@abtasty/widget-utils
Advanced tools
Comparing version 1.12.3-5 to 1.12.3-6
@@ -1,1 +0,1 @@ | ||
"use strict";function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var r,o;function n(r,o){try{var a=e[r](o),s=a.value,i=s instanceof _AwaitValue;Promise.resolve(i?s.wrapped:s).then(function(e){i?n("next",e):t(a.done?"return":"normal",e)},function(e){n("throw",e)})}catch(e){t("throw",e)}}function t(e,t){switch(e){case"return":r.resolve({value:t,done:!0});break;case"throw":r.reject(t);break;default:r.resolve({value:t,done:!1})}(r=r.next)?n(r.key,r.arg):o=null}this._invoke=function(e,t){return new Promise(function(a,s){var i={key:e,arg:t,resolve:a,reject:s,next:null};o?o=o.next=i:(r=o=i,n(e,t))})},"function"!=typeof e.return&&(this.return=void 0)}function _defineProperty(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function ownKeys(e,r){var o=Object.keys(e);return Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(e)),r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),o}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(o,!0).forEach(function(r){_defineProperty(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(o).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var r=0,o=new Array(e.length);r<e.length;r++)o[r]=e[r];return o}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}Object.defineProperty(exports,"__esModule",{value:!0}),"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};var originalBodyScroll,backgroundTranslations={en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},backgroundColorTranslations={en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},backgroundImageTranslations={en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},backgroundOpacityTranslations={en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},borderTranslations={en:"Border",fr:"Contour",es:"Borde",de:"Grenze"},borderColorTranslations={en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},borderRadiusTranslations={en:"Border radius",fr:"Arrondi du contour",es:"Contorno redondeado",de:"Abgerundeter Umriss"},borderWidthTranslations={en:"Border width",fr:"Épaisseur du contour",es:"Espesor del contorno.",de:"Dicke der Kontur"},everydayTranslations={en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},everyWeekTranslations={en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},everyMonthTranslations={en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},everySessionTranslations={en:"Every session",fr:"Chaque session",es:"En cada sesión",de:"Jede Session"},everytimeTranslations={en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},oncePerUserTranslations={en:"Once per user (no recurrence)",fr:"Une fois par visiteur (pas de récurrence)",es:"Una vez por usuario (sin recurrencia)",de:"Einmal pro User (keine Wiederholung)"},recurrenceTranslations={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},displayRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," of the display"),fr:"".concat(recurrenceTranslations.fr," de l'affichage"),es:"".concat(recurrenceTranslations.es," de la pantalla."),de:"".concat(recurrenceTranslations.de," der Anzeige")},closingRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after closure"),fr:"".concat(recurrenceTranslations.fr," après fermeture"),es:"".concat(recurrenceTranslations.es," después del cierre"),de:"".concat(recurrenceTranslations.de," nach Schließung")},validationRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after validation"),fr:"".concat(recurrenceTranslations.fr," après validation"),es:"".concat(recurrenceTranslations.es," después de la validación"),de:"".concat(recurrenceTranslations.de," nach der Validierung")},textColorTranslations={en:"Text color",fr:"Couleur du texte",es:"Color de texto",de:"Textfarbe"},closeButtonColorTranslations={en:"Close button color",fr:"Couleur du bouton de fermeture",es:"Color del botón de cierre",de:"Farbe der Schließen-Schaltfläche"},top={en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},bottom={en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},left={en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},right={en:"Right",fr:"Droite",es:"Derecha",de:"Recht"},pageLoadTranslations={en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},clickTranslations={en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},exitIntentTranslations={en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},delayTranslations={en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},reengageInactivityTranslations={en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},triggerOnTranslations={en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},triggerTranslations={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"},STYLE="style",LAYOUT="layout",CONTENT="content",CONDITIONS="conditions",GROUP="group",CHECKBOX="checkbox",COLOR_PICKER="colorpicker",SEPARATOR="separator",DATE_PICKER="datepicker",DATE_RANGE_PICKER="dateRangePicker",SELECT="select",MEDIA_UPLOAD="mediaupload",NUMBER="number",RADIO_BUTTON="radio",RADIO_IMAGE="radioImage",SLIDER="slider",SWITCH="switch",TEXT_FIELD="text",TEXT_AREA="textarea",TIME_PICKER="timepicker",SELECT_ELEMENT="selectelement",CUSTOM_TEXTS="customTexts",recurrencesOptions=[{label:everytimeTranslations,value:"-1"},{label:everySessionTranslations,value:"0"},{label:everydayTranslations,value:"1"},{label:everyWeekTranslations,value:"7"},{label:everyMonthTranslations,value:"30"},{label:oncePerUserTranslations,value:"365"}],commons={category:CONDITIONS,type:SELECT,options:recurrencesOptions,value:"-1"},closingRecurrenceForm=_objectSpread2({},commons,{label:closingRecurrenceTranslations,propName:"closingRecurrence"}),displayRecurrenceForm=_objectSpread2({},commons,{label:displayRecurrenceTranslations,propName:"displayRecurrence"}),validationRecurrenceForm=_objectSpread2({},commons,{label:validationRecurrenceTranslations,propName:"validationRecurrence"}),recurrencesGroup={category:CONDITIONS,type:GROUP,label:recurrenceTranslations,collapsible:!0,children:[displayRecurrenceForm,closingRecurrenceForm,validationRecurrenceForm]},triggersOptions=[{label:pageLoadTranslations,value:"pageLoad"},{label:clickTranslations,value:"click"},{label:exitIntentTranslations,value:"exitIntent"},{label:delayTranslations,value:"delay"},{label:reengageInactivityTranslations,value:"reengage"}],TRIGGER_EVENT="triggerEvent",triggerEventClick={category:CONDITIONS,type:SELECT_ELEMENT,propName:"".concat(TRIGGER_EVENT,"Click"),label:triggerTranslations,placeholder:{en:"Select an element in the webpage",fr:"Sélectionner un élément dans la page",es:"Selecciona un elemento en la página web",de:"Wählen Sie ein Element auf der Webseite aus"},conditions:[{field:TRIGGER_EVENT,value:"click"}]},triggerEventExitDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ExitDelay"),label:{en:"Delay after exit intent",fr:"Délai après intention de sortie",es:"Retraso después de la intención de salida",de:"Verzögerung nach Ausstiegsabsicht"},min:0,max:120,value:0,conditions:[{field:TRIGGER_EVENT,value:"exitIntent"}]},triggerEventReengageDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ReengageDelay"),label:{en:"Idle timeout before posting",fr:"Délai d'inactivité avant l'affichage",es:"Tiempo de espera inactivo antes de publicar",de:"Zeitüberschreitung vor dem Posten"},min:1,max:120,value:10,conditions:[{field:TRIGGER_EVENT,value:"reengage"}]},triggerEventDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"Delay"),label:{en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"",de:"Verzögerung vor dem Posten"},value:10,conditions:[{field:TRIGGER_EVENT,value:"delay"}]},conditionalFields=[triggerEventClick,triggerEventExitDelay,triggerEventReengageDelay,triggerEventDelay],triggersForm={category:CONDITIONS,type:SELECT,label:triggerOnTranslations,options:triggersOptions,propName:TRIGGER_EVENT,value:"pageLoad"},triggersGroup={category:CONDITIONS,type:GROUP,label:triggerTranslations,collapsible:!0,children:[triggersForm].concat(_toConsumableArray(conditionalFields))},isOnEditor=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},backgroundColorForm={category:STYLE,type:COLOR_PICKER,label:backgroundColorTranslations,propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},backgroundImageForm={category:STYLE,type:MEDIA_UPLOAD,label:backgroundImageTranslations,propName:"backgroundImage",value:""},backgroundOpacityForm={category:STYLE,type:SLIDER,label:backgroundOpacityTranslations,propName:"backgroundOpacity",value:75,unit:"%"},backgroundsGroup={category:STYLE,type:GROUP,label:backgroundTranslations,collapsible:!0,children:[backgroundColorForm,backgroundImageForm,backgroundOpacityForm]},borderColorForm={category:STYLE,type:COLOR_PICKER,label:borderColorTranslations,propName:"borderColor",value:"rgba(255, 255, 255, 1)"},borderRadiusForm={category:STYLE,type:SLIDER,label:borderRadiusTranslations,propName:"borderRadius",value:0,unit:"px"},borderWidthForm={category:STYLE,type:SLIDER,label:borderWidthTranslations,propName:"borderWidth",value:0,unit:"px"},bordersGroup={category:STYLE,type:GROUP,label:borderTranslations,collapsible:!0,children:[borderWidthForm,borderColorForm,borderRadiusForm]},textColorForm={category:STYLE,type:COLOR_PICKER,label:textColorTranslations,propName:"textColor",value:"rgba(255, 255, 255, 1)"};function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){originalBodyScroll&&(document.querySelector("body").style.overflowY=originalBodyScroll)}var loadImage=function(e){return new Promise(function(r,o){var n=new Image;n.onload=function(){r(n)},n.src=e,n.onerror=function(r){var n=new Error("Image ".concat(e," is not loaded."));o(n)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var r,o=0;document.addEventListener("mousemove",function(e){o=e.clientY}),document.body.addEventListener("mouseleave",function n(t){t.clientY<=50&&(o=0,clearInterval(r),r=setTimeout(function(){0===o&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e,r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];o.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(e=console).log.apply(e,o)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,r,o){var n,t=0;try{document.querySelector(e)}catch(r){var a="Selector «".concat(e,"» not valid.");return log(a),"function"==typeof o&&o(a)}n=setTimeout(function(){clearInterval(t);var r="Can't find element «".concat(e,"».");return log(r),"function"==typeof o&&o(r)},1e4),t=setInterval(function(){var o=document.querySelector(e);if(null!==o)return clearTimeout(n),clearInterval(t),"function"==typeof r&&r(o)},200)},getCookie=function(e){for(var r=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var t=o[n];" "==t.charAt(0);)t=t.substring(1);if(0===t.indexOf(r))return t.substring(r.length,t.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join(""));return e},setCookie=function(e,r,o){var n="";if(o){var t=new Date;t.setTime(t.getTime()+24*o*60*60*1e3),n="expires="+t.toUTCString()}var a="domain="+getHostname();document.cookie=e+"="+r+"; "+n+";"+a+";path=/"};exports.preventGlobalScroll=preventGlobalScroll,exports.allowGlobalScroll=allowGlobalScroll,exports.loadImage=loadImage,exports.isTouch=isTouch,exports.exitIntent=exitIntent,exports.log=log,exports.domReady=domReady,exports.waitForElement=waitForElement,exports.getCookie=getCookie,exports.getHostname=getHostname,exports.setCookie=setCookie,exports.closingRecurrenceForm=closingRecurrenceForm,exports.displayRecurrenceForm=displayRecurrenceForm,exports.validationRecurrenceForm=validationRecurrenceForm,exports.recurrencesGroup=recurrencesGroup,exports.triggersForm=triggersForm,exports.triggersGroup=triggersGroup,exports.isOnEditor=isOnEditor,exports.backgroundColorForm=backgroundColorForm,exports.backgroundImageForm=backgroundImageForm,exports.backgroundOpacityForm=backgroundOpacityForm,exports.backgroundsGroup=backgroundsGroup,exports.borderColorForm=borderColorForm,exports.borderRadiusForm=borderRadiusForm,exports.borderWidthForm=borderWidthForm,exports.bordersGroup=bordersGroup,exports.textColorForm=textColorForm,exports.backgroundImageTranslations=backgroundImageTranslations,exports.backgroundColorTranslations=backgroundColorTranslations,exports.backgroundTranslations=backgroundTranslations,exports.backgroundOpacityTranslations=backgroundOpacityTranslations,exports.borderTranslations=borderTranslations,exports.borderColorTranslations=borderColorTranslations,exports.borderRadiusTranslations=borderRadiusTranslations,exports.borderWidthTranslations=borderWidthTranslations,exports.everydayTranslations=everydayTranslations,exports.everyWeekTranslations=everyWeekTranslations,exports.everyMonthTranslations=everyMonthTranslations,exports.everySessionTranslations=everySessionTranslations,exports.everytimeTranslations=everytimeTranslations,exports.oncePerUserTranslations=oncePerUserTranslations,exports.recurrenceTranslations=recurrenceTranslations,exports.displayRecurrenceTranslations=displayRecurrenceTranslations,exports.closingRecurrenceTranslations=closingRecurrenceTranslations,exports.validationRecurrenceTranslations=validationRecurrenceTranslations,exports.textColorTranslations=textColorTranslations,exports.closeButtonColorTranslations=closeButtonColorTranslations,exports.top=top,exports.bottom=bottom,exports.left=left,exports.right=right,exports.pageLoadTranslations=pageLoadTranslations,exports.clickTranslations=clickTranslations,exports.exitIntentTranslations=exitIntentTranslations,exports.delayTranslations=delayTranslations,exports.reengageInactivityTranslations=reengageInactivityTranslations,exports.triggerOnTranslations=triggerOnTranslations,exports.triggerTranslations=triggerTranslations,exports.STYLE=STYLE,exports.LAYOUT=LAYOUT,exports.CONTENT=CONTENT,exports.CONDITIONS=CONDITIONS,exports.GROUP=GROUP,exports.CHECKBOX=CHECKBOX,exports.COLOR_PICKER=COLOR_PICKER,exports.SEPARATOR=SEPARATOR,exports.DATE_PICKER=DATE_PICKER,exports.DATE_RANGE_PICKER=DATE_RANGE_PICKER,exports.SELECT=SELECT,exports.MEDIA_UPLOAD=MEDIA_UPLOAD,exports.NUMBER=NUMBER,exports.RADIO_BUTTON=RADIO_BUTTON,exports.RADIO_IMAGE=RADIO_IMAGE,exports.SLIDER=SLIDER,exports.SWITCH=SWITCH,exports.TEXT_FIELD=TEXT_FIELD,exports.TEXT_AREA=TEXT_AREA,exports.TIME_PICKER=TIME_PICKER,exports.SELECT_ELEMENT=SELECT_ELEMENT,exports.CUSTOM_TEXTS=CUSTOM_TEXTS; | ||
"use strict";function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function n(t,r){try{var a=e[t](r),s=a.value,i=s instanceof _AwaitValue;Promise.resolve(i?s.wrapped:s).then(function(e){i?n("next",e):o(a.done?"return":"normal",e)},function(e){n("throw",e)})}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise(function(a,s){var i={key:e,arg:o,resolve:a,reject:s,next:null};r?r=r.next=i:(t=r=i,n(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ownKeys(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(r,!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}})}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}Object.defineProperty(exports,"__esModule",{value:!0}),"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};var originalBodyScroll,backgroundTranslations={en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},backgroundColorTranslations={en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},backgroundImageTranslations={en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},backgroundOpacityTranslations={en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},borderTranslations={en:"Border",fr:"Contour",es:"Borde",de:"Grenze"},borderColorTranslations={en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},borderRadiusTranslations={en:"Border radius",fr:"Arrondi du contour",es:"Contorno redondeado",de:"Abgerundeter Umriss"},borderWidthTranslations={en:"Border width",fr:"Épaisseur du contour",es:"Espesor del contorno.",de:"Dicke der Kontur"},everydayTranslations={en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},everyWeekTranslations={en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},everyMonthTranslations={en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},everySessionTranslations={en:"Every session",fr:"Chaque session",es:"En cada sesión",de:"Jede Session"},everytimeTranslations={en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},oncePerUserTranslations={en:"Once per user (no recurrence)",fr:"Une fois par visiteur (pas de récurrence)",es:"Una vez por usuario (sin recurrencia)",de:"Einmal pro User (keine Wiederholung)"},recurrenceTranslations={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},displayRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," of the display"),fr:"".concat(recurrenceTranslations.fr," de l'affichage"),es:"".concat(recurrenceTranslations.es," de la pantalla."),de:"".concat(recurrenceTranslations.de," der Anzeige")},closingRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after closure"),fr:"".concat(recurrenceTranslations.fr," après fermeture"),es:"".concat(recurrenceTranslations.es," después del cierre"),de:"".concat(recurrenceTranslations.de," nach Schließung")},validationRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after validation"),fr:"".concat(recurrenceTranslations.fr," après validation"),es:"".concat(recurrenceTranslations.es," después de la validación"),de:"".concat(recurrenceTranslations.de," nach der Validierung")},textColorTranslations={en:"Text color",fr:"Couleur du texte",es:"Color de texto",de:"Textfarbe"},closeButtonColorTranslations={en:"Close button color",fr:"Couleur du bouton de fermeture",es:"Color del botón de cierre",de:"Farbe der Schließen-Schaltfläche"},top={en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},bottom={en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},left={en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},right={en:"Right",fr:"Droite",es:"Derecha",de:"Recht"},pageLoadTranslations={en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},clickTranslations={en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},exitIntentTranslations={en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},delayTranslations={en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},reengageInactivityTranslations={en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},triggerOnTranslations={en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},triggerTranslations={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"},STYLE="style",LAYOUT="layout",CONTENT="content",CONDITIONS="conditions",GROUP="group",CHECKBOX="checkbox",COLOR_PICKER="colorpicker",SEPARATOR="separator",DATE_PICKER="datepicker",DATE_RANGE_PICKER="dateRangePicker",SELECT="select",MEDIA_UPLOAD="mediaupload",NUMBER="number",RADIO_BUTTON="radio",RADIO_IMAGE="radioImage",SLIDER="slider",SWITCH="switch",TEXT_FIELD="text",TEXT_AREA="textarea",TIME_PICKER="timepicker",SELECT_ELEMENT="selectelement",CUSTOM_TEXTS="customTexts",recurrencesOptions=[{label:everytimeTranslations,value:"-1"},{label:everySessionTranslations,value:"0"},{label:everydayTranslations,value:"1"},{label:everyWeekTranslations,value:"7"},{label:everyMonthTranslations,value:"30"},{label:oncePerUserTranslations,value:"365"}],commons={category:CONDITIONS,type:SELECT,options:recurrencesOptions,value:"-1"},closingRecurrenceForm=_objectSpread2({},commons,{label:closingRecurrenceTranslations,propName:"closingRecurrence"}),displayRecurrenceForm=_objectSpread2({},commons,{label:displayRecurrenceTranslations,propName:"displayRecurrence"}),validationRecurrenceForm=_objectSpread2({},commons,{label:validationRecurrenceTranslations,propName:"validationRecurrence"}),recurrencesGroup={category:CONDITIONS,type:GROUP,label:recurrenceTranslations,collapsible:!0,children:[displayRecurrenceForm,closingRecurrenceForm,validationRecurrenceForm]},triggersOptions=[{label:pageLoadTranslations,value:"pageLoad"},{label:clickTranslations,value:"click"},{label:exitIntentTranslations,value:"exitIntent"},{label:delayTranslations,value:"delay"},{label:reengageInactivityTranslations,value:"reengage"}],TRIGGER_EVENT="triggerEvent",triggerEventClick={category:CONDITIONS,type:SELECT_ELEMENT,propName:"".concat(TRIGGER_EVENT,"Click"),label:triggerTranslations,placeholder:{en:"Select an element in the webpage",fr:"Sélectionner un élément dans la page",es:"Selecciona un elemento en la página web",de:"Wählen Sie ein Element auf der Webseite aus"},conditions:[{field:TRIGGER_EVENT,value:"click"}]},triggerEventExitDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ExitDelay"),label:{en:"Delay after exit intent",fr:"Délai après intention de sortie",es:"Retraso después de la intención de salida",de:"Verzögerung nach Ausstiegsabsicht"},min:0,max:120,value:0,conditions:[{field:TRIGGER_EVENT,value:"exitIntent"}]},triggerEventReengageDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ReengageDelay"),label:{en:"Idle timeout before posting",fr:"Délai d'inactivité avant l'affichage",es:"Tiempo de espera inactivo antes de publicar",de:"Zeitüberschreitung vor dem Posten"},min:1,max:120,value:10,conditions:[{field:TRIGGER_EVENT,value:"reengage"}]},triggerEventDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"Delay"),label:{en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"",de:"Verzögerung vor dem Posten"},value:10,conditions:[{field:TRIGGER_EVENT,value:"delay"}]},conditionalFields=[triggerEventClick,triggerEventExitDelay,triggerEventReengageDelay,triggerEventDelay],triggersForm={category:CONDITIONS,type:SELECT,label:triggerOnTranslations,options:triggersOptions,propName:TRIGGER_EVENT,value:"pageLoad"},triggersGroup={category:CONDITIONS,type:GROUP,label:triggerTranslations,collapsible:!0,children:[triggersForm].concat(_toConsumableArray(conditionalFields))},isOnEditor=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},backgroundColorForm={category:STYLE,type:COLOR_PICKER,label:backgroundColorTranslations,propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},backgroundImageForm={category:STYLE,type:MEDIA_UPLOAD,label:backgroundImageTranslations,propName:"backgroundImage",value:""},backgroundOpacityForm={category:STYLE,type:SLIDER,label:backgroundOpacityTranslations,propName:"backgroundOpacity",value:75,unit:"%"},backgroundsGroup={category:STYLE,type:GROUP,label:backgroundTranslations,collapsible:!0,children:[backgroundColorForm,backgroundImageForm,backgroundOpacityForm]},borderColorForm={category:STYLE,type:COLOR_PICKER,label:borderColorTranslations,propName:"borderColor",value:"rgba(255, 255, 255, 1)"},borderRadiusForm={category:STYLE,type:SLIDER,label:borderRadiusTranslations,propName:"borderRadius",value:0,unit:"px"},borderWidthForm={category:STYLE,type:SLIDER,label:borderWidthTranslations,propName:"borderWidth",value:0,unit:"px"},bordersGroup={category:STYLE,type:GROUP,label:borderTranslations,collapsible:!0,children:[borderWidthForm,borderColorForm,borderRadiusForm]},textColorForm={category:STYLE,type:COLOR_PICKER,label:textColorTranslations,propName:"textColor",value:"rgba(255, 255, 255, 1)"},WidgetContainer=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"000000",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";_classCallCheck(this,e),this.testID=t,this.widgetContainer=r,this.basicClassName="ab_widget_container_".concat(r),this.widgetContainerClassName="".concat(this.basicClassName,"_").concat(t),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(t),this.domElement=this.getDom()}return _createClass(e,[{key:"insert",value:function(){return document.head.appendChild(this.styleElement),document.body.appendChild(this.domElement),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove("ab_hide"),this}},{key:"hide",value:function(){return this.domElement.classList.add("ab_hide"),this}},{key:"init",value:function(){return this.insert(),this.addCloseEvent(),this}},{key:"addCloseEvent",value:function(){for(var e=this,t=this.domElement.querySelectorAll("\n\t\t\t.".concat(this.overlayClassName,",\n\t\t\t.").concat(this.closeButtonClassName,"\n\t\t")),r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.push.apply(n,_toConsumableArray(t)),n.forEach(function(t){t.addEventListener("click",function(){e.hide()},!0)}),this}},{key:"getDom",value:function(){var e=document.createElement("div");return e.className="".concat(this.basicClassName," ").concat(this.widgetContainerClassName," ab_hide"),e.innerHTML='\n\t\t\t<div class="'.concat(this.overlayClassName,'"></div>\n\t\t\t<div class="').concat(this.contentClassName,'">\n\t\t\t\t<button class="').concat(this.closeButtonClassName,'">+</button>\n\t\t\t</div>'),e}},{key:"getStyleTag",value:function(e){var t=document.createElement("style");return t.type="text/css",isOnEditor()&&t.setAttribute("abtasty-script-added","true"),t.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(e),t}}]),e}(),Popin=function(e){function t(e,r){var n;return _classCallCheck(this,t),(n=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e,r))).stringStyles=n.getStyles(),n.styleElement=n.getStyleTag(n.stringStyles),n}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t.").concat(this.overlayClassName," {\n\t\t\tposition: absolute;\n\t\t\tz-index: -1;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground-color: black;\n\t\t\topacity: 0.6;\n\t\t}\n\t\t.").concat(this.contentClassName," {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttop: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\tbackground-color: white;\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\t\t.").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t}")}}]),t}(),Banner=function(e){function t(e,r,n){var o;return _classCallCheck(this,t),(o=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e,r))).position=n,o.stringStyles=o.getStyles(),o.styleElement=o.getStyleTag(o.stringStyles),o}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {\n\t\t\tposition: fixed;\n\t\t\t").concat(this.position,": 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t\tbackground-color: white;\n\t\t}\n\t\t.").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t}")}}]),t}();function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){originalBodyScroll&&(document.querySelector("body").style.overflowY=originalBodyScroll)}var loadImage=function(e){return new Promise(function(t,r){var n=new Image;n.onload=function(){t(n)},n.src=e,n.onerror=function(t){var n=new Error("Image ".concat(e," is not loaded."));r(n)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var t,r=0;document.addEventListener("mousemove",function(e){r=e.clientY}),document.body.addEventListener("mouseleave",function n(o){o.clientY<=50&&(r=0,clearInterval(t),t=setTimeout(function(){0===r&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(e=console).log.apply(e,r)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,r){var n,o=0;try{document.querySelector(e)}catch(t){var a="Selector «".concat(e,"» not valid.");return log(a),"function"==typeof r&&r(a)}n=setTimeout(function(){clearInterval(o);var t="Can't find element «".concat(e,"».");return log(t),"function"==typeof r&&r(t)},1e4),o=setInterval(function(){var r=document.querySelector(e);if(null!==r)return clearTimeout(n),clearInterval(o),"function"==typeof t&&t(r)},200)},getCookie=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join(""));return e},setCookie=function(e,t,r){var n="";if(r){var o=new Date;o.setTime(o.getTime()+24*r*60*60*1e3),n="expires="+o.toUTCString()}var a="domain="+getHostname();document.cookie=e+"="+t+"; "+n+";"+a+";path=/"};exports.preventGlobalScroll=preventGlobalScroll,exports.allowGlobalScroll=allowGlobalScroll,exports.loadImage=loadImage,exports.isTouch=isTouch,exports.exitIntent=exitIntent,exports.log=log,exports.domReady=domReady,exports.waitForElement=waitForElement,exports.getCookie=getCookie,exports.getHostname=getHostname,exports.setCookie=setCookie,exports.closingRecurrenceForm=closingRecurrenceForm,exports.displayRecurrenceForm=displayRecurrenceForm,exports.validationRecurrenceForm=validationRecurrenceForm,exports.recurrencesGroup=recurrencesGroup,exports.triggersForm=triggersForm,exports.triggersGroup=triggersGroup,exports.isOnEditor=isOnEditor,exports.backgroundColorForm=backgroundColorForm,exports.backgroundImageForm=backgroundImageForm,exports.backgroundOpacityForm=backgroundOpacityForm,exports.backgroundsGroup=backgroundsGroup,exports.borderColorForm=borderColorForm,exports.borderRadiusForm=borderRadiusForm,exports.borderWidthForm=borderWidthForm,exports.bordersGroup=bordersGroup,exports.textColorForm=textColorForm,exports.Popin=Popin,exports.Banner=Banner,exports.WidgetContainer=WidgetContainer,exports.backgroundImageTranslations=backgroundImageTranslations,exports.backgroundColorTranslations=backgroundColorTranslations,exports.backgroundTranslations=backgroundTranslations,exports.backgroundOpacityTranslations=backgroundOpacityTranslations,exports.borderTranslations=borderTranslations,exports.borderColorTranslations=borderColorTranslations,exports.borderRadiusTranslations=borderRadiusTranslations,exports.borderWidthTranslations=borderWidthTranslations,exports.everydayTranslations=everydayTranslations,exports.everyWeekTranslations=everyWeekTranslations,exports.everyMonthTranslations=everyMonthTranslations,exports.everySessionTranslations=everySessionTranslations,exports.everytimeTranslations=everytimeTranslations,exports.oncePerUserTranslations=oncePerUserTranslations,exports.recurrenceTranslations=recurrenceTranslations,exports.displayRecurrenceTranslations=displayRecurrenceTranslations,exports.closingRecurrenceTranslations=closingRecurrenceTranslations,exports.validationRecurrenceTranslations=validationRecurrenceTranslations,exports.textColorTranslations=textColorTranslations,exports.closeButtonColorTranslations=closeButtonColorTranslations,exports.top=top,exports.bottom=bottom,exports.left=left,exports.right=right,exports.pageLoadTranslations=pageLoadTranslations,exports.clickTranslations=clickTranslations,exports.exitIntentTranslations=exitIntentTranslations,exports.delayTranslations=delayTranslations,exports.reengageInactivityTranslations=reengageInactivityTranslations,exports.triggerOnTranslations=triggerOnTranslations,exports.triggerTranslations=triggerTranslations,exports.STYLE=STYLE,exports.LAYOUT=LAYOUT,exports.CONTENT=CONTENT,exports.CONDITIONS=CONDITIONS,exports.GROUP=GROUP,exports.CHECKBOX=CHECKBOX,exports.COLOR_PICKER=COLOR_PICKER,exports.SEPARATOR=SEPARATOR,exports.DATE_PICKER=DATE_PICKER,exports.DATE_RANGE_PICKER=DATE_RANGE_PICKER,exports.SELECT=SELECT,exports.MEDIA_UPLOAD=MEDIA_UPLOAD,exports.NUMBER=NUMBER,exports.RADIO_BUTTON=RADIO_BUTTON,exports.RADIO_IMAGE=RADIO_IMAGE,exports.SLIDER=SLIDER,exports.SWITCH=SWITCH,exports.TEXT_FIELD=TEXT_FIELD,exports.TEXT_AREA=TEXT_AREA,exports.TIME_PICKER=TIME_PICKER,exports.SELECT_ELEMENT=SELECT_ELEMENT,exports.CUSTOM_TEXTS=CUSTOM_TEXTS; |
@@ -1,1 +0,1 @@ | ||
function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var r,n;function o(r,n){try{var t=e[r](n),i=t.value,l=i instanceof _AwaitValue;Promise.resolve(l?i.wrapped:i).then(function(e){l?o("next",e):a(t.done?"return":"normal",e)},function(e){o("throw",e)})}catch(e){a("throw",e)}}function a(e,a){switch(e){case"return":r.resolve({value:a,done:!0});break;case"throw":r.reject(a);break;default:r.resolve({value:a,done:!1})}(r=r.next)?o(r.key,r.arg):n=null}this._invoke=function(e,a){return new Promise(function(t,i){var l={key:e,arg:a,resolve:t,reject:i,next:null};n?n=n.next=l:(r=n=l,o(e,a))})},"function"!=typeof e.return&&(this.return=void 0)}function _defineProperty(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ownKeys(e,r){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(n,!0).forEach(function(r){_defineProperty(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var r=0,n=new Array(e.length);r<e.length;r++)n[r]=e[r];return n}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};var originalBodyScroll,backgroundTranslations={en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},backgroundColorTranslations={en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},backgroundImageTranslations={en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},backgroundOpacityTranslations={en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},borderTranslations={en:"Border",fr:"Contour",es:"Borde",de:"Grenze"},borderColorTranslations={en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},borderRadiusTranslations={en:"Border radius",fr:"Arrondi du contour",es:"Contorno redondeado",de:"Abgerundeter Umriss"},borderWidthTranslations={en:"Border width",fr:"Épaisseur du contour",es:"Espesor del contorno.",de:"Dicke der Kontur"},everydayTranslations={en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},everyWeekTranslations={en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},everyMonthTranslations={en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},everySessionTranslations={en:"Every session",fr:"Chaque session",es:"En cada sesión",de:"Jede Session"},everytimeTranslations={en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},oncePerUserTranslations={en:"Once per user (no recurrence)",fr:"Une fois par visiteur (pas de récurrence)",es:"Una vez por usuario (sin recurrencia)",de:"Einmal pro User (keine Wiederholung)"},recurrenceTranslations={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},displayRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," of the display"),fr:"".concat(recurrenceTranslations.fr," de l'affichage"),es:"".concat(recurrenceTranslations.es," de la pantalla."),de:"".concat(recurrenceTranslations.de," der Anzeige")},closingRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after closure"),fr:"".concat(recurrenceTranslations.fr," après fermeture"),es:"".concat(recurrenceTranslations.es," después del cierre"),de:"".concat(recurrenceTranslations.de," nach Schließung")},validationRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after validation"),fr:"".concat(recurrenceTranslations.fr," après validation"),es:"".concat(recurrenceTranslations.es," después de la validación"),de:"".concat(recurrenceTranslations.de," nach der Validierung")},textColorTranslations={en:"Text color",fr:"Couleur du texte",es:"Color de texto",de:"Textfarbe"},closeButtonColorTranslations={en:"Close button color",fr:"Couleur du bouton de fermeture",es:"Color del botón de cierre",de:"Farbe der Schließen-Schaltfläche"},top={en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},bottom={en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},left={en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},right={en:"Right",fr:"Droite",es:"Derecha",de:"Recht"},pageLoadTranslations={en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},clickTranslations={en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},exitIntentTranslations={en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},delayTranslations={en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},reengageInactivityTranslations={en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},triggerOnTranslations={en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},triggerTranslations={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"},STYLE="style",LAYOUT="layout",CONTENT="content",CONDITIONS="conditions",GROUP="group",CHECKBOX="checkbox",COLOR_PICKER="colorpicker",SEPARATOR="separator",DATE_PICKER="datepicker",DATE_RANGE_PICKER="dateRangePicker",SELECT="select",MEDIA_UPLOAD="mediaupload",NUMBER="number",RADIO_BUTTON="radio",RADIO_IMAGE="radioImage",SLIDER="slider",SWITCH="switch",TEXT_FIELD="text",TEXT_AREA="textarea",TIME_PICKER="timepicker",SELECT_ELEMENT="selectelement",CUSTOM_TEXTS="customTexts",recurrencesOptions=[{label:everytimeTranslations,value:"-1"},{label:everySessionTranslations,value:"0"},{label:everydayTranslations,value:"1"},{label:everyWeekTranslations,value:"7"},{label:everyMonthTranslations,value:"30"},{label:oncePerUserTranslations,value:"365"}],commons={category:CONDITIONS,type:SELECT,options:recurrencesOptions,value:"-1"},closingRecurrenceForm=_objectSpread2({},commons,{label:closingRecurrenceTranslations,propName:"closingRecurrence"}),displayRecurrenceForm=_objectSpread2({},commons,{label:displayRecurrenceTranslations,propName:"displayRecurrence"}),validationRecurrenceForm=_objectSpread2({},commons,{label:validationRecurrenceTranslations,propName:"validationRecurrence"}),recurrencesGroup={category:CONDITIONS,type:GROUP,label:recurrenceTranslations,collapsible:!0,children:[displayRecurrenceForm,closingRecurrenceForm,validationRecurrenceForm]},triggersOptions=[{label:pageLoadTranslations,value:"pageLoad"},{label:clickTranslations,value:"click"},{label:exitIntentTranslations,value:"exitIntent"},{label:delayTranslations,value:"delay"},{label:reengageInactivityTranslations,value:"reengage"}],TRIGGER_EVENT="triggerEvent",triggerEventClick={category:CONDITIONS,type:SELECT_ELEMENT,propName:"".concat(TRIGGER_EVENT,"Click"),label:triggerTranslations,placeholder:{en:"Select an element in the webpage",fr:"Sélectionner un élément dans la page",es:"Selecciona un elemento en la página web",de:"Wählen Sie ein Element auf der Webseite aus"},conditions:[{field:TRIGGER_EVENT,value:"click"}]},triggerEventExitDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ExitDelay"),label:{en:"Delay after exit intent",fr:"Délai après intention de sortie",es:"Retraso después de la intención de salida",de:"Verzögerung nach Ausstiegsabsicht"},min:0,max:120,value:0,conditions:[{field:TRIGGER_EVENT,value:"exitIntent"}]},triggerEventReengageDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ReengageDelay"),label:{en:"Idle timeout before posting",fr:"Délai d'inactivité avant l'affichage",es:"Tiempo de espera inactivo antes de publicar",de:"Zeitüberschreitung vor dem Posten"},min:1,max:120,value:10,conditions:[{field:TRIGGER_EVENT,value:"reengage"}]},triggerEventDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"Delay"),label:{en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"",de:"Verzögerung vor dem Posten"},value:10,conditions:[{field:TRIGGER_EVENT,value:"delay"}]},conditionalFields=[triggerEventClick,triggerEventExitDelay,triggerEventReengageDelay,triggerEventDelay],triggersForm={category:CONDITIONS,type:SELECT,label:triggerOnTranslations,options:triggersOptions,propName:TRIGGER_EVENT,value:"pageLoad"},triggersGroup={category:CONDITIONS,type:GROUP,label:triggerTranslations,collapsible:!0,children:[triggersForm].concat(_toConsumableArray(conditionalFields))},isOnEditor=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},backgroundColorForm={category:STYLE,type:COLOR_PICKER,label:backgroundColorTranslations,propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},backgroundImageForm={category:STYLE,type:MEDIA_UPLOAD,label:backgroundImageTranslations,propName:"backgroundImage",value:""},backgroundOpacityForm={category:STYLE,type:SLIDER,label:backgroundOpacityTranslations,propName:"backgroundOpacity",value:75,unit:"%"},backgroundsGroup={category:STYLE,type:GROUP,label:backgroundTranslations,collapsible:!0,children:[backgroundColorForm,backgroundImageForm,backgroundOpacityForm]},borderColorForm={category:STYLE,type:COLOR_PICKER,label:borderColorTranslations,propName:"borderColor",value:"rgba(255, 255, 255, 1)"},borderRadiusForm={category:STYLE,type:SLIDER,label:borderRadiusTranslations,propName:"borderRadius",value:0,unit:"px"},borderWidthForm={category:STYLE,type:SLIDER,label:borderWidthTranslations,propName:"borderWidth",value:0,unit:"px"},bordersGroup={category:STYLE,type:GROUP,label:borderTranslations,collapsible:!0,children:[borderWidthForm,borderColorForm,borderRadiusForm]},textColorForm={category:STYLE,type:COLOR_PICKER,label:textColorTranslations,propName:"textColor",value:"rgba(255, 255, 255, 1)"};function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){originalBodyScroll&&(document.querySelector("body").style.overflowY=originalBodyScroll)}var loadImage=function(e){return new Promise(function(r,n){var o=new Image;o.onload=function(){r(o)},o.src=e,o.onerror=function(r){var o=new Error("Image ".concat(e," is not loaded."));n(o)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var r,n=0;document.addEventListener("mousemove",function(e){n=e.clientY}),document.body.addEventListener("mouseleave",function o(a){a.clientY<=50&&(n=0,clearInterval(r),r=setTimeout(function(){0===n&&(e(),document.removeEventListener("mouseleave",o))},0))},!1)},log=function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];n.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(e=console).log.apply(e,n)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,r,n){var o,a=0;try{document.querySelector(e)}catch(r){var t="Selector «".concat(e,"» not valid.");return log(t),"function"==typeof n&&n(t)}o=setTimeout(function(){clearInterval(a);var r="Can't find element «".concat(e,"».");return log(r),"function"==typeof n&&n(r)},1e4),a=setInterval(function(){var n=document.querySelector(e);if(null!==n)return clearTimeout(o),clearInterval(a),"function"==typeof r&&r(n)},200)},getCookie=function(e){for(var r=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var a=n[o];" "==a.charAt(0);)a=a.substring(1);if(0===a.indexOf(r))return a.substring(r.length,a.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join(""));return e},setCookie=function(e,r,n){var o="";if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),o="expires="+a.toUTCString()}var t="domain="+getHostname();document.cookie=e+"="+r+"; "+o+";"+t+";path=/"};export{preventGlobalScroll,allowGlobalScroll,loadImage,isTouch,exitIntent,log,domReady,waitForElement,getCookie,getHostname,setCookie,closingRecurrenceForm,displayRecurrenceForm,validationRecurrenceForm,recurrencesGroup,triggersForm,triggersGroup,isOnEditor,backgroundColorForm,backgroundImageForm,backgroundOpacityForm,backgroundsGroup,borderColorForm,borderRadiusForm,borderWidthForm,bordersGroup,textColorForm,backgroundImageTranslations,backgroundColorTranslations,backgroundTranslations,backgroundOpacityTranslations,borderTranslations,borderColorTranslations,borderRadiusTranslations,borderWidthTranslations,everydayTranslations,everyWeekTranslations,everyMonthTranslations,everySessionTranslations,everytimeTranslations,oncePerUserTranslations,recurrenceTranslations,displayRecurrenceTranslations,closingRecurrenceTranslations,validationRecurrenceTranslations,textColorTranslations,closeButtonColorTranslations,top,bottom,left,right,pageLoadTranslations,clickTranslations,exitIntentTranslations,delayTranslations,reengageInactivityTranslations,triggerOnTranslations,triggerTranslations,STYLE,LAYOUT,CONTENT,CONDITIONS,GROUP,CHECKBOX,COLOR_PICKER,SEPARATOR,DATE_PICKER,DATE_RANGE_PICKER,SELECT,MEDIA_UPLOAD,NUMBER,RADIO_BUTTON,RADIO_IMAGE,SLIDER,SWITCH,TEXT_FIELD,TEXT_AREA,TIME_PICKER,SELECT_ELEMENT,CUSTOM_TEXTS}; | ||
function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,n;function r(t,n){try{var a=e[t](n),i=a.value,s=i instanceof _AwaitValue;Promise.resolve(s?i.wrapped:i).then(function(e){s?r("next",e):o(a.done?"return":"normal",e)},function(e){r("throw",e)})}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(a,i){var s={key:e,arg:o,resolve:a,reject:i,next:null};n?n=n.next=s:(t=n=s,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ownKeys(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}})}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};var originalBodyScroll,backgroundTranslations={en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},backgroundColorTranslations={en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},backgroundImageTranslations={en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},backgroundOpacityTranslations={en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},borderTranslations={en:"Border",fr:"Contour",es:"Borde",de:"Grenze"},borderColorTranslations={en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},borderRadiusTranslations={en:"Border radius",fr:"Arrondi du contour",es:"Contorno redondeado",de:"Abgerundeter Umriss"},borderWidthTranslations={en:"Border width",fr:"Épaisseur du contour",es:"Espesor del contorno.",de:"Dicke der Kontur"},everydayTranslations={en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},everyWeekTranslations={en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},everyMonthTranslations={en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},everySessionTranslations={en:"Every session",fr:"Chaque session",es:"En cada sesión",de:"Jede Session"},everytimeTranslations={en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},oncePerUserTranslations={en:"Once per user (no recurrence)",fr:"Une fois par visiteur (pas de récurrence)",es:"Una vez por usuario (sin recurrencia)",de:"Einmal pro User (keine Wiederholung)"},recurrenceTranslations={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},displayRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," of the display"),fr:"".concat(recurrenceTranslations.fr," de l'affichage"),es:"".concat(recurrenceTranslations.es," de la pantalla."),de:"".concat(recurrenceTranslations.de," der Anzeige")},closingRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after closure"),fr:"".concat(recurrenceTranslations.fr," après fermeture"),es:"".concat(recurrenceTranslations.es," después del cierre"),de:"".concat(recurrenceTranslations.de," nach Schließung")},validationRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after validation"),fr:"".concat(recurrenceTranslations.fr," après validation"),es:"".concat(recurrenceTranslations.es," después de la validación"),de:"".concat(recurrenceTranslations.de," nach der Validierung")},textColorTranslations={en:"Text color",fr:"Couleur du texte",es:"Color de texto",de:"Textfarbe"},closeButtonColorTranslations={en:"Close button color",fr:"Couleur du bouton de fermeture",es:"Color del botón de cierre",de:"Farbe der Schließen-Schaltfläche"},top={en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},bottom={en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},left={en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},right={en:"Right",fr:"Droite",es:"Derecha",de:"Recht"},pageLoadTranslations={en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},clickTranslations={en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},exitIntentTranslations={en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},delayTranslations={en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},reengageInactivityTranslations={en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},triggerOnTranslations={en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},triggerTranslations={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"},STYLE="style",LAYOUT="layout",CONTENT="content",CONDITIONS="conditions",GROUP="group",CHECKBOX="checkbox",COLOR_PICKER="colorpicker",SEPARATOR="separator",DATE_PICKER="datepicker",DATE_RANGE_PICKER="dateRangePicker",SELECT="select",MEDIA_UPLOAD="mediaupload",NUMBER="number",RADIO_BUTTON="radio",RADIO_IMAGE="radioImage",SLIDER="slider",SWITCH="switch",TEXT_FIELD="text",TEXT_AREA="textarea",TIME_PICKER="timepicker",SELECT_ELEMENT="selectelement",CUSTOM_TEXTS="customTexts",recurrencesOptions=[{label:everytimeTranslations,value:"-1"},{label:everySessionTranslations,value:"0"},{label:everydayTranslations,value:"1"},{label:everyWeekTranslations,value:"7"},{label:everyMonthTranslations,value:"30"},{label:oncePerUserTranslations,value:"365"}],commons={category:CONDITIONS,type:SELECT,options:recurrencesOptions,value:"-1"},closingRecurrenceForm=_objectSpread2({},commons,{label:closingRecurrenceTranslations,propName:"closingRecurrence"}),displayRecurrenceForm=_objectSpread2({},commons,{label:displayRecurrenceTranslations,propName:"displayRecurrence"}),validationRecurrenceForm=_objectSpread2({},commons,{label:validationRecurrenceTranslations,propName:"validationRecurrence"}),recurrencesGroup={category:CONDITIONS,type:GROUP,label:recurrenceTranslations,collapsible:!0,children:[displayRecurrenceForm,closingRecurrenceForm,validationRecurrenceForm]},triggersOptions=[{label:pageLoadTranslations,value:"pageLoad"},{label:clickTranslations,value:"click"},{label:exitIntentTranslations,value:"exitIntent"},{label:delayTranslations,value:"delay"},{label:reengageInactivityTranslations,value:"reengage"}],TRIGGER_EVENT="triggerEvent",triggerEventClick={category:CONDITIONS,type:SELECT_ELEMENT,propName:"".concat(TRIGGER_EVENT,"Click"),label:triggerTranslations,placeholder:{en:"Select an element in the webpage",fr:"Sélectionner un élément dans la page",es:"Selecciona un elemento en la página web",de:"Wählen Sie ein Element auf der Webseite aus"},conditions:[{field:TRIGGER_EVENT,value:"click"}]},triggerEventExitDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ExitDelay"),label:{en:"Delay after exit intent",fr:"Délai après intention de sortie",es:"Retraso después de la intención de salida",de:"Verzögerung nach Ausstiegsabsicht"},min:0,max:120,value:0,conditions:[{field:TRIGGER_EVENT,value:"exitIntent"}]},triggerEventReengageDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ReengageDelay"),label:{en:"Idle timeout before posting",fr:"Délai d'inactivité avant l'affichage",es:"Tiempo de espera inactivo antes de publicar",de:"Zeitüberschreitung vor dem Posten"},min:1,max:120,value:10,conditions:[{field:TRIGGER_EVENT,value:"reengage"}]},triggerEventDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"Delay"),label:{en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"",de:"Verzögerung vor dem Posten"},value:10,conditions:[{field:TRIGGER_EVENT,value:"delay"}]},conditionalFields=[triggerEventClick,triggerEventExitDelay,triggerEventReengageDelay,triggerEventDelay],triggersForm={category:CONDITIONS,type:SELECT,label:triggerOnTranslations,options:triggersOptions,propName:TRIGGER_EVENT,value:"pageLoad"},triggersGroup={category:CONDITIONS,type:GROUP,label:triggerTranslations,collapsible:!0,children:[triggersForm].concat(_toConsumableArray(conditionalFields))},isOnEditor=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},backgroundColorForm={category:STYLE,type:COLOR_PICKER,label:backgroundColorTranslations,propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},backgroundImageForm={category:STYLE,type:MEDIA_UPLOAD,label:backgroundImageTranslations,propName:"backgroundImage",value:""},backgroundOpacityForm={category:STYLE,type:SLIDER,label:backgroundOpacityTranslations,propName:"backgroundOpacity",value:75,unit:"%"},backgroundsGroup={category:STYLE,type:GROUP,label:backgroundTranslations,collapsible:!0,children:[backgroundColorForm,backgroundImageForm,backgroundOpacityForm]},borderColorForm={category:STYLE,type:COLOR_PICKER,label:borderColorTranslations,propName:"borderColor",value:"rgba(255, 255, 255, 1)"},borderRadiusForm={category:STYLE,type:SLIDER,label:borderRadiusTranslations,propName:"borderRadius",value:0,unit:"px"},borderWidthForm={category:STYLE,type:SLIDER,label:borderWidthTranslations,propName:"borderWidth",value:0,unit:"px"},bordersGroup={category:STYLE,type:GROUP,label:borderTranslations,collapsible:!0,children:[borderWidthForm,borderColorForm,borderRadiusForm]},textColorForm={category:STYLE,type:COLOR_PICKER,label:textColorTranslations,propName:"textColor",value:"rgba(255, 255, 255, 1)"},WidgetContainer=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"000000",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";_classCallCheck(this,e),this.testID=t,this.widgetContainer=n,this.basicClassName="ab_widget_container_".concat(n),this.widgetContainerClassName="".concat(this.basicClassName,"_").concat(t),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(t),this.domElement=this.getDom()}return _createClass(e,[{key:"insert",value:function(){return document.head.appendChild(this.styleElement),document.body.appendChild(this.domElement),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove("ab_hide"),this}},{key:"hide",value:function(){return this.domElement.classList.add("ab_hide"),this}},{key:"init",value:function(){return this.insert(),this.addCloseEvent(),this}},{key:"addCloseEvent",value:function(){for(var e=this,t=this.domElement.querySelectorAll("\n\t\t\t.".concat(this.overlayClassName,",\n\t\t\t.").concat(this.closeButtonClassName,"\n\t\t")),n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return r.push.apply(r,_toConsumableArray(t)),r.forEach(function(t){t.addEventListener("click",function(){e.hide()},!0)}),this}},{key:"getDom",value:function(){var e=document.createElement("div");return e.className="".concat(this.basicClassName," ").concat(this.widgetContainerClassName," ab_hide"),e.innerHTML='\n\t\t\t<div class="'.concat(this.overlayClassName,'"></div>\n\t\t\t<div class="').concat(this.contentClassName,'">\n\t\t\t\t<button class="').concat(this.closeButtonClassName,'">+</button>\n\t\t\t</div>'),e}},{key:"getStyleTag",value:function(e){var t=document.createElement("style");return t.type="text/css",isOnEditor()&&t.setAttribute("abtasty-script-added","true"),t.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(e),t}}]),e}(),Popin=function(e){function t(e,n){var r;return _classCallCheck(this,t),(r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e,n))).stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t.").concat(this.overlayClassName," {\n\t\t\tposition: absolute;\n\t\t\tz-index: -1;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground-color: black;\n\t\t\topacity: 0.6;\n\t\t}\n\t\t.").concat(this.contentClassName," {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttop: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\tbackground-color: white;\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\t\t.").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t}")}}]),t}(),Banner=function(e){function t(e,n,r){var o;return _classCallCheck(this,t),(o=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e,n))).position=r,o.stringStyles=o.getStyles(),o.styleElement=o.getStyleTag(o.stringStyles),o}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {\n\t\t\tposition: fixed;\n\t\t\t").concat(this.position,": 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t\tbackground-color: white;\n\t\t}\n\t\t.").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t}")}}]),t}();function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){originalBodyScroll&&(document.querySelector("body").style.overflowY=originalBodyScroll)}var loadImage=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.src=e,r.onerror=function(t){var r=new Error("Image ".concat(e," is not loaded."));n(r)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var t,n=0;document.addEventListener("mousemove",function(e){n=e.clientY}),document.body.addEventListener("mouseleave",function r(o){o.clientY<=50&&(n=0,clearInterval(t),t=setTimeout(function(){0===n&&(e(),document.removeEventListener("mouseleave",r))},0))},!1)},log=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(e=console).log.apply(e,n)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,n){var r,o=0;try{document.querySelector(e)}catch(t){var a="Selector «".concat(e,"» not valid.");return log(a),"function"==typeof n&&n(a)}r=setTimeout(function(){clearInterval(o);var t="Can't find element «".concat(e,"».");return log(t),"function"==typeof n&&n(t)},1e4),o=setInterval(function(){var n=document.querySelector(e);if(null!==n)return clearTimeout(r),clearInterval(o),"function"==typeof t&&t(n)},200)},getCookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join(""));return e},setCookie=function(e,t,n){var r="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r="expires="+o.toUTCString()}var a="domain="+getHostname();document.cookie=e+"="+t+"; "+r+";"+a+";path=/"};export{preventGlobalScroll,allowGlobalScroll,loadImage,isTouch,exitIntent,log,domReady,waitForElement,getCookie,getHostname,setCookie,closingRecurrenceForm,displayRecurrenceForm,validationRecurrenceForm,recurrencesGroup,triggersForm,triggersGroup,isOnEditor,backgroundColorForm,backgroundImageForm,backgroundOpacityForm,backgroundsGroup,borderColorForm,borderRadiusForm,borderWidthForm,bordersGroup,textColorForm,Popin,Banner,WidgetContainer,backgroundImageTranslations,backgroundColorTranslations,backgroundTranslations,backgroundOpacityTranslations,borderTranslations,borderColorTranslations,borderRadiusTranslations,borderWidthTranslations,everydayTranslations,everyWeekTranslations,everyMonthTranslations,everySessionTranslations,everytimeTranslations,oncePerUserTranslations,recurrenceTranslations,displayRecurrenceTranslations,closingRecurrenceTranslations,validationRecurrenceTranslations,textColorTranslations,closeButtonColorTranslations,top,bottom,left,right,pageLoadTranslations,clickTranslations,exitIntentTranslations,delayTranslations,reengageInactivityTranslations,triggerOnTranslations,triggerTranslations,STYLE,LAYOUT,CONTENT,CONDITIONS,GROUP,CHECKBOX,COLOR_PICKER,SEPARATOR,DATE_PICKER,DATE_RANGE_PICKER,SELECT,MEDIA_UPLOAD,NUMBER,RADIO_BUTTON,RADIO_IMAGE,SLIDER,SWITCH,TEXT_FIELD,TEXT_AREA,TIME_PICKER,SELECT_ELEMENT,CUSTOM_TEXTS}; |
{ | ||
"name": "@abtasty/widget-utils", | ||
"version": "1.12.3-5", | ||
"version": "1.12.3-6", | ||
"main": "dist/widget-utils.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/widget-utils.esm.js", |
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
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
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
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
44092
158