!function(t){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var a=Object(t),n=1;n>>0;if("function"!=typeof t)throw TypeError("predicate must be a function");for(var n=arguments[1],i=0;i0||"popout"==i.app.display_settings.action&&i.app.display_settings.popout.autoshow>0)&&i.isApprovedUrl()&&n.getCookie(i.uniqueSlug("autoshow"))<1&&(n.setCookie(i.uniqueSlug("autoshow"),"1"),i.triggers.click())},makePromoGrid:function(){this.makeDefaultApp()},makeDefaultApp:function(e){var a=this,i=a.parentElement.getAttribute("class");i.indexOf("widget-relative")<0&&(i+=" widget-relative",a.parentElement.setAttribute("class",i)),a.makeAppIframe((function(){!a.noscroll&&n.getScrollTop()&&n.getScrollTop()+150>=t.outerHeight&&n.showElement(a.parentElement,100),"function"==typeof e&&e()})),a.makeAudienceBanner(),a.parentElement.classList.add("has-iframe"),a.parentElement.appendChild(a.iframe),"1"!==a.app.whitelabel&&a.parentElement.appendChild(a.banner),n.config.query&&"aptivada"==n.config.query.debug&&console.log("make default app","appending",a.iframe,"to",a.parentElement),a.parentElement.setAttribute("style",a.config.parent_style),a.parentElement.style.backgroundImage="none"},makeButton:function(t,e){var a=this,n=a.parts=a.makeButtonParts(),i=function(){"function"==typeof e.onCreate&&e.onCreate()},o=function(){"default"==a.app.display_settings.action&&n.wrap.parentNode.removeChild(n.wrap),"function"==typeof e.onClick&&e.onClick()};n.content.appendChild(n.label),n.content.appendChild(n.title),n.wrap.appendChild(n.content),n.label.innerText=a.app.type_name,n.title.innerText=a.app.display_settings.label||a.app.title,a.parentElement.appendChild(n.wrap),a.triggers.click=function(e){if("true"==a.hasLoaded)return!1;o(),"function"==typeof t&&t(i)},n.content.addEventListener("click",a.triggers.click)},makePreview:function(t,e){var a=this,n=a.parts=a.makeButtonParts(),i=function(){"function"==typeof e.onCreate&&e.onCreate()},o=function(){"default"!=a.app.display_settings.action&&"flyout"!=a.app.display_settings.type||n.wrap.parentNode.removeChild(n.wrap),"function"==typeof e.onClick&&e.onClick()};n.title.innerText=a.app.title,n.button.innerText=a.app.display_settings.label||"Start",n.link.appendChild(n.image),n.content.appendChild(n.link),n.content.appendChild(n.title),n.content.appendChild(n.button),n.wrap.appendChild(n.content),a.parentElement.appendChild(n.wrap),a.triggers.click=function(){if("true"==a.hasLoaded)return!1;o(),"function"==typeof t&&t(i)},n.link.addEventListener("click",a.triggers.click),n.button.addEventListener("click",a.triggers.click)},makeFlyout:function(t,e){var a=this,n=a.parts=a.makeButtonParts(),i=function(){"function"==typeof e.onCreate&&e.onCreate()},o=function(){"flyout"==a.app.display_settings.type&&n.wrap.parentNode.removeChild(n.wrap),"function"==typeof e.onClick&&e.onClick()};n.content.appendChild(n.label),n.content.appendChild(n.title),n.wrap.appendChild(n.content),n.label.innerText=a.app.type_name,n.title.innerText=a.app.display_settings.label||a.app.title,n.wrap.setAttribute("class",n.wrap.getAttribute("class")+" out"),document.body.appendChild(n.wrap);var r=a.app.display_settings.delay>0?1e3*a.app.display_settings.delay:100;setTimeout((function(){n.wrap.setAttribute("class",n.wrap.getAttribute("class").replace(" out","").trim())}),r),a.triggers.click=function(){if("true"==a.hasLoaded)return!1;o(),"function"==typeof t&&t(i)},n.content.addEventListener("click",a.triggers.click)},makePopout:function(t,e){var a=this,n=a.app.display_settings.type,i=a.parts.popout=a.makePopoutParts(),o=function(){"function"==typeof e.onClick&&e.onClick()},r=function(){"function"==typeof e.onCreate&&e.onCreate()},p=function(){a.hasLoaded=!1,i.background.parentNode.removeChild(i.background),i.wrap.setAttribute("class",i.wrap.getAttribute("class")+" out"),setTimeout((function(){i.wrap.parentNode.removeChild(i.wrap),"flyout"==n&&a.makeApp()}),350)};i.heading.appendChild(i.close),i.wrap.appendChild(i.heading),i.wrap.appendChild(i.content),document.body.appendChild(i.wrap),document.body.appendChild(i.background),setTimeout((function(){i.wrap.setAttribute("class",i.wrap.getAttribute("class").replace(" out","").trim())}),50),o(),a.makeAppIframe((function(){"function"==typeof t&&t(),r()})),a.makeAudienceBanner(),i.content.appendChild(a.iframe),i.content.appendChild(a.banner),i.background.addEventListener("click",(function(t){return p(),!1})),i.close.addEventListener("click",(function(t){return p(),!1}))},makeLightbox:function(t,e){var a=this,n=a.parts.lightbox=a.makeLightboxParts(),i=function(){"function"==typeof e.onCreate&&e.onCreate()},o=function(){document.body.setAttribute("class",(document.body.getAttribute("body")||"")+" aptivada-body"),"function"==typeof e.onClick&&e.onClick()},r=function(){a.hasLoaded=!1,document.body.setAttribute("class",(document.body.getAttribute("class")||"").replace("aptivada-body","").trim()),n.wrap.setAttribute("class",n.wrap.getAttribute("class")+" out"),setTimeout((function(){n.wrap.parentNode.removeChild(n.wrap),"flyout"==a.app.display_settings.type&&a.makeApp()}),350)};n.content.appendChild(n.close),n.content.appendChild(n.scroller),n.wrap.appendChild(n.content),document.body.appendChild(n.wrap),o(),setTimeout((function(){n.wrap.setAttribute("class",n.wrap.getAttribute("class").replace(" out","").trim())}),50),n.wrap.addEventListener("click",(function(t){t.target==this&&r()})),n.close.addEventListener("click",(function(t){return r(),!1})),a.makeAppIframe((function(){"function"==typeof t&&t(),i()})),a.makeAudienceBanner(),n.scroller.appendChild(a.iframe),n.scroller.appendChild(a.banner)},makeLightboxParts:function(){var t=this.uniqueSlug("selector"),e=document.createElement("div");e.setAttribute("class","aptivada-lightbox out"),e.setAttribute("data-app",t);var a=document.createElement("div");a.setAttribute("class","aptivada-content");var n=document.createElement("a");n.setAttribute("class","aptivada-close"),n.setAttribute("href","javascript:void(0)"),n.innerHTML="×";var i=document.createElement("div");return i.setAttribute("class","aptivada-scroller"),{wrap:e,content:a,close:n,scroller:i}},makePopoutParts:function(){var t=this.app.display_settings.popout.position,e=this.uniqueSlug("selector"),a=document.createElement("div");a.setAttribute("class","aptivada-popout "+t+" out"),a.setAttribute("data-app",e);var n=document.createElement("div");n.setAttribute("class","aptivada-content");var i=document.createElement("div");i.setAttribute("class","aptivada-heading");var o=document.createElement("div");o.setAttribute("class","aptivada-popout-background aptivada-background"),o.setAttribute("data-app",e);var r=document.createElement("a");return r.setAttribute("class","aptivada-close"),r.setAttribute("href","javascript:void(0)"),r.innerHTML="×",{wrap:a,content:n,heading:i,close:r,background:o}},makeButtonParts:function(){var t=this,e=t.uniqueSlug("selector"),a=document.createElement("div");a.setAttribute("class","aptivada-button-wrap aptivada-button-"+t.app.display_settings.type),a.setAttribute("data-app",e),"flyout"==t.app.display_settings.type&&a.setAttribute("class",a.getAttribute("class")+" "+t.app.display_settings.flyout.position);var n=document.createElement("button");n.setAttribute("class","aptivada-button");var i=document.createElement("a");i.setAttribute("class","aptivada-link"),i.setAttribute("href","javascript:void(0)");var o=document.createElement("h2");o.setAttribute("class","aptivada-title"),o.innerText=t.app.title;var r=document.createElement("div");r.setAttribute("class","aptivada-content");var p=document.createElement("div");p.setAttribute("class","aptivada-label");var s=document.createElement("div"),d="aptivada-loading";"button"==t.app.display_type&&(d+=" button-"+t.app.display_settings.type,d+=" action-"+t.app.display_settings.action);var l=document.createElement("img");return l.src=t.app.primary_image,s.setAttribute("class",d),s.setAttribute("data-show","0"),s.setAttribute("style",t.config.parent_style),s.setAttribute("data-app",e),{wrap:a,button:n,link:i,title:o,label:p,content:r,loading:s,image:l}},makeAppIframe:function(t){var e=this;n.config.query&&"aptivada"==n.config.query.debug&&console.log("making widget iframe",e.getParsedUrl()),e.iframe=document.createElement("iframe"),e.iframe.setAttribute("src",e.getParsedUrl()),e.iframe.setAttribute("allow","clipboard-write"),e.iframe.setAttribute("height",this.app.height||this.config.height),e.iframe.setAttribute("width",this.config.width),e.iframe.setAttribute("title",this.config.title||this.app.title||""),e.iframe.style.width=this.config.width,e.iframe.style.height=this.app.height?this.app.height+"px":this.config.height,e.iframe.style.backgroundColor="#ffffff",e.iframe.style.display="block",e.iframe.frameBorder="0",e.hasLoaded="pending",e.iframe.onload=function(){n.config.query&&"aptivada"==n.config.query.debug&&console.log("iframe.onload()"),e.hasLoaded="true","function"==typeof t&&t()}},makeAudienceBanner:function(t){var e=document.createElement("a");e.setAttribute("href","https://audience.io/?utm_source=campaignfooter&utm_medium={parent-website-host}&utm_campaign=poweredby".replace("{parent-website-host}",location.host)),e.setAttribute("target","_blank"),e.innerHTML="Powered By Audience",e.style.backgroundColor="#ffffff",e.style.color="#000000",e.style.display="block",e.style.fontFamily='"Lato", sans-serif',e.style.padding="4px",e.style.textAlign="center",e.style.textDecoration="none",this.banner=e},sendMessage:function(t,e,a){this.iframe.contentWindow.postMessage({action:t,connectionId:e,data:a},"*")},setWindowHref:function(e){t.location.href=e},setWindowHash:function(t){if(!t)return console.warn("Aptivada setHash() failed. No hash specified"),!1;document.location.hash="",document.location.hash=t},scrollWindowToElement:function(t){var e=document.querySelector(t);e||console.warn("Aptivada scrollWindowToElement() failed. No selector specified"),e.scrollIntoView()},setIframeHeight:function(t){"aptivada"==n.config.query.debug&&console.log("set iframe height",t),"lightbox"==this.app.display_settings.action?(this.iframe.style.height=t+"px",this.iframe.setAttribute("height",t)):(this.app.display_settings.action,this.iframe.style.height=t+"px",this.iframe.setAttribute("height",t))},scrollWindowFromFrame:function(e){var a=n.elementOffset(this.iframe)+e;t.scrollTo({top:a,behavior:"smooth"})},isAudacyCms:function(){return/audacy/i.test(t.location.host)},getViewportPosition:function(){if(!this.iframe)return!1;var e=n.elementOffset(this.iframe),a=null;try{a=document.querySelector("section.layout__top").offsetHeight}catch(t){}var i=t.top.document,o=(i.documentElement.scrollTop||i.body.scrollTop||t.pageYOffset)-e.top+(this.isAudacyCms()?null!=a?a:130:50);return{top:o=o<50?50:o,iframe:{offsetTop:e.top,offsetLeft:e.left,width:this.iframe.offsetWidth},scrollTop:{combined:i.documentElement.scrollTop||i.body.scrollTop,documentBody:i.body.scrollTop,documentElement:i.documentElement.scrollTop}}},getGeolocation:function(t,a,n){return n&&"object"==typeof n||(n={}),n=e.extend({enableHighAccuracy:!0,timeout:1e4,maximumAge:3e5},n),navigator.geolocation.getCurrentPosition(t,a,n)},getWidth:function(){var t=this.iframe.parentNode.offsetWidth;return"lightbox"!=this.app.display_settings.action&&"popout"!=this.app.display_settings.action||(t-=20),t},setWidth:function(t){this.iframe.style.width=t+"px",this.iframe.setAttribute("width",t)},emptyParentElement:function(){if(this.parentElement)for(;this.parentElement.firstChild;)this.parentElement.removeChild(this.parentElement.firstChild)},buildUrl:function(){var e=n.getHost();this.config.url=this.config.host=e;const a=new URLSearchParams(t.location.search),i=new URLSearchParams;i.set("js","true"),a.forEach(((t,e)=>{e.startsWith("utm_")&&i.set(e,t)})),"promo_grid"==this.widget_type?this.config.url=this.config.url+"/grid/[id]?"+i.toString():this.config.url=this.config.url+"/[app_type]/[id]"+this.config.urlSection+"?"+i.toString()+(this.config.urlAdminPreview||"")+(this.config.urlEntryId||"")+(this.config.urlReferrerId||"")+(this.config.urlShareType||""),this.config.url+="&parent="+encodeURIComponent(t.location.href),this.config.settingsUrl="https://v1.audience.io/promo/info.php?widget_id="+this.widget_id+"&widget_type="+this.widget_type+"&app_type="+(this.config.app_type||"")+"&environment="+this.config.environment+(this.account?"&account="+this.account:""),console.log(this.config.url)},isApprovedUrl:function(){if("preview"==this.config.environment)return!0;var t=this,e=!0,a=!0,i=t.app.display_settings.urls_blacklist,o=t.app.display_settings.urls_whitelist,r=n.config.location,p=function(t,e){var a=!0;return t.protocol!=e.protocol&&"*"!=e.protocol&&(a=!1),t.subdomain!=e.subdomain&&"*"!=e.subdomain&&(a=!1),t.domain!=e.domain&&"*"!=e.domain&&(a=!1),t.page!=e.page&&"*"!=e.page&&(a=!1),t.query!=e.query&&"*"!=e.query&&(a=!1),a};return i&&i.length&&i.forEach((function(t){p(r,t)&&(a=!1)})),o&&o.length&&(e=!1,o.forEach((function(t){p(r,t)&&(e=!0)}))),!(!e||!a)||(console.warn("Aptivada Widget Not Approved for this URL","#"+(t.app.app_id||t.widget_id)),!1)},uniqueSlug:function(t){return["aptivada",this.widget_type,this.widget_id,this.widget_index,this.app?this.app.app_id||0:"app",t].join("_")},setParentRelative:function(t){var e="relative";!1===t&&(e=""),this.parentElement.setAttribute("class",(this.parentElement.getAttribute("class")||"").replace("relative","")+" "+e)}};if(!t.Aptivada)var n=t.Aptivada={config:{},widgets:[],loadedFiles:[],loaded:!1,functions:{onload:function(){var e=t.location.search.indexOf("debug=aptivada")>-1;e&&console.log("general onload"),n.loaded?e&&console.log("already loading - aborting"):(n.loaded=!0,n.setup(),n.initWidgets(),t.addEventListener("message",n.functions.onMessage.bind(n)),t.addEventListener("resize",n.functions.onResize.bind(n)))},onMessage:function(t){this.receiveMessage(t)},onResize:function(){}},init:function(){t.jQuery&&"function"==typeof t.jQuery?t.jQuery(document).ready((function(){n.functions.onload()})):"loading"!==document.readyState?n.functions.onload():document.addEventListener?document.addEventListener("DOMContentLoaded",n.functions.onload):document.attachEvent("onreadystatechange",(function(){"complete"==document.readyState&&n.functions.onload()}))},setup:function(){n.setMobile(),n.config.inAppBrowser=!1,n.config.query=n.getQueryParams(document.location.search),n.config.location=n.parseUrl(t.location.href),["FBAN","FBIOS","FB_IAB","FB4A","FBAV","Twitter"].forEach((function(t){navigator&&navigator.userAgent.indexOf(t)>-1&&(n.config.inAppBrowser=!0)}));try{t.localStorage.setItem("localStorageTest",!0),n.config.hasLocalStorage=!0}catch(t){n.config.hasLocalStorage=!1}n.config.parentUrl=(t.location.protocol+"//"+t.location.host+t.location.pathname).replace(/\/{1,}$/,""),n.config.scriptOrigin=n.getScriptOrigin()},getScriptOrigin:function(){return new URL("https://xp.audience.io/widget.js").origin},getHost:function(){return new URL("https://xp.audience.io/widget.js").origin},initWidgets:function(){var t=document.body.getElementsByClassName("aptivada-widget");if(n.widgets=[],t.length)for(var e=0;e2&&(i=r.slice(-2).join("."),o=r.slice(0,-2).join(".")),a.port&&(i+=":"+a.port),{protocol:n,subdomain:o,domain:i,page:a.path.trim().replace(/^\/|\/$/g,"")||"",query:a.query||""}},receiveMessage:function(t){if(!["https://v1.audience.io/","https://xp.audience.io/"].every((function(e){return-1===t.origin.indexOf(new URL(e).host)})))if(i)console.warn("Aptivada postMessage failed, no action specified");else{var e="aptivada"==n.config.query.debug,a="object"==typeof t.data&&t.data?t.data.data:null,i="object"==typeof t.data&&t.data?t.data.action:null,o="object"==typeof t.data&&t.data?t.data.connectionId:null,r=n.widgets.find((function(e){return e.settingsWindow===t.source||e.iframe&&e.iframe.contentWindow===t.source}));if(!r)return console.warn("Aptivada post message ignored. No matching widget");switch(e&&r&&console.log("caught message",i,"for widget",r),i){case"checkConnection":return r.sendMessage(i,o,{connectionId:o});case"setWindowHref":return r.setWindowHref(a.href);case"setWindowHash":return r.setWindowHash(a.hash);case"scrollWindowToElement":return r.scrollWindowToElement(a.selector);case"scrollWindowFromFrame":return r.scrollWindowFromFrame(a.y);case"setIframeHeight":return r.setIframeHeight(a.height);case"getViewportPosition":var p=r.getViewportPosition();return r.sendMessage(i,o,p),p;case"getGeolocation":return r.getGeolocation((function(t){r.sendMessage(i,o,{coords:{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy}})}),(function(t){r.sendMessage(i,o,{code:t.code,message:t.message})}));case"applyCampaignSettings":return r.loadAppSettings(a.settings)}console.warn("Aptivada post message ignored. No matching action: "+i)}},loadjscssfile:function(t,e){var a;this.loadedFiles.indexOf(t)>-1||(this.loadedFiles.push(t),"js"==e?((a=document.createElement("script")).setAttribute("type","text/javascript"),a.setAttribute("src",t)):"css"==e&&((a=document.createElement("link")).setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",t)),void 0!==a&&document.getElementsByTagName("head")[0].appendChild(a))},getQueryParams:function(t){t=t.split("+").join(" ");for(var e,a={},n=/[?&]?([^=]+)=([^&]*)/g;e=n.exec(t);)a[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return a},checkMobile:function(t){(n.config.mobile.apple.phone||n.config.mobile.android.phone||n.config.mobile.seven_inch)&&(document.location=t)},elementOffset:function(t){var e=0,n=0,i=void 0,o=void 0;if("function"==typeof jQuery)return jQuery(t).offset();if(a.isAudacyCms()){var r=t,p=0,s=0;do{p+=r.offsetTop||0,s+=r.offsetLeft||0,r=r.offsetParent}while(r);return{top:p,left:s}}for(;null!=t&&"html"!=(t.tagName||"").toLowerCase();){var d=t.offsetLeft||0,l=t.offsetTop||0;t.style.position&&t.style.position.indexOf("relative")>-1&&(i=void 0,o=void 0),null==i&&(e+=d),null==o&&(n+=l),i=d,o=l,t=t.parentElement}return{left:parseInt(e,10),top:parseInt(n,10)}},showElement:function(t,e){e||(e=0);var a=n.elementOffset(t);document.documentElement.scrollTop&&(document.documentElement.scrollTop=a.top-100-e),document.body.scrollTop>-1&&(document.body.scrollTop=a.top-100-e)},getScrollTop:function(){return document.documentElement.scrollTop?document.documentElement.scrollTop:!!document.body.scrollTo&&document.body.scrollTo},setMobile:function(){var t,e,a,n,i,o,r,p,s,d,l,c,u;this.config.mobile=(t=/iPhone/i,e=/iPod/i,a=/iPad/i,n=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,i=/Android/i,o=/BlackBerry/i,r=/Opera Mini/i,p=/IEMobile/i,s=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,d=RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),l=function(t,e){return t.test(e)},(u=new(c=function(c){var u=c||navigator.userAgent;this.apple={phone:l(t,u),ipod:l(e,u),tablet:l(a,u),device:l(t,u)||l(e,u)||l(a,u)},this.android={phone:l(n,u),tablet:!l(n,u)&&l(i,u),device:l(n,u)||l(i,u)},this.other={blackberry:l(o,u),opera:l(r,u),windows:l(p,u),firefox:l(s,u),device:l(o,u)||l(r,u)||l(p,u)||l(s,u)},this.seven_inch=l(d,u),this.any=this.apple.device||this.android.device||this.other.device||this.seven_inch})).Class=c,u)},setCookie:function(t,e,a){var n=new Date;n.setTime(n.getTime()+24*a*60*60*1e3);var i="expires="+n.toUTCString();document.cookie=t+"="+e+";"+i+";path=/"},getCookie:function(t){for(var e=t+"=",a=decodeURIComponent(document.cookie).split(";"),n=0;n