@abtasty/nps
Advanced tools
Comparing version 0.2.3-2 to 0.2.3-3
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.widgetForm=t()}(this,function(){"use strict";var e=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}};var t=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var n=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var o=function(o){return e(o)||t(o)||n()};var r=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};var a=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}};var l=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var i=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var s=function(e){return a(e)||l(e)||i()};var c=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var d=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var f=p(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(o){return"function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?e.exports=n=function(e){return t(e)}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},n(o)}e.exports=n});var b=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var y=function(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?b(e):t},m=p(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}),g=p(function(e){function t(n,o){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,o)}e.exports=t});var h=function(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}}),t&&g(e,t)},v={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},C={en:"".concat(v.en," of the display"),fr:"".concat(v.fr," de l'affichage"),es:"".concat(v.es," de la pantalla"),de:"".concat(v.de," der Anzeige")},N={en:"".concat(v.en," after closure"),fr:"".concat(v.fr," après fermeture"),es:"".concat(v.es," después del cierre"),de:"".concat(v.de," nach Schließung")},k={en:"".concat(v.en," after validation"),fr:"".concat(v.fr," après validation"),es:"".concat(v.es," después de la validación"),de:"".concat(v.de," nach der Validierung")},w={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"},S="style",O="slider";function x(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 E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(n,!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var B={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"En cada sesión",de:"Jede Session"},value:"0"},{label:{en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},value:"1"},{label:{en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},value:"7"},{label:{en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},value:"30"},{label:{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)"},value:"365"}],value:"-1"},P=E({},B,{label:N,propName:"closingRecurrence"}),_={category:"conditions",type:"group",label:v,collapsible:!0,children:[E({},B,{label:C,propName:"displayRecurrence"}),P,E({},B,{label:k,propName:"validationRecurrence"})]},T=[{label:{en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},value:"pageLoad"},{label:{en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},value:"exitIntent"},{label:{en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},value:"delay"},{label:{en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},value:"reengage"}],j={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:w,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:"triggerEvent",value:"click"}]},A={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"exitIntent"}]},z={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"reengage"}]},D={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"delay"}]},R={category:"conditions",type:"group",label:w,collapsible:!0,children:[{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},options:T,propName:"triggerEvent",value:"pageLoad"}].concat(s([j,A,z,D]))},M=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},q={category:S,type:"colorpicker",label:{en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},I={category:S,type:O,label:{en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},propName:"backgroundOpacity",value:75,unit:"%"},H={category:S,type:"colorpicker",label:{en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},propName:"borderColor",value:"rgba(255, 255, 255, 1)"},V={category:S,type:O,label:{en:"Border radius",fr:"Arrondi du contour",es:"Contorno redondeado",de:"Abgerundeter Umriss"},propName:"borderRadius",value:0,unit:"px"},W={category:S,type:O,label:{en:"Border width",fr:"Épaisseur du contour",es:"Espesor del contorno",de:"Dicke der Kontur"},propName:"borderWidth",value:0,unit:"px"},F=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]:"";c(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 d(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,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return o.push.apply(o,s(t)),o.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,'" ').concat(M()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),e}},{key:"getStyleTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("style");return t.type="text/css",M()&&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}(),L=(function(e){function t(e,n){var o;return c(this,t),(o=y(this,m(t).call(this,e,n))).stringStyles=o.getStyles(),o.styleElement=o.getStyleTag(o.stringStyles),o}h(t,F),d(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\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}")}}])}(),function(e){function t(e,n,o){var r;return c(this,t),(r=y(this,m(t).call(this,e,n))).position=o,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}h(t,F),d(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}\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}")}}])}(),[{field:"isFeedBackQuestion",value:!0}]),Q=[{category:"content",type:"hidden",propName:"npsCampaignId",value:!1},{category:"content",type:"wysiwyg",propName:"question",label:{en:"Question",fr:"Question",es:"",de:""},value:{en:"How likely you are to recommand us to a friend ?",fr:"Quelle est la probabilité que vous nous recommandiez à un proche ?",es:"",de:""}},{category:"content",type:"checkbox",propName:"isFeedBackQuestion",label:{en:"Ask an open question",fr:"Poser une question ouverte",es:"",de:""},value:!1},{category:"content",type:"textarea",propName:"feedbackQuestion",label:"Feedback Question",value:{en:"Thanks for your answer, anything else ?",fr:"Merci pour votre réponse, avez-vous quelque chose à nous partager ?",es:"",de:""},conditions:L},{category:"content",type:"text",propName:"buttonText",label:{en:"Button text",fr:"Texte du bouton",es:"",de:""},value:{en:"Send",fr:"Envoyer",es:"",de:""},conditions:L},{category:"content",type:"checkbox",propName:"isThankYouMessage",label:{en:"Show a message to thanks user",fr:"Afficher un message pour remercier l'utilisateur",es:"",de:""},value:!1},{category:"content",type:"text",propName:"thankYouMessage",label:{en:"Thanks you message",fr:"Message de remerciement",es:"",de:""},value:{en:"Thanks for your anwers :)",fr:"Merci pour vos réponses :)",es:"",de:""},conditions:[{field:"isThankYouMessage",value:!0}]}],U=[{category:"layout",type:"radioImage",propName:"layout",label:{en:"Select a layout",fr:"Sélectionnez une mise en page",es:"Seleccione un diseño",de:"Wählen Sie ein Layout"},value:"popin",options:[{label:{en:"Popin",fr:"Popin",es:"Popin",de:"Popin"},value:"popin",src:"https://widgets-images.abtasty.com/layout/popin.svg"},{label:{en:"Banner",fr:"Bannière",es:"Bandera",de:"Banner"},value:"banner",src:"https://widgets-images.abtasty.com/banner/bottom.png"},{label:{en:"In the page",fr:"Dans la page",es:"En la pagina",de:"In der Seite"},value:"free",src:"https://widgets-images.abtasty.com/layout/free.svg"}]},{category:"layout",type:"radioImage",propName:"bannerPosition",label:{en:"Adjust the layout",fr:"Ajuster le placement",es:"Ajustar la posición",de:"Position einstellen"},value:"bottom",conditions:[{field:"layout",value:"banner"}],options:[{label:{en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},value:"bottom",src:"https://widgets-images.abtasty.com/banner/bottom.png"},{label:{en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},value:"top",src:"https://widgets-images.abtasty.com/banner/top.png"}]},{category:"layout",type:"selectelement",propName:"npsElementReferrer",label:{en:"Select an element as referrer",fr:"Sélectionnez un élément de référence",es:"Seleccione un elemento de referencia",de:"Wählen Sie ein Referenzelement"},value:"body",conditions:[{field:"layout",value:"free"}]},{category:"layout",type:"select",propName:"npsReferrerInsertType",value:"beforeend",conditions:[{field:"layout",value:"free"}],label:{en:"Position relative to the element",fr:"Position par rapport à l'élément",es:"Posición relativa al elemento",de:"Position relativ zum Element"},options:[{label:{en:"Before begin",fr:"Avant",es:"Antes",de:"Vor"},value:"beforebegin"},{label:{en:"After begin",fr:"Au début",es:"Al principio",de:"Früh"},value:"afterbegin"},{label:{en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},value:"beforeend"},{label:{en:"After end",fr:"Après",es:"Después",de:"Nach"},value:"afterend"}]}],J=[_,R,{category:"conditions",type:"checkbox",propName:"autoHide",value:!0,label:{en:"Auto hide after user validation",fr:"Masquer automatiquement après la validation",es:"",de:""}},{category:"conditions",type:"number",propName:"timeHide",value:2,label:{en:"Hide after x seconds",fr:"Masquer après x secondes",es:"",de:""},conditions:[{field:"autoHide",value:!0}]}];var K=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};function Y(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 G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(n,!0).forEach(function(t){K(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Z="rgba(255, 255, 255, 1)",X="rgba(16, 121, 255, 1)",$=[{field:"themeType",value:"theme"}],ee=[{field:"buttonsContrast",value:"full"}],te=[{field:"buttonsContrast",value:"empty"}],ne={borderWidth:0,borderRadius:10,borderColor:X,backgroundColor:Z,overlayColor:"rgba(0, 0, 0, 1)",overlayOpacity:50,textColor:X,horizontalPaddingContainer:20,verticalPaddingContainer:10,horizontalMarginContainer:0,verticalMarginContainer:0,dropShadow:!1,shadowOpacity:0,buttonsContrast:"full",buttonsShape:"roundsquare",buttonsBackgroundColor_full:X,buttonsBackgroundColor_empty:Z,buttonsTextColor_full:Z,buttonsTextColor_empty:X,buttonsBorderColor_full:X,buttonsBorderColor_empty:X,buttonsBorderWidth_full:0,buttonsBorderWidth_empty:2},oe=[{themeValue:"lightTheme",defaultValues:G({},ne)},{themeValue:"darkTheme",defaultValues:G({},ne,{borderColor:X,backgroundColor:X,overlayOpacity:75,textColor:Z,buttonsContrast:"empty",buttonsBackgroundColor_full:Z,buttonsBackgroundColor_empty:X,buttonsTextColor_full:X,buttonsTextColor_empty:Z,buttonsBorderColor_full:Z,buttonsBorderColor_empty:Z,buttonsBorderWidth_full:2,buttonsBorderWidth_empty:2})}],re={category:S,type:"group",collapsible:!0,conditions:$},ae={category:S,type:"colorpicker",label:{en:"Buttons background color",fr:"Couleur de fond des boutons",es:"Color de fondo de los botones",de:"Hintergrundfarbe der Tasten"},propName:"buttonsBackgroundColor",value:Z},le={category:S,type:"colorpicker",label:{en:"Buttons text color",fr:"Couleur de texte des boutons",es:"Color del texto de los botones",de:"Textfarbe der Schaltflächen"},propName:"buttonsTextColor",value:X},ie={category:S,type:"colorpicker",label:{en:"Buttons border color",fr:"Couleur du contour des boutons",es:"Color del contorno de los botones",de:"Farbe der Schaltflächenkontur"},propName:"buttonsBorderColor",value:X},se={category:S,type:O,label:{en:"Buttons border thickness",fr:"Épaisseur du contour des boutons",es:"Grosor del contorno de los botones",de:"Stärke des Umrisses der Schaltflächen"},propName:"buttonsBorderWidth",value:2,unit:"px"},ce=G({},q,{propName:"overlayColor",label:{en:"Overlay color",fr:"Couleur de l'overlay",es:"",de:""}}),ue=G({},I,{propName:"overlayOpacity",label:{en:"Overlay opacity",fr:"Opacité de l'overlay",es:"Opacidad superpuesta",de:"Deckkraft überlagern"}}),de={category:S,type:"radioImage",propName:"themeType",label:{en:"Select the type",fr:"Sélectionnez un type",es:"",de:""},value:"theme",options:[{label:{en:"Theme",fr:"Thème",es:"",de:""},value:"theme",src:"https://widgets-images.abtasty.com/style/theme.svg"},{label:{en:"Custom CSS",fr:"CSS Personnalisé",es:"",de:""},value:"customCss",src:"https://widgets-images.abtasty.com/style/custom.svg"}]},pe={category:S,type:"radio",propName:"theme",label:{en:"Select the theme",fr:"Sélectionnez un thème",es:"",de:""},value:"lightTheme",conditions:$,options:[{label:{en:"Light",fr:"Clair",es:"",de:""},value:"lightTheme"},{label:{en:"Dark",fr:"Sombre",es:"",de:""},value:"darkTheme"}]},fe=[G({},re,{label:{en:"Border",fr:"Contour",es:"Borde",de:"Grenze"},conditions:$,children:[W,V,H]}),G({},re,{label:{en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},conditions:$,children:[q,ce,ue]}),G({},re,{label:{en:"Container",fr:"Conteneur",es:"Container",de:"Container"},children:[{category:S,type:"colorpicker",label:{en:"Text color",fr:"Couleur du texte",es:"Color de texto",de:"Textfarbe"},propName:"textColor",value:X},{category:S,type:O,label:{en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},propName:"horizontalPaddingContainer",value:0,unit:"px"},{category:S,type:O,label:{en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},propName:"verticalPaddingContainer",value:0,unit:"px"},{category:S,type:O,label:{en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},propName:"horizontalMarginContainer",value:0,unit:"px"},{category:S,type:O,label:{en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},propName:"verticalMarginContainer",value:0,unit:"px"},{category:S,type:"switch",label:{en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},propName:"dropShadow",value:!1},{category:S,type:O,label:{en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},propName:"shadowOpacity",value:0,unit:"%",conditions:[{field:"dropShadow",value:!0}]}]}),G({},re,{label:{en:"Buttons style",fr:"Style des boutons",es:"Estilo de botón",de:"Schaltflächenstil"},children:[{category:S,type:"radioImage",label:{en:"Buttons contrast",fr:"Contraste des boutons",es:"Contraste de los botones",de:"Kontrast der Tasten"},propName:"buttonsContrast",value:"full",options:[{value:"full",src:"https://widgets-images.abtasty.com/nps/button-contrast-1.svg"},{value:"empty",src:"https://widgets-images.abtasty.com/nps/button-contrast-2.svg"}]},{category:S,type:"radioImage",label:{en:"Buttons shape",fr:"Forme des boutons",es:"Forma de boton",de:"Knopfform"},propName:"buttonsShape",value:"roundsquare",options:[{value:"square",src:"https://widgets-images.abtasty.com/nps/button-shape-1.svg"},{value:"roundsquare",src:"https://widgets-images.abtasty.com/nps/button-shape-2.svg"},{value:"round",src:"https://widgets-images.abtasty.com/nps/button-shape-3.svg"}]},G({},ae,{conditions:ee,propName:"".concat(ae.propName,"_full")}),G({},ae,{conditions:te,propName:"".concat(ae.propName,"_empty")}),G({},le,{conditions:ee,propName:"".concat(le.propName,"_full")}),G({},le,{conditions:te,propName:"".concat(le.propName,"_empty")}),G({},ie,{conditions:ee,propName:"".concat(ie.propName,"_full")}),G({},ie,{conditions:te,propName:"".concat(ie.propName,"_empty")}),G({},se,{conditions:ee,propName:"".concat(se.propName,"_full")}),G({},se,{conditions:te,propName:"".concat(se.propName,"_empty")})]})];var be=oe.map(function(e){var t=e.themeValue,n=e.defaultValues;return[].concat(fe).map(function(e){var r=e.conditions,a=e.children;return G({},e,{conditions:[].concat(o(r),[{field:"theme",value:t}]),children:a.map(function(e){var r=e.propName,a=e.conditions,l=n[r],i="".concat(t,"_").concat(r),s=a&&a.length>0&&a.reduce(function(e,n){var r=n.field,a=n.value;return[].concat(o(e),[{field:"".concat(t,"_").concat(r),value:a}])},[]),c=G({},e,{value:l,propName:i});return s&&s.length&&(c.conditions=s),c})})})}).flat(),ye=[de,pe].concat(o(be));return[].concat(o(J),o(Q),o(U),o(ye))}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.widgetForm=t()}(this,function(){"use strict";var e=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}};var t=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var n=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var o=function(o){return e(o)||t(o)||n()};var r=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};var a=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}};var i=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var l=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var s=function(e){return a(e)||i(e)||l()};var c=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var d=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var f=p(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(o){return"function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?e.exports=n=function(e){return t(e)}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},n(o)}e.exports=n});var b=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var y=function(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?b(e):t},m=p(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}),g=p(function(e){function t(n,o){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,o)}e.exports=t});var h=function(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}}),t&&g(e,t)},v={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},C={en:"".concat(v.en," of the display"),fr:"".concat(v.fr," de l'affichage"),es:"".concat(v.es," de la pantalla"),de:"".concat(v.de," der Anzeige")},N={en:"".concat(v.en," after closure"),fr:"".concat(v.fr," après fermeture"),es:"".concat(v.es," después del cierre"),de:"".concat(v.de," nach Schließung")},w={en:"".concat(v.en," after validation"),fr:"".concat(v.fr," après validation"),es:"".concat(v.es," después de la validación"),de:"".concat(v.de," nach der Validierung")},S={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"},k="style",O="slider";function x(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 E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(n,!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var B={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"En cada sesión",de:"Jede Session"},value:"0"},{label:{en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},value:"1"},{label:{en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},value:"7"},{label:{en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},value:"30"},{label:{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)"},value:"365"}],value:"-1"},P=E({},B,{label:N,propName:"closingRecurrence"}),_={category:"conditions",type:"group",label:v,collapsible:!0,children:[E({},B,{label:C,propName:"displayRecurrence"}),P,E({},B,{label:w,propName:"validationRecurrence"})]},T=[{label:{en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},value:"pageLoad"},{label:{en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},value:"exitIntent"},{label:{en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},value:"delay"},{label:{en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},value:"reengage"}],j={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:S,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:"triggerEvent",value:"click"}]},A={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"exitIntent"}]},z={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"reengage"}]},D={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"delay"}]},M={category:"conditions",type:"group",label:S,collapsible:!0,children:[{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},options:T,propName:"triggerEvent",value:"pageLoad"}].concat(s([j,A,z,D]))},R=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},q={category:k,type:"colorpicker",label:{en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},H={category:k,type:O,label:{en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},propName:"backgroundOpacity",value:75,unit:"%"},I={category:k,type:"colorpicker",label:{en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},propName:"borderColor",value:"rgba(255, 255, 255, 1)"},V={category:k,type:O,label:{en:"Border radius",fr:"Arrondi du contour",es:"Contorno redondeado",de:"Abgerundeter Umriss"},propName:"borderRadius",value:0,unit:"px"},W={category:k,type:O,label:{en:"Border width",fr:"Épaisseur du contour",es:"Espesor del contorno",de:"Dicke der Kontur"},propName:"borderWidth",value:0,unit:"px"},F=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]:"";c(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 d(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,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return o.push.apply(o,s(t)),o.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,'" ').concat(R()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),e}},{key:"getStyleTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("style");return t.type="text/css",R()&&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}(),L=(function(e){function t(e,n){var o;return c(this,t),(o=y(this,m(t).call(this,e,n))).stringStyles=o.getStyles(),o.styleElement=o.getStyleTag(o.stringStyles),o}h(t,F),d(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\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}")}}])}(),function(e){function t(e,n,o){var r;return c(this,t),(r=y(this,m(t).call(this,e,n))).position=o,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}h(t,F),d(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}\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}")}}])}(),function(e){function t(e,n,o,r){var a;return c(this,t),(a=y(this,m(t).call(this,e,n))).position=o,a.referrerElement=r,a.stringStyles=a.getStyles(),a.styleElement=a.getStyleTag(a.stringStyles),a}h(t,F),d(t,[{key:"insert",value:function(){var e="string"==typeof this.referrerElement?document.querySelector(this.referrerElement):this.referrerElement;return document.head.appendChild(this.styleElement),e.insertAdjacentElement(this.position,this.domElement),this}},{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tposition: relative;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\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}")}}])}(),[{field:"isFeedBackQuestion",value:!0}]),Q=[{category:"content",type:"hidden",propName:"npsCampaignId",value:!1},{category:"content",type:"wysiwyg",propName:"question",label:{en:"Question",fr:"Question",es:"",de:""},value:{en:"How likely you are to recommand us to a friend ?",fr:"Quelle est la probabilité que vous nous recommandiez à un proche ?",es:"",de:""}},{category:"content",type:"checkbox",propName:"isFeedBackQuestion",label:{en:"Ask an open question",fr:"Poser une question ouverte",es:"",de:""},value:!1},{category:"content",type:"textarea",propName:"feedbackQuestion",label:"Feedback Question",value:{en:"Thanks for your answer, anything else ?",fr:"Merci pour votre réponse, avez-vous quelque chose à nous partager ?",es:"",de:""},conditions:L},{category:"content",type:"text",propName:"buttonText",label:{en:"Button text",fr:"Texte du bouton",es:"",de:""},value:{en:"Send",fr:"Envoyer",es:"",de:""},conditions:L},{category:"content",type:"checkbox",propName:"isThankYouMessage",label:{en:"Show a message to thanks user",fr:"Afficher un message pour remercier l'utilisateur",es:"",de:""},value:!1},{category:"content",type:"text",propName:"thankYouMessage",label:{en:"Thanks you message",fr:"Message de remerciement",es:"",de:""},value:{en:"Thanks for your anwers :)",fr:"Merci pour vos réponses :)",es:"",de:""},conditions:[{field:"isThankYouMessage",value:!0}]}],U=[{category:"layout",type:"radioImage",propName:"layout",label:{en:"Select a layout",fr:"Sélectionnez une mise en page",es:"Seleccione un diseño",de:"Wählen Sie ein Layout"},value:"popin",options:[{label:{en:"Popin",fr:"Popin",es:"Popin",de:"Popin"},value:"popin",src:"https://widgets-images.abtasty.com/layout/popin.svg"},{label:{en:"Banner",fr:"Bannière",es:"Bandera",de:"Banner"},value:"banner",src:"https://widgets-images.abtasty.com/banner/bottom.png"},{label:{en:"In the page",fr:"Dans la page",es:"En la pagina",de:"In der Seite"},value:"free",src:"https://widgets-images.abtasty.com/layout/free.svg"}]},{category:"layout",type:"radioImage",propName:"bannerPosition",label:{en:"Adjust the layout",fr:"Ajuster le placement",es:"Ajustar la posición",de:"Position einstellen"},value:"bottom",conditions:[{field:"layout",value:"banner"}],options:[{label:{en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},value:"bottom",src:"https://widgets-images.abtasty.com/banner/bottom.png"},{label:{en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},value:"top",src:"https://widgets-images.abtasty.com/banner/top.png"}]},{category:"layout",type:"selectelement",propName:"npsElementReferrer",label:{en:"Select an element as referrer",fr:"Sélectionnez un élément de référence",es:"Seleccione un elemento de referencia",de:"Wählen Sie ein Referenzelement"},value:"body",conditions:[{field:"layout",value:"free"}]},{category:"layout",type:"select",propName:"npsReferrerInsertType",value:"beforeend",conditions:[{field:"layout",value:"free"}],label:{en:"Position relative to the element",fr:"Position par rapport à l'élément",es:"Posición relativa al elemento",de:"Position relativ zum Element"},options:[{label:{en:"Before begin",fr:"Avant",es:"Antes",de:"Vor"},value:"beforebegin"},{label:{en:"After begin",fr:"Au début",es:"Al principio",de:"Früh"},value:"afterbegin"},{label:{en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},value:"beforeend"},{label:{en:"After end",fr:"Après",es:"Después",de:"Nach"},value:"afterend"}]},{category:"layout",type:"radio",propName:"contentDirection",value:"column",label:{en:"Content direction",fr:"Positionnement du contenu",es:"",de:""},options:[{label:{en:"Column",fr:"En colonne",es:"",de:""},value:"column"},{label:{en:"Row",fr:"En ligne",es:"",de:""},value:"row"}]}],J=[_,M,{category:"conditions",type:"checkbox",propName:"autoHide",value:!0,label:{en:"Auto hide after user validation",fr:"Masquer automatiquement après la validation",es:"",de:""}},{category:"conditions",type:"number",propName:"timeHide",value:2,label:{en:"Hide after x seconds",fr:"Masquer après x secondes",es:"",de:""},conditions:[{field:"autoHide",value:!0}]}];var K=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};function Y(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 G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(n,!0).forEach(function(t){K(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Z="rgba(255, 255, 255, 1)",X="rgba(16, 121, 255, 1)",$=[{field:"themeType",value:"theme"}],ee=[{field:"buttonsContrast",value:"full"}],te=[{field:"buttonsContrast",value:"empty"}],ne={borderWidth:2,borderRadius:10,borderColor:X,backgroundColor:Z,overlayColor:"rgba(0, 0, 0, 1)",overlayOpacity:50,textColor:X,questionMargin:15,horizontalPaddingContainer:20,verticalPaddingContainer:15,horizontalMarginContainer:0,verticalMarginContainer:0,dropShadow:!1,shadowOpacity:0,buttonsHorizontalMargin:5,buttonsContrast:"full",buttonsShape:"roundsquare",buttonsBackgroundColor_full:X,buttonsBackgroundColor_empty:Z,buttonsTextColor_full:Z,buttonsTextColor_empty:X,buttonsBorderColor_full:X,buttonsBorderColor_empty:X,buttonsBorderWidth_full:0,buttonsBorderWidth_empty:2},oe=[{themeValue:"lightTheme",defaultValues:G({},ne)},{themeValue:"darkTheme",defaultValues:G({},ne,{borderColor:X,backgroundColor:X,overlayOpacity:75,textColor:Z,buttonsContrast:"empty",buttonsBackgroundColor_full:Z,buttonsBackgroundColor_empty:X,buttonsTextColor_full:X,buttonsTextColor_empty:Z,buttonsBorderColor_full:Z,buttonsBorderColor_empty:Z,buttonsBorderWidth_full:2,buttonsBorderWidth_empty:2})}],re={category:k,type:"group",collapsible:!0,conditions:$},ae={category:k,type:"colorpicker",label:{en:"Buttons background color",fr:"Couleur de fond des boutons",es:"Color de fondo de los botones",de:"Hintergrundfarbe der Tasten"},propName:"buttonsBackgroundColor",value:Z},ie={category:k,type:"colorpicker",label:{en:"Buttons text color",fr:"Couleur de texte des boutons",es:"Color del texto de los botones",de:"Textfarbe der Schaltflächen"},propName:"buttonsTextColor",value:X},le={category:k,type:"colorpicker",label:{en:"Buttons border color",fr:"Couleur du contour des boutons",es:"Color del contorno de los botones",de:"Farbe der Schaltflächenkontur"},propName:"buttonsBorderColor",value:X},se={category:k,type:O,label:{en:"Buttons border thickness",fr:"Épaisseur du contour des boutons",es:"Grosor del contorno de los botones",de:"Stärke des Umrisses der Schaltflächen"},propName:"buttonsBorderWidth",value:2,unit:"px"},ce=G({},q,{propName:"overlayColor",label:{en:"Overlay color",fr:"Couleur de l'overlay",es:"",de:""}}),ue=G({},H,{propName:"overlayOpacity",label:{en:"Overlay opacity",fr:"Opacité de l'overlay",es:"Opacidad superpuesta",de:"Deckkraft überlagern"}}),de={category:k,type:"radioImage",propName:"themeType",label:{en:"Select the type",fr:"Sélectionnez un type",es:"",de:""},value:"theme",options:[{label:{en:"Theme",fr:"Thème",es:"",de:""},value:"theme",src:"https://widgets-images.abtasty.com/style/theme.svg"},{label:{en:"Custom CSS",fr:"CSS Personnalisé",es:"",de:""},value:"customCss",src:"https://widgets-images.abtasty.com/style/custom.svg"}]},pe={category:k,type:"radio",propName:"theme",label:{en:"Select the theme",fr:"Sélectionnez un thème",es:"",de:""},value:"lightTheme",conditions:$,options:[{label:{en:"Light",fr:"Clair",es:"",de:""},value:"lightTheme"},{label:{en:"Dark",fr:"Sombre",es:"",de:""},value:"darkTheme"}]},fe=[G({},re,{label:{en:"Border",fr:"Contour",es:"Borde",de:"Grenze"},conditions:$,children:[W,V,I]}),G({},re,{label:{en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},conditions:$,children:[q,ce,ue]}),G({},re,{label:{en:"Container",fr:"Conteneur",es:"Container",de:"Container"},children:[{category:k,type:"colorpicker",label:{en:"Text color",fr:"Couleur du texte",es:"Color de texto",de:"Textfarbe"},propName:"textColor",value:X},{category:k,type:O,label:{en:"Margin Question / Answer",fr:"Espacement Question / Réponse",es:"",de:""},propName:"questionMargin",value:15,unit:"px"},{category:k,type:O,label:{en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},propName:"horizontalPaddingContainer",value:0,unit:"px"},{category:k,type:O,label:{en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},propName:"verticalPaddingContainer",value:0,unit:"px"},{category:k,type:O,label:{en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},propName:"horizontalMarginContainer",value:0,unit:"px"},{category:k,type:O,label:{en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},propName:"verticalMarginContainer",value:0,unit:"px"},{category:k,type:"switch",label:{en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},propName:"dropShadow",value:!1},{category:k,type:O,label:{en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},propName:"shadowOpacity",value:0,unit:"%",conditions:[{field:"dropShadow",value:!0}]}]}),G({},re,{label:{en:"Buttons style",fr:"Style des boutons",es:"Estilo de botón",de:"Schaltflächenstil"},children:[{category:k,type:O,label:{en:"Margin between buttons",fr:"Espace entre les boutons",es:"",de:""},propName:"buttonsHorizontalMargin",value:5,unit:"px"},{category:k,type:"radioImage",label:{en:"Buttons contrast",fr:"Contraste des boutons",es:"Contraste de los botones",de:"Kontrast der Tasten"},propName:"buttonsContrast",value:"full",options:[{value:"full",src:"https://widgets-images.abtasty.com/nps/button-contrast-1.svg"},{value:"empty",src:"https://widgets-images.abtasty.com/nps/button-contrast-2.svg"}]},{category:k,type:"radioImage",label:{en:"Buttons shape",fr:"Forme des boutons",es:"Forma de boton",de:"Knopfform"},propName:"buttonsShape",value:"roundsquare",options:[{value:"square",src:"https://widgets-images.abtasty.com/nps/button-shape-1.svg"},{value:"roundsquare",src:"https://widgets-images.abtasty.com/nps/button-shape-2.svg"},{value:"round",src:"https://widgets-images.abtasty.com/nps/button-shape-3.svg"}]},G({},ae,{conditions:ee,propName:"".concat(ae.propName,"_full")}),G({},ae,{conditions:te,propName:"".concat(ae.propName,"_empty")}),G({},ie,{conditions:ee,propName:"".concat(ie.propName,"_full")}),G({},ie,{conditions:te,propName:"".concat(ie.propName,"_empty")}),G({},le,{conditions:ee,propName:"".concat(le.propName,"_full")}),G({},le,{conditions:te,propName:"".concat(le.propName,"_empty")}),G({},se,{conditions:ee,propName:"".concat(se.propName,"_full")}),G({},se,{conditions:te,propName:"".concat(se.propName,"_empty")})]})];var be=oe.map(function(e){var t=e.themeValue,n=e.defaultValues;return[].concat(fe).map(function(e){var r=e.conditions,a=e.children;return G({},e,{conditions:[].concat(o(r),[{field:"theme",value:t}]),children:a.map(function(e){var r=e.propName,a=e.conditions,i=n[r],l="".concat(t,"_").concat(r),s=a&&a.length>0&&a.reduce(function(e,n){var r=n.field,a=n.value;return[].concat(o(e),[{field:"".concat(t,"_").concat(r),value:a}])},[]),c=G({},e,{value:i,propName:l});return s&&s.length&&(c.conditions=s),c})})})}).flat(),ye=[de,pe].concat(o(be));return[].concat(o(J),o(Q),o(U),o(ye))}); |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var e=t(function(t){var e=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,n,r){var a=e&&e.prototype instanceof m?e:m,o=Object.create(a.prototype),i=new O(r||[]);return o._invoke=function(t,e,n){var r=u;return function(a,o){if(r===d)throw new Error("Generator is already running");if(r===f){if("throw"===a)throw o;return j()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var s=S(i,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===u)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=l(t,e,n);if("normal"===c.type){if(r=n.done?f:h,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=f,n.method="throw",n.arg=c.arg)}}}(t,n,i),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u="suspendedStart",h="suspendedYield",d="executing",f="completed",p={};function m(){}function y(){}function v(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==n&&r.call(w,o)&&(g=w);var C=v.prototype=m.prototype=Object.create(g);function E(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function N(t){var e;this._invoke=function(n,a){function o(){return new Promise(function(e,o){!function e(n,a,o,i){var s=l(t[n],t,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):Promise.resolve(u).then(function(t){c.value=t,o(c)},function(t){return e("throw",t,o,i)})}i(s.arg)}(n,a,e,o)})}return e=e?e.then(o,o):o()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,S(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 a=l(r,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,p;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function k(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 x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:j}}function j(){return{value:e,done:!0}}return y.prototype=C.constructor=v,v.constructor=y,v[s]=y.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(C),t},t.awrap=function(t){return{__await:t}},E(N.prototype),N.prototype[i]=function(){return this},t.AsyncIterator=N,t.async=function(e,n,r,a){var o=new N(c(e,n,r,a));return t.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},E(C),C[s]="Generator",C[o]=function(){return this},C.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 r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,O.prototype={constructor:O,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(x),!t)for(var n in this)"t"===n.charAt(0)&&r.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 a(r,a){return s.type="throw",s.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(i)},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),x(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 r=n.completion;if("throw"===r.type){var a=r.arg;x(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var r=function(t){if(Array.isArray(t))return t};var a=function(t,e){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){a=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n};var o=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var i=function(t,e){return r(t)||a(t,e)||o()};function s(t,e,n,r,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,a)}var c=function(t){return function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(t){s(o,r,a,i,c,"next",t)}function c(t){s(o,r,a,i,c,"throw",t)}i(void 0)})}};var l=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var u=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var h=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var d=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var f=function(t){return u(t)||h(t)||d()};var p=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var y=function(t,e,n){return e&&m(t.prototype,e),n&&m(t,n),t},v=t(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(r){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=n=function(t){return e(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},n(r)}t.exports=n});var g=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var b=function(t,e){return!e||"object"!==v(e)&&"function"!=typeof e?g(t):e},w=t(function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e}),C=t(function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e});var E=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C(t,e)},N="Recurrence",S="Récurrence",k="Recurrencia",x="Wiederholung",O={en:"".concat(N," of the display"),fr:"".concat(S," de l'affichage"),es:"".concat(k," de la pantalla"),de:"".concat(x," der Anzeige")},T={en:"".concat(N," after closure"),fr:"".concat(S," après fermeture"),es:"".concat(k," después del cierre"),de:"".concat(x," nach Schließung")},j={en:"".concat(N," after validation"),fr:"".concat(S," après validation"),es:"".concat(k," después de la validación"),de:"".concat(x," nach der Validierung")},P={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"};function _(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(n,!0).forEach(function(e){l(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var L={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"En cada sesión",de:"Jede Session"},value:"0"},{label:{en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},value:"1"},{label:{en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},value:"7"},{label:{en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},value:"30"},{label:{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)"},value:"365"}],value:"-1"},D=(A({},L,{label:T,propName:"closingRecurrence"}),A({},L,{label:O,propName:"displayRecurrence"}),A({},L,{label:j,propName:"validationRecurrence"}),[{label:{en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},value:"pageLoad"},{label:{en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},value:"exitIntent"},{label:{en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},value:"delay"},{label:{en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},value:"reengage"}]),I={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:P,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:"triggerEvent",value:"click"}]},B={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"exitIntent"}]},R={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"reengage"}]},q={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"delay"}]},z=([{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},options:D,propName:"triggerEvent",value:"pageLoad"}].concat(f([I,B,R,q])),function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")}),G=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"000000",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";p(this,t),this.testID=e,this.widgetContainer=n,this.basicClassName="ab_widget_container_".concat(n),this.widgetContainerClassName="".concat(this.basicClassName,"_").concat(e),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(e),this.domElement=this.getDom()}return y(t,[{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 t=this,e=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),a=0;a<n;a++)r[a]=arguments[a];return r.push.apply(r,f(e)),r.forEach(function(e){e.addEventListener("click",function(){t.hide()},!0)}),this}},{key:"getDom",value:function(){var t=document.createElement("div");return t.className="".concat(this.basicClassName," ").concat(this.widgetContainerClassName," ab_hide"),t.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,'" ').concat(z()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),t}},{key:"getStyleTag",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=document.createElement("style");return e.type="text/css",z()&&e.setAttribute("abtasty-script-added","true"),e.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(t),e}}]),t}(),Q=function(t){function e(t,n){var r;return p(this,e),(r=b(this,w(e).call(this,t,n))).stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return E(e,G),y(e,[{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\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}")}}]),e}(),M=function(t){function e(t,n,r){var a;return p(this,e),(a=b(this,w(e).call(this,t,n))).position=r,a.stringStyles=a.getStyles(),a.styleElement=a.getStyleTag(a.stringStyles),a}return E(e,G),y(e,[{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}\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}")}}]),e}();var Y=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function F(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var W=function(t,e,n){return e&&F(t.prototype,e),n&&F(t,n),t};function U(t,e){return new Promise(function(n,r){var a=new XMLHttpRequest;a.open(t,e,!0),a.onload=function(){this.status>=200&&this.status<300?n(a.response):r({status:this.status,statusText:a.statusText})},a.onerror=function(){r({status:this.status,statusText:a.statusText})},a.send()})}var V=DATA,H=V.question,J=V.npsCampaignId,X=V.feedbackQuestion,K="https://nps.abtasty.com/api/",Z=function(){return{abtastyIdentifier:"abtastyidentifier=".concat(top.ABTasty.accountSettings.identifier),accessToken:"access_token=".concat(ABTASTY_S.SERVER.token),testId:"testId=".concat(TEST_ID),variationId:"variationId=".concat(ABTASTY_S.STORE.currentVariation.id),name:"name=".concat(ABTASTY_S.STORE.test.name," - ").concat(ABTASTY_S.STORE.currentVariation.name),nps:"nps=".concat(H),feedback:"feedback=".concat(X),id:"id=".concat(J)}},$=function(){var t,e,n,r,a,o,i,s,c=Z();return U("GET",(e=(t=c).abtastyIdentifier,n=t.accessToken,r=t.testId,a=t.variationId,o=t.name,i=t.nps,s=t.feedback,"".concat(K,"setNPS.php?").concat(e,"&").concat(n,"&").concat(r,"&").concat(a,"&").concat(o,"&").concat(i,"&").concat(s)))},tt=function(){var t,e,n,r,a,o,i,s,c,l=Z();return U("GET",(e=(t=l).id,n=t.abtastyIdentifier,r=t.accessToken,a=t.testId,o=t.variationId,i=t.name,s=t.nps,c=t.feedback,"".concat(K,"setNPS.php?").concat(e,"&").concat(n,"&").concat(r,"&").concat(a,"&").concat(o,"&").concat(i,"&").concat(s,"&").concat(c)))},et=function(t){var e,n,r,a=function(t,e){var n=e.feedback,r=e.id,a=e.abtastyIdentifier,o="score=".concat(t);return"".concat(K,"collect.php?").concat(o,"&").concat(n,"&nps").concat(r,"&").concat(a)}(t,Z());return e="GET",n=a,(r=new XMLHttpRequest).open(e,n,!1),r.send(null),r};function nt(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}var rt=DATA,at=rt.themeType,ot=rt.layout,it=rt.isFeedBackQuestion,st=rt.isThankYouMessage,ct=rt.timeHide,lt=void 0===ct?500:ct,ut=function(){function t(e,n,r,a,o,i,s){Y(this,t),this.question=e,this.feedbackQuestion=n,this.maxNote=r,this.testID=a,this.userStyles=o,this.legend=i,this.container=s,this.baseClassName="nps_container",this.npsClassName="".concat(this.baseClassName,"_").concat(a),this.questionClassName="".concat(this.baseClassName,"_question"),this.notesClassName="".concat(this.baseClassName,"_notes"),this.feedbackQuestionClassName="".concat(this.questionClassName,"_feedback"),this.notesButtonsClassName="".concat(this.notesClassName,"_button"),this.npsElement=this.getNPSElement(),this.styleElement=this.getStyleElement()}return W(t,[{key:"sendNote",value:function(t){return top.console.log("".concat(t,"/").concat(this.maxNote)),z()||et(t),this}},{key:"insert",value:function(t,e){return document.head.insertAdjacentElement("beforeend",this.styleElement),t.insertAdjacentElement(e,this.npsElement),this}},{key:"removeNPS",value:function(){return this.npsElement.remove(),this.styleElement.remove(),this}},{key:"showFeedBack",value:function(t){var e=this.getFeedBackElement();return t.insertAdjacentElement("afterend",e),t.classList.add(this.container.hideClassName),this}},{key:"getFeedBackElement",value:function(){var t=document.createElement("div");return t.className=this.feedbackQuestionClassName,t.innerHTML="\n\t\t<p>".concat(this.feedbackQuestion,'</p>\n\t\t<input type="text" class="').concat(this.feedbackQuestionClassName,'_input"></input>'),t}},{key:"getNotesElement",value:function(){var t=this,e=document.createElement("div");e.className=this.notesClassName;for(var n=this.maxNote;n>=0;){var r=document.createElement("button");r.className=this.notesButtonsClassName,r.dataset.note=n,z()&&r.setAttribute("data-abtasty-actionnable",""),r.innerHTML+="<span>".concat(n,"</span>"),r.addEventListener("click",function(n){t.sendNote(n.target.dataset.note),it&&t.feedbackQuestion&&t.feedbackQuestion.length?t.showFeedBack(e):st&&t.thankYouMessage&&t.thankYouMessage.length?t.showThankYouMessage():setTimeout(function(){return t.container.hide()},lt)},{passive:!0,capture:!0}),e.insertAdjacentElement("afterbegin",r),n-=1}return e}},{key:"getQuestionElement",value:function(){var t=document.createElement("p");return t.className=this.questionClassName,t.textContent=this.question,t}},{key:"getContainer",value:function(){var t=document.createElement("div");return t.className="".concat(this.baseClassName," ").concat(this.npsClassName),t}},{key:"getNPSElement",value:function(){var t=this.getContainer(),e=this.getQuestionElement(),n=this.getNotesElement();return t.appendChild(e),t.appendChild(n),t}},{key:"getDefaultStyles",value:function(){return"\n\t\t.ab_hide { display: none; }\n\t\t.".concat(this.baseClassName,", .").concat(this.baseClassName," * {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tmin-width: inherit;\n\t\t\tmin-height: inherit;\n\t\t\tmax-width: inherit;\n\t\t\tmax-height: inherit;\n\t\t\tfont-size: 1vmin;\n\t\t\tline-height: 1;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tborder: none;\n\t\t}")}},{key:"getThemeDefaultStyles",value:function(){var t="popin"===ot?"75em":"auto";return"\n\t\t.".concat(this.npsClassName,", .").concat(this.npsClassName," * {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.").concat(this.npsClassName," {\n\t\t\twidth: ").concat(t,";\n\t\t\theight: 10em;\n\t\t\talign-items: center;\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.questionClassName,",\n\t\t.").concat(this.npsClassName," .").concat(this.feedbackQuestionClassName," {\n\t\t\tfont-size: 2em;\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.notesClassName," {\n\t\t\tflex-grow: 0.4;\n\t\t\tflex-direction: row;\n\t\t\tjustify-content: space-around;\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.notesButtonsClassName," {\n\t\t\twidth: 3.5em;\n\t\t\theight: 3.5em;\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.notesButtonsClassName," span {\n\t\t\tfont-size: 2em;\n\t\t}")}},{key:"getUserStyles",value:function(){var t,e=this.userStyles,r=e.backgroundColor,a=e.borderColor,o=e.borderRadius,s=e.borderWidth,c=e.dropShadow,l=e.textColor,u=e.horizontalPaddingContainer,h=e.verticalPaddingContainer,d=e.horizontalMarginContainer,f=e.verticalMarginContainer,p=e.overlayColor,m=e.overlayOpacity,y=e.shadowOpacity,v=e.buttonsContrast,g=e.buttonsShape,b=Object.entries(this.userStyles).filter(function(t){return i(t,1)[0].includes(v)}).reduce(function(t,e){var r=i(e,2),a=r[0],o=r[1],s=a.split("_".concat(v))[0],c=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nt(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nt(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},t);return c[s]=o,c},{}),w=b.buttonsBackgroundColor,C=b.buttonsTextColor,E=b.buttonsBorderColor,N=b.buttonsBorderWidth;switch(g){case"roundsquare":t="border-radius: 8px;";break;case"round":t="border-radius: 50%;";break;default:t=""}var S=c?"box-shadow: 0px 5px 10px 2px rgba(0, 0, 0, ".concat(y/100,");"):"",k="\n\t\t.".concat(this.npsClassName," .").concat(this.notesButtonsClassName," {\n\t\t\tbackground-color: ").concat(w,";\n\t\t\tborder: ").concat(N,"px solid ").concat(E,";\n\t\t\t").concat(t,"\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.notesButtonsClassName," span {\n\t\t\tcolor: ").concat(C,";\n\t\t}");return"\n\t\tbody .".concat(this.npsClassName," {\n\t\t\tbackground-color: ").concat(r,";\n\t\t\tborder: ").concat(s,"px solid ").concat(a,";\n\t\t\tborder-radius: ").concat(o,"px;\n\t\t\tmargin: ").concat(f,"px ").concat(d,"px;\n\t\t\tpadding: ").concat(h,"px ").concat(u,"px;\n\t\t\t").concat(S,"\n\t\t}\n\t\t.").concat(this.questionClassName,",\n\t\t.").concat(this.feedbackQuestionClassName," {\n\t\t\tcolor: ").concat(l,";\n\t\t}\n\t\t").concat(k,"\n\t\t.").concat(this.container.overlayClassName," {\n\t\t\tbackground-color: ").concat(p,";\n\t\t\topacity: ").concat(m/100,";\n\t\t}")}},{key:"getStyleElement",value:function(){var t="theme"===at,e=this.getDefaultStyles(),n=t?this.getThemeDefaultStyles():"",r=t?this.getUserStyles():"",a=document.createElement("style");return z()&&a.setAttribute("abtasty-script-added","true"),a.textContent="".concat(e," ").concat(n," ").concat(r),a}}]),t}();function ht(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ht(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var ft="NPS";top.console.log(DATA);var pt=DATA,mt=pt.npsCampaignId,yt=pt.layout,vt=pt.bannerPosition,gt=pt.npsElementReferrer,bt=pt.npsReferrerInsertType,wt=pt.question,Ct=pt.feedbackQuestion,Et=pt.themeType,Nt=pt.theme;function St(t){return kt.apply(this,arguments)}function kt(){return(kt=c(e.mark(function t(n){var r,a,o,i;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.detail,t.next=3,$();case 3:a=t.sent,o=dt({},r,{npsCampaignId:JSON.parse(a).id}),i=new CustomEvent("asyncWidgetDataObtained",{detail:o}),top.dispatchEvent(i);case 7:case"end":return t.stop()}},t)}))).apply(this,arguments)}top.removeEventListener("widgetsave",St,{once:!0}),top.removeEventListener("widgetsave",tt,{once:!0}),z()||mt?(!mt&&z()&&!0!==ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave&&(ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave=!0,top.addEventListener("widgetsave",St,{once:!0})),mt&&z()&&!0!==ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave&&top.addEventListener("widgetsave",tt,{once:!0}),function(t){var e,n;switch(yt){case"popin":(e=new Q(TEST_ID,ft)).init(),n=e.domElement.querySelector(".".concat(e.contentClassName));break;case"banner":(e=new M(TEST_ID,ft,vt)).init(),n=e.domElement.querySelector(".".concat(e.contentClassName));break;default:e=!1,n=document.querySelector(gt)}new ut(wt,Ct,10,TEST_ID,t,["no","yes"],e).insert(n,bt),e&&e.show()}("customCss"!==Et&&Object.entries(DATA).filter(function(t){return i(t,1)[0].includes(Nt)}).reduce(function(t,e){var n=i(e,2),r=n[0],a=n[1],o=r.split("".concat(Nt,"_"))[1],s=dt({},t);return s[o]=a,s},{}))):top.console.error("The NPS is not linked to any NPS campaign")}(); | ||
!function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var e=t(function(t){var e=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,n,r){var a=e&&e.prototype instanceof m?e:m,o=Object.create(a.prototype),i=new O(r||[]);return o._invoke=function(t,e,n){var r=u;return function(a,o){if(r===d)throw new Error("Generator is already running");if(r===f){if("throw"===a)throw o;return j()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var s=S(i,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===u)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=l(t,e,n);if("normal"===c.type){if(r=n.done?f:h,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=f,n.method="throw",n.arg=c.arg)}}}(t,n,i),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u="suspendedStart",h="suspendedYield",d="executing",f="completed",p={};function m(){}function y(){}function v(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==n&&r.call(w,o)&&(g=w);var E=v.prototype=m.prototype=Object.create(g);function C(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function N(t){var e;this._invoke=function(n,a){function o(){return new Promise(function(e,o){!function e(n,a,o,i){var s=l(t[n],t,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):Promise.resolve(u).then(function(t){c.value=t,o(c)},function(t){return e("throw",t,o,i)})}i(s.arg)}(n,a,e,o)})}return e=e?e.then(o,o):o()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,S(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 a=l(r,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,p;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function k(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 x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:j}}function j(){return{value:e,done:!0}}return y.prototype=E.constructor=v,v.constructor=y,v[s]=y.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},C(N.prototype),N.prototype[i]=function(){return this},t.AsyncIterator=N,t.async=function(e,n,r,a){var o=new N(c(e,n,r,a));return t.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},C(E),E[s]="Generator",E[o]=function(){return this},E.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 r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,O.prototype={constructor:O,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(x),!t)for(var n in this)"t"===n.charAt(0)&&r.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 a(r,a){return s.type="throw",s.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(i)},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),x(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 r=n.completion;if("throw"===r.type){var a=r.arg;x(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var r=function(t){if(Array.isArray(t))return t};var a=function(t,e){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){a=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n};var o=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var i=function(t,e){return r(t)||a(t,e)||o()};function s(t,e,n,r,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,a)}var c=function(t){return function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(t){s(o,r,a,i,c,"next",t)}function c(t){s(o,r,a,i,c,"throw",t)}i(void 0)})}};var l=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var u=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var h=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var d=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var f=function(t){return u(t)||h(t)||d()};var p=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var y=function(t,e,n){return e&&m(t.prototype,e),n&&m(t,n),t},v=t(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(r){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=n=function(t){return e(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},n(r)}t.exports=n});var g=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var b=function(t,e){return!e||"object"!==v(e)&&"function"!=typeof e?g(t):e},w=t(function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e}),E=t(function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e});var C=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&E(t,e)},N="Recurrence",S="Récurrence",k="Recurrencia",x="Wiederholung",O={en:"".concat(N," of the display"),fr:"".concat(S," de l'affichage"),es:"".concat(k," de la pantalla"),de:"".concat(x," der Anzeige")},T={en:"".concat(N," after closure"),fr:"".concat(S," après fermeture"),es:"".concat(k," después del cierre"),de:"".concat(x," nach Schließung")},j={en:"".concat(N," after validation"),fr:"".concat(S," après validation"),es:"".concat(k," después de la validación"),de:"".concat(x," nach der Validierung")},P={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"};function _(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(n,!0).forEach(function(e){l(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var L={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"En cada sesión",de:"Jede Session"},value:"0"},{label:{en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},value:"1"},{label:{en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},value:"7"},{label:{en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},value:"30"},{label:{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)"},value:"365"}],value:"-1"},D=(A({},L,{label:T,propName:"closingRecurrence"}),A({},L,{label:O,propName:"displayRecurrence"}),A({},L,{label:j,propName:"validationRecurrence"}),[{label:{en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},value:"pageLoad"},{label:{en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},value:"exitIntent"},{label:{en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},value:"delay"},{label:{en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},value:"reengage"}]),I={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:P,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:"triggerEvent",value:"click"}]},B={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"exitIntent"}]},R={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"reengage"}]},q={category:"conditions",type:"number",propName:"".concat("triggerEvent","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:"triggerEvent",value:"delay"}]},z=([{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},options:D,propName:"triggerEvent",value:"pageLoad"}].concat(f([I,B,R,q])),function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")}),M=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"000000",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";p(this,t),this.testID=e,this.widgetContainer=n,this.basicClassName="ab_widget_container_".concat(n),this.widgetContainerClassName="".concat(this.basicClassName,"_").concat(e),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(e),this.domElement=this.getDom()}return y(t,[{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 t=this,e=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),a=0;a<n;a++)r[a]=arguments[a];return r.push.apply(r,f(e)),r.forEach(function(e){e.addEventListener("click",function(){t.hide()},!0)}),this}},{key:"getDom",value:function(){var t=document.createElement("div");return t.className="".concat(this.basicClassName," ").concat(this.widgetContainerClassName," ab_hide"),t.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,'" ').concat(z()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),t}},{key:"getStyleTag",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=document.createElement("style");return e.type="text/css",z()&&e.setAttribute("abtasty-script-added","true"),e.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(t),e}}]),t}(),G=function(t){function e(t,n){var r;return p(this,e),(r=b(this,w(e).call(this,t,n))).stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return C(e,M),y(e,[{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\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}")}}]),e}(),Q=function(t){function e(t,n,r){var a;return p(this,e),(a=b(this,w(e).call(this,t,n))).position=r,a.stringStyles=a.getStyles(),a.styleElement=a.getStyleTag(a.stringStyles),a}return C(e,M),y(e,[{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}\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}")}}]),e}(),Y=function(t){function e(t,n,r,a){var o;return p(this,e),(o=b(this,w(e).call(this,t,n))).position=r,o.referrerElement=a,o.stringStyles=o.getStyles(),o.styleElement=o.getStyleTag(o.stringStyles),o}return C(e,M),y(e,[{key:"insert",value:function(){var t="string"==typeof this.referrerElement?document.querySelector(this.referrerElement):this.referrerElement;return document.head.appendChild(this.styleElement),t.insertAdjacentElement(this.position,this.domElement),this}},{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tposition: relative;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\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}")}}]),e}();var F=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function W(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var U=function(t,e,n){return e&&W(t.prototype,e),n&&W(t,n),t};function H(t,e){return new Promise(function(n,r){var a=new XMLHttpRequest;a.open(t,e,!0),a.onload=function(){this.status>=200&&this.status<300?n(a.response):r({status:this.status,statusText:a.statusText})},a.onerror=function(){r({status:this.status,statusText:a.statusText})},a.send()})}var V=DATA,J=V.question,X=V.npsCampaignId,K=V.feedbackQuestion,Z="https://nps.abtasty.com/api/",$=function(){return{abtastyIdentifier:"abtastyidentifier=".concat(top.ABTasty.accountSettings.identifier),accessToken:"access_token=".concat(ABTASTY_S.SERVER.token),testId:"testId=".concat(TEST_ID),variationId:"variationId=".concat(ABTASTY_S.STORE.currentVariation.id),name:"name=".concat(ABTASTY_S.STORE.test.name," - ").concat(ABTASTY_S.STORE.currentVariation.name),nps:"nps=".concat(J),feedback:"feedback=".concat(K),id:"id=".concat(X)}},tt=function(){var t,e,n,r,a,o,i,s,c=$();return H("GET",(e=(t=c).abtastyIdentifier,n=t.accessToken,r=t.testId,a=t.variationId,o=t.name,i=t.nps,s=t.feedback,"".concat(Z,"setNPS.php?").concat(e,"&").concat(n,"&").concat(r,"&").concat(a,"&").concat(o,"&").concat(i,"&").concat(s)))},et=function(){var t,e,n,r,a,o,i,s,c,l=$();return H("GET",(e=(t=l).id,n=t.abtastyIdentifier,r=t.accessToken,a=t.testId,o=t.variationId,i=t.name,s=t.nps,c=t.feedback,"".concat(Z,"setNPS.php?").concat(e,"&").concat(n,"&").concat(r,"&").concat(a,"&").concat(o,"&").concat(i,"&").concat(s,"&").concat(c)))},nt=function(t){var e,n,r,a=function(t,e){var n=e.feedback,r=e.id,a=e.abtastyIdentifier,o="score=".concat(t);return"".concat(Z,"collect.php?").concat(o,"&").concat(n,"&nps").concat(r,"&").concat(a)}(t,$());return e="GET",n=a,(r=new XMLHttpRequest).open(e,n,!1),r.send(null),r};function rt(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}var at=DATA,ot=at.themeType,it=at.layout,st=at.isFeedBackQuestion,ct=at.isThankYouMessage,lt=at.timeHide,ut=void 0===lt?500:lt,ht=function(){function t(e,n,r,a,o,i,s){F(this,t),this.question=e,this.feedbackQuestion=n,this.maxNote=r,this.testID=a,this.userStyles=o,this.legend=i,this.container=s,this.baseClassName="nps_container",this.npsClassName="".concat(this.baseClassName,"_").concat(a),this.questionClassName="".concat(this.baseClassName,"_question"),this.notesClassName="".concat(this.baseClassName,"_notes"),this.feedbackQuestionClassName="".concat(this.questionClassName,"_feedback"),this.notesButtonsClassName="".concat(this.notesClassName,"_button"),this.npsElement=this.getNPSElement(),this.styleElement=this.getStyleElement()}return U(t,[{key:"sendNote",value:function(t){return top.console.log("".concat(t,"/").concat(this.maxNote)),z()||nt(t),this}},{key:"insert",value:function(t,e){return document.head.insertAdjacentElement("beforeend",this.styleElement),t.insertAdjacentElement(e,this.npsElement),this}},{key:"removeNPS",value:function(){return this.npsElement.remove(),this.styleElement.remove(),this}},{key:"showFeedBack",value:function(t){var e=this.getFeedBackElement();return t.insertAdjacentElement("afterend",e),t.classList.add(this.container.hideClassName),this}},{key:"getFeedBackElement",value:function(){var t=document.createElement("div");return t.className=this.feedbackQuestionClassName,t.innerHTML="\n\t\t<p>".concat(this.feedbackQuestion,'</p>\n\t\t<input type="text" class="').concat(this.feedbackQuestionClassName,'_input"></input>'),t}},{key:"getNotesElement",value:function(){var t=this,e=document.createElement("div");e.className=this.notesClassName;for(var n=this.maxNote;n>=0;){var r=document.createElement("button");r.className=this.notesButtonsClassName,r.dataset.note=n,z()&&r.setAttribute("data-abtasty-actionnable",""),r.innerHTML+="<span>".concat(n,"</span>"),r.addEventListener("click",function(n){t.sendNote(n.target.dataset.note),st&&t.feedbackQuestion&&t.feedbackQuestion.length?t.showFeedBack(e):ct&&t.thankYouMessage&&t.thankYouMessage.length?t.showThankYouMessage():setTimeout(function(){return t.container.hide()},ut)},{passive:!0,capture:!0}),e.insertAdjacentElement("afterbegin",r),n-=1}return e}},{key:"getQuestionElement",value:function(){var t=document.createElement("p");return t.className=this.questionClassName,t.textContent=this.question,t}},{key:"getContainer",value:function(){var t=document.createElement("div");return t.className="".concat(this.baseClassName," ").concat(this.npsClassName),t}},{key:"getNPSElement",value:function(){var t=this.getContainer(),e=this.getQuestionElement(),n=this.getNotesElement();return t.appendChild(e),t.appendChild(n),t}},{key:"getDefaultStyles",value:function(){return"\n\t\t.ab_hide { display: none; }\n\t\t.".concat(this.baseClassName,", .").concat(this.baseClassName," * {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tmin-width: inherit;\n\t\t\tmin-height: inherit;\n\t\t\tmax-width: inherit;\n\t\t\tmax-height: inherit;\n\t\t\tfont-size: 1vmin;\n\t\t\tline-height: 1;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tborder: none;\n\t\t}")}},{key:"getThemeDefaultStyles",value:function(){var t="popin"===it?"75em":"auto";return"\n\t\t.".concat(this.npsClassName,", .").concat(this.npsClassName," * {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: nowrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.").concat(this.npsClassName," {\n\t\t\twidth: ").concat(t,";\n\t\t\talign-items: center;\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.questionClassName,",\n\t\t.").concat(this.npsClassName," .").concat(this.feedbackQuestionClassName," {\n\t\t\tfont-size: 2em;\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.notesClassName," {\n\t\t\tflex-direction: row;\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.notesButtonsClassName," {\n\t\t\twidth: 3.5em;\n\t\t\theight: 3.5em;\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.notesButtonsClassName," span {\n\t\t\tfont-size: 2em;\n\t\t}")}},{key:"getUserStyles",value:function(){var t,e=this.userStyles,r=e.backgroundColor,a=e.borderColor,o=e.borderRadius,s=e.borderWidth,c=e.dropShadow,l=e.textColor,u=e.horizontalPaddingContainer,h=e.verticalPaddingContainer,d=e.horizontalMarginContainer,f=e.verticalMarginContainer,p=e.overlayColor,m=e.overlayOpacity,y=e.shadowOpacity,v=e.buttonsContrast,g=e.buttonsShape,b=e.contentDirection,w=e.questionMargin,E=e.buttonsHorizontalMargin,C=Object.entries(this.userStyles).filter(function(t){return i(t,1)[0].includes(v)}).reduce(function(t,e){var r=i(e,2),a=r[0],o=r[1],s=a.split("_".concat(v))[0],c=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},t);return c[s]=o,c},{}),N=C.buttonsBackgroundColor,S=C.buttonsTextColor,k=C.buttonsBorderColor,x=C.buttonsBorderWidth;switch(g){case"roundsquare":t="border-radius: 8px;";break;case"round":t="border-radius: 50%;";break;default:t=""}var O=c?"box-shadow: 0px 5px 10px 2px rgba(0, 0, 0, ".concat(y/100,");"):"",T="\n\t\t.".concat(this.npsClassName," .").concat(this.notesButtonsClassName," {\n\t\t\tmargin-left: ").concat(E,"px;\n\t\t\tmargin-right: ").concat(E,"px;\n\t\t\tbackground-color: ").concat(N,";\n\t\t\tborder: ").concat(x,"px solid ").concat(k,";\n\t\t\t").concat(t,"\n\t\t}\n\t\t.").concat(this.npsClassName," .").concat(this.notesButtonsClassName," span {\n\t\t\tcolor: ").concat(S,";\n\t\t}");return"\n\t\tbody .".concat(this.npsClassName," {\n\t\t\tflex-direction: ").concat(b,";\n\t\t\tbackground-color: ").concat(r,";\n\t\t\tborder: ").concat(s,"px solid ").concat(a,";\n\t\t\tborder-radius: ").concat(o,"px;\n\t\t\tmargin: ").concat(f,"px ").concat(d,"px;\n\t\t\tpadding: ").concat(h,"px ").concat(u,"px;\n\t\t\t").concat(O,"\n\t\t}\n\t\t.").concat(this.questionClassName,",\n\t\t.").concat(this.feedbackQuestionClassName," {\n\t\t\tcolor: ").concat(l,";\n\t\t\tmargin-").concat("row"===b?"right":"bottom"," : ").concat(w,"px;\n\t\t}\n\t\t").concat(T,"\n\t\t.").concat(this.container.overlayClassName," {\n\t\t\tbackground-color: ").concat(p,";\n\t\t\topacity: ").concat(m/100,";\n\t\t}")}},{key:"getStyleElement",value:function(){var t="theme"===ot,e=this.getDefaultStyles(),n=t?this.getThemeDefaultStyles():"",r=t?this.getUserStyles():"",a=document.createElement("style");return z()&&a.setAttribute("abtasty-script-added","true"),a.textContent="".concat(e," ").concat(n," ").concat(r),a}}]),t}();function dt(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function ft(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dt(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dt(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var pt="NPS";top.console.log(DATA);var mt=DATA,yt=mt.npsCampaignId,vt=mt.layout,gt=mt.bannerPosition,bt=mt.npsElementReferrer,wt=mt.npsReferrerInsertType,Et=mt.contentDirection,Ct=mt.question,Nt=mt.feedbackQuestion,St=mt.themeType,kt=mt.theme;function xt(t){return Ot.apply(this,arguments)}function Ot(){return(Ot=c(e.mark(function t(n){var r,a,o,i;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.detail,t.next=3,tt();case 3:a=t.sent,o=ft({},r,{npsCampaignId:JSON.parse(a).id}),i=new CustomEvent("asyncWidgetDataObtained",{detail:o}),top.dispatchEvent(i);case 7:case"end":return t.stop()}},t)}))).apply(this,arguments)}top.removeEventListener("widgetsave",xt,{once:!0}),top.removeEventListener("widgetsave",et,{once:!0}),z()||yt?(!yt&&z()&&!0!==ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave&&(ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave=!0,top.addEventListener("widgetsave",xt,{once:!0})),yt&&z()&&!0!==ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave&&top.addEventListener("widgetsave",et,{once:!0}),function(t){var e;switch(vt){case"popin":e=new G(TEST_ID,pt);break;case"banner":e=new Q(TEST_ID,pt,gt);break;default:e=new Y(TEST_ID,pt,wt,bt)}e.init();var n=e.domElement.querySelector(".".concat(e.contentClassName));new ht(Ct,Nt,10,TEST_ID,t,["no","yes"],e).insert(n,"beforeend"),e.show()}("customCss"!==St&&ft({},Object.entries(DATA).filter(function(t){return i(t,1)[0].includes(kt)}).reduce(function(t,e){var n=i(e,2),r=n[0],a=n[1],o=r.split("".concat(kt,"_"))[1],s=ft({},t);return s[o]=a,s},{}),{contentDirection:Et}))):top.console.error("The NPS is not linked to any NPS campaign")}(); |
{ | ||
"name": "@abtasty/nps", | ||
"description": "Allow you to add a custom NPS on your website", | ||
"version": "0.2.3-2", | ||
"version": "0.2.3-3", | ||
"main": "dist/main.js", | ||
@@ -46,5 +46,5 @@ "form": "dist/form.js", | ||
"dependencies": { | ||
"@abtasty/widget-utils": "^1.12.3-12", | ||
"@abtasty/widget-utils": "^1.12.3-13", | ||
"@babel/runtime": "^7.4.2" | ||
} | ||
} |
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
57652
206