{"version":3,"sources":["webpack:///./Scripts/Components/Counter.js"],"names":["window","addEventListener","event","document","querySelectorAll","forEach","counterTimerEl","daysDiv","querySelector","hoursDiv","minutesDiv","secondsDiv","startDate","getAttribute","hours","minutes","seconds","startDateObj","Date","setHours","setMinutes","setSeconds","formattedDate","toLocaleDateString","month","day","year","hour","minute","second","countDownDate","getTime","x","setInterval","now","distance","days","Math","floor","toString","padStart","innerHTML","clearInterval"],"mappings":"iEAmDAA,OAAOC,iBAAiB,QAASC,IAlDNC,SAASC,iBAAiB,iBAClCC,SAASC,IACpB,MAAMC,EAAUD,EAAeE,cAAc,sBACvCC,EAAWH,EAAeE,cAAc,uBACxCE,EAAaJ,EAAeE,cAAc,yBAC1CG,EAAaL,EAAeE,cAAc,yBAEhD,KAAKD,GAAYE,GAAaC,GAAeC,GACzC,OAGJ,MAAMC,EAAYN,EAAeO,aAAa,kBACxCC,GAASR,EAAeO,aAAa,sBAAwB,EAC7DE,EAAUT,EAAeO,aAAa,wBACtCG,EAAUV,EAAeO,aAAa,wBAE5C,KAAKD,GAAcE,GAAUC,GAAYC,GACrC,OAGJ,MAAMC,EAAe,IAAIC,KAAKN,GAC9BK,EAAaE,SAASL,GACtBG,EAAaG,WAAWL,GACxBE,EAAaI,WAAWL,GACxB,MACMM,EAAgBL,EAAaM,mBAAmB,QADtC,CAAEC,MAAO,QAASC,IAAK,UAAWC,KAAM,UAAWC,KAAM,UAAWC,OAAQ,UAAWC,OAAQ,YAEzGC,EAAgB,IAAIZ,KAAKI,GAAeS,UAC9C,IAAIC,EAAIC,aAAY,WAChB,IAAIC,GAAM,IAAIhB,MAAOa,UACjBI,EAAWL,EAAgBI,EAC3BE,EAAOC,KAAKC,MAAMH,EAAW,OAAuBI,WAAWC,SAAS,EAAG,KAC3E1B,EAAQuB,KAAKC,MAAOH,EAAW,MAAqB,MAAsBI,WAAWC,SAAS,EAAG,KACjGzB,EAAUsB,KAAKC,MAAOH,EAAW,KAAgB,KAAiBI,WAAWC,SAAS,EAAG,KACzFxB,EAAUqB,KAAKC,MAAOH,EAAW,IAAe,KAAMI,WAAWC,SAAS,EAAG,KACjFjC,EAAQkC,UAAYL,EACpB3B,EAASgC,UAAY3B,EACrBJ,EAAW+B,UAAY1B,EACvBJ,EAAW8B,UAAYzB,EAEnBmB,EAAW,IACXO,cAAcV,GACdzB,EAAQkC,UAAY,KACpBhC,EAASgC,UAAY,KACrB/B,EAAW+B,UAAY,KACvB9B,EAAW8B,UAAY,KAE/B,GAAG,EAAE,GAKgB,G","file":"676.3aa6c2656ca1d4fd4009.js","sourcesContent":["function initializeCounterTimers() {\r\n const counterTimerEl = document.querySelectorAll(\".counterTimer\");\r\n counterTimerEl.forEach((counterTimerEl) => {\r\n const daysDiv = counterTimerEl.querySelector(\".counterTimer-days\");\r\n const hoursDiv = counterTimerEl.querySelector(\".counterTimer-hours\");\r\n const minutesDiv = counterTimerEl.querySelector(\".counterTimer-minutes\");\r\n const secondsDiv = counterTimerEl.querySelector(\".counterTimer-seconds\");\r\n\r\n if (!daysDiv || !hoursDiv || !minutesDiv || !secondsDiv) {\r\n return;\r\n }\r\n\r\n const startDate = counterTimerEl.getAttribute(\"data-startDate\");\r\n const hours = +counterTimerEl.getAttribute(\"data-startDateHour\") + 2;\r\n const minutes = counterTimerEl.getAttribute(\"data-startDateMinute\");\r\n const seconds = counterTimerEl.getAttribute(\"data-startDateSecond\");\r\n\r\n if (!startDate || !hours || !minutes || !seconds) {\r\n return;\r\n }\r\n\r\n const startDateObj = new Date(startDate);\r\n startDateObj.setHours(hours);\r\n startDateObj.setMinutes(minutes);\r\n startDateObj.setSeconds(seconds);\r\n const options = { month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' };\r\n const formattedDate = startDateObj.toLocaleDateString('en-US', options);\r\n const countDownDate = new Date(formattedDate).getTime();\r\n let x = setInterval(function () {\r\n let now = new Date().getTime();\r\n let distance = countDownDate - now;\r\n let days = Math.floor(distance / (1000 * 60 * 60 * 24)).toString().padStart(2, '0');\r\n let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)).toString().padStart(2, '0');\r\n let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)).toString().padStart(2, '0');\r\n let seconds = Math.floor((distance % (1000 * 60)) / 1000).toString().padStart(2, '0');\r\n daysDiv.innerHTML = days;\r\n hoursDiv.innerHTML = hours;\r\n minutesDiv.innerHTML = minutes;\r\n secondsDiv.innerHTML = seconds;\r\n\r\n if (distance < 0) {\r\n clearInterval(x);\r\n daysDiv.innerHTML = \"00\";\r\n hoursDiv.innerHTML = \"00\";\r\n minutesDiv.innerHTML = \"00\";\r\n secondsDiv.innerHTML = \"00\";\r\n }\r\n }, 0);\r\n });\r\n}\r\n\r\nwindow.addEventListener(\"load\", (event) => {\r\n initializeCounterTimers();\r\n});\r\n"],"sourceRoot":""}