"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[2641],{2641:(t,e,n)=>{n.r(e),n.d(e,{geniallyCountdownEditorScript:()=>i});var o=n(53289),s=n(79883);const i=t=>{let{script:e}=t;const n=()=>e.getConfig().textItemRef;e.on("configChange",(t=>{let{config:e,prevConfig:i}=t;const r=null===i||void 0===i?void 0:i.textItemRef,c=n();if(r&&(r.textEditable=!0),c){c.textEditable=!1;const t=(0,o.D)(c.text),n=e.initialTime.milliseconds;c.text=(0,o.x)((0,s.AF)(n),t)}})),e.on("dispose",(()=>{const t=n();t&&(t.textEditable=!0)})),e.setApi({setTime(t,e){const i=n();if(!i)return;const r=(0,o.D)(i.text),c=60*t*1e3+1e3*e;i.text=(0,o.x)((0,s.AF)(c),r)}})}},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/2641.451d84ad.chunk.js.map