document.addEventListener("DOMContentLoaded",function(){const e=document.querySelectorAll(".wp-block-axvart-live-clock-date");e.length&&e.forEach(e=>{const t=e.dataset.displayMode||"both",o=e.dataset.timeFormat||"12",n=e.dataset.dateFormat||"long",a=e.dataset.timezone||"browser",r=e.dataset.customTimezone||"UTC",i=e.dataset.separator||"colon",c="true"===e.dataset.showSeconds,d="true"===e.dataset.showWeekday,s="true"===e.dataset.blinkingSeparator,l=e.querySelector(".clock-time"),m=e.querySelector(".clock-date");function u(){const e=new Date;if(l&&("time"===t||"both"===t)){const t={hour:"2-digit",minute:"2-digit",...c&&{second:"2-digit"},hour12:"12"===o,timeZone:"browser"===a?void 0:r};let n=e.toLocaleTimeString("en-US",t);if(s){const e="dot"===i?"·":":",t=n.split(":");l.innerHTML=t.map((o,n)=>n<t.length-1?o+'<span class="clock-separator">'+e+"</span>":o).join("")}else"dot"===i&&(n=n.replace(/:/g,"·")),l.textContent=n}if(m&&("date"===t||"both"===t)){const t={timeZone:"browser"===a?void 0:r};let o;o="long"===n?e.toLocaleDateString("en-US",{...t,weekday:d?"long":void 0,year:"numeric",month:"long",day:"numeric"}):"short"===n?e.toLocaleDateString("en-US",{...t,year:"numeric",month:"short",day:"numeric"}):"numeric"===n?e.toLocaleDateString("en-US",{...t,year:"numeric",month:"2-digit",day:"2-digit"}):e.toLocaleDateString("en-US",t),m.textContent=o}}u();const g=setInterval(u,1e3);window.addEventListener("beforeunload",function(){clearInterval(g)})})});