PageSourceSearch

https://www.allbirds.com/cdn/shop/t/4159/assets/theme2.js

js allbirds.com collected 2026-10-02 02:15:59 UTC 115,834 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.js","./ScrollTrigger.js","./iterable.js","./analytics-data.js","./wunderkind-api.js","./validator.js","./cookies.js","./_commonjsHelpers.js","./use-amplitude-experiment.js","./vue.esm-bundler.js","./use-product-section-visibility.js","./use-recently-viewed.js","./observers.js"])))=>i.map(i=>d[i]);
2import{i as k,S as Ke,e as te,w as ye,g as En,a as Lr}from"./ScrollTrigger.js";import"./iterable.js";import{t as wn,a as In,b as Cn,c as Rn,d as An,e as Pn,f as _n}from"./analytics-data.js";import{i as Tn,m as kr,a as kt,p as Ln,c as kn,b as Dn,g as Vt,F as Wt,T as Mn,d as On,e as zt,Q as ae,r as Un,f as xn,s as Nn,h as Fn,j as Bn,k as Kn,l as he,n as jt,o as qn,u as Dr,q as Gn,t as Vn,v as Ht,w as Mr,x as Or,y as Se,z as Wn,A as zn,B as $t,C as jn,M as De}from"./wunderkind-api.js";import{r as Le,C as ke,o as Hn,A as $n,u as Ur,a as Me,F as Oe,i as Yn}from"./use-amplitude-experiment.js";import{i as xr}from"./validator.js";import{r as rt,w as Qn}from"./vue.esm-bundler.js";import{u as Xn}from"./use-product-section-visibility.js";import{u as Zn}from"./use-recently-viewed.js";import"./cookies.js";import"./_commonjsHelpers.js";const Jn=()=>{if(!window.ALLBIRDS.Rudderstack.isIdentifyAndPageCalled&&window.ALLBIRDS.OneTrust.hasPerformanceConsent()){k("[Allbirds pixel] - RudderStack Page Load - sending analytics events");const t=kr();if(kt({additionalTraits:{fbclid:t.fbclid,gclid:t.gclid,msclkid:t.msclkid},forceIdentify:!0}),Ln("","",{client_platform:"liquid",template:window.ALLBIRDS?.page?.template||"",template_full_name:window.ALLBIRDS?.page?.templateFullName||""}),window.ALLBIRDS?.page?.template==Ke.COLLECTION)wn(),kn()&&In(),Dn()&&Cn({collection:window.ALLBIRDS?.page?.collectionPage?.collection,featureLinkDestination:window.location.href,featureName:Vt(Wt.SORT_BY)?.toUpperCase(),featureType:Mn.SORTING.KEY});else if(window.ALLBIRDS?.page?.template==Ke.PRODUCT)Rn();else if(window.ALLBIRDS?.page?.template==Ke.SEARCH){const e=Vt(Wt.QUERY)||"",r=On(document.querySelector("[data-search-results]")?.dataset?.searchResultsCount)||0;An({searchEntry:zt.SEARCH_PAGE,searchSource:window.location.href}),e&&Pn({query:e,searchEntry:zt.SEARCH_PAGE,searchResultsCount:r,searchSource:window.location.href})}window.ALLBIRDS.Rudderstack.isIdentifyAndPageCalled=!0}},ei=()=>{document.addEventListener("DOMContentLoaded",()=>{k("[Allbirds pixel] - RudderStack Page Load - page load event"),window.ALLBIRDS.Rudderstack.isIdentifyAndPageCalled=!1,Tn(),Le(()=>{k("[Allbirds pixel] - RudderStack Page Load - rudderstack ready event",{isIdentifyAndPageCalled:window.ALLBIRDS.Rudderstack.isIdentifyAndPageCalled}),Jn()},ke.RUDDERSTACK_PAGE_LOAD)})},Yt=()=>window.location.search.includes(ae.EVENT_NAME_PARAM),ti=(t,e)=>{window.ALLBIRDS.OneTrust.hasPerformanceConsent()&&(k("[Allbirds pixel] - RudderStack Query String API - sending analytics event",{eventName:t,eventProps:e}),window.rudderanalytics.track(t,e))},ri=t=>{let e=t;if(xr(e)||e?.replaceAll===void 0)return ye("[Allbirds pixel] - RudderStack Query String API - _sanitizeEventProps - stringValueToSanitize is nil or not a string",{stringValueToSanitize:t},new Error("stringValueToSanitize is nil")),e;try{e=e.replaceAll("+"," ")}catch(r){te("[Allbirds pixel] - RudderStack Query String API - _sanitizeEventProps - error sanitizing event props",{stringValueToSanitize:t},r)}return e},ni=()=>{document.addEventListener("DOMContentLoaded",()=>{Le(()=>{if(k("[Allbirds pixel] - RudderStack Query String API - rudderstack ready event",{queryStringApi:Yt()}),Yt())try{const t={},r=new URL(window.location.href).searchParams,n=ri(r.get(ae.EVENT_NAME_PARAM));for(const[o,s]of r.entries())if(o.startsWith(ae.EVENT_PROP_PREFIX_PARAM)){const a=o.substring(ae.EVENT_PROP_PREFIX_PARAM.length);let l=s;if(s.startsWith(ae.PROP_TYPE_OBJECT_PREFIX)){const c=s.replace(ae.PROP_TYPE_OBJECT_PREFIX,"");l=JSON.parse(c)}a&&(t[a]=l)}if(xr(n)||n===""){te("[Allbirds pixel] - RudderStack Query String API - executeQueryStringApi - eventName is required",{currentUrl:window.location.href,eventName:n},new Error("RudderStack Query String API - eventName is required"));return}ti(n,t);const i=[ae.EVENT_NAME_PARAM,...Object.keys(t).map(o=>`${ae.EVENT_PROP_PREFIX_PARAM}${o}`)];Un(i)}catch(t){te("[Allbirds pixel] - RudderStack Query String API - executeQueryStringApi - error parsing",{currentUrl:window.location.href},t)}},ke.RUDDERSTACK_QUERY_STRING_API)})},me=window.ALLBIRDS.environment.types,Qt={[`${me.PRODUCTION}-UK`]:window.ALLBIRDS.settings.rudderstack.appKeyUkProd,[`${me.PRODUCTION}-US`]:window.ALLBIRDS.settings.rudderstack.appKeyUsProd,[`${me.STAGING}-UK`]:window.ALLBIRDS.settings.rudderstack.appKeyUkStaging,[`${me.STAGING}-US`]:window.ALLBIRDS.settings.rudderstack.appKeyUsStaging,[me.DEVELOPMENT]:window.ALLBIRDS.settings.rudderstack.appKeyDevelopment},{env:Dt,shopId:Mt}=window.ALLBIRDS.environment,ii=window.ALLBIRDS.environment.isUsStore,Xt=Qt[`${Dt}-${Mt}`]||Qt[me.DEVELOPMENT],Ot=ii?"allbirds.com":"allbirds.co.uk",oi=`https://apisdk.${Ot}`,si=`https://dataplane.${Ot}`,ai="oneTrust",Zt=`https://jssdk.${Ot}/v3`,li=window.ALLBIRDS.settings.rudderstack.facebookCAPIEnabled;let Jt=!1;const ui=(t,e,r)=>{let o=1;const s=setInterval(function(){window.rudderanalytics&&window.rudderanalytics.load?(window.rudderanalytics.load(t,e,r),clearInterval(s),k(`[Allbirds pixel] - Rudderstack SDK - calling sdk.load() function - after ${o} attempts`,{appKeyPrefix:t?.slice(0,8),dataPlaneUrl:e,environment:Dt,shopifyStore:Mt})):(o>60&&(clearInterval(s),te(`[Allbirds pixel] - Rudderstack SDK - could not be loaded - after ${o} attempts`,{},new Error("Rudderstack SDK could not be loaded"))),o++)},1e3)},ci=()=>{const t=()=>{window.ALLBIRDS.Rudderstack.notifyConsentChange(window.ALLBIRDS.OneTrust.hasPerformanceConsent())};window.ALLBIRDS.Rudderstack&&window.ALLBIRDS.OneTrust?window.ALLBIRDS.OneTrust.isOneTrustActiveGroupsReady()?t():window.ALLBIRDS.OneTrust.onConsentChange(()=>{t()}):te("[Allbirds pixel] - Rudderstack SDK - could not notify consent change, OneTrust and Rudderstack SDKs are not loaded",{windowAllbirdsOneTrust:window.ALLBIRDS.OneTrust,windowAllbirdsRudderstack:window.ALLBIRDS.Rudderstack},new Error("OneTrust and Rudderstack SDKs are not loaded"))},di=()=>
2{if(!Jt){const t={configUrl:oi,consentManagement:{enabled:!0,provider:ai},destSDKBaseURL:`${Zt}/${window.rudderAnalyticsBuildType}/js-integrations`,...li&&{integrations:{"Facebook Conversions":{hashed:!1}}},loadIntegration:!1,logLevel:window.ALLBIRDS.settings.rudderstack.logLevel||"DEBUG",onLoaded:()=>{ci(),k("[Allbirds pixel] - Rudderstack SDK - load event")},pluginsSDKBaseURL:`${Zt}/${window.rudderAnalyticsBuildType}/plugins`,preConsent:{enabled:!0,events:{delivery:"buffer"},storage:{strategy:"session"}},storage:{encryption:{version:"legacy"}}};Xt||ye("[Allbirds pixel] - Rudderstack SDK - App key is not set!",{environment:Dt,shopifyStore:Mt}),ui(Xt,si,t),Jt=!0}},fi=()=>window.ALLBIRDS?.settings?.rudderstack?.enabled===!0;fi()&&(di(),ei(),ni(),Hn());var vt=function(t,e){return vt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},vt(t,e)};function Qe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");vt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var D=function(){return D=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},D.apply(this,arguments)};function I(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})}function w(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=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 r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function H(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function z(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function ee(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}var er;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(er||(er={}));var gt;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(gt||(gt={}));var Nr="$default_instance",Fr="https://api2.amplitude.com/2/httpapi",vi="https://api.eu.amplitude.com/2/httpapi",gi="https://api2.amplitude.com/batch",hi="https://api.eu.amplitude.com/batch",W;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(W||(W={}));var q=function(){var t="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[t]<"u")return globalThis[t];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},pi=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Br)},tr=ee([],z(Array(256).keys()),!1).map(function(t){return t.toString(16).padStart(2,"0")}),Br=function(t){var e,r=q();if(!(!((e=r?.crypto)===null||e===void 0)&&e.getRandomValues))return pi(t);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=n[6]&15|64,n[8]=n[8]&63|128,ee([],z(n.entries()),!1).map(function(i){var o=z(i,2),s=o[0],a=o[1];return[4,6,8,10].includes(s)?"-".concat(tr[a]):tr[a]}).join("")},rr=function(t){return{promise:t||Promise.resolve()}},Y;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(Y||(Y={}));var Ue="Amplitude Logger ",We=(function(){function t(){this.logLevel=Y.None}return t.prototype.disable=function(){this.logLevel=Y.None},t.prototype.enable=function(e){e===void 0&&(e=Y.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Verbose||console.log("".concat(Ue,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Warn||console.warn("".concat(Ue,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Error||console.error("".concat(Ue,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Debug||console.log("".concat(Ue,"[Debug]: ").concat(e.join(" ")))},t})(),qe=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Nr,logLevel:Y.Warn,loggerProvider:new We,offline:!1,optOut:!1,serverUrl:Fr,serverZone:"US",useBatch:!1}},mi=(function(){function t(e){var r,n,i,o;this._optOut=!1;var s=qe();this.apiKey=e.apiKey,this.flushIntervalMillis=(r=e.flushIntervalMillis)!==null&&r!==void 0?r:s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.instanceName=e.instanceName||s.instanceName,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=e.offline!==void 0?e.offline:s.offline,this.optOut=(i=e.optOut)!==null&&i!==void 0?i:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(o=e.useBatch)!==null&&o!==void 0?o:s.useBatch,this.loggerProvider.enable(this.logLevel);var a=Si(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
2,enumerable:!1,configurable:!0}),t})(),yi=function(t,e){return t==="EU"?e?hi:vi:e?gi:Fr},Si=function(t,e,r){if(t===void 0&&(t=""),e===void 0&&(e=qe().serverZone),r===void 0&&(r=qe().useBatch),t)return{serverUrl:t,serverZone:void 0};var n=["US","EU"].includes(e)?e:qe().serverZone;return{serverZone:n,serverUrl:yi(n,r)}};function bi(t){return t>=200&&t<300}var Ei=function(t){var e=new Error().stack||"";return e.split(`
3`).slice(2+t).map(function(r){return r.trim()})},ce=function(t,e,r,n,i){return i===void 0&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=r(),l=a.logger,c=a.logLevel;if(c&&c<Y.Debug||!c||!l)return t.apply(i,o);var u={type:"invoke public method",name:e,args:o,stacktrace:Ei(1),time:{start:new Date().toISOString()},states:{}},f=t.apply(i,o);return f&&f.promise?f.promise.then(function(){u.time&&(u.time.end=new Date().toISOString()),l.debug(JSON.stringify(u,null,2))}):(u.time&&(u.time.end=new Date().toISOString()),l.debug(JSON.stringify(u,null,2))),f}},wi=function(t){return t===void 0&&(t=Nr),$n.getInstance(t)},nr=function(t){var e=0;if(t.length===0)return e;for(var r=0;r<t.length;r++){var n=t.charCodeAt(r);e=(e<<5)-e+n,e|=0}return e},Kr=(function(){function t(){}return t.prototype.send=function(e,r,n){return Promise.resolve(null)},t.prototype.buildResponse=function(e){var r,n,i,o,s,a,l,c,u,f,d,p,v,g,m,y,h,S,b,C,R,A;if(typeof e!="object")return null;var E=e.code||0,_=this.buildStatus(E);switch(_){case W.Success:return{status:_,statusCode:E,body:{eventsIngested:(r=e.events_ingested)!==null&&r!==void 0?r:0,payloadSizeBytes:(n=e.payload_size_bytes)!==null&&n!==void 0?n:0,serverUploadTime:(i=e.server_upload_time)!==null&&i!==void 0?i:0}};case W.Invalid:return{status:_,statusCode:E,body:{error:(o=e.error)!==null&&o!==void 0?o:"",missingField:(s=e.missing_field)!==null&&s!==void 0?s:"",eventsWithInvalidFields:(a=e.events_with_invalid_fields)!==null&&a!==void 0?a:{},eventsWithMissingFields:(l=e.events_with_missing_fields)!==null&&l!==void 0?l:{},eventsWithInvalidIdLengths:(c=e.events_with_invalid_id_lengths)!==null&&c!==void 0?c:{},epsThreshold:(u=e.eps_threshold)!==null&&u!==void 0?u:0,exceededDailyQuotaDevices:(f=e.exceeded_daily_quota_devices)!==null&&f!==void 0?f:{},silencedDevices:(d=e.silenced_devices)!==null&&d!==void 0?d:[],silencedEvents:(p=e.silenced_events)!==null&&p!==void 0?p:[],throttledDevices:(v=e.throttled_devices)!==null&&v!==void 0?v:{},throttledEvents:(g=e.throttled_events)!==null&&g!==void 0?g:[]}};case W.PayloadTooLarge:return{status:_,statusCode:E,body:{error:(m=e.error)!==null&&m!==void 0?m:""}};case W.RateLimit:return{status:_,statusCode:E,body:{error:(y=e.error)!==null&&y!==void 0?y:"",epsThreshold:(h=e.eps_threshold)!==null&&h!==void 0?h:0,throttledDevices:(S=e.throttled_devices)!==null&&S!==void 0?S:{},throttledUsers:(b=e.throttled_users)!==null&&b!==void 0?b:{},exceededDailyQuotaDevices:(C=e.exceeded_daily_quota_devices)!==null&&C!==void 0?C:{},exceededDailyQuotaUsers:(R=e.exceeded_daily_quota_users)!==null&&R!==void 0?R:{},throttledEvents:(A=e.throttled_events)!==null&&A!==void 0?A:[]}};case W.Timeout:default:return{status:_,statusCode:E}}},t.prototype.buildStatus=function(e){return bi(e)?W.Success:e===429?W.RateLimit:e===413?W.PayloadTooLarge:e===408?W.Timeout:e>=400&&e<500?W.Invalid:e>=500?W.Failed:W.Unknown},t})(),Ii=(function(t){Qe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.customHeaders=r,n}return e.prototype.send=function(r,n){return I(this,void 0,void 0,function(){var i,o,s;return w(this,function(a){switch(a.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:D({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(n),method:"POST"},[4,fetch(r,i)];case 1:return o=a.sent(),[4,o.text()];case 2:s=a.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},e})(Kr),Ci=(function(){function t(e,r){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=r}return t.prototype.fetchConfig=function(){var e=null,r={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(i){return this.logger.debug("Remote config localstorage failed to access: ",i),Promise.resolve(r)}if(e===null)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(r);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(i){return this.logger.debug("Remote config localstorage failed to parse: ",i),localStorage.removeItem(this.key),Promise.resolve(r)}},t.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(r){this.logger.debug("Remote config localstorage failed to set: ",r)}return Promise.resolve(!1)},t})(),Ri="https://sr-client-cfg.amplitude.com/config",Ai="https://sr-client-cfg.eu.amplitude.com/config",Pi=3,nt={INVALID_API_KEY:401,FORB
3IDDEN:403,RATE_LIMIT:429},_i=1e3,Ti=300*1e3,Li=(function(){function t(e,r,n,i){n===void 0&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=i||(n==="US"?Ri:Ai),this.logger=r,this.storage=new Ci(e,r)}return t.prototype.subscribe=function(e,r,n){var i=Br(),o={id:i,key:e,deliveryMode:r,callback:n};return this.callbackInfos.push(o),r==="all"?this.subscribeAll(o):this.subscribeWaitForRemote(o,r.timeout),i},t.prototype.unsubscribe=function(e){var r=this.callbackInfos.findIndex(function(n){return n.id===e});return r===-1?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(r,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},t.prototype.updateConfigs=function(){return I(this,void 0,void 0,function(){var e,r,n=this;return w(this,function(i){switch(i.label){case 0:return this.lastSuccessfulFetch&&(e=Date.now()-this.lastSuccessfulFetch,e<Ti)?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return r=i.sent(),this.storage.setConfig(r),this.callbackInfos.forEach(function(o){n.sendCallback(o,r,"remote")}),[2]}})})},t.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(r){return r.remoteConfig!==null&&(e.lastSuccessfulFetch=Date.now()),r}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},t.prototype.subscribeAll=function(e){return I(this,void 0,void 0,function(){var r,n,i,o=this;return w(this,function(s){switch(s.label){case 0:return r=this.getOrCreateFetchPromise().then(function(a){o.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(a))),o.sendCallback(e,a,"remote"),o.storage.setConfig(a)}),n=this.storage.fetchConfig().then(function(a){return a}),[4,Promise.race([r,n])];case 1:return i=s.sent(),i!==void 0&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(i))),i.remoteConfig!==null?this.sendCallback(e,i,"cache"):this.logger.debug("Remote config client skips sending c
3allback because cache is empty (first time user).")),[4,r];case 2:return s.sent(),[2]}})})},t.prototype.subscribeWaitForRemote=function(e,r){return I(this,void 0,void 0,function(){var n,i,i;return w(this,function(o){switch(o.label){case 0:n=new Promise(function(s,a){setTimeout(function(){a("Timeout exceeded")},r)}),o.label=1;case 1:return o.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return i=o.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,i,"remote"),this.storage.setConfig(i),[3,5];case 3:return o.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return i=o.sent(),i.remoteConfig!==null?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,i,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,i,"remote")),[3,5];case 5:return[2]}})})},t.prototype.sendCallback=function(e,r,n){e.lastCallback=new Date;var i;e.key?i=e.key.split(".").reduce(function(o,s){return o===null?o:s in o?o[s]:null},r.remoteConfig):i=r.remoteConfig,e.callback(i,n,r.lastFetch)},t.prototype.fetch=function(e,r){return e===void 0&&(e=Pi),r===void 0&&(r=_i),I(this,void 0,void 0,function(){var n,i,o,s,a,l,c=this;return w(this,function(u){switch(u.label){case 0:n=r/e,i={remoteConfig:null,lastFetch:new Date},o=function(f){var d,p,v,g,m,y,h;return w(this,function(S){switch(S.label){case 0:d=!0,p=new AbortController,v=setTimeout(function(){return p.abort()},r),S.label=1;case 1:return S.trys.push([1,7,8,9]),[4,fetch(s.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:p.signal})];case 2:return g=S.sent(),g.ok?[3,4]:[4,g.text()];case 3:return m=S.sent(),s.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(g.status,": ").concat(m)),g.status===nt.INVALID_API_KEY||g.status===nt.FORBIDDEN?(s.logger.error("Remote config client fetch failed with ".concat(g.status,". Invalid API key; future fetches will be skipped.")),s.isLastFetchInvalidApiKey=!0,d=!1):g.status>=400&&g.status<500&&g.status!==nt.RATE_LIMIT&&(d=!1),[3,6];case 4:return[4,g.json()];case 5:return y=S.sent(),[2,{value:{remoteConfig:y,lastFetch:new Date}}];case 6:return[3,9];case 7:return h=S.sent(),h instanceof Error&&h.name==="AbortError"?s.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(r,"ms")):s.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),h),[3,9];case 8:return clearTimeout(v),[7];case 9:return d?f<e-1?[4,new Promise(function(b){return setTimeout(b,c.getJitterDelay(n))})]:[3,11]:[2,"break"];case 10:S.sent(),S.label=11;case 11:return[2]}})},s=this,a=0,u.label=1;case 1:return a<e?[5,o(a)]:[3,4];case 2:if(l=u.sent(),typeof l=="object")return[2,l.value];if(l==="break")return[3,4];u.label=3;case 3:return a++,[3,1];case 4:return[2,i]}})})},t.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},t.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",t.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(e,"?").concat(r.toString())},t.CONFIG_GROUP="browser",t})(),Pe;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(Pe||(Pe={}));var ht="https://app.amplitude.com",ki="https://app.eu.amplitude.com",Di="https://apps.stag2.amplitude.com",Mi={US:ht,EU:ki,STAGING:Di},Oi="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.3.js.gz",Ui=function(t){var e=document.querySelector('script[src="'.concat(CSS.escape(t),'"]'));return e?Promise.resolve({status:!0}):new Promise(function(r,n){var i;try{var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=t,o.addEventListener("load",function(){r({status:!0})},{once:!0}),o.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(t)})}),(i=document.head)===null||i===void 0||i.appendChild(o)}catch(s){n(s)}})};function xi(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var qr,pt="__AMPLITUDE_MESSENGER_INSTANCE__",ze="__AMPLITUDE_MESSENGER__",Ni=(function(){function t(e){var r=e===void 0?{}:e,n=r.origin,i=n===void 0?ht:n;this[qr]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=i}return t.prototype.notify=function(e){var r,n,i,o;(n=(r=this.logger)===null||r===void 0?void 0:r.debug)===null||n===void 0||n.call(r,"Message sent: ",JSON.stringify(e)),(o=(i=window.opener)===null||i===void 0?void 0:i.postMessage)===null||o===void 0||o.call(i,e,this.endpoint)},t.prototype.sendRequest=function(e,r,n){var i=this;n===void 0&&(n={timeout:15e3});var o=xi(),s={id:o,action:e,args:r},a=new Promise(function(l,c){i.requestCallbacks[o]={resolve:l,reject:c},i.notify(s),n.timeout>0&&setTimeout(function(){c(new Error("".concat(e," timed out (id: ").concat(o,")"))),delete i.requestCallbacks[o]},n.timeout)});return a},t.prototype.handleResponse=function(e){var r;if(!this.requestCallbacks[e.id]){(r=this.logger)===null||r===void 0||r.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},t.prototype.registerActionHandler=function(e,r){var n,i,o,s;this.actionHandlers.has(e)&&((s=(o=this.logger)===null||o===void 0?void 0:o.warn)===null||s===void 0||s.call(o,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,r);var a=this.pendingMessages.get(e);if(a){this.pendingMessages.delete(e);try{for(var l=H(a),c=l.next();!c.done;c=l.next()){var u=c.value;r(u)}}catch(f){n={error:f}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}},t.prototype.loadScriptOnce=function(e){return I(this,void 0,void 0,function(){var r,n,i;return w(this,function(o){switch(o.label){case 0:if(r=this.scriptLoadPromises.get(e),r)return[2,r];n=Ui(e).then(function(){}),this.scriptLoadPromises.set(e,n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n];case 2:return o.sent(),[3,4];case 3:throw i=o.sent(),this.scriptLoadPromises.delete(e),i;case 4:return[2]}})})},t.prototype.setup=function(e){var r=this,n,i,o=e===void 0?{}:e,s=o.logger,a=o.endpoint;s&&(this.logger=s),a&&this.endpoint===ht&&(this.endpoint=a),!this.isSetup&&(this.isSetup=!0,(i=(n=this.logger)===null||n===void 0?void 0:n.debug)===null||i===void 0||i.call(n,"Setting up messenger"),this.messageHandler=function(l){var c,u,f,d,p;if((u=(c=r.logger)===null||c===void 0?void 0:c.debug)===null||u===void 0||u.call(c,"Message received: ",JSON.stringify(l)),r.endpoint===l.origin){var v=l.data,g=v?.action;if(g)if("id"in v&&v.id)(d=(f=r.logger)===null||f===void 0?void 0:f.debug)===null||d===void 0||d.call(f,"Received Response to previous request: ",JSON.stringify(l)),r.handleResponse(v);else{if(g==="ping"){r.notify({action:"pong"});return}var m=r.actionHandlers.get(g);if(m)m(v.data);
3else{var y=(p=r.pendingMessages.get(g))!==null&&p!==void 0?p:[];y.push(v.data),r.pendingMessages.set(g,y)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},t.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=q();e?.[ze]===this&&delete e[ze]},t})();qr=pt;function Fi(t){return typeof t=="object"&&t!==null&&pt in t&&t[pt]===!0}function Bi(t){var e=q(),r=e?.[ze];if(Fi(r))return r;var n=new Ni(t);return e&&(e[ze]=n),n}var ir="__AMPLITUDE_BACKGROUND_CAPTURE__";function Ki(t,e){var r,n=t;if(n[ir]!==!0){n[ir]=!0;var i=(r=void 0)!==null&&r!==void 0?r:Oi,o=null,s=function(a,l){var c,u;a==="background-capture-complete"&&((u=(c=t.logger)===null||c===void 0?void 0:c.debug)===null||u===void 0||u.call(c,"Background capture complete"),t.notify({action:"background-capture-complete",data:l}))};t.registerActionHandler("initialize-background-capture",function(){var a,l;(l=(a=t.logger)===null||a===void 0?void 0:a.debug)===null||l===void 0||l.call(a,"Initializing background capture (external script)");var c=new URL(i,t.endpoint).toString();t.loadScriptOnce(c).then(function(){var u,f,d;(f=(u=t.logger)===null||u===void 0?void 0:u.debug)===null||f===void 0||f.call(u,"Background capture script loaded (external)"),o=(d=window?.amplitudeBackgroundCapture)===null||d===void 0?void 0:d.call(window,{messenger:t,onBackgroundCapture:s}),t.notify({action:"background-capture-loaded"})}).catch(function(){var u;(u=t.logger)===null||u===void 0||u.warn("Failed to initialize background capture")})}),t.registerActionHandler("close-background-capture",function(){var a;(a=o?.close)===null||a===void 0||a.call(o),o=null})}}var Gr="[Amplitude]",qi="".concat(Gr," Session Replay ID"),Gi=0,Vi=Pe.US,Wi={enabled:!0},Ut=1e3,zi="".concat(Gr," Session Replay Debug"),ji="amp-block",Vr="amp-mask",Hi="amp-unmask",Wr="https://api-sr.amplitude.com/sessions/v2/track",zr="https://api-sr.eu.amplitude.com/sessions/v2/track",jr="https://api-sr.stag2.amplitude.com/sessions/v2/track",$i=1*1e6,Yi=3e4,Qi=6e4,Xi=500,Zi=10*1e3,Hr=1024,Ji=1e3,le;(function(t){t.GET_SR_PROPS="get-sr-props",t.DEBUG_INFO="debug-info",t.FETCH_REQUEST="fetch-request",t.METADATA="metadata",t.TARGETING_DECISION="targeting-decision"})(le||(le={}));var mt=(function(){function t(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return t.prototype.getSafeMethod=function(e){var r;if(!this.logger)return(function(){});var n=this.logger[e];if(typeof n=="function"){var i=(r=n.__rrweb_original__)!==null&&r!==void 0?r:n;return i.bind(this.logger)}return(function(){})},t.prototype.enable=function(e){this.logger.enable(e)},t.prototype.disable=function(){this.logger.disable()},t})(),yt="medium";function eo(t){return t.toLowerCase()}function to(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?eo(e):null}var $r=function(t,e,r){switch(e){case"light":{if(t!=="input")return!0;var n=r?to(r):"";return n?!!(["password","hidden","email","tel"].includes(n)||r.autocomplete.startsWith("cc-")):!1}case"medium":case"conservative":return!0;default:return $r(t,yt,r)}},Yr=function(t,e,r){var n,i,o;if(e===void 0&&(e={defaultMaskLevel:yt}),r){if(r.closest("."+Vr))return!0;var s=((n=e.maskSelector)!==null&&n!==void 0?n:[]).some(function(l){return r.closest(l)});if(s)return!0;if(r.closest("."+Hi))return!1;var a=((i=e.unmaskSelector)!==null&&i!==void 0?i:[]).some(function(l){return r.closest(l)});if(a)return!1}return $r(t,(o=e.defaultMaskLevel)!==null&&o!==void 0?o:yt,r)},or=function(t,e){return function(r,n){return Yr(t,e,n)?r.replace(/[^\s]/g,"*"):r}},ro=function(t){return function(e,r,n){var i;return e==="style"||!((i=t?.maskAttributes)!==null&&i!==void 0?i:[]).includes(e)?r:Yr("text",t,n)?r.replace(/[^\s]/g,"*"):r}},no=function(){var t=q();return t?.location?t.location.href:""},io=function(t,e){return"".concat(e,"/").concat(t)},xt=function(t,e){return e||(t===Pe.STAGING?jr:t===Pe.EU?zr:Wr)},oo=function(t){if(typeof t!="string"||t.trim()==="")return!1;var e=/^\/|^https?:\/\/[^\s]+$/;return!!e.test(t)},so=function(t){var e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(e,"$"))},ao=function(t){if(!t.every(function(e){return typeof e.selector=="string"&&typeof e.replacement=="string"}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!t.every(function(e){return oo(e.selector)}))throw new Error("ugcFilterRules must be an array of objects with valid globs")},Xe=function(t,e){var r,n;try{for(var i=H(e),o=i.next();!o.done;o=i.next()){var s=o.value,a=so(s.selector);if(a.test(t))return t.replace(a,s.replacement)}}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t},Qr=function(){return I(void 0,void 0,void 0,function(){var t,e,r,n,i,o,s;return w(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),t=q(),t?[4,t.navigator.storage.estimate()]:[3,2];case 1:return e=a.sent(),r=e.usage,n=e.quota,i=e.usageDetails,o=r?Math.round(r/Hr):0,s=r&&n?Math.round((r/n+Number.EPSILON)*1e3)/1e3:0,[2,{totalStorageSize:o,percentOfQuota:s,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},Xr=function(t){var e=D({},t),r=e.apiKey;return e.apiKey="****".concat(r.substring(r.length-4)),e},Zr=function(){return{flushMaxRetries:2,logLevel:Y.Warn,loggerProvider:new We,transportProvider:new Ii}},lo=(function(t){Qe(e,t);function e(r,n){var i=this,o,s,a,l,c,u,f=Zr();if(i=t.call(this,D(D({transportProvider:f.transportProvider,loggerProvider:new mt(n.loggerProvider||f.loggerProvider)},n),{apiKey:r}))||this,i.flushMaxRetries=n.flushMaxRetries!==void 0&&n.flushMaxRetries<=f.flushMaxRetries?n.flushMaxRetries:f.flushMaxRetries,i.apiKey=r,i.sampleRate=n.sampleRate||Gi,i.serverZone=n.serverZone||Vi,i.configServerUrl=n.configServerUrl,i.trackServerUrl=n.trackServerUrl,i.shouldInlineStylesheet=n.shouldInlineStylesheet,i.version=n.version,i.performanceConfig=n.performanceConfig||Wi,i.storeType=(o=n.storeType)!==null&&o!==void 0?o:"idb",i.applyBackgroun
3dColorToBlockedElements=(s=n.applyBackgroundColorToBlockedElements)!==null&&s!==void 0?s:!1,i.enableUrlChangePolling=(a=n.enableUrlChangePolling)!==null&&a!==void 0?a:!1,i.urlChangePollingInterval=(l=n.urlChangePollingInterval)!==null&&l!==void 0?l:Ut,i.captureDocumentTitle=(c=n.captureDocumentTitle)!==null&&c!==void 0?c:!1,n.privacyConfig&&(i.privacyConfig=n.privacyConfig),n.interactionConfig&&(i.interactionConfig=n.interactionConfig,i.interactionConfig.ugcFilterRules&&ao(i.interactionConfig.ugcFilterRules)),n.debugMode&&(i.debugMode=n.debugMode),n.useWebWorker!==void 0)i.useWebWorker=n.useWebWorker;else{var d=n;((u=d.experimental)===null||u===void 0?void 0:u.useWebWorker)!==void 0&&(i.useWebWorker=d.experimental.useWebWorker)}return n.omitElementTags&&(i.omitElementTags=n.omitElementTags),i}return e})(mi);const uo="modulepreload",co=function(t,e){return new URL(t,e).href},sr={},Ie=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let c=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const s=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=c(r.map(u=>{if(u=co(u,n),u in sr)return;sr[u]=!0;const f=u.endsWith(".css"),d=f?'[rel="stylesheet"]':"";if(n)for(let v=s.length-1;v>=0;v--){const g=s[v];if(g.href===u&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${d}`))return;const p=document.createElement("link");if(p.rel=f?"stylesheet":uo,f||(p.as="script"),p.crossOrigin="",p.href=u,l&&p.setAttribute("nonce",l),document.head.appendChild(p),f)return new Promise((v,g)=>{p.addEventListener("load",v),p.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};var Jr=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Jr||{}),en=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(en||{}),fo=function(t,e){var r=document.createDocumentFragment(),n=function(i){if(i===void 0&&(i=[]),typeof i=="string"&&(i=[i]),i=i.filter(function(o){try{r.querySelector(o)}catch{return e.warn('[session-replay-browser] omitting selector "'.concat(o,'" because it is invalid')),!1}return!0}),i.length!==0)return i};return t.blockSelector=n(t.blockSelector),t.maskSelector=n(t.maskSelector),t.unmaskSelector=n(t.unmaskSelector),t},vo=(function(){function t(e,r){this.localConfig=r,this.remoteConfigClient=e}return t.prototype.generateJoinedConfig=function(){var e,r,n,i,o;return I(this,void 0,void 0,function(){var s,a,l,c,u,f,d,p,v,g,m,y,h,S,b,C,R,A=this;return w(this,function(E){switch(E.label){case 0:s=D({},this.localConfig),s.optOut=this.localConfig.optOut,s.captureEnabled=!0,E.label=1;case 1:return E.trys.push([1,3,,4]),[4,new Promise(function(_,T){A.remoteConfigClient.subscribe("configs.sessionReplay","all",function(U,L){var P;if(A.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(L,":"),JSON.stringify(U,null,2)),!U){T(new Error("No remote config received"));return}var x=U,N=x.sr_sampling_config,F=x.sr_privacy_config,M=x.sr_targeting_config,B=(P=s.interactionConfig)===null||P===void 0?void 0:P.ugcFilterRules;s.interactionConfig=x.sr_interaction_config,s.interactionConfig&&B&&(s.interactionConfig.ugcFilterRules=B),s.loggingConfig=x.sr_logging_config,(N||F||M)&&(a={},N&&(a.sr_sampling_config=N),F&&(a.sr_privacy_config=F),M&&(a.sr_targeting_config=M)),_()})})];case 2:return E.sent(),[3,4];case 3:return l=E.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",l),s.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:void 0}];case 4:if(!a)return[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:a}];if(c=a.sr_sampling_config,u=a.sr_privacy_config,f=a.sr_targeting_config,c&&Object.keys(c).length>0?(Object.prototype.hasOwnProperty.call(c,"capture_enabled")?s.captureEnabled=c.capture_enabled:s.captureEnabled=!1,Object.prototype.hasOwnProperty.call(c,"sample_rate")&&(s.sampleRate=c.sample_rate)):(s.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),u){d=(e=s.privacyConfig)!==null&&e!==void 0?e:{},p={defaultMaskLevel:(n=(r=u.defaultMaskLevel)!==null&&r!==void 0?r:d.defaultMaskLevel)!==null&&n!==void 0?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:ee([],z(new Set(ee(ee([],z((i=d.maskAttributes)!==null&&i!==void 0?i:[]),!1),z((o=u.maskAttributes)!==null&&o!==void 0?o:[]),!1))),!1)},v=function(_){var T,U,L,P,x,N,F,M,B,$={};typeof _.blockSelector=="string"&&(_.blockSelector=[_.blockSelector]);try{for(var ie=H((F=_.blockSelector)!==null&&F!==void 0?F:[]),G=ie.next();!G.done;G=ie.next()){var Z=G.value;$[Z]="block"}}catch(oe){T={error:oe}}finally{try{G&&!G.done&&(U=ie.return)&&U.call(ie)}finally{if(T)throw T.error}}try{for(var J=H((M=_.maskSelector)!==null&&M!==void 0?M:[]),V=J.next();!V.done;V=J.next()){var Z=V.value;$[Z]="mask"}}catch(oe){L={error:oe}}finally{try{V&&!V.done&&(P=J.return)&&P.call(J)}finally{if(L)throw L.error}}try{for(var K=H((B=_.unmaskSelector)!==null&&B!==void 0?B:[]),ue=K.next();!ue.done;ue=K.next()){var Z=ue.value;$[Z]="unmask"}}catch(oe){x={error:oe}}finally{try{ue&&!ue.done&&(N=K.return)&&N.call(K)}finally{if(x)throw x.error}}return $},g=D(D({},v(d)),v(u));try{for(m=H(Object.entries(g)),y=m.next();!y.done;y=m.next())h=z(y.value,2),S=h[0],b=h[1],b==="mask"?p.maskSelector.push(S):b==="block"?p.blockSelector.push(S):b==="unmask"&&p.unmaskSelector.push(S)}catch(_){C={error:_}}finally{try{y&&!y.done&&(R=m.return)&&R.call(m)}finally{if(C)throw C.error}}s.privacyConfig=fo(p,this.localConfig.loggerProvider)}return f&&Object.keys(f).length>0&&(s.targetingConfig=f),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Xr(s)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:a}]}})})},t})(),go=function(t,e){return I(void 0,void 0,void 0,function(){var r,n;return w(this,function(i){return r=new lo(t,e),n=new Li(t,r.loggerProvider,r.serverZone,e.configServerUrl),[2,new vo(n,r)]})})},Q=Uint8Array,j=Uint16Array,_e=Uint32Array,Nt=new Q([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ft=new Q([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ar=new Q([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),tn=function(t,e){for(var r=new j(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new _e(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},rn=tn(Nt,2),ho=rn[0],St=rn[1];ho[28]=258,St[258]=28;var po=tn(Ft,0),lr=po[1],bt=new j(32768);for(var O=0;O<32768;++O){var se=(O&43690)>>>1|(O&21845)<<1;se=(se&52428)>>>2|(se&13107)<<2,se=(se&61680)>>>4|(se&3855)<<4,bt[O]=((se&65280)>>>8|(se&255)<<8)>>>1}var Ce=(function(t,e,r){for(var n=t.length,i=0,o=new j(e);i<n;++i)++o[t[i]-1];var s=new j(e);for(i=0;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new j(1<<e);var l=15-e;for(i=0;i<n;++i)if(t[i])for(var c=i<<4|t[i],u=e-t[i],f=s[t[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[bt[f]>>>l]=c}else for(a=new j(n),i=0;i<n;++i)a[i]=bt[s[t[i]-1]++]>>>15-t[i];return a}),ge=new Q(288);for(var O=0;O<144;++O)ge[O]=8;for(var O=144;O<256;++O)ge[O]=9;for(var O=256;O<280;++O)ge[O]=7;for(var O=280;O<288;++O)ge[O]=8;var je=new Q(32);for(var O=0;O<32;++O)je[O]=5;var mo=Ce(ge,9,0),yo=Ce(je,5,0),nn=function(t){return(t/8>>0)+(t&7&&1)},on=function(t,e,r){(r==null||r>t.length)&&(r=t.length);var n=new(t instanceof j?j:t instanceof _e?_e:Q)(r-e);return n.set(t.subarray(e,r)),n},re=function(t,e,r){r<<=e&7;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8},be=function(t,e,r){r<<=e&7;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},it=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return[new Q(0),0];if(i==1){var s=new Q(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort(function(C,R){return C.f-R.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,f=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=r[r[c].f<r[f].f?c++:f++],l=r[c!=u&&r[c].f<r[f].f?c++:f++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,n=1;n<i;++n)o[n].s>d&&(d=o[n].s);var p=new j(d+1),v=Et(r[u-1],p,0);if(v>e){var n=0,g=0,m=v-e,y=1<<m;for(o.sort(function(R,A){return p[A.s]-p[R.s]||R.f-A.f});n<i;++n){var h=o[n].s;if(p[h]>e)g+=y-(1<<v-p[h]),p[h]=e;else break}for(g>>>=m;g>0;){var S=o[n].s;p[S]<e?g-=1<<e-p[S]++-1:++n}for(;n>=0&&g;--n){var b=o[n].s;p[b]==e&&(--p[b],++g)}v=e}return[new Q(p),v]},Et=function(t,e,r){return t.s==-1?Math.max(Et(t.l,e,r+1),Et(t.r,e,r+1)):e[t.s]=r},ur=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new j(++e),n=0,i=t[0],o=1,s=function(l){r[n++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[r.subarray(0,n),e]},Ee=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},wt=function(t,e,r){var n=r.length,i=nn(e+2);t[i]=n&255,t[i+1]=n>>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<n;++o)t[i+o+4]=r[o];return(i+4+n)*8},cr=function(t,e,r,n,i,o,s,a,l,c,u){re(e,u++,r),++i[256];for(var f=it(i,15),d=f[0],p=f[1],v=it(o,15),g=v[0],m=v[1],y=ur(d),h=y[0],S=y[1],b=ur(g),C=b[0],R=b[1],A=new j(19),E=0;E<h.length;
vendor: 6,789 bytes, line 3
3++E)A[h[E]&31]++;for(var E=0;E<C.length;++E)A[C[E]&31]++;for(var _=it(A,7),T=_[0],U=_[1],L=19;L>4&&!T[ar[L-1]];--L);var P=c+5<<3,x=Ee(i,ge)+Ee(o,je)+s,N=Ee(i,d)+Ee(o,g)+s+14+3*L+Ee(A,T)+(2*A[16]+3*A[17]+7*A[18]);if(P<=x&&P<=N)return wt(e,u,t.subarray(l,l+c));var F,M,B,$;if(re(e,u,1+(N<x)),u+=2,N<x){F=Ce(d,p,0),M=d,B=Ce(g,m,0),$=g;var ie=Ce(T,U,0);re(e,u,S-257),re(e,u+5,R-1),re(e,u+10,L-4),u+=14;for(var E=0;E<L;++E)re(e,u+3*E,T[ar[E]]);u+=3*L;for(var G=[h,C],Z=0;Z<2;++Z)for(var J=G[Z],E=0;E<J.length;++E){var V=J[E]&31;re(e,u,ie[V]),u+=T[V],V>15&&(re(e,u,J[E]>>>5&127),u+=J[E]>>>12)}}else F=mo,M=ge,B=yo,$=je;for(var E=0;E<a;++E)if(n[E]>255){var V=n[E]>>>18&31;be(e,u,F[V+257]),u+=M[V+257],V>7&&(re(e,u,n[E]>>>23&31),u+=Nt[V]);var K=n[E]&31;be(e,u,B[K]),u+=$[K],K>3&&(be(e,u,n[E]>>>5&8191),u+=Ft[K])}else be(e,u,F[n[E]]),u+=M[n[E]];return be(e,u,F[256]),u+M[256]},So=new _e([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bo=function(t,e,r,n,i,o){var s=t.length,a=new Q(n+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(n,a.length-i),c=0;if(!e||s<8)for(var u=0;u<=s;u+=65535){var f=u+65535;f<s?c=wt(l,c,t.subarray(u,f)):(l[u]=o,c=wt(l,c,t.subarray(u,s)))}else{for(var d=So[e-1],p=d>>>13,v=d&8191,g=(1<<r)-1,m=new j(32768),y=new j(g+1),h=Math.ceil(r/3),S=2*h,b=function(tt){return(t[tt]^t[tt+1]<<h^t[tt+2]<<S)&g},C=new _e(25e3),R=new j(288),A=new j(32),E=0,_=0,u=0,T=0,U=0,L=0;u<s;++u){var P=b(u),x=u&32767,N=y[P];if(m[x]=N,y[P]=x,U<=u){var F=s-u;if((E>7e3||T>24576)&&F>423){c=cr(t,l,0,C,R,A,_,T,L,u-L,c),T=E=_=0,L=u;for(var M=0;M<286;++M)R[M]=0;for(var M=0;M<30;++M)A[M]=0}var B=2,$=0,ie=v,G=x-N&32767;if(F>2&&P==b(u-G))for(var Z=Math.min(p,F)-1,J=Math.min(32767,u),V=Math.min(258,F);G<=J&&--ie&&x!=N;){if(t[u+B]==t[u+B-G]){for(var K=0;K<V&&t[u+K]==t[u+K-G];++K);if(K>B){if(B=K,$=G,K>Z)break;for(var ue=Math.min(G,K-2),oe=0,M=0;M<ue;++M){var et=u-G+M+32768&32767,bn=m[et],Kt=et-bn+32768&32767;Kt>oe&&(oe=Kt,N=et)}}}x=N,N=m[x],G+=x-N+32768&32767}if($){C[T++]=268435456|St[B]<<18|lr[$];var qt=St[B]&31,Gt=lr[$]&31;_+=Nt[qt]+Ft[Gt],++R[257+qt],++A[Gt],U=u+B,++E}else C[T++]=t[u],++R[t[u]]}}c=cr(t,l,o,C,R,A,_,T,L,u-L,c)}return on(a,0,n+nn(c)+i)},Eo=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,o=r.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)n+=r[s],i+=n;n%=65521,i%=65521}t=n,e=i},d:function(){return(t>>>8<<16|(e&255)<<8|e>>>8)+((t&255)<<23)*2}}},wo=function(t,e,r,n,i){return bo(t,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):12+e.mem,r,n,!0)},Io=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},Co=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;t[0]=120,t[1]=n<<6|(n?32-2*n:1)};function Ro(t,e){e===void 0&&(e={});var r=Eo();r.p(t);var n=wo(t,e,2,4);return Co(n,e),Io(n,n.length-4,r.d()),n}function Ao(t,e){var r=t.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(t);for(var n=new Q(t.length+(t.length>>>1)),i=0,o=function(c){n[i++]=c},s=0;s<r;++s){if(i+5>n.length){var a=new Q(i+8+(r-s<<1));a.set(n),n=a}var l=t.charCodeAt(s);l<128||e?o(l):l<2048?(o(192|l>>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|t.charCodeAt(++s)&1023,o(240|l>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|l&63)):(o(224|l>>>12),o(128|l>>>6&63),o(128|l&63))}return on(n,0,i)}function Po(t,e){for(var r="",n=0;n<t.length;){var i=t[n++];r+=String.fromCharCode(i)}return r}const _o="v1",To=t=>{const e={...t,v:_o};return Po(Ro(Ao(JSON.stringify(e))))};var Lo=2e3,ko=(function(){function t(e,r,n,i){var o=this,s;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(f){var d=To(f);return JSON.stringify(d)},this.addCompressedEventToManager=function(f,d){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:f},sessionId:d,deviceId:o.deviceId})},this.addCompressedEvent=function(f,d){if(o.worker)try{o.worker.postMessage({event:f,sessionId:d})}catch(v){v.name==="DataCloneError"?o.worker.postMessage(JSON.stringify({event:f,sessionId:d})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",v)}else{var p=o.compressEvent(f);o.addCompressedEventToManager(p,d)}},this.terminate=function(){var f;(f=o.worker)===null||f===void 0||f.terminate()};var a=q();if(this.canUseIdleCallback=a&&"requestIdleCallback"in a,this.eventsManager=e,this.config=r,this.deviceId=n,this.timeout=((s=r.performanceConfig)===null||s===void 0?void 0:s.timeout)||Lo,i){r.loggerProvider.log("Enabling web worker for compression");try{var l=new Blob([i],{type:"application/javascript"}),c=URL.createObjectURL(l),u=new Worker(c);u.onerror=function(f){f.preventDefault(),r.loggerProvider.error("Worker failed, falling back to non-worker compression:",f),u.terminate(),o.worker=void 0},u.onmessage=function(f){var d=f.data,p=d.compressedEvent,v=d.sessionId;o.addCompressedEventToManager(p,v)},this.worker=u}catch(f){r.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",f)}}}return t.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(r){e.processQueue(r)},{timeout:this.timeout}))},t.prototype.enqueueEvent=function(e,r){var n;this.canUseIdleCallback&&(!((n=this.config.performanceConfig)===null||n===void 0)&&n.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:r}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,r))},t.prototype.processQueue=function(e){for(var r=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var i=n.event,o=n.sessionId;this.addCompressedEvent(i,o)}}this.taskQueue.length>0?requestIdleCallback(function(s){r.processQueue(s)},{timeout:this.timeout}):this.isProcessing=!1},t})(),Do="Unexpected error occurred",Mo="Network error occurred, event batch rejected",dr="Session replay event batch rejected due to exceeded retry count",pe="Failed to store session replay events in IndexedDB",Oo="Session replay event batch not sent due to missing device ID",Uo="Session replay event batch not sent due to missing api key",It="1.35.0",xo=(function(){function t(e){var r=e.trackServerUrl,n=e.loggerProvider,i=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=n,this.payloadBatcher=i||function(o){return o},this.trackServerUrl=r}return t.prototype.sendEventsList=function(e){this.addToQueue(D(D({},e),{attempts:0,timeout:0}))},t.prototype.addToQueue=function(){for(var e=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r.filter(function(o){return o.attempts<(o.flushMaxRetries||0)?(o.attempts+=1,!0):(e.completeRequest({context:o,err:dr}),!1)});
3i.forEach(function(o){e.queue=e.queue.concat(o),e.schedule(0)})},t.prototype.schedule=function(e){var r=this;this.scheduled||(this.scheduled=setTimeout(function(){r.flush(!0).then(function(){r.queue.length>0&&r.schedule(e)})},e))},t.prototype.flush=function(e){return e===void 0&&(e=!1),I(this,void 0,void 0,function(){var r,n,i,o,s,a,l;return w(this,function(c){switch(c.label){case 0:r=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),c.label=1;case 1:c.trys.push([1,6,7,8]),n=H(r),i=n.next(),c.label=2;case 2:return i.done?[3,5]:(o=i.value,[4,this.send(o,e)]);case 3:c.sent(),c.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return s=c.sent(),a={error:s},[3,8];case 7:try{i&&!i.done&&(l=n.return)&&l.call(n)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},t.prototype.send=function(e,r){var n,i;return r===void 0&&(r=!0),I(this,void 0,void 0,function(){var o,s,a,l,c,u,f,d,p,v,g,m,y;return w(this,function(h){switch(h.label){case 0:if(o=e.apiKey,!o)return[2,this.completeRequest({context:e,err:Uo})];if(s=e.deviceId,!s)return[2,this.completeRequest({context:e,err:Oo})];if(a=no(),l=It,c=e.sampleRate,u=new URLSearchParams({device_id:s,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),f="".concat(((n=e.version)===null||n===void 0?void 0:n.type)||"standalone","/").concat(((i=e.version)===null||i===void 0?void 0:i.version)||l),d=this.payloadBatcher({version:1,events:e.events}),d.events.length===0)return this.completeRequest({context:e}),[2];h.label=1;case 1:return h.trys.push([1,6,,7]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(o),"X-Client-Version":l,"X-Client-Library":f,"X-Client-Url":a.substring(0,Ji),"X-Client-Sample-Rate":"".concat(c),"X-Sampling-Hash-Alg":"xxhash32"},body:JSON.stringify(d),method:"POST"},v="".concat(xt(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(v,p)];case 2:if(g=h.sent(),g===null)return this.completeRequest({context:e,err:Do}),[2];if(r)return[3,3];m="";try{m=JSON.stringify(g.body,null,2)}catch{}return this.completeRequest({context:e,success:"".concat(g.status,": ").concat(m)}),[3,5];case 3:return[4,this.handleReponse(g.status,e)];case 4:h.sent(),h.label=5;case 5:return[3,7];case 6:return y=h.sent(),this.completeRequest({context:e,err:y}),[3,7];case 7:return[2]}})})},t.prototype.handleReponse=function(e,r){return I(this,void 0,void 0,function(){var n,i;return w(this,function(o){switch(o.label){case 0:switch(n=new Kr().buildStatus(e),i=n,i){case W.Success:return[3,1];case W.Failed:return[3,2]}return[3,4];case 1:return this.handleSuccessResponse(r),[3,5];case 2:return[4,this.handleOtherResponse(r)];case 3:return o.sent(),[3,5];case 4:this.completeRequest({context:r,err:Mo}),o.label=5;case 5:return[2]}})})},t.prototype.handleSuccessResponse=function(e){var r=Math.round(new Blob(e.events).size/Hr);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(r," KB")})},t.prototype.handleOtherResponse=function(e){return I(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return r=e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:dr}),[2]):[4,new Promise(function(i){return setTimeout(i,r)})];case 1:return n.sent(),[4,this.send(e,!0)];case 2:return n.sent(),[2]}})})},t.prototype.completeRequest=function(e){var r=e.context,n=e.err,i=e.success;r.onComplete(),n?this.loggerProvider.warn(n):i&&this.loggerProvider.log(i)},t})();const Ct=(t,e)=>e.some(r=>t instanceof r);let fr,vr;function No(){return fr||(fr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Fo(){return vr||(vr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Rt=new WeakMap,ot=new WeakMap,Ze=new WeakMap;function Bo(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",o),t.removeEventListener("error",s)},o=()=>{r(ve(t.result)),i()},s=()=>{n(t.error),i()};t.addEventListener("success",o),t.addEventListener("error",s)});return Ze.set(e,t),e}function Ko(t){if(Rt.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",o),t.removeEventListener("error",s),t.removeEventListener("abort",s)},o=()=>{r(),i()},s=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",o),t.addEventListener("error",s),t.addEventListener("abort",s)});Rt.set(t,e)}let At={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return Rt.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return ve(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function sn(t){At=t(At)}function qo(t){return Fo().includes(t)?function(...e){return t.apply(Pt(this),e),ve(this.request)}:function(...e){return ve(t.apply(Pt(this),e))}}function Go(t){return typeof t=="function"?qo(t):(t instanceof IDBTransaction&&Ko(t),Ct(t,No())?new Proxy(t,At):t)}function ve(t){if(t instanceof IDBRequest)return Bo(t);if(ot.has(t))return ot.get(t);const e=Go(t);return e!==t&&(ot.set(t,e),Ze.set(e,t)),e}const Pt=t=>Ze.get(t);function an(t,e,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(t,e),a=ve(s);return n&&s.addEventListener("upgradeneeded",l=>{n(ve(s.result),l.oldVersion,l.newVersion,ve(s.transaction),l)}),r&&s.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const Vo=["get","getKey","getAll","getAllKeys","count"],Wo=["put","add","delete","clear"],st=ne
vendor: 16,153 bytes, line 3
3w Map;function gr(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(st.get(e))return st.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=Wo.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||Vo.includes(r)))return;const o=async function(s,...a){const l=this.transaction(s,i?"readwrite":"readonly");let c=l.store;return n&&(c=c.index(a.shift())),(await Promise.all([c[r](...a),i&&l.done]))[0]};return st.set(e,o),o}sn(t=>({...t,get:(e,r,n)=>gr(e,r)||t.get(e,r,n),has:(e,r)=>!!gr(e,r)||t.has(e,r)}));const zo=["continue","continuePrimaryKey","advance"],hr={},_t=new WeakMap,ln=new WeakMap,jo={get(t,e){if(!zo.includes(e))return t[e];let r=hr[e];return r||(r=hr[e]=function(...n){_t.set(this,ln.get(this)[e](...n))}),r}};async function*Ho(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const r=new Proxy(e,jo);for(ln.set(r,e),Ze.set(r,Pt(e));e;)yield r,e=await(_t.get(r)||e.continue()),_t.delete(r)}function pr(t,e){return e===Symbol.asyncIterator&&Ct(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&Ct(t,[IDBIndex,IDBObjectStore])}sn(t=>({...t,get(e,r,n){return pr(e,r)?Ho:t.get(e,r,n)},has(e,r){return pr(e,r)||t.has(e,r)}}));var un=(function(){function t(e){var r=this,n,i,o;this.minInterval=Xi,this.maxInterval=Zi,this.maxPersistedEventsSize=$i,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(s,a){var l=r.getStringSize(a),c=r.getEventsArraySize(s);return c+l>=r.maxPersistedEventsSize?!0:Date.now()-r.timeAtLastSplit>r.interval&&s.length?(r.interval=Math.min(r.maxInterval,r.interval+r.minInterval),r._timeAtLastSplit=Date.now(),!0):!1},this.loggerProvider=e.loggerProvider,this.minInterval=(n=e.minInterval)!==null&&n!==void 0?n:this.minInterval,this.maxInterval=(i=e.maxInterval)!==null&&i!==void 0?i:this.maxInterval,this.maxPersistedEventsSize=(o=e.maxPersistedEventsSize)!==null&&o!==void 0?o:this.maxPersistedEventsSize}return Object.defineProperty(t.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),t.prototype.getStringSize=function(e){return e.length},t.prototype.getEventsArraySize=function(e){var r,n,i=0;try{for(var o=H(e),s=o.next();!s.done;s=o.next()){var a=s.value;i+=this.getStringSize(a)}}catch(c){r={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}var l=2+Math.max(0,e.length-1)+e.length*2;return i+l},t})(),$o=function(t){return typeof t=="object"&&t!==null&&t.name==="AbortError"},ne=function(t,e,r){$o(r)?t.debug(e):t.warn(e)},Re="sessionCurrentSequence",Ae="sequencesToSend",Yo=function(t){var e,r;return t.objectStoreNames.contains(Re)||(r=t.createObjectStore(Re,{keyPath:"sessionId"})),t.objectStoreNames.contains(Ae)||(e=t.createObjectStore(Ae,{keyPath:"sequenceId",autoIncrement:!0}),e.createIndex("sessionId","sessionId")),{sequencesStore:e,currentSequenceStore:r}},Qo=function(t){return I(void 0,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,an(t,1,{upgrade:Yo})];case 1:return[2,e.sent()]}})})},Xo=(function(t){Qe(e,t);function e(r){var n=t.call(this,r)||this;return n.getSequencesToSend=function(){return I(n,void 0,void 0,function(){var i,o,s,a,l,c;return w(this,function(u){switch(u.label){case 0:return u.trys.push([0,5,,6]),i=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:o=u.sent(),u.label=2;case 2:return o?(s=o.value,a=s.sessionId,l=s.events,i.push({events:l,sequenceId:o.key,sessionId:a}),[4,o.continue()]):[3,4];case 3:return o=u.sent(),[3,2];case 4:return[2,i];case 5:return c=u.sent(),ne(this.loggerProvider,"".concat(pe,": ").concat(c),c),[3,6];case 6:return[2,void 0]}})})},n.storeCurrentSequence=function(i){return I(n,void 0,void 0,function(){var o,s,a;return w(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.db.get(Re,i)];case 1:return o=l.sent(),o?[4,this.db.put(Ae,{sessionId:i,events:o.events})]:[2,void 0];case 2:return s=l.sent(),[4,this.db.put(Re,{sessionId:i,events:[]})];case 3:return l.sent(),[2,D(D({},o),{sessionId:i,sequenceId:s})];case 4:return a=l.sent(),ne(this.loggerProvider,"".concat(pe,": ").concat(a),a),[3,5];case 5:return[2,void 0]}})})},n.addEventToCurrentSequence=function(i,o){return I(n,void 0,void 0,function(){var s,a,l,c,u,f;return w(this,function(d){switch(d.label){case 0:return d.trys.push([0,10,,11]),s=this.db.transaction(Re,"readwrite"),[4,s.store.get(i)];case 1:return a=d.sent(),a?[3,3]:[4,s.store.put({sessionId:i,events:[o]})];case 2:return d.sent(),[2];case 3:return l=void 0,this.shouldSplitEventsList(a.events,o)?(l=a.events,[4,s.store.put({sessionId:i,events:[o]})]):[3,5];case 4:return d.sent(),[3,7];case 5:return c=a.events.concat(o),[4,s.store.put({sessionId:i,events:c})];case 6:d.sent(),d.label=7;case 7:return[4,s.done];case 8:return d.sent(),l?[4,this.storeSendingEvents(i,l)]:[2,void 0];case 9:return u=d.sent(),u?[2,{events:l,sessionId:i,sequenceId:u}]:[2,void 0];case 10:return f=d.sent(),ne(this.loggerProvider,"".concat(pe,": ").concat(f),f),[3,11];case 11:return[2,void 0]}})})},n.storeSendingEvents=function(i,o){return I(n,void 0,void 0,function(){var s,a;return w(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,this.db.put(Ae,{sessionId:i,events:o})];case 1:return s=l.sent(),[2,s];case 2:return a=l.sent(),ne(this.loggerProvider,"".concat(pe,": ").concat(a),a),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(i,o){return I(n,void 0,void 0,function(){var s;return w(this,function(a){switch(a.label){case 0:if(!o)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.db.delete(Ae,o)];case 2:return a.sent(),[3,4];case 3:return s=a.sent(),ne(this.loggerProvider,"".concat(pe,": ").concat(s),s),[3,4];case 4:return[2]}})})},n.db=r.db,n}return e.new=function(r,n){return I(this,void 0,void 0,function(){var i,o,s,a;return w(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),i=r==="replay"?"":"_".concat(r),o="".concat(n.apiKey.substring(0,10),"_amp_session_replay_events").concat(i),[4,Qo(o)];case 1:return s=l.sent(),[2,new e(D(D({},n),{db:s}))];case 2:return a=l.sent(),ne(n.loggerProvider,"".concat(pe,": ").concat(a),a),[3,3];case 3:return[2]}})})},e.prototype.getCurrentSequenceEvents=function(r){return I(this,void 0,void 0,function(){var s,n,i,o,s,a,l,c;return w(this,function(u){switch(u.label){case 0:return r?[4,this.db.get("sessionCurrentSequence",r)]:[3,2];case 1:return s=u.sent(),s?[2,[s]]:[2,void 0];case 2:n=[],u.label=3;case 3:return u.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:i=H.apply(void 0,[u.sent()]),o=i.next(),u.label=5;case 5:if(o.done)return[3,7];s=o.value,n.push(s),u.label=6;case 6:return o=i.next(),[3,5];case 7:return[3,10];case 8:return a=u.sent(),l={error:a},[3,10];case 9:try{o&&!o.done&&(c=i.return)&&c.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,n]}})})},e})(un),Zo=(function(t){Qe(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.finalizedSequences={},r.sequences={},r.sequenceId=0,r}return e.prototype.resetCurrentSequence=function(r){this.sequences[r]=[]},e.prototype.addSequence=function(r){var n=this.sequenceId++,i=ee([],z(this.sequences[r]),!1);return this.finalizedSequences[n]={sessionId:r,events:i},this.resetCurrentSequence(r),{sequenceId:n,events:i,sessionId:r}},e.prototype.getSequencesToSend=function(){return I(this,void 0,void 0,function(){return w(this,function(r){return[2,Object.entries(this.finalizedSequences).map(function(n){var i=z(n,2),o=i[0],s=i[1],a=s.sessionId,l=s.events;return{sequenceId:Number(o),sessionId:a,events:l}})]})})},e.prototype.storeCurrentSequence=function(r){return I(this,void 0,void 0,function(){return w(this,function(n){return this.sequences[r]?[2,this.addSequence(r)]:[2,void 0]})})},e.prototype.addEventToCurrentSequence=function(r,n){return I(this,void 0,void 0,function(){var i;return w(this,function(o){return this.sequences[r]||this.resetCurrentSequence(r),this.shouldSplitEventsList(this.sequences[r],n)&&(i=this.addSequence(r)),this.sequences[r].push(n),[2,i]})})},e.prototype.storeSendingEvents=function(r,n){return I(this,void 0,void 0,function(){return w(this,function(i){return this.finalizedSequences[this.sequenceId]={sessionId:r,events:n},[2,this.sequenceId++]})})},e.prototype.cleanUpSessionEventsStore=function(r,n){return I(this,void 0,void 0,function(){return w(this,function(i){return n!==void 0&&delete this.finalizedSequences[n],[2]})})},e})(un),mr=function(t){var e=t.config,r=t.minInterval,n=t.maxInterval,i=t.type,o=t.payloadBatcher,s=t.storeType;return I(void 0,void 0,void 0,function(){function a(y){return y===void 0&&(y=!1),I(this,void 0,void 0,function(){return w(this,function(h){return[2,l.flush(y)]})})}var l,c,u,f,d,p,v,g,m;return w(this,function(y){switch(y.label){case 0:return l=new xo(D(D({},e),{loggerProvider:e.loggerProvider,payloadBatcher:o})),c=function(){return new Zo({loggerProvider:e.loggerProvider,maxInterval:n,minInterval:r})},u=function(){return I(void 0,void 0,void 0,function(){var h;return w(this,function(S){switch(S.label){case 0:return[4,Xo.new(i,{loggerProvider:e.loggerProvider,minInterval:r,maxInterval:n,apiKey:e.apiKey})];case 1:return h=S.sent(),h?[2,h]:(e.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,c()])}})})},s!=="idb"?[3,2]:[4,u()];case 1:return d=y.sent(),[3,3];case 2:d=c(),y.label=3;case 3:return f=d,p=function(h){var S=h.events,b=h.sessionId,C=h.deviceId,R=h.sequenceId;e.debugMode&&Qr().then(function(A){var E=A.totalStorageSize,_=A.percentOfQuota,T=A.usageDetails;e.loggerProvider.debug("Total storage size: ".concat(E," KB, percentage of quota: ").concat(_,"%, usage details: ").concat(T))}).catch(function(){}),l.sendEventsList({events:S,sessionId:b,flushMaxRetries:e.flushMaxRetries,apiKey:e.apiKey,deviceId:C,sampleRate:e.sampleRate,serverZone:e.serverZone,version:e.version,type:i,onComplete:function(){return I(void 0,void 0,void 0,function(){return w(this,function(A){switch(A.label){case 0:return[4,f.cleanUpSessionEventsStore(b,R)];case 1:return A.sent(),[2]}})})}})},v=function(h){var S=h.sessionId,b=h.deviceId;f.storeCurrentSequence(S).then(function(C){C&&p({sequenceId:C.sequenceId,events:C.events,sessionId:C.sessionId,deviceId:b})}).catch(function(C){e.loggerProvider.warn("Failed to get current sequence of session replay events for session:",C)})},g=function(h){var S=h.deviceId;return I(void 0,void 0,void 0,function(){var b;return w(this,function(C){switch(C.label){case 0:return[4,f.getSequencesToSend()];case 1:return b=C.sent(),b&&b.forEach(function(R){p({sequenceId:R.sequenceId,events:R.events,sessionId:R.sessionId,deviceId:S})}),[2]}})})},m=function(h){var S=h.event,b=h.sessionId,C=h.deviceId;f.addEventToCurrentSequence(b,S.data).then(function(R){return R&&p({sequenceId:R.sequenceId,events:R.events,sessionId:R.sessionId,deviceId:C})}).catch(function(R){e.loggerProvider.warn("Failed to add event to session replay capture:",R)})},[2,{sendCurrentSequenceEvents:v,addEvent:m,sendStoredEvents:g,flush:a}]}})})},yr=(function(){function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=new Map;e.forEach(function(i){n.set(i.name,i.manager)}),this.managers=n}return t.prototype.sendStoredEvents=function(e){return I(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return r=[],this.managers.forEach(function(i){r.push(i.sendStoredEvents(e))}),[4,Promise.all(r)];case 1:return n.sent(),[2]}})})},t.prototype.addEvent=function(e){var r,n=e.sessionId,i=e.event,o=e.deviceId;(r=this.managers.get(i.type))===null||r===void 0||r.addEvent({sessionId:n,event:i,deviceId:o})},t.prototype.sendCurrentSequenceEvents=function(e){var r=e.sessionId,n=e.deviceId;this.managers.forEach(function(i){i.sendCurrentSequenceEvents({sessionId:r,deviceId:n})})},t.prototype.flush=function(e){return I(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return r=[],this.managers.forEach(function(i){r.push(i.flush(e))}),[4,Promise.all(r)];case 1:return n.sent(),[2]}})})},t})(),X,Bt,cn;function Jo(t,e){if(cn=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";var r={root:document.body,idName:function(o){return!0},className:function(o){return!0},tagName:function(o){return!0},attr:function(o,s){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};X=D(D({},r),e),Bt=es(X.root,r);var n=xe(t,"all",function(){return xe(t,"two",function(){return xe(t,"one",function(){return xe(t,"none")})})});if(n){var i=vn(gn(n,t));return i.length>0&&(n=i[0]),Je(n)}else throw new Error("Selector was not found.")}function es(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function xe(t,e,r){for(var n=null,i=[],o=t,s=0,a=function(){var c,u,f=new Date().getTime()-cn.getTime();if(X.timeoutMs!==void 0&&f>X.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(f,"ms"));var d=Fe(ts(o))||Fe.apply(void 0,ee([],z(rs(o)),!1))||Fe.apply(void 0,ee([],z(ns(o)),!1))||Fe(is(o))||[Er()],p=os(o);if(e=="all")p&&(d=d.concat(d.filter(at).map(function(h){return Ne(h,p)})));else if(e=="two")d=d.slice(0,1),p&&(d=d.concat(d.filter(at).map(function(h){return Ne(h,p)})));else if(e=="one"){var v=z(d=d.slice(0,1),1),g=v[0];p&&at(g)&&(d=[Ne(g,p)])}else e=="none"&&(d=[Er()],p&&(d=[Ne(d[0],p)]));try{for(var m=(c=void 0,H(d)),y=m.next();!y.done;y=m.next()){var g=y.value;g.level=s}}catch(h){c={error:h}}finally{try{y&&!y.done&&(u=m.return)&&u.call(m)}finally{if(c)throw c.error}}if(i.push(d),i.length>=X.seedMinLength&&(n=Sr(i,r),n))return"break";o=o.parentElement,s++};o;){var l=a();if(l==="break")break}return n||(n=Sr(i,r)),!n&&r?r():n}function Sr(t,e){var r,n,i=vn(fn(t));if(i.length>X.threshold)return e?e():null;try{for(var o=H(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(dn(a))return a}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function Je(t){for(var e=t[0],r=e.name,n=1;n<t.length;n++){var i=t[n].level||0;e.level===i-1?r="".concat(t[n].name," > ").concat(r):r="".concat(t[n].name," ").concat(r),e=t[n]}return r}function br(t){return t.map(function(e){return e.penalty}).reduce(function(e,r){return e+r},0)}function dn(t){var e=Je(t);switch(Bt.querySelectorAll(e).length){case 0:throw new Error("Can't select any node with this selector: ".concat(e));case 1:return!0;default:return!1}}function ts(t){var e=t.getAttribute("id");return e&&X.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function rs(t){var e=Array.from(t.attributes).filter(function(r){return X.attr(r.name,r.value)});return e.map(function(r){return{name:"[".concat(CSS.escape(r.name),'="').concat(CSS.escape(r.value),'"]'),penalty:.5}})}function ns(t){var e=Array.from(t.classList).filter(X.className);return e.map(function(r){return{name:"."+CSS.escape(r),penalty:1}})}function is(t){var e=t.tagName.toLowerCase();return X.tagName(e)?{name:e,penalty:2}:null}function Er(){return{name:"*",penalty:3}}function os(t){var e=t.parentNode;if(!e)return null;var r=e.firstChild;if(!r)return null;for(var n=0;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==t);)r=r.nextSibling;return n}function Ne(t,e){return{name:t.name+":nth-child(".concat(e,")"),penalty:t.penalty+1}}function at(t){return t.name!=="html"&&!t.name.startsWith("#")}function Fe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.filter(ss);return r.length>0?r:null}function ss(t){return t!=null}function fn(t,e){var r,n,i,o,s,a;return e===void 0&&(e=[]),w(this,function(l){switch(l.label){case 0:if(!(t.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),r=H(t[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(i=n.value,[5,H(fn(t.slice(1,t.length),e.concat(i)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),s={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}
3return[7];case 8:return[3,11];case 9:return[4,e];case 10:l.sent(),l.label=11;case 11:return[2]}})}function vn(t){return ee([],z(t),!1).sort(function(e,r){return br(e)-br(r)})}function gn(t,e,r){var n,i,o;return r===void 0&&(r={counter:0,visited:new Map}),w(this,function(s){switch(s.label){case 0:if(!(t.length>2&&t.length>X.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<t.length-1?r.counter>X.maxNumberOfTries?[2]:(r.counter+=1,i=ee([],z(t),!1),i.splice(n,1),o=Je(i),r.visited.has(o)?[2]:dn(i)&&as(i,e)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,H(gn(i,e,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}})}function as(t,e){return Bt.querySelector(Je(t))===e}var ls=36e5,us=function(t){var e=t.version,r=t.events,n=[];return r.forEach(function(i){var o=JSON.parse(i);o.count=1,o.type==="click"&&n.push(o)}),{version:e,events:n}},cs=function(t){var e=t.version,r=t.events,n=[];r.forEach(function(o){var s=JSON.parse(o);s.type==="click"&&n.push(s)});var i=n.reduce(function(o,s){var a=s.x,l=s.y,c=s.selector,u=s.timestamp,f=u-u%ls,d="".concat(a,":").concat(l,":").concat(c??"",":").concat(f);return o[d]?o[d].count+=1:o[d]=D(D({},s),{timestamp:f,count:1}),o},{});return{version:e,events:Object.values(i)}},ds=(function(){function t(e,r){var n=this;this.createHook=function(i){var o=i.eventsManager,s=i.sessionId,a=i.deviceIdFn,l=i.mirror,c=i.ugcFilterRules,u=i.performanceOptions;return function(f){if(f.type===en.Click){var d=q();if(d){var p=d.location,v=d.innerHeight,g=d.innerWidth;if(p){var m=f.x,y=f.y;if(!(m===void 0||y===void 0)){var h=l.getNode(f.id),S;if(h)try{S=Jo(h,u)}catch{n.logger.debug("error resolving selector from finder")}var b=Xe(p.href,c),C={x:m+n.scrollWatcher.currentScrollX,y:y+n.scrollWatcher.currentScrollY,selector:S,viewportHeight:v,viewportWidth:g,pageUrl:b,timestamp:Date.now(),type:"click"},R=a();R&&o.addEvent({sessionId:s,event:{type:"interaction",data:JSON.stringify(C)},deviceId:R})}}}}}},this.logger=e,this.scrollWatcher=r}return t})();function lt(){var t=q();return t?.innerHeight||document.documentElement&&document.documentElement.clientHeight||0}function ut(){var t=q();return t?.innerWidth||document.documentElement&&document.documentElement.clientWidth||0}var fs=(function(){function t(e,r){var n=q();n&&n.navigator&&typeof n.navigator.sendBeacon=="function"?this.sendBeacon=function(i,o){try{if(n.navigator.sendBeacon(i,JSON.stringify(o)))return!0}catch{}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(i,o){var s=new XMLHttpRequest;return s.open("POST",i,!0),s.setRequestHeader("Accept","*/*"),s.send(JSON.stringify(o)),!0},this.basePageUrl=xt(r.serverZone,r.trackServerUrl),this.apiKey=r.apiKey,this.context=e}return t.prototype.send=function(e,r){var n=this.context,i=n.sessionId,o=n.type,s=new URLSearchParams({device_id:e,session_id:String(i),type:String(o),api_key:this.apiKey}),a="".concat(this.basePageUrl,"?").concat(s.toString());this.sendBeacon(a,r)||this.sendXhr(a,r)},t})(),vs=(function(){function t(e,r){var n=this;this.timestamp=Date.now(),this.hook=function(i){n.update(i)},this.send=function(i){return function(o){var s,a,l,c,u=i(),f=q();if(f&&u){var d=(s=f.scrollX)!==null&&s!==void 0?s:0,p=(a=f.scrollY)!==null&&a!==void 0?a:0;(d>0||p>0)&&n.update({id:1,x:d,y:p}),n.transport.send(u,{version:1,events:[{maxScrollX:n._maxScrollX,maxScrollY:n._maxScrollY,maxScrollWidth:n._maxScrollWidth,maxScrollHeight:n._maxScrollHeight,viewportHeight:lt(),viewportWidth:ut(),pageUrl:Xe(f.location.href,(c=(l=n.config.interactionConfig)===null||l===void 0?void 0:l.ugcFilterRules)!==null&&c!==void 0?c:[]),timestamp:n.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=ut(),this._maxScrollHeight=lt(),this.config=r,this.transport=e}return t.default=function(e,r){return new t(new fs(e,r),r)},Object.defineProperty(t.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScrollY",{get:function(){return this._maxScrollY}
3,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),t.prototype.update=function(e){var r=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var n=ut();this._maxScrollX=e.x;var i=e.x+n;i>this._maxScrollWidth&&(this._maxScrollWidth=i),this.timestamp=r}if(e.y>this._maxScrollY){var o=lt();this._maxScrollY=e.y;var s=e.y+o;s>this._maxScrollHeight&&(this._maxScrollHeight=s),this.timestamp=r}},t})(),wr=(function(){function t(e){var r=e.sessionId,n=e.deviceId;this.deviceId=n,this.sessionId=r,r&&n&&(this.sessionReplayId=io(r,n))}return t})(),gs=1e3*60*60*24*2,hs=(function(){function t(){var e=this;this.dbs={},this.createStore=function(r){return I(e,void 0,void 0,function(){return w(this,function(n){switch(n.label){case 0:return[4,an(r,1,{upgrade:function(i){i.objectStoreNames.contains("sessionTargetingMatch")||i.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,n.sent()]}})})},this.openOrCreateDB=function(r){return I(e,void 0,void 0,function(){var n,i;return w(this,function(o){switch(o.label){case 0:return this.dbs&&this.dbs[r]?[2,this.dbs[r]]:(n="".concat(r.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(n)]);case 1:return i=o.sent(),this.dbs[r]=i,[2,i]}})})},this.getTargetingMatchForSession=function(r){var n=r.loggerProvider,i=r.apiKey,o=r.sessionId;return I(e,void 0,void 0,function(){var s,a,l,c;return w(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),[4,this.openOrCreateDB(i)];case 1:return s=u.sent(),a=String(o),[4,s.get("sessionTargetingMatch",a)];case 2:return l=u.sent(),[2,l?.targetingMatch];case 3:return c=u.sent(),ne(n,"Failed to get targeting match for session id ".concat(o,": ").concat(c),c),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(r){var n=r.loggerProvider,i=r.apiKey,o=r.sessionId,s=r.targetingMatch;return I(e,void 0,void 0,function(){var a,l,c,u;return w(this,function(f){switch(f.label){case 0:return f.trys.push([0,3,,4]),[4,this.openOrCreateDB(i)];case 1:return a=f.sent(),l=String(o),[4,a.put("sessionTargetingMatch",{targetingMatch:s,sessionId:l,lastUpdated:Date.now()})];case 2:return c=f.sent(),[2,c];case 3:return u=f.sent(),ne(n,"Failed to store targeting match for session id ".concat(o,": ").concat(u),u),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(r){var n=r.loggerProvider,i=r.apiKey,o=r.currentSessionId;return I(e,void 0,void 0,function(){var s,a,l,c,u,f,d,p;return w(this,function(v){switch(v.label){case 0:return v.trys.push([0,8,,9]),[4,this.openOrCreateDB(i)];case 1:return s=v.sent(),a=String(o),l=s.transaction("sessionTargetingMatch","readwrite"),[4,l.store.getAll()];case 2:c=v.sent(),u=0,v.label=3;case 3:return u<c.length?(f=c[u],d=Date.now()-f.lastUpdated,f.sessionId!==a&&d>gs?[4,l.store.delete(f.sessionId)]:[3,5]):[3,6];case 4:v.sent(),v.label=5;case 5:return u++,[3,3];case 6:return[4,l.done];case 7:return v.sent(),[3,9];case 8:return p=v.sent(),ne(n,"Failed to clear old targeting matches for sessions: ".concat(p),p),[3,9];case 9:return[2]}})})}}return t})(),ct=new hs,ps=function(t){var e=t.sessionId,r=t.targetingConfig,n=t.loggerProvider,i=t.apiKey,o=t.targetingParams,s=t.urlChange,a=s===void 0?!1:s;return I(void 0,void 0,void 0,function(){var l,c,u,f,d,p,v;return w(this,function(g){switch(g.label){case 0:return[4,ct.clearStoreOfOldSessions({loggerProvider:n,apiKey:i,currentSessionId:e})];case 1:return g.sent(),[4,ct.getTargetingMatchForSession({loggerProvider:n,apiKey:i,sessionId:e})];case 2:if(l=g.sent(),l===!0&&!a)return[2,!0];c=!0,g.label=3;case 3:return g.trys.push([3,6,,7]),[4,Ie(()=>import("./index.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)];case 4:return u=g.sent().evaluateTargeting,f=D(D({},o),{flag:r,sessionId:typeof e=="string"?parseInt(e,10):e,apiKey:i,loggerProvider:n}),[4,u(f)];case 5:return d=g.sent(),d&&d.sr_targeting_config&&(c=d.sr_targeting_config.key==="on"),ct.storeTargetingMatchForSession({loggerProvider:n,apiKey:i,sessionId:e,targetingMatch:c}),[3,7];case 6:return p=g.sent(),v=p,n.warn(v.message),[3,7];case 7:return[2,c]}})})},Ge=2654435761,Ve=2246822519,Ir=3266489917,ms=668265263,Cr=374761393;function fe(t,e){return(t<<e|t>>>32-e)>>>0}function Be(t,e){return t=t+Math.imul(e,Ve)>>>0,t=fe(t,13),t=Math.imul(t,Ge)>>>0,t}function we(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function ys(t){for(var e=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<t.length){var i=t.charCodeAt(r+1);i>=56320&&i<=57343&&(n=(n-55296<<10)+(i-56320)+65536,r++)}n<128?e.push(n):n<2048?e.push(192|n>>6,128|n&63):n<65536?e.push(224|n>>12,128|n>>6&63,128|n&63):e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|n&63)}return new Uint8Array(e)}function Ss(t,e){e===void 0&&(e=0);var r=ys(t),n=r.length,i,o=0;if(n>=16){for(var s=e+Ge+Ve>>>0,a=e+Ve>>>0,l=e>>>0,c=e-Ge>>>0;o<=n-16;)s=Be(s,we(r,o)),o+=4,a=Be(a,we(r,o)),o+=4,l=Be(l,we(r,o)),o+=4,c=Be(c,we(r,o)),o+=4;i=fe(s,1)+fe(a,7)+fe(l,12)+fe(c,18)>>>0}else i=e+Cr>>>0;for(i=i+n>>>0;o<=n-4;)i=i+Math.imul(we(r,o),Ir)>>>0,i=Math.imul(fe(i,17),ms)>>>0,o+=4;for(;o<n;)i=i+Math.imul(r[o],Cr)>>>0,i=Math.imul(fe(i,11),Ge)>>>0,o++;return i^=i>>>15,i=Math.imul(i,Ve)>>>0,i^=i>>>13,i=Math.imul(i,Ir)>>>0,i^=i>>>16,i>>>0}function bs(t,e){var r=Ss(t.toString()),n=r%1e6;return n/1e6<e}var dt="__amplitude_url_tracking_patched__",Rr=new WeakMap;function hn(t,e,r){if(r===void 0&&(r={}),!t?.location)return function(){};var n=r.enablePolling,i=n===void 0?!1:n,o=r.pollingInterval,s=o===void 0?Ut:o;if(i){var a=function(){var b;return(b=t.location.href)!==null&&b!==void 0?b:""},l=a(),c=t.setInterval(function(){var b=a();b!==l&&(l=b,e(b))},s);return function(){c!=null&&t.clearInterval(c)}}var u=Rr.get(t);if(!u){var f=void 0,d=new Set,p=function(){var b;return(b=t.location.href)!==null&&b!==void 0?b:""},v=function(){var b=p();f!==void 0&&b===f||(f=b,d.forEach(function(C){return C(b)}))},g=function(b){var C=function(){for(var R=[],A=0;A<arguments.length;A++)R[A]=arguments[A];var E=b.apply(this,R);return v(),E};return C[dt]=!0,C},m=t.history;if(m?.pushState){var y=Reflect.get(m,"pushState");y[dt]||(m.pushState=g(y))}if(m?.replaceState){var h=Reflect.get(m,"replaceState");h[dt]||(m.replaceState=g(h))}u={callbacks:d,notify:v,onPopStateOrHashChange:function(){return v()},listenersAttached:!1},Rr.set(t,u)}var S=u;return S.listenersAttached||(t.addEventListener("popstate",S.onPopStateOrHashChange),t.addEventListener("hashchange",S.onPopStateOrHashChange),S.listenersAttached=!0),S.callbacks.add(e),function(){S.callbacks.delete(e),S.callbacks.size===0&&S.listenersAttached&&(t.removeEventListener("popstate",S.onPopStateOrHashChange),t.removeEventListener("hashchange",S.onPopStateOrHashChange),S.listenersAttached=!1)}}function pn(t){return t===void 0&&(t={}),{name:"amplitude/url-tracking@1",observer:function(e,r,n){var i,o,s,a=D(D({},t),n),l=a.ugcFilterRules||[],c=(i=a.enablePolling)!==null&&i!==void 0?i:!1,u=(o=a.pollingInterval)!==null&&o!==void 0?o:Ut,f=(s=a.captureDocumentTitle)!==null&&s!==void 0?s:!1;if(!r)return function(){};var d=void 0,p=function(){return r.location&&r.location.href||""}
3,v=function(){var y=r.innerHeight,h=r.innerWidth,S=r.document,b=p(),C="";f&&(C=S?.title||"");var R=l.length>0?Xe(b,l):b;return{href:R,title:C,viewportHeight:y,viewportWidth:h,type:"url-change-event"}},g=function(){var y=p();if(d===void 0||y!==d){d=y;var h=v();e(h)}},m=hn(r,function(){return g()},c?{enablePolling:!0,pollingInterval:u}:{});return g(),function(){return m()}},options:t}}pn();var Es=(function(){function t(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.urlChangeCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(r){var n=q();n&&(n.removeEventListener("blur",e.blurListener),n.removeEventListener("focus",e.focusListener),!r&&n.addEventListener("blur",e.blurListener),!r&&n.addEventListener("focus",e.focusListener),n.self&&"onpagehide"in n.self?(n.removeEventListener("pagehide",e.pageLeaveListener),!r&&n.addEventListener("pagehide",e.pageLeaveListener)):(n.removeEventListener("beforeunload",e.pageLeaveListener),!r&&n.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){e.recordEvents(!1)},this.pageLeaveListener=function(r){e.pageLeaveFns.forEach(function(n){n(r)})},this.evaluateTargetingAndCapture=function(r,n,i,o){return n===void 0&&(n=!1),i===void 0&&(i=!1),o===void 0&&(o=!1),I(e,void 0,void 0,function(){var s,a,l,c,u,f,d,p,v,g,m,y,h;return w(this,function(S){switch(S.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig)if(n)this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.");else return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];return this.lastTargetingParams=r,s=this.config.targetingConfig,a=s&&!this.sessionTargetingMatch,a?(l=o?this.latestUrlChangeTargetingEvaluationId:void 0,c=r.event,c&&Object.values(gt).includes(c.event_type)&&(c=void 0),u=(y=(v=(p=r.page)===null||p===void 0?void 0:p.url)!==null&&v!==void 0?v:(m=(g=q())===null||g===void 0?void 0:g.location)===null||m===void 0?void 0:m.href)!==null&&y!==void 0?y:"",f=(h=r.page)!==null&&h!==void 0?h:u!==""?{url:u}:void 0,[4,ps({sessionId:this.identifiers.sessionId,targetingConfig:s,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:r.userProperties,event:c,page:f},urlChange:o})]):[3,2];case 1:if(d=S.sent(),o&&l!==void 0&&l!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(l,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||d,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:c,targetingParams:r},null,2)),S.label=2;case 2:return n?(this.initialize(!0),[3,5]):[3,3];case 3:return i||!this.recordCancelCallback?(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]):[3,5];case 4:S.sent(),S.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i=!0),I(e,void 0,void 0,function(){var o,s,a,l;return w(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),o=void 0,s=this.config,s&&r!==le.METADATA?(o={config:Xr(s),version:It},i?[4,Qr()]:[3,2]):[3,2];case 1:a=c.sent(),o=D(D({},a),o),c.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(r,D(D({},n),o)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(r," due to no ongoing recording.")),[3,4];case 3:return l=c.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",l),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var r;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,(r=e.networkObservers)===null||r===void 0||r.stop()}catch(i){var n=i;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(n.toString()))}},this.loggerProvider=new mt(new We)}return t.prototype.init=function(e,r){return rr(this._init(e,r))},t.prototype.setupUrlChangeListenerForTargeting=function(){var e=this,r;(r=this.urlChangeCleanup)===null||r===void 0||r.call(this);var n=q();if(n?.location){var i=function(s){var a=++e.latestUrlChangeTargetingEvaluationId;e.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:s}}
vendor: 10,909 bytes, line 3
3,!1,!1,!0),e.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(a," for ").concat(s,"."))},o=hn(n,i);this.urlChangeCleanup=function(){o(),e.urlChangeCleanup=null}}},t.prototype.getCurrentPageForTargeting=function(){var e,r,n=(r=(e=q())===null||e===void 0?void 0:e.location)===null||r===void 0?void 0:r.href;return n!=null?{url:n}:void 0},t.prototype._init=function(e,r){var n,i,o,s,a,l,c,u;return I(this,void 0,void 0,function(){var f,d,p,v,g,m,y,h,S,b,E,C,R,A,E,_,T,U,L;return w(this,function(P){switch(P.label){case 0:return(n=this.urlChangeCleanup)===null||n===void 0||n.call(this),this.loggerProvider=new mt(r.loggerProvider||new We),Object.prototype.hasOwnProperty.call(r,"logLevel")&&this.loggerProvider.enable(r.logLevel),this.identifiers=new wr({sessionId:r.sessionId,deviceId:r.deviceId}),f=this,[4,go(e,r)];case 1:return f.joinedConfigGenerator=P.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:d=P.sent(),p=d.joinedConfig,v=d.localConfig,g=d.remoteConfig,this.config=p,this.setMetadata(r.sessionId,p,v,g,(i=r.version)===null||i===void 0?void 0:i.version,It,(o=r.version)===null||o===void 0?void 0:o.type),r.sessionId&&(!((s=this.config.interactionConfig)===null||s===void 0)&&s.enabled)&&(m=vs.default({sessionId:r.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[m.send(this.getDeviceId.bind(this)).bind(m)],this.scrollHook=m.hook.bind(m),this.clickHandler=new ds(this.loggerProvider,m)),y=[],h=this.config.storeType,h==="idb"&&!(!((a=q())===null||a===void 0)&&a.indexedDB)&&(h="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(h," for event storage.")),P.label=3;case 3:return P.trys.push([3,5,,6]),[4,mr({config:this.config,type:"replay",storeType:h})];case 4:return S=P.sent(),y.push({name:"replay",manager:S}),[3,6];case 5:return b=P.sent(),E=b,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(E.toString())),[3,6];case 6:if(!(!((l=this.config.interactionConfig)===null||l===void 0)&&l.enabled))return[3,10];C=this.config.interactionConfig.batch?cs:us,P.label=7;case 7:return P.trys.push([7,9,,10]),[4,mr({config:this.config,type:"interaction",minInterval:(c=this.config.interactionConfig.trackEveryNms)!==null&&c!==void 0?c:Yi,maxInterval:Qi,payloadBatcher:C,storeType:h})];case 8:return R=P.sent(),y.push({name:"interaction",manager:R}),[3,10];case 9:return A=P.sent(),E=A,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(E.toString())),[3,10];case 10:return this.eventsManager=new(yr.bind.apply(yr,ee([void 0],z(y),!1))),this.eventCompressor&&this.eventCompressor.terminate(),_=void 0,T=q(),this.config.useWebWorker&&T&&T.Worker?[4,Ie(()=>import("./index2.js"),[],import.meta.url)]:[3,12];case 11:U=P.sent().compressionScript,_=U,P.label=12;case 12:return this.eventCompressor=new ko(this.eventsManager,this.config,this.getDeviceId(),_),[4,this.initializeNetworkObservers()];case 13:return P.sent(),!((u=q())===null||u===void 0)&&u.opener&&(L=Bi(),Ki(L),L.setup(D({logger:this.loggerProvider},this.config.serverZone&&{endpoint:Mi[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:r.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 14:return P.sent(),this.config.targetingConfig&&this.setupUrlChangeListenerForTargeting(),[2]}})})},t.prototype.setSessionId=function(e,r){return rr(this.asyncSetSessionId(e,r))},t.prototype.asyncSetSessionId=function(e,r,n){var i;return I(this,void 0,void 0,function(){var o,s,a;return w(this,function(l){switch(l.label){case 0:return this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,o=this.identifiers&&this.identifiers.sessionId,o&&this.sendEvents(o),s=r||this.getDeviceId(),this.identifiers=new wr({sessionId:e,deviceId:s}),this.joinedConfigGenerator&&o?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:a=l.sent().joinedConfig,this.config=a,l.label=2;case 2:return!((i=this.config)===null||i===void 0)&&i.targetingConfig?[4,this.evaluateTargetingAndCapture({userProperties:n?.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return l.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:l.sent(),l.label=6;case 6:return[2]}})})},t.prototype.getSessionReplayProperties=function(){var e,r=this.config,n=this.identifiers;if(!r||!n)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var i=this.getShouldRecord(),o={};return i&&(o=(e={},e[qi]=n.sessionReplayId?n.sessionReplayId:null,e),r.debugMode&&(o[zi]=JSON.stringify({appHash:nr(r.apiKey).toString()}))),this.addCustomRRWebEvent(le.GET_SR_PROPS,{shouldRecord:i,eventProperties:o},this.eventCount===10),this.eventCount===10&&(this.eventCount=0),this.eventCount++,o},t.prototype.sendEvents=function(e){var r,n=e||((r=this.identifiers)===null||r===void 0?void 0:r.sessionId),i=this.getDeviceId();this.eventsManager&&n&&i&&this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:i})},t.prototype.initialize=function(e){var r;return e===void 0&&(e=!1),I(this,void 0,void 0,function(){var n;return w(this,function(i){return!((r=this.identifiers)===null||r===void 0)&&r.sessionId?(n=this.getDeviceId(),n?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:n}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()])):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},t.prototype.shouldOptOut=function(){var e,r,n;if(!((e=this.config)===null||e===void 0)&&e.instanceName){var i=wi(this.config.instanceName).identityStore;n=i.getIdentity().optOut}return n!==void 0?n:(r=this.config)===null||r===void 0?void 0:r.optOut},t.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e=!1,r="",n=!1;if(this.config.targetingConfig)this.sessionTargetingMatch?(r="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(r),e=!0,n=!0):(r="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(r),e=!1,n=!1);else{var i=bs(this.identifiers.sessionId,this.config.sampleRate);i?(e=!0,n=!0):(r="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(r),e=!1,n=!1)}return this.lastShouldRecordDecision!==e&&this.config.targetingConfig&&(this.addCustomRRWebEvent(le.TARGETING_DECISION,{message:r,sessionId:this.identifiers.sessionId,matched:n,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=e),e},t.prototype.getBlockSelectors=function(){var e,r,n,i=(n=(r=(e=this.config)===null||e===void 0?void 0:e.privacyConfig)===null||r===void 0?void 0:r.blockSelector)!==null&&n!==void 0?n:[];if(i.length!==0)return i},t.prototype.getMaskTextSelectors=function(){var e,r,n,i;if(((r=(e=this.config)===null||e===void 0?void 0:e.privacyConfig)===null||r===void 0?void 0:r.defaultMaskLevel)==="conservative")return"*";var o=(i=(n=this.config)===null||n===void 0?void 0:n.privacyConfig)===null||i===void 0?void 0:i.maskSelector;if(o)return o},t.prototype.getRecordingPlugins=function(e){var r,n,i,o,s,a;return I(this,void 0,void 0,function(){var l,c,u,f;return w(this,function(d){switch(d.label){case 0:l=[];try{c=pn({ugcFilterRules:((n=(r=this.config)===null||r===void 0?void 0:r.interactionConfig)===null||n===void 0?void 0:n.ugcFilterRules)||[],enablePolling:((i=this.config)===null||i===void 0?void 0:i.enableUrlChangePolling)||!1,pollingInterval:(o=this.config)===null||o===void 0?void 0:o.urlChangePollingInterval,captureDocumentTitle:(s=this.config)===null||s===void 0?void 0:s.captureDocumentTitle}),l.push(c)}catch(p){this.loggerProvider.warn("Failed to create URL tracking plugin:",p)}if(!(!((a=e?.console)===null||a===void 0)&&a.enabled))return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Ie(()=>import("./rrweb-plugin-console-record.js"),[],import.meta.url)];case 2:return u=d.sent().getRecordConsolePlugin,l.push(u({level:e.console.levels})),[3,4];case 3:return f=d.sent(),this.loggerProvider.warn("Failed to load console plugin:",f),[3,4];case 4:return[2,l.length>0?l:void 0]}})})},t.prototype.getRecordFunction=function(){return I(this,void 0,void 0,function(){var e,r;return w(this,function(n){switch(n.label){case 0:if(this.recordFunction)return[2,this.recordFunction];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Ie(()=>import("./rrweb-record.js"),[],import.meta.url)];case 2:return e=n.sent().record,this.recordFunction=e,[2,e];case 3:return r=n.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",r),[2,null];case 4:return[2]}})})},t.prototype.recordEvents=function(e){var r,n,i,o,s,a,l,c;return e===void 0&&(e=!0),I(this,void 0,void 0,function(){var u,f,d,p,v,g,m,y,h,S,b,C,R,A,E,_,T=this;return w(this,function(U){switch(U.label){case 0:return u=this.config,f=this.getShouldRecord(),d=(r=this.identifiers)===null||r===void 0?void 0:r.sessionId,!f||!d||!u?[2]:(this.stopRecordingEvents(),[4,this.getRecordFunction()]);case 1:return p=U.sent(),p?[4,this.initializeNetworkObservers()]:[2];case 2:U.sent(),v=(n=u.loggingConfig)===null||n===void 0?void 0:n.network,g=xt(u.serverZone,u.trackServerUrl),m=[Wr,zr,jr,g],(i=this.networkObservers)===null||i===void 0||i.start(function(L){m.some(function(P){return L.url.startsWith(P)})||T.addCustomRRWebEvent(le.FETCH_REQUEST,L)},v),y=u.privacyConfig,h=u.interactionConfig,S=u.loggingConfig,b=h?.enabled?{mouseInteraction:this.eventsManager&&((o=this.clickHandler)===null||o===void 0?void 0:o.createHook({eventsManager:this.eventsManager,sessionId:d,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:(s=h.ugcFilterRules)!==null&&s!==void 0?s:[],performanceOptions:(a=u.performanceConfig)===null||a===void 0?void 0:a.interaction})),scroll:this.scrollHook}:{},C=h?.enabled&&h.ugcFilterRules?h.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(d,".")),U.label=3;
3case 3:return U.trys.push([3,5,,6]),R=this,A=p,_={emit:function(L){if(T.shouldOptOut()){T.loggerProvider.log("Opting session ".concat(d," out of recording due to optOut config.")),T.stopRecordingEvents(),T.sendEvents();return}L.type===Jr.Meta&&(L.data.href=Xe(L.data.href,C)),T.eventCompressor&&T.eventCompressor.enqueueEvent(L,d)},inlineStylesheet:u.shouldInlineStylesheet,hooks:b,maskAllInputs:!0,maskTextClass:Vr,blockClass:ji,blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:u.applyBackgroundColorToBlockedElements,maskInputFn:or("input",y),maskTextFn:or("text",y),maskAttributeFn:ro(y),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:(l=u.omitElementTags)===null||l===void 0?void 0:l.script,comment:(c=u.omitElementTags)===null||c===void 0?void 0:c.comment},errorHandler:function(L){var P=L;if(P.message.includes("insertRule")&&P.message.includes("CSSStyleSheet")||P._external_)throw P;return T.loggerProvider.warn("Error while capturing replay: ",P.toString()),!0}},[4,this.getRecordingPlugins(S)];case 4:return R.recordCancelCallback=A.apply(void 0,[(_.plugins=U.sent(),_)]),this.addCustomRRWebEvent(le.DEBUG_INFO),e&&this.addCustomRRWebEvent(le.METADATA,this.metadata),[3,6];case 5:return E=U.sent(),this.loggerProvider.warn("Failed to initialize session replay:",E),[3,6];case 6:return[2]}})})},t.prototype.getDeviceId=function(){var e;return(e=this.identifiers)===null||e===void 0?void 0:e.deviceId},t.prototype.getSessionId=function(){var e;return(e=this.identifiers)===null||e===void 0?void 0:e.sessionId},t.prototype.flush=function(e){var r;return e===void 0&&(e=!1),I(this,void 0,void 0,function(){return w(this,function(n){return[2,(r=this.eventsManager)===null||r===void 0?void 0:r.flush(e)]})})},t.prototype.shutdown=function(){var e;(e=this.urlChangeCleanup)===null||e===void 0||e.call(this),this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},t.prototype.mapSDKType=function(e){return e==="plugin"?"@amplitude/plugin-session-replay-browser":e==="segment"?"@amplitude/segment-session-replay-plugin":null},t.prototype.setMetadata=function(e,r,n,i,o,s,a){var l=e?.toString()?nr(e.toString()):void 0;this.metadata={joinedConfig:r,localConfig:n,remoteConfig:i,sessionId:e,hashValue:l,sampleRate:r.sampleRate,replaySDKType:this.mapSDKType(a),replaySDKVersion:o,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:s}},t.prototype.initializeNetworkObservers=function(){var e,r,n;return I(this,void 0,void 0,function(){var i,o;return w(this,function(s){switch(s.label){case 0:if(!(!((n=(r=(e=this.config)===null||e===void 0?void 0:e.loggingConfig)===null||r===void 0?void 0:r.network)===null||n===void 0)&&n.enabled&&!this.networkObservers))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,Ie(()=>import("./observers.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)];case 2:return i=s.sent().NetworkObservers,this.networkObservers=new i,[3,4];case 3:return o=s.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",o),[3,4];case 4:return[2]}})})},t})(),de=function(t){return function(){var e=t.config,r=e||Zr(),n=r.loggerProvider,i=r.logLevel;return{logger:n,logLevel:i}}},ws=function(){var t=new Es;return{init:ce(t.init.bind(t),"init",de(t)),evaluateTargetingAndCapture:ce(t.evaluateTargetingAndCapture.bind(t),"evaluateTargetingAndRecord",de(t)),setSessionId:ce(t.setSessionId.bind(t),"setSessionId",de(t)),getSessionId:ce(t.getSessionId.bind(t),"getSessionId",de(t)),getSessionReplayProperties:ce(t.getSessionReplayProperties.bind(t),"getSessionReplayProperties",de(t)),flush:ce(t.flush.bind(t),"flush",de(t)),shutdown:ce(t.shutdown.bind(t),"shutdown",de(t))}};const mn=ws();var Is=mn.init,Cs=mn.getSessionReplayProperties;const Ar="[Amplitude] Session Replay ID",Rs=()=>{const t=window.ALLBIRDS.settings.amplitude;if(window.ALLBIRDS.settings.amplitude.INITIALIZED!==!0){if(t.sessionReplayEnabled===!1||t.apiKey===void 0){k("[Allbirds pixel] - Amplitude - Session Replay not enabled",{amplitudeApiKey:t.apiKey,sessionReplayEnabled:t.sessionReplayEnabled});return}return new Promise(e=>{Le(async()=>{const r=xn();window.ALLBIRDS.OneTrust.hasPerformanceConsent()&&await Is(t.apiKey,{deviceId:r.anonymousId,optOut:!1,sampleRate:t.sessionReplaySampleRate,sessionId:window.rudderanalytics.get
3SessionId()}).promise;const i=Cs();setTimeout(()=>{const s=i?.[Ar];if(!s){ye("[Allbirds pixel] - Amplitude - [Amplitude] Session Replay ID - not found ",{sessionId:s},new Error("Session Replay ID not found"));return}const a=kr();kt({additionalTraits:{fbclid:a.fbclid,gclid:a.gclid,msclkid:a.msclkid,session_replay_session_id:s},email:null}),Nn(s),window.ALLBIRDS.settings.amplitude.INITIALIZED=!0,window.TrackJS&&s&&window.TrackJS.addMetadata(Ar,s),e()},500)},ke.AMPLITUDE_INIT_SESSION_REPLAY)})}},As=window.ALLBIRDS.environment.isUsStore||window.ALLBIRDS.environment.isUkStore;As&&Rs();En.registerPlugin(Lr);function Ps(){const{getFlag:t,reportExposure:e}=Ur(),r=rt(new Map),n=rt(new Map),i=rt(new Set);let o=!1;const s=()=>{const v=document.querySelectorAll("[data-amp-flag-key]"),g=new Set;return v.forEach(m=>{const y=m.getAttribute("data-amp-flag-key")?.toLowerCase(),h=m.getAttribute("data-amp-variant")?.toLowerCase();if(!y){ye("[Allbirds composable] - useAmpSectionVisibility - Section has data-amp-flag-key attribute but value is empty",{sectionId:m.getAttribute("data-section-id")});return}r.value.set(m,{flagKey:y,variant:h||null}),g.add(y)}),k("[Allbirds composable] - useAmpSectionVisibility - Found sections",{flagCount:g.size,flags:Array.from(g),sectionCount:v.length}),Array.from(g)},a=(v,g)=>{if(!g||g.status!==Oe.SUCCESS||!g.value)return!1;const m=r.value.get(v);if(m?.variant){const y=g.value?.toLowerCase(),h=m.variant.toLowerCase();if(y!==h)return k("[Allbirds composable] - useAmpSectionVisibility - Variant mismatch",{actualVariant:y,expectedVariant:h,flagKey:m.flagKey,sectionId:v.getAttribute("data-section-id")}),!1}return!0},l=v=>{const g=r.value.get(v);g&&requestAnimationFrame(()=>{v.classList.remove(Me),Lr.refresh(),k("[Allbirds composable] - useAmpSectionVisibility - Showing section",{flagKey:g.flagKey,sectionId:v.getAttribute("data-section-id"),variant:g.variant})})},c=(v,g="Flag not active")=>{const m=r.value.get(v);m&&(typeof Shopify<"u"&&Shopify.designMode||(v.classList.add(Me),k("[Allbirds composable] - useAmpSectionVisibility - Hiding section",{flagKey:m.flagKey,reason:g,sectionId:v.getAttribute("data-section-id")})))},u=v=>{if(n.value.has(v))return;const g=Qn(()=>t(v),m=>{if(!m)return;Array.from(r.value.entries()).filter(([,h])=>h.flagKey===v).forEach(([h])=>{m.status===Oe.SUCCESS?a(h,m)?l(h):c(h,"Flag active but variant mismatch"):m.status===Oe.ERROR&&c(h,"Flag error")}),m.status===Oe.SUCCESS&&!i.value.has(v)&&(i.value.add(v),e(v))},{immediate:!0});n.value.set(v,g)},f=async()=>{o||(o=!0,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",async()=>{await d()}):await d())},d=async()=>{try{const v=s();if(v.length===0){k("[Allbirds composable] - useAmpSectionVisibility - No Amplitude-enabled sections found");return}if(typeof Shopify<"u"&&Shopify.designMode){r.value.forEach((g,m)=>{m.classList.contains(Me)&&(m.classList.remove(Me),k("[Allbirds composable] - useAmpSectionVisibility - Showing section in design mode",{sectionId:m.getAttribute("data-section-id")}))}),k("[Allbirds composable] - useAmpSectionVisibility - Skipping flag initialization in design mode",{sectionCount:r.value.size});return}v.forEach(g=>{u(g)}),k("[Allbirds composable] - useAmpSectionVisibility - Initialized",{flagCount:v.length,sectionCount:r.value.size})}catch(v){te("[Allbirds composable] - useAmpSectionVisibility - Error initializing",{error:v.message},v)}};return{getRegisteredFlagKeys:()=>Array.from(new Set(Array.from(r.value.values()).map(v=>v.flagKey))),init:f}}class _s{constructor(){if(!Yn()){k("[Allbirds pixel] - Amplitude Experiment - Disabled (no deployment key)");return}this.initializeOnDOMReady()}async initializeFlags(){try{const{initializeFlags:e}=Ur(),{getRegisteredFlagKeys:r,init:n}=Ps();await n();const i=r(),o=window.ALLBIRDS?.page?.template||"",s=this.mapTemplateType(o),a={page_path:window.location.pathname};k("[Allbirds pixel] - Amplitude Experiment - Initializing flags",{context:a,domFlagKeys:i,templateType:s}),await e(s,i,a),k("[Allbirds pixel] - Amplitude Experiment - Initialization complete")}catch(e){te("[Allbirds pixel] - Amplitude Experiment - Error initializing",{error:e.message},e)}}initializeOnDOMReady(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{this.initializeFlags()},{once:!0}):this.initializeFlags()}mapTemplateType(e){return Ke[e.toUpperCase()]||e}}new _s;class Ts{constructor(){this.initializeOnDOMReady()}initialize(){try{const{init:e}=Xn();e(),k("[Allbirds pixel] - Product Section Visibility - Initialization complete")}catch(e){te("[Allbirds pixel] - Product Section Visibility - Error initializing",{error:e.message},e)}}initializeOnDOMReady(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{this.initialize()},{once:!0}):this.initialize()}}new Ts;const Pr=()=>{const t=window.ALLBIRDS?.page?.productDetailsPage?.product?.handle;if(!t||!window.ALLBIRDS?.page?.isProductTemplate)return;const{trackProductView:e}=Zn();e(t)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Pr,{once:!0}):Pr();const yn=({loggingKeyword:t="Not set",logicToExecuteFn:e,options:r={attempts:60,interval:1e3},validationFn:n})=>{const i=r.attempts,o=r.interval;let s=1;const a=setInterval(function(){n()?(e(),k(`[Allbirds utils] - Retry - on ${t} - available - after ${s} attempts`),clearInterval(a)):(s>i&&(clearInterval(a),te(`[Allbirds utils] - Retry - on ${t} - not available - after ${s} attempts`,{},new Error(`${t} is not available - after ${s} attempts`))),s++)},o)},Ls="#loop-returns-onstore-banner-container",ks=()=>{try{if(Fn()&&Bn()&&Kn()){const t=document.querySelector(Ls);t&&(t.classList.remove("hidden"),t.classList.add("inline-block"),document.body.classList.add("loop-returns-banner-visible"))}else document.body.classList.remove("loop-returns-banner-visible")}catch(t){te("[Allbirds lib] - loop-returns-onestore - Error while moving the banner to the container",{},t)}},Sn=()=>{yn({loggingKeyword:"window.LoopOnstore SDK",logicToExecuteFn:()=>{ks()},validationFn:()=>window?.LoopOnstore!==void 0&&typeof window?.LoopOnstore?.isActive=="function"})};document.addEventListener("Loop:Activated",()=>{Sn()});document.addEventListener("DOMContentLoaded",()=>{Sn()});const Ds=()=>window.ALLBIRDS?.settings?.gladly?.enabled||!1;let He,$e,Ye;
3const ft=t=>{_n({location:jt.LOCATIONS.CHAT_BUBBLE,name:t,type:jt.TYPES.BUTTON,url:window.location.href})},Ms=()=>{typeof He!="function"&&(He=window.Gladly.on(he.SIDEKICK_OPENED.GLADLY_EVENT_NAME,()=>{ft(he.SIDEKICK_OPENED.RUDDERSTACK_KEY_NAME)}),k("[Allbirds pixel] - Gladly - Subscribing to Gladly SDK event - sidekick:opened")),typeof $e!="function"&&($e=window.Gladly.on(he.CONVERSATION_STARTED.GLADLY_EVENT_NAME,()=>{ft(he.CONVERSATION_STARTED.RUDDERSTACK_KEY_NAME)}),k("[Allbirds pixel] - Gladly - Subscribing Gladly SDK event - conversation:started")),typeof Ye!="function"&&(Ye=window.Gladly.on(he.CAMPAIGN_TRIGGERED.GLADLY_EVENT_NAME,()=>{ft(he.CAMPAIGN_TRIGGERED.RUDDERSTACK_KEY_NAME)}),k("[Allbirds pixel] - Gladly - Subscribing Gladly SDK event - campaign:triggered"))},Os=()=>{yn({loggingKeyword:"window.Gladly SDK",logicToExecuteFn:()=>{Ms()},validationFn:()=>window.Gladly!==void 0&&typeof window.Gladly.on=="function"})};document.addEventListener("DOMContentLoaded",()=>{Ds()?Os():(typeof He=="function"&&typeof $e=="function"&&typeof Ye=="function"&&(He(),$e(),Ye(),ye("[Allbirds pixel] - Gladly - Unsubscribing all events because the Gladly SDK is disabled")),ye("[Allbirds pixel] - Gladly - Gladly SDK is disabled!"))});const Tt="[Allbirds pixel] - Wunderkind Page Load",Us=()=>{Gn(Vn())&&Ht()&&(Mr({emailHash:Ht()}),k(`${Tt} - onPageLoad - new session for already logged-in user - triggering logIn event`))},xs=()=>{Us()},Ns=()=>{document.addEventListener("DOMContentLoaded",()=>{k(`${Tt} - onPageLoad - page load event - Wunderkind settings status`,{wunderkindSettingsStatus:qn()}),Le(()=>{Dr(()=>{k(`${Tt} - onPageLoad - Wunderkind Tag or Pixel is ready`),xs()})},ke.WUNDERKIND_PAGE_LOAD)})};Or()&&Ns();const Te="[Allbirds pixel] - Shopify Account",Lt="allbirds-customer-account-first-time-after-logged-in",_r=()=>{window.sessionStorage.setItem(Lt,"false")},Tr=()=>{try{if(!Se())return window.sessionStorage.removeItem(Lt),!1;const e=window.sessionStorage.getItem(Lt);return!e}catch{return te(`${Te} - _isCustomerAccountFirstTimeAfterLoggedInOnThisSession - Error getting item from session storage`),!1}},Fs=()=>{kt({additionalTraits:{...zn({subscriptionSource:De.PLACEMENT.SHOPIFY_ACCOUNT,subscriptionStatus:$t()}),account_sign_up_date:Wn(new Date),registered_user:!0},email:Se()}),jn({messageMedium:De.MEDIUM.EMAIL,messageType:De.TYPE.ALL,optInStatus:$t(),placement:De.PLACEMENT.SHOPIFY_ACCOUNT}),k(`${Te} - onPageLoad - Rudderstack - customer account logged in and new session - triggering identifyUser and userMarketingPreference events`)},Bs=()=>{Mr({email:Se()}),k(`${Te} - onPageLoad - Wunderkind - customer account logged in and new session - triggering logIn event`)},Ks=()=>{document.addEventListener("DOMContentLoaded",()=>{k(`${Te} - onPageLoad - page load event - Shopify Account settings status`,{isShopifyAccountLoggedIn:!!Se()}),Le(()=>{if(Tr()&&(Fs(),!Or())){_r();return}Dr(()=>{k(`${Te} - onPageLoad - Wunderkind Tag or Pixel is ready`,{isShopifyAccountLoggedIn:!!Se()}),Tr()&&(Bs(),_r())})},ke.SHOPIFY_ACCOUNT_PAGE_LOAD)})};Se()&&Ks();export{I as _,w as a,D as b,q as g,an as o};

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.