(()=>{"use strict";var o={d:(n,t)=>{for(var e in t)o.o(t,e)&&!o.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},o:(o,n)=>Object.prototype.hasOwnProperty.call(o,n)},n={};o.d(n,{default:()=>e});const t=()=>{var o,n;return null===(n=null===(o=window.location)||void 0===o?void 0:o.search)||void 0===n?void 0:n.includes("pianoDebug")},e={onetrustToPianoMapping:{C0001:{COMPOSER:1,DMP:1,ID:1,PA:1,VX:1,DL:1},C0002:{COMPOSER:1,DMP:2,ID:1,PA:1,VX:3,DL:1},C0003:{COMPOSER:3,DMP:2,ID:3,PA:3,VX:2,DL:1},C0004:{COMPOSER:2,DMP:3,ID:2,PA:2,VX:2,DL:2}},pianoProductModesConsentAll:{COMPOSER:3,DMP:3,ID:3,PA:3,VX:3,DL:3},pianoProductModes:{COMPOSER:1,DMP:1,ID:1,PA:1,VX:1,DL:1},pianoWeightsToModes:{1:"opt-out",2:"essential",3:"opt-in"},hookIntoOneTrust:function(){t()&&console.log("PMC: Piano:","Consent Initialization.."),window.pmc.hooks.add_action("pmc_onetrust_consent_data_ready",this.determinePianoProductModes.bind(this))},determinePianoProductModes:function({groupsConsentedTo:o}){const n=this;t()&&console.log("PMC: Piano:","pmc_onetrust_consent_data_ready","OneTrust groups consented to",o);const e={COMPOSER:[],DMP:[],ID:[],PA:[],VX:[],DL:[]};if(0{Object.keys(e).forEach((t=>{n.onetrustToPianoMapping[o]&&e[t].push(n.onetrustToPianoMapping[o][t])}))})),t()&&console.log("PMC: Piano:","pianoProductsWeights",e);const i=o.length>=Object.keys(n.onetrustToPianoMapping).length;Object.keys(e).forEach((o=>{n.pianoProductModes[o]=Math.max(...e[o],...i?[n.pianoProductModesConsentAll[o]]:[])})),t()&&console.log("PMC: Piano:","pianoProductModes",n.pianoProductModes)}window.tp=window.tp||[],window.tp.push(["init",n.setPianoProductModes.bind(n)])},setPianoProductModes:function(){var o,n,e,i,s,d;const a=this;window.pdl=window.pdl||{},window.pdl.requireConsent=!0,window.tp.consent.set("ESP",{mode:"opt-out"}),window.tp.consent.set("Social Flow",{mode:"opt-out"}),window.tp.consent.set("COMPOSER",{mode:null!==(o=a.pianoWeightsToModes[a.pianoProductModes.COMPOSER])&&void 0!==o?o:"opt-out"}),window.tp.consent.set("DMP",{mode:null!==(n=a.pianoWeightsToModes[a.pianoProductModes.DMP])&&void 0!==n?n:"opt-out"}),window.tp.consent.set("ID",{mode:null!==(e=a.pianoWeightsToModes[a.pianoProductModes.ID])&&void 0!==e?e:"opt-out"}),window.tp.consent.set("PA",{mode:null!==(i=a.pianoWeightsToModes[a.pianoProductModes.PA])&&void 0!==i?i:"opt-out"}),window.tp.consent.set("VX",{mode:null!==(s=a.pianoWeightsToModes[a.pianoProductModes.VX])&&void 0!==s?s:"opt-out"}),window.tp.consent.set("DL",{mode:null!==(d=a.pianoWeightsToModes[a.pianoProductModes.DL])&&void 0!==d?d:"opt-out"}),t()&&console.log("PMC: Piano:","tp.consent.get()",window.tp.consent.get())}};(window.pmcPianoConsent=window.pmcPianoConsent||{}).consent=n.default})();; (()=>{"use strict";var e={d:(o,n)=>{for(var t in n)e.o(n,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:n[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{pmcPiano:()=>v});const n="PMC: Piano: ",t=()=>{var e,o;return null===(o=null===(e=window.location)||void 0===e?void 0:e.search)||void 0===o?void 0:o.includes("pianoDebug")},i=e=>{let o=e.name.replace("bound","").trim();return o||(o="Anonymous"),o},a=e=>e.origin.endsWith(".tinypass.com")||e.origin.endsWith("https://tinypass.com")||e.origin.endsWith(".piano.io")||e.origin.endsWith("https://piano.io");var r=function(e,o,n,t){return new(n||(n=Promise))((function(i,a){function r(e){try{l(t.next(e))}catch(e){a(e)}}function s(e){try{l(t.throw(e))}catch(e){a(e)}}function l(e){var o;e.done?i(e.value):(o=e.value,o instanceof n?o:new n((function(e){e(o)}))).then(r,s)}l((t=t.apply(e,o||[])).next())}))};const s={callApi:(e,...o)=>r(void 0,[e,...o],void 0,(function*(e,o={}){return yield new Promise((n=>{window.tp.api.callApi(e,o,n)})).then((i=>(t()&&console.log(n,"pmcPianoApi.callApi",e,o,i),i))).catch((i=>{t()&&console.error(n,"pmcPianoApi.callApi",e,o,i)}))})),callProtectedApi:function(e){return r(this,void 0,void 0,(function*(){var o;const i=`${null===(o=window.pmcPianoData)||void 0===o?void 0:o.wordPressRestApiUri}${e}`;return yield fetch(i,{credentials:"include"}).then((e=>e.headers.get("content-type").includes("application/json")?e.json():e.text())).then((e=>(t()&&console.log(n,"pmcPianoApi.callProtectedApi",i,e),e))).catch((e=>{t()&&console.error(n,"pmcPianoApi.callProtectedApi",i,e)}))}))},getLicenseeData:e=>r(void 0,void 0,void 0,(function*(){return yield s.callProtectedApi(`/licensee/${e}`)})),getUserCustomFields:e=>r(void 0,void 0,void 0,(function*(){return yield s.callProtectedApi(`/user/custom-fields/${e}`)})),getAccessList:()=>r(void 0,void 0,void 0,(function*(){return yield s.callApi("/access/list").then((({data:e})=>e))})),getConversionList:()=>r(void 0,void 0,void 0,(function*(){return yield s.callApi("/conversion/list").then((({conversions:e})=>e))}))},l=(e={})=>{void 0!==e.knownUser&&window.tp.user.isUserValid()&&(t()&&console.log(n,"init","Firing known user callback",i(e.knownUser)),e.knownUser()),void 0===e.unknownUser||window.tp.user.isUserValid()||(t()&&console.log(n,"init","Firing unknown user callback",i(e.unknownUser)),e.unknownUser())},d=(e,o)=>{t()&&console.log(n,"loginSuccess","Firing callback",i(e),o),e(o)},c=e=>{t()&&console.log(n,"logout","Firing callback",i(e)),e()},u=(e,o)=>{t()&&console.log(n,"registrationSuccess","Firing callback",i(e),o),e(o)};var p=function(e,o,n,t){return new(n||(n=Promise))((function(i,a){function r(e){try{l(t.next(e))}catch(e){a(e)}}function s(e){try{l(t.throw(e))}catch(e){a(e)}}function l(e){var o;e.done?i(e.value):(o=e.value,o instanceof n?o:new n((function(e){e(o)}))).then(r,s)}l((t=t.apply(e,o||[])).next())}))};let w,m="";const v={api:s,callbacks:{onInit:e=>(window.tp=window.tp||[],window.tp.push(["init",l.bind(void 0,e)]),window.pmcPiano.callbacks),onKnownIP:e=>{var o;return null===(o=window.pmcPiano.ipAuth)||void 0===o||o.onKnownIP(e),window.pmcPiano.callbacks},onLogin:e=>(window.tp=window.tp||[],window.tp.push(["addHandler","loginSuccess",d.bind(void 0,e)]),window.pmcPiano.callbacks),onLogout:e=>(window.tp=window.tp||[],window.tp.push(["addHandler","logout",c.bind(void 0,e)]),window.pmcPiano.callbacks),onRegistration:e=>(window.tp=window.tp||[],window.tp.push(["addHandler","registrationSuccess",u.bind(void 0,e)]),window.pmcPiano.callbacks)},ipAuth:{callbacks:[],doCallbacks:function(){this.callbacks.forEach((e=>{t()&&console.log(n,"Running known IP callback",i(e)),e()}))},hasKnownIP:!1,onKnownIP:function(e){this.hasKnownIP?e():this.callbacks.push(e)},setKnownIP:function(){t()&&console.log(n,"User has a known IP Address"),this.hasKnownIP=!0,this.doCallbacks()}},piano:{loadSDK:function(){var e;if(!(null===(e=window.pmcPianoData)||void 0===e?void 0:e.sdkUri))return void console.error(n,"window.pmcPianoData.sdkUri not defined",window.pmcPianoData);const o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=window.pmcPianoData.sdkUri,document.head.appendChild(o)},prime:function(){var e,o,i,a,r,s,l,d,c,u;if(window.tp=window.tp||[],!(null===(e=window.pmcPianoData)||void 0===e?void 0:e.aid))return void console.error(n,"window.pmcPianoData.aid not defined",window.pmcPianoData);window.tp.push(["setAid",null===(o=window.pmcPianoData)||void 0===o?void 0:o.aid]),(null===(i=window.pmcPianoData)||void 0===i?void 0:i.cxSiteId)&&(t()&&console.log(n,"tp.push: [setCxenseSiteID="+window.pmcPianoData.cxSiteId+"]"),window.tp.push(["setCxenseSiteId",window.pmcPianoData.cxSiteId])),window.tp.push(["setSandbox",!!(null===(a=window.pmcPianoData)||void 0===a?void 0:a.isSandboxMode)]),window.tp.push(["setDebug",t()]),window.tp.push(["setUsePianoIdUserProvider",!0]),Object.entries(null!==(s=null===(r=window.pmcPianoData)||void 0===r?void 0:r.customVariables)&&void 0!==s?s:{}).forEach((([e,o])=>{t()&&console.log(n,"tp.push: [setCustomVariable, "+e+"="+o+"]"),window.tp.push(["setCustomVariable",e,o])}));const p=window.pmc.tracking.get_properties();if(window.tp.push(["setPageURL",window.location.href]),p.forEach((function(e){t()&&console.log(n,"tp.push: [setCustomVariable, pmc-"+e.name+"="+e.value+"]"),window.tp.push(["setCustomVariable","pmc-"+e.name,e.value])})),null===(l=window.pmcPianoData)||void 0===l?void 0:l.author){const e=[].concat(window.pmcPianoData.author).join(",");t()&&console.log(n,"tp.push: [setContentAuthor="+e+"]"),window.tp.push(["setContentAuthor",e])}(null===(d=window.pmcPianoData)||void 0===d?void 0:d.tags)&&0<(null===(c=window.pmcPianoData.tags)||void 0===c?void 0:c.length)&&(t()&&console.log(n,"tp.push: [setTags=]",window.pmcPianoData.tags),window.tp.push(["setTags",null!==(u=window.pmcPianoData.tags)&&void 0!==u?u:[]])),window.tp.push(["addHandler","customEvent",function(e){var o,i;if("template-redirect"===e.eventName){const a=(()=>{try{return JSON.parse(e.params.params)}catch(e){return t()&&console.error(n,e),{}}})(),r=encodeURIComponent(null!==(i=null!==(o=e.params.trackingId)&&void 0!==o?o:a.trackingId)&&void 0!==i?i:""),s=`${e.params.url}${e.params.url.includes("?")?"&":"?"}_ptid=${r}`;t()&&console.log(n,"custom event template-redirect",e,a,r,s),window.location.href=s}}])},setCallbacks:function(){var e,o;const n=()=>{window.pmcPiano.piano.setGA4Config(),window.tp.experience.execute()};null===(o=null===(e=window.pmcPiano)||void 0===e?void 0:e.callbacks)||void 0===o||o.onInit({knownUser:n,unknownUser:n}).onLogin((e=>{"PIANOID"===e.source&&!0!==e.registration&&window.pmcPiano.piano.reRenderExperiences()})).onLogout(this.reRenderExperiences.bind(this))},setGA4Config:function(){var e,o,i,a;const r=null===(e=window.tp.pianoId.getUser())||void 0===e?void 0:e.uid,s=null===(a=null===(i=null===(o=window.pmcPianoData)||void 0===o?void 0:o.trackingPixels)||void 0===i?void 0:i.ga)||void 0===a?void 0:a.measurement_id;if(!s)return void console.error(n,"GA4 measurement_id is undefined.",window.pmcPianoData);const l={send_page_view:!1,page_location:document.URL,page_title:document.title};r&&(l.user_id=r),window.tp.setGA4Config({measurementId:s,eventParameters:l}),t()&&console.log(n,"tp.setGA4Config measurement id",window.tp.ga4Service.getMeasurementId())},reRenderExperiences:function(){t()&&console.log(n,"Re-rendering Experiences"),window.tp.offer.close(),window.tp.offer.closeInline("#piano-paywall"),window.tp.offer.closeInline("#piano-right-rail"),window.tp.offer.closeInline("#piano-mid-river"),window.tp.offer.closeInline("#piano-sticky-footer"),window.tp.offer.closeInline("#piano-fly-out"),window.tp.offer.closeInline("#piano-module-header-link-vy"),window.tp.offer.closeInline("#piano-header-subscribe-button"),window.tp.offer.closeInline("#piano-header-sub-button");const e=document.querySelector(".pmc-paywall");e&&(e.classList.remove("a-article-cropped"),e.classList.remove("piano-truncate-content")),window.tp.experience.execute()}},reportingCookie:{cookieLabel:"pmc_piano_reporting",reporting:{entitlements:"",user_type:"ANONYMOUS",acct_id:null,acct_type:null,org_id:null,org_name:null,paywall_logged_in:!1},initialize:function(){var e;const o=this;t()&&console.log(n,"Initializing Piano Reporting Cookie"),null===(e=window.pmcPiano)||void 0===e||e.callbacks.onInit({knownUser:()=>{o.setDataForAuthUser()},unknownUser:()=>p(this,void 0,void 0,(function*(){o.hasReportingCookie()||(yield o.set(JSON.stringify(o.reporting)))}))}).onKnownIP((function(){o.reporting.acct_type="ip",o.reporting.user_type="KNOWN",o.set(JSON.stringify(o.reporting))})).onLogin((()=>{o.setDataForAuthUser()})).onLogout(o.delete.bind(o))},set:function(e){return p(this,void 0,void 0,(function*(){t()&&console.log(n,"Setting pmc_piano_reporting cookie",e),yield function(e){return o=this,n=arguments,i=function*(e,o=100){for(;!e();)yield new Promise((e=>setTimeout(e,o)))},new((t=void 0)||(t=Promise))((function(e,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(o){var n;o.done?e(o.value):(n=o.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,s)}l((i=i.apply(o,n||[])).next())}));var o,n,t,i}((()=>void 0!==window.OptanonActiveGroups)),window.pmc.cookie.set(this.cookieLabel,e,604800,"/","targeting",this.tld())}))},delete:function(){t()&&console.log(n,"Deleting pmc_piano_reporting cookie"),window.pmc.cookie.expire(this.cookieLabel,"/",this.tld())},getDataForAuthUser:function(){return p(this,void 0,void 0,(function*(){var e,o,i,a,r;let s=null!==(e=yield window.pmcPiano.api.getConversionList())&&void 0!==e?e:[];const l=null!==(o=s.sort(((e,o)=>o.create_date-e.create_date))[0])&&void 0!==o?o:void 0;s=s.filter((e=>{var o;return null===(o=null==e?void 0:e.user_access)||void 0===o?void 0:o.granted})),s=0>=s.length?[l]:(e=>{let o=[];return 1>=e.length?e:(["( |^)shared","( |^)corporate","( |^)education","( |^)partner","( |^)agent","( |^)billboard member","( |^)employee","( |^)comp","( |^)(limited|registration)"].forEach((n=>{var t,i,a;let r=0;for(;r{var i,a;const r=e=>{var o,n;const t=null===(n=null===(o=null==e?void 0:e.term)||void 0===o?void 0:o.resource.name)||void 0===n?void 0:n.toLocaleLowerCase();return(null==t?void 0:t.match(/( |^)shared/))?"shared":(null==t?void 0:t.match(/( |^)agent/))?"agent":(null==t?void 0:t.match(/( |^)(corporate|education|employee|partner)/))?"site_license":"individual"},s=r(e);if(1>=o.length)return s;const l=o.slice(1).map((e=>r(e))),d="individual"===s,c="shared"===s,u=l.includes("agent"),p=l.includes("site_license");return(d||c)&&u&&p?(d?"individual":"shared")+"|site_license|agent":(d||c)&&p&&!u?(d?"individual":"shared")+"|site_license":(d||c)&&u&&!p?(d?"individual":"shared")+"|agent":"site_license"===s&&u?"site_license|agent":(t()&&console.log(n,`User might have duplicate resources. userId: ${null===(a=null===(i=null==e?void 0:e.user_access)||void 0===i?void 0:i.user)||void 0===a?void 0:a.uid} accountType: ${s}`),s)})(s[0],s),c=Array.from(new Set(s.map((e=>{var o;return null===(o=null==e?void 0:e.term)||void 0===o?void 0:o.resource.name})))).join("|")||void 0,u=Array.from(new Set(s.map((e=>{var o;return null===(o=null==e?void 0:e.term)||void 0===o?void 0:o.name})))).join("|")||void 0,p=Array.from(new Set(s.map((e=>(null==e?void 0:e.user_access)||(null==e?void 0:e.term)?((e={})=>{const o=null==e?void 0:e.user_access,n=null==e?void 0:e.term,t=null==n?void 0:n.resource;return(null==t?void 0:t.name)&&""!==t.name?(null==o?void 0:o.granted)&&(/registration/i.exec(null==n?void 0:n.name)||"registration"===(null==n?void 0:n.type))?"REGISTERED":(null==o?void 0:o.granted)?"SUBSCRIBER":void 0:"KNOWN"})(e):void 0)))).sort(((e,o)=>e.localeCompare(o))).join("|")||void 0,w=[];for(const e of s)(null===(i=null==e?void 0:e.term)||void 0===i?void 0:i.term_id)&&(m=null==e?void 0:e.term)&&("email_domain_contract"===(null==m?void 0:m.type)||"specific_email_addresses_contract"===(null==m?void 0:m.type))&&w.push(yield window.pmcPiano.api.getLicenseeData(e.term.term_id));var m;const v=Array.from(new Set(w.map((e=>null==e?void 0:e.id)))).join("|")||void 0,g=Array.from(new Set(w.map((e=>null==e?void 0:e.name)))).join("|")||void 0;return{accessGrantedStatus:null!==(r=null===(a=s[0])||void 0===a?void 0:a.user_access.granted)&&void 0!==r&&r,accountTermType:d,resourceName:c,termName:u,orgId:v,orgName:g,userType:p}}))},setDataForAuthUser:function(){return p(this,void 0,void 0,(function*(){const e=this,o=window.tp.pianoId.getUser(),n=e.hasReportingCookie();if((null==n?void 0:n.acct_id)===o.uid)return Promise.resolve();const t=yield this.getDataForAuthUser(),i={acct_id:o.uid,acct_type:t.accountTermType,entitlements:t.resourceName,paywall_logged_in:t.accessGrantedStatus,user_type:t.userType,org_id:t.orgId||null,org_name:t.orgName||null};return this.reporting=Object.assign(Object.assign({},e.reporting),i),yield e.set(JSON.stringify(this.reporting)),Promise.resolve()}))},hasReportingCookie:function(){try{return JSON.parse(window.pmc.cookie.get("pmc_piano_reporting")||null)}catch(e){return t()&&console.log(n,"No reporting cookie",e.toString()),!1}},tld:function(){return new URL(window.location.href).hostname.split(/\./).slice(-2).join(".")}},wordPressThemes:{targetElements:{subscriptionFlyout:".a-subscription-banner"},hookIntoPmcPiano:function(){var e,o,n,t;const i=this;null===(o=null===(e=window.pmcPiano)||void 0===e?void 0:e.callbacks)||void 0===o||o.onInit({knownUser:()=>{i.setAuthenticatedUserId(),i.maybeRenderMyAccountPage(),i.maybeRenderPasswordResetPage()},unknownUser:()=>{i.maybeRenderMyAccountPage(),i.maybeRenderPasswordResetPage()}}).onLogin((()=>{i.setAuthenticatedUserId(),i.maybeRenderMyAccountPage(),i.maybeRenderPasswordResetPage()})).onLogout(i.maybeRenderMyAccountPage.bind(i)).onRegistration(i.onRegistration.bind(i)),null===(n=window.tp)||void 0===n||n.push(["addHandler","checkoutComplete",function(){/reader_id=amp/gi.exec(window.location.search)&&window.close()}]),null===(t=window.tp)||void 0===t||t.push(["addHandler","externalCheckoutComplete",function(){location.reload()}]),window.addEventListener("message",i.reloadOfferModal.bind(i)),window.addEventListener("message",i.registerPostMessageListener.bind(i)),document.addEventListener("keydown",(function(e){"Escape"===e.key&&i.closePianoModal()}))},closePianoModal:function(){const e=document.querySelector(".tp-modal:last-child")||document.querySelector(".tp-modal"),o=null==e?void 0:e.querySelector(".tp-close");e&&o&&o.click()},registerPostMessageListener:function(e){const o=window.pmcPiano.wordPressThemes;if(!a(e)||"string"!=typeof e.type)return!1;switch(e.data.type){case"piano_subscription_flyout_focus_change":const n=e.data.focused,t=document.querySelector(o.targetElements.subscriptionFlyout);n?null==t||t.classList.remove("lrv-a-hidden"):null==t||t.classList.add("lrv-a-hidden");case"piano_mode_close":this.closePianoModal()}},maybeRenderMyAccountPage:function(){const e=()=>{const e=".js-subscription-my-account-component";document.querySelector(e)&&(window.tp.myaccount.show({displayMode:"inline",containerSelector:e}),console.log(n,"Rendered My Account component"))};"complete"!==document.readyState?window.addEventListener("DOMContentLoaded",e):e()},maybeRenderPasswordResetPage:function(){if(!document.querySelector(".js-subscription-password-reset-component"))return"password reset element missing";const e=window.location.search.match(/reset_token=([A-Za-z0-9]+)/);if(!e)return"invalid token";window.addEventListener("message",this.redirectHomeOnClosedMessage.bind(this)),window.tp.pianoId.show({resetPasswordToken:e[1],loggedIn:function(){window.location="/"}})},onRegistration:()=>{let e=!1;window.tp.push(["addHandler","checkoutClose",function(o){e||(e=!0,window.pmcPiano.piano.reRenderExperiences())}])},redirectHomeOnClosedMessage:function(e){if(!a(e))return!1;let o;try{o=JSON.parse(e.data)}catch(e){return!1}return!!(o.sender&&o.event&&o.sender.startsWith("piano-id")&&"closed"===o.event)&&(window.location="/",!0)},setAuthenticatedUserId:function(){const e=window.tp.pianoId.getUser(),o=window.blogherads||{};t()&&console.log(n,"wordPressThemes.setAuthenticatedUserId",e.uid),o.adq=o.adq||[],o.adq.push((function(){try{o.setAuthenticatedUserId(e.uid,"piano")}catch(e){}}))},registerStickyFooter:e=>{var o,n;const t=window.pmcPiano.wordPressThemes;null===(n=null===(o=window.pmcPiano)||void 0===o?void 0:o.callbacks)||void 0===n||n.onInit({unknownUser:(()=>{const o=document.querySelector(e.className||".js-subscription-sticky-footer");if(!o)return;const n=document.getElementsByClassName(e.targetClassName||"footer"),i=()=>{const e=()=>{const e=window.scrollY,t=window.innerHeight,i=n[0].offsetTop;return e+t+("static"===o.style.position?o.clientHeight:0)>i};setTimeout(function(){this.stickyFooterPrevTime=this.stickyFooterPrevTime||Date.now(),this.stickyFooterPrevTime&&500>Date.now()-this.stickyFooterPrevTime||(this.stickyFooterPrevTime=Date.now(),e()||"fixed"===o.style.position?e()&&"static"!==o.style.position&&(o.style.position="static"):(o.style.position="fixed",o.style.bottom="0px"))}.bind(t),500)};i(),window.addEventListener("load",i),window.addEventListener("scroll",i),window.addEventListener("resize",i)}).bind(t)})},reloadOfferModal:function(e){var o,n,t,i,r;if(!a(e)||!(null===(n=null===(o=window.location)||void 0===o?void 0:o.pathname)||void 0===n?void 0:n.match(/^\/subscribe/))||!(null===(i=null===(t=window.location)||void 0===t?void 0:t.search)||void 0===i?void 0:i.match(/contractId=/)))return!1;let s;try{s=JSON.parse(e.data)}catch(e){return!1}return!(!(null===(r=null==s?void 0:s.sender)||void 0===r?void 0:r.startsWith("piano-id"))||"closed"!==(null==s?void 0:s.event)||window.tp.pianoId.isUserValid()||(window.tp.offer.reloadAll(),0))}},newsletterForm:{initialized:!1,setDataForNewsletter:!1,targetElements:{paywall:".pmc-paywall",paywallFade:"a-article-nl-fade",overlay:"div[id=piano-paywall] .tp-container-inner"},signupURLs:{aia:"https://cloud.email.artnews.com/aia-api/",artforum:"https://cloud.email.artforum.com/api/",artnews:"https://cloud.email.artnews.com/artnews-api/",billboard:"https://cloud.email.billboard.com/api/",deadline:"https://cloud.email.deadline.com/api/",robbreport:"https://cloud.email.robbreport.com/api/",rollingstone:"https://cloud.email.rollingstone.com/signup-api/",sourcingjournal:"https://cloud.email.sourcingjournal.com/api/",sportico:"https://cloud.email.sportico.com/api/",thr:"https://cloud.email.hollywoodreporter.com/api/",variety:"https://cloud.email.variety.com/api/",wwd:"https://cloud.email.wwd.com/api/"},modal:!0,emailInputFocused:!1,prepareExactTargetFormData:e=>{const o=Object.assign({__contextName:["aia","artnews","deadline"].includes(m)?"FormPost":"NewsletterFormPost",__executionContext:"Post"},e.data.formData),n=new FormData;for(const[e,t]of Object.entries(o))n.append(e,t);return n},sendSignupDataToExactTarget:e=>{const o=window.pmcPiano.newsletterForm,i=o.signupURLs[m];i||console.error(n,"Invaild brand for newsletter form submission",{brand:m,signupURLs:o.signupURLs}),fetch(i,{method:"POST",mode:"no-cors",body:e}).then((e=>{t()&&console.log(n,"POST request to ExactTarget successful:",e)})).catch((e=>{console.error(n,"Error sending formData to ExtactTarget:",e)}))},calculateTopOffset:()=>{var e,o,n,t,i,a,r,s;const l=(null===(e=document.querySelector("header"))||void 0===e?void 0:e.offsetHeight)||0;let d=(null===(o=document.querySelector(".js-Header-contents"))||void 0===o?void 0:o.offsetHeight)||0,c=Math.min(Math.max(l,d)+20,100);const u=(null===(n=document.querySelector('[data-component="header-sticky"]'))||void 0===n?void 0:n.offsetHeight)||0,p=(null===(t=document.querySelector('[data-component="header-mobile"]'))||void 0===t?void 0:t.offsetHeight)||0;(p||u)&&(c=u>0?u+20:p+45),c=(null===(a=null===(i=null===window||void 0===window?void 0:window.pmc)||void 0===i?void 0:i.hooks)||void 0===a?void 0:a.apply_filters("pmc_piano_regwall_header_height",c,{header:l,headerInnerWrapper:d}))||c;const w=null===(r=document.querySelector(".pmc-paywall > .jw-state-playing"))||void 0===r?void 0:r.offsetHeight,m=null===(s=document.querySelector(".live-event-banner > .banner-regular"))||void 0===s?void 0:s.offsetHeight;if(window.innerWidth<768){if(w>0)return c+w;if(m>0)return c+m}return c},stickyDismissableRegwall:()=>{const e=window.pmcPiano.newsletterForm,o=document.querySelector(e.targetElements.paywall),n=document.querySelector(`${e.targetElements.overlay} iframe`);o&&n?(o.classList.add(e.targetElements.paywallFade),window.addEventListener("scroll",(()=>{var n;const t=document.querySelector(e.targetElements.overlay),i=null==t?void 0:t.getBoundingClientRect(),a=o.getBoundingClientRect(),r=document.querySelector("#piano-paywall"),s=null==r?void 0:r.getBoundingClientRect(),l=e.calculateTopOffset();t.style.position="absolute",t.style.top="0px",t.style.zIndex=window.pmcPianoData.isNovaTheme?"10000":"2",0>=s.top-i.height/2?t.style.position="static":a.top<=l&&(t.style.position="fixed",t.style.top=`${l}px`);const d=null===(n=null==t?void 0:t.parentElement)||void 0===n?void 0:n.parentElement;d&&"relative"!==getComputedStyle(d).position&&(d.style.position="relative")}))):setTimeout(e.stickyDismissableRegwall)},registerPostMessageListener:()=>{const e=window.pmcPiano.newsletterForm;window.addEventListener("message",(o=>{var i;if(a(o)&&"string"==typeof o.type)switch(o.data.type){case"piano_template_newsletter_close_button_clicked":null===(i=document.querySelector(e.targetElements.paywall))||void 0===i||i.classList.remove(e.targetElements.paywallFade);const a=document.querySelector(e.targetElements.overlay);a&&(window.pmcPianoData.isNovaTheme?a.style.display="none":a.classList.add("lrv-a-hidden"));break;case"piano_template_newsletter_email_input":e.emailInputFocused=o.data.focused,window.dispatchEvent(new Event("scroll",{bubbles:!0}));break;case"piano_template_newsletter_submit_button_clicked":m=o.data.brand,w=e.prepareExactTargetFormData(o),e.sendSignupDataToExactTarget(w);break;case"piano_regwall_register_button_clicked":m=o.data.brand,w=e.prepareExactTargetFormData(o),e.setDataForNewsletter=!0,t()&&console.log(n,"Data Stored for Registration",w)}}))},registrationSuccess:function(e){const o=e.user.email;o&&this.setDataForNewsletter&&(this.setDataForNewsletter=!1,t()&&console.log(n,"Registration success",e),w.set("EmailAddress",o),setTimeout(this.sendSignupDataToExactTarget(w),1e3))},initialize:()=>{const e=window.pmcPiano.newsletterForm;e.initialized?t()&&console.log(n,"Newsletter Form is already initialized"):(t()&&console.log(n,"Initializing Newsletter Form"),e.modal&&e.stickyDismissableRegwall(),e.registerPostMessageListener(),window.pmcPiano.callbacks.onRegistration(e.registrationSuccess.bind(e)),e.initialized=!0)}}};window.tp=window.tp||[],v.piano.prime(),v.piano.loadSDK(),window.tp.push(["init",()=>{const e=window.pmcPiano;t()&&console.log(n,"PMC: Piano: Initializing Piano"),e.piano.setCallbacks(),e.reportingCookie.initialize(),e.wordPressThemes.hookIntoPmcPiano()}]);var g=window;for(var h in o)g[h]=o[h];o.__esModule&&Object.defineProperty(g,"__esModule",{value:!0})})();; (()=>{"use strict";var o={665:function(o,t,n){var e=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),e(n(759)).default.init()},759:function(o,t,n){var e=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsentCriteria=void 0;var i,u=e(n(60));!function(o){o.STRICTLY_NECESSARY="C0001",o.PERFORMANCE="C0002",o.FUNCTIONAL="C0003",o.TARGETING="C0004",o.SOCIAL="C0005"}(i||(t.ConsentCriteria=i={}));var a=[i.PERFORMANCE],d=function(){function o(){this.value=void 0}return o.prototype.init=function(){var o,t=this,n=(0,u.default)();(null===(o=null==n?void 0:n.hooks)||void 0===o?void 0:o.add_action)?n.hooks.add_action("pmc_onetrust_consent_data_ready",(function(o){var n,e,i,d,r=o.groupsConsentedTo;if(t.value=void 0,(null==r?void 0:r.length)&&a.every((function(o){return r.includes(o)}))){var l=null!==(i=null===(e=window.pmcFirstPartyCookie)||void 0===e?void 0:e.endpoint)&&void 0!==i?i:null;l?fetch(l,{credentials:"include"}).then((function(o){return o.json()})).then((function(o){(null==o?void 0:o.value)&&(t.value=o.value)})).catch((function(){})).finally((function(){var o;null===(o=(0,u.default)().hooks)||void 0===o||o.do_action("pmc_fpc_data_ready",t)})):null===(d=(0,u.default)().hooks)||void 0===d||d.do_action("pmc_fpc_data_ready",t)}else null===(n=(0,u.default)().hooks)||void 0===n||n.do_action("pmc_fpc_data_ready",t)})):console.log("PMC First Party Cookie: pmc.hooks.add_action is not defined")},o}();window.pmc_fpc=new d,t.default=window.pmc_fpc},60:(o,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=window;n.pmc=n.pmc||{},t.default=function(){return n.pmc}}},t={};!function n(e){var i=t[e];if(void 0!==i)return i.exports;var u=t[e]={exports:{}};return o[e].call(u.exports,u,u.exports,n),u.exports}(665)})();; (()=>{"use strict";var e={665:function(e,t,a){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=r(a(831)),i=r(a(865)),o=[{tag:"a",handler:n.default},{tag:"button",handler:i.default}];document.addEventListener("DOMContentLoaded",(function(){o.forEach((function(e){Array.from(document.getElementsByTagName(e.tag)).forEach((function(t){t.addEventListener("click",e.handler)}))}))}))},404:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.push1PDEvent=t.blogherads=void 0;var a=window;a.blogherads=a.blogherads||{},a.blogherads.adq=a.blogherads.adq||[],t.blogherads=a.blogherads,t.push1PDEvent=function(e,a){t.blogherads.adq.push((function(){t.blogherads.push1PDEvent(e,a)}))}},865:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formButtonClickHandler=void 0;var r=a(404);t.formButtonClickHandler=function(e){var t=e.currentTarget;if(t instanceof Element&&/(sign up|subscribe|newsletter)/.test(t.innerHTML.toLowerCase())){for(var a={source_id:t.className,source_value:t.innerHTML.trim(),email:""},n=t;n&&"FORM"!==n.tagName;)n=n.parentElement;n&&Array.from(n.children).forEach((function(e){var t,r;if(e instanceof HTMLInputElement||e instanceof HTMLSelectElement){var n=null===(t=e.getAttribute("name"))||void 0===t?void 0:t.toLowerCase(),i=null===(r=e.getAttribute("id"))||void 0===r?void 0:r.toLowerCase(),o=e.value;"source"===n&&(a.source_id=e.id,a.source_value=o),(n&&n.indexOf("email")>=0||i&&i.indexOf("email")>=0)&&(a.email=o)}})),(0,r.push1PDEvent)("newsletter_signup_click",a)}},t.default=t.formButtonClickHandler},831:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.linkClickHandler=void 0;var r=a(404);t.linkClickHandler=function(e){var t,a=e.currentTarget;if(a instanceof Element){var n=a.getAttribute("href"),i=a.getAttribute("data-xid");if(!i&&n){var o=/xid:([^&/])*/gm.exec(n);o&&(i=o[0])}i=(null==i?void 0:i.replace("xid:",""))||"";var d=a.hasAttribute("custom-ga-data")?JSON.parse(a.getAttribute("custom-ga-data")):{},l=!(!d["1pd"]&&!a.getAttribute("data-1pd")),u=d.product||{},c=u.category||a.getAttribute("data-category-name"),s=u.currency||a.getAttribute("data-currency")||"US",v=u.name||a.getAttribute("data-product-name"),f=u.price||a.getAttribute("data-price"),g=d.type||a.getAttribute("data-type"),p=d.partner||a.getAttribute("data-partner");if(!(null==p?void 0:p.length)&&(null==n?void 0:n.length)){var m=null===(t=a.hostname)||void 0===t?void 0:t.split(".");m&&(m.pop(),m.length>1&&m.shift(),p=m.join(),["amazon","amzn"].includes(p)&&(p="Amazon"))}(l||(null==i?void 0:i.length)>0||(null==v?void 0:v.length)>0||(null==g?void 0:g.length)>0)&&(0,r.push1PDEvent)("ecommerce_click",{href:n,xid:i,data_partner:p,data_price:f,data_product_name:v,data_product_category:c,data_product_currency:s,data_type:g})}},t.default=t.linkClickHandler}},t={};!function a(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,a),i.exports}(665)})();; (()=>{"use strict";const t=t=>new Promise((e=>{try{const e=__gpp("getGPPData");-1!==e.applicableSections&&null!==e&&(t.__gpp=e,window.pmc_onetrust.initialized.__gpp=!0)}catch{}e(t)})),e=t=>new Promise((e=>{"function"==typeof __uspapi&&"object"==typeof pmc_fastly_geo_data&&"US"===pmc_fastly_geo_data?.country&&__uspapi("getUSPData",1,((n,o)=>{var i;"1---"===n?.uspString&&e(t);let a=Array(4).fill(void 0);"string"==typeof n?.uspString&&4===n.uspString.length&&(a=n.uspString.split("")),t.__uspapi={...n,version:null!==(i=a[0])&&void 0!==i?i:n?.version,doNotSellDataOffered:"Y"===a[1],consentsToSellData:"N"===a[2],IABLSPA:"Y"===a[3]},window.pmc_onetrust.initialized.__uspapi=!0,e(t)}))})),n=t=>new Promise((e=>{try{!1===window.pmc_onetrust.initialized.__tcfapi&&__tcfapi("addEventListener",2,((n,o)=>{!o||"useractioncomplete"!==n.eventStatus&&"tcloaded"!==n.eventStatus||(n.purpose.consents[1]&&n.purpose.consents[8]&&n.purpose.consents[10]&&window.triggerGA?window.triggerGA(!0):window.triggerGA(!1),t.__tcfapi=n,e(t))}))}catch{}})),o=t=>new Promise((e=>{Object.keys(t).length&&(window.pmc_onetrust.initialized.__tcfapi=!0,pmc.hooks.do_action("pmc_onetrust_consent_data_ready",{groupsConsentedTo:window.OptanonActiveGroups.split(",").filter((t=>t)),consentData:t})),e()}));window.pmc_onetrust={init:()=>{!function(){let i={};"object"!=typeof pmc_fastly_geo_data||"EU"===pmc_fastly_geo_data?.continent||["CA","CO","CT","DE","IA","MT","NE","NH","NJ","OR","TX","UT","VA"].includes(pmc_fastly_geo_data?.region)||"US"===pmc_fastly_geo_data?.country||document.querySelectorAll('script[class*="optanon-category"][type="text/plain"]').forEach((t=>function(t){const e=function(t){if(!t)return!1;const e=[...t.matchAll(/optanon-category-([a-zA-Z0-9]+)/g)];return!(!e||0===e.length)&&e.map((t=>t[1]))}(t.className);if(!e||0===e.length)return!1;let n=!0;for(const t of e)if(o=t,!("EU"!==pmc_fastly_geo_data?.continent||"string"==typeof OnetrustActiveGroups&&OnetrustActiveGroups.includes(o))){n=!1;break}var o;n&&function(t){const e=t.cloneNode(!0);e.setAttribute("type","text/javascript"),t.replaceWith(e)}(t)}(t))),t(i).then(e(i)).then(n(i)).then(o(i))}()},initialized:{__gpp:!1,__uspapi:!1,__tcfapi:!1}}})();; (()=>{var e={315:()=>{window.pmc_onetrust_helpers={getActiveConsentGroups:()=>(window.OptanonActiveGroups||"").split(",").filter(Boolean)}}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var p=r[o]={exports:{}};return e[o](p,p.exports,t),p.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{"use strict";t(315)})()})();;