function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}var WidgetCount=(()=>_createClass(function e(t,n){_classCallCheck(this,e),this.dateFinal=new Date(t+" "+n)},[{key:"timeInterval",value:function(){var e=this,n=setInterval(function(){e.setTime()},1e3),o=setInterval(function(){var e=document.getElementById("countContainer"),t=document.getElementsByClassName("screenMultiple")[0];null==e&&null==t&&(clearInterval(n),clearInterval(o),sessionStorage.setItem("IsIntervalWidgetCountLaunch","false"))},5e3);return n}},{key:"buildTemplate",value:function(e,t){var n=document.getElementById("countContainer"),o=document.getElementsByClassName("screenMultiple")[0],n=(null!=n&&!o||"true"===sessionStorage.getItem("IsIntervalWidgetCountLaunch")||(this.timeInterval(),sessionStorage.setItem("IsIntervalWidgetCountLaunch","true")),$("#widgetTemplate").clone()),o=$("<div>"),t=(o.attr("id","countContainer").css("text-align","center").css("display","flex").css("justify-content","space-around").css("align-items","center").css("width","90%").css("flex-wrap","wrap"),0<e.background.length&&n.attr("style","background-image:url(".concat(t.instanceMethodType.pathMedia+e.background,")")),$("<div>")),e=$("<div>"),r=$("<div>"),i=$("<div>"),a=(t.attr("id","countJours").attr("class","widgetCountDiv"),e.attr("id","countHeures").attr("class","widgetCountDiv"),r.attr("id","countMinutes").attr("class","widgetCountDiv"),i.attr("id","countSecondes").attr("class","widgetCountDiv"),$("<p>")),s=$("<p>"),u=$("<p>"),c=$("<p>"),l=(a.attr("id","countNbJours").css("font-size","5vw"),s.attr("id","countNbHeures").css("font-size","5vw"),u.attr("id","countNbMinutes").css("font-size","5vw"),c.attr("id","countNbSecondes").css("font-size","5vw"),$("<p>")),p=$("<p>"),d=$("<p>"),f=$("<p>");return l.text("jours").css("font-size","2vw"),p.text("heures").css("font-size","2vw"),d.text("minutes").css("font-size","2vw"),f.text("secondes").css("font-size","2vw"),t.append(a),e.append(s),r.append(u),i.append(c),t.append(l),e.append(p),r.append(d),i.append(f),t.appendTo(o),e.appendTo(o),r.appendTo(o),i.appendTo(o),o.appendTo(n),this.setTime(),n}},{key:"remainingTime",value:function(){var e=new Date,e=this.dateFinal-e;return[Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]}},{key:"setTime",value:function(){var e=$("#countNbJours"),t=$("#countNbHeures"),n=$("#countNbMinutes"),o=$("#countNbSecondes"),r=this.remainingTime();e.text(r[0]),t.text(r[1]),n.text(r[2]),o.text(r[3])}}]))();