var pmcPiano;!function(){"use strict";var e={575:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},c=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function c(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,c={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(c=0)),c;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((i=(i=c.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&a[a.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]0)})))),{acct:t(t({},e.user.acct),Object.fromEntries(Object.entries(null===(r=null==n?void 0:n.user)||void 0===r?void 0:r.acct).filter((function(e){var n=e[1];return null!=n&&("string"!=typeof n||("string"==typeof n&&"".concat(n).length)>0)})))),entitlements:i(i([],null!==(o=null===(a=null==e?void 0:e.user)||void 0===a?void 0:a.entitlements)&&void 0!==o?o:[],!0),null!==(s=null===(c=null==n?void 0:n.user)||void 0===c?void 0:c.entitlements)&&void 0!==s?s:[],!0)})})},getSubscriberData:function(){return r(void 0,void 0,Promise,(function(){var e,n,r,i,o,c,s,l,u,d,b,p,f,v,g;return a(this,(function(a){switch(a.label){case 0:return e=window.pmcPiano.piano,n=window.pmcPiano.pianoApi,r=window.pmcPiano.entitlements,[4,n.importWpApiFetch()];case 1:if(i=a.sent().default,o=e.getUser(),!(c=null==o?void 0:o.email))return e.canDebug&&console.log("PMC: Piano: No email available from Piano user, returning empty SubscriberData"),[2,void 0];a.label=2;case 2:return a.trys.push([2,5,,6]),c?(u="/wp-json/pmc/piano/v1/subscriptions/get/".concat(encodeURIComponent(c),"/"),[4,i({url:"".concat(window.location.protocol,"//").concat(window.location.host).concat(u)})]):[3,4];case 3:d=a.sent(),l=(null==d?void 0:d.user)?d:{},a.label=4;case 4:return[3,6];case 5:return b=a.sent(),e.canDebug&&console.log("PMC: Piano: Error retrieving subscriber data from Salesforce API",b),[3,6];case 6:return[4,n.getAccessList()];case 7:p=a.sent();try{Array.isArray(p)&&p.length>0&&(null===(g=p[0])||void 0===g?void 0:g.user)&&(f=p[0],s={data_type:"piano",user:{family_name:f.user.last_name,given_name:f.user.first_name,email:f.user.email,acct:{contact_id:f.user.uid,name:[f.user.first_name,f.user.last_name].filter((function(e){return e&&e.length>0})).join(" ").trim()},entitlements:p.map((function(e){return e.resource.name}))}})}catch(n){e.canDebug&&console.error("PMC: Piano: Error retrieving Piano access list",n)}return e.canDebug&&console.log("PMC: Piano: Retrieved subscriber data from Piano API",l,s),[2,(v=l&&s?r.combineSubscriberData(l,s):null!=l?l:s)?t({data_type:"piano"},v):void 0]}}))}))},setSubscriberData:function(){var e=window.pmcPiano.entitlements,n=window.pmcPiano.piano;if(!n.hasUser())return n.canDebug&&console.log("PMC: Piano: No Piano user, skipping subscriber data load"),void e.triggerSubscriberDataLoaded();e.getSubscriberData().then((function(t){e.subscriberData=t,n.canDebug&&console.log("PMC: Piano: Loaded subscriber data",e.subscriberData),e.triggerSubscriberDataLoaded()}))},subscriberDataLoadedCallbacks:[],cxenseCallbackCalled:!1,triggerSubscriberDataLoaded:function(){var e=window.pmcPiano.entitlements;if(window.pmcPiano.piano,0>=e.subscriberDataLoadedCallbacks.length){if(e.cxenseCallbackCalled)return;setTimeout(e.triggerSubscriberDataLoaded.bind(e),500)}else{for(var n=0,t=e.subscriberDataLoadedCallbacks;n=Object.keys(t.onetrustToPianoMapping).length;Object.keys(i).forEach((function(e){t.pianoProductModes[e]=Math.max.apply(Math,o(o([],i[e],!1),a?[t.pianoProductModesConsentAll[e]]:[],!1))})),t.canDebug&&console.log("PMC: Piano:","pianoProductModes",t.pianoProductModes)}window.tp.push(["init",t.setPianoProductModes.bind(t)])},setPianoProductModes:function(){var e,n,o,t,i,a,s=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!==(e=s.pianoWeightsToModes[s.pianoProductModes.COMPOSER])&&void 0!==e?e:"opt-out"}),window.tp.consent.set("DMP",{mode:null!==(n=s.pianoWeightsToModes[s.pianoProductModes.DMP])&&void 0!==n?n:"opt-out"}),window.tp.consent.set("ID",{mode:null!==(o=s.pianoWeightsToModes[s.pianoProductModes.ID])&&void 0!==o?o:"opt-out"}),window.tp.consent.set("PA",{mode:null!==(t=s.pianoWeightsToModes[s.pianoProductModes.PA])&&void 0!==t?t:"opt-out"}),window.tp.consent.set("VX",{mode:null!==(i=s.pianoWeightsToModes[s.pianoProductModes.VX])&&void 0!==i?i:"opt-out"}),window.tp.consent.set("DL",{mode:null!==(a=s.pianoWeightsToModes[s.pianoProductModes.DL])&&void 0!==a?a:"opt-out"}),s.canDebug&&console.log("PMC: Piano:","tp.consent.get()",window.tp.consent.get())}}},353:function(e,n,o){var t=this&&this.__awaiter||function(e,n,o,t){return new(o||(o=Promise))((function(i,a){function s(e){try{c(t.next(e))}catch(e){a(e)}}function r(e){try{c(t.throw(e))}catch(e){a(e)}}function c(e){var n;e.done?i(e.value):(n=e.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,r)}c((t=t.apply(e,n||[])).next())}))},i=this&&this.__generator||function(e,n){var o,t,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(c){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(s=0)),s;)try{if(o=1,t&&(i=2&r[0]?t.return:r[0]?t.throw||((i=t.return)&&i.call(t),0):t.next)&&!(i=i.call(t,r[1])).done)return i;switch(t=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,t=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]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(n),500)};i(),window.addEventListener("load",i),window.addEventListener("scroll",i),window.addEventListener("resize",i)}}.bind(n))},getUserCustomFields:function(){return t(this,void 0,void 0,(function(){return i(this,(function(e){return[2,window.pmcPiano.pianoApi.getFromEndpoint("".concat(this.userCustomFieldsEndpoint,"/").concat(this.user.uid))]}))}))},getAccountType:function(e){return["email_domain_contract","specific_email_addresses_contract"].includes(e)?"site_license":"individual"},registerOnLoggedInUserCallback:function(e){this.initialized&&this.hasUser()&&e(this.getUser()),this.onLoggedInUserCallbacks.push(e)},registerOnLoggedOutUserCallback:function(e){this.onLoggedOutUserCallbacks.push(e)},registerOnPageLoadNotHasUserCallback:function(e){this.initialized&&!this.hasUser()&&e(),this.onPageLoadNotHasUserCallbacks.push(e)},registerOnHasIPUserCallback:function(e){this.initialized&&!0===this.hasIPUser()&&e(),this.onHasIPUserCallbacks.push(e)},triggerOnLoggedInUserCallbacks:function(){var e=this;e.canDebug&&console.log("PMC: Piano: Running login callbacks",e.onLoggedInUserCallbacks),e.onLoggedInUserCallbacks.forEach((function(n){n(e.user)}))},triggerOnLoggedOutUserCallbacks:function(){var e=this;e.canDebug&&console.log("PMC: Piano: Running logout callbacks",e.onLoggedOutUserCallbacks),e.onLoggedOutUserCallbacks.forEach((function(e){e()}))},triggerOnPageLoadNotHasUserCallbacks:function(){var e=this;e.canDebug&&console.log("PMC: Piano: Running no-user callbacks",e.onPageLoadNotHasUserCallbacks),e.onPageLoadNotHasUserCallbacks.forEach((function(e){e()}))},triggerOnHasIPUserCallbacks:function(){var e=this;e.canDebug&&console.log("PMC: Piano: Running has-IP-user callbacks",e.onHasIPUserCallbacks),e.onHasIPUserCallbacks.forEach((function(e){e()}))},setIPUser:function(){var e=this;e.canDebug&&console.log("PMC: Piano: IP Match"),e.isIPUser=!0,e.triggerOnHasIPUserCallbacks()},maybeRenderMyAccountPage:function(){document.querySelector(this.myAccountPageSelector)&&window.tp.myaccount.show({displayMode:"inline",containerSelector:this.myAccountPageSelector})},maybeRenderPasswordResetPage:function(){if(!document.querySelector(this.passwordResetPageSelector))return"password reset element missing";var e=window.location.search.match(/reset_token=([A-Za-z0-9]+)/);return e?(window.onmessage=this.redirectHomeOnClosedMessage,window.tp.pianoId.show({resetPasswordToken:e[1],loggedIn:function(){window.location="/"}})):"invalid token"},redirectHomeOnClosedMessage:function(e){if("string"==typeof e.data){var n=JSON.parse(e.data);n.sender&&n.sender.startsWith("piano-id")&&"closed"===n.event&&(window.location="/")}},reRenderExperiences:function(){var e=this,n=window.tp;e.canDebug&&console.log("PMC: Piano: Re-rendering Experiences"),n.offer.closeInline(e.pianoPaywallSelector),n.offer.closeInline("#piano-right-rail"),n.offer.closeInline("#piano-mid-river"),n.offer.closeInline("#piano-sticky-footer"),n.offer.closeInline("#piano-fly-out");var o=document.querySelector(e.pmcPaywallSelector);o&&o.classList.remove(e.truncatedContentSelector),n.experience.execute()}};s.primeTp(),s.checkTp(),e.exports=s}},n={},o=function o(t){var i=n[t];if(void 0!==i)return i.exports;var a=n[t]={exports:{}};return e[t].call(a.exports,a,a.exports,o),a.exports}(353);(pmcPiano=void 0===pmcPiano?{}:pmcPiano).piano=o}();; window.pmc_cxense_functions={until:async function(e,t=100){for(;!e();)await new Promise((e=>setTimeout(e,t)))},sendGAEvent:(e,t,n)=>{window.ga&&window.ga("send","event",e,t,n),void 0!==window.gtag&&window.gtag("event",String(e+"-"+t).substring(0,39),{eventCategory:String(e).substring(0,99),eventAction:String(t).substring(0,99),eventLabel:String(n).substring(0,99)})},GATriggerClick:function(e){this.sendGAEvent("Wall","Clicked",e)},GATriggerClickLogin:function(e){this.sendGAEvent("Wall","Clicked-Login",e)},GATriggerCA:function(e){this.sendGAEvent("Wall","Clicked-Create Account",e)},truncateContentToLines:function(e=0){if(console.log("[cx] attempting to truncate content by lines.."),!e)return void console.log("[cx] no line count specified");const t=document.querySelector(".l-article-content .c-content .pmc-paywall")||document.querySelector(".l-featured-article .c-content .pmc-paywall")||document.querySelector(".a-content .pmc-paywall");if(!t)return void console.log("[cx] No content found");console.log("[cx] removing empty and non-paragraphs from content");const n=t.querySelectorAll(":scope > p"),o=[];for(n.forEach((e=>{""!==e.innerText&&o.push(e)}));t.firstElementChild;)t.firstElementChild.remove();const i=[];o.forEach((e=>{i.push(document.createTextNode(e.innerText)),i.push(document.createElement("br")),i.push(document.createElement("br"))})),t.append(...i),console.log("[cx] applying line clamping of "+e+" line(s)"),t.style.cssText+="display: -webkit-box;",t.style.cssText+="-webkit-line-clamp: "+e+";",t.style.cssText+="-webkit-box-orient: vertical;",t.style.cssText+="margin-top:2rem;",console.log("[cx] truncation complete")},truncateListContent(){const e=document.querySelectorAll(".c-list article");if(e)for(;e.firstElementChild!==e.lastElementChild;)e.lastElementChild.remove()},fadeContent:function(){const e=document.querySelector(".c-content .pmc-paywall")||document.querySelector(".a-content .pmc-paywall");if(e){const t=document.createElement("div");t.setAttribute("class","cx-content-fade"),e.style.cssText+="position: relative;",e.style.cssText+="overflow: hidden;",e.append(t),window.blogherads=window.blogherads||{},window.blogherads.adq=window.blogherads.adq||[],window.blogherads.adq.push((function(){window.blogherads.setConf("slot_slider_status",!1)}))}},loginStatus:function(){return!(void 0===window.pmc||void 0===window.pmc.subscription_v2||!window.pmc.subscription_v2.has_user()||!window.pmc.subscription_v2.has_session())},wpAdminLoggedIn:function(){return!("undefined"==typeof pmc_meta||!pmc_meta.hasOwnProperty("logged-in"))&&"yes"===pmc_meta["logged-in"]},showRegistrationForm:function(e,t){const n=window.pmc_cxense_functions;console.log("PMC - Cxense","Showing registration form",e,t);const o=document.querySelector(".pmc-cx-show-reg-form-button"),i=new URL(t.url),c=i.searchParams;if(c.set("brand",t.brand),c.set("campaign",o.getAttribute("data-campaign-id")),window.cookie3PSupported){window.addEventListener("message",n.listenForRegistrationFormPostMessages);const e=document.getElementById("reg-step1"),t=document.getElementById("reg-step2"),c=document.getElementById("create-acc-loader");c.style.visibility="visible",o.disabled=!0;const l=document.createElement("iframe");l.setAttribute("style","width:100%;height:400px;border:0;"),l.setAttribute("id","pmc-registration-paywall"),l.setAttribute("title","PMC Registration Paywall"),l.setAttribute("name","registrationPaywall"),l.setAttribute("allowtransparency","true"),l.setAttribute("scrolling","no"),l.setAttribute("loading","lazy"),l.setAttribute("sandbox","allow-same-origin allow-scripts allow-popups allow-forms"),l.src=i.toString(),l.referrerPolicy="no-referrer-when-downgrade",t.appendChild(l),l.onload=function(){c.style.visibility="hidden",o.disabled=!1,e.classList.toggle("pmc-cx-tab-active"),t.classList.toggle("pmc-cx-tab-active")}}else c.set("redirect",encodeURIComponent(window.location.href)),window.location.assign(i.toString())},listenForRegistrationFormPostMessages:function(e){const t=window.pmc_cxense_functions;if(["https://subscriptions.pmcdev.io","https://subscriptions.pmc.com"].includes(e.origin)&&"string"==typeof e.data)if(e.data.includes("gaSend")){const n=e.data.split("."),o=n[1],i=n[2],c=n[3];t.sendGAEvent(o,i,c)}else if(e.data.includes("cxConvertProduct")){const t=e.data.split(".")[1];cX.CCE.callQueue.push(["sendConversionEvent",{productId:t,funnelStep:"convertProduct"}])}else{const t=JSON.parse(e.data);if(t.jwt){const e=document.getElementById("pmc-registration-paywall");e&&e.remove();const n=new URL(window.location.href),o=n.searchParams;o.set("jwt",t.jwt),o.set("sub_action",t.sub_action),window.location.assign(n.toString())}}},handleCloseButtonClick:function(){const e=document.querySelector("#cx-nl-overlay-wrap"),t=document.querySelector(".cx-nl-close-btn"),n=document.querySelector(".c-content .pmc-paywall")||document.querySelector(".a-content .pmc-paywall");t.addEventListener("click",(function(t){t.stopPropagation(),e.style.display="none",n.classList.remove("dismissible-blur-text")}))},showNewsletterUpgradeOffer:function(){event.preventDefault();const e=document.querySelector(".cx-newsletter-wrapper #nlEmailAddress");e.value&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.value)&&(document.querySelector(".cx-newsletter-wrapper .nlSignupbtn").disabled=!1,document.getElementById("nl-regwall-step1").classList.toggle("pmc-cx-tab-active"),document.getElementById("nl-regwall-step2").classList.toggle("pmc-cx-tab-active"))},blurContent:function(){const e=document.querySelector(".c-content .pmc-paywall")||document.querySelector(".a-content .pmc-paywall");e&&e.classList.add("dismissible-blur-text")},setModalPosition:function(){const e=document.querySelector(".pmc-paywall"),t=document.getElementById("cx-nl-overlay-wrap");let n=0,o=!1;const i=document.querySelector(".header").offsetHeight+15,c=document.querySelector(".above-header-ad");new MutationObserver((function(e,t){for(const t of e)"childList"===t.type&&(o=!1)})).observe(c,{childList:!0,subtree:!0}),window.addEventListener("scroll",(function(){o||(n=e.getBoundingClientRect().top+window.scrollY,o=!0);const c=e.getBoundingClientRect().top<=i,l=e.clientHeight-t.clientHeight,s=window.scrollY+i,r=c?Math.min(Math.max(0,s-n),l)+"px":"1rem";t.style.top=r}))},textInputHolder:function(){const e=document.getElementById("nlEmailAddress"),t=e.placeholder;e.onfocus=function(){""===e.value&&(e.placeholder="")},e.onblur=function(){""===e.value&&(e.placeholder=t)}},emailCapture:function(){console.log("Form Loaded");const e=(new Date).toISOString().split("T")[0];let t="https://cloud.email.wwd.com/signup/";document.getElementById("currentDateInput").value=e,document.querySelector(".nlSignupbtn").addEventListener("click",(function(e){const n=e.target;n.hasAttribute("data-url")&&(t=n.getAttribute("data-url"));const o=document.querySelector(".pmc-cx-nl-form"),i=new FormData(o);fetch(t,{method:"POST",body:i,mode:"no-cors"}).then((e=>{console.log("POST request successful:",e)})).catch((e=>{console.log("Error:",e)}))}))},newsletterModal:function(){const e=window.pmc_cxense_functions;document.querySelector(".a-content").classList.add("lrv-u-position-relative"),setTimeout((function(){document.getElementById("cx-paywall").hasChildNodes()&&(e.setModalPosition(),e.blurContent(),e.textInputHolder(),e.handleCloseButtonClick(),e.emailCapture())}),2e3)},specialReportUrl:function(){console.log("spr-1");let e="";const t=document.querySelector(".view-full-extended a.c-link");return e=t?t.href:"https://read-vip.variety.com/",e},hidePaidContent:function(){let e=document.querySelector(".a-content .vy-cx-page-content");e||(e=document.querySelector(".a-content")),e&&e.innerText.length>200&&(e.innerHTML="

"+e.innerText.substr(0,200)+" ...

")},hideElementsByClassName:function(e){const t=document.getElementsByClassName(e);t.length>0&&(t[0].style.display="none")},removeElementsByClassName:function(e){"view-full-extended"==e&&console.log("rmCls-sprpt");const t=document.getElementsByClassName(e);for(;t.length>0;)t[0].parentNode.removeChild(t[0])},switchLogin:function(){const e=window.pmc_cxense_functions;"complete"===document.readyState?e.initializeLogin():window.addEventListener("load",e.initializeLogin)},initializeLogin:async function(){const e=window.pmc_cxense_functions;if(console.log("login Provider: ",window.pmcPianoData?.loginProvider),"piano"===window.pmcPianoData?.loginProvider){await e.until((()=>0{var t={543:function(t,e){!function(t){"use strict";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function n(t){for(var n=1;ne)return t;for(i=0;i0&&void 0!==arguments[0]?arguments[0]:["hours","minutes","seconds"],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;t=t||["hours","minutes","seconds"],e=e||":",n=n||2;var i,s=[];for(i=0;i-1&&this.events[t].splice(n,1)}},o.prototype.removeAllListeners=function(t){t?Array.isArray(this.events[t])&&(this.events[t]=[]):this.events={}},o.prototype.emit=function(t){for(var e=this,n=arguments.length,i=new Array(n>1?n-1:0),s=1;s0&&void 0!==arguments[0]?arguments[0]:{},T=new r,k=new r,S=new o,O=!1,D=!1,x={},M={detail:{timer:this}};function F(t,e){var n=w[t];k[t]=e,T[t]=t===m?Math.abs(e):j(e>=0?e:n-j(e,n),n)}function L(t){return B(t,m)}function $(t){return B(t,f)}function V(t){return B(t,y)}function R(t){return B(t,p)}function z(t){return B(t,u)}function B(t,e){var n=k[e];return F(e,it(t,v[e])),k[e]!==n}function U(){q(),Y()}function q(){clearInterval(t),t=void 0,O=!1,D=!1}function H(t){mt()?(P=N(),_=st(I.target)):Z(t),J()}function J(){var n=v[e];Q(G(Date.now()))||(t=setInterval(W,n),O=!0,D=!1)}function N(){return G(Date.now())-k.secondTenths*v.secondTenths*s}function W(){var t=G(Date.now());K(X()),a(M.detail.timer),Q(t)&&(ot(),yt("targetAchieved",M))}function X(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G(Date.now()),e=s>0?t-P:P-t,n={};return n.secondTenths=z(e),n.seconds=R(e),n.minutes=V(e),n.hours=$(e),n.days=L(e),n}function G(t){return Math.floor(t/v[e])*v[e]}function K(t){t.secondTenths&&yt("secondTenthsUpdated",M),t.seconds&&yt("secondsUpdated",M),t.minutes&&yt("minutesUpdated",M),t.hours&&yt("hoursUpdated",M),t.days&&yt("daysUpdated",M)}function Q(t){return _ instanceof Array&&t>=A}function Y(){T.reset(),k.reset()}function Z(t){e=tt((t=t||{}).precision),a="function"==typeof t.callback?t.callback:function(){},C=!0===t.countdown,s=!0===C?-1:1,"object"===i(t.startValues)?at(t.startValues):b=null,P=N(),X(),"object"===i(t.target)?_=st(t.target):C?(t.target={seconds:0},_=st(t.target)):_=null,x={precision:e,callback:a,countdown:"object"===i(t)&&!0===t.countdown,target:_,startValues:b},I=t}function tt(t){if(!et(t="string"==typeof t?t:p))throw new Error("Error in precision parameter: ".concat(t," is not a valid value"));return t}function et(t){return g.indexOf(t)>=0}function nt(t){var e;if("object"===i(t))if(t instanceof Array){if(5!==t.length)throw new Error("Array size not valid");e=t}else{for(var n in t)if(g.indexOf(n)<0)throw new Error("Error in startValues or target parameter: ".concat(n," is not a valid input value"));e=[t.secondTenths||0,t.seconds||0,t.minutes||0,t.hours||0,t.days||0]}e=e.map((function(t){return parseInt(t,10)}));var s=e[0],a=e[1]+it(s,c),r=e[2]+it(a,l),o=e[3]+it(r,h),u=e[4]+it(o,d);return e[0]=s%c,e[1]=a%l,e[2]=r%h,e[3]=o%d,e[4]=u,e}function it(t,e){var n=t/e;return n<0?Math.ceil(n):Math.floor(n)}function st(t){if(t){var e=rt(_=nt(t));return A=P+e.secondTenths*v.secondTenths*s,_}}function at(t){b=nt(t),T.secondTenths=b[0],T.seconds=b[1],T.minutes=b[2],T.hours=b[3],T.days=b[4],k=rt(b,k)}function rt(t,e){var n=e||{};return n.days=t[4],n.hours=n.days*d+t[3],n.minutes=n.hours*h+t[2],n.seconds=n.minutes*l+t[1],n.secondTenths=n.seconds*c+t[[0]],n}function ot(){U(),yt("stopped",M)}function ct(){U(),H(I),yt("reset",M)}function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n(n({},E),t),ft()||(H(t),yt("started",M))}function ht(){q(),D=!0,yt("paused",M)}function dt(t,e){S.on(t,e)}function ut(t,e){S.removeListener(t,e)}function pt(t){S.removeAllListeners(t)}function yt(t,e){S.emit(t,e)}function ft(){return O}function mt(){return D}function gt(){return T}function vt(){return k}function wt(){return x}Z(E),void 0!==this&&(this.start=lt,this.pause=ht,this.stop=ot,this.reset=ct,this.isRunning=ft,this.isPaused=mt,this.getTimeValues=gt,this.getTotalTimeValues=vt,this.getConfig=wt,this.addEventListener=dt,this.on=dt,this.removeEventListener=ut,this.removeAllEventListeners=pt,this.off=ut)}t.Timer=I,t.default=I,Object.defineProperty(t,"__esModule",{value:!0})}(e)}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=window;let e=[],i={};t.pmc_trackJwPlayerScriptLoaders=i;class s{constructor(t){this.playerId=t,this.jwPlayerDefaults=null,this.callbacks=[]}load(){return this.playerId?C(`https://${_.content_mask||"content.jwplatform.com"}/libraries/${this.playerId}.js`,this.handleOnLoaded.bind(this)):t.jwplayer&&t.jwplayer.defaults&&t.jwplayer.defaults.pid&&(this.playerId=t.jwplayer.defaults.pid,this.handleOnLoaded()),this}handleOnLoaded(){const e=this.callbacks;if(t.jwplayer&&t.jwplayer.defaults){if(_.ads_suppression&&delete t.jwplayer.defaults.advertising,this.playerId!==t.jwplayer.defaults.pid&&console.log(`Warning: JwPlayerLoader load "${this.playerId}" seeing "${t.jwplayer.defaults.pid}"`),this.jwPlayerDefaults=t.jwplayer.defaults,Array.isArray(e)){const n=e=>{if("function"==typeof e)try{const n=t.jwplayer.defaults;t.jwplayer.defaults=this.jwPlayerDefaults,e(Object.assign({jwPlayer:t.jwplayer},this)),t.jwplayer.defaults=n}catch(e){t.console.log(e)}};this.callbacks={push:n},e.forEach((t=>{this.callbacks.push(t)}))}return this}}}const a=function(){const n=e;if(t.jwplayer&&t.jwplayer.defaults&&t.jwplayer.defaults.pid){const e=t.jwplayer.defaults.pid;i[e]=i[e]||new s(e),i[e].handleOnLoaded()}Array.isArray(n)&&(e={push:t=>{const{playerId:e,callback:n}=t;i[e]=i[e]||new s(e).load(),n&&i[e].callbacks.push(n)}},n.forEach((t=>{e.push(t)})))},r=function(t,n){e.push({playerId:t,callback:n})},o=window;let c=[],l=!1;const h=function(){_.comscore&&!l&&(l=!0,C("https://sb.scorecardresearch.com/c2/plugins/streamingtag_plugin_jwplayer.js",(()=>{const t=c;Array.isArray(t)&&(c={push:t=>{if(o.ns_&&o.ns_.StreamingAnalytics){const e=t.getConfig();o.ns_.StreamingAnalytics.JWPlayer(t,_.comscore),o.console.log("comscore tracking initialized",{vid:e.id})}}},t.forEach((t=>{c.push(t)})))})))},d=function(t){c.push(t)};class u{constructor(t,e,n,i){this.playerInstance=n,this.playlist=i,this.activeChannel=t,this.inActiveChannel=e,this.tryingChannel=this.activeChannel,this.channelStatusErrorCount=0}init(){this.playerInstance.on("playlistComplete",this.handleFinished.bind(this)),this.playerInstance.on("error",(t=>{230001===t.code&&(this.timer&&(clearTimeout(this.timer),delete this.timer),this.handleFinished())})),this.playerInstance.on("remove",(()=>{this.timer&&(clearTimeout(this.timer),delete this.timer),delete this.playerInstance,delete this.activeChannel,delete this.inActiveChannel,delete this.playlist,delete this.channelStatusErrorCount,delete this.tryingChannel})),this.checkChannelStatus()}handleFinished(){this.timer&&(clearTimeout(this.timer),delete this.timer),A("Waiting for Live Channel to become active."),this.playerInstance.setConfig({repeat:!0}),this.playerInstance.load(this.playlist),this.checkChannelStatus(),this.playerInstance.play()}checkChannelStatus(){var t;this.timer&&(clearTimeout(this.timer),delete this.timer),(t=this.tryingChannel,P(`https://cdn.jwplayer.com/live/channels/${t}.json`)).then((t=>{A(`Received channel ${this.tryingChannel} status: ${t.status}`),this.channelStatusErrorCount=0;const e=t.current_event;return!("active"!==t.status||!e)&&e})).then((t=>{if(t){if(this.tryingChannel!==this.activeChannel){const t=this.activeChannel;this.activeChannel=this.tryingChannel,this.inActiveChannel=t}this.configurePlayer(t).catch((t=>{E(`Failed to start live event stream playback: ${t}`)}))}else this.inActiveChannel&&this.tryingChannel!==this.inActiveChannel?(this.tryingChannel=this.inActiveChannel,this.checkChannelStatus()):(this.tryingChannel=this.activeChannel,this.timer=setTimeout(this.checkChannelStatus.bind(this),1e4))})).catch((t=>{if(this.channelStatusErrorCount++,E(`Unable to fetch the channel status for ${this.tryingChannel}: ${t}`),this.channelStatusErrorCount>3){if(this.tryingChannel!==this.activeChannel){const t=this.activeChannel;this.activeChannel=this.tryingChannel,this.inActiveChannel=t}this.channelStatusErrorCount=0,this.timer=setTimeout(this.checkChannelStatus.bind(this),1e4)}else this.checkChannelStatus()}))}async configurePlayer(t){let e,n=0;for(A(`Fetching playlist for ${t}.`);!e;)try{e=await(i=t,P(`https://cdn.jwplayer.com/v2/media/${i}`,{cache:"no-cache"}))}catch(i){if(++n,E(`Error fetching playlist: ${i}`),n>=3){A("Configuring Player with m3u8"),e={playlist:[{mediaid:t,file:`https://cdn.jwplayer.com/live/events/${t}.m3u8`}]};break}await T(2**(n-1)*5e3)}var i;this.playerInstance.setConfig({repeat:!1}),this.playerInstance.load(e.playlist),this.playerInstance.play(),A(`Playing live event stream with id '${t}'.`)}}var p=n(543),y=n.n(p);class f{constructor(t,e,n){this.playerInstance=t,this.currentPlaylistItem=null,this.currentMediaID=null,this.startedMediaIDs=[],this.timer=new(y()),this.intervalHandler=null,this.mediaIntervals={},this.ga4Property=_?.livestream_ga4_property,this.eventCategory=e,this.eventLabelPrefix=n}init(){this.playerInstance.on("firstFrame",this.handleStart.bind(this)),this.playerInstance.on("pause",(t=>{let{pauseReason:e}=t;"interaction"===e&&this.timer.pause()})),this.playerInstance.on("play",(t=>{let{playReason:e}=t;"interaction"===e&&this.timer.start()})),["playAttemptFailed","error","remove","complete"].forEach((t=>{this.playerInstance.on(t,this.handleStop.bind(this))})),window.addEventListener("beforeunload",this.handleStop.bind(this))}handleStart(){this.currentPlaylistItem=this.playerInstance.getPlaylistItem(),this.currentMediaID=this.currentPlaylistItem.mediaid,this.startedMediaIDs.includes(this.currentMediaID)||(this.startedMediaIDs.push(this.currentMediaID),this.doViewedEvent("first_play")),this.timer.reset(),this.timer.start(),this.intervalHandler=setInterval(this.doElapsedTimeCheck.bind(this),3e3),this.doElapsedTimeCheck()}doElapsedTimeCheck(){const t=this.timer.getTotalTimeValues().seconds,e=this.timer.getTotalTimeValues().minutes;void 0===this.mediaIntervals[this.currentMediaID]&&(this.mediaIntervals[this.currentMediaID]=[]),this.mediaIntervals[this.currentMediaID].includes(e)||(this.mediaIntervals[this.currentMediaID].push(e),e>=1&&this.doViewedEvent("viewed_duration",e,t),e>=10&&this.handleStop())}handleStop(){Array.isArray(this.mediaIntervals[this.currentMediaID])&&!this.mediaIntervals[this.currentMediaID].includes(1)&&this.doViewedEvent("viewed_duration",0,this.timer.getTotalTimeValues().seconds),this.timer.pause(),clearInterval(this.intervalHandler),this.intervalHandler=null}doViewedEvent(t,e,n){const i={[`${this.eventLabelPrefix}_title`]:this.currentPlaylistItem?.title,[`${this.eventLabelPrefix}_media_id`]:this.currentMediaID,[`${this.eventLabelPrefix}_channel_id`]:this.currentPlaylistItem?.livestream_channel_id,[`${this.eventLabelPrefix}_event`]:t};void 0!==e&&(i[`${this.eventLabelPrefix}_viewed_min`]=e),void 0!==n&&(i[`${this.eventLabelPrefix}_total_viewed_sec`]=n),this.doEvent(i)}doEvent(t){"undefined"!=typeof gtag&&this.ga4Property&>ag("event",this.eventCategory,{send_to:this.ga4Property,...t})}}const m=window,g=m.document;class v{constructor(t){this.divId=t,this.isReady=!1,this.actions=[],this.jwInstance=null,this.options={},this.callbacks=[]}whenReady(t){this.callbacks.push(t)}ready(t){if(this.isReady||!t)return;if(this.jwInstance=t(this.divId),!this.jwInstance)return void console.log(`Error instantiate JwPlayer instance for div ${this.divId}`);this.isReady=!0;const e=this.actions,n=this.callbacks;if(Array.isArray(e)){const t=t=>{this.doAction(t)};this.actions={push:t},e.forEach((t=>{this.actions.push(t)}))}if(Array.isArray(n)){const t=t=>{t(this.jwInstance)};this.callbacks={push:t},n.forEach((t=>{this.callbacks.push(t)}))}}doAction(t){const{cmd:e,args:n}=t;this.jwInstance&&this.jwInstance[e]&&("setup"===e?this.setup.apply(this,n):this.jwInstance[e].apply(this.jwInstance,n))}hasDirectSold(){return _&&_.has_direct_sold_ad}setup(t){if(t&&(this.options=t),this.adjustDeviceScreenSize().adjustAdvertisingTag().adjustFloating(),t&&(this.jwInstance.setup(this.options),this.jwInstance.on("ready",function(){this.maybeAddLiveTag()}.bind(this)),this.options.channelId)){const{channelId:t,backupChannelId:e,playlist:n}=this.options;new u(t,e,this.jwInstance,n).init(),_.livestream_ga_enabled&&new f(this.jwInstance,"harmony-livestream","livestream").init()}return this.applyCaption().monetize().pushVideoEvents().overlayCatapult().comscoreTracking(),this}adjustDeviceScreenSize(){try{const t=m.screen?.orientation?.angle||m.orientation||0;if(this.width=0==t||180==t?m.screen.width:m.screen.height,void 0!==m.devicePixelRatio&&m.devicePixelRatio>1&&(this.width=this.width/m.devicePixelRatio,this.width<300&&(this.width=300)),void 0!==this.options.width&&this.width=i?"top":1.5i?"mid":"bottom"}}}catch(t){m.console.log(t)}return t}comscoreTracking(){if(this.jwInstance)try{d(this.jwInstance)}catch(t){m.console.log(t)}return this}}class w{constructor(t){this.id=t,this._pmc=new v(t,this)}instance(){const{jwInstance:t}=this._pmc;return t}whenReady(t){return this._pmc.whenReady(t),this}whenNoFloat(t){if("function"==typeof t)return this.noFloatCallback=t,this._pmc.canFloat()||this.noFloatCallback(),this}noFloat(){this._pmc.adjustFloating(!1),this.noFloatCallback&&this.noFloatCallback()}setup(t){return t&&(this._pmc.options=t),this._pmc.actions.push({cmd:"setup",args:Array.from(arguments)}),this}remove(){this._pmc.actions.push({cmd:"remove",args:Array.from(arguments)})}on(){this._pmc.actions.push({cmd:"on",args:Array.from(arguments)})}play(){this._pmc.actions.push({cmd:"play",args:Array.from(arguments)})}pause(){this._pmc.actions.push({cmd:"pause",args:Array.from(arguments)})}stop(){this._pmc.actions.push({cmd:"stop",args:Array.from(arguments)})}getState(){const{jwInstance:t}=this._pmc;return t?t.getState():"error"}getVolume(){const{jwInstance:t}=this._pmc;return t?t.getVolume():0}setVolume(){this._pmc.actions.push({cmd:"setVolume",args:Array.from(arguments)})}getMute(){const{jwInstance:t}=this._pmc;return t?t.getMute():0}setMute(){this._pmc.actions.push({cmd:"setMute",args:Array.from(arguments)})}getPlaylist(){const{jwInstance:t}=this._pmc;return t?t.getPlaylist():[]}getPlaylistIndex(){const{jwInstance:t}=this._pmc;return t?t.getPlaylistIndex():0}getPlugin(t){const{jwInstance:e}=this._pmc;return e?e.getPlugin(t):null}getContainer(){const{jwInstance:t}=this._pmc;return t?t.getContainer():null}getConfig(){const{jwInstance:t}=this._pmc;return t?t.getConfig():{}}playlistItem(){this._pmc.actions.push({cmd:"playlistItem",args:Array.from(arguments)})}load(){this._pmc.actions.push({cmd:"load",args:Array.from(arguments)})}next(){this._pmc.actions.push({cmd:"next",args:Array.from(arguments)})}}const j=window,I=j.document,_=j.pmc_jwplayer_options=j.pmc_jwplayer_options||{};_.noFloatIds=_.noFloatIds||[];const b={};function C(t,e,n,i){const s=I.createElement("script"),a=I.getElementsByTagName("script")[0];s.type="text/javascript",s.async=!0,(e||n)&&(s.onload=function(){"function"==typeof e&&e(),n&&s.parentNode.removeChild(s)}),s.src=t,i&&(s.id=i),a.parentNode.insertBefore(s,a)}function P(t,e){return fetch(t,e).then((e=>{if(!e.ok)throw new Error(`Unable to fetch ${t}: ${e.statusText}`);return e.json()}))}function A(t,e){j.console.log(t,e)}function E(t,e){j.console.error(t,e)}function T(t){return new Promise((e=>setTimeout(e,t)))}const k=window;function S(){["jwplayer_contextual_player_div","jwplayer_floating_preroll_ad"].forEach((t=>{_.noFloatIds.includes(t)||_.noFloatIds.push(t);const e=b[t];e&&e.noFloat()}))}function O(t){_.has_direct_sold_ad=t||!0,Object.values(b).forEach((t=>{t.noFloat()}))}const D={"dfp:isdirect=true":O,"floatingplayer=nofloat":S};const x=window;let M=!1;function F(t){a(),M||(M=!0,_.pid&&r(_.pid),t&&t.players&&Array.isArray(t.players)&&t.players.forEach((t=>{r(t)})),h(),_.cgid&&!_.ads_suppression&&C("https://tags.catapultx.com/bootstrapper"))}x.pmc_jwplayer=function(t,e){let n=e||function(t){const e=/jwplayer_[^_]+_([^_]+)(?:_div(?:_\d+)?)?/.exec(t);if(e&&2===e.length&&"div"!==e[1])return e[1];const n=I.getElementById(t);return n?n.getAttribute("data-playerid")||n.getAttribute("data-player"):null}(t);t||j.jwplayer&&(t=j.jwplayer().id),j.pmc&&j.pmc.hooks&&(n=j.pmc.hooks.apply_filters("pmc_jwplayer_id",n)),!n&&j.jwplayer&&j.jwplayer.defaults&&j.jwplayer.defaults.pid&&(n=j.jwplayer.defaults.pid),n&&"default"!==n||(n=_.pid);let i=b[t];return i||(i=new w(t),b[t]=i,r(n,(t=>{i._pmc.ready(t.jwPlayer)})),i.on("remove",(()=>{delete b[t]}))),i},x.pmc_jwplayer.init=F,x.pmc_jwplayer.loadScript=C,x.pmc_jwplayer.load=r,x.pmc_jwplayer.extractPlayListFromDivId=function(t){const e=I.getElementById(t);if(e){const t=e.getAttribute("data-jsonfeed");if(t&&t.length)return t}const n=/jwplayer_([^_]+)_[^_]+_div(?:_\d+)?/.exec(t);if(n&&2===n.length){return i=`feeds/${n[1]}.json`,`https://${_.content_mask||"content.jwplatform.com"}/${i}`}var i;return null},x.pmc_jwplayer.handleDirectSold=O,x.pmc_jwplayer.handleFloatingPlayerNoFloat=S,x.pmc_jwplayer.add=F,k.addEventListener("message",(function(t){const e=t.data;if("string"==typeof e&&0===e.indexOf("pmcadm:"))for(const[t,n]of Object.entries(D))e.indexOf(t)>=7&&n()}),!1),k.pmc&&k.pmc.hooks&&k.pmc.hooks.add_action("pmc_adm_dfp_direct_sold",O)})()})();; (()=>{var e,n;e=document,window.cnx||(window.cnx={},window.cnx.cmd=[],(n=e.createElement("iframe")).src="javascript:false",n.display="none",n.onload=function(){var e=n.contentWindow.document,t=e.createElement("script");t.src="//cd.connatix.com/connatix.player.js?cid=1ffe63de-eb53-11e9-b4d2-069",t.setAttribute("async","1"),t.setAttribute("type","text/javascript"),e.body.appendChild(t)},e.head.appendChild(n))})();; var pmcPiano;!function(){"use strict";var e={515:function(e,t,n){var a,o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,a=arguments.length;n .jw-state-playing"))||void 0===t?void 0:t.offsetHeight,i=null===(n=r.get(".live-event-banner > .banner-regular"))||void 0===n?void 0:n.offsetHeight;if(window.innerWidth<768){if(o>0)return a+o;if(i>0)return a+i}return a}();t.style.top="0",t.style.zIndex="2",t.style.transition="top 0.1s ease 0s";var o=(e.getBoundingClientRect().top<=a?Math.min(Math.max(0,window.scrollY+a-n),e.clientHeight-t.clientHeight):0)+(r.emailInputFocused?-150:0);t.style.position="absolute",t.style.top="".concat(o,"px")}))):setTimeout(r.setModal)},registerPostMessageListener:function(){window.addEventListener("message",(function(e){if(Object.values(r.postMessageTrustedOrigin).includes(e.origin)&&"string"==typeof e.type)if("piano_template_newsletter_close_button_clicked"===e.data.type){var t=r.get(r.targetElements.paywall);null==t||t.classList.remove(r.targetElements.paywallFade);var n=r.get(r.targetElements.overlay);null==n||n.classList.add("lrv-a-hidden")}else"piano_template_newsletter_email_input"===e.data.type?(r.emailInputFocused=e.data.focused,window.dispatchEvent(new Event("scroll",{bubbles:!0}))):"piano_template_newsletter_submit_button_clicked"===e.data.type?(i=e.data.brand,a=r.setupFormData(e),r.signupNewsLetter(a)):"piano_regwall_register_button_clicked"===e.data.type&&(i=e.data.brand,a=r.setupFormData(e),console.log("Data Stored for Registration",a))}))},registrationSuccess:function(e){var t=this;if("string"==typeof e.data){var n=void 0;try{n=JSON.parse(e.data)}catch(e){return t.canDebug&&console.warn("PMC: Piano: registration",e),console.warn("PMC: Piano: newsletter registration",e),!1}n.sender&&n.sender.startsWith("piano-id")&&"registrationSuccess"===n.event&&(t.canDebug&&console.log("PMC: Piano: newsletter registrationSuccess",e),console.log("PMC: Piano: newsletter registrationSuccess",e),a.set("EmailAddress",n.params.user.email),setTimeout(t.signupNewsLetter(a),1e3))}return!0},initialize:function(){!0!==r.initialized?(console.log("PMC: Piano: Initializing PMC Piano Newsletter Form"),!0===r.modal&&r.setModal(),r.registerPostMessageListener(),window.addEventListener("message",r.registrationSuccess.bind(r)),r.initialized=!0):r.canDebug&&console.log("PMC: Piano: PMC Piano Newsletter Form is already initialized")}};var r=t.pmcPianoNewsletterForm;e.exports=t.pmcPianoNewsletterForm},510:function(e,t,n){n.r(t)}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var i=t[a]={exports:{}};return e[a].call(i.exports,i,i.exports,n),i.exports}n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a=n(515);(pmcPiano=void 0===pmcPiano?{}:pmcPiano).newsletterForm=a}();;