(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[198],{2734:(e,t,n)=>{"use strict";n.d(t,{useTrackVideo:()=>m});var r=n(44749),i=n(51368),o=Object.defineProperty,s=(e,t,n)=>((e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class a{constructor(e=!0){s(this,"id",(0,i.A)()),s(this,"payload"),s(this,"store"),this.store=e}destroy(){this.store&&r.Pj.getState().removeEventBeacon(this.id),this.payload=void 0}updateData(e){let{eventBeacons:t}=r.Pj.getState();!t[this.id]&&this.store&&r.Pj.getState().addEventBeacon(this.id,this),this.payload=e}}var u=n(63815),l=n(71777),c=n(50210),d=Object.defineProperty,f=(e,t,n)=>((e,t,n)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class h{constructor(e){f(this,"adBreak"),f(this,"adContent"),f(this,"config"),f(this,"loggedMediaSessionEnd",!1),f(this,"loggedMediaSessionStart",!1),f(this,"_sessionId",(0,i.A)()),f(this,"currentAdPlaybackStartTimestamp"),f(this,"currentPlaybackStartTimestamp"),f(this,"currentPlayheadPosition"),f(this,"loggedAdStart",!1),f(this,"loggedProgressMap",{"Video 100% Complete":{logged:!1,value:.95},"Video 25% Complete":{logged:!1,value:.25},"Video 50% Complete":{logged:!1,value:.5},"Video 75% Complete":{logged:!1,value:.75}}),f(this,"loggedVideoPlayerImpression",!1),f(this,"maxPlayheadPosition"),f(this,"mediaContentComplete",!1),f(this,"mediaSessionAdObjects",[]),f(this,"mediaSessionAdTotal",0),f(this,"mediaSessionEndBeacon",new a),f(this,"mediaSessionEndTimestamp",performance.now()),f(this,"mediaSessionStartTimestamp",performance.now()),f(this,"minPlayheadPosition"),f(this,"storedAdPlaybackTime",0),f(this,"storedPlaybackTime",0),l.vF.verbose("starting new media session",{config:e,sessionId:this.sessionId}),this.config={...e,video_session_id:this.sessionId},this.mediaSessionStartTimestamp=performance.now(),this.currentPlayheadPosition=0,this.maxPlayheadPosition=0,this.minPlayheadPosition=Number.MAX_VALUE}get sessionId(){return this._sessionId}logAdEnd(){var e,t,n,r;null!=(e=this.adContent)&&e.ad_content_start_time&&(this.adContent.ad_content_end_time=performance.now(),this.adContent.ad_completed=!0,this.adContent.ad_skipped=!1),this.loggedAdStart=!1,this.updateStoredAdPlaybackTime(),this.currentAdPlaybackStartTimestamp=void 0;let i={custom_attributes:{...this.config,ad_duration:null==(t=this.adContent)?void 0:t.ad_duration,ad_id:null==(n=this.adContent)?void 0:n.ad_id,creative_id:null==(r=this.adContent)?void 0:r.ad_creative_id,playhead_position:this.mediaPlayheadPosition()},event_name:"Video Ad Viewed",event_type:"other"};this.logEvent(i)}logAdPause(){this.currentAdPlaybackStartTimestamp&&(this.updateStoredAdPlaybackTime(),this.currentAdPlaybackStartTimestamp=void 0)}logAdPlay(e,t){this.logPlayheadPosition(t),this.loggedMediaSessionStart||this.logMediaSessionStart(),!this.loggedAdStart&&e&&this.logAdStart(e),this.currentAdPlaybackStartTimestamp=performance.now()}logAdSkip(){var e;null!=(e=this.adContent)&&e.ad_content_start_time&&(this.adContent.ad_content_end_time=performance.now(),this.adContent.ad_skipped=!0,this.adContent.ad_completed=!1),this.loggedAdStart=!1,this.updateStoredAdPlaybackTime(),this.currentAdPlaybackStartTimestamp=void 0}logAdStart(e){this.loggedAdStart||(this.loggedAdStart=!0,this.mediaSessionAdTotal+=1,this.mediaSessionAdObjects.push(e.ad_id),this.adContent=e,this.adContent.ad_content_start_time=performance.now())}logMediaSessionEnd(){!this.loggedMediaSessionStart||this.loggedMediaSessionEnd||(this.loggedMediaSessionEnd=!0,this.mediaSessionEndTimestamp=performance.now(),this.updateMediaSessionEndBeacon(),this.mediaSessionEndBeacon.payload&&this.logEvent(this.mediaSessionEndBeacon.payload),this.mediaSessionEndBeacon.destroy())}logMediaSessionProgress(e){c.z.events.logEvent({custom_attributes:{...this.config,playhead_position:this.mediaPlayheadPosition()},event_name:e,event_type:"other"})}logMediaSessionStart(){if(this.loggedMediaSessionStart)return;this.loggedMediaSessionStart=!0,this.mediaSessionStartTimestamp=performance.now();let e={custom_attributes:{...this.config,playhead_position:this.mediaPlayheadPosition()},event_name:"Video View Started",event_type:"other"};this.logEvent(e)}logPause(){this.currentPlaybackStartTimestamp&&(this.updateStoredPlaybackTime(),this.currentPlaybackStartTimestamp=void 0),l.vF.verbose("Video Pause",{media_session_id:this.sessionId,playhead_position:this.mediaPlayheadPosition()})}logPlay(e){this.logPlayheadPosition(e),this.loggedMediaSessionStart||this.logMediaSessionStart(),this.currentPlaybackStartTimestamp||(this.currentPlaybackStartTimestamp=performance.now()),l.vF.verbose("Video Play",{media_session_id:this.sessionId,playhead_position:this.mediaPlayheadPosition()})}logPlayheadPosition(e){if(this.currentPlayheadPosition=e,this.currentPlayheadPosition&&this.currentPlayheadPosition>this.maxPlayheadPosition&&(this.maxPlayheadPosition=this.currentPlayheadPosition),this.currentPlayheadPosition&&this.currentPlayheadPositionr;i&&o&&!t&&("Video 100% Complete"===e&&(this.mediaContentComplete=!0),this.loggedProgressMap[e].logged=!0,this.logMediaSessionProgress(e))}this.updateMediaSessionEndBeacon()}logVideoPlayerImpression(){if(this.loggedVideoPlayerImpression)return;this.loggedVideoPlayerImpression=!0;let e={custom_attributes:{...this.config},event_name:"Video Player Impression",event_type:"other"};this.logEvent(e)}updateStoredAdPlaybackTime(){void 0!==this.currentAdPlaybackStartTimestamp&&(this.storedAdPlaybackTime=this.storedAdPlaybackTime+(performance.now()-this.currentAdPlaybackStartTimestamp)/1e3)}updateStoredPlaybackTime(){void 0!==this.currentPlaybackStartTimestamp&&(this.storedPlaybackTime=this.storedPlaybackTime+(performance.now()-this.currentPlaybackStartTimestamp)/1e3)}buildMediaSessionEndPayload(){return{custom_attributes:{...this.config,max_playhead_position:this.mediaMaxPlayheadPosition(),playhead_position:this.mediaPlayheadPosition(),total_ad_time:this.mediaAdTimeSpent(),total_ads_capacity:1+Math.floor(this.config.video_duration/120),total_ads_viewed:this.mediaSessionAdTotal,total_session_time:this.mediaTimeSpent(),total_watch_time:this.mediaContentTimeSpent(),video_completed:(0,u.$)(this.mediaContentComplete)},event_name:"Video View Ended",event_type:"other"}}logEvent(e){this.mediaSessionEndTimestamp=performance.now(),c.z.events.logEvent(e)}mediaAdTimeSpent(){return void 0!==this.currentAdPlaybackStartTimestamp?Math.floor(this.storedAdPlaybackTime+(performance.now()-this.currentAdPlaybackStartTimestamp)/1e3):Math.floor(this.storedAdPlaybackTime)}mediaContentTimeSpent(){return void 0!==this.currentPlaybackStartTimestamp?Math.floor(this.storedPlaybackTime+(performance.now()-this.currentPlaybackStartTimestamp)/1e3):Math.floor(this.storedPlaybackTime)}mediaMaxPlayheadPosition(){return Math.floor(this.maxPlayheadPosition)}mediaPlayheadPosition(){return Math.floor(this.currentPlayheadPosition)}mediaTimeSpent(){return Math.floor((this.mediaSessionEndTimestamp-this.mediaSessionStartTimestamp)/1e3)}updateMediaSessionEndBeacon(){this.mediaSessionEndBeacon.updateData(this.buildMediaSessionEndPayload())}}var p=n(12115),v=n(74194),g=n(97753);let m=e=>{let t=(0,p.useRef)(null),n=(0,v.v)(e,{threshold:.5}),{logMediaSessionEnd:r,startInactivityTimer:i,stopInactivityTimer:o}=(e=>{let t=(0,p.useRef)(null),n=(0,p.useCallback)(()=>{e.current&&e.current.logMediaSessionEnd()},[e]),r=(0,p.useCallback)(()=>{"visible"===document.visibilityState||n()},[n]),i=(0,p.useCallback)(()=>{null!==t.current&&window.clearInterval(t.current),t.current=null},[]),o=(0,p.useCallback)(()=>{let e=Date.now();t.current=window.setInterval(()=>{Date.now()-e>3e5&&(n(),i())},g.eO)},[n,i]);return(0,p.useEffect)(()=>(window.addEventListener("visibilitychange",r),window.addEventListener("pagehide",n),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("pagehide",n)}),[r,n]),{logMediaSessionEnd:n,startInactivityTimer:o,stopInactivityTimer:i}})(t),s=(0,p.useCallback)(()=>{t.current&&(t.current=new h(t.current.config))},[]),a=(0,p.useCallback)(()=>{if(!t.current||!e.current)return;t.current.loggedMediaSessionEnd&&s();let n=e.current.currentTime;t.current.logPlay(n),o()},[s,o,e]),l=(0,p.useCallback)(()=>{t.current&&(t.current.logPause(),i())},[i]),c=(0,p.useCallback)(()=>{t.current&&e.current&&t.current.logPlayheadPosition(e.current.currentTime)},[e]),d=(0,p.useCallback)(n=>{t.current&&e.current&&(t.current.loggedMediaSessionEnd&&s(),t.current.logAdPlay(n,e.current.currentTime),o())},[s,o,e]),f=(0,p.useCallback)(()=>{t.current&&(t.current.logAdPause(),i())},[i]),m=(0,p.useCallback)(()=>{t.current&&t.current.logAdEnd()},[]),y=(0,p.useCallback)(()=>{t.current&&t.current.logAdSkip()},[]),b=(0,p.useCallback)(e=>{t.current&&t.current.logMediaSessionEnd(),t.current=new h({video_casted:(0,u.$)(e.videoCasted),video_casted_device_id:e.videoCastedDeviceId,video_casted_device_model:e.videoCastedDeviceModel,video_casted_device_name:e.videoCastedDeviceName,video_casted_device_version:e.videoCastedDeviceVersion,video_casted_provider:e.videoCastedProvider,video_channel_name:e.videoChannelName,video_duration:e.videoDurationSeconds,video_episode_number:e.videoEpisodeNumber,video_id:e.videoId,video_publication_date:e.videoPublicationDate,video_season_name:e.videoSeasonName,video_show_id:e.videoShowId,video_show_name:e.videoShowName,video_source:e.videoSource,video_tags:e.videoTags,video_title:e.videoTitle,video_type:e.videoType})},[]);return(0,p.useEffect)(()=>{t.current&&n&&t.current.logVideoPlayerImpression()},[n]),{logAdEnd:m,logAdPause:f,logAdPlay:d,logAdSkip:y,logEnd:r,logLoadStart:b,logPause:l,logPlay:a,logTimeUpdate:c}}},3978:(e,t,n)=>{"use strict";n.d(t,{TrackImpressionClient:()=>c});var r=n(95155),i=n(97753),o=n(74194),s=n(44749),a=n(71777),u=n(12115),l=n(50210);let c=e=>{let{children:t,rootMargin:n="-50px",...c}=e,d=(0,u.useRef)(null),f=(0,o.v)(d,{rootMargin:n}),h=(0,s.Pj)(e=>e.pageViews),{[i.qD.contentImpressionId]:p,[i.qD.contentImpressionVariant]:v}=c;return(0,u.useEffect)(()=>{try{f&&l.z.events.logContentImpression(p,v)}catch(e){a.vF.error(e)}},[p,f,v,h]),(0,r.jsx)("div",{ref:d,...c,children:t})}},5260:(e,t,n)=>{"use strict";n.d(t,{p:()=>s,m:()=>o});var r=n(97753),i=n(63815);let o=()=>Array.from(document.querySelectorAll(`[${r.qD.contentImpressionId}]`)).reduce((e,t)=>{let n=t.getAttribute(r.qD.contentImpressionId);return n?{...e,[`${n.toLowerCase().replace(/-/g,"_")}_present`]:(0,i.$)(!0)}:e},{}),s=e=>Object.entries(e).reduce((e,[t,{variant:n,viewed:r=!1}])=>({...e,[`${t}_type`]:n,[`${t}_viewed`]:(0,i.$)(r)}),{})},6119:(e,t,n)=>{"use strict";n.d(t,{I:()=>i,r:()=>r});let r=e=>{if(!(e.target instanceof Element))return;let t=e.target instanceof HTMLElement?e.target:e.target.parentElement;for(;t;){let e=t.getAttribute("data-id"),n=t.getAttribute("data-parent");if(e&&n)return t;t=t.parentElement}},i=e=>{let t,n=["data-nitrous-element-id","data-id","data-cy","data-testid","data-vars-cta","data-vars-ga-call-to-action","id","aria-label"].find(t=>!!e.getAttribute(t));return n&&(t=e.getAttribute(n)||void 0),{element_id:t,element_id_attribute_name:n}}},12500:(e,t,n)=>{"use strict";n.d(t,{s:()=>r});let r=e=>e.split(/\s+/).filter(e=>e.length>0).length},13492:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});let r=(e,t={async:!0})=>new Promise((n,r)=>{let i=document.createElement("script");document.getElementsByTagName("head")[0].appendChild(i),i.onload=()=>n(),i.onerror=()=>r(),Object.keys(t).forEach(e=>{let n=t[e];if("boolean"==typeof n){if(!n)return;i.setAttribute(e,e);return}i.setAttribute(e,n)}),i.src=e})},29652:(e,t,n)=>{"use strict";n.d(t,{TrackPage:()=>e8});var r,i,o,s,a,u=n(44749),l=-1,c=function(e){addEventListener("pageshow",function(t){t.persisted&&(l=t.timeStamp,e(t))},!0)},d=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart=0?r="back-forward-cache":n&&(document.prerendering||f()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(0x82f79cd8fff*Math.random())+1e12),navigationType:r}},p=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},v=function(e,t,n,r){var i,o;return function(s){var a;t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,a=t.value,t.rating=a>n[1]?"poor":a>n[0]?"needs-improvement":"good",e(t))}},g=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},m=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},y=function(e){var t=!1;return function(){t||(e(),t=!0)}},b=-1,_=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},w=function(e){"hidden"===document.visibilityState&&b>-1&&(b="visibilitychange"===e.type?e.timeStamp:0,S())},E=function(){addEventListener("visibilitychange",w,!0),addEventListener("prerenderingchange",w,!0)},S=function(){removeEventListener("visibilitychange",w,!0),removeEventListener("prerenderingchange",w,!0)},T=function(){return b<0&&(b=_(),E(),c(function(){setTimeout(function(){b=_(),E()},0)})),{get firstHiddenTime(){return b}}},P=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},I=[1800,3e3],A=function(e,t){t=t||{},P(function(){var n,r=T(),i=h("FCP"),o=p("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTimer.value&&(r.value=i,r.entries=o,n())},a=p("layout-shift",s);a&&(n=v(e,r,k,t.reportAllChanges),m(function(){s(a.takeRecords()),n(!0)}),c(function(){i=0,n=v(e,r=h("CLS",0),k,t.reportAllChanges),g(function(){return n()})}),setTimeout(n,0))}))},O=0,x=1/0,R=0,N=function(e){e.forEach(function(e){e.interactionId&&(x=Math.min(x,e.interactionId),O=(R=Math.max(R,e.interactionId))?(R-x)/7+1:0)})},L=function(){return r?O:performance.interactionCount||0},U=function(){"interactionCount"in performance||r||(r=p("event",N,{type:"event",buffered:!0,durationThreshold:0}))},D=[],M=new Map,F=0,j=function(){var e=Math.min(D.length-1,Math.floor((L()-F)/50));return D[e]},H=[],q=function(e){if(H.forEach(function(t){return t(e)}),e.interactionId||"first-input"===e.entryType){var t=D[D.length-1],n=M.get(e.interactionId);if(n||D.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};M.set(r.id,r),D.push(r)}D.sort(function(e,t){return t.latency-e.latency}),D.length>10&&D.splice(10).forEach(function(e){return M.delete(e.id)})}}},V=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=y(e),"hidden"===document.visibilityState?e():(n=t(e),m(e)),n},z=[200,500],$=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},P(function(){U();var n,r,i=h("INP"),o=function(e){V(function(){e.forEach(q);var t=j();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())})},s=p("event",o,{durationThreshold:null!=(n=t.durationThreshold)?n:40});r=v(e,i,z,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),m(function(){o(s.takeRecords()),r(!0)}),c(function(){F=L(),D.length=0,M.clear(),r=v(e,i=h("INP"),z,t.reportAllChanges)}))}))},Y=[2500,4e3],B={},J=function(e,t){t=t||{},P(function(){var n,r=T(),i=h("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach(function(e){e.startTime=0&&o1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?(t=function(){Z(i,e),r()},n=function(){r()},r=function(){removeEventListener("pointerup",t,X),removeEventListener("pointercancel",n,X)},addEventListener("pointerup",t,X),addEventListener("pointercancel",n,X)):Z(i,e)}},en=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,et,X)})},er=[100,300],ei=function(e,t){t=t||{},P(function(){var n,r=T(),s=h("FID"),u=function(e){e.startTime{e(e=>{let t=eo[e.name];u.Pj.setState(n=>({coreWebVitalsPayload:{...n.coreWebVitalsPayload,[t]:e.value}}))},{reportAllChanges:e===$||e===C})})}}var ea=n(97753),eu=n(50210),el=n(71777);let ec=()=>{try{if(typeof window>"u")throw Error("cannot access window in a server side environment");return window.nitrous||(window.nitrous={}),window.nitrous}catch(e){el.vF.error(e)}return{}};var ed=n(67340),ef=n(40605),eh=Object.defineProperty,ep=(e,t,n)=>((e,t,n)=>t in e?eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let ev=e=>{let t=Array.from(new FormData(e).entries()).reduce((e,[t,n])=>{let r=t.replace(/[^A-Za-z0-9_]/g,"").toLowerCase();return{...e,[r]:[...e[r]||[],n.toString()]}},{}),n=Object.entries(t).reduce((e,[t,n])=>({...e,[`filter_${t}`]:(0,ed.yp)(n.join(","))}),{}),r=e.getAttribute(ea.qD.formEventName)||e.name||"Form Submitted";eu.z.events.logEvent({custom_attributes:n,event_name:r,event_type:"other"}),ey(e,t)},eg=e=>{let{target:t}=e;t instanceof HTMLFormElement&&ev(t)};class em{constructor(){ep(this,"forms",[]),ep(this,"formSubmitQueue",{}),this.handleFormChange=this.handleFormChange.bind(this)}destroy(){window.removeEventListener("submit",eg,!0),window.removeEventListener("nitrousformchange",this.handleFormChange)}handleFormChange(e){var t,n;let r=null==(n=null==(t=e.detail)?void 0:t.target)?void 0:n.form;if(!(r instanceof HTMLFormElement)||!(r.name||r.id)||Array.from(r.elements).find(e=>"submit"===e.getAttribute("type")))return;this.formSubmitQueue[r.name]&&window.clearTimeout(this.formSubmitQueue[r.name]);let i=window.setTimeout(()=>{ev(r)},1e3);this.formSubmitQueue[r.name]=i}init(){window.addEventListener("nitrousformchange",this.handleFormChange),window.addEventListener("submit",eg,!0),ec().initializedFormTracking||((()=>{for(let{elementClass:e,props:t}of[{elementClass:HTMLInputElement,props:["checked","value"]},{elementClass:HTMLSelectElement,props:["value"]},{elementClass:HTMLTextAreaElement,props:["value"]}])for(let n of t){let t=Object.getOwnPropertyDescriptor(e.prototype,n);Object.defineProperty(e.prototype,n,{set(e){var r;this[n]!==e&&window.dispatchEvent(new CustomEvent("nitrousformchange",{detail:{prevValue:this[n],target:this}})),null==(r=null==t?void 0:t.set)||r.call(this,e)}})}})(),ec().initializedFormTracking=!0)}}let ey=(e,t)=>{let n=Object.entries(t).find(([e])=>e.includes("email"));if(n){let e=(0,ed.wj)(n[1][0]);if(e)return void ef.do(e)}let r=Array.from(e.elements).find(e=>{var t,n;return null==(n=null==(t=e.getAttribute("autocomplete"))?void 0:t.toLowerCase())?void 0:n.includes("email")});if(r&&r instanceof HTMLInputElement){let e=(0,ed.wj)(r.value||"");if(e)return void ef.do(e)}};var eb=n(82468);let e_=["Global DNS","Do Not Sell My Information"],ew=e=>{if(!e.origin.includes("onetrust"))return;let t=null;try{let{requestTypes:n}=JSON.parse(e.data);if(!n||!Array.isArray(n))throw Error("'requestTypes' is not an array");t=n}catch(e){el.vF.error("failed to parse onetrust webform submission data",e);return}if(e_.some(e=>t.includes(e))){let e=eb.A.Identity.getCurrentUser(),t=eb.A.Consent.createConsentState(),n=eb.A.Consent.createCCPAConsent(!0,Date.now(),"","","");t.setCCPAConsentState(n),e.setConsentState(t),eu.z.events.logEvent({custom_attributes:{},event_name:"Do Not Sell",event_type:"other"})}};class eE{destroy(){window.removeEventListener("message",ew)}init(){window.addEventListener("message",ew)}}var eS=n(50657);let eT=["marketing_channel","marketing_channel_rollup","marketing_type","utm_campaign","utm_content","utm_id","utm_medium","utm_source","utm_term","utm_type"],eP=()=>{window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(()=>{var e;let t=eu.z.user.getMtid();t&&(googletag.pubads().setPublisherProvidedId(t),googletag.pubads().setTargeting("mtid",t));let{pageId:n}=u.Pj.getState();n&&googletag.pubads().setTargeting("pageId",n);let r=(0,eS.M)(u.Pj.getState().hasTrackedMarketingChannelPayload),i=(null==(e=eu.z.user.getUser())?void 0:e.userAttributes)||{};eT.forEach(e=>{let t=(r??i)[e];"string"==typeof t&&t&&googletag.pubads().setTargeting(e,t)})})},eI=e=>{var t,n;let r=(null==e?void 0:e.slot)||{},i=null==(t=null==r?void 0:r.getSlotElementId)?void 0:t.call(r),o=null==(n=null==r?void 0:r.getAdUnitPath)?void 0:n.call(r);eu.z.events.logAdEvent("impression_viewable",{adPath:o,slotId:i},r)},eA=e=>{var t,n,r;let i=(null==e?void 0:e.slot)||{},o=null==(t=null==i?void 0:i.getSlotElementId)?void 0:t.call(i),s=null==(n=null==i?void 0:i.getAdUnitPath)?void 0:n.call(i),a=null==(r=i.getTargeting("refreshtype"))?void 0:r[0];if(a&&"none"!==a){let e=`ads_impressions_${a}`;u.Pj.setState(t=>({adsRefreshPayload:{...t.adsRefreshPayload,[e]:(t.adsRefreshPayload[e]||0)+1}}))}eu.z.events.logAdEvent("impression",{adPath:s,slotId:o},i)},ek=e=>{var t,n;if(!e.isEmpty){let r=(null==e?void 0:e.slot)||{},i=null==(t=null==r?void 0:r.getSlotElementId)?void 0:t.call(r),o=null==(n=null==r?void 0:r.getAdUnitPath)?void 0:n.call(r);eu.z.events.logAdEvent("rendered",{adPath:o,isBackfill:e.isBackfill,...e.size&&{size:Array.isArray(e.size)?JSON.stringify(e.size):e.size},slotId:i},r)}},eC=e=>{var t,n;let r=(null==e?void 0:e.slot)||{},i=null==(t=null==r?void 0:r.getSlotElementId)?void 0:t.call(r),o=null==(n=null==r?void 0:r.getAdUnitPath)?void 0:n.call(r);eu.z.events.logAdEvent("requested",{adPath:o,slotId:i},r)},eO=e=>{var t,n,r;let i=(null==e?void 0:e.slot)||{},o=null==(t=null==i?void 0:i.getSlotElementId)?void 0:t.call(i),s=null==(n=null==i?void 0:i.getAdUnitPath)?void 0:n.call(i),{advertiserId:a,campaignId:u,creativeId:l,creativeTemplateId:c,lineItemId:d}=(null==(r=null==e?void 0:e.slot)?void 0:r.getResponseInformation())||{};eu.z.events.logAdEvent("responded",{adPath:s,advertiserId:null==a?void 0:a.toString(),campaignId:null==u?void 0:u.toString(),creativeId:null==l?void 0:l.toString(),creativeTemplateId:null==c?void 0:c.toString(),lineItemId:null==d?void 0:d.toString(),slotId:o},i)};var ex=n(13492),eR=n(6119);let eN=e=>{if(!e)return"";let t="",n=e;for(;null!=n&&"#document"!==n.nodeName;){let e=n,r=0;for(;null!==e.previousElementSibling&&void 0!==e;)r+=1,e=e.previousElementSibling;let i=(n.nodeName||"").toLowerCase(),o="";if("body"===i||"html"===i||"head"===i||"document"===i||"header"===i||"footer"===i)o=i;else{if(o=i,n.id)o+=eL(`#${n.id}`);else if(n.getAttribute("data-id"))o+=eL(`[data-id="${n.getAttribute("data-id")}"]`);else if(n.className&&"string"==typeof n.className){let e=n.className.toString().split(" ")[0];e&&(o+=eL(`.${e}`))}0!==r&&(o+=`:nth-child(${r+1})`)}t=`${o}${t?" > ":""}${t}`,n=n.parentElement}return t},eL=e=>e.replace(/:/g,"\\:"),eU=e=>{try{"number"==typeof e.screenX&&"number"==typeof e.screenY&&u.Pj.getState().addClickPosition({x:Math.round(e.screenX+window.scrollX),y:Math.round(e.screenY+window.scrollY)});let t=(0,eR.r)(e),n=null==t?void 0:t.getAttribute("data-id"),r=null==t?void 0:t.getAttribute("data-parent"),i=null==t?void 0:t.getAttribute("href");if(!t||!n||!r)return;let o=t.getAttribute(ea.qD.position)??Array.from(document.querySelectorAll(`[data-id="${n}"][data-parent="${r}"]`)).findIndex(e=>e===t)+1;eu.z.events.logClick({attributes:Array.from(t.attributes||[]).reduce((e,t)=>{if(t.name.startsWith(ea.qD.prefix)){let n=t.name.replace(ea.qD.prefix,"").replace(/-/g,"_");return{...e,[n]:t.value}}return e},{}),...i&&{elementLink:i},dataId:n,dataParent:r,dataPosition:`${o}`,elementContent:t.innerText,elementPath:eN(t)})}catch(e){el.vF.error(e)}},eD=e=>{eU(e)},eM=(e,t=ea.eO)=>{let n=-1/0;return function(...r){Date.now()-n>=t&&(e(...r),n=Date.now())}},eF=eM(e=>{if((0,eR.r)(e)||!e.target||!(e.target instanceof Element))return;let t=e.target instanceof HTMLElement?e.target:e.target.parentElement;if(!t||ej(t))return;let{element_id:n}=(0,eR.I)(t),r=t.getAttribute("data-nitrous-element-name")||t.getAttribute("aria-label")||"Unclassified",i=t.getAttribute("data-parent");eu.z.events.logEvent({custom_attributes:{element_content:t.innerText,element_id:n,element_name:r,element_parent:i,element_path:eN(t),element_x:Math.round(e.screenX+window.scrollX),element_y:Math.round(e.screenY+window.scrollY)},event_name:"Dead Click",event_type:"other"})},1e3),ej=e=>["onclick","onauxclick","onpointerdown","onmousedown","onmouseup","ontouchstart","ontouchend","ontouchcancel","ondblclick","onmouseenter","onmouseleave","onmouseover","onmouseout","onkeypress","onkeydown","onkeyup","oncontextmenu","onselect","oninput","oncopy","oncut","onpaste","onfocus"].find(t=>(null==e?void 0:e[t])!==null&&(null==e?void 0:e[t])!==void 0),eH=[],eq,eV=e=>{if(!e.target||!(e.target instanceof Element))return;let t=e.target instanceof HTMLElement?e.target:e.target.parentElement;if(t){let e=eH[eH.length-1];t===(null==e?void 0:e.element)||(eH=[],window.clearTimeout(eq),window.setTimeout(()=>{if(eH.length>=4){let e=eH[eH.length-1],{element_id:n}=(0,eR.I)(e.element),r=t.getAttribute("data-nitrous-element-name")||t.getAttribute("aria-label")||"Unclassified",i=t.getAttribute("data-parent");eu.z.events.logEvent({custom_attributes:{element_click_count:eH.length,element_content:e.element.innerText,element_id:n,element_link:t.getAttribute("href"),element_name:r,element_parent:i,element_path:eN(e.element)},event_name:"Rage Click",event_type:"other"})}eH=[]},1500)),eH.push({element:t,time:Date.now()})}},ez=e=>{try{let{eventBeacons:t}=u.Pj.getState();el.vF.verbose("flushing event beacons"),Object.entries(t).forEach(([n,r])=>{if(!(null!=e&&e.includes(n))){let{payload:e}=r;e&&(eu.z.events.logEvent(e),t[n].destroy())}})}catch(e){el.vF.error(e)}};var e$=n(40652);let eY="";var eB=n(63815);let eJ=e=>{let{bottom:t,left:n,right:r,top:i,x:o,y:s}=e.getBoundingClientRect();return{bottom:window.scrollY+t,left:window.scrollX+n,right:window.scrollX+r,top:window.scrollY+i,x:window.scrollX+o,y:window.scrollY+s}};var eW=n(12500);let eK=(e,t,n)=>Math.max(0,Math.min((e-t)/(n-t),1))||0,eQ=(e,t)=>parseFloat(e.toFixed(t));var eX=n(5260),eG=n(51368),eZ=Object.defineProperty,e0=(e,t,n)=>((e,t,n)=>t in e?eZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class e1{constructor(e){e0(this,"inactivityInterval"),e0(this,"initializedAt",new Date),e0(this,"isInactive",!1),e0(this,"isInitialized",!1),e0(this,"lastActiveAtMs",performance.now()),e0(this,"lastMeasuredActivityAtMs",-1),e0(this,"loggedPageViewAt",performance.now()),e0(this,"payload"),e0(this,"removeEventListeners"),e0(this,"shouldLogPageView",!0),e0(this,"shouldLogUes",!1),this.payload=e}addEventListeners(){var e;let t=()=>{let e=performance.now();this.lastActiveAtMs=e,this.isInactive&&(this.isInactive=!1,this.logPageView())},n=eM(t),r=(null==(e=u.Pj.getState().config)?void 0:e.inactivityTimeoutMs)||ea.sb.inactivityTimeoutMs;this.inactivityInterval=window.setInterval(async()=>{let e=performance.now(),t=e-this.lastActiveAtMs;this.lastMeasuredActivityAtMs=e,t>r&&(this.isInactive=!0,this.logUes())},ea.eO);let i=()=>{"visible"===document.visibilityState?(this.logPageView(),t()):this.logUes()},o=()=>{this.logUes()},s=()=>{this.logUes(),ez()},a=()=>{this.logUes(),ez()};window.nitrousListeningHistory||(window.nitrousListeningHistory=!0,window.addEventListener("popstate",()=>{let e=(0,e$.l2)(window.location.href,window.location.origin);eY!==e&&(el.vF.debug("detected page change",{nextUrl:e,prevUrl:eY}),eY=e,window.dispatchEvent(new Event("clientnavigation")))}),["pushState","replaceState"].forEach(e=>{var t,n,r;t=window.history,n=e,r=(...e)=>{let t=(0,e$.l2)(e[2]||window.location.href,window.location.origin);eY!==t&&(el.vF.debug("detected page change",{nextUrl:t,prevUrl:eY}),eY=t,window.dispatchEvent(new Event("clientnavigation")))},t[n]=new Proxy(t[n],{apply:(e,t,n)=>(r.apply(t,n),e.apply(t,n))})})),document.addEventListener("visibilitychange",i,{passive:!0}),window.addEventListener("pagehide",o,{passive:!0}),window.addEventListener("beforeunload",s,{passive:!0}),document.addEventListener("mousemove",n,{passive:!0}),document.addEventListener("keyup",n,{passive:!0}),document.addEventListener("touchstart",n,{passive:!0}),window.addEventListener("scroll",n,{passive:!0}),window.addEventListener("clientnavigation",a),this.removeEventListeners=()=>{window.clearInterval(this.inactivityInterval),document.removeEventListener("visibilitychange",i),window.removeEventListener("pagehide",o),window.removeEventListener("beforeunload",s),document.removeEventListener("mousemove",n),document.removeEventListener("keyup",n),document.removeEventListener("touchstart",n),window.removeEventListener("scroll",n),window.removeEventListener("clientnavigation",a)}}destroy(){window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(()=>{googletag.pubads().removeEventListener("slotRequested",eC),googletag.pubads().removeEventListener("slotResponseReceived",eO),googletag.pubads().removeEventListener("slotRenderEnded",ek),googletag.pubads().removeEventListener("slotOnload",eA),googletag.pubads().removeEventListener("impressionViewable",eI)}),window.removeEventListener("click",eU),window.removeEventListener("contextmenu",eD),window.removeEventListener("pointerdown",eF,!0),window.removeEventListener("pointerdown",eV),this.removeEventListeners&&this.removeEventListeners()}init(){try{this.isInitialized||(()=>{el.vF.verbose("resetting store");let{resetAdsSlice:e,resetEventsSlice:t,resetUesSlice:n}=u.Pj.getState();t(),n(),e()})(),eP(),window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(()=>{googletag.pubads().addEventListener("slotRequested",eC),googletag.pubads().addEventListener("slotResponseReceived",eO),googletag.pubads().addEventListener("slotRenderEnded",ek),googletag.pubads().addEventListener("slotOnload",eA),googletag.pubads().addEventListener("impressionViewable",eI)}),(0,ex.k)("https://nitrous-analytics.s3.amazonaws.com/gpt.js"),u.Pj.setState({pageLoadTimeMs:Date.now()}),this.addEventListeners(),this.logPageView(),window.addEventListener("click",eU),window.addEventListener("contextmenu",eD),window.addEventListener("pointerdown",eF,!0),window.addEventListener("pointerdown",eV)}catch(e){el.vF.error(e)}this.isInitialized=!0}logPageView(){try{if(!this.shouldLogPageView||!this.payload)return;eu.z.events.logPageView(this.payload),this.loggedPageViewAt=performance.now(),this.shouldLogPageView=!1,this.shouldLogUes=!0}catch(e){el.vF.error(e)}}logUes(){try{if(!this.shouldLogUes)return;let e=Math.floor((performance.now()-this.loggedPageViewAt)/1e3)||0;e>3600&&console.error("nitrous: viewDuration > 3600",{initializedAtUtc:this.initializedAt.toUTCString(),lastActiveAtMs:this.lastActiveAtMs,lastMeasuredActivityAtMs:this.lastMeasuredActivityAtMs,loggedPageViewAtMs:this.loggedPageViewAt,nowMs:performance.now(),nowUtc:new Date().toUTCString(),viewDuration:e}),e>1e6&&(e=0),eu.z.events.logUserEngagementSummary((e=>{var t,n;let{ads:r,adsRefreshPayload:i,clickPositions:o,commentsPosted:s,contentSectionsViewed:a,coreWebVitalsPayload:l,impressions:c,maxScrollTop:d,resourcePerformance:f,scrollBucketData:h,scrollStartTimeMs:p}=u.Pj.getState(),v=Array.from(document.querySelectorAll(`[${ea.qD.contentSection}]`)||[]).filter(e=>e.checkVisibility({checkVisibilityCSS:!0})),g=1,m=1,y=1;v.length>0&&(g=v.length,y=eQ((m=a||1)/g||0,4));let b=document.documentElement.scrollHeight||0,_=document.documentElement.scrollWidth||0,w=Math.min(Math.floor(document.documentElement.clientHeight+(d||document.documentElement.scrollTop)),b),E=eQ(w/b,2)||0,S=JSON.stringify({d:o,w:_}),T=h?JSON.stringify({d:h,h:ea.xV}):void 0,P=Object.values(r).length,I=Object.values(r).reduce((e,t)=>e+t.timeline.filter(e=>"requested"===e.type).length,0),A=Object.values(r).reduce((e,t)=>e+t.timeline.filter(e=>"responded"===e.type).length,0),k=Object.values(r).reduce((e,t)=>e+t.timeline.filter(e=>"impression"===e.type).length,0),C=Object.values(r).reduce((e,t)=>e+t.timeline.filter(e=>"rendered"===e.type).length,0),O=Object.values(r).reduce((e,t)=>e+t.timeline.filter(e=>"impression_viewable"===e.type).length,0),x=Object.values(r).map(e=>{var t;return null==(t=e.timeline.find(e=>"requested"===e.type&&e.timestampMs<(p||1/0)))?void 0:t.elapsedTimeMs}).filter(e=>void 0!==e).reduce((e,t,n,r)=>e+t/r.length,0),R=Object.values(r).map(e=>{var t;return null==(t=e.timeline.find(e=>"responded"===e.type))?void 0:t.elapsedTimeMs}).filter(e=>void 0!==e).reduce((e,t,n,r)=>e+t/r.length,0),N=Object.values(r).map(e=>{var t;return null==(t=e.timeline.find(e=>"rendered"===e.type))?void 0:t.elapsedTimeMs}).filter(e=>void 0!==e).reduce((e,t,n,r)=>e+t/r.length,0),L=Object.values(r).map(e=>{var t;return null==(t=e.timeline.find(e=>"requested"===e.type))?void 0:t.elapsedTimeMs}).filter(e=>void 0!==e),U=L.length>0?Math.round(Math.min(...L)):0,D=!Object.values(r).flatMap(e=>e.timeline).find(e=>"queued"===e.type),M=!!(null!=(t=window.googletag)&&t._loaded_),F=!!(null!=(n=window.googletag)&&n.apiReady),j=!0===window.nitrousAnb,H=(0,eB.$)(!j),q=Object.entries(f).reduce((e,[t,n])=>({...e,[`${t}_load_time`]:n.loadTime,[`${t}_status`]:n.status}),{}),{content_word_count:V,content_words_per_minute:z,content_words_viewed:$,scroll_percentage_article:Y}=((e,t)=>{let n,r,i=document.querySelector(`[${ea.qD.contentReadable}]`),o=Array.from(document.querySelectorAll(`[${ea.qD.contentReadableSection}]`));if(o.length<=0)return{};let{contentWordCount:s,contentWordsViewed:a}=o.reduce((e,n)=>{if(!(n instanceof HTMLElement))return e;let r=(0,eW.s)(n.innerText),{bottom:i,top:o}=eJ(n),s=Math.floor(r*eK(t,o,i));return{contentWordCount:e.contentWordCount+r,contentWordsViewed:e.contentWordsViewed+s}},{contentWordCount:0,contentWordsViewed:0});if(0===s)return{};i?{bottom:n,top:r}=eJ(i):({top:r}=eJ(o[0]),{bottom:n}=eJ(o[o.length-1]));let u=eQ(eK(t,r,n),2);return{content_word_count:s,content_words_per_minute:e?eQ(Math.min(300,a/e*60),2):0,content_words_viewed:0===e?0:Math.min(a,s),scroll_percentage_article:u}})(e,w);return{custom_attributes:{...Array.from(document.querySelectorAll(`[${ea.qD.form}]`)).reduce((e,t)=>{try{return{...e,...JSON.parse(t.innerHTML)}}catch{}return e},{}),...(0,eX.m)(),...(0,eX.p)(c),...q,...i,...l,ad_blocker_enabled:H,ads_first_request_time:U,ads_gpt_loaded:M,ads_impl_loaded:F,ads_impressed:k,ads_impressed_viewable:O,ads_queue_empty:D,ads_rendered:C,ads_rendered_in_avg:Math.round(N),ads_requested:I,ads_requested_in_avg:Math.round(x),ads_responded:A,ads_responded_in_avg:Math.round(R),ads_total_slots:P,attention_data:T,click_data:S,comments_posted:s,content_sections_total:g,content_sections_viewed:m,content_sections_viewed_percent:y,content_word_count:V,content_words_per_minute:z,content_words_viewed:$,event_group:"Engagement",event_name:"User Engagement Summary",scroll_depth:w,scroll_percentage:E,scroll_percentage_article:Y,view_duration:e,view_height:b},event_name:"User Engagement Summary",event_type:"other"}})(e)),u.Pj.setState({pageId:(0,eG.A)()}),eP(),this.shouldLogPageView=!0,this.shouldLogUes=!1}catch(e){el.vF.error(e)}}}var e2=Object.defineProperty,e4=(e,t,n)=>((e,t,n)=>t in e?e2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class e3{constructor(e){e4(this,"po"),e4(this,"trackResourceConfig"),this.trackResourceConfig=e}destroy(){var e;try{null==(e=this.po)||e.disconnect(),this.po=void 0}catch(e){el.vF.error(e)}}init(){try{if(this.po)return;this.po=new PerformanceObserver(e=>{let t=e.getEntries().reduce((e,t)=>{let n=this.trackResourceConfig.find(e=>t.name.includes(e.matches));if(!n)return e;let{duration:r,responseStatus:i}=t;return{...e,[n.id]:{loadTime:Math.floor(r),status:null==i?void 0:i.toString()}}},{});u.Pj.getState().updateResourcePerformance(t)}),this.po.observe({buffered:!0,type:"resource"})}catch(e){el.vF.error(e)}}}let e5=()=>{let{currScrollTop:e,lastScrolledAt:t,maxScrollTop:n}=u.Pj.getState(),{scrollTop:r}=document.documentElement;(!n||r>n)&&u.Pj.getState().setMaxScrollTop(scrollY);let i=Math.round(Math.min((new Date().getTime()-t)/1e3,30)),o=Math.floor(e/ea.xV),s=Math.floor((e+document.documentElement.scrollHeight)/ea.xV);u.Pj.getState().incrementScrollBucket(o,s,i),u.Pj.setState({currScrollTop:r,lastScrolledAt:new Date().getTime()})};class e6{destroy(){window.removeEventListener("scrollend",e5)}init(){window.addEventListener("scrollend",e5)}}var e7=n(12115);let e8=e=>{let{payload:t}=e,n=(0,e7.useRef)(new e1(t)),r=(0,e7.useRef)(new e3([{id:"ads_gpt",matches:"https://securepubads.g.doubleclick.net/tag/js/gpt.js"},{id:"ads_impl",matches:"pubads_impl.js"}])),i=(0,e7.useRef)(new e6),o=(0,e7.useRef)(new em),s=(0,e7.useRef)(new es),a=(0,e7.useRef)(new eE);return(0,e7.useEffect)(()=>{let e=n.current,t=r.current,u=i.current,l=o.current,c=s.current,d=a.current,f=()=>{e.init(),t.init(),u.init(),l.init(),c.init(),d.init()};return eu.z.initialized?f():window.addEventListener("nitrousinitialized",f),()=>{e.destroy(),t.destroy(),u.destroy(),l.destroy(),c.destroy(),d.destroy()}},[]),null}},36491:(e,t,n)=>{"use strict";n.d(t,{$:()=>r});let r=(e,t)=>`${e||""}-${t||""}`},37264:(e,t,n)=>{"use strict";n.d(t,{Se:()=>u,T$:()=>a});var r,i=n(39249),o=n(86915),s=n(70762),a=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,i.Cl)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(r.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(r.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(r.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(r.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(r.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(r.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(r.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(r.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(r.UNSET,e,o.mG),this},e.prototype.clearAll=function(){return this._properties={},this._properties[r.CLEAR_ALL]=o.mG,this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return!(void 0!==this._properties[r.CLEAR_ALL]||this._propertySet.has(t))&&(e===r.ADD?"number"==typeof n:e===r.UNSET||e===r.REMOVE||(0,s.E)(t,n))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(r||(r={}));var u=[r.CLEAR_ALL,r.UNSET,r.SET,r.SET_ONCE,r.ADD,r.APPEND,r.PREPEND,r.PREINSERT,r.POSTINSERT,r.REMOVE]},37450:(e,t,n)=>{"use strict";n.d(t,{Sc:()=>a});var r=n(71777),i=Object.defineProperty,o=(e,t,n)=>((e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class s{constructor(e,t){o(this,"initialState"),o(this,"persistConfig"),o(this,"state"),this.persistConfig=t,this.initialState=e,this.state=e}getState(){if(void 0===localStorage)return r.vF.warn("failed to get state: localStorage is undefined"),this.initialState;let e=JSON.parse(localStorage.getItem(this.persistConfig.name)||"{}");return{...this.state,...e}}setState(e){let t;if(void 0===localStorage)return void r.vF.warn("failed to set state: localStorage is undefined");let n=this.getState();t="function"==typeof e?e(n):e;let i={...n,...t};this.state=i,localStorage.setItem(this.persistConfig.name,JSON.stringify(this.persistConfig.persist(this.state)))}}let a=new s({chatbotTotalClicks:0,viewCount:0},{name:"nitrous-store",persist:e=>({viewCount:e.viewCount})})},38603:(e,t,n)=>{var r,i=n(49509);!function(){"use strict";var t="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_MD5_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self,u=!s.JS_MD5_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node;u?s=n.g:a&&(s=self);var l,c=!s.JS_MD5_NO_COMMON_JS&&e.exports,d=n.amdO,f=!s.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),p=[128,32768,8388608,-0x80000000],v=[0,8,16,24],g=["hex","array","digest","buffer","arrayBuffer","base64"],m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),y=[];if(f){var b=new ArrayBuffer(68);l=new Uint8Array(b),y=new Uint32Array(b)}var _=Array.isArray;(s.JS_MD5_NO_NODE_JS||!_)&&(_=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var w=ArrayBuffer.isView;f&&(s.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!w)&&(w=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var E=function(e){var n=typeof e;if("string"===n)return[e,!0];if("object"!==n||null===e)throw Error(t);if(f&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!_(e)&&!w(e))throw Error(t);return[e,!1]},S=function(e){return function(t){return new I(!0).update(t)[e]()}},T=function(e){var r,i=n(18535),o=n(76274).Buffer;return r=o.from&&!s.JS_MD5_NO_BUFFER_FROM?o.from:function(e){return new o(e)},function(n){if("string"==typeof n)return i.createHash("md5").update(n,"utf8").digest("hex");if(null==n)throw Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),_(n)||w(n)||n.constructor===o?i.createHash("md5").update(r(n)).digest("hex"):e(n)}},P=function(e){return function(t,n){return new A(t,!0).update(n)[e]()}};function I(e){if(e)y[0]=y[16]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=0,this.blocks=y,this.buffer8=l;else if(f){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function A(e,t){var n,r=E(e);if(e=r[0],r[1]){var i,o=[],s=e.length,a=0;for(n=0;n>>6:(i<55296||i>=57344?o[a++]=224|i>>>12:(i=65536+((1023&i)<<10|1023&e.charCodeAt(++n)),o[a++]=240|i>>>18,o[a++]=128|i>>>12&63),o[a++]=128|i>>>6&63),o[a++]=128|63&i);e=o}e.length>64&&(e=new I(!0).update(e).array());var u=[],l=[];for(n=0;n<64;++n){var c=e[n]||0;u[n]=92^c,l[n]=54^c}I.call(this,t),this.update(l),this.oKeyPad=u,this.inner=!0,this.sharedMemory=t}I.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var t=E(e);e=t[0];for(var n,r,i=t[1],o=0,s=e.length,a=this.blocks,u=this.buffer8;o>>6:(n<55296||n>=57344?u[r++]=224|n>>>12:(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),u[r++]=240|n>>>18,u[r++]=128|n>>>12&63),u[r++]=128|n>>>6&63),u[r++]=128|63&n);else for(r=this.start;o>>2]|=n<>>2]|=(192|n>>>6)<=57344?a[r>>>2]|=(224|n>>>12)<>>2]|=(240|n>>>18)<>>2]|=(128|n>>>12&63)<>>2]|=(128|n>>>6&63)<>>2]|=(128|63&n)<>>2]|=e[o]<=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000|0,this.bytes=this.bytes%0x100000000),this},I.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=p[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},I.prototype.hash=function(){var e,t,n,r,i,o,s=this.blocks;this.first?(n=((n=(-0x10325477^(r=((r=(-0x67452302^0x77777777&(e=((e=s[0]-0x28955b89)<<7|e>>>25)-0x10325477|0))+s[1]-0x705f434)<<12|r>>>20)+e|0)&(-0x10325477^e))+s[2]-0x4324b227)<<17|n>>>15)+r|0,t=((t=(e^n&(r^e))+s[3]-0x4e748589)<<22|t>>>10)+n|0):(e=this.h0,t=this.h1,n=this.h2,e+=((r=this.h3)^t&(n^r))+s[0]-0x28955b88,r+=(n^(e=(e<<7|e>>>25)+t|0)&(t^n))+s[1]-0x173848aa,n+=(t^(r=(r<<12|r>>>20)+e|0)&(e^t))+s[2]+0x242070db,t+=(e^(n=(n<<17|n>>>15)+r|0)&(r^e))+s[3]-0x3e423112,t=(t<<22|t>>>10)+n|0),e+=(r^t&(n^r))+s[4]-0xa83f051,r+=(n^(e=(e<<7|e>>>25)+t|0)&(t^n))+s[5]+0x4787c62a,n+=(t^(r=(r<<12|r>>>20)+e|0)&(e^t))+s[6]-0x57cfb9ed,t+=(e^(n=(n<<17|n>>>15)+r|0)&(r^e))+s[7]-0x2b96aff,e+=(r^(t=(t<<22|t>>>10)+n|0)&(n^r))+s[8]+0x698098d8,r+=(n^(e=(e<<7|e>>>25)+t|0)&(t^n))+s[9]-0x74bb0851,n+=(t^(r=(r<<12|r>>>20)+e|0)&(e^t))+s[10]-42063,t+=(e^(n=(n<<17|n>>>15)+r|0)&(r^e))+s[11]-0x76a32842,e+=(r^(t=(t<<22|t>>>10)+n|0)&(n^r))+s[12]+0x6b901122,r+=(n^(e=(e<<7|e>>>25)+t|0)&(t^n))+s[13]-0x2678e6d,n+=(t^(r=(r<<12|r>>>20)+e|0)&(e^t))+s[14]-0x5986bc72,t+=(e^(n=(n<<17|n>>>15)+r|0)&(r^e))+s[15]+0x49b40821,t=(t<<22|t>>>10)+n|0,e+=(n^r&(t^n))+s[1]-0x9e1da9e,e=(e<<5|e>>>27)+t|0,r+=(t^n&(e^t))+s[6]-0x3fbf4cc0,r=(r<<9|r>>>23)+e|0,n+=(e^t&(r^e))+s[11]+0x265e5a51,n=(n<<14|n>>>18)+r|0,t+=(r^e&(n^r))+s[0]-0x16493856,t=(t<<20|t>>>12)+n|0,e+=(n^r&(t^n))+s[5]-0x29d0efa3,e=(e<<5|e>>>27)+t|0,r+=(t^n&(e^t))+s[10]+0x2441453,r=(r<<9|r>>>23)+e|0,n+=(e^t&(r^e))+s[15]-0x275e197f,n=(n<<14|n>>>18)+r|0,t+=(r^e&(n^r))+s[4]-0x182c0438,t=(t<<20|t>>>12)+n|0,e+=(n^r&(t^n))+s[9]+0x21e1cde6,e=(e<<5|e>>>27)+t|0,r+=(t^n&(e^t))+s[14]-0x3cc8f82a,r=(r<<9|r>>>23)+e|0,n+=(e^t&(r^e))+s[3]-0xb2af279,n=(n<<14|n>>>18)+r|0,t+=(r^e&(n^r))+s[8]+0x455a14ed,t=(t<<20|t>>>12)+n|0,e+=(n^r&(t^n))+s[13]-0x561c16fb,e=(e<<5|e>>>27)+t|0,r+=(t^n&(e^t))+s[2]-0x3105c08,r=(r<<9|r>>>23)+e|0,n+=(e^t&(r^e))+s[7]+0x676f02d9,n=(n<<14|n>>>18)+r|0,t+=(r^e&(n^r))+s[12]-0x72d5b376,e+=((i=(t=(t<<20|t>>>12)+n|0)^n)^r)+s[5]-378558,r+=(i^(e=(e<<4|e>>>28)+t|0))+s[8]-0x788e097f,n+=((o=(r=(r<<11|r>>>21)+e|0)^e)^t)+s[11]+0x6d9d6122,t+=(o^(n=(n<<16|n>>>16)+r|0))+s[14]-0x21ac7f4,e+=((i=(t=(t<<23|t>>>9)+n|0)^n)^r)+s[1]-0x5b4115bc,r+=(i^(e=(e<<4|e>>>28)+t|0))+s[4]+0x4bdecfa9,n+=((o=(r=(r<<11|r>>>21)+e|0)^e)^t)+s[7]-0x944b4a0,t+=(o^(n=(n<<16|n>>>16)+r|0))+s[10]-0x41404390,e+=((i=(t=(t<<23|t>>>9)+n|0)^n)^r)+s[13]+0x289b7ec6,r+=(i^(e=(e<<4|e>>>28)+t|0))+s[0]-0x155ed806,n+=((o=(r=(r<<11|r>>>21)+e|0)^e)^t)+s[3]-0x2b10cf7b,t+=(o^(n=(n<<16|n>>>16)+r|0))+s[6]+0x4881d05,e+=((i=(t=(t<<23|t>>>9)+n|0)^n)^r)+s[9]-0x262b2fc7,r+=(i^(e=(e<<4|e>>>28)+t|0))+s[12]-0x1924661b,n+=((o=(r=(r<<11|r>>>21)+e|0)^e)^t)+s[15]+0x1fa27cf8,t+=(o^(n=(n<<16|n>>>16)+r|0))+s[2]-0x3b53a99b,t=(t<<23|t>>>9)+n|0,e+=(n^(t|~r))+s[0]-0xbd6ddbc,e=(e<<6|e>>>26)+t|0,r+=(t^(e|~n))+s[7]+0x432aff97,r=(r<<10|r>>>22)+e|0,n+=(e^(r|~t))+s[14]-0x546bdc59,n=(n<<15|n>>>17)+r|0,t+=(r^(n|~e))+s[5]-0x36c5fc7,t=(t<<21|t>>>11)+n|0,e+=(n^(t|~r))+s[12]+0x655b59c3,e=(e<<6|e>>>26)+t|0,r+=(t^(e|~n))+s[3]-0x70f3336e,r=(r<<10|r>>>22)+e|0,n+=(e^(r|~t))+s[10]-1051523,n=(n<<15|n>>>17)+r|0,t+=(r^(n|~e))+s[1]-0x7a7ba22f,t=(t<<21|t>>>11)+n|0,e+=(n^(t|~r))+s[8]+0x6fa87e4f,e=(e<<6|e>>>26)+t|0,r+=(t^(e|~n))+s[15]-0x1d31920,r=(r<<10|r>>>22)+e|0,n+=(e^(r|~t))+s[6]-0x5cfebcec,n=(n<<15|n>>>17)+r|0,t+=(r^(n|~e))+s[13]+0x4e0811a1,t=(t<<21|t>>>11)+n|0,e+=(n^(t|~r))+s[4]-0x8ac817e,e=(e<<6|e>>>26)+t|0,r+=(t^(e|~n))+s[11]-0x42c50dcb,r=(r<<10|r>>>22)+e|0,n+=(e^(r|~t))+s[2]+0x2ad7d2bb,n=(n<<15|n>>>17)+r|0,t+=(r^(n|~e))+s[9]-0x14792c6f,t=(t<<21|t>>>11)+n|0,this.first?(this.h0=e+0x67452301|0,this.h1=t-0x10325477|0,this.h2=n-0x67452302|0,this.h3=r+0x10325476|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+n|0,this.h3=this.h3+r|0)},I.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return h[e>>>4&15]+h[15&e]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>28&15]+h[e>>>24&15]+h[t>>>4&15]+h[15&t]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>28&15]+h[t>>>24&15]+h[n>>>4&15]+h[15&n]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>28&15]+h[n>>>24&15]+h[r>>>4&15]+h[15&r]+h[r>>>12&15]+h[r>>>8&15]+h[r>>>20&15]+h[r>>>16&15]+h[r>>>28&15]+h[r>>>24&15]},I.prototype.toString=I.prototype.hex,I.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255,255&r,r>>>8&255,r>>>16&255,r>>>24&255]},I.prototype.array=I.prototype.digest,I.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},I.prototype.buffer=I.prototype.arrayBuffer,I.prototype.base64=function(){for(var e,t,n,r="",i=this.array(),o=0;o<15;)e=i[o++],t=i[o++],n=i[o++],r+=m[e>>>2]+m[(e<<4|t>>>4)&63]+m[(t<<2|n>>>6)&63]+m[63&n];return r+(m[(e=i[o])>>>2]+m[e<<4&63]+"==")},A.prototype=new I,A.prototype.finalize=function(){if(I.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();I.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),I.prototype.finalize.call(this)}};var k=function(){var e=S("hex");u&&(e=T(e)),e.create=function(){return new I},e.update=function(t){return e.create().update(t)};for(var t=0;t{"use strict";n.d(t,{AQ:()=>h,C6:()=>i,Cl:()=>o,Ju:()=>l,N3:()=>f,Tt:()=>s,YH:()=>u,fX:()=>d,sH:()=>a,xN:()=>p,zs:()=>c});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function a(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(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)instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function d(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{var n;(n=i[e](t)).value instanceof f?Promise.resolve(n.value.v).then(u,l):c(o[0][2],n)}catch(e){c(o[0][3],e)}}function u(e){a("next",e)}function l(e){a("throw",e)}function c(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function p(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=l(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){var o,s,a;o=r,s=i,a=(t=e[n](t)).done,Promise.resolve(t.value).then(function(e){o({value:e,done:a})},s)})}}}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},40605:(e,t,n)=>{"use strict";n.d(t,{IP:()=>rC,u0:()=>rO,F6:()=>rx,ls:()=>rR,Ts:()=>rN,$s:()=>rL,do:()=>rU,u4:()=>rD});var r,i,o,s,a,u,l,c,d,f,h,p,v,g,m=n(39249);!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(r||(r={}));var y=function(e){return function(){var t=(0,m.Cl)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},b=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=(0,m.Ju)(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},_=function(e,t){return function(){var n,r,i={};try{for(var o=(0,m.Ju)(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=b(e,a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},w=function(e,t,n,i,o){return void 0===o&&(o=null),function(){for(var s=[],a=0;a0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),C=function(){return(C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var R=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=O(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next())if(s.value===i)return e===t}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),u=Array.isArray(t);if(a!==u)return!1;if(a&&u){for(var l=0;l>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,K);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,(0,m.fX)([],(0,m.zs)(r.entries()),!1).map(function(e){var t=(0,m.zs)(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(W[r]):W[r]}).join("")};function Q(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var X=function(){function e(){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[]}return e.prototype.setup=function(e){var t;return(0,m.sH)(this,void 0,void 0,function(){var n,r=this;return(0,m.YH)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(D.fS,"_").concat(this.config.apiKey.substring(0,10)),[4,null==(t=this.config.storageProvider)?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map(function(e){return r.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=K()),new Promise(function(n){t.queue.push({event:e,attempts:0,callback:function(e){return n(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attemptsthis.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,m.sH)(this,void 0,void 0,function(){var t,n,r=this;return(0,m.YH)(this,function(i){switch(i.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),[4,H(t,this.config.flushQueueSize).reduce(function(t,n){return(0,m.sH)(r,void 0,void 0,function(){return(0,m.YH)(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())];case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){return void 0===t&&(t=!0),(0,m.sH)(this,void 0,void 0,function(){var n,r,o,s;return(0,m.YH)(this,function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,(0,m.Tt)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new J,a.label=1;case 1:return a.trys.push([1,3,,4]),r=B(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,n)];case 2:if(null===(o=a.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(Q(o))):this.fulfillRequest(e,o.statusCode,o.status),[2];return this.handleResponse(o,e),[3,4];case 3:var u;return s=(u=a.sent())instanceof Error?u.message:String(u),this.config.loggerProvider.error(s),this.handleResponse({status:i.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){var n=e.status;switch(n){case i.Success:this.handleSuccessResponse(e,t);break;case i.Invalid:this.handleInvalidResponse(e,t);break;case i.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case i.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))return void this.fulfillRequest(t,e.statusCode,e.body.error);var r=new Set((0,m.fX)((0,m.fX)((0,m.fX)((0,m.fX)([],(0,m.zs)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,m.zs)(Object.values(e.body.eventsWithMissingFields)),!1),(0,m.zs)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,m.zs)(e.body.silencedEvents),!1).flat()),i=t.filter(function(t,i){return!r.has(i)||void n.fulfillRequest([t],e.statusCode,e.body.error)});i.length>0&&this.config.loggerProvider.warn(Q(e));var o=this.removeEventsExceedFlushMaxRetries(i);this.scheduleEvents(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length)return void this.fulfillRequest(t,e.statusCode,e.body.error);this.config.loggerProvider.warn(Q(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),u=new Set(o),l=t.filter(function(t,r){return t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)?void n.fulfillRequest([t],e.statusCode,e.body.error):(u.has(r)&&(t.timeout=n.throttleTimeout),!0)});l.length>0&&this.config.loggerProvider.warn(Q(e));var c=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){this.removeEvents(e),e.forEach(function(e){return e.callback(q(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}(),G=function(){function e(){this.name="identity",this.type="before",this.identityStore=M().identityStore}return e.prototype.execute=function(e){return(0,m.sH)(this,void 0,void 0,function(){var t;return(0,m.YH)(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(t){return e.instanceName&&(this.identityStore=M(e.instanceName).identityStore),[2]})})},e}(),Z=n(37264),ee=n(70762),et=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return(0,ee.a)(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?(0,m.Cl)({},this.properties):{};return e[o.REVENUE_PRODUCT_ID]=this.productId,e[o.REVENUE_QUANTITY]=this.quantity,e[o.REVENUE_PRICE]=this.price,e[o.REVENUE_TYPE]=this.revenueType,e[o.REVENUE_CURRENCY]=this.currency,e[o.REVENUE]=this.revenue,e[o.RECEIPT]=this.receipt,e[o.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(o||(o={}));var en=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e};!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(s||(s={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(a||(a={}));var er=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var n,r;return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(i){switch(i.label){case 0:if(this.plugins.some(function(t){return t.name===e.name}))return this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=K(),this.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!=(n=e.type)?n:"enrichment",[4,null==(r=e.setup)?void 0:r.call(e,t,this.client)];case 1:return i.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var n;return(0,m.sH)(this,void 0,void 0,function(){var r,i;return(0,m.YH)(this,function(o){switch(o.label){case 0:if(-1===(r=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return i=this.plugins[r],this.plugins.splice(r,1),[4,null==(n=i.teardown)?void 0:n.call(i)];case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this.applying=!1,this.plugins.map(function(e){var t;return null==(t=e.teardown)?void 0:t.call(e)}),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return(0,m.sH)(this,void 0,void 0,function(){var t,n,r,i,o,s,a,u,l,c,d,f,h,p,v;return(0,m.YH)(this,function(g){switch(g.label){case 0:if(!e)return[2];t=(0,m.zs)(e,1)[0],n=(0,m.zs)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),r=this.plugins.filter(function(e){return"before"===e.type}),g.label=1;case 1:g.trys.push([1,6,7,8]),o=(i=(0,m.Ju)(r)).next(),g.label=2;case 2:if(o.done)return[3,5];if(!(s=o.value).execute)return[3,4];return[4,s.execute((0,m.Cl)({},t))];case 3:if(null===(a=g.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),g.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return f={error:g.sent()},[3,8];case 7:try{o&&!o.done&&(h=i.return)&&h.call(i)}finally{if(f)throw f.error}return[7];case 8:u=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),g.label=9;case 9:g.trys.push([9,14,15,16]),c=(l=(0,m.Ju)(u)).next(),g.label=10;case 10:if(c.done)return[3,13];if(!(s=c.value).execute)return[3,12];return[4,s.execute((0,m.Cl)({},t))];case 11:if(null===(a=g.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),g.label=12;case 12:return c=l.next(),[3,10];case 13:return[3,16];case 14:return p={error:g.sent()},[3,16];case 15:try{c&&!c.done&&(v=l.return)&&v.call(l)}finally{if(p)throw p.error}return[7];case 16:return d=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(t))),Promise.all(d.map(function(e){var n=(0,m.Cl)({},t);return e.execute(n).catch(function(e){return q(n,0,String(e))})})).then(function(e){var r=(0,m.zs)(e,1)[0]||q(t,100,"Event not tracked, no destination plugins on the instance");n(r)}),[2]}})})},e.prototype.flush=function(){return(0,m.sH)(this,void 0,void 0,function(){var e,t=this;return(0,m.YH)(this,function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return n.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return n.sent(),[2]}})})},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onIdentityChanged)||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onSessionIdChanged)||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onOptOutChanged)||n.call(t,e)})},e}(),ei=function(e,t){return(0,m.Cl)((0,m.Cl)({},t),{event_type:a.IDENTIFY,user_properties:e.getUserProperties()})},eo=function(e,t,n,r){var i;return(0,m.Cl)((0,m.Cl)({},r),{event_type:a.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:((i={})[e]=t,i)})},es=function(e,t,n){var r,i=new Z.T$;return i.set(e,t),(0,m.Cl)((0,m.Cl)({},n),{event_type:a.IDENTIFY,user_properties:i.getUserProperties(),groups:((r={})[e]=t,r)})},ea=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new er(this),this.name=e}return e.prototype._init=function(e){return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return(0,m.sH)(this,void 0,void 0,function(){var t,n,r,i,o,s;return(0,m.YH)(this,function(a){switch(a.label){case 0:t=this[e],this[e]=[],a.label=1;case 1:a.trys.push([1,8,9,10]),r=(n=(0,m.Ju)(t)).next(),a.label=2;case 2:if(r.done)return[3,7];if(!((i=(0,r.value)())&&"promise"in i))return[3,4];return[4,i.promise];case 3:return a.sent(),[3,6];case 4:return[4,i];case 5:a.sent(),a.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return o={error:a.sent()},[3,10];case 9:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:a.sent(),a.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,n){var r=(0,m.Cl)((0,m.Cl)((0,m.Cl)({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t});return E(this.dispatch(r))},e.prototype.identify=function(e,t){var n=ei(e,t);return E(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=eo(e,t,n,r);return E(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=es(e,t,n);return E(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=(0,m.Cl)((0,m.Cl)({},t),{event_type:a.REVENUE,event_properties:e.getEventProperties()});return E(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),E())},e.prototype._addPlugin=function(e){return E(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),E())},e.prototype._removePlugin=function(e){return E(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(q(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,m.sH)(this,void 0,void 0,function(){var t=this;return(0,m.YH)(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t={};if(void 0===e)return t;var n={};return Object.keys(e).forEach(function(t){Object.values(s).includes(t)||(n[t]=e[t])}),Z.Se.forEach(function(n){if(Object.keys(e).includes(n)){var r=e[n];switch(n){case s.CLEAR_ALL:Object.keys(t).forEach(function(e){delete t[e]});break;case s.UNSET:Object.keys(r).forEach(function(e){delete t[e]});break;case s.SET:Object.assign(t,r)}}}),Object.assign(t,n),t},e.prototype.process=function(e){return(0,m.sH)(this,void 0,void 0,function(){var t,n,r;return(0,m.YH)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),this.config.optOut)return[2,q(e,0,"Event skipped due to optOut config")];return e.event_type===a.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[4,this.timeline.push(e)];case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return r=String(i.sent()),this.config.loggerProvider.error(r),[2,n=q(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){if(!this.isReady)return void this.q.push(this._setOptOut.bind(this,!!e));this._setOptOut(e)},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.timeline.onOptOutChanged(e),this.config.optOut=!!e)},e.prototype.flush=function(){return E(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});return void 0===t?void this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e)):t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),eu=function(e,t){return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1},el=function(e){return eu(e,"attribution")},ec=function(e){return eu(e,"pageViews")},ed=function(e){return eu(e,"sessions")},ef=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},eh=function(e){if(ef(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},ep=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return ec(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},ev=function(e,t){for(var n=0;n=200&&e<300?i.Success:429===e?i.RateLimit:413===e?i.PayloadTooLarge:408===e?i.Timeout:e>=400&&e<500?i.Invalid:e>=500?i.Failed:i.Unknown},e}(),eI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,m.C6)(t,e),t.prototype.send=function(e,t){return(0,m.sH)(this,void 0,void 0,function(){var n,r;return(0,m.YH)(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw Error("FetchTransport is not supported");return[4,fetch(e,{headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"})];case 1:return[4,(n=i.sent()).text()];case 2:r=i.sent();try{return[2,this.buildResponse(JSON.parse(r))]}catch(e){return[2,this.buildResponse({code:n.status})]}}})})},t}(eP),eA=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,m.sH)(this,void 0,void 0,function(){var t,n,r;return(0,m.YH)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,m.sH)(this,void 0,void 0,function(){var t;return(0,m.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(n){return[2,(null==(t=this.storage)?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(r){try{null==(n=this.storage)||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(n){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),ek=function(e){function t(t){var n,r=this;return(r=e.call(this,null==(n=S())?void 0:n.localStorage)||this).loggerProvider=null==t?void 0:t.loggerProvider,r}return(0,m.C6)(t,e),t.prototype.set=function(t,n){var r;return(0,m.sH)(this,void 0,void 0,function(){var i;return(0,m.YH)(this,function(o){switch(o.label){case 0:if(!(Array.isArray(n)&&n.length>1e3))return[3,2];return i=n.length-1e3,[4,e.prototype.set.call(this,t,n.slice(0,1e3))];case 1:return o.sent(),null==(r=this.loggerProvider)||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(eA),eC=function(e){function t(){var t;return e.call(this,null==(t=S())?void 0:t.sessionStorage)||this}return(0,m.C6)(t,e),t}(eA),eO=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return(0,m.C6)(t,e),t.prototype.send=function(e,t){return(0,m.sH)(this,void 0,void 0,function(){var n=this;return(0,m.YH)(this,function(r){return[2,new Promise(function(r,i){"undefined"==typeof XMLHttpRequest&&i(Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done){var e=o.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))})]})})},t}(eP),ex=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,m.C6)(t,e),t.prototype.send=function(e,t){return(0,m.sH)(this,void 0,void 0,function(){var n=this;return(0,m.YH)(this,function(r){return[2,new Promise(function(r,i){var o=S();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);if(o.navigator.sendBeacon(e,JSON.stringify(t)))return r(n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}));return r(n.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(eP),eR=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},eN=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},eL="[Amplitude]",eU="".concat(eL," Form Started"),eD="".concat(eL," Form Submitted"),eM="".concat(eL," File Downloaded"),eF="session_start",ej="session_end",eH="".concat(eL," File Extension"),eq="".concat(eL," File Name"),eV="".concat(eL," Link ID"),ez="".concat(eL," Link Text"),e$="".concat(eL," Link URL"),eY="".concat(eL," Form ID"),eB="".concat(eL," Form Name"),eJ="".concat(eL," Form Destination"),eW="cookie",eK=function(e){function t(t,n,i,o,s,a,u,l,c,d,f,h,p,v,g,m,y,b,_,w,E,S,T,P,I,A,k,C,O,x,R,N,L,U){void 0===i&&(i=new e_),void 0===o&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===c&&(c=5),void 0===d&&(d=30),void 0===f&&(f=eW),void 0===m&&(m=new z),void 0===y&&(y=r.Warn),void 0===_&&(_=!1),void 0===w&&(w=!1),void 0===T&&(T=""),void 0===P&&(P="US"),void 0===A&&(A=18e5),void 0===k&&(k=new ek({loggerProvider:m})),void 0===C&&(C={ipAddress:!0,language:!0,platform:!0}),void 0===O&&(O="fetch"),void 0===x&&(x=!1),void 0===R&&(R=!1);var D=e.call(this,{apiKey:t,storageProvider:k,transportProvider:eX(O)})||this;return D.apiKey=t,D.appVersion=n,D.cookieOptions=o,D.defaultTracking=s,D.autocapture=a,D.flushIntervalMillis=l,D.flushMaxRetries=c,D.flushQueueSize=d,D.identityStorage=f,D.ingestionMetadata=h,D.instanceName=p,D.loggerProvider=m,D.logLevel=y,D.minIdLength=b,D.offline=_,D.partnerId=E,D.plan=S,D.serverUrl=T,D.serverZone=P,D.sessionTimeout=A,D.storageProvider=k,D.trackingOptions=C,D.transport=O,D.useBatch=x,D.fetchRemoteConfig=R,D.version=ey,D._optOut=!1,D._cookieStorage=i,D.deviceId=u,D.lastEventId=v,D.lastEventTime=g,D.optOut=w,D.sessionId=I,D.pageCounter=L,D.userId=N,D.debugLogsEnabled=U,D.loggerProvider.enable(U?r.Debug:D.logLevel),D}return(0,m.C6)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(ew(this.apiKey),e)},t}(Y),eQ=function(e,t){switch(void 0===e&&(e=eW),void 0===t&&(t={}),e){case"localStorage":return new ek;case"sessionStorage":return new eC;case"none":return new e_;default:return new eE((0,m.Cl)((0,m.Cl)({},t),{expirationDays:t.expiration}))}},eX=function(e){return"xhr"===e?new eO:"beacon"===e?new ex:new eI},eG=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0},eZ=function(){var e,t=eG();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=e0(n[0]),i=e0(n[1]);return i&&(e[r]=i),e},{}):{}},e0=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},e1="dclid",e2="fbclid",e4="gbraid",e3="gclid",e5="ko_click_id",e6="li_fat_id",e7="msclkid",e8="rdt_cid",e9="ttclid",te="twclid",tt="wbraid",tn={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},tr=function(){function e(){}return e.prototype.parse=function(){return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(e){return[2,(0,m.Cl)((0,m.Cl)((0,m.Cl)((0,m.Cl)({},tn),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=eZ();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!=(t=null==(e=n.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=eZ();return(e={})[e1]=t[e1],e[e2]=t[e2],e[e4]=t[e4],e[e3]=t[e3],e[e5]=t[e5],e[e6]=t[e6],e[e7]=t[e7],e[e8]=t[e8],e[e9]=t[e9],e[te]=t[te],e[tt]=t[tt],e},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(u||(u={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(l||(l={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(c||(c={}));var ti=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},to=function(e){void 0===e&&(e={});var t,n,r=eG(),i=void 0,o=!1,s=e.trackOn,a=e.trackHistoryChanges,u=e.eventType,l=void 0===u?"[Amplitude] Page Viewed":u,c=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},d=function(){return(0,m.sH)(void 0,void 0,void 0,function(){var e,t,n;return(0,m.YH)(this,function(r){switch(r.label){case 0:return e=c("undefined"!=typeof location&&location.href||""),n={event_type:l},t=[{}],[4,ts()];case 1:return[2,(n.event_properties=m.Cl.apply(void 0,[m.Cl.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&c(location.pathname)||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":e.split("?")[0]}]),n)]}})})},f=function(){return void 0===s||"function"==typeof s&&s()},h="undefined"!=typeof location?location.href:null,p=function(){return(0,m.sH)(void 0,void 0,void 0,function(){var e,n,r,o;return(0,m.YH)(this,function(s){switch(s.label){case 0:if(n=tu(a,e=location.href,h||"")&&f(),h=e,!n)return[3,4];if(null==i||i.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return o=(r=t).track,[4,d()];case 2:o.apply(r,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}})})},v=function(){p()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return(0,m.sH)(void 0,void 0,void 0,function(){var a,u;return(0,m.YH)(this,function(l){switch(l.label){case 0:if(t=s,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",v),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=(0,m.zs)(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&p()}})),!f())return[3,2];return i.log("Tracking page view event"),u=(a=t).track,[4,d()];case 1:u.apply(a,[l.sent()]),l.label=2;case 2:return[2]}})})},execute:function(e){return(0,m.sH)(void 0,void 0,void 0,function(){var t;return(0,m.YH)(this,function(r){switch(r.label){case 0:if(!("attribution"===s&&ta(e)))return[3,2];return null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()];case 1:e.event_type=(t=r.sent()).event_type,e.event_properties=(0,m.Cl)((0,m.Cl)({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===l&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=(0,m.Cl)((0,m.Cl)({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(e){return r&&(r.removeEventListener("popstate",v),o=!1),[2]})})}}},ts=function(){return(0,m.sH)(void 0,void 0,void 0,function(){var e;return(0,m.YH)(this,function(t){switch(t.label){case 0:return e=ti,[4,new tr().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},ta=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[u.SET]||{},r=t[u.UNSET]||{},i=(0,m.fX)((0,m.fX)([],(0,m.zs)(Object.keys(n)),!1),(0,m.zs)(Object.keys(r)),!1);return Object.keys(tn).every(function(e){return i.includes(e)})}return!1},tu=function(e,t,n){if("pathOnly"!==e)return t!==n;if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname},tl=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,r){return(0,m.sH)(void 0,void 0,void 0,function(){var i,o;return(0,m.YH)(this,function(s){return i=function(){if(!r)return void t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");if("undefined"!=typeof document){var i=function(e){var t=!1;n(e,"change",function(){var n,i=td(e);t||r.track(eU,((n={})[eY]=tc(e.id),n[eB]=tc(e.name),n[eJ]=i,n)),t=!0}),n(e,"submit",function(){var n,i,o=td(e);t||r.track(eU,((n={})[eY]=tc(e.id),n[eB]=tc(e.name),n[eJ]=o,n)),r.track(eD,((i={})[eY]=tc(e.id),i[eB]=tc(e.name),i[eJ]=o,i)),t=!1})};Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=S())?o.addEventListener("load",i):t.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},tc=function(e){if("string"==typeof e)return e},td=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},tf=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,r){return(0,m.sH)(void 0,void 0,void 0,function(){var i,o;return(0,m.YH)(this,function(s){return i=function(){if(!r)return void t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");if("undefined"!=typeof document){var i=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,i=o.exec(t.href),s=null==i?void 0:i[1];s&&n(e,"click",function(){var n;s&&r.track(eM,((n={})[eH]=s,n[eq]=t.pathname,n[eV]=e.id,n[ez]=e.text,n[e$]=e.href,n))})},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=S())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},th=!1,tp=function(e){th||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),th=!0)},tv=function(){var e=S(),t=[],n=function(n,r){e&&(e.addEventListener(n,r),t.push({type:n,handler:r}))},r=function(){t.forEach(function(t){var n=t.type,r=t.handler;e&&e.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(e.offline=!navigator.onLine,n("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),n("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(e){return r(),[2]})})}}};!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(d||(d={})),function(e){e.US="US",e.EU="EU"}(f||(f={}));var tg="Remote config fetch rejected due to timeout after 5 seconds",tm="Unexpected error occurred",ty=function(){function e(e){var t=e.localConfig,n=e.configKeys,r=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(e,t,n){return(0,m.sH)(r,void 0,void 0,function(){var r,i,o;return(0,m.YH)(this,function(s){switch(s.label){case 0:return r=Date.now(),[4,this.fetchWithTimeout(n)];case 1:if((i=s.sent())&&(o=i.configs&&i.configs[e]))return this.metrics.fetchTimeAPISuccess=Date.now()-r,[2,o[t]];return this.metrics.fetchTimeAPIFail=Date.now()-r,[2,void 0]}})})},this.fetchWithTimeout=function(e){return(0,m.sH)(r,void 0,void 0,function(){var t,n,r;return(0,m.YH)(this,function(i){switch(i.label){case 0:return t=new AbortController,n=setTimeout(function(){return t.abort()},5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return r=i.sent(),clearTimeout(n),[2,r]}})})},this.fetchRemoteConfig=function(e,t){return(0,m.sH)(r,void 0,void 0,function(){var n,r,i,o,s,a,u,l,c,f,h;return(0,m.YH)(this,function(p){switch(p.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:tg})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0);p.label=1;case 1:p.trys.push([1,3,,4]),n=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(i=(r=(0,m.Ju)(this.configKeys)).next();!i.done;i=r.next())o=i.value,n.append("config_keys",o)}catch(e){c={error:e}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(c)throw c.error}}return t&&n.set("session_id",String(t)),s={headers:{Accept:"*/*"},method:"GET"},a="".concat(this.getServerUrl(),"?").concat(n.toString()),this.attempts+=1,[4,fetch(a,(0,m.Cl)((0,m.Cl)({},s),{signal:e}))];case 2:if(null===(u=p.sent()))return[2,this.completeRequest({err:tm})];switch(new eP().buildStatus(u.status)){case d.Success:return this.attempts=0,[2,this.parseAndStoreConfig(u)];case d.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:if(l=p.sent(),e.aborted)return[2,this.completeRequest({err:tg})];return[2,this.completeRequest({err:null!=(h=l.message)?h:tm})];case 4:return[2]}})})},this.retryFetch=function(e,t){return(0,m.sH)(r,void 0,void 0,function(){var n=this;return(0,m.YH)(this,function(r){switch(r.label){case 0:return[4,new Promise(function(e){return setTimeout(e,n.attempts*n.retryTimeout)})];case 1:return r.sent(),[2,this.fetchRemoteConfig(e,t)]}})})},this.parseAndStoreConfig=function(e){return(0,m.sH)(r,void 0,void 0,function(){var t;return(0,m.YH)(this,function(n){switch(n.label){case 0:return[4,e.json()];case 1:return t=n.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}})})},this.localConfig=t,this.configKeys=n}return e.prototype.getServerUrl=function(){return this.localConfig.serverZone===f.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===f.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,n=e.success;if(t)throw Error(t);n&&this.localConfig.loggerProvider.log(n)},e}(),tb=function(e){var t=e.localConfig,n=e.configKeys;return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(e){return[2,new ty({localConfig:t,configKeys:n})]})})},t_=function(){function e(e){this.config=e,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return e.prototype.initialize=function(){return(0,m.sH)(this,void 0,void 0,function(){var e;return(0,m.YH)(this,function(t){switch(t.label){case 0:return e=this,[4,tb({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return e.remoteConfigFetch=t.sent(),[2]}})})},e.prototype.generateJoinedConfig=function(){var e,t,n;return(0,m.sH)(this,void 0,void 0,function(){var r,i,o;return(0,m.YH)(this,function(s){switch(s.label){case 0:if(s.trys.push([0,3,,4]),!(i=this.remoteConfigFetch))return[3,2];return[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)];case 1:i=s.sent(),s.label=2;case 2:return r=i,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(r,null,2)),r&&"autocapture"in r&&("boolean"==typeof r.autocapture&&(this.config.autocapture=r.autocapture),"object"==typeof r.autocapture&&(void 0===this.config.autocapture&&(this.config.autocapture=r.autocapture),"boolean"==typeof this.config.autocapture&&(this.config.autocapture=(0,m.Cl)({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},r.autocapture)),"object"==typeof this.config.autocapture&&(this.config.autocapture=(0,m.Cl)((0,m.Cl)({},this.config.autocapture),r.autocapture))),this.config.defaultTracking=this.config.autocapture),this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),null!=(n=this.config).requestMetadata||(n.requestMetadata=new J),(null==(e=this.remoteConfigFetch)?void 0:e.metrics.fetchTimeAPISuccess)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),(null==(t=this.remoteConfigFetch)?void 0:t.metrics.fetchTimeAPIFail)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return o=s.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",o),[3,4];case 4:return[2,this.config]}})})},e}(),tw=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],tE="data-amp-track-",tS=["div","span","h1","h2","h3","h4","h5","h6"];!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(h||(h={}));var tT=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,n,r,i,o,s,a,u,l,c,d,f,p,v,g,m,y,b,_,w,E,S,T=e.code||0,P=this.buildStatus(T);switch(P){case h.Success:return{status:P,statusCode:T,body:{eventsIngested:null!=(t=e.events_ingested)?t:0,payloadSizeBytes:null!=(n=e.payload_size_bytes)?n:0,serverUploadTime:null!=(r=e.server_upload_time)?r:0}};case h.Invalid:return{status:P,statusCode:T,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(s=e.events_with_invalid_fields)?s:{},eventsWithMissingFields:null!=(a=e.events_with_missing_fields)?a:{},eventsWithInvalidIdLengths:null!=(u=e.events_with_invalid_id_lengths)?u:{},epsThreshold:null!=(l=e.eps_threshold)?l:0,exceededDailyQuotaDevices:null!=(c=e.exceeded_daily_quota_devices)?c:{},silencedDevices:null!=(d=e.silenced_devices)?d:[],silencedEvents:null!=(f=e.silenced_events)?f:[],throttledDevices:null!=(p=e.throttled_devices)?p:{},throttledEvents:null!=(v=e.throttled_events)?v:[]}};case h.PayloadTooLarge:return{status:P,statusCode:T,body:{error:null!=(g=e.error)?g:""}};case h.RateLimit:return{status:P,statusCode:T,body:{error:null!=(m=e.error)?m:"",epsThreshold:null!=(y=e.eps_threshold)?y:0,throttledDevices:null!=(b=e.throttled_devices)?b:{},throttledUsers:null!=(_=e.throttled_users)?_:{},exceededDailyQuotaDevices:null!=(w=e.exceeded_daily_quota_devices)?w:{},exceededDailyQuotaUsers:null!=(E=e.exceeded_daily_quota_users)?E:{},throttledEvents:null!=(S=e.throttled_events)?S:[]}};case h.Timeout:default:return{status:P,statusCode:T}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?h.Success:429===e?h.RateLimit:413===e?h.PayloadTooLarge:408===e?h.Timeout:e>=400&&e<500?h.Invalid:e>=500?h.Failed:h.Unknown},e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(p||(p={}));var tP="Remote config fetch rejected due to timeout after 5 seconds",tI="Unexpected error occurred",tA=function(){function e(e){var t=e.localConfig,n=e.configKeys,r=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteNamespaceConfig=function(e,t){return(0,m.sH)(r,void 0,void 0,function(){var n,r,i;return(0,m.YH)(this,function(o){switch(o.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(t)];case 1:if((r=o.sent())&&(i=r.configs&&r.configs[e]))return this.metrics.fetchTimeAPISuccess=Date.now()-n,[2,i];return this.metrics.fetchTimeAPIFail=Date.now()-n,[2,void 0]}})})},this.getRemoteConfig=function(e,t,n){return(0,m.sH)(r,void 0,void 0,function(){var r;return(0,m.YH)(this,function(i){switch(i.label){case 0:return[4,this.getRemoteNamespaceConfig(e,n)];case 1:return[2,null==(r=i.sent())?void 0:r[t]]}})})},this.fetchWithTimeout=function(e){return(0,m.sH)(r,void 0,void 0,function(){var t,n,r;return(0,m.YH)(this,function(i){switch(i.label){case 0:return t=new AbortController,n=setTimeout(function(){return t.abort()},5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return r=i.sent(),clearTimeout(n),[2,r]}})})},this.fetchRemoteConfig=function(e,t){return(0,m.sH)(r,void 0,void 0,function(){var n,r,i,o,s,a,u,l,c,d,f;return(0,m.YH)(this,function(p){switch(p.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:tP})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0);p.label=1;case 1:p.trys.push([1,3,,4]),n=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(i=(r=(0,m.Ju)(this.configKeys)).next();!i.done;i=r.next())o=i.value,n.append("config_keys",o)}catch(e){c={error:e}}finally{try{i&&!i.done&&(d=r.return)&&d.call(r)}finally{if(c)throw c.error}}return t&&n.set("session_id",String(t)),s={headers:{Accept:"*/*"},method:"GET"},a="".concat(this.getServerUrl(),"?").concat(n.toString()),this.attempts+=1,[4,fetch(a,(0,m.Cl)((0,m.Cl)({},s),{signal:e}))];case 2:if(null===(u=p.sent()))return[2,this.completeRequest({err:tI})];switch(new tT().buildStatus(u.status)){case h.Success:return this.attempts=0,[2,this.parseAndStoreConfig(u)];case h.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:if(l=p.sent(),e.aborted)return[2,this.completeRequest({err:tP})];return[2,this.completeRequest({err:null!=(f=l.message)?f:tI})];case 4:return[2]}})})},this.retryFetch=function(e,t){return(0,m.sH)(r,void 0,void 0,function(){var n=this;return(0,m.YH)(this,function(r){switch(r.label){case 0:return[4,new Promise(function(e){return setTimeout(e,n.attempts*n.retryTimeout)})];case 1:return r.sent(),[2,this.fetchRemoteConfig(e,t)]}})})},this.parseAndStoreConfig=function(e){return(0,m.sH)(r,void 0,void 0,function(){var t;return(0,m.YH)(this,function(n){switch(n.label){case 0:return[4,e.json()];case 1:return t=n.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}})})},this.localConfig=t,this.configKeys=n}return e.prototype.getServerUrl=function(){return this.localConfig.configServerUrl?this.localConfig.configServerUrl:this.localConfig.serverZone===p.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===p.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,n=e.success;if(t)throw Error(t);n&&this.localConfig.loggerProvider.log(n)},e}(),tk=function(e){var t=e.localConfig,n=e.configKeys;return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(e){return[2,new tA({localConfig:t,configKeys:n})]})})},tC="[Amplitude] Element Clicked",tO="[Amplitude] Element Tag",tx="[Amplitude] Element Text",tR="[Amplitude] Page URL",tN="https://app.amplitude.com",tL={US:tN,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};function tU(e){return"function"==typeof e}function tD(e){return function(t){if(tU(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}function tM(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var tF=tM(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function tj(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var tH=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,n,r,i,o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=(0,m.Ju)(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(tU(u))try{u()}catch(e){i=e instanceof tF?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var c=(0,m.Ju)(l),d=c.next();!d.done;d=c.next()){var f=d.value;try{tz(f)}catch(e){i=null!=i?i:[],e instanceof tF?i=(0,m.fX)((0,m.fX)([],(0,m.zs)(i)),(0,m.zs)(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}if(i)throw new tF(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)tz(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(n=this._finalizers)?n:[]).push(e)}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&tj(t,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&tj(n,e),e instanceof t&&e._removeParent(this)},(e=new t).closed=!0,t.EMPTY=e,t}(),tq=tH.EMPTY;function tV(e){return e instanceof tH||e&&"closed"in e&&tU(e.remove)&&tU(e.add)&&tU(e.unsubscribe)}function tz(e){tU(e)?e():e.unsubscribe()}var t$={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},tY={setTimeout:function(e,t){for(var n=[],r=2;r0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this.hasError,r=this.isStopped,i=this.observers;return n||r?tq:(this.currentObservers=null,i.push(e),new tH(function(){t.currentObservers=null,tj(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,n=this.thrownError,r=this.isStopped;t?e.error(n):r&&e.complete()},t.prototype.asObservable=function(){var e=new nr;return e.source=this,e},t.create=function(e,t){return new nv(e,t)},t}(nr),nv=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,m.C6)(t,e),t.prototype.next=function(e){var t,n;null==(n=null==(t=this.destination)?void 0:t.next)||n.call(t,e)},t.prototype.error=function(e){var t,n;null==(n=null==(t=this.destination)?void 0:t.error)||n.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!=(n=null==(t=this.source)?void 0:t.subscribe(e))?n:tq},t}(np);function ng(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new np}:t,r=e.resetOnError,i=void 0===r||r,o=e.resetOnComplete,s=void 0===o||o,a=e.resetOnRefCountZero,u=void 0===a||a;return function(e){var t,r,o,a=0,l=!1,c=!1,d=function(){null==r||r.unsubscribe(),r=void 0},f=function(){d(),t=o=void 0,l=c=!1},h=function(){var e=t;f(),null==e||e.unsubscribe()};return tD(function(e,p){a++,c||l||d();var v=o=null!=o?o:n();p.add(function(){0!=--a||c||l||(r=nm(h,u))}),v.subscribe(p),!t&&a>0&&(t=new t2({next:function(e){return v.next(e)},error:function(e){c=!0,d(),r=nm(f,i,e),v.error(e)},complete:function(){l=!0,d(),r=nm(f,s),v.complete()}}),nd(e).subscribe(t))})(e)}}function nm(e,t){for(var n=[],r=2;r1024)return e.slice(0,r)}return e}((function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t})(e).map(function(e){return function(e){if(null===e)return null;var t,n,r,i,o,s,a=String(e.tagName).toLowerCase(),u={tag:a},l=Array.from(null!=(i=null==(r=e.parentElement)?void 0:r.children)?i:[]);l.length&&(u.index=l.indexOf(e),u.indexOfType=l.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var c=null==(s=null==(o=e.previousElementSibling)?void 0:o.tagName)?void 0:s.toLowerCase();c&&(u.prevSib=String(c));var d=e.getAttribute("id");d&&(u.id=String(d));var f=Array.from(e.classList);f.length&&(u.classes=f);var h={},p=Array.from(e.attributes).filter(function(e){return!nN.includes(e.name)}),v=!nC(e);if(!nD.includes(String(e.getAttribute("type")))&&!nU.includes(a))try{for(var g=(0,m.Ju)(p),y=g.next();!y.done;y=g.next()){var b=y.value;(!v||nL.includes(b.name))&&(h[b.name]=String(b.value).substring(0,128))}}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}return Object.keys(h).length&&(u.attrs=h),u}(e)}),1024):[]},nF=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;if(e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector)return n.querySelector(e.selector);return n}}catch(e){}},nj=function(e,t,n){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}})},nH=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/,nq=/(^\d{3}-?\d{2}-?\d{4}$)/,nV=/[^\s@]+@[^\s@.]+\.[^\s@]+/,nz=function(e){var t,n,r,i=this;this.isNonSensitiveString=function(e){var t,n;if("string"!=typeof e)return!0;if(nH.test((e||"").replace(/[- ]/g,""))||nq.test(e)||nV.test(e))return!1;try{for(var r=(0,m.Ju)(i.additionalMaskTextPatterns),o=r.next();!o.done;o=r.next()){var s=o.value;try{if(s.test(e))return!1}catch(e){}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}if(t){var r=t.textContent||"";return i.isNonSensitiveString(r)?r:""}return i.getNearestLabel(n)},this.getEventProperties=function(e,t,n){var r,o,s,a=null==(s=null==(o=null==t?void 0:t.tagName)?void 0:o.toLowerCase)?void 0:s.call(o),u="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},l=t.getAttribute("aria-label"),c=t.getAttributeNames().reduce(function(e,r){if(r.startsWith(n)){var i=r.replace(n,""),o=t.getAttribute(r);i&&(e[i]=o||"")}return e},{}),d=i.getNearestLabel(t),f=((r={})["[Amplitude] Element ID"]=t.getAttribute("id")||"",r["[Amplitude] Element Class"]=t.getAttribute("class"),r["[Amplitude] Element Hierarchy"]=nM(t),r[tO]=a,r[tx]=i.getText(t),r["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),r["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),r["[Amplitude] Element Aria Label"]=l,r["[Amplitude] Element Attributes"]=c,r["[Amplitude] Element Parent Label"]=d,r[tR]=window.location.href.split("?")[0],r["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);return"a"===a&&"click"===e&&t instanceof HTMLAnchorElement&&(f["[Amplitude] Element Href"]=t.href),nO(f)},this.addAdditionalEventProperties=function(e,t,n,r,o){void 0===o&&(o=!1);var s={event:e,timestamp:Date.now(),type:t};if(("click"===s.type||"change"===s.type)&&null!==s.event.target){if(o&&nA(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=i.getEventProperties(s.type,s.closestTrackedAncestor,r),s;var a=nx(s.event.target,n);a&&(s.closestTrackedAncestor=a,s.targetElementProperties=i.getEventProperties(s.type,a,r))}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=nF(e,t);if(n){if("TEXT"===e.elementExtractType)return i.getText(n);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return n.getAttribute(e.attribute)}}},this.combineText=function(e){var t="";return nC(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach(function(e){var n="";e&&3===e.nodeType?e.textContent&&(n=e.textContent):n=i.combineText(e),t+=n.split(/(\s+)/).filter(i.isNonSensitiveString).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}),t},this.getText=function(e){return i.combineText(e).trim()},this.getEventTagProps=function(e){if(!e)return{};var t,n,r,o=null==(r=null==(n=null==e?void 0:e.tagName)?void 0:n.toLowerCase)?void 0:r.call(n);return nO(((t={})[tO]=o,t[tx]=i.getText(e),t[tR]=window.location.href.split("?")[0],t))};var o=null!=(r=e.maskTextRegex)?r:[],s=[];try{for(var a=(0,m.Ju)(o),u=a.next();!u.done;u=a.next()){var l=u.value;if(s.length>=25)break;if(l instanceof RegExp)s.push(l);else if("pattern"in l&&"string"==typeof l.pattern)try{s.push(new RegExp(l.pattern))}catch(e){}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}this.additionalMaskTextPatterns=s},n$=function(){function e(e){var t=(void 0===e?{}:e).origin,n=this;this.endpoint=tN,this.requestCallbacks={},this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=void 0===t?tN:t}return e.prototype.notify=function(e){var t,n,r,i;null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Message sent: ",JSON.stringify(e)),null==(i=null==(r=window.opener)?void 0:r.postMessage)||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout(function(){s(Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null==(t=this.logger)||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.setup=function(e){var t=this,n=void 0===e?{dataExtractor:new nz({})}:e,r=n.logger,i=n.endpoint,o=n.isElementSelectable,s=n.cssSelectorAllowlist,a=n.actionClickAllowlist,u=n.dataExtractor;this.logger=r,i&&this.endpoint===tN&&(this.endpoint=i);var l=null;window.addEventListener("message",function(e){if(null==(r=null==(n=t.logger)?void 0:n.debug)||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var n,r,i,c,d,f=null==e?void 0:e.data,h=null==f?void 0:f.action;if(h)if("id"in f)null==(c=null==(i=t.logger)?void 0:i.debug)||c.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(f);else if("ping"===h)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===h){var p,v=null==f?void 0:f.data;(p="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise(function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=p,r.addEventListener("load",function(){e({status:!0})},{once:!0}),r.addEventListener("error",function(){t({status:!1,message:"Failed to load the script ".concat(p)})}),null==(n=document.head)||n.appendChild(r)}catch(e){t(e)}})).then(function(){var e;l=null==(e=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:e.call(window,{getEventTagProps:u.getEventTagProps,isElementSelectable:function(e){return!o||o((null==v?void 0:v.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a,extractDataFromDataSource:u.extractDataFromDataSource,diagnostics:{autocapture:{version:"1.11.1"}}}),t.notify({action:"selector-loaded"})}).catch(function(){var e;null==(e=t.logger)||e.warn("Failed to initialize visual tagging selector")})}else"close-visual-tagging-selector"===h&&(null==(d=null==l?void 0:l.close)||d.call(l))}}),this.notify({action:"page-loaded"})},e}();function nY(e,t){return tD(function(n,r){var i=0;n.subscribe(t6(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}var nB=function(e){function t(t,n){return e.call(this)||this}return(0,m.C6)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(tH),nJ={setInterval:function(e,t){for(var n=[],r=2;r=Math.abs(r.event.screenX-n.event.screenX)&&20>=Math.abs(r.event.screenY-n.event.screenY);return i&&!o})),C.pipe((O=I.debounceTime,void 0===x&&(x=nX),tD(function(e,t){var n=null,r=null,i=null,o=function(){if(n){n.unsubscribe(),n=null;var e=r;r=null,t.next(e)}};function s(){var e=i+O,r=x.now();if(r0&&d(i)},void 0,void 0,function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),a=null})),l||d(null!=r?"number"==typeof r?r:r-u.now():i)})}({first:500,with:function(){return nZ}}),t8(function(){return e}))},tD(function(e,t){var n=null,r=0,i=!1,o=function(){return i&&!n&&t.complete()};e.subscribe(t6(t,function(e){null==n||n.unsubscribe(),nd(ei(e,r++)).subscribe(n=t6(t,function(e){return t.next(e)},function(){n=null,o()}))},function(){i=!0,o()}))}))).subscribe(function(e){null==B||B.track(tC,K("click",e.closestTrackedAncestor))}),h.push(u),null==(y=null==t?void 0:t.loggerProvider)||y.log("".concat(f," has been successfully added.")),window.opener&&d.enabled&&(c=e.cssSelectorAllowlist,v=e.actionClickAllowlist,null==(b=d.messenger)||b.setup((0,m.Cl)((0,m.Cl)({dataExtractor:p,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:tL[t.serverZone]}),{isElementSelectable:nk(e,(0,m.fX)((0,m.fX)([],(0,m.zs)(c),!1),(0,m.zs)(v),!1)),cssSelectorAllowlist:c,actionClickAllowlist:v}))),[2])})})},execute:function(e){return(0,m.sH)(void 0,void 0,void 0,function(){return(0,m.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,m.sH)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,m.YH)(this,function(i){try{for(t=(e=(0,m.Ju)(h)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}},rl="dclid",rc="fbclid",rd="gbraid",rf="gclid",rh="ko_click_id",rp="li_fat_id",rv="msclkid",rg="rtd_cid",rm="ttclid",ry="twclid",rb="wbraid",r_={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},rw=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},rE=function(e,t,n,r,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,s=(0,m.Tt)(e,["referrer","referring_domain"]),a=t||{},u=(a.referrer,a.referring_domain),l=(0,m.Tt)(a,["referrer","referring_domain"]);if(rS(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Object.values(e).every(function(e){return!e})&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var c=JSON.stringify(s)!==JSON.stringify(l),d=rw(o||"")!==rw(u||""),f=!t||c||d;return f?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),f},rS=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},rT=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},rP=function(){function e(){}return e.prototype.parse=function(){return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(e){return[2,(0,m.Cl)((0,m.Cl)((0,m.Cl)((0,m.Cl)({},r_),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=T();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!=(t=null==(e=n.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=T();return(e={})[rl]=t[rl],e[rc]=t[rc],e[rd]=t[rd],e[rf]=t[rf],e[rh]=t[rh],e[rp]=t[rp],e[rv]=t[rv],e[rg]=t[rg],e[rm]=t[rm],e[ry]=t[ry],e[rb]=t[rb],e},e}(),rI=function(){function e(e,t){var n,r,i;this.shouldTrackNewCampaign=!1,this.options=(0,m.Cl)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:rT(null==(n=t.cookieOptions)?void 0:n.domain)},e),this.storage=t.cookieStorage,this.storageKey=(r=t.apiKey,void 0===i&&(i=10),[D.r,"MKTG",r.substring(0,i)].filter(Boolean).join("_")),this.currentCampaign=r_,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,m.sH)(this,void 0,void 0,function(){var e,t;return(0,m.YH)(this,function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:if(t=m.zs.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||en(this.sessionTimeout,this.lastEventTime),!rE(this.currentCampaign,this.previousCampaign,this.options,this.logger,e))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,m.sH)(this,void 0,void 0,function(){return(0,m.YH)(this,function(e){switch(e.label){case 0:return[4,Promise.all([new rP().parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r=(t=this.currentCampaign,n=this.options,ei(Object.entries((0,m.Cl)((0,m.Cl)({},r_),t)).reduce(function(e,t){var r,i=(0,m.zs)(t,2),o=i[0],s=i[1];return(e.setOnce("initial_".concat(o),null!=(r=null!=s?s:n.initialEmptyValue)?r:"EMPTY"),s)?e.set(o,s):e.unset(o)},new Z.T$)));return e&&(r.event_id=e),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),rA=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,m.C6)(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),E(this._init((0,m.Cl)((0,m.Cl)({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i;return(0,m.sH)(this,void 0,void 0,function(){var o,s,a,u,l,c=this;return(0,m.YH)(this,function(d){var f,h,p,v,g;switch(d.label){case 0:if(this.initializing)return[2];return this.initializing=!0,[4,(f=t.apiKey,h=t,p=this,void 0===h&&(h={}),(0,m.sH)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u,l,c,d,v,g,y,b,_,w,E,S,P,I,A,k,C,O,x,R,N,L,U,M,F,j,H,q,V,z,$,Y,B,J,W;return(0,m.YH)(this,function(Q){var X,G,Z;switch(Q.label){case 0:if(e=h.identityStorage||eW,E={},e===eW)return[3,1];return n="",[3,5];case 1:if(null==(P=null==(S=h.cookieOptions)?void 0:S.domain))return[3,2];return r=P,[3,4];case 2:return[4,(0,m.sH)(void 0,void 0,void 0,function(){var e,t,n,r,i,o;return(0,m.YH)(this,function(s){switch(s.label){case 0:return[4,new eE().isEnabled()];case 1:if(!s.sent()||"undefined"==typeof location||!location.hostname)return[2,""];for(e=(null!=X?X:location.hostname).split("."),t=[],n="AMP_TLDTEST",r=e.length-2;r>=0;--r)t.push(e.slice(r).join("."));r=0,s.label=2;case 2:if(!(r{"use strict";n.d(t,{KQ:()=>i,Q:()=>s,l2:()=>o});var r=n(71777);let i=()=>{let e=document.querySelector("link[rel='canonical']");return e?new URL(e.href):void 0},o=(e,t)=>{let n;if("string"==typeof e){let r=e;if(!r.startsWith("http")){r.startsWith("/")||(r=`/${r}`),r.endsWith("/")||(r=`${r}/`);let e=t;e.endsWith("/")&&(e=e.slice(0,-1)),r=`${e}${r}`}n=new URL(r)}else n=e;return`${n.origin}${n.pathname}`},s=()=>{let e,t,n,i=document.referrer,o=document.location.href,s=document.location.pathname,a=e=>e.hostname.split(".").slice(-2).join(".");if(i)try{e=a(new URL(i))}catch(e){r.vF.error(`failed to construct referrer_domain, referrer_url is likely malformed: ${i}`,e)}try{let e=new URL(o);t=a(e),n=e.hostname.split(".").slice(0,-2).join(".")||void 0}catch(e){r.vF.error(`failed to construct view_domain, view_url is likely malformed: ${o}`,e)}return{referrer_domain:e,referrer_url:i,view_domain:t,view_path:s,view_subdomain:n,view_url:o}}},41973:(e,t,n)=>{"use strict";n.d(t,{TrackChatbot:()=>l});var r=n(37450),i=n(6119),o=n(71777),s=n(12115),a=n(50210);let u=e=>{let t=(0,i.r)(e),n=null==t?void 0:t.getAttribute("data-id");("ai-chatbot-articles"===n||"ai-chatbot-vehicles"===n||"ai-chatbot-link"===n)&&r.Sc.setState(e=>({chatbotTotalClicks:e.chatbotTotalClicks+1}))},l=e=>{let{opened:t}=e,n=(0,s.useRef)(!0);return(0,s.useEffect)(()=>(window.addEventListener("click",u),()=>{window.removeEventListener("click",u)}),[]),(0,s.useEffect)(()=>{try{t&&n.current?(a.z.events.logChatbotOpen(),n.current=!1):t||n.current||(a.z.events.logChatbotClose(),n.current=!0)}catch(e){o.vF.error(e)}},[t]),null}},44749:(e,t,n)=>{"use strict";n.d(t,{Y$:()=>l,Pj:()=>d});var r=n(65521),i=n(46786),o=n(36491),s=n(71777),a=n(97753),u=n(51368);let l="@motortrend/nitrous-web-sdk",c=(0,i.lt)((0,i.Zr)((e=>(t,n,r)=>{let i=e(t,n,r);return r.reset=()=>{let i=e(t,n,r);"object"==typeof i&&t(Object.entries(i).reduce((e,[t,n])=>"function"==typeof n||"viewCount"===t?e:{...e,[t]:n},{}))},i})((...e)=>({...((e,t)=>({addEventBeacon:(t,n)=>e(e=>({eventBeacons:{...e.eventBeacons,[t]:n}})),addPageView:t=>{e(e=>({pageViews:[...e.pageViews,t]}))},eventBeacons:{},pageId:(0,u.A)(),pageLoadTimeMs:Date.now(),pageViews:[],removeEventBeacon:n=>{let{eventBeacons:r}=t();delete r[n],e({eventBeacons:r})},resetEventsSlice:()=>e({eventBeacons:{},pageViews:[]}),resetPageViews:()=>e({pageViews:[]}),setPageLoadTimeMs:t=>e({pageLoadTimeMs:t}),setPrevPageView(t){e({prevPageView:t})},setSessionId:t=>e({sessionId:t}),updateSessionExpiresAt:()=>{var n;return e({sessionExpiresAt:Date.now()+((null==(n=t().config)?void 0:n.sessionDurationMs)||a.sb.sessionDurationMs)})}}))(...e),...((e,t)=>({addClickPosition:t=>e(e=>({clickPositions:[...e.clickPositions,t]})),clickPositions:[],commentsPosted:0,contentSectionsViewed:0,contentSectionsViewedMap:{},coreWebVitalsPayload:{},currScrollTop:0,handleCommentPosted:()=>e(e=>({commentsPosted:e.commentsPosted+1})),handleContentImpression:(t,n)=>e(e=>({impressions:{...e.impressions,[t]:{...e.impressions[t]||{},variant:n,viewed:!0}}})),handleContentRender:(t,n)=>e(e=>({impressions:{...e.impressions,[t]:{...e.impressions[t]||{},rendered:!0,variant:n}}})),handleContentSectionViewed:n=>{let r={...t().contentSectionsViewedMap||{}},i=r[n];r[n]=(i||0)+1,e({contentSectionsViewed:Object.values(r).filter(e=>e>0).length,contentSectionsViewedMap:r})},impressions:{},incrementScrollBucket:(n,r,i)=>{let o={...t().scrollBucketData};for(let e=n;e<=r;e++)o[e]=(o[e]||0)+i;e({scrollBucketData:o})},lastScrolledAt:new Date().getTime(),resetUesSlice:()=>{e({clickPositions:[],commentsPosted:0,contentSectionsViewed:0,contentSectionsViewedMap:{},coreWebVitalsPayload:{},eventBeacons:{},impressions:{},scrollBucketData:{}})},resourcePerformance:{},scrollBucketData:{},setMaxScrollTop:t=>{e(e=>({maxScrollTop:t,...void 0===e.scrollStartTimeMs&&{scrollStartTimeMs:Date.now()}}))},updateResourcePerformance:t=>e(e=>({resourcePerformance:{...e.resourcePerformance,...t}}))}))(...e),...(e=>({setConfig:t=>{e({config:t})}}))(...e),...((e,t)=>({ads:{},adsRefreshPayload:{},resetAdsSlice:()=>e({ads:{}}),resetAdsTimeline:()=>{let{ads:n}=t();e({ads:Object.entries(n).reduce((e,[t,n])=>({...e,[t]:{...n,timeline:[]}}),{}),adsRefreshPayload:{}})},updateAd:(n,r,i)=>{let s=(0,o.$)(n,r);if(!s)return;let a=t().ads||{},u=a[s]||{};return e({ads:{...a,[s]:{...u,...i}}})},updateAdTimeline:(n,r,i)=>{var a,u;try{let s,l=Date.now(),c=(0,o.$)(n,r);if(!c)return;let d=t().ads||{},f=d[c]||{};if("mounted"===i||"queued"===i||"requested"===i)s=l-t().pageLoadTimeMs;else if("responded"===i){let e=null==(a=f.timeline.slice().reverse().find(e=>"requested"===e.type))?void 0:a.timestampMs;void 0!==e&&(s=l-e)}else if("rendered"===i){let e=null==(u=f.timeline.slice().reverse().find(e=>"responded"===e.type))?void 0:u.timestampMs;void 0!==e&&(s=l-e)}return e({ads:{...d,[c]:{...f,adPath:r,slotId:n,timeline:[...f.timeline||[],{elapsedTimeMs:s,timestampMs:l,type:i}]}}})}catch(e){s.vF.error(e)}}}))(...e),...(e=>({hasTrackedMarketingChannelPayload:!1,identified:!1,setHasTrackedMarketingChannelPayload:t=>e({hasTrackedMarketingChannelPayload:t}),setIdentified:t=>e({identified:t}),setMtid:t=>e({mtid:t})}))(...e)})),{name:l,partialize:e=>{var t;return{config:{logLevel:null==(t=e.config)?void 0:t.logLevel},hasTrackedMarketingChannelPayload:e.hasTrackedMarketingChannelPayload,mtid:e.mtid,prevPageView:e.prevPageView,sessionExpiresAt:e.sessionExpiresAt,sessionId:e.sessionId}}}),{name:l}),d=(0,r.v)()(c)},50210:(e,t,n)=>{"use strict";n.d(t,{z:()=>ex});var r=n(97753),i=Object.defineProperty,o=(e,t,n)=>((e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class s extends Error{constructor(e,t,n){super(),o(this,"code"),o(this,"context"),o(this,"message"),this.code=t,this.context=n,this.message=e}}var a=n(82468);let u=e=>l(e,0),l=async(e,t)=>{let n=await c({userIdentities:e}),i=null==n?void 0:n.getUser();if((null==n?void 0:n.httpCode)===200&&i)return i;if(t{setTimeout(()=>{e(!0)},n)})),l(e,t+1)}throw new s("mparticle login failed: see https://docs.mparticle.com/developers/sdk/web/idsync/#status-codes",null==n?void 0:n.httpCode,n.body)},c=e=>new Promise(t=>a.A.Identity.login(e,e=>t(e)));var d=n(44749),f=n(37450);function h(e){for(var t=1;t{let e,t=p.get("nit");try{t&&(e=JSON.parse(t))}catch{}return e},g=e=>{let t=v()||{};p.set("nit",JSON.stringify({...t,...e}),{expires:365})};var m=n(71777),y=n(50657),b=n(40605),_=Object.defineProperty;let w=["\x1b[32m[nitrous]\x1b[0m"];class E{constructor(){((e,t,n)=>((e,t,n)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n))(this,"_isEnabled",!1)}debug(...e){this._isEnabled&&console.log(...w,...e)}enable(){this._isEnabled=!0}error(...e){console.error(...w,...e)}warn(...e){this._isEnabled&&console.warn(...w,...e)}}let S=new E;var T=(e=>(e.EACCES="EACCES",e.EADDRINFO="EADDRINFO",e.EADDRINUSE="EADDRINUSE",e.EADDRNOTAVAIL="EADDRNOTAVAIL",e.EAFNOSUPPORT="EAFNOSUPPORT",e.EAGAIN="EAGAIN",e.EAIFAMNOSUPPORT="EAIFAMNOSUPPORT",e.EAISERVICE="EAISERVICE",e.EAISOCKTYPE="EAISOCKTYPE",e.EALREADY="EALREADY",e.EBADF="EBADF",e.EBUSY="EBUSY",e.ECANCELED="ECANCELED",e.ECHARSET="ECHARSET",e.ECONNABORTED="ECONNABORTED",e.ECONNREFUSED="ECONNREFUSED",e.ECONNRESET="ECONNRESET",e.EDESTADDRREQ="EDESTADDRREQ",e.EEXIST="EEXIST",e.EFAULT="EFAULT",e.EHOSTUNREACH="EHOSTUNREACH",e.EINTR="EINTR",e.EINVAL="EINVAL",e.EIO="EIO",e.EISCONN="EISCONN",e.EISDIR="EISDIR",e.ELOOP="ELOOP",e.EMFILE="EMFILE",e.EMSGSIZE="EMSGSIZE",e.ENAMETOOLONG="ENAMETOOLONG",e.ENETDOWN="ENETDOWN",e.ENETUNREACH="ENETUNREACH",e.ENFILE="ENFILE",e.ENOBUFS="ENOBUFS",e.ENODEV="ENODEV",e.ENOENT="ENOENT",e.ENOMEM="ENOMEM",e.ENONET="ENONET",e.ENOSPC="ENOSPC",e.ENOSYS="ENOSYS",e.ENOTCONN="ENOTCONN",e.ENOTDIR="ENOTDIR",e.ENOTEMPTY="ENOTEMPTY",e.ENOTFOUND="ENOTFOUND",e.ENOTSOCK="ENOTSOCK",e.ENOTSUP="ENOTSUP",e.EOF="EOF",e.EPERM="EPERM",e.EPIPE="EPIPE",e.EPROTO="EPROTO",e.EPROTONOSUPPORT="EPROTONOSUPPORT",e.EPROTOTYPE="EPROTOTYPE",e.EROFS="EROFS",e.ESHUTDOWN="ESHUTDOWN",e.ESPIPE="ESPIPE",e.ESRCH="ESRCH",e.ETIMEDOUT="ETIMEDOUT",e.EXDEV="EXDEV",e.OK="OK",e.UNKNOWN="UNKNOWN",e))(T||{});let P={errorCodes:[T.ETIMEDOUT,T.ECONNRESET,T.EADDRINUSE,T.ECONNREFUSED,T.EPIPE,T.ENOTFOUND,T.ENETUNREACH],limit:3,statusCodes:[408,413,429,500,502,503,504,521,522,524]},I=async(e,t={},n)=>{let r,i,{retryConfig:o,...s}=t,{errorCodes:a,limit:u,statusCodes:l}={errorCodes:(null==o?void 0:o.errorCodes)||P.errorCodes,limit:(null==o?void 0:o.limit)||P.limit,statusCodes:(null==o?void 0:o.statusCodes)||P.statusCodes};try{r=await fetch(e,s)}catch(e){i=e}let c=n!!e&&"object"==typeof e&&"cause"in e&&!!e.cause&&"object"==typeof e.cause&&"code"in e.cause)(i)&&a.includes(i.cause.code||"");if(!((d||f)&&c)){if(r)return r;throw i}return await (e=>{let t;return t=1e3*Math.pow(2,e)+100*Math.random(),new Promise(e=>setTimeout(e,t))})(n),I(e,t,n+1)},A=async e=>{try{let t,n=await (t={headers:{Authorization:`Api-Key ${e}`},method:"GET",retryConfig:{limit:6}},I("https://api.lab.amplitude.com/sdk/v2/flags",t,1));if(n.ok)return await n.json()}catch(e){S.error("failed to fetch experiments",e)}},k=async(e,t,n)=>{try{let r=await A(e);if(!r)return;m.vF.debug("fetched experiments",r);let i=v()||{},o=(null==i?void 0:i.experiments)||{},s=r.filter(e=>{var t;return(null==(t=e.metadata)?void 0:t.evaluationMode)==="remote"}).filter(e=>!o[e.key]).map(e=>e.key),a={};if(0!==s.length){m.vF.debug("performing remote evaluation for the following experiments:",s.join(", "));let r={user_properties:(0,y.M)(!1)};a=await C(e,t,n,s,r)}let u=R(r,t,n);if(Object.entries(u).forEach(([e,t])=>{b.$s(((e,t)=>{var n,r,i,o;let s={event_properties:{[`${e}.variant`]:t.key},event_type:"[Experiment] Assignment",time:Date.now(),user_properties:{}},a=null==(n=t.metadata)?void 0:n.flagVersion,u=null==(r=t.metadata)?void 0:r.segmentName,l=null==(i=t.metadata)?void 0:i.flagType,c=null==(o=t.metadata)?void 0:o.default,d={},f={};return s.event_properties[`${e}.variant`]=t.key,a&&u&&(s.event_properties[`${e}.details`]=`v${a} rule:${u}`),"mutual-exclusion-group"!=l&&(c?f[`[Experiment] ${e}`]="-":d[`[Experiment] ${e}`]=t.key),s.user_properties.$set=d,s.user_properties.$unset=f,s})(e,t))}),0===Object.entries(a).length)return;let l={...o,...a,...u};g({experiments:l})}catch(e){m.vF.error("failed to bucket user into experiments",e)}},C=async(e,t,n,r,i)=>{let o=new URLSearchParams({device_id:t,flag_keys:r.join(","),...n&&{user_id:n},...i&&{context:JSON.stringify(i)}}),s=await fetch(`https://api.lab.amplitude.com/v1/vardata?${o.toString()}`,{headers:{Authorization:`Api-Key ${e}`}});if(!s.ok)throw Error(`failed to fetch remote experiments: ${s.statusText}`);return await s.json()},O=()=>{Array.from(document.querySelectorAll(`[${r.qD.experimentKey}]`)||[]).forEach(e=>{let t=e.getAttribute(r.qD.experimentKey),n=e.getAttribute(r.qD.experimentVariant),i=window.nitrousExposures||{};t&&n&&i[t]!==n&&(b.$s(x(t,n)),i[t]=n,window.nitrousExposures=i)})},x=(e,t)=>({event_properties:{flag_key:e,variant:t},event_type:"$exposure",user_properties:{}}),R=(e,t,n)=>e.filter(e=>{var t;return(null==(t=e.metadata)?void 0:t.evaluationMode)==="local"}).reduce((e,r)=>{var i;let o=null==(i=r.segments.find(e=>{var r,i;return(null==(r=e.metadata)?void 0:r.segmentName)==="individual-inclusions"&&(null==(i=e.conditions)?void 0:i.some(e=>e.some(e=>t&&e.values.includes(t)||n&&e.values.includes(n))))}))?void 0:i.variant;return o?(m.vF.debug(`user is part of testing group for '${r.key}' experiment, forcibly re-bucketing user into '${o}' group`,{deviceId:t,userId:n}),{...e,[r.key]:r.variants[o]}):e},{});var N=n(78425),L=n(13492);let U="[nitrous-analytics.mp]";class D{error(e){console.error(U,e)}verbose(e){console.log(U,e)}warning(e){console.warn(U,e)}}let M=new D;var F=n(37264),j=n(51368),H=n(36491),q=n(38603);let V=e=>(0,q.md5)(e),z=()=>{let{chatbotSessionId:e}=f.Sc.getState();return{custom_attributes:{interaction_id:e},event_name:"Open Chatbot",event_type:"other"}};var $=n(12500),Y=n(67340);let B=(e,t)=>{var n;let r=null==(n=ex.user.getUser())?void 0:n.mpid;return{custom_attributes:{element_name:t,event_group:"Report Issue",event_name:"Report Issue",feedback_text:e?(0,Y.yp)(e):void 0,...r&&{mpid:r}},event_name:"Report Issue",event_type:"other"}};var J=n(63815);let W={Mobile:481},K={Mobile:2.1666666666666665*W.Mobile},Q={Desktop:W.Mobile*K.Mobile},X=e=>e.replace(/\b\w/g,e=>e.toUpperCase());var G=n(40652),Z=(e=>(e.Web="Web",e.Android="Android",e.iOS="iOS",e.HWA="HWA",e.tvOS="tvOS",e.Roku="Roku",e.Server="Server",e))(Z||{}),ee=(e=>(e.Fire_TV="Fire TV",e.Android_TV="Android TV",e.Comcast="Comcast",e.Desktop="Desktop",e.Mobile="Mobile",e))(ee||{}),et=(e=>(e.article="article",e.episode="episode",e.clip="clip",e.trailer="trailer",e.live="live",e.show="show",e.magazine_collection="magazine collection",e.magazine="magazine",e.magazine_issue="magazine issue",e.photo="photo",e.movie="movie",e.car="car",e.car_make="car make",e.car_model="car model",e.car_manufacturer="car manufacturer",e.car_segment="car segment",e.award="award",e.live_stream="live stream",e.event="event",e.person="person",e.collection="collection",e.gallery="gallery",e.FAST_TV="FAST TV",e.video="video",e.image="image",e.vertical_short="vertical short",e.curated="curated",e.email="email",e.staff__page="staff_page",e.staff_page="staff page",e.newsletter_page="newsletter page",e))(et||{}),en=(e=>(e.Originals="Originals",e.Shows="Shows",e.Motorsports="Motorsports",e.Watch_Live="Watch Live",e.Web_Watch_Live="Web Watch Live",e.Live_Events_Schedule="Live Events Schedule",e))(en||{}),er=(e=>(e.article="article",e.episode="episode",e.clip="clip",e.trailer="trailer",e.live="live",e.show="show",e.magazine_collection="magazine collection",e.magazine="magazine",e.magazine_issue="magazine issue",e.photo="photo",e.movie="movie",e.car="car",e.car_make="car make",e.car_model="car model",e.car_manufacturer="car manufacturer",e.car_segment="car segment",e.award="award",e.live_stream="live stream",e.event="event",e.person="person",e.collection="collection",e.gallery="gallery",e.FAST_TV="FAST TV",e.video="video",e.image="image",e))(er||{}),ei=(e=>(e.Facebook="Facebook",e.Twitter="Twitter",e.Instagram="Instagram",e))(ei||{}),eo=(e=>(e.ALL="ALL",e.Reviews="Reviews",e.News="News",e.Videos="Videos",e.Buyers_Guide="Buyer's Guide",e.Shows="Shows",e.Episodes="Episodes",e))(eo||{}),es=(e=>(e.ALL="ALL",e.Reviews="Reviews",e.News="News",e.Videos="Videos",e.Buyers_Guide="Buyer's Guide",e.Shows="Shows",e.Episodes="Episodes",e))(es||{}),ea=(e=>(e.kaltura="kaltura",e.webiny="webiny",e.sonic="sonic",e.wurl="wurl",e))(ea||{}),eu=(e=>(e.airplay="airplay",e.chromecast="chromecast",e.samsung_cast="samsung cast",e))(eu||{}),el=(e=>(e.long_form="long form",e.short_form="short form",e.fast_tv="fast tv",e.episode="episode",e.trailer="trailer",e.clip="clip",e.live="live",e.vertical_short="vertical short",e))(el||{}),ec=(e=>(e.paid="paid",e.organic="organic",e.null="null",e))(ec||{}),ed=(e=>(e.motortrend="motortrend",e.facebook="facebook",e.google="google",e.apple="apple",e))(ed||{}),ef=(e=>(e.ACTIVE="ACTIVE",e.CANCELED="CANCELED",e.TERMINATED="TERMINATED",e.PRE__ACTIVE="PRE_ACTIVE",e.PAUSED="PAUSED",e.CREATED="CREATED",e))(ef||{}),eh=(e=>(e.DAY="DAY",e.MONTH="MONTH",e.YEAR="YEAR",e))(eh||{}),ep=(e=>(e.apple="apple",e.google="google",e.roku="roku",e.samsung="samsung",e.comcast="comcast",e.amazon="amazon",e.motortrend="motortrend",e))(ep||{}),ev=(e=>(e.male="male",e.female="female",e.non_binary="non-binary",e))(ev||{}),eg=n(62698),em=n(5260);let ey=e=>"string"!=typeof e?[""]:e.replace(/^\/|\/$/g,"").split("/");var eb=Object.defineProperty,e_=(e,t,n)=>((e,t,n)=>t in e?eb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class ew{constructor(e){e_(this,"api"),e_(this,"eventQueue",[]),this.api=e}canLog(e){var t,n;let{config:r,pageViews:i}=d.Pj.getState(),{event_name:o}=e;if((null==(n=null==(t=null==r?void 0:r.eventConfig)?void 0:t[o])?void 0:n.enabled)===!1)return m.vF.debug("dropping event according to event config",e),!1;if(!this.api.identified)return this.eventQueue.push(e),m.vF.debug("queueing event until user has been identified",this.eventQueue),!1;let s=i.length>0,a="Page/Screen"===e.event_name&&"true"===e.custom_attributes.true_view;return!!s||!!a||(this.eventQueue.push(e),m.vF.verbose("queueing event until page view attributes are available",this.eventQueue),!1)}logAdEvent(e,t,n){try{let i=(0,H.$)(t.slotId,t.adPath);if(d.Pj.getState().updateAdTimeline(t.slotId,t.adPath,e),t){let{advertiserId:e,campaignId:n,creativeId:r,creativeTemplateId:i,isBackfill:o,lineItemId:s,size:a}=t;d.Pj.getState().updateAd(t.slotId,t.adPath,{...e&&{advertiserId:e},...o&&{isBackfill:o},...n&&{campaignId:n},...r&&{creativeId:r},...i&&{creativeTemplateId:i},...s&&{lineItemId:s},...a&&{size:a}})}let o=r._H[e];if(o){let e=d.Pj.getState().ads[i];if(!e)return void m.vF.error("cannot log Ad Response event: `ad` is undefined");let t=o(e,n);if(!t)return;this.logEvent(t)}}catch(e){m.vF.error(e)}}logChatbotClose(){try{let e=(()=>{let{chatbotSessionStartMs:e,chatbotTotalClicks:t,chatbotTotalPrompts:n,chatbotTotalTokens:r}=f.Sc.getState();return{custom_attributes:{...z().custom_attributes,interaction_duration:Math.floor((performance.now()-(e||0))/1e3),interaction_tokens:r,interaction_total_clicks:t,interaction_total_prompts:n},event_name:"Close Chatbot",event_type:"other"}})();this.logEvent(e)}catch(e){m.vF.error(e)}}logChatbotOpen(){try{f.Sc.setState({chatbotSessionId:(0,j.A)(),chatbotSessionStartMs:performance.now(),chatbotTotalClicks:0,chatbotTotalPrompts:0,chatbotTotalTokens:0});let e=z();this.logEvent(e)}catch(e){m.vF.error(e)}}logChatbotPrompt(e,t,n){try{f.Sc.setState(e=>({chatbotTotalPrompts:(e.chatbotTotalPrompts||0)+1})),n&&f.Sc.setState(e=>({chatbotTotalTokens:(e.chatbotTotalTokens||0)+n}));let r={custom_attributes:{interaction_category:t,interaction_id:f.Sc.getState().chatbotSessionId,interaction_prompt:e?(0,Y.yp)(e):void 0,interaction_tokens:n,interaction_words_count:(0,$.s)(e)},event_name:"Chatbot Prompt",event_type:"other"};this.logEvent(r)}catch(e){m.vF.error(e)}}logChatbotReportIssue(e){try{let t={custom_attributes:{...B(e,"chatbot").custom_attributes,interaction_id:f.Sc.getState().chatbotSessionId},event_name:"Report Issue",event_type:"other"};this.logEvent(t)}catch(e){m.vF.error(e)}}logClick(e){try{let t=(e=>{var t;let{config:n}=d.Pj.getState(),{attributes:r,dataId:i}=e,o=null==(t=null==n?void 0:n.clickConfig)?void 0:t[i];if(!e.elementLink&&(null==o?void 0:o.enabled)===!1)return void m.vF.log("dropping click event according to event config",e);let{element_name:s,event_group:a,event_name:u,...l}=(null==o?void 0:o.attributes)||{};return{custom_attributes:{...l||{},element_content:e.elementContent,element_id:i,element_link:e.elementLink,element_name:s||"Unclassified",element_parent:e.dataParent,element_path:e.elementPath,element_position:e.dataPosition,event_group:a||"Unclassified",event_name:u||"Unclassified",...r},event_name:"Click",event_type:"other"}})(e);if(!t)return;this.logEvent(t)}catch(e){m.vF.error(e)}}logCommentPosted(){try{d.Pj.getState().handleCommentPosted()}catch(e){m.vF.error(e)}}logContentImpression(e,t){try{m.vF.verbose("content impression",{id:e,variant:t}),d.Pj.getState().handleContentImpression(e,t)}catch(e){m.vF.error(e)}}logContentSectionView(e){try{d.Pj.getState().handleContentSectionViewed(e)}catch(e){m.vF.error(e)}}logEvent(e){try{this.startNewSessionIfExpired(),this._logEvent(e)}catch(e){m.vF.error(e)}}async logNewsletterSubscription(e,t){try{await u({email:e,other:V(e),other3:this.api.user.getMtid()});let n=t.reduce((e,t)=>({...e,[t]:!0}),{});this.api.user.setUserAttributes(n);let r={custom_attributes:{email_subscriptions:JSON.stringify(t),event_group:"Newsletter",event_name:"Email Subscription",subscribing_email:e},event_name:"Subscribed to Email",event_type:"other"};this.logEvent(r)}catch(e){if(m.vF.error(e),e instanceof s)return{error:e}}}logPageView(e){try{this.startNewSessionIfExpired(),f.Sc.setState(e=>({viewCount:e.viewCount+1}));let t={custom_attributes:{...(()=>{let e,{config:t,pageId:n,pageViews:r,prevPageView:i,sessionId:o}=d.Pj.getState(),{viewCount:s}=f.Sc.getState(),{referrer_domain:a,referrer_url:u,view_domain:l,view_path:c,view_subdomain:h,view_url:p}=(0,G.Q)(),v=(e=>{if("/"===e)return"Landing";let t=ey(e);return t.length<=1?"no_taxonomy":X(t[0].replace(/-/g," "))})(c),g=(e=>{if("/"===e)return"Home";let t=ey(e);return t.length<=1?"Index Page":t.map(e=>X(e.replace(/-/g," "))).join(" : ")})(c),y=(0,G.KQ)(),b=null==y?void 0:y.href,_=y?((e=y.pathname.replace(/\/+/g,"/")).startsWith("/")||(e=`/${e}`),e.endsWith("/")||(e=`${e}/`),e):void 0,w=window.screen.width||window.innerWidth,E=window.screen.height||window.innerHeight,S=Math.floor(w*E),T=S{let{pageViews:e}=d.Pj.getState();return 0===e.length})(),I=P?null==i?void 0:i.view_name:r[0].view_name_previous;return{app_name:(null==t?void 0:t.appName)||"",device_family:T,device_screen_area:S,device_screen_height:E,device_screen_width:w,device_user_agent:window.navigator.userAgent,device_user_agent_bot:(0,eg.B3)(window.navigator.userAgent)||void 0,nitrous_version:"0.20.51",page_id:n,platform_name:Z.Web,referrer_domain:a,referrer_url:u,session_id:o,true_view:(0,J.$)(P),view_canonical_path:_,view_canonical_url:b,view_count:s,view_domain:l,view_group:v,view_name:g,view_name_previous:I,view_path:c,view_subdomain:h,view_url:p,window_id:(()=>{try{let e=sessionStorage.getItem("@motortrend/nitrous-web-sdk.windowId");return e||(e=(0,j.A)(),sessionStorage.setItem(`${d.Y$}.windowId`,e)),e}catch(e){m.vF.error(e)}})()}})(),...(0,em.m)(),...e},event_name:"Page/Screen",event_type:"page_view"};this.logEvent(t)}catch(e){m.vF.error(e)}}logReportIssue(e){try{let t=B(e);this.logEvent(t)}catch(e){m.vF.error(e)}}logUserEngagementSummary(e){try{this.logEvent(e);let{resetAdsTimeline:t,resetUesSlice:n}=d.Pj.getState();n(),t()}catch(e){m.vF.error(e)}}prepareAndUpload(){try{let{eventQueue:e}=this;if(this.eventQueue=[],0===e.length)return;m.vF.verbose("flushing event queue",e),e.forEach(e=>{this._logEvent(e)})}catch(e){m.vF.error(e)}}_logEvent(e){if(!this.canLog(e))return;let t=(e=>{let{pageViews:t}=d.Pj.getState();return{custom_attributes:((e={})=>Object.keys(e).reduce((t,n)=>{let r=e[n];if(null==r||Number.isNaN(r)||""===r)return t;let i="";if("number"==typeof r||"string"==typeof r)i=r;else if("boolean"==typeof r)i=r.toString();else if("object"==typeof r)i=JSON.stringify(r);else{if("function"!=typeof r.toString)return t;i=r.toString()}return t[n]=i,t},{}))({...(null==t?void 0:t[t.length-1])||{},...e.custom_attributes}),event_name:e.event_name,event_type:r.xD[e.event_type]}})(e);m.vF.focus("event:",t.event_name,t.custom_attributes);let{custom_attributes:n,event_type:i}=t,{event_name:o}=t;"Page/Screen"===e.event_name?("true"===n.true_view?(this.api.user.setInternalUserAttributes(),d.Pj.getState().setPrevPageView(n),window.nitrousExposures={},O()):o="Returned to Tab",a.A.logPageView(o,n),d.Pj.getState().addPageView(n)):a.A.logEvent(o,i,n);let s="Page/Screen"===o?"Viewed Page/Screen":o;"User Engagement Summary"===s?navigator.sendBeacon(this.api.serverUrl||"https://api2.amplitude.com/2/httpapi",JSON.stringify({api_key:this.api.amplitudeApiKey,events:[{device_id:b.IP(),event_properties:n,event_type:s,session_id:b.u0()}]})):b.u4(s,n),this.prepareAndUpload()}startNewSessionIfExpired(){let{updateSessionExpiresAt:e}=d.Pj.getState();this.api.isSessionExpired()?this.api.startNewSession():e()}}var eE=Object.defineProperty,eS=(e,t,n)=>((e,t,n)=>t in e?eE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class eT{constructor(e){eS(this,"api"),eS(this,"userRequestInFlight",!1),eS(this,"userRequestQueue",[]),this.api=e}canLog(e,t){return!!this.api.identified&&!this.userRequestInFlight||(this.userRequestQueue.push({identityRequest:t,method:e}),m.vF.verbose("queueing identity request until user has been identified",{identified:this.api.identified,identityRequestInFlight:this.userRequestInFlight},this.userRequestQueue),!1)}getAmplitudeDeviceId(){return b.IP()}getCreatedAt(){var e;try{return null==(e=a.A.Identity.getCurrentUser())?void 0:e.getFirstSeenTime()}catch(e){m.vF.error(e)}}getDeviceId(){try{return a.A.getDeviceId()}catch{}}getLastTimeSeen(){var e;try{return null==(e=a.A.Identity.getCurrentUser())?void 0:e.getLastSeenTime()}catch(e){m.vF.error(e)}}getMtid(){try{typeof window>"u"&&m.vF.error("mtid is cookie based an should never be retrieved server side");let{setMtid:e}=d.Pj.getState(),{mtid:t}=d.Pj.getState();return t||(t=(0,j.A)(),e(t),m.vF.verbose("created new mtid",{mtid:t})),t}catch(e){m.vF.error(e)}}getUser(){try{let e=a.A.Identity.getCurrentUser();return{mpid:null==e?void 0:e.getMPID(),userAttributes:null==e?void 0:e.getAllUserAttributes(),userIdentities:null==e?void 0:e.getUserIdentities()}}catch(e){m.vF.error(e)}}async identify(e){try{if(!this.mapIdentities(e))return void m.vF.error("cannot perform 'setUserIdentities' because no identities were passed");return await this.logIdentityRequest("identify",{userIdentities:e})}catch(e){m.vF.error(e)}}isFirstTouch(){var e;let t=Object.keys((null==(e=a.A.Identity.getCurrentUser())?void 0:e.getAllUserAttributes())||{}).some(e=>"string"==typeof e&&e.startsWith("firsttouch")),n=this.getCreatedAt(),r=!!n&&Date.now()-n<=6e4;return!t&&r}logIdentityRequest(e,t,n=!1){return new Promise(r=>{try{if(!n&&!this.canLog(e,t))return r(void 0);this.userRequestInFlight=!0;let i=`logIdentityRequest.${e}`;return m.vF.verbose(i,t),a.A.Identity[e](t,e=>{this.userRequestInFlight=!1,(null==e?void 0:e.httpCode)!==200&&m.vF.error(`${i} failed: ${null==e?void 0:e.httpCode}`,null==e?void 0:e.body,"see https://docs.mparticle.com/developers/sdk/web/idsync/#status-codes"),this.prepareAndUpload(),r(e)})}catch(e){m.vF.error(e)}return this.userRequestInFlight=!1,r(void 0)})}async login(e){b.do(e);let t=new F.T$;t.set("logged_in",!0),b.ls(t),this.api.events.logEvent({custom_attributes:{},event_name:"Login",event_type:"other"}),await u({email:e,other:V(e),other3:this.api.user.getMtid()})}async logout(){try{let e=new F.T$;return e.set("logged_in",!1),b.ls(e),this.api.events.logEvent({custom_attributes:{},event_name:"Logout",event_type:"other"}),await this.logIdentityRequest("logout",{userIdentities:{}})}catch(e){m.vF.error(e)}}mapIdentities(e){if(!e)return;let t=0===Object.keys(e).length,n=Object.values(e).every(e=>!e);if(t||n)return;let{email:r,hashedEmail:i,mtid:o}=e;return{userIdentities:{...o&&{other3:o},...r&&{email:r},...i&&{other:i}}}}async prepareAndUpload(){try{let{userRequestQueue:e}=this;if(this.userRequestQueue=[],0===e.length)return;for(let t of(m.vF.verbose("flushing user request queue",e),e))await this.logIdentityRequest(t.method,t.identityRequest)}catch(e){m.vF.error(e)}}setInternalUserAttributes(){let{hasTrackedMarketingChannelPayload:e,setHasTrackedMarketingChannelPayload:t}=d.Pj.getState(),n=(0,y.M)(e);if(n){let e=new F.T$;Object.entries(n).forEach(([t,n])=>{null!=n?(e.set(t,n),e.setOnce(`firsttouch_${t}`,n)):e.unset(t)}),b.ls(e)}if(t(!0),n){let e={};this.isFirstTouch()&&(e=Object.entries(n).reduce((e,[t,n])=>({...e,[`firsttouch_${t}`]:n}),{})),this.setUserAttributes({...n,...e})}}setUserAttributes(e){try{if(!e||0===Object.entries(e).length)return;m.vF.verbose("setting user attributes",e);let t=a.A.Identity.getCurrentUser();if(!t)return void m.vF.error("cannot set user attributes because user is missing");for(let[n,r]of Object.entries(e))"string"==typeof r&&t.setUserAttribute(n,r)}catch(e){m.vF.error(e)}}async setUserIdentities(e){var t,n;try{let r,i=this.mapIdentities(e);if(!i)return void m.vF.error("cannot perform `setUserIdentities` because no identities were passed",e);let o=(null==(n=null==(t=a.A.Identity.getCurrentUser())?void 0:t.getUserIdentities())?void 0:n.userIdentities)||{},s=(r=i.userIdentities,Object.entries(r).reduce((e,[t,n])=>(o[t]===n||(e[t]=n),e),{}));if(0===Object.keys(s).length)return void m.vF.warn("cannot set user identities because identities are unchanged",{newUserIdentities:s,prevUserIdentities:o});return await this.logIdentityRequest("modify",{userIdentities:s})}catch(e){m.vF.error(e)}}async signup(e){b.do(e);let t=new F.T$;t.set("logged_in",!0),b.ls(t),this.api.events.logEvent({custom_attributes:{},event_name:"Registration Complete",event_type:"other"}),await u({email:e,other:V(e),other3:this.api.user.getMtid()})}}var eP=Object.defineProperty,eI=(e,t,n)=>((e,t,n)=>t in e?eP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class eA{constructor(){eI(this,"amplitudeApiKey",""),eI(this,"apiKey",""),eI(this,"events",new ew(this)),eI(this,"identified",!1),eI(this,"initialized",!1),eI(this,"serverUrl"),eI(this,"user",new eT(this))}addEventListeners(){try{window.addEventListener("beforeunload",()=>{this.events.prepareAndUpload()})}catch(e){m.vF.error(e)}}async identityCallback(e){var t,n,i,o;try{if(r.of.amplitude){let e=null==(t=this.user.getUser())?void 0:t.mpid,n=this.user.getDeviceId();if(e||n){let t=new F.T$;e&&t.set("mpid",e),n&&t.set("mp_device_id",n),b.ls(t)}}let s=(0,N.L)(),l=s[r.NM.loginHashedEmail];l&&(m.vF.debug("performing query parameter based authentication"),await u({other:l,other3:this.user.getMtid()}));let c=s[r.NM.base64Email];c&&b.do(window.atob(c)),m.vF.focus("user identified",{deviceId:a.A.getDeviceId(),userAttributes:null==(n=null==e?void 0:e.getUser())?void 0:n.getAllUserAttributes(),userIdentities:null==(o=null==(i=null==e?void 0:e.getUser())?void 0:i.getUserIdentities())?void 0:o.userIdentities}),this.identified=!0,d.Pj.getState().setIdentified(!0),this.events.prepareAndUpload(),this.user.prepareAndUpload()}catch(e){m.vF.error(e)}}init(e="",t,n){var i;let o;if(this.initialized)return void m.vF.warn("init cannot not be called more than once. If you're initializing via useEffect, you may need to check your dependencies array");this.initialized=!0,this.apiKey=e,this.amplitudeApiKey=t;let{nitrousdebug:s,nitroussession:u}=(0,N.L)(),l="true"===s||(null==(i=d.Pj.getState().config)?void 0:i.logLevel)==="debug";try{u&&!isNaN(Number(u))&&(o=Number(u))}catch{}let c={...l&&{logLevel:"debug"},...o&&{sessionDurationMs:o}},f={...r.sb,...n,...c};d.Pj.getState().setConfig(f),this.serverUrl="production"===f.env?"https://eq47czqy1l.execute-api.us-west-2.amazonaws.com/v1/events":"https://ok622kc3lg.execute-api.us-east-1.amazonaws.com/v1/events",m.vF.log(m.I1),m.vF.verbose("initialized nitrous sdk"),l&&m.vF.verbose("debug mode enabled");try{this.isSessionExpired()&&this.startNewSession(),this.addEventListeners();let n=(0,N.L)()[r.NM.loginHashedEmail],i=this.user.getMtid(),o={...f.userIdentities||{},hashedEmail:n,mtid:this.user.getMtid()},s=this.user.mapIdentities(o);if(r.of.amplitude&&(b.Ts(t,{appVersion:f.appVersion,autocapture:{attribution:!1,elementInteractions:!1,fileDownloads:!1,formInteractions:!1,pageViews:!1,sessions:!0},logLevel:0,serverUrl:this.serverUrl,transport:"beacon"}).promise.then(()=>{let e=b.IP(),n=b.F6();e&&(g({deviceId:e}),k(t,e,n),O())}),(()=>{try{let e=v();if(!e)return;Array.isArray(null==e?void 0:e.events)&&e.events.forEach(e=>{b.$s(e)}),g({events:[]})}catch(e){m.vF.error("failed to log experiment cookie events",e)}})()),a.A.init(e,{...f.cname&&{aliasUrl:`${f.cname}/webevents/v1/identity/`,configUrl:`${f.cname}/tags/JS/v2/`,identityUrl:`${f.cname}/identity/v1/`,v1SecureServiceUrl:`${f.cname}/webevents/v1/JS/`,v2SecureServiceUrl:`${f.cname}/webevents/v2/JS/`,v3SecureServiceUrl:`${f.cname}/webevents/v3/JS/`},...!!s&&{identifyRequest:s},appName:f.appName,appVersion:f.appVersion,dataPlan:{planId:"motortrend"},identityCallback:e=>{this.identityCallback(e)},isDevelopmentMode:"development"===f.env,logger:M,logLevel:"none",maxCookieSize:f.maxCookieSize,useCookieStorage:f.useCookieStorage}),r.of.amplitude&&i){let e=new F.T$;e.set("mtid",i),b.ls(e)}this.loadNasScript(),window.dispatchEvent(new CustomEvent("nitrousinitialized"))}catch(e){m.vF.error(e)}}isSessionExpired(){let{sessionExpiresAt:e}=d.Pj.getState();return!e||Date.now()>e}async loadNasScript(){let{nitroushud:e}=(0,N.L)();if("true"===e?localStorage.setItem(r.lO.nitrousAnalyticsHud,"true"):"false"===e&&localStorage.setItem(r.lO.nitrousAnalyticsHud,"false"),"true"===localStorage.getItem(r.lO.nitrousAnalyticsHud)){let{config:e}=d.Pj.getState(),t=(null==e?void 0:e.env)==="production"?"https://nitrous-analytics.s3.amazonaws.com/nas.js":"https://nitrous-analytics.s3.amazonaws.com/nas.dev.js";(0,L.k)(t)}}startNewSession(){let e=(0,j.A)();m.vF.verbose("new session",e);let{resetPageViews:t,setHasTrackedMarketingChannelPayload:n,setSessionId:r,updateSessionExpiresAt:i}=d.Pj.getState();n(!1),t(),f.Sc.setState({viewCount:0}),i(),r(e)}}var ek=Object.defineProperty,eC=(e,t,n)=>((e,t,n)=>t in e?ek(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class eO{constructor(){eC(this,"instance",new eA),eC(this,"events",{logAdEvent:(e,t,n)=>this.instance.events.logAdEvent(e,t,n),logChatbotClose:()=>this.instance.events.logChatbotClose(),logChatbotOpen:()=>this.instance.events.logChatbotOpen(),logChatbotPrompt:(e,t,n)=>this.instance.events.logChatbotPrompt(e,t,n),logChatbotReportIssue:e=>this.instance.events.logChatbotReportIssue(e),logClick:e=>this.instance.events.logClick(e),logCommentPosted:()=>this.instance.events.logCommentPosted(),logContentImpression:(e,t)=>this.instance.events.logContentImpression(e,t),logContentSectionView:e=>this.instance.events.logContentSectionView(e),logEvent:e=>this.instance.events.logEvent(e),logNewsletterSubscription:(e,t)=>this.instance.events.logNewsletterSubscription(e,t),logPageView:e=>this.instance.events.logPageView(e),logReportIssue:e=>this.instance.events.logReportIssue(e),logUserEngagementSummary:e=>this.instance.events.logUserEngagementSummary(e)}),eC(this,"user",{getAmplitudeDeviceId:()=>this.instance.user.getAmplitudeDeviceId(),getCreatedAt:()=>this.instance.user.getCreatedAt(),getDeviceId:()=>this.instance.user.getDeviceId(),getMtid:()=>this.instance.user.getMtid(),getUser:()=>this.instance.user.getUser(),login:e=>this.instance.user.login(e),logout:()=>this.instance.user.logout(),setUserAttributes:e=>this.instance.user.setUserAttributes(e),setUserIdentities:e=>this.instance.user.setUserIdentities(e),signup:e=>this.instance.user.signup(e)})}get initialized(){return this.instance.initialized}init(e,t,n){this.instance.init(e,t,n)}}let ex=new eO},50657:(e,t,n)=>{"use strict";n.d(t,{M:()=>h});var r=n(78425),i=n(71777);let o=[{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Email",marketing_channel_rollup:"Email",marketing_type:"Organic"},rule_name:"Organic Email",rules:[{attribute:"utm_medium",matches:["email","emaileditorial"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"AdMedia",marketing_channel_rollup:"Paid Search",marketing_type:"Paid"},rule_name:"Admedia",rules:[{attribute:"utm_source",matches:["admedia"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Ad.net",marketing_channel_rollup:"Paid Search",marketing_type:"Paid"},rule_name:"Ad.net",rules:[{attribute:"utm_source",matches:["adnet"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Search",marketing_channel_rollup:"Paid Search",marketing_type:"Paid"},rule_name:"Paid Search",rules:[{attribute:"utm_medium",matches:["sem","paid_search"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Display",marketing_channel_rollup:"Paid Other",marketing_type:"Paid"},rule_name:"Paid Display",rules:[{attribute:"utm_medium",matches:["display"],operator:"equals"},{attribute:"utm_type",matches:["paid"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Linear",marketing_channel_rollup:"Paid Other",marketing_type:"Paid"},rule_name:"Paid Linear",rules:[{attribute:"utm_medium",matches:["radio","linear"],operator:"equals"},{attribute:"utm_type",matches:["paid"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Event",marketing_channel_rollup:"Paid Other",marketing_type:"Paid"},rule_name:"Paid Event",rules:[{attribute:"utm_medium",matches:["event"],operator:"equals"},{attribute:"utm_type",matches:["paid"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Social",marketing_channel_rollup:"Paid Social",marketing_type:"Paid"},rule_name:"Paid Social",rules:[{attribute:"utm_medium",matches:["social"],operator:"equals"},{attribute:"utm_type",matches:["paid"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Social",marketing_channel_rollup:"Organic Social",marketing_type:"Organic"},rule_name:"True Anthem Social",rules:[{attribute:"utm_campaign",matches:["true_anthem"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Social",marketing_channel_rollup:"Paid Social",marketing_type:"Paid"},rule_name:"Legacy Paid Social",rules:[{attribute:"view_url",matches:["sm_id="],operator:"contains"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Magazine",marketing_channel_rollup:"Paid Other",marketing_type:"Paid"},rule_name:"Paid Magazine",rules:[{attribute:"utm_medium",matches:["magazine"],operator:"equals"},{attribute:"utm_type",matches:["paid"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Display",marketing_channel_rollup:"External Referral",marketing_type:"Organic"},rule_name:"Organic Display",rules:[{attribute:"utm_medium",matches:["display"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Owned Social",marketing_channel_rollup:"Organic Social",marketing_type:"Organic"},rule_name:"Organic Owned Social",rules:[{attribute:"utm_medium",matches:["social"],operator:"equals"},{attribute:"utm_campaign",operator:"exists"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Social",marketing_channel_rollup:"Organic Social",marketing_type:"Organic"},rule_name:"Organic Social",rules:[{attribute:"referrer_domain",matches:["facebook.com","instagram.com","twitter.com","linkedin.com","pinterest.com","snapchat.com","tiktok.com","reddit.com","youtube.com","tumblr.com"],operator:"contains"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Search",marketing_channel_rollup:"Natural Search",marketing_type:"Organic"},rule_name:"Organic Search",rules:[{attribute:"referrer_domain",matches:["google.com","bing.com","yahoo.com","duckduckgo.com","ask.com","aol.com","yandex.com","qwant.com","startpage.com","dogpile.com"],operator:"contains"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Search",marketing_channel_rollup:"Natural Search",marketing_type:"Organic"},rule_name:"Organic Discover",rules:[{attribute:"referrer_url",matches:["discover.google.com","quicksearchbox","googlequicksearchbox","googleapis.com"],operator:"contains"}]},{operator:"or",overwritesExisting:!0,payload:{marketing_channel:"Web Push",marketing_channel_rollup:"Web Push",marketing_type:"Organic"},rule_name:"Web Push",rules:[{attribute:"utm_campaign",matches:["webpush"],operator:"equals"},{attribute:"utm_medium",matches:["webpush"],operator:"equals"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Hearst Autos",marketing_channel_rollup:"External Referral",marketing_type:"Organic"},rule_name:"Organic Hearst Autos",rules:[{attribute:"referrer_domain",matches:["caranddriver.com","motortrend.com","roadandtrack.com","autoweek.com","bringatrailer.com"],operator:"equals"},{attributeA:"referrer_domain",attributeB:"view_domain",operator:"not_equals_attribute"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Hearst",marketing_channel_rollup:"External Referral",marketing_type:"Organic"},rule_name:"Organic Hearst",rules:[{attribute:"referrer_domain",matches:["cosmopolitan.com","delish.com","elle.com","elledecor.com","esquire.com","goodhousekeeping.com","harpersbazaar.com","housebeautiful.com","menshealth.com","oprahdaily.com","popularmechanics.com","prevention.com","runnersworld.com","seventeen.com","townandcountrymag.com","veranda.com","womansday.com","womenshealthmag.com","countryliving.com","bicycling.com","thepioneerwoman.com"],operator:"equals"},{attributeA:"referrer_domain",attributeB:"view_domain",operator:"not_equals_attribute"}]},{operator:"and",overwritesExisting:!0,payload:{marketing_channel:"Development",marketing_channel_rollup:"Internal Referral",marketing_type:"Organic"},rule_name:"Development Environments",rules:[{attribute:"referrer_domain",operator:"exists"},{attribute:"referrer_domain",matches:["hearstapps.net","localhost"],operator:"contains"},{attributeA:"referrer_domain",attributeB:"view_domain",operator:"equals_attribute"}]},{operator:"and",overwritesExisting:!1,payload:{marketing_channel:"Direct",marketing_channel_rollup:"Direct",marketing_type:"Organic"},rule_name:"Organic Direct",rules:[{attribute:"referrer_domain",operator:"not_exists"}]},{operator:"and",overwritesExisting:!1,payload:{marketing_channel:"Internal Referral",marketing_channel_rollup:"Internal Referral",marketing_type:"Organic"},rule_name:"Default Internal Referral",rules:[{attribute:"referrer_domain",operator:"exists"},{attributeA:"referrer_domain",attributeB:"view_domain",operator:"equals_attribute"}]},{operator:"and",overwritesExisting:!1,payload:{marketing_channel:"External Referral",marketing_channel_rollup:"External Referral",marketing_type:"Organic"},rule_name:"Default External Referral",rules:[{attribute:"referrer_domain",operator:"exists"},{attributeA:"referrer_domain",attributeB:"view_domain",operator:"not_equals_attribute"}]}],s=(e,t)=>{i.vF.error(`cannot evaluate marketing rules for attribute: ${e}. ${typeof t}'s are not a supported comparison type`)},a=(e,t,n)=>"string"==typeof e||"number"==typeof e||"bigint"==typeof e||null==e?t.some(t=>String(e).includes(t)):(s(n,e),!1),u=(e,t,n)=>"string"==typeof e||"number"==typeof e||"bigint"==typeof e||null==e?t.some(t=>String(e)===t):(s(n,e),!1),l=(e,t)=>e===t,c=e=>!!e,d={contains:a,equals:u,equals_attribute:l,exists:c,not_contains:(...e)=>!a(...e),not_equals:(...e)=>!u(...e),not_equals_attribute:(...e)=>!l(...e),not_exists:(...e)=>!c(...e)};var f=n(40652);let h=e=>{let t=(()=>{let{utm_campaign:e=null,utm_content:t=null,utm_id:n=null,utm_medium:i=null,utm_source:o=null,utm_term:s=null,utm_type:a=null}=(0,r.L)();return{utm_campaign:e?e.toLowerCase():null,utm_content:t?t.toLowerCase():null,utm_id:n?n.toLowerCase():null,utm_medium:i?i.toLowerCase():null,utm_source:o?o.toLowerCase():null,utm_term:s?s.toLowerCase():null,utm_type:a?a.toLowerCase():null}})(),{referrer_domain:n,referrer_url:s,view_domain:a,view_url:u}=(0,f.Q)(),l={...(0,r.L)(),...t,referrer_domain:n,referrer_url:s,view_domain:a,view_url:u},c=(e=>o.find(t=>{let n="and"===t.operator?"every":"some";return t.rules[n](t=>{if("exists"===t.operator||"not_exists"===t.operator){let n=e[t.attribute];return d[t.operator](n)}if("contains"===t.operator||"equals"===t.operator||"not_contains"===t.operator||"not_equals"===t.operator){let n=t.attribute,r=e[n];return d[t.operator](r,t.matches,n)}if("equals_attribute"===t.operator||"not_equals_attribute"===t.operator){let n=e[t.attributeA],r=e[t.attributeB];return d[t.operator](n,r)}return!1})}))(l),h=c?`'${c.rule_name}' matched`:"none matched";if(i.vF.verbose(`marketing channel rules evaluated: ${h}`,{attributeLookupTable:l,hasTrackedMarketingChannelPayload:e,matchingRule:c}),!c||e&&!(null!=c&&c.overwritesExisting))return;let p=c.payload;return{...t,...p,referrer_domain:n,referrer_url:s}}},51368:(e,t,n)=>{"use strict";let r;n.d(t,{A:()=>a});let i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},o=new Uint8Array(16),s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));let a=function(e,t,n){if(i.randomUUID&&!t&&!e)return i.randomUUID();let a=(e=e||{}).random??e.rng?.()??function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(o)}();if(a.length<16)throw Error("Random bytes length must be >= 16");if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){if((n=n||0)<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=a[e];return t}return function(e,t=0){return(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase()}(a)}},62698:(e,t,n)=>{"use strict";n.d(t,{B3:()=>o});var r,i=/bot|crawl|http|lighthouse|scan|search|spider/i,o=e=>{var t,n;return null!=(n=null==(t=null==e?void 0:e.match(function(){if(r instanceof RegExp)return r;try{r=RegExp(" daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?{"use strict";n.d(t,{$:()=>r});let r=e=>(!!e).toString()},67340:(e,t,n)=>{"use strict";n.d(t,{wj:()=>s,yp:()=>a});let r=/[^\s@]+@[^\s@]+\.[^\s@]+/,i=/^(?!000|666|9\d{2})\d{3}-(?!00)\d{2}-(?!0000)\d{4}$/,o=/\d{1,5}\s\w+(\s\w+){1,},?\s\w+,\s[A-Z]{2}\s\d{5}(-\d{4})?/,s=e=>{let t=e.match(r);return t?t[0]:null},a=e=>{let t=e;return Array.from(e.matchAll(RegExp(r,"g"))).forEach(([e])=>{t=t.replace(e,(e=>{let t=e.split("@")[0],n="*".repeat(Math.max(0,t.length));return e.replace(t,n)})(e))}),Array.from(e.matchAll(RegExp(r,"g"))).forEach(([e])=>{t=t.replace(e,e.replace(/(\+?1[-.\s]?|)(\(?\d{3}\)?)/,"$1***"))}),Array.from(e.matchAll(RegExp(i,"g"))).forEach(([e])=>{t=t.replace(e,e.replace(/^(?!\*\*\*|000)(\d{3})-(?!\*\*|00)(\d{2})/,"***-**"))}),Array.from(e.matchAll(RegExp(o,"g"))).forEach(([e])=>{t=t.replace(e,(e=>{let t=e.split(" ").slice(1).join(" "),n=t.replace(/[^\s]/g,"*");return e.replace(t,n)})(e))}),t}},70762:(e,t,n)=>{"use strict";n.d(t,{E:()=>o,a:()=>i});var r=n(39249),i=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!o(t,n))return!1}return!0},o=function(e,t){var n,o;if("string"!=typeof e)return!1;if(Array.isArray(t)){var s=!0;try{for(var a=(0,r.Ju)(t),u=a.next();!u.done;u=a.next()){var l=u.value;if(Array.isArray(l))return!1;if("object"==typeof l)s=s&&i(l);else if(!["number","string"].includes(typeof l))return!1;if(!s)return!1}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}}else if(null==t)return!1;else if("object"==typeof t)return i(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0}},71777:(e,t,n)=>{"use strict";n.d(t,{I1:()=>o,vF:()=>a});var r=n(44749);let i=["%c[nitrous]","color:#E90C17"],o=`
:::: ::: ::::::::::: ::::::::::: ::::::::: :::::::: ::: ::: ::::::::
:+:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
:+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#+ +:+ +#+ +#+ +#+ +#++:++#: +#+ +:+ +#+ +:+ +#++:++#++
+#+ +#+#+# +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
### #### ########### ### ### ### ######## ######## ########
`;class s{get logLevel(){var e;return null==(e=r.Pj.getState().config)?void 0:e.logLevel}debug(...e){"debug"===this.logLevel&&console.log(...i,...e)}error(...e){"none"!==this.logLevel&&console.error(...i,...e)}focus(e,...t){"none"!==this.logLevel&&"warning"!==this.logLevel&&console.log(`${i[0]} %c${e}`,i[1],"color:#eb34e5",...t)}log(...e){this.logLevel&&"none"!==this.logLevel&&console.log(...e)}verbose(...e){("verbose"===this.logLevel||"debug"===this.logLevel)&&console.log(...i,...e)}warn(...e){("warning"===this.logLevel||"verbose"===this.logLevel||"debug"===this.logLevel)&&console.warn(...i,...e)}}let a=new s},74194:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var r=n(71777),i=n(12115);let o=(e,t={})=>{let{root:n=null,rootMargin:o="0px 0px 0px 0px",threshold:s=0}=t,[a,u]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{if(!e.current)return r.vF.error(Error("useIntersection: failed to initialize IntersectionObserver because 'ref' is undefined. This likely inidcates a race condition")),()=>{};if("function"!=typeof IntersectionObserver)return r.vF.error(Error("useIntersection: failed to initialize IntersectionObserver because IntersectionObserver api is undefined. This may occur if useIntersection is being run in a server context or if the browser does not implement IntersectionObserver")),()=>{};let t=new IntersectionObserver(e=>{var t;u((null==(t=e[0])?void 0:t.isIntersecting)||!1)},{root:n,rootMargin:o,threshold:s});return t.observe(e.current),()=>{t.disconnect()}},[n,o,e,s]),a}},76383:(e,t,n)=>{"use strict";n.d(t,{TrackContentSection:()=>l});var r=n(95155),i=n(97753),o=n(74194),s=n(71777),a=n(12115),u=n(50210);let l=e=>{let{children:t,id:n}=e,l=(0,a.useRef)(null),c=(0,o.v)(l),d=(0,a.useId)(),f=null!=n?n:d;return(0,a.useEffect)(()=>{try{c&&u.z.events.logContentSectionView(f)}catch(e){s.vF.error(e)}},[c,f]),(0,r.jsx)("div",{ref:l,[i.qD.contentSection]:f,children:t})}},78425:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(71777);let i=()=>{try{return Object.fromEntries(new URL(document.location.href).searchParams.entries())}catch(e){r.vF.error(e)}return{}}},86915:(e,t,n)=>{"use strict";n.d(t,{OP:()=>c,bu:()=>u,e5:()=>s,fS:()=>o,mG:()=>r,mJ:()=>a,pL:()=>l,r:()=>i});var r="-",i="AMP",o="".concat(i,"_unsent"),s="$default_instance",a="https://api2.amplitude.com/2/httpapi",u="https://api.eu.amplitude.com/2/httpapi",l="https://api2.amplitude.com/batch",c="https://api.eu.amplitude.com/batch"},97753:(e,t,n)=>{"use strict";n.d(t,{xD:()=>a,_H:()=>f,sb:()=>u,of:()=>m,lO:()=>l,vm:()=>v,eq:()=>p,qD:()=>d,NM:()=>g,xV:()=>h,eO:()=>c});let r=(e,t)=>({custom_attributes:{...(e=>{var t,n,r;let i=null==(t=e.getTargeting("column"))?void 0:t[0],o=(null==(n=e.getTargeting("refresh"))?void 0:n[0])==="true"?"true":"false",s=null==(r=e.getTargeting("refreshtype"))?void 0:r[0];return{...i&&{ad_rail_side:i},...o&&{ad_refreshed:o},...s&&{ad_refresh_type:s}}})(t),ad_path:e.adPath,ad_slot_id:e.slotId},event_name:"Ad Request Started",event_type:"other"}),i=(e,t)=>({custom_attributes:{...(r(e,t)||{}).custom_attributes||{},ad_advertiser_id:e.advertiserId||void 0,ad_back_fill:null!==e.isBackfill&&void 0!==e.isBackfill?e.isBackfill.toString():void 0,ad_campaign_id:e.campaignId||void 0,ad_creative_id:e.creativeId||void 0,ad_creative_template_id:e.creativeTemplateId||void 0,ad_line_item_id:e.lineItemId||"programmatic",ad_path:e.adPath,ad_slot_id:e.slotId},event_name:"Ad Response Complete",event_type:"other"});var o=n(44749),s=n(82468);let a={location:s.A.EventType.Location,media:s.A.EventType.Media,navigation:s.A.EventType.Navigation,other:s.A.EventType.Other,page_view:void 0,search:s.A.EventType.Search,social:s.A.EventType.Social,transaction:s.A.EventType.Transaction,unknown:s.A.EventType.Unknown,user_content:s.A.EventType.UserContent,user_preference:s.A.EventType.UserPreference},u={eventConfig:{"Ad Render Complete":{enabled:!1},"Ad Request Started":{enabled:!1},"Ad Response Complete":{enabled:!1},"Ad Viewable Impression":{enabled:!1},"Video 100% Complete":{enabled:!1},"Video 25% Complete":{enabled:!1},"Video 50% Complete":{enabled:!1},"Video 75% Complete":{enabled:!1}},inactivityTimeoutMs:3e5,maxCookieSize:1500,sessionDurationMs:18e5,useCookieStorage:!0},l={nitrousAnalyticsHud:"nitrous-analytics-hud"},c=2500,d={contentImpressionId:"data-nitrous-content-impression-id",contentImpressionVariant:"data-nitrous-content-impression-variant",contentReadable:"data-nitrous-content-readable",contentReadableSection:"data-nitrous-content-readable-section",contentSection:"data-nitrous-content-section",experimentKey:"data-nitrous-ab-test",experimentVariant:"data-nitrous-ab-variant",form:"data-nitrous-form",formEventName:"data-nitrous-form-event-name",position:"data-nitrous-position",prefix:"data-nitrous-"},f={impression:(e,t)=>{let n=(r(e,t)||{}).custom_attributes||{},o=(i(e,t)||{}).custom_attributes||{};return{custom_attributes:{...n,...o,ad_size:e.size},event_name:"Ad Impression",event_type:"other"}},impression_viewable:(e,t)=>{let n=(r(e,t)||{}).custom_attributes||{},o=(i(e,t)||{}).custom_attributes||{};return{custom_attributes:{...n,...o,ad_size:e.size},event_name:"Ad Viewable Impression",event_type:"other"}},mounted:void 0,queued:void 0,rendered:(e,t)=>{var n,s,a;let{pageLoadTimeMs:u}=o.Pj.getState(),{size:l,timeline:c}=e,d=(r(e,t)||{}).custom_attributes||{},f=null==(n=c.slice().reverse().find(e=>"requested"===e.type))?void 0:n.timestampMs,h=null==(s=c.slice().reverse().find(e=>"responded"===e.type))?void 0:s.timestampMs,p=null==(a=c.slice().reverse().find(e=>"rendered"===e.type))?void 0:a.timestampMs,v=p&&h?(p-h).toString():void 0,g=f?(f-u).toString():void 0,m=(i(e,t)||{}).custom_attributes||{};return{custom_attributes:{...d,...m,ad_size:l,rendered_in:v,requested_in:g},event_name:"Ad Render Complete",event_type:"other"}},requested:r,responded:i},h=300,p=10,v=1e3,g={base64Email:"n_em",loginHashedEmail:"n_emid"},m={amplitude:!0}}}]);
//# sourceMappingURL=198-487b086686c414c9.js.map