/*! grapesjs-component-countdown - 1.0.2 */ !function(n,t){'object'==typeof exports&&'object'==typeof module?module.exports=t():'function'==typeof define&&define.amd?define([],t):'object'==typeof exports?exports["grapesjs-component-countdown"]=t():n["grapesjs-component-countdown"]=t()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{"use strict";var n={d:(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(n,t)=>Object.prototype.hasOwnProperty.call(n,t),r:n=>{'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(n,'__esModule',{value:!0})}},t={};n.r(t),n.d(t,{default:()=>o});var e=void 0&&(void 0).__assign||function(){return e=Object.assign||function(n){for(var t,e=1,o=arguments.length;e\n \n ",label:l,category:'Extra',select:!0,content:{type:s}},a));n.Components.addType(s,{model:{defaults:e({startfrom:o.startTime,classes:[i],endText:o.endText,droppable:!1,script:function(n){var t=n.startfrom,e=n.endText,o=this,a=new Date(t).getTime(),c=o.querySelector('[data-js=countdown]'),d=o.querySelector('[data-js=countdown-endtext]'),s=o.querySelector('[data-js=countdown-day]'),l=o.querySelector('[data-js=countdown-hour]'),i=o.querySelector('[data-js=countdown-minute]'),r=o.querySelector('[data-js=countdown-second]'),u=o.__gjsCountdownInterval;u&&clearInterval(u);var p=window.__gjsCountdownIntervals||[],v=[];p.forEach((function(n){n.isConnected||(clearInterval(n.__gjsCountdownInterval),v.push(n))})),p.indexOf(o)<0&&p.push(o),window.__gjsCountdownIntervals=p.filter((function(n){return v.indexOf(n)<0}));var y=function(n,t,e,o){s.innerHTML="".concat(n<10?'0'+n:n),l.innerHTML="".concat(t<10?'0'+t:t),i.innerHTML="".concat(e<10?'0'+e:e),r.innerHTML="".concat(o<10?'0'+o:o)},f=function(){var n=(new Date).getTime(),t=a-n,s=Math.floor(t/864e5),l=Math.floor(t%864e5/36e5),i=Math.floor(t%36e5/6e4),r=Math.floor(t%6e4/1e3);y(s,l,i,r),t<0&&(clearInterval(o.__gjsCountdownInterval),d.innerHTML=e,c.style.display='none',d.style.display='')};a?(o.__gjsCountdownInterval=setInterval(f,1e3),d.style.display='none',c.style.display='',f()):y(0,0,0,0)},'script-props':['startfrom','endText'],traits:[{label:'Start',name:'startfrom',changeProp:!0,type:o.dateInputType},{label:'End text',name:'endText',changeProp:!0}],components:"\n \n
\n
\n
").concat(o.labelDays,"
\n
\n
\n
\n
").concat(o.labelHours,"
\n
\n
\n
\n
").concat(o.labelMinutes,"
\n
\n
\n
\n
").concat(o.labelSeconds,"
\n
\n
\n \n "),styles:(d||"\n .".concat(i," {\n text-align: center;\n }\n\n .").concat(i,"-block {\n display: inline-block;\n margin: 0 10px;\n padding: 10px;\n }\n\n .").concat(i,"-digit {\n font-size: 5rem;\n }\n\n .").concat(i,"-endtext {\n font-size: 5rem;\n }\n\n .").concat(i,"-cont {\n display: inline-block;\n }\n "))+o.styleAdditional},c)}})};return t})())); //# sourceMappingURL=index.js.map