PageSourceSearch

https://www.motortrend.com/_assets/nitrous/nitrous-sdk.js

js motortrend.com collected 2026-09-24 08:26:24 UTC 246,272 bytes, 25 lines download raw bytes

1window.n_qb=window.Nitrous;var Nitrous=(function(j){Object.defineProperty(j,Symbol.toStringTag,{value:"Module"});var _u=Object.create,Ni=Object.defineProperty,bu=Object.getOwnPropertyDescriptor,Eu=Object.getOwnPropertyNames,wu=Object.getPrototypeOf,Tu=Object.prototype.hasOwnProperty,Li=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Su=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Eu(t),o=0,a=i.length,s;o<a;o++)s=i[o],!Tu.call(e,s)&&s!==n&&Ni(e,s,{get:(u=>t[u]).bind(null,s),enumerable:!(r=bu(t,s))||r.enumerable});return e},Iu=(e,t,n)=>(n=e!=null?_u(wu(e)):{},Su(t||!e||!e.__esModule?Ni(n,"default",{value:e,enumerable:!0}):n,e)),Di=e=>{let t;const n=new Set,r=(c,l)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=l??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(v=>v(t,p))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(r,i,s);return s},Au=e=>e?Di(e):Di,Cu=Li((e=>{var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,r={};function i(f,p,v){this.props=f,this.context=p,this.refs=r,this.updater=v||t}i.prototype.isReactComponent={},i.prototype.setState=function(f,p){if(typeof f!="object"&&typeof f!="function"&&f!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,f,p,"setState")},i.prototype.forceUpdate=function(f){this.updater.enqueueForceUpdate(this,f,"forceUpdate")};function o(){}o.prototype=i.prototype;function a(f,p,v){this.props=f,this.context=p,this.refs=r,this.updater=v||t}var s=a.prototype=new o;s.constructor=a,n(s,i.prototype),s.isPureReactComponent=!0;var u=Array.isArray,c={H:null,A:null,T:null,S:null},l=Object.prototype.hasOwnProperty;e.useDebugValue=function(){},e.useSyncExternalStore=function(f,p,v){return c.H.useSyncExternalStore(f,p,v)}})),Pu=Li(((e,t)=>{t.exports=Cu()})),Mi=Iu(Pu(),1),ku=e=>e;function Ou(e,t=ku){const n=Mi.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return Mi.useDebugValue(n),n}var xi=e=>{const t=Au(e),n=r=>Ou(t,r);return Object.assign(n,t),n},Ru=e=>e?xi(e):xi,ar=new Map,dn=e=>{const t=ar.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},Nu=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=ar.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return ar.set(n.name,i),{type:"tracked",store:e,...i}},Lu=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:a,store:s,...u}=t;let c;try{c=(o??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return e(n,r,i);const{connection:l,...f}=Nu(s,c,u);let p=!0;i.setState=(b,h,m)=>{const g=n(b,h);if(!p)return g;const _=m===void 0?{type:a||"anonymous"}:typeof m=="string"?{type:m}:m;return s===void 0?(l?.send(_,r()),g):(l?.send({..._,type:`${s}/${_.type}`},{...dn(u.name),[s]:i.getState()}),g)};const v=(...b)=>{const h=p;p=!1,n(...b),p=h},y=e(i.setState,r,i);if(f.type==="untracked"?l?.init(y):(f.stores[f.store]=i,l?.init(Object.fromEntries(Object.entries(f.stores).map(([b,h])=>[b,b===f.store?y:h.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){const b=i.dispatch;i.dispatch=(...h)=>{b(...h)}}return l.subscribe(b=>{var h;switch(b.type){case"ACTION":if(typeof b.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return sr(b.payload,m=>{if(m.type==="__setState"){if(s===void 0){v(m.state);return}Object.keys(m.state).length!==1&&console.error(`
2                    [zustand devtools middleware] Unsupported __setState action format.
3                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
4                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
5                    `);const g=m.state[s];if(g==null)return;JSON.stringify(i.getState())!==JSON.stringify(g)&&v(g);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(m)});case"DISPATCH":switch(b.payload.type){case"RESET":return v(y),s===void 0?l?.init(i.getState()):l?.init(dn(u.name));
5case"COMMIT":if(s===void 0){l?.init(i.getState());return}return l?.init(dn(u.name));case"ROLLBACK":return sr(b.state,m=>{if(s===void 0){v(m),l?.init(i.getState());return}v(m[s]),l?.init(dn(u.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return sr(b.state,m=>{if(s===void 0){v(m);return}JSON.stringify(i.getState())!==JSON.stringify(m[s])&&v(m[s])});case"IMPORT_STATE":{const{nextLiftedState:m}=b.payload,g=(h=m.computedStates.slice(-1)[0])==null?void 0:h.state;if(!g)return;v(s===void 0?g:g[s]),l?.send(null,m);return}case"PAUSE_RECORDING":return p=!p}return}}),y},Du=Lu,sr=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function Mu(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const o=s=>s===null?null:JSON.parse(s,t?.reviver),a=(i=n.getItem(r))!=null?i:null;return a instanceof Promise?a.then(o):o(a)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,t?.replacer)),removeItem:r=>n.removeItem(r)}}var ur=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ur(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ur(r)(n)}}}},xu=(e,t)=>(n,r,i)=>{let o={storage:Mu(()=>localStorage),partialize:b=>b,version:0,merge:(b,h)=>({...h,...b}),...t},a=!1;const s=new Set,u=new Set;let c=o.storage;if(!c)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...b)},r,i);const l=()=>{const b=o.partialize({...r()});return c.setItem(o.name,{state:b,version:o.version})},f=i.setState;i.setState=(b,h)=>{f(b,h),l()};const p=e((...b)=>{n(...b),l()},r,i);i.getInitialState=()=>p;let v;const y=()=>{var b,h;if(!c)return;a=!1,s.forEach(g=>{var _;return g((_=r())!=null?_:p)});const m=((h=o.onRehydrateStorage)==null?void 0:h.call(o,(b=r())!=null?b:p))||void 0;return ur(c.getItem.bind(c))(o.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==o.version){if(o.migrate){const _=o.migrate(g.state,g.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,g.state];return[!1,void 0]}).then(g=>{var _;const[E,C]=g;if(v=o.merge(C,(_=r())!=null?_:p),n(v,!0),E)return l()}).then(()=>{m?.(v,void 0),v=r(),a=!0,u.forEach(g=>g(v))}).catch(g=>{m?.(void 0,g)})};return i.persist={setOptions:b=>{o={...o,...b},b.storage&&(c=b.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>y(),hasHydrated:()=>a,onHydrate:b=>(s.add(b),()=>{s.delete(b)}),onFinishHydration:b=>(u.add(b),()=>{u.delete(b)})},o.skipHydration||y(),v||p},Uu=xu,Fu=e=>(t,n,r)=>{const i=e(t,n,r);return r.reset=()=>{const o=e(t,n,r);typeof o=="object"&&t(Object.entries(o).reduce((a,[s,u])=>typeof u=="function"||s==="viewCount"?a:{...a,[s]:u},{}))},i},Vu=Fu,cr=(e,t)=>`${e||""}-${t||""}`,Lt=["%c[nitrous]","color:#E90C17"],$u=`
6      ::::    ::: ::::::::::: ::::::::::: :::::::::   ::::::::  :::    :::  :::::::: 
7     :+:+:   :+:     :+:         :+:     :+:    :+: :+:    :+: :+:    :+: :+:    :+: 
8    :+:+:+  +:+     +:+         +:+     +:+    +:+ +:+    +:+ +:+    +:+ +:+         
9   +#+ +:+ +#+     +#+         +#+     +#++:++#:  +#+    +:+ +#+    +:+ +#++:++#++   
10  +#+  +#+#+#     +#+         +#+     +#+    +#+ +#+    +#+ +#+    +#+        +#+    
11 #+#   #+#+#     #+#         #+#     #+#    #+# #+#    #+# #+#    #+# #+#    #+#     
12###    #### ###########     ###     ###    ###  ########   ########   ########       
13`,Hu=class{_enabled=!1;debug(...e){this._enabled&&console.debug(...Lt,...e)}enable(){this._enabled=!0}error(...e){this._enabled&&console.error(...Lt,...e)}focus(e,...t){this._enabled&&console.log(`${Lt[0]} %c${e}`,Lt[1],"color:#eb34e5",...t)}log(...e){this._enabled&&console.log(...e)}warn(...e){this._enabled&&console.warn(...Lt,...e)}},T=new Hu,qu=(e,t)=>({ads:{},adsRefreshPayload:{},resetAdsSlice:()=>e({ads:{}}),resetAdsTimeline:()=>{const{ads:n}=t();e({ads:Object.entries(n).reduce((r,[i,o])=>({...r,[i]:{...o,timeline:[]}}),{}),adsRefreshPayload:{}})},updateAd:(n,r,i)=>{const o=cr(n,r);if(!o)return;
13const a=t().ads||{},s=a[o]||{};return e({ads:{...a,[o]:{...s,...i}}})},updateAdTimeline:(n,r,i)=>{try{const o=Date.now(),a=cr(n,r);if(!a)return;const s=t().ads||{},u=s[a]||{timeline:[]};let c;if(i==="mounted"||i==="queued"||i==="requested")c=o-t().pageLoadTimeMs;else if(i==="responded"){const l=u.timeline.slice().reverse().find(f=>f.type==="requested")?.timestampMs;l!==void 0&&(c=o-l)}else if(i==="rendered"){const l=u.timeline.slice().reverse().find(f=>f.type==="responded")?.timestampMs;l!==void 0&&(c=o-l)}return e({ads:{...s,[a]:{...u,adPath:r,slotId:n,timeline:[...u.timeline||[],{elapsedTimeMs:c,timestampMs:o,type:i}]}}})}catch(o){T.error(o)}}}),ju=e=>({pageLoadTimeMs:Date.now(),setPageLoadTimeMs:t=>e({pageLoadTimeMs:t})}),Bu=(e,t)=>({addClickPosition:n=>e(r=>({clickPositions:[...r.clickPositions,n]})),clickPositions:[],commentsPosted:0,contentSectionsViewed:0,contentSectionsViewedMap:{},currScrollTop:0,handleCommentPosted:()=>e(n=>({commentsPosted:n.commentsPosted+1})),handleContentImpression:(n,r)=>e(i=>({impressions:{...i.impressions,[n]:{...i.impressions[n]||{},variant:r,viewed:!0}}})),handleContentRender:(n,r)=>e(i=>({impressions:{...i.impressions,[n]:{...i.impressions[n]||{},rendered:!0,variant:r}}})),handleContentSectionViewed:n=>{const r={...t().contentSectionsViewedMap||{}};r[n]=(r[n]||0)+1,e({contentSectionsViewed:Object.values(r).filter(i=>i>0).length,contentSectionsViewedMap:r})},impressions:{},incrementScrollBucket:(n,r,i)=>{const o={...t().scrollBucketData};for(let a=n;a<=r;a++)o[a]=(o[a]||0)+i;e({scrollBucketData:o})},lastScrolledAt:new Date().getTime(),resetUesSlice:()=>{e({clickPositions:[],commentsPosted:0,contentSectionsViewed:0,contentSectionsViewedMap:{},impressions:{},scrollBucketData:{}})},resourcePerformance:{},scrollBucketData:{},setMaxScrollTop:n=>{e(r=>({maxScrollTop:n,...r.scrollStartTimeMs===void 0&&{scrollStartTimeMs:Date.now()}}))},updateResourcePerformance:n=>e(r=>({resourcePerformance:{...r.resourcePerformance,...n}}))}),Gu=e=>({hasTrackedMarketingChannelPayload:!1,setHasTrackedMarketingChannelPayload:t=>e({hasTrackedMarketingChannelPayload:t})}),lr="@motortrend/nitrous-web-sdk",Wu=Du(Uu(Vu((...e)=>({...ju(...e),...Bu(...e),...qu(...e),...Gu(...e)})),{name:lr,partialize:e=>({hasTrackedMarketingChannelPayload:e.hasTrackedMarketingChannelPayload})}),{name:lr}),Q=Ru()(Wu),zu=["permutive","amzniid","prmtvctx","ias-kw"],Ku=e=>{const t=googletag.getConfig("targeting")?.targeting,n=Ui(t),r=e.getConfig("targeting")?.targeting,i=Ui(r),o=dr("column",e),a=dr("refresh",e)==="true"?"true":"false",s=dr("refreshtype",e);return{...o&&{ad_rail_side:o},...a&&{ad_refreshed:a},...s&&{ad_refresh_type:s},ads_page_targeting:n,ads_targeting:i}},Ui=e=>!e||typeof e!="object"?[]:Object.entries(e).filter(([t])=>!zu.includes(t)).reduce((t,[n,r])=>(typeof r=="string"?t.push({ads_targeting_key:n,ads_targeting_value:r}):Array.isArray(r)&&r.forEach((i,o)=>{const a=o===0?n:`${n}_${o+1}`;i!=null&&i!==""&&t.push({ads_targeting_key:a,ads_targeting_value:i})}),t),[]),dr=(e,t)=>{const n=(t.getConfig("targeting").targeting||{})[e];return Array.isArray(n)?n[0]:n},Dt=(e,t)=>
13({custom_attributes:{...Ku(t),ad_path:e.adPath,ad_slot_id:e.slotId},event_name:"Ad Request Started",event_type:"other"}),fn=(e,t)=>({custom_attributes:{...(Dt(e,t)||{}).custom_attributes||{},ad_advertiser_id:e.advertiserId||void 0,ad_back_fill:e.isBackfill!==null&&e.isBackfill!==void 0?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"}),Yu=(e,t)=>{const n=(Dt(e,t)||{}).custom_attributes||{},r=(fn(e,t)||{}).custom_attributes||{};return{custom_attributes:{...n,...r,ad_size:e.size},event_name:"Ad Impression",event_type:"other"}},Xu=(e,t)=>{const{pageLoadTimeMs:n}=Q.getState(),{size:r,timeline:i}=e,o=(Dt(e,t)||{}).custom_attributes||{},a=i.slice().reverse().find(p=>p.type==="requested")?.timestampMs,s=i.slice().reverse().find(p=>p.type==="responded")?.timestampMs,u=i.slice().reverse().find(p=>p.type==="rendered")?.timestampMs,c=u&&s?(u-s).toString():void 0,l=a?(a-n).toString():void 0,f=(fn(e,t)||{}).custom_attributes||{};return{custom_attributes:{...o,...f,ad_size:r,rendered_in:c,requested_in:l},event_name:"Ad Render Complete",event_type:"other"}},Qu=(e,t)=>{const n=(Dt(e,t)||{}).custom_attributes||{},r=(fn(e,t)||{}).custom_attributes||{};return{custom_attributes:{...n,...r,ad_size:e.size},event_name:"Ad Viewable Impression",event_type:"other"}},Ju=60*1e3*5,fr=60*1e3*3,pt={nitrousAnalyticsHud:"nitrous-analytics-hud",persistentContext:"nit-context",sessionContext:"nit-session-context"},Zu=2500,q={autoSubmit:"data-nitrous-auto-submit",contentImpressionEvent:"data-nitrous-content-impression-event",contentImpressionId:"data-nitrous-content-id",contentImpressionLabel:"data-nitrous-content-label",contentImpressionVariant:"data-nitrous-content-variant",contentReadable:"data-nitrous-content-readable",contentReadableSection:"data-nitrous-content-readable-section",contentSection:"data-nitrous-content-section",elementId:"data-nitrous-id",elementLink:"data-nitrous-link",elementName:"data-nitrous-element-name",elementParent:"data-nitrous-element-parent",experimentKey:"data-nitrous-ab-test",experimentVariant:"data-nitrous-ab-variant",form:"data-nitrous-form",formEventName:"data-nitrous-form-name",formName:"data-nitrous-form-name",formSubmitOnChange:"data-nitrous-form-submit-on-change",position:"data-nitrous-position",prefix:"data-nitrous-",videoId:"data-nitrous-video-id"},ec={impression:Yu,impression_viewable:Qu,mounted:void 0,queued:void 0,rendered:Xu,requested:Dt,responded:fn},De={base64Email:"n_em",cookie:"n_cg",debug:"nitrousdebug",emid:"n_emid",experimentName:"n_exp",experimentVariant:"n_exp_var",hud:"nitroushud",prHudNumber:"nitroushudpr",prNumber:"nitrouspr",referrer:"referrer",showDeviceId:"n_did"},Fi={eventConfig:{"Ad Render Complete":{enabled:!1},"Ad Request Started":{enabled:!1},"Ad Response Complete":{enabled:!1},"Ad Viewable Impression":{enabled:!1},"Dead Click":{enabled:!1},"Video 100% Complete":{enabled:!1},"Video 25% Complete":{enabled:!1},"Video 50% Complete":{enabled:!1},"Video 75% Complete":{enabled:!1}},useBucketOnLoad:!1};function vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var tc={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function vr(e,t){function n(i,o,a){if(!(typeof document>"u")){a=vn({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in a)a[u]&&(s+="; "+u,a[u]!==!0&&(s+="="+a[u].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var u=o[s].split("="),c=u.slice(1).join("=");try{var l=decodeURIComponent(u[0]);if(a[l]=e.read(c,l),i===l)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",vn({},o,{expires:-1}))},withAttributes:function(i){return vr(this.converter,vn({},this.attributes,i))},withConverter:function(i){return vr(vn({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Mt=vr(tc,{path:"/"}),Ae=()=>{const e=Mt.get("nit");let t;try{e&&(t=JSON.parse(e))}catch{}return t},Ve=e=>{const t=Ae()||{};Mt.set("nit",JSON.stringify({...t,...e}),{expires:365})},nc=e=>{const t=Mt.get(`AMP_${e.substring(0,10)}`);if(t)try{return JSON.parse(atob(t))}catch{}},rc=()=>Mt.get("_HFID"),Vi=()=>Mt.get("mosb"),ic=()=>{try{const e=new URL(window.location.href).searchParams.get(De.cookie);if(e)return JSON.parse(atob(decodeURIComponent(e)))}catch(e){T.error(e)}},mt=()=>{try{return Object.fromEntries(new URL(document.location.href).searchParams.entr
13ies())}catch(e){T.error(e)}return{}},pr=()=>(window.__NITROUS__||(window.__NITROUS__={}),window.__NITROUS__),oc=e=>{const t=pr();t.client=e},K=()=>pr().client,pn=/[^\s@]+@[^\s@]+\.[^\s@]+/,ac=/^(?!000|666|9\d{2})\d{3}-(?!00)\d{2}-(?!0000)\d{4}$/,sc=/\d{1,5}\s\w+(\s\w+){1,},?\s\w+,\s[A-Z]{2}\s\d{5}(-\d{4})?/,$i=e=>{const t=e.match(pn);return t?t[0]:null},uc=e=>pn.test(e),cc=e=>{const t=e.split("@")[0],n="*".repeat(Math.max(0,t.length));return e.replace(t,n)},lc=e=>e.replace(/(\+?1[-.\s]?|)(\(?\d{3}\)?)/,"$1***"),dc=e=>e.replace(/^(?!\*\*\*|000)(\d{3})-(?!\*\*|00)(\d{2})/,"***-**"),fc=e=>{const t=e.split(" ").slice(1).join(" "),n=t.replace(/[^\s]/g,"*");return e.replace(t,n)},vc=e=>"*".repeat(Math.max(0,e.length)),mr=e=>{let t=e;return Array.from(e.matchAll(new RegExp(pn,"g"))).forEach(([n])=>{t=t.replace(n,cc(n))}),Array.from(e.matchAll(new RegExp(pn,"g"))).forEach(([n])=>{t=t.replace(n,lc(n))}),Array.from(e.matchAll(new RegExp(ac,"g"))).forEach(([n])=>{t=t.replace(n,dc(n))}),Array.from(e.matchAll(new RegExp(sc,"g"))).forEach(([n])=>{t=t.replace(n,fc(n))}),t},hr=function(e,t){return hr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},hr(e,t)};function fe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");hr(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var P=function(){return P=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},P.apply(this,arguments)};function gr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function I(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})}function S(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ce(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function ae(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function ht(e){return this instanceof ht?(this.v=e,this):new ht(e)}function pc(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(v){return function(y){return Promise.resolve(y).then(v,f)}}function s(v,y){r[v]&&(i[v]=function(b){return new Promise(function(h,m){o.push([v,b,h,m])>1||u(v,b)})},y&&(i[v]=y(i[v])))}function u(v,y){try{c(r[v](y))}catch(b){p(o[0][3],b)}}function c(v){v.value instanceof ht?Promise.resolve(v.value.v).then(l,f):p(o[0][2],v)}function l(v){u("next",v)}function f(v){u("throw",v)}function p(v,y){v(y),o.shift(),o.length&&u(o[0][0],o[0][1])}}function mc(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof ce=="function"?ce(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,u){a=e[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(c){o({value:c,done:s})},a)}}var hc="Event tracked successfully",gc="Unexpected error occurred",yc="Event rejected due to exceeded retry count",_c="Event skipped due to optOut config",bc="Event rejected due to missing API key",zh="Invalid API key",Ec="Client not initialized",J;(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"})(J||(J={}));var gt=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=J.Unknown),{event:e,code:t,message:n}},yt=function(e){return e?(e^Math.random()*16>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,yt)}
13,wc=(function(){function e(t){this.client=t,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(t,n){var r,i;return I(this,void 0,void 0,function(){return S(this,function(o){switch(o.label){case 0:return this.plugins.some(function(a){return a.name===t.name})?(n.loggerProvider.warn("Plugin with name ".concat(t.name," already exists, skipping registration")),[2]):(t.name===void 0&&(t.name=yt(),n.loggerProvider.warn(`Plugin name is undefined. 
14      Generating a random UUID for plugin name: `.concat(t.name,`. 
15      Set a name for the plugin to prevent it from being added multiple times.`))),t.type=(r=t.type)!==null&&r!==void 0?r:"enrichment",[4,(i=t.setup)===null||i===void 0?void 0:i.call(t,n,this.client)]);case 1:return o.sent(),this.plugins.push(t),[2]}})})},e.prototype.deregister=function(t,n){var r;return I(this,void 0,void 0,function(){var i,o;return S(this,function(a){switch(a.label){case 0:return i=this.plugins.findIndex(function(s){return s.name===t}),i===-1?(n.loggerProvider.warn("Plugin with name ".concat(t," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(r=o.teardown)===null||r===void 0?void 0:r.call(o)]);case 1:return a.sent(),[2]}})})},e.prototype.reset=function(t){this.applying=!1,this.plugins.map(function(n){var r;return(r=n.teardown)===null||r===void 0?void 0:r.call(n)}),this.plugins=[],this.client=t},e.prototype.push=function(t){var n=this;return new Promise(function(r){n.queue.push([t,r]),n.scheduleApply(0)})},e.prototype.scheduleApply=function(t){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},t))},e.prototype.apply=function(t){return I(this,void 0,void 0,function(){var n,r,i,o,a,s,u,v,y,c,l,f,p,v,y,b,h,m,g,_,E,C;return S(this,function(A){switch(A.label){case 0:if(!t)return[2];n=B(t,1),r=n[0],i=B(t,2),o=i[1],a=this.plugins.filter(function(N){return N.type==="before"}),A.label=1;case 1:A.trys.push([1,6,7,8]),s=ce(a),u=s.next(),A.label=2;case 2:return u.done?[3,5]:(v=u.value,v.execute?[4,v.execute(P({},r))]:[3,4]);case 3:if(y=A.sent(),y===null)return o({event:r,code:0,message:""}),[2];r=y,A.label=4;case 4:return u=s.next(),[3,2];case 5:return[3,8];case 6:return c=A.sent(),g={error:c},[3,8];case 7:try{u&&!u.done&&(_=s.return)&&_.call(s)}finally{if(g)throw g.error}return[7];case 8:l=this.plugins.filter(function(N){return N.type==="enrichment"||N.type===void 0}),A.label=9;case 9:A.trys.push([9,14,15,16]),f=ce(l),p=f.next(),A.label=10;case 10:return p.done?[3,13]:(v=p.value,v.execute?[4,v.execute(P({},r))]:[3,12]);case 11:if(y=A.sent(),y===null)return o({event:r,code:0,message:""}),[2];r=y,A.label=12;case 12:return p=f.next(),[3,10];case 13:return[3,16];case 14:return b=A.sent(),E={error:b},[3,16];case 15:try{p&&!p.done&&(C=f.return)&&C.call(f)}finally{if(E)throw E.error}return[7];case 16:return h=this.plugins.filter(function(N){return N.type==="destination"}),m=h.map(function(N){var D=P({},r);return N.execute(D).catch(function($){return gt(D,0,String($))})}),Promise.all(m).then(function(N){var D=B(N,1)[0]||gt(r,100,"Event not tracked, no destination plugins on the instance");o(D)}),[2]}})})},e.prototype.flush=function(){return I(this,void 0,void 0,function(){var t,n,r,i=this;return S(this,function(o){switch(o.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map(function(a){return i.apply(a)}))];case 1:return o.sent(),n=this.plugins.filter(function(a){return a.type==="destination"}),r=n.map(function(a){return a.flush&&a.flush()}),[4,Promise.all(r)];case 2:return o.sent(),[2]}})})},e})(),Kh="AMP",Tc="".concat("AMP","_unsent"),Hi="https://api2.amplitude.com/2/httpapi",Sc="https://api.eu.amplitude.com/2/httpapi",Ic="https://api2.amplitude.com/batch",Ac="https://api.eu.amplitude.com/batch",Cc=1e3,yr=function(e){if(Object.keys(e).length>Cc)return!1;for(var t in e){var n=e[t];if(!qi(t,n))return!1}return!0},qi=function(e,t){var n,r;if(typeof e!="string")return!1;if(Array.isArray(t)){var i=!0;try{for(var o=ce(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if(typeof s=="object")i=i&&yr(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(t==null)return!1;if(typeof t=="object")return yr(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},$e=(function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return P({},this._properties)}
15,e.prototype.set=function(t,n){return this._safeSet(le.SET,t,n),this},e.prototype.setOnce=function(t,n){return this._safeSet(le.SET_ONCE,t,n),this},e.prototype.append=function(t,n){return this._safeSet(le.APPEND,t,n),this},e.prototype.prepend=function(t,n){return this._safeSet(le.PREPEND,t,n),this},e.prototype.postInsert=function(t,n){return this._safeSet(le.POSTINSERT,t,n),this},e.prototype.preInsert=function(t,n){return this._safeSet(le.PREINSERT,t,n),this},e.prototype.remove=function(t,n){return this._safeSet(le.REMOVE,t,n),this},e.prototype.add=function(t,n){return this._safeSet(le.ADD,t,n),this},e.prototype.unset=function(t){return this._safeSet(le.UNSET,t,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[le.CLEAR_ALL]="-",this},e.prototype._safeSet=function(t,n,r){if(this._validate(t,n,r)){var i=this._properties[t];return i===void 0&&(i={},this._properties[t]=i),i[n]=r,this._propertySet.add(n),!0}return!1},e.prototype._validate=function(t,n,r){return this._properties[le.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:t===le.ADD?typeof r=="number":t!==le.UNSET&&t!==le.REMOVE?qi(n,r):!0},e})(),le;(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"})(le||(le={}));var _r;(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 st;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(st||(st={}));var Pc=function(e,t,n){return P(P(P({},typeof e=="string"?{event_type:e}:e),n),t&&{event_properties:t})},ji=function(e,t){return P(P({},t),{event_type:st.IDENTIFY,user_properties:e.getUserProperties()})},kc=function(e,t,n,r){var i;return P(P({},r),{event_type:st.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})},Oc=function(e,t,n){var r,i=new $e;return i.set(e,t),P(P({},n),{event_type:st.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})},Rc=function(e,t){return P(P({},t),{event_type:st.REVENUE,event_properties:e.getEventProperties()})},ye=function(e){return{promise:e||Promise.resolve()}},Nc=(function(){function e(t){t===void 0&&(t="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new wc(this),this.name=t}return e.prototype._init=function(t){return I(this,void 0,void 0,function(){return S(this,function(n){switch(n.label){case 0:return this.config=t,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return n.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(t){return I(this,void 0,void 0,function(){var n,r,i,o,a,s,u,c;return S(this,function(l){switch(l.label){case 0:n=this[t],this[t]=[],l.label=1;case 1:l.trys.push([1,8,9,10]),r=ce(n),i=r.next(),l.label=2;case 2:return i.done?[3,7]:(o=i.value,a=o(),a&&"promise"in a?[4,a.promise]:[3,4]);case 3:return l.sent(),[3,6];case 4:return[4,a];case 5:l.sent(),l.label=6;case 6:return i=r.next(),[3,2];case 7:return[3,10];case 8:return s=l.sent(),u={error:s},[3,10];case 9:try{i&&!i.done&&(c=r.return)&&c.call(r)}finally{if(u)throw u.error}return[7];case 10:return this[t].length?[4,this.runQueuedFunctions(t)]:[3,12];case 11:l.sent(),l.label=12;case 12:return[2]}})})},e.prototype.track=function(t,n,r){var i=Pc(t,n,r);return ye(this.dispatch(i))},e.prototype.identify=function(t,n){var r=ji(t,n);return ye(this.dispatch(r))},e.prototype.groupIdentify=function(t,n,r,i){var o=kc(t,n,r,i);return ye(this.dispatch(o))},e.prototype.setGroup=function(t,n,r){var i=Oc(t,n,r);return ye(this.dispatch(i))},e.prototype.revenue=function(t,n){var r=Rc(t,n);return ye(this.dispatch(r))},e.prototype.add=function(t){return this.isReady?this._addPlugin(t):(this.q.push(this._addPlugin.bind(this,t)),ye())},e.prototype._addPlugin=function(t){return ye(this.timeline.register(t,this.config))},e.prototype.remove=function(t){return this.isReady?this._removePlugin(t):(this.q.push(this._removePlugin.bind(this,t)),ye())},e.prototype._removePlugin=function(t){return ye(this.timeline.deregister(t,this.config))},e.prototype.dispatchWithCallback=function(t,n){if(!this.isReady)return n(gt(t,0,Ec));this.process(t).then(n)},e.prototype.dispatch=function(t){return I(this,void 0,void 0,function(){var n=this;return S(this,function(r){return this.isReady?[2,this.process(t)]:[2,new Promise(function(i){n.dispatchQ.push(n.dispatchWithCallback.bind(n,t,i))})]})})},e.prototype.process=function(t){return I(this,void 0,void 0,function(){var i,n,r,i;return S(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,gt(t,0,_c
15)]:[4,this.timeline.push(t)];case 1:return i=o.sent(),i.code===200?this.config.loggerProvider.log(i.message):i.code===100?this.config.loggerProvider.warn(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return n=o.sent(),r=String(n),this.config.loggerProvider.error(r),i=gt(t,0,r),[2,i];case 3:return[2]}})})},e.prototype.setOptOut=function(t){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!t));return}this._setOptOut(t)},e.prototype._setOptOut=function(t){this.config.optOut=!!t},e.prototype.flush=function(){return ye(this.timeline.flush())},e})(),Lc=(function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(t){return this.productId=t,this},e.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},e.prototype.setPrice=function(t){return this.price=t,this},e.prototype.setRevenueType=function(t){return this.revenueType=t,this},e.prototype.setCurrency=function(t){return this.currency=t,this},e.prototype.setRevenue=function(t){return this.revenue=t,this},e.prototype.setReceipt=function(t){return this.receipt=t,this},e.prototype.setReceiptSig=function(t){return this.receiptSig=t,this},e.prototype.setEventProperties=function(t){return yr(t)&&(this.properties=t),this},e.prototype.getEventProperties=function(){var t=this.properties?P({},this.properties):{};return t[Me.REVENUE_PRODUCT_ID]=this.productId,t[Me.REVENUE_QUANTITY]=this.quantity,t[Me.REVENUE_PRICE]=this.price,t[Me.REVENUE_TYPE]=this.revenueType,t[Me.REVENUE_CURRENCY]=this.currency,t[Me.REVENUE]=this.revenue,t[Me.RECEIPT]=this.receipt,t[Me.RECEIPT_SIG]=this.receiptSig,t},e})(),Me;(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"})(Me||(Me={}));var Dc=function(e,t){var n=Math.max(t,1);return e.reduce(function(r,i,o){var a=Math.floor(o/n);return r[a]||(r[a]=[]),r[a].push(i),r},[])},_e;(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"})(_e||(_e={}));var mn="Amplitude Logger ",Bi=(function(){function e(){this.logLevel=_e.None}return e.prototype.disable=function(){this.logLevel=_e.None},e.prototype.enable=function(t){t===void 0&&(t=_e.Warn),this.logLevel=t},e.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<_e.Verbose||console.log("".concat(mn,"[Log]: ").concat(t.join(" ")))},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<_e.Warn||console.warn("".concat(mn,"[Warn]: ").concat(t.join(" ")))},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<_e.Error||console.error("".concat(mn,"[Error]: ").concat(t.join(" ")))},e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<_e.Debug||console.log("".concat(mn,"[Debug]: ").concat(t.join(" ")))},e})(),hn=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:_e.Warn,loggerProvider:new Bi,offline:!1,optOut:!1,serverUrl:Hi,serverZone:"US",useBatch:!1}},Mc=(function(){function e(t){var n,r,i,o;this._optOut=!1;var a=hn();this.apiKey=t.apiKey,this.flushIntervalMillis=(n=t.flushIntervalMillis)!==null&&n!==void 0?n:a.flushIntervalMillis,this.flushMaxRetries=t.flushMaxRetries||a.flushMaxRetries,this.flushQueueSize=t.flushQueueSize||a.flushQueueSize,this.instanceName=t.instanceName||a.instanceName,this.loggerProvider=t.loggerProvider||a.loggerProvider,this.logLevel=(r=t.logLevel)!==null&&r!==void 0?r:a.logLevel,this.minIdLength=t.minIdLength,this.plan=t.plan,this.ingestionMetadata=t.ingestionMetadata,this.offline=t.offline!==void 0?t.offline:a.offline,this.optOut=(i=t.optOut)!==null&&i!==void 0?i:a.optOut,this.serverUrl=t.serverUrl,this.serverZone=t.serverZone||a.serverZone,this.storageProvider=t.storageProvider,this.transportProvider=t.transportProvider,this.useBatch=(o=t.useBatch)!==null&&o!==void 0?o:a.useBatch,this.loggerProvider.enable(this.logLevel);var s=Gi(t.serverUrl,t.serverZone,t.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(t){this._optOut=t}
15,enumerable:!1,configurable:!0}),e})(),xc=function(e,t){return e==="EU"?t?Ac:Sc:t?Ic:Hi},Gi=function(e,t,n){if(e===void 0&&(e=""),t===void 0&&(t=hn().serverZone),n===void 0&&(n=hn().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:hn().serverZone;return{serverZone:r,serverUrl:xc(r,n)}},Wi=(function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(t,n){this.sdk.metrics.histogram[t]=n},e})();function Uc(e){return e instanceof Error?e.message:String(e)}function gn(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch{}return t}var Fc=(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(t){var n;return I(this,void 0,void 0,function(){var r,i=this;return S(this,function(o){switch(o.label){case 0:return this.config=t,this.storageKey="".concat(Tc,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=o.sent(),r&&r.length>0&&Promise.all(r.map(function(a){return i.execute(a)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(t){var n=this;return t.insert_id||(t.insert_id=yt()),new Promise(function(r){var i={event:t,attempts:0,callback:function(o){return r(o)},timeout:0};n.queue.push(i),n.schedule(n.config.flushIntervalMillis),n.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(t){var n=this;return t.filter(function(r){return r.attempts+=1,r.attempts<n.config.flushMaxRetries?!0:(n.fulfillRequest([r],500,yc),!1)})},e.prototype.scheduleEvents=function(t){var n=this;t.forEach(function(r){n.schedule(r.timeout===0?n.config.flushIntervalMillis:r.timeout)})},e.prototype.schedule=function(t){var n=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&t>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=t,this.scheduleId=setTimeout(function(){n.queue=n.queue.map(function(r){return r.timeout=0,r}),n.flush(!0)},t);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(t){return t===void 0&&(t=!1),I(this,void 0,void 0,function(){var n,r,i,o=this;return S(this,function(a){switch(a.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),n=[],r=[],this.queue.forEach(function(s){return s.timeout===0?n.push(s):r.push(s)}),i=Dc(n,this.config.flushQueueSize),[4,i.reduce(function(s,u){return I(o,void 0,void 0,function(){return S(this,function(c){switch(c.label){case 0:return[4,s];case 1:return c.sent(),[4,this.send(u,t)];case 2:return[2,c.sent()]}})})},Promise.resolve())]);case 1:return a.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(t,n){return n===void 0&&(n=!0),I(this,void 0,void 0,function(){var r,i,o,a,s;return S(this,function(u){switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,bc)];r={api_key:this.config.apiKey,events:t.map(function(c){var l=c.event;return l.extra,gr(l,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Wi,u.label=1;case 1:return u.trys.push([1,3,,4]),i=Gi(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:return o=u.sent(),o===null?(this.fulfillRequest(t,0,gc),[2]):n?(this.handleResponse(o,t),[3,4]):("body"in o?this.fulfillRequest(t,o.statusCode,"".concat(o.status,": ").concat(gn(o))):this.fulfillRequest(t,o.statusCode,o.status),[2]);case 3:return a=u.sent(),s=Uc(a),this.config.loggerProvider.error(s),this.handleResponse({status:J.Failed,statusCode:0},t),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(t,n){var r=t.status;switch(r){case J.Success:this.handleSuccessResponse(t,n);break;case J.Invalid:this.handleInvalidResponse(t,n);break;case J.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,n);break;case J.RateLimit:this.handleRateLimitResponse(t,n);break;default:this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(r,"' provided for ").concat(n.length,' events"}')),this.handleOtherResponse(n);break}},e.prototype.handleSuccessResponse=function(t,n){this.fulfillRequest(n,t.statusCode,hc)},e.prototype.handleInvalidResponse=function(t,n){var r=this;if(t.body.missingField||t.body.error.startsWith("Invalid API key")){this.fulfillRequest(n,t.statusCode,t.body.error);return}var i=ae(ae(ae(ae([],B(Object.values(t.body.eventsWithInvalidFields)),!1),B(Object.values(t.body.eventsWithMissingFields)),!1),B(Object.values(t.body.eventsWithInvalidIdLengths)),!1),B(t.body.silencedEvents),!1).flat(),o=new Set(i),a=n.filter(function(u,c){if
15(o.has(c)){r.fulfillRequest([u],t.statusCode,t.body.error);return}return!0});a.length>0&&this.config.loggerProvider.warn(gn(t));var s=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(s)},e.prototype.handlePayloadTooLargeResponse=function(t,n){if(n.length===1){this.fulfillRequest(n,t.statusCode,t.body.error);return}this.config.loggerProvider.warn(gn(t)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.handleRateLimitResponse=function(t,n){var r=this,i=Object.keys(t.body.exceededDailyQuotaUsers),o=Object.keys(t.body.exceededDailyQuotaDevices),a=t.body.throttledEvents,s=new Set(i),u=new Set(o),c=new Set(a),l=n.filter(function(p,v){if(p.event.user_id&&s.has(p.event.user_id)||p.event.device_id&&u.has(p.event.device_id)){r.fulfillRequest([p],t.statusCode,t.body.error);return}return c.has(v)&&(p.timeout=r.throttleTimeout),!0});l.length>0&&this.config.loggerProvider.warn(gn(t));var f=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(f)},e.prototype.handleOtherResponse=function(t){var n=this,r=t.map(function(o){return o.timeout=o.attempts*n.retryTimeout,o}),i=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(i)},e.prototype.fulfillRequest=function(t,n,r){this.removeEvents(t),t.forEach(function(i){return i.callback(gt(i.event,n,r))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var t=this.queue.map(function(n){return n.event});this.config.storageProvider.set(this.storageKey,t)}},e.prototype.removeEvents=function(t){this.queue=this.queue.filter(function(n){return!t.some(function(r){return r.event.insert_id===n.event.insert_id})}),this.saveEvents()},e})(),Vc=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:$c(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),$c=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Hc=(function(){function e(){this.queue=[]}return e.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},e.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach(function(n){t(n)}),this.queue=[])},e})(),tt=function(){return tt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},tt.apply(this,arguments)};function yn(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function zi(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}var _n=function(e,t){var n,r,i=["string","number","boolean","undefined"],o=typeof e;if(o!==typeof t)return!1;try{for(var a=yn(i),s=a.next();!s.done;s=a.next())if(s.value===o)return e===t}catch(p){n={error:p}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var u=Array.isArray(e),c=Array.isArray(t);if(u!==c)return!1;if(u&&c){for(var l=0;l<e.length;l++)if(!_n(e[l],t[l]))return!1}else{if(!_n(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var f=!0;return Object.keys(e).forEach(function(p){_n(e[p],t[p])||(f=!1)}),f}return!0},qc="$set",jc="$unset",Bc="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var Gc=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,n=tt({},this.identity.userProperties),r=tt(tt({},this.identity),{userProperties:n});return{setUserId:function(i){return r.userId=i,this},setDeviceId:function(i){return r.deviceId=i,this},setUserProperties:function(i){return r.userProperties=i,this},setOptOut:function(i){return r.optOut=i,this},updateUserProperties:function(i){var o,a,s,u,c,l,f=r.userProperties||{};try{for(var p=yn(Object.entries(i)),v=p.next();!v.done;v=p.next()){var y=zi(v.value,2),b=y[0],h=y[1];switch(b){case qc:try{for(var m=(s=void 0,yn(Object.entries(h))),g=m.next();!g.done;g=m.next()){var _=zi(g.value,2),E=_[0],C=_[1];f[E]=C}}catch(D){s={error:D}}finally{try{g&&!g.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}break;case jc:try{for(var A=(c=void 0,yn(Object.keys(h))),N=A.next();!N.done;N=A.next()){var E=N.value;delete f[E]}}catch(D){c={error:D}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(c)throw c.error}}break;case Bc:f={};break}}}catch(D){o={error:D}}finally{try{v&&!v.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}return r.userProperties=f,this},commit:function(){return t.setIdentity(r),this}}},e.prototype.getIdentity=function(){return tt({},this.identity)},e.prototype.setIdentity=function(t){var n=tt({},this.identity);this.identity=tt({}
15,t),_n(n,this.identity)||this.listeners.forEach(function(r){r(t)})},e.prototype.addIdentityListener=function(t){this.listeners.add(t)},e.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},e})(),xt=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,Wc=(function(){function e(){this.identityStore=new Gc,this.eventBridge=new Hc,this.applicationContextProvider=new Vc}return e.getInstance=function(t){return xt.analyticsConnectorInstances||(xt.analyticsConnectorInstances={}),xt.analyticsConnectorInstances[t]||(xt.analyticsConnectorInstances[t]=new e),xt.analyticsConnectorInstances[t]},e})(),Ut=function(e){return e===void 0&&(e="$default_instance"),Wc.getInstance(e)},zc=function(e,t){Ut(t).identityStore.editIdentity().setUserId(e).commit()},Kc=function(e,t){Ut(t).identityStore.editIdentity().setDeviceId(e).commit()},Yc=(function(){function e(){this.name="identity",this.type="before",this.identityStore=Ut().identityStore}return e.prototype.execute=function(t){return I(this,void 0,void 0,function(){var n;return S(this,function(r){return n=t.user_properties,n&&this.identityStore.editIdentity().updateUserProperties(n).commit(),[2,t]})})},e.prototype.setup=function(t){return I(this,void 0,void 0,function(){return S(this,function(n){return t.instanceName&&(this.identityStore=Ut(t.instanceName).identityStore),[2]})})},e})(),He=function(){var e="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[e]<"u")return globalThis[e];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},Ki=function(e,t){return t===void 0&&(t=Date.now()),Date.now()-t>e},Yi=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},Xc=function(e){return"".concat("AMP".toLowerCase(),"_").concat(e.substring(0,6))},Qc=function(){var e,t,n,r;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(r=(n=(t=(e=navigator.languages)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:navigator.language)!==null&&n!==void 0?n:i)!==null&&r!==void 0?r:""},bn=function(){var e,t=He();return!((e=t?.location)===null||e===void 0)&&e.search?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(n,r){var i=r.split("=",2),o=Xi(i[0]),a=Xi(i[1]);return a&&(n[o]=a),n},{}):{}},Xi=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},Jc=function(e){return e===void 0&&(e=0),(new Error().stack||"").split(`
16`).slice(2+e).map(function(t){return t.trim()})},Z=function(e){return function(){var t=P({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},Zc=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");try{for(var i=ce(t.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(a in e)e=e[a];else return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},ee=function(e,t){return function(){var n,r,i={};try{for(var o=ce(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=Zc(e,s)}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},te=function(e,t,n,r,i){return i===void 0&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=n(),u=s.logger,c=s.logLevel;if(c&&c<_e.Debug||!c||!u)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:Jc(1),time:{start:new Date().toISOString()},states:{}};r&&l.states&&(l.states.before=r());var f=e.apply(i,o);return f&&f.promise?f.promise.then(function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),u.debug(JSON.stringify(l,null,2))}):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),u.debug(JSON.stringify(l,null,2))),f}},br=(function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return I(this,void 0,void 0,function(){return S(this,function(t){return[2,!0]})})},e.prototype.get=function(t){return I(this,void 0,void 0,function(){return S(this,function(n){return[2,this.memoryStorage.get(t)]})})},e.prototype.getRaw=function(t){return I(this,void 0,void 0,function(){var n;return S(this,function(r){switch(r.label){case 0:return[4,this.get(t)];case 1:return n=r.sent(),[2,n?JSON.stringify(n):void 0]}})})},e.prototype.set=function(t,n){return I(this,void 0,void 0,function(){return S(this,function(r){return this.memoryStorage.set(t,n),[2]})})},e.prototype.remove=function(t){return I(this,void 0,void 0,function(){return S(this,function(n){return this.memoryStorage.delete(t),[2]})})},e.prototype.reset=function(){return I(this,void 0,void 0,function(){return S(this,function(t){return this.memoryStorage.clear(),[2]})})},e})(),Er=(function(){function e(t){this.options=P({},t)}return e.prototype.isEnabled=function(){return I(this,void 0,void 0,function(){var t,n,r;return S(this,function(i){switch(i.label){case 0:if(!He())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return i.sent(),[4,t.get(n)];case 3:return r=i.sent(),[2,r===e.testValue];case 4:return i.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){var n;return I(this,void 0,void 0,function(){var r,i;return S(this,function(o){switch(o.label){case 0:return[4,this.getRaw(t)];case 1:if(r=o.sent(),!r)return[2,void 0];try{return i=(n=el(r))!==null&&n!==void 0?n:tl(r),i===void 0?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(t,", value: ").concat(r)),[2,void 0]):[2,JSON.parse(i)]}catch{return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(t,", value: ").concat(r)),[2,void 0]}return[2]}})})},e.prototype.getRaw=function(t){var n,r;return I(this,void 0,void 0,function(){var i,o,a;return S(this,function(s){return i=He(),o=(r=(n=i?.document)===null||n===void 0?void 0:n.cookie.split("; "))!==null&&r!==void 0?r:[],a=o.find(function(u){return u.indexOf(t+"=")===0}),a?[2,a.substring(t.length+1)]:[2,void 0]})})},e.prototype.set=function(t,n){var r;return I(this,void 0,void 0,function(){var i,o,a,s,u,c,l;return S(this,function(f){try{i=(r=this.options.expirationDays)!==null&&r!==void 0?r:0,o=n!==null?i:-1,a=void 0,o&&(s=new Date,s.setTime(s.getTime()+o*24*60*60*1e3),a=s),u="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(n)))),a&&(u+="; expires=".concat(a.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),c=He(),c&&(c.document.cookie=u)}catch(p){l=p instanceof Error?p.message:String(p),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(t,". Error: ").concat(l))}return[2]})})},e.prototype.remove=function(t){return I(this,void 0,void 0,function(){return S(this,function(n){switch(n.label){case 0:return[4,this.set(t,null)];case 1:return n.sent(),[2]}})})},e.prototype.reset=function(){return I(this,void 0,void 0,function(){return S(this,function(t){return[2]})})},e})(),el=function(e){try{return decodeURIComponent(atob(e))}catch{return}},tl=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch{return}},nl=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),["AMP",t,e.substring(0,n)].filter(
16Boolean).join("_")},En=(function(){function e(){}return e.prototype.send=function(t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(t){var n,r,i,o,a,s,u,c,l,f,p,v,y,b,h,m,g,_,E,C,A,N;if(typeof t!="object")return null;var D=t.code||0,$=this.buildStatus(D);switch($){case J.Success:return{status:$,statusCode:D,body:{eventsIngested:(n=t.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=t.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(i=t.server_upload_time)!==null&&i!==void 0?i:0}};case J.Invalid:return{status:$,statusCode:D,body:{error:(o=t.error)!==null&&o!==void 0?o:"",missingField:(a=t.missing_field)!==null&&a!==void 0?a:"",eventsWithInvalidFields:(s=t.events_with_invalid_fields)!==null&&s!==void 0?s:{},eventsWithMissingFields:(u=t.events_with_missing_fields)!==null&&u!==void 0?u:{},eventsWithInvalidIdLengths:(c=t.events_with_invalid_id_lengths)!==null&&c!==void 0?c:{},epsThreshold:(l=t.eps_threshold)!==null&&l!==void 0?l:0,exceededDailyQuotaDevices:(f=t.exceeded_daily_quota_devices)!==null&&f!==void 0?f:{},silencedDevices:(p=t.silenced_devices)!==null&&p!==void 0?p:[],silencedEvents:(v=t.silenced_events)!==null&&v!==void 0?v:[],throttledDevices:(y=t.throttled_devices)!==null&&y!==void 0?y:{},throttledEvents:(b=t.throttled_events)!==null&&b!==void 0?b:[]}};case J.PayloadTooLarge:return{status:$,statusCode:D,body:{error:(h=t.error)!==null&&h!==void 0?h:""}};case J.RateLimit:return{status:$,statusCode:D,body:{error:(m=t.error)!==null&&m!==void 0?m:"",epsThreshold:(g=t.eps_threshold)!==null&&g!==void 0?g:0,throttledDevices:(_=t.throttled_devices)!==null&&_!==void 0?_:{},throttledUsers:(E=t.throttled_users)!==null&&E!==void 0?E:{},exceededDailyQuotaDevices:(C=t.exceeded_daily_quota_devices)!==null&&C!==void 0?C:{},exceededDailyQuotaUsers:(A=t.exceeded_daily_quota_users)!==null&&A!==void 0?A:{},throttledEvents:(N=t.throttled_events)!==null&&N!==void 0?N:[]}};case J.Timeout:default:return{status:$,statusCode:D}}},e.prototype.buildStatus=function(t){return t>=200&&t<300?J.Success:t===429?J.RateLimit:t===413?J.PayloadTooLarge:t===408?J.Timeout:t>=400&&t<500?J.Invalid:t>=500?J.Failed:J.Unknown},e})(),rl=(function(e){fe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.send=function(n,r){return I(this,void 0,void 0,function(){var i,o,a;return S(this,function(s){switch(s.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(r),method:"POST"},[4,fetch(n,i)];case 1:return o=s.sent(),[4,o.text()];case 2:a=s.sent();try{return[2,this.buildResponse(JSON.parse(a))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},t})(En),Qi=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],Ji="data-amp-track-",Zi=["div","span","h1","h2","h3","h4","h5","h6"],Ft=function(e,t){return typeof e=="boolean"?e:e?.[t]!==!1},eo=function(e){return Ft(e,"attribution")},il=function(e){return Ft(e,"fileDownloads")},ol=function(e){return Ft(e,"formInteractions")},to=function(e){return Ft(e,"pageViews")},no=function(e){return Ft(e,"sessions")},ro=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.elementInteractions===!0||typeof e.elementInteractions=="object")},al=function(e){if(ro(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.elementInteractions=="object")return e.autocapture.elementInteractions},sl=function(e){var t=function(){return!1},n=void 0,r,i=e.pageCounter;return to(e.defaultTracking)&&(t=void 0,r=void 0,e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.pageViews&&typeof e.defaultTracking.pageViews=="object"&&("trackOn"in e.defaultTracking.pageViews&&(t=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(r=e.defaultTracking.pageViews.eventType))),{trackOn:t,trackHistoryChanges:n,eventType:r,pageCounter:i}},ul=function(e){return eo(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution=="object"?P({},e.defaultTracking.attribution):{}},wr=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,a=r.resolve,s=e&&e[i];if(typeof s=="function"){var u=s.apply(e,o);typeof a=="function"&&a(u?.promise)}}return e},Tr=function(e){var t=e;return t&&t._q!==void 0},io="2.12.2",cl="amplitude-ts",ll="Web",dl="$remote",fl=(function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(cl,"/").concat(io),typeof navigator<"u"&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},e.prototype.execute=function(t){var n,r;return I(this,void 0,void 0,function(){var i,o,a,s;return S(this,function(u){return i=new Date().getTime(),o=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1,a=(r=t.event_id)!==null&&r!==void 0?r:o+1,this.config.lastEventId=a,t.time||(this.config.lastEventTime=i),s=P(P(P(P(P(P(P(P({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:ll}),this.config.trackingOptions.language&&{language:Qc()}),this.config.trackingOptions.ipAddress&&{ip:dl}),{insert_id:yt(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),t),{event_id:a,library:this.library,user_agent:this.userAgent}),[2,s]})})},e})(),oo=(function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return I(this,void 0,void 0,function(){var t,n,r,i;return S(this,function(o){switch(o.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return o.sent(),[4,n.get(r)];case 3:return i=o.sent(),[2,i===t];case 4:return o.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return o.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return I(this,void 0,void 0,function(){var n;return S(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return n=r.sent(),n?[2,JSON.parse(n)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(t){var n;return I(this,void 0,void 0,function(){return S(this,function(r){return[2,((n=this.storage)===null||n===void 0?void 0:n.getItem(t))||void 0]})})},e.prototype.set=function(t,n){var r;return I(this,void 0,void 0,function(){return S(this,function(i){try{(r=this.storage)===null||r===void 0||r.setItem(t,JSON.stringify(n))}catch{}return[2]})})},e.prototype.remove=function(t){var n;return I(this,void 0,void 0,function(){return S(this,function(r){try{(n=this.storage)===null||n===void 0||n.removeItem(t)}catch{}return[2]})})},e.prototype.reset=function(){var t;return I(this,void 0,void 0,function(){return S(this,function(n){try{(t=this.storage)===null||t===void 0||t.clear()}catch{}return[2]})})},e})(),wn=1e3,ao=(function(e){fe(t,e);function t(n){var r=this,i;return r=e.call(this,(i=He())===null||i===void 0?void 0:i.localStorage)||this,r.loggerProvider=n?.loggerProvider,r}return t.prototype.set=function(n,r){var i;return I(this,void 0,void 0,function(){var o;return S(this,function(a){switch(a.label){case 0:return Array.isArray(r)&&r.length>wn?(o=r.length-wn,[4,e.prototype.set.call(this,n,r.slice(0,wn))]):[3,2];case 1:return a.sent(),(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(o," events because the queue length exceeded ").concat(wn,".")),[3,4];case 2:return[4,e.prototype.set.call(this,n,r)];case 3:a.sent(),a.label=4;case 4:return[2]}})})},t})(oo),vl=(function(e){fe(t,e);function t(){var n;return e.call(this,(n=He())===null||n===void 0?void 0:n.sessionStorage)||this}return t}
16)(oo),pl=(function(e){fe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={done:4},n}return t.prototype.send=function(n,r){return I(this,void 0,void 0,function(){var i=this;return S(this,function(o){return[2,new Promise(function(a,s){typeof XMLHttpRequest>"u"&&s(new Error("XHRTransport is not supported."));var u=new XMLHttpRequest;u.open("POST",n,!0),u.onreadystatechange=function(){if(u.readyState===i.state.done){var c=u.responseText;try{a(i.buildResponse(JSON.parse(c)))}catch{a(i.buildResponse({code:u.status}))}}},u.setRequestHeader("Content-Type","application/json"),u.setRequestHeader("Accept","*/*"),u.send(JSON.stringify(r))})]})})},t})(En),ml=(function(e){fe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.send=function(n,r){return I(this,void 0,void 0,function(){var i=this;return S(this,function(o){return[2,new Promise(function(a,s){var u=He();if(!u?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var c=JSON.str
16ingify(r);return u.navigator.sendBeacon(n,JSON.stringify(r))?a(i.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:c.length,server_upload_time:Date.now()})):a(i.buildResponse({code:500}))}catch(l){s(l)}})]})})},t})(En),hl=function(e,t,n){return n===void 0&&(n=!0),I(void 0,void 0,void 0,function(){var r,i,o,a,s,u,c,l,f;return S(this,function(p){switch(p.label){case 0:return r=Xc(e),[4,t.getRaw(r)];case 1:return i=p.sent(),i?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:p.sent(),p.label=3;case 3:return o=B(i.split("."),6),a=o[0],s=o[1],u=o[2],c=o[3],l=o[4],f=o[5],[2,{deviceId:a,userId:gl(s),sessionId:Sr(c),lastEventId:Sr(f),lastEventTime:Sr(l),optOut:!!u}]}})})},Sr=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},gl=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch{return}},Ce="[Amplitude]",Yh="".concat(Ce," Page Viewed"),so="".concat(Ce," Form Started"),yl="".concat(Ce," Form Submitted"),_l="".concat(Ce," File Downloaded"),bl="session_start",El="session_end",wl="".concat(Ce," File Extension"),Tl="".concat(Ce," File Name"),Sl="".concat(Ce," Link ID"),Il="".concat(Ce," Link Text"),Al="".concat(Ce," Link URL"),Ir="".concat(Ce," Form ID"),Ar="".concat(Ce," Form Name"),Cr="".concat(Ce," Form Destination"),uo="cookie",Cl=(function(e){fe(t,e);function t(n,r,i,o,a,s,u,c,l,f,p,v,y,b,h,m,g,_,E,C,A,N,D,$,ie,U,re,de,Ee,xe,Ue,Je,Ge,We){i===void 0&&(i=new br),o===void 0&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),c===void 0&&(c=1e3),l===void 0&&(l=5),f===void 0&&(f=30),p===void 0&&(p=uo),m===void 0&&(m=new Bi),g===void 0&&(g=_e.Warn),E===void 0&&(E=!1),C===void 0&&(C=!1),D===void 0&&(D=""),$===void 0&&($="US"),U===void 0&&(U=1800*1e3),re===void 0&&(re=new ao({loggerProvider:m})),de===void 0&&(de={ipAddress:!0,language:!0,platform:!0}),Ee===void 0&&(Ee="fetch"),xe===void 0&&(xe=!1),Ue===void 0&&(Ue=!1);var L=e.call(this,{apiKey:n,storageProvider:re,transportProvider:co(Ee)})||this;return L.apiKey=n,L.appVersion=r,L.cookieOptions=o,L.defaultTracking=a,L.autocapture=s,L.flushIntervalMillis=c,L.flushMaxRetries=l,L.flushQueueSize=f,L.identityStorage=p,L.ingestionMetadata=v,L.instanceName=y,L.loggerProvider=m,L.logLevel=g,L.minIdLength=_,L.offline=E,L.partnerId=A,L.plan=N,L.serverUrl=D,L.serverZone=$,L.sessionTimeout=U,L.storageProvider=re,L.trackingOptions=de,L.transport=Ee,L.useBatch=xe,L.fetchRemoteConfig=Ue,L.version=io,L._optOut=!1,L._cookieStorage=i,L.deviceId=u,L.lastEventId=b,L.lastEventTime=h,L.optOut=C,L.sessionId=ie,L.pageCounter=Ge,L.userId=Je,L.debugLogsEnabled=We,L.loggerProvider.enable(We?_e.Debug:L.logLevel),L}return Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(n){this._cookieStorage!==n&&(this._cookieStorage=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(n){this._deviceId!==n&&(this._deviceId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(n){this._userId!==n&&(this._userId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(n){this._sessionId!==n&&(this._sessionId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(n){this._optOut!==n&&(this._optOut=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(n){this._lastEventTime!==n&&(this._lastEventTime=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(n){this._lastEventId!==n&&(this._lastEventId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(n){this._pageCounter!==n&&(this._pageCounter=n,this.updateStorage())}
16,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(n){this._debugLogsEnabled!==n&&(this._debugLogsEnabled=n,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var n={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(Yi(this.apiKey),n)},t})(Mc),Pl=function(e,t,n){return t===void 0&&(t={}),I(void 0,void 0,void 0,function(){var r,i,o,a,s,u,c,l,f,p,v,y,b,h,m,g,_,E,C,A,N,D,$,ie,U,re,de,Ee,xe,Ue,Je,Ge,We,L,Y,ot,k,H,M,ge,at,Re,Ct;return S(this,function(Fe){switch(Fe.label){case 0:return r=t.identityStorage||"cookie",C={},r==="cookie"?[3,1]:(o="",[3,5]);case 1:return(N=(A=t.cookieOptions)===null||A===void 0?void 0:A.domain)!==null&&N!==void 0?(a=N,[3,4]):[3,2];case 2:return[4,Ol()];case 3:a=Fe.sent(),Fe.label=4;case 4:o=a,Fe.label=5;case 5:return i=P.apply(void 0,[(C.domain=o,C.expiration=365,C.sameSite="Lax",C.secure=!1,C.upgrade=!0,C),t.cookieOptions]),s=kl(t.identityStorage,i),[4,hl(e,s,($=(D=t.cookieOptions)===null||D===void 0?void 0:D.upgrade)!==null&&$!==void 0?$:!0)];case 6:return u=Fe.sent(),[4,s.get(Yi(e))];case 7:return c=Fe.sent(),l=bn(),f=(Ee=(de=(re=(U=(ie=t.deviceId)!==null&&ie!==void 0?ie:l.ampDeviceId)!==null&&U!==void 0?U:l.deviceId)!==null&&re!==void 0?re:c?.deviceId)!==null&&de!==void 0?de:u.deviceId)!==null&&Ee!==void 0?Ee:yt(),p=(xe=c?.lastEventId)!==null&&xe!==void 0?xe:u.lastEventId,v=(Ue=c?.lastEventTime)!==null&&Ue!==void 0?Ue:u.lastEventTime,y=(Ge=(Je=t.optOut)!==null&&Je!==void 0?Je:c?.optOut)!==null&&Ge!==void 0?Ge:u.optOut,b=(We=c?.sessionId)!==null&&We!==void 0?We:u.sessionId,h=(Y=(L=t.userId)!==null&&L!==void 0?L:c?.userId)!==null&&Y!==void 0?Y:u.userId,n.previousSessionDeviceId=(ot=c?.deviceId)!==null&&ot!==void 0?ot:u.deviceId,n.previousSessionUserId=(k=c?.userId)!==null&&k!==void 0?k:u.userId,m={ipAddress:(M=(H=t.trackingOptions)===null||H===void 0?void 0:H.ipAddress)!==null&&M!==void 0?M:!0,language:(at=(ge=t.trackingOptions)===null||ge===void 0?void 0:ge.language)!==null&&at!==void 0?at:!0,platform:(Ct=(Re=t.trackingOptions)===null||Re===void 0?void 0:Re.platform)!==null&&Ct!==void 0?Ct:!0},g=c?.pageCounter,_=c?.debugLogsEnabled,t.autocapture!==void 0&&(t.defaultTracking=t.autocapture),E=new Cl(e,t.appVersion,s,i,t.defaultTracking,t.autocapture,f,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,r,t.ingestionMetadata,t.instanceName,p,v,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,y,t.partnerId,t.plan,t.serverUrl,t.serverZone,b,t.sessionTimeout,t.storageProvider,m,t.transport,t.useBatch,t.fetchRemoteConfig,h,g,_),[4,E.storageProvider.isEnabled()];case 8:return Fe.sent()||(E.loggerProvider.warn("Storage provider ".concat(E.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),E.storageProvider=new br),[2,E]}})})},kl=function(e,t){switch(e===void 0&&(e=uo),t===void 0&&(t={}),e){case"localStorage":return new ao;case"sessionStorage":return new vl;case"none":return new br;default:return new Er(P(P({},t),{expirationDays:t.expiration}))}},co=function(e){return e==="xhr"?new pl:e==="beacon"?new ml:new rl},Ol=function(e){return I(void 0,void 0,void 0,function(){var t,n,r,i,o,o,a,s,u,c;return S(this,function(l){switch(l.label){case 0:return[4,new Er().isEnabled()];case 1:if(!l.sent()||!e&&(typeof location>"u"||!location.hostname))return[2,""];for(t=e??location.hostname,n=t.split("."),r=[],i="AMP_TLDTEST",o=n.length-2;o>=0;--o)r.push(n.slice(o).join("."));o=0,l.label=2;case 2:return o<r.length?(a=r[o],s={domain:"."+a},u=new Er(s),[4,u.set(i,1)]):[3,7];case 3:return l.sent(),[4,u.get(i)];case 4:return c=l.sent(),c?[4,u.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+a];case 6:return o++,[3,2];case 7:return[2,""]}})})},lo=function(){var e="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[e]<"u")return globalThis[e];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},fo=function(){var e,t=lo();return!((e=t?.location)===null||e===void 0)&&e.search?t.location.search.substring(1).split("&").filter(
16Boolean).reduce(function(n,r){var i=r.split("=",2),o=vo(i[0]),a=vo(i[1]);return a&&(n[o]=a),n},{}):{}},vo=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},Rl="utm_campaign",Nl="utm_content",Ll="utm_id",Dl="utm_medium",Ml="utm_source",xl="utm_term",po="dclid",mo="fbclid",ho="gbraid",go="gclid",yo="ko_click_id",_o="li_fat_id",bo="msclkid",Eo="rtd_cid",wo="ttclid",To="twclid",So="wbraid",Io={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},Ul=(function(){function e(){}return e.prototype.parse=function(){return I(this,void 0,void 0,function(){return S(this,function(t){return[2,P(P(P(P({},Io),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=fo();return{utm_campaign:t[Rl],utm_content:t[Nl],utm_id:t[Ll],utm_medium:t[Dl],utm_source:t[Ml],utm_term:t[xl]}},e.prototype.getReferrer=function(){var t,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(t=r.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},e.prototype.getClickIds=function(){var t,n=fo();return t={},t[po]=n[po],t[mo]=n[mo],t[ho]=n[ho],t[go]=n[go],t[yo]=n[yo],t[_o]=n[_o],t[bo]=n[bo],t[Eo]=n[Eo],t[wo]=n[wo],t[To]=n[To],t[So]=n[So],t},e})(),Tn;(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"})(Tn||(Tn={}));var Ao;(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"})(Ao||(Ao={}));var Co;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(Co||(Co={}));var Sn;(function(e){e.US="US",e.EU="EU"})(Sn||(Sn={}));var In;(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"})(In||(In={}));var Fl=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},Vl="[Amplitude] Page Viewed",$l=function(e){e===void 0&&(e={});var t,n=lo(),r=void 0,i,o,a=e.trackOn,s=e.trackHistoryChanges,u=e.eventType,c=u===void 0?Vl:u,l=function(h){var m=h;try{m=decodeURI(h)}catch(g){r?.error("Malformed URI sequence: ",g)}return m},f=function(){return I(void 0,void 0,void 0,function(){var h,m,g;return S(this,function(_){switch(_.label){case 0:return h=l(typeof location<"u"&&location.href||""),g={event_type:c},m=[{}],[4,Hl()];case 1:return[2,(g.event_properties=P.apply(void 0,[P.apply(void 0,m.concat([_.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":h,"[Amplitude] Page Path":typeof location<"u"&&l(location.pathname)||"","[Amplitude] Page Title":typeof document<"u"&&document.title||"","[Amplitude] Page URL":h.split("?")[0]}]),g)]}})})},p=function(){return typeof a>"u"||typeof a=="function"&&a()},v=typeof location<"u"?location.href:null,y=function(){return I(void 0,void 0,void 0,function(){var h,m,g,_;return S(this,function(E){switch(E.label){case 0:return h=location.href,m=jl(s,h,v||"")&&p(),v=h,m?(r?.log("Tracking page view event"),t!=null?[3,1]:[3,3]):[3,4];case 1:return _=(g=t).track,[4,f()];case 2:_.apply(g,[E.sent()]),E.label=3;case 3:E.label=4;case 4:return[2]}})})},b=function(){y()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(h,m){return I(void 0,void 0,void 0,function(){var g,_;return S(this,function(E){switch(E.label){case 0:return t=m,o=h,r=h.loggerProvider,r.log("Installing @amplitude/plugin-page-view-tracking-browser"),n&&(n.addEventListener("popstate",b),i=n.history.pushState,n.history.pushState=new Proxy(n.history.pushState,{apply:function(C,A,N){var D=B(N,3),$=D[0],ie=D[1],U=D[2];C.apply(A,[$,ie,U]),y()}})),p()?(r.log("Tracking page view event"),_=(g=t).track,[4,f()]):[3,2];case 1:_.apply(g,[E.sent()]),E.label=2;case 2:return[2]}})})},execute:function(h){return I(void 0,void 0,void 0,function(){var m;return S(this,function(g){switch(g.label){case 0:return a==="attribution"&&ql(h)?(r?.log("Enriching c
16ampaign event to page view event with campaign parameters"),[4,f()]):[3,2];case 1:m=g.sent(),h.event_type=m.event_type,h.event_properties=P(P({},h.event_properties),m.event_properties),g.label=2;case 2:return o&&h.event_type===c&&(o.pageCounter=o.pageCounter?o.pageCounter+1:1,h.event_properties=P(P({},h.event_properties),{"[Amplitude] Page Counter":o.pageCounter})),[2,h]}})})},teardown:function(){return I(void 0,void 0,void 0,function(){return S(this,function(h){return n&&(n.removeEventListener("popstate",b),i&&(n.history.pushState=i)),[2]})})}}},Hl=function(){return I(void 0,void 0,void 0,function(){var e;return S(this,function(t){switch(t.label){case 0:return e=Fl,[4,new Ul().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},ql=function(e){if(e.event_type==="$identify"&&e.user_properties){var t=e.user_properties,n=t[Tn.SET]||{},r=t[Tn.UNSET]||{},i=ae(ae([],B(Object.keys(n)),!1),B(Object.keys(r)),!1);return Object.keys(Io).every(function(o){return i.includes(o)})}return!1},jl=function(e,t,n){switch(e){case"pathOnly":if(n=="")return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname;default:return t!==n}},Bl=function(){var e,t=[],n=function(c,l,f){c.addEventListener(l,f),t.push({element:c,type:l,handler:f})},r=function(){t.forEach(function(c){var l=c.element,f=c.type,p=c.handler;l?.removeEventListener(f,p)}),t=[]},i="@amplitude/plugin-form-interaction-tracking-browser",o="enrichment",a=function(c,l){return I(void 0,void 0,void 0,function(){var f,p;return S(this,function(v){return f=function(){if(!l){c.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if(!(typeof document>"u")){var y=function(b){var h=!1;n(b,"change",function(){var m,g=Po(b);h||l.track(so,(m={},m[Ir]=_t(b.id),m[Ar]=_t(b.name),m[Cr]=g,m)),h=!0}),n(b,"submit",function(){var m,g,_=Po(b);h||l.track(so,(m={},m[Ir]=_t(b.id),m[Ar]=_t(b.name),m[Cr]=_,m)),l.track(yl,(g={},g[Ir]=_t(b.id),g[Ar]=_t(b.name),g[Cr]=_,g)),h=!1})};Array.from(document.getElementsByTagName("form")).forEach(y),typeof MutationObserver<"u"&&(e=new MutationObserver(function(b){b.forEach(function(h){h.addedNodes.forEach(function(m){m.nodeName==="FORM"&&y(m),"querySelectorAll"in m&&typeof m.querySelectorAll=="function"&&Array.from(m.querySelectorAll("form")).map(y)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(p=He(),p?p.addEventListener("load",f):c.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},s=function(c){return I(void 0,void 0,void 0,function(){return S(this,function(l){return[2,c]})})},u=function(){return I(void 0,void 0,void 0,function(){return S(this,function(c){return e?.disconnect(),r(),[2]})})};return{name:i,type:o,setup:a,execute:s,teardown:u}},_t=function(e){if(typeof e=="string")return e},Po=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(t??""),window.location.href).href}catch{}return t},Gl=function(){var e,t=[],n=function(c,l,f){c.addEventListener(l,f),t.push({element:c,type:l,handler:f})},r=function(){t.forEach(function(c){var l=c.element,f=c.type,p=c.handler;l?.removeEventListener(f,p)}),t=[]},i="@amplitude/plugin-file-download-tracking-browser",o="enrichment",a=function(c,l){return I(void 0,void 0,void 0,function(){var f,p;return S(this,function(v){return f=function(){if(!l){c.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if(!(typeof document>"u")){var y=function(h){var m;try{m=new URL(h.href,window.location.href)}catch{return}var g=b.exec(m.href),_=g?.[1];_&&n(h,"click",function(){var E;_&&l.track(_l,(E={},E[wl]=_,E[Tl]=m.pathname,E[Sl]=h.id,E[Il]=h.text,E[Al]=h.href,E))})},b=/\.(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(y),typeof MutationObserver<"u"&&(e=new MutationObserver(function(h){h.forEach(function(m){m.addedNodes.forEac
16h(function(g){g.nodeName==="A"&&y(g),"querySelectorAll"in g&&typeof g.querySelectorAll=="function"&&Array.from(g.querySelectorAll("a")).map(y)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(p=He(),p?p.addEventListener("load",f):c.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},s=function(c){return I(void 0,void 0,void 0,function(){return S(this,function(l){return[2,c]})})},u=function(){return I(void 0,void 0,void 0,function(){return S(this,function(c){return e?.disconnect(),r(),[2]})})};return{name:i,type:o,setup:a,execute:s,teardown:u}},ko=!1,Wl=function(e){ko||e.defaultTracking!==void 0||(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:
17
18amplitude.init(<YOUR_API_KEY>, {
19  defaultTracking: true,
20});
21
22Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`),ko=!0)},zl=function(){var e="@amplitude/plugin-network-checker-browser",t="before",n=He(),r=[],i=function(u,c){n&&(n.addEventListener(u,c),r.push({type:u,handler:c}))},o=function(){r.forEach(function(u){var c=u.type,l=u.handler;n&&n.removeEventListener(c,l)}),r=[]},a=function(u,c){return I(void 0,void 0,void 0,function(){return S(this,function(l){return typeof navigator>"u"?(u.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),u.offline=!1,[2]):(u.offline=!navigator.onLine,i("online",function(){u.loggerProvider.debug("Network connectivity changed to online."),u.offline=!1,setTimeout(function(){c.flush()},u.flushIntervalMillis)}),i("offline",function(){u.loggerProvider.debug("Network connectivity changed to offline."),u.offline=!0}),[2])})})},s=function(){return I(void 0,void 0,void 0,function(){return S(this,function(u){return o(),[2]})})};return{name:e,type:t,setup:a,teardown:s}},Kl="Network error occurred, remote config fetch failed",Yl="Remote config successfully fetched",Xl="Remote config fetch rejected due to exceeded retry count",Oo="Remote config fetch rejected due to timeout after 5 seconds",Ro="Unexpected error occurred",Ql="https://sr-client-cfg.amplitude.com/config",Jl="https://sr-client-cfg.stag2.amplitude.com/config",Zl="https://sr-client-cfg.eu.amplitude.com/config",ed=(function(){function e(t){var n=t.localConfig,r=t.configKeys,i=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(o,a,s){return I(i,void 0,void 0,function(){var u,c,l;return S(this,function(f){switch(f.label){case 0:return u=Date.now(),[4,this.fetchWithTimeout(s)];case 1:return c=f.sent(),c&&(l=c.configs&&c.configs[o],l)?(this.metrics.fetchTimeAPISuccess=Date.now()-u,[2,l[a]]):(this.metrics.fetchTimeAPIFail=Date.now()-u,[2,void 0])}})})},this.fetchWithTimeout=function(o){return I(i,void 0,void 0,function(){var a,s,u;return S(this,function(c){switch(c.label){case 0:return a=new AbortController,s=setTimeout(function(){return a.abort()},5e3),[4,this.fetchRemoteConfig(a.signal,o)];case 1:return u=c.sent(),clearTimeout(s),[2,u]}})})},this.fetchRemoteConfig=function(o,a){return I(i,void 0,void 0,function(){var s,u,c,l,f,p,v,y,b,h,m,g,_;return S(this,function(E){switch(E.label){case 0:if(a===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:Xl})];if(o.aborted)return[2,this.completeRequest({err:Oo})];a!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=a,this.attempts=0),E.label=1;case 1:E.trys.push([1,3,,4]),s=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(u=ce(this.configKeys),c=u.next();!c.done;c=u.next())l=c.value,s.append("config_keys",l)}catch(C){m={error:C}}finally{try{c&&!c.done&&(g=u.return)&&g.call(u)}finally{if(m)throw m.error}}return a&&s.set("session_id",String(a)),f={headers:{Accept:"*/*"},method:"GET"},p="".concat(this.getServerUrl(),"?").concat(s.toString()),this.attempts+=1,[4,fetch(p,P(P({},f),{signal:o}))];case 2:if(v=E.sent(),v===null)return[2,this.completeRequest({err:Ro})];switch(y=new En().buildStatus(v.status),y){case In.Success:return this.attempts=0,[2,this.parseAndStore
22Config(v)];case In.Failed:return[2,this.retryFetch(o,a)];default:return[2,this.completeRequest({err:Kl})]}return[3,4];case 3:return b=E.sent(),h=b,o.aborted?[2,this.completeRequest({err:Oo})]:[2,this.completeRequest({err:(_=h.message)!==null&&_!==void 0?_:Ro})];case 4:return[2]}})})},this.retryFetch=function(o,a){return I(i,void 0,void 0,function(){var s=this;return S(this,function(u){switch(u.label){case 0:return[4,new Promise(function(c){return setTimeout(c,s.attempts*s.retryTimeout)})];case 1:return u.sent(),[2,this.fetchRemoteConfig(o,a)]}})})},this.parseAndStoreConfig=function(o){return I(i,void 0,void 0,function(){var a;return S(this,function(s){switch(s.label){case 0:return[4,o.json()];case 1:return a=s.sent(),this.completeRequest({success:Yl}),[2,a]}})})},this.localConfig=n,this.configKeys=r}return e.prototype.getServerUrl=function(){return this.localConfig.serverZone===Sn.STAGING?Jl:this.localConfig.serverZone===Sn.EU?Zl:Ql},e.prototype.completeRequest=function(t){var n=t.err,r=t.success;if(n)throw new Error(n);r&&this.localConfig.loggerProvider.log(r)},e})(),td=function(e){var t=e.localConfig,n=e.configKeys;return I(void 0,void 0,void 0,function(){return S(this,function(r){return[2,new ed({localConfig:t,configKeys:n})]})})},nd=td,rd=(function(){function e(t){this.config=t,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return e.prototype.initialize=function(){return I(this,void 0,void 0,function(){var t;return S(this,function(n){switch(n.label){case 0:return t=this,[4,nd({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return t.remoteConfigFetch=n.sent(),[2]}})})},e.prototype.generateJoinedConfig=function(){var t,n,r,i;return I(this,void 0,void 0,function(){var o,a,s;return S(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),a=this.remoteConfigFetch,a?[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)]:[3,2];case 1:a=u.sent(),u.label=2;case 2:return o=a,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(o,null,2)),o&&"autocapture"in o&&(typeof o.autocapture=="boolean"&&(this.config.autocapture=o.autocapture),typeof o.autocapture=="object"&&(this.config.autocapture===void 0&&(this.config.autocapture=o.autocapture),typeof this.config.autocapture=="boolean"&&(this.config.autocapture=P({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},o.autocapture)),typeof this.config.autocapture=="object"&&(this.config.autocapture=P(P({},this.config.autocapture),o.autocapture))),this.config.defaultTracking=this.config.autocapture),this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),(t=(i=this.config).requestMetadata)!==null&&t!==void 0||(i.requestMetadata=new Wi),!((n=this.remoteConfigFetch)===null||n===void 0)&&n.metrics.fetchTimeAPISuccess&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),!((r=this.remoteConfigFetch)===null||r===void 0)&&r.metrics.fetchTimeAPIFail&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return s=u.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",s),[3,4];case 4:return[2,this.config]}})})},e})(),id=function(e){return I(void 0,void 0,void 0,function(){var t;return S(this,function(n){switch(n.label){case 0:return t=new rd(e),[4,t.initialize()];case 1:return n.sent(),[2,t]}})})},od="@amplitude/plugin-autocapture-browser",No="[Amplitude] Element Clicked",Xh="[Amplitude] Element Changed",ad="[Amplitude] Element ID",sd="[Amplitude] Element Class",Lo="[Amplitude] Element Tag",Do="[Amplitude] Element Text",ud="[Amplitude] Element Hierarchy",cd="[Amplitude] Element Href",ld="[Amplitude] Element Position Left",dd="[Amplitude] Element Position Top",fd="[Amplitude] Element Aria Label",vd="[Amplitude] Element Attributes",pd="[Amplitude] Element Parent Label",Mo="[Amplitude] Page URL",md="[Amplitude] Page Title",hd="[Amplitude] Viewport Height",gd="[Amplitude] Viewport Width",Pr="https://app.amplitude.com",y
22d="https://app.eu.amplitude.com",_d="https://apps.stag2.amplitude.com",bd={US:Pr,EU:yd,STAGING:_d},Ed="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",wd="amp-visual-tagging-selector-highlight";function G(e){return typeof e=="function"}function kr(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Or=kr(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
23`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
24  `):"",this.name="UnsubscriptionError",this.errors=n}});function An(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Vt=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=ce(a),u=s.next();!u.done;u=s.next())u.value.remove(this)}catch(y){t={error:y}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(G(c))try{c()}catch(y){o=y instanceof Or?y.errors:[y]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var f=ce(l),p=f.next();!p.done;p=f.next()){var v=p.value;try{Fo(v)}catch(y){o=o??[],y instanceof Or?o=ae(ae([],B(o)),B(y.errors)):o.push(y)}}}catch(y){r={error:y}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(o)throw new Or(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Fo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&An(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&An(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),xo=Vt.EMPTY;function Uo(e){return e instanceof Vt||e&&"closed"in e&&G(e.remove)&&G(e.add)&&G(e.unsubscribe)}function Fo(e){G(e)?e():e.unsubscribe()}var ut={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Cn={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Cn.delegate;return i?.setTimeout?i.setTimeout.apply(i,ae([e,t],B(n))):setTimeout.apply(void 0,ae([e,t],B(n)))},clearTimeout:function(e){var t=Cn.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Vo(e){Cn.setTimeout(function(){var t=ut.onUnhandledError;if(t)t(e);else throw e})}function Pn(){}var Td=(function(){return Rr("C",void 0,void 0)})();function Sd(e){return Rr("E",void 0,e)}function Id(e){return Rr("N",e,void 0)}function Rr(e,t,n){return{kind:e,value:t,error:n}}var ct=null;function kn(e){if(ut.useDeprecatedSynchronousErrorHandling){var t=!ct;if(t&&(ct={errorThrown:!1,error:null}),e(),t){var n=ct,r=n.errorThrown,i=n.error;if(ct=null,r)throw i}}else e()}function Ad(e){ut.useDeprecatedSynchronousErrorHandling&&ct&&(ct.errorThrown=!0,ct.error=e)}var Nr=(function(e){fe(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Uo(n)&&n.add(r)):r.destination=Od,r}return t.create=function(n,r,i){return new $t(n,r,i)},t.prototype.next=function(n){this.isStopped?Dr(Id(n),this):this._next(n)},t.prototype.error=function(n){this.isStopped?Dr(Sd(n),this):(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped?Dr(Td,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Vt),Cd=Function.prototype.bind;function Lr(e,t){return Cd.call(e,t)}var Pd=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){On(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){On(r)}else On(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){On(n)}},e})(),$t=(function(e){fe(t,e);function t(n,r,i){var o=e.call(this)||this,a;if(G(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;
24o&&ut.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Lr(n.next,s),error:n.error&&Lr(n.error,s),complete:n.complete&&Lr(n.complete,s)}):a=n}return o.destination=new Pd(a),o}return t})(Nr);function On(e){ut.useDeprecatedSynchronousErrorHandling?Ad(e):Vo(e)}function kd(e){throw e}function Dr(e,t){var n=ut.onStoppedNotification;n&&Cn.setTimeout(function(){return n(e,t)})}var Od={closed:!0,next:Pn,error:kd,complete:Pn},Mr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function $o(e){return e}function Rd(e){return e.length===0?$o:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var ve=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=Ld(t)?t:new $t(t,n,r);return kn(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=Ho(n),new n(function(i,o){var a=new $t({next:function(s){try{t(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[Mr]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Rd(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=Ho(t),new t(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},e.create=function(t){return new e(t)},e})();function Ho(e){var t;return(t=e??ut.Promise)!==null&&t!==void 0?t:Promise}function Nd(e){return e&&G(e.next)&&G(e.error)&&G(e.complete)}function Ld(e){return e&&e instanceof Nr||Nd(e)&&Uo(e)}function Dd(e){return G(e?.lift)}function Te(e){return function(t){if(Dd(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function be(e,t,n,r,i){return new Md(e,t,n,r,i)}var Md=(function(e){fe(t,e);function t(n,r,i,o,a,s){var u=e.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(c){try{r(c)}catch(l){n.error(l)}}:e.prototype._next,u._error=o?function(c){try{o(c)}catch(l){n.error(l)}finally{this.unsubscribe()}}:e.prototype._error,u._complete=i?function(){try{i()}catch(c){n.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,u}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t})(Nr),xd=kr(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),qo=(function(e){fe(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new jo(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new xd},t.prototype.next=function(n){var r=this;kn(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=ce(r.currentObservers),s=a.next();!s.done;s=a.next())s.value.next(n)}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;kn(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},t.prototype.complete=function(){var n=this;kn(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0}
24,enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?xo:(this.currentObservers=null,s.push(n),new Vt(function(){r.currentObservers=null,An(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},t.prototype.asObservable=function(){var n=new ve;return n.source=this,n},t.create=function(n,r){return new jo(n,r)},t})(ve),jo=(function(e){fe(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},t.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:xo},t})(qo),Bo={now:function(){return(Bo.delegate||Date).now()},delegate:void 0},Ud=(function(e){fe(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return r===void 0&&(r=0),this},t})(Vt),Rn={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Rn.delegate;return i?.setInterval?i.setInterval.apply(i,ae([e,t],B(n))):setInterval.apply(void 0,ae([e,t],B(n)))},clearInterval:function(e){var t=Rn.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},Fd=(function(e){fe(t,e);function t(n,r){var i=e.call(this,n,r)||this;
vendor: 4,761 bytes, line 24
24return i.scheduler=n,i.work=r,i.pending=!1,i}return t.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Rn.setInterval(n.flush.bind(n,this),i)},t.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Rn.clearInterval(r)},t.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,An(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Ud),Go=(function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=Bo.now,e})(),Vd=(function(e){fe(t,e);function t(n,r){r===void 0&&(r=Go.now);var i=e.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},t})(Go),Nn=new Vd(Fd),$d=Nn,xr=new ve(function(e){return e.complete()});function Wo(e){return e&&G(e.schedule)}function zo(e){return e[e.length-1]}function Ko(e){return Wo(zo(e))?e.pop():void 0}function Hd(e,t){return typeof zo(e)=="number"?e.pop():t}var Ur=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Yo(e){return G(e?.then)}function Xo(e){return G(e[Mr])}function Qo(e){return Symbol.asyncIterator&&G(e?.[Symbol.asyncIterator])}function Jo(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function qd(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Zo=qd();function ea(e){return G(e?.[Zo])}function ta(e){return pc(this,arguments,function(){var n,r,i,o;return S(this,function(a){switch(a.label){case 0:n=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ht(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,ht(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ht(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function na(e){return G(e?.getReader)}function Se(e){if(e instanceof ve)return e;if(e!=null){if(Xo(e))return jd(e);if(Ur(e))return Bd(e);if(Yo(e))return Gd(e);if(Qo(e))return ra(e);if(ea(e))return Wd(e);if(na(e))return zd(e)}throw Jo(e)}function jd(e){return new ve(function(t){var n=e[Mr]();if(G(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Bd(e){return new ve(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function Gd(e){return new ve(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,Vo)})}function Wd(e){return new ve(function(t){var n,r;try{for(var i=ce(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function ra(e){return new ve(function(t){Kd(e,t).catch(function(n){return t.error(n)})})}function zd(e){return ra(ta(e))}function Kd(e,t){var n,r,i,o;return I(this,void 0,void 0,function(){var a,s;return S(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=mc(e),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];
24case 10:return[7];case 11:return t.complete(),[2]}})})}function Ye(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function ia(e,t){return t===void 0&&(t=0),Te(function(n,r){n.subscribe(be(r,function(i){return Ye(r,e,function(){return r.next(i)},t)},function(){return Ye(r,e,function(){return r.complete()},t)},function(i){return Ye(r,e,function(){return r.error(i)},t)}))})}function oa(e,t){return t===void 0&&(t=0),Te(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Yd(e,t){return Se(e).pipe(oa(t),ia(t))}function Xd(e,t){return Se(e).pipe(oa(t),ia(t))}function Qd(e,t){return new ve(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function Jd(e,t){return new ve(function(n){var r;return Ye(n,t,function(){r=e[Zo](),Ye(n,t,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return G(r?.return)&&r.return()}})}function aa(e,t){if(!e)throw new Error("Iterable cannot be null");return new ve(function(n){Ye(n,t,function(){var r=e[Symbol.asyncIterator]();Ye(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Zd(e,t){return aa(ta(e),t)}function ef(e,t){if(e!=null){if(Xo(e))return Yd(e,t);if(Ur(e))return Qd(e,t);if(Yo(e))return Xd(e,t);if(Qo(e))return aa(e,t);if(ea(e))return Jd(e,t);if(na(e))return Zd(e,t)}throw Jo(e)}function sa(e,t){return t?ef(e,t):Se(e)}function ua(e){return e instanceof Date&&!isNaN(e)}var tf=kr(function(e){return function(n){n===void 0&&(n=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=n}});function nf(e,t){var n=ua(e)?{first:e}:typeof e=="number"?{each:e}:e,r=n.first,i=n.each,o=n.with,a=o===void 0?rf:o,s=n.scheduler,u=s===void 0?t??Nn:s,c=n.meta,l=c===void 0?null:c;if(r==null&&i==null)throw new TypeError("No timeout provided.");return Te(function(f,p){var v,y,b=null,h=0,m=function(g){y=Ye(p,u,function(){try{v.unsubscribe(),Se(a({meta:l,lastValue:b,seen:h})).subscribe(p)}catch(_){p.error(_)}},g)};v=f.subscribe(be(p,function(g){y?.unsubscribe(),h++,p.next(b=g),i>0&&m(i)},void 0,void 0,function(){y?.closed||y?.unsubscribe(),b=null})),!h&&m(r!=null?typeof r=="number"?r:+r-u.now():i)})}function rf(e){throw new tf(e)}function qe(e,t){return Te(function(n,r){var i=0;n.subscribe(be(r,function(o){r.next(e.call(t,o,i++))}))})}var of=Array.isArray;function af(e,t){return of(t)?e.apply(void 0,ae([],B(t))):e(t)}function sf(e){return qe(function(t){return af(e,t)})}function uf(e,t,n,r,i,o,a,s){var u=[],c=0,l=0,f=!1,p=function(){f&&!u.length&&!c&&t.complete()},v=function(b){return c<r?y(b):u.push(b)},y=function(b){o&&t.next(b),c++;var h=!1;Se(n(b,l++)).subscribe(be(t,function(m){i?.(m),o?v(m):t.next(m)},function(){h=!0},void 0,function(){if(h)try{c--;for(var m=function(){var g=u.shift();a?Ye(t,a,function(){return y(g)}):y(g)};u.length&&c<r;)m();p()}catch(g){t.error(g)}}))};return e.subscribe(be(t,v,function(){f=!0,p()})),function(){s?.()}}function Ln(e,t,n){return n===void 0&&(n=1/0),G(t)?Ln(function(r,i){return qe(function(o,a){return t(r,o,i,a)})(Se(e(r,i)))},n):(typeof t=="number"&&(n=t),Te(function(r,i){return uf(r,i,e,n)}))}function ca(e){return e===void 0&&(e=1/0),Ln($o,e)}function cf(){return ca(1)}function lf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return cf()(sa(e,Ko(e)))}var df=["addListener","removeListener"],ff=["addEventListener","removeEventListener"],vf=["on","off"];function Ht(e,t,n,r){if(G(n)&&(r=n,n=void 0),r)return Ht(e,t,n).pipe(sf(r));var i=B(hf(e)?ff.map(function(s){return function(u){return e[s](t,u,n)}}):pf(e)?df.map(la(e,t)):mf(e)?vf.map(la(e,t)):[],2),o=i[0],a=i[1];if(!o&&Ur(e))return Ln(function(s){return Ht(s,t,n)})(Se(e));if(!o)throw new TypeError("Invalid event target");return new ve(function(s){var u=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return s.next(1<c.length?c:c[0])};return o(u),function(){return a(u)}})}function la(e,t){return function(n){return function(r){return e[n](t,r)}}}function pf(e){return G(e.addListener)&&G(e.removeListener)}function mf(e){return G(e.on)&&G(e.off)}function hf(e){return G(e.addEventListener)&&G(e.removeEventListener)}function gf(e,t,n){e===void 0&&(e=0),n===void 0&&(n=$d);var r=-1;return t!=null&&(Wo(t)?n=t:r=t),new ve(function(i){var o=ua(e)?+e-n.now():e;o<0&&(o=0);var a=0;return n.schedule(function(){i.closed||(i.next(a++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function da(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ko(e),r=Hd(e,1/0),i=e;return i.length?i.length===1?Se(i[0]):ca(r)(sa(i,n)):xr}function nt(e,t){return Te(function(n,r){var i=0;n.subscribe(be(r,function(o){return e.call(t,o,i++)&&r.next(o)}))})}function yf(e){return Te(function(t,n){var r=[];return t.subscribe(be(n,function(i){return r.push(i)},function(){n.next(r),n.complete()}
24)),Se(e).subscribe(be(n,function(){var i=r;r=[],n.next(i)},Pn)),function(){r=null}})}function _f(e,t){return t===void 0&&(t=Nn),Te(function(n,r){var i=null,o=null,a=null,s=function(){if(i){i.unsubscribe(),i=null;var c=o;o=null,r.next(c)}};function u(){var c=a+e,l=t.now();if(l<c){i=this.schedule(void 0,c-l),r.add(i);return}s()}n.subscribe(be(r,function(c){o=c,a=t.now(),i||(i=t.schedule(u,e),r.add(i))},function(){s(),r.complete()},void 0,function(){o=i=null}))})}function Fr(e){return e<=0?function(){return xr}:Te(function(t,n){var r=0;t.subscribe(be(n,function(i){++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function bf(){return Te(function(e,t){e.subscribe(be(t,Pn))})}function Ef(e){return qe(function(){return e})}function fa(e,t){return t?function(n){return lf(t.pipe(Fr(1),bf()),n.pipe(fa(e)))}:Ln(function(n,r){return Se(e(n,r)).pipe(Fr(1),Ef(n))})}function wf(e,t){t===void 0&&(t=Nn);var n=gf(e,t);return fa(function(){return n})}function Tf(){return Te(function(e,t){var n,r=!1;e.subscribe(be(t,function(i){var o=n;n=i,r&&t.next([o,i]),r=!0}))})}function Dn(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new qo}:t,r=e.resetOnError,i=r===void 0?!0:r,o=e.resetOnComplete,a=o===void 0?!0:o,s=e.resetOnRefCountZero,u=s===void 0?!0:s;return function(c){var l,f,p,v=0,y=!1,b=!1,h=function(){f?.unsubscribe(),f=void 0},m=function(){h(),l=p=void 0,y=b=!1},g=function(){var _=l;m(),_?.unsubscribe()};return Te(function(_,E){v++,!b&&!y&&h();var C=p=p??n();E.add(function(){v--,v===0&&!b&&!y&&(f=Vr(g,u))}),C.subscribe(E),!l&&v>0&&(l=new $t({next:function(A){return C.next(A)},error:function(A){b=!0,h(),f=Vr(m,i,A),C.error(A)},complete:function(){y=!0,h(),f=Vr(m,a),C.complete()}}),Se(_).subscribe(l))})(c)}}function Vr(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new $t({next:function(){i.unsubscribe(),e()}});return Se(t.apply(void 0,ae([],B(n)))).subscribe(i)}}function Sf(e,t){return Te(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(be(r,function(u){i?.unsubscribe();var c=0,l=o++;Se(e(u,l)).subscribe(i=be(r,function(f){return r.next(t?t(u,f,l,c++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}var If=["input","select","textarea"],$r=function(e,t){return function(n,r){var i,o,a,s=e.pageUrlAllowlist,u=e.shouldTrackEventResolver,c=(o=(i=r?.tagName)===null||i===void 0?void 0:i.toLowerCase)===null||o===void 0?void 0:o.call(i);if(!c)return!1;if(u)return u(n,r);if(!Cf(window.location.href,s))return!1;var l=String(r?.getAttribute("type"))||"";if(typeof l=="string")switch(l.toLowerCase()){case"hidden":return!1;case"password":return!1}if(t&&!t.some(function(p){var v;return!!(!((v=r?.matches)===null||v===void 0)&&v.call(r,p))}))return!1;switch(c){case"input":case"select":case"textarea":return n==="change"||n==="click";default:var f=(a=window?.getComputedStyle)===null||a===void 0?void 0:a.call(window,r);return f&&f.getPropertyValue("cursor")==="pointer"&&n==="click"?!0:n==="click"}}},va=function(e){return!(e==null||typeof e=="string"&&(/^(?:(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}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))},Af=function(e){return!!e&&e.nodeType===3},pa=function(e){var t,n,r,i=(n=(t=e?.tagName)===null||t===void 0?void 0:t.toLowerCase)===null||n===void 0?void 0:n.call(t),o=e instanceof HTMLElement?((r=e.getAttribute("contenteditable"))===null||r===void 0?void 0:r.toLowerCase())==="true":!1;return!If.includes(i)&&!o},Hr=function(e){var t="";return pa(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach(function(n){var r="";Af(n)?n.textContent&&(r=n.textContent):r=Hr(n),t+=r.split(/(\s+)/).filter(va).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}),t},Cf=function(e,t){return!t||!t.length?!0:t.some(function(n){return typeof n=="string"?e===n:e.match(n)})},Pf=function(e,t){return e.getAttributeNames().reduce(function(n,r){if(r.startsWith(t)){var i=r.replace(t,""),o=e.getAttribute(r);i&&(n[i]=o||"")}return n},{})},kf=function(e){return e==null||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0},ma=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return kf(r)||(t[n]=r),t},{})},ha=function(e){var t=e.parentElement;if(!t)return"";var n;try{n=t.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch{n=null}if(n){var r=n.textContent||"";return va(r)?r:""}return ha(t)},qr=function(e,t){return e?t.some(function(n){var r;return(r=e?.matches)===null||r===void 0?void 0:r.call(e,n)})?e:qr(e?.parentElement,t):null},Of=function(e){var t,n,r;if(!e)return{};var i=(r=(n=e?.tagName)===null||n===void 0?void 0:n.toLowerCase)===null||r===void 0?void 0:r.call(n);return ma((t={},t[Lo]=i,t[Do]=Hr(e),t[Mo]=window.location.href.split("?")[0],t))},Rf=function(e){return new Promise(function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),(r=document.head)===null||r===void 0||r.appendChild(i)}catch(o){n(o)}})};function Nf(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var jr=function(e){return!(e.event.target===null||!e.closestTrackedAncestor)},Lf=(function(){function e(t){var n=(t===void 0?{}:t).origin,r=n===void 0?Pr:n,i=this;this.endpoint=Pr,this.requestCallbacks={},this.onSelect=function(o){i.notify({action:"element-selected",data:o})},this.onTrack=function(o,a){o==="selector-mode-changed"?i.notify({action:"track-selector-mode-changed",data:a}):o==="selector-moved"&&i.notify({action:"track-selector-moved",data:a})},this.endpoint=r}return e.prototype.notify=function(t){var n,r,i,o;(r=(n=this.logger)===null||n===void 0?void 0:n.debug)===null||r===void 0||r.call(n,"Message sent: ",JSON.stringify(t)),(o=(i=window.opener)===null||i===void 0?void 0:i.postMessage)===null||o===void 0||o.call(i,t,this.endpoint)},e.prototype.sendRequest=function(t,n,r){var i=this;r===void 0&&(r={timeout:15e3});var o=Nf(),a={id:o,action:t,args:n};return new Promise(function(s,u){i.requestCallbacks[o]={resolve:s,reject:u},i.notify(a),r?.timeout>0&&setTimeout(function(){u(new Error("".concat(t," timed out (id: ").concat(o,")"))),delete i.requestCallbacks[o]},r.timeout)})},e.prototype.handleResponse=function(t){var n;if(!this.requestCallbacks[t.id]){(n=this.logger)===null||n===void 0||n.warn("No callback found for request id: ".concat(t.id));return}this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]},e.prototype.setup=function(t){var n=this,r=t===void 0?{}:t,i=r.logger,o=r.endpoint,a=r.isElementSelectable,s=r.cssSelectorAllowlist,u=r.actionClickAllowlist;this.logger=i,o&&this.endpoint==="https://app.amplitude.com"&&(this.endpoint=o
24);var c=null;window.addEventListener("message",function(l){var f,p,v,y,b;if((p=(f=n.logger)===null||f===void 0?void 0:f.debug)===null||p===void 0||p.call(f,"Message received: ",JSON.stringify(l)),n.endpoint===l.origin){var h=l?.data,m=h?.action;if(m)if("id"in h)(y=(v=n.logger)===null||v===void 0?void 0:v.debug)===null||y===void 0||y.call(v,"Received Response to previous request: ",JSON.stringify(l)),n.handleResponse(h);else if(m==="ping")n.notify({action:"pong"});else if(m==="initialize-visual-tagging-selector"){var g=h?.data;Rf(Ed).then(function(){var _;c=(_=window?.amplitudeVisualTaggingSelector)===null||_===void 0?void 0:_.call(window,{getEventTagProps:Of,isElementSelectable:function(E){return a?a(g?.actionType||"click",E):!0},onTrack:n.onTrack,onSelect:n.onSelect,visualHighlightClass:wd,messenger:n,cssSelectorAllowlist:s,actionClickAllowlist:u}),n.notify({action:"selector-loaded"})}).catch(function(){var _;(_=n.logger)===null||_===void 0||_.warn("Failed to initialize visual tagging selector")})}else m==="close-visual-tagging-selector"&&((b=c?.close)===null||b===void 0||b.call(c))}}),this.notify({action:"page-loaded"})},e})(),Df=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],Mf=["type"],xf=["svg","path","g"],Uf=["password","hidden"],Ff=128,Vf=1024;function $f(e){var t,n,r,i,o,a;if(e===null)return null;var s=String(e.tagName).toLowerCase(),u={tag:s},c=Array.from((i=(r=e.parentElement)===null||r===void 0?void 0:r.children)!==null&&i!==void 0?i:[]);c.length&&(u.index=c.indexOf(e),u.indexOfType=c.filter(function(_){return _.tagName===e.tagName}).indexOf(e));var l=(a=(o=e.previousElementSibling)===null||o===void 0?void 0:o.tagName)===null||a===void 0?void 0:a.toLowerCase();l&&(u.prevSib=String(l));var f=e.getAttribute("id");f&&(u.id=String(f));var p=Array.from(e.classList);p.length&&(u.classes=p);var v={},y=Array.from(e.attributes).filter(function(_){return!Df.includes(_.name)}),b=!pa(e);if(!Uf.includes(String(e.getAttribute("type")))&&!xf.includes(s))try{for(var h=ce(y),m=h.next();!m.done;m=h.next()){var g=m.value;b&&!Mf.includes(g.name)||(v[g.name]=String(g.value).substring(0,Ff))}}catch(_){t={error:_}}finally{try{m&&!m.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}return Object.keys(v).length&&(u.attrs=v),u}function Hf(e){var t=[];if(!e)return t;
24t.push(e);for(var n=e.parentElement;n&&n.tagName!=="HTML";)t.push(n),n=n.parentElement;return t}var qf=function(e){var t=[];return e?(t=jf(Hf(e).map(function(n){return $f(n)}),Vf),t):[]};function jf(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(i===null)n+=4;else{var o=Mn(i);n+=o?Array.from(o).length:4}if(n>t)return e.slice(0,r)}return e}function Mn(e,t){t===void 0&&(t=!1);try{if(e==null)return t?"None":null;if(typeof e=="string")return t?(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),e.includes('"')?"'".concat(e,"'"):e.includes("'")?'"'.concat(e.replace(/'/g,"\\'"),'"'):"'".concat(e,"'")):e;if(typeof e=="boolean")return e?"True":"False";if(Array.isArray(e)){var n=e.map(function(o){return Mn(o,!0)});return"[".concat(n.join(", "),"]")}else if(typeof e=="object"){var r=Object.entries(e).filter(function(o){return B(o,1)[0]!=null}).map(function(o){var a=B(o,2),s=a[0],u=a[1];return"".concat(String(Mn(s,!0)),": ").concat(String(Mn(u,!0)))}),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return e.toString()}catch{return null}}var Bf=5;function Gf(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.shouldTrackEvent,o=n.clickObservable,a=da(o.pipe(Tf(),nt(function(s){var u=B(s,2),c=u[0],l=u[1],f=c.event.target!==l.event.target,p=Math.abs(l.event.screenX-c.event.screenX)<=20&&Math.abs(l.event.screenY-c.event.screenY)<=20;return f&&!p})),o.pipe(_f(r.debounceTime),qe(function(){return"timeout"})));return o.pipe(wf(0),nt(jr),nt(function(s){return i("click",s.closestTrackedAncestor)}),yf(a)).subscribe(function(s){var u,c,l=(s.length>=Bf,No);try{for(var f=ce(s),p=f.next();!p.done;p=f.next()){var v=p.value;t?.track(l,v.targetElementProperties)}}catch(y){u={error:y}}finally{try{p&&!p.done&&(c=f.return)&&c.call(f)}finally{if(u)throw u.error}}})}function Wf(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent;return n.changeObservable.pipe(nt(jr),nt(function(o){return i("change",o.closestTrackedAncestor)})).subscribe(function(o){t?.track("[Amplitude] Element Changed",r("change",o.closestTrackedAncestor))})}function zf(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,a=e.shouldTrackActionClick,s=n.clickObservable,u=n.mutationObservable,c=n.navigateObservable,l=s.pipe(nt(function(v){return!o("click",v.closestTrackedAncestor)}),qe(function(v){return v.closestTrackedAncestor=qr(v.event.target,r.actionClickAllowlist),v.closestTrackedAncestor!==null&&(v.targetElementProperties=i(v.type,v.closestTrackedAncestor)),v}),nt(jr),nt(function(v){return a("click",v.closestTrackedAncestor)})),f=[u];c&&f.push(c);var p=da.apply(void 0,ae([],B(f),!1));return l.pipe(Sf(function(v){return p.pipe(Fr(1),nf({first:500,with:function(){return xr}}),qe(function(){return v}))})).subscribe(function(v){t?.track("[Amplitude] Element Clicked",i("click",v.closestTrackedAncestor))})}var bt;(function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"})(bt||(bt={}));function Kf(e){return e.type==="click"||e.type==="change"}var Yf=function(e){var t,n,r;e===void 0&&(e={});var i=e.dataAttributePrefix,o=i===void 0?Ji:i,a=e.visualTaggingOptions,s=a===void 0?{enabled:!0,messenger:new Lf}:a;e.cssSelectorAllowlist=(t=e.cssSelectorAllowlist)!==null&&t!==void 0?t:Qi,e.actionClickAllowlist=(n=e.actionClickAllowlist)!==null&&n!==void 0?n:Zi,e.debounceTime=(r=e.debounceTime)!==null&&r!==void 0?r:0;var u=od,c="enrichment",l=[],f=function(){var m,g=Ht(document,"click",{capture:!0}).pipe(qe(function(A){return v(A,"click")}),Dn()),_=Ht(document,"change",{capture:!0}).pipe(qe(function(A){return v(A,"change")}),Dn()),E;window.navigation&&(E=Ht(window.navigation,"navigate").pipe(qe(function(A){return v(A,"navigate")}),Dn()));var C=new ve(function(A){var N=new MutationObserver(function(D){A.next(D)});return N.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return N.disconnect()}}).pipe(qe(function(A){return v(A,"mutation")}),Dn());return m={},m[bt.ClickObservable]=g,m[bt.ChangeObservable]=_,m[bt.NavigateObservable]=E,m[bt.MutationObservable]=C,m},p=function(m,g){var _,E,C,A=(C=(E=g?.tagName)===null||E===void 0?void 0:E.toLowerCase)===null||C===void 0?void 0:C.call(E),N=typeof g.getBoundingClientRect=="function"?g.getBoundingClientRect():{left:null,top:null},D=g.getAttribute("aria-label"),$=Pf(g,o),ie=ha(g),U=(_={},_[ad]=g.getAttribute("id")||"",_[sd]=g.getAttribute("class"),_[ud]=qf(g),_[Lo]=A,_[Do]=Hr(g),_[ld]=N.left==null?null:Math.round(N.left),_[dd]=N.top==null?null:Math.round(N.top),_[fd]=D,_[vd]=$,_[pd]=ie,_[Mo]=window.location.href.split("?")[0],_[md]=typeof document<"u"&&document.title||"",_[hd]=window.innerHeight,_[gd]=window.innerWidth,_);return A==="a"&&m==="click"&&g instanceof HTMLAnchorElement&&(U[cd]=g.href),ma(U)},v=function(m,g){var _={event:m,timestamp:Date.now(),type:g};if(Kf(_)&&_.event.target!==null){var E=qr(_.event.target,e.cssSelectorAllowlist);return E&&(_.closestTrackedAncestor=E,_.targetElementProperties=p(_.type,E)),_}return _},y=function(m,g){return I(void 0,void 0,void 0,function(){var _,E,C,A,N,D,$,ie,U,re;return S(this,function(de){return typeof document>"u"?[2]:(_=$r(e,e.cssSelectorAllowlist),E=$r(e,e.actionClickAllowlist),C=f(),A=Gf({allObservables:C,options:e,amplitude:g,shouldTrackEvent:_}),l.push(A),N=Wf({allObservables:C,getEventProperties:p,amplitude:g,shouldTrackEvent:_}),l.push(N),D=zf({allObservables:C,options:e,getEventProperties:p,amplitude:g,shouldTrackEvent:_,shouldTrackActionClick:E}),l.push(D),(U=m?.loggerProvider)===null||U===void 0||U.log("".concat(u," has been successfully added.")),window.opener&&s.enabled&&($=e.cssSelectorAllowlist,ie=e.actionClickAllowlist,(re=s.messenger)===null||re===void 0||re.setup(P(P({logger:m?.loggerProvider},m?.serverZone&&{endpoint:bd[m.serverZone]}),{isElementSelectable:$r(e,ae(ae([],B($),!1),B(ie),!1)),cssSelectorAllowlist:$,actionClickAllowlist:ie}))),[2])})})},b=function(m){return I(void 0,void 0,void 0,function(){return S(this,function(g){return[2,m]})})},h=function(){return I(void 0,void 0,void 0,function(){var m,g,_,E,C;return S(this,function(A){try{for(m=ce(l),g=m.next();!g.done;g=m.next())_=g.value,_.unsubscribe()}catch(N){E={error:N}}finally{try{g&&!g.done&&(C=m.return)&&C.call(m)}finally{if(E)throw E.error}}return[2]})})};return{name:u,type:c,setup:y,execute:b,teardown:h}},Xf="utm_campaign",Qf="utm_content",Jf="utm_id",Zf="utm_medium",ev="utm_source",tv="utm_term",ga="dclid",ya="fbclid",_a="gbraid",ba="gclid",Ea="ko_click_id",wa="li_fat_id",Ta="msclkid",Sa="rtd_cid",Ia="ttclid",Aa="twclid",Ca="wbraid",Br={utm_campaign:void 0,utm_c
24ontent: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},Pa=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},nv=function(e){return Object.values(e).every(function(t){return!t})},rv=function(e,t,n,r,i){i===void 0&&(i=!0),e.referrer;var o=e.referring_domain,a=gr(e,["referrer","referring_domain"]),s=t||{};s.referrer;var u=s.referring_domain,c=gr(s,["referrer","referring_domain"]);if(iv(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&&nv(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var l=JSON.stringify(a)!==JSON.stringify(c),f=Pa(o||"")!==Pa(u||""),p=!t||l||f;return p?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."),p},iv=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=""),e.some(function(n){return n instanceof RegExp?n.test(t):n===t})},ov=function(e,t){var n=P(P({},Br),e);return ji(Object.entries(n).reduce(function(r,i){var o,a=B(i,2),s=a[0],u=a[1];return r.setOnce("initial_".concat(s),(o=u??t.initialEmptyValue)!==null&&o!==void 0?o:"EMPTY"),u?r.set(s,u):r.unset(s)},new $e))},av=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},sv=(function(){function e(){}return e.prototype.parse=function(){return I(this,void 0,void 0,function(){return S(this,function(t){return[2,P(P(P(P({},Br),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=bn();return{utm_campaign:t[Xf],utm_content:t[Qf],utm_id:t[Jf],utm_medium:t[Zf],utm_source:t[ev],utm_term:t[tv]}},e.prototype.getReferrer=function(){var t,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(t=r.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},e.prototype.getClickIds=function(){var t,n=bn();return t={},t[ga]=n[ga],t[ya]=n[ya],t[_a]=n[_a],t[ba]=n[ba],t[Ea]=n[Ea],t[wa]=n[wa],t[Ta]=n[Ta],t[Sa]=n[Sa],t[Ia]=n[Ia],t[Aa]=n[Aa],t[Ca]=n[Ca],t},e})(),uv=(function(){function e(t,n){var r;this.shouldTrackNewCampaign=!1,this.options=P({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:av((r=n.cookieOptions)===null||r===void 0?void 0:r.domain)},t),this.storage=n.cookieStorage,this.storageKey=nl(n.apiKey,"MKTG"),this.currentCampaign=Br,this.sessionTimeout=n.sessionTimeout,this.lastEventTime=n.lastEventTime,this.logger=n.loggerProvider,n.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return I(this,void 0,void 0,function(){var t,n;return S(this,function(r){switch(r.label){case 0:return[4,this.fetchCampaign()];case 1:return n=B.apply(void 0,[r.sent(),2]),this.currentCampaign=n[0],this.previousCampaign=n[1],t=this.lastEventTime?Ki(this.sessionTimeout,this.lastEventTime):!0,rv(this.currentCampaign,this.previousCampaign,this.options,this.logger,t)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return I(this,void 0,void 0,function(){return S(this,function(t){switch(t.label){case 0:return[4,Promise.all([new sv().parse(),this.storage.get(this.storageKey)])];case 1:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(t){this.shouldTrackNewCampaign=!1;var n=ov(this.currentCampaign,this.options);return t&&(n.event_id=t),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e})(),cv=(function(e){fe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(n,r,i){n===void 0&&(n="");var o,a;return arguments.length>2?(o=r,a=i):typeof r=="string"?(o=r,a=void 0):(o=r?.userId,a=r),ye(this._init(P(P({},a),{userId:o,apiKey:n})))},t.prototype._init=function(n){var r,i,o;return I(this,void 0,void 0,function(){var a,s,u,c,l,f,p=this;return S(this,function(v){switch(v.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,Pl(n.apiKey,n,this)]);case 1:return a=v.sent(),n.fetchRemoteConfig?[4,id(a)]:[3,4];case 2:return s=v.sent(),[4,s.generateJoinedConfig()];case 3:a=v.sent(),v.label=4;case 4:return[4,e.prototype._init.call(this,a)];case 5:return v.sent(),this.logBrowserOptions(a),eo(this.config.defaultTracking)?(u=ul(this.config),this.webAttribution=new uv(u,this.config),[4,this.webAttribution.init()]):[3,7];case 6:v.sent(),v.label=7;case 7:return c=bn(),l=Number.isNaN(Number(c.ampSessionId))?void 0:Number(c.ampSessionId),this.setSessionId((o=(i=(r=n.sessionId)!==null&&r!==void 0?r:l)!==null&&i!==void 0?i:this.config.sessionId)!==null&&o!==void 0?o:Date.now()),f=Ut(n.instanceName),f.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===null?[3,9]:[4,this.add(zl()).promise];case 8:v.sent(),v.label=9;case 9:return[4,this.add(new Fc).promise];case 10:return v.sent(),[4,this.add(new fl).promise];case 11:return v.sent(),[4,this.add(new Yc).promise];case 12:return v.sent(),Wl(this.config),il(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Gl()).promise]):[3,14];case 13:v.sent(),v.label=14;case 14:return ol(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Bl()).promise]):[3,16];case 15:v.sent(),v.label=16;case 16:return to(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add($l(sl(this.config))).promise]):[3,18];case 17:v.sent(),v.label=18;case 18:return ro(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Yf(al(this.config))).promise]):[3,20];case 19:v.sent(),v.label=20;case 20:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 21:return v.sent(),f.eventBridge.setEventReceiver(function(y){p.track(y.eventType,y.eventProperties)}),[2]}})})},t.prototype.getUserId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.userId},t.prototype.setUserId=function(n){if(!this.config){this.q.push(this.setUserId.bind(this,n));return}
24this.config.loggerProvider.debug("function setUserId: ",n),(n!==this.config.userId||n===void 0)&&(this.config.userId=n,zc(n,this.config.instanceName))},t.prototype.getDeviceId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.deviceId},t.prototype.setDeviceId=function(n){if(!this.config){this.q.push(this.setDeviceId.bind(this,n));return}this.config.loggerProvider.debug("function setDeviceId: ",n),this.config.deviceId=n,Kc(n,this.config.instanceName)},t.prototype.reset=function(){this.setDeviceId(yt()),this.setUserId(void 0)},t.prototype.getSessionId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.sessionId},t.prototype.setSessionId=function(n){var r,i=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,n)),ye(Promise.resolve());if(n===this.config.sessionId)return ye(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",n);var o=this.getSessionId(),a=this.config.lastEventTime,s=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1;this.config.sessionId=n,this.config.lastEventTime=void 0,this.config.pageCounter=0,no(this.config.defaultTracking)&&(o&&a&&i.push(this.track(El,void 0,{device_id:this.previousSessionDeviceId,event_id:++s,session_id:o,time:a+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var u=this.trackCampaignEventIfNeeded(++s,i);return no(this.config.defaultTracking)&&i.push(this.track(bl,void 0,{event_id:u?++s:s,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,ye(Promise.all(i))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(n){if(!this.config){this.q.push(this.setTransport.bind(this,n));return}this.config.transportProvider=co(n)},t.prototype.identify=function(n,r){if(Tr(n)){var i=n._q;n._q=[],n=wr(new $e,i)}return r?.user_id&&this.setUserId(r.user_id),r?.device_id&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,n,r)},t.prototype.groupIdentify=function(n,r,i,o){if(Tr(i)){var a=i._q;i._q=[],i=wr(new $e,a)}return e.prototype.groupIdentify.call(this,n,r,i,o)},t.prototype.revenue=function(n,r){if(Tr(n)){var i=n._q;n._q=[],n=wr(new Lc,i)}return e.prototype.revenue.call(this,n,r)},t.prototype.trackCampaignEventIfNeeded=function(n,r){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var i=this.webAttribution.generateCampaignEvent(n);return r?r.push(this.track(i).promise):this.track(i),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(n){return I(this,void 0,void 0,function(){var r,i,o;return S(this,function(a){return r=Date.now(),i=Ki(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),n.event_type!=="session_start"&&n.event_type!=="session_end"&&(!n.session_id||n.session_id===this.getSessionId())&&(i||o?(this.setSessionId(r),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):i||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,n)]})})},t.prototype.logBrowserOptions=function(n){try{var r=P(P({},n),{apiKey:n.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(r))}catch(i){this.config.loggerProvider.error("Error logging browser config",i)}},t})(Nc),lv=function(){var e=new cv;return{init:te(e.init.bind(e),"init",Z(e),ee(e,["config"])),add:te(e.add.bind(e),"add",Z(e),ee(e,["config.apiKey","timeline.plugins"])),remove:te(e.remove.bind(e),"remove",Z(e),ee(e,["config.apiKey","timeline.plugins"])),track:te(e.track.bind(e),"track",Z(e),ee(e,["config.apiKey","timeline.queue.length"])),logEvent:te(e.logEvent.bind(e),"logEvent",Z(e),ee(e,["config.apiKey","timeline.queue.length"])),identify:te(e.identify.bind(e),"identify",Z(e),ee(e,["config.apiKey","timeline.queue.length"])),groupIdentify:te(e.groupIdentify.bind(e),"groupIdentify",Z(e),ee(e,["config.apiKey","timeline.queue.length"])),setGroup:te(e.setGroup.bind(e),"setGroup",Z(e),ee(e,["config.apiKey","timeline.queue.length"])),revenue:te(e.revenue.bind(e),"revenue",Z(e),ee(e,["config.apiKey","timeline.queue.length"])),flush:te(e.flush.bind(e),"flush",Z(e),ee(e,["config.apiKey","timeline.queue.length"])),getUserId:te(e.getUserId.bind(e),"getUserId",Z(e),ee(e,["config","config.userId"])),setUserId:te(e.setUserId.bind(e),"setUserId",Z(e),ee(e,["config","config.userId"])),getDeviceId:te(e.getDeviceId.bind(e),"getDeviceId",Z(e),ee(e,["config","config.deviceId"])),setDeviceId:te(e.setDeviceId.bind(e),"setDeviceId",Z(e),ee(e,["config","config.deviceId"])),reset:te(e.reset.bind(e),"reset",Z(e),ee(e,["config","config.userId","config.deviceId"])),getSessionId:te(e.getSessionId.bind(e),"getSessionId",Z(e),ee(e,["config"])),setSessionId:te(e.setSessionId.bind(e),"setSessionId",Z(e),ee(e,["config"])),extendSession:te(e.extendSession.bind(e),"extendSession",Z(e),ee(e,["config"])),setOptOut:te(e.setOptOut.bind(e),"setOptOut",Z(e),ee(e,["config"])),setTransport:te(e.setTransport.bind(e),"setTransport",Z(e),ee(e,["config"]))}},ne=lv(),Qh=ne.add,Jh=ne.extendSession,dv=ne.flush,Gr=ne.getDeviceId,Z
24h=ne.getSessionId,xn=ne.getUserId,eg=ne.groupIdentify,Et=ne.identify,fv=ne.init,qt=ne.logEvent,tg=ne.remove,ng=ne.reset,rg=ne.revenue,ig=ne.setDeviceId,og=ne.setGroup,ag=ne.setOptOut,sg=ne.setSessionId,ug=ne.setTransport,wt=ne.setUserId,vv=ne.track,ka;(function(e){e.IdentifyOperation=_r,e.SpecialEventType=st,e.RevenueProperty=Me,e.LogLevel=_e,e.OfflineDisabled=null,e.DEFAULT_CSS_SELECTOR_ALLOWLIST=Qi,e.DEFAULT_DATA_ATTRIBUTE_PREFIX=Ji,e.DEFAULT_ACTION_CLICK_ALLOWLIST=Zi})(ka||(ka={}));var Oa=async()=>{const e=Ae();if(e?.auth){const{email:t,payload:n,type:r}=e.auth;r==="login"&&t?await K()?.login(t,n):r==="signup"&&t?await K()?.signup(t,n):r==="login-sync"&&t&&!e.loginSync&&(await Ra(t,n),Ve({loginSync:!0})),Ve({auth:void 0})}else e?.loginSyncInit&&!e?.loginSync&&e?.loginSyncInit.email&&(await Ra(e.loginSyncInit.email,e.loginSyncInit),Ve({loginSync:!0,loginSyncInit:void 0}))},Ra=async(e,t)=>{try{const n=Fn();xn()||wt(e);const r=new $e;let i;typeof t?.mylo_username=="string"&&(i=t.mylo_username,r.set("mylo_username",t.mylo_username)),r.set("email",e),Et(r),n&&i&&await Da({amplitudeDeviceId:n,email:e,myloUsername:i})}catch(n){T.error("Failed to handle login sync",n)}},Na=async(e,t,n)=>{const r=Fn();wt(e);const i=new $e;i.set("logged_in",!0),i.set("auth_flow",n),typeof t?.auth_provider=="string"&&i.set("auth_provider",t.auth_provider);let o;typeof t?.mylo_username=="string"&&(o=t.mylo_username,i.set("mylo_username",t.mylo_username));let a;uc(e)&&(a=e,i.set("email",e)),Et(i),r&&o&&await Da({amplitudeDeviceId:r,email:a,myloUsern
24ame:o})},pv=()=>{const e=mt(),t=e[De.base64Email];if(t){wt(window.atob(t));return}const n=e[De.emid];if(n){wt(n);return}const r=Ae();if(r?.auth?.email){wt(r.auth.email);return}},mv=e=>{const t=rc(),n=Vi();K()?.setUserAttributes({...e===!0&&{is_new_user:!0},...t&&{hfid:t},...n&&{mosb:n}})},hv=e=>{const t=nc(e),n=Ae();return t?.deviceId===void 0&&n?.deviceId===void 0},La=(e,t)=>{const n=K()?.getConfig();return n?.environment==="development"||n?.appName==="motortrend"||n?.appName==="NextWeb"?fetch(`https://nitrous-id-api.prod.hearstapps.com${e}`,{body:t,headers:{"Content-Type":"application/json"},method:"POST"}):fetch(`https://eq47czqy1l.execute-api.us-west-2.amazonaws.com/v1${e}`,{body:t,headers:{"X-Api-Key":"WaHItmO5Oq9Veq4GjA5ty31pUCkZjtG98Aywra3D"},method:"POST"})},Da=e=>La("/link",JSON.stringify({id:btoa(JSON.stringify({amplitudeDeviceId:e.amplitudeDeviceId,email:e.email,myloUsername:e.myloUsername}))})),gv=e=>La("/id",JSON.stringify({id:btoa(JSON.stringify({amplitudeDeviceId:e.amplitudeDeviceId,mosb:e.mosb,pushlyId:e.pushlyId}))})),Un={chatbotTotalClicks:0,experimentExposures:{},pageId:window.crypto.randomUUID()},z={get:()=>Un,reset:()=>{Un={chatbotTotalClicks:0,experimentExposures:{},pageId:window.crypto.randomUUID()}},resetChatbotSession:()=>{z.set({chatbotSessionId:void 0,chatbotSessionStartMs:void 0,chatbotTotalClicks:0,chatbotTotalPrompts:void 0,chatbotTotalTokens:void 0})},set:e=>{Un={...Un,...e}},startChatbotSession:()=>{z.set({chatbotSessionId:window.crypto.randomUUID(),chatbotSessionStartMs:performance.now(),chatbotTotalClicks:0,chatbotTotalPrompts:0,chatbotTotalTokens:0})}},Ma=()=>{const{chatbotSessionId:e}=z.get();return{custom_attributes:{interaction_id:e},event_name:"Open Chatbot",event_type:"other"}},yv=()=>{const{chatbotSessionStartMs:e,chatbotTotalClicks:t,chatbotTotalPrompts:n,chatbotTotalTokens:r}=z.get();return{custom_attributes:{...Ma().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"}},xa=e=>e.split(/\s+/).filter(t=>t.length>0).length,_v=(e,t,n)=>({custom_attributes:{interaction_category:t,interaction_id:z.get().chatbotSessionId,interaction_prompt:mr(e),interaction_tokens:n,interaction_words_count:xa(e)},event_name:"Chatbot Prompt",event_type:"other"}),Ua=(e,t)=>({custom_attributes:{element_name:t,event_group:"Report Issue",event_name:"Report Issue",feedback_text:e?mr(e):void 0},event_name:"Report Issue",event_type:"other"}),bv=e=>({custom_attributes:{...Ua(e,"chatbot").custom_attributes,interaction_id:z.get().chatbotSessionId},event_name:"Report Issue",event_type:"other"}),Fa={sessionExpiration:Date.now()+fr,sessionId:window.crypto.randomUUID(),viewCount:0},F={get:()=>{const e=localStorage.getItem(pt.sessionContext);return e?JSON.parse(e):(localStorage.setItem(pt.sessionContext,JSON.stringify(Fa)),Fa)},incrementViewCount:()=>{const e=F.get();F.set({...e,viewCount:e.viewCount+1})},set:e=>{localStorage.setItem(pt.sessionContext,JSON.stringify({...F.get(),...e}))},startNewSession:()=>{F.set({sessionExpiration:Date.now()+fr,sessionId:crypto.randomUUID(),userIdStatus:void 0,viewCount:1})},updateSessionExpiration:()=>{const e=F.get();F.set({...e,sessionExpiration:Date.now()+fr})}},Ev="https://api.lab.amplitude.com/sdk/v2/flags",Wr=["\x1B[32m[nitrous]\x1B[0m"],wv=class{_isEnabled=!1;debug(...e){this._isEnabled&&console.log(...Wr,...e)}enable(){this._isEnabled=!0}error(...e){console.error(...Wr,...e)}warn(...e){this._isEnabled&&console.warn(...Wr,...e)}},Tv=new wv,lt=(function(e){return 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="E
24INTR",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})({}),Sv=e=>!!e&&typeof e=="object"&&"cause"in e&&!!e.cause&&typeof e.cause=="object"&&"code"in e.cause,Iv=e=>new Promise(t=>setTimeout(t,e)),Av=e=>{const t=Math.random()*100;return Iv(Math.pow(2,e)*1e3+t)},zr={errorCodes:[lt.ETIMEDOUT,lt.ECONNRESET,lt.EADDRINUSE,lt.ECONNREFUSED,lt.EPIPE,lt.ENOTFOUND,lt.ENETUNREACH],limit:3,statusCodes:[408,413,429,500,502,503,504,521,522,524]},Cv=(e,t)=>Va(e,t,1),Va=async(e,t={},n)=>{const{retryConfig:r,...i}=t,{errorCodes:o,limit:a,statusCodes:s}={errorCodes:r?.errorCodes||zr.errorCodes,limit:r?.limit||zr.limit,statusCodes:r?.statusCodes||zr.statusCodes};let u,c;try{u=await fetch(e,i)}catch(v){c=v}const l=n<a,f=!!u&&s.includes(u.status),p=Sv(c)&&o.includes(c.cause.code||"");if(!((f||p)&&l)){if(u)return u;throw c}return await Av(n),Va(e,t,n+1)},Pv=async e=>{try{const t=await Cv(Ev,{headers:{Authorization:`Api-Key ${e}`},method:"GET",retryConfig:{limit:6}});if(t.ok)return await t.json()}catch(t){Tv.error("failed to fetch experiments",t)}},$a=(e,t)=>{const n={event_properties:{[`${e}.variant`]:t.key},event_type:"[Experiment] Assignment",time:Date.now(),user_properties:{}},r=t.metadata?.flagVersion,i=t.metadata?.segmentName,o=t.metadata?.flagType,a=t.metadata?.default,s={},u={};return n.event_properties[`${e}.variant`]=t.key,r&&i&&(n.event_properties[`${e}.details`]=`v${r} rule:${i}`),o!="mutual-exclusion-group"&&(a?u[`[Experiment] ${e}`]="-":s[`[Experiment] ${e}`]=t.key),n.user_properties.$set=s,n.user_properties.$unset=u,n},kv=()=>{try{const e=Ae();if(!e)return;Array.isArray(e?.events)&&e.events.forEach(t=>{qt(t)}),Ve({events:[]})}catch(e){T.error("failed to log experiment cookie events",e)}},Ov=()=>{try{const e=Ae();if(!e)return;e.newAssignments&&Object.keys(e.newAssignments).length>0&&Object.entries(e.newAssignments).forEach(([t,n])=>{const r=$a(t,n);qt(r)}),Ve({newAssignments:void 0})}catch(e){T.error("failed to log experiment cookie events",e)}},Rv=async e=>{const t=Gr(),n=xn(),r=K()?.getConfig()?.apiKey;if(!t){T.debug("cannot bucket user, device id not found");return}if(r!=="bypass-api-key"){if(!r){T.debug("cannot bucket user, api key not found");return}return(await qa(r,t,n,[e],void 0))?.[e]?.key==="on"}},Ha=async e=>{try{const{context:t,experiments:n}=e||{},r=Gr(),i=xn(),o=K()?.getConfig()?.apiKey;if(!r){T.debug("cannot bucket user, device id not found");return}if(o==="bypass-api-key")return;if(!o){T.debug("cannot bucket user, api key not found");return}const a=await Pv(o);if(!a)return;T.debug("fetched experiments",a);const s=Ae()||{},u=Object.entries(s?.experiments||{}).filter(([v])=>a.find(y=>y.key===v)),c=Object.fromEntries(u);Ve({experiments:c});let l;n?l=n.filter(v=>!c[v]).filter(v=>a.find(y=>y.key===v)):l=a.filter(v=>v.metadata?.evaluationMode==="remote").filter(v=>!c[v.key]).map(v=>v.key);let f={};if(l&&l?.length>0){T.debug("performing remote evaluation for the following experiments:",l?.join(", "));const v={...t||{},user_properties:{...F.get().userAttributes,...t?.user_properties||{}}};f=await qa(o,r,i,l,v)}const p=Lv(a,r,i);if(Object.entries(p).forEach(([v,y])=>{qt($a(v,y))}),Object.entries(f).length===0)return;Ve({experiments:{...c,...f,...p}})}catch(t){T.error("failed to bucket user into experiments",t)}},qa=async(e,t,n,r,i)=>{const o=new URLSearchParams({device_id:t,flag_keys:r.join(","),...n&&{user_id:n},...i&&{context:JSON.stringify(i)}}),a=await fetch(`https://api.lab.amplitude.com/v1/vardata?${o.toString()}`,{headers:{Authorization:`Api-Key ${e}`}});if(!a.ok)throw new Error(`failed to fetch remote experiments: ${a.statusText}`);return await a.json()},Nv=e=>(Ae()||{}).experiments?.[e]?.key,Kr=()=>{Array.from(document.querySelectorAll(`[${q.experimentKey}
24]`)||[]).forEach(e=>{const t=e.getAttribute(q.experimentKey),n=e.getAttribute(q.experimentVariant),r=z.get().experimentExposures;t&&n&&r[t]!==n&&(qt(ja(t,n)),r[t]=n,z.set({experimentExposures:r}))})},ja=(e,t)=>({event_properties:{flag_key:e,variant:t},event_type:"$exposure",user_properties:{}}),Lv=(e,t,n)=>e.filter(r=>r.metadata?.evaluationMode==="local").reduce((r,i)=>{const o=i.segments.find(a=>a.metadata?.segmentName==="individual-inclusions"&&a.conditions?.some(s=>s.some(u=>t&&u.values.includes(t)||n&&u.values.includes(n))))?.variant;return o?(T.debug(`user is part of testing group for '${i.key}' experiment, forcibly re-bucketing user into '${o}' group`,{deviceId:t,userId:n}),{...r,[i.key]:i.variants[o]}):r},{}),Dv=(e,t)=>{if(!e)return T.error("cannot log exposure: experiment is missing"),Promise.resolve(void 0);if(!t)return T.error("cannot log exposure: variant is missing"),Promise.resolve(void 0);const n=z.get().experimentExposures;return n[e]=t,z.set({experimentExposures:n}),qt(ja(e,t)).promise},Mv=()=>{const e=mt(),t=e[De.experimentName],n=e[De.experimentVariant];t&&n&&Ve({experiments:{...(Ae()||{})?.experiments||{},[t]:{key:n}}})},xv=async e=>{Mv(),Kr(),e&&Ha()},V=e=>{K()?.logEvent(e)},Uv=e=>{const t=bv(e);t&&V(t)},Fv=()=>{try{Q.getState().handleCommentPosted()}catch(e){T.error(e)}},Yr=(e,t,n)=>{try{T.debug("content impression",{id:e,variant:t}),Q.getState().handleContentImpression(e,t),n&&V(n)}catch(r){T.error(r)}},Vv=e=>{try{Q.getState().handleContentSectionViewed(e)}catch(t){T.error(t)}},$v=e=>{try{const t=Ua(e);t&&V(t)}catch(t){T.error(t)}},Hv=(e,t,n)=>{try{V({custom_attributes:{error_code:t,error_data:Object.entries(n||{}).reduce((r,[i,o])=>[...r,{name:i,value:o}],[]),error_name:e},event_name:"Error Logged"})}catch(r){T.error(r)}},qv=()=>{try{z.startChatbotSession();const e=Ma();e&&V(e)}catch(e){T.error(e)}},jv=()=>{try{const e=yv();e&&V(e),z.resetChatbotSession()}catch(e){T.error(e)}},Bv=(e,t,n)=>{try{z.set({chatbotTotalPrompts:(z.get().chatbotTotalPrompts||0)+1}),n&&z.set({chatbotTotalTokens:(z.get().chatbotTotalTokens||0)+n});const r=_v(e,t,n);r&&V(r)}catch(r){T.error(r)}},Ba=(e,t)=>{try{K()?.setUserAttributes(e,t)}catch(n){T.error(n)}},Gv=()=>{try{return F.get().userAttributes||{}}catch(e){return T.error(e),{}}},Wv=e=>{try{K()?.removeUserAttribute(e)}catch(t){T.error(t)}},zv=(e,t)=>{try{K()?.login(e,t)}catch(n){T.error(n)}},Kv=(e,t)=>{try{K()?.signup(e,t)}catch(n){T.error(n)}},Yv=()=>{try{K()?.logout()}catch(e){T.error(e)}},Fn=()=>{try{return K()?.getDeviceId()}catch(e){T.error(e)}},Xv=()=>z.get().pageViewEvent,Qv=async()=>{try{await Oa()}catch(e){T.error(e)}},Jv=(e,t)=>
24{let n;if(e instanceof HTMLFormElement)n=e;else if(typeof e=="string"){const i=document.querySelector(`form[name="${e}"]`);i instanceof HTMLFormElement&&(n=i)}else return;if(!n)return;const r=K()?.getTrackers().find(i=>i.name==="form");r&&typeof r.requestFormSubmit=="function"&&r.requestFormSubmit(n,t)},Ga=e=>{try{e()}catch(t){T.error("failed to call function",t)}},Wa={},se={get:()=>{const e=localStorage.getItem(pt.persistentContext);return e?JSON.parse(e):(localStorage.setItem(pt.persistentContext,JSON.stringify(Wa)),Wa)},set:e=>{localStorage.setItem(pt.persistentContext,JSON.stringify({...se.get(),...e}))}},Xr=(e,t={async:!0})=>new Promise((n,r)=>{const i=document.createElement("script");document.getElementsByTagName("head")[0]?.appendChild(i),i.onload=()=>n(),i.onerror=()=>r(),Object.keys(t).forEach(o=>{const a=t[o];if(typeof a=="boolean"){if(!a)return;i.setAttribute(o,o);return}i.setAttribute(o,a)}),i.src=e}),Zv=async()=>{if(se.get().hudEnabled){const{prHudNumber:e}=se.get(),t=e?`https://static-assets.hearstapps.com/nitrous/dev/nitrous-hud-pr-${e}.js`:"https://static-assets.hearstapps.com/nitrous/nitrous-hud.js",n=e?`https://static-assets.hearstapps.com/nitrous/dev/nitrous-hud-pr-${e}.css`:"https://static-assets.hearstapps.com/nitrous/nitrous-hud.css";Xr(t);const r=document.getElementsByTagName("head")[0],i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.href=n,r.appendChild(i);return}},ep=()=>{const{prNumber:e}=se.get();return e===void 0?!1:e!==pr().prNumber},tp=()=>{const{prNumber:e}=se.get();window.__NITROUS__.prNumber=e,Xr(`https://static-assets.hearstapps.com/nitrous/dev/nitrous-pr-${e}.js`)},np=()=>{let e=!1;return{init:()=>{Xr("https://st.motortrend.com/nitrous/gpt.js").catch().finally(()=>{e=!0})},processEvent:t=>(e&&(t.custom_attributes={...t.custom_attributes,ad_blocker_enabled:window.nitrousAnb!==!0}),t)}},jt=e=>e.toLowerCase().replace(/-/g,"_"),rp=["https://app.blackbookinformation.com","https://qaapp.jumpstartautomotivetools.com"],ip=()=>({init:()=>{window.addEventListener("message",e=>{rp.includes(e.origin)&&e.data.eventName==="formSubmitted"&&op(e.data)},!0)}}),Qr=(e,t)=>{if(t!=null)return typeof t=="string"||typeof t=="number"||typeof t=="boolean"?{form_field_name:jt(e),form_field_value:t}:Array.isArray(t)?t.map((n,r)=>{let i=`${e}_${r+1}`;return t.length===2&&(r===0?i=`${e}_min`:r===1&&(i=`${e}_max`)),Qr(i,n)}).flat().filter(n=>!!n):typeof t=="object"?Object.entries(t).map(([n,r])=>Qr(`${e}_${n}`,r)).flat().filter(n=>!!n):void 0},op=e=>{try{if(e.pageName){const t=jt(e.pageName),n={...e.data?.[0]||{},form_location_id:e.location,lead_id:e.leadID};V({custom_attributes:{form_data:Object.entries(n).reduce((r,[i,o])=>{const a=Qr(i,o);return a?Array.isArray(a)?[...r,...a]:[...r,a]:r},[]),form_name:t},event_name:"Form Submitted"})}}catch(t){T.error("error while processing cve form submssion",t)}},ap=e=>e?e.tagName==="A"?e:Bt(e,'button, a, [role="tooltip"], [role="button"], [role="link"], [role="radio"], [role="checkbox"]',10)||Bt(e,`[data-id], [${q.elementId}], [${q.elementName}], [data-cy], [data-vars-cta], [data-vars-ga-call-to-action], [id]`,5):null,Bt=(e,t,n)=>{let r=e,i=0;for(;r&&(n===void 0||i<n);){if(r.matches(t))return r;r=r.parentElement,i++}return null},sp=e=>{if(!e)return"";let t="",n=e;for(;n!=null&&n.nodeName!=="#document";){let r=n,i=0;for(;r.previousElementSibling!==null&&r!==void 0;)i+=1,r=r.previousElementSibling;const o=(n.nodeName||"").toLowerCase();let a="";if(o==="body"||o==="html"||o==="head"||o==="document"||o==="header"||o==="footer")a=o;else{if(a=o,n.id)a+=`#${za(n.id)}`;else if(n.getAttribute("data-id"))a+=`[data-id="${n.getAttribute("data-id")}"]`;else if(n.className&&typeof n.className=="string"){const s=n.className.toString().split(" ")[0];s&&(a+=`.${za(s)}`)}i!==0&&(a+=`:nth-child(${i+1})`)}t=`${a}${t?" > ":""}${t}`,n=n.parentElement}return t},za=e=>e?.replace(/[:()\[\]]/g,"\\$&"),Jr=e=>Array.from(e.attributes||[]).reduce((t,n)=>{if(n.name.startsWith(q.prefix)){const r=n.name.replace(q.prefix,"").replace(/-/g,"_");return{...t,[r]:n.value}}return t},{}),Gt=e=>e.toLowerCase().replace(/-/g," ").replace(/\n/g," ").replace(/_/g," ").replace(/[^a-zA-Z0-9 ]/g,"").trim().replace(/\s+/g," ").replace(/\b\w/g,t=>t.toUpperCase()),up=1500,cp=4,rt=[],lp,dp=e=>{let t;const n=[q.elementId,"data-id","data-cy","data-testid","data-vars-cta","data-vars-ga-call-to-action","id"],r=Bt(e,n.map(o=>`[${o}]`).join(","),3);let i;return r&&(i=n.find(o=>!!r.getAttribute(o)),i&&(t=r.getAttribute(i)||void 0)),{element_id:t,element_id_attribute_name:i}},fp=e=>{const t=[q.elementName,"data-vars-ga-ux-element","aria-label","label","data-label","data-component","data-cmp"],n=Bt(e,t.map(r=>`[${r}]`).join(","),3);if(n){const r=t.find(i=>!!n.getAttribute(i));if(r)return n.getAttribute(r)||void 0}},Ka=e=>{try{if(typeof e.screenX=="number"&&typeof e.screenY=="number"&&Q.getState().addClickPosition({x:Math.round(e.screenX+window.scrollX),y:Math.round(e.screenY+window.scrollY)}),!(e.target instanceof Element))return;const t=e.target instanceof HTMLElement?e.target:e.target?.parentElement;if(!t)return;const n=ap(t),r=rt.find(({element:i})=>i===e.target);n&&!r&&pp(n),!n&&!r&&!_p(t)&&mp(e,t),t&&hp(t)}catch(t){T.error(t)}},vp=e=>{if(!e)return;if(e.getAttribute("data-parent"))return e.getAttribute("data-parent");
24if(e.getAttribute(q.elementParent))return e.getAttribute(q.elementParent);const t=Bt(e.parentElement,`[data-id], [${q.elementId}]`,25);return t?.getAttribute("data-id")||t?.getAttribute(q.elementId)},Zr=e=>{const{element_id:t,element_id_attribute_name:n}=dp(e),r=vp(e),i=e.getAttribute("href")||e.getAttribute(q.elementLink)||e.getAttribute("data-link");let o;t&&n&&(o=e.getAttribute(q.position)||e.getAttribute("data-position")||Array.from(document.querySelectorAll(`[${n}="${t}"]`)).findIndex(s=>s===e)+1,o=o?.toString());const a=fp(e)||Gt(t||"");return{element_content:e.innerText,element_id:t,element_link:i,element_name:a,element_parent:r,element_path:sp(e),element_position:o}},pp=e=>{const t=K()?.getConfig().clickConfig,n=Zr(e),r=n.element_id?t?.[n.element_id]?.attributes||{}:{},{[q.position]:i,...o}=Jr(e),a={...n,...o,...r,click_data:bp(o)};F.set({prevClickEvent:a}),V({custom_attributes:a,event_name:"Click",event_type:"other"}),(n.element_id==="ai-chatbot-articles"||n.element_id==="ai-chatbot-vehicles"||n.element_id==="ai-chatbot-link")&&z.set({chatbotTotalClicks:z.get().chatbotTotalClicks+1})},mp=(e,t)=>{V({custom_attributes:{...Zr(t),element_x:Math.round(e.screenX+window.scrollX),element_y:Math.round(e.screenY+window.scrollY)},event_name:"Dead Click",event_type:"other"})},hp=e=>{e!==rt[rt.length-1]?.element&&(rt=[],window.clearTimeout(lp),window.setTimeout(()=>{rt.length>=cp&&V({custom_attributes:{...Zr(e),element_click_count:rt.length},event_name:"Rage Click",event_type:"other"}),rt=[]},up)),rt.push({element:e,time:Date.now()})},gp=e=>{Ka(e)},yp=()=>({init:()=>{window.addEventListener("click",Ka,{capture:!0}),window.addEventListener("contextmenu",gp,!0)}}),_p=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=>e?.[t]!==null&&e?.[t]!==void 0),bp=e=>Object.entries(e||{}).reduce((t,[n,r])=>{let i=r;return r==="true"||r==="True"?i=!0:r==="false"||r==="False"?i=!1:Number.isFinite(Number(r))&&(i=Number(r)),[...t,{name:n,value:i}]},[]),Ep=class{init(){}processEvent(e){const t=K()?.getConfig(),n=/\/cars-for-sale\/.+/.test(window.location.pathname);return e.custom_attributes={...e.custom_attributes,nitrous_config:[{name:"one_trust_consent",value:t?.useOneTrustConsent},{name:"page_config_page_data_trigger",value:n||t?.pageConfig?.usePageDataTrigger},{name:"video_config_hearst_videos_plugin",value:t?.useHearstVideosPlugin},{name:"form_config_labels",value:t?.formConfig?.useLabels}]},e}},wp=()=>new Ep;function Tp(e,t,n){let r=t>0?t:1e3,i;const o=()=>{e(),r=Math.min(r*2,n),i=window.setTimeout(o,r)};return o(),()=>window.clearTimeout(i)}var Sp=class{_observers=[];_trackedContentIds={};init(){const e=()=>{this._observers.forEach(r=>{r.disconnect()}),Array.from(document.querySelectorAll(`[${q.contentImpressionId}]`)).forEach(r=>{const i=r.getAttribute(q.contentImpressionId);if(this._trackedContentIds[i])return;const o=new IntersectionObserver(a=>{a.forEach(s=>{if(s.isIntersecting){const u=r.getAttribute(q.contentImpressionLabel),c=r.getAttribute(q.contentImpressionEvent),l=r.getAttribute(q.contentImpressionVariant)||void 0;let f;c==="true"&&(f={custom_attributes:{...Jr(r)},event_name:`${u||Gt(i)} Viewable Impression`}),Yr(i,l,f),this._trackedContentIds[i]=!0,o.disconnect()}})},{root:null,rootMargin:"0px",threshold:0});o.observe(r),this._observers.push(o)})},t=()=>Tp(e,1e3,6e4),n=t();window.addEventListener("clientnavigation",()=>{this._trackedContentIds={},n(),t()})}},Ip=()=>new Sp,ei,it,Wt,Ya,Vn,Xa=-1,dt=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Xa=t.timeStamp,e(t))}),!0)},ti=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},$n=function(){var e=ti();return e&&e.activationStart||0},Pe=function(e,t){var n=ti(),r="navigate";return Xa>=0?r="back-forward-cache":n&&(document.prerendering||$n()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Tt=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(i){Promise.resolve().then((function(){t(i.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch{}},ke=function(e,t,n,r){var i,o;return function(a){t.value>=0&&(a||r)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=(function(s,u){return s>u[1]?"poor":s>u[0]?"needs-improvement":"good"})(t.value,n),e(t))}},ni=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},zt=function(e){document.addEventListener("visibilitychange",(function(){document.visibilityState==="hidden"&&e()}))},Hn=function(e){var t=!1;return function(){t||(e(),t=!0)}},St=-1,Qa=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},qn=function(e){document.visibilityState==="hidden"&&St>-1&&(St=e.type==="visibilitychange"?e.timeStamp:0,Ap())},Ja=function(){addEventListener("visibilitychange",qn,!0),addEventListener("prerenderingchange",qn,!0)},Ap=function(){removeEventListener("visibilitychange",qn,!0),removeEventListener("prerenderingchange",qn,!0)},ri=function(){return St<0&&(St=Qa(),Ja(),dt((function(){setTimeout((function(){St=Qa(),Ja()}),0)}))),{get firstHiddenTime(){return St}}},Kt=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Za=[1800,3e3],es=function(e,t){t=t||{},Kt((function(){var n,r=ri(),i=Pe("FCP"),o=Tt("paint",(function(a){a.forEach((function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<r.firstHiddenTime&&(i.value=Math.max(s.startTime-$n(),0),i.entries.push(s),n(!0)))}))}));o&&(n=ke(e,i,Za,t.reportAllChanges),dt((function(a){i=Pe("FCP"),n=ke(e,i,Za,t.reportAllChanges),ni((function(){i.value=performance.now()-a.timeStamp,n(!0)}))})))}))},ts=[.1,.25],ns=function(e,t){t=t||{},es(Hn((function(){var n,r=Pe("CLS",0),i=0,o=[],a=function(u){u.forEach((function(c){if(!c.hadRecentInput){var l=o[0],f=o[o.length-1];i&&c.startTime-f.startTime<1e3&&c.startTime-l.startTime<5e3?(i+=c.value,o.push(c)):(i=c.value,o=[c])}})),i>r.value&&(r.value=i,r.entries=o,n())},s=Tt("layout-shift",a);s&&(n=ke(e,r,ts,t.reportAllChanges),zt((function(){a(s.takeRecords()),n(!0)})),dt((function(){i=0,r=Pe("CLS",0),n=ke(e,r,ts,t.reportAllChanges),ni((function(){return n()}))})),setTimeout(n,0))}
24)))},rs=0,ii=1/0,jn=0,Cp=function(e){e.forEach((function(t){t.interactionId&&(ii=Math.min(ii,t.interactionId),jn=Math.max(jn,t.interactionId),rs=jn?(jn-ii)/7+1:0)}))},is=function(){return ei?rs:performance.interactionCount||0},Pp=function(){"interactionCount"in performance||ei||(ei=Tt("event",Cp,{type:"event",buffered:!0,durationThreshold:0}))},je=[],Bn=new Map,os=0,kp=function(){return je[Math.min(je.length-1,Math.floor((is()-os)/50))]},Op=[],Rp=function(e){if(Op.forEach((function(i){return i(e)})),e.interactionId||e.entryType==="first-input"){var t=je[je.length-1],n=Bn.get(e.interactionId);if(n||je.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]};Bn.set(r.id,r),je.push(r)}je.sort((function(i,o){return o.latency-i.latency})),je.length>10&&je.splice(10).forEach((function(i){return Bn.delete(i.id)}))}}},as=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Hn(e),document.visibilityState==="hidden"?e():(n=t(e),zt(e)),n},ss=[200,500],us=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Kt((function(){var n;Pp();var r,i=Pe("INP"),o=function(s){as((function(){s.forEach(Rp);var u=kp();u&&u.latency!==i.value&&(i.value=u.latency,i.entries=u.entries,r())}))},a=Tt("event",o,{durationThreshold:(n=t.durationThreshold)!==null&&n!==void 0?n:40});r=ke(e,i,ss,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),zt((function(){o(a.takeRecords()),r(!0)})),dt((function(){os=is(),je.length=0,Bn.clear(),i=Pe("INP"),r=ke(e,i,ss,t.reportAllChanges)})))})))},cs=[2500,4e3],oi={},Np=function(e,t){t=t||{},Kt((function(){var n,r=ri(),i=Pe("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach((function(c){c.startTime<r.firstHiddenTime&&(i.value=Math.max(c.startTime-$n(),0),i.entries=[c],n())}))},a=Tt("largest-contentful-paint",o);if(a){n=ke(e,i,cs,t.reportAllChanges);var s=Hn((function(){oi[i.id]||(o(a.takeRecords()),a.disconnect(),oi[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(u){addEventListener(u,(function(){return as(s)}),{once:!0,capture:!0})})),zt(s),dt((function(u){i=Pe("LCP"),n=ke(e,i,cs,t.reportAllChanges),ni((function(){i.value=performance.now()-u.timeStamp,oi[i.id]=!0,n(!0)}))}))}}))},ls=[800,1800],Lp=function e(t){document.prerendering?Kt((function(){return e(t)})):document.readyState!=="complete"?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},Dp=function(e,t){t=t||{};var n=Pe("TTFB"),r=ke(e,n,ls,t.reportAllChanges);Lp((function(){var i=ti();i&&(n.value=Math.max(i.responseStart-$n(),0),n.entries=[i],r(!0),dt((function(){n=Pe("TTFB",0),(r=ke(e,n,ls,t.reportAllChanges))(!0)})))}))},Yt={passive:!0,capture:!0},Mp=new Date,ds=function(e,t){it||(it=t,Wt=e,Ya=new Date,vs(removeEventListener),fs())},fs=function(){if(Wt>=0&&Wt<Ya-Mp){var e={entryType:"first-input",name:it.type,target:it.target,cancelable:it.cancelable,startTime:it.timeStamp,processingStart:it.timeStamp+Wt};Vn.forEach((function(t){t(e)})),Vn=[]}},xp=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?(function(n,r){var i=function(){ds(n,r),a()},o=function(){a()},a=function(){removeEventListener("pointerup",i,Yt),removeEventListener("pointercancel",o,Yt)};addEventListener("pointerup",i,Yt),addEventListener("pointercancel",o,Yt)})(t,e):ds(t,e)}},vs=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,xp,Yt)}))},ps=[100,300],Up=function(e,t){t=t||{},Kt((function(){var n,r=ri(),i=Pe("FID"),o=function(u){u.startTime<r.firstHiddenTime&&(i.value=u.processingStart-u.startTime,i.entries.push(u),n(!0))},a=function(u){u.forEach(o)},s=Tt("first-input",a);n=ke(e,i,ps,t.reportAllChanges),s&&(zt(Hn((function(){a(s.takeRecords()),s.disconnect()}))),dt((function(){var u;i=Pe("FID"),n=ke(e,i,ps,t.reportAllChanges),Vn=[],Wt=-1,it=null,vs(addEventListener),u=o,Vn.push(u),fs()})))}))},Fp={CLS:"cwv_cummulative_layout_shift",FCP:"cwv_first_contentful_paint",FID:"cwv_first_input_delay",INP:"cwv_interaction_to_next_paint",LCP:"cwv_largest_contentful_paint",TTFB:"cwv_time_to_first_byte"},Vp=class{payload={};
24init(){[Up,Np,Dp,es,us,ns].forEach(e=>{e(t=>{const n=Fp[t.name];this.payload={...this.payload,[n]:Math.round(t.value*10)/10}},{reportAllChanges:e===us||e===ns})})}processEvent(e){return e.event_name==="User Engagement Summary"&&(e.custom_attributes={...e.custom_attributes,...this.payload,cwv_network_speed:window.navigator.connection?.effectiveType}),e}},$p=()=>new Vp,Xt=(e,t=Zu)=>{let n=Number.NEGATIVE_INFINITY;return function(...r){Date.now()-n>=t&&(e(...r),n=Date.now())}},{entries:ms,setPrototypeOf:hs,isFrozen:Hp,getPrototypeOf:qp,getOwnPropertyDescriptor:jp}=Object,{freeze:pe,seal:Oe,create:Gn}=Object,{apply:ai,construct:si}=typeof Reflect<"u"&&Reflect;pe||(pe=function(t){return t}),Oe||(Oe=function(t){return t}),ai||(ai=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(n,i)}),si||(si=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});var Wn=he(Array.prototype.forEach),Bp=he(Array.prototype.lastIndexOf),gs=he(Array.prototype.pop),Qt=he(Array.prototype.push),Gp=he(Array.prototype.splice),zn=he(String.prototype.toLowerCase),ui=he(String.prototype.toString),ci=he(String.prototype.match),Jt=he(String.prototype.replace),Wp=he(String.prototype.indexOf),zp=he(String.prototype.trim),Ie=he(Object.prototype.hasOwnProperty),me=he(RegExp.prototype.test),Zt=Kp(TypeError);function he(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return ai(e,t,r)}}function Kp(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return si(e,n)}}function x(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zn;hs&&hs(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(Hp(t)||(t[r]=o),i=o)}e[i]=!0}return e}function Yp(e){for(let t=0;t<e.length;t++)Ie(e,t)||(e[t]=null);return e}function Be(e){const t=Gn(null);for(const[n,r]of ms(e))Ie(e,n)&&(Array.isArray(r)?t[n]=Yp(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Be(r):t[n]=r);return t}function en(e,t){for(;e!==null;){const r=jp(e,t);if(r){if(r.get)return he(r.get);if(typeof r.value=="function")return he(r.value)}e=qp(e)}function n(){return null}return n}var ys=pe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),li=pe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),di=pe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Xp=pe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fi=pe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Qp=pe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_s=pe(["#text"]),bs=pe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
24spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),vi=pe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Es=pe(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Kn=pe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Jp=Oe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Zp=Oe(/<%[\w\W]*|[\w\W]*%>/gm),em=Oe(/\$\{[\w\W]*/gm),tm=Oe(/^data-[\-\w.\u00B7-\uFFFF]+$/),nm=Oe(/^aria-[\-\w]+$/),ws=Oe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rm=Oe(/^(?:\w+script|data):/i),im=Oe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ts=Oe(/^html$/i),om=Oe(/^[a-z][.\w]*(-[.\w]+)+$/i),Ss=Object.freeze({__proto__:null,ARIA_ATTR:nm,ATTR_WHITESPACE:im,CUSTOM_ELEMENT:om,DATA_ATTR:tm,DOCTYPE_NAME:Ts,ERB_EXPR:Zp,IS_ALLOWED_URI:ws,IS_SCRIPT_OR_DATA:rm,MUSTACHE_EXPR:Jp,TMPLIT_EXPR:em}),tn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},am=function(){return typeof window>"u"?null:window},sm=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;
24const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Is=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function As(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:am();const t=R=>As(R);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==tn.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:s,Element:u,NodeFilter:c,NamedNodeMap:l=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:p,trustedTypes:v}=e,y=u.prototype,b=en(y,"cloneNode"),h=en(y,"remove"),m=en(y,"nextSibling"),g=en(y,"childNodes"),_=en(y,"parentNode");if(typeof a=="function"){const R=n.createElement("template");R.content&&R.content.ownerDocument&&(n=R.content.ownerDocument)}let E,C="";const{implementation:A,createNodeIterator:N,createDocumentFragment:D,getElementsByTagName:$}=n,{importNode:ie}=r;let U=Is();t.isSupported=typeof ms=="function"&&typeof _=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:re,ERB_EXPR:de,TMPLIT_EXPR:Ee,DATA_ATTR:xe,ARIA_ATTR:Ue,IS_SCRIPT_OR_DATA:Je,ATTR_WHITESPACE:Ge,CUSTOM_ELEMENT:We}=Ss;let{IS_ALLOWED_URI:L}=Ss,Y=null;const ot=x({},[...ys,...li,...di,...fi,..._s]);let k=null;const H=x({},[...bs,...vi,...Es,...Kn]);let M=Object.seal(Gn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,at=null;const Re=Object.seal(Gn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ct=!0,Fe=!0,eu=!1,tu=!0,Pt=!1,Zn=!0,ft=!1,wi=!1,Ti=!1,kt=!1,er=!1,tr=!1,nu=!0,ru=!1;const Vh="user-content-";let Si=!0,cn=!1,Ot={},ze=null;const Ii=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let iu=null;const ou=x({},["audio","video","img","source","image","track"]);let Ai=null;const au=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nr="http://www.w3.org/1998/Math/MathML",rr="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let Rt=Ze,Ci=!1,Pi=null;const $h=x({},[nr,rr,Ze],ui);let ir=x({},["mi","mo","mn","ms","mtext"]),or=x({},["annotation-xml"]);const Hh=x({},["title","style","font","a","script"]);let ln=null;const qh=["application/xhtml+xml","text/html"],jh="text/html";let oe=null,Nt=null;const Bh=n.createElement("form"),su=function(d){return d instanceof RegExp||d instanceof Function},ki=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Nt&&Nt===d)){if((!d||typeof d!="object")&&(d={}),d=Be(d),ln=qh.indexOf(d.PARSER_MEDIA_TYPE)===-1?jh:d.PARSER_MEDIA_TYPE,oe=ln==="application/xhtml+xml"?ui:zn,Y=Ie(d,"ALLOWED_TAGS")?x({},d.ALLOWED_TAGS,oe):ot,k=Ie(d,"ALLOWED_ATTR")?x({},d.ALLOWED_ATTR,oe):H,Pi=Ie(d,"ALLOWED_NAMESPACES")?x({},d.ALLOWED_NAMESPACES,ui):$h,Ai=Ie(d,"ADD_URI_SAFE_ATTR")?x(Be(au),d.ADD_URI_SAFE_ATTR,oe):au,iu=Ie(d,"ADD_DATA_URI_TAGS")?x(Be(ou),d.ADD_DATA_URI_TAGS,oe):ou,ze=Ie(d,"FORBID_CONTENTS")?x({},d.FORBID_CONTENTS,oe):Ii,ge=Ie(d,"FORBID_TAGS")?x({},d.FORBID_TAGS,oe):Be({}),at=Ie(d,"FORBID_ATTR")?x({},d.FORBID_ATTR,oe):Be({}),Ot=Ie(d,"USE_PROFILES")?d.USE_PROFILES:!1,Ct=d.ALLOW_ARIA_ATTR!==!1,Fe=d.ALLOW_DATA_ATTR!==!1,eu=d.ALLOW_UNKNOWN_PROTOCOLS||!1,tu=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pt=d.SAFE_FOR_TEMPLATES||!1,Zn=d.SAFE_FOR_XML!==!1,ft=d.WHOLE_DOCUMENT||!1,kt=d.RETURN_DOM||!1,er
vendor: 6,409 bytes, line 24
24=d.RETURN_DOM_FRAGMENT||!1,tr=d.RETURN_TRUSTED_TYPE||!1,Ti=d.FORCE_BODY||!1,nu=d.SANITIZE_DOM!==!1,ru=d.SANITIZE_NAMED_PROPS||!1,Si=d.KEEP_CONTENT!==!1,cn=d.IN_PLACE||!1,L=d.ALLOWED_URI_REGEXP||ws,Rt=d.NAMESPACE||Ze,ir=d.MATHML_TEXT_INTEGRATION_POINTS||ir,or=d.HTML_INTEGRATION_POINTS||or,M=d.CUSTOM_ELEMENT_HANDLING||{},d.CUSTOM_ELEMENT_HANDLING&&su(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(M.tagNameCheck=d.CUSTOM_ELEMENT_HANDLING.tagNameCheck),d.CUSTOM_ELEMENT_HANDLING&&su(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(M.attributeNameCheck=d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(M.allowCustomizedBuiltInElements=d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pt&&(Fe=!1),er&&(kt=!0),Ot&&(Y=x({},_s),k=Gn(null),Ot.html===!0&&(x(Y,ys),x(k,bs)),Ot.svg===!0&&(x(Y,li),x(k,vi),x(k,Kn)),Ot.svgFilters===!0&&(x(Y,di),x(k,vi),x(k,Kn)),Ot.mathMl===!0&&(x(Y,fi),x(k,Es),x(k,Kn))),Ie(d,"ADD_TAGS")||(Re.tagCheck=null),Ie(d,"ADD_ATTR")||(Re.attributeCheck=null),d.ADD_TAGS&&(typeof d.ADD_TAGS=="function"?Re.tagCheck=d.ADD_TAGS:(Y===ot&&(Y=Be(Y)),x(Y,d.ADD_TAGS,oe))),d.ADD_ATTR&&(typeof d.ADD_ATTR=="function"?Re.attributeCheck=d.ADD_ATTR:(k===H&&(k=Be(k)),x(k,d.ADD_ATTR,oe))),d.ADD_URI_SAFE_ATTR&&x(Ai,d.ADD_URI_SAFE_ATTR,oe),d.FORBID_CONTENTS&&(ze===Ii&&(ze=Be(ze)),x(ze,d.FORBID_CONTENTS,oe)),d.ADD_FORBID_CONTENTS&&(ze===Ii&&(ze=Be(ze)),x(ze,d.ADD_FORBID_CONTENTS,oe)),Si&&(Y["#text"]=!0),ft&&x(Y,["html","head","body"]),Y.table&&(x(Y,["tbody"]),delete ge.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Zt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Zt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=d.TRUSTED_TYPES_POLICY,C=E.createHTML("")}else E===void 0&&(E=sm(v,i)),E!==null&&typeof C=="string"&&(C=E.createHTML(""));pe&&pe(d),Nt=d}},uu=x({},[...li,...di,...Xp]),cu=x({},[...fi,...Qp]),Gh=function(d){let w=_(d);(!w||!w.tagName)&&(w={namespaceURI:Rt,tagName:"template"});const O=zn(d.tagName),X=zn(w.tagName);return Pi[d.namespaceURI]?d.namespaceURI===rr?w.namespaceURI===Ze?O==="svg":w.namespaceURI===nr?O==="svg"&&(X==="annotation-xml"||ir[X]):!!uu[O]:d.namespaceURI===nr?w.namespaceURI===Ze?O==="math":w.namespaceURI===rr?O==="math"&&or[X]:!!cu[O]:d.namespaceURI===Ze?w.namespaceURI===rr&&!or[X]||w.namespaceURI===nr&&!ir[X]?!1:!cu[O]&&(Hh[O]||!uu[O]):!!(ln==="application/xhtml+xml"&&Pi[d.namespaceURI]):!1},Ke=function(d){Qt(t.removed,{element:d});try{_(d).removeChild(d)}catch{h(d)}},vt=function(d,w){try{Qt(t.removed,{attribute:w.getAttributeNode(d),from:w})}catch{Qt(t.removed,{attribute:null,from:w})}if(w.removeAttribute(d),d==="is")if(kt||er)try{Ke(w)}catch{}else try{w.setAttribute(d,"")}catch{}},lu=function(d){let w=null,O=null;if(Ti)d="<remove></remove>"+d;else{const Ne=ci(d,/^[\r\n\t ]+/);O=Ne&&Ne[0]}ln==="application/xhtml+xml"&&Rt===Ze&&(d='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d+"</body></html>");const X=E?E.createHTML(d):d;if(Rt===Ze)try{w=new p().parseFromString(X,ln)}catch{}if(!w||!w.documentElement){w=A.createDocument(Rt,"template",null);try{w.documentElement.innerHTML=Ci?C:X}catch{}}const W=w.body||w.documentElement;return d&&O&&W.insertBefore(n.createTextNode(O),W.childNodes[0]||null),Rt===Ze?$.call(w,ft?"html":"body")[0]:ft?w.documentElement:W},du=function(d){return N.call(d.ownerDocument||d,d,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Oi=function(d){return d instanceof f&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof l)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},fu=function(d){return typeof s=="function"&&d instanceof s};function et(R,d,w){Wn(R,O=>{O.call(t,d,w,Nt)})}const vu=function(d){let w=null;if(et(U.beforeSanitizeElements,d,null),Oi(d))return Ke(d),!0;const O=oe(d.nodeName);if(et(U.uponSanitizeElement,d,{tagName:O,allowedTags:Y}),Zn&&d.hasChildNodes()&&!fu(d.firstElementChild)&&me(/<[/\w!]/g,d.innerHTML)&&me(/<[/\w!]/g,d.textContent)||d.nodeType===tn.progressingInstruction||Zn&&d.nodeType===tn.comment&&me(/<[/\w]/g,d.data))return Ke(d),!0;if(!(Re.tagCheck instanceof Function&&Re.tagCheck(O))&&(!Y[O]||ge[O])){if(!ge[O]&&mu(O)&&(M.tagNameCheck instanceof RegExp&&me(M.tagNameCheck,O)||M.tagNameCheck instanceof Function&&M.tagNameCheck(O)))return!1;if(Si&&!ze[O]){const X=_(d)||d.parentNode,W=g(d)||d.childNodes;if(W&&X){const Ne=W.length;for(let Le=Ne-1;Le>=0;--Le){const we=b(W[Le],!0);we.__removalCount=(d.__removalCount||0)+1,X.insertBefore(we,m(d))}}}return Ke(d),!0}return d instanceof u&&!Gh(d)||(O==="noscript"||O==="noembed"||O==="noframes")&&me(/<\/no(script|embed|frames)/i,d.innerHTML)?(Ke(d),!0):(Pt&&d.nodeType===tn.text&&(w=d.textContent,Wn([re,de,Ee],X=>{w=Jt(w,X," ")}),d.textContent!==w&&(Qt(t.removed,{element:d.cloneNode()}),d.textContent=w)),et(U.afterSanitizeElements,d,null),!1)},pu=function(d,w,O){if(at[w]||nu&&(w==="id"||w==="name")&&(O in n||O in Bh))return!1;if(!(Fe&&!at[w]&&me(xe,w))){if(!(Ct&&me(Ue,w))){if(!(Re.attributeCheck instanceof Function&&Re.attributeCheck(w,d))){if(!k[w]||at[w]){if(!(mu(d)&&(M.tagNameCheck instanceof RegExp&&me(M.tagNameCheck,d)||M.tagNameCheck instanceof Function&&M.tagNameCheck(d))&&(M.attributeNameCheck instanceof RegExp&&me(M.attributeNameCheck,w)||M.attributeNameCheck instanceof Function&&M.attributeNameCheck(w,d))||w==="is"&&M.allowCustomizedBuiltInElements&&(M.tagNameCheck instanceof RegExp&&me(M.tagNameCheck,O)||M.tagNameCheck instanceof Function&&M.tagNameCheck(O))))return!1}else if(!Ai[w]){if(!me(L,Jt(O,Ge,""))){if(!((w==="src"||w==="xlink:href"||w==="href")&&d!=="script"&&Wp(O,"data:")===0&&iu[d])){if(!(eu&&!me(Je,Jt(O,Ge,"")))){if(O)return!1}}}}}}}return!0},mu=function(d){return d!=="annotation-xml"&&ci(d,We)},hu=function(d){et(U.beforeSanitizeAttributes,d,null);const{attributes:w}=d;if(!w||Oi(d))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:k,forceKeepAttr:void 0};let X=w.length;for(;X--;){const{name:W,namespaceURI:Ne,value:Le}
24=w[X],we=oe(W),Ri=Le;let ue=W==="value"?Ri:zp(Ri);if(O.attrName=we,O.attrValue=ue,O.keepAttr=!0,O.forceKeepAttr=void 0,et(U.uponSanitizeAttribute,d,O),ue=O.attrValue,ru&&(we==="id"||we==="name")&&(vt(W,d),ue=Vh+ue),Zn&&me(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ue)){vt(W,d);continue}if(we==="attributename"&&ci(ue,"href")){vt(W,d);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){vt(W,d);continue}if(!tu&&me(/\/>/i,ue)){vt(W,d);continue}Pt&&Wn([re,de,Ee],yu=>{ue=Jt(ue,yu," ")});const gu=oe(d.nodeName);if(!pu(gu,we,ue)){vt(W,d);continue}if(E&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Ne)switch(v.getAttributeType(gu,we)){case"TrustedHTML":ue=E.createHTML(ue);break;case"TrustedScriptURL":ue=E.createScriptURL(ue);break}if(ue!==Ri)try{Ne?d.setAttributeNS(Ne,W,ue):d.setAttribute(W,ue),Oi(d)?Ke(d):gs(t.removed)}catch{vt(W,d)}}et(U.afterSanitizeAttributes,d,null)},Wh=function R(d){let w=null;const O=du(d);for(et(U.beforeSanitizeShadowDOM,d,null);w=O.nextNode();)et(U.uponSanitizeShadowNode,w,null),vu(w),hu(w),w.content instanceof o&&R(w.content);et(U.afterSanitizeShadowDOM,d,null)};return t.sanitize=function(R){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,O=null,X=null,W=null;if(Ci=!R,Ci&&(R="<!-->"),typeof R!="string"&&!fu(R))if(typeof R.toString=="function"){if(R=R.toString(),typeof R!="string")throw Zt("dirty is not a string, aborting")}else throw Zt("toString is not a function");if(!t.isSupported)return R;if(wi||ki(d),t.removed=[],typeof R=="string"&&(cn=!1),cn){if(R.nodeName){const we=oe(R.nodeName);if(!Y[we]||ge[we])throw Zt("root node is forbidden and cannot be sanitized in-place")}}else if(R instanceof s)w=lu("<!---->"),O=w.ownerDocument.importNode(R,!0),O.nodeType===tn.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?w=O:w.appendChild(O);else{if(!kt&&!Pt&&!ft&&R.indexOf("<")===-1)return E&&tr?E.createHTML(R):R;if(w=lu(R),!w)return kt?null:tr?C:""}w&&Ti&&Ke(w.firstChild);const Ne=du(cn?R:w);for(;X=Ne.nextNode();)vu(X),hu(X),X.content instanceof o&&Wh(X.content);if(cn)return R;if(kt){if(er)for(W=D.call(w.ownerDocument);w.firstChild;)W.appendChild(w.firstChild);else W=w;return(k.shadowroot||k.shadowrootmode)&&(W=ie.call(r,W,!0)),W}let Le=ft?w.outerHTML:w.innerHTML;return ft&&Y["!doctype"]&&w.ownerDocument&&w.ownerDocument.doctype&&w.ownerDocument.doctype.name&&me(Ts,w.ownerDocument.doctype.name)&&(Le="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
25`+Le),Pt&&Wn([re,de,Ee],we=>{Le=Jt(Le,we," ")}),E&&tr?E.createHTML(Le):Le},t.setConfig=function(){ki(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),wi=!0},t.clearConfig=function(){Nt=null,wi=!1},t.isValidAttribute=function(R,d,w){return Nt||ki({}),pu(oe(R),oe(d),w)},t.addHook=function(R,d){typeof d=="function"&&Qt(U[R],d)},t.removeHook=function(R,d){if(d!==void 0){const w=Bp(U[R],d);return w===-1?void 0:Gp(U[R],w,1)[0]}return gs(U[R])},t.removeHooks=function(R){U[R]=[]},t.removeAllHooks=function(){U=Is()},t}var Cs=As(),um=1e3,Ps=e=>{const t=Array.from(e.elements),n=s=>{const u=t.find(c=>c.name===s);return!!(!u||u.hidden||u.type==="hidden")},r=Array.from(new FormData(e).entries()).filter(([s])=>!n(s)).filter(([s])=>!s?.toLowerCase().includes("nonce"));if(r.length===0)return;const i=r.reduce((s,[u,c])=>({...s,[u]:[...s[u]||[],c.toString()]}),{}),o=nn(e);for(const[s,u]of Object.entries(o.fields))u.timeStart!==void 0&&(u.time=(u.time||0)+Date.now()-u.timeStart,u.timeStart=void 0,o.fields[s]=u);const a=K()?.getConfig().formConfig?.useLabels||!0;return Object.entries(i).reduce((s,[u,c])=>{const l=o.fields[u];let f=u.replace(/[^A-Za-z0-9_]/g,"").toLowerCase();if(a){const v=t.find(y=>y.name===u)?.id;if(v){const y=document.querySelector(`label[for='${v}']`)?.innerText;y&&(f=y)}}let p=mr(c.join(","));return f.includes("password")&&(p=vc(c.join(","))),[...s,{form_field_errored:l?.error||!1,form_field_name:f,form_field_required:l?.required||!1,form_field_time_active:l?.time||0,form_field_touched:l?.touched||!1,form_field_value:p,form_was_last_field_touched:l?.touchedLast||!1}]},[])},pi=(e,t)=>{try{const n=Ps(e),r=Os(Array.from(e.elements))||[];if(!n||r.length>0)return;const i=e.getAttribute(q.formName)||e.name;let o;
25t&&(o=Object.entries(t).reduce((s,[u,c])=>[...s,{name:u,value:c}],[])),V({custom_attributes:{form_data:n,form_name:i,...o&&{form_custom_data:o}},event_name:"Form Submitted"});const a=nn(e);a.submitted=!0,vm(e)}catch(n){T.error(n)}},ks=Xt(e=>{try{const{target:t}=e;if(t instanceof HTMLFormElement){if(t.getAttribute(q.autoSubmit)==="false")return;pi(t,void 0)}}catch(t){T.error(t)}},um),Yn={},nn=e=>{const t=pm(e);let n=Yn[t];return n||(n={fields:{},form:e,submitted:!1},Yn[t]=n),n},Os=e=>{if(Array.isArray(e))return e.filter(t=>t.ariaInvalid==="true"||t.className?.includes("error"))},cm=e=>{try{const t=nn(e),n=Array.from(e.elements),r=Os(n)||[];for(const o of r){const{name:a}=o;if(!a)continue;const s=t.fields[a]||{};s.error=!0,t.fields[a]=s}const i=n.filter(o=>o.ariaRequired==="true"||o.className?.includes("required"));for(const o of i){const{name:a}=o;if(!a)continue;const s=t.fields[a]||{};s.required=!0,t.fields[a]=s}}catch(t){T.error(t)}},lm=e=>{const t=e.target?.form,{name:n}=e.target;if(!t||!(t instanceof HTMLFormElement)||!n)return;const r=nn(t),i=r.fields[n]||{};i.touched=!0,i.touchedLast=!0,i.timeStart=Date.now(),r.fields[n]=i;for(const[o,a]of Object.entries(r.fields))o!==n&&(a.touchedLast=!1,r.fields[o]=a);cm(t)},dm=e=>{const t=e.target?.form,{name:n}=e.target;if(!t||!(t instanceof HTMLFormElement)||!n)return;const r=nn(t),i=r.fields[n]||{},{timeStart:o}=i;o!==void 0&&(i.time=(i.time||0)+Date.now()-o,i.timeStart=void 0,r.fields[n]=i)},Rs=()=>{try{const e=Object.entries(Yn).filter(([,t])=>t.submitted===!1);for(const[t,n]of e){const r=Ps(n.form);r&&(V({custom_attributes:{form_data:r,form_name:n.form.name},event_name:"Form Abandoned"}),delete Yn[t])}}catch(e){T.error(e)}},fm=class{formSubmitQueue={};name="form";constructor(){this.handleFormChange=this.handleFormChange.bind(this)}destroy(){window.removeEventListener("change",this.handleFormChange,!0),window.removeEventListener("submit",ks,!0)}handleFormChange(e){const t=e.target?.form;if(!(t instanceof HTMLFormElement))return;const n=t.getAttribute(q.formSubmitOnChange);if(!n||n==="false")return;this.formSubmitQueue[t.name]&&window.clearTimeout(this.formSubmitQueue[t.name]);const r=window.setTimeout(()=>{pi(t,void 0)},1e3);this.formSubmitQueue[t.name]=r}init(){window.addEventListener("change",this.handleFormChange,!0),window.addEventListener("submit",ks,!0),window.addEventListener("focus",lm,!0),window.addEventListener("blur",dm,!0),window.addEventListener("clientnavigation",Rs),window.addEventListener("beforeunload",Rs,!0)}requestFormSubmit(e,t){e&&pi(e,t)}},vm=e=>{const t=Array.from(new FormData(e).entries());let n;const r=t.find(([i])=>i.includes("email"));if(r&&(n=$i(Cs.sanitize(r[1].toString()||""))),!n){const i=Array.from(e.elements).find(o=>o.getAttribute("autocomplete")?.toLowerCase()?.includes("email"));i&&i instanceof HTMLInputElement&&(n=$i(Cs.sanitize(i.value||"")))}if(n&&xn()===void 0){wt(n);const i=new $e;i.set("email",n),Et(i)}},pm=e=>{if(e.name)return e.name;const t=Array.from(e.elements).filter(n=>!!n.getAttribute("name"));return t.length===0?"unlabeled_form":t.slice(0,2).reduce((n,r)=>`${n}-${r.getAttribute("name")}`,"")},mm=()=>new fm,hm=()=>({init:()=>{window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(()=>{googletag.pubads().addEventListener("slotRequested",bm),googletag.pubads().addEventListener("slotResponseReceived",Em),googletag.pubads().addEventListener("slotRenderEnded",_m),googletag.pubads().addEventListener("slotOnload",ym),googletag.pubads().addEventListener("impressionViewable",gm)})}}),rn=(e,t,n)=>{try{const r=cr(t.slotId,t.adPath);if(Q.getState().updateAdTimeline(t.slotId,t.adPath,e),t){const{advertiserId:o,campaignId:a,creativeId:s,creativeTemplateId:u,isBackfill:c,lineItemId:l,size:f}=t;Q.getState().updateAd(t.slotId,t.adPath,{...o&&{advertiserId:o},...c&&{isBackfill:c},...a&&{campaignId:a},...s&&{creativeId:s},...u&&{creativeTemplateId:u},...l&&{lineItemId:l},...f&&{size:f}})}const i=ec[e];if(i){const o=Q.getState().ads[r];if(!o){T.error("cannot log Ad Response event: `ad` is undefined");return}const a=i(o,n);a&&V(a)}}catch(r){T.error(r)}},gm=e=>{const t=e?.slot||{},n=t?.getSlotElementId?.(),r=t?.getAdUnitPath?.();rn("impression_viewable",{adPath:r,slotId:n},t)},ym=e=>{const t=e?.slot||{},n=t?.getSlotElementId?.(),r=t?.getAdUnitPath?.(),i=t.getTargeting("refreshtype")?.[0];
25if(i&&i!=="none"){const o=`ads_impressions_${i}`;Q.setState(a=>({adsRefreshPayload:{...a.adsRefreshPayload,[o]:(a.adsRefreshPayload[o]||0)+1}}))}rn("impression",{adPath:r,slotId:n},t)},_m=e=>{if(!e.isEmpty){const t=e?.slot||{},n=t?.getSlotElementId?.(),r=t?.getAdUnitPath?.();rn("rendered",{adPath:r,isBackfill:e.isBackfill,...e.size&&{size:Array.isArray(e.size)?JSON.stringify(e.size):e.size},slotId:n},t)}},bm=e=>{const t=e?.slot||{},n=t?.getSlotElementId?.(),r=t?.getAdUnitPath?.();rn("requested",{adPath:r,slotId:n},t)},Em=e=>{const t=e?.slot||{},n=t?.getSlotElementId?.(),r=t?.getAdUnitPath?.(),{advertiserId:i,campaignId:o,creativeId:a,creativeTemplateId:s,lineItemId:u}=e?.slot?.getResponseInformation()||{};rn("responded",{adPath:r,advertiserId:i?.toString(),campaignId:o?.toString(),creativeId:a?.toString(),creativeTemplateId:s?.toString(),lineItemId:u?.toString(),slotId:n},t)},wm=e=>new Promise(t=>{setTimeout(()=>{t(!0)},e)}),Ns=()=>!1,Tm=()=>({init:()=>{Ns()&&Ls()},processEvent:e=>(e.event_name==="Viewed Page/Screen"&&Ns()&&Ls(),e)}),mi=2500,Ls=async()=>{try{const{userIdStatus:e}=F.get();if(e==="in-progress"||e==="complete")return;F.set({userIdStatus:"in-progress"});const[t,n,r]=await Promise.all([hi(Fn,mi),hi(Vi,mi),hi(()=>window.PushlySDK?.getUser?.()?.getId?.(),mi)]),i=!!t&&!!r&&!!n;t?(await gv({amplitudeDeviceId:t,mosb:n,pushlyId:r}),F.set({userIdStatus:i?"complete":"partial"})):F.set({userIdStatus:void 0})}catch(e){T.error("Error during identification",e)}},hi=async(e,t)=>{const n=Date.now();let r;for(;!r;){if(Date.now()-n>=t)return;r=e()??void 0,r||await wm(100)}return r},Sm=()=>{let e=null,t=!1;const n=()=>{e&&window.clearTimeout(e),e=window.setTimeout(()=>{T.debug("user went inactive");const o=K()?.getTrackers();Object.entries(o||{}).forEach(([,a])=>{const s=a;typeof s.onInacitivity=="function"&&s.onInacitivity()}),t=!0},Ju)},r=Xt(()=>{if(t){T.debug("user is active again");const o=K()?.getTrackers();Object.entries(o||{}).forEach(([,a])=>{const s=a;typeof s.onActivityResume=="function"&&s.onActivityResume()}),t=!1}n()},1e3),i=()=>{document.visibilityState==="visible"&&r()};return{init:()=>{window.addEventListener("click",r,!0),window.addEventListener("keydown",r,!0),window.addEventListener("scroll",r,!0),window.addEventListener("timeupdate",r,!0),document.addEventListener("visibilitychange",i)}}},Im=()=>({init:()=>{window.addEventListener("journey-submitted",Am,!0),window.addEventListener("journey-clicked",km,!0),window.addEventListener("journey-inview",Cm,!0),window.addEventListener("journey-displayed",Pm,!0)}}),on="journey",Am=e=>{if(e.detail.templateName){const t=`${on}.${e.detail.templateName}`;V({custom_attributes:{form_data:[{field_name:"email_hash",field_value:e.detail["email-md5"]},{field_name:"campaign_name",field_value:e.detail.campaignName},{field_name:"template_name",field_value:e.detail.templateName},{field_name:"template_type",field_value:e.detail.templateType}],form_name:t},event_name:"Form Submitted"})}},Cm=e=>{e.detail.templateName&&Yr(`${on}.${e.detail.templateName}`,e.detail.campaignName||void 0)},Pm=e=>{if(e.detail.templateName){const t=`${on}.${e.detail.templateName}`;Q.getState().handleContentRender(t,e.detail.campaignName||void 0)}},km=e=>{let t=`${on}.unknown-button`;e.detail.templateName&&(t=`${on}.${e.detail.templateName}`),V({custom_attributes:{click_data:[{name:"template_id",value:e.detail.templateId},{name:"template_name",value:e.detail.templateName},{name:"template_type",value:e.detail.templateType}],element_content:e.detail.ctaText,element_id:t,element_link:e.detail.destinationLink,element_parent:e.detail.templateId},event_name:"Click"})},Ds=()=>{try{Ba({do_not_sell:!0}),V({custom_attributes:{},event_name:"Do Not Sell",event_type:"other"})}catch(e){T.error(e)}},Om=class{destroy(){window.removeEventListener("cmp.consent.submit",Ds)}init(){window.addEventListener("cmp.consent.submit",Ds)}},Rm=()=>new Om,Nm={resources:[{id:"ads_gpt",matches:"https://securepubads.g.doubleclick.net/tag/js/gpt.js"},{id:"ads_impl",matches:"pubads_impl.js"}]},Lm=class{_options;constructor(e){this._options=e}init(){try{new PerformanceObserver(e=>{const t=e.getEntries().reduce((n,r)=>{const i=this._options.resources.find(s=>r.name.includes(s.matches));if(!i)return n;const{duration:o,responseStatus:a}=r;return{...n,[i.id]:{loadTime:Math.floor(o),status:a?.toString()}}},{});Q.getState().updateResourcePerformance(t)}).observe({buffered:!0,type:"resource"})}catch(e){T.error(e)}}},Dm=e=>new Lm({...Nm,...e||{}}),Ms=()=>{const{currScrollTop:e,lastScrolledAt:t,maxScrollTop:n}=Q.getState(),{scrollTop:r}=document.documentElement;(!n||r>
25n)&&Q.getState().setMaxScrollTop(scrollY);const i=Math.round(Math.min((new Date().getTime()-t)/1e3,30)),o=Math.floor(e/300),a=Math.floor((e+document.documentElement.scrollHeight)/300);Q.getState().incrementScrollBucket(o,a,i),Q.setState({currScrollTop:r,lastScrolledAt:new Date().getTime()})},Mm=class{destroy(){window.removeEventListener("scrollend",Ms)}init(){window.addEventListener("scrollend",Ms)}},xm=()=>new Mm,Um=()=>({init:()=>{},processEvent:e=>{const{sessionExpiration:t}=F.get();if(Date.now()>t){T.debug("Session expired, starting new session"),F.startNewSession();const{setHasTrackedMarketingChannelPayload:n}=Q.getState();n(!1),se.set({isNewUser:!1}),K()?.setUserAttributes({is_new_user:!1})}else F.updateSessionExpiration(),e.event_name==="Viewed Page/Screen"&&F.incrementViewCount();return e.custom_attributes={...e.custom_attributes,session_id:F.get().sessionId,view_count:F.get().viewCount||1},e}}),gi={Desktop:16/9,Mobile:19.5/9,Tablet:4/3},It={Desktop:992,Mobile:481,Tablet:768},yi={Desktop:It.Desktop*gi.Desktop,Mobile:It.Mobile*gi.Mobile,Tablet:It.Tablet*gi.Tablet},Fm={Desktop:It.Mobile*yi.Mobile,Mobile:It.Mobile*yi.Mobile,Tablet:It.Mobile*yi.Mobile},Vm=e=>{let t=e.replace(/\/+/g,"/");return t.startsWith("/")||(t=`/${t}`),t.endsWith("/")||(t=`${t}/`),t},$m=()=>window.screen.height||window.innerHeight,Hm=()=>window.screen.width||window.innerWidth,qm=()=>{try{let e=sessionStorage.getItem("@motortrend/nitrous-web-sdk.windowId");return e||(e=crypto.randomUUID(),sessionStorage.setItem(`${lr}.windowId`,e)),e}catch(e){T.error(e)}},jm=(e,t,n)=>{e[t]=new Proxy(e[t],{apply(r,i,o){return n.apply(i,o),r.apply(i,o)}})},xs=(e,t)=>{if(e===t)return!0;if(typeof e!="object"||e===null||e===void 0||typeof t!="object"||t===null||e===void 0)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||!xs(e[i],t[i]))return!1;return!0},Bm=e=>{if(e==null)return!0;for(const t of Object.keys(e))if(e[t]!==null||e[t]!==void 0||e[t]!=="")return!1;return!0},Gm=e=>Object.entries(e).reduce((t,[n,r])=>(r==null||Number.isNaN(r)||r===""||(t[n]=r),t),{}),an=(e,t)=>parseFloat(e.toFixed(t)),Wm=()=>{const e=document.querySelector("link[rel='canonical']");return e?new URL(e.href):void 0},Us=(e,t)=>{let n;if(typeof e=="string"){let i=e;if(!i.startsWith("http")){i.startsWith("/")||(i=`/${i}`);let o=t;o.endsWith("/")&&(o=o.slice(0,-1)),i=`${o}${i}`}n=new URL(i)}else if(e instanceof URL)n=e;else throw new Error("url is expected to be a string or URL object");let r=n.pathname;return r.endsWith("/")||(r=`${r}/`),`${n.origin}${r}`},Fs=()=>{const e=mt(),t=document.referrer||e[De.referrer]||void 0,n=document.location.href,r=document.location.pathname,i=l=>l.hostname.split(".").slice(-2).join("."),o=l=>l.hostname.split(".").slice(0,-2).join(".");let a;if(t)try{a=i(new URL(t))}catch(l){T.error(`failed to construct referrer_domain, referrer_url is likely malformed: ${t}`,l)}let s,u;try{const l=new URL(n);s=i(l),u=o(l)||void 0}catch(l){T.error(`failed to construct view_domain, view_url is likely malformed: ${n}`,l)}let c;return Object.entries(e||{}).length>0&&(c=Object.entries(e).reduce((l,[f,p])=>[...l,{name:f,value:p}],[])),{referrer_domain:a,referrer_url:t,view_domain:s,view_params:c,view_path:r,view_subdomain:u,view_url:n}},zm=(function(e){return e.Web="Web",e.Android="Android",e.iOS="iOS",e.HWA="HWA",e.tvOS="tvOS",e.Roku="Roku",e.Server="Server",e})({}),Vs=(function(e){return e.Fire_TV="Fire TV",e.Android_TV="Android TV",e.Comcast="Comcast",e.Desktop="Desktop",e.Mobile="Mobile",e})({}),cg=(function(e){return 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})({}),lg=(function(e){return 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})({}),dg=(function(e){return 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})({}),fg=(function(e){return e.Facebook="Facebook",e.Twitter="Twitter",e.Instagram="Instagram",e})({}),vg=(function(e){return 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})({}),pg=(function(e){return 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})({}),mg=(function(e){return e.kaltura="kaltura",e.webiny="webiny",e.sonic="sonic",e.wurl="wurl",e})({}),hg=(function(e){return e.airplay="airplay",e.chromecast="chromecast",e.samsung_cast="samsung cast",e})({}),gg=(function(e){return 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})({}),yg=(function(e){return e.paid="paid",e.organic="organic",e.null="null",e})({}),_g=(function(e){return e.motortrend="motortrend",e.facebook="facebook",e.google="google",e.apple="apple",e})({}),bg=(function(e){return e.ACTIVE="ACTIVE",e.CANCELED="CANCELED",e.TERMINATED="TERMINATED",e.PRE__ACTIVE="PRE_ACTIVE",e.PAUSED="PAUSED",e.CREATED="CREATED",e})({}),Eg=(function(e){return e.DAY="DAY",e.MONTH="MONTH",e.YEAR="YEAR",e})({}),wg=(function(e){return e.apple="apple",e.google="google",e.roku="roku",e.samsung="samsung",e.comcast="comcast",e.amazon="amazon",e.motortrend="motortrend",e})({}),Tg=(function(e){return e.male="male",e.female="female",e.non_binary="non-binary",e})({}),Km=" daum[ /]| deusu/| yadirectfetcher|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\btime/|\\||^<|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|^{{.*}}$|adscanner/|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|cookiehubscan|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|firep
25hp|functionize|gomezagent|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|ips-agent|java(?!;)|jsjcw_scanner|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node|nutch|offbyone|optimize|pageburst|pagespeed|parser|perl|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scanner\\.|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|zgrab",Ym=/bot|crawl|http|lighthouse|scan|search|spider/i,sn;function Xm(){if(sn instanceof RegExp)return sn;try{sn=new RegExp(Km,"i")}catch{sn=Ym}return sn}var Qm=e=>{var t,n;return(n=(t=e?.match(Xm()))==null?void 0:t[0])!=null?n:null},Jm="0.20.104",$s=e=>(!!e).toString(),Hs=["cox-marketplace-widget","inventory_widget"],qs=()=>Array.from(document.querySelectorAll(`[${q.contentImpressionId}]`)).reduce((e,t)=>{const n=t.getAttribute(q.contentImpressionId);return!n||!Hs.includes(n)?e:{...e,[`${jt(n)}_present`]:$s(!0)}},{}),Zm=e=>Object.entries(e).reduce((t,[n,{variant:r,viewed:i=!1}])=>{if(!Hs.includes(n))return t;const o=jt(n);return{...t,[`${o}_type`]:r,[`${o}_viewed`]:$s(i)}},{}),eh=e=>{const t=Array.from(document.querySelectorAll(`[${q.contentImpressionId}]`)),n=t.map(o=>o.getAttribute(q.contentImpressionId)).filter(Boolean),r=Object.keys(e||{}).filter(o=>!n.includes(o)),i=[...n,...r];if(i.length!==0)return i.reduce((o,a)=>{const s=jt(a),u=t.find(c=>c.getAttribute(q.contentImpressionId)===a);return[...o,{loaded:!0,name:s,variant:u?.getAttribute(q.contentImpressionVariant)||e[a]?.variant,viewed:e[a]?.viewed}]},[])},js=e=>typeof e!="string"?[""]:e.replace(/^\/|\/$/g,"").split("/"),th=e=>e==="/"?"Landing":Gt(js(e)[0]),nh=e=>{if(window.HRST?.article?.display)return Gt(`${window.HRST.article.display} Page`);if(e==="/")return"Home";const t=js(e);return t.length<=1?"Index Page":t.map(n=>Gt(n.replace(/-/g," "))).join(" : ")},rh=()=>{const e=window.performance.getEntries().find(t=>{let n,r;try{const i=new URL(t.name);return n=`${i.host}${i.pathname}`,r=`${window.location.host}${window.location.pathname}`,r===n&&t.responseEnd!==void 0}catch{return!1}});if(e)return an((e.responseEnd-e.startTime)/1e3,1)},Bs=({day:e,hour:t,minute:n,month:r,year:i})=>{const o=new Date;return i&&o.setFullYear(parseInt(i)),r&&o.setUTCMonth(parseInt(r)-1),e&&o.setUTCDate(parseInt(e)),t&&o.setUTCHours(parseInt(t)),n&&o.setUTCMinutes(parseInt(n)),o.toISOString()},ih=(e,t)=>{let n,r;return e==="rankings"?(r="Rankings",n="Rankings"):e?.toLowerCase()==="model page"?(r="Model Page",n="Model Page"):t?.includes("car-accessories")?(r="Other",n="Car Accessories"):t?.includes("bring-a-trailer")||t?.includes("bringatrailer")?(r=e,n="Bring a Trailer"):t?.includes("/drive/")&&!t?.includes("first-drive")?(r=e,n="Drive"):t==="/"?(r="Homepage",n="Homepage"):t?.includes("archive")?(r="Archive Story",n="Archive Story"):t?.includes("lightning-lap")||t?.includes("10best")||t?.includes("editors-choice")||t?.includes("editor's-choice")?(r="Accolades",n="Accolades"):t?.includes("how-to")?(r="How to & service",n="How to & service"):t?.includes("/photos/")||t?.includes("photos")||t?.includes("gallery")||t?.includes("pictures")?(r="Photos",n="Photo Gallery"):t?.includes("/news/")?(r="News",t?.includes("recall")||t?.includes("nhtsa")||t?.includes("iihs")||t?.includes("safety")?n="Recall/Safety":t?.includes("price")||t?.includes("pricing")||t?.includes("msrp")?n="Pricing News":t?.includes("debut")||t?.includes("reveal")||t?.includes("unveil")||t?.includes("launch")||t?.includes("premier")||t?.includes("premiere")?n="Reveal":t?.includes("concept")||t?.includes("future")?n="Concept/Future Cars":t?.includes("spy")||t?.includes("spied")||t?.includes("teaser")?n="Spy/Teaser":t?.includes("facelift")||t?.includes("refresh")||t?.includes("mid-cycle")?n="Model Refresh":t?.includes("sales")||t?.includes("deliveries")||t?.includes("production")||t?.includes("allocation")?n="Sales/Production News":t?.includes("discontinue")||t?.includes("discontinuation")||t?.includes("end")?n="Discontinuation":t?.includes("policy")||t?.includes("law")||t?.includes("tax")||t?.includes("rebate")||t?.includes("incentive")||t?.includes("tariff")?n="Policy/Incentives":t?.includes("epa")||t?.includes("range")||t?.includes("mpg")||t?.includes("mpge")||t?.includes("fuel-economy")||t?.includes("epa")||t?.includes("range")||t?.includes("mpg")||t?.includes("mpge")||t?.includes("fuel-economy")?n="MPG/Range News":n="News"):t?.includes("/reviews/")?(r="Reviews",t?.includes("first-drive")||t?.includes("drive")?n="First Drive":t?.includes("/comparison")||t?.includes("-vs-")||t?.includes("versus")?n="Comparison":t?.includes("long-term-test")?n="Instrumented Test/LT Test":t?.includes("quick-spin")||t?.includes("quick-drive")||t?.includes("short-take")?n="Quick Spin":t?.includes("instrumented")||t?.includes("track-test")||t?.includes("first-test")||t?.includes("range-test")||t?.includes("mpg-test")||t?.includes("fuel-economy-test")||t?.includes("towing")||t?.includes("test")||t?.includes("off-road")||t?.includes("offroad")||t?.includes("overland")||t?.includes("0-60")||t?.includes("quarter-mile")||t?.includes("reliability-maintenance")?n="Instrumented Test/LT Test":n="Other"):t?.includes("/features/")?(r="Features",t?.includes("/columns/")?n="Opinion/Columns":t?.includes("opinion")||t?.includes("column")||t?.includes("editorial")?n="Opinion/Column":t?.includes("history")||t?.includes("retrospective")||t?.includes("anniversary")||t?.includes("evolution")||t?.includes("origin")?n="History/Retrospective":t?.includes("reliability-maintenance")?n="Instrumented Test":t?.includes("-issue")?n="Online Issue":t?.includes("window-shop")?n="Window Shop":n="Other"):t?.includes("/columns/")?(r="Features",n="Opinion/Columns"):t?.includes("opinion")||t?.includes("column")||t?.includes("editorial")||t?.includes("op-ed")||t?.includes("oped")||t?.includes("take")||t?.includes("rant")?(r="Features",n="Opinion/Column"):t?.includes("10best")||t?.includes("editors-choice")||t?.includes("of-the-year")?(r="Accolades",n="Accolades"):t?.includes("history")||t?.includes("retrospective")||t?.includes("anniversary")||t?.includes("evolution")||t?.includes("origin")?(r="Features",n="History/Retrospective"):t?.includes("interview")||t?.includes("q-and-a")||t?.includes("q&a")||t?.includes("qa")?(r="Features",n="Interview"):t?.includes("auto-show")||t?.includes("nyias")||t?.includes("la-auto")||t?.includes("detroit")||t?.includes("geneva")||t?.includes("paris")||t?.includes("ces")||t?.includes("sema")||t?.includes("monterey")||t?.includes("pebble")?(r="Features",n="Event Coverage/Auto Show"):t?.includes("road-trip")||t?.includes("roadtrip")||t?.includes("travel")?(r="Features",n="Travelogue"):t?.
25includes("deep-dive")||t?.includes("explained")||t?.includes("explainer")||t?.includes("tech")||t?.includes("teardown")||t?.includes("engineering")?(r="Features",n="Tech/Deep Dive"):t?.includes("culture")||t?.includes("lifestyle")||t?.includes("design")||t?.includes("icons")||t?.includes("people")?(r="Features",n="Culture/Design"):t?.includes("reliability-maintenance")?(r="Other",n="Instrumented Test"):t?.includes("-issue")?(r="Other",n="Online Issue"):t?.includes("window-shop")?(r="Other",n="Window Shop"):(r="Other",n="Other"),{content_alt_classification:r,content_sub_classification:n}},oh=()=>{const e=window.HRST?.datalayer?.automotive?.tagsets;if(!(!Array.isArray(e)||e.length===0))return e.map(t=>({bodystyle:t?.body_style,make_name:t?.make_name,model_name:t?.model_name,primary_fuel_type:t?.primary_fuel_type,submodel_name:t?.submodel_name,year:t?.year!==void 0&&t?.year!==null?t.year:void 0}))},ah=e=>{const t=window.HRST?.nitrous?.data?.view_template||window.HRST?.article?.template,n=window.jamData?.pubtemplate,r=window.HRST?.site?.brand_slug||window.HRST?.site?.prefix,i=window.HRST?.nitrous?.data?.content_brand||window.HRST?.adConfig?.site||window.HRST?.article?.brand,o=window.HRST?.nitrous?.data?.content_author||window.HRST?.article?.author?.name,a=window.HRST?.nitrous?.data?.content_tags||window.HRST?.article?.tags,s=!!document.querySelector("video")||!!window.HRST?.article?.hasVideo,u=window.HRST?.nitrous?.data?.content_publication_date||window.HRST?.article?.publishDate&&Bs(window.HRST?.article?.publishDate),c=window.HRST?.nitrous?.data?.content_modification_date||window.HRST?.article?.modifiedDate&&Bs(window.HRST?.article?.modifiedDate),l=window.HRST?.nitrous?.data?.content_section||window.HRST?.article?.section?.name,f=window.HRST?.nitrous?.data?.content_classification||window.HRST?.article?.type,p=window.HRST?.article?.template,v=window.HRST?.article?.type,y=window.HRST?.nitrous?.data?.content_title||window.HRST?.article?.title||document.title,b=window.HRST?.nitrous?.data?.content_id||window.HRST?.contentId||window.HRST?.article?.id||window.HRST?.metadata?.contentId||window.HRST?.article?.artID,h=window.HRST?.datalayer?.automotive?.tagsets?.[0],m=window.HRST?.nitrous?.data?.car_make||h?.make_name||window.jamData?.make,g=window.HRST?.nitrous?.data?.car_model||h?.model_name||window.jamData?.model,_=window.HRST?.nitrous?.data?.car_trim||h?.submodel_name,E=window.HRST?.nitrous?.data?.car_year?.toString()||h?.year?.toString()||window.jamData?.year?.toString(),C=window.HRST?.nitrous?.data?.car_segment||h?.body_style,A=window.HRST?.nitrous?.data?.car_data_array||(window.HRST?.datalayer?.automotive?.tagsets?JSON.stringify(window.HRST.datalayer.automotive.tagsets):void 0),N=oh(),D=window.HRST?.article?.collection;let $;Array.isArray(D)&&D[0]?.id&&($=D);const ie=!Bm(window.HRST?.article?.sponsor),U=window.HRST?.nitrous?.data?.view_sponsored||ie?.toString(),{content_alt_classification:re,content_sub_classification:de}=ih(f,e);return Gm({...window.HRST?.nitrous?.data||{},brand_slug:r,car_data:N,car_data_array:A,car_make:m,car_model:g,car_segment:C,car_trim:_,car_year:E,content_alt_classification:re,content_author:o,content_brand:i,content_classification:f,content_collection:$,content_has_video:s,content_id:b,content_modification_date:c,content_publication_date:u,content_section:l,content_sub_classification:de,content_tags:a,content_title:y,content_type:p,content_type_hrst:v,view_pubtemplate:n,view_sponsored:U,view_template:t})},sh=(e,t)=>{const{pageId:n}=z.get(),{prevClickEvent:r}=F.get(),i=K()?.getConfig().appName,{referrer_domain:o,referrer_url:a,view_domain:s,view_params:u,view_path:c,view_subdomain:l,view_url:f}=Fs(),p=th(c),v=nh(c),y=Wm(),b=y?.href,h=y?Vm(y.pathname):void 0,m=Hm(),g=$m(),_=Math.floor(m*g),E=_<Fm.Desktop?Vs.Mobile:Vs.Desktop,C=ah(c);let A={};return r&&(F.set({prevClickEvent:void 0}),A=Object.entries(r).reduce((N,[D,$])=>({...N,[`${D}_previous`]:$}),{})),{...A,app_name:i,content_type_hrst_previous:e?.content_type_hrst,content_type_previous:e?.content_type,device_family:E,device_screen_area:_,device_screen_height:g,device_screen_width:m,device_user_agent:window.navigator.userAgent,device_user_agent_bot:Qm(window.navigator.userAgent)||void 0,nitrous_version:Jm,page_id:n,platform_name:zm.Web,referrer_domain:o,referrer_url:a,view_canonical_path:h,view_canonical_url:b,view_domain:s,view_group:p,view_load_time:rh(),view_name:v,view_name_previous:e?.view_name,view_nav_type:t,view_params:u,view_path:c,view_path_previous:e?.view_path,view_subdomain:l,view_url:f,view_url_previous:e?.view_url,window_id:qm(),...C}},Gs=(e,t)=>({custom_attributes:{...sh(e,t),...qs()},event_name:"Viewed Page/Screen"}),Xn=e=>{const{bottom:t,left:n,right:r,top:i,x:o,y:a}=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+a}},Ws=(e,t,n)=>Math.max(0,Math.min((e-t)/(n-t),1))||0,uh=(e,t)=>{const n=Array.from(document.querySelectorAll("main p"));if(n.length<=0)return{};const{contentWordCount:r,contentWordsViewed:i}=n.reduce((u,c)=>{if(!(c instanceof HTMLElement))return u;const l=xa(c.innerText),{bottom:f,top:p}=Xn(c),v=Ws(t,p,f),y=Math.floor(l*v);return{contentWordCount:u.contentWordCount+l,contentWordsViewed:u.contentWordsViewed+y}},{contentWordCount:0,contentWordsViewed:0});if(r===0)return{};const o=Xn(n[0]).top,a=Xn(n[n.length-1]).bottom,s=an(Ws(t,o,a),2);return{content_word_count:r,content_words_per_minute:e?an(Math.min(300,i/e*60),2):0,content_words_viewed:e===0?0:Math.min(i,r),scroll_percentage_article:s}},ch=()=>Array.from(document.querySelectorAll(`[${q.contentSection}]`)||[]).filter(e=>e.checkVisibility({checkVisibilityCSS:!0})),lh=e=>{const t=ch();let n=1,r=1,i=1;if(t.length>0){const o=t.reduce((a,s)=>{const{bottom:u}=Xn(s);return e>u?a+1:a},0);n=t.length,r=o||1,i=an(r/n||0,4)}return{content_sections_total:n,content_sections_viewed:r,content_sections_viewed_percent:i}},zs=e=>{const{ads:t={},adsRefreshPayload:n,clickPositions:r,commentsPosted:i,impressions:o,maxScrollTop:a,resourcePerformance:s,scrollBucketData:u,scrollStartTimeMs:c}=Q.getState(),l=document.documentElement.scrollHeight||0,f=document.documentElement.scrollWidth||0,p=Math.min(Math.floor(document.documentElement.clientHeight+(a||document.documentElement.scrollTop)),l),v=an(p/l,2)||0,y=JSON.stringify({d:r,w:f}),b=u?JSON.stringify({d:u,h:300}):void 0,h=Object.values(t).length,m=Object.values(t).reduce((k,H)=>k+H.timeline.filter(M=>M.type==="requested").length,0),g=Object.values(t).reduce((k,H)=>k+H.timeline.filter(M=>M.type==="responded").length,0),_=Object.values(t).reduce((k,H)=>k+H.timeline.filter(M=>M.type==="impression").length,0),E=Object.values(t).reduce((k,H)=>k+H.timeline.filter(M=>M.type==="rendered").length,0),C=Object.values(t).reduce((k,H)=>k+H.timeline.filter(M=>M.type==="impression_viewable").length,0),A=Object.values(t).map(k=>k.timeline.find(H=>H.type==="requested"&&H.timestampMs<(c||1/0))?.elapsedTimeMs).filter(k=>k!==void 0).reduce((k,H,M,ge)=>k+H/ge.length,0),N=Object.values(t).map(k=>k.timeline.find(H=>H.type==="responded")?.elapsedTimeMs).filter(k=>k!==void 0).reduce((k,H,M,ge)=>k+H/ge.length,0),D=Object.values(t).map(k=>k.timeline.find(H=>H.type==="rendered")?.elapsedTimeMs).filter(k=>k!==void 0).reduce((k,H,M,ge)=>k+H/ge.length,0),$=Object.values(t).map(k=>k.timeline.find(H=>H.type==="requested")?.elapsedTimeMs).filter(k=>k!==void 0),ie=$.length>0?Math.round(Math.min(...$)):0,U=!Object.values(t).flatMap(k=>k.timeline).find(k=>k.type==="queued"),re=!!window.googletag?._loaded_,de=!!window.googletag?.apiReady,Ee=Object.entries(s).reduce((k,[H,M])=>({...k,[`${H}_load_time`]:M.loadTime,[`${H}_status`]:M.status}),{}),{content_word_count:xe,content_words_per_minute:Ue,content_words_viewed:Je,scroll_percentage_article:Ge}=uh(e,p),{content_sections_total:We,content_sections_viewed:L,content_sections_viewed_percent:Y}=lh(p),ot=eh(o);return{custom_attributes:{...qs(),...Zm(o),...Ee,...n,ads_first_request_time:ie,ads_gpt_loaded:re,ads_
25impl_loaded:de,ads_impressed:_,ads_impressed_viewable:C,ads_queue_empty:U,ads_rendered:E,ads_rendered_in_avg:Math.round(D),ads_requested:m,ads_requested_in_avg:Math.round(A),ads_responded:g,ads_responded_in_avg:Math.round(N),ads_total_slots:h,attention_data:b,click_data:y,comments_posted:i,content_impressions:ot,content_sections_total:We,content_sections_viewed:L,content_sections_viewed_percent:Y,content_word_count:xe,content_words_per_minute:Ue,content_words_viewed:Je,event_group:"Engagement",event_name:"User Engagement Summary",scroll_depth:p,scroll_percentage:v,scroll_percentage_article:Ge,view_duration:e,view_height:l},event_name:"User Engagement Summary",event_type:"other"}},dh=()=>{const{utm_campaign:e=null,utm_content:t=null,utm_id:n=null,utm_medium:r=null,utm_source:i=null,utm_term:o=null,utm_type:a=null}=mt();return{utm_campaign:e?e.toLowerCase():null,utm_content:t?t.toLowerCase():null,utm_id:n?n.toLowerCase():null,utm_medium:r?r.toLowerCase():null,utm_source:i?i.toLowerCase():null,utm_term:o?o.toLowerCase():null,utm_type:a?a.toLowerCase():null}},fh=()=>{const{utm_campaign:e,utm_content:t,utm_id:n,utm_medium:r,utm_source:i,utm_term:o,utm_type:a}=dh(),{referrer_domain:s,referrer_url:u}=Fs(),{referrer_domain:c,referrer_url:l,utm_campaign:f,utm_content:p,utm_id:v,utm_medium:y,utm_source:b,utm_term:h,utm_type:m}=F.get().userAttributes||{};let g,_;try{_=new URL(document.referrer),l&&(g=new URL(l))}catch{}const E=!_,C=!g,A=_&&_.hostname===window.location.hostname,N=g&&g.hostname===window.location.hostname;if(e||t||n||r||i||o||a||!(f||p||v||y||b||h||m||l||c)||!(f&&f!=="(none)"||p&&p!=="(none)"||v&&v!=="(none)"||y&&y!=="(none)"||b&&b!=="(none)"||h&&h!=="(none)"||m&&m!=="(none)")&&(N||C)&&!(A||E))return{referrer_domain:s||"(none)",referrer_url:u||"(none)",utm_campaign:e||"(none)",utm_content:t||"(none)",utm_id:n||"(none)",utm_medium:r||"(none)",utm_source:i||"(none)",utm_term:o||"(none)",utm_type:a||"(none)"}},Ks=()=>{const e=fh();if(e){const t=e,n=F.get().userAttributes,r=!Object.keys(n||{}).some(o=>o.includes("first_touch")),i={};r||Object.entries(e).forEach(([o,a])=>{if(a!=null){const s=`firsttouch_${o}`;i[s]=a}}),K()?.setUserAttributes(t,i)}},vh=class{isTrueView=!0;navType="full";payload=void 0;prevPageViewEvent;uesStartedAt=null;init(){try{Q.setState({pageLoadTimeMs:Date.now()}),this.prevPageViewEvent=F.get().prevPageViewEvent,this.logPageView();const e=()=>{document.visibilityState==="visible"?(this.isTrueView=!1,this.uesStartedAt=performance.now(),V({custom_attributes:{},event_name:"Returned to Tab"})):this.logUes()},t=()=>{this.logUes()},n=()=>{this.navType="client",this.logUes(),z.reset(),this.prevPageViewEvent=F.get().prevPageViewEvent,this.isTrueView=!0,this.logPageView()};document.addEventListener("visibilitychange",e,{passive:!0}),window.addEventListener("beforeunload",t,{passive:!0}),window.addEventListener("clientnavigation",n),hh()}catch(e){T.error(e)}}onActivityResume(){this.isTrueView=!1,this.uesStartedAt=performance.now(),V({custom_attributes:{},event_name:"Returned from Inactivity"})}onInacitivity(){this.logUes()}processEvent(e){return e.event_name!=="Viewed Page/Screen"&&(e.custom_attributes={true_view:this.isTrueView,...this.payload||{},...e.custom_attributes}),e}logPageView(){try{const e=Gs(this.prevPageViewEvent,this.navType),{prevClickEvent:t}=F.get();t&&F.set({prevClickEvent:void 0}),this.payload={...e.custom_attributes},e.custom_attributes.true_view=!0,V(e),this.uesStartedAt=performance.now(),Ks(),Kr(),z.set({pageViewEvent:e.custom_attributes}),F.set({prevPageViewEvent:e.custom_attributes})}catch(e){T.error(e)}}logUes(){try{if(this.uesStartedAt===null||this.uesStartedAt===void 0)return;V(zs(Math.floor((performance.now()-this.uesStartedAt)/1e3)||0));const{resetAdsTimeline:e,resetUesSlice:t}=Q.getState();t(),e(),this.uesStartedAt=null}catch(e){T.error(e)}}},ph=()=>new vh,mh=e=>{const{items:t}=e.detail,n=e.detail.dataLayer;t.forEach(r=>{if(r?.event==="page_data"&&(n?.filter(i=>i.event==="page_data")||[]).length!==0){const i=K()?.getTrackers()||[];for(const o of i)typeof o.onBeforeNavigation=="function"&&o.onBeforeNavigation();window.dispatchEvent(new Event("clientnavigation"))}n.push(r)})},hh=()=>{window.dataLayer=window.dataLayer||[],window.addEventListener("datalayer:push",mh);const e=window.dataLayer.push;window.dataLayer.push=function(...t){try{window.dispatchEvent(new CustomEvent("datalayer:push",{detail:{dataLayer:[...window.dataLayer||[]],items:t}}))}catch{}return e.apply(window.dataLayer,t)}},gh=()=>{let e;try{e=Us(window.location.href,window.location.origin)}catch{}const t=n=>{const r=Us(n,window.location.origin);if(e!==r){T.debug("detected page change",{nextUrl:r,prevUrl:e}),e=r;const i=K()?.getTrackers()||[];for(const o of i)typeof o.onBeforeNavigation=="function"&&o.onBeforeNavigation();window.dispatchEvent(new Event("clientnavigation"))}};window.addEventListener("popstate",()=>{try{t(window.location.href)}catch{}}),["pushState","replaceState"].forEach(n=>
25{jm(window.history,n,(...r)=>{try{let i=r[2];i instanceof URL?i=i.href:typeof i!="string"&&(i=window.location.href),t(i)}catch{}})})},yh=class{dataDependencies={};isTrueView=!0;navType="full";payload=void 0;prevPageViewEvent;uesStartedAt=null;init(){try{Q.setState({pageLoadTimeMs:Date.now()}),this.prevPageViewEvent=F.get().prevPageViewEvent,this.logPageView();const e=()=>{document.visibilityState==="visible"?(this.isTrueView=!1,this.uesStartedAt=performance.now(),V({custom_attributes:{},event_name:"Returned to Tab"})):this.logUes()},t=()=>{this.logUes()},n=()=>{this.navType="client",this.logUes(),z.reset(),this.prevPageViewEvent=F.get().prevPageViewEvent,this.isTrueView=!0,window.HRST?_h(this.dataDependencies.hrst).then(()=>{this.logPageView()}):this.logPageView()};gh(),document.addEventListener("visibilitychange",e,{passive:!0}),window.addEventListener("beforeunload",t,{passive:!0}),window.addEventListener("clientnavigation",n)}catch(e){T.error(e)}}onActivityResume(){this.isTrueView=!1,this.uesStartedAt=performance.now(),V({custom_attributes:{},event_name:"Returned from Inactivity"})}onInacitivity(){this.logUes()}processEvent(e){return e.event_name!=="Viewed Page/Screen"&&(e.custom_attributes={true_view:this.isTrueView,...this.payload||{},...e.custom_attributes}),e}logPageView(){try{const e=Gs(this.prevPageViewEvent,this.navType),{prevClickEvent:t}=F.get();t&&F.set({prevClickEvent:void 0}),this.payload={...e.custom_attributes},e.custom_attributes.true_view=!0,V(e),this.uesStartedAt=performance.now(),Ks(),Kr(),z.set({pageViewEvent:e.custom_attributes}),F.set({prevPageViewEvent:e.custom_attributes}),this.dataDependencies.hrst=window.HRST}catch(e){T.error(e)}}logUes(){try{if(this.uesStartedAt===null||this.uesStartedAt===void 0)return;V(zs(Math.floor((performance.now()-this.uesStartedAt)/1e3)||0));const{resetAdsTimeline:e,resetUesSlice:t}=Q.getState();t(),e(),this.uesStartedAt=null}catch(e){T.error(e)}}},_h=e=>new Promise(t=>{let i=0;const o=window.setInterval(()=>{i+=100,(!xs(e,window.HRST)||i>=2e3)&&(window.clearInterval(o),t(!0))},100)}),bh=()=>new yh,Eh=()=>{const e=new Set,t=new Set,n=o=>{if(!o.uuid||e.has(o.uuid))return;e.add(o.uuid),t.add(o);let a;const s=Xt(()=>{const h=Xe(o);if(!h)return;Ys(o,h);const m=o.element;h.currentTime=m.currentTime,m.currentTime>h.maxPlayheadPosition&&(h.maxPlayheadPosition=m.currentTime)},1e3),u=()=>{const h=Xe(o);h&&Ys(o,h)},c=()=>{const h=Xe(o);if(!h)return;const m=performance.now();h.totalWatchTime=h.totalWatchTime+(m-(h.lastPlayedAt||m)),h.lastPlayedAt=void 0},l=()=>{const h=Xe(o);h&&_i(o,h)},f=Xt(()=>{const h=o.getCurrentVideo()?.id;if(h){if(!a){a=h;return}if(a!==h){const m=un[a];if(!m)return;_i(o,m),a=h}}},1e3),p=()=>{const h=Xe(o);h&&(h.lastBufferedAt=performance.now())},v=()=>{const h=Xe(o);if(!h||!h.lastBufferedAt)return;const m=performance.now();h.totalBufferTime+=m-h.lastBufferedAt,h.lastBufferedAt=void 0},y=h=>{const m=Xe(o);if(!m)return;const g=wh[h.type];if(g){m.loggedQuartileEvents[g]=!0;const _=Qn(o,m);_&&V({custom_attributes:_,event_name:g})}},b=()=>{const h=o.element;if(!h)return;const m=new IntersectionObserver(g=>{g.forEach(_=>{if(_.isIntersecting){const E=Xe(o);if(E){const C=Qn(o,E);C&&V({custom_attributes:C,event_name:"Video Player Impression",event_type:"other"})}m.disconnect()}})},{root:null,rootMargin:"0px",threshold:0});m.observe(h)};o.events.on("timeupdate",s),o.events.on("play",u),o.events.on("pause",c),o.events.on("played-q1",y),o.events.on("played-q2",y),o.events.on("played-q3",y),o.events.on("played-q4",y),o.events.on("playlistitem",f),o.events.on("ended",l),o.events.on("waiting",p),o.events.on("canplay",v),b()},r=()=>{if(!window.videoPlayerManager){T.error("tried to listen to player before manager was initialized");return}Array.isArray(window.videoPlayerManager.instances)&&window.videoPlayerManager.instances.forEach(o=>{typeof o?.getCurrentVideo=="function"&&o.getCurrentVideo()&&n(o)}),window.videoPlayerManager.events.on("videoPlayerInit",o=>{o.videoPlayer?n(o.videoPlayer):T.error("player init triggered but the player is missing")})},i=()=>{t.forEach(o=>{const a=Xe(o);a&&a.firstPlayedAt!==void 0&&_i(o,a)})};return{init:()=>{window.videoPlayerManager?r():window.addEventListener("videoPlayerManagerInit",()=>{r()}),window.addEventListener("beforeunload",i)},onBeforeNavigation:()=>{i()}}},Xe=e=>{const t=e.getCurrentVideo(),n=e.element,r=t?.duration||n?.duration,i=t?.id;if(!i||!r)return;let o=un[i];return o||(un[i]={currentTime:n.currentTime,duration:r,eventId:window.crypto.randomUUID(),firstPlayedAt:void 0,hearstVideo:t,id:i,lastBufferedAt:void 0,lastPlayedAt:void 0,loggedQuartileEvents:{},maxPlayheadPosition:n.currentTime,totalBufferTime:0,totalWatchTime:0},o=un[i]),o},Ys=(e,t)=>{const n=performance.now();if(t.firstPlayedAt===void 0){const r=Qn(e,t);r&&V({custom_attributes:r,event_name:"Video View Started",event_type:"other"}),t.firstPlayedAt=n}t.lastPlayedAt===void 0&&(t.lastPlayedAt=n)},_i=(e,t)=>{const n=Qn(e,t);n&&V({custom_attributes:n,event_name:"Video View Ended",event_type:"other"}),delete un[t.id]},Qn=(e,t)=>{const n=e.element;if(!t||!n)return;const r=performance.now(),i=t.duration===1/0,o=Math.ceil(t.duration),a=Math.min(Math.ceil(t.currentTime),o),s=Math.min(Math.max(a,Math.ceil(t.maxPlayheadPosition)),o),u=
25Math.floor((t.totalWatchTime+(r-(t.lastPlayedAt||r)))/1e3),c=Math.max(Math.floor((r-(t.firstPlayedAt||r))/1e3),u),l=Math.round(s/o*100);let f=!1;!i&&s>=.9*o&&(f=!0);const p=t.hearstVideo.id?.includes("http")?void 0:t.hearstVideo.id;return{max_playhead_position:s,playhead_position:a,total_session_time:c,total_watch_time:u,video_aspect_ratio:t.hearstVideo.videoMedia?.nearest_aspect_ratio,video_completed:f,video_description:t.hearstVideo.description,video_duration:o,video_id:p,video_is_stream:i,video_publication_date:t.hearstVideo.videoMedia?.created_at,video_thumbnail:t.hearstVideo.poster,video_title:t.hearstVideo.title,video_url:t.hearstVideo.sources?.[0]?.src,video_watch_percentage:l}},wh={"played-q1":"Video 25% Complete","played-q2":"Video 50% Complete","played-q3":"Video 75% Complete","played-q4":"Video 100% Complete"},un={},Xs=e=>{let t=e.getAttribute(q.videoId)||void 0;if(t)return t;const n=e.currentSrc||e.src;return n&&(t=n.split("/").pop()),t},At={},Th=()=>({init:()=>{window.addEventListener("timeupdate",kh,!0),window.addEventListener("play",Ph,!0),window.addEventListener("pause",Ch,!0),window.addEventListener("ended",Ah,!0),window.addEventListener("waiting",Oh,!0),window.addEventListener("canplay",Ih,!0),window.addEventListener("beforeunload",Qs,{passive:!0}),Sh()},onBeforeNavigation:()=>{Qs()},onInacitivity:()=>{Ei().forEach(e=>{const t=Qe(e);!t||!t.firstPlayedAt||bi(e,t)}),At={}}}),Sh=()=>{Ei().forEach(e=>{const t=new IntersectionObserver(n=>{n.forEach(r=>{if(r.isIntersecting){Qe(e);const i=Jn(e);i&&V({custom_attributes:i,event_name:"Video Player Impression",event_type:"other"}),t.disconnect()}})},{root:null,rootMargin:"0px",threshold:0});t.observe(e)})},bi=(e,t)=>{const n=Jn(e);n&&V({custom_attributes:n,event_name:"Video View Ended",event_type:"other"}),delete At[t.id]},Qe=e=>{if(!e||!(e instanceof HTMLVideoElement))return;const t=Xs(e);if(!t)return;let n=At[t];if(!n){const{currentTime:r}=e;At[t]={eventId:window.crypto.randomUUID(),firstPlayedAt:void 0,id:t,lastBufferedAt:void 0,lastPlayedAt:void 0,loggedQuartileEvents:{},maxPlayheadPosition:r,totalBufferTime:0,totalWatchTime:0},n=At[t]}return n},Ih=e=>{const t=Qe(e.target);if(!t||!t.lastBufferedAt)return;const n=performance.now();t.totalBufferTime+=n-t.lastBufferedAt,t.lastBufferedAt=void 0},Ah=e=>{const t=Qe(e.target);t&&bi(e.target,t)},Qs=()=>{Ei().forEach(e=>{const t=Qe(e);t&&t.firstPlayedAt!==void 0&&bi(e,t)})},Ch=e=>{const t=Qe(e.target);if(!t)return;const n=performance.now();t.totalWatchTime=t.totalWatchTime+(n-(t.lastPlayedAt||n)),t.lastPlayedAt=void 0},Js=(e,t)=>{if(t.firstPlayedAt===void 0){const n=Jn(e);n&&V({custom_attributes:n,event_name:"Video View Started",event_type:"other"}),t.firstPlayedAt=performance.now()}t.lastPlayedAt===void 0&&(t.lastPlayedAt=performance.now())},Ph=e=>{const t=Qe(e.target);t&&Js(e.target,t)},kh=Xt(e=>{const{target:t}=e;if(!t||!(t instanceof HTMLVideoElement))return;const n=Qe(e.target);if(!n)return;Js(t,n),t.currentTime>n.maxPlayheadPosition&&(n.maxPlayheadPosition=t.currentTime);let r;if(n.maxPlayheadPosition>t.duration*.25?r="Video 25% Complete":n.maxPlayheadPosition>t.duration*.5?r="Video 50% Complete":n.maxPlayheadPosition>t.duration*.75?r="Video 75% Complete":n.maxPlayheadPosition>t.duration*.95&&(r="Video 100% Complete"),r&&!n.loggedQuartileEvents[r]){n.loggedQuartileEvents[r]=!0;const i=Jn(e.target);i&&V({custom_attributes:i,event_name:r,event_type:"other"})}},250),Oh=e=>{const t=Qe(e.target);t&&(t.lastBufferedAt=performance.now())},Jn=e=>{const t=Xs(e);if(!t)return;const n=At[t];if(n){if(e.getAttribute("title")==="Advertisement")return}else return;const r=performance.now(),i=e.duration===1/0,o=Math.ceil(e.duration),a=Math.min(Math.ceil(e.currentTime),o),s=Math.min(Math.max(a,Math.ceil(n.maxPlayheadPosition)),o),u=Math.floor((n.totalWatchTime+(r-(n.lastPlayedAt||r)))/1e3),c=Math.max(Math.floor((r-(n.firstPlayedAt||r))/1e3),u),l=parseFloat((s/o).toFixed(2));let f=!1;!i&&s>=.9*o&&(f=!0);const{height:p,width:v}=window.getComputedStyle(e),y=parseFloat((parseFloat(v)/parseFloat(p)).toFixed(2)),b=Jr(e);return{...b,max_playhead_position:s,playhead_position:a,total_session_time:c,total_watch_time:u,video_aspect_ratio:y,video_completed:f,video_duration:o,video_id:b.video_id||t,video_is_stream
25:i,video_thumbnail:b.video_thumbnail||e.getAttribute("poster"),video_title:b.video_title||e.getAttribute("title")||e.getAttribute("data-title")||e.getAttribute("aria-label"),video_url:b.video_url||e.src,video_watch_percentage:l}},Ei=()=>Array.from(document.querySelectorAll("video")),Rh=e=>Object.keys(e).reduce((t,n)=>{const r=e[n];return r==null||Number.isNaN(r)||r===""||(t[n]=r),t},{}),Nh=class{_config;_eventQueue=[];_initialized=!1;_serverUrl="";_trackers=[];constructor(e){this._config=e}getConfig(){return this._config}getDeviceId(){try{return Ae()?.deviceId}catch(e){T.error(e)}}getTrackers(){return this._trackers}init(){if(this._config.debug&&T.enable(),!this._config.apiKey){T.warn("api key is missing, cannot initialize");return}if(this._initialized){T.warn("init should not be called more than once. Are you calling `init` in a useEffect? It should be called outside the context of a react component, preferably at the top level of your app.");return}this._initialized=!0,T.log($u),T.debug("initialized nitrous sdk");try{this._serverUrl=Lh(this._config);const e=hv(this._config.apiKey);se.set({isNewUser:e});const t=Ae()?.deviceId,n=this._config.apiKey||"api-key";fv(n,{appVersion:this._config.appVersion,autocapture:{attribution:!1,elementInteractions:!1,fileDownloads:!1,formInteractions:!1,pageViews:!1,sessions:!0},logLevel:0,transport:"beacon",...t&&{deviceId:t},...this._config.useProxyUrl!==!1&&{serverUrl:this._serverUrl}}).promise.then(()=>{const i=Gr();if(i&&(Ve({...!(this._config.apiKey==="bypass-api-key"||this._config.apiKey==="test-personalization")&&{apiKey:this._config.apiKey},deviceId:i}),xv(this._config.useBucketOnLoad||!1)),Array.isArray(window.n_qb)){for(const o of window.n_qb)Ga(o);window.n_qb=void 0}mt()[De.showDeviceId]==="true"&&window.alert(`amplitude device id: ${i}`)}),pv(),mv(e),kv(),Ov();const r=/\/cars-for-sale\/.+/.test(window.location.pathname);this._trackers=[r||this._config.pageConfig?.usePageDataTrigger?ph:bh,...Uh,this._config.useHearstVideosPlugin===!0?Eh:Th].map(i=>i()),this._trackers.forEach(i=>{i.init(this)}),Zv(),Oa()}catch(e){T.error(e)}}async logEvent(e){try{if(!this.canLog(e))return;this.prepareAndUpload();let t=e;for(const i of this._trackers)if(typeof i.processEvent=="function"&&(t=await i.processEvent(t,this),t===null)){T.debug("dropping event due to tracker processor",e);return}this._config.appDataInit&&(t.custom_attributes={...t.custom_attributes||{},...this._config.appDataInit||{}}),t.custom_attributes=Rh(t.custom_attributes),T.focus("event:",t.event_name,t.custom_attributes);const{custom_attributes:n,event_name:r}=t;vv(r,n),(r==="User Engagement Summary"||r==="Video View Ended")&&dv(),Dh(t)}catch(t){T.error(t)}}async login(e,t){try{await Na(e,t,"login"),this.logEvent({custom_attributes:t||{},event_name:"Logged In",event_type:"other"})}catch(n){T.error("error while logging in",n)}}logout(){try{const e=new $e;e.set("logged_in",!1),Et(e),this.logEvent({custom_attributes:{},event_name:"Logout",event_type:"other"})}catch(e){T.error(e)}}removeUserAttribute(e){try{T.debug("removing user attribute",e);const t=new $e;t.unset(e),Et(t)}catch(t){T.error(t)}}setUserAttributes(e,t){try{if(T.debug("setting user attributes",{permanentUserAttributes:t,userAttributes:e}),Object.keys(e).length===0&&Object.keys(t||{}).length===0)return;const n=new $e;Object.entries(e).forEach(([r,i])=>{i!=null?n.set(r,i):n.unset(r)}),t&&Object.entries(t).forEach(([r,i])=>{i!=null&&n.setOnce(r,i)}),F.set({userAttributes:{...F.get().userAttributes||{},...e||{},...t||{}}}),Et(n)}catch(n){T.error(n)}}async signup(e,t){try{await Na(e,t,"signup"),this.logEvent({custom_attributes:t||{},event_name:"Registration Complete",event_type:"other"})}catch(n){T.error("error while logging out",n)}}canLog(e){const{event_name:t}=e;return this._config.eventConfig?.[t]?.enabled===!1?(T.debug("dropping event according to event config",e),!1):!0}prepareAndUpload(){try{const{_eventQueue:e}=this;if(this._eventQueue=[],e.length===0)return;T.debug("flushing event queue",e),e.forEach(t=>{this.logEvent(t)})}catch(e){T.error(e)}}},Lh=e=>e.environment==="development"?"https://ok622kc3lg.execute-api.us-east-1.amazonaws.com/v1/events":"https://eq47czqy1l.execute-api.us-west-2.amazonaws.com/v1/events",Dh=e=>{const{hudEnabled:t}=se.get();t&&window.__NITROUS__&&(window.__NITROUS__.debugEvents=window.__NITROUS__.debugEvents||[],window.__NITROUS__.debugEvents.push(e),window.dispatchEvent(new CustomEvent("nitrous-event",{detail:e})))}
25,Zs=e=>typeof window.OptanonActiveGroups=="string"&&window.OptanonActiveGroups.includes(e),Mh=(e,t)=>{Zs(e)&&t();const n=window.OptanonWrapper;window.OptanonWrapper=()=>{n?.(),Zs(e)&&t()}},xh=()=>{const{[De.debug]:e,[De.hud]:t,[De.prHudNumber]:n,[De.prNumber]:r}=mt();e==="true"?(T.enable(),se.set({debug:!0})):e==="false"&&se.set({debug:!1}),t==="true"?se.set({hudEnabled:!0}):t==="false"&&se.set({hudEnabled:!1}),n==="false"?se.set({prHudNumber:void 0}):n!==void 0&&se.set({prHudNumber:n}),r==="false"?(se.set({prNumber:void 0}),z.set({loadedPrNumber:void 0})):r!==void 0&&se.set({prNumber:r});const i=ic();i&&Ve({...i.apiKey&&{apiKey:i.apiKey},...i.deviceId&&{deviceId:i.deviceId}})},Uh=[Um,Dm,hm,np,xm,mm,$p,Rm,yp,Sm,Ip,Im,ip,wp,Tm],Fh=e=>{xh();const{apiKey:t,deviceId:n}=Ae()||{};if(ep()){tp();return}const r=new Nh({...t&&{apiKey:t},...n&&{deviceId:n},...Fi,...e,debug:se.get().debug||e.debug,eventConfig:{...Fi.eventConfig||{},...e.eventConfig||{}}});oc(r),typeof e.useOneTrustConsent=="string"?Mh(e.useOneTrustConsent,()=>{r.init()}):r.init()};return j.bucketUser=Ha,j.flushAuthCookie=Qv,j.getDeviceId=Fn,j.getFeatureFlag=Rv,j.getPageData=Xv,j.getUserAttributes=Gv,j.getVariant=Nv,j.init=Fh,j.logChatbotClose=jv,j.logChatbotOpen=qv,j.logChatbotPrompt=Bv,j.logChatbotReportIssue=Uv,j.logCommentPosted=Fv,j.logContentImpression=Yr,j.logContentSectionView=Vv,j.logError=Hv,j.logEvent=V,j.logExposure=Dv,j.logFormSubmit=Jv,j.logReportIssue=$v,j.login=zv,j.logout=Yv,j.push=Ga,j.removeUserAttribute=Wv,j.setUserAttributes=Ba,j.signup=Kv,j})({});typeof window.nitrousOnLoad=="function"&&window.nitrousOnLoad();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.