Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@abtasty/modal

Package Overview
Dependencies
Maintainers
13
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abtasty/modal - npm Package Compare versions

Comparing version 1.3.8 to 2.0.0

3

dist/main.js

@@ -1,1 +0,2 @@

!function(){"use strict";function t(){c.style.display="none","video"===d&&(c.innerHTML=c.innerHTML)}function e(){return c.querySelector(p)?(c.querySelector(p).addEventListener("click",t),c.querySelector(h).addEventListener("click",t),0):setTimeout(e,50)}function a(){c.style.display="block","on"===DATA.actionTracking&&ABTastyEvent(DATA.actionTrackingName,null,TEST_ID),e(),f||(localStorage.setItem(u,v),sessionStorage.setItem(u,v))}function o(t){void 0===t&&(t=!1);var e={modalSize:DATA.size,modalTitle:DATA.modalTitle,modalContent:DATA.modalContent||t.outerHTML,closeButtonPosition:!!DATA.closeButtonPosition&&DATA.closeButtonPosition,modalTypeMedia:!!t,link:DATA.url};if(c.className="abtasty-modal abtasty-modal--"+d,c.dataset.testId=TEST_ID,c.innerHTML=l(e),document.body.appendChild(c),n=c.querySelector(".abtasty-modal__area"),DATA.closeButtonColor){c.querySelector(h).style.color=DATA.closeButtonColor}}!function(t,e){if("undefined"==typeof document)return e;t=t||"";var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a.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;background-color:#fff;border:3px solid #fff;text-align:left}.abtasty-modal__area--media{max-width:80%;margin:auto!important;top:20%;max-height:50%;border:none}.abtasty-modal__close{float:right!important;font-size:44px;font-weight:300;background:transparent;border:0;color:#bbb;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;line-height:32px!important;margin-right:5px;cursor:pointer}.abtasty-modal__area--media .abtasty-modal__close{position:absolute;right:0;color:#e6e6e6}.abtasty-modal__area--media .abtasty-modal__close--outside{top:-40px;right:-35px}.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{text-align:left;width:auto;font-size:31px!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}@media (min-width:630px){.abtasty-modal__area--medium{width:600px;margin:150px auto!important}}@media (min-width:330px){.abtasty-modal__area--small{width:300px;margin:150px auto!important}}@media (min-width:930px){.abtasty-modal__area--large{width:900px;margin:150px auto!important}}",void 0);var n,i,r=function(t){function e(t,a){if(1===arguments.length){for(var n=t[0],i=1;i<t.length;i++)n=e(n,t[i]);return n}for(var r in a)if("class"===r){l=t[r]||[];t[r]=(Array.isArray(l)?l:[l]).concat(a[r]||[])}else if("style"===r){var l=o(t[r]),d=o(a[r]);t[r]=l+d}else t[r]=a[r];return t}function a(t,e){return Array.isArray(t)?function(t,e){for(var o,n="",r="",l=Array.isArray(e),d=0;d<t.length;d++)(o=a(t[d]))&&(l&&e[d]&&(o=i(o)),n=n+r+o,r=" ");return n}(t,e):t&&"object"==typeof t?function(t){var e="",a="";for(var o in t)o&&t[o]&&l.call(t,o)&&(e=e+a+o,a=" ");return e}(t):t||""}function o(t){if(!t)return"";if("object"==typeof t){var e="";for(var a in t)l.call(t,a)&&(e=e+a+":"+t[a]+";");return e}return";"!==(t+="")[t.length-1]?t+";":t}function n(t,e,a,o){return!1!==e&&null!=e&&(e||"class"!==t&&"style"!==t)?!0===e?" "+(o?t:t+'="'+t+'"'):("function"==typeof e.toJSON&&(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),a||-1===e.indexOf('"'))?(a&&(e=i(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"&#39;")+"'"):""}function i(t){var e=""+t,a=d.exec(e);if(!a)return t;var o,n,i,r="";for(o=a.index,n=0;o<e.length;o++){switch(e.charCodeAt(o)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}n!==o&&(r+=e.substring(n,o)),n=o+1,r+=i}return n!==o?r+e.substring(n,o):r}function r(t,e,a,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&e||o))throw t.message+=" on line "+a,t;try{o=o||require("fs").readFileSync(e,"utf8")}catch(e){r(t,null,a)}var n=3,i=o.split("\n"),l=Math.max(a-n,0),d=Math.min(i.length,a+n),n=i.slice(l,d).map(function(t,e){var o=e+l+1;return(o==a?" > ":" ")+o+"| "+t}).join("\n");throw t.path=e,t.message=(e||"Pug")+":"+a+"\n"+n+"\n\n"+t.message,t}var l=Object.prototype.hasOwnProperty;t.merge=e,t.classes=a,t.style=o,t.attr=n,t.attrs=function(t,e){var i="";for(var r in t)if(l.call(t,r)){var d=t[r];if("class"===r){i=n(r,d=a(d),!1,e)+i;continue}"style"===r&&(d=o(d)),i+=n(r,d,!1,e)}return i};var d=/["&<>]/;return t.escape=i,t.rethrow=r,t}({}),l=function(t){var e,a="";try{var o={},n=t||{};(function(t,o,n,i,l,d){a=(a=(a+="<abtasty-modal__underlay></abtasty-modal__underlay>")+"<div"+r.attr("class",r.classes(["abtasty-modal__area abtasty-modal__area--"+(d?"media":""+i)],[!0]),!1,!0)+">")+"<div"+r.attr("class",r.classes(["abtasty-modal__close",t?"abtasty-modal__close--"+t:""],[!1,!0]),!1,!0)+">",a+="×</div>",a+='<div class="abtasty-modal__content">',d?o?a=(a=a+'<a class="abtasty-modal__media-link"'+r.attr("href",o,!0,!0)+">")+(null==(e=n)?"":e)+"</a>":a+=null==(e=n)?"":e:(a+='<div class="abtasty-modal__text">',a=(a=(a+='<h2 class="abtasty-modal__title">')+r.escape(null==(e=l)?"":e)+"</h2>")+(null==(e=n)?"":e)+"</div>"),a+="</div></div>"}).call(this,"closeButtonPosition"in n?n.closeButtonPosition:"undefined"!=typeof closeButtonPosition?closeButtonPosition:void 0,"link"in n?n.link:"undefined"!=typeof link?link:void 0,"modalContent"in n?n.modalContent:"undefined"!=typeof modalContent?modalContent:void 0,"modalSize"in n?n.modalSize:"undefined"!=typeof modalSize?modalSize:void 0,"modalTitle"in n?n.modalTitle:"undefined"!=typeof modalTitle?modalTitle:void 0,"modalTypeMedia"in n?n.modalTypeMedia:"undefined"!=typeof modalTypeMedia?modalTypeMedia:void 0)}catch(t){r.rethrow(t,void 0,void 0,o[void 0])}return a},d=DATA.modalType,s="image"===d&&DATA.imgUrl,m="video"===d&&DATA.videoLink,c=document.createElement("abtasty-modal"),u="AB Tasty Modal "+d+" "+TEST_ID,f=void 0!==window.ABTastyEditor,y=!!sessionStorage.getItem("ABTastyPreview"),p="abtasty-modal__underlay",h=".abtasty-modal__close",v=Date.now(),g={pageLoad:a,exitIntent:function(){var t=parseFloat(DATA.exitIntentDelay)||0,e=0,o=0;document.addEventListener("mousemove",function(t){o=t.clientY}),document.body.addEventListener("mouseleave",function n(i){i.clientY<=50&&(o=0,clearInterval(e),e=setTimeout(function(){0===o&&(a(),document.body.removeEventListener("mouseleave",n))},1e3*t))},!1)},reengage:function(){var t=["mousemove","keydown","scroll"];t.forEach(function(e){document.addEventListener(e,function e(){clearTimeout(i),i=setTimeout(function(){a(),t.forEach(function(t){return document.removeEventListener(t,e)})},1e3*DATA.timer)},!1)})},timer:function(){setTimeout(a,1e3*DATA.timer)}};!function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(function(){!function(){if(s){var t=new Image;t.src=DATA.imgUrl,t.className="abtasty-modal__media",t.onload=function(){o(this),n.style.width=this.width+"px",n.style.height=this.height+"px"}}else if(m){var e=document.createElement("iframe"),a=DATA.size.split(" x "),i=a[0]+"px",r=a[1]+"px",l=function(t){var e,a=t.indexOf("youtu")>-1,o=t.indexOf("vimeo")>-1;return a?e="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/)[2]+"?rel=0":o&&(e="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]),e}(DATA.videoLink);e.width=i,e.height=r,e.src=l,e.frameBorder=0,e.allowfullscreen=!0,o(e),n.style.width=i,n.style.height=r}else o()}(),"click"===DATA.trigger?function(t,e,a){document.body.addEventListener("click",function(o){var n=o.target;if(!a||!n.matches(a))for(;n;){if(n!==document&&n.matches(t)){e();break}n=n.parentNode}})}(DATA.selector,a,p+", "+h):function(){var t=Number(DATA.displayFrequency),e=localStorage.getItem(u);return!(e&&-1!==t&&!f&&!y)||(0===t?!sessionStorage.getItem(u):e<v-24*t*60*60*1e3)}()&&g[DATA.trigger]()})}();
!function(){"use strict";function t(){N.style.display="none","video"===l&&(N.innerHTML=N.innerHTML)}function a(){return N.querySelector(q)?(N.querySelector(q).addEventListener("click",t),N.querySelector(H).addEventListener("click",t),0):setTimeout(a,50)}function e(){N.style.display="block",s&&ABTastyEvent(m,null,TEST_ID),a(),M||(localStorage.setItem(z,R),sessionStorage.setItem(z,R))}function o(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a={layout:L,type:l,borderRadius:y,borderWidth:f,borderColor:p,button:_,buttonBackgroundColor:g,buttonLink:h,buttonText:v,buttonTextColor:x,backgroundColor:c,backgroundImage:b,image:A,width:O,videoLink:I,customWidth:C,animation:u,title:E,closeButtonPosition:w,modalContent:T||t.outerHTML};N.className="abtasty-modal abtasty-modal--"+l,N.dataset.testId=TEST_ID;var e=n(a);if(N.innerHTML=e,document.body.appendChild(N),j=N.querySelector(".abtasty-modal__area"),k){N.querySelector(H).style.color=k}}!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__content{border-color:#f6f6f6;border-style:solid;padding:20px}.abtasty-modal__area-type--image,.abtasty-modal__area-type--video{max-width:80%;margin:auto!important;top:20%;max-height:50%;border:none}.abtasty-modal__close{position:absolute;right:5px;top:0;font-size:30px;font-weight:300;background:transparent;border:0;color:#bbb;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;line-height:32px!important;margin-right:5px;cursor:pointer}.abtasty-modal__close--outside{top:-30px;right:-30px}.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:31px!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}.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__innertext,.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--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--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}@media (min-width:630px){.abtasty-modal__area-width--medium{width:600px;margin:150px auto!important}}@media (min-width:330px){.abtasty-modal__area-width--small{width:300px;margin:150px auto!important}}@media (min-width:930px){.abtasty-modal__area-width--large{width:900px;margin:150px 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 i=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,"&#39;")+"'"):""}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="&quot;";break;case 38:n="&amp;";break;case 60:n="&lt;";break;case 62:n="&gt;";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}({}),n=function(t){var a,e="",o={};try{var n={},r=t||{};(function(t,n,r,d,l,s,m,u,c,b,y,f,p,_,g,h,v,x,k){o.button=a=function(){this&&this.block,this&&this.attributes;e=(e=(e+='<div class="abtasty-modal__button">')+"<a"+(i.attr("href",c,!0,!0)+i.attr("style",i.style({"background-color":u,color:y}),!0,!0))+">")+i.escape(null==(a=b)?"":a)+"</a></div>"},o.title=a=function(){this&&this.block,this&&this.attributes;e=(e+='<h2 class="abtasty-modal__title">')+i.escape(null==(a=v)?"":a)+"</h2>"},o.image=a=function(){this&&this.block,this&&this.attributes;e+='<div class="abtasty-modal__image">',_&&(e=e+"<img"+(i.attr("src",_,!0,!0)+i.attr("style",i.style({"border-radius":l+"px"}),!0,!0))+">"),e+="</div>"},o.content=a=function(){this&&this.block,this&&this.attributes;e=(e+='<p class="abtasty-modal__innertext">')+i.escape(null==(a=h)?"":a)+"</p>"},o.closeButton=a=function(){this&&this.block,this&&this.attributes;e=e+"<div"+i.attr("class",i.classes(["abtasty-modal__close",f?"abtasty-modal__close--"+f:""],[!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"'+i.attr("style",i.style({"border-radius":l+"px","border-width":s+"px","border-color":d,"background-color":n,"background-image":r?'url("'+r+'")':"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"+(i.attr("class",i.classes(["abtasty-animation-"+t+" abtasty-modal__area abtasty-modal__area-width--"+k+" abtasty-modal__area-type--"+x+" abtasty-modal__area-layout--"+g],[!0]),!1,!0)+i.attr("style",i.style({width:"custom"===k&&p+"%","margin-left":"custom"===k&&(100-p)/2+"% !important"}),!0,!0))+">",a&&a&&a(),e+="</div>"},o.modalWrapper.call({block:function(){o.closeButton(),o.contentWrapper.call({block:function(){"simple"===x?(e+='<div class="abtasty-modal__text">',"center"===g||"left"===g?(o.title(),o.content(),e+='<div style="clear:both;"></div>'):(o.content(),o.title(),e+='<div style="clear:both;"></div>'),e+="</div>",m&&o.button()):"image"===x?("top"!==g&&"left"!==g||o.image(),e+='<div class="abtasty-modal__text">',o.title(),o.content(),m&&o.button(),e+="</div>","right"!==g&&"bottom"!==g||o.image(),e+='<div style="clear:both;"></div>'):"video"===x&&("top"===g&&o.title(),e+=null==(a=h)?"":a,"bottom"===g&&o.title(),m&&o.button())}})}})}).call(this,"animation"in r?r.animation:"undefined"!=typeof animation?animation:void 0,"backgroundColor"in r?r.backgroundColor:"undefined"!=typeof backgroundColor?backgroundColor:void 0,"backgroundImage"in r?r.backgroundImage:"undefined"!=typeof backgroundImage?backgroundImage:void 0,"borderColor"in r?r.borderColor:"undefined"!=typeof borderColor?borderColor:void 0,"borderRadius"in r?r.borderRadius:"undefined"!=typeof borderRadius?borderRadius:void 0,"borderWidth"in r?r.borderWidth:"undefined"!=typeof borderWidth?borderWidth:void 0,"button"in r?r.button:"undefined"!=typeof button?button:void 0,"buttonBackgroundColor"in r?r.buttonBackgroundColor:"undefined"!=typeof buttonBackgroundColor?buttonBackgroundColor:void 0,"buttonLink"in r?r.buttonLink:"undefined"!=typeof buttonLink?buttonLink:void 0,"buttonText"in r?r.buttonText:"undefined"!=typeof buttonText?buttonText:void 0,"buttonTextColor"in r?r.buttonTextColor:"undefined"!=typeof buttonTextColor?buttonTextColor:void 0,"closeButtonPosition"in r?r.closeButtonPosition:"undefined"!=typeof closeButtonPosition?closeButtonPosition:void 0,"customWidth"in r?r.customWidth:"undefined"!=typeof customWidth?customWidth:void 0,"image"in r?r.image:"undefined"!=typeof image?image:void 0,"layout"in r?r.layout:"undefined"!=typeof layout?layout:void 0,"modalContent"in r?r.modalContent:"undefined"!=typeof modalContent?modalContent:void 0,"title"in r?r.title:"undefined"!=typeof title?title:void 0,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"width"in r?r.width:"undefined"!=typeof width?width:void 0)}catch(t){i.rethrow(t,void 0,void 0,n[void 0])}return e};!function(){console.log("DATA",DATA);var t=parseFloat(DATA.exitEventDelay)||0,a=0,e=0;document.addEventListener("mousemove",function(t){e=t.clientY}),document.addEventListener("mouseleave",function o(i){i.clientY<=50&&(e=0,clearInterval(a),a=setTimeout(function(){0===e&&(showModal(),document.removeEventListener("mouseleave",o))},1e3*t))},!1)}();var r=DATA,d=r.type,l=void 0===d?"simple":d,s=r.actionTrackingEvent,m=r.actionTrackingName,u=r.animation,c=r.backgroundColor,b=r.backgroundImage,y=r.borderRadius,f=r.borderWidth,p=r.borderColor,_=r.button,g=r.buttonBackgroundColor,h=r.buttonLink,v=r.buttonText,x=r.buttonTextColor,k=r.closeButtonColor,w=r.closeButtonPosition,T=r.content,C=r.customWidth,E=r.title,A=r.image,L=r.layout,I=r.videoLink,S=r.recurrence,B=r.triggerEvent,Y=r.triggerEventDelay,D=(r.exitEventDelay,r.clickEventSelector),W=r.reengageEventDelay,O=r.width,N=("image"===l&&DATA.imgUrl,"video"===l&&DATA.videoLink,document.createElement("abtasty-modal")),z="AB Tasty Modal "+l+" "+TEST_ID,M=void 0!==window.ABTastyEditor,P=!!sessionStorage.getItem("ABTastyPreview"),q="abtasty-modal__underlay",H=".abtasty-modal__close",R=Date.now(),j=void 0,F=void 0,J={pageLoad:e,exitIntent:function(){var t=parseFloat(DATA.exitIntentDelay)||0,a=0,o=0;document.addEventListener("mousemove",function(t){o=t.clientY}),document.addEventListener("mouseleave",function i(n){n.clientY<=50&&(o=0,clearInterval(a),a=setTimeout(function(){0===o&&(e(),document.removeEventListener("mouseleave",i))},1e3*t))},!1)},reengage:function(){var t=["mousemove","keydown","scroll"];t.forEach(function(a){document.addEventListener(a,function a(){clearTimeout(F),F=setTimeout(function(){e(),t.forEach(function(t){return document.removeEventListener(t,a)})},1e3*W)},!1)})},timer:function(){setTimeout(e,1e3*Y)}};!function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(function(){"video"===l?function(){var t="abtasty-widget-video-"+Date.now(),a=document.createElement("iframe");a.setAttribute("id",t);var e=[853,480],i=e[0]+"px",n=e[1]+"px",r=function(t){var a=t.indexOf("youtu")>-1,e=t.indexOf("vimeo")>-1,o=void 0;return a?o="//www.youtube.com/embed/"+t.match(/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&?]*).*/)[2]+"?rel=0":e&&(o="//player.vimeo.com/video/"+t.match(/.*(www\.)?vimeo.com\/(\d+)($|\/)/)[2]),o}(I);a.width=i,a.height=n,a.src=r,a.frameBorder=0,a.allowfullscreen=!0,o(a),j.style.width=i,j.style.height=n}():o(),"click"===B?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,e,q+", "+H):function(){var t=Number(S),a=localStorage.getItem(z);return!(a&&-1!==t&&!M&&!P)||(0===t?!sessionStorage.getItem(z):a<R-24*t*60*60*1e3)}()&&J[B]()})}();
//# sourceMappingURL=main.js.map
{
"name": "@abtasty/modal",
"description": "Widget for AB Tasty",
"version": "1.3.8",
"version": "2.0.0",
"icon": "icon.png",
"form": "form.html",
"form": "form.js",
"main": "dist/main.js",

@@ -24,2 +24,3 @@ "files": [

"devDependencies": {
"babel-preset-env": "^1.6.1",
"concurrently": "^3.5.0",

@@ -32,2 +33,3 @@ "cssnano": "^3.10.0",

"rollup": "^0.51.5",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-buble": "^0.17.0",

@@ -44,4 +46,7 @@ "rollup-plugin-commonjs": "^8.2.6",

"dependencies": {
"@abtasty/widget-utils": "^1.10.0"
"@abtasty/widget-utils": "^1.10.0",
"babel": "^6.23.0",
"babel-core": "^6.26.0",
"rollup-plugin-uglify-es": "0.0.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc