(function() { const C={noOfErrors:0,noOfSecondsWaitingForNR:0,stoppedWaitingForNR:!1,logs:[],secondsToWaitForNR:10},h=(e,t,n,r=()=>{})=>{try{return e()}catch(o){C.noOfErrors=C.noOfErrors+1,kt(o,{code:t,message:n}),r()}},Ge=()=>C.noOfErrors;var w=(e=>(e.MissingData="ECOM:MISSING_DATA",e.UnableToInit="ECOM:UNABLE_TO_INITALISE",e.QueueAction="ECOM:QUEUE_ACTION",e.QueueEvent="ECOM:QUEUE_EVENT",e))(w||{});const kt=(e,t)=>{const n=window.newrelic;if(n){C.logs.forEach(r=>n.noticeError(r.message,r.properties)),C.logs=[],n.noticeError(e,t);return}if(C.stoppedWaitingForNR){Te(`LibraryError|Code:${t.code}|${t.message}|${e.message}`);return}if(C.logs.push({message:e,properties:t}),C.logs.length==1){const r=setInterval(()=>{if(C.noOfSecondsWaitingForNR>=C.secondsToWaitForNR||window.newrelic){C.stoppedWaitingForNR=!0,clearInterval(r),C.logs.forEach(o=>kt(o.message,o.properties));return}C.noOfSecondsWaitingForNR=C.noOfSecondsWaitingForNR+1},1e3);return}},Te=e=>{window.dataLayer=window.dataLayer||[],(window.gtag=window.gtag??function(){window.dataLayer.push(arguments)})("event","ecomt",{ReferenceText:e})},_t="data-mktp-product",yt="data-mktp-container",Ct="data-mktp-list",un="data-mktp-conversion";function se(e,t){if(!e)return{success:!t};try{return{success:!0,result:JSON.parse(e)}}catch{return{success:!1}}}const ln=e=>{const t=e.getAttribute(_t);return se(t,!0)},fn=e=>{const t=e.getAttribute(un);return se(t,!1)},gn=e=>{const t=e.getAttribute(Ct);return se(t,!0)},mn=e=>{const t=e.getAttribute(yt);return se(t,!0)};function bt(e,t){return e.hasAttribute(t)?e:e.closest(`[${t}]`)}const hn=e=>e.tagName==="A"?e:e.querySelector("a"),pn=e=>bt(e,_t),wn=e=>e.closest(`[${Ct}]`),In=e=>bt(e,yt);var St=(e=>(e.conversion="Conversion",e))(St||{}),m=(e=>(e.TrackPage="data-ecom-page",e.TrackContainer="data-ecom-container",e.TrackMiscClick="data-ecom-misc-click",e.TrackLinkClick="data-ecom-link",e.TrackProduct="data-ecom-product",e.TrackCart="data-ecom-cart",e.TrackConversion="data-ecom-conversion",e.TrackList="data-ecom-list",e.TrackTID="data-ecom-tid",e.TrackImpression="data-ecom-impression",e.Form="data-ecom-form",e.TrackFormAddToCart="data-ecom-form-add-to-cart",e.TrackClickAddToCart="data-ecom-click-add-to-cart",e.TrackFormBeginCheckout="data-ecom-form-begin-checkout",e.TrackClickBeginCheckout="data-ecom-click-begin-checkout",e.TrackFormPurchase="data-ecom-form-purchase",e.TrackExternalWidget="data-ecom-external-widget",e.FormFieldNonSensitive="data-ecom-form-field-non-sensitive",e.FormFieldSensitive="data-ecom-form-field-sensitive",e.FormFieldSensitivePartial="data-ecom-form-field-sensitive-partial",e.Interacted="data-ecom-interacted",e))(m||{}),ke=(e=>(e.DisablePassive="data-ecom-disable-passive",e))(ke||{});const Me=(e,t=document)=>{var n;return(n=t.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]},ae=e=>({...xe(e),...kn(e)}),xe=e=>B(m.TrackContainer,e),kn=e=>{const t=B(m.TrackProduct,e),n=t.index??_n(e);return n!=null&&(t.index=n),t},X=e=>{const t=B(m.TrackPage,e);return t&&Object.keys(t).length===0&&t.constructor===Object?{}:t},_n=e=>{const t=z(e,[m.TrackList])||z(e,[m.TrackContainer]),n=z(e,m.TrackProduct);if(t&&n){const r=t.querySelectorAll(Le(m.TrackProduct));return Array.from(r).indexOf(n)+1}},z=(e,t)=>e==null?void 0:e.closest(Le(t)),U=(e,t)=>{if(t==null)return{};try{return JSON.parse((t==null?void 0:t.getAttribute(e))??(t==null?void 0:t.getAttribute(J(e)))??"{}")}catch{return{}}},B=(e,t)=>U(e,h(()=>Tt(e,t),w.MissingData,e));function Tt(e,t,n=0){var o;if(n==100||!t||t===document||t===window)return null;const r=z(t,e);return r||Tt(e,(o=t.getRootNode())==null?void 0:o.host,n+1)}const ve=(e,t)=>{var n;return(t==null?void 0:t.clickTextOverride)||(("value"in e?((n=e.querySelector(`[value='${e.value}']`))==null?void 0:n.textContent)??e.value:"")||e.innerText||e.textContent||"").trim()||(t==null?void 0:t.clickText)||""},re=(e,t)=>{const n=Tn(e.tagName)==="a"?e:e.querySelector("a");return(n==null?void 0:n.getAttribute("href"))||(t==null?void 0:t.clickUrl)||""},Ee=(e,t)=>{const n=re(e,void 0);if(!n)return"NA";if(t!=null&&t.tid&&n&&n.includes(t.tid))return t.tid;const r=Sn(),o=bn(n,r),i=o.split("_");return r&&i[1]?`${i[0].substring(i[0].indexOf(r))}_${i[1]}`:o},yn=e=>{const{provider:t}=Ae(e);return t?{affiliation:t}:{}},Ae=e=>{var o,i;window.ecomBase=window.ecomBase||window.mktpBase;const t=(o=window.ecomBase)!=null&&o.sameSiteIframe?window.parent:window,n=(t==null?void 0:t.gtm_link_table)??((i=t.ecomBase)==null?void 0:i.table);return Cn(e,n)};function Cn(e,t){if(Array.isArray(t)){for(const n of t)if(new RegExp(n[0]).test(e)&&typeof n[1]=="object")return n[1]}return{provider:"",TID:"",PageUrl:"",static:{}}}function bn(e,t){var d;const n=new URL(e,"https://www.mktptgenerateconversionurl.internal"),{TID:r}=Ae(e)||{};if(r){const c=n.searchParams.get(r);if(c)return c}if(!t)return"NA";const o=`(${t}_)(.+?)(?=[^a-zA-Z0-9]|$)`,i=new RegExp(o);for(const[,c]of n.searchParams)if(c.includes(t+"_"))return((d=c.match(i))==null?void 0:d[0])??c;const s=n.pathname.match(i);if(s&&s[1])return s[0].replace("/","");const a=n.hash.match(i);if(a&&a[1])return a[0];const u=n.searchParams.toString().match(i);return u&&u[1]?u[0]:"NA"}function Sn(){return[Me("mktp_clientId"),Me("ecom_clientId")].find(e=>e)}function Le(e){const t=Array.isArray(e)?e:[e];return t.forEach(r=>{t.push(J(r))}),t.map(r=>`[${r}]`).join(", ")}const J=e=>e.replace("ecom-","mktp-");function xt(e,t){return[t,J(t)].find(n=>e.hasAttribute(n))}function vt(e,t){return e.querySelectorAll(Le(t))}function Tn(e){return e.toLowerCase()}function xn(e){var g;const t=hn(e),n=(t==null?void 0:t.href)??null;let r=null;t!=null&&t.innerText?r=t==null?void 0:t.innerText:r=((g=fn(e).result)==null?void 0:g.clickText)??null;const o=pn(e);let i=null;if(o){const p=ln(o).result;p&&(i={...p})}const s=In(e);let a=null,u=null;if(s){const p=mn(s).result;p&&(a=p.componentTitle,u=p.componentType)}const d=wn(e);let c=null,l=null;if(d){const p=gn(d).result;if(p&&(c=p.listName),o){const S=vt(d,m.TrackProduct);l=Array.from(S).indexOf(o)+1}}return{event:St.conversion,product:i,href:n,linkText:r,componentTitle:a,componentType:u,listName:c,position:l}}const vn=e=>xt(e,m.TrackConversion)?xn(e):null;var f=(e=>(e.ActionGenerateConversionUrl="action:generate-conversion-url",e.ActionGenerateTid="action:generate-tid",e.ActionUpdateConsent="action:update-consent",e.ActionSetLoggedInUserId="action:set-logged-in-user-id",e.Conversion="event:conversion",e.TidFocus="event:tid-focus",e.MiscClick="event:misc-click",e.LinkClick="event:link-click",e.ProductImpression="event:product-impression",e.FormStart="event:form-start",e.FormProgression="event:form-progression",e.FormSubmission="event:form-submission",e.AddToCart="event:add-to-cart",e.ProductView="event:product-view",e.ProductListView="event:product-list-view",e.BeginCheckout="event:begin-checkout",e.Purchase="event:purchase",e.AccountSignUp="event:account-sign-up",e.SelectContent="event:select-content",e.RequoteSubmission="event:requote-submission",e.ExternalWidgetRender="event:external-widget-render",e.ExternalWidgetInteraction="event:external-widget-interaction",e.PageView="event:page-view",e.InternalAction="action:internal",e.Hook="hook:tracking",e.HookRemove="hook:remove",e.ActionSetFacebookPixelId="action:set-facebook-pixel-id",e))(f||{});function En(e,t){window.ecomtq=window.ecomtq??[],window.ecomtq.push({name:f.ActionUpdateConsent,properties:{onetrust:e,consentObj:t}})}var Q={},M={},je;function An(){if(je)return M;je=1,Object.defineProperty(M,"__esModule",{value:!0});class e{constructor(...r){this._head=this._tail=null,this._length=0,r.length>0&&r.forEach(o=>{this.append(o)})}*iterator(){let r=this._head;for(;r;)yield r.value,r=r.next}[Symbol.iterator](){return this.iterator()}get head(){return this._head?this._head.value:null}get tail(){return this._tail?this._tail.value:null}get length(){return this._length}insert(r,o,i=!1){if(i&&this.isDuplicate(r))return!1;let s=new t(r),a=this._head;if(a)for(;;){if(a.value===o)return s.next=a.next,s.prev=a,a.next=s,s.next?s.next.prev=s:this._tail=s,this._length++,!0;if(a.next)a=a.next;else return!1}else return!1}append(r,o=!1){if(o&&this.isDuplicate(r))return!1;let i=new t(r);return this._tail?(this._tail.next=i,i.prev=this._tail,this._tail=i):this._head=this._tail=i,this._length++,!0}prepend(r,o=!1){if(o&&this.isDuplicate(r))return!1;let i=new t(r);return this._head?(i.next=this._head,this._head.prev=i,this._head=i):this._head=this._tail=i,this._length++,!0}remove(r){let o=this._head;if(o){if(o.value===r)return this._head=o.next,this._head.prev=null,o.next=o.prev=null,this._length--,o.value;for(;;){if(o.value===r)return o.next?(o.prev.next=o.next,o.next.prev=o.prev,o.next=o.prev=null):(o.prev.next=null,this._tail=o.prev,o.next=o.prev=null),this._length--,o.value;if(o.next)o=o.next;else return}}}removeHead(){let r=this._head;if(r)return this._head.next?(this._head.next.prev=null,this._head=this._head.next,r.next=r.prev=null):(this._head=null,this._tail=null),this._length--,r.value}removeTail(){let r=this._tail;if(r)return this._tail.prev?(this._tail.prev.next=null,this._tail=this._tail.prev,r.next=r.prev=null):(this._head=null,this._tail=null),this._length--,r.value}first(r){let o=this.iterator(),i=[],s=Math.min(r,this.length);for(let a=0;a"u")){s=K({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var u in s)s[u]&&(a+="; "+u,s[u]!==!0&&(a+="="+s[u].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],s={},a=0;a1?`.${n[1]}.${n[0]}`:"."+t[1]}return""}const q={},V=function(e,t){return Fn()?()=>t():(q[e]||(q[e]=t),()=>(typeof q[e]=="function"&&(q[e]=q[e]()),q[e]))};function Fn(){var e,t;try{return((e=process==null?void 0:process.env)==null?void 0:e.VITEST)=="true"&&((t=process==null?void 0:process.env)==null?void 0:t.VITESTSINGLETON)!="true"}catch{}return!1}const I=V("settings",Dn);function Dn(){const e={tenantPrefix:k().tenantPrefix??k().tidPrefix??"NA",partnerNameByUrl:k().table=k().table||(k().table=F()),pageLevelDataValues:k().pageLevelValues||window.pageLevelDataValues||{...window.pageLevelDatalayer}},t=()=>e.tenantPrefix,n=()=>window.gtm_link_table??e.partnerNameByUrl,r=()=>{const T=k().trafficSource;return T||"internal"},o=()=>e.pageLevelDataValues||{},i=()=>k().endpoint,s=()=>k().conversionEventName||"Conversion",a=()=>k().consent,u=()=>d()[0],d=()=>k().gaIds||[k().gaId],c=()=>{var T;return(T=k().ssgtmUrl)==null?void 0:T.replace(/\/$/,"")},l=()=>k().ssgtmPreview,g=()=>15e3,p=()=>k().itemType=="embed",S=()=>{const{loggedInUserId:T}=k();return(T||"").length>5?T:void 0},O=()=>k().trustArcConsent;function F(){const{blob:T}=k();if(!T)return;return h(()=>cn(T),w.MissingData,"unable to decrypt blob");function cn(le){return JSON.parse(atob(dn(le)))}function dn(le){return le.split("").reverse().join("")}}function sn(){return k().version||"latest"}function an(){return{path:k().cookiePath,cookieDomainIsHostname:k().cookieDomainIsHostname===!0}}return{tenantPrefix:t,partnerRules:n,trafficSource:r,sstEndpoint:i,conversionEventName:s,consentDefault:a,primaryGaId:u,gaIds:d,ssgtmUrl:c,gaLoadingTimeout:g,pageLevelData:o,isCrossDomainIframeWidget:p,version:sn,ssgtmPreview:l,loggedInUserId:S,cookies:an,trustArcConsent:O}}function k(){return window.ecomBase||window.mktpBase||{}}const D=(e,t,n)=>{const r=[e];e.startsWith("ecom_")&&r.push(Et(e));const o=I().cookies();r.forEach(i=>{const s={expires:n,sameSite:"Lax",secure:qn(),path:o.path||"/"};h(()=>{o.cookieDomainIsHostname||(s.domain=Nn(window.location.hostname)??""),te.set(i,t,s)},w.MissingData,"cookie saving")})},Rn=e=>h(()=>{const t=window.location.search;return new URLSearchParams(t).get(e)},w.MissingData,"from queryString")||"",b=e=>h(()=>e.startsWith("ecom_")?te.get(e)||te.get(Et(e)):te.get(e),w.MissingData,"cookie"),On=(e,t)=>{const n=b(e);return n&&D(e,n,t),n},Et=e=>e.replace("ecom_","mktp_");function qn(){var t;let e=!1;try{e=((t=process==null?void 0:process.env)==null?void 0:t.VITEST)=="true"}catch{}return!("STORIES"in window)&&!e}let Bn=e=>crypto.getRandomValues(new Uint8Array(e)),Vn=(e,t,n)=>{let r=(2<{let s="";for(;;){let a=n(o),u=o|0;for(;u--;)if(s+=e[a[u]&r]||"",s.length>=i)return s}}},At=(e,t=21)=>Vn(e,t|0,Bn);const x=V("user",$n);function $n(){const e={isNewClientId:!1},t=j("ga_sessionId",1/48),n=j("ga_clientId"),r=j("ecom_sessionId",1/48),o=j("ecom_clientId",400,u),i=j("ecom_sstSessionCount"),s=()=>{const c=o.getAndExtend();return{userId:Rn("ecom_userid")||b("ecom_userid"),gaSessionId:t.get(),gaClientId:n.getAndExtend(),sessionId:r.get(),isNewClientId:e.isNewClientId,clientId:c,sstSessionCount:Number(i.getAndExtend()),loggedInUserId:e.loggedInUserId}},a=()=>{const l=Number(i.get()??0)+1;return i.store(l.toString()),l};function u(c){const l=I().tenantPrefix();if(!c||c.length!=22||!c.startsWith(l)){const g=`${l}${At("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",20)()}`;return o.store(g),e.isNewClientId=!0,g}return c}function d(c){e.loggedInUserId=c}return{getUserState:s,storeGaClientId:n.store,storeGaSessionId:t.store,storeClientId:o.store,storeSessionId:r.store,storeLoggedInUserId:d,incrementSessionCount:a}}function j(e,t=400,n=void 0){return{get:()=>{const r=b(e);return(n==null?void 0:n(r))||r},getAndExtend:()=>{const r=On(e,t);return(n==null?void 0:n(r))||r},store:r=>{D(e,r,t)}}}function Ue(e){const n=I().partnerRules();return Gn(e,n)}function Gn(e,t){if(Array.isArray(t)){for(const n of t)if(new RegExp(n[0]).test(e))return n[1]}}const ye=new Un.Queue,Mn=async()=>{var t,n;const e=x().getUserState();return{pageLocation:encodeURIComponent(window.location.href),pageReferrer:encodeURIComponent(document.referrer),pageTitle:((t=window.ecomBase)==null?void 0:t.title)??document.title,screenResolution:`${window.screen.width}x${window.screen.height}`,MarketplaceClientId:e.clientId??"",MarketplaceSessionId:e.sessionId??"",userId:e.userId??"",gaClientId:e.gaClientId??"",gaSessionId:e.gaSessionId??"",trafficSource:((n=window.ecomBase)==null?void 0:n.trafficSource)??""}};function jn(){const e=setInterval(()=>{const t=x().getUserState(),n=b("mktp_session_new")==="yes"?!0:!b("mktp_session_new"),r=b("mktp_sslt")==="true";(t.clientId??"")&&(n&&!r&&(Wn(),D("mktp_sslt","true",.020833333333333332)),clearInterval(e))},20)}function Lt(){jn()}function Wn(){const e={...Mn(),event:"LandingPage",eventTime:Math.floor(performance.timeOrigin)};ye.enqueue(e),Hn().then(()=>{}).catch(t=>{})}async function Hn(){if(!window.ecomBase.endpoint)return;const e=[];for(let n=0;nnew Date().toISOString(),$=typeof Buffer=="function",He=typeof TextDecoder=="function"?new TextDecoder:void 0,ze=typeof TextEncoder=="function"?new TextEncoder:void 0,Zn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",W=Array.prototype.slice.call(Zn),ee=(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(W),Xn=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,y=String.fromCharCode.bind(String),Je=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Yn=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),Pt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Qn=e=>{let t,n,r,o,i="";const s=e.length%3;for(let a=0;a255||(r=e.charCodeAt(a++))>255||(o=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|o,i+=W[t>>18&63]+W[t>>12&63]+W[t>>6&63]+W[t&63]}return s?i.slice(0,s-3)+"===".substring(s):i},Nt=typeof btoa=="function"?e=>btoa(e):$?e=>Buffer.from(e,"binary").toString("base64"):Qn,Kn=$?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,o=e.length;r{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?y(192|t>>>6)+y(128|t&63):y(224|t>>>12&15)+y(128|t>>>6&63)+y(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return y(240|t>>>18&7)+y(128|t>>>12&63)+y(128|t>>>6&63)+y(128|t&63)}},tr=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,nr=e=>e.replace(tr,er),Ze=$?e=>Buffer.from(e,"utf8").toString("base64"):ze?e=>Kn(ze.encode(e)):e=>Nt(nr(e)),Ft=(e,t=!1)=>t?Yn(Ze(e)):Ze(e),rr=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,or=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return y((n>>>10)+55296)+y((n&1023)+56320);case 3:return y((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return y((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},ir=e=>e.replace(rr,or),sr=e=>{if(e=e.replace(/\s+/g,""),!Xn.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,n="",r,o;for(let i=0;i>16&255):o===64?y(t>>16&255,t>>8&255):y(t>>16&255,t>>8&255,t&255);return n},Dt=typeof atob=="function"?e=>atob(Pt(e)):$?e=>Buffer.from(e,"base64").toString("binary"):sr,ar=$?e=>Je(Buffer.from(e,"base64")):e=>Je(Dt(e).split("").map(t=>t.charCodeAt(0))),cr=$?e=>Buffer.from(e,"base64").toString("utf8"):He?e=>He.decode(ar(e)):e=>ir(Dt(e)),dr=e=>Pt(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),ur=e=>cr(dr(e)),Pe=V("adnetworks",fr),Rt="ecom_networks_v2",lr="mktpt_networks_v2",oe={taboola:{limit:30,qs:["tcid"]},facebook:{limit:7,qs:["fbclid"],cookies:["_fbc","_fbp"]},google:{limit:90,qs:["gclid","gbraid","wbraid"]},reddit:{limit:28,qs:["rdt_cid"],cookies:["_rdt_cid","_rdt_em","_rdt_uuid"]},tiktok:{limit:28,qs:["ttclid"],cookies:["_ttp"]},microsoft:{limit:28,qs:["msclkid"]},"media.net":{limit:28,qs:["MaxclickID","mcid"],qsValidation:/^\d{29}$/}};function fr(){function e(){try{const o=window.localStorage.getItem(Rt)||window.localStorage.getItem(lr),i=o?{...fe(),...JSON.parse(ur(o))}:fe();return mr(i)}catch{return fe()}}function t(){const o=e(),i=new URL(window.location.href);Object.entries(oe).forEach(([s,a])=>{const u=s,d=a.qs.find(g=>{const p=i.searchParams.get(g)||"";return a.qsValidation?p.match(a.qsValidation):p.length>10}),c=d?i.searchParams.get(d):"",l=o[u];c&&!l.find(g=>g.clickoutId==c)&&l.push({clickoutId:c,clickoutQS:d||"",timestamp:Ut(),landingUrl:window.location.href})});try{Ot(o)}catch{gr(o)}}function n(){const o=[];return Object.entries(e()).reduce((i,[s,a])=>{const u=a[a.length-1];return u&&i.push({name:s,clickId:u.clickoutId,timeStamp:u.timestamp}),i},o).sort(function(i,s){return new Date(i.timeStamp).getTime()-new Date(s.timeStamp).getTime()})}function r(){const o=e();return Object.entries(o).reduce((s,[a,u])=>{const d=a,{cookies:c}=oe[d]||{};return s[d]={values:u,cookies:u.length==0||!c?{}:c.reduce((l,g)=>(l[g]=b(g),l),{})},s},{})}return{initalize:t,getState:r,timeline:n}}function Ot(e){window.localStorage.setItem(Rt,Ft(JSON.stringify(e)))}function gr(e){const t={...e};Object.entries(t).forEach(([n,r])=>{const o=n;t[o]=[r[0],r[r.length-1]].filter(i=>i)});try{Ot(t)}catch{}}function fe(){return Object.keys(oe).reduce((e,t)=>(e[t]=[],e),{})}function mr(e){const t={...e};return Object.entries(t).forEach(([n,r])=>{const o=n;t[o]=r.filter(i=>hr(Ut(),i.timestamp){var n;const e=I().trustArcConsent(),t=e==null?void 0:e.locationDetectionPixelUrl;if(!t)return!1;try{const o=(n=(await fetch(t,{method:"HEAD"})).headers.get("x-country-code"))==null?void 0:n.toLowerCase();return pr.includes(o||"")}catch{return!1}},Ir=e=>{const t=I().trustArcConsent(),n=t!=null&&t.forceCountryCode?`&country=${t.forceCountryCode}`:"",r=t?`&privacypolicylink=${encodeURIComponent(t.privacyUrl)}`:"",o=t!=null&&t.language?`&language=${t.language}`:"",i="consent_preferences_container",s=document.createElement("script");s.async=!0,s.crossOrigin="true",s.type="text/javascript",s.src=`https://consent.trustarc.com/notice?domain=${e}&c=${i}&js=nj¬iceType=bb&text=true>m=1${n}${r}${o}`;const a=document.createElement("div");a.id="consent_blackbar",a.className=i,a.style.fontSynthesis="weight",document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(a),document.body.appendChild(s)}):(document.body.appendChild(a),document.body.appendChild(s))},kr=()=>{(function(){(function(){const t="__tcfapiLocator",n=[],r=window;let o=r,i,s;function a(){const c=r.document,l=!!r.frames[t];if(!l)if(c.body){const g=c.createElement("iframe");g.style.cssText="display:none",g.name=t,c.body.appendChild(g)}else setTimeout(a,5);return!l}function u(){if(arguments.length)arguments[0]==="setGdprApplies"?arguments.length>3&&parseInt(arguments[1],10)===2&&typeof arguments[3]=="boolean"&&(s=arguments[3],typeof arguments[2]=="function"&&arguments[2]("set",!0)):arguments[0]==="ping"?typeof arguments[2]=="function"&&arguments[2]({gdprApplies:s,cmpLoaded:!1,cmpStatus:"stub"}):n.push(arguments);else return n}function d(c){const l=typeof c.data=="string";let g={};if(l)try{g=JSON.parse(c.data)}catch{}else g=c.data;const p=typeof g=="object"&&g!==null?g.__tcfapiCall:null;p&&window.__tcfapi(p.command,p.version,function(S,O){const F={__tcfapiReturn:{returnValue:S,success:O,callId:p.callId}};c&&c.source&&c.source.postMessage&&c.source.postMessage(l?JSON.stringify(F):F,"*")},p.parameter)}for(;o;){try{if(o.frames[t]){i=o;break}}catch{}if(o===r.top)break;o=o.parent}i||(a(),r.__tcfapi=u,r.addEventListener("message",d,!1))})()})()},_r="cmapi_cookie_privacy";let ie;const yr=async()=>{clearInterval(ie),window.removeEventListener("message",qt),Cr();const e=I().trustArcConsent();let t=(e==null?void 0:e.domain)??"";e!=null&&e.euDomain&&await wr()&&(t=e.euDomain,kr()),Ir(t)},Cr=()=>{const{updateTrustArcPreferences:e}=R();Xe(Ce())||(ie=window.setInterval(()=>{const t=Ce();Xe(t)&&(clearInterval(ie),e(t))},100)),window.addEventListener("message",qt)},br=e=>{try{return JSON.parse(e)}catch{return null}},Ce=()=>Bt(b(_r));function qt(e){var n;const t=br(e.data);if(t&&t.source==="preference_manager"&&t.message==="submit_preferences"){const{updateTrustArcPreferences:r}=R();clearInterval(ie),r((Bt(((n=t.data)==null?void 0:n.value)??t.data)??[]).map(o=>o+1))}}function Bt(e){return h(()=>{if(e){const t=e.match(/\d+/g);return t==null?void 0:t.map(Number)}},w.MissingData,"consentTrustArc")}function Xe(e){return e!==void 0&&e.length>0}const R=V("consent",xr),Sr=2,Tr=3,Ye="ecom_adv_consent";function xr(){const e={onChange:[],consentData:void 0},t=d=>{e.onChange.includes(d)||e.onChange.push(d);const c=i();c&&d(c)},n=d=>{const c=o(d);c&&r(c)},r=d=>{e.consentData=d,e.onChange.forEach(c=>c(e.consentData))},o=d=>{if(d)return{analytics_storage:d.includes(Sr)?"granted":"denied",ads:d.includes(Tr)?"granted":"denied"}},i=()=>{var c;const d=I();return e.consentData=(c=d==null?void 0:d.trustArcConsent())!=null&&c.enabled?o(Ce()):s()},s=()=>{const d=b(Ye);if((d==null?void 0:d.indexOf("{"))===0)return h(()=>{const c=JSON.parse(d);if("analytics_storage"in c)return c},w.MissingData,"consentManual")},a=({onetrust:d,consentObj:c})=>{let l={analytics_storage:"denied",ads:"denied"};d?(l.analytics_storage=d.includes(",2,")?"granted":"denied",l.ads=d.includes(",3,")?"granted":"denied"):c&&(l=c),D(Ye,JSON.stringify(l),400),r(l)};function u(){return!e.consentData||Object.keys(e.consentData).length===0?"default":Object.entries(e.consentData||{}).filter(([,d])=>d==="granted").map(([d])=>d).join("|")||"all_denied"}return{subscribe:t,updateTrustArcPreferences:n,storeManualPreferences:a,getConsentValue:u}}const vr=V("optimizely",Er);function Er(){return{experiments:()=>{var o;const t=window.optimizely;if(!t||Array.isArray(t)||typeof t.get!="function")return;const n=((o=t.get("state"))==null?void 0:o.getExperimentStates())||{};return Object.entries(n).filter(([,{isActive:i}])=>i).map(([i,{isActive:s,variation:a,isInExperimentHoldback:u}])=>`${i}:${s}:${s?a.id:""}:${u}`).join("|")}}}const Ar=()=>{const e=Pe().timeline(),t=e[0];if(!t)return{};const n=e[e.length-1];return{FirstNetworkName:t.name,FirstNetworkClickoutId:(t.clickId||"").substring(0,100),FirstNetworkTimestamp:t.timeStamp,LatestNetworkName:n.name,LatestNetworkClickoutId:(n.clickId||"").substring(0,100),LatestNetworkTimestamp:n.timeStamp}},ce=()=>{const e=I(),t=x().getUserState(),n={user_id:t.loggedInUserId||e.loggedInUserId()},r=window.navigator.userAgent,o="mktp_",i=window.mktp_traffic_type?o+"device":r.match(/FAbot-|Forbes/i)?o+"bot":r.match(/bot/i)?"external_bot":void 0;return{...e.pageLevelData(),MarketplaceClientId:t.clientId,MarketplaceSessionId:t.sessionId,traffic_type:e.trafficSource(),UserId:t.userId||(t==null?void 0:t.clientId),ExperimentInfo:vr().experiments(),UserAgent:window.navigator.userAgent,...Ar(),...n.user_id?n:{},CookiePreferences:R().getConsentValue(),...i?{MarketplaceTrafficType:i}:{}}};function Lr(e,t){let n=!1;t!==e&&(n=!0);const r=n?String(new Date().getTime()):b("ecom_sessionId")||b("mktp_sessionId")||String(new Date().getTime());Jn(r,n),window.ecomBase.gaLoaded||(window.ecomBase.gaLoaded=!0,Lt())}function Ur(){window.gtag("set",ce())}function Pr(){const e=I().primaryGaId();Ur();const t=b("ga_sessionId");e&&window.gtag("get",e,"session_id",n=>Lr(n,t))}window.consentUpdate=En;const Nr={init:function(){window.ecomBase=window.ecomBase||window.mktpBase,window.pageLevelDataValues={...window.pageLevelDatalayer},window.ecomBase.gaLoaded=!1,zn(),window.INITIALIZED||(window.INITIALIZED=!0),Pr();let e=!1;window.ecomBase.gaLoaded||document.addEventListener("DOMContentLoaded",()=>{let t;e||(t=setTimeout(()=>{Lt()},15e3),e=!0);const n=setInterval(()=>{window.ecomBase.gaLoaded&&(clearTimeout(t),clearInterval(n))},20)})}},Fr=()=>{let e;function t(){e&&clearTimeout(e),e=setTimeout(()=>{Mt(),e=null},1200)}const n=document.querySelector("body"),r={childList:!0,subtree:!0},o=function(s){for(const a of s)a.type==="childList"&&a.addedNodes.length>0&&t()};new MutationObserver(o).observe(n,r)};function v(e){Rr().push(e)}function Dr(e){v({name:f.Hook,properties:e})}const Rr=()=>{var t;const e=(t=window.ecomBase)!=null&&t.sameSiteIframe?window.parent:window;return e.ecomtq=e.ecomtq??[]},Z=e=>{const t=U(m.TrackConversion,e),n=ae(e),r=re(e,t),o=n!=null&&n.affiliation?{}:h(()=>yn(r),w.MissingData,"partnerName");return{...B(m.TrackList,e),...n,...o,...t,clickText:ve(e,t),clickUrl:re(e,t),tid:Ee(e,U(m.TrackTID,e)),...X(e)}},Or=e=>{const t=U(m.TrackLinkClick,e);v({name:f.LinkClick,properties:{...ae(e),...t,clickText:ve(e,t),clickUrl:re(e,t),...X(e)}})},qr=e=>{const t=U(m.TrackMiscClick,e);v({name:f.MiscClick,properties:{...ae(e),...t,clickText:ve(e,t),clickType:t.componentType??t.clickType??"",...X(e),...B(m.TrackList,e)}})},Br=e=>{v({name:f.Conversion,properties:Z(e)})},Vt=(e,t)=>{v({name:f.ActionGenerateConversionUrl,properties:{url:e},cb:(n,r)=>t({convertedUrl:n,tid:r})})},Vr=(e,t)=>{const n=new IntersectionObserver((r,o)=>{r.forEach(i=>{const s=i.target;i.isIntersecting&&(o.disconnect(),t(s))})},{rootMargin:"0px",threshold:.5});return n.observe(e),n},$r=e=>Vr(e,Gr),Gr=e=>{v({name:f.ProductImpression,properties:{...ae(e),...B(m.TrackList,e)}})},be={},ge=(e,t=2e4)=>{const{tid:n}=Z(e);n in be||(Mr(n,t),v({name:f.TidFocus,properties:Z(e)}))};function Mr(e,t){t<1||(be[e]=setTimeout(()=>{delete be[e]},t))}const jr=(e,t=()=>!0)=>{["click","auxclick"].forEach(n=>{e.addEventListener(n,r=>{r.ecomTrackingHandled=!0,t(e)&&Br(e),ge(e)})},{passive:!0}),["touchstart"].forEach(n=>{e.addEventListener(n,()=>ge(e))},{passive:!0}),["focus","contextmenu"].forEach(n=>{e.addEventListener(n,()=>ge(e))},{passive:!0})},Wr=e=>{e.addEventListener("click",t=>{t.ecomTrackingHandled=!0,qr(e)},{passive:!0})},Hr=e=>{["click","auxclick"].forEach(t=>{e.addEventListener(t,n=>{n.ecomTrackingHandled=!0,Or(e)},{passive:!0})})},H=(e,t)=>{vt(document,e).forEach(n=>{const r=window.ecomDomNodes=window.ecomDomNodes??new Map;r.has(n)||(r.set(n,!0),h(()=>t(n),w.UnableToInit,"attachEventListener"))})},zr=(e,t)=>{const n=U(m.TrackExternalWidget,t),r=Jr(e,n);return{...n,tid:r}},Jr=(e,t)=>{var s;const n=Ae(e.src),r=n==null?void 0:n.TID;if(r){const u=new URL(e.src).searchParams.get(r);if(u)return u}const o="data-sub-id",i=(s=e==null?void 0:e.closest(`[${o}]`))==null?void 0:s.getAttribute(o);return i||t.tid},Zr=e=>{v({name:f.ExternalWidgetRender,properties:{...U(m.TrackExternalWidget,e),...xe(e),...X(e)}})},$t=(e,t)=>{const n=t?zr(t,e):U(m.TrackExternalWidget,e);v({name:f.ExternalWidgetInteraction,properties:{...n,...xe(e),...X(e)}})},Xr=()=>{const e=()=>{const t=document.activeElement;t&&t.tagName==="IFRAME"&&Yr(t)};window.addEventListener("blur",e)},Yr=e=>{const t=z(e,m.TrackExternalWidget);t&&Qr(t,e)},Qr=(e,t)=>{xt(e,m.Interacted)||($t(e,t),e.setAttribute(m.Interacted,"true"))},Kr=e=>{e.querySelector("iframe")||eo(e)},eo=e=>{const t=()=>{$t(e),t&&e.removeEventListener("click",t)};e.addEventListener("click",t)},to=e=>{const t=I().tenantPrefix();if(Qe(e,t))return;new MutationObserver(()=>Qe(e,t)).observe(e,{attributes:!0})},Qe=(e,t)=>{const n=U(m.TrackExternalWidget,e);return n!=null&&n.tid&&n.tid.startsWith(t)?(Zr(e),!0):!1},no=(e,t)=>{var n;if(e.hasAttribute(ke.DisablePassive)){const r=(n=e.getAttribute(ke.DisablePassive))==null?void 0:n.split(",");return r==null?void 0:r.includes(t)}return!1};var Gt=(e=>(e.conversion="conversion",e))(Gt||{});let me,he=[],Ke;const et=e=>{var t;(t=ro())==null||t.observe(e)};function ro(){return me||(me=new IntersectionObserver((e,t)=>{e.forEach(n=>{const r=n.target;n.isIntersecting&&(t.unobserve(r),oo(r))})},{rootMargin:"0px",threshold:.2}))}function tt(e,t){return e.reduce((n,r)=>{const o=t(r)||"";return n.includes(o)||n.push(o),n},[]).join("|")}function oo(e){he.push(e),clearTimeout(Ke),Ke=setTimeout(()=>{const t=[...he];he=[],t.length>0&&io(t)},300)}function io(e){const t=e.map(Z),n="tidImpression|";(window.ecomtq=window.ecomtq||[]).push({name:f.ProductListView,properties:{listId:n+tt(t,r=>r.listId||r.affiliation),listName:n+tt(t,r=>r.listName||r.affiliation),items:t,referenceText:"tidImpression"}})}const so=()=>{Xr(),Mt(),Fr()},Mt=()=>{h(ao,w.UnableToInit,"conversionElms"),H(m.TrackMiscClick,Wr),H(m.TrackLinkClick,Hr),H(m.TrackImpression,$r),H(m.TrackExternalWidget,e=>{Kr(e),to(e)})};function ao(){H(m.TrackConversion,e=>{const t=e.getAttribute("href");if(!t)return;const n=h(()=>Ee(e,void 0),w.MissingData,"tidValue");!n||n=="NA"||n.length<23||!n.includes("_")?Vt(t,({convertedUrl:r})=>{e.setAttribute("href",r),et(e)}):et(e),jr(e,r=>!no(r,Gt.conversion))})}const co=e=>{R().storeManualPreferences(e.properties)},uo=At("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",12);function jt(){return`${x().getUserState().clientId}_${uo()}`}const lo=e=>{const t=e.properties.url;if(t==""||!t.startsWith("http")&&!t.startsWith("/")){e.cb(t,"");return}h(()=>{const n=jt();e.cb(fo(e.properties.url,n),n)},w.QueueAction,"tid generation",()=>{e.cb(e.properties.url,"")})};function fo(e,t){const n="PARTNER_TID_VALUE",r="Forbes_TID_value",o=Ue(e),i=go(t,o);if(e.includes(n))e=e.replace(n,t);else if(e.includes(r))e=e.replace(r,t);else if(o!=null&&o.TID){const s=new URL(e);o.TID.split(",").forEach(u=>{s.searchParams.set(u,i)}),e=s.toString()}else{const s=Wt(e);s.searchParams.append("tid",i),e=s.toString()}return e=mo(e,o),e=ho(e,o),e=po(e),e=Io(e),e}function Wt(e){const t="https://www.fa.internal";if(e.startsWith("http"))return new URL(e);const r=new URL(e,t);return r.toString=function(){return URL.prototype.toString.apply(this).replace(t,"")},r}function go(e,t){return t!=null&&t.tidUrlPrefix?`${t.tidUrlPrefix}${e}`:e}function mo(e,t){if(["Forbes_page_url","PAGE_URL_VALUE"].forEach(n=>{e.includes(n)&&(e=e.replace(n,encodeURIComponent(window.location.pathname)))}),t!=null&&t.PageUrl){const n=new URL(e);return n.searchParams.set(t.PageUrl,window.location.pathname),n.toString()}return e}function ho(e,t){if(!t||!t.static||t.static.constructor!==Object||Object.keys(t.static).length<1)return e;const n=t.static,r=new URL(e);return Object.keys(n).forEach(function(o){r.searchParams.set(o,n[o])}),r.toString()}function po(e){if(!(I().tenantPrefix()==="FA"))return e;const n=(window==null?void 0:window.__mpResponseHeaders)&&(window==null?void 0:window.__mpResponseHeaders["x-postal-code"]),r=window.location.pathname.includes("/l/")?"paid-search":"organic";if(e.startsWith("http")){const o=new URL(e);o.searchParams.has("channel")&&(o.searchParams.set("channel",r),e=o.toString())}return n?e.replace("ZIP_CODE_VALUE",n):e}const wo={PARTNER_CREATIVE_VALUE:"ecom_creative",PARTNER_ADPLACEMENT_VALUE:"ecom_placement",PARTNER_ADID_VALUE:"ecom_id",PARTNER_ADSETID_VALUE:"ecom_setid",PARTNER_CLICKID_VALUE:"fbclid",PARTNER_UTM_CAMPAIGN_VALUE:"utm_campaign",PARTNER_MATCH_TYPE_VALUE:"match_type"};function Io(e){let t=e;const n=new URLSearchParams(window.location.search),r=Object.entries(wo);try{const o=Wt(t);r.forEach(([i,s])=>{const a=o.searchParams.entries().find(([,d])=>d===i),u=a==null?void 0:a[0];if(u){const d=n.get(s);d?o.searchParams.set(u,d):o.searchParams.delete(u)}}),t=o.toString()}catch{}return r.forEach(([o,i])=>{const s=n.get(i);s&&(t=t.replaceAll(o,encodeURIComponent(s)))}),t}const ko=e=>{e.cb(jt())},_o=(e,t,n)=>{if("STORIES_SIMULATE_AD_BLOCKER"in window){n("storybook simulated ad block");return}if("STORIES"in window&&!("STORIES_BYPASS"in window))return;const r=`https://www.googletagmanager.com/gtag/js?id=${t}&l=dataLayer&cx=c`;if(e.querySelector(`script[src='${r}']`))return;const o=e.createElement("script");o.async=!0,o.src=r;const i=e.querySelector("script");i==null||i.parentNode.insertBefore(o,i),o.addEventListener("error",()=>n("script error")),fetch(r).then(s=>{yo(s)||n("google request overridden")}).catch(()=>{})};function yo(e){return e.type==="cors"}const Ht="pqp",zt="sm",Ne=`/${Ht}/${zt}`;function Co(e){if(!e.includes(Ne))return e;try{const t=new URL(e);return Jt(t)}catch{return e}}function Jt(e){const[t]=e.pathname.split(Ne);return e.pathname=t,e.toString()}function bo(e){if(!e.includes(Ne))return e;const t=new URL(e);return pe(t,"utm_medium",()=>So(e)),pe(t,"utm_source",()=>To(e)),pe(t,"utm_campaign",()=>xo(e)),Jt(t)}function So(e){return Fe(e,0)}function To(e){return Fe(e,1)}function xo(e){return Fe(e,2)}function Fe(e,t){const r=new URL(e).pathname.split("/"),o=r.findIndex(i=>i===Ht);if(o!==-1&&r[o+1]===zt){const i=o+2+t;return r[i]}return null}function pe(e,t,n){if(!e.searchParams.has(t)){const r=n();r&&e.searchParams.append(t,r)}}const vo=()=>{var r;const e=I().consentDefault();Eo(e);const{storeManualPreferences:t,subscribe:n}=R();!((r=I().trustArcConsent())!=null&&r.enabled)&&e&&t({consentObj:e}),n(Ao)},Eo=e=>{e?gtag("consent","default",{analytics_storage:e.analytics_storage,ad_storage:e.ads,ad_user_data:e.ads,ad_personalization:e.ads}):(gtag("consent","default",{analytics_storage:"denied",ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",region:["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","EU","GB"]}),gtag("consent","default",{analytics_storage:"granted",ad_storage:"granted",ad_user_data:"granted",ad_personalization:"granted"}))},Ao=e=>{I().gaIds().forEach(n=>{n&&window.gtag("set",n,{CookiePreferences:R().getConsentValue()})}),gtag("consent","update",{analytics_storage:e.analytics_storage,ad_storage:e.ads,ad_user_data:e.ads,ad_personalization:e.ads})},de=V("gatag",Lo);function Lo(){const{storeGaClientId:e,storeGaSessionId:t}=x(),n={initalizedBy:void 0,loadedListeners:[]},r=()=>{window.dataLayer=window.dataLayer||[],window.gtag=window.gtag??function(){window.dataLayer.push(arguments)},gtag("js",new Date);const a=I();vo();const{path:u}=a.cookies(),d=a.isCrossDomainIframeWidget()?{cookie_flags:"SameSite=None;Secure"}:{cookie_flags:`Path=${u||"/"};SameSite=Lax;Secure`};a.gaIds().forEach(l=>{var g;l&&(gtag("config",l,{pageTitle:((g=window.ecomBase)==null?void 0:g.title)||document.title,page_location:Co(window.location.href),send_page_view:!0,...d,...ce()}),_o(document,l,p=>o(!1,p)))});const c=a.primaryGaId()??"";window.gtag("get",c,"client_id",l=>{o(!0,"ga client_id cb"),typeof l=="string"&&l&&e(l)}),window.gtag("get",c,"session_id",l=>{typeof l=="string"&&l&&t(l)}),window.setTimeout(()=>{n.initalizedBy||o(!1,"timeout")},a.gaLoadingTimeout())},o=(a,u)=>{n.gaLoaded=a,n.initalizedBy=u,n.loadedListeners.forEach(d=>d({gaLoaded:a,reason:u})),n.loadedListeners=[]},i=()=>n.initalizedBy?Promise.resolve({gaLoaded:n.gaLoaded,reason:n.initalizedBy}):new Promise(a=>n.loadedListeners.push(a));function s(a){I().gaIds().forEach(d=>{d&&window.gtag("set",d,{user_id:a})})}return{initalize:r,waitGtagLoaded:i,setLoggedInUserId:s}}const Uo=e=>{const t=e.properties.userId||"";t.length<5||(x().storeLoggedInUserId(t),de().setLoggedInUserId(t))},Po=e=>{var n;const t=e.name;return t===f.ActionGenerateConversionUrl?(lo(e),!0):t===f.ActionGenerateTid?(ko(e),!0):t===f.ActionSetLoggedInUserId?(Uo(e),!0):t===f.ActionUpdateConsent?((n=I().trustArcConsent())!=null&&n.enabled||co(e),!0):!1},P=[],Zt="action:",No=()=>{P.splice(0,P.length),nt("mktptq"),nt("ecomtq")};function we(e){const t=e.name;if(t===f.Hook){Fo(e);return}if(t===f.HookRemove){Do(e);return}if(t.startsWith(Zt)){if(Po(e))return;P.forEach(n=>{n.onAction&&h(()=>{n.onAction(e)},w.QueueAction,"Hook: "+n.name)})}t.startsWith("event:")&&P.forEach(n=>{h(()=>{n.onEvent(e)},w.QueueEvent,"Hook: "+n.name)})}function Fo(e){const{onEvent:t,onInit:n,name:r,onAction:o}=e.properties;P.map(i=>i.onEvent).includes(t)||(h(()=>{n==null||n()},w.UnableToInit,"Hook"),P.push({name:r,onEvent:t,onAction:o}))}function Do(e){const t=P.findIndex(n=>n.name==e.properties.name);t>-1&&P.splice(t,1)}function nt(e){const t=window[e]=window[e]??[];t.push=function(...n){return we(n[0]),n[0].name.indexOf(Zt)===0?this.length:Array.prototype.push.apply(this,n)},t.filter(n=>n.name===f.Hook).forEach(we),t.forEach(we)}const De=e=>({FormStep:e.formStep,FormName:e.formName,FormType:e.formType,FormLocation:e.formLocation,PartnerName:e.partnerName}),Re=e=>{if(typeof e!="object")return{ReferenceText:"ECOM PROPERTIES MISSING"};try{return"items"in e&&Array.isArray(e.items)?Oe(e):Ro(e)}catch(t){return{ReferenceText:t.toString()}}},Oe=e=>({currency:"USD",value:Array.isArray(e.items)?e.items.reduce((t,n)=>t+=n.price||0,0):0,items:Xt(e),...ue(e)}),Ro=e=>({currency:"USD",value:e.price,...ue(e),items:[{...Be(e,e),..."listId"in e?Yt(e):{}}]}),Xt=e=>{if(!Array.isArray(e.items))return[];const t="listId"in e?Yt(e):{};return e.items.map(n=>({...Be(n,e),...t}))},G=e=>({Tid:e.tid,EnquiryId:e.enquiryId,CartId:e.cartId}),Oo=e=>({...G(e),transaction_id:e.transactionId}),ue=e=>"listId"in e?{item_list_id:e.listId,item_list_name:e.listName,location_id:e.listId,AppliedFilters:e.appliedFilters,PageNumber:e.pageNumber,ResultsCount:e.resultsCount}:{},N=e=>({ComponentTitle:e.componentTitle,ComponentType:e.componentType,...e.enquiryId&&{EnquiryId:e.enquiryId},...e.cartId&&{CartId:e.cartId}}),qe=e=>({ReferenceText:!e.itemName&&!e.itemId?e.referenceText+" | MISSING PRODUCT ANNOTATION":e.referenceText}),Be=(e,{tid:t})=>{const n="NO_PRODUCT_INFO";return Object.entries({item_id:e.itemId??n,item_name:e.itemName??n,affiliation:e.affiliation,coupon:e.coupon,index:e.index??0,item_brand:e.itemBrand,item_brand_id:e.itemBrandId,item_category:e.itemCategory,item_category2:e.itemCategory2,item_category3:e.itemCategory3,item_category4:e.itemCategory4,item_category5:e.itemCategory5,price:e.price,quantity:1,secondaryCallout:e.secondaryCallout,starRating:e.starRating,initialCost:e.initialCost,subscriptionCost:e.subscriptionCost,Tid:e.tid??t,ReferenceText:e.referenceText}).reduce((r,[o,i])=>(i!==void 0&&(r[o]=i),r),{})},Yt=e=>({item_list_id:e.listId,item_list_name:e.listName,location_id:e.listId}),Qt=e=>{const t=e.filter(n=>n.piiSanitisedValue!="false").map(n=>({key:n.key,value:n.piiSanitisedValue}));return qo(JSON.stringify(t))},qo=e=>({Payload:e==null?void 0:e.substring(0,490),PayloadExtension1:(e==null?void 0:e.length)>490?e==null?void 0:e.substring(490):""}),Bo=(e,t)=>{window.gtag("event",e,t)},Kt=()=>Math.floor(Math.random()*2147483648+0).toString(),Ve=()=>String(new Date().getTime()),Vo=()=>`${Kt()}.${Ve()}`.slice(0,21),$e=(e,t)=>{const{ssgtmPreview:n}=I(),r=n(),o=new Headers({});return o.append("Content-Type","text/plain"),(r||"").length>10&&o.append("x-gtm-server-preview",r),fetch(e,{method:"POST",keepalive:!0,headers:o,body:t})},$o=async e=>{var s;const{ssgtmUrl:t,version:n,tenantPrefix:r}=I(),o={path:"/g/collect",querystring:`?${rt(e.qs)}`,...e.body?{body:rt(e.body)}:{}},i=(s=t())==null?void 0:s.replace(/\/$/,"");await $e(`${i}/base64?t=${r()}&v=${n()}`,btoa(JSON.stringify(o)))};function rt(e){return Object.entries(e).reduce((t,[n,r])=>(r&&t.push(`${n}=${typeof r=="string"?encodeURIComponent(r):r}`),t),[]).join("&")}function Go(e,t,n){if(n=="ecomt")return Mo(e);const r=jo(e,t);return bo(r)}function Mo(e){const t=new URL(e);return t.searchParams.set("utm_medium","internal"),t.searchParams.set("utm_source","debugging"),t.toString()}function jo(e,t){try{const n=new URL(e);if(n.search||!t)return e;const r=new URL(t);if(r.host==n.host&&r.pathname==n.pathname)return t}catch{}return e}const Wo=(e,t,n)=>{const r={v:"2",tid:t.send_to,dt:document.title,dl:Go(window.location.href,document.referrer,e),en:e,tt:t.traffic_type,cid:t.GAClientId,sid:t.GASessionId,ul:navigator.language.toLowerCase(),sr:`${screen.width}x${screen.height}`,dr:document.referrer,dh:window.location.hostname,uafvl:window.navigator.userAgent,_p:Kt(),_fv:t.isNewUser?1:0,_ss:t.isNewSession?1:0,_nsi:t.isNewSession?1:0,sct:t.sessionCount,gcs:"G101",gcd:"11p1q1p1p5",npa:1,dma:0,tag_exp:0,frm:0,pscdl:"noapi",_s:1,seg:1,_ee:1,tfd:window!=null&&window.performance?Math.round(window.performance.now()):1e3,richsstsse:""},o={...t,send_to:void 0,traffic_type:void 0,items:void 0,sessionCount:void 0,isNewSession:void 0,isNewUser:void 0,GABlocked:n.toString()},i=t.items;if(Array.isArray(i)&&i.length>0){const{en:s,_ee:a}=r,u={en:s,_ee:a,...st(o)};return i.forEach((d,c)=>{const l=[];u["pr"+(c+1)]=Object.entries(d).filter(g=>g[1]!=null).map(([g,p],S)=>{const O=`${S!=0?"~":""}`;if(ot[g])return`${O}${ot[g]}${p}`;l.push(g);const F=l.length-1;return`${O}k${F}${g}~v${F}${p}`}).join("")}),delete r.en,delete r._ee,{qs:r,body:u}}return{qs:{...r,...st(o)}}},ot={item_id:"id",item_name:"nm",item_brand:"br",item_category:"ca",item_category2:"c2",item_category3:"c3",item_category4:"c4",item_category5:"c5",item_variant:"va",price:"pr",quantity:"qt",coupon:"cp",item_list_name:"ln",index:"lp",item_list_id:"li",discount:"ds",affiliation:"af",promotion_id:"pi",promotion_name:"pn",creative_name:"cn",creative_slot:"cs",location_id:"lo"},it={currency:"cu"};function st(e){return Object.entries(e).reduce((t,[n,r])=>{if(!r&&typeof r!="number")return t;const o=n in it?it[n]:`ep${typeof r=="number"?"n":""}.${n}`;return t[o]=r,t},{})}const at=async(e,t,n=!1)=>{if(!I().ssgtmUrl())return;const r={...t};await de().waitGtagLoaded().then(async o=>{if(!n&&o.gaLoaded)return;const i=x(),s=i.getUserState();if(r.GAClientId=r.GAClientId||s.gaClientId,r.GASessionId=r.GASessionId||s.gaSessionId,!r.GAClientId){const a=Vo();i.storeGaClientId(a),r.GAClientId=a,r.isNewUser=!0}if(!r.GASessionId){const a=Ve();i.storeGaSessionId(a),r.GASessionId=a,r.isNewSession=!0,r.isNewUser||i.incrementSessionCount()}r.sessionCount=i.getUserState().sstSessionCount,$o(Wo(e,r,!o.gaLoaded))})},_=(e,t,n=!1)=>{const r=I(),o=x().getUserState(),i={...t,GAClientId:o.gaClientId,GASessionId:o.gaSessionId,...ce()};if(n){at(e,{...i,send_to:"G-XKT6C6KJQZ"},!0);return}r.gaIds().forEach(s=>{const a={...i,send_to:s};Bo(e,a),s&&at(e,a)})},Ho={name:"gtag",onEvent:e=>{switch(e.name){case f.Conversion:tn(e),en(e);break;case f.TidFocus:Qo(e);break;case f.MiscClick:ei(e);break;case f.FormStart:ri(e);break;case f.FormProgression:ni(e);break;case f.FormSubmission:oi(e);break;case f.ProductImpression:ii(e);break;case f.LinkClick:ti(e);break;case f.ProductView:Jo(e);break;case f.ProductListView:zo(e);break;case f.AddToCart:Zo(e);break;case f.BeginCheckout:Xo(e);break;case f.Purchase:Yo(e);break;case f.AccountSignUp:si(e);break;case f.SelectContent:ai(e);break;case f.RequoteSubmission:ci(e);break;case f.ExternalWidgetRender:di(e);break;case f.ExternalWidgetInteraction:Ko(e);break;case f.PageView:ui(e);break}},onInit:()=>{window.dataLayer=window.dataLayer||[],window.gtag=window.gtag??function(){window.dataLayer.push(arguments)}}},zo=({properties:e})=>{_("view_item_list",{...G(e),...ue(e),...Array.isArray(e.items)?{items:Xt(e)}:void 0,..."componentTitle"in e?N(e):void 0,..."referenceText"in e?{ReferenceText:e.referenceText}:void 0})},Jo=({properties:e})=>{_("view_item",{...Oe(e),...G(e)})},en=({properties:e})=>{_("add_to_cart",{...N(e),...qe(e),...G(e),...Re(e)})},Zo=({properties:e})=>{_("add_to_cart",{...G(e),...Re(e)})},Xo=({properties:e})=>{_("begin_checkout",{...Re(e),...G(e)})},Yo=({properties:e})=>{_("purchase",{...Oo(e),...Oe(e)})},tn=({properties:e})=>{const t=I().conversionEventName();_(t,{...N(e),...qe(e),ClickText:e.clickText,ClickUrl:e.clickUrl,ClickPosition:e.index,PartnerName:e.affiliation,Tid:e.tid,coupon:e.coupon,...Y(e)})},Qo=({properties:e})=>{_("Tid Focus",{...N(e),...qe(e),ClickText:e.clickText,ClickUrl:e.clickUrl,ClickPosition:e.index,PartnerName:e.affiliation,Tid:e.tid,coupon:e.coupon,...Y(e)})},L="External Widget",Ko=({properties:e})=>{const t={properties:{...e,clickText:L,clickUrl:"",referenceText:e.referenceText||L,itemBrand:e.partnerName||L,affiliation:e.partnerName||L,itemCategory:L,itemCategory2:"",price:0,listName:L,listId:L,resultsCount:0,tid:e.tid||"MISSING_TID",itemId:L,itemName:L}};tn(t),en(t)},ei=({properties:e})=>{_("Misc Click",{...N(e),ClickText:e.clickText,ClickType:e.clickType,PartnerName:e.affiliation||e.itemBrand,ReferenceText:e.referenceText,...Y(e)})},ti=({properties:e})=>{const t=e.affiliation||e.itemBrand;_("Link Click",{...N(e),ClickText:e.clickText,ClickUrl:e.clickUrl,ClickType:e.clickType||"external",ClickCat:e.clickCat,...t?{PartnerName:t}:"",ReferenceText:e.referenceText,...Y(e)})},ni=({properties:e})=>{_("Form Progression",{...De(e),...Qt(e.payloadData),EnquiryId:e.enquiryId,FormErrorMessage:e.formErrorMessage,FormFieldCausingError:e.formFieldCausingError,FormStatus:e.formStatus,CartId:e.cartId,Tid:e.tid})};function ri({properties:e}){_("Form Progression",{...De({...e,formStep:"start"}),EnquiryId:e.enquiryId,Tid:e.tid,CartId:e.cartId})}const oi=({properties:e})=>{_("Form Submission",{...De(e),...Qt(e.payloadData),EnquiryId:e.enquiryId,FormErrorMessage:e.formErrorMessage,FormFieldCausingError:e.formFieldCausingError,FormStatus:e.formStatus,CartId:e.cartId,Tid:e.tid})},ii=({properties:e})=>{_("Product Impression",{...Be(e,{}),...ue(e),...N(e)})},si=({properties:e})=>{_("sign_up",{Tid:e.tid,EnquiryId:e.enquiryId,PartnerName:e.partnerName})},ai=({properties:e})=>{_("select_content",{content_type:e.contentType,content_id:e.contentId})},ci=({properties:e})=>{_("Requote Submission",{Tid:e.tid,EnquiryId:e.enquiryId})},di=({properties:e})=>{_("External Widget Render",{PartnerName:e.partnerName,ReferenceText:e.referenceText,Tid:e.tid,...N(e),...Y(e)})};function Y(e){return{...e.subId1?{SubId1:e.subId1}:{},...e.subId2?{SubId2:e.subId2}:{},...e.subId3?{SubId3:e.subId3}:{},...e.subId4?{SubId4:e.subId4}:{}}}const ui=e=>{_("page_view",{ReferenceText:e.properties.referenceText})},li=()=>{h(()=>{Pe().initalize()},w.UnableToInit,"adNetworksStore"),h(()=>{de().initalize()},w.UnableToInit,"gtagStore")},fi=async()=>{const{getUserState:e,storeSessionId:t}=x(),{sessionId:n}=e();t(n??Ve())},gi={name:"sst",onEvent:e=>{const{sstEndpoint:t,trafficSource:n}=I(),r=t();if(!(!r||n()!="internal"))switch(e.name){case f.Conversion:mi(e,r);break}}};async function mi({properties:e},t){const r={...await pi(),clickUrl:encodeURIComponent(e.clickUrl),otherParams:"",tid:e.tid,event:"ConversionMP",eventTime:new Date().getTime(),partnerName:e.affiliation};await hi(r,t)}const hi=async(e,t)=>{try{(await fetch(t,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"},keepalive:!0})).ok}catch{}},pi=async()=>{var t;const e=x().getUserState();return{pageLocation:encodeURIComponent(window.location.href),pageReferrer:encodeURIComponent(document.referrer),pageTitle:((t=window.ecomBase)==null?void 0:t.title)??document.title,screenResolution:`${window.screen.width}x${window.screen.height}`,MarketplaceClientId:e.clientId??"",MarketplaceSessionId:e.sessionId??"",userId:e.userId??"",gaClientId:e.gaClientId??"",gaSessionId:e.gaSessionId??"",trafficSource:I().trafficSource}},wi={name:"adnetworks",onEvent:e=>{if(e.name!=f.Conversion&&e.name!=f.ExternalWidgetInteraction||!e.properties.tid)return;const t=I(),n=t.ssgtmUrl(),r=t.tenantPrefix();if(!n||r!="FA")return;const i=Pe().getState(),s=[];if(Object.entries(i).forEach(([l,{values:g,cookies:p}])=>{const S=g[g.length-1];S&&s.push({...S,name:l,cookies:p})}),s.length==0)return;const a=s.find(l=>l.name=="taboola"),u=s.find(l=>l.name=="facebook"),d=s.reduce((l,g)=>(l[g.name]=g,l),{}),c={path:"/mktpt-adnetworks",jsonBody:{mktptNetworks:s.map(l=>l.name).join("|"),mktptNetworkValues:d,documentLocation:window.location.href,documentReferrer:document.referrer,...a?{taboolaClickId:a.clickoutId}:{},...u?{_fbp:u.cookies._fbp,_fbc:u.cookies._fbc,facebookClickId:u.clickoutId,facebookLandingUrl:u.landingUrl}:{},...Ii(e.name,e.properties),...ce()}};$e(`${n}/base64?t=${r}&v=${t.version()}`,Ft(JSON.stringify(c)))}};function Ii(e,t){return t.affiliation=t.affiliation??t.partnerName,e==f.ExternalWidgetInteraction&&(t.clickText=t.clickText??"ExternalWidgetInteraction"),t}const ct="consent",nn="track",dt="SubmitApplication",ut="AddToCart",Ie="Purchase",ki="ViewContent",lt="Lead",ft="landing_clickout",A={name:"fb",queue:[],loaded:void 0,hadFormStart:!1,init:!1,onAction:e=>{e.name!=f.ActionSetFacebookPixelId||A.init||(A.init=!0,yi())},onInit(){ne(nn,"PageView",{}),R().subscribe(t=>{t.ads==="granted"?ne(ct,"grant",{}):ne(ct,"revoke",{})})},onEvent:e=>{switch(e.name){case f.Conversion:{const t=Object.entries({product_affiliation:e.properties.affiliation,product_brand:e.properties.itemBrand,product_category:e.properties.itemCategory,product_id:e.properties.itemId,product_name:e.properties.itemName,product_category2:e.properties.itemCategory2,component_title:e.properties.componentTitle,reference_text:e.properties.referenceText,tid:e.properties.tid}).filter(([,n])=>n).reduce((n,[r,o])=>(n[r]=o,n),{});A.hadFormStart?(E(lt,t,e),E(Ie,t,e)):gt(ft,t,e);break}case f.FormStart:A.hadFormStart=!0,E(ki,{},e);break;case f.FormSubmission:{const{formStatus:t,nextStep:n,formName:r}=e.properties;n==="journey-start"?gt(ft,{reference_text:r},e):t==="Success"&&n==="journey-end"?(E(dt,{},e),E(ut,{},e),E(lt,{},e),E(Ie,{},e)):(t==="Fail"||n==="journey-results")&&(E(dt,{},e),E(ut,{},e));break}case f.Purchase:E(Ie,{tid:e.properties.tid,enquiryId:e.properties.enquiryId},e);break}}};function E(e,t,n){rn(nn,e,t,n)}function gt(e,t,n){rn("trackCustom",e,t,n)}function rn(e,t,n,r){ne(e,t,_i(n,r))}function ne(e,t,n){window.fbq&&A.loaded?window.fbq(e,t,n):A.queue.push([e,t,n])}function _i(e,{properties:t}){const n=t.tid;return n&&(e.eventID=n,e.tid=n),e}function yi(){if(window.fbq){mt();return}const e=setInterval(()=>{window.fbq&&(clearInterval(e),mt())},500);setTimeout(()=>{clearInterval(e)},6e4)}function mt(){A.loaded=!0,A.queue.forEach(e=>{window.fbq(e[0],e[1],e[2])}),A.queue=[]}const Ci=()=>{var e;window.ecomBase=window.mktpBase||window.ecomBase,window.mktptq=window.mktptq||[],window.ecomtq=window.ecomtq||[],[Ho,gi,wi,A].forEach(Dr),li(),h(fi,w.UnableToInit,"session"),h(No,w.UnableToInit,"queue"),h(bi,w.UnableToInit,"gaBlocked"),(e=I().trustArcConsent())!=null&&e.enabled&&h(yr,w.UnableToInit,"trustArcConsent")},bi=async()=>{await de().waitGtagLoaded().then(async e=>{e.gaLoaded||v({name:f.PageView,properties:{referenceText:e.reason}})})},ht="data-ecom-fallback-scanned";let pt=!1;const Si=()=>{pt||(pt=!0,document.addEventListener("click",e=>{var o;if(e.ecomTrackingHandled)return;const t=vi(e.target);if(!t||!(t!=null&&t.hasAttribute("href"))||!((o=Ue(t.getAttribute("href")))!=null&&o.provider))return;const n=Ee(t,void 0);(!n||n=="NA"||n.length<23||!n.includes("_"))&&Vt(t.getAttribute("href"),({convertedUrl:i})=>{t.setAttribute("href",i)});const r=Z(t);r.referenceText="ecom global fallback",v({name:f.Conversion,properties:r})},{passive:!0}))},on=()=>{const e=[m.TrackConversion,J(m.TrackConversion)].map(n=>`:not([${n}])`);document.querySelectorAll(`a:not([${ht}])${e.join("")}`).forEach(n=>{var i;const r=n.getAttribute("href");if(n.setAttribute(ht,""),!r)return;const o=n.firstElementChild;(i=Ue(r))!=null&&i.provider&&(n.removeAttribute(m.TrackLinkClick),n.removeAttribute(J(m.TrackConversion)),Ti(n,m.TrackConversion,{referenceText:"missing annotation",clickText:(o==null?void 0:o.tagName)=="IMG"?o.getAttribute("alt")||o.getAttribute("src"):void 0}))})},Ti=(e,t,n)=>e.setAttribute(t,JSON.stringify(n)),xi=()=>{let e;function t(){e&&clearTimeout(e),e=setTimeout(()=>{on(),e=null},500)}const n=document.querySelector("body"),r={childList:!0,subtree:!0},o=function(s){for(const a of s)a.type==="childList"&&a.addedNodes.length>0&&t()};new MutationObserver(o).observe(n,r)};function vi(e){let t=e,n=0;for(;t&&t.tagName!="A"&&n<100;)n++,t=t.parentElement;return t}const Ei=[],Ai=()=>{Ci(),Ui(),h(Si,w.UnableToInit,"globalfallback"),window.mktp={getDataForClickEvent:e=>vn(e)},Nr.init()},Li=()=>{const e=w.UnableToInit;h(on,e,"fallback"),h(xi,e,"mutationfallback"),h(so,e,"event listeners")};function Ui(){Ei.includes(window.location.pathname)&&h(()=>{const e=window.fetch;window.fetch=async function(...t){var o,i;const n=t[0];if(typeof n!="string"||!n.includes("google-analytics"))return e.apply(this,t);const r=n+"&ep.GABlocked=true";try{const s=await e.apply(this,t);return s.status!=204&&await wt(r,(o=t[1])==null?void 0:o.body),s}catch(s){throw await wt(r,(i=t[1])==null?void 0:i.body),s}}},w.UnableToInit,"fetchoverride")}async function wt(e,t){var a;const{ssgtmUrl:n,version:r,tenantPrefix:o}=I(),i={path:"/g/collect",querystring:e.substring(e.indexOf("?")),...t?{body:t}:{}},s=(a=n())==null?void 0:a.replace(/\/$/,"");return await $e(`${s}/base64?t=${o()}&v=${r()}`,btoa(JSON.stringify(i))).catch(()=>{})}let It=!1;const Pi=window.setTimeout(()=>{Se(),Te("LibraryLoaded|DomTimeout")},10*1e3);h(Ai,w.UnableToInit,"onLoad");document.readyState=="interactive"?Se():document.addEventListener("DOMContentLoaded",()=>{Se()});function Se(){It||(It=!0,clearTimeout(Pi),h(Li,w.UnableToInit,"onDomContentLoaded"),Ge()>1&&Te(`LibraryLoaded|Errors:${Ge()}`),(window.dataLayer=window.dataLayer||[]).push({event:"ecomt",ReferenceText:"GTM|LibraryLoaded"}))} })();