"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[1550],{11550:(t,e,n)=>{n.r(e),n.d(e,{geniallyCountdownToDateEditorScript:()=>c});var o=n(53289),s=n(79883),i=n(73267),r=n(2173);const c=t=>{let{script:e,editor:n}=t;n.justCreated&&!e.getConfig().disableDefaultTimer&&e.mutateConfig((t=>{t.targetDate.date=(0,r.S)(new Date(Date.now()+i.U+(0,s.di)()))}));const c=()=>e.getConfig().textItemRef;e.on("configChange",(t=>{let{config:n,prevConfig:r}=t;const u=null===r||void 0===r?void 0:r.textItemRef,a=c(),l=e.getConfig().plusItemRef;if(l&&(l.opacity=0),u&&(u.textEditable=!0),a){a.textEditable=!1;const t=n.targetDate;let e=Math.max(t.getTime()-Date.now(),0);if(e>i.G){const t=e-Math.trunc(e/i.U)*i.U;e=99*i.U+t,l&&(l.opacity=1)}else l&&(l.opacity=0);const r=(0,s.EJ)(e),c=(0,o.D)(a.text);a.text=(0,o.x)(r,c)}})),e.on("dispose",(()=>{const t=c();t&&(t.textEditable=!0)}))}},2173:(t,e,n)=>{function o(t){return t.toISOString().substring(0,19)}n.d(e,{S:()=>o})},53289:(t,e,n)=>{function o(t){if(t.nodeType===Node.TEXT_NODE&&t.textContent&&""!==t.textContent.trim())return t;if(t.hasChildNodes())for(let e=0;e<t.childNodes.length;e+=1){const n=o(t.childNodes[e]);if(n)return n}return null}function s(t){const e=document.createElement("div");e.innerHTML=t;const n=o(e);return n?function(t){let e="",n=t;for(;n;)n instanceof HTMLElement&&n.style.cssText&&(e=n.style.cssText+e),n=n.parentElement;return e}(n):""}function i(t,e){const n=document.createElement("span");return n.setAttribute("style",e),n.textContent=t.replace(/^\s+/g,(t=>"\xa0".repeat(t.length))).replace(/\s+$/g,(t=>"\xa0".repeat(t.length))),n.outerHTML}n.d(e,{D:()=>s,x:()=>i})},79883:(t,e,n)=>{n.d(e,{EJ:()=>c,AF:()=>r,di:()=>u});const o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return t.toString().padStart(e,"0")};function s(t){const e=Math.floor(t/1e3);return{seconds:e%60,minutes:Math.floor(e/60)}}function i(t){const e=function(t){const e=s(t);return{seconds:e.seconds,minutes:e.minutes%60,hours:Math.floor(e.minutes/60)}}(t);return{seconds:e.seconds,minutes:e.minutes,hours:e.hours%24,days:Math.floor(e.hours/24)}}function r(t){const e=s(t);return`${o(e.minutes)}:${o(e.seconds)}`}function c(t){const e=i(t);return`${o(e.days,2)}:${o(e.hours)}:${o(e.minutes)}:${o(e.seconds)}`}function u(){const t=new Date,e=t.getTime();return e-(e+6e4*t.getTimezoneOffset())}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/1550.ba6e6bb0.chunk.js.map