(()=>{"use strict";var e={5338(e,s,t){var o=t(5795);s.H=o.createRoot,o.hydrateRoot},5795(e){e.exports=window.ReactDOM}},s={};const t=window.wp.element,o=window.ReactJSXRuntime,n=({targetDate:e=new Date,showLabels:s=!0,labels:n={years:"Years",months:"Months",weeks:"Weeks",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds"},itemsVisibility:a={years:!1,months:!1,weeks:!1,days:!0,hours:!0,minutes:!0,seconds:!0},onEnd:r=null})=>{const d=e=>e.toString().padStart(2,"0"),u=()=>{const s=+new Date(e)-+new Date;let t={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0};return s>0&&(t={years:Math.floor(s/31536e6),months:Math.floor(s%31536e6/2592e6),weeks:Math.floor(s%2592e6/6048e5),days:Math.floor(s%6048e5/864e5),hours:Math.floor(s%864e5/36e5),minutes:Math.floor(s%36e5/6e4),seconds:Math.floor(s%6e4/1e3)},!a?.years&&t.years&&(t.months+=12*t.years,t.years=0),!a?.months&&t.months&&(t.weeks+=4*t.months,t.months=0),!a?.weeks&&t.weeks&&(t.days+=7*t.weeks,t.weeks=0),!a?.days&&t.days&&(t.hours+=24*t.days,t.days=0),!a?.hours&&t.hours&&(t.minutes+=60*t.hours,t.hours=0),!a?.minutes&&t.minutes&&(t.seconds+=60*t.minutes,t.minutes=0)),t.years=d(t.years),t.months=d(t.months),t.weeks=d(t.weeks),t.days=d(t.days),t.hours=d(t.hours),t.minutes=d(t.minutes),t.seconds=d(t.seconds),t},[i,l]=(0,t.useState)(u());(0,t.useEffect)(()=>{const e=setTimeout(()=>{l(u())},1e3);return()=>clearTimeout(e)});const c=(e,t)=>(0,o.jsxs)("div",{className:"zolo-countdown-item",children:[(0,o.jsx)("div",{className:"zolo-countdown-face",children:t}),s&&(0,o.jsx)("div",{className:"zolo-countdown-label",children:e})]});return(0,o.jsxs)(o.Fragment,{children:[a?.years&&c(n?.years,i.years),a?.months&&c(n?.months,i.months),a?.weeks&&c(n?.weeks,i.weeks),a?.days&&c(n?.days,i.days),a?.hours&&c(n?.hours,i.hours),a?.minutes&&c(n?.minutes,i.minutes),a?.seconds&&c(n?.seconds,i.seconds)]})};var a=function t(o){var n=s[o];if(void 0!==n)return n.exports;var a=s[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(5338);document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll(".wp-block-zolo-countdown");e.length>0&&e.forEach(e=>{const s=e.querySelector(".zolo-countdown-wrap");let t=s.dataset.countdate;const r=JSON.parse(s.dataset.itemsvisibility),d=JSON.parse(s.dataset.itemslabels),u=s.dataset.togglelabels,i=new Date(t);(0,a.H)(s).render((0,o.jsx)(n,{targetDate:i,itemsVisibility:r,showLabels:u,labels:d}))})})})();