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KM,WACjBC,aAAcP,KAAKO,aACnBC,aAAcR,KAAKQ,aACnBd,kBAAmBM,KAAKN,oBAGhCM,KAAKyB,WACT,EAMAW,QACSpC,KAAKR,WAGVQ,KAAKqB,QACLrB,KAAKR,UAAW,EACZQ,KAAKtB,YAKLsB,KAAKuB,MAAMzD,GAEnB,EAMAoE,MACSlC,KAAKR,WAGVQ,KAAKqB,QACLrB,KAAKN,kBAAoB,EACzBM,KAAKR,UAAW,EACZQ,KAAKtB,YAKLsB,KAAKuB,MAAMxD,GAEnB,EAKAsE,SACQrC,KAAKR,WACLQ,KAAKN,kBAAoBI,KAAKwC,IAAI,EAAGtC,KAAKP,QAAUO,KAAKjB,OAEjE,EAKAwD,UACIvC,KAAKqB,QACLrB,KAAKN,kBAAoBM,KAAKZ,KAC9BY,KAAKP,QAAUO,KAAKjB,MAAQiB,KAAKZ,KACjCY,KAAKR,UAAW,EAChBQ,KAAKc,OACT,EAKAI,yBACI,OAAQF,SAASQ,iBACb,IAAK,UACDxB,KAAKqC,SACLrC,KAAKyB,WACL,MACJ,IAAK,SACDzB,KAAKqB,QACL,MAEZ,GAEJmB,SACI,OAAO,IAAAC,GAAEzC,KAAKd,IAAKc,KAAK0C,OAAOjE,QAAU,CACrCuB,KAAK0C,OAAOjE,QAAQuB,KAAKX,UAAU,CAC/BQ,KAAMG,KAAKH,KACXI,MAAOD,KAAKC,MACZC,QAASF,KAAKE,QACdC,QAASH,KAAKG,QACdC,aAAcJ,KAAKI,aACnBC,UAAWL,KAAKK,UAChBC,WAAYN,KAAKM,WACjBC,aAAcP,KAAKO,aACnBC,aAAcR,KAAKQ,aACnBd,kBAAmBM,KAAKN,2BAE5BiD,EACR,G","sources":["webpack://kkpam_www/./node_modules/@chenfengyuan/vue-countdown/dist/vue-countdown.esm.js"],"sourcesContent":["/*! vue-countdown v2.1.0 | (c) 2018-present Chen Fengyuan | MIT */\nimport { defineComponent, h } from 'vue';\n\nconst MILLISECONDS_SECOND = 1000;\r\nconst MILLISECONDS_MINUTE = 60 * MILLISECONDS_SECOND;\r\nconst MILLISECONDS_HOUR = 60 * MILLISECONDS_MINUTE;\r\nconst MILLISECONDS_DAY = 24 * MILLISECONDS_HOUR;\r\nconst EVENT_ABORT = 'abort';\r\nconst EVENT_END = 'end';\r\nconst EVENT_PROGRESS = 'progress';\r\nconst EVENT_START = 'start';\r\nconst EVENT_VISIBILITY_CHANGE = 'visibilitychange';\r\nvar index = defineComponent({\r\n name: 'VueCountdown',\r\n props: {\r\n /**\r\n * Starts the countdown automatically when initialized.\r\n */\r\n autoStart: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n /**\r\n * Emits the countdown events.\r\n */\r\n emitEvents: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n /**\r\n * The interval time (in milliseconds) of the countdown progress.\r\n */\r\n interval: {\r\n type: Number,\r\n default: 1000,\r\n validator: (value) => value >= 0,\r\n },\r\n /**\r\n * Generate the current time of a specific time zone.\r\n */\r\n now: {\r\n type: Function,\r\n default: () => Date.now(),\r\n },\r\n /**\r\n * The tag name of the component's root element.\r\n */\r\n tag: {\r\n type: String,\r\n default: 'span',\r\n },\r\n /**\r\n * The time (in milliseconds) to count down from.\r\n */\r\n time: {\r\n type: Number,\r\n default: 0,\r\n validator: (value) => value >= 0,\r\n },\r\n /**\r\n * Transforms the output props before render.\r\n */\r\n transform: {\r\n type: Function,\r\n default: (props) => props,\r\n },\r\n },\r\n emits: [\r\n EVENT_ABORT,\r\n EVENT_END,\r\n EVENT_PROGRESS,\r\n EVENT_START,\r\n ],\r\n data() {\r\n return {\r\n /**\r\n * It is counting down.\r\n * @type {boolean}\r\n */\r\n counting: false,\r\n /**\r\n * The absolute end time.\r\n * @type {number}\r\n */\r\n endTime: 0,\r\n /**\r\n * The remaining milliseconds.\r\n * @type {number}\r\n */\r\n totalMilliseconds: 0,\r\n /**\r\n * The request ID of the requestAnimationFrame.\r\n * @type {number}\r\n */\r\n requestId: 0,\r\n };\r\n },\r\n computed: {\r\n /**\r\n * Remaining days.\r\n * @returns {number} The computed value.\r\n */\r\n days() {\r\n return Math.floor(this.totalMilliseconds / MILLISECONDS_DAY);\r\n },\r\n /**\r\n * Remaining hours.\r\n * @returns {number} The computed value.\r\n */\r\n hours() {\r\n return Math.floor((this.totalMilliseconds % MILLISECONDS_DAY) / MILLISECONDS_HOUR);\r\n },\r\n /**\r\n * Remaining minutes.\r\n * @returns {number} The computed value.\r\n */\r\n minutes() {\r\n return Math.floor((this.totalMilliseconds % MILLISECONDS_HOUR) / MILLISECONDS_MINUTE);\r\n },\r\n /**\r\n * Remaining seconds.\r\n * @returns {number} The computed value.\r\n */\r\n seconds() {\r\n return Math.floor((this.totalMilliseconds % MILLISECONDS_MINUTE) / MILLISECONDS_SECOND);\r\n },\r\n /**\r\n * Remaining milliseconds.\r\n * @returns {number} The computed value.\r\n */\r\n milliseconds() {\r\n return Math.floor(this.totalMilliseconds % MILLISECONDS_SECOND);\r\n },\r\n /**\r\n * Total remaining days.\r\n * @returns {number} The computed value.\r\n */\r\n totalDays() {\r\n return this.days;\r\n },\r\n /**\r\n * Total remaining hours.\r\n * @returns {number} The computed value.\r\n */\r\n totalHours() {\r\n return Math.floor(this.totalMilliseconds / MILLISECONDS_HOUR);\r\n },\r\n /**\r\n * Total remaining minutes.\r\n * @returns {number} The computed value.\r\n */\r\n totalMinutes() {\r\n return Math.floor(this.totalMilliseconds / MILLISECONDS_MINUTE);\r\n },\r\n /**\r\n * Total remaining seconds.\r\n * @returns {number} The computed value.\r\n */\r\n totalSeconds() {\r\n return Math.floor(this.totalMilliseconds / MILLISECONDS_SECOND);\r\n },\r\n },\r\n watch: {\r\n $props: {\r\n deep: true,\r\n immediate: true,\r\n /**\r\n * Update the countdown when props changed.\r\n */\r\n handler() {\r\n this.totalMilliseconds = this.time;\r\n this.endTime = this.now() + this.time;\r\n if (this.autoStart) {\r\n this.start();\r\n }\r\n },\r\n },\r\n },\r\n mounted() {\r\n document.addEventListener(EVENT_VISIBILITY_CHANGE, this.handleVisibilityChange);\r\n },\r\n beforeUnmount() {\r\n document.removeEventListener(EVENT_VISIBILITY_CHANGE, this.handleVisibilityChange);\r\n this.pause();\r\n },\r\n methods: {\r\n /**\r\n * Starts to countdown.\r\n * @public\r\n * @emits Countdown#start\r\n */\r\n start() {\r\n if (this.counting) {\r\n return;\r\n }\r\n this.counting = true;\r\n if (this.emitEvents) {\r\n /**\r\n * Countdown start event.\r\n * @event Countdown#start\r\n */\r\n this.$emit(EVENT_START);\r\n }\r\n if (document.visibilityState === 'visible') {\r\n this.continue();\r\n }\r\n },\r\n /**\r\n * Continues the countdown.\r\n * @private\r\n */\r\n continue() {\r\n if (!this.counting) {\r\n return;\r\n }\r\n const delay = Math.min(this.totalMilliseconds, this.interval);\r\n if (delay > 0) {\r\n let init;\r\n let prev;\r\n const step = (now) => {\r\n if (!init) {\r\n init = now;\r\n }\r\n if (!prev) {\r\n prev = now;\r\n }\r\n const range = now - init;\r\n if (range >= delay\r\n // Avoid losing time about one second per minute (now - prev ≈ 16ms) (#43)\r\n || range + ((now - prev) / 2) >= delay) {\r\n this.progress();\r\n }\r\n else {\r\n this.requestId = requestAnimationFrame(step);\r\n }\r\n prev = now;\r\n };\r\n this.requestId = requestAnimationFrame(step);\r\n }\r\n else {\r\n this.end();\r\n }\r\n },\r\n /**\r\n * Pauses the countdown.\r\n * @private\r\n */\r\n pause() {\r\n cancelAnimationFrame(this.requestId);\r\n },\r\n /**\r\n * Progresses to countdown.\r\n * @private\r\n * @emits Countdown#progress\r\n */\r\n progress() {\r\n if (!this.counting) {\r\n return;\r\n }\r\n this.totalMilliseconds -= this.interval;\r\n if (this.emitEvents && this.totalMilliseconds > 0) {\r\n /**\r\n * Countdown progress event.\r\n * @event Countdown#progress\r\n */\r\n this.$emit(EVENT_PROGRESS, {\r\n days: this.days,\r\n hours: this.hours,\r\n minutes: this.minutes,\r\n seconds: this.seconds,\r\n milliseconds: this.milliseconds,\r\n totalDays: this.totalDays,\r\n totalHours: this.totalHours,\r\n totalMinutes: this.totalMinutes,\r\n totalSeconds: this.totalSeconds,\r\n totalMilliseconds: this.totalMilliseconds,\r\n });\r\n }\r\n this.continue();\r\n },\r\n /**\r\n * Aborts the countdown.\r\n * @public\r\n * @emits Countdown#abort\r\n */\r\n abort() {\r\n if (!this.counting) {\r\n return;\r\n }\r\n this.pause();\r\n this.counting = false;\r\n if (this.emitEvents) {\r\n /**\r\n * Countdown abort event.\r\n * @event Countdown#abort\r\n */\r\n this.$emit(EVENT_ABORT);\r\n }\r\n },\r\n /**\r\n * Ends the countdown.\r\n * @public\r\n * @emits Countdown#end\r\n */\r\n end() {\r\n if (!this.counting) {\r\n return;\r\n }\r\n this.pause();\r\n this.totalMilliseconds = 0;\r\n this.counting = false;\r\n if (this.emitEvents) {\r\n /**\r\n * Countdown end event.\r\n * @event Countdown#end\r\n */\r\n this.$emit(EVENT_END);\r\n }\r\n },\r\n /**\r\n * Updates the count.\r\n * @private\r\n */\r\n update() {\r\n if (this.counting) {\r\n this.totalMilliseconds = Math.max(0, this.endTime - this.now());\r\n }\r\n },\r\n /**\r\n * Restarts the count.\r\n * @public\r\n */\r\n restart() {\r\n this.pause();\r\n this.totalMilliseconds = this.time;\r\n this.endTime = this.now() + this.time;\r\n this.counting = false;\r\n this.start();\r\n },\r\n /**\r\n * visibility change event handler.\r\n * @private\r\n */\r\n handleVisibilityChange() {\r\n switch (document.visibilityState) {\r\n case 'visible':\r\n this.update();\r\n this.continue();\r\n break;\r\n case 'hidden':\r\n this.pause();\r\n break;\r\n }\r\n },\r\n },\r\n render() {\r\n return h(this.tag, this.$slots.default ? [\r\n this.$slots.default(this.transform({\r\n days: this.days,\r\n hours: this.hours,\r\n minutes: this.minutes,\r\n seconds: this.seconds,\r\n milliseconds: this.milliseconds,\r\n totalDays: this.totalDays,\r\n totalHours: this.totalHours,\r\n totalMinutes: this.totalMinutes,\r\n totalSeconds: this.totalSeconds,\r\n totalMilliseconds: this.totalMilliseconds,\r\n })),\r\n ] : undefined);\r\n },\r\n});\n\nexport { index as default };\n"],"names":["MILLISECONDS_SECOND","MILLISECONDS_MINUTE","MILLISECONDS_HOUR","MILLISECONDS_DAY","EVENT_ABORT","EVENT_END","EVENT_PROGRESS","EVENT_START","EVENT_VISIBILITY_CHANGE","index","name","props","autoStart","type","Boolean","default","emitEvents","interval","Number","validator","value","now","Function","Date","tag","String","time","transform","emits","data","counting","endTime","totalMilliseconds","requestId","computed","days","Math","floor","this","hours","minutes","seconds","milliseconds","totalDays","totalHours","totalMinutes","totalSeconds","watch","$props","deep","immediate","handler","start","mounted","document","addEventListener","handleVisibilityChange","beforeUnmount","removeEventListener","pause","methods","$emit","visibilityState","continue","delay","min","init","prev","step","range","progress","requestAnimationFrame","end","cancelAnimationFrame","abort","update","max","restart","render","h","$slots","undefined"],"sourceRoot":""}