JezK
Edit File: sc-upsell-countdown-timer.cjs.entry.js.map
{"file":"sc-upsell-countdown-timer.entry.cjs.js","mappings":";;;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,smBAAsmB,CAAC;AACzoB,qCAAe,yBAAyB;;MCU3B,sBAAsB;;;6BAEA,QAAQ;;wBAMb,IAAI;;IAEhC,gBAAgB;QACd,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;IAED,eAAe;QACb,IAAI,CAAC,aAAa,GAAGA,iCAAyB,EAAE,CAAC;QACjD,WAAW,CAAC;YACV,IAAI,CAAC,aAAa,GAAGA,iCAAyB,EAAE,CAAC;SAClD,EAAE,IAAI,CAAC,CAAC;KACV;IAED,MAAM;QACJ,QACEC,QAACC,UAAI,qDACH,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE;gBACL,2BAA2B,EAAE,IAAI;aAClC,IAEA,IAAI,CAAC,QAAQ,IAAID,sEAAS,IAAI,EAAC,OAAO,GAAG,EAC1CA,qEACEA,mEAAM,IAAI,EAAC,mBAAmB,GAAG,OAACA,uEAAS,IAAI,CAAC,aAAa,CAAU,CAClE,CACF,EACP;KACH;;;;;;","names":["getFormattedRemainingTime","h","Host"],"sources":["src/components/controllers/upsell/sc-upsell-countdown-timer/sc-upsell-countdown-timer.css?tag=sc-upsell-countdown-timer&encapsulation=shadow","src/components/controllers/upsell/sc-upsell-countdown-timer/sc-upsell-countdown-timer.tsx"],"sourcesContent":[":host {\n display: flex;\n justify-content: var(--sc-upsell-countdown-timer-justify-content, center);\n align-items: var(--sc-upsell-countdown-timer-align-items, center);\n text-align: var(--sc-upsell-countdown-timer-text-align, center);\n flex-wrap: wrap;\n gap: var(--sc-upsell-countdown-timer-gap, 0.5em);\n line-height: 1;\n padding: var(--sc-upsell-countdown-timer-padding, var(--sc-spacing-medium));\n border-radius: var(--sc-upsell-countdown-timer-border-radius, var(--sc-border-radius-pill));\n background-color: var(--sc-upsell-countdown-timer-background-color, rgb(226, 249, 235));\n color: var(--sc-upsell-countdown-timer-color, rgb(71, 91, 80));\n}\n","/**\n * External dependencies.\n */\nimport { Component, Host, Prop, h, State } from '@stencil/core';\nimport { getFormattedRemainingTime } from '@store/upsell/getters';\n\n@Component({\n tag: 'sc-upsell-countdown-timer',\n styleUrl: 'sc-upsell-countdown-timer.css',\n shadow: true,\n})\nexport class ScUpsellCountdownTimer {\n /** The time remaining in seconds. */\n @State() timeRemaining: number = Infinity; // Initial time is many, would be updated later.\n\n /** The formatted time remaining. */\n @State() formattedTime: string;\n\n /** Whether to show the icon. */\n @Prop() showIcon: boolean = true;\n\n componentDidLoad() {\n this.updateCountdown();\n }\n\n updateCountdown() {\n this.formattedTime = getFormattedRemainingTime();\n setInterval(() => {\n this.formattedTime = getFormattedRemainingTime();\n }, 1000);\n }\n\n render() {\n return (\n <Host\n role=\"timer\"\n class={{\n 'sc-upsell-countdown-timer': true,\n }}\n >\n {this.showIcon && <sc-icon name=\"clock\" />}\n <span>\n <slot name=\"offer-expire-text\" /> <strong>{this.formattedTime}</strong>\n </span>\n </Host>\n );\n }\n}\n"],"version":3}