@abtasty/countdown
Advanced tools
Comparing version 3.5.2-0 to 3.5.2
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e(function(t){function e(t,e,n,o,i,s,r){try{var a=t[s](r),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(o,i)}t.exports=function(t){return function(){var n=this,o=arguments;return new Promise(function(i,s){var r=t.apply(n,o);function a(t){e(r,i,s,a,c,"next",t)}function c(t){e(r,i,s,a,c,"throw",t)}a(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports}),o=t(n),i=e(function(t){var e=function(t){var e,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",r=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),r=new k(o||[]);return s._invoke=function(t,e,n){var o=u;return function(i,s){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw s;return L()}for(n.method=i,n.arg=s;;){var r=n.delegate;if(r){var a=$(r,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===u)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=d(t,e,n);if("normal"===c.type){if(o=n.done?g:h,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}(t,n,r),s}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var u="suspendedStart",h="suspendedYield",m="executing",g="completed",p={};function y(){}function b(){}function w(){}var f={};c(f,s,function(){return this});var v=Object.getPrototypeOf,x=v&&v(v(_([])));x&&x!==n&&o.call(x,s)&&(f=x);var T=w.prototype=y.prototype=Object.create(f);function S(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function C(t,e){function n(i,s,r,a){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&o.call(u,"__await")?e.resolve(u.__await).then(function(t){n("next",t,r,a)},function(t){n("throw",t,r,a)}):e.resolve(u).then(function(t){l.value=t,r(l)},function(t){return n("throw",t,r,a)})}a(c.arg)}var i;this._invoke=function(t,o){function s(){return new e(function(e,i){n(t,o,e,i)})}return i=i?i.then(s,s):s()}}function $(t,n){var o=t.iterator[n.method];if(o===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,$(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var s=i.arg;return s?s.done?(n[t.resultName]=s.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function _(t){if(t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,r=function n(){for(;++i<t.length;)if(o.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return r.next=r}}return{next:L}}function L(){return{value:e,done:!0}}return b.prototype=w,c(T,"constructor",w),c(w,"constructor",b),b.displayName=c(w,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c(t,a,"GeneratorFunction")),t.prototype=Object.create(T),t},t.awrap=function(t){return{__await:t}},S(C.prototype),c(C.prototype,r,function(){return this}),t.AsyncIterator=C,t.async=function(e,n,o,i,s){void 0===s&&(s=Promise);var r=new C(l(e,n,o,i),s);return t.isGeneratorFunction(n)?r:r.next().then(function(t){return t.done?t.value:r.next()})},S(T),c(T,a,"Generator"),c(T,s,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var o=e.pop();if(o in t)return n.value=o,n.done=!1,n}return n.done=!0,n}},t.values=_,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(o,i){return a.type="throw",a.arg=t,n.next=o,i&&(n.method="next",n.arg=e),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var r=this.tryEntries[s],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var c=o.call(r,"catchLoc"),l=o.call(r,"finallyLoc");if(c&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var r=s?s.completion:{};return r.type=t,r.arg=e,s?(this.method="next",this.next=s.finallyLoc,p):this.complete(r)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if("throw"===o.type){var i=o.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:_(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}});const s=()=>Object.prototype.hasOwnProperty.call(window,"ABTastyEditor"),r=()=>{let t;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?t=window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?t=window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings&&(t=window.ABTasty.accountSettings.identifier),t):t},a=()=>{const t=!!document.getElementById("ABTastyPreviewBar"),e=location.href.includes("ab_project=preview");return t||e},c=()=>!s()&&(a()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),l=()=>window.ABTasty&&!0===window.ABTasty.consentReady,d="remove",u="rebuild",h="https://api-social-proof.abtasty.com/clients/",m=()=>{const{type:t}=DATA;return`${PACKAGE.replace("@abtasty/","")}${t?`_${t}`:""}`},g=()=>{const t=m();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`.split("-").join(" ")},p=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,y=t=>{if((()=>{if(s()||a())return!1;const t=ABTasty.getTestsOnPage()[TEST_ID];return!!t&&Object.keys(t.targetings.qaParameters).length>0})()){const e=g();window.console.log(`%c${e} - QA Mode for campaign ${TEST_ID}\n${t}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}},b=t=>{const e={promise:null,resolve:null,reject:null,name:t};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e},w=(t,e)=>{const n=()=>{try{return document.querySelector(t)}catch(t){return null}};let o=n();const i=[document.body||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],s=()=>a.disconnect(),r=()=>a.observe(...i),a=new MutationObserver(()=>(o=n(),o&&!s()&&e(o)));return o?setTimeout(()=>e(o),0):r(),{selector:t,clear:s,observe:r}};function f(t,e){return e(t)||!t.parentElement?t:f(t.parentElement,e)}const v=t=>{s()||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())},x=(t,e)=>[...document.querySelectorAll(e)].some(n=>n.isSameNode(t)||!!t.closest(e));class T{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=this.startVisibilityObserver(),this.mutationObserver=this.startMutationObserver(),this.mouseOverEvent=this.mouseOverHandler()}intersectionHandler(t){t.forEach(t=>{t.isIntersecting?(this.existingTargets.forEach(e=>{e.element.isSameNode(t.target)&&(this.inViewportTargets.push(e),this.mouseOverEvent.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(e=>!e.element.isSameNode(t.target)||(this.mouseOverEvent.clear(),!1))})}startVisibilityObserver(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:0})}startMutationObserver(){const t=this.mutationObserver||new MutationObserver(this.checkElements.bind(this));return document.body&&t.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),t}onMouseOver({target:t,path:e}){const n=this.inViewportTargets.find(({element:n,selector:o})=>{if(n.isSameNode(t))return!0;const i=[...t.querySelectorAll(o)];if(i.length&&i.includes(n))return!0;if(e.includes(n))return!0;const s=[...t.parentElement.children],r=s.findIndex(e=>e.isSameNode(t)),a=s.filter((t,e)=>e>r);if(a.length){if(a.includes(n))return!0;if(a.some(t=>[...t.querySelectorAll(o)].includes(n)))return!0}return!1});if(n&&this.isElementVisible(n.element)){const{selector:t,element:e,uniqueId:o}=n,i=this.targets.find(e=>e.selector===t&&e.uniqueId===o);i&&i.resolve(e),this.clear(t,o)}}mouseOverHandler(){const t=["mouseover",t=>setTimeout(()=>this.onMouseOver(t),50),!0];return{start:()=>document.addEventListener(...t),clear:()=>document.removeEventListener(...t)}}isElementVisible(t){return this.isElementTopmost(t)&&this.isElementOpaque(t)}isElementOpaque(t){return"HTML"===f(t,t=>"0"===window.getComputedStyle(t).opacity).nodeName}isElementTopmost(t){const e=t.getBoundingClientRect(),n=[[e.left,e.top],[e.right,e.top],[e.left,e.bottom],[e.right,e.bottom],[e.left+e.width/2,e.top],[e.left+e.width/2,e.bottom],[e.left,e.height/2],[e.right,e.height/2],[e.left+e.left/2,e.height/2]];let o=!1,i=0;for(;!o&&i<n.length;){const e=document.elementFromPoint(...n[i]);o=t===e||t.contains(e),i+=1}return o}checkElements(){this.targets.forEach(({selector:t,uniqueId:e})=>{const n=document.querySelector(t);n&&!this.existingTargets.find(n=>n.element.matches(t)&&n.uniqueId===e)&&(this.existingTargets.push({element:n,selector:t,uniqueId:e}),this.visibilityObserver.observe(n))}),this.existingTargets=this.existingTargets.filter(({selector:t,element:e})=>!!document.querySelector(t)||(e&&this.visibilityObserver.unobserve(e),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:t,element:e,uniqueId:n})=>{if(e.matches(t)&&this.isElementVisible(e)){const o=this.targets.find(e=>e.selector===t&&e.uniqueId===n);return o&&o.resolve(e),this.clear(t,n),!1}return!0})}watch(t,e,n){this.targets.push({selector:t,resolve:e,uniqueId:n});const o=()=>{this.startMutationObserver(),this.checkElements()};document.body?o():w("body",o)}clear(t,e){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(n=>n.filter(({selector:n,uniqueId:o})=>n!==t&&o!==e));const n=document.querySelector(t);n&&this.visibilityObserver.unobserve(n),0===this.targets.length&&this.mutationObserver.disconnect(),0===this.inViewportTargets.length&&this.mouseOverEvent.clear()}}class S{constructor({triggerEvent:t,triggerSelector:e,triggerDelay:n}){this.event=t,this.selector=e&&e.length?e:"body",this.delay=1e3*n,this.elementsSelectors=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.visibilityObservers=[],this.elementsWaiters=[]}async onElementVisible({promise:t,resolve:e}){const n=b(`${this.event}DomReady`);this.promises.push(n);const o=await this.onPageLoad(n),i=await async function(){let t;return t=await("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||new Promise((t,e)=>{const n=window.document.getElementsByTagName("script")[0],o=window.document.createElement("script");o.src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver",n.parentNode.insertBefore(o,n),o.onload=t,o.onerror=e})),t}(),s=new T;if(this.visibilityObservers.push(s),i&&o){const t=p();s.watch(this.selector,e,t)}return t}onPageLoad({promise:t,resolve:e}){const n=()=>"complete"===document.readyState;if(!n()){const o=["readystatechange",({isTrusted:t})=>t&&n()&&e(!0),{passive:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}return e(!0),t}onClick({promise:t,resolve:e}){const n=document.createElement("style");n.type="text/css",n.id=`Click_${p()}`,n.innerHTML=`${this.selector} {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}`,document.head.appendChild(n),this.elementsSelectors.push(`#${n.id}`);const o=["click",({isTrusted:t,target:n})=>t&&x(n,this.selector)&&e(!0),{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}onHover({promise:t,resolve:e}){const n=["mouseenter",({isTrusted:t,target:n})=>t&&x(n,this.selector)&&e(!0),{passive:!0,capture:!0}];return this.eventsListeners.push([document.documentElement,...n]),document.documentElement.addEventListener(...n),t}onExitIntent({promise:t,resolve:e}){const n=["mouseleave",({isTrusted:t,clientY:n})=>{t&&n<=0&&e(!0)},{passive:!0}],o=w("body",t=>{this.eventsListeners.push([t,...n]),t.addEventListener(...n),this.elementsWaiters=this.elementsWaiters.filter(t=>t!==o)});return this.elementsWaiters.push(o),t}onReengage({promise:t,resolve:e}){const n=this.delay;let o=n;const i=[({isTrusted:t})=>{t&&(o=n)},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(t=>{this.eventsListeners.push([document,t,...i]),document.addEventListener(t,...i)});const s=setInterval(()=>{o<=0?e(!0):o-=100},100);return this.intervals.push(s),t}onCustomTrigger({promise:t,resolve:e}){const{triggerEventCustomScript:n}=DATA;return new Function(`return new Promise(async resolve => {${n}})`)().then(t=>t&&e(!0)),t}onScrollUp({promise:t,resolve:e}){let n=0;const o=["scroll",({isTrusted:t})=>{t&&(window.pageYOffset<n?e(!0):n=window.pageYOffset)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}onScrollPercentReached({promise:t,resolve:e}){const{triggerEventScrollPercent:n}=DATA,o=["scroll",({isTrusted:t})=>{if(!t)return;const o=(()=>{const{documentElement:t,body:e}=document,n=t.scrollTop||e.scrollTop,o=t.scrollHeight||e.scrollHeight;return Math.trunc(n/(o-t.clientHeight)*100,10)})();n<o&&e(!0)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}getSocialProofPurchases({promise:t,resolve:e}){const n=window.ABTastyProductKey,o=r(),{viewInterval:i,triggerSocialProofMinPurchases:s,spNoTrim:a}=DATA;return n||(y("Not able to find ABTastyProductKey, impossible to call the API."),e(!1)),n&&o?fetch(`${h}${o}/metrics/i?key=${n}${a?"&noTrim=true":""}`).then(t=>t.ok&&t.json()).then(t=>(t=>{if(void 0===i||void 0===s)return!1;const e=void 0!==t[i]&&t[i]>=s;return e||y(`Widget will not be shown, product has been purchased ${t[i]} times while ${s} are required`),e})(t)&&e(`${t[i]}`)).catch(()=>y("Failed to fetch datas from server.")):e(!1),t}getSocialProofPageViews({promise:t,resolve:e}){const{viewInterval:n,triggerSocialProofMinPageViews:o,spNoTrim:i}=DATA,s=encodeURIComponent(i?window.location.href.replace(window.location.origin,""):`${window.location.pathname}`),a=r();return s&&a?fetch(`${h}${a}/metrics/pv?key=${s}${i?"&noTrim=true":""}`).then(t=>t.ok&&t.json()).then(t=>(t=>{if(void 0===n||void 0===o)return!1;const e=void 0!==t[n]&&t[n]>=o;return e||y(`Widget will not be shown, page has been seen ${t[n]} times while ${o} are required`),e})(t)&&e(`${t[n]}`)).catch(()=>y("Failed to fetch datas from server.")):e(!1),t}onConsent({promise:t,resolve:e}){if(!l()){const n=["abtasty_consentValid",()=>e(!0)];return this.eventsListeners.push(n),window.addEventListener(...n),t}return e(!0),t}onTrackingSent({promise:t,resolve:e}){const{triggerEventTrackingSent:n}=DATA;let o=localStorage.getItem("ABTastyData");const i=()=>JSON.parse(o).ActionTracking.find(({name:t})=>t===n),s=["storage",()=>{o=localStorage.getItem("ABTastyData"),i()&&e(!0)},{passive:!0,capture:!0}];return o&&i()?e(!0):(()=>{this.eventsListeners.push([window,...s]),window.addEventListener(...s)})(),t}onMinPagesViewed({promise:t,resolve:e}){const{triggerEventMinPagesViewed:n}=DATA;let o=localStorage.getItem("ABTastyData");const i=()=>n<=(o?JSON.parse(o).VisitedPages.length:0),s=["storage",()=>{o=localStorage.getItem("ABTastyData"),i()&&e(!0)},{passive:!0,capture:!0}];return o&&i()?e(!0):(()=>{this.eventsListeners.push([window,...s]),window.addEventListener(...s)})(),t}onRageClick({promise:t,resolve:e}){const{triggerEventRageClickQuantity:n,triggerEventRageClickDelay:o}=DATA;let i=0,s=!1;const r=["click",({isTrusted:t})=>{t&&(i+=1,i>=n&&e(!0),s||(s=!0,setTimeout(()=>{i=0,s=!1},o)))},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...r]),document.addEventListener(...r),t}clear(){if(this.elementsSelectors.length&&(this.elementsSelectors.forEach(t=>{document.querySelector(t)&&document.querySelector(t).remove()}),this.elementsSelectors=[]),this.eventsListeners.length&&(this.eventsListeners.forEach(t=>{const[e,...n]=t;e&&n.length>1&&e.removeEventListener(...n)}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(t=>clearTimeout(t)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(t=>clearInterval(t)),this.intervals=[]),this.observers.length&&(this.observers.forEach(t=>t.disconnect()),this.observers=[]),this.visibilityObservers.length){const t=p();this.visibilityObservers.forEach(e=>e.clear(this.selector,t)),this.visibilityObservers=[]}return this.promises.length&&(this.promises.forEach(t=>t.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(t=>t.clear()),this.elementsWaiters=[]),this}async isTriggered(){this.clear();const t=b(this.event);this.promises.push(t);const e={consent:()=>this.onConsent(t),direct:()=>!0,pageLoad:()=>this.onPageLoad(t),click:()=>this.onClick(t),exitIntent:()=>this.onExitIntent(t),reengage:()=>this.onReengage(t),elementVisible:()=>this.onElementVisible(t),script:()=>this.onCustomTrigger(t),hover:()=>this.onHover(t),scrollUp:()=>this.onScrollUp(t),scrollPercent:()=>this.onScrollPercentReached(t),rageClick:()=>this.onRageClick(t),minPagesViewed:()=>this.onMinPagesViewed(t),trackingSent:()=>this.onTrackingSent(t),socialProofPurchases:()=>this.getSocialProofPurchases(t),socialProofPageViews:()=>this.getSocialProofPageViews(t)},n=!Object.prototype.hasOwnProperty.call(e,this.event)||await e[this.event]();return this.clear(),"reengage"!==this.event&&this.delay?n&&await(async()=>{const t=b(`${this.event}Delay`);return this.promises.push(t),setTimeout(()=>{t.resolve(!0),this.clear()},this.delay),t.promise})():n}}const C="closing",$="validation",E="ABTastyWidgets",A="ABTastyWidgetsTemporary";class k{constructor({displayRecurrence:t,closingRecurrence:e,validationRecurrence:n},o){this.displayRecurrence=parseFloat(t),this.closingRecurrence=parseFloat(e),this.validationRecurrence=parseFloat(n),this.onSetCallback=o,this.widgetName=m(),this.uniqueId=p(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`,this.isListeningStorageEvent=this.listenStorageEvent(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}onStorage({key:t}){const e=localStorage.getItem(A),n=sessionStorage.getItem(E);"ABTastyData"===t&&!e&&n&&localStorage.setItem(A,n)}listenStorageEvent(){return this.isListeningStorageEvent||window.addEventListener("storage",this.onStorage.bind(this)),!0}getGivenRecurrenceStorageParsed(t){try{const e=t.getItem(E);return JSON.parse(e)}catch(e){return t.removeItem(E),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(t,e){const{[this.recurrenceKey]:n,...o}=e;return Object.entries(o).length?(t.setItem(E,JSON.stringify(o)),o):(t.removeItem(E),!1)}removeSessionRecurrenceStorage(){const t=this.getSessionRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.sessionStorage,t)}removeLocalRecurrenceStorage(){const t=this.getLocalRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.localStorage,t)}getSessionRecurrence(){const t=this.getSessionRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}getLocalRecurrence(){const t=this.getLocalRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}getCurrentRecurrence(){if(this.pendingRecurrence)return this.pendingRecurrenceValue;const t=this.getSessionRecurrence(),e=this.getLocalRecurrence();return t||e||{type:!1}}isOver(){const t=localStorage.getItem(A),e=!(!t||!t.includes(this.recurrenceKey))||this.getSessionRecurrence();t&&(sessionStorage.setItem(E,t),localStorage.removeItem(A));const n=this.getLocalRecurrence(),o=(n?parseFloat(n.stamp):0)<(new Date).getTime();return o&&this.removeLocalRecurrenceStorage(),!this.pendingRecurrence&&o&&!this.getLocalRecurrence()&&!e}setRecurrence(t,e){0!==t&&(window.removeEventListener("storage",this.onStorage.bind(this)),this.isListeningStorageEvent=!1);const n=this.getTypeOfStorage(t);if(a()||!n&&"object"!=typeof n)return!1;const{storageString:o,storageMethod:i}=n,s=this.getStamp(t),r={type:e,stamp:s},{type:c}=this.getCurrentRecurrence(),d=async()=>{if(!l()){this.pendingRecurrence=!0,this.pendingRecurrenceValue=r;const t=new S({triggerEvent:"consent"});await t.isTriggered(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}const t=this.getSessionRecurrence(),e=this.getLocalRecurrence();let n;"session"===o?t?n=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),n=this.getSessionRecurrenceStorageParsed()):"local"===o&&(e?n=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),n=this.getLocalRecurrenceStorageParsed()));const s=n?{[this.recurrenceKey]:r,...n}:{[this.recurrenceKey]:r};i.setItem(E,JSON.stringify(s)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!i)return!1;if(c&&e!==$)if(e===C&&c!==$)d();else{if("display"!==e||c===$||c===C)return!1;d()}else d();return s}setDisplayRecurrence(){this.setRecurrence(this.displayRecurrence,"display")}setClosingRecurrence(){this.setRecurrence(this.closingRecurrence,"closing")}setValidationRecurrence(){this.setRecurrence(this.validationRecurrence,"validation")}getStamp(t){return(new Date).getTime()+864e5*t}getTypeOfStorage(t){return!(isNaN(t)||t<0||0!==t&&!t)&&(t>0?{storageString:"local",storageMethod:window.localStorage}:0===t&&{storageString:"session",storageMethod:window.sessionStorage})}}class _{constructor(t,e,n){this.recurrence=t,this.isWidgetApplied=e,this.callback=n,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=["abtasty_resetActionTracking",this.eventHandler.bind(this),{passive:!0}],this.elementsWaiters=[]}recurrenceIsDone(){return!this.recurrence||this.recurrence.isOver()}decisionHandler(t){const e=c(),{type:n}=this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1};let o;const i=this.isWidgetApplied(),s=(()=>{const e=this.recurrenceIsDone();return t&&"display"===n||e})();return!i&&e&&s?o=u:(i&&(!e||!s)||!i&&!e)&&(o=d),"string"==typeof o&&(this.clearWatcher(),this.callback(o,t),this.watch()),this}eventHandler(){let t=c();return[250,500].forEach(e=>{setTimeout(()=>{const n=c();return 500===e&&n===t?this:(t=n,this.decisionHandler(!1))},e)}),this}observerHandler(t){return t.some(t=>["removedNodes","addedNodes"].some(e=>t[e]&&t[e].length))?this.decisionHandler(!0):this}watch(){if(s())return this;this.clearWatcher(),document.addEventListener(...this.eventListenerParams);const t=()=>{const t=[document.body,{childList:!0,subtree:!0}];this.observer.observe(...t)};return document.body?t():(()=>{const e=w("body",()=>{t(),this.elementsWaiters=this.elementsWaiters.filter(t=>t!==e)});this.elementsWaiters.push(e)})(),this}clearWatcher(){return document.removeEventListener(...this.eventListenerParams),this.elementsWaiters.length&&(this.elementsWaiters.forEach(t=>t.clear()),this.elementsWaiters=[]),this.observer.disconnect(),this}}const L=/.+\/([^.]+)\.(otf|ttf)$/;class B{constructor(){this.children=void 0,this.uniqueId=p(),this.widgetName=m(),this.prettyName=g(),this.recurrenceParams=(()=>{const{displayRecurrence:t,closingRecurrence:e,validationRecurrence:n}=DATA;if(s()||!t&&!e&&!n)return!1;const o={everytime:()=>-1,session:()=>0,once:()=>395,day:t=>DATA[`${t}_day`],week:t=>7*DATA[`${t}_week`],month:t=>30.5*DATA[`${t}_month`]},i={};return t&&(i.displayRecurrence=o[t]("displayRecurrence")),e&&(i.closingRecurrence=o[e]("closingRecurrence")),n&&(i.validationRecurrence=o[n]("validationRecurrence")),i})(),this.triggerParams=(()=>{let{triggerEvent:t}=DATA;const{triggerEventClick:e,triggerEventHover:n,triggerEventReengageDelay:o,socialProofContentType:i,triggerEventElementVisible:r,triggerEventDelay:a}=DATA;if(s()||!t&&!i)return!1;const c={click:()=>e,hover:()=>n,elementVisible:()=>r},l=Object.prototype.hasOwnProperty.call(c,t)?c[t]():"body",d="reengage"===t?o:a;return i&&(t=1===i?"socialProofPurchases":"socialProofPageViews"),{triggerEvent:t,triggerSelector:l,triggerDelay:d}})(),this.recurrence=!!this.recurrenceParams&&new k(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new S(this.triggerParams),this.pageWatcher=new _(this.recurrence,this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:t,triggerEvent:e}=DATA;return!e||!["click","hover","scrollUp","script"].includes(e)||t})(),this.basicClassName=`ab_widget_container_${this.widgetName}`,this.widgetContainerId=`${this.basicClassName}_${this.uniqueId}`,this.contentClassName=`${this.basicClassName}_content`,this.overlayClassName=`${this.basicClassName}_overlay`,this.closeButtonClassName=`${this.basicClassName}_close_button`,this.hideClassName=`ab_hide_${this.uniqueId}`,this.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.elementsWaiters=[]}clearGivenClearables(){this.eventsListeners.length&&(this.eventsListeners.forEach(t=>document.removeEventListener(...t)),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(t=>clearTimeout(t)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(t=>clearInterval(t)),this.intervals=[]),this.observers.length&&(this.observers.forEach(t=>t.disconnect()),this.observers=[]),this.promises.length&&(this.promises.forEach(t=>t.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(t=>t.clear()),this.elementsWaiters=[])}isWidgetApplied(){return this.domElement&&this.domElement.isConnected}removeOldDomElement(){const t=document.getElementById(this.widgetContainerId);return t&&t.remove(),this}async insert(){if(this.isWidgetApplied())return!1;const t=new Promise(t=>{const e=w("head",e=>{this.elementsWaiters=this.elementsWaiters.filter(({selector:t})=>"head"!==t),t(e.appendChild(this.styleElement))});this.elementsWaiters.push(e)}),e=new Promise(t=>{const{elementReferrer:e="body",referrerInsertType:n="beforeend"}="free"===DATA.layout?DATA:{},o=w(e,o=>{this.elementsWaiters=this.elementsWaiters.filter(t=>t.selector!==e),this.removeOldDomElement(),t(o.insertAdjacentElement(n,this.domElement))});this.elementsWaiters.push(o)});return Promise.all([e,t]).then(()=>this)}remove(){return this.pageWatcher.clearWatcher(),[this.domElement,this.styleElement].forEach(t=>t&&t.isConnected&&t.remove()),this.hasOncePerPageTrigger?this.pageWatcher.watch():s()||this.init().then(({response:t})=>t?this.show():this),this}show(){return s()||this.hasBeenShown&&this.hasOncePerPageTrigger||window.ABTastyEvent(`${this.prettyName} displayed`,null,TEST_ID),this.closedByUser=!1,setTimeout(()=>this.domElement.classList.remove(this.hideClassName),50),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(),this}hide(){return!s()&&this.hasBeenShown&&window.ABTastyEvent(`${this.prettyName} closed`,null,TEST_ID),this.closedByUser=!0,this.domElement.classList.add(this.hideClassName),this}async init(t){const e=s(),n=c(),o=this.trigger&&this.trigger.promises.length,i=!this.recurrence||this.recurrence.isOver();if(!e&&!n||o||!i)return!1;this.pageWatcher.watch();const r=e||!this.trigger||this.trigger&&await this.trigger.isTriggered();return!!r&&(await this.insert(),this.addCloseEvent(),e||t||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(r),{container:this,response:r})}onPageChange(t,e){const n=()=>this.init().then(({response:t})=>t&&this.show());e||(this.hasBeenShown=!1);const o=this.isWidgetApplied(),i={[d]:()=>{o?this.remove():(this.trigger&&this.trigger.clear(),this.pageWatcher.watch())},[u]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch():o||this.insert().then(t=>t.show()).catch(this.pageWatcher.watch):n()}};"function"==typeof i[t]&&i[t]()}addCloseEvent(...t){const{closeButton:e,overlay:n,overlayClickable:o,layout:i,animationDuration:r=1e3}=DATA,a=[];if(void 0!==n&&!0!==n||!0!==o||"popin"!==i||a.push(`.${this.overlayClassName}`),void 0!==e&&e&&a.push(`.${this.closeButtonClassName}`),!a.length)return this;const c=this.domElement.querySelectorAll(a.join(", "));return c.length?(t.push(...c),t.forEach(t=>{s()&&(t.dataset.abtastyActionnable="true"),t.addEventListener("click",t=>{v(t),this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(),setTimeout(()=>this.remove(),1.05*r)},{once:!0,capture:!0})}),this):this}getDom(){const{closeButton:t,layout:e,overlay:n=!0}=DATA,o=document.createElement("div");return o.className=`${this.basicClassName} ${this.hideClassName}`,o.id=this.widgetContainerId,o.innerHTML=`\n\t\t\t${"popin"===e&&!0===n?`<div class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t${t?`<button class="${this.closeButtonClassName}"><svg viewBox="0 0 16 16">\n\t<defs><path id="prefix__a" d="M12 4.991L11.009 4 8 7.009 4.991 4 4 4.991 7.009 8 4 11.009 4.991 12 8 8.991 11.009 12 12 11.009 8.991 8z"></path></defs>\n\t<g><use xlink:href="#prefix__a"></use></g>\n</svg></button>`:""}\n\t\t\t</div>`,o}loadFont(t,e){if(!t||"inherit"===t)return;const n=document.createElement("style"),o=e.match(L)?e.match(L)[1]:"";n.innerHTML=`@font-face { font-family: '${t}_${o}'; src: url('${e}');}`,document.head.appendChild(n)}getStyleTag(t="",e=DATA){const{noStyles:n,layout:o}=e,{backgroundColor:i,isBackgroundImage:r,backgroundImage:a,backgroundSize:c,backgroundPosition:l,backgroundRepeat:d,borderColor:u,borderRadius:h,borderWidth:m,textColor:g,textAlign:p,fontName:y,fontStyle:b,fontSize:w,isTitle:f,titleTextAlign:v,titleTextColor:x,titleFontName:T,titleFontStyle:S,titleFontSize:C,overlay:$,overlayColor:E,dropShadow:A,dropShadowColor:k,dropShadowBlur:_,containerMargin:B,containerPadding:I,closeButton:N,closeButtonPosition:P,closeButtonSize:R,closeButtonBorderRadius:O,closeButtonBorderWidth:D,closeButtonBorderColor:W,closeButtonColor:j,closeButtonBackgroundColor:M,buttonsAlign:F,buttonsBorderWidth:q,buttonsBorderColor:V,buttonsBorderRadius:H,buttonsBackgroundColor:z,buttonsTextColor:U,buttonsFontName:G,buttonsFontStyle:Y,buttonsFontSize:K,secondLinkBorderWidth:J,secondLinkBorderColor:Q,secondLinkBorderRadius:Z,secondLinkBackgroundColor:X,secondLinkTextColor:tt,secondLinkFontName:et,secondLinkFontStyle:nt,secondLinkFontSize:ot,animation:it,animationDuration:st,animationBehaviour:rt,animationSlideDirection:at}=n?{}:e,ct=document.createElement("style");ct.type="text/css",s()&&ct.setAttribute("abtasty-script-added","true"),this.loadFont(y,b),this.loadFont(T,S),this.loadFont(G,Y),this.loadFont(et,nt);const lt=`background: ${["string"==typeof i?i:"rgba(255, 255, 255, 1)",r&&"string"==typeof a&&a.length?`url(${a})`:"",r&&"string"==typeof l&&"100% 100%"!==c?l:"0 0",r&&"string"==typeof c?`/ ${c}`:"/ auto",r&&d&&!["cover","100% 100%"].includes(c)?"repeat":"no-repeat"].join(" ").trim()};`,dt="number"==typeof m&&m>0,ut=`border: ${[dt?`${m}px`:"unset",dt?"solid":"",dt&&"string"==typeof u&&u.length?u:""].join(" ").trim()};`,ht=void 0!==h?`border-radius: ${h}px;`:"",mt=void 0!==g?`color: ${g}; fill: ${g}; -webkit-text-fill-color: ${g};`:"",gt=void 0!==p?`text-align: ${p};`:"",pt=y&&"inherit"!==y?`font-family:${y}_${b.match(L)?b.match(L)[1]:""};`:b||"",yt=w?`font-size: ${w}px;`:"",bt=void 0!==A&&A?`box-shadow: 0 5px ${_}px 0 ${k};`:"",wt=B instanceof Array&&1===B.length&&B[0],ft=wt?`margin: ${wt.top}px ${wt.right}px ${wt.bottom}px ${wt.left}px;`:"",vt=wt?`margin: calc(${wt.top}px * 0.5) calc(${wt.right}px * 0.5) calc(${wt.bottom}px * 0.5) calc(${wt.left}px * 0.5);`:"",xt=I instanceof Array&&1===I.length&&I[0],Tt=xt?`padding: ${xt.top}px ${xt.right}px ${xt.bottom}px ${xt.left}px;`:"",St=xt?`padding: calc(${xt.top}px * 0.5) calc(${xt.right}px * 0.5) calc(${xt.bottom}px * 0.5) calc(${xt.left}px * 0.5);`:"",Ct=void 0!==q&&q?`border-width: ${q}px; border-style: solid;`:"",$t=[V,q].every(t=>void 0!==t)&&q?`border-color: ${V};`:"",Et=void 0!==H?`border-radius: ${H}px;`:"",At=void 0!==z?`background-color: ${z};`:"",kt=void 0!==U?`color: ${U}; fill: ${U}; -webkit-text-fill-color: ${U};`:"",_t=G&&"inherit"!==G?`font-family:${G}_${Y.match(L)?Y.match(L)[1]:""};`:Y||"",Lt=K?`font-size: ${K}px;`:"",Bt=void 0!==J&&J?`border-width: ${J}px; border-style: solid;`:"",It=[Q,J].every(t=>void 0!==t)&&J?`border-color: ${Q};`:"",Nt=void 0!==Z?`border-radius: ${Z}px;`:"",Pt=void 0!==X?`background-color: ${X};`:"",Rt=void 0!==tt?`color: ${tt}; fill: ${tt}; -webkit-text-fill-color: ${tt};`:"",Ot=et&&"inherit"!==et?`font-family:${et}_${nt.match(L)?nt.match(L)[1]:""};`:nt||"",Dt=ot?`font-size: ${ot}px;`:"",Wt="popin"!==o||void 0!==$&&!0!==$?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==E?E:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),jt="number"==typeof R?R:16,Mt=jt/2,Ft=n||void 0!==N&&N?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===P?`bottom: calc(100% + ${Mt}px)`:`top: ${Mt}px`)+";",`right: ${Mt}px;`,"width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","outline: none;","padding: 0;","margin: 0;","line-height: 0;","z-index: 9;","number"==typeof O?`border-radius: ${O}px;`:"","number"==typeof D&&D>0?`border: ${D}px solid ${void 0!==W?W:"rgba(57, 57, 57, 1)"};`:"","string"==typeof M?`background-color: ${M};`:"","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;",`width: ${jt}px;`,`height: ${jt}px;`,"string"==typeof j?`fill: ${j};`:"","}"].join(""):"",qt=f&&"string"==typeof x?[`#${this.widgetContainerId} .${this.contentClassName} > * h1, `,`#${this.widgetContainerId} .${this.contentClassName} > * h2, `,`#${this.widgetContainerId} .${this.contentClassName} > * h3, `,`#${this.widgetContainerId} .${this.contentClassName} > * h4, `,`#${this.widgetContainerId} .${this.contentClassName} > * h5, `,`#${this.widgetContainerId} .${this.contentClassName} > * h6 {`,`color: ${x}; fill: ${x}; -webkit-text-fill-color: ${x};`,void 0!==v?`text-align: ${v};`:"",T&&"inherit"!==T?`font-family:${T}_${S.match(L)?S.match(L)[1]:""};`:S||"",C?`font-size: ${C}px;`:"","}"].join(""):"";let Vt="";if("string"==typeof it){const t=(st/1e3).toFixed(2),e=["top","bottom"].includes(at),n=Number(e),o=[(["top","left"].includes(at)?"-":"")+"100vmax",this.translateValues?this.translateValues[n]:"0"];e&&o.reverse(),Vt={none:[],fade:[`#${this.widgetContainerId} {`,`transition: opacity ${t}s ${rt};`,"}"],slide:[`.${this.hideClassName} .${this.overlayClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,`transition: opacity ${t}s ${rt};`,"}",`.${this.hideClassName} .${this.contentClassName} {`,`transform: translate(${o.join(", ")}) !important;`,"}",`#${this.widgetContainerId} .${this.contentClassName} {`,`transition: transform ${t}s ${rt};`,"}"]}[s()&&!ABTASTY_S.WIDGETS.animationChanged?"none":it].join("")}return ct.textContent=[`.${this.hideClassName} {`,"opacity: 0 !important;","pointer-events: none;","}",`#${this.widgetContainerId} {`,"opacity: 1;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,lt,ht,ut,mt,gt,bt,ft,pt,yt,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,mt,gt,pt,yt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",Tt,pt,yt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a, `,`#${this.widgetContainerId} .${this.contentClassName} > * button {`,"box-sizing: border-box;","display: inline-block;",Ct,$t,Et,At,kt,_t,Lt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a *, `,`#${this.widgetContainerId} .${this.contentClassName} > * button * {`,kt,_t,Lt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a:nth-child(2), `,`#${this.widgetContainerId} .${this.contentClassName} > * button:nth-child(2) {`,`margin-${"fill"===F?"top":"left"}: 8px;`,Bt,It,Nt,Pt,Rt,Ot,Dt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a:nth-child(2) *, `,`#${this.widgetContainerId} .${this.contentClassName} > * button:nth-child(2) * {`,Rt,Ot,Dt,"}","@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,vt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,St,"}","}",Wt,Ft,qt,Vt,`${t}`].join(""),ct}}const I=["top: 0;","top: 50%;","bottom: 0;"],N=["left: 0;","left: 50%;","right: 0;"],P=t=>1===t?"-50%":0,R=()=>{if(Array.isArray(DATA.popinPosition)){const{popinPosition:[{x:t,y:e}]}=DATA,n=`translate(${P(e)}, ${P(t)});`;return`${I[t]}${N[e]}transform: ${n}`}return"left: 50%;top: 50%;transform: translate(-50%, -50%);"},O=()=>"autoWidth"in DATA&&!0===DATA.autoWidth,D=()=>{if(O())return"width: auto;height: auto;";const{popinPercentWidth:t,popinPixelsWidth:e,widthUnit:n,autoHeight:o,popinPercentHeight:i,popinPixelsHeight:s,heightUnit:r}=DATA;return`width: ${"px"===n?e:t}${n};height: ${o?"auto":`${"px"===r?s:i}${r}`};`};class W extends B{constructor(){super(),this.translateValues=Object.values(DATA.popinPosition[0]).map(t=>P(t)),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:t,zindexCustom:e,overlay:n}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;",`z-index: ${"custom"===t?e:t};`,"background: none;","pointer-events: "+(!1===n?"none":"all"),"}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;",R(),D(),"pointer-events: all","}",`${O()?"":[`#${this.widgetContainerId} .${this.contentClassName} > div {`,"height: 100%;","overflow: auto;","box-sizing: border-box;","}"].join("")}`,`${O()?"":["@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join("")}`].join("")}}class j extends B{constructor(){super(),this.position="string"==typeof DATA.layout&&"bannerTop"===DATA.layout?"top":"bottom",this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:t,zindexCustom:e}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;",`${this.position}: 0;`,"left: 0;","width: 100%;","height: auto;",`z-index: ${"custom"===t?e:t};`,"background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}class M extends B{constructor(){super(),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"width: auto;","height: auto;","margin: 0;","padding: 0;","background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}const F=()=>{const{layout:t}=DATA;let e;switch(t){case"popin":e=new W;break;case"bannerTop":case"bannerBottom":e=new j;break;case"free":e=new M;break;default:e=new B}return e},q={button:"button",buttonClose:"buttonClose",widget:"widget",widgetClose:"widgetClose"},V=[{label:"widget_promotionalBanner_content_radio_linkType_option_button",value:q.button},{label:"widget_promotionalBanner_content_radio_linkType_option_buttonClose",value:q.buttonClose},{label:"widget_promotionalBanner_content_radio_linkType_option_wholeBannerClickable",value:q.widget},{label:"widget_promotionalBanner_content_radio_linkType_option_wholeBannerClickableClose",value:q.widgetClose},{label:"widget_promotionalBanner_content_radio_linkType_option_none",value:!1}],H=(q.button,t=>t&&[q.button,q.buttonClose].includes(t));V.filter(({value:t})=>H(t));var z=e(function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports});t(z);var U=e(function(t){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,i,s=[],r=!0,a=!1;try{for(n=n.call(t);!(r=(o=n.next()).done)&&(s.push(o.value),!e||s.length!==e);r=!0);}catch(t){a=!0,i=t}finally{try{r||null==n.return||n.return()}finally{if(a)throw i}}return s}},t.exports.__esModule=!0,t.exports.default=t.exports});t(U);var G=e(function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o},t.exports.__esModule=!0,t.exports.default=t.exports});t(G);var Y=e(function(t){t.exports=function(t,e){if(t){if("string"==typeof t)return G(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports});t(Y);var K=e(function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports});t(K);var J=t(e(function(t){t.exports=function(t,e){return z(t)||U(t,e)||Y(t,e)||K()},t.exports.__esModule=!0,t.exports.default=t.exports})),Q=t(e(function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports})),Z=t(e(function(t){function e(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}t.exports=function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports})),X=["fr","en","de","es"],tt=["day","hour","minute","second"],et={day:{en:"Day",fr:"Jour",es:"Dia",de:"Tag"},days:{en:"Days",fr:"Jours",es:"Dias",de:"Tage"},hour:{en:"Hour",fr:"Heure",es:"Hora",de:"Zeit"},hours:{en:"Hours",fr:"Heures",es:"Horas",de:"Stunden"},minute:"Min",second:{en:"Sec",fr:"Sec",es:"Seg",de:"Sek"}},nt="line",ot="free",it=window.ABTASTY_S&&ABTASTY_S.USER&&ABTASTY_S.USER.lang?ABTASTY_S.USER.lang.split("_")[0]:navigator.language.substr(0,2)||"en",st=function(t){return X.indexOf(t)>-1}(it)?it:"en",rt={day:et.day[st],days:et.days[st],hour:et.hour[st],hours:et.hours[st],minute:et.minute,minutes:et.minute,second:et.second[st],seconds:et.second[st]},at=function(){function t(e,n){Q(this,t),this.testId=e,this.data=n,this.targetselector=n.selector,this.container=this.createContainer(),this.digitElements={},this.textElements={},this.timeElements={},this.timeLoop=null,this.maxWidth=0,this.previewTime=172799,this.unitsText=rt,this.fonts=[],this.data.customTexts&&(this.unitsText={day:this.data.customDaysLabel,days:this.data.customDaysLabel,hour:this.data.customHoursLabel,hours:this.data.customHoursLabel,minute:this.data.customMinutesLabel,minutes:this.data.customMinutesLabel,second:this.data.customSecondsLabel,seconds:this.data.customSecondsLabel})}return Z(t,[{key:"getFonts",value:function(){return[{name:this.data.messageFontName,style:this.data.messageFontStyle},{name:this.data.numbersfontName,style:this.data.numbersfontStyle},{name:this.data.legendfontName,style:this.data.legendfontStyle}]}},{key:"remove",value:function(){var t=this,e=DATA.animationDuration;setTimeout(function(){return t.parentContainer.remove()},1.05*e)}},{key:"addCloseEvent",value:function(t){var e=this;t&&t.addEventListener("click",function(t){v(t),s()||e.parentContainer.recurrence.setClosingRecurrence(),e.parentContainer.hide(),e.remove()},{capture:!0,passive:!1})}},{key:"addRedirectionEvent",value:function(t){var e=this;!s()&&t&&t.addEventListener("click",function(){var t=DATA,n=t.autoHide,o=t.timeHide;n&&setTimeout(function(){e.parentContainer.hide(),e.remove()},1e3*o),e.parentContainer.recurrence.setValidationRecurrence()},{useCapture:!0,once:!0})}},{key:"createContainer",value:function(){var t=DATA,e=t.linkType,n=t.redirectionUrl,o=t.openInNewTab,i=document.createElement(e&&e.includes("widget")?"a":"div");switch(i.classList.add("abtasty-countdown"),e){case"widget":i.href=n,i.target=o?"_blank":"_self",this.addRedirectionEvent(i);break;case"widgetClose":i.href="#",i.dataset.abtastyActionnable="true",this.addCloseEvent(i)}return i}},{key:"insert",value:function(t,e){return t.insertAdjacentElement(e,this.container),this}},{key:"setText",value:function(t){var e=this;tt.forEach(function(n){var o=t[n];String(o).length<2&&(o="0".concat(o)),e.digitElements[n].textContent=o,e.textElements[n].textContent=1===o?e.unitsText[n]:e.unitsText["".concat(n,"s")],e.maxWidth<e.digitElements[n].offsetWidth&&(e.maxWidth=e.digitElements[n].offsetWidth,e.digitElements[n].style.minWidth="".concat(e.maxWidth,"px"),window.requestAnimationFrame(function(){e.setText(t)})),e.digitElements[n].style.minWidth="".concat(e.maxWidth,"px")})}},{key:"onTimeEnd",value:function(){var t;if(clearInterval(this.timeLoop),"hideWidget"===this.data.endSettings)return this.parentContainer.hide(),void(this.parentContainer.domElement.style.display="none");var e={};"showText"===this.data.endSettings&&(e.endText=!0,e.endCountdown=!0,e.endButton=!1),"showTextAndButton"===this.data.endSettings&&(e.endText=!0,e.endButton=!0,e.endCountdown=!0),"hideCountdownAndShowText"===this.data.endSettings&&(e.endText=!0,e.endCountdown=!1,e.endButton=!1),"hideCountdownAndShowTextAndButton"===this.data.endSettings&&(e.endText=!0,e.endCountdown=!1,e.endButton=!0);var n=["abtasty-countdown-".concat(this.data.endSettings),"abtasty-countdown-finish"];Object.keys(e).forEach(function(t){e[t]&&!n.includes("abtasty-countdown-".concat(t,"-show"))?n.push("abtasty-countdown-".concat(t,"-show")):n.includes("abtasty-countdown-".concat(t,"-hide"))||n.push("abtasty-countdown-".concat(t,"-hide"))}),(t=this.container.classList).add.apply(t,n)}},{key:"setCountdown",value:function(){var t=new Date,e=function(t,e){switch(t.type){case"global":return t.timestamp-e.getTime();case"local":if(s())return t.previewTimestamp-e.getTime();var n=t.timecomponents,o=n.year,i=n.month,r=n.day,a=n.hour,c=n.minute;return new Date(o,i-1,r,a,c).getTime()-e.getTime();default:return 0}}(this.data.dateTime,t)/1e3;if(window.ABTastyEditor&&("ifEnded"===this.data.previewBlock&&(e=-1),this.previewTime-=1),e<=0)return this.setText({day:0,hour:0,minute:0,second:0}),void this.onTimeEnd();var n=Math.floor(e/86400);e-=86400*n;var o=Math.floor(e/3600);e-=3600*o;var i=Math.floor(e/60);e-=60*i;var r=Math.floor(e);this.setText({day:n,hour:o,minute:i,second:r})}},{key:"getStyle",value:function(){this.loadFonts();var t=DATA.buttonsAlign,e=void 0!==t&&"fill"!==t?"text-align: ".concat(t,";"):"";return"\n .abtasty-countdown-bottom-button,\n .abtasty-countdown-finish-button {\n ".concat(e,"\n }\n .abtasty-countdown-bottom-button a,\n .abtasty-countdown-finish-button a {\n width: ").concat("fill"===t?"100%":"auto",";\n }\n\n .abtasty-countdown .abtasty-countdown-finish-text,\n .abtasty-countdown .abtasty-countdown-top-message,\n .abtasty-countdown .abtasty-countdown-finish-text *,\n .abtasty-countdown .abtasty-countdown-top-message * {\n white-space: pre-line;\n text-align: ").concat(this.data.messageAlign," !important;\n color: ").concat(this.data.textColor,";\n font-size: ").concat(this.data.messageFontSize,"px; \n ").concat(this.data.messageFontName&&"inherit"!==this.data.messageFontName?"font-family:".concat(this.data.messageFontName,"_").concat(this.data.messageFontStyle.match(/.+\/([^.]+)\.(otf|ttf)$/)[1],";"):this.data.messageFontStyle||"",";\n }\n\n .abtasty-countdown .abtasty-countdown-elm-number,\n .abtasty-countdown .abtasty-countdown-elm-number * {\n font-size: ").concat(this.data.numbersfontSize,"px; \n color: ").concat(this.data.numberstextColor,";\n -webkit-text-fill-color: ").concat(this.data.numberstextColor,";\n font-weight: initial;\n ").concat(this.data.numbersfontName&&"inherit"!==this.data.numbersfontName?"font-family:".concat(this.data.numbersfontName,"_").concat(this.data.numbersfontStyle.match(/.+\/([^.]+)\.(otf|ttf)$/)[1],";"):this.data.numbersfontStyle||"",";\n }\n\n .abtasty-countdown .abtasty-countdown-elm-text,\n .abtasty-countdown .abtasty-countdown-elm-text * {\n ").concat(this.data.legendfontName&&"inherit"!==this.data.legendfontName?"font-family:".concat(this.data.legendfontName,"_").concat(this.data.legendfontStyle.match(/.+\/([^.]+)\.(otf|ttf)$/)[1],";"):this.data.legendfontStyle||"",";\n font-size: ").concat(this.data.legendfontSize,"px; \n color: ").concat(this.data.legendtextColor,";\n -webkit-text-fill-color: ").concat(this.data.legendtextColor,";\n }\n\n .abtasty-countdown .abtasty-countdown-elm-time {\n border-radius: ").concat(this.data.countdownBorderRadius,"px;\n border: ").concat(this.data.countdownBorderWidth,"px solid ").concat(this.data.countdownBorderColor,";\n background-color: ").concat(this.data.numbersBackgroundColor,"; \n } \n ")}},{key:"setButton",value:function(){var t=this,e=function(e,n,o,i){var s=t.parentContainer.uniqueId,r=document.createElement("a");return r.className="popin_link_".concat(s),r.innerHTML="<span>".concat(e,"</span>"),r.href="button"===n?o:"#","button"===n?(r.target=i?"_blank":"_self",t.addRedirectionEvent(r)):(r.dataset.abtastyActionnable="true",t.addCloseEvent(r)),r},n=DATA,o=n.linkType,i=n.buttonText,s=n.redirectionUrl,r=n.openInNewTab,a=n.secondLink,c=n.secondLinkText,l=n.secondLinkType,d=n.secondLinkURL,u=n.secondLinkOpenInNewTab,h=n.endBtnTargetBlank,m=n.endBtnLabel,g=n.endBtnLink,p=this.container.querySelector(".abtasty-countdown-bottom-button"),y=[];if(o&&o.includes("button")){var b=e(i,o,s,r);if(y.push(b),a){var w=e(c,l,d,u);y.push(w)}}y.forEach(function(t){return p.appendChild(t)});var f=this.container.querySelector(".abtasty-countdown-finish-button"),v=document.createElement("a");v.href=g,v.target=h?"_blank":"_self",v.innerHTML=m,f.appendChild(v)}},{key:"setContent",value:function(){var t=this.container.querySelector(".abtasty-countdown-top-message"),e=document.createElement("p");e.innerHTML=this.data.message,t.appendChild(e);var n=this.container.querySelector(".abtasty-countdown-finish-text"),o=document.createElement("div");o.innerHTML=this.data.endMessage,n.appendChild(o)}},{key:"init",value:function(t){var e,n,s=this,r=this.data,a=r.layout,c=r.inlineLayoutContent,l=r.imageOn;try{this.parentContainer=t;var d=function(e){s.container.classList.add("abtasty-countdown-layout-".concat(e)),e===nt&&(["free","popin"].includes(a)&&(s.parentContainer.domElement.querySelector(".".concat(t.contentClassName)).classList.add("abtasty-countdown-content-".concat(a,"-inline")),s.container.classList.add("abtasty-countdown-layout-".concat(a,"-inline"))),s.parentContainer.domElement.querySelectorAll(".".concat(t.closeButtonClassName)).forEach(function(t){return t.classList.add("abtasty-countdown-close-inline")}))};switch(a){case"bannerTop":case"bannerBottom":d(nt);break;case"free":d(c?nt:ot);break;case"popin":if(d(c?nt:ot),l){var u=this.data.image,h=new Image;h.src=u,h.classList.add("abtasty-countdown-image"),h.onload=function(){var t=o(i.mark(function t(){var e,n;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=document.querySelector(".countdown_popin_img_container"),n="margin-bottom:20px; width:100%;","https://widgets-images.abtasty.com/widgets-default-image.png"===u&&(n="".concat(n," width:300px !important; height:220px;")),h.style=n,e.appendChild(h);case 5:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}()}break;default:d("block")}this.container.innerHTML="\n ".concat(l&&"popin"===a?'<div class="countdown_popin_img_container"></div>':"",'\n <div class="abtasty-countdown-layout-').concat(a,'">\n <div class="abtasty-countdown-clock">\n <div class="abtasty-countdown-days abtasty-countdown-elm-time">\n <div class="abtasty-countdown-days__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-days__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-hours abtasty-countdown-elm-time">\n <div class="abtasty-countdown-hours__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-hours__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-minutes abtasty-countdown-elm-time">\n <div class="abtasty-countdown-minutes__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-minutes__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-seconds abtasty-countdown-elm-time">\n <div class="abtasty-countdown-seconds__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-seconds__text abtasty-countdown-elm-text"></div>\n </div>\n </div>\n <div class="abtasty-countdown-top-message"></div>\n <div class="abtasty-countdown-finish-text"></div>\n <div class="abtasty-countdown-finish-button"></div>\n <div class="abtasty-countdown-bottom-button"></div>\n </div>\n '),this.container.insertAdjacentElement("afterbegin",(e="".concat(".abtasty-countdown,.abtasty-countdown>div{display:inline-block;text-align:center}.abtasty-countdown>div{margin:10px;white-space:normal}.abtasty-countdown .countdown_popin_img_container{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.abtasty-countdown .abtasty-countdown-finish-text,.abtasty-countdown .abtasty-countdown-top-message{margin-bottom:15px}.abtasty-countdown .abtasty-countdown-elm-time{display:inline-block;padding:6px;margin:6px 6px 15px}.abtasty-countdown .abtasty-countdown-elm-text{text-align:center}.abtasty-countdown .abtasty-countdown-elm-number,.abtasty-countdown .abtasty-countdown-elm-text{font-weight:700;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}.abtasty-countdown .abtasty-countdown-bottom-button a,.abtasty-countdown .abtasty-countdown-finish-button a{cursor:pointer;text-decoration:none;display:block;text-align:center;display:inline-block;padding:6px 10px}.abtasty-countdown-layout-line>div{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:stretch;-ms-flex-pack:stretch;justify-content:stretch}@media (max-width:740px){.abtasty-countdown-layout-line>div:not(.abtasty-countdown-layout-popin){-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.abtasty-countdown-layout-line div.abtasty-countdown-finish-text,.abtasty-countdown-layout-line div.abtasty-countdown-top-message{margin-bottom:20px;margin-top:20px}.abtasty-countdown-layout-line div.abtasty-countdown-bottom-button a{margin-left:0}}.abtasty-countdown-layout-line>div>div{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.abtasty-countdown-layout-free{display:block;text-align:center}.abtasty-countdown-layout-line>div{margin:0}.abtasty-countdown-layout-line .abtasty-countdown-finish-text,.abtasty-countdown-layout-line .abtasty-countdown-top-message{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 5px 0 15px;margin-bottom:0}.abtasty-countdown-layout-line .abtasty-countdown-top-message p{margin-bottom:0}.abtasty-countdown-layout-line .abtasty-countdown-bottom-button a{margin-left:30px}.abtasty-countdown-layout-line .abtasty-countdown-elm-time{margin:0}.abtasty-countdown-layout-line{-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-countdown-layout-line .abtasty-countdown-bottom-button,.abtasty-countdown-layout-line .abtasty-countdown-clock,.abtasty-countdown-layout-line .abtasty-countdown-finish-button{-ms-flex-negative:0;flex-shrink:0}.abtasty-countdown-finish-button,.abtasty-countdown-finish-text{display:none}.abtasty-countdown-endButton-show .abtasty-countdown-finish-button,.abtasty-countdown-endCountdown-show.abtasty-countdown-clock,.abtasty-countdown-endText-show .abtasty-countdown-finish-text{display:block}.abtasty-countdown-layout-line.abtasty-countdown-endButton-show .abtasty-countdown-finish-button,.abtasty-countdown-layout-line.abtasty-countdown-endCountdown-show .abtasty-countdown-clock,.abtasty-countdown-layout-line.abtasty-countdown-endText-show .abtasty-countdown-finish-text{display:table-cell}.abtasty-countdown-endButton-hide .abtasty-countdown-finish-button,.abtasty-countdown-endCountdown-hide .abtasty-countdown-clock,.abtasty-countdown-endText-hide .abtasty-countdown-finish-text,.abtasty-countdown-finish .abtasty-countdown-bottom-button,.abtasty-countdown-finish .abtasty-countdown-top-message{display:none!important}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:55%!important}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-button,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-button{width:45%!important}.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:30%!important}.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom .abtasty-countdown-clock,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-button,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-button{width:35%!important}.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:65%}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop,.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop{width:100%}.abtasty-countdown-content-popin-inline{min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;max-width:inherit}.abtasty-countdown-content-free-inline{max-width:100%}@media (max-width:570px){.abtasty-countdown-layout-free,.abtasty-countdown-layout-popin{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}}.abtasty-countdown-layout-popin{min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}"," ").concat(this.getStyle()),(n=document.createElement("style")).type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),n)),tt.forEach(function(t){var e=s.container.querySelector(".abtasty-countdown-".concat(t,"s")),n=J(e.children,2),o=n[0],i=n[1];s.digitElements[t]=o,s.textElements[t]=i,s.timeElements[t]=e}),this.setContent(),this.setButton(),this.timeLoop=setInterval(this.setCountdown.bind(this),1e3),setTimeout(function(){s.setCountdown()},100),this.setCountdown()}catch(t){console.warn("Countdown error occured during widget rendering:",t)}}},{key:"loadFonts",value:function(){this.getFonts().forEach(function(t){var e=t.name,n=t.style;if(e&&"inherit"!==e){var o=document.createElement("style");o.appendChild(document.createTextNode(" @font-face { font-family: '".concat(e,"_").concat(n.match(/.+\/([^.]+)\.(otf|ttf)$/)[1],"'; src: url('").concat(n,"'); } "))),document.head.appendChild(o)}})}}]),t}();function ct(){return(ct=o(i.mark(function t(){var e,n,o;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=F(),t.next=3,e.init();case 3:if(t.sent){t.next=6;break}return t.abrupt("return",!1);case 6:return n=e.domElement.querySelector(".".concat(e.contentClassName)),(o=new at(TEST_ID,DATA)).init(e),o.insert(n,"beforeend"),e.show(),t.abrupt("return",o);case 12:case"end":return t.stop()}},t)}))).apply(this,arguments)}!function(){ct.apply(this,arguments)}()}(); | ||
!function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=t(e(function(t){function e(t,e,n,o,i,s,r){try{var a=t[s](r),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(o,i)}t.exports=function(t){return function(){var n=this,o=arguments;return new Promise(function(i,s){var r=t.apply(n,o);function a(t){e(r,i,s,a,c,"next",t)}function c(t){e(r,i,s,a,c,"throw",t)}a(void 0)})}},t.exports.default=t.exports,t.exports.__esModule=!0})),o=e(function(t){var e=function(t){var e,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",r=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof p?e:p,s=Object.create(i.prototype),r=new k(o||[]);return s._invoke=function(t,e,n){var o=u;return function(i,s){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw s;return B()}for(n.method=i,n.arg=s;;){var r=n.delegate;if(r){var a=C(r,n);if(a){if(a===y)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===u)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=d(t,e,n);if("normal"===c.type){if(o=n.done?g:h,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}(t,n,r),s}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var u="suspendedStart",h="suspendedYield",m="executing",g="completed",y={};function p(){}function w(){}function b(){}var f={};c(f,s,function(){return this});var v=Object.getPrototypeOf,x=v&&v(v(L([])));x&&x!==n&&o.call(x,s)&&(f=x);var T=b.prototype=p.prototype=Object.create(f);function S(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function $(t,e){function n(i,s,r,a){var c=d(t[i],t,s);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&o.call(u,"__await")?e.resolve(u.__await).then(function(t){n("next",t,r,a)},function(t){n("throw",t,r,a)}):e.resolve(u).then(function(t){l.value=t,r(l)},function(t){return n("throw",t,r,a)})}a(c.arg)}var i;this._invoke=function(t,o){function s(){return new e(function(e,i){n(t,o,e,i)})}return i=i?i.then(s,s):s()}}function C(t,n){var o=t.iterator[n.method];if(o===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method))return y;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var s=i.arg;return s?s.done?(n[t.resultName]=s.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(t){if(t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,r=function n(){for(;++i<t.length;)if(o.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return r.next=r}}return{next:B}}function B(){return{value:e,done:!0}}return w.prototype=b,c(T,"constructor",b),c(b,"constructor",w),w.displayName=c(b,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,a,"GeneratorFunction")),t.prototype=Object.create(T),t},t.awrap=function(t){return{__await:t}},S($.prototype),c($.prototype,r,function(){return this}),t.AsyncIterator=$,t.async=function(e,n,o,i,s){void 0===s&&(s=Promise);var r=new $(l(e,n,o,i),s);return t.isGeneratorFunction(n)?r:r.next().then(function(t){return t.done?t.value:r.next()})},S(T),c(T,a,"Generator"),c(T,s,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var o=e.pop();if(o in t)return n.value=o,n.done=!1,n}return n.done=!0,n}},t.values=L,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(o,i){return a.type="throw",a.arg=t,n.next=o,i&&(n.method="next",n.arg=e),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var r=this.tryEntries[s],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var c=o.call(r,"catchLoc"),l=o.call(r,"finallyLoc");if(c&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var r=s?s.completion:{};return r.type=t,r.arg=e,s?(this.method="next",this.next=s.finallyLoc,y):this.complete(r)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if("throw"===o.type){var i=o.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:L(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}});const i=()=>Object.prototype.hasOwnProperty.call(window,"ABTastyEditor"),s=()=>{let t;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?t=window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?t=window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings&&(t=window.ABTasty.accountSettings.identifier),t):t},r=()=>{const t=!!document.getElementById("ABTastyPreviewBar"),e=location.href.includes("ab_project=preview");return t||e},a=()=>!i()&&(r()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),c=()=>window.ABTasty&&!0===window.ABTasty.consentReady,l="remove",d="rebuild",u="https://api-social-proof.abtasty.com/clients/",h=()=>{const{type:t}=DATA;return`${PACKAGE.replace("@abtasty/","")}${t?`_${t}`:""}`},m=()=>{const t=h();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`.split("-").join(" ")},g=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,y=t=>{if((()=>{if(i()||r())return!1;const t=ABTasty.getTestsOnPage()[TEST_ID];return!!t&&Object.keys(t.targetings.qaParameters).length>0})()){const e=m();window.console.log(`%c${e} - QA Mode for campaign ${TEST_ID}\n${t}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}},p=t=>{const e={promise:null,resolve:null,reject:null,name:t};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e},w=(t,e)=>{const n=()=>{try{return document.querySelector(t)}catch(t){return null}};let o=n();const i=[document.body||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],s=()=>a.disconnect(),r=()=>a.observe(...i),a=new MutationObserver(()=>(o=n(),o&&!s()&&e(o)));return o?setTimeout(()=>e(o),0):r(),{selector:t,clear:s,observe:r}};function b(t,e){return e(t)||!t.parentElement?t:b(t.parentElement,e)}const f=t=>{i()||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())},v=(t,e)=>[...document.querySelectorAll(e)].some(n=>n.isSameNode(t)||!!t.closest(e));class x{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=this.startVisibilityObserver(),this.mutationObserver=this.startMutationObserver(),this.mouseOverEvent=this.mouseOverHandler()}intersectionHandler(t){t.forEach(t=>{t.isIntersecting?(this.existingTargets.forEach(e=>{e.element.isSameNode(t.target)&&(this.inViewportTargets.push(e),this.mouseOverEvent.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(e=>!e.element.isSameNode(t.target)||(this.mouseOverEvent.clear(),!1))})}startVisibilityObserver(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:0})}startMutationObserver(){const t=this.mutationObserver||new MutationObserver(this.checkElements.bind(this));return document.body&&t.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),t}onMouseOver({target:t,path:e}){const n=this.inViewportTargets.find(({element:n,selector:o})=>{if(n.isSameNode(t))return!0;const i=[...t.querySelectorAll(o)];if(i.length&&i.includes(n))return!0;if(e.includes(n))return!0;const s=[...t.parentElement.children],r=s.findIndex(e=>e.isSameNode(t)),a=s.filter((t,e)=>e>r);if(a.length){if(a.includes(n))return!0;if(a.some(t=>[...t.querySelectorAll(o)].includes(n)))return!0}return!1});if(n&&this.isElementVisible(n.element)){const{selector:t,element:e,uniqueId:o}=n,i=this.targets.find(e=>e.selector===t&&e.uniqueId===o);i&&i.resolve(e),this.clear(t,o)}}mouseOverHandler(){const t=["mouseover",t=>setTimeout(()=>this.onMouseOver(t),50),!0];return{start:()=>document.addEventListener(...t),clear:()=>document.removeEventListener(...t)}}isElementVisible(t){return this.isElementTopmost(t)&&this.isElementOpaque(t)}isElementOpaque(t){return"HTML"===b(t,t=>"0"===window.getComputedStyle(t).opacity).nodeName}isElementTopmost(t){const e=t.getBoundingClientRect(),n=[[e.left,e.top],[e.right,e.top],[e.left,e.bottom],[e.right,e.bottom],[e.left+e.width/2,e.top],[e.left+e.width/2,e.bottom],[e.left,e.height/2],[e.right,e.height/2],[e.left+e.left/2,e.height/2]];let o=!1,i=0;for(;!o&&i<n.length;){const e=document.elementFromPoint(...n[i]);o=t===e||t.contains(e),i+=1}return o}checkElements(){this.targets.forEach(({selector:t,uniqueId:e})=>{const n=document.querySelector(t);n&&!this.existingTargets.find(n=>n.element.matches(t)&&n.uniqueId===e)&&(this.existingTargets.push({element:n,selector:t,uniqueId:e}),this.visibilityObserver.observe(n))}),this.existingTargets=this.existingTargets.filter(({selector:t,element:e})=>!!document.querySelector(t)||(e&&this.visibilityObserver.unobserve(e),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:t,element:e,uniqueId:n})=>{if(e.matches(t)&&this.isElementVisible(e)){const o=this.targets.find(e=>e.selector===t&&e.uniqueId===n);return o&&o.resolve(e),this.clear(t,n),!1}return!0})}watch(t,e,n){this.targets.push({selector:t,resolve:e,uniqueId:n});const o=()=>{this.startMutationObserver(),this.checkElements()};document.body?o():w("body",o)}clear(t,e){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(n=>n.filter(({selector:n,uniqueId:o})=>n!==t&&o!==e));const n=document.querySelector(t);n&&this.visibilityObserver.unobserve(n),0===this.targets.length&&this.mutationObserver.disconnect(),0===this.inViewportTargets.length&&this.mouseOverEvent.clear()}}class T{constructor({triggerEvent:t,triggerSelector:e,triggerDelay:n}){this.event=t,this.selector=e&&e.length?e:"body",this.delay=1e3*n,this.elementsSelectors=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.visibilityObservers=[],this.elementsWaiters=[]}async onElementVisible({promise:t,resolve:e}){const n=p(`${this.event}DomReady`);this.promises.push(n);const o=await this.onPageLoad(n),i=await async function(){let t;return t=await("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||new Promise((t,e)=>{const n=window.document.getElementsByTagName("script")[0],o=window.document.createElement("script");o.src="",n.parentNode.insertBefore(o,n),o.onload=t,o.onerror=e})),t}(),s=new x;if(this.visibilityObservers.push(s),i&&o){const t=g();s.watch(this.selector,e,t)}return t}onPageLoad({promise:t,resolve:e}){const n=()=>"complete"===document.readyState;if(!n()){const o=["readystatechange",({isTrusted:t})=>t&&n()&&e(!0),{passive:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}return e(!0),t}onClick({promise:t,resolve:e}){const n=document.createElement("style");n.type="text/css",n.id=`Click_${g()}`,n.innerHTML=`${this.selector} {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}`,document.head.appendChild(n),this.elementsSelectors.push(`#${n.id}`);const o=["click",({isTrusted:t,target:n})=>t&&v(n,this.selector)&&e(!0),{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}onHover({promise:t,resolve:e}){const n=["mouseenter",({isTrusted:t,target:n})=>t&&v(n,this.selector)&&e(!0),{passive:!0,capture:!0}];return this.eventsListeners.push([document.documentElement,...n]),document.documentElement.addEventListener(...n),t}onExitIntent({promise:t,resolve:e}){const n=["mouseleave",({isTrusted:t,clientY:n})=>{t&&n<=0&&e(!0)},{passive:!0}],o=w("body",t=>{this.eventsListeners.push([t,...n]),t.addEventListener(...n),this.elementsWaiters=this.elementsWaiters.filter(t=>t!==o)});return this.elementsWaiters.push(o),t}onReengage({promise:t,resolve:e}){const n=this.delay;let o=n;const i=[({isTrusted:t})=>{t&&(o=n)},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(t=>{this.eventsListeners.push([document,t,...i]),document.addEventListener(t,...i)});const s=setInterval(()=>{o<=0?e(!0):o-=100},100);return this.intervals.push(s),t}onCustomTrigger({promise:t,resolve:e}){const{triggerEventCustomScript:n}=DATA;return new Function(`return new Promise(async resolve => {${n}})`)().then(t=>t&&e(!0)),t}onScrollUp({promise:t,resolve:e}){let n=0;const o=["scroll",({isTrusted:t})=>{t&&(window.pageYOffset<n?e(!0):n=window.pageYOffset)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}onScrollPercentReached({promise:t,resolve:e}){const{triggerEventScrollPercent:n}=DATA,o=["scroll",({isTrusted:t})=>{if(!t)return;const o=(()=>{const{documentElement:t,body:e}=document,n=t.scrollTop||e.scrollTop,o=t.scrollHeight||e.scrollHeight;return Math.trunc(n/(o-t.clientHeight)*100,10)})();n<o&&e(!0)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}getSocialProofPurchases({promise:t,resolve:e}){const n=window.ABTastyProductKey,o=s(),{viewInterval:i,triggerSocialProofMinPurchases:r,spNoTrim:a}=DATA;return n||(y("Not able to find ABTastyProductKey, impossible to call the API."),e(!1)),n&&o?fetch(`${u}${o}/metrics/i?key=${n}${a?"&noTrim=true":""}`).then(t=>t.ok&&t.json()).then(t=>(t=>{if(void 0===i||void 0===r)return!1;const e=void 0!==t[i]&&t[i]>=r;return e||y(`Widget will not be shown, product has been purchased ${t[i]} times while ${r} are required`),e})(t)&&e(`${t[i]}`)).catch(()=>y("Failed to fetch datas from server.")):e(!1),t}getSocialProofPageViews({promise:t,resolve:e}){const{viewInterval:n,triggerSocialProofMinPageViews:o,spNoTrim:i}=DATA,r=encodeURIComponent(i?window.location.href.replace(window.location.origin,""):`${window.location.pathname}`),a=s();return r&&a?fetch(`${u}${a}/metrics/pv?key=${r}${i?"&noTrim=true":""}`).then(t=>t.ok&&t.json()).then(t=>(t=>{if(void 0===n||void 0===o)return!1;const e=void 0!==t[n]&&t[n]>=o;return e||y(`Widget will not be shown, page has been seen ${t[n]} times while ${o} are required`),e})(t)&&e(`${t[n]}`)).catch(()=>y("Failed to fetch datas from server.")):e(!1),t}onConsent({promise:t,resolve:e}){if(!c()){const n=["abtasty_consentValid",()=>e(!0)];return this.eventsListeners.push(n),window.addEventListener(...n),t}return e(!0),t}onTrackingSent({promise:t,resolve:e}){const{triggerEventTrackingSent:n}=DATA;let o=localStorage.getItem("ABTastyData");const i=()=>JSON.parse(o).ActionTracking.find(({name:t})=>t===n),s=["storage",()=>{o=localStorage.getItem("ABTastyData"),i()&&e(!0)},{passive:!0,capture:!0}];return o&&i()?e(!0):(()=>{this.eventsListeners.push([window,...s]),window.addEventListener(...s)})(),t}onMinPagesViewed({promise:t,resolve:e}){const{triggerEventMinPagesViewed:n}=DATA;let o=localStorage.getItem("ABTastyData");const i=()=>n<=(o?JSON.parse(o).VisitedPages.length:0),s=["storage",()=>{o=localStorage.getItem("ABTastyData"),i()&&e(!0)},{passive:!0,capture:!0}];return o&&i()?e(!0):(()=>{this.eventsListeners.push([window,...s]),window.addEventListener(...s)})(),t}onRageClick({promise:t,resolve:e}){const{triggerEventRageClickQuantity:n,triggerEventRageClickDelay:o}=DATA;let i=0,s=!1;const r=["click",({isTrusted:t})=>{t&&(i+=1,i>=n&&e(!0),s||(s=!0,setTimeout(()=>{i=0,s=!1},o)))},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...r]),document.addEventListener(...r),t}clear(){if(this.elementsSelectors.length&&(this.elementsSelectors.forEach(t=>{document.querySelector(t)&&document.querySelector(t).remove()}),this.elementsSelectors=[]),this.eventsListeners.length&&(this.eventsListeners.forEach(t=>{const[e,...n]=t;e&&n.length>1&&e.removeEventListener(...n)}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(t=>clearTimeout(t)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(t=>clearInterval(t)),this.intervals=[]),this.observers.length&&(this.observers.forEach(t=>t.disconnect()),this.observers=[]),this.visibilityObservers.length){const t=g();this.visibilityObservers.forEach(e=>e.clear(this.selector,t)),this.visibilityObservers=[]}return this.promises.length&&(this.promises.forEach(t=>t.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(t=>t.clear()),this.elementsWaiters=[]),this}async isTriggered(){this.clear();const t=p(this.event);this.promises.push(t);const e={consent:()=>this.onConsent(t),direct:()=>!0,pageLoad:()=>this.onPageLoad(t),click:()=>this.onClick(t),exitIntent:()=>this.onExitIntent(t),reengage:()=>this.onReengage(t),elementVisible:()=>this.onElementVisible(t),script:()=>this.onCustomTrigger(t),hover:()=>this.onHover(t),scrollUp:()=>this.onScrollUp(t),scrollPercent:()=>this.onScrollPercentReached(t),rageClick:()=>this.onRageClick(t),minPagesViewed:()=>this.onMinPagesViewed(t),trackingSent:()=>this.onTrackingSent(t),socialProofPurchases:()=>this.getSocialProofPurchases(t),socialProofPageViews:()=>this.getSocialProofPageViews(t)},n=!Object.prototype.hasOwnProperty.call(e,this.event)||await e[this.event]();return this.clear(),"reengage"!==this.event&&this.delay?n&&await(async()=>{const t=p(`${this.event}Delay`);return this.promises.push(t),setTimeout(()=>{t.resolve(!0),this.clear()},this.delay),t.promise})():n}}const S="closing",$="validation",C="ABTastyWidgets",E="ABTastyWidgetsTemporary";class A{constructor({displayRecurrence:t,closingRecurrence:e,validationRecurrence:n},o){this.displayRecurrence=parseFloat(t),this.closingRecurrence=parseFloat(e),this.validationRecurrence=parseFloat(n),this.onSetCallback=o,this.widgetName=h(),this.uniqueId=g(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`,this.isListeningStorageEvent=this.listenStorageEvent(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}onStorage({key:t}){const e=localStorage.getItem(E),n=sessionStorage.getItem(C);"ABTastyData"===t&&!e&&n&&localStorage.setItem(E,n)}listenStorageEvent(){return this.isListeningStorageEvent||window.addEventListener("storage",this.onStorage.bind(this)),!0}getGivenRecurrenceStorageParsed(t){try{const e=t.getItem(C);return JSON.parse(e)}catch(e){return t.removeItem(C),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(t,e){const{[this.recurrenceKey]:n,...o}=e;return Object.entries(o).length?(t.setItem(C,JSON.stringify(o)),o):(t.removeItem(C),!1)}removeSessionRecurrenceStorage(){const t=this.getSessionRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.sessionStorage,t)}removeLocalRecurrenceStorage(){const t=this.getLocalRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.localStorage,t)}getSessionRecurrence(){const t=this.getSessionRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}getLocalRecurrence(){const t=this.getLocalRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}getCurrentRecurrence(){if(this.pendingRecurrence)return this.pendingRecurrenceValue;const t=this.getSessionRecurrence(),e=this.getLocalRecurrence();return t||e||{type:!1}}isOver(){const t=localStorage.getItem(E),e=!(!t||!t.includes(this.recurrenceKey))||this.getSessionRecurrence();t&&(sessionStorage.setItem(C,t),localStorage.removeItem(E));const n=this.getLocalRecurrence(),o=(n?parseFloat(n.stamp):0)<(new Date).getTime();return o&&this.removeLocalRecurrenceStorage(),!this.pendingRecurrence&&o&&!this.getLocalRecurrence()&&!e}setRecurrence(t,e){0!==t&&(window.removeEventListener("storage",this.onStorage.bind(this)),this.isListeningStorageEvent=!1);const n=this.getTypeOfStorage(t);if(r()||!n&&"object"!=typeof n)return!1;const{storageString:o,storageMethod:i}=n,s=this.getStamp(t),a={type:e,stamp:s},{type:l}=this.getCurrentRecurrence(),d=async()=>{if(!c()){this.pendingRecurrence=!0,this.pendingRecurrenceValue=a;const t=new T({triggerEvent:"consent"});await t.isTriggered(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}const t=this.getSessionRecurrence(),e=this.getLocalRecurrence();let n;"session"===o?t?n=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),n=this.getSessionRecurrenceStorageParsed()):"local"===o&&(e?n=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),n=this.getLocalRecurrenceStorageParsed()));const s=n?{[this.recurrenceKey]:a,...n}:{[this.recurrenceKey]:a};i.setItem(C,JSON.stringify(s)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!i)return!1;if(l&&e!==$)if(e===S&&l!==$)d();else{if("display"!==e||l===$||l===S)return!1;d()}else d();return s}setDisplayRecurrence(){this.setRecurrence(this.displayRecurrence,"display")}setClosingRecurrence(){this.setRecurrence(this.closingRecurrence,"closing")}setValidationRecurrence(){this.setRecurrence(this.validationRecurrence,"validation")}getStamp(t){return(new Date).getTime()+864e5*t}getTypeOfStorage(t){return!(isNaN(t)||t<0||0!==t&&!t)&&(t>0?{storageString:"local",storageMethod:window.localStorage}:0===t&&{storageString:"session",storageMethod:window.sessionStorage})}}class k{constructor(t,e,n){this.recurrence=t,this.isWidgetApplied=e,this.callback=n,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=["abtasty_resetActionTracking",this.eventHandler.bind(this),{passive:!0}],this.elementsWaiters=[]}recurrenceIsDone(){return!this.recurrence||this.recurrence.isOver()}decisionHandler(t){const e=a(),{type:n}=this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1};let o;const i=this.isWidgetApplied(),s=(()=>{const e=this.recurrenceIsDone();return t&&"display"===n||e})();return!i&&e&&s?o=d:(i&&(!e||!s)||!i&&!e)&&(o=l),"string"==typeof o&&(this.clearWatcher(),this.callback(o,t),this.watch()),this}eventHandler(){let t=a();return[250,500].forEach(e=>{setTimeout(()=>{const n=a();return 500===e&&n===t?this:(t=n,this.decisionHandler(!1))},e)}),this}observerHandler(t){return t.some(t=>["removedNodes","addedNodes"].some(e=>t[e]&&t[e].length))?this.decisionHandler(!0):this}watch(){if(i())return this;this.clearWatcher(),document.addEventListener(...this.eventListenerParams);const t=()=>{const t=[document.body,{childList:!0,subtree:!0}];this.observer.observe(...t)};return document.body?t():(()=>{const e=w("body",()=>{t(),this.elementsWaiters=this.elementsWaiters.filter(t=>t!==e)});this.elementsWaiters.push(e)})(),this}clearWatcher(){return document.removeEventListener(...this.eventListenerParams),this.elementsWaiters.length&&(this.elementsWaiters.forEach(t=>t.clear()),this.elementsWaiters=[]),this.observer.disconnect(),this}}const L=/.+\/([^.]+)\.(otf|ttf)$/;class B{constructor(){this.children=void 0,this.uniqueId=g(),this.widgetName=h(),this.prettyName=m(),this.recurrenceParams=(()=>{const{displayRecurrence:t,closingRecurrence:e,validationRecurrence:n}=DATA;if(i()||!t&&!e&&!n)return!1;const o={everytime:()=>-1,session:()=>0,once:()=>395,day:t=>DATA[`${t}_day`],week:t=>7*DATA[`${t}_week`],month:t=>30.5*DATA[`${t}_month`]},s={};return t&&(s.displayRecurrence=o[t]("displayRecurrence")),e&&(s.closingRecurrence=o[e]("closingRecurrence")),n&&(s.validationRecurrence=o[n]("validationRecurrence")),s})(),this.triggerParams=(()=>{let{triggerEvent:t}=DATA;const{triggerEventClick:e,triggerEventHover:n,triggerEventReengageDelay:o,socialProofContentType:s,triggerEventElementVisible:r,triggerEventDelay:a}=DATA;if(i()||!t&&!s)return!1;const c={click:()=>e,hover:()=>n,elementVisible:()=>r},l=Object.prototype.hasOwnProperty.call(c,t)?c[t]():"body",d="reengage"===t?o:a;return s&&(t=1===s?"socialProofPurchases":"socialProofPageViews"),{triggerEvent:t,triggerSelector:l,triggerDelay:d}})(),this.recurrence=!!this.recurrenceParams&&new A(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new T(this.triggerParams),this.pageWatcher=new k(this.recurrence,this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:t,triggerEvent:e}=DATA;return!e||!["click","hover","scrollUp","script"].includes(e)||t})(),this.basicClassName=`ab_widget_container_${this.widgetName}`,this.widgetContainerId=`${this.basicClassName}_${this.uniqueId}`,this.contentClassName=`${this.basicClassName}_content`,this.overlayClassName=`${this.basicClassName}_overlay`,this.closeButtonClassName=`${this.basicClassName}_close_button`,this.hideClassName=`ab_hide_${this.uniqueId}`,this.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.elementsWaiters=[]}clearGivenClearables(){this.eventsListeners.length&&(this.eventsListeners.forEach(t=>document.removeEventListener(...t)),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(t=>clearTimeout(t)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(t=>clearInterval(t)),this.intervals=[]),this.observers.length&&(this.observers.forEach(t=>t.disconnect()),this.observers=[]),this.promises.length&&(this.promises.forEach(t=>t.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(t=>t.clear()),this.elementsWaiters=[])}isWidgetApplied(){return this.domElement&&this.domElement.isConnected}removeOldDomElement(){const t=document.getElementById(this.widgetContainerId);return t&&t.remove(),this}async insert(){if(this.isWidgetApplied())return!1;const t=new Promise(t=>{const e=w("head",e=>{this.elementsWaiters=this.elementsWaiters.filter(({selector:t})=>"head"!==t),t(e.appendChild(this.styleElement))});this.elementsWaiters.push(e)}),e=new Promise(t=>{const{elementReferrer:e="body",referrerInsertType:n="beforeend"}="free"===DATA.layout?DATA:{},o=w(e,o=>{this.elementsWaiters=this.elementsWaiters.filter(t=>t.selector!==e),this.removeOldDomElement(),t(o.insertAdjacentElement(n,this.domElement))});this.elementsWaiters.push(o)});return Promise.all([e,t]).then(()=>this)}remove(){return this.pageWatcher.clearWatcher(),[this.domElement,this.styleElement].forEach(t=>t&&t.isConnected&&t.remove()),this.hasOncePerPageTrigger?this.pageWatcher.watch():i()||this.init().then(({response:t})=>t?this.show():this),this}show(){return i()||this.hasBeenShown&&this.hasOncePerPageTrigger||window.ABTastyEvent(`${this.prettyName} displayed`,null,TEST_ID),this.closedByUser=!1,setTimeout(()=>this.domElement.classList.remove(this.hideClassName),50),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(),this}hide(){return!i()&&this.hasBeenShown&&window.ABTastyEvent(`${this.prettyName} closed`,null,TEST_ID),this.closedByUser=!0,this.domElement.classList.add(this.hideClassName),this}async init(t){const e=i(),n=a(),o=this.trigger&&this.trigger.promises.length,s=!this.recurrence||this.recurrence.isOver();if(!e&&!n||o||!s)return!1;this.pageWatcher.watch();const r=e||!this.trigger||this.trigger&&await this.trigger.isTriggered();return!!r&&(await this.insert(),this.addCloseEvent(),e||t||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(r),{container:this,response:r})}onPageChange(t,e){const n=()=>this.init().then(({response:t})=>t&&this.show());e||(this.hasBeenShown=!1);const o=this.isWidgetApplied(),i={[l]:()=>{o?this.remove():(this.trigger&&this.trigger.clear(),this.pageWatcher.watch())},[d]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch():o||this.insert().then(t=>t.show()).catch(this.pageWatcher.watch):n()}};"function"==typeof i[t]&&i[t]()}addCloseEvent(...t){const{closeButton:e,overlay:n,overlayClickable:o,layout:s,animationDuration:r=1e3}=DATA,a=[];if(void 0!==n&&!0!==n||!0!==o||"popin"!==s||a.push(`.${this.overlayClassName}`),void 0!==e&&e&&a.push(`.${this.closeButtonClassName}`),!a.length)return this;const c=this.domElement.querySelectorAll(a.join(", "));return c.length?(t.push(...c),t.forEach(t=>{i()&&(t.dataset.abtastyActionnable="true"),t.addEventListener("click",t=>{f(t),this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(),setTimeout(()=>this.remove(),1.05*r)},{once:!0,capture:!0})}),this):this}getDom(){const{closeButton:t,layout:e,overlay:n=!0}=DATA,o=document.createElement("div");return o.className=`${this.basicClassName} ${this.hideClassName}`,o.id=this.widgetContainerId,o.innerHTML=`\n\t\t\t${"popin"===e&&!0===n?`<div class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t${t?`<button class="${this.closeButtonClassName}"><svg viewBox="0 0 16 16">\n\t<defs><path id="prefix__a" d="M12 4.991L11.009 4 8 7.009 4.991 4 4 4.991 7.009 8 4 11.009 4.991 12 8 8.991 11.009 12 12 11.009 8.991 8z"></path></defs>\n\t<g><use xlink:href="#prefix__a"></use></g>\n</svg></button>`:""}\n\t\t\t</div>`,o}loadFont(t,e){if(!t||"inherit"===t)return;const n=document.createElement("style"),o=e.match(L)?e.match(L)[1]:"";n.innerHTML=`@font-face { font-family: '${t}_${o}'; src: url('${e}');}`,document.head.appendChild(n)}getStyleTag(t="",e=DATA){const{noStyles:n,layout:o}=e,{backgroundColor:s,isBackgroundImage:r,backgroundImage:a,backgroundSize:c,backgroundPosition:l,backgroundRepeat:d,borderColor:u,borderRadius:h,borderWidth:m,textColor:g,textAlign:y,fontName:p,fontStyle:w,fontSize:b,isTitle:f,titleTextAlign:v,titleTextColor:x,titleFontName:T,titleFontStyle:S,titleFontSize:$,overlay:C,overlayColor:E,dropShadow:A,dropShadowColor:k,dropShadowBlur:B,containerMargin:_,containerPadding:I,closeButton:N,closeButtonPosition:P,closeButtonSize:R,closeButtonBorderRadius:O,closeButtonBorderWidth:D,closeButtonBorderColor:W,closeButtonColor:j,closeButtonBackgroundColor:M,buttonsBorderWidth:V,buttonsBorderColor:q,buttonsBorderRadius:H,buttonsBackgroundColor:F,buttonsTextColor:z,buttonsFontName:U,buttonsFontStyle:G,buttonsFontSize:Y,animation:K,animationDuration:J,animationBehaviour:Q,animationSlideDirection:Z}=n?{}:e,X=document.createElement("style");X.type="text/css",i()&&X.setAttribute("abtasty-script-added","true"),this.loadFont(p,w),this.loadFont(T,S),this.loadFont(U,G);const tt=`background: ${["string"==typeof s?s:"rgba(255, 255, 255, 1)",r&&"string"==typeof a&&a.length?`url(${a})`:"",r&&"string"==typeof l&&"100% 100%"!==c?l:"0 0",r&&"string"==typeof c?`/ ${c}`:"/ auto",r&&d&&!["cover","100% 100%"].includes(c)?"repeat":"no-repeat"].join(" ").trim()};`,et="number"==typeof m&&m>0,nt=`border: ${[et?`${m}px`:"unset",et?"solid":"",et&&"string"==typeof u&&u.length?u:""].join(" ").trim()};`,ot=void 0!==h?`border-radius: ${h}px;`:"",it=void 0!==g?`color: ${g}; fill: ${g}; -webkit-text-fill-color: ${g};`:"",st=void 0!==y?`text-align: ${y};`:"",rt=p&&"inherit"!==p?`font-family:${p}_${w.match(L)?w.match(L)[1]:""};`:w||"",at=b?`font-size: ${b}px;`:"",ct=void 0!==A&&A?`box-shadow: 0 5px ${B}px 0 ${k};`:"",lt=_ instanceof Array&&1===_.length&&_[0],dt=lt?`margin: ${lt.top}px ${lt.right}px ${lt.bottom}px ${lt.left}px;`:"",ut=lt?`margin: calc(${lt.top}px * 0.5) calc(${lt.right}px * 0.5) calc(${lt.bottom}px * 0.5) calc(${lt.left}px * 0.5);`:"",ht=I instanceof Array&&1===I.length&&I[0],mt=ht?`padding: ${ht.top}px ${ht.right}px ${ht.bottom}px ${ht.left}px;`:"",gt=ht?`padding: calc(${ht.top}px * 0.5) calc(${ht.right}px * 0.5) calc(${ht.bottom}px * 0.5) calc(${ht.left}px * 0.5);`:"",yt=void 0!==V&&V?`border-width: ${V}px; border-style: solid;`:"",pt=[q,V].every(t=>void 0!==t)&&V?`border-color: ${q};`:"",wt=void 0!==H?`border-radius: ${H}px;`:"",bt=void 0!==F?`background-color: ${F};`:"",ft=void 0!==z?`color: ${z}; fill: ${z}; -webkit-text-fill-color: ${z};`:"",vt=U&&"inherit"!==U?`font-family:${U}_${G.match(L)?G.match(L)[1]:""};`:G||"",xt=Y?`font-size: ${Y}px;`:"",Tt="popin"!==o||void 0!==C&&!0!==C?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==E?E:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),St="number"==typeof R?R:16,$t=St/2,Ct=n||void 0!==N&&N?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===P?`bottom: calc(100% + ${$t}px)`:`top: ${$t}px`)+";",`right: ${$t}px;`,"width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","outline: none;","padding: 0;","margin: 0;","line-height: 0;","z-index: 9;","number"==typeof O?`border-radius: ${O}px;`:"","number"==typeof D&&D>0?`border: ${D}px solid ${void 0!==W?W:"rgba(57, 57, 57, 1)"};`:"","string"==typeof M?`background-color: ${M};`:"","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;",`width: ${St}px;`,`height: ${St}px;`,"string"==typeof j?`fill: ${j};`:"","}"].join(""):"",Et=f&&"string"==typeof x?[`#${this.widgetContainerId} .${this.contentClassName} > * h1, `,`#${this.widgetContainerId} .${this.contentClassName} > * h2, `,`#${this.widgetContainerId} .${this.contentClassName} > * h3, `,`#${this.widgetContainerId} .${this.contentClassName} > * h4, `,`#${this.widgetContainerId} .${this.contentClassName} > * h5, `,`#${this.widgetContainerId} .${this.contentClassName} > * h6 {`,`color: ${x}; fill: ${x}; -webkit-text-fill-color: ${x};`,void 0!==v?`text-align: ${v};`:"",T&&"inherit"!==T?`font-family:${T}_${S.match(L)?S.match(L)[1]:""};`:S||"",$?`font-size: ${$}px;`:"","}"].join(""):"";let At="";if("string"==typeof K){const t=(J/1e3).toFixed(2),e=["top","bottom"].includes(Z),n=Number(e),o=[(["top","left"].includes(Z)?"-":"")+"100vmax",this.translateValues?this.translateValues[n]:"0"];e&&o.reverse(),At={none:[],fade:[`#${this.widgetContainerId} {`,`transition: opacity ${t}s ${Q};`,"}"],slide:[`.${this.hideClassName} .${this.overlayClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,`transition: opacity ${t}s ${Q};`,"}",`.${this.hideClassName} .${this.contentClassName} {`,`transform: translate(${o.join(", ")}) !important;`,"}",`#${this.widgetContainerId} .${this.contentClassName} {`,`transition: transform ${t}s ${Q};`,"}"]}[i()&&!ABTASTY_S.WIDGETS.animationChanged?"none":K].join("")}return X.textContent=[`.${this.hideClassName} {`,"opacity: 0 !important;","pointer-events: none;","}",`#${this.widgetContainerId} {`,"opacity: 1;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,tt,ot,nt,it,st,ct,dt,rt,at,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,it,st,rt,at,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",mt,rt,at,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a, `,`#${this.widgetContainerId} .${this.contentClassName} > * button {`,"box-sizing: border-box;","display: inline-block;",yt,pt,wt,bt,ft,vt,xt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a *, `,`#${this.widgetContainerId} .${this.contentClassName} > * button * {`,ft,vt,xt,"}","@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,ut,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,gt,"}","}",Tt,Ct,Et,At,`${t}`].join(""),X}}const _=["top: 0;","top: 50%;","bottom: 0;"],I=["left: 0;","left: 50%;","right: 0;"],N=t=>1===t?"-50%":0,P=()=>{if(Array.isArray(DATA.popinPosition)){const{popinPosition:[{x:t,y:e}]}=DATA,n=`translate(${N(e)}, ${N(t)});`;return`${_[t]}${I[e]}transform: ${n}`}return"left: 50%;top: 50%;transform: translate(-50%, -50%);"},R=()=>"autoWidth"in DATA&&!0===DATA.autoWidth,O=()=>{if(R())return"width: auto;height: auto;";const{popinPercentWidth:t,popinPixelsWidth:e,widthUnit:n,autoHeight:o,popinPercentHeight:i,popinPixelsHeight:s,heightUnit:r}=DATA;return`width: ${"px"===n?e:t}${n};height: ${o?"auto":`${"px"===r?s:i}${r}`};`};class D extends B{constructor(){super(),this.translateValues=Object.values(DATA.popinPosition[0]).map(t=>N(t)),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:t,zindexCustom:e,overlay:n}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;",`z-index: ${"custom"===t?e:t};`,"background: none;","pointer-events: "+(!1===n?"none":"all"),"}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;",P(),O(),"pointer-events: all","}",`${R()?"":[`#${this.widgetContainerId} .${this.contentClassName} > div {`,"height: 100%;","overflow: auto;","box-sizing: border-box;","}"].join("")}`,`${R()?"":["@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join("")}`].join("")}}class W extends B{constructor(){super(),this.position="string"==typeof DATA.layout&&"bannerTop"===DATA.layout?"top":"bottom",this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:t,zindexCustom:e}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;",`${this.position}: 0;`,"left: 0;","width: 100%;","height: auto;",`z-index: ${"custom"===t?e:t};`,"background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}class j extends B{constructor(){super(),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"width: auto;","height: auto;","margin: 0;","padding: 0;","background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}const M=()=>{const{layout:t}=DATA;let e;switch(t){case"popin":e=new D;break;case"bannerTop":case"bannerBottom":e=new W;break;case"free":e=new j;break;default:e=new B}return e};var V=e(function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0});t(V);var q=e(function(t){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,i,s=[],r=!0,a=!1;try{for(n=n.call(t);!(r=(o=n.next()).done)&&(s.push(o.value),!e||s.length!==e);r=!0);}catch(t){a=!0,i=t}finally{try{r||null==n.return||n.return()}finally{if(a)throw i}}return s}},t.exports.default=t.exports,t.exports.__esModule=!0});t(q);var H=e(function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o},t.exports.default=t.exports,t.exports.__esModule=!0});t(H);var F=e(function(t){t.exports=function(t,e){if(t){if("string"==typeof t)return H(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0});t(F);var z=e(function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0});t(z);var U=t(e(function(t){t.exports=function(t,e){return V(t)||q(t,e)||F(t,e)||z()},t.exports.default=t.exports,t.exports.__esModule=!0})),G=t(e(function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0})),Y=t(e(function(t){function e(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}t.exports=function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t},t.exports.default=t.exports,t.exports.__esModule=!0})),K=["fr","en","de","es"],J=["day","hour","minute","second"],Q={day:{en:"Day",fr:"Jour",es:"Dia",de:"Tag"},days:{en:"Days",fr:"Jours",es:"Dias",de:"Tage"},hour:{en:"Hour",fr:"Heure",es:"Hora",de:"Zeit"},hours:{en:"Hours",fr:"Heures",es:"Horas",de:"Stunden"},minute:"Min",second:{en:"Sec",fr:"Sec",es:"Seg",de:"Sek"}},Z="line",X="free",tt=window.ABTASTY_S&&ABTASTY_S.USER&&ABTASTY_S.USER.lang?ABTASTY_S.USER.lang.split("_")[0]:navigator.language.substr(0,2)||"en",et=function(t){return K.indexOf(t)>-1}(tt)?tt:"en",nt={day:Q.day[et],days:Q.days[et],hour:Q.hour[et],hours:Q.hours[et],minute:Q.minute,minutes:Q.minute,second:Q.second[et],seconds:Q.second[et]},ot=function(){function t(e,n){G(this,t),this.testId=e,this.data=n,this.targetselector=n.selector,this.container=this.createContainer(),this.digitElements={},this.textElements={},this.timeElements={},this.timeLoop=null,this.maxWidth=0,this.previewTime=172799,this.unitsText=nt,this.fonts=[],this.data.customTexts&&(this.unitsText={day:this.data.customDaysLabel,days:this.data.customDaysLabel,hour:this.data.customHoursLabel,hours:this.data.customHoursLabel,minute:this.data.customMinutesLabel,minutes:this.data.customMinutesLabel,second:this.data.customSecondsLabel,seconds:this.data.customSecondsLabel})}return Y(t,[{key:"getFonts",value:function(){return[{name:this.data.messageFontName,style:this.data.messageFontStyle},{name:this.data.numbersfontName,style:this.data.numbersfontStyle},{name:this.data.legendfontName,style:this.data.legendfontStyle}]}},{key:"remove",value:function(){var t=this,e=DATA.animationDuration;setTimeout(function(){return t.parentContainer.remove()},1.05*e)}},{key:"addCloseEvent",value:function(t){var e=this;t&&t.addEventListener("click",function(t){f(t),i()||e.parentContainer.recurrence.setClosingRecurrence(),e.parentContainer.hide(),e.remove()},{capture:!0,passive:!1})}},{key:"addRedirectionEvent",value:function(t){var e=this;!i()&&t&&t.addEventListener("click",function(){var t=DATA,n=t.autoHide,o=t.timeHide;n&&setTimeout(function(){e.parentContainer.hide(),e.remove()},1e3*o),e.parentContainer.recurrence.setValidationRecurrence()},{useCapture:!0,once:!0})}},{key:"createContainer",value:function(){var t=DATA,e=t.linkType,n=t.redirectionUrl,o=t.openInNewTab,i=document.createElement(e&&e.includes("widget")?"a":"div");switch(i.classList.add("abtasty-countdown"),e){case"widget":i.href=n,i.target=o?"_blank":"_self",this.addRedirectionEvent(i);break;case"widgetClose":i.href="#",i.dataset.abtastyActionnable="true",this.addCloseEvent(i)}return i}},{key:"insert",value:function(t,e){return t.insertAdjacentElement(e,this.container),this}},{key:"setText",value:function(t){var e=this;J.forEach(function(n){var o=t[n];String(o).length<2&&(o="0".concat(o)),e.digitElements[n].textContent=o,e.textElements[n].textContent=1===o?e.unitsText[n]:e.unitsText["".concat(n,"s")],e.maxWidth<e.digitElements[n].offsetWidth&&(e.maxWidth=e.digitElements[n].offsetWidth,e.digitElements[n].style.minWidth="".concat(e.maxWidth,"px"),window.requestAnimationFrame(function(){e.setText(t)})),e.digitElements[n].style.minWidth="".concat(e.maxWidth,"px")})}},{key:"onTimeEnd",value:function(){var t;if(clearInterval(this.timeLoop),"hideWidget"===this.data.endSettings)return this.parentContainer.hide(),void(this.parentContainer.domElement.style.display="none");var e={};"showText"===this.data.endSettings&&(e.endText=!0,e.endCountdown=!0,e.endButton=!1),"showTextAndButton"===this.data.endSettings&&(e.endText=!0,e.endButton=!0,e.endCountdown=!0),"hideCountdownAndShowText"===this.data.endSettings&&(e.endText=!0,e.endCountdown=!1,e.endButton=!1),"hideCountdownAndShowTextAndButton"===this.data.endSettings&&(e.endText=!0,e.endCountdown=!1,e.endButton=!0);var n=["abtasty-countdown-".concat(this.data.endSettings),"abtasty-countdown-finish"];Object.keys(e).forEach(function(t){e[t]&&!n.includes("abtasty-countdown-".concat(t,"-show"))?n.push("abtasty-countdown-".concat(t,"-show")):n.includes("abtasty-countdown-".concat(t,"-hide"))||n.push("abtasty-countdown-".concat(t,"-hide"))}),(t=this.container.classList).add.apply(t,n)}},{key:"setCountdown",value:function(){var t=new Date,e=function(t,e){switch(t.type){case"global":return t.timestamp-e.getTime();case"local":if(i())return t.previewTimestamp-e.getTime();var n=t.timecomponents,o=n.year,s=n.month,r=n.day,a=n.hour,c=n.minute;return new Date(o,s-1,r,a,c).getTime()-e.getTime();default:return 0}}(this.data.dateTime,t)/1e3;if(window.ABTastyEditor&&("ifEnded"===this.data.previewBlock&&(e=-1),this.previewTime-=1),e<=0)return this.setText({day:0,hour:0,minute:0,second:0}),void this.onTimeEnd();var n=Math.floor(e/86400);e-=86400*n;var o=Math.floor(e/3600);e-=3600*o;var s=Math.floor(e/60);e-=60*s;var r=Math.floor(e);this.setText({day:n,hour:o,minute:s,second:r})}},{key:"getStyle",value:function(){this.loadFonts();var t=DATA.buttonsAlign,e=void 0!==t&&"fill"!==t?"text-align: ".concat(t,";"):"";return"\n .abtasty-countdown-bottom-button,\n .abtasty-countdown-finish-button {\n ".concat(e,"\n }\n .abtasty-countdown-bottom-button a,\n .abtasty-countdown-finish-button a {\n width: ").concat("fill"===t?"100%":"auto",";\n }\n\n .abtasty-countdown .abtasty-countdown-finish-text,\n .abtasty-countdown .abtasty-countdown-top-message,\n .abtasty-countdown .abtasty-countdown-finish-text *,\n .abtasty-countdown .abtasty-countdown-top-message * {\n white-space: pre-line;\n text-align: ").concat(this.data.messageAlign," !important;\n color: ").concat(this.data.textColor,";\n font-size: ").concat(this.data.messageFontSize,"px; \n ").concat(this.data.messageFontName&&"inherit"!==this.data.messageFontName?"font-family:".concat(this.data.messageFontName,"_").concat(this.data.messageFontStyle.match(/.+\/([^.]+)\.(otf|ttf)$/)[1],";"):this.data.messageFontStyle||"",";\n }\n\n .abtasty-countdown .abtasty-countdown-elm-number,\n .abtasty-countdown .abtasty-countdown-elm-number * {\n font-size: ").concat(this.data.numbersfontSize,"px; \n color: ").concat(this.data.numberstextColor,";\n -webkit-text-fill-color: ").concat(this.data.numberstextColor,";\n font-weight: initial;\n ").concat(this.data.numbersfontName&&"inherit"!==this.data.numbersfontName?"font-family:".concat(this.data.numbersfontName,"_").concat(this.data.numbersfontStyle.match(/.+\/([^.]+)\.(otf|ttf)$/)[1],";"):this.data.numbersfontStyle||"",";\n }\n\n .abtasty-countdown .abtasty-countdown-elm-text,\n .abtasty-countdown .abtasty-countdown-elm-text * {\n ").concat(this.data.legendfontName&&"inherit"!==this.data.legendfontName?"font-family:".concat(this.data.legendfontName,"_").concat(this.data.legendfontStyle.match(/.+\/([^.]+)\.(otf|ttf)$/)[1],";"):this.data.legendfontStyle||"",";\n font-size: ").concat(this.data.legendfontSize,"px; \n color: ").concat(this.data.legendtextColor,";\n -webkit-text-fill-color: ").concat(this.data.legendtextColor,";\n }\n\n .abtasty-countdown .abtasty-countdown-elm-time {\n border-radius: ").concat(this.data.countdownBorderRadius,"px;\n border: ").concat(this.data.countdownBorderWidth,"px solid ").concat(this.data.countdownBorderColor,";\n background-color: ").concat(this.data.numbersBackgroundColor,"; \n } \n ")}},{key:"setButton",value:function(){if(!1!==this.data.linkType&&this.data.linkType.includes("button")){var t=DATA,e=t.linkType,n=t.buttonText,o=t.redirectionUrl,i=t.openInNewTab,s=this.container.querySelector(".abtasty-countdown-bottom-button"),r=document.createElement("a");r.innerHTML=n,"button"===e?(r.href=o,r.target=i?"_blank":"_self",this.addRedirectionEvent(r)):(r.href="#",r.dataset.abtastyActionnable="true",this.addCloseEvent(r)),s.appendChild(r)}var a=this.container.querySelector(".abtasty-countdown-finish-button"),c=document.createElement("a");c.href=this.data.endBtnLink,this.data.endBtnTargetBlank&&(c.target="_blank"),c.innerHTML=this.data.endBtnLabel,a.appendChild(c)}},{key:"setContent",value:function(){var t=this.container.querySelector(".abtasty-countdown-top-message"),e=document.createElement("p");e.innerHTML=this.data.message,t.appendChild(e);var n=this.container.querySelector(".abtasty-countdown-finish-text"),o=document.createElement("div");o.innerHTML=this.data.endMessage,n.appendChild(o)}},{key:"init",value:function(t){var e,i,s=this,r=this.data,a=r.layout,c=r.inlineLayoutContent,l=r.imageOn;try{this.parentContainer=t;var d=function(e){s.container.classList.add("abtasty-countdown-layout-".concat(e)),e===Z&&(["free","popin"].includes(a)&&(s.parentContainer.domElement.querySelector(".".concat(t.contentClassName)).classList.add("abtasty-countdown-content-".concat(a,"-inline")),s.container.classList.add("abtasty-countdown-layout-".concat(a,"-inline"))),s.parentContainer.domElement.querySelectorAll(".".concat(t.closeButtonClassName)).forEach(function(t){return t.classList.add("abtasty-countdown-close-inline")}))};switch(a){case"bannerTop":case"bannerBottom":d(Z);break;case"free":d(c?Z:X);break;case"popin":if(d(c?Z:X),l){var u=this.data.image,h=new Image;h.src=u,h.classList.add("abtasty-countdown-image"),h.onload=function(){var t=n(o.mark(function t(){var e,n;return o.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=document.querySelector(".countdown_popin_img_container"),n="margin-bottom:20px; width:100%;","https://widgets-images.abtasty.com/widgets-default-image.png"===u&&(n="".concat(n," width:300px !important; height:220px;")),h.style=n,e.appendChild(h);case 5:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}()}break;default:d("block")}this.container.innerHTML="\n ".concat(l&&"popin"===a?'<div class="countdown_popin_img_container"></div>':"",'\n <div class="abtasty-countdown-layout-').concat(a,'">\n <div class="abtasty-countdown-clock">\n <div class="abtasty-countdown-days abtasty-countdown-elm-time">\n <div class="abtasty-countdown-days__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-days__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-hours abtasty-countdown-elm-time">\n <div class="abtasty-countdown-hours__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-hours__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-minutes abtasty-countdown-elm-time">\n <div class="abtasty-countdown-minutes__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-minutes__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-seconds abtasty-countdown-elm-time">\n <div class="abtasty-countdown-seconds__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-seconds__text abtasty-countdown-elm-text"></div>\n </div>\n </div>\n <div class="abtasty-countdown-top-message"></div>\n <div class="abtasty-countdown-finish-text"></div>\n <div class="abtasty-countdown-finish-button"></div>\n <div class="abtasty-countdown-bottom-button"></div>\n </div>\n '),this.container.insertAdjacentElement("afterbegin",(e="".concat(".abtasty-countdown,.abtasty-countdown>div{display:inline-block;text-align:center}.abtasty-countdown>div{margin:10px;white-space:normal}.abtasty-countdown .countdown_popin_img_container{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.abtasty-countdown .abtasty-countdown-finish-text,.abtasty-countdown .abtasty-countdown-top-message{margin-bottom:15px}.abtasty-countdown .abtasty-countdown-elm-time{display:inline-block;padding:6px;margin:6px 6px 15px}.abtasty-countdown .abtasty-countdown-elm-text{text-align:center}.abtasty-countdown .abtasty-countdown-elm-number,.abtasty-countdown .abtasty-countdown-elm-text{font-weight:700;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}.abtasty-countdown .abtasty-countdown-bottom-button a,.abtasty-countdown .abtasty-countdown-finish-button a{cursor:pointer;text-decoration:none;display:block;text-align:center;display:inline-block;padding:6px 10px}.abtasty-countdown-layout-line>div{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:stretch;-ms-flex-pack:stretch;justify-content:stretch}@media (max-width:740px){.abtasty-countdown-layout-line>div:not(.abtasty-countdown-layout-popin){-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.abtasty-countdown-layout-line div.abtasty-countdown-finish-text,.abtasty-countdown-layout-line div.abtasty-countdown-top-message{margin-bottom:20px;margin-top:20px}.abtasty-countdown-layout-line div.abtasty-countdown-bottom-button a{margin-left:0}}.abtasty-countdown-layout-line>div>div{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.abtasty-countdown-layout-free{display:block;text-align:center}.abtasty-countdown-layout-line>div{margin:0}.abtasty-countdown-layout-line .abtasty-countdown-finish-text,.abtasty-countdown-layout-line .abtasty-countdown-top-message{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 5px 0 15px;margin-bottom:0}.abtasty-countdown-layout-line .abtasty-countdown-top-message p{margin-bottom:0}.abtasty-countdown-layout-line .abtasty-countdown-bottom-button a{margin-left:30px}.abtasty-countdown-layout-line .abtasty-countdown-elm-time{margin:0}.abtasty-countdown-layout-line{-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-countdown-layout-line .abtasty-countdown-bottom-button,.abtasty-countdown-layout-line .abtasty-countdown-clock,.abtasty-countdown-layout-line .abtasty-countdown-finish-button{-ms-flex-negative:0;flex-shrink:0}.abtasty-countdown-finish-button,.abtasty-countdown-finish-text{display:none}.abtasty-countdown-endButton-show .abtasty-countdown-finish-button,.abtasty-countdown-endCountdown-show.abtasty-countdown-clock,.abtasty-countdown-endText-show .abtasty-countdown-finish-text{display:block}.abtasty-countdown-layout-line.abtasty-countdown-endButton-show .abtasty-countdown-finish-button,.abtasty-countdown-layout-line.abtasty-countdown-endCountdown-show .abtasty-countdown-clock,.abtasty-countdown-layout-line.abtasty-countdown-endText-show .abtasty-countdown-finish-text{display:table-cell}.abtasty-countdown-endButton-hide .abtasty-countdown-finish-button,.abtasty-countdown-endCountdown-hide .abtasty-countdown-clock,.abtasty-countdown-endText-hide .abtasty-countdown-finish-text,.abtasty-countdown-finish .abtasty-countdown-bottom-button,.abtasty-countdown-finish .abtasty-countdown-top-message{display:none!important}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:55%!important}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-button,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-button{width:45%!important}.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:30%!important}.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom .abtasty-countdown-clock,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-button,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-button{width:35%!important}.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:65%}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop,.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop{width:100%}.abtasty-countdown-content-popin-inline{min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;max-width:inherit}.abtasty-countdown-content-free-inline{max-width:100%}@media (max-width:570px){.abtasty-countdown-layout-free,.abtasty-countdown-layout-popin{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}}.abtasty-countdown-layout-popin{min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}"," ").concat(this.getStyle()),(i=document.createElement("style")).type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),i)),J.forEach(function(t){var e=s.container.querySelector(".abtasty-countdown-".concat(t,"s")),n=U(e.children,2),o=n[0],i=n[1];s.digitElements[t]=o,s.textElements[t]=i,s.timeElements[t]=e}),this.setContent(),this.setButton(),this.timeLoop=setInterval(this.setCountdown.bind(this),1e3),setTimeout(function(){s.setCountdown()},100),this.setCountdown()}catch(t){console.warn("Countdown error occured during widget rendering:",t)}}},{key:"loadFonts",value:function(){this.getFonts().forEach(function(t){var e=t.name,n=t.style;if(e&&"inherit"!==e){var o=document.createElement("style");o.appendChild(document.createTextNode(" @font-face { font-family: '".concat(e,"_").concat(n.match(/.+\/([^.]+)\.(otf|ttf)$/)[1],"'; src: url('").concat(n,"'); } "))),document.head.appendChild(o)}})}}]),t}();function it(){return(it=n(o.mark(function t(){var e,n,i;return o.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=M(),t.next=3,e.init();case 3:if(t.sent){t.next=6;break}return t.abrupt("return",!1);case 6:return n=e.domElement.querySelector(".".concat(e.contentClassName)),(i=new ot(TEST_ID,DATA)).init(e),i.insert(n,"beforeend"),e.show(),t.abrupt("return",i);case 12:case"end":return t.stop()}},t)}))).apply(this,arguments)}!function(){it.apply(this,arguments)}()}(); |
{ | ||
"name": "@abtasty/countdown", | ||
"description": "Widget for AB Tasty", | ||
"version": "3.5.2-0", | ||
"version": "3.5.2", | ||
"form": "dist/form.js", | ||
@@ -47,3 +47,3 @@ "main": "dist/main.js", | ||
"dependencies": { | ||
"@abtasty/widget-utils": "^1.18.25" | ||
"@abtasty/widget-utils": "^1.18.22" | ||
}, | ||
@@ -55,2 +55,2 @@ "snowpack": { | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
700511
3
0
2
0
4