@abtasty/modal
Advanced tools
Comparing version 2.0.13 to 2.0.14
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";function t(){K&&(document.querySelector("body").style.overflowY=K),q.style.display="none","video"===m&&(q.innerHTML=q.innerHTML)}function a(){return q.querySelector(j)?(q.querySelector(j).addEventListener("click",t),q.querySelector(J).addEventListener("click",t),0):setTimeout(a,50)}function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a={layout:W,type:m,borderRadius:_,borderRadiusImage:f,borderWidth:g,borderColor:h,button:v,buttonBackgroundColor:x,buttonLink:w,buttonText:k,buttonTextColor:T,backgroundColor:c,backgroundImage:p,image:B,width:z,videoLink:A,customWidth:S,animation:u,title:L,closeButtonPosition:E,modalContent:I||t.outerHTML};if(q.className="abtasty-modal abtasty-modal--"+m,q.dataset.testId=TEST_ID,q.innerHTML=d(a),document.body.appendChild(q),$=q.querySelector(".abtasty-modal__area"),C){q.querySelector(J).style.color=C}}function o(){var t=(window.innerWidth>630?.5*window.innerWidth:window.innerWidth-40)/16*9;return Math.round(t)}function i(){var t="abtasty-widget-video-"+Date.now(),a=document.createElement("iframe");a.setAttribute("id",t);var i=function(t){var a=t.indexOf("youtu")>-1,e=t.indexOf("vimeo")>-1,o=void 0;a?(o="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/)[2]+"?rel=0",N&&(o+="&autoplay=1")):e&&(o="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]);return o}(A),n=o();a.style.height=n+"px","no-title"===W&&(a.style.border=g+"px solid "+h,a.style.borderRadius=_+"px"),a.src=i,a.frameBorder=0,a.allowfullscreen=!0,e(a),$.style.height=n+"px",window.addEventListener("resize",function(){var t=document.querySelector("abtasty-modal iframe"),a=o();t.style.height=a+"px",$.style.height=a+"px"})}function n(){"video"===m?i():e(),q.style.display="block",function(){var t=document.querySelector("body");K=window.getComputedStyle(t).overflowY,t.style.overflowY="hidden"}(),b&&ABTastyEvent(y,null,TEST_ID),a(),H||(localStorage.setItem(M,G),sessionStorage.setItem(M,G))}!function(t,a){if("undefined"==typeof document)return a;t=t||"";var e=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}("abtasty-modal{display:none;z-index:1000000}abtasty-modal,abtasty-modal__underlay{position:fixed;top:0;left:0;width:100%;height:100%}abtasty-modal__underlay{background-color:rgba(0,0,0,.5);cursor:pointer}.abtasty-modal__area{top:0;left:0;right:0;width:auto;margin:10px!important;max-height:70%;z-index:100;position:relative}.abtasty-modal__area-type--video.abtasty-modal__area-layout--no-title .abtasty-modal__content{padding:5px;border-radius:0!important;border-width:0!important;background-color:transparent!important;background-image:none!important}.abtasty-modal__area-type--video.abtasty-modal__area-layout--bottom .abtasty-modal__content{padding:25px 20px 20px}.abtasty-modal__content{border-color:#f6f6f6;border-style:solid;padding:20px}.abtasty-modal__area-type--image,.abtasty-modal__area-type--no-title,.abtasty-modal__area-type--simple,.abtasty-modal__area-type--video{margin:auto!important;top:20%;max-height:50%;border:none}.abtasty-modal__area-type--video.abtasty-modal__area-layout--bottom .abtasty-modal__close--inside{top:2px}.abtasty-modal__area-type--video.abtasty-modal__area-layout--top .abtasty-modal__close--inside{right:15px;top:20px}.abtasty-modal__area-type--image .abtasty-modal__close,.abtasty-modal__area-type--simple .abtasty-modal__close{right:10px;top:15px}.abtasty-modal__close{position:absolute;right:5px;top:0;font-size:20px;font-weight:300;background:transparent;border:0;color:#222;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;line-height:20px!important;margin-right:5px;cursor:pointer}.abtasty-modal__area-type--video.abtasty-modal__area-layout--no-title .abtasty-modal__close--inside{top:-6px;right:-15px;background:#fff;border-radius:20px;width:22px;height:22px}.abtasty-modal__area-type--image .abtasty-modal__close--outside,.abtasty-modal__area-type--simple .abtasty-modal__close--outside,.abtasty-modal__close .abtasty-modal__close--outside{top:-25px;right:-25px;width:22px;height:22px;padding:1px 6px;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__close--outside{top:-25px;right:-25px;background:#fff;border-radius:20px;width:22px;height:22px}.abtasty-modal__media,.abtasty-modal__media-link{max-width:100%;display:block}.abtasty-modal__text{padding:20px;font-family:Open Sans,sans-serif!important;color:#000}.abtasty-modal__title{width:auto;font-size:20px!important;font-weight:500;line-height:1.1;margin-bottom:10px}.abtasty-modal__text p{margin:0 0 10px!important;font-size:15px;font-weight:300}.abtasty-modal__button{width:100%;text-align:center;margin-top:20px}.abtasty-modal__button a{padding:10px 20px;border-radius:10px;display:inline-block;font-weight:700}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--center .abtasty-modal__title{text-align:center}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--center .abtasty-modal__innertext{text-align:center;white-space:pre-wrap}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--left .abtasty-modal__title{width:50%;float:left;text-align:center;vertical-align:middle}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--left .abtasty-modal__innertext{width:50%;float:left}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--right .abtasty-modal__title{width:50%;float:left;text-align:center;vertical-align:middle}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--right .abtasty-modal__innertext{width:50%;float:left}.abtasty-modal__area-type--image .abtasty-modal__image img{max-height:400px}.abtasty-modal__area-type--image.abtasty-modal__area-layout--left .abtasty-modal__image{width:50%;display:inline-block;height:100%;vertical-align:middle;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--left .abtasty-modal__text{text-align:left;width:50%;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__area-type--image.abtasty-modal__area-layout--right .abtasty-modal__image{width:50%;display:inline-block;height:100%;vertical-align:middle;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--right .abtasty-modal__text{text-align:left;width:50%;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__image{width:100%;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__text{width:100%;padding:20px 0}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__image img{max-height:300px}.abtasty-modal__area-type--image.abtasty-modal__area-layout--bottom .abtasty-modal__image{width:100%;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--bottom .abtasty-modal__text{width:100%;padding:20px 0}.abtasty-modal__area-type--video{text-align:center;width:100%}.abtasty-modal__area-type--video iframe{width:100%}@media (min-width:630px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--medium{width:600px;margin:auto!important}.abtasty-modal--video{width:50%;left:20%}}@media (min-width:330px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--small{width:300px;margin:auto!important}}@media (min-width:930px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--large{width:900px;margin:auto!important}}.abtasty-animation-fadeIn{-webkit-animation-name:a;animation-name:a}.abtasty-animation-fadeIn,.abtasty-animation-fadeOut{-webkit-animation-duration:.5s;animation-duration:.5s}.abtasty-animation-fadeOut{-webkit-animation-name:b;animation-name:b}.abtasty-animation-slideIn{-webkit-animation-name:c;animation-name:c;-webkit-animation-duration:.5s;animation-duration:.5s}.abtasty-animation-slideOut{-webkit-animation-name:d;animation-name:d;-webkit-animation-duration:.5s;animation-duration:.5s}@-webkit-keyframes a{0%{opacity:0}to{opacity:1}}@keyframes a{0%{opacity:0}to{opacity:1}}@-webkit-keyframes b{0%{opacity:1}to{opacity:0}}@keyframes b{0%{opacity:1}to{opacity:0}}@-webkit-keyframes c{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes c{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes d{0%{-webkit-transform:translateY(0);transform:translateY(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes d{0%{-webkit-transform:translateY(0);transform:translateY(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}",void 0);var r=function(t){function a(t,e){if(1===arguments.length){for(var i=t[0],n=1;n<t.length;n++)i=a(i,t[n]);return i}for(var r in e)if("class"===r){d=t[r]||[];t[r]=(Array.isArray(d)?d:[d]).concat(e[r]||[])}else if("style"===r){var d=o(t[r]),l=o(e[r]);t[r]=d+l}else t[r]=e[r];return t}function e(t,a){return Array.isArray(t)?function(t,a){for(var o,i="",r="",d=Array.isArray(a),l=0;l<t.length;l++)(o=e(t[l]))&&(d&&a[l]&&(o=n(o)),i=i+r+o,r=" ");return i}(t,a):t&&"object"==typeof t?function(t){var a="",e="";for(var o in t)o&&t[o]&&d.call(t,o)&&(a=a+e+o,e=" ");return a}(t):t||""}function o(t){if(!t)return"";if("object"==typeof t){var a="";for(var e in t)d.call(t,e)&&(a=a+e+":"+t[e]+";");return a}return";"!==(t+="")[t.length-1]?t+";":t}function i(t,a,e,o){return!1!==a&&null!=a&&(a||"class"!==t&&"style"!==t)?!0===a?" "+(o?t:t+'="'+t+'"'):("function"==typeof a.toJSON&&(a=a.toJSON()),"string"==typeof a||(a=JSON.stringify(a),e||-1===a.indexOf('"'))?(e&&(a=n(a))," "+t+'="'+a+'"'):" "+t+"='"+a.replace(/'/g,"'")+"'"):""}function n(t){var a=""+t,e=l.exec(a);if(!e)return t;var o,i,n,r="";for(o=e.index,i=0;o<a.length;o++){switch(a.charCodeAt(o)){case 34:n=""";break;case 38:n="&";break;case 60:n="<";break;case 62:n=">";break;default:continue}i!==o&&(r+=a.substring(i,o)),i=o+1,r+=n}return i!==o?r+a.substring(i,o):r}function r(t,a,e,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&a||o))throw t.message+=" on line "+e,t;try{o=o||require("fs").readFileSync(a,"utf8")}catch(a){r(t,null,e)}var i=3,n=o.split("\n"),d=Math.max(e-i,0),l=Math.min(n.length,e+i),i=n.slice(d,l).map(function(t,a){var o=a+d+1;return(o==e?" > ":" ")+o+"| "+t}).join("\n");throw t.path=a,t.message=(a||"Pug")+":"+e+"\n"+i+"\n\n"+t.message,t}var d=Object.prototype.hasOwnProperty;t.merge=a,t.classes=e,t.style=o,t.attr=i,t.attrs=function(t,a){var n="";for(var r in t)if(d.call(t,r)){var l=t[r];if("class"===r){n=i(r,l=e(l),!1,a)+n;continue}"style"===r&&(l=o(l)),n+=i(r,l,!1,a)}return n};var l=/["&<>]/;return t.escape=n,t.rethrow=r,t}({}),d=function(t){var a,e="",o={};try{var i={},n=t||{};(function(t,i,n,d,l,s,m,b,y,u,c,p,_,f,g,h,v,x,w,k){o.button=a=function(){this&&this.block,this&&this.attributes;e=(e=(e+='<div class="abtasty-modal__button">')+"<a"+(r.attr("href",u,!0,!0)+r.attr("style",r.style({"background-color":y,color:p}),!0,!0))+">")+r.escape(null==(a=c)?"":a)+"</a></div>"},o.title=a=function(){this&&this.block,this&&this.attributes;e=(e+='<h2 class="abtasty-modal__title" style="text-align:center;">')+(null==(a=x)?"":a)+"</h2>"},o.image=a=function(){this&&this.block,this&&this.attributes;e+='<div class="abtasty-modal__image">',g&&(e=e+"<img"+(r.attr("src",g,!0,!0)+r.attr("style",r.style({"border-radius":s+"px"}),!0,!0))+">"),e+="</div>"},o.content=a=function(){this&&this.block,this&&this.attributes;e+='<div class="abtasty-modal__innertext">',e=(e+="<p>")+(null==(a=v)?"":a)+"</p></div>"},o.closeButton=a=function(){this&&this.block,this&&this.attributes;e=e+"<div"+r.attr("class",r.classes(["abtasty-modal__close",_?"abtasty-modal__close--"+_:""],[!1,!0]),!1,!0)+">",e+="×</div>"},o.contentWrapper=a=function(){var t=this&&this.block;this&&this.attributes;e=e+'<div class="abtasty-modal__content"'+r.attr("style",r.style({"border-radius":l+"px","border-width":m+"px","border-color":d,"background-color":i,"background-image":n?'url("'+n+'")':"none"}),!0,!0)+">",t&&t&&t(),e+="</div>"},o.modalWrapper=a=function(){var a=this&&this.block;this&&this.attributes;e=(e+="<abtasty-modal__underlay></abtasty-modal__underlay>")+"<div"+(r.attr("class",r.classes(["abtasty-animation-"+t+" abtasty-modal__area abtasty-modal__area-width--"+k+" abtasty-modal__area-type--"+w+" abtasty-modal__area-layout--"+h],[!0]),!1,!0)+r.attr("style",r.style({width:"custom"===k&&f+"%","margin-left":"custom"===k&&(100-f)/2+"% !important"}),!0,!0))+">",a&&a&&a(),e+="</div>"},o.modalWrapper.call({block:function(){o.closeButton(),o.contentWrapper.call({block:function(){"simple"===w?(e+='<div class="abtasty-modal__text">',"center"===h||"left"===h?(o.title(),o.content(),e+='<div style="clear:both;"></div>'):(o.content(),o.title(),e+='<div style="clear:both;"></div>'),e+="</div>",b&&o.button()):"image"===w?("top"!==h&&"left"!==h||o.image(),e+='<div class="abtasty-modal__text">',o.title(),o.content(),b&&o.button(),e+="</div>","right"!==h&&"bottom"!==h||o.image(),e+='<div style="clear:both;"></div>'):"video"===w&&("top"===h&&o.title(),e+=null==(a=v)?"":a,"bottom"===h&&o.title(),b&&o.button())}})}})}).call(this,"animation"in n?n.animation:"undefined"!=typeof animation?animation:void 0,"backgroundColor"in n?n.backgroundColor:"undefined"!=typeof backgroundColor?backgroundColor:void 0,"backgroundImage"in n?n.backgroundImage:"undefined"!=typeof backgroundImage?backgroundImage:void 0,"borderColor"in n?n.borderColor:"undefined"!=typeof borderColor?borderColor:void 0,"borderRadius"in n?n.borderRadius:"undefined"!=typeof borderRadius?borderRadius:void 0,"borderRadiusImage"in n?n.borderRadiusImage:"undefined"!=typeof borderRadiusImage?borderRadiusImage:void 0,"borderWidth"in n?n.borderWidth:"undefined"!=typeof borderWidth?borderWidth:void 0,"button"in n?n.button:"undefined"!=typeof button?button:void 0,"buttonBackgroundColor"in n?n.buttonBackgroundColor:"undefined"!=typeof buttonBackgroundColor?buttonBackgroundColor:void 0,"buttonLink"in n?n.buttonLink:"undefined"!=typeof buttonLink?buttonLink:void 0,"buttonText"in n?n.buttonText:"undefined"!=typeof buttonText?buttonText:void 0,"buttonTextColor"in n?n.buttonTextColor:"undefined"!=typeof buttonTextColor?buttonTextColor:void 0,"closeButtonPosition"in n?n.closeButtonPosition:"undefined"!=typeof closeButtonPosition?closeButtonPosition:void 0,"customWidth"in n?n.customWidth:"undefined"!=typeof customWidth?customWidth:void 0,"image"in n?n.image:"undefined"!=typeof image?image:void 0,"layout"in n?n.layout:"undefined"!=typeof layout?layout:void 0,"modalContent"in n?n.modalContent:"undefined"!=typeof modalContent?modalContent:void 0,"title"in n?n.title:"undefined"!=typeof title?title:void 0,"type"in n?n.type:"undefined"!=typeof type?type:void 0,"width"in n?n.width:"undefined"!=typeof width?width:void 0)}catch(t){r.rethrow(t,void 0,void 0,i[void 0])}return e},l=DATA,s=l.type,m=void 0===s?"simple":s,b=l.actionTrackingEvent,y=l.actionTrackingName,u=l.animation,c=l.backgroundColor,p=l.backgroundImage,_=l.borderRadius,f=l.borderRadiusImage,g=l.borderWidth,h=l.borderColor,v=l.button,x=l.buttonBackgroundColor,w=l.buttonLink,k=l.buttonText,T=l.buttonTextColor,C=l.closeButtonColor,E=l.closeButtonPosition,I=l.content,S=l.customWidth,L=l.title,B=l.image,W=l.layout,A=l.videoLink,Y=l.recurrence,O=l.triggerEvent,R=l.triggerEventDelay,D=l.clickEventSelector,z=l.width,N=l.autoPlay,P=void 0,q=document.createElement("abtasty-modal"),M="AB Tasty Modal "+m+" "+TEST_ID,H=void 0!==window.ABTastyEditor,F=!!sessionStorage.getItem("ABTastyPreview"),j="abtasty-modal__underlay",J=".abtasty-modal__close",G=Date.now(),$=void 0,K=void 0;!function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(function(){var t=void 0!==window.ABTastyWidgetForm&&window.ABTastyWidgetForm;if(console.log("WIDGET_FORM_OPEN",t),H&&t&&n(),"click"===O)!function(t,a,e){document.body.addEventListener("click",function(o){var i=o.target;if(!e||!i.matches(e))for(;i;){if(i!==document&&i.matches(t)){a();break}i=i.parentNode}})}(D,n,j+", "+J);else if(function(){var t=Number(Y),a=localStorage.getItem(M);return!(a&&-1!==t&&!H&&!F)||(0===t?!sessionStorage.getItem(M):a<G-24*t*60*60*1e3)}())switch(O){case"pageLoad":n();break;case"exitIntent":!function(t){var a=DATA.exitEventDelay,e=parseFloat(a)||0,o=void 0,i=0;document.addEventListener("mousemove",function(t){i=t.clientY}),document.addEventListener("mouseleave",function a(n){n.clientY<=50&&(i=0,clearInterval(o),o=setTimeout(function(){0===i&&(t(),document.removeEventListener("mouseleave",a))},1e3*e))},!1)}(n);break;case"reengage":!function(t){var a=DATA.reengageEventDelay,e=["mousemove","keydown","scroll"],o=void 0;e.forEach(function(i){document.addEventListener(i,function i(){clearTimeout(o),o=setTimeout(function(){t(),e.forEach(function(t){return document.removeEventListener(t,i)})},1e3*a)},!1)})}(n);break;case"timer":clearTimeout(P),P=setTimeout(n,1e3*R)}})}(); | ||
!function(){"use strict";function t(){K&&(document.querySelector("body").style.overflowY=K),P.style.display="none","video"===m&&(P.innerHTML=P.innerHTML)}function a(){return P.querySelector(F)?(P.querySelector(F).addEventListener("click",t),P.querySelector(J).addEventListener("click",t),0):setTimeout(a,50)}function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a={layout:Y,type:m,borderRadius:_,borderRadiusImage:f,borderWidth:g,borderColor:h,button:v,buttonBackgroundColor:x,buttonLink:w,buttonText:k,buttonTextColor:T,backgroundColor:c,backgroundImage:p,image:B,width:z,videoLink:W,customWidth:S,animation:u,title:L,closeButtonPosition:E,modalContent:I||t.outerHTML};if(P.className="abtasty-modal abtasty-modal--"+m,P.dataset.testId=TEST_ID,P.innerHTML=d(a),document.body.appendChild(P),$=P.querySelector(".abtasty-modal__area"),C){P.querySelector(J).style.color=C}}function o(){var t=(window.innerWidth>630?.5*window.innerWidth:window.innerWidth-40)/16*9;return Math.round(t)}function i(){var t="abtasty-widget-video-"+Date.now(),a=document.createElement("iframe");a.setAttribute("id",t);var i=function(t){var a=t.indexOf("youtu")>-1,e=t.indexOf("vimeo")>-1,o=void 0;a?(o="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/)[2]+"?rel=0",q&&(o+="&autoplay=1")):e&&(o="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]);return o}(W),n=o();a.style.height=n+"px","no-title"===Y&&(a.style.border=g+"px solid "+h,a.style.borderRadius=_+"px"),a.src=i,a.frameBorder=0,a.allowfullscreen=!0,e(a),$.style.height=n+"px",window.addEventListener("resize",function(){var t=document.querySelector("abtasty-modal iframe"),a=o();t.style.height=a+"px",$.style.height=a+"px"})}function n(){"video"===m?i():e(),P.style.display="block",function(){var t=document.querySelector("body");K=window.getComputedStyle(t).overflowY,t.style.overflowY="hidden"}(),b&&ABTastyEvent(y,null,TEST_ID),a(),H||(localStorage.setItem(M,G),sessionStorage.setItem(M,G))}!function(t,a){if("undefined"==typeof document)return a;t=t||"";var e=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}("abtasty-modal{display:none;z-index:1000000}abtasty-modal,abtasty-modal__underlay{position:fixed;top:0;left:0;width:100%;height:100%}abtasty-modal__underlay{background-color:rgba(0,0,0,.5);cursor:pointer}.abtasty-modal__area{top:0;left:0;right:0;width:auto;margin:10px!important;max-height:70%;z-index:100;position:relative}.abtasty-modal__area-type--video.abtasty-modal__area-layout--no-title .abtasty-modal__content{padding:5px;border-radius:0!important;border-width:0!important;background-color:transparent!important;background-image:none!important}.abtasty-modal__area-type--video.abtasty-modal__area-layout--bottom .abtasty-modal__content{padding:25px 20px 20px}.abtasty-modal__content{border-color:#f6f6f6;border-style:solid;padding:20px}.abtasty-modal__area-type--image,.abtasty-modal__area-type--no-title,.abtasty-modal__area-type--simple,.abtasty-modal__area-type--video{margin:auto!important;top:20%;max-height:50%;border:none}.abtasty-modal__area-type--video.abtasty-modal__area-layout--bottom .abtasty-modal__close--inside{top:2px}.abtasty-modal__area-type--video.abtasty-modal__area-layout--top .abtasty-modal__close--inside{right:15px;top:20px}.abtasty-modal__area-type--image .abtasty-modal__close,.abtasty-modal__area-type--simple .abtasty-modal__close{right:10px;top:15px}.abtasty-modal__close{position:absolute;right:5px;top:0;font-size:20px;font-weight:300;background:transparent;border:0;color:#222;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;line-height:20px!important;margin-right:5px;cursor:pointer}.abtasty-modal__area-type--video.abtasty-modal__area-layout--no-title .abtasty-modal__close--inside{top:-6px;right:-15px;background:#fff;border-radius:20px;width:22px;height:22px}.abtasty-modal__area-type--image .abtasty-modal__close--outside,.abtasty-modal__area-type--simple .abtasty-modal__close--outside,.abtasty-modal__close .abtasty-modal__close--outside{top:-25px;right:-25px;width:22px;height:22px;padding:1px 6px;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__close--outside{top:-25px;right:-25px;background:#fff;border-radius:20px;width:22px;height:22px}.abtasty-modal__media,.abtasty-modal__media-link{max-width:100%;display:block}.abtasty-modal__text{padding:20px;font-family:Open Sans,sans-serif!important;color:#000}.abtasty-modal__title{width:auto;font-size:20px!important;font-weight:500;line-height:1.1;margin-bottom:10px}.abtasty-modal__text p{margin:0 0 10px!important;font-size:15px;font-weight:300}.abtasty-modal__button{width:100%;text-align:center;margin-top:20px}.abtasty-modal__button a{padding:10px 20px;border-radius:10px;display:inline-block;font-weight:700}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--center .abtasty-modal__title{text-align:center}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--center .abtasty-modal__innertext{text-align:center;white-space:pre-wrap}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--left .abtasty-modal__title{width:50%;float:left;text-align:center;vertical-align:middle}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--left .abtasty-modal__innertext{width:50%;float:left}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--right .abtasty-modal__title{width:50%;float:left;text-align:center;vertical-align:middle}.abtasty-modal__area-type--simple.abtasty-modal__area-layout--right .abtasty-modal__innertext{width:50%;float:left}.abtasty-modal__area-type--image .abtasty-modal__image img{max-height:400px}.abtasty-modal__area-type--image.abtasty-modal__area-layout--left .abtasty-modal__image{width:50%;display:inline-block;height:100%;vertical-align:middle;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--left .abtasty-modal__text{text-align:left;width:50%;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__area-type--image.abtasty-modal__area-layout--right .abtasty-modal__image{width:50%;display:inline-block;height:100%;vertical-align:middle;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--right .abtasty-modal__text{text-align:left;width:50%;display:inline-block;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__image{width:100%;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__text{width:100%;padding:20px 0}.abtasty-modal__area-type--image.abtasty-modal__area-layout--top .abtasty-modal__image img{max-height:300px}.abtasty-modal__area-type--image.abtasty-modal__area-layout--bottom .abtasty-modal__image{width:100%;text-align:center}.abtasty-modal__area-type--image.abtasty-modal__area-layout--bottom .abtasty-modal__text{width:100%;padding:20px 0}.abtasty-modal__area-type--video{text-align:center;width:100%}.abtasty-modal__area-type--video iframe{width:100%}@media (min-width:630px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--medium{width:600px;margin:auto!important}.abtasty-modal--video{width:50%;left:20%}}@media (min-width:330px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--small{width:300px;margin:auto!important}}@media (min-width:930px){abtasty-modal:not(.abtasty-modal--video) .abtasty-modal__area-width--large{width:900px;margin:auto!important}}.abtasty-animation-fadeIn{-webkit-animation-name:a;animation-name:a}.abtasty-animation-fadeIn,.abtasty-animation-fadeOut{-webkit-animation-duration:.5s;animation-duration:.5s}.abtasty-animation-fadeOut{-webkit-animation-name:b;animation-name:b}.abtasty-animation-slideIn{-webkit-animation-name:c;animation-name:c;-webkit-animation-duration:.5s;animation-duration:.5s}.abtasty-animation-slideOut{-webkit-animation-name:d;animation-name:d;-webkit-animation-duration:.5s;animation-duration:.5s}@-webkit-keyframes a{0%{opacity:0}to{opacity:1}}@keyframes a{0%{opacity:0}to{opacity:1}}@-webkit-keyframes b{0%{opacity:1}to{opacity:0}}@keyframes b{0%{opacity:1}to{opacity:0}}@-webkit-keyframes c{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes c{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes d{0%{-webkit-transform:translateY(0);transform:translateY(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes d{0%{-webkit-transform:translateY(0);transform:translateY(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}",void 0);var r=function(t){function a(t,e){if(1===arguments.length){for(var i=t[0],n=1;n<t.length;n++)i=a(i,t[n]);return i}for(var r in e)if("class"===r){d=t[r]||[];t[r]=(Array.isArray(d)?d:[d]).concat(e[r]||[])}else if("style"===r){var d=o(t[r]),l=o(e[r]);t[r]=d+l}else t[r]=e[r];return t}function e(t,a){return Array.isArray(t)?function(t,a){for(var o,i="",r="",d=Array.isArray(a),l=0;l<t.length;l++)(o=e(t[l]))&&(d&&a[l]&&(o=n(o)),i=i+r+o,r=" ");return i}(t,a):t&&"object"==typeof t?function(t){var a="",e="";for(var o in t)o&&t[o]&&d.call(t,o)&&(a=a+e+o,e=" ");return a}(t):t||""}function o(t){if(!t)return"";if("object"==typeof t){var a="";for(var e in t)d.call(t,e)&&(a=a+e+":"+t[e]+";");return a}return";"!==(t+="")[t.length-1]?t+";":t}function i(t,a,e,o){return!1!==a&&null!=a&&(a||"class"!==t&&"style"!==t)?!0===a?" "+(o?t:t+'="'+t+'"'):("function"==typeof a.toJSON&&(a=a.toJSON()),"string"==typeof a||(a=JSON.stringify(a),e||-1===a.indexOf('"'))?(e&&(a=n(a))," "+t+'="'+a+'"'):" "+t+"='"+a.replace(/'/g,"'")+"'"):""}function n(t){var a=""+t,e=l.exec(a);if(!e)return t;var o,i,n,r="";for(o=e.index,i=0;o<a.length;o++){switch(a.charCodeAt(o)){case 34:n=""";break;case 38:n="&";break;case 60:n="<";break;case 62:n=">";break;default:continue}i!==o&&(r+=a.substring(i,o)),i=o+1,r+=n}return i!==o?r+a.substring(i,o):r}function r(t,a,e,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&a||o))throw t.message+=" on line "+e,t;try{o=o||require("fs").readFileSync(a,"utf8")}catch(a){r(t,null,e)}var i=3,n=o.split("\n"),d=Math.max(e-i,0),l=Math.min(n.length,e+i),i=n.slice(d,l).map(function(t,a){var o=a+d+1;return(o==e?" > ":" ")+o+"| "+t}).join("\n");throw t.path=a,t.message=(a||"Pug")+":"+e+"\n"+i+"\n\n"+t.message,t}var d=Object.prototype.hasOwnProperty;t.merge=a,t.classes=e,t.style=o,t.attr=i,t.attrs=function(t,a){var n="";for(var r in t)if(d.call(t,r)){var l=t[r];if("class"===r){n=i(r,l=e(l),!1,a)+n;continue}"style"===r&&(l=o(l)),n+=i(r,l,!1,a)}return n};var l=/["&<>]/;return t.escape=n,t.rethrow=r,t}({}),d=function(t){var a,e="",o={};try{var i={},n=t||{};(function(t,i,n,d,l,s,m,b,y,u,c,p,_,f,g,h,v,x,w,k){o.button=a=function(){this&&this.block,this&&this.attributes;e=(e=(e+='<div class="abtasty-modal__button">')+"<a"+(r.attr("href",u,!0,!0)+r.attr("style",r.style({"background-color":y,color:p}),!0,!0))+">")+r.escape(null==(a=c)?"":a)+"</a></div>"},o.title=a=function(){this&&this.block,this&&this.attributes;e=(e+='<h2 class="abtasty-modal__title" style="text-align:center;">')+(null==(a=x)?"":a)+"</h2>"},o.image=a=function(){this&&this.block,this&&this.attributes;e+='<div class="abtasty-modal__image">',g&&(e=e+"<img"+(r.attr("src",g,!0,!0)+r.attr("style",r.style({"border-radius":s+"px"}),!0,!0))+">"),e+="</div>"},o.content=a=function(){this&&this.block,this&&this.attributes;e+='<div class="abtasty-modal__innertext">',e=(e+="<p>")+(null==(a=v)?"":a)+"</p></div>"},o.closeButton=a=function(){this&&this.block,this&&this.attributes;e=e+"<div"+r.attr("class",r.classes(["abtasty-modal__close",_?"abtasty-modal__close--"+_:""],[!1,!0]),!1,!0)+">",e+="×</div>"},o.contentWrapper=a=function(){var t=this&&this.block;this&&this.attributes;e=e+'<div class="abtasty-modal__content"'+r.attr("style",r.style({"border-radius":l+"px","border-width":m+"px","border-color":d,"background-color":i,"background-image":n?'url("'+n+'")':"none"}),!0,!0)+">",t&&t&&t(),e+="</div>"},o.modalWrapper=a=function(){var a=this&&this.block;this&&this.attributes;e=(e+="<abtasty-modal__underlay></abtasty-modal__underlay>")+"<div"+(r.attr("class",r.classes(["abtasty-animation-"+t+" abtasty-modal__area abtasty-modal__area-width--"+k+" abtasty-modal__area-type--"+w+" abtasty-modal__area-layout--"+h],[!0]),!1,!0)+r.attr("style",r.style({width:"custom"===k&&f+"%","margin-left":"custom"===k&&(100-f)/2+"% !important"}),!0,!0))+">",a&&a&&a(),e+="</div>"},o.modalWrapper.call({block:function(){o.closeButton(),o.contentWrapper.call({block:function(){"simple"===w?(e+='<div class="abtasty-modal__text">',"center"===h||"left"===h?(o.title(),o.content(),e+='<div style="clear:both;"></div>'):(o.content(),o.title(),e+='<div style="clear:both;"></div>'),e+="</div>",b&&o.button()):"image"===w?("top"!==h&&"left"!==h||o.image(),e+='<div class="abtasty-modal__text">',o.title(),o.content(),b&&o.button(),e+="</div>","right"!==h&&"bottom"!==h||o.image(),e+='<div style="clear:both;"></div>'):"video"===w&&("top"===h&&o.title(),e+=null==(a=v)?"":a,"bottom"===h&&o.title(),b&&o.button())}})}})}).call(this,"animation"in n?n.animation:"undefined"!=typeof animation?animation:void 0,"backgroundColor"in n?n.backgroundColor:"undefined"!=typeof backgroundColor?backgroundColor:void 0,"backgroundImage"in n?n.backgroundImage:"undefined"!=typeof backgroundImage?backgroundImage:void 0,"borderColor"in n?n.borderColor:"undefined"!=typeof borderColor?borderColor:void 0,"borderRadius"in n?n.borderRadius:"undefined"!=typeof borderRadius?borderRadius:void 0,"borderRadiusImage"in n?n.borderRadiusImage:"undefined"!=typeof borderRadiusImage?borderRadiusImage:void 0,"borderWidth"in n?n.borderWidth:"undefined"!=typeof borderWidth?borderWidth:void 0,"button"in n?n.button:"undefined"!=typeof button?button:void 0,"buttonBackgroundColor"in n?n.buttonBackgroundColor:"undefined"!=typeof buttonBackgroundColor?buttonBackgroundColor:void 0,"buttonLink"in n?n.buttonLink:"undefined"!=typeof buttonLink?buttonLink:void 0,"buttonText"in n?n.buttonText:"undefined"!=typeof buttonText?buttonText:void 0,"buttonTextColor"in n?n.buttonTextColor:"undefined"!=typeof buttonTextColor?buttonTextColor:void 0,"closeButtonPosition"in n?n.closeButtonPosition:"undefined"!=typeof closeButtonPosition?closeButtonPosition:void 0,"customWidth"in n?n.customWidth:"undefined"!=typeof customWidth?customWidth:void 0,"image"in n?n.image:"undefined"!=typeof image?image:void 0,"layout"in n?n.layout:"undefined"!=typeof layout?layout:void 0,"modalContent"in n?n.modalContent:"undefined"!=typeof modalContent?modalContent:void 0,"title"in n?n.title:"undefined"!=typeof title?title:void 0,"type"in n?n.type:"undefined"!=typeof type?type:void 0,"width"in n?n.width:"undefined"!=typeof width?width:void 0)}catch(t){r.rethrow(t,void 0,void 0,i[void 0])}return e},l=DATA,s=l.type,m=void 0===s?"simple":s,b=l.actionTrackingEvent,y=l.actionTrackingName,u=l.animation,c=l.backgroundColor,p=l.backgroundImage,_=l.borderRadius,f=l.borderRadiusImage,g=l.borderWidth,h=l.borderColor,v=l.button,x=l.buttonBackgroundColor,w=l.buttonLink,k=l.buttonText,T=l.buttonTextColor,C=l.closeButtonColor,E=l.closeButtonPosition,I=l.content,S=l.customWidth,L=l.title,B=l.image,Y=l.layout,W=l.videoLink,A=l.recurrence,O=l.triggerEvent,R=l.triggerEventDelay,D=l.clickEventSelector,z=l.width,q=l.autoPlay,N=void 0,P=document.createElement("abtasty-modal"),M="AB Tasty Modal "+m+" "+TEST_ID,H=void 0!==window.ABTastyEditor,j=!!sessionStorage.getItem("ABTastyPreview"),F="abtasty-modal__underlay",J=".abtasty-modal__close",G=Date.now(),$=void 0,K=void 0;!function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(function(){var t="block"===document.querySelector("#abtasty-widget-react-form").style.display;if(console.log("WIDGET_FORM_OPEN",t),H&&t&&n(),"click"===O)!function(t,a,e){document.body.addEventListener("click",function(o){var i=o.target;if(!e||!i.matches(e))for(;i;){if(i!==document&&i.matches(t)){a();break}i=i.parentNode}})}(D,n,F+", "+J);else if(function(){var t=Number(A),a=localStorage.getItem(M);return!(a&&-1!==t&&!H&&!j)||(0===t?!sessionStorage.getItem(M):a<G-24*t*60*60*1e3)}())switch(O){case"pageLoad":n();break;case"exitIntent":!function(t){var a=DATA.exitEventDelay,e=parseFloat(a)||0,o=void 0,i=0;document.addEventListener("mousemove",function(t){i=t.clientY}),document.addEventListener("mouseleave",function a(n){n.clientY<=50&&(i=0,clearInterval(o),o=setTimeout(function(){0===i&&(t(),document.removeEventListener("mouseleave",a))},1e3*e))},!1)}(n);break;case"reengage":!function(t){var a=DATA.reengageEventDelay,e=["mousemove","keydown","scroll"],o=void 0;e.forEach(function(i){document.addEventListener(i,function i(){clearTimeout(o),o=setTimeout(function(){t(),e.forEach(function(t){return document.removeEventListener(t,i)})},1e3*a)},!1)})}(n);break;case"timer":clearTimeout(N),N=setTimeout(n,1e3*R)}})}(); |
{ | ||
"name": "@abtasty/modal", | ||
"description": "Widget for AB Tasty", | ||
"version": "2.0.13", | ||
"version": "2.0.14", | ||
"icon": "icon.png", | ||
@@ -6,0 +6,0 @@ "form": "dist/form.js", |
58807