1(()=>{var Mf=Object.defineProperty;var Sa=Object.getOwnPropertySymbols;var Uf=Object.prototype.hasOwnProperty,Hf=Object.prototype.propertyIsEnumerable;var Tn=(le,ne,Y)=>ne in le?Mf(le,ne,{enumerable:!0,configurable:!0,writable:!0,value:Y}):le[ne]=Y,wa=(le,ne)=>{for(var Y in ne||(ne={}))Uf.call(ne,Y)&&Tn(le,Y,ne[Y]);if(Sa)for(var Y of Sa(ne))Hf.call(ne,Y)&&Tn(le,Y,ne[Y]);return le};var rt=(le,ne,Y)=>Tn(le,typeof ne!="symbol"?ne+"":ne,Y);(function(){try{var le=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{},ne=new le.Error().stack;ne&&(le._sentryDebugIds=le._sentryDebugIds||{},le._sentryDebugIds[ne]="e63837d5-928c-460f-961b-dea4fa33f993",le._sentryDebugIdIdentifier="sentry-dbid-e63837d5-928c-460f-961b-dea4fa33f993")}catch(Y){}})();(self.webpackChunkdice_web=self.webpackChunkdice_web||[]).push([[3158],{16064:((le,ne,Y)=>{le.exports=Y(43619).Observable}),27366:((le,ne,Y)=>{"use strict";Y.r(ne),Y.d(ne,{AmplitudeBrowser:()=>Ea,Identify:()=>bt,Revenue:()=>jn,Types:()=>Ve,_setDiagnosticsSampleRate:()=>Of,add:()=>uf,createInstance:()=>_a,extendSession:()=>cf,flush:()=>lf,getDeviceId:()=>df,getIdentity:()=>ff,getOptOut:()=>vf,getSessionId:()=>hf,getUserId:()=>pf,groupIdentify:()=>gf,identify:()=>mf,init:()=>yf,logEvent:()=>bf,remove:()=>Ef,reset:()=>_f,revenue:()=>Tf,runQueuedFunctions:()=>Is,setDeviceId:()=>Sf,setGroup:()=>wf,setIdentity:()=>If,setOptOut:()=>Af,setSessionId:()=>Cf,setTransport:()=>Pf,setUserId:()=>kf,track:()=>Rf,trackVideo:()=>sf});var Ve={};Y.r(Ve),Y.d(Ve,{DEFAULT_ACTION_CLICK_ALLOWLIST:()=>Fi,DEFAULT_CSS_SELECTOR_ALLOWLIST:()=>Hi,DEFAULT_DATA_ATTRIBUTE_PREFIX:()=>zr,EXCLUDE_INTERNAL_REFERRERS_CONDITIONS:()=>cr,IdentifyOperation:()=>at,LogLevel:()=>ee,OfflineDisabled:()=>Yn,RevenueProperty:()=>je,ServerZone:()=>bn,SpecialEventType:()=>nt});var u=Y(31635),ee;(function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"})(ee||(ee={}));var de=function(e){e===void 0&&(e=0);var t=new Error().stack||"";return t.split(` 2`).slice(2+e).map(function(r){return r.trim()})},K=function(e){return function(){var t=(0,u.Cl)({},e.config),r=t.loggerProvider,n=t.logLevel;return{logger:r,logLevel:n}}},ge=function(e,t){var r,n;t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");try{for(var i=(0,u.Ju)(t.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(a in e)e=e[a];else return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},Z=function(e,t){return function(){var r,n,i={};try{for(var o=(0,u.Ju)(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=ge(e,s)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},re=function(e,t,r,n,i){return i===void 0&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=r(),l=s.logger,c=s.logLevel;if(c&&c<ee.Debug||!c||!l)return e.apply(i,o);var d={type:"invoke public method",name:t,args:o,stacktrace:de(1),time:{start:new Date().toISOString()},states:{}};n&&d.states&&(d.states.before=n());var f=e.apply(i,o);return f&&f.promise?f.promise.then(function(){n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))}):(n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))),f}},ae=function(e){return{promise:e||Promise.resolve()}},Ce=Y(96763),Ye="Amplitude Logger ",We=(function(){function e(){this.logLevel=ee.None}return e.prototype.disable=function(){this.logLevel=ee.None},e.prototype.enable=function(t){t===void 0&&(t=ee.Warn),this.logLevel=t},e.prototype.log=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.logLevel<ee.Verbose||Ce.log("".concat(Ye,"[Log]: ").concat(t.join(" ")))},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.logLevel<ee.Warn||Ce.warn("".concat(Ye,"[Warn]: ").concat(t.join(" ")))},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.logLevel<ee.Error||Ce.error("".concat(Ye,"[Error]: ").concat(t.join(" ")))},e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.logLevel<ee.Debug||Ce.log("".concat(Ye,"[Debug]: ").concat(t.join(" ")))},e})(),gt=(function(){function e(t,r){this.key="AMP_remote_config_".concat(t.substring(0,10)),this.logger=r}return e.prototype.fetchConfig=function(){var t=null,r={remoteConfig:null,lastFetch:new Date};try{t=localStorage.getItem(this.key)}catch(i){return this.logger.debug("Remote config localstorage failed to access: ",i),Promise.resolve(r)}if(t===null)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(r);try{var n=JSON.parse(t);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)}},e.prototype.setConfig=function(t){try{return localStorage.setItem(this.key,JSON.stringify(t)),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)},e})(),X=function(){var e="ampIntegrationContext";if(typeof globalThis!="undefined"&&typeof globalThis[e]!="undefined")return globalThis[e];if(typeof globalThis!="undefined")return globalThis;if(typeof window!="undefined")return window;if(typeof self!="undefined")return self;if(typeof Y.g!="undefined")return Y.g},ot=function(e){return e?(e^Math.random()*16>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,me)},et=(0,u.fX)([],(0,u.zs)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),me=function(e){var t,r=X();if(!(!((t=r==null?void 0:r.crypto)===null||t===void 0)&&t.getRandomValues))return ot(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=n[6]&15|64,n[8]=n[8]&63|128,(0,u.fX)([],(0,u.zs)(n.entries()),!1).map(function(i){var o=(0,u.zs)(i,2),a=o[0],s=o[1];return[4,6,8,10].includes(a)?"-".concat(et[s]):et[s]}).join("")},G="https://sr-client-cfg.amplitude.com/config",O="https://sr-client-cfg.eu.amplitude.com/config",B=3,F={INVALID_API_KEY:401,FORB
2IDDEN:403,RATE_LIMIT:429},N=1e3,te=300*1e3,Pe=(function(){function e(t,r,n,i){n===void 0&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=t,this.serverUrl=i||(n==="US"?G:O),this.logger=r,this.storage=new gt(t,r)}return e.prototype.subscribe=function(t,r,n){var i=me(),o={id:i,key:t,deliveryMode:r,callback:n};return this.callbackInfos.push(o),r==="all"?this.subscribeAll(o):this.subscribeWaitForRemote(o,r.timeout),i},e.prototype.unsubscribe=function(t){var r=this.callbackInfos.findIndex(function(n){return n.id===t});return r===-1?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(t," doesn't exist.")),!1):(this.callbackInfos.splice(r,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(t,".")),!0)},e.prototype.updateConfigs=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n=this;return(0,u.YH)(this,function(i){switch(i.label){case 0:return this.lastSuccessfulFetch&&(t=Date.now()-this.lastSuccessfulFetch,t<te)?(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]}})})},e.prototype.getOrCreateFetchPromise=function(){var t=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(){t.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(r){return r.remoteConfig!==null&&(t.lastSuccessfulFetch=Date.now()),r}).finally(function(){t.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o=this;return(0,u.YH)(this,function(a){switch(a.label){case 0:return r=this.getOrCreateFetchPromise().then(function(s){o.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(s))),o.sendCallback(t,s,"remote"),o.storage.setConfig(s)}),n=this.storage.fetchConfig().then(function(s){return s}),[4,Promise.race([r,n])];case 1:return i=a.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(t,i,"cache"):this.logger.debug("Remote config client skips sending c
2allback because cache is empty (first time user).")),[4,r];case 2:return a.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(t,r){return(0,u.sH)(this,void 0,void 0,function(){var n,o,i,o;return(0,u.YH)(this,function(a){switch(a.label){case 0:n=new Promise(function(s,l){setTimeout(function(){l("Timeout exceeded")},r)}),a.label=1;case 1:return a.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return o=a.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(t,o,"remote"),this.storage.setConfig(o),[3,5];case 3:return i=a.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 o=a.sent(),o.remoteConfig!==null?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(t,o,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(t,o,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(t,r,n){t.lastCallback=new Date;var i;t.key?i=t.key.split(".").reduce(function(o,a){return o===null?o:a in o?o[a]:null},r.remoteConfig):i=r.remoteConfig,t.callback(i,n,r.lastFetch)},e.prototype.fetch=function(t,r){return t===void 0&&(t=B),r===void 0&&(r=N),(0,u.sH)(this,void 0,void 0,function(){var n,i,o,a,s,l,c=this;return(0,u.YH)(this,function(d){switch(d.label){case 0:n=r/t,i={remoteConfig:null,lastFetch:new Date},o=function(f){var v,h,p,g,m,b,E;return(0,u.YH)(this,function(y){switch(y.label){case 0:v=!0,h=new AbortController,p=setTimeout(function(){return h.abort()},r),y.label=1;case 1:return y.trys.push([1,7,8,9]),[4,fetch(a.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:h.signal})];case 2:return g=y.sent(),g.ok?[3,4]:[4,g.text()];case 3:return m=y.sent(),a.logger.debug("Remote config client fetch with retry time ".concat(t," failed with ").concat(g.status,": ").concat(m)),g.status===F.INVALID_API_KEY||g.status===F.FORBIDDEN?(a.logger.error("Remote config client fetch failed with ".concat(g.status,". Invalid API key; future fetches will be skipped.")),a.isLastFetchInvalidApiKey=!0,v=!1):g.status>=400&&g.status<500&&g.status!==F.RATE_LIMIT&&(v=!1),[3,6];case 4:return[4,g.json()];case 5:return b=y.sent(),[2,{value:{remoteConfig:b,lastFetch:new Date}}];case 6:return[3,9];case 7:return E=y.sent(),E instanceof Error&&E.name==="AbortError"?a.logger.debug("Remote config client fetch with retry time ".concat(t," timed out after ").concat(r,"ms")):a.logger.debug("Remote config client fetch with retry time ".concat(t," is rejected because: "),E),[3,9];case 8:return clearTimeout(p),[7];case 9:return v?f<t-1?[4,new Promise(function(S){return setTimeout(S,c.getJitterDelay(n))})]:[3,11]:[2,"break"];case 10:y.sent(),y.label=11;case 11:return[2]}})},a=this,s=0,d.label=1;case 1:return s<t?[5,o(s)]:[3,4];case 2:if(l=d.sent(),typeof l=="object")return[2,l.value];if(l==="break")return[3,4];d.label=3;case 3:return s++,[3,1];case 4:return[2,i]}})})},e.prototype.getJitterDelay=function(t){return Math.floor(Math.random()*t)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e})(),pe=10,Ne=1,j={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},mt={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Jt=(function(){function e(t,r){this.dbPromise=null,this.logger=r,this.dbName="AMP_diagnostics_".concat(t.substring(0,10))}return e.isSupported=function(){var t;return((t=X())===null||t===void 0?void 0:t.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(t){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var t=this;return new Promise(function(r,n){var i=indexedDB.open(t.dbName,Ne);i.onerror=function(){t.dbPromise=null,n(new Error("Failed to open IndexedDB"))},i.onsuccess=function(){var o=i.result;
2o.onclose=function(){t.dbPromise=null,t.logger.debug("DiagnosticsStorage: DB connection closed.")},o.onerror=function(a){t.logger.debug("DiagnosticsStorage: A global database error occurred.",a),o.close()},r(o)},i.onupgradeneeded=function(o){var a=o.target.result;t.createTables(a)}})},e.prototype.createTables=function(t){if(t.objectStoreNames.contains(j.TAGS)||t.createObjectStore(j.TAGS,{keyPath:"key"}),t.objectStoreNames.contains(j.COUNTERS)||t.createObjectStore(j.COUNTERS,{keyPath:"key"}),t.objectStoreNames.contains(j.HISTOGRAMS)||t.createObjectStore(j.HISTOGRAMS,{keyPath:"key"}),!t.objectStoreNames.contains(j.EVENTS)){var r=t.createObjectStore(j.EVENTS,{keyPath:"id",autoIncrement:!0});r.createIndex("time_idx","time",{unique:!1})}t.objectStoreNames.contains(j.INTERNAL)||t.createObjectStore(j.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o,a=this;return(0,u.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([j.TAGS],"readwrite"),i=n.objectStore(j.TAGS),[2,new Promise(function(l){var c=Object.entries(t);n.oncomplete=function(){l()},n.onabort=function(d){a.logger.debug("DiagnosticsStorage: Failed to set tags",d),l()},c.forEach(function(d){var f=(0,u.zs)(d,2),v=f[0],h=f[1],p=i.put({key:v,value:h});p.onerror=function(g){a.logger.debug("DiagnosticsStorage: Failed to set tag",v,h,g)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",o),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o,a=this;return(0,u.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([j.COUNTERS],"readwrite"),i=n.objectStore(j.COUNTERS),[2,new Promise(function(l){var c=Object.entries(t);n.oncomplete=function(){l()},n.onabort=function(d){a.logger.debug("DiagnosticsStorage: Failed to increment counters",d),l()},c.forEach(function(d){var f=(0,u.zs)(d,2),v=f[0],h=f[1],p=i.get(v);p.onsuccess=function(){var g=p.result,m=g?g.value:0,b=i.put({key:v,value:m+h});b.onerror=function(E){a.logger.debug("DiagnosticsStorage: Failed to update counter",v,E)}},p.onerror=function(g){a.logger.debug("DiagnosticsStorage: Failed to read existing counter",v,g)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",o),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o,a=this;return(0,u.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([j.HISTOGRAMS],"readwrite"),i=n.objectStore(j.HISTOGRAMS),[2,new Promise(function(l){var c=Object.entries(t);n.oncomplete=function(){l()},n.onabort=function(d){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",d),l()},c.forEach(function(d){var f=(0,u.zs)(d,2),v=f[0],h=f[1],p=i.get(v);p.onsuccess=function(){var g=p.result,m;g?m={key:v,count:g.count+h.count,min:Math.min(g.min,h.min),max:Math.max(g.max,h.max),sum:g.sum+h.sum}:m={key:v,count:h.count,min:h.min,max:h.max,sum:h.sum};var b=i.put(m);b.onerror=function(E){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",v,E)}},p.onerror=function(g){a.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",v,g)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",o),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o,a=this;return(0,u.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),t.length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([j.EVENTS],"readwrite"),i=n.objectStore(j.EVENTS),[2,new Promise(function(l){n.oncomplete=function(){l()},n.onabort=function(d){a.logger.debug("DiagnosticsStorage: Failed to add event records",d),l()};var c=i.count();c.onsuccess=function(){var d=c.result,f=Math.max(0,pe-d);f<t.length&&a.logger.debug("DiagnosticsStorage: Only added ".concat(f," of ").concat(t.length," events due to storage limit")),t.slice(0,f).forEach(function(v){var h=i.add(v);h.onerror=function(p){a.logger.debug("DiagnosticsStorage: Failed to add event record",p)}})},c.onerror=function(d){a.logger.debug("DiagnosticsStorage: Failed to count existing events",d)}})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",o),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(t,r){return(0,u.sH)(this,void 0,void 0,function(){var n,i,o,a;return(0,u.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=s.sent(),i=n.transaction([j.INTERNAL],"readwrite"),o=i.objectStore(j.INT
2ERNAL),[2,new Promise(function(l,c){i.onabort=function(){return c(new Error("Failed to set internal value"))};var d=o.put({key:t,value:r});d.onsuccess=function(){return l()},d.onerror=function(){return c(new Error("Failed to set internal value"))}})];case 2:return a=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",a),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o;return(0,u.YH)(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=a.sent(),n=r.transaction([j.INTERNAL],"readonly"),i=n.objectStore(j.INTERNAL),[2,new Promise(function(s,l){n.onabort=function(){return l(new Error("Failed to get internal value"))};var c=i.get(t);c.onsuccess=function(){return s(c.result)},c.onerror=function(){return l(new Error("Failed to get internal value"))}})];case 2:return o=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",o),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r;return(0,u.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(mt.LAST_FLUSH_TIMESTAMP)];case 1:return t=n.sent(),[2,t?parseInt(t.value,10):void 0];case 2:return r=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",r),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r;return(0,u.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(mt.LAST_FLUSH_TIMESTAMP,t.toString())];case 1:return n.sent(),[3,3];case 2:return r=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",r),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(t,r){return new Promise(function(n,i){var o=t.objectStore(r),a=o.clear();a.onsuccess=function(){return n()},a.onerror=function(){return i(new Error("Failed to clear table ".concat(r)))}})},e.prototype.getAllAndClear=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i,o,a,s,l;return(0,u.YH)(this,function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),[4,this.getDB()];case 1:return t=c.sent(),r=t.transaction([j.TAGS,j.COUNTERS,j.HISTOGRAMS,j.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(r,j.TAGS),this.getAllFromStore(r,j.COUNTERS),this.getAllFromStore(r,j.HISTOGRAMS),this.getAllFromStore(r,j.EVENTS)])];case 2:return n=u.zs.apply(void 0,[c.sent(),4]),i=n[0],o=n[1],a=n[2],s=n[3],[4,Promise.all([this.clearTable(r,j.COUNTERS),this.clearTable(r,j.HISTOGRAMS),this.clearTable(r,j.EVENTS)])];case 3:return c.sent(),[2,{tags:i,counters:o,histogramStats:a,events:s}];case 4:return l=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",l),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(t,r){return new Promise(function(n,i){var o=t.objectStore(r),a=o.getAll();a.onsuccess=function(){return n(a.result)},a.onerror=function(){return i(new Error("Failed to get all from ".concat(r)))}})},e})(),$t=function(e){var t=0;if(e.length===0)return t;for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);t=(t<<5)-t+n,t|=0}return t},Sn=function(e,t){var r=$t(e.toString()),n=Math.abs(r),i=n*31,o=i%1e6;return o/1e6<t},Qt=function(e,t){var r=$t(e.toString()),n=Math.abs(r),i=n*31,o=i%1e5;return o/1e5<t},Zt="__AMPLITUDE_SCRIPT_URL__",Ir="sdk.error.uncaught",er=function(){var e=X();if(!e)return[];var t=e[Zt];return Array.isArray(t)?t:typeof t=="string"?[t]:[]},Ar=function(e){var t=getGlobalScope();if(t){var r=er();r.includes(e)||(r.push(e),t[Zt]=r)}},Ia=function(e){if(e.scriptUrl){var t=w(e.scriptUrl);t&&Ar(t)}},_=function(e){var t=X();if(!(!t||typeof t.addEventListener!="function")){var r=function(o){var a=o.error instanceof Error?o.error:void 0,s=a==null?void 0:a.stack,l=T({filename:o.filename,stack:s});l&&i({type:"error",message:o.message,stack:s,filename:o.filename,errorName:a==null?void 0:a.name,metadata:{colno:o.colno,lineno:o.lineno,isTrusted:o.isTrusted,matchReason:l}})},n=function(o){var a,s=o.reason instanceof Error?o.reason:void 0,l=s==null?void 0:s.stack,c=I(l),d=T({filename:c,stack:l});d&&i({type:"unhandledrejection",message:(a=s==null?void 0:s.message)!==null&&a!==void 0?a:k(o.reason),stack:l,filename:c,errorName:s==null?void 0:s.name,metadata:{isTrusted:o.isTrusted,matchReason:d}})},i=function(o){e.recordEvent(Ir,(0,u.Cl)({type:o.type,message:o.message,filename:o.filename,error_name:o.errorName,stack:o.stack},o.metadata))};t.addEventListener("error",r,!0),t.addEventListener("unhandledrejection",n,!0)}},T=function(e){var t,r,n=er();if(n.length!==0)try{for(var i=(0,u.Ju)(n),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.filename&&e.filename.includes(a))return"filename";if(e.stack&&e.stack.includes(a))return"stack"}}catch(s){t={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},w=function(e){var t,r;try{var n=new URL(e,(r=(t=getGlobalScope())===null||t===void 0?void 0:t.location)===null||r===void 0?void 0:r.origin);return n.origin+n.pathname}catch(i){return}},I=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},k=function(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch(t){return"[object Object]"}},P=1e3,V=300*1e3,ie="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",Ie="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",z=1e4,fe=10,Te=(function(){function e(t,r,n,i){n===void 0&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=t,this.logger=r,this.serverUrl=n==="US"?ie:Ie,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(i,null,2)),this.config=(0,u.Cl)({enabled:!0,sampleRate:0},i),this.startTimestamp=Date.now(),this.shouldTrack=Qt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Jt.isSupported()?this.storage=new Jt(t,r):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),_(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(t,r){if(this.isStorageAndTrackEnabled()){if
2(Object.keys(this.inMemoryTags).length>=z){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}this.inMemoryTags[t]=r,this.startTimersIfNeeded()}},e.prototype.increment=function(t,r){if(r===void 0&&(r=1),!!this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=z){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}this.inMemoryCounters[t]=(this.inMemoryCounters[t]||0)+r,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(t,r){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=z){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var n=this.inMemoryHistograms[t];n?(n.count+=1,n.min=Math.min(n.min,r),n.max=Math.max(n.max,r),n.sum+=r):this.inMemoryHistograms[t]={count:1,min:r,max:r,sum:r},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(t,r){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=fe){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}this.inMemoryEvents.push({event_name:t,time:Date.now(),event_properties:r}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var t=this;this.saveTimer||(this.saveTimer=setTimeout(function(){t.saveAllDataToStorage().catch(function(r){t.logger.debug("DiagnosticsClient: Failed to save all data to storage",r)}).finally(function(){t.saveTimer=null})},P)),this.flushTimer||(this.flushTimer=setTimeout(function(){t._flush().catch(function(r){t.logger.debug("DiagnosticsClient: Failed to flush",r)}).finally(function(){t.flushTimer=null})},V))},e.prototype.saveAllDataToStorage=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i;return(0,u.YH)(this,function(o){switch(o.label){case 0:return this.storage?(t=(0,u.Cl)({},this.inMemoryTags),r=(0,u.Cl)({},this.inMemoryCounters),n=(0,u.Cl)({},this.inMemoryHistograms),i=(0,u.fX)([],(0,u.zs)(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(t),this.storage.incrementCounters(r),this.storage.setHistogramStats(n),this.storage.addEventRecords(i)])]):[2];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i,o,a,s,l,c,d;return(0,u.YH)(this,function(f){switch(f.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return f.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return t=f.sent(),r=t.tags,n=t.counters,i=t.histogramStats,o=t.events,this.storage.setLastFlushTimestamp(Date.now()),a={},r.forEach(function(v){a[v.key]=v.value}),s={},n.forEach(function(v){s[v.key]=v.value}),l={},i.forEach(function(v){l[v.key]={count:v.count,min:v.min,max:v.max,avg:Math.round(v.sum/v.count*100)/100}}),c=o.map(function(v){return{event_name:v.event_name,time:v.time,event_properties:v.event_properties}}),Object.keys(s).length===0&&Object.keys(l).length===0&&c.length===0?[2]:(d={tags:a,histogram:l,counters:s,events:c},this.fetch(d),[2])}})})},e.prototype.fetch=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n;return(0,u.YH)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),!X())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return r=i.sent(),r.ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return n=i.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",n),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n;return(0,u.YH)(this,function(i){switch(i.label){case 0:return this.storage?(t=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return r=i.sent()||-1,r===-1?(this.storage.setLastFlushTimestamp(t),this._setFlushTimer(V),[2]):(n=t-r,n>=V?(this._flush(),[2]):(this._setFlushTimer(V-n),[2]))}})})},e.prototype._setFlushTimer=function(t){var r=this;this.flushTimer=setTimeout(function(){r._flush().catch(function(n){r.logger.debug("DiagnosticsClient: Failed to flush",n)}).finally(function(){r.flushTimer=null})},t)},e.prototype._setSampleRate=function(t){this.logger.debug("DiagnosticsClient: Setting sample rate to",t),this.config.sampleRate=t,this.shouldTrack=Qt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e})(),Ke=function(){var e,t=X();if(!(!((e=t==null?void 0:t.location)===null||e===void 0)&&e.search))return{};
2var r=t.location.search.substring(1).split("&").filter(Boolean),n=r.reduce(function(i,o){var a=o.split("=",2),s=oe(a[0]),l=oe(a[1]);return l&&(i[s]=l),i},{});return n},oe=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch(t){return""}},xe=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:He(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),He=function(){return typeof navigator!="undefined"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ge=(function(){function e(){this.queue=[]}return e.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},e.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach(function(r){t(r)}),this.queue=[])},e})(),ke=function(){return ke=Object.assign||function(t){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)&&(t[o]=r[o])}return t},ke.apply(this,arguments)};function tr(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function wn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}typeof SuppressedError=="function"&&SuppressedError;var rr=function(e,t){var r,n,i=["string","number","boolean","undefined"],o=typeof e,a=typeof t;if(o!==a)return!1;try{for(var s=tr(i),l=s.next();!l.done;l=s.next()){var c=l.value;if(c===o)return e===t}}catch(m){r={error:m}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var d=Array.isArray(e),f=Array.isArray(t);if(d!==f)return!1;if(d&&f){for(var v=0;v<e.length;v++)if(!rr(e[v],t[v]))return!1}else{var h=Object.keys(e).sort(),p=Object.keys(t).sort();if(!rr(h,p))return!1;var g=!0;return Object.keys(e).forEach(function(m){rr(e[m],t[m])||(g=!1)}),g}return!0},Aa="$set",Ca="$unset",Pa="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var ka=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,r=ke({},this.identity.userProperties),n=ke(ke({},this.identity),{userProperties:r});return{setUserId:function(i){return n.userId=i,this},setDeviceId:function(i){return n.deviceId=i,this},setUserProperties:function(i){return n.userProperties=i,this},setOptOut:function(i){return n.optOut=i,this},updateUserProperties:function(i){var o,a,s,l,c,d,f=n.userProperties||{};try{for(var v=tr(Object.entries(i)),h=v.next();!h.done;h=v.next()){var p=wn(h.value,2),g=p[0],m=p[1];switch(g){case Aa:try{for(var b=(s=void 0,tr(Object.entries(m))),E=b.next();!E.done;E=b.next()){var y=wn(E.value,2),S=y[0],A=y[1];f[S]=A}}catch(x){s={error:x}}finally{try{E&&!E.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}break;case Ca:try{for(var C=(c=void 0,tr(Object.keys(m))),D=C.next();!D.done;D=C.next()){var S=D.value;delete f[S]}}catch(x){c={error:x}}finally{try{D&&!D.done&&(d=C.return)&&d.call(C)}finally{if(c)throw c.error}}break;case Pa:f={};break}}}catch(x){o={error:x}}finally{try{h&&!h.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}return n.userProperties=f,this},commit:function(){return t.setIdentity(n),this}}},e.prototype.getIdentity=function(){return ke({},this.identity)},e.prototype.setIdentity=function(t){var r=ke({},this.identity);this.identity=ke({},t),rr(r,this.identity)||this.listeners.forEach(function(n){n(t)})},e.prototype.addIdentityListener=function(t){this.listeners.add(t)},e.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},e})(),Ot=typeof globalThis!="undefined"?globalThis:typeof Y.g!="undefined"?Y.g:self,Ra=(function(){function e(){this.identityStore=new ka,this.eventBridge=new Ge,this.applicationContextProvider=new xe}return e.getInstance=function(t){return Ot.analyticsConnectorInstances||(Ot.analyticsConnectorInstances={}),Ot.analyticsConnectorInstances[t]||(Ot.analyticsConnectorInstances[t]=new e),Ot.analyticsConnectorInstances[t]},e})(),In="-",nr="AMP",Oa="".concat(nr,"_unsent"),An="$default_instance",Cr="https://api2.amplitude.com/2/httpapi",Cn="https://api.eu.amplitude.com/2/httpapi",Pn="https://api2.amplitude.com/batch",kn="https://api.eu.amplitude.com/batch",Da="utm_campaign",La="utm_content",Na="utm_id",xa="utm_medium",Ma="utm_source",Ua="utm_term",Rn="dclid",On="fbclid",Dn="gbraid",Ln="gclid",Nn="ko_click_id",xn="li_fat_id",Mn="msclkid",Un="rdt_cid",Hn="ttclid",Fn="twclid",Vn="wbraid",Ff="EMPTY",Pr={utm_campaign:void 0,utm_c
2ontent:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Vf="MKTG",Ha=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],Yf=null,Dt=function(e){return e===void 0&&(e=An),Ra.getInstance(e)},Fa=function(e,t){Dt(t).identityStore.editIdentity().setUserId(e).commit()},Va=function(e,t){Dt(t).identityStore.editIdentity().setDeviceId(e).commit()},Yn=null,ye;(function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"})(ye||(ye={}));var Ya="Event tracked successfully",Ba="Unexpected error occurred",Ga="Event rejected due to exceeded retry count",ja="Event skipped due to optOut config",qa="Event rejected due to missing API key",za="Invalid API key",Xa="Client not initialized",Wa=function(e,t){var r=Math.max(t,1);return e.reduce(function(n,i,o){var a=Math.floor(o/r);return n[a]||(n[a]=[]),n[a].push(i),n},[])},yt=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=ye.Unknown),{event:e,code:t,message:r}},ir=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:An,logLevel:ee.Warn,loggerProvider:new We,offline:!1,optOut:!1,serverUrl:Cr,serverZone:"US",useBatch:!1}},Ka=(function(){function e(t){var r,n,i,o;this._optOut=!1;var a=ir();this.apiKey=t.apiKey,this.flushIntervalMillis=(r=t.flushIntervalMillis)!==null&&r!==void 0?r:a.flushIntervalMillis,this.flushMaxRetries=t.flushMaxRetries||a.flushMaxRetries,this.flushQueueSize=t.flushQueueSize||a.flushQueueSize,this.instanceName=t.instanceName||a.instanceName,this.loggerProvider=t.loggerProvider||a.loggerProvider,this.logLevel=(n=t.logLevel)!==null&&n!==void 0?n:a.logLevel,this.minIdLength=t.minIdLength,this.plan=t.plan,this.ingestionMetadata=t.ingestionMetadata,this.offline=t.offline!==void 0?t.offline:a.offline,this.optOut=(i=t.optOut)!==null&&i!==void 0?i:a.optOut,this.serverUrl=t.serverUrl,this.serverZone=t.serverZone||a.serverZone,this.storageProvider=t.storageProvider,this.transportProvider=t.transportProvider,this.useBatch=(o=t.useBatch)!==null&&o!==void 0?o:a.useBatch,this.loggerProvider.enable(this.logLevel);var s=Bn(t.serverUrl,t.serverZone,t.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(t){this._optOut=t},enumerable:!1,configurable:!0}),e})(),Ja=function(e,t){return e==="EU"?t?kn:Cn:t?Pn:Cr},Bn=function(e,t,r){if(e===void 0&&(e=""),t===void 0&&(t=ir().serverZone),r===void 0&&(r=ir().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:ir().serverZone;return{serverZone:n,serverUrl:Ja(n,r)}},$a=(function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(t,r){this.sdk.metrics.histogram[t]=r},e})(),Bf=(function(){function e(){}return e})();function kr(e){return e>=200&&e<300}var Qa=new Set([Cr,Cn,Pn,kn]),Za=function(e,t){return t===void 0&&(t=!1),Qa.has(e)?!0:t};function es(e){return e instanceof Error?e.message:String(e)}function Lt(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(r){}return t}var ts=(function(){function e(t){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=t==null?void 0:t.diagnosticsClient}return e.prototype.setup=function(t){var r;return(0,u.sH)(this,void 0,void 0,function(){var n,i=this;return(0,u.YH)(this,function(o){switch(o.label){case 0:return this.config=t,this.storageKey="".concat(Oa,"_").concat(this.config.apiKey.substring(0,10)),[4,(r=this.config.storageProvider)===null||r===void 0?void 0:r.get(this.storageKey)];case 1:return n=o.sent(),n&&n.length>0&&Promise.all(n.map(function(a){return i.execute(a)}
2)).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(t){var r=this;return t.insert_id||(t.insert_id=me()),new Promise(function(n){var i={event:t,attempts:0,callback:function(o){return n(o)},timeout:0};r.queue.push(i),r.schedule(r.config.flushIntervalMillis),r.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(t){var r=this;return t.filter(function(n){return n.attempts+=1,n.attempts<r.config.flushMaxRetries?!0:(r.fulfillRequest([n],500,Ga),!1)})},e.prototype.scheduleEvents=function(t){var r=this;t.forEach(function(n){r.schedule(n.timeout===0?r.config.flushIntervalMillis:n.timeout)})},e.prototype.schedule=function(t){var r=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&t>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=t,this.scheduleId=setTimeout(function(){r.queue=r.queue.map(function(n){return n.timeout=0,n}),r.flush(!0)},t);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(t){return t===void 0&&(t=!1),(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o=this;return(0,u.YH)(this,function(a){switch(a.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),r=[],n=[],this.queue.forEach(function(s){return s.timeout===0?r.push(s):n.push(s)}),i=Wa(r,this.config.flushQueueSize),[4,i.reduce(function(s,l){return(0,u.sH)(o,void 0,void 0,function(){return(0,u.YH)(this,function(c){switch(c.label){case 0:return[4,s];case 1:return c.sent(),[4,this.send(l,t)];case 2:return[2,c.sent()]}})})},Promise.resolve())]);case 1:return a.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(t,r){var n;return r===void 0&&(r=!0),(0,u.sH)(this,void 0,void 0,function(){var i,o,a,s,l,c;return(0,u.YH)(this,function(d){switch(d.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,qa)];i={api_key:this.config.apiKey,events:t.map(function(f){var v=f.event,h=v.extra,p=(0,u.Tt)(v,["extra"]);return p}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new $a,d.label=1;case 1:return d.trys.push([1,3,,4]),o=Bn(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,a=Za(o,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(o,i,a)];case 2:return s=d.sent(),s===null?(this.fulfillRequest(t,0,Ba),[2]):r?(this.handleResponse(s,t),[3,4]):("body"in s?this.fulfillRequest(t,s.statusCode,"".concat(s.status,": ").concat(Lt(s))):this.fulfillRequest(t,s.statusCode,s.status),[2]);case 3:return l=d.sent(),c=es(l),this.config.loggerProvider.error(c),(n=this.diagnosticsClient)===null||n===void 0||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:t.map(function(f){return f.event.event_type}),message:c,stack_trace:de()}),this.handleResponse({status:ye.Failed,statusCode:0},t),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(t,r){var n;kr(t.statusCode)||(n=this.diagnosticsClient)===null||n===void 0||n.recordEvent("analytics.events.unsuccessful",{events:r.map(function(o){return o.event.event_type}),code:t.statusCode,status:t.status,body:Lt(t),stack_trace:de()});var i=t.status;switch(i){case ye.Success:{this.handleSuccessResponse(t,r);break}case ye.Invalid:{this.handleInvalidResponse(t,r);break}case ye.PayloadTooLarge:{this.handlePayloadTooLargeResponse(t,r);break}case ye.RateLimit:{this.handleRateLimitResponse(t,r);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(i,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}}},e.prototype.handleSuccessResponse=function(t,r){this.fulfillRequest(r,t.statusCode,Ya)},e.prototype.handleInvalidResponse=function(t,r){var n=this;if(t.body.missingField||t.body.error.startsWith(za)){this.fulfillRequest(r,t.statusCode,t.body.error);return}var i=(0,u.fX)((0,u.fX)((0,u.fX)((0,u.fX)([],(0,u.zs)(Object.values(t.body.eventsWithInvalidFields)),!1),(0,u.zs)(Object.values(t.body.eventsWithMissingFields)),!1),(0,u.zs)(Object.values(t.body.eventsWithInvalidIdLengths)),!1),(0,u.zs)(t.body.silencedEvents),!1).flat(),o=new Set(i),a=r.filter(function(l,c){if
2(o.has(c)){n.fulfillRequest([l],t.statusCode,t.body.error);return}return!0});a.length>0&&this.config.loggerProvider.warn(Lt(t));var s=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(s)},e.prototype.handlePayloadTooLargeResponse=function(t,r){if(r.length===1){this.fulfillRequest(r,t.statusCode,t.body.error);return}this.config.loggerProvider.warn(Lt(t)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(t,r){var n=this,i=Object.keys(t.body.exceededDailyQuotaUsers),o=Object.keys(t.body.exceededDailyQuotaDevices),a=t.body.throttledEvents,s=new Set(i),l=new Set(o),c=new Set(a),d=r.filter(function(v,h){if(v.event.user_id&&s.has(v.event.user_id)||v.event.device_id&&l.has(v.event.device_id)){n.fulfillRequest([v],t.statusCode,t.body.error);return}return c.has(h)&&(v.timeout=n.throttleTimeout),!0});d.length>0&&this.config.loggerProvider.warn(Lt(t));var f=this.removeEventsExceedFlushMaxRetries(d);this.scheduleEvents(f)},e.prototype.handleOtherResponse=function(t){var r=this,n=t.map(function(o){return o.timeout=o.attempts*r.retryTimeout,o}),i=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(i)},e.prototype.fulfillRequest=function(t,r,n){var i,o,a;kr(r)?(a=this.diagnosticsClient)===null||a===void 0||a.increment("analytics.events.sent",t.length):((i=this.diagnosticsClient)===null||i===void 0||i.increment("analytics.events.dropped",t.length),(o=this.diagnosticsClient)===null||o===void 0||o.recordEvent("analytics.events.dropped",{events:t.map(function(s){return s.event.event_type}),code:r,message:n,stack_trace:de()})),this.removeEvents(t),t.forEach(function(s){return s.callback(yt(s.event,r,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var t=this.queue.map(function(r){return r.event});this.config.storageProvider.set(this.storageKey,t)}},e.prototype.removeEvents=function(t){this.queue=this.queue.filter(function(r){return!t.some(function(n){return n.event.insert_id===r.event.insert_id})}),this.saveEvents()},e})(),rs=(function(){function e(){this.name="identity",this.type="before",this.identityStore=Dt().identityStore}return e.prototype.execute=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r;return(0,u.YH)(this,function(n){return r=t.user_properties,r&&this.identityStore.editIdentity().updateUserProperties(r).commit(),[2,t]})})},e.prototype.setup=function(t){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(r){return t.instanceName&&(this.identityStore=Dt(t.instanceName).identityStore),[2]})})},e})(),ns=1e3,Rr=function(e){if(Object.keys(e).length>ns)return!1;for(var t in e){var r=e[t];if(!Gn(t,r))return!1}return!0},Gn=function(e,t){var r,n;if(typeof e!="string")return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,u.Ju)(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if(typeof s=="object")i=i&&Rr(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(t==null)return!1;if(typeof t=="object")return Rr(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},bt=(function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,u.Cl)({},this._properties)},e.prototype.set=function(t,r){return this._safeSet(se.SET,t,r),this},e.prototype.setOnce=function(t,r){return this._safeSet(se.SET_ONCE,t,r),this},e.prototype.append=function(t,r){return this._safeSet(se.APPEND,t,r),this},e.prototype.prepend=function(t,r){return this._safeSet(se.PREPEND,t,r),this},e.prototype.postInsert=function(t,r){return this._safeSet(se.POSTINSERT,t,r),this},e.prototype.preInsert=function(t,r){return this._safeSet(se.PREINSERT,t,r),this},e.prototype.remove=function(t,r){return this._safeSet(se.REMOVE,t,r),this},e.prototype.add=function(t,r){return this._safeSet(se.ADD,t,r),this},e.prototype.unset=function(t){return this._safeSet(se.UNSET,t,In),this},e.prototype.clearAll=function(){return this._properties={},this._properties[se.CLEAR_ALL]=In,this}
2,e.prototype._safeSet=function(t,r,n){if(this._validate(t,r,n)){var i=this._properties[t];return i===void 0&&(i={},this._properties[t]=i),i[r]=n,this._propertySet.add(r),!0}return!1},e.prototype._validate=function(t,r,n){return this._properties[se.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:t===se.ADD?typeof n=="number":t!==se.UNSET&&t!==se.REMOVE?Gn(r,n):!0},e})(),se;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(se||(se={}));var is=[se.CLEAR_ALL,se.UNSET,se.SET,se.SET_ONCE,se.ADD,se.APPEND,se.PREPEND,se.PREINSERT,se.POSTINSERT,se.REMOVE],at;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(at||(at={}));var nt;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(nt||(nt={}));var os=function(e,t,r){var n=typeof e=="string"?{event_type:e}:e;return(0,u.Cl)((0,u.Cl)((0,u.Cl)({},n),r),t&&{event_properties:t})},Or=function(e,t){var r=(0,u.Cl)((0,u.Cl)({},t),{event_type:nt.IDENTIFY,user_properties:e.getUserProperties()});return r},as=function(e,t,r,n){var i,o=(0,u.Cl)((0,u.Cl)({},n),{event_type:nt.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[e]=t,i)});return o},ss=function(e,t,r){var n,i=new bt;i.set(e,t);var o=(0,u.Cl)((0,u.Cl)({},r),{event_type:nt.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[e]=t,n)});return o},us=function(e,t){return(0,u.Cl)((0,u.Cl)({},t),{event_type:nt.REVENUE,event_properties:e.getEventProperties()})},jn=(function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(t){return this.productId=t,this},e.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},e.prototype.setPrice=function(t){return this.price=t,this},e.prototype.setRevenueType=function(t){return this.revenueType=t,this},e.prototype.setCurrency=function(t){return this.currency=t,this},e.prototype.setRevenue=function(t){return this.revenue=t,this},e.prototype.setReceipt=function(t){return this.receipt=t,this},e.prototype.setReceiptSig=function(t){return this.receiptSig=t,this},e.prototype.setEventProperties=function(t){try{var r=JSON.parse(JSON.stringify(t));Rr(r)&&(this.properties=r)}catch(n){}return this},e.prototype.getEventProperties=function(){var t=this.properties?(0,u.Cl)({},this.properties):{};return t[je.REVENUE_PRODUCT_ID]=this.productId,t[je.REVENUE_QUANTITY]=this.quantity,t[je.REVENUE_PRICE]=this.price,t[je.REVENUE_TYPE]=this.revenueType,t[je.REVENUE_CURRENCY]=this.currency,t[je.REVENUE]=this.revenue,t[je.RECEIPT]=this.receipt,t[je.RECEIPT_SIG]=this.receiptSig,t},e})(),je;(function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"})(je||(je={}));var qn=function(e,t){t===void 0&&(t=Date.now());var r=Date.now(),n=r-t;return n>e},zn=Y(81401),cs=Y.n(zn),ls=cs()||zn,ds=(function(){function e(t){this.client=t,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return e.prototype.register=function(t,r){var n,i;return(0,u.sH)(this,void 0,void 0,function(){var o;return(0,u.YH)(this,function(a){switch(a.label){case 0:return t.name===void 0&&(t.name=me(),this.loggerProvider.warn(`Plugin name is undefined. 3 Generating a random UUID for plugin name: `.concat(t.name,`. 4 Set a name for the plugin to prevent it from being added multiple times.`))),o=t.name,this.pluginStatus.has(o)?(this.loggerProvider.warn("Plugin with name ".concat(o," already exists, skipping registration")),[2]):(t.type=(n=t.type)!==null&&n!==void 0?n:"enrichment",this.pluginStatus.set(o,"locked"),[4,(i=t.setup)===null||i===void 0?void 0:i.call(t,r,this.client)]);case 1:return a.sent(),this.pluginStatus.get(o)!=="locked"?[2]:(this.plugins.push(t),this.pluginStatus.set(o,"installed"),[2])}})})},e.prototype.deregister=function(t,r){var n;return(0,u.sH)(this,void 0,void 0,function(){var i,o;return(0,u.YH)(this,function(a){switch(a.label){case 0:return this.pluginStatus.delete(t),i=this.plugins.findIndex(function(s){return s.name===t}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(t," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(n=o.teardown)===null||n===void 0?void 0:n.call(o)]);case 1:return a.sent(),[2]}})})},e.prototype.reset=function(t){this._clearOptOutListeners(),this.applying=!1;var r=this.plugins;r.map(function(n){var i;return(i=n.teardown)===null||i===void 0?void 0:i.call(n)}),this.plugins=[],this.pluginStatus.clear(),this.client=t},e.prototype.push=function(t){var r=this;return new Promise(function(n){r.queue.push([t,n]),r.scheduleApply(0)})},e.prototype.scheduleApply=function(t){var r=this;this.applying||(this.applying=!0,setTimeout(function(){r.apply(r.queue.shift()).then(function(){r.applying=!1,r.queue.length>0&&r.scheduleApply(0)})},t))},e.prototype.apply=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o,a,s,l,h,p,c,d,f,v,h,p,g,m,b,E,y,S,A;return(0,u.YH)(this,function(C){switch(C.label){case 0:if(!t)return[2];r=(0,u.zs)(t,1),n=r[0],i=(0,u.zs)(t,2),o=i[1],this.loggerProvider.log("Timeline.apply: Initial event",n),a=this.plugins.filter(function(D){return D.type==="before"}),C.label=1;case 1:C.trys.push([1,6,7,8]),s=(0,u.Ju)(a),l=s.next(),C.label=2;case 2:return l.done?[3,5]:(h=l.value,h.execute?[4,h.execute((0,u.Cl)({},n))]:[3,4]);case 3:if(p=C.sent(),p===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(h.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(h.name),"', event: ").concat(JSON.stringify(n))),C.label=4;case 4:return l=s.next(),[3,2];case 5:return[3,8];case 6:return c=C.sent(),E={error:c},[3,8];case 7:try{l&&!l.done&&(y=s.return)&&y.call(s)}finally{if(E)throw E.error}
4return[7];case 8:d=this.plugins.filter(function(D){return D.type==="enrichment"||D.type===void 0}),C.label=9;case 9:C.trys.push([9,14,15,16]),f=(0,u.Ju)(d),v=f.next(),C.label=10;case 10:return v.done?[3,13]:(h=v.value,h.execute?[4,h.execute((0,u.Cl)({},n))]:[3,12]);case 11:if(p=C.sent(),p===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(h.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(h.name),"', event: ").concat(JSON.stringify(n))),C.label=12;case 12:return v=f.next(),[3,10];case 13:return[3,16];case 14:return g=C.sent(),S={error:g},[3,16];case 15:try{v&&!v.done&&(A=f.return)&&A.call(f)}finally{if(S)throw S.error}return[7];case 16:return m=this.plugins.filter(function(D){return D.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),b=m.map(function(D){var x=(0,u.Cl)({},n);return D.execute(x).catch(function(U){return yt(x,0,String(U))})}),Promise.all(b).then(function(D){var x=(0,u.zs)(D,1),U=x[0],J=U||yt(n,100,"Event not tracked, no destination plugins on the instance");o(J)}),[2]}})})},e.prototype.flush=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,u.YH)(this,function(o){switch(o.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map(function(a){return i.apply(a)}))];case 1:return o.sent(),r=this.plugins.filter(function(a){return a.type==="destination"}),n=r.map(function(a){return a.flush&&a.flush()}),[4,Promise.all(n)];case 2:return o.sent(),[2]}})})},e.prototype.addOptOutListener=function(t){this._optOutListeners.push(t)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onIdentityChanged)===null||n===void 0||n.call(r,t)})},e.prototype.onSessionIdChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onSessionIdChanged)===null||n===void 0||n.call(r,t)})},e.prototype.onOptOutChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onOptOutChanged)===null||n===void 0||n.call(r,t)}),this._callOptOutListeners(t)},e.prototype._callOptOutListeners=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o,a,s,l;return(0,u.YH)(this,function(c){switch(c.label){case 0:c.trys.push([0,7,8,9]),r=(0,u.Ju)(this._optOutListeners),n=r.next(),c.label=1;case 1:if(n.done)return[3,6];i=n.value,c.label=2;case 2:return c.trys.push([2,4,,5]),[4,i(t)];case 3:return c.sent(),[3,5];case 4:return o=c.sent(),this.loggerProvider.error("Error calling optOut listener",o),[3,5];case 5:return n=r.next(),[3,1];case 6:return[3,9];case 7:return a=c.sent(),s={error:a},[3,9];case 8:try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(s)throw s.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(t){var r;(r=t.onReset)===null||r===void 0||r.call(t)})},e})(),fs=(function(){function e(t){t===void 0&&(t="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new ds(this),this.name=t}return e.prototype._init=function(t){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(r){switch(r.label){case 0:return this.config=t,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return r.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o,a,s,l,c;return(0,u.YH)(this,function(d){switch(d.label){case 0:r=this[t],this[t]=[],d.label=1;case 1:d.trys.push([1,8,9,10]),n=(0,u.Ju)(r),i=n.next(),d.label=2;case 2:return i.done?[3,7]:(o=i.value,a=o(),a&&"promise"in a?[4,a.promise]:[3,4]);case 3:return d.sent(),[3,6];case 4:return[4,a];case 5:d.sent(),d.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return s=d.sent(),l={error:s},[3,10];case 9:try{i&&!i.done&&(c=n.return)&&c.call(n)}finally{if(l)throw l.error}
4return[7];case 10:return this[t].length?[4,this.runQueuedFunctions(t)]:[3,12];case 11:d.sent(),d.label=12;case 12:return[2]}})})},e.prototype.track=function(t,r,n){var i=os(t,r,n);return this.userProperties=this.getOperationAppliedUserProperties(i.user_properties),ae(this.dispatch(i))},e.prototype.identify=function(t,r){var n=Or(t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),ae(this.dispatch(n))},e.prototype.groupIdentify=function(t,r,n,i){var o=as(t,r,n,i);return ae(this.dispatch(o))},e.prototype.setGroup=function(t,r,n){var i=ss(t,r,n);return this.userProperties=this.getOperationAppliedUserProperties(i.user_properties),ae(this.dispatch(i))},e.prototype.revenue=function(t,r){var n=us(t,r);return ae(this.dispatch(n))},e.prototype.add=function(t){return this.isReady?this._addPlugin(t):(this.q.push(this._addPlugin.bind(this,t)),ae())},e.prototype._addPlugin=function(t){return ae(this.timeline.register(t,this.config))},e.prototype.remove=function(t){return this.isReady?this._removePlugin(t):(this.q.push(this._removePlugin.bind(this,t)),ae())},e.prototype._removePlugin=function(t){return ae(this.timeline.deregister(t,this.config))},e.prototype.dispatchWithCallback=function(t,r){if(!this.isReady)return r(yt(t,0,Xa));this.process(t).then(r)},e.prototype.dispatch=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r=this;return(0,u.YH)(this,function(n){return this.isReady?[2,this.process(t)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,t,i))})]})})},e.prototype.getOperationAppliedUserProperties=function(t){var r,n=(r=this.userProperties)!==null&&r!==void 0?r:{},i=(0,u.Cl)({},n);if(t===void 0)return i;var o={};return Object.keys(t).forEach(function(a){Object.values(at).includes(a)||(o[a]=t[a])}),is.forEach(function(a){if(Object.keys(t).includes(a)){var s=t[a];
4switch(a){case at.CLEAR_ALL:Object.keys(i).forEach(function(l){delete i[l]});break;case at.UNSET:Object.keys(s).forEach(function(l){delete i[l]});break;case at.SET:Object.assign(i,s);break}}}),Object.assign(i,o),i},e.prototype.process=function(t){return(0,u.sH)(this,void 0,void 0,function(){var i,r,n,i;return(0,u.YH)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,yt(t,0,ja)]:(t.event_type===nt.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(t)]);case 1:return i=o.sent(),i.code===200?this.config.loggerProvider.log(i.message):i.code===100?this.config.loggerProvider.warn(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return r=o.sent(),n=String(r),this.config.loggerProvider.error(n),i=yt(t,0,n),[2,i];case 3:return[2]}})})},e.prototype.setOptOut=function(t){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!t));return}this._setOptOut(t)},e.prototype._setOptOut=function(t){this.config.optOut!==t&&(this.config.optOut=!!t,this.timeline.onOptOutChanged(t))},e.prototype.flush=function(){return ae(this.timeline.flush())},e.prototype.plugin=function(t){var r=this.timeline.plugins.find(function(n){return n.name===t});if(r===void 0){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(t));return}return r},e.prototype.plugins=function(t){return this.timeline.plugins.filter(function(r){return r instanceof t})},e})();function vs(){var e,t,r=X();return typeof((t=(e=r==null?void 0:r.chrome)===null||e===void 0?void 0:e.runtime)===null||t===void 0?void 0:t.id)=="string"}var Et=function(e,t){return typeof e=="boolean"?e:(e==null?void 0:e[t])===!1?!1:vs()?!!(e!=null&&e[t]):!0},Dr=function(e){return Et(e,"attribution")},hs=function(e){return Et(e,"fileDownloads")},Xn=function(e){return Et(e,"formInteractions")},Wn=function(e){return Et(e,"pageViews")},Kn=function(e){return Et(e,"sessions")},ps=function(e){return Et(e,"pageUrlEnrichment")},Jn=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.networkTracking===!0||typeof e.networkTracking=="object")},$n=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.elementInteractions===!0||typeof e.elementInteractions=="object")},gs=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e.webVitals===!0},Qn=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.frustrationInteractions===!0||typeof e.frustrationInteractions=="object")},ms=function(e){return typeof e=="object"&&(e.performanceTracking===!0||typeof e.performanceTracking=="object")},ys=function(e){if(typeof e.autocapture=="object"){var t=e.autocapture.performanceTracking;if(t===!0)return{mainThreadBlock:!0};if(typeof t=="object"&&t!==null)return t}},bs=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e!==null&&e.enabled!==!1},Es=function(e){if($n(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.elementInteractions=="object")return e.autocapture.elementInteractions},_s=function(e){if(Qn(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.frustrationInteractions=="object")return e.autocapture.frustrationInteractions},Ts=function(e){var t;if(Jn(e.autocapture)){var r=void 0;return typeof e.autocapture=="object"&&typeof e.autocapture.networkTracking=="object"?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),(0,u.Cl)((0,u.Cl)({},r),{captureRules:(t=r==null?void 0:r.captureRules)===null||t===void 0?void 0:t.map(function(n){var i,o,a;if(!((i=n.urls)===null||i===void 0)&&i.length&&(!((o=n.hosts)===null||o===void 0)&&o.length)){var s=JSON.stringify(n.hosts),l=JSON.stringify(n.urls);return(a=e.loggerProvider)===null||a===void 0||a.warn("Found network capture rule with both urls='".concat(l,"' and hosts='").concat(s,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,u.Cl)((0,u.Cl)({},n),{hosts:void 0})}return n})})}},Zn=function(e){var t=function(){return!1},r=void 0,n,i=e.pageCounter,o=Wn(e.defaultTracking);return o&&(t=void 0,n=void 0,e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.pageViews&&typeof e.defaultTracking.pageViews=="object"&&("trackOn"in e.defaultTracking.pageViews&&(t=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(n=e.defaultTracking.pageViews.eventType))),{trackOn:t,trackHistoryChanges:r,eventType:n,pageCounter:i}},Ss=function(e){return Dr(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution=="object"?(0,u.Cl)({},e.defaultTracking.attribution):{}},ws=function(e){if(Xn(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&typeof e.defaultTracking.formInteractions=="object")return e.defaultTracking.formInteractions},Is=function(e,t){or(e,t)},or=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,a=n.resolve,s=e&&e[i];if(typeof s=="function"){var l=s.apply(e,o);typeof a=="function"&&a(l==null?void 0:l.promise)}}return e},Lr=function(e){var t=e;return t&&t._q!==void 0},As=function(){var e,t,r,n;if(typeof navigator=="undefined")return"";var i=navigator.userLanguage;return(n=(r=(t=(e=navigator.languages)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:navigator.language)!==null&&r!==void 0?r:i)!==null&&n!==void 0?n:""},Nr="2.42.1",ei="amplitude-ts",Cs="Web",Ps="$remote",ks=(function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(ei,"/").concat(Nr),typeof navigator!="undefined"&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},e.prototype.execute=function(t){var r,n;return(0,u.sH)(this,void 0,void 0,function(){var i,o,a,s;return(0,u.YH)(this,function(l){return i=new Date().getTime(),o=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1,a=(n=t.event_id)!==null&&n!==void 0?n:o+1,this.config.lastEventId=a,t.time||(this.config.lastEventTime=i),s=(0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:Cs}),this.config.trackingOptions.language&&{language:As()}),this.config.trackingOptions.ipAddress&&{ip:Ps}),{insert_id:me(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),t),{event_id:a,library:this.library,user_agent:this.userAgent}),[2,s]})})},e})(),xr=(function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(t){return[2,!0]})})},e.prototype.get=function(t){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(r){return[2,this.memoryStorage.get(t)]})})},e.prototype.getRaw=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r;return(0,u.YH)(this,function(n){switch(n.label){case 0:return[4,this.get(t)];case 1:return r=n.sent(),[2,r?JSON.stringify(r):void 0]}})})},e.prototype.set=function(t,r){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(n){return this.memoryStorage.set(t,r),[2]})})},e.prototype.remove=function(t){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(r){return this.memoryStorage.delete(t),[2]})})},e.prototype.reset=function(){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(t){return this.memoryStorage.clear(),[2]})})},e})(),Mr=Y(96763),Rs=function(){var e,t=X();return(e=t==null?void 0:t.navigator)===null||e===void 0?void 0:e.locks},ar=(function(){function e(t,r){r===void 0&&(r={}),this.options=(0,u.Cl)({},t),this.config=r}return e.prototype.isEnabled=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i,o=this;return(0,u.YH)(this,function(a){switch(a.label){case 0:return t="AMP_TEST",r=(0,u.Cl)({},this.options),n=new e(r),i=String(Date.now()),[4,n.transaction(t,function(s){var l,c;try{s.set(i);var d=s.get(),f=d===i;return!f&&o.config.diagnosticsClient&&((l=o.config.diagnosticsClient)===null||l===void 0||l.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:i,sync:!0})),f}catch(h){if(o.config.diagnosticsClient){var v=h instanceof Error?h.message:String(h);(c=o.config.diagnosticsClient)===null||c===void 0||c.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:i,error:v,sync:!0})}return!1}finally{s.set(null)}})];case 1:return[2,a.sent()]}})})},e.prototype.get=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r;return(0,u.YH)(this,function(n){switch(n.label){case 0:return[4,this.getRaw(t)];case 1:return r=n.sent(),[2,this.decodeCookieValue(t,r)]}})})},e.prototype.decodeCookieValue=function(t,r){if(r)try{var n=ti(r);if(n===void 0){Mr.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(t,", value: ").concat(r));return}return JSON.parse(n)}catch(i){Mr.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(t,", value: ").concat(r));return}},e.prototype.getSync=function(t){var r=this.getRawSync(t);return this.decodeCookieValue(t,r)},e.prototype.getRaw=function(t){var r,n;return(0,u.sH)(this,void 0,void 0,function(){var i,o,a,s,l,c,d,f,v,h;return(0,u.YH)(this,function(p){switch(p.label){case 0:i=X(),o=i,p.label=1;case 1:return p.trys.push([1,4,,5]),a=o==null?void 0:o.cookieStore,a?[4,a.getAll(t)]:[3,3];case 2:if(s=p.sent(),s){s.length>1&&((r=this.config.diagnosticsClient)===null||r===void 0||r.recordEvent("cookies.duplicate",{cookies:s.map(function(g){return g.domain})}),(n=this.config.diagnosticsClient)===null||n===void 0||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(l=(0,u.Ju)(s),c=l.next();!c.done;c=l.next())if(d=c.value,ri(d.domain,this.options.domain))return[2,d.value]}catch(g){v={error:g}}finally{try{c&&!c.done&&(h=l.return)&&h.call(l)}finally{if(v)throw v.error}}}p.label=3;case 3:return[3,5];case 4:return f=p.sent(),[3,5];case 5:return[2,this.getRawSync(t)]}})})},e.prototype.getRawSync=function(t){var r=this,n,i,o=X(),a=((i=(n=o==null?void 0:o.document)===null||n===void 0?void 0:n.cookie.split("; "))!==null&&i!==void 0?i:[]).filter(function(c){return c.indexOf(t+"=")===0}),s=void 0,l=this.config.duplicateResolverFn;
4if(typeof l=="function"&&a.length>1&&(s=a.find(function(c){var d;try{var f=l(c.substring(t.length+1));return f||(d=r.config.diagnosticsClient)===null||d===void 0||d.increment("cookies.duplicate.occurrence.document.cookie"),f}catch(v){return!1}})),s||(s=a[0]),!!s)return s.substring(t.length+1)},e.prototype.set=function(t,r){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(n){return this.setSync(t,r),[2]})})},e.prototype.setSync=function(t,r){var n;try{var i=(n=this.options.expirationDays)!==null&&n!==void 0?n:0,o=r!==null?i:-1,a=void 0;if(o){var s=new Date;s.setTime(s.getTime()+o*24*60*60*1e3),a=s}var l="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(r))));a&&(l+="; expires=".concat(a.toUTCString())),l+="; path=/",this.options.domain&&(l+="; domain=".concat(this.options.domain)),this.options.secure&&(l+="; Secure"),this.options.sameSite&&(l+="; SameSite=".concat(this.options.sameSite));var c=X();c!=null&&c.document&&(c.document.cookie=l)}catch(f){var d=f instanceof Error?f.message:String(f);Mr.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(t,". Error: ").concat(d))}},e.prototype.remove=function(t){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(r){switch(r.label){case 0:return[4,this.set(t,null)];case 1:return r.sent(),[2]}})})},e.prototype.reset=function(){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(t){return[2]})})},e.isDomainWritable=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i,o,a;return(0,u.YH)(this,function(s){switch(s.label){case 0:if(e.cachedTlds[t])return[2,!0];r={domain:"."+t},n="AMP_TLDTEST",i=new e(r),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,i.transaction(n,function(l){if(e.cachedTlds[t])return!0;try{l.set(1);var c=!!l.get();return c&&(e.cachedTlds[t]=!0),c}finally{l.set(null)}})];case 2:return o=s.sent(),[2,!!o];case 3:return a=s.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(t,r){return(0,u.sH)(this,void 0,void 0,function(){var n,i,o,a=this;return(0,u.YH)(this,function(s){switch(s.label){case 0:if(n=Rs(),i=function(){var l={get:function(){return a.getSync(t)},set:function(c){return a.setSync(t,c)}};return r(l)},!n)return[2,i()];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(t),i)];case 2:return[2,s.sent()];case 3:return o=s.sent(),[2,i()];case 4:return[2]}})})},e.cachedTlds={},e})(),Os=function(e){try{return decodeURIComponent(atob(e))}catch(t){return}},Ds=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(t){return}},ti=function(e){var t;return(t=Os(e))!==null&&t!==void 0?t:Ds(e)},ri=function(e,t){if(e===""&&t==="")return!0;if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()},ni=function(e,t,r){return t===void 0&&(t=""),r===void 0&&(r=10),[nr,t,e.substring(0,r)].filter(Boolean).join("_")},Ls=function(e){return"".concat(nr.toLowerCase(),"_").concat(e.substring(0,6))},Ns=Y(96763),ii=(function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i,o;return(0,u.YH)(this,function(a){switch(a.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",a.label=1;case 1:return a.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return a.sent(),[4,r.get(n)];case 3:return i=a.sent(),[2,i===t];case 4:return o=a.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return a.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n;return(0,u.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return r=i.sent(),r?[2,JSON.parse(r)]:[2,void 0];case 2:return n=i.sent(),Ns.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(t){var r;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(n){return[2,((r=this.storage)===null||r===void 0?void 0:r.getItem(t))||void 0]})})},e.prototype.set=function(t,r){var n;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(i){try{(n=this.storage)===null||n===void 0||n.setItem(t,JSON.stringify(r))}catch(o){}return[2]})})},e.prototype.remove=function(t){var r;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(n){try{(r=this.storage)===null||r===void 0||r.removeItem(t)}catch(i){}return[2]})})},e.prototype.reset=function(){var t;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(r){try{(t=this.storage)===null||t===void 0||t.clear()}catch(n){}return[2]})})},e})(),sr=1e3,oi=(function(e){(0,u.C6)(t,e);function t(r){var n=this,i,o,a;try{a=(i=X())===null||i===void 0?void 0:i.localStorage}catch(s){(o=r==null?void 0:r.loggerProvider)===null||o===void 0||o.debug("Failed to access localStorage. error=".concat(JSON.stringify(s))),a=void 0}return n=e.call(this,a)||this,n.loggerProvider=r==null?void 0:r.loggerProvider,n}return t.prototype.set=function(r,n){var i;return(0,u.sH)(this,void 0,void 0,function(){var o;return(0,u.YH)(this,function(a){switch(a.label){case 0:return Array.isArray(n)&&n.length>sr?(o=n.length-sr,[4,e.prototype.set.call(this,r,n.slice(0,sr))]):[3,2];case 1:return a.sent(),(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(o," events because the queue length exceeded ").concat(sr,".")),[3,4];case 2:return[4,e.prototype.set.call(this,r,n)];case 3:a.sent(),a.label=4;case 4:return[2]}})})},t})(ii),xs=(function(e){(0,u.C6)(t,e);function t(){var r;return e.call(this,(r=X())===null||r===void 0?void 0:r.sessionStorage)||this}return t})(ii),ai=2*1024;function si(){return typeof CompressionStream!="undefined"}function ui(e){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n;return(0,u.YH)(this,function(i){switch(i.label){case 0:if(t=CompressionStream,typeof t=="undefined")return[2,void 0];i.label=1;case 1:return i.trys.push([1,3,,4]),r=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(r).arrayBuffer()];case 2:return[2,i.sent()];case 3:return n=i.sent(),[2,void 0];case 4:return[2]}})})}var Ur=(function(){function e(){}return e.prototype.send=function(t,r,n){return Promise.resolve(null)},e.prototype.buildResponse=function(t){var r,n,i,o,a,s,l,c,d,f,v,h,p,g,m,b,E,y,S,A,C,D;if(typeof t!="object")return null;var x=t.code||0,U=this.buildStatus(x);switch(U){case ye.Success:return{status:U,statusCode:x,body:{eventsIngested:(r=t.events_ingested)!==null&&r!==void 0?r:0,payloadSizeBytes:(n=t.payload_size_bytes)!==null&&n!==void 0?n:0,serverUploadTime:(i=t.server_upload_time)!==null&&i!==void 0?i:0}};case ye.Invalid:return{status:U,statusCode:x,body:{error:(o=t.error)!==null&&o!==void 0?o:"",missingField:(a=t.missing_field)!==null&&a!==void 0?a:"",eventsWithInvalidFields:(s=t.events_with_invali
4d_fields)!==null&&s!==void 0?s:{},eventsWithMissingFields:(l=t.events_with_missing_fields)!==null&&l!==void 0?l:{},eventsWithInvalidIdLengths:(c=t.events_with_invalid_id_lengths)!==null&&c!==void 0?c:{},epsThreshold:(d=t.eps_threshold)!==null&&d!==void 0?d:0,exceededDailyQuotaDevices:(f=t.exceeded_daily_quota_devices)!==null&&f!==void 0?f:{},silencedDevices:(v=t.silenced_devices)!==null&&v!==void 0?v:[],silencedEvents:(h=t.silenced_events)!==null&&h!==void 0?h:[],throttledDevices:(p=t.throttled_devices)!==null&&p!==void 0?p:{},throttledEvents:(g=t.throttled_events)!==null&&g!==void 0?g:[]}};case ye.PayloadTooLarge:return{status:U,statusCode:x,body:{error:(m=t.error)!==null&&m!==void 0?m:""}};case ye.RateLimit:return{status:U,statusCode:x,body:{error:(b=t.error)!==null&&b!==void 0?b:"",epsThreshold:(E=t.eps_threshold)!==null&&E!==void 0?E:0,throttledDevices:(y=t.throttled_devices)!==null&&y!==void 0?y:{},throttledUsers:(S=t.throttled_users)!==null&&S!==void 0?S:{},exceededDailyQuotaDevices:(A=t.exceeded_daily_quota_devices)!==null&&A!==void 0?A:{},exceededDailyQuotaUsers:(C=t.exceeded_daily_quota_users)!==null&&C!==void 0?C:{},throttledEvents:(D=t.throttled_events)!==null&&D!==void 0?D:[]}};case ye.Timeout:default:return{status:U,statusCode:x}}},e.prototype.buildStatus=function(t){return kr(t)?ye.Success:t===429?ye.RateLimit:t===413?ye.PayloadTooLarge:t===408?ye.Timeout:t>=400&&t<500?ye.Invalid:t>=500?ye.Failed:ye.Unknown},e})(),Ms=(function(e){(0,u.C6)(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=r,n}return t.prototype.send=function(r,n,i){return i===void 0&&(i=!1),(0,u.sH)(this,void 0,void 0,function(){var o=this;return(0,u.YH)(this,function(a){return[2,new Promise(function(s,l){typeof XMLHttpRequest=="undefined"&&l(new Error("XHRTransport is not supported."));var c=new XMLHttpRequest;c.open("POST",r,!0),c.onreadystatechange=function(){if(c.readyState===o.state.done){var g=c.responseText;try{s(o.buildResponse(JSON.parse(g)))}catch(m){s(o.buildResponse({code:c.status}))}}};var d={"Content-Type":"application/json",Accept:"*/*"},f=JSON.stringify(n),v=i&&f.length>=ai&&si(),h=function(g){var m,b;d=(0,u.Cl)((0,u.Cl)({},o.customHeaders),d);try{for(var E=(0,u.Ju)(Object.entries(d)),y=E.next();!y.done;y=E.next()){var S=(0,u.zs)(y.value,2),A=S[0],C=S[1];c.setRequestHeader(A,C)}}catch(D){m={error:D}}finally{try{y&&!y.done&&(b=E.return)&&b.call(E)}finally{if(m)throw m.error}}c.send(g)},p=function(){return(0,u.sH)(o,void 0,void 0,function(){var g;return(0,u.YH)(this,function(m){switch(m.label){case 0:return v?[4,ui(f)]:[3,2];case 1:return g=m.sent(),g?(d["Content-Encoding"]="gzip",h(g)):h(f),[3,3];case 2:h(f),m.label=3;case 3:return[2]}})})};p().catch(l)})]})})},t})(Ur),Us=(function(e){(0,u.C6)(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.customHeaders=r,n}return t.prototype.send=function(r,n,i){return i===void 0&&(i=!1),(0,u.sH)(this,void 0,void 0,function(){var o,a,s,l,c,d,f,v;return(0,u.YH)(this,function(h){switch(h.label){case 0:if(typeof fetch=="undefined")throw new Error("FetchTransport is not supported");return o=JSON.stringify(n),a=i&&o.length>=ai&&si(),s=o,l={"Content-Type":"application/json",Accept:"*/*"},a?[4,ui(o)]:[3,2];case 1:c=h.sent(),c&&(l["Content-Encoding"]="gzip",s=c),h.label=2;case 2:return l=(0,u.Cl)((0,u.Cl)({},this.customHeaders),l),d={headers:l,body:s,method:"POST"},[4,fetch(r,d)];case 3:return f=h.sent(),[4,f.text()];case 4:v=h.sent();try{return[2,this.buildResponse(JSON.parse(v))]}catch(p){return[2,this.buildResponse({code:f.status})]}return[2]}})})},t})(Ur),Hs=(function(e){(0,u.C6)(t,e);function t(){return e.call(this)||this}return t.prototype.send=function(r,n,i){return i===void 0&&(i=!1),(0,u.sH)(this,void 0,void 0,function(){var o=this;return(0,u.YH)(this,function(a){return[2,new Promise(function(s,l){var c=X();if(!(c!=null&&c.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var d=JSON.stringify(n),f=c.navigator.sendBeacon(r,d);return s(f?o.buildResponse({code:200,events_ingested:n.events.length,payload_size_bytes:d.length,server_upload_time:Date.now()}):o.buildResponse({code:500}))}catch(v){l(v)}})]})})},t})(Ur),Fs=function(e,t,r){return r===void 0&&(r=!0),(0,u.sH)(void 0,void 0,void 0,function(){var n,i,o,a,s,l,c,d,f;return(0,u.YH)(this,function(v){switch(v.label){case 0:return n=Ls(e),[4,t.getRaw(n)];case 1:return i=v.sent(),i?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:v.sent(),v.label=3;
4case 3:return o=(0,u.zs)(i.split("."),6),a=o[0],s=o[1],l=o[2],c=o[3],d=o[4],f=o[5],[2,{deviceId:a,userId:Vs(s),sessionId:Hr(c),lastEventId:Hr(f),lastEventTime:Hr(d),optOut:!!l}]}})})},Hr=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Vs=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch(t){return}},Be="[Amplitude]",Gf="".concat(Be," Page Viewed"),ci="".concat(Be," Form Started"),Ys="".concat(Be," Form Submitted"),Bs="".concat(Be," File Downloaded"),li="session_start",di="session_end",Gs="".concat(Be," File Extension"),js="".concat(Be," File Name"),qs="".concat(Be," Link ID"),zs="".concat(Be," Link Text"),Xs="".concat(Be," Link URL"),Fr="".concat(Be," Form ID"),Vr="".concat(Be," Form Name"),Yr="".concat(Be," Form Destination"),ur="cookie",fi="US",cr={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},vi=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Ws=function(e){return Object.values(e).every(function(t){return!t})},Ks=function(e){var t=(0,u.Cl)((0,u.Cl)({},e),{referring_domain:void 0,referrer:void 0});return Object.values(t).every(function(r){return!r})},Js=function(e,t,r,n,i,o){i===void 0&&(i=!0);var a=e.referrer,s=e.referring_domain,l=(0,u.Tt)(e,["referrer","referring_domain"]),c=t||{},d=c.referrer,f=c.referring_domain,v=(0,u.Tt)(c,["referrer","referring_domain"]),h=r.excludeInternalReferrers;if(h){var p=tu(h,n);if(!(p instanceof TypeError)&&e.referring_domain&&ru(e.referring_domain,o)){if(p==="always")return hi(p,e.referring_domain,n),!1;if(p==="ifEmptyCampaign"&&Ks(e))return hi(p,e.referring_domain,n),!1}}if($s(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Ws(e)&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var g=JSON.stringify(l)!==JSON.stringify(v),m=vi(s||"")!==vi(f||""),b=!t||g||m;return b?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),b},$s=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=""),e.some(function(r){return r instanceof RegExp?r.test(t):r===t})},Qs=function(e,t){var r=t.startsWith(".")?t:".".concat(t),n=e.startsWith(".")?e:".".concat(e);return!!n.endsWith(r)},Zs=function(e,t){var r=(0,u.Cl)((0,u.Cl)({},Pr),e),n=Object.entries(r).reduce(function(i,o){var a,s=(0,u.zs)(o,2),l=s[0],c=s[1];return i.setOnce("initial_".concat(l),(a=c!=null?c:t.initialEmptyValue)!==null&&a!==void 0?a:"EMPTY"),c?i.set(l,c):i.unset(l)},new bt);return Or(n)},eu=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},tu=function(e,t){if(e===!0)return cr.always;if(typeof e=="object"){var r=e.condition;if(typeof r=="string"&&Object.keys(cr).includes(r))return r;if(typeof r=="undefined")return cr.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),new TypeError(n)};function hi(e,t,r){var n="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");e==="always"?r.debug(n):e==="ifEmptyCampaign"&&r.debug("".concat(n," with empty campaign parameters"))}var pi=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],gi=function(e){var t,r,n=e||((r=(t=X())===null||t===void 0?void 0:t.location)===null||r===void 0?void 0:r.hostname);if(!n)return"";var i=n.split("."),o=i[i.length-1],a=i[i.length-2];return pi.find(function(s){return n.endsWith(".".concat(s))})&&(o=i[i.length-2]+"."+i[i.length-1],a=i[i.length-3]),a?"".concat(a,".").concat(o):o},ru=function(e,t){var r=X();if(!r)return!1;var n=(t||"").trim()||gi(r.location.hostname);return Qs(e,n)},nu=(function(e){(0,u.C6)(t,e);function t(r,n,i,o,a,s,l,c,d,f,v,h,p,g,m,b,E,y,S,A,C,D,x,U,J,R,M,H,W,Q,ue,be,qe,q,$,he,Re,Ee,Ue,we,_e,Oe,De,Ae){i===void 0&&(i=new xr),o===void 0&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),c===void 0&&(c=1e3),d===void 0&&(d=5),f===void 0&&(f=30),v===void 0&&(v=ur),b===void 0&&(b=new We),E===void 0&&(E=ee.Warn),S===void 0&&(S=!1),A===void 0&&(A=!1),x===void 0&&(x=""),U===void 0&&(U=fi),M===void 0&&(M=1800*1e3),H===void 0&&(H=new oi({loggerProvider:b})),W===void 0&&(W={ipAddress:!0,language:!0,platform:!0}),Q===void 0&&(Q="fetch"),ue===void 0&&(ue=!1),be===void 0&&(be=!0),Ee===void 0&&(Ee=!0),Ue===void 0&&(Ue=0),De===void 0&&(De=!1);var L=this,ve;L=e.call(this,{apiKey:r,storageProvider:H,transportProvider:mi(Q)})||this,L.apiKey=r,L.appVersion=n,L.cookieOptions=o,L.defaultTracking=a,L.autocapture=s,L.flushIntervalMillis=c,L.flushMaxRetries=d,L.flushQueueSize=f,L.identityStorage=v,L.ingestionMetadata=h,L.instanceName=p,L.loggerProvider=b,L.logLevel=E,L.minIdLength=y,L.offline=S,L.partnerId=C,L.plan=D,L.serverUrl=x,L.serverZone=U,L.sessionTimeout=M,L.storageProvider=H,L.trackingOptions=W,L.transport=Q,L.useBatch=ue,L.fetchRemoteConfig=be,L.networkTrackingOptions=he,L.identify=Re,L.enableDiagnostics=Ee,L.diagnosticsSampleRate=Ue,L.diagnosticsClient=we,L.remoteConfig=_e,L.topLevelDomain=Oe,
4L.enableRequestBodyCompression=De,L.customEnrichment=Ae,L.version=Nr,L._optOut=!1,L._cookieStorage=i,L.deviceId=l,L.lastEventId=g,L.lastEventTime=m,L.optOut=A,L.deferredSessionId=R,L.sessionId=J,L.pageCounter=q,L.userId=qe,L.debugLogsEnabled=$,L.loggerProvider.enable($?ee.Debug:L.logLevel),L.networkTrackingOptions=he,L.identify=Re,L.enableDiagnostics=Ee,L.diagnosticsSampleRate=Ue,L.diagnosticsClient=we;var Fe=(ve=_e==null?void 0:_e.fetchRemoteConfig)!==null&&ve!==void 0?ve:be;return L.remoteConfig=L.remoteConfig||{},L.remoteConfig.fetchRemoteConfig=Fe,L.fetchRemoteConfig=Fe,L.topLevelDomain=Oe||gi(),L}return Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(r){this._cookieStorage!==r&&(this._cookieStorage=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(r){this._deviceId!==r&&(this._deviceId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(r){this._userId!==r&&(this._userId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(r){this._sessionId!==r&&(this._sessionId=r,r!==void 0&&this._deferredSessionId!==void 0&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(r){this._deferredSessionId!==r&&r!==this.sessionId&&(this._deferredSessionId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut!==r&&(this._optOut=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(r){this._lastEventTime!==r&&(this._lastEventTime=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(r){this._lastEventId!==r&&(this._lastEventId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(r){this._pageCounter!==r&&(this._pageCounter=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(r){this._debugLogsEnabled!==r&&(this._debugLogsEnabled=r,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var r={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof ar&&(r.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(ni(this.apiKey),r)},t})(Ka),iu=function(e,t,r,n,i){return t===void 0&&(t={}),(0,u.sH)(void 0,void 0,void 0,function(){var o,a,s,l,c,d,f,v,h,p,g,m,b,E,y,S,A,C,D,x,U,J,R,M,H,W,Q,ue,be,qe,q,$,he,Re,Ee,Ue,we,_e,Oe,De,Ae,L,ve,Fe,Rt,dt,ft,vt,tt,ht,pt;return(0,u.YH)(this,function(ze){switch(ze.label){case 0:return o=t.identityStorage||ur,a="",o===ur&&!(!((J=t.cookieOptions)===null||J===void 0)&&J.domain)&&((R=t.cookieOptions)===null||R===void 0?void 0:R.domain)!==""?[4,su(void 0,n)]:[3,2];case 1:a=ze.sent(),ze.label=2;case 2:return s=(0,u.Cl)({domain:(H=(M=t.cookieOptions)===null||M===void 0?void 0:M.domain)!==null&&H!==void 0?H:a,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),l={duplicateResolverFn:function(Kt){var En=ti(Kt);if(!En)return!1;var Le=JSON.parse(En);return ri(Le.cookieDomain,s.domain)},diagnosticsClient:n},c=ou(t.identityStorage,s,l),[4,Fs(e,c,(Q=(W=t.cookieOptions)===null||W===void 0?void 0:W.upgrade)!==null&&Q!==void 0?Q:!0)];case 3:return d=ze.sent(),[4,c.get(ni(e))];case 4:return f=ze.sent(),v=Ke(),h=v.ampTimestamp?Number(v.ampTimestamp):void 0,p=h?Date.now()<h:!0,g=($=(q=(qe=(ue=t.deviceId)!==null&&ue!==void 0?ue:p?(be=v.ampDeviceId)!==null&&be!==void 0?be:v.deviceId:void 0)!==null&&qe!==void 0?qe:f==null?void 0:f.deviceId)!==null&&q!==void 0?q:d.deviceId)!==null&&$!==void 0?$:me(),m=(he=f==null?void 0:f.lastEventId)!==null&&he!==void 0?he:d.lastEventId,b=(Re=f==null?void 0:f.lastEventTime)!==null&&Re!==void 0?Re:d.lastEventTime,E=(Ue=(Ee=t.optOut)!==null&&Ee!==void 0?Ee:f==null?void 0:f.optOut)!==null&&Ue!==void 0?Ue:d.optOut,y=(we=f==null?void 0:f.sessionId)!==null&&we!==void 0?we:d.sessionId,S=f==null?void 0:f.deferredSessionId,A=(Oe=(_e=t.userId)!==null&&_e!==void 0?_e:f==null?void 0:f.userId)!==null&&Oe!==void 0?Oe:d.userId,r.previousSessionDeviceId=(De=f==null?void 0:f.deviceId)!==null&&De!==void 0?De:d.deviceId,r.previousSessionUserId=(Ae=f==null?void 0:f.userId)!==null&&Ae!==void 0?Ae:d.userId,C={ipAddress:(ve=(L=t.trackingOptions)===null||L===void 0?void 0:L.ipAddress)!==null&&ve!==void 0?ve:!0,language:(Rt=(Fe=t.trackingOptions)===null||Fe===void 0?void 0:Fe.language)!==null&&Rt!==void 0?Rt:!0,platform:(ft=(dt=t.trackingOptions)===null||dt===void 0?void 0:dt.platform)!==null&&ft!==void 0?ft:!0},D=f==null?void 0:f.pageCounter,x=f==null?void 0:f.debugLogsEnabled,t.autocapture!==void 0&&(t.defaultTracking=t.autocapture),U=new nu(e,t.appVersion,c,s,t.defaultTracking,t.autocapture,g,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,o,t.ingestionMetadata,t.instanceName,m,b,(vt=i==null?void 0:i.loggerProvider)!==null&&vt!==void 0?vt:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,E,t.partnerId,t.plan,t.serverUrl,(tt=i==null?void 0:i.serverZone)!==null&&tt!==void 0?tt:t.serverZone,y,S,t.sessionTimeout,t.storageProvider,C,t.transport,t.useBatch,t.fetchRemoteConfig,A,D,x,t.networkTrackingOptions,t.identify,(ht=i==null?void 0:i.enableDiagnostics)!==null&&ht!==void 0?ht:t.enableDiagnostics,(pt=i==null?void 0:i.diagnosticsSampleRate)!==null&&pt!==void 0?pt:r._diagnosticsSampleRate,n,t.remoteConfig,a,t.enableRequestBodyCompression,t.customEnrichment),[4,U.storageProvider.isEnabled()];case 5:return ze.sent()||(U.loggerProvider.warn("Storage provider ".concat(U.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),U.storageProvider=new xr),[2,U]}})})},ou=function(e,t,r){switch(e===void 0&&(e=ur),t===void 0&&(t={}),e){case"localStorage":return new oi;case"sessionStorage":return new xs;case"none":return new xr;default:return new ar((0,u.Cl)((0,u.Cl)({},t),{expirationDays:t.expiration}),r)}},au=function(e){var t,r;return e===void 0&&(e={}),((t=e.remoteConfig)===null||t===void 0?void 0:t.fetchRemoteConfig)===!0?!0:!(((r=e.remoteConfig)===null||r===void 0?void 0:r.fetchRemoteConfig)===!1||e.fetchRemoteConfig===!1)},mi=function(e){var t=typeof e=="object"?e.type:e,r=typeof e=="object"?e.headers:void 0;return t==="xhr"?new Ms(r):t==="beacon"?new Hs:new Us(r)},su=function(e,t){return(0,u.sH)(void 0,void 0,void 0,function(){var r,n,i,o,a,a,s,l,c;return(0,u.YH)(this,function(d){switch(d.label){case 0:return[4,new ar(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!d.sent()||!e&&(typeof location=="undefined"||!location.hostname))return[2,""];if(r=e!=null?e:location.hostname,n=r.split("."),n.length===1)return[2,""];for(i=[],o=1,pi.find(function(f){return r.endsWith(".".concat(f))})&&(o=2),a=n.length-o-1;a>=0;--a)i.push(n.slice(a).join("."));a=0,d.label=2;case 2:if(!(a<i.length))return[3,7];s=i[a],d.label=3;case 3:return d.trys.push([3,5,,6]),[4,ar.isDomainWritable(s)];case 4:return l=d.sent(),l?[2,"."+s]:[3,6];case 5:return c=d.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(s),error:c instanceof Error?c.message:String(c)}),[3,6];case 6:return a++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(r)}),[2,""]}})})},Br=function(){var e="ampIntegrationContext";if(typeof globalThis!="undefined"&&typeof globalThis[e]!="undefined")return globalThis[e];if(typeof globalThis!="undefined")return globalThis;if(typeof window!="undefined")return window;if(typeof self!="undefined")return self;if(typeof Y.g!="undefined")return Y.g},uu="data-amp-mask",Nt="*****",cu=/\b(?:\d[ -]*?){13,16}\b/,lu=/(\d{3}-?\d{2}-?\d{4})/g,du=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,fu=function(e,t){var r,n;if(t===void 0&&(t=[]),typeof e!="string")return"";var i=e;i=i.replace(cu,Nt),i=i.replace(lu,Nt),i=i.replace(du,Nt);try{for(var o=(0,u.Ju)(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,Nt)}catch(l){}}}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},vu=function(e){if(typeof document=="undefined"||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(uu)?Nt:e?e(document.title):document.title},hu=function(e){return e?(e^Math.random()*16>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Gr)},yi=(0,u.fX)([],(0,u.zs)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),Gr=function(e){var t,r=Br();if(!(!((t=r==null?void 0:r.crypto)===null||t===void 0)&&t.getRandomValues))return hu(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=n[6]&15|64,n[8]=n[8]&63|128,(0,u.fX)([],(0,u.zs)(n.entries()),!1).map(function(i){var o=(0,u.zs)(i,2),a=o[0],s=o[1];return[4,6,8,10].includes(a)?"-".concat(yi[s]):yi[s]}).join("")},pu=Y(96763),gu=(function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i,o;return(0,u.YH)(this,function(a){switch(a.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",a.label=1;case 1:return a.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return a.sent(),[4,r.get(n)];case 3:return i=a.sent(),[2,i===t];case 4:return o=a.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return a.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n;return(0,u.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return r=i.sent(),r?[2,JSON.parse(r)]:[2,void 0];case 2:return n=i.sent(),pu.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(t){var r;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(n){return[2,((r=this.storage)===null||r===void 0?void 0:r.getItem(t))||void 0]})})},e.prototype.set=function(t,r){var n;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(i){try{(n=this.storage)===null||n===void 0||n.setItem(t,JSON.stringify(r))}catch(o){}return[2]})})},e.prototype.remove=function(t){var r;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(n){try{(r=this.storage)===null||r===void 0||r.removeItem(t)}catch(i){}return[2]})})},e.prototype.reset=function(){var t;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(r){try{(t=this.storage)===null||t===void 0||t.clear()}catch(n){}return[2]})})},e})(),mu=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},bi=function(){var e,t=Br();if(!(!((e=t==null?void 0:t.location)===null||e===void 0)&&e.search))return{};
4var r=t.location.search.substring(1).split("&").filter(Boolean),n=r.reduce(function(i,o){var a=o.split("=",2),s=Ei(a[0]),l=Ei(a[1]);return l&&(i[s]=l),i},{});return n},Ei=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch(t){return""}},jf="-",yu="AMP",qf="".concat(yu,"_unsent"),zf="$default_instance",Xf="https://api2.amplitude.com/2/httpapi",Wf="https://api.eu.amplitude.com/2/httpapi",Kf="https://api2.amplitude.com/batch",Jf="https://api.eu.amplitude.com/batch",bu="utm_campaign",Eu="utm_content",_u="utm_id",Tu="utm_medium",Su="utm_source",wu="utm_term",_i="dclid",Ti="fbclid",Si="gbraid",wi="gclid",Ii="ko_click_id",Ai="li_fat_id",Ci="msclkid",Pi="rdt_cid",ki="ttclid",Ri="twclid",Oi="wbraid",$f="EMPTY",Di={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Qf="MKTG",Zf=null,ev=null,Iu=(function(){function e(){}return e.prototype.parse=function(){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(t){return[2,(0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)({},Di),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=bi(),r=t[bu],n=t[Eu],i=t[_u],o=t[Tu],a=t[Su],s=t[wu];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:a,utm_term:s}},e.prototype.getReferrer=function(){var t,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(t=n.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&r!==void 0?r:void 0}catch(i){}return n},e.prototype.getClickIds=function(){var t,r=bi();return t={},t[_i]=r[_i],t[Ti]=r[Ti],t[Si]=r[Si],t[wi]=r[wi],t[Ii]=r[Ii],t[Ai]=r[Ai],t[Ci]=r[Ci],t[Pi]=r[Pi],t[ki]=r[ki],t[Ri]=r[Ri],t[Oi]=r[Oi],t},e})(),lr;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(lr||(lr={}));var Li;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(Li||(Li={}));var Au="[Amplitude] Page Viewed",jr="AMP_PAGE_VIEW",Ni=function(e){e===void 0&&(e={});var t,r=Br(),n=void 0,i=!1,o,a,s=e.trackOn,l=e.trackHistoryChanges,c=e.eventType,d=c===void 0?Au:c,f=function(E){var y=E;try{y=decodeURI(E)}catch(S){n==null||n.error("Malformed URI sequence: ",S)}return y},v=function(E){return(0,u.sH)(void 0,void 0,void 0,function(){var y,S,A;return(0,u.YH)(this,function(C){switch(C.label){case 0:return y=f(typeof location!="undefined"&&location.href||""),A={event_type:d},S=[{}],[4,Cu()];case 1:return[2,(A.event_properties=u.Cl.apply(void 0,[u.Cl.apply(void 0,S.concat([C.sent()])),{"[Amplitude] Page Domain":typeof location!="undefined"&&location.hostname||"","[Amplitude] Page Location":y,"[Amplitude] Page Path":typeof location!="undefined"&&f(location.pathname)||"","[Amplitude] Page Title":vu(fu),"[Amplitude] Page URL":y.split("?")[0],"[Amplitude] Page View ID":E}]),A)]}})})},h=function(){return typeof s=="undefined"||typeof s=="function"&&s()},p=typeof location!="undefined"?location.href:null,g=function(){return(0,u.sH)(void 0,void 0,void 0,function(){var E,y,S,A,C,D;return(0,u.YH)(this,function(x){switch(x.label){case 0:return E=location.href,y=ku(l,E,p||"")&&h(),p=E,y?(S=void 0,a&&(S=Gr(),a.set(jr,{pageViewId:S})),n==null||n.log("Tracking page view event"),t!=null?[3,1]:(A=void 0,[3,3])):[3,4];case 1:return D=(C=t).track,[4,v(S)];case 2:A=D.apply(C,[x.sent()]),x.label=3;case 3:x.label=4;case 4:return[2]}})})},m=function(){g()},b={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(E,y){return(0,u.sH)(void 0,void 0,void 0,function(){var S,A,C;return(0,u.YH)(this,function(D){switch(D.label){case 0:if(t=y,o=E,n=E.loggerProvider,n.log("Installing @amplitude/plugin-page-view-tracking-browser"),i=!0,r){try{a=new gu(r.sessionStorage)}catch(x){n==null||n.debug("sessionStorage is not available in this environment.")}r.addEventListener("popstate",m),r.history.pushState=new Proxy(r.history.pushState,{apply:function(x,U,J){var R=(0,u.zs)(J,3),M=R[0],H=R[1],W=R[2];x.apply(U,[M,H,W]),i&&m()}})}return h()?(n.log("Tracking page view event"),S=void 0,a&&(S=Gr(),a.set(jr,{pageViewId:S})),C=(A=t).track,[4,v(S)]):[3,2];case 1:C.apply(A,[D.sent()]),D.label=2;case 2:return[2]}})})},execute:function(E){return(0,u.sH)(void 0,void 0,void 0,function(){var y,S,A;return(0,u.YH)(this,function(C){switch(C.label){case 0:return s==="attribution"&&Pu(E)?(n==null||n.log("Enriching c
4ampaign event to page view event with campaign parameters"),y=void 0,a?[4,a.get(jr)]:[3,2]):[3,4];case 1:S=C.sent(),y=S==null?void 0:S.pageViewId,C.label=2;case 2:return[4,v(y)];case 3:A=C.sent(),E.event_type=A.event_type,E.event_properties=(0,u.Cl)((0,u.Cl)({},E.event_properties),A.event_properties),C.label=4;case 4:return o&&E.event_type===d&&(o.pageCounter=o.pageCounter?o.pageCounter+1:1,E.event_properties=(0,u.Cl)((0,u.Cl)({},E.event_properties),{"[Amplitude] Page Counter":o.pageCounter})),[2,E]}})})},teardown:function(){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(E){return r&&(r.removeEventListener("popstate",m),i=!1),[2]})})}};return b},Cu=function(){return(0,u.sH)(void 0,void 0,void 0,function(){var e;return(0,u.YH)(this,function(t){switch(t.label){case 0:return e=mu,[4,new Iu().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},Pu=function(e){if(e.event_type==="$identify"&&e.user_properties){var t=e.user_properties,r=t[lr.SET]||{},n=t[lr.UNSET]||{},i=(0,u.fX)((0,u.fX)([],(0,u.zs)(Object.keys(r)),!1),(0,u.zs)(Object.keys(n)),!1);return Object.keys(Di).every(function(o){return i.includes(o)})}return!1},ku=function(e,t,r){switch(e){case"pathOnly":{if(r=="")return!0;var n=new URL(t),i=new URL(r),o=n.origin+n.pathname,a=i.origin+i.pathname;return o!==a}default:return t!==r}},Ru=function(){var e,t=[],r=function(d,f,v){d.addEventListener(f,v),t.push({element:d,type:f,handler:v})},n=function(){t.forEach(function(d){var f=d.element,v=d.type,h=d.handler;f==null||f.removeEventListener(v,h)}),t=[]},i,o="@amplitude/plugin-form-interaction-tracking-browser",a="enrichment",s=function(d,f){return(0,u.sH)(void 0,void 0,void 0,function(){var v,h;return(0,u.YH)(this,function(p){return i=ws(d),v=function(){if(!f){d.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if(typeof document!="undefined"){var g=new WeakSet,m=function(E){if(!g.has(E)){g.add(E);var y=!1;r(E,"change",function(){var S,A=xi(E);y||f.track(ci,(S={},S[Fr]=_t(E.id),S[Vr]=_t(E.name),S[Yr]=A,S)),y=!0}),r(E,"submit",function(S){var A,C,D=xi(E);if(y||f.track(ci,(A={},A[Fr]=_t(E.id),A[Vr]=_t(E.name),A[Yr]=D,A)),y=!0,(i==null?void 0:i.shouldTrackSubmit)!==void 0)if(typeof i.shouldTrackSubmit=="function"&&typeof SubmitEvent!="undefined"&&S instanceof SubmitEvent)try{var x=i.shouldTrackSubmit(S);if(!x)return}catch(U){d.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else d.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");f.track(Ys,(C={},C[Fr]=_t(E.id),C[Vr]=_t(E.name),C[Yr]=D,C)),y=!1})}},b=Array.from(document.getElementsByTagName("form"));b.forEach(m),typeof MutationObserver!="undefined"&&(e=new MutationObserver(function(E){E.forEach(function(y){y.addedNodes.forEach(function(S){S.nodeName==="FORM"&&m(S),"querySelectorAll"in S&&typeof S.querySelectorAll=="function"&&Array.from(S.querySelectorAll("form")).map(m)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?v():(h=X(),h?h.addEventListener("load",v):d.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},l=function(d){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(f){return[2,d]})})},c=function(){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(d){return e==null||e.disconnect(),n(),[2]})})};return{name:o,type:a,setup:s,execute:l,teardown:c}},_t=function(e){if(typeof e=="string")return e},xi=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(t!=null?t:""),window.location.href).href}catch(r){}return t},Ou=function(){var e,t=[],r=function(c,d,f){c.addEventListener(d,f),t.push({element:c,type:d,handler:f})},n=function(){t.forEach(function(c){var d=c.element,f=c.type,v=c.handler;d==null||d.removeEventListener(f,v)}),t=[]},i="@amplitude/plugin-file-download-tracking-browser",o="enrichment",a=function(c,d){return(0,u.sH)(void 0,void 0,void 0,function(){var f,v;return(0,u.YH)(this,function(h){return f=function(){if(!d){c.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if(typeof document!="undefined"){var p=function(b){var E;try{E=new URL(b.href,window.location.href)}catch(A){return}var y=g.exec(E.href),S=y==null?void 0:y[1];S&&r(b,"click",function(){var A;S&&d.track(Bs,(A={},A[Gs]=S,A[js]=E.pathname,A[qs]=b.id,A[zs]=b.text,A[Xs]=b.href,A))})},g=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/,m=Array.from(document.getElementsByTagName("a"));m.forEach(p),typeof MutationObserver!="undefined"&&(e=new MutationObserver(function(b){b.forEach(function(E){E.addedNodes.forEac
4h(function(y){y.nodeName==="A"&&p(y),"querySelectorAll"in y&&typeof y.querySelectorAll=="function"&&Array.from(y.querySelectorAll("a")).map(p)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(v=X(),v?v.addEventListener("load",f):c.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},s=function(c){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(d){return[2,c]})})},l=function(){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(c){return e==null||e.disconnect(),n(),[2]})})};return{name:i,type:o,setup:a,execute:s,teardown:l}},qr=!1,Du=function(e){if(!(qr||e.defaultTracking!==void 0)){var t=`\`options.defaultTracking\` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to \`options.defaultTracking\`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example: 5 6amplitude.init(<YOUR_API_KEY>, { 7 defaultTracking: true, 8}); 9 10Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`;e.loggerProvider.warn(t),qr=!0}},tv=function(){qr=!1},Lu=function(){var e="@amplitude/plugin-network-checker-browser",t="before",r=X(),n=[],i=function(l,c){r!=null&&r.addEventListener&&(r==null||r.addEventListener(l,c),n.push({type:l,handler:c}))},o=function(){n.forEach(function(l){var c=l.type,d=l.handler;r==null||r.removeEventListener(c,d)}),n=[]},a=function(l,c){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(d){return typeof navigator=="undefined"?(l.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),l.offline=!1,[2]):(l.offline=!navigator.onLine,i("online",function(){l.loggerProvider.debug("Network connectivity changed to online."),l.offline=!1,setTimeout(function(){c.flush()},l.flushIntervalMillis)}),i("offline",function(){l.loggerProvider.debug("Network connectivity changed to offline."),l.offline=!0}),[2])})})},s=function(){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(l){return o(),[2]})})};return{name:e,type:t,setup:a,teardown:s}};function Mi(e){var t,r,n,i,o,a,s,l,c,d,f,v;if(!(typeof e!="object"||e===null)&&!Array.isArray(e)){var h=Object.keys(e);try{for(var p=(0,u.Ju)(h),g=p.next();!g.done;g=p.next()){var m=g.value;try{var b=e[m];typeof(b==null?void 0:b.enabled)=="boolean"&&(b.enabled?(delete b.enabled,Object.keys(b).length===0&&(e[m]=!0)):e[m]=!1),Mi(b)}catch(W){}}}catch(W){t={error:W}}finally{try{g&&!g.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}try{if(!((c=(l=(s=e.autocapture)===null||s===void 0?void 0:s.networkTracking)===null||l===void 0?void 0:l.captureRules)===null||c===void 0)&&c.length)try{for(var E=(0,u.Ju)(e.autocapture.networkTracking.captureRules),y=E.next();!y.done;y=E.next()){var S=y.value;try{for(var A=(o=void 0,(0,u.Ju)(["responseHeaders","requestHeaders"])),C=A.next();!C.done;C=A.next()){var D=C.value,x=(d=S[D])!==null&&d!==void 0?d:{},U=x.captureSafeHeaders,J=x.allowlist;if(!(!U&&!J)){if(J!==void 0&&!Array.isArray(J)){delete S[D];continue}S[D]=(0,u.fX)((0,u.fX)([],(0,u.zs)(U?Ha:[]),!1),(0,u.zs)(J!=null?J:[]),!1)}}}catch(W){o={error:W}}finally{try{C&&!C.done&&(a=A.return)&&a.call(A)}finally{if(o)throw o.error}}}}catch(W){n={error:W}}finally{try{y&&!y.done&&(i=E.return)&&i.call(E)}finally{if(n)throw n.error}}}catch(W){}var R=(f=e.autocapture)===null||f===void 0?void 0:f.frustrationInteractions;R&&(R.rageClick&&(R.rageClicks=R.rageClick,delete R.rageClick),R.deadClick&&(R.deadClicks=R.deadClick,delete R.deadClick));try{var M=(v=e.autocapture)===null||v===void 0?void 0:v.elementInteractions;if(M&&typeof M=="object"&&(M.viewportContentUpdated===!0&&(M.viewportContentUpdated={}),M.viewportContentUpdated===!1&&(M.viewportContentUpdated={enabled:!1}),M.exposureDuration!==void 0)){var H=M.viewportContentUpdated;H===void 0?M.viewportContentUpdated={exposureDuration:M.exposureDuration}:typeof H=="object"&&H.exposureDuration===void 0&&H.enabled!==!1&&(H.exposureDuration=M.exposureDuration),delete M.exposureDuration}}catch(W){}}}function Ui(e,t,r){var n,i,o=[];try{for(var a=(0,u.Ju)(t!=null?t:[]),s=a.next();!s.done;s=a.next()){var l=s.value;try{o.push(new RegExp(l))}catch(c){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),c)}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return e.concat(o)}function Nu(e,t){var r,n,i,o,a,s,l;if(e){Mi(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var c=e;if(c&&"autocapture"in c){if(typeof c.autocapture=="boolean"&&(t.autocapture=c.autocapture),typeof c.autocapture=="object"&&c.autocapture!==null){var d=(0,u.Cl)({},c.autocapture);if(t.autocapture===void 0&&(t.autocapture=c.autocapture),typeof c.autocapture.elementInteractions=="object"&&c.autocapture.elementInteractions!==null&&(!((i=c.autocapture.elementInteractions.pageUrlAllowlistRegex)===null||i===void 0)&&i.length)){d.elementInteractions=(0,u.Cl)({},c.autocapture.elementInteractions);var f=d.elementInteractions,v=(o=f.pageUrlAllowlist)!==null&&o!==void 0?o:[],h=c.autocapture.elementInteractions.pageUrlAllowlistRegex;f.pageUrlAllowlist=Ui(v,h,t),delete f.pageUrlAllowlistRegex}
10if(typeof c.autocapture.networkTracking=="object"&&c.autocapture.networkTracking!==null&&(!((a=c.autocapture.networkTracking.captureRules)===null||a===void 0)&&a.length)){d.networkTracking=(0,u.Cl)({},c.autocapture.networkTracking);var p=d.networkTracking,g=(s=p.captureRules)!==null&&s!==void 0?s:[];try{for(var m=(0,u.Ju)(g),b=m.next();!b.done;b=m.next()){var E=b.value;E.urls=Ui((l=E.urls)!==null&&l!==void 0?l:[],E.urlsRegex,t),delete E.urlsRegex}}catch(y){r={error:y}}finally{try{b&&!b.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}}typeof t.autocapture=="boolean"&&(t.autocapture=(0,u.Cl)({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},d)),typeof t.autocapture=="object"&&(t.autocapture=(0,u.Cl)((0,u.Cl)({},t.autocapture),d))}t.defaultTracking=t.autocapture}"customEnrichment"in c&&c.customEnrichment!==null&&t.customEnrichment!==!1&&(t.customEnrichment=c.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(y){t.loggerProvider.error("Failed to apply remote configuration because of error: ",y)}}}var Hi=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],zr="data-amp-track-",Fi=["div","span","h1","h2","h3","h4","h5","h6"],Vi=150,xu=Y(16064),Se=Y.n(xu);function Xr(e,t){return new(Se())(function(r){e.subscribe({next:function(n){t(n).then(function(i){return r.next(i)}).catch(function(i){return r.error(i)})},error:function(n){r.error(n)},complete:function(){r.complete()}})})}function st(e,t){return new(Se())(function(r){var n=!1,i=new Set,o=function(){var s,l;n=!0;try{for(var c=(0,u.Ju)(i),d=c.next();!d.done;d=c.next()){var f=d.value;try{f.unsubscribe()}catch(v){}}}catch(v){s={error:v}}finally{try{d&&!d.done&&(l=c.return)&&l.call(c)}finally{if(s)throw s.error}}i.clear()},a=function(s){var l=s.subscribe({next:function(c){n||r.next(c)},error:function(c){n||(n=!0,r.error(c),o())},complete:function(){i.delete(l),!n&&i.size===0&&(r.complete(),o(),n=!0)}});i.add(l)};return a(e),a(t),o})}function Je(e){var t=new Set,r=null;function n(){r==null||r.unsubscribe(),r=null,t.clear()}return new(Se())(function(i){return t.add(i),r===null&&(r=e.subscribe({next:function(o){var a,s,l;try{for(var c=(0,u.Ju)(t),d=c.next();!d.done;d=c.next()){var f=d.value;(l=f.next)===null||l===void 0||l.call(f,o)}}catch(v){a={error:v}}finally{try{d&&!d.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}},error:function(o){var a,s,l;try{for(var c=(0,u.Ju)(t),d=c.next();!d.done;d=c.next()){var f=d.value;(l=f.error)===null||l===void 0||l.call(f,o)}}catch(v){a={error:v}}finally{try{d&&!d.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}n()},complete:function(){var o,a,s;try{for(var l=(0,u.Ju)(t),c=l.next();!c.done;c=l.next()){var d=c.value;(s=d.complete)===null||s===void 0||s.call(d)}}catch(f){o={error:f}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}n()}})),function(){t.delete(i),t.size===0&&r&&(r.unsubscribe(),r=null)}})}var Wr="https://app.amplitude.com",Mu="https://app.eu.amplitude.com",Uu="https://apps.stag2.amplitude.com",Hu={US:Wr,EU:Mu,STAGING:Uu},Fu="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.3.js.gz",Vu=function(e){var t=document.querySelector('script[src="'.concat(CSS.escape(e),'"]'));return t?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=e,o.addEventListener("load",function(){r({status:!0})},{once:!0}),o.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),(i=document.head)===null||i===void 0||i.appendChild(o)}catch(a){n(a)}})};function Yu(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var Yi,Kr="__AMPLITUDE_MESSENGER_INSTANCE__",dr="__AMPLITUDE_MESSENGER__",Bu=(function(){function e(t){var r=t===void 0?{}:t,n=r.origin,i=n===void 0?Wr:n;this[Yi]=!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 e.prototype.notify=function(t){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(t)),(o=(i=window.opener)===null||i===void 0?void 0:i.postMessage)===null||o===void 0||o.call(i,t,this.endpoint)},e.prototype.sendRequest=function(t,r,n){var i=this;n===void 0&&(n={timeout:15e3});var o=Yu(),a={id:o,action:t,args:r},s=new Promise(function(l,c){i.requestCallbacks[o]={resolve:l,reject:c},i.notify(a),n.timeout>0&&setTimeout(function(){c(new Error("".concat(t," timed out (id: ").concat(o,")"))),delete i.requestCallbacks[o]},n.timeout)});return s},e.prototype.handleResponse=function(t){var r;if(!this.requestCallbacks[t.id]){(r=this.logger)===null||r===void 0||r.warn("No callback found for request id: ".concat(t.id));return}this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]},e.prototype.registerActionHandler=function(t,r){var n,i,o,a;this.actionHandlers.has(t)&&((a=(o=this.logger)===null||o===void 0?void 0:o.warn)===null||a===void 0||a.call(o,"Overwriting existing action handler for: ".concat(t))),this.actionHandlers.set(t,r);var s=this.pendingMessages.get(t);if(s){this.pendingMessages.delete(t);try{for(var l=(0,u.Ju)(s),c=l.next();!c.done;c=l.next()){var d=c.value;r(d)}}catch(f){n={error:f}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n,i;return(0,u.YH)(this,function(o){switch(o.label){case 0:if(r=this.scriptLoadPromises.get(t),r)return[2,r];n=Vu(t).then(function(){}),this.scriptLoadPromises.set(t,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(t),i;case 4:return[2]}})})},e.prototype.setup=function(t){var r=this,n,i,o=t===void 0?{}:t,a=o.logger,s=o.endpoint;a&&(this.logger=a),s&&this.endpoint===Wr&&(this.endpoint=s),!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,d,f,v,h;if((d=(c=r.logger)===null||c===void 0?void 0:c.debug)===null||d===void 0||d.call(c,"Message received: ",JSON.stringify(l)),r.endpoint===l.origin){var p=l.data,g=p==null?void 0:p.action;if(g)if("id"in p&&p.id)(v=(f=r.logger)===null||f===void 0?void 0:f.debug)===null||v===void 0||v.call(f,"Received Response to previous request: ",JSON.stringify(l)),r.handleResponse(p);else{if(g==="ping"){r.notify({action:"pong"});return}var m=r.actionHandlers.get(g);if(m)m(p.data);
10else{var b=(h=r.pendingMessages.get(g))!==null&&h!==void 0?h:[];b.push(p.data),r.pendingMessages.set(g,b)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.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 t=X();(t==null?void 0:t[dr])===this&&delete t[dr]},e})();Yi=Kr;function Gu(e){return typeof e=="object"&&e!==null&&Kr in e&&e[Kr]===!0}function ju(e){var t=X(),r=t==null?void 0:t[dr];if(Gu(r))return r;var n=new Bu(e);return t&&(t[dr]=n),n}var Bi="__AMPLITUDE_BACKGROUND_CAPTURE__";function qu(e,t){var r,n=e;if(n[Bi]!==!0){n[Bi]=!0;var i=(r=t==null?void 0:t.scriptUrl)!==null&&r!==void 0?r:Fu,o=null,a=function(s,l){var c,d;s==="background-capture-complete"&&((d=(c=e.logger)===null||c===void 0?void 0:c.debug)===null||d===void 0||d.call(c,"Background capture complete"),e.notify({action:"background-capture-complete",data:l}))};e.registerActionHandler("initialize-background-capture",function(){var s,l;(l=(s=e.logger)===null||s===void 0?void 0:s.debug)===null||l===void 0||l.call(s,"Initializing background capture (external script)");var c=new URL(i,e.endpoint).toString();e.loadScriptOnce(c).then(function(){var d,f,v;(f=(d=e.logger)===null||d===void 0?void 0:d.debug)===null||f===void 0||f.call(d,"Background capture script loaded (external)"),o=(v=window==null?void 0:window.amplitudeBackgroundCapture)===null||v===void 0?void 0:v.call(window,{messenger:e,onBackgroundCapture:a}),e.notify({action:"background-capture-loaded"})}).catch(function(){var d;(d=e.logger)===null||d===void 0||d.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var s;(s=o==null?void 0:o.close)===null||s===void 0||s.call(o),o=null})}}var Gi="1.27.1",zu="@amplitude/plugin-autocapture-browser",Xu="@amplitude/plugin-frustration-browser",Wu="@amplitude/plugin-performance-browser",ji="[Amplitude] Element Clicked",Ku="[Amplitude] Dead Click",Ju="[Amplitude] Rage Click",$u="[Amplitude] Error Click",Qu="[Amplitude] Element Changed",rv="[Amplitude] Page Scrolled",Zu="[Amplitude] Thrashed Cursor",ec="[Amplitude] Main Thread Block",tc="[Amplitude] Element ID",rc="[Amplitude] Element Class",qi="[Amplitude] Element Tag",zi="[Amplitude] Element Text",nc="[Amplitude] Element Hierarchy",ic="[Amplitude] Element Href",oc="[Amplitude] Element Position Left",ac="[Amplitude] Element Position Top",sc="[Amplitude] Element Aria Label",uc="[Amplitude] Element Attributes",cc="[Amplitude] Element Path",lc="[Amplitude] Element Parent Label",Jr="[Amplitude] Page URL",dc="[Amplitude] Page Title",Xi="[Amplitude] Viewport Height",Wi="[Amplitude] Viewport Width",fc="[Amplitude] Max Page X",vc="[Amplitude] Max Page Y",Ki="[Amplitude] Page View ID",hc="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",pc="amp-visual-tagging-selector-highlight",Ji="data-amp-mask-attributes",gc=25,$i=128,mc="AMP_PAGE_VIEW",yc=18e3,Qi=function(e,t){return!t||!t.length?!0:t.some(function(r){return typeof r=="string"?e===r:e.match(r)})},Zi=function(e,t){var r=e;try{r=decodeURI(e)}catch(n){t==null||t.error("Malformed URI sequence: ",n)}return r},bc=["input","select","textarea"],eo=function(e,t){var r,n=(r=window==null?void 0:window.getComputedStyle)===null||r===void 0?void 0:r.call(window,e);return(n==null?void 0:n.getPropertyValue("cursor"))==="pointer"&&t==="click"},$r=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&Qi(window.location.href,r)||!Qi(window.location.href,t))},Tt=function(e,t,r){return r===void 0&&(r=!1),function(n,i){var o,a,s=e.shouldTrackEventResolver,l=(a=(o=i==null?void 0:i.tagName)===null||o===void 0?void 0:o.toLowerCase)===null||a===void 0?void 0:a.call(o);if(!l)return!1;if(s)return s(n,i);if(!$r(e))return!1;var c=String(i==null?void 0:i.getAttribute("type"))||"";if(typeof c=="string")switch(c.toLowerCase()){case"hidden":return!1;case"password":return!1}var d=eo(i,n);if(r&&d)return!0;
10if(t){var f=t.some(function(v){var h;return!!(!((h=i==null?void 0:i.matches)===null||h===void 0)&&h.call(i,v))});if(!f)return!1}switch(l){case"input":case"select":case"textarea":return n==="change"||n==="click";default:return d?!0:n==="click"}}},nv=function(e){return!!e&&e.nodeType===3},Ec=function(e){var t,r,n,i=(r=(t=e==null?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase)===null||r===void 0?void 0:r.call(t),o=e instanceof HTMLElement?((n=e.getAttribute("contenteditable"))===null||n===void 0?void 0:n.toLowerCase())==="true":!1;return!bc.includes(i)&&!o},_c=function(e){return e?e.split(",").map(function(t){return t.trim()}).filter(function(t){return t.length>0&&t!=="id"&&t!=="class"}):[]},Tc=function(e,t){return Object.entries(e).reduce(function(r,n){var i=(0,u.zs)(n,2),o=i[0],a=i[1];if(o.startsWith(t)){var s=o.replace(t,"");s&&(r[s]=a||"")}return r},{})},Sc=function(e){return e==null||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0},to=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return Sc(n)||(t[r]=n),t},{})},ro=function(){var e;try{var t=X(),r=(e=t==null?void 0:t.sessionStorage)===null||e===void 0?void 0:e.getItem(mc);if(!r)return;var n=JSON.parse(r);if(typeof n.pageViewId=="string")return n.pageViewId}catch(i){}},iv=function(e,t){if(e&&"querySelectorAll"in e&&typeof e.querySelectorAll=="function"){var r=t.reduce(function(n,i){if(i){var o=Array.from(e.querySelectorAll(i));o.forEach(function(a){n.add(a)})}return n},new Set);return Array.from(r)}return[]},Qr=function(e,t){return e?t.some(function(r){var n;return(n=e==null?void 0:e.matches)===null||n===void 0?void 0:n.call(e,r)})?e:Qr(e==null?void 0:e.parentElement,t):null},ov=function(e){return new Promise(function(t,r){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),(n=document.head)===null||n===void 0||n.appendChild(i)}catch(o){r(o)}})};function av(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var xt=function(e){return!(e.event.target===null||!e.closestTrackedAncestor)};function wc(e){return e.type==="click"||e.type==="change"}var fr;(function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"})(fr||(fr={}));var no="__AMPLITUDE_VISUAL_TAGGING__";function Ic(e,t){var r=e;if(r[no]!==!0){r[no]=!0;var n=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,a=t.actionClickAllowlist,s=null,l=function(d){e.notify({action:"element-selected",data:d})},c=function(d,f){d==="selector-mode-changed"?e.notify({action:"track-selector-mode-changed",data:f}):d==="selector-moved"&&e.notify({action:"track-selector-moved",data:f})};e.registerActionHandler("initialize-visual-tagging-selector",function(d){e.loadScriptOnce(hc).then(function(){var f;s=(f=window==null?void 0:window.amplitudeVisualTaggingSelector)===null||f===void 0?void 0:f.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(v){return i?i((d==null?void 0:d.actionType)||"click",v):!0}
10,onTrack:c,onSelect:l,visualHighlightClass:pc,messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:a,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:Gi}}}),e.notify({action:"selector-loaded"})}).catch(function(){var f;(f=e.logger)===null||f===void 0||f.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var d;(d=s==null?void 0:s.close)===null||d===void 0||d.call(s)})}}function Ac(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers,o=r.clickObservable,a=o.filter(xt).filter(function(l){return n("click",l.closestTrackedAncestor)}).map(function(l){return i(l)}),s=a;return s.subscribe(function(l){t==null||t.track(ji,l.targetElementProperties)})}function Cc(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers,a=r.changeObservable,s=a.filter(xt).filter(function(l){return i("change",l.closestTrackedAncestor)}).map(function(l){return o(l)});return s.subscribe(function(l){t==null||t.track(Qu,n("change",l.closestTrackedAncestor))})}function Pc(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,a=e.shouldTrackActionClick,s=r.clickObservable,l=r.mutationObservable,c=r.navigateObservable,d=s.filter(function(m){return!o("click",m.closestTrackedAncestor)}).map(function(m){var b=Qr(m.event.target,n.actionClickAllowlist);return m.closestTrackedAncestor=b,m.closestTrackedAncestor!==null&&(m.targetElementProperties=i(m.type,m.closestTrackedAncestor)),m}).filter(xt).filter(function(m){return a("click",m.closestTrackedAncestor)}),f=c?st(l,c):l,v=st(d,f),h=null,p=null,g=Xr(v,function(m){if(h&&(clearTimeout(h),h=null),m.type==="click")return p=m,h=setTimeout(function(){h=null,p=null},500),Promise.resolve(null);if(p){var b=p;return p=null,Promise.resolve(b)}return Promise.resolve(null)});return g.subscribe(function(m){m&&(t==null||t.track(ji,i("click",m.closestTrackedAncestor)))})}function kc(e){var t=e.amplitude,r=e.allObservables,n=r.scrollObservable,i={maxX:0,maxY:0},o=n.subscribe(function(){var a,s,l,c,d=X(),f=Math.floor((s=(a=d==null?void 0:d.scrollX)!==null&&a!==void 0?a:d==null?void 0:d.pageXOffset)!==null&&s!==void 0?s:0),v=Math.floor((c=(l=d==null?void 0:d.scrollY)!==null&&l!==void 0?l:d==null?void 0:d.pageYOffset)!==null&&c!==void 0?c:0);i.maxX=Math.max(i.maxX,f),i.maxY=Math.max(i.maxY,v)});return{unsubscribe:function(){o.unsubscribe()},getState:function(){return i},reset:function(){i.maxX=0,i.maxY=0}}}var Zr=X(),St=Zr==null?void 0:Zr.console,ut={},Mt={},en=!1;function Rc(e){if(!St||typeof St[e]!="function")return!1;if(Mt[e])return!0;var t=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{if(ut[e]&&!en){en=!0;var i=ut[e];i&&i.forEach(function(o){try{o(e,r)}catch(a){}})}}catch(o){}return en=!1,Mt[e].apply(St,r)};return Mt[e]=St[e],St[e]=t,!0}function Oc(e,t){var r=Rc(e);if(!r)return new Error("Console override failed");ut[e]?ut[e].push(t):ut[e]=[t]}function Dc(e){var t,r;try{for(var n=(0,u.Ju)(Object.values(ut)),i=n.next();!i.done;i=n.next())for(var o=i.value,a=o.length-1;a>=0;a--)if(o[a]===e){o.splice(a,1);break}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}function Lc(){var e,t;try{for(var r=(0,u.Ju)(Object.entries(Mt)),n=r.next();!n.done;n=r.next()){var i=(0,u.zs)(n.value,2),o=i[0],a=i[1];a&&(St[o]=a)}}catch(s){e={error:s}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}Mt={},ut={}}var io={addListener:Oc,removeListener:Dc,_restoreConsole:Lc},wt=X(),oo=function(){return new(Se())(function(e){var t=new MutationObserver(function(r){e.next(r)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},ao=function(e){return e===void 0&&(e="click"),new(Se())(function(t){var r,n=function(i){t.next(i)};return(r=X())===null||r===void 0||r.document.addEventListener(e,n,{capture:!0}),function(){var i;(i=X())===null||i===void 0||i.document.removeEventListener(e,n,{capture:!0})}})},Nc=function(){return new(Se())(function(e){var t,r=function(n){e.next(n)};return(t=X())===null||t===void 0||t.addEventListener("scroll",r),function(){var n;(n=X())===null||n===void 0||n.removeEventListener("scroll",r)}})},xc=function(){return new(Se())(function(e){var t=function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=void 0;Array.isArray(n[0])&&typeof n[0][0]=="string"&&(o=n[0][0]),e.next({kind:"console",message:o})};return io.addListener("error",t),function(){io.removeListener(t)}})},Mc=function(e,t){return new(Se())(function(r){var n,i=X();if(!(i!=null&&i.IntersectionObserver))return function(){};
10var o=new IntersectionObserver(function(c){c.forEach(function(d){r.next(d)})},{root:null,rootMargin:"0px",threshold:1}),a=t.join(","),s=(n=i==null?void 0:i.document.querySelectorAll(a))!==null&&n!==void 0?n:[];s.forEach(function(c){o.observe(c)});var l=e.subscribe(function(c){var d=c.event;return d.forEach(function(f){var v=f.addedNodes;return v.forEach(function(h){h instanceof Element&&(h.matches(a)&&o.observe(h),h.querySelectorAll(a).forEach(function(p){o.observe(p)}))})})});return function(){l.unsubscribe(),o.disconnect()}})},Uc=function(){return new(Se())(function(e){var t=function(r){if(r instanceof ErrorEvent){var n={kind:"error"};r.error instanceof Error||r.error instanceof DOMException?n=(0,u.Cl)((0,u.Cl)({},n),{message:r.error.message,stack:r.error.stack,filename:r.filename,lineNumber:r.lineno,columnNumber:r.colno}):typeof r.error=="string"&&(n.message=r.error),e.next(n)}};return wt.addEventListener("error",t),function(){wt.removeEventListener("error",t)}})},Hc=function(){return new(Se())(function(e){var t=function(r){var n={kind:"unhandledrejection"};r.reason instanceof Error||r.reason instanceof DOMException?(n.message=r.reason.message,n.stack=r.reason.stack):typeof r.reason=="string"&&(n.message=r.reason),e.next(n)};return wt.addEventListener("unhandledrejection",t),function(){wt.removeEventListener("unhandledrejection",t)}})},Fc=function(){var e=st(Uc(),Hc());return st(e,xc())},Vc=function(){return new(Se())(function(e){var t=function(n){e.next(n)},r={capture:!0};return wt.document.addEventListener("mousemove",t,r),function(){wt.document.removeEventListener("mousemove",t,r)}})},Yc=Y(96763),Bc=function(e,t){try{if(t.subprop_key==="[Amplitude] Element Text")return t.subprop_op==="is"&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if(t.subprop_key==="[Amplitude] Element Hierarchy")return t.subprop_op==="autotrack css match"&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(r){return Yc.error("Error matching event to filter",r),!1}return!1},Gc=function(e,t){try{if(e.sourceType==="DOM_ELEMENT"){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}catch(n){return}},jc=function(e,t,r){e.forEach(function(n){if(typeof n!="string"&&n.actionType==="ATTACH_EVENT_PROPERTY"){var i=r.extractDataFromDataSource(n.dataSource,t.closestTrackedAncestor);t.targetElementProperties[n.destinationKey]=i}})},qc=Y(96763),tn={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},so=function(e){var t,r,n,i,o=Object.values(tn).reduce(function(h,p){return h[p]=new Set,h},{});if(!e)return o;try{for(var a=(0,u.Ju)(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{try{for(var c=(n=void 0,(0,u.Ju)(l.definition)),d=c.next();!d.done;d=c.next()){var f=d.value,v=tn[f.event_type];v&&o[v].add(l.id)}}catch(h){n={error:h}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}catch(h){qc.warn("Skipping Labeled Event due to malformed definition",l==null?void 0:l.id,h)}}}catch(h){t={error:h}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},uo=function(e){var t,r,n,i,o=new Map;try{for(var a=(0,u.Ju)(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var c=(n=void 0,(0,u.Ju)(l.conditions)),d=c.next();!d.done;d=c.next()){var f=d.value;if(f.type==="LABELED_EVENT"){var v=f.match.eventId,h=o.get(v);h||(h=[],o.set(v,h)),h.push(l)}}}catch(p){n={error:p}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},zc=function(e,t){return t.filter(function(r){return r.definition.some(function(n){return tn[n.event_type]===e.type&&n.filters.every(function(i){return Bc(e,i)})})})},Xc=function(e,t){var r,n,i,o,a=new Set;try{for(var s=(0,u.Ju)(e),l=s.next();!l.done;l=s.next()){var c=l.value,d=t.get(c.id);if(d)try{for(var f=(i=void 0,(0,u.Ju)(d)),v=f.next();!v.done;v=f.next()){var h=v.value;a.add(h)}}catch(p){i={error:p}}finally{try{v&&!v.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}}catch(p){r={error:p}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(a)},Wc=(function(){function e(t,r,n,i){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=r,this.dataExtractor=n,this.options=i}return e.prototype.evaluate=function(t){var r,n,i=this.options.pageActions;if(!i)return t;var o=zc(t,Array.from(this.groupedLabeledEvents[t.type]).map(function(d){return i.labeledEvents[d]})),a=Xc(o,this.labeledEventToTriggerMap);try{for(var s=(0,u.Ju)(a),l=s.next();!l.done;l=s.next()){var c=l.value;jc(c.actions,t,this.dataExtractor)}}catch(d){r={error:d}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return t},e.prototype.update=function(t,r,n){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=r,this.options=n},e})(),Kc=function(e,t,r,n){return new Wc(e,t,r,n)},It="data-amp-mask",it="*****",Jc=/\b(?:\d[ -]*?){13,16}\b/,$c=/(\d{3}-?\d{2}-?\d{4})/g,Qc=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Zc=function(e,t){var r,n;if(t===void 0&&(t=[]),typeof e!="string")return"";var i=e;i=i.replace(Jc,it),i=i.replace($c,it),i=i.replace(Qc,it);try{for(var o=(0,u.Ju)(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,it)}catch(l){}}}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},el=function(e){if(typeof document=="undefined"||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(It)?it:e?e(document.title):document.title},tl=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",Ji,It]),rl=["type"],nl=["svg","path","g"],il=["password","hidden"],sv=1024;function ol(e,t){var r,n,i,o,a,s;if(e===null)return null;var l=String(e.tagName).toLowerCase(),c={tag:l},d=Array.from((o=(i=e.parentElement)===null||i===void 0?void 0:i.children)!==null&&o!==void 0?o:[]);d.length&&(c.index=d.indexOf(e),c.indexOfType=d.filter(function(A){return A.tagName===e.tagName}).indexOf(e));var f=(s=(a=e.previousElementSibling)===null||a===void 0?void 0:a.tagName)===null||s===void 0?void 0:s.toLowerCase();f&&(c.prevSib=String(f));var v=e.getAttribute("id");v&&(c.id=String(v));var h=Array.from(e.classList);h.length&&(c.classes=h);var p={},g=Array.from(e.attributes),m=g.filter(function(A){return!tl.has(A.name)}),b=!Ec(e);if(!il.includes(String(e.getAttribute("type")))&&!nl.includes(l))try{for(var E=(0,u.Ju)(m),y=E.next();!y.done;y=E.next()){var S=y.value;
10if(!(b&&!rl.includes(S.name))){if(t.has(S.name)){p[S.name]=it;continue}p[S.name]=String(S.value).substring(0,$i)}}}catch(A){r={error:A}}finally{try{y&&!y.done&&(n=E.return)&&n.call(E)}finally{if(r)throw r.error}}return Object.keys(p).length&&(c.attrs=p),c}function al(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&r.tagName!=="HTML";)t.push(r),r=r.parentElement;return t}var Ut=(function(){function e(t,r){this.value=t,this.optimized=r}return e.prototype.toString=function(){return this.value},e})(),sl=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=ul(n,!!t,n===e);if(!i||(r.push(i),i.optimized))break;n=n.parentElement}return r.reverse(),r.join(" > ")},ul=function(e,t,r){var n,i;if(e.nodeType!==Node.ELEMENT_NODE)return null;var o=e.getAttribute("id");if(t){if(o)return new Ut(d(o),!0);var a=e.tagName.toLowerCase();if(a==="body"||a==="head"||a==="html")return new Ut(a,!0)}var s=e.tagName.toLowerCase();if(o)return new Ut(s+d(o),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new Ut(s,!0);function c(R){var M=R.getAttribute("class");return M?M.split(/\s+/g).filter(Boolean).map(function(H){return"$"+H}):[]}function d(R){return"#"+CSS.escape(R)}for(var f=c(e),v=!1,h=!1,p=-1,g=-1,m=l.children,b=0;m&&(p===-1||!h)&&b<m.length;++b){var E=m[b];if(E.nodeType===Node.ELEMENT_NODE){if(g+=1,E===e){p=g;continue}if(!h&&E.tagName.toLowerCase()===s){v=!0;var y=new Set(f);if(!y.size){h=!0;continue}for(var S=c(E),A=0;A<S.length;++A){var C=S[A];if(y.has(C)&&(y.delete(C),!y.size)){h=!0;break}}}}}var D=s;if(r&&s.toLowerCase()==="input"&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(D+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),h)D+=":nth-child("+String(p+1)+")";else if(v)try{for(var x=(0,u.Ju)(f),U=x.next();!U.done;U=x.next()){var J=U.value;D+="."+CSS.escape(J.slice(1))}}catch(R){n={error:R}}finally{try{U&&!U.done&&(i=x.return)&&i.call(x)}finally{if(n)throw n.error}}return new Ut(D,!1)},co=(function(){function e(t,r){var n,i,o=this,a;this.replaceSensitiveString=function(v){return Zc(v,o.additionalMaskTextPatterns)},this.getHierarchy=function(v){var h,p,g,m,b=performance.now(),E=[];if(!v)return[];for(var y=al(v),S=new Map,A=y.length-1;A>=0;A--){var C=y[A];if(C){var D=_c(C.getAttribute(Ji)),x=A===y.length-1?[]:(g=S.get(y[A+1]))!==null&&g!==void 0?g:new Set,U=new Set((0,u.fX)((0,u.fX)([],(0,u.zs)(x),!1),(0,u.zs)(D),!1));S.set(C,U)}}E=y.map(function(Q){var ue;return ol(Q,(ue=S.get(Q))!==null&&ue!==void 0?ue:new Set)});var J=function(Q){Q!=null&&Q.attrs&&Object.entries(Q.attrs).forEach(function(ue){var be=(0,u.zs)(ue,2),qe=be[0],q=be[1];Q.attrs&&(Q.attrs[qe]=o.replaceSensitiveString(q))})};try{for(var R=(0,u.Ju)(E),M=R.next();!M.done;M=R.next()){var H=M.value;J(H)}}catch(Q){h={error:Q}}finally{try{M&&!M.done&&(p=R.return)&&p.call(R)}finally{if(h)throw h.error}}var W=performance.now();return(m=o.diagnosticsClient)===null||m===void 0||m.recordHistogram("autocapturePlugin.getHierarchy",W-b),E},this.getNearestLabel=function(v){var h=v.parentElement;if(!h)return"";var p;try{p=h.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(g){p=null}return p?o.getText(p):o.getNearestLabel(h)},this.getElementPath=function(v){var h;if(!v)return"";var p=performance.now(),g=sl(v),m=performance.now();return(h=o.diagnosticsClient)===null||h===void 0||h.recordHistogram("autocapturePlugin.getElementPath",m-p),g},this.getEventProperties=function(v,h,p){var g,m,b,E,y=(b=(m=h==null?void 0:h.tagName)===null||m===void 0?void 0:m.toLowerCase)===null||b===void 0?void 0:b.call(m),S=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():{left:null,top:null},A=o.getHierarchy(h),C=(E=A[0])===null||E===void 0?void 0:E.attrs,D=o.getNearestLabel(h),x=Tc(C!=null?C:{},p),U=(g={},g[nc]=A,g[qi]=y,g[zi]=o.getText(h),g[oc]=S.left==null?null:Math.round(S.left),g[ac]=S.top==null?null:Math.round(S.top),g[uc]=x,g[cc]=o.getElementPath(h),g[lc]=D,g[Jr]=Zi(window.location.href.split("?")[0]),g[dc]=el(o.replaceSensitiveString),g[Xi]=window.innerHeight,g[Wi]=window.innerWidth,g),J=ro();if(J&&(U[Ki]=J),U[tc]=h.getAttribute("id")||"",U[rc]=h.getAttribute("class"),U[sc]=C==null?void 0:C["aria-label"],y==="a"&&v==="click"&&h instanceof HTMLAnchorElement){var R=h.href.substring(0,$i);
10U[ic]=o.replaceSensitiveString(R)}return to(U)},this.addTypeAndTimestamp=function(v,h){return{event:v,timestamp:Date.now(),type:h}},this.addAdditionalEventProperties=function(v,h,p,g,m){m===void 0&&(m=!1);var b=o.addTypeAndTimestamp(v,h);if(wc(b)&&b.event.target!==null){if(m){var E=eo(b.event.target,b.type);if(E)return b.closestTrackedAncestor=b.event.target,b.targetElementProperties=o.getEventProperties(b.type,b.closestTrackedAncestor,g),b}var y=Qr(b.event.target,p);return y&&(b.closestTrackedAncestor=y,b.targetElementProperties=o.getEventProperties(b.type,y,g)),b}return b},this.extractDataFromDataSource=function(v,h){if(v.sourceType==="DOM_ELEMENT"){var p=Gc(v,h);return p?v.elementExtractType==="TEXT"?o.getText(p):v.elementExtractType==="ATTRIBUTE"&&v.attribute?p.getAttribute(v.attribute):void 0:void 0}},this.getTextWithMaskedDescendants=function(v){var h,p,g="[".concat(It,"], [contenteditable]");if(!v.querySelector(g))return v.innerText;var m="",b=Array.from(v.childNodes);try{for(var E=(0,u.Ju)(b),y=E.next();!y.done;y=E.next()){var S=y.value;if(S.nodeType===Node.TEXT_NODE){m+=S.textContent||"";continue}if(S instanceof Element){if(S.hasAttribute(It)||S.hasAttribute("contenteditable")){m+=it;continue}m+=o.getTextWithMaskedDescendants(S)}}}catch(A){h={error:A}}finally{try{y&&!y.done&&(p=E.return)&&p.call(E)}finally{if(h)throw h.error}}return m},this.getText=function(v){var h=v.closest("[".concat(It,"]"))!==null;if(h)return it;var p="";return v.querySelector("[".concat(It,"], [contenteditable]"))?p=o.getTextWithMaskedDescendants(v):p=v.innerText||"",o.replaceSensitiveString(p.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(v){var h,p,g;if(!v)return{};var m=(g=(p=v==null?void 0:v.tagName)===null||p===void 0?void 0:p.toLowerCase)===null||g===void 0?void 0:g.call(p),b=(h={},h[qi]=m,h[zi]=o.getText(v),h[Jr]=window.location.href.split("?")[0],h);return to(b)},this.diagnosticsClient=r==null?void 0:r.diagnosticsClient;var s=(a=t.maskTextRegex)!==null&&a!==void 0?a:[],l=[];try{for(var c=(0,u.Ju)(s),d=c.next();!d.done;d=c.next()){var f=d.value;if(l.length>=gc)break;if(f instanceof RegExp)l.push(f);else if("pattern"in f&&typeof f.pattern=="string")try{l.push(new RegExp(f.pattern,"i"))}catch(v){}}}catch(v){n={error:v}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=l}return e})();function cl(e){var t=e.allObservables,r=e.onExposure,n=e.dataExtractor,i=e.exposureDuration,o=i===void 0?Vi:i,a=new Map,s=new Map,l=t.exposureObservable,c=l.subscribe(function(d){var f=d,v=f.target;if(f.isIntersecting){if(!a.get(v)){var h=setTimeout(function(){a.set(v,!0);var p=n.getElementPath(v);r(p),s.set(v,null)},o);s.set(v,h)}}else if(!f.isIntersecting&&f.intersectionRatio<1){var h=s.get(v);h&&(clearTimeout(h),s.set(v,null))}});return{unsubscribe:function(){c.unsubscribe()},reset:function(){s.forEach(function(d){d&&clearTimeout(d)}),s.clear(),a.clear()}}}function ll(e){var t,r,n,i,o,a,s=e.amplitude,l=e.scrollTracker,c=e.currentElementExposed,d=e.elementExposedForPage,f=e.exposureTracker,v=e.isPageEnd,h=e.lastScroll,p=l.getState(),g=X(),m=(r=g==null?void 0:g.innerWidth)!==null&&r!==void 0?r:0,b=(n=g==null?void 0:g.innerHe
10ight)!==null&&n!==void 0?n:0,E=(t={},t[Jr]=Zi((a=(o=(i=g==null?void 0:g.location)===null||i===void 0?void 0:i.href)===null||o===void 0?void 0:o.split("?")[0])!==null&&a!==void 0?a:""),t[fc]=p.maxX+m,t[vc]=p.maxY+b,t[Xi]=b,t[Wi]=m,t["[Amplitude] Element Exposed"]=Array.from(c),t),y=ro();if(y&&(E[Ki]=y),c.size===0&&p.maxX===h.maxX&&p.maxY===h.maxY){v&&(l.reset(),d.clear(),f==null||f.reset());return}s==null||s.track("[Amplitude] Viewport Content Updated",E),h.maxX=p.maxX,h.maxY=p.maxY,c.clear(),v&&(l.reset(),d.clear(),f==null||f.reset())}function dl(e,t,r,n){if(!t.has(e)){t.add(e),r.add(e);var i=Array.from(r),o=JSON.stringify(i);o.length>=yc&&n(!1)}}var fl=Y(96763),Me;(function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"})(Me||(Me={}));var vl=function(e,t){var r,n,i,o,a,s,l,c,d,f,v,h;e===void 0&&(e={}),t==null||t.diagnosticsClient.setTag("plugin.autocapture.version",Gi);var p=e.dataAttributePrefix,g=p===void 0?zr:p,m=e.visualTaggingOptions,b=m===void 0?{enabled:!0}:m;e.cssSelectorAllowlist=(r=e.cssSelectorAllowlist)!==null&&r!==void 0?r:Hi,e.actionClickAllowlist=(n=e.actionClickAllowlist)!==null&&n!==void 0?n:Fi,e.debounceTime=(i=e.debounceTime)!==null&&i!==void 0?i:0;var E=((o=e.viewportContentUpdated)===null||o===void 0?void 0:o.enabled)!==!1,y=(l=(s=(a=e.viewportContentUpdated)===null||a===void 0?void 0:a.exposureDuration)!==null&&s!==void 0?s:e.exposureDuration)!==null&&l!==void 0?l:Vi;e.viewportContentUpdated=(0,u.Cl)((0,u.Cl)({},e.viewportContentUpdated),{exposureDuration:y}),e.pageUrlExcludelist=(c=e.pageUrlExcludelist)===null||c===void 0?void 0:c.reduce(function(q,$){if(typeof $=="string"&&q.push($),$ instanceof RegExp&&q.push($),typeof $=="object"&&$!==null&&"pattern"in $)try{q.push(new RegExp($.pattern))}catch(he){return fl.warn("Invalid regex pattern: ".concat($.pattern),he),q}return q},[]);var S=zu,A="enrichment",C=[],D=new co(e,t),x=new Set,U=new Set,J,R=function(){var q,$=Je(ao().map(function(_e){return D.addAdditionalEventProperties(_e,"click",e.cssSelectorAllowlist,g)})),he=Je(new(Se())(function(_e){var Oe,De=function(Ae){var L=D.addAdditionalEventProperties(Ae,"change",e.cssSelectorAllowlist,g);_e.next(L)};return(Oe=X())===null||Oe===void 0||Oe.document.addEventListener("change",De,{capture:!0}),function(){var Ae;return(Ae=X())===null||Ae===void 0?void 0:Ae.document.removeEventListener("change",De)}})),Re;window.navigation&&(Re=Je(new(Se())(function(_e){var Oe=function(De){var Ae=D.addAdditionalEventProperties(De,"navigate",e.cssSelectorAllowlist,g);_e.next(Ae)};return window.navigation.addEventListener("navigate",Oe),function(){window.navigation.removeEventListener("navigate",Oe)}})));var Ee=Je(oo().map(function(_e){return D.addAdditionalEventProperties(_e,"mutation",e.cssSelectorAllowlist,g)})),Ue=Nc(),we=Mc(Ee,e.cssSelectorAllowlist);return q={},q[Me.ChangeObservable]=he,q[Me.ClickObservable]=$,q[Me.MutationObservable]=Ee,q[Me.NavigateObservable]=Re,q[Me.ScrollObservable]=Ue,q[Me.ExposureObservable]=we,q},M=so(Object.values((f=(d=e.pageActions)===null||d===void 0?void 0:d.labeledEvents)!==null&&f!==void 0?f:{})),H=uo((h=(v=e.pageActions)===null||v===void 0?void 0:v.triggers)!==null&&h!==void 0?h:[]),W=Kc(M,H,D,e),Q=function(q){var $,he;q&&(e.pageActions=(0,u.Cl)((0,u.Cl)({},e.pageActions),q),M=so(Object.values(($=e.pageActions.labeledEvents)!==null&&$!==void 0?$:{})),H=uo((he=e.pageActions.triggers)!==null&&he!==void 0?he:[]),W.update(M,H,e))},ue=function(q,$){return(0,u.sH)(void 0,void 0,void 0,function(){var he,Re,Ee,Ue,we,_e,Oe,De,Ae,L,ve,Fe,Rt,dt,ft,vt,tt,ht,pt,ze,Kt;return(0,u.YH)(this,function(En){return typeof document=="undefined"?[2]:(he=!1,Re={maxX:void 0,maxY:void 0},q.fetchRemoteConfig&&(q.remoteConfigClient?q.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(Le){Q(Le)}):q.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),Ee=Tt(e,e.cssSelectorAllowlist),Ue=Tt(e,e.actionClickAllowlist),we=R(),_e=Ac({allObservables:we,amplitude:$,shouldTrackEvent:Ee,evaluateTriggers:W.evaluate.bind(W)}),C.push(_e),Oe=Cc({allObservables:we,getEventProperties:function(){for(var Le=[],Xe=0;Xe<arguments.length;Xe++)Le[Xe]=arguments[Xe];return D.getEventProperties.apply(D,(0,u.fX)((0,u.fX)([],(0,u.zs)(Le),!1),[g],!1))},amplitude:$,shouldTrackEvent:Ee,evaluateTriggers:W.evaluate.bind(W)}),C.push(Oe),De=Pc({allObservables:we,options:e,getEventProperties:function(){for(var Le=[],Xe=0;Xe<arguments.length;Xe++)Le[Xe]=arguments[Xe];return D.getEventProperties.apply(D,(0,u.fX)((0,u.fX)([],(0,u.zs)(Le),!1),[g],!1))},amplitude:$,shouldTrackEvent:Ee,shouldTrackActionClick:Ue}),De&&C.push(De),Ae=kc({allObservables:we,amplitude:$}),C.push(Ae),L={},ve=X(),Fe=function(Le){Le&&he||(setTimeout(function(){he=!1},100),he=!0,ll({amplitude:$,scrollTracker:Ae,currentElementExposed:U,elementExposedForPage:x,exposureTracker:L.exposure,isPageEnd:Le,lastScroll:Re}))},Rt=function(Le){dl(Le,x,U,Fe)},E&&(L.exposure=cl({allObservables:we,onExposure:Rt,dataExtractor:D,exposureDuration:y}),L.exposure&&C.push(L.exposure),dt=function(){Fe(!0)},ve==null||ve.addEventListener("beforeunload",dt),J=function(){ve==null||ve.removeEventListener("beforeunload",dt)},C.push({unsubscribe:function(){return J()}}),ft=we[Me.NavigateObservable],ft?C.push(ft.subscribe(function(){Fe(!0)})):ve&&(vt=function(){Fe(!0)},ve.addEventListener("popstate",vt),tt=ve.history.pushState,ve.history&&tt&&(ve.history.pushState=new Proxy(tt,{apply:function(Le,Xe,Df){var _n=(0,u.zs)(Df,3),Lf=_n[0],Nf=_n[1],xf=_n[2];Le.apply(Xe,[Lf,Nf,xf]),Fe(!0)}})),C.push({unsubscribe:function(){ve.removeEventListener("popstate",vt),ve.history&&tt&&(ve.history.pushState=tt)}}))),(Kt=q==null?void 0:q.loggerProvider)===null||Kt===void 0||Kt.log("".concat(S," has been successfully added.")),window.opener&&b.enabled&&(ht=e.cssSelectorAllowlist,pt=e.actionClickAllowlist,ze=ju(),Ic(ze,{dataExtractor:D,isElementSelectable:Tt(e,(0,u.fX)((0,u.fX)([],(0,u.zs)(ht),!1),(0,u.zs)(pt),!1)),cssSelectorAllowlist:ht,actionClickAllowlist:pt}),qu(ze),ze.setup((0,u.Cl)({logger:q==null?void 0:q.loggerProvider},(q==null?void 0:q.serverZone)&&{endpoint:Hu[q.serverZone]}))),[2])})})},be=function(q){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function($){return[2,q]})})},qe=function(){return(0,u.sH)(void 0,void 0,void 0,function(){var q,$,he,Re,Ee;return(0,u.YH)(this,function(Ue){try{for(q=(0,u.Ju)(C),$=q.next();!$.done;$=q.next())he=$.value,he.unsubscribe()}catch(we){Re={error:we}}finally{try{$&&!$.done&&(Ee=q.return)&&Ee.call(q)}finally{if(Re)throw Re.error}}return[2]})})};return{name:S,type:A,setup:ue,execute:be,teardown:qe}},hl=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],lo=(0,u.fX)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,u.zs)(hl),!1),pl=lo,gl=lo,ml=["*"],uv=3e3,yl=1e3,bl=4,El=50,_l=3e3,Tl=["mutation","navigate"];function Sl(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackDeadClick,o=r.clickObservable,a=r.mutationObservable,s=r.navigateObservable,l=o.filter(function(h){return xt(h)&&i("click",h.closestTrackedAncestor)&&h.event.target instanceof Element&&h.event.target.closest('a[target="_blank"]')===null&&h.event.button===fr.LEFT_OR_TOUCH_CONTACT}),c=s?st(a,s):a,d=st(l,c),f=null,v=Xr(d,function(h){return f&&Tl.includes(h.type)?(clearTimeout(f),f=null,Promise.resolve(null)):h.type==="click"?f?Promise.resolve(null):new Promise(function(p){f=setTimeout(function(){p(h),f=null},_l)}):Promise.resolve(null)});return v.subscribe(function(h){if(h){var p={"[Amplitude] X":h.event.clientX,"[Amplitude] Y":h.event.clientY};t.track(Ku,(0,u.Cl)((0,u.Cl)({},n("click",h.closestTrackedAncestor)),p),{time:h.timestamp})}})}var fo=bl,vo=yl,ho=El;function po(e,t){var r,n,i,o,a=t.event,s=a.pageX,l=a.pageY;e.yMin=Math.min((r=e.yMin)!==null&&r!==void 0?r:l,l),e.yMax=Math.max((n=e.yMax)!==null&&n!==void 0?n:l,l),e.xMin=Math.min((i=e.xMin)!==null&&i!==void 0?i:s,s),e.xMax=Math.max((o=e.xMax)!==null&&o!==void 0?o:s,s),e.isOutOfBounds=e.yMax-e.yMin>ho||e.xMax-e.xMin>ho}function go(e){if(e.length===0)return null;var t=e[0],r=e[e.length-1],n=(0,u.Cl)({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(i){return{X:i.event.pageX,Y:i.event.pageY,Time:i.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties);return{rageClickEvent:n,time:t.timestamp}}function wl(e,t){var r=Math.max(0,e.length-fo+1),n=e[r];return t.timestamp-n.timestamp>=vo}function Il(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}function Al(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,a=n.selectionObservable,s=[],l={},c=null;function d(p){s=[],l={},p&&(po(l,p),s.push(p))}var f=Xr(o.filter(function(p){return i("click",p.closestTrackedAncestor)}),function(p){return(0,u.sH)(t,void 0,void 0,function(){var g;return(0,u.YH)(this,function(m){return po(l,p),g=null,s.length===0||Il(s,p)||wl(s,p)||l.isOutOfBounds?(c&&(g=go(s)),d(p)):s.push(p),c&&(clearTimeout(c.timerId),c.resolve(g),c=null),s.length>=fo?[2,new Promise(function(b){c={resolve:b,timerId:setTimeout(function(){b(go(s))},vo)}})]:[2,null]})})}),v=a==null?void 0:a.subscribe(function(){d()}),h=f.subscribe(function(p){p!==null&&r.track(Ju,p.rageClickEvent,{time:p.time})});return{unsubscribe:function(){h.unsubscribe(),v==null||v.unsubscribe()}}}var Cl=2e3;function Pl(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackErrorClick,i=r.clickObservable,o=r.browserErrorObservable,a=i.filter(function(d){return xt(d)&&n("click",d.closestTrackedAncestor)&&d.event.target instanceof Element&&d.event.target.closest('a[target="_blank"]')===null&&d.event.button===fr.LEFT_OR_TOUCH_CONTACT}),s=null,l=null,c=function(){s!==null&&(clearTimeout(s),s=null),l=null};return st(a,o).subscribe(function(d){var f;if(d.type==="click"){c(),l=d,s=setTimeout(c,Cl);return}d.type==="error"&&l&&(t.track($u,(0,u.Cl)((f={},f["[Amplitude] Kind"]=d.event.kind,f["[Amplitude] Message"]=d.event.message,f["[Amplitude] Stack"]=d.event.stack,f["[Amplitude] Filename"]=d.event.filename,f["[Amplitude] Line Number"]=d.event.lineNumber,f["[Amplitude] Column Number"]=d.event.columnNumber,f),l.targetElementProperties)),c())})}var $e;(function(e){e.INCREASING="increasing",e.DECREASING="decreasing"})($e||($e={}));var ct;(function(e){e.X="x",e.Y="y"})(ct||(ct={}));var kl=function(e){var t=e.allWindowObservables,r=t.mouseMoveObservable;return new(Se())(function(n){var i=null,o=null,a=null;return r.subscribe(function(s){var l={x:s.clientX,y:s.clientY};if(i===null){i=l;return}l.x>i.x?(o===$e.DECREASING&&n.next(ct.X),o=$e.INCREASING):l.x<i.x&&(o===$e.INCREASING&&n.next(ct.X),o=$e.DECREASING),l.y>i.y?(a===$e.DECREASING&&n.next(ct.Y),a=$e.INCREASING):l.y<i.y&&(a===$e.INCREASING&&n.next(ct.Y),a=$e.DECREASING),i=l})})};function Rl(e){var t=+Date.now();e.startTime=e.startTime||t;var r=e.changes,n=e.changesThreshold;r.push(t),r.length>n&&r.shift()}function mo(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;if(t.length<r)return!1;var i=t[t.length-1]-t[0];return i<n}function yo(e){e.changes=[],e.startTime=void 0}function bo(e){for(var t=e.changes,r=e.thresholdMs,n=0,i=t[t.length-1];n<t.length;n++){var o=i-t[n];if(o<r)break}n!==0&&(e.startTime=t[n],e.changes.splice(0,n))}function Ol(e,t){var r=void 0;if(mo(e)&&(r=e.startTime),mo(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}var Eo=20,_o=2e3,Dl=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=r===void 0?Eo:r,i=e.thresholdMs,o=i===void 0?_o:i;return new(Se())(function(a){var s={changes:[],changesThreshold:n,thresholdMs:o},l={changes:[],changesThreshold:n,thresholdMs:o},c=void 0,d=null;function f(){c!==void 0&&(a.next(c),c=void 0,d!==null&&clearTimeout(d),yo(s),yo(l))}return t.subscribe(function(v){d!==null&&clearTimeout(d),Rl(v===ct.X?s:l);var h=Ol(s,l);return h?(c=c||h,d=setTimeout(function(){f(),d=null},o)):f(),bo(s),bo(l),function(){d!==null&&(clearTimeout(d),d=null)}})})},Ll=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,i=e.directionChanges,o=i===void 0?Eo:i,a=e.thresholdMs,s=a===void 0?_o:a,l=kl({allWindowObservables:n}),c=Dl({mouseDirectionChangeObservable:l,directionChanges:o,thresholdMs:s});return c.subscribe(function(d){$r(r)&&t.track(Zu,void 0,{time:d})})};function rn(e,t,r,n){if(!n)return[];var i=e[t];return typeof i=="object"&&i!==null&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var vr=5,hr=4e3,Nl=function(e){var t;e===void 0&&(e={});var r=Xu,n="enrichment",i=[],o=e.errorClicks!==!1;e.errorClicks||(o=!1);var a=e.deadClicks!==!1&&e.deadClicks!==null,s=e.rageClicks!==!1&&e.rageClicks!==null,l=e.thrashedCursor!==!1&&e.thrashedCursor!==null;e.thrashedCursor||(l=!1);var c=rn(e,"rageClicks",ml,s),d=rn(e,"deadClicks",pl,a),f=rn(e,"errorClicks",gl,o),v=(t=e.dataAttributePrefix)!==null&&t!==void 0?t:zr,h=new co(e),p=(0,u.fX)([],(0,u.zs)(new Set((0,u.fX)((0,u.fX)((0,u.fX)([],(0,u.zs)(c),!1),(0,u.zs)(d),!1),(0,u.zs)(f),!1))),!1),g=function(){var y,S=Je(ao("pointerdown").map(function(R){return h.addAdditionalEventProperties(R,"click",p,v,!0)})),A=Je(Fc().map(function(R){return h.addTypeAndTimestamp(R,"error")})),C=Je(oo().map(function(R){return h.addAdditionalEventProperties(R,"mutation",p,v)})),D;if(window.navigation){var x=new(Se())(function(R){var M=function(H){R.next((0,u.Cl)((0,u.Cl)({},H),{type:"navigate"}))};return window.navigation.addEventListener("navigate",M),function(){window.navigation.removeEventListener("navigate",M)}});D=Je(x.map(function(R){return h.addAdditionalEventProperties(R,"navigate",p,v)}))}var U=Je(new(Se())(function(R){var M=function(){var H=document.activeElement;if(H&&(H.tagName==="TEXTAREA"||H.tagName==="INPUT")){var W=void 0,Q=void 0;
10try{if(W=H.selectionStart,Q=H.selectionEnd,W===Q)return}catch(be){return}return R.next()}var ue=window.getSelection();if(!(!ue||ue.isCollapsed))return R.next()};return window.document.addEventListener("selectionchange",M),function(){window.document.removeEventListener("selectionchange",M)}})),J=Je(Vc());return y={},y[Me.ClickObservable]=S,y[Me.MutationObservable]=C,y[Me.NavigateObservable]=D,y[Me.BrowserErrorObservable]=A,y[Me.SelectionObservable]=U,y[Me.MouseMoveObservable]=J,y},m=function(y,S){return(0,u.sH)(void 0,void 0,void 0,function(){var A,C,D,x,U,J,R,M,H,W,Q;return(0,u.YH)(this,function(ue){return typeof document=="undefined"?[2]:(A=g(),s&&(C=Tt(e,c),D=Al({allObservables:A,amplitude:S,shouldTrackRageClick:C}),i.push(D)),a&&(x=Tt(e,d),U=Sl({amplitude:S,allObservables:A,getEventProperties:function(be,qe){return h.getEventProperties(be,qe,v)},shouldTrackDeadClick:x}),i.push(U)),o&&(J=Tt(e,f),R=Pl({amplitude:S,allObservables:A,shouldTrackErrorClick:J}),i.push(R)),l&&(M=void 0,H=void 0,typeof e.thrashedCursor=="object"&&(M=e.thrashedCursor.directionChanges,H=e.thrashedCursor.threshold,M&&M<vr&&(y.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(M," is below the minimum of ").concat(vr,", setting to ").concat(vr)),M=vr),H&&H>hr&&(y.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(H," is above the maximum of ").concat(hr,", setting to ").concat(hr)),H=hr)),W=Ll({amplitude:S,options:e,allObservables:A,directionChanges:M,thresholdMs:H}),i.push(W)),(Q=y==null?void 0:y.loggerProvider)===null||Q===void 0||Q.log("".concat(r," has been successfully added.")),[2])})})},b=function(y){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(S){return[2,y]})})},E=function(){return(0,u.sH)(void 0,void 0,void 0,function(){var y,S,A,C,D;return(0,u.YH)(this,function(x){try{for(y=(0,u.Ju)(i),S=y.next();!S.done;S=y.next())A=S.value,A.unsubscribe()}catch(U){C={error:U}}finally{try{S&&!S.done&&(D=y.return)&&D.call(y)}finally{if(C)throw C.error}}return[2]})})};return{name:r,type:n,setup:m,execute:b,teardown:E}},xl=100,Ml=1e4;function To(e,t){var r=e.startTime+e.duration;return t.filter(function(n){return n.startTime<r&&n.startTime+n.duration>e.startTime}).map(function(n){return n.name})}function Ul(e,t){var r,n=To(e,t),i=(r=e.scripts)!==null&&r!==void 0?r:[],o=i.map(function(d){return d.sourceURL}).filter(Boolean),a=i.map(function(d){return d.sourceFunctionName}).filter(Boolean),s=i.map(function(d){return d.sourceCharPosition}).filter(function(d){return typeof d=="number"&&d>=0}),l=i.map(function(d){return d.invokerType}).filter(Boolean),c=i.map(function(d){return d.invoker}).filter(Boolean);return(0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},n.length>0&&{"[Amplitude] Main Thread Block Measures":n}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":i.length}),o.length>0&&{"[Amplitude] Main Thread Block Script URLs":o}),a.length>0&&{"[Amplitude] Main Thread Block Script Functions":a}),s.length>0&&{"[Amplitude] Main Thread Block Script Positions":s}),l.length>0&&{"[Amplitude] Main Thread Block Invoker Types":l}),c.length>0&&{"[Amplitude] Main Thread Block Invokers":c})}function Hl(e,t){var r,n=To(e,t),i=(r=e.attribution)!==null&&r!==void 0?r:[];return(0,u.Cl)((0,u.Cl)({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},n.length>0&&{"[Amplitude] Main Thread Block Measures":n}),i.length>0&&{"[Amplitude] Main Thread Block Attribution":i.map(function(o){return o.name})})}function Fl(){if(typeof PerformanceObserver=="undefined")return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(t){}return null}function Vl(e){var t=e.amplitude,r=e.options,n=e.durationThreshold,i=n===void 0?xl:n,o=Fl();if(!o)return{unsubscribe:function(){}};var a=[],s=new PerformanceObserver(function(c){var d,f,v=performance.now();try{for(var h=(0,u.Ju)(c.getEntries()),p=h.next();!p.done;p=h.next()){var g=p.value;a.push(g)}}catch(b){d={error:b}}finally{try{p&&!p.done&&(f=h.return)&&f.call(h)}finally{if(d)throw d.error}}for(var m=v-Ml;a.length>0&&a[0].startTime<m;)a.shift()});try{s.observe({entryTypes:["measure"]})}catch(c){}var l=new PerformanceObserver(function(c){var d,f;try{for(var v=(0,u.Ju)(c.getEntries()),h=v.next();!h.done;h=v.next()){var p=h.value;if(!$r(r))return;if(!(p.duration<i)){var g=o==="long-animation-frame"?Ul(p,a):Hl(p,a);t.track(ec,g)}}}catch(m){d={error:m}}finally{try{h&&!h.done&&(f=v.return)&&f.call(v)}finally{if(d)throw d.error}}});try{l.observe({entryTypes:[o]})}catch(c){return s.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){l.disconnect(),s.disconnect()}}}var Yl=100,Bl=function(e){e===void 0&&(e={});var t=Wu,r="enrichment",n=[],i=e.mainThreadBlock===!0||typeof e.mainThreadBlock=="object"&&e.mainThreadBlock!==null,o=function(l,c){return(0,u.sH)(void 0,void 0,void 0,function(){var d,f,v;return(0,u.YH)(this,function(h){return typeof document=="undefined"?[2]:(i&&(d=Yl,typeof e.mainThreadBlock=="object"&&e.mainThreadBlock.durationThreshold!==void 0&&(d=e.mainThreadBlock.durationThreshold),f=Vl({amplitude:c,options:e,durationThreshold:d}),n.push(f)),(v=l==null?void 0:l.loggerProvider)===null||v===void 0||v.log("".concat(t," performance tracking has been successfully added.")),[2])})})},a=function(l){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(c){return[2,l]})})},s=function(){return(0,u.sH)(void 0,void 0,void 0,function(){var l,c,d,f,v;return(0,u.YH)(this,function(h){try{for(l=(0,u.Ju)(n),c=l.next();!c.done;c=l.next())d=c.value,d.unsubscribe()}catch(p){f={error:p}}finally{try{c&&!c.done&&(v=l.return)&&v.call(l)}finally{if(f)throw f.error}}return[2]})})};return{name:t,type:r,setup:o,execute:a,teardown:s}},At=function(){var e="ampIntegrationContext";if(typeof globalThis!="undefined"&&typeof globalThis[e]!="undefined")return globalThis[e];if(typeof globalThis!="undefined")return globalThis;if(typeof window!="undefined")return window;if(typeof self!="undefined")return self;if(typeof Y.g!="undefined")return Y.g},Gl=function(e){return e?(e^Math.random()*16>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,wo)},So=(0,u.fX)([],(0,u.zs)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),wo=function(e){var t,r=At();if(!(!((t=r==null?void 0:r.crypto)===null||t===void 0)&&t.getRandomValues))return Gl
10(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=n[6]&15|64,n[8]=n[8]&63|128,(0,u.fX)([],(0,u.zs)(n.entries()),!1).map(function(i){var o=(0,u.zs)(i,2),a=o[0],s=o[1];return[4,6,8,10].includes(a)?"-".concat(So[s]):So[s]}).join("")};function jl(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||e===void 0}function Io(e,t,r){if(e){var n=t.map(Co),i=r.map(Co);Ao({json:e,allowlist:n,excludelist:i,ancestors:[]})}}function Ao(e){var t,r,n=e.json,i=e.targetObject,o=e.allowlist,a=e.excludelist,s=e.ancestors,l=e.parentObject,c=e.targetKey;i||(i=n);var d=Object.keys(i);try{for(var f=(0,u.Ju)(d),v=f.next();!v.done;v=f.next()){var h=v.value,p=(0,u.fX)((0,u.fX)([],(0,u.zs)(s),!1),[h],!1);jl(i[h])?(!Po(p,o)||Po(p,a))&&delete i[h]:Ao({json:n,targetObject:i[h],allowlist:o,excludelist:a,ancestors:p,parentObject:i,targetKey:h})}}catch(g){t={error:g}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}Object.keys(i).length===0&&l&&c&&delete l[c]}function Co(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(t){return t.replace(/~0/g,"~").replace(/~1/g,"/")})}function nn(e,t,r,n){if(r===void 0&&(r=0),n===void 0&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&t[n]==="**";)n++;return n===t.length}var i=t[n];if(i==="**"){if(n+1===t.length)return!0;for(var o=r;o<=e.length;o++)if(nn(e,t,o,n+1))return!0;return!1}else return i==="*"||i===e[r]?nn(e,t,r+1,n+1):!1}function Po(e,t){return t.some(function(r){return nn(e,r)})}var cv="-",ql="AMP",lv="".concat(ql,"_unsent"),dv="$default_instance",fv="https://api2.amplitude.com/2/httpapi",vv="https://api.eu.amplitude.com/2/httpapi",hv="https://api2.amplitude.com/batch",pv="https://api.eu.amplitude.com/batch",gv="utm_campaign",mv="utm_content",yv="utm_id",bv="utm_medium",Ev="utm_source",_v="utm_term",Tv="dclid",Sv="fbclid",wv="gbraid",Iv="gclid",Av="ko_click_id",Cv="li_fat_id",Pv="msclkid",kv="rdt_cid",Rv="ttclid",Ov="twclid",Dv="wbraid",Lv="EMPTY",Nv={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},xv="MKTG",pr=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],zl=["authorization","cookie","set-cookie"],Xl=500,ko=100,Wl=(function(){function e(t){this.request=t}return e.prototype.headers=function(t){var r,n;t===void 0&&(t=[]);var i=this.request.headers,o={};if(Array.isArray(i))i.forEach(function(f){var v=(0,u.zs)(f,2),h=v[0],p=v[1];o[h]=p});else if(i instanceof Headers)i.forEach(function(f,v){o[v]=f});else if(typeof i=="object"&&i!==null)try{for(var a=(0,u.Ju)(Object.entries(i)),s=a.next();!s.done;s=a.next()){var l=(0,u.zs)(s.value,2),c=l[0],d=l[1];o[c]=d}}catch(f){r={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return gr(o,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(typeof this._bodySize=="number")return this._bodySize;var t=At();if(t!=null&&t.TextEncoder){var r=this.request.body;return this._bodySize=Ro(r,ko),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.request.body=="str
10ing"?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),(0,u.sH)(this,void 0,void 0,function(){var n;return(0,u.YH)(this,function(i){return t.length===0?[2,null]:(n=this.body,[2,on(n,t,r)])})})},e})(),Kl=(function(){function e(t,r){this.bodyRaw=t,this.requestHeaders=r}return e.prototype.headers=function(t){return t===void 0&&(t=[]),gr(this.requestHeaders,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return Ro(this.bodyRaw,ko)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.bodyRaw=="string"?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),(0,u.sH)(this,void 0,void 0,function(){var n;return(0,u.YH)(this,function(i){return t.length===0?[2,null]:(n=this.body,[2,on(n,t,r)])})})},e})();function Ro(e,t){var r,n,i,o=At(),a=o==null?void 0:o.TextEncoder;if(a){var s;if(typeof e=="string")s=e,i=new a().encode(s).length;else if(e instanceof Blob)s=e,i=s.size;else if(e instanceof URLSearchParams)s=e,i=new a().encode(s.toString()).length;else if(ArrayBuffer.isView(e))s=e,i=s.byteLength;else if(e instanceof ArrayBuffer)s=e,i=s.byteLength;else if(e instanceof FormData){var l=e,c=0,d=0;try{for(var f=(0,u.Ju)(l.entries()),v=f.next();!v.done;v=f.next()){var h=(0,u.zs)(v.value,2),p=h[0],g=h[1];if(c+=p.length,typeof g=="string")c+=new a().encode(g).length;else if(g instanceof Blob)c+=g.size;else return;if(++d>=t)return}}catch(m){r={error:m}}finally{try{v&&!v.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}i=c}else if(e instanceof ReadableStream){s=e;return}return i}}var Jl=(function(){function e(t){this.response=t}return e.prototype.headers=function(t){var r;if(t===void 0&&(t=[]),this.response.headers instanceof Headers){var n=this.response.headers,i={};return(r=n==null?void 0:n.forEach)===null||r===void 0||r.call(n,function(o,a){i[a]=o}),gr(i,{allow:t})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var t,r;if(this._bodySize!==void 0)return this._bodySize;var n=(r=(t=this.response.headers)===null||t===void 0?void 0:t.get)===null||r===void 0?void 0:r.call(t,"content-length"),i=n?parseInt(n,10):void 0;return this._bodySize=i,i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i;return(0,u.YH)(this,function(o){switch(o.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),o.label=1;case 1:return o.trys.push([1,3,,4]),t=this.clonedResponse.text(),r=new Promise(function(a){return setTimeout(function(){return a(null)},Xl)}),[4,Promise.race([t,r])];case 2:return n=o.sent(),[2,n];case 3:return i=o.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),(0,u.sH)(this,void 0,void 0,function(){var n;return(0,u.YH)(this,function(i){switch(i.label){case 0:return t.length===0?[2,null]:[4,this.text()];case 1:return n=i.sent(),[2,on(n,t,r)]}})})},e})(),$l=(function(){function e(t,r,n,i){this.statusCode=t,this.headersString=r,this.size=n,this.getJson=i}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(t){var r,n;if(t===void 0&&(t=[]),!this.headersString)return{};var i={},o=this.headersString.split(`\r 11`);try{for(var a=(0,u.Ju)(o),s=a.next();!s.done;s=a.next()){var l=s.value,c=(0,u.zs)(l.split(": "),2),d=c[0],f=c[1];d&&f&&(i[d]=f)}}catch(v){r={error:v}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return gr(i,{allow:t})},e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),(0,u.sH)(this,void 0,void 0,function(){var n;return(0,u.YH)(this,function(i){return t.length===0?[2,null]:(n=this.getJson(),n?(Io(n,t,r),[2,n]):[2,null])})})},e})();function on(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return Io(n,t,r),n}catch(i){return null}}var Ht;(function(e){e.REDACT="redact",e.REMOVE="remove"})(Ht||(Ht={}));var Oo="[REDACTED]",gr=function(e,t){var r,n,i=t.allow,o=i===void 0?[]:i,a=t.strategy,s=a===void 0?Ht.REMOVE:a,l=(0,u.fX)([],(0,u.zs)(zl),!1),c={},d=function(p){var g=p.toLowerCase();l.find(function(m){return m.toLowerCase()===g})?s===Ht.REDACT&&(c[p]=Oo):o.find(function(m){return m.toLowerCase()===g})?c[p]=e[p]:s===Ht.REDACT&&(c[p]=Oo)};try{for(var f=(0,u.Ju)(Object.keys(e)),v=f.next();!v.done;v=f.next()){var h=v.value;d(h)}}catch(p){r={error:p}}finally{try{v&&!v.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}return c},Ql=(function(){function e(t,r,n,i,o,a,s,l,c,d,f){s===void 0&&(s=0),this.type=t,this.method=r,this.timestamp=n,this.startTime=i,this.url=o,this.requestWrapper=a,this.status=s,this.duration=l,this.responseWrapper=c,this.error=d,this.endTime=f}return e.prototype.toSerializable=function(){var t,r,n,i,o={type:this.t
11ype,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:(t=this.requestWrapper)===null||t===void 0?void 0:t.headers((0,u.fX)([],(0,u.zs)(pr),!1)),requestBodySize:(r=this.requestWrapper)===null||r===void 0?void 0:r.bodySize,responseHeaders:(n=this.responseWrapper)===null||n===void 0?void 0:n.headers((0,u.fX)([],(0,u.zs)(pr),!1)),responseBodySize:(i=this.responseWrapper)===null||i===void 0?void 0:i.bodySize};return Object.fromEntries(Object.entries(o).filter(function(a){var s=(0,u.zs)(a,2),l=s[0],c=s[1];return c!==void 0}))},e})();function Zl(e){return typeof e=="object"&&e!==null&&"url"in e&&"method"in e}var ed=(function(){function e(t,r){r===void 0&&(r=wo()),this.callback=t,this.id=r}return e})();function lt(e){try{e()}catch(t){}}var td=(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=At();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var t=At();return!!t&&!!t.fetch},e.prototype.subscribe=function(t,r){var n,i,o,a,s,l,c,d,f,v;if(this.logger||(this.logger=r),this.eventCallbacks.set(t.id,t),!this.isObserving){var h=(o=(i=(n=this.globalScope)===null||n===void 0?void 0:n.XMLHttpRequest)===null||i===void 0?void 0:i.prototype)===null||o===void 0?void 0:o.open,p=(l=(s=(a=this.globalScope)===null||a===void 0?void 0:a.XMLHttpRequest)===null||s===void 0?void 0:s.prototype)===null||l===void 0?void 0:l.send,g=(f=(d=(c=this.globalScope)===null||c===void 0?void 0:c.XMLHttpRequest)===null||d===void 0?void 0:d.prototype)===null||f===void 0?void 0:f.setRequestHeader;h&&p&&g&&this.observeXhr(h,p,g);var m=(v=this.globalScope)===null||v===void 0?void 0:v.fetch;m&&this.observeFetch(m),this.isObserving=!0}},e.prototype.unsubscribe=function(t){this.eventCallbacks.delete(t.id)},e.prototype.triggerEventCallbacks=function(t){var r=this;this.eventCallbacks.forEach(function(n){try{n.callback(t)}catch(i){lt(function(){var o;(o=r.logger)===null||o===void 0||o.debug("an unexpected error occurred while triggering event callbacks",i)})}})},e.prototype.handleNetworkRequestEvent=function(t,r,n,i,o,a,s){var l;if(!(a===void 0||s===void 0)){var c,d="GET";if(Zl(r)?(c=r.url,d=r.method):c=(l=r==null?void 0:r.toString)===null||l===void 0?void 0:l.call(r),c)try{var f=new URL(c);c="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(b){}d=(n==null?void 0:n.method)||d;var v,h;i&&(v=i.status),o&&(h={name:o.name||"UnknownError",message:o.message||"An unknown error occurred"},v=0);var p=Math.floor(performance.now()-s),g=Math.floor(a+p),m=new Ql(t,d,a,a,c,n,v,p,i,h,g);this.triggerEventCallbacks(m)}},e.prototype.getTimestamps=function(){var t,r;return{startTime:(t=Date.now)===null||t===void 0?void 0:t.call(Date),durationStart:(r=performance==null?void 0:performance.now)===null||r===void 0?void 0:r.call(performance)}},e.prototype.observeFetch=function(t){var r=this;!this.globalScope||!t||(this.globalScope.fetch=function(n,i){return(0,u.sH)(r,void 0,void 0,function(){var o,a,s,l,c=this;return(0,u.YH)(this,function(d){switch(d.label){case 0:try{o=this.getTimestamps()}catch(f){lt(function(){var v;return(v=c.logger)===null||v===void 0?void 0:v.debug("an unexpected error occurred while retrieving timestamps",f)})}d.label=1;case 1:return d.trys.push([1,3,,4]),[4,t(n,i)];case 2:return a=d.sent(),[3,4];case 3:return l=d.sent(),s=l,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,i?new Wl(i):void 0,a?new Jl(a):void 0,s,o==null?void 0:o.startTime,o==null?void 0:o.durationStart)}catch(f){lt(function(){var v;return(v=c.logger)===null||v===void 0?void 0:v.debug("an unexpected error occurred while handling fetch",f)})}if(a)return[2,a];throw s}})})})},e.createXhrJsonParser=function(t,r){return function(){var n;try{if(t.responseType==="json"){if(!((n=r.globalScope)===null||n===void 0)&&n.structuredClone)return r.globalScope.structuredClone(t.response)}else if(["text",""].includes(t.responseType))return JSON.parse(t.responseText)}catch(i){return i instanceof Error&&i.name==="InvalidStateError"&<(function(){var o;return(o=r.logger)===null||o===void 0?void 0:o.debug("unexpected error when retrieving responseText. responseType='".concat(t.responseType,"'"))}),null}return null}},e.prototype.observeXhr=function(t,r,n){if(!(!this.globalScope||!t||!r)){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var a,s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];var c=this,d=(0,u.zs)(s,2),f=d[0],v=d[1];try{c.$$AmplitudeAnalyticsEvent=(0,u.Cl)({method:f,url:(a=v==null?void 0:v.toString)===null||a===void 0?void 0:a.call(v),headers:{}},o.getTimestamps())}catch(h){lt(function(){var p;return(p=o.logger)===null||p===void 0?void 0:p.debug("an unexpected error occurred while calling xhr open",h)})}return t.apply(c,s)},i.send=function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var l=this,c=l,d=e.createXhrJsonParser(l,o),f=a[0],v=c.$$AmplitudeAnalyticsEvent;return c.$$AmplitudeAnalyticsEvent&&c.addEventListener("loadend",function(){try{var h=c.getAllResponseHeaders(),p=c.getResponseHeader("content-length"),g=new $l(c.status,h,p?parseInt(p,10):void 0,d),m=c.$$AmplitudeAnalyticsEvent.headers,b=new Kl(f,m);v.status=c.status,o.handleNetworkRequestEvent("xhr",{url:v.url,method:v.method},b,g,void 0,v.startTime,v.durationStart)}catch(E){lt(function(){var y;return(y=o.logger)===null||y===void 0?void 0:y.debug("an unexpected error occurred while handling xhr send",E)})}}),r.apply(c,a)},i.setRequestHeader=function(a,s){var l=this;try{var c=l.$$AmplitudeAnalyticsEvent;c&&(c.headers[a]=s)}catch(d){lt(function(){var f;return(f=o.logger)===null||f===void 0?void 0:f.debug("an unexpected error occurred while calling xhr setRequestHeader",d)})}n.apply(l,[a,s])}}},e})(),Do=new td,rd="@amplitude/plugin-network-capture-browser",Lo="[Amplitude] Network Request",nd=!0,id=function(e,t){return!t||!t.length?!0:t.some(function(r){return typeof r=="string"?e===r:e.match(r)})},Mv=function(e,t){var r=e;try{r=decodeURI(e)}catch(n){t==null||t.error("Malformed URI sequence: ",n)}return r},No="500-599";function mr(e,t){var r=t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&"),n="^"+r.replace(/\*/g,".*")+"$",i=new RegExp(n);return i.test(e)}function xo(e,t){var r,n,i=t.split(",");try{for(var o=(0,u.Ju)(i),a=o.next();!a.done;a=o.next()){var s=a.value,l=(0,u.zs)(s.split("-").map(Number),2),c=l[0],d=l[1];if(e===c&&d===void 0||e>=c&&e<=d)return!0}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function od(e,t,r,n,i){if(!(e.hosts&&!e.hosts.find(function(a){return mr(t,a)}))&&!(n&&e.urls&&!id(n,e.urls))&&!(i&&e.methods&&!e.methods.find(function(a){return i.toLowerCase()===a.toLowerCase()||a==="*"}))){if(r||r===0){var o=e.statusCodeRange||No;if(!xo(r,o))return!1}return!0}}function Mo(e){var t;if(e)try{var r=(t=At())===null||t===void 0?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),a=n.href,s=n.host;n.hash="",n.search="";var l=n.href;return{query:i,fragment:o,href:a,hrefWithoutQueryOrHash:l,host:s}}catch(c){return}}function ad(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if(typeof r!="string")return!1;var n=JSON.parse(r),i=n.events;if(i.find(function(o){return o.event_type===Lo}))return!0}catch(o){}return!1}function Uo(e){if(typeof e!="object"||e===null){if(e)return(0,u.fX)([],(0,u.zs)(pr),!1);if(e===void 0){var t=nd?void 0:(0,u.fX)([],(0,u.zs)(pr),!1);return t}return}if(e.length!==0)return e}function Ho(e){var t,r,n;return!(!((t=e==null?void 0:e.allowlist)===null||t===void 0)&&t.length)&&!(!((r=e==null?void 0:e.blocklist)===null||r===void 0)&&r.length)&&!(!((n=e==null?void 0:e.excludelist)===null||n===void 0)&&n.length)}function sd(e,t){var r;t===void 0&&(t={});var n=Mo(e.url);if(!n)return!1;var i=n.host;if(t.ignoreAmplitudeRequests!==!1&&(mr(i,"*.amplitude.com")||mr(i,"amplitude.com"))||!((r=t.ignoreHosts)===null||r===void 0)&&r.find(function(a){return mr(i,a)})||!t.captureRules&&e.status!==void 0&&!xo(e.status,No))return!1;if(t.captureRules){var o;if((0,u.fX)([],(0,u.zs)(t.captureRules),!1).reverse().find(function(a){if
11(o=od(a,i,e.status,e.url,e.method),o){var s=Uo(a.responseHeaders);if(e.responseWrapper&&s){var l=e.responseWrapper.headers(s);l&&(e.responseHeaders=l)}var c=Uo(a.requestHeaders);if(e.requestWrapper&&c){var d=e.requestWrapper.headers(c);d&&(e.requestHeaders=d)}if(e.responseWrapper&&a.responseBody&&!Ho(a.responseBody)){var f=a.responseBody.excludelist||a.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(a.responseBody.allowlist,f)}if(e.requestWrapper&&a.requestBody&&!Ho(a.requestBody)){var f=a.requestBody.excludelist||a.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(a.requestBody.allowlist,f)}}return o!==void 0}),!o)return!1}return!(e.requestWrapper&&ad(i,e.requestWrapper))}function ud(e,t,r,n){return(0,u.sH)(this,void 0,void 0,function(){var i,o,a;return(0,u.YH)(this,function(s){switch(s.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=u.zs.apply(void 0,[s.sent(),2]),o=i[0],a=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(l){n==null||n.debug("Failed to stringify request body",l)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch(l){n==null||n.debug("Failed to stringify response body")}s.label=2;case 2:return r==null||r.track(Lo,e),[2]}})})}function cd(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider,o=t.networkObservable,a=o.filter(function(s){return sd(s.event,r)});return a.subscribe(function(s){var l,c,d,f=s.event,v=Mo(f.url);if(v){var h=(c=f.responseWrapper)===null||c===void 0?void 0:c.bodySize,p=(d=f.requestWrapper)===null||d===void 0?void 0:d.bodySize,g=(l={},l["[Amplitude] URL"]=v.hrefWithoutQueryOrHash,l["[Amplitude] URL Query"]=v.query,l["[Amplitude] URL Fragment"]=v.fragment,l["[Amplitude] Request Method"]=f.method,l["[Amplitude] Status Code"]=f.status,l["[Amplitude] Start Time"]=f.startTime,l["[Amplitude] Completion Time"]=f.endTime,l["[Amplitude] Duration"]=f.duration,l["[Amplitude] Request Body Size"]=p,l["[Amplitude] Response Body Size"]=h,l["[Amplitude] Request Type"]=f.type,l["[Amplitude] Request Headers"]=f.requestHeaders,l["[Amplitude] Response Headers"]=f.responseHeaders,l);ud(g,f,n,i)}})}var an;(function(e){e.NetworkObservable="networkObservable"})(an||(an={}));var Fo,ld=function(e){e===void 0&&(e={});var t=rd,r="enrichment",n,i=function(c,d){var f={event:c,timestamp:Date.now(),type:d};return f},o=function(){var c,d=new(Se())(function(f){var v=new ed(function(h){var p=i(h,"network");f.next(p)});return Do.subscribe(v,n),function(){Do.unsubscribe(v)}});return c={},c[an.NetworkObservable]=d,c},a=function(c,d){return(0,u.sH)(void 0,void 0,void 0,function(){var f;return(0,u.YH)(this,function(v){return typeof document=="undefined"?[2]:(f=o(),n=c==null?void 0:c.loggerProvider,Fo=cd({allObservables:f,networkTrackingOptions:e,amplitude:d,loggerProvider:n}),n==null||n.log("".concat(t," has been successfully added.")),[2])})})},s=function(c){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(d){return[2,c]})})},l=function(){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(c){return Fo.unsubscribe(),[2]})})};return{name:t,type:r,setup:a,execute:s,teardown:l}},dd=function(){var e="ampIntegrationContext";if(typeof globalThis!="undefined"&&typeof globalThis[e]!="undefined")return globalThis[e];if(typeof globalThis!="undefined")return globalThis;if(typeof window!="undefined")return window;if(typeof self!="undefined")return self;if(typeof Y.g!="undefined")return Y.g},Uv=function(e,t){return!t||!t.length?!0:t.some(function(r){return typeof r=="string"?e===r:e.match(r)})},sn=function(e,t){var r=e;try{r=decodeURI(e)}catch(n){t==null||t.error("Malformed URI sequence: ",n)}return r},fd="web-vitals-browser",vd="[Amplitude] Web Vitals";let Vo=-1;const Ct=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Vo=t.timeStamp,e(t))}),!0)},Qe=(e,t,r,n)=>{let i,o;return a=>{t.value>=0&&(a||n)&&(o=t.value-(i!=null?i:0),(o||i===void 0)&&(i=t.value,t.delta=o,t.rating=((s,l)=>s>l[1]?"poor":s>l[0]?"needs-improvement":"good")(t.value,r),e(t)))}},un=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},cn=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ft=()=>{var t;const e=cn();return(t=e==null?void 0:e.activationStart)!=null?t:0},Ze=(e,t=-1)=>{const r=cn();let n="navigate";return Vo>=0?n="back-forward-cache":r&&(document.prerendering||Ft()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},ln=new WeakMap;function dn(e,t){return ln.get(e)||ln.set(e,new t),ln.get(e)}class hd{constructor(){rt(this,"t");rt(this,"i",0);rt(this,"o",[])}h(t){var i;if(t.hadRecentInput)return;const r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&t.startTime-n.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),(i=this.t)==null||i.call(this,t)}}const Vt=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver((i=>{Promise.resolve().then((()=>{t(i.getEntries())}))}));return n.observe(wa({type:e,buffered:!0},r)),n}}catch(n){}},fn=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Pt=-1;const Yo=new Set,Bo=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,vn=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of Yo)t();isFinite(Pt)||(Pt=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",vn,!0))}},yr=()=>{var e;if(Pt<0){const t=Ft(),r=document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter((n=>n.name==="hidden"&&n.startTime>t))[0])==null?void 0:e.startTime;Pt=r!=null?r:Bo(),addEventListener("visibilitychange",vn,!0),addEventListener("prerenderingchange",vn,!0),Ct((()=>{setTimeout((()=>{Pt=Bo()}))}))}return{get firstHiddenTime(){return Pt},onHidden(t){Yo.add(t)}}},br=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},Go=[1800,3e3],jo=(e,t={})=>{br((()=>{const r=yr();let n,i=Ze("FCP");const o=Vt("paint",(a=>{for(const s of a)s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<r.firstHiddenTime&&(i.value=Math.max(s.startTime-Ft(),0),i.entries.push(s),n(!0)))}));o&&(n=Qe(e,i,Go,t.reportAllChanges),Ct((a=>{i=Ze("FCP"),n=Qe(e,i,Go,t.reportAllChanges),un((()=>{i.value=performance.now()-a.timeStamp,n(!0)}))})))}))},qo=[.1,.25],pd=(e,t={})=>{const r=yr();jo(fn((()=>{let n,i=Ze("CLS",0);const o=dn(t,hd),a=l=>{for(const c of l)o.h(c);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},s=Vt("layout-shift",a);s&&(n=Qe(e,i,qo,t.reportAllChanges),r.onHidden((()=>{a(s.takeRecords()),n(!0)})),Ct((()=>{o.i=0,i=Ze("CLS",0),n=Qe(e,i,qo,t.reportAllChanges),un((()=>n()))})),setTimeout(n))})))};let zo=0,hn=1/0,Er=0;const gd=e=>{for(const t of e)t.interactionId&&(hn=Math.min(hn,t.interactionId),Er=Math.max(Er,t.interactionId),zo=Er?(Er-hn)/7+1:0)};let pn;const Xo=()=>{var e;return pn?zo:(e=performance.interactionCount)!=null?e:0},md=()=>{"interactionCount"in performance||pn||(pn=Vt("event",gd,{type:"event",buffered:!0,durationThreshold:0}))};let Wo=0;class yd{constructor(){rt(this,"u",[]);rt(this,"l",new Map);rt(this,"m");rt(this,"p")}v(){Wo=Xo(),this.u.length=0,this.l.clear()}L(){const t=Math.min(this.u.length-1,Math.floor((Xo()-Wo)/50));return this.u[t]}h(t){var i,o;if((i=this.m)==null||i.call(this,t),!t.interactionId&&t.entryType!=="first-input")return;const r=this.u.at(-1);let n=this.l.get(t.interactionId);if(n||this.u.length<10||t.duration>r.P){if(n?t.duration>n.P?(n.entries=[t],n.P=t.duration):t.duration===n.P&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],P:t.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((a,s)=>s.P-a.P)),this.u.length>10){const a=this.u.splice(10);for(const s of a)this.l.delete(s.id)}(o=this.p)==null||o.call(this,n)}}}const Ko=e=>{const t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=fn(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}
11)))},Jo=[200,500],bd=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=yr();br((()=>{var l;md();let n,i=Ze("INP");const o=dn(t,yd),a=c=>{Ko((()=>{for(const f of c)o.h(f);const d=o.L();d&&d.P!==i.value&&(i.value=d.P,i.entries=d.entries,n())}))},s=Vt("event",a,{durationThreshold:(l=t.durationThreshold)!=null?l:40});n=Qe(e,i,Jo,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(s.takeRecords()),n(!0)})),Ct((()=>{o.v(),i=Ze("INP"),n=Qe(e,i,Jo,t.reportAllChanges)})))}))};class Ed{constructor(){rt(this,"m")}h(t){var r;(r=this.m)==null||r.call(this,t)}}const $o=[2500,4e3],_d=(e,t={})=>{br((()=>{const r=yr();let n,i=Ze("LCP");const o=dn(t,Ed),a=l=>{t.reportAllChanges||(l=l.slice(-1));for(const c of l)o.h(c),c.startTime<r.firstHiddenTime&&(i.value=Math.max(c.startTime-Ft(),0),i.entries=[c],n())},s=Vt("largest-contentful-paint",a);if(s){n=Qe(e,i,$o,t.reportAllChanges);const l=fn((()=>{a(s.takeRecords()),s.disconnect(),n(!0)})),c=d=>{d.isTrusted&&(Ko(l),removeEventListener(d.type,c,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])addEventListener(d,c,{capture:!0});Ct((d=>{i=Ze("LCP"),n=Qe(e,i,$o,t.reportAllChanges),un((()=>{i.value=performance.now()-d.timeStamp,n(!0)}))}))}}))},Qo=[800,1800],gn=e=>{document.prerendering?br((()=>gn(e))):document.readyState!=="complete"?addEventListener("load",(()=>gn(e)),!0):setTimeout(e)},Td=(e,t={})=>{let r=Ze("TTFB"),n=Qe(e,r,Qo,t.reportAllChanges);gn((()=>{const i=cn();i&&(r.value=Math.max(i.responseStart-Ft(),0),r.entries=[i],n(!0),Ct((()=>{r=Ze("TTFB",0),n=Qe(e,r,Qo,t.reportAllChanges),n(!0)})))}))};function Sd(e){var t,r=((t=e.entries[0])===null||t===void 0?void 0:t.startTime)||0;return performance.timeOrigin+r}function Yt(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(Sd(e)),navigationStart:Math.floor(performance.timeOrigin)}}var wd=function(){var e=null,t=dd(),r=t==null?void 0:t.document,n=t==null?void 0:t.location,i=function(s,l){return(0,u.sH)(void 0,void 0,void 0,function(){var c,d;return(0,u.YH)(this,function(f){return r===void 0?[2]:(c=sn((n==null?void 0:n.href)||"",s.loggerProvider),d={"[Amplitude] Page Domain":(n==null?void 0:n.hostname)||"","[Amplitude] Page Location":c,"[Amplitude] Page Path":sn((n==null?void 0:n.pathname)||"",s.loggerProvider),"[Amplitude] Page Title":typeof document!="undefined"&&document.title||"","[Amplitude] Page URL":sn(c.split("?")[0],s.loggerProvider)},_d(function(v){d["[Amplitude] LCP"]=Yt(v)}),jo(function(v){d["[Amplitude] FCP"]=Yt(v)}),bd(function(v){d["[Amplitude] INP"]=Yt(v)}),pd(function(v){d["[Amplitude] CLS"]=Yt(v)}),Td(function(v){d["[Amplitude] TTFB"]=Yt(v)}),e=function(){r.visibilityState==="hidden"&&e&&(l.track(vd,d),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e),[2])})})},o=function(s){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(l){return[2,s]})})},a=function(){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(s){return e&&(r==null||r.removeEventListener("visibilitychange",e)),[2]})})};return{name:fd,type:"enrichment",setup:i,execute:o,teardown:a}},Zo=function(e,t,r){return t===void 0&&(t=""),r===void 0&&(r=10),[nr,t,e.substring(0,r)].filter(Boolean).join("_")},Id=(function(){function e(){}return e.prototype.parse=function(){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(t){return[2,(0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)({},Pr),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=Ke(),r=t[Da],n=t[La],i=t[Na],o=t[xa],a=t[Ma],s=t[Ua];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:a,utm_term:s}},e.prototype.getReferrer=function(){var t,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(t=n.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&r!==void 0?r:void 0}catch(i){}return n},e.prototype.getClickIds=function(){var t,r=Ke();return t={},t[Rn]=r[Rn],t[On]=r[On],t[Dn]=r[Dn],t[Ln]=r[Ln],t[Nn]=r[Nn],t[xn]=r[xn],t[Mn]=r[Mn],t[Un]=r[Un],t[Hn]=r[Hn],t[Fn]=r[Fn],t[Vn]=r[Vn],t},e})(),ea=(function(){function e(t,r){var n;this.shouldTrackNewCampaign=!1,this.options=(0,u.Cl)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:eu(((n=r.cookieOptions)===null||n===void 0?void 0:n.domain)||r.topLevelDomain),optOut:r.optOut},t),this.storage=r.cookieStorage,this.storageKey=Zo(r.apiKey,"MKTG"),this.webExpStorageKey=Zo(r.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=Pr,this.sessionTimeout=r.sessionTimeout,this.lastEventTime=r.lastEventTime,this.logger=r.loggerProvider,this.topLevelDomain=r.topLevelDomain,r.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r;return(0,u.YH)(this,function(n){switch(n.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return r=u.zs.apply(void 0,[n.sent(),2]),this.currentCampaign=r[0],this.previousCampaign=r[1],t=this.lastEventTime?qn(this.sessionTimeout,this.lastEventTime):!0,Js(this.currentCampaign,this.previousCampaign,this.options,this.logger,t,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,u.sH)(this,void 0,void 0,function(){var t;return(0,u.YH)(this,function(r){switch(r.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return t=r.sent(),t?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[4,Promise.all([t||new Id().parse(),this.storage.get(this.storageKey)])];case 4:return[2,r.sent()]}})})},e.prototype.generateCampaignEvent=function(t){this.shouldTrackNewCampaign=!1;var r=Zs(this.currentCampaign,this.options);return t&&(r.event_id=t),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e})(),ta;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(ta||(ta={}));var _r;
11(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(_r||(_r={}));var Ad=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},ra=function(){var e="ampIntegrationContext";if(typeof globalThis!="undefined"&&typeof globalThis[e]!="undefined")return globalThis[e];if(typeof globalThis!="undefined")return globalThis;if(typeof window!="undefined")return window;if(typeof self!="undefined")return self;if(typeof Y.g!="undefined")return Y.g},na=function(){var e,t=ra();if(!(!((e=t==null?void 0:t.location)===null||e===void 0)&&e.search))return{};var r=t.location.search.substring(1).split("&").filter(Boolean),n=r.reduce(function(i,o){var a=o.split("=",2),s=ia(a[0]),l=ia(a[1]);return l&&(i[s]=l),i},{});return n},ia=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch(t){return""}},Hv="-",Cd="AMP",Fv="".concat(Cd,"_unsent"),Vv="$default_instance",Yv="https://api2.amplitude.com/2/httpapi",Bv="https://api.eu.amplitude.com/2/httpapi",Gv="https://api2.amplitude.com/batch",jv="https://api.eu.amplitude.com/batch",Pd="utm_campaign",kd="utm_content",Rd="utm_id",Od="utm_medium",Dd="utm_source",Ld="utm_term",oa="dclid",aa="fbclid",sa="gbraid",ua="gclid",ca="ko_click_id",la="li_fat_id",da="msclkid",fa="rdt_cid",va="ttclid",ha="twclid",pa="wbraid",qv="EMPTY",Nd={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},zv="MKTG",Xv=null,Wv=null,xd=(function(){function e(){}return e.prototype.parse=function(){return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(t){return[2,(0,u.Cl)((0,u.Cl)((0,u.Cl)((0,u.Cl)({},Nd),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=na(),r=t[Pd],n=t[kd],i=t[Rd],o=t[Od],a=t[Dd],s=t[Ld];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:a,utm_term:s}},e.prototype.getReferrer=function(){var t,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(t=n.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&r!==void 0?r:void 0}catch(i){}return n},e.prototype.getClickIds=function(){var t,r=na();return t={},t[oa]=r[oa],t[aa]=r[aa],t[sa]=r[sa],t[ua]=r[ua],t[ca]=r[ca],t[la]=r[la],t[da]=r[da],t[fa]=r[fa],t[va]=r[va],t[ha]=r[ha],t[pa]=r[pa],t},e})(),Md="[Amplitude] Attribution",Ud=new Set([_r.IDENTIFY,_r.GROUP_IDENTIFY]),Hd=function(e){return Ad(e)},Fd=function(e){var t;e===void 0&&(e={});var r=(t=e.fallbackAttributionEvent)!==null&&t!==void 0?t:!1,n=ra(),i,o,a={},s=!1,l=!1,c,d,f,v,h=function(){return(0,u.sH)(void 0,void 0,void 0,function(){var m;return(0,u.YH)(this,function(b){switch(b.label){case 0:return[4,new xd().parse()];case 1:return m=b.sent(),a=Hd(m),r&&(o==null||o.log("Tracking attribution fallback event."),i==null||i.track(Md,a)),[2]}})})},p=function(){h()},g=function(m){return new Proxy(m,{apply:function(b,E,y){Reflect.apply(b,E,y),s&&p()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(m,b){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(E){switch(E.label){case 0:return i=b,o=m.loggerProvider,s=!0,o.log("Installing event property attribution tracking."),[4,h()];case 1:if(E.sent(),!n)return[2];if(n.addEventListener("popstate",p),!l){if(c=Reflect.get(n.history,"pushState"),d=Reflect.get(n.history,"replaceState"),!c||!d)return[2];f=g(c),n.history.pushState=f,v=g(d),n.history.replaceState=v,l=!0}return[2]}})})},execute:function(m){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(b){return Ud.has(m.event_type)?[2,m]:(m.event_properties=(0,u.Cl)((0,u.Cl)({},a),m.event_properties),[2,m])})})},teardown:function(){return(0,u.sH)(void 0,void 0,void 0,function(){var m,b;return(0,u.YH)(this,function(E){return n&&(n.removeEventListener("popstate",p),m=Reflect.get(n.history,"pushState"),b=Reflect.get(n.history,"replaceState"),l&&m===f&&c&&(n.history.pushState=c),l&&b===v&&d&&(n.history.replaceState=d)),s=!1,l=!1,c=void 0,d=void 0,f=void 0,v=void 0,a={},[2]})})}}},ga;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(ga||(ga={}));var Bt;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(Bt||(Bt={}));var Vd=function(){var e="ampIntegrationContext";if(typeof globalThis!="undefined"&&typeof globalThis[e]!="undefined")return globalThis[e];if(typeof globalThis!="undefined")return globalThis;if(typeof window!="undefined")return window;if(typeof self!="undefined")return self;if(typeof Y.g!="undefined")return Y.g},Kv=function(e,t){return!t||!t.length?!0:t.some(function(r){return typeof r=="string"?e===r:e.match(r)})},Tr=function(e,t){var r=e;try{r=decodeURI(e)}catch(n){t==null||t.error("Malformed URI sequence: ",n)}return r},Yd=Y(96763),Bd=(function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return(0,u.sH)(this,void 0,void 0,function(){var t,r,n,i,o;return(0,u.YH)(this,function(a){switch(a.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",a.label=1;case 1:return a.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return a.sent(),[4,r.get(n)];case 3:return i=a.sent(),[2,i===t];case 4:return o=a.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return a.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return(0,u.sH)(this,void 0,void 0,function(){var r,n;return(0,u.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return r=i.sent(),r?[2,JSON.parse(r)]:[2,void 0];case 2:return n=i.sent(),Yd.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(t){var r;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(n){return[2,((r=this.storage)===null||r===void 0?void 0:r.getItem(t))||void 0]})})},e.prototype.set=function(t,r){var n;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(i){try{(n=this.storage)===null||n===void 0||n.setItem(t,JSON.stringify(r))}catch(o){}return[2]})})},e.prototype.remove=function(t){var r;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(n){try{(r=this.storage)===null||r===void 0||r.removeItem(t)}catch(i){}return[2]})})},e.prototype.reset=function(){var t;return(0,u.sH)(this,void 0,void 0,function(){return(0,u.YH)(this,function(r){try{(t=this.storage)===null||t===void 0||t.clear()}catch(n){}return[2]})})},e})(),Gd="data-amp-mask",Gt="*****",jd=/\b(?:\d[ -]*?){13,16}\b/,qd=/(\d{3}-?\d{2}-?\d{4})/g,zd=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Xd=function(e,t){var r,n;if(t===void 0&&(t=[]),typeof e!="string")return"";var i=e;i=i.replace(jd,Gt),i=i.replace(qd,Gt),i=i.replace(zd,Gt);try{for(var o=(0,u.Ju)(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,Gt)}catch(l){}}}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},Wd=function(e){if(typeof document=="undefined"||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(Gd)?Gt:e?e(document.title):document.title},Sr="AMP_CURRENT_PAGE",wr="AMP_PREVIOUS_PAGE",kt="AMP_URL_INFO",jt;(function(e){e.Direct="direct",e.Internal="internal",e.External="external"})(jt||(jt={}));var Kd=new Set([Bt.IDENTIFY,Bt.GROUP_IDENTIFY,Bt.REVENUE]),Jv=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e!==null&&"pageUrlEnrichment"in e?!!e.pageUrlEnrichment:!1},Jd=function(e){var t=e===void 0?{}:e,r=t.internalDomains,n=r===void 0?[]:r,i=Vd(),o=void 0,a=!1,s=void 0,l=!1,
11c=!1,d=function(g){var m;try{var b=Tr(g,s);m=new URL(b).hostname}catch(E){s==null||s.error("Could not parse URL: ",E)}return m},f=function(g){var m=typeof location!="undefined"&&location.hostname||"",b=g?d(g):void 0;if(!b)return jt.Direct;var E=n.some(function(S){return m.indexOf(S)!==-1}),y=n.some(function(S){return b.indexOf(S)!==-1});return m===b||y&&E?jt.Internal:jt.External},v=function(){return(0,u.sH)(void 0,void 0,void 0,function(){var g,m,b,E,y;return(0,u.YH)(this,function(S){switch(S.label){case 0:return o&&a?[4,o.get(kt)]:[3,3];case 1:return g=S.sent(),m=Tr(typeof location!="undefined"&&location.href||""),b=(g==null?void 0:g[Sr])||"",E=void 0,m===b?E=(g==null?void 0:g[wr])||"":b?E=b:E=document.referrer||"",[4,o.set(kt,(y={},y[Sr]=m,y[wr]=E,y))];case 2:S.sent(),S.label=3;case 3:return[2]}})})},h=function(){v()},p={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(g,m){return(0,u.sH)(void 0,void 0,void 0,function(){var b;return(0,u.YH)(this,function(E){switch(E.label){case 0:if(s=g.loggerProvider,s.log("Installing @amplitude/plugin-page-url-enrichment-browser"),c=!0,!i)return[3,2];try{o=new Bd(i.sessionStorage)}catch(y){s==null||s.debug("sessionStorage is not available in this environment.")}return[4,o==null?void 0:o.isEnabled()];case 1:a=(b=E.sent())!==null&&b!==void 0?b:!1,i.addEventListener("popstate",h),l||(i.history.pushState=new Proxy(i.history.pushState,{apply:function(y,S,A){var C=(0,u.zs)(A,3),D=C[0],x=C[1],U=C[2];y.apply(S,[D,x,U]),c&&h()}}),i.history.replaceState=new Proxy(i.history.replaceState,{apply:function(y,S,A){var C=(0,u.zs)(A,3),D=C[0],x=C[1],U=C[2];y.apply(S,[D,x,U]),c&&h()}}),l=!0),E.label=2;case 2:return[2]}})})},execute:function(g){return(0,u.sH)(void 0,void 0,void 0,function(){var m,b,E,y,S;return(0,u.YH)(this,function(A){switch(A.label){case 0:return m=Tr(typeof location!="undefined"&&location.href||""),o&&a?[4,o.get(kt)]:[3,5];case 1:return b=A.sent(),b!=null&&b[Sr]?[3,3]:[4,o.set(kt,(S={},S[Sr]=m,S[wr]=document.referrer||"",S))];case 2:A.sent(),A.label=3;case 3:return[4,o.get(kt)];case 4:if(E=A.sent(),y="",E&&(y=E[wr]||""),Kd.has(g.event_type))return[2,g];g.event_properties=(0,u.Cl)((0,u.Cl)({},g.event_properties||{}),{"[Amplitude] Page Domain":qt(g,"[Amplitude] Page Domain",typeof location!="undefined"&&location.hostname||""),"[Amplitude] Page Location":qt(g,"[Amplitude] Page Location",m),"[Amplitude] Page Path":qt(g,"[Amplitude] Page Path",typeof location!="undefined"&&Tr(location.pathname)||""),"[Amplitude] Page Title":qt(g,"[Amplitude] Page Title",Wd(Xd)),"[Amplitude] Page URL":qt(g,"[Amplitude] Page URL",m.split("?")[0]),"[Amplitude] Previous Page Location":y,"[Amplitude] Previous Page Type":f(y)}),A.label=5;case 5:return[2,g]}})})},teardown:function(){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(g){switch(g.label){case 0:return i&&(i.removeEventListener("popstate",h),c=!1),o&&a?[4,o.set(kt,{})]:[3,2];case 1:g.sent(),g.label=2;case 2:return[2]}})})}};return p};function qt(e,t,r){return e.event_properties||(e.event_properties={}),e.event_properties[t]===void 0?r:e.event_properties[t]}var $d=function(){var e,t,r;function n(a){return typeof a!="object"||a===null?!1:"body"in a&&typeof a.body=="string"}function i(a){if(a)try{var s=new Function("return "+a)();if(typeof s=="function")return s;e==null||e.error("Custom enrichment body did not evaluate to a function")}catch(l){e==null||e.error("Could not create custom enrichment function",l)}return function(l){return l}}var o={name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(a,s){return(0,u.sH)(void 0,void 0,void 0,function(){var l,c;return(0,u.YH)(this,function(d){return e=a.loggerProvider,e==null||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),!((c=a.remoteConfig)===null||c===void 0)&&c.fetchRemoteConfig&&(a.remoteConfigClient?(l=a.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(f){f&&n(f)?r=i(f.body||""):r=i("")}),t=function(){var f;return(f=a.remoteConfigClient)===null||f===void 0?void 0:f.unsubscribe(l)}):e==null||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(a){return(0,u.sH)(void 0,void 0,void 0,function(){var s;return(0,u.YH)(this,function(l){if(r)try{return[2,(s=r(a))!==null&&s!==void 0?s:null]}catch(c){return e==null||e.error("Could not execute custom enrichment function",c),[2,a]}return[2,a]})})},teardown:function(){return(0,u.sH)(void 0,void 0,void 0,function(){return(0,u.YH)(this,function(a){return t&&t(),[2]})})}};return o},mn="userProperty",ma="eventProperty",Qd=function(e){return e===mn||e===ma},Zd=function(e){var t=(0,u.fX)([],(0,u.zs)(new Set((Array.isArray(e)?e:[e]).filter(Qd))),!1);return t.length>0?t:[mn]},ya=function(e,t){return Zd(e.trackingMethod).includes(t)},ba=function(e){return ya(e,mn)},ef=function(e){return ya(e,ma)},yn=-1,Ea=(function(e){(0,u.C6)(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._diagnosticsSampleRate=0,r}return t.prototype.init=function(r,n,i){r===void 0&&(r="");var o,a;return arguments.length>2?(o=n,a=i):typeof n=="string"?(o=n,a=void 0):(o=n==null?void 0:n.userId,a=n),ae(this._init((0,u.Cl)((0,u.Cl)({},a),{userId:o,apiKey:r})))},t.prototype._init=function(r){var n,i,o,a,s,l,c,d;return(0,u.sH)(this,void 0,void 0,function(){var f,v,h,p,g,m,b,E,y,S,A,C,D,x,U,J=this;return(0,u.YH)(this,function(R){switch(R.label){case 0:return this.initializing?[2]:(this.initializing=!0,f=au(r),v=(n=r.loggerProvider)!==null&&n!==void 0?n:new We,r.loggerProvider||v.enable((i=r.logLevel)!==null&&i!==void 0?i:ee.Warn),h=(o=r.serverZone)!==null&&o!==void 0?o:fi,g=this._diagnosticsSampleRate,m=(a=r.enableDiagnostics)!==null&&a!==void 0?a:!0,f?(p=new Pe(r.apiKey,v,h,(s=r.remoteConfig)===null||s===void 0?void 0:s.serverUrl),[4,new Promise(function(M){p==null||p.subscribe("configs.diagnostics.browserSDK","all",function(H,W,Q){if(v.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:H,source:W,lastFetch:Q},null,2)),H){var ue=H.sampleRate;typeof ue=="number"&&!isNaN(ue)&&(g=ue);var be=H.enabled;typeof be=="boolean"&&(m=be)}M()})})]):[3,2]);case 1:R.sent(),R.label=2;case 2:return b=new Te(r.apiKey,v,h,{enabled:m,sampleRate:g}),b.setTag("library","".concat(ei,"/").concat(Nr)),typeof navigator!="undefined"&&b.setTag("user_agent",navigator.userAgent),[4,iu(r.apiKey,r,this,b,{loggerProvider:v,serverZone:h,enableDiagnostics:m,diagnosticsSampleRate:g})];case 3:return E=R.sent(),f&&p?[4,new Promise(function(M){p==null||p.subscribe("configs.analyticsSDK.browserSDK","all",function(H,W,Q){E.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:H,source:W,lastFetch:Q},null,2)),H&&Nu(H,E),M()})})]:[3,5];case 4:R.sent(),R.label=5;case 5:return[4,e.prototype._init.call(this,E)];case 6:return R.sent(),this.logBrowserOptions(E),this.config.remoteConfigClient=p,y=Ss(this.config),Dr(this.config.defaultTracking)&&ba(y)?(this.config.optOut&&this.timeline.addOptOutListener(function(M){return(0,u.sH)(J,void 0,void 0,function(){return(0,u.YH)(this,function(H){switch(H.label){case 0:return M?[3,2]:(this.webAttribution=new ea(y,this.config),[4,this.webAttribution.init()]);case 1:H.sent(),H.label=2;case 2:return[2]}})})}),this.webAttribution=new ea(y,this.config),[4,this.webAttribution.init()]):[3,8];case 7:R.sent(),R.label=8;case 8:return S=Ke(),A=S.ampTimestamp?Number(S.ampTimestamp):void 0,C=A?Date.now()<A:!0,D=C&&!Number.isNaN(Number(S.ampSessionId))?Number(S.ampSessionId):void 0,x=this.config.deferredSessionId,x===yn&&!this.config.optOut&&(x=Date.now()),this.setSessionId((d=(c=(l=r.sessionId)!==null&&l!==void 0?l:D)!==null&&c!==void 0?c:x)!==null&&d!==void 0?d:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(M){return(0,u.sH)(J,void 0,void 0,function(){return(0,u.YH)(this,function(H){return!M&&this.config.deferredSessionId&&(this.config.deferredSessionId===yn?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),U=Dt(r.instanceName),U.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===Yn?[3,10]:[4,this.add(Lu()).promise];case 9:R.sent(),R.label=10;case 10:return[4,this.add(new ts({diagnosticsClient:b})).promise];case 11:return R.sent(),[4,this.add(new ks).promise];case 12:return R.sent(),[4,this.add(new rs).promise];case 13:return R.sent(),Du(this.config),hs(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Ou()).promise]):[3,15];case 14:R.sent(),R.label=15;case 15:return Xn(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Ru()).promise]):[3,17];case 16:R.sent(),R.label=17;case 17:return Wn(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ni(Zn(this.config))).promise]):[3,20];case 18:return R.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(M){return(0,u.sH)(J,void 0,void 0,function(){return(0,u.YH)(this,function(H){switch(H.label){case 0:return M?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ni(Zn(this.config))).promise]);case 1:return H.sent(),[2]}})})}),R.label=20;case 20:return Dr(this.config.defaultTracking)&&ef(y)?(this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(Fd(y)).promise]):[3,22];case 21:R.sent(),R.label=22;case 22:return $n(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(vl(Es(this.config),{diagnosticsClient:b})).promise]):[3,24];case 23:R.sent(),R.label=24;case 24:return Qn(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Nl(_s(this.config))).promise]):[3,26];
11case 25:R.sent(),R.label=26;case 26:return Jn(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(ld(Ts(this.config))).promise]):[3,28];case 27:R.sent(),R.label=28;case 28:return gs(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(wd()).promise]):[3,30];case 29:R.sent(),R.label=30;case 30:return ms(this.config.autocapture)?(this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(Bl(ys(this.config))).promise]):[3,32];case 31:R.sent(),R.label=32;case 32:return ps(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(Jd()).promise]):[3,34];case 33:R.sent(),R.label=34;case 34:return bs(this.config.customEnrichment)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add($d()).promise]):[3,36];case 35:R.sent(),R.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return R.sent(),U.eventBridge.setEventReceiver(function(M){var H=M.eventProperties||{},W=H.time,Q=(0,u.Tt)(H,["time"]),ue=typeof W=="number"?{time:W}:void 0;J.track(M.eventType,Q,ue)}),[2]}})})},t.prototype.getUserId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.userId},t.prototype.setUserId=function(r){if(!this.config){this.q.push(this.setUserId.bind(this,r));return}this.config.loggerProvider.debug("function setUserId: ",r),(r!==this.config.userId||r===void 0)&&(this.config.userId=r,this.timeline.onIdentityChanged({userId:r}),Fa(r,this.config.instanceName))},t.prototype.getDeviceId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.deviceId},t.prototype.setDeviceId=function(r){if(!this.config){this.q.push(this.setDeviceId.bind(this,r));return}this.config.loggerProvider.debug("function setDeviceId: ",r),r!==this.config.deviceId&&(this.config.deviceId=r,this.timeline.onIdentityChanged({deviceId:r}),Va(r,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(me()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var r,n;return{deviceId:(r=this.config)===null||r===void 0?void 0:r.deviceId,userId:(n=this.config)===null||n===void 0?void 0:n.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(r){var n,i,o;if("userId"in r&&this.setUserId(r.userId),"deviceId"in r&&r.deviceId&&this.setDeviceId(r.deviceId),"userProperties"in r){this.userProperties=r.userProperties;var a=new bt,s=(o=r.userProperties)!==null&&o!==void 0?o:{};try{for(var l=(0,u.Ju)(Object.entries(s)),c=l.next();!c.done;c=l.next()){var d=(0,u.zs)(c.value,2),f=d[0],v=d[1];a.set(f,v)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}this.identify(a)}},t.prototype.getOptOut=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.optOut},t.prototype.getSessionId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.sessionId},t.prototype.setSessionId=function(r){var n,i=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,r)),ae(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=r!=null?r:yn,ae(Promise.resolve());if(r===void 0&&(r=Date.now()),r===this.config.sessionId)return ae(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",r);var o=this.getSessionId();o!==r&&this.timeline.onSessionIdChanged(r);var a=this.config.lastEventTime,s=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1;this.config.sessionId=r,this.config.lastEventTime=void 0,this.config.pageCounter=0,Kn(this.config.defaultTracking)&&(o&&a&&i.push(this.track(di,void 0,{device_id:this.previousSessionDeviceId,event_id:++s,session_id:o,time:a+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var l=this.trackCampaignEventIfNeeded(++s,i);return this.config.identify&&i.push(this.track(Or(this.config.identify)).promise),Kn(this.config.defaultTracking)&&i.push(this.track(li,void 0,{event_id:l?++s:s,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,ae(Promise.all(i))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}
11this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(r){if(!this.config){this.q.push(this.setTransport.bind(this,r));return}this.config.transportProvider=mi(r)},t.prototype.identify=function(r,n){if(Lr(r)){var i=r._q;r._q=[],r=or(new bt,i)}return n!=null&&n.user_id&&this.setUserId(n.user_id),n!=null&&n.device_id&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,r,n)},t.prototype.groupIdentify=function(r,n,i,o){if(Lr(i)){var a=i._q;i._q=[],i=or(new bt,a)}return e.prototype.groupIdentify.call(this,r,n,i,o)},t.prototype.revenue=function(r,n){if(Lr(r)){var i=r._q;r._q=[],r=or(new jn,i)}return e.prototype.revenue.call(this,r,n)},t.prototype.trackCampaignEventIfNeeded=function(r,n){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!ba(this.webAttribution.options))return!1;var i=this.webAttribution.generateCampaignEvent(r);return n?n.push(this.track(i).promise):this.track(i),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(r){return(0,u.sH)(this,void 0,void 0,function(){var n,i,o;return(0,u.YH)(this,function(a){return n=Date.now(),i=qn(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),r.event_type!==li&&r.event_type!==di&&(!r.
11session_id||r.session_id===this.getSessionId())&&(i||o?(this.setSessionId(n),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):i||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,r)]})})},t.prototype.logBrowserOptions=function(r){try{var n=(0,u.Cl)((0,u.Cl)({},r),{apiKey:r.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",ls(n))}catch(i){this.config.loggerProvider.error("Error logging browser config",i)}},t.prototype._setDiagnosticsSampleRate=function(r){if(!(r>1||r<0)&&!this.config){this._diagnosticsSampleRate=r;return}},t})(fs),_a=function(){var e=new Ea;return{init:re(e.init.bind(e),"init",K(e),Z(e,["config"])),add:re(e.add.bind(e),"add",K(e),Z(e,["config.apiKey","timeline.plugins"])),remove:re(e.remove.bind(e),"remove",K(e),Z(e,["config.apiKey","timeline.plugins"])),track:re(e.track.bind(e),"track",K(e),Z(e,["config.apiKey","timeline.queue.length"])),logEvent:re(e.logEvent.bind(e),"logEvent",K(e),Z(e,["config.apiKey","timeline.queue.length"])),identify:re(e.identify.bind(e),"identify",K(e),Z(e,["config.apiKey","timeline.queue.length"])),groupIdentify:re(e.groupIdentify.bind(e),"groupIdentify",K(e),Z(e,["config.apiKey","timeline.queue.length"])),setGroup:re(e.setGroup.bind(e),"setGroup",K(e),Z(e,["config.apiKey","timeline.queue.length"])),revenue:re(e.revenue.bind(e),"revenue",K(e),Z(e,["config.apiKey","timeline.queue.length"])),flush:re(e.flush.bind(e),"flush",K(e),Z(e,["config.apiKey","timeline.queue.length"])),getUserId:re(e.getUserId.bind(e),"getUserId",K(e),Z(e,["config","config.userId"])),setUserId:re(e.setUserId.bind(e),"setUserId",K(e),Z(e,["config","config.userId"])),getDeviceId:re(e.getDeviceId.bind(e),"getDeviceId",K(e),Z(e,["config","config.deviceId"])),setDeviceId:re(e.setDeviceId.bind(e),"setDeviceId",K(e),Z(e,["config","config.deviceId"])),reset:re(e.reset.bind(e),"reset",K(e),Z(e,["config","config.userId","config.deviceId"])),getSessionId:re(e.getSessionId.bind(e),"getSessionId",K(e),Z(e,["config"])),setSessionId:re(e.setSessionId.bind(e),"setSessionId",K(e),Z(e,["config"])),extendSession:re(e.extendSession.bind(e),"extendSession",K(e),Z(e,["config"])),setOptOut:re(e.setOptOut.bind(e),"setOptOut",K(e),Z(e,["config"])),setTransport:re(e.setTransport.bind(e),"setTransport",K(e),Z(e,["config"])),getIdentity:re(e.getIdentity.bind(e),"getIdentity",K(e),Z(e,["config"])),setIdentity:re(e.setIdentity.bind(e),"setIdentity",K(e),Z(e,["config","config.userId","config.deviceId"])),getOptOut:re(e.getOptOut.bind(e),"getOptOut",K(e),Z(e,["config"])),_setDiagnosticsSampleRate:re(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",K(e),Z(e,["config"]))}};const ce=_a();function Ta(e,t){var r=0;if(Number.isFinite(e)&&Number.isFinite(t)&&t>0){var n=e/t*100;r=Math.min(100,Math.max(0,n))}return r}function zt(e,t){var r=e.currentTime,n=e.duration;return(0,u.Cl)({duration:n,start_time:r,last_position:r,percent_completed:Ta(r,n)},t!==void 0?{stop_reason:t}:{})}function Xt(e){return{mux_playback_id:e.getAttribute("playback-id"),mux_video_id:e.getAttribute("metadata-video-id"),mux_video_title:e.getAttribute("metadata-video-title")}}function tf(e,t,r){var n=function(){var c=(0,u.Cl)((0,u.Cl)({},zt(e)),r==="mux"?Xt(e):{});t.onPlay(c)};e.addEventListener("play",n);var i=function(){var c=(0,u.Cl)((0,u.Cl)({},zt(e,"paused")),r==="mux"?Xt(e):{});t.onPause(c)};e.addEventListener("pause",i);var o=function(){var c=(0,u.Cl)((0,u.Cl)({},zt(e,"ended")),r==="mux"?Xt(e):{});t.onEnded(c)};e.addEventListener("ended",o);var a=function(){var c=(0,u.Cl)((0,u.Cl)({},zt(e,"seeking")),r==="mux"?Xt(e):{});t.onSeeking(c)};e.addEventListener("seeking",a);var s=function(){var c=(0,u.Cl)((0,u.Cl)({},zt(e)),r==="mux"?Xt(e):{});t.onSeeked(c)};e.addEventListener("seeked",s);var l=function(){var c=e,d={position:e.currentTime,isSeeking:!!c.seeking};t.onTimeUpdate(d)};return e.addEventListener("timeupdate",l),function(){e.removeEventListener("play",n),e.removeEventListener("pause",i),e.removeEventListener("ended",o),e.removeEventListener("seeking",a),e.removeEventListener("seeked",s),e.removeEventListener("timeupdate",l)}}function rf(e){return(0,u.sH)(this,void 0,void 0,function(){var t;return(0,u.YH)(this,function(r){switch(r.label){case 0:return[4,new Promise(function(n){return e.getCurrentTime(n)})];case 1:return t=r.sent(),[2,{currentTime:t}]}})})}function Wt(e,t,r,n){return(0,u.sH)(this,void 0,void 0,function(){var i,o,a,s,l;return(0,u.YH)(this,function(c){switch(c.label){case 0:return[4,Promise.all([new Promise(function(d){return e.getDuration(d)}),new Promise(function(d){return e.getCurrentTime(d)})])];case 1:if(i=u.zs.apply(void 0,[c.sent(),2]),o=i[0],a=i[1],s={},r==="mux"){l=void 0;try{l=new URL(t.getAttribute("src")),s.mux_video_title=l.searchParams.get("metadata-video-title"),s.mux_video_id=l.searchParams.get("metadata-video-id"),s.mux_playback_id=l.pathname.split("/").pop()}catch(d){}}return[2,(0,u.Cl)((0,u.Cl)({duration:o,start_time:a,last_position:a,percent_completed:Ta(a,o)},n!==void 0?{stop_reason:n}:{}),s)]}})})}function nf(e,t,r){r===void 0&&(r=null);var n=[],i=function(){var o=e.elem,a=!1,s=function(){Wt(e,o,r).then(function(h){t.onPlay(h)}).catch(function(h){t.onError("Error getting iframe metadata from 'play' handler: ".concat(h))})};e.on("play",s),n.push(function(){return e.off("play",s)});var l=function(){Wt(e,o,r,"paused").then(function(h){t.onPause(h)}).catch(function(h){t.onError("Error getting iframe metadata from 'pause' handler: ".concat(h))})};e.on("pause",l),n.push(function(){return e.off("pause",l)});var c=function(){Wt(e,o,r,"ended").then(function(h){t.onEnded(h)}).catch(function(h){t.onError("Error getting iframe metadata from 'ended' handler: ".concat(h))})};e.on("ended",c),n.push(function(){return e.off("ended",c)});var d=function(){a=!0,Wt(e,o,r,"seeking").then(function(h){t.onSeeking(h)}).catch(function(h){t.onError("Error getting iframe metadata from 'seeking' handler: ".concat(h))})};e.on("seeking",d),n.push(function(){return e.off("seeking",d)});var f=function(){a=!1,Wt(e,o,r).then(function(h){t.onSeeked(h)}).catch(function(h){t.onError("Error getting iframe metadata from 'seeked' handler: ".concat(h))})};e.on("seeked",f),n.push(function(){return e.off("seeked",f)});var v=function(){rf(e).then(function(h){var p=h.currentTime,g={position:p,isSeeking:a};t.onTimeUpdate(g)}).catch(function(h){t.onError("Error getting iframe metadata from 'timeupdate' handler: ".concat(h))})};e.on("timeupdate",v),n.push(function(){return e.off("timeupdate",v)}
11)};return e.on("ready",i),function(){e.off("ready",i),n.forEach(function(o){return o()})}}var of=(function(){function e(t){var r=t.videoEl,n=t.onStateChange,i=t.vendor,o=t.isEmbedded,a=this;this.state={playbackState:"paused"},this.handler={onPlay:function(s){a.updatePlaybackState("playing",s)},onPause:function(s){a.updatePlaybackState("paused",s)},onEnded:function(s){a.updatePlaybackState("ended",s)},onSeeking:function(){var s=(0,u.Cl)((0,u.Cl)({},a.state),{isSeeking:!0});a.updateState(s)},onSeeked:function(s){var l=(0,u.Cl)((0,u.Cl)({},a.state),{isSeeking:!1,position:s.last_position});a.updateState(l)},onError:function(s){a.updateStateWithError(s)},onTimeUpdate:function(s){a.updateTime(s)}},this.onStateChange=n,o?this.untrack=nf(r,this.handler,i):this.untrack=tf(r,this.handler,i)}return e.prototype.stateChangeHandler=function(t,r){try{this.onStateChange(t,r)}catch(n){}},e.prototype.updateStateWithError=function(t){var r=this.state,n=(0,u.Cl)((0,u.Cl)({},r),{playbackState:"error",errorMessage:t});this.updateState(n)},e.prototype.updatePlaybackState=function(t,r){var n=(0,u.Cl)((0,u.Cl)({},this.state),{playbackState:t,lastEvent:r,position:r.last_position});this.updateState(n)},e.prototype.updateTime=function(t){var r,n,i=this.state.lastEvent;if(!(!i||this.state.playbackState!=="playing")){var o=t.isSeeking||this.state.isSeeking,a=(r=this.state.position)!==null&&r!==void 0?r:0,s=t.position;if(o){this.state=(0,u.Cl)((0,u.Cl)({},this.state),{position:s});return}var l=s-a,c=(0,u.Cl)((0,u.Cl)({},this.state),{position:s,watchTime:((n=this.state.watchTime)!==null&&n!==void 0?n:0)+l});this.updateState(c)}},e.prototype.updateState=function(t){var r=this.state;this.state=t,this.stateChangeHandler(r,t)},e.prototype.destroy=function(){this.untrack()},e})(),af=(function(){function e(t){this.amplitude=t,this.videoEl=null,this.embeddedVideoPlayer=null,this.extraEventProperties={},this.listeners=[],this.onRemoveListeners=[]}return e.prototype.withVideoElement=function(t){return this.videoEl=t,this},e.prototype.withEmbeddedPlayer=function(t){return this.embeddedVideoPlayer=t,this},e.prototype.withVendor=function(t){return this.vendor=t,this},e.prototype.withExtraEventProperties=function(t){return this.extraEventProperties=t,this},e.prototype.captureVideoStarted=function(){var t=this;return this.listeners.push(function(r,n){r.playbackState!=="playing"&&n.playbackState==="playing"&&t.amplitude.track("Video Content Started",(0,u.Cl)((0,u.Cl)({},n.lastEvent),t.extraEventProperties))}),this},e.prototype.captureVideoStopped=function(){var t=this;return this.listeners.push(function(r,n){r.playbackState==="playing"&&n.playbackState!=="playing"&&t.amplitude.track("Video Content Stopped",(0,u.Cl)((0,u.Cl)((0,u.Cl)({},n.lastEvent),{watch_duration:n.watchTime}),t.extraEventProperties))}),this},e.prototype.start=function(){var t=this,r,n=(r=this.videoEl)!==null&&r!==void 0?r:this.embeddedVideoPlayer;if(!n)throw new Error("Video element not specified. Use withVideoElement() or withEmbeddedPlayer() to specify the video element.");if(this.videoEl&&this.embeddedVideoPlayer)throw new Error("Both video element and embedded video player specified. Use only one of withVideoElement() or withEmbeddedPlayer() to specify the video element.");var i=new of({videoEl:n,onStateChange:function(o,a){t.listeners.forEach(function(s){return s(o,a)})},vendor:this.vendor,isEmbedded:!!this.embeddedVideoPlayer});return this.onRemoveListeners.push(function(){i.destroy()}),this},e.prototype.stop=function(){this.onRemoveListeners.forEach(function(t){return t()}),this.onRemoveListeners=[]},e})();function sf(e,t,r){var n;r===void 0&&(r={});var i=new af(e);return t instanceof HTMLVideoElement?i.withVideoElement(t):i.withEmbeddedPlayer(t),r.vendor&&i.withVendor(r.vendor),i.withExtraEventProperties((n=r.extraEventProperties)!==null&&n!==void 0?n:{}).captureVideoStarted().captureVideoStopped().start(),function(){return i.stop()}}var bn;(function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"})(bn||(bn={}));var uf=ce.add,cf=ce.extendSession,lf=ce.flush,df=ce.getDeviceId,ff=ce.getIdentity,vf=ce.getOptOut,hf=ce.getSessionId,pf=ce.getUserId,gf=ce.groupIdentify,mf=ce.identify,yf=ce.init,bf=ce.logEvent,Ef=ce.remove,_f=ce.reset,Tf=ce.revenue,Sf=ce.setDeviceId,wf=ce.setGroup,If=ce.setIdentity,Af=ce.setOptOut,Cf=ce.setSessionId,Pf=ce.setTransport,kf=ce.setUserId,Rf=ce.track,Of=ce._setDiagnosticsSampleRate}),31635:((le,ne,Y)=>{"use strict";Y.d(ne,{C6:()=>u,Cl:()=>ee,Ju:()=>et,Tt:()=>de,YH:()=>gt,fX:()=>B,sH:()=>We,zs:()=>me});var Ve=function(_,T){return Ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,I){w.__proto__=I}||function(w,I){for(var k in I)Object.prototype.hasOwnProperty.call(I,k)&&(w[k]=I[k])},Ve(_,T)};function u(_,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");Ve(_,T);function w(){this.constructor=_}
vendor: 9,454 bytes, line 11
11_.prototype=T===null?Object.create(T):(w.prototype=T.prototype,new w)}var ee=function(){return ee=Object.assign||function(T){for(var w,I=1,k=arguments.length;I<k;I++){w=arguments[I];for(var P in w)Object.prototype.hasOwnProperty.call(w,P)&&(T[P]=w[P])}return T},ee.apply(this,arguments)};function de(_,T){var w={};for(var I in _)Object.prototype.hasOwnProperty.call(_,I)&&T.indexOf(I)<0&&(w[I]=_[I]);if(_!=null&&typeof Object.getOwnPropertySymbols=="function")for(var k=0,I=Object.getOwnPropertySymbols(_);k<I.length;k++)T.indexOf(I[k])<0&&Object.prototype.propertyIsEnumerable.call(_,I[k])&&(w[I[k]]=_[I[k]]);return w}function K(_,T,w,I){var k=arguments.length,P=k<3?T:I===null?I=Object.getOwnPropertyDescriptor(T,w):I,V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(_,T,w,I);else for(var ie=_.length-1;ie>=0;ie--)(V=_[ie])&&(P=(k<3?V(P):k>3?V(T,w,P):V(T,w))||P);return k>3&&P&&Object.defineProperty(T,w,P),P}function ge(_,T){return function(w,I){T(w,I,_)}}function Z(_,T,w,I,k,P){function V(ke){if(ke!==void 0&&typeof ke!="function")throw new TypeError("Function expected");return ke}for(var ie=I.kind,Ie=ie==="getter"?"get":ie==="setter"?"set":"value",z=!T&&_?I.static?_:_.prototype:null,fe=T||(z?Object.getOwnPropertyDescriptor(z,I.name):{}),Te,Ke=!1,oe=w.length-1;oe>=0;oe--){var xe={};for(var He in I)xe[He]=He==="access"?{}:I[He];for(var He in I.access)xe.access[He]=I.access[He];xe.addInitializer=function(ke){if(Ke)throw new TypeError("Cannot add initializers after decoration has completed");P.push(V(ke||null))};var Ge=(0,w[oe])(ie==="accessor"?{get:fe.get,set:fe.set}:fe[Ie],xe);if(ie==="accessor"){if(Ge===void 0)continue;if(Ge===null||typeof Ge!="object")throw new TypeError("Object expected");(Te=V(Ge.get))&&(fe.get=Te),(Te=V(Ge.set))&&(fe.set=Te),(Te=V(Ge.init))&&k.unshift(Te)}else(Te=V(Ge))&&(ie==="field"?k.unshift(Te):fe[Ie]=Te)}z&&Object.defineProperty(z,I.name,fe),Ke=!0}function re(_,T,w){for(var I=arguments.length>2,k=0;k<T.length;k++)w=I?T[k].call(_,w):T[k].call(_);return I?w:void 0}function ae(_){return typeof _=="symbol"?_:"".concat(_)}function Ce(_,T,w){return typeof T=="symbol"&&(T=T.description?"[".concat(T.description,"]"):""),Object.defineProperty(_,"name",{configurable:!0,value:w?"".concat(w," ",T):T})}function Ye(_,T){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(_,T)}function We(_,T,w,I){function k(P){return P instanceof w?P:new w(function(V){V(P)})}return new(w||(w=Promise))(function(P,V){function ie(fe){try{z(I.next(fe))}catch(Te){V(Te)}}function Ie(fe){try{z(I.throw(fe))}catch(Te){V(Te)}}function z(fe){fe.done?P(fe.value):k(fe.value).then(ie,Ie)}z((I=I.apply(_,T||[])).next())})}function gt(_,T){var w={label:0,sent:function(){if(P[0]&1)throw P[1];return P[1]},trys:[],ops:[]},I,k,P,V=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return V.next=ie(0),V.throw=ie(1),V.return=ie(2),typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function ie(z){return function(fe){return Ie([z,fe])}}function Ie(z){if(I)throw new TypeError("Generator is already executing.");for(;V&&(V=0,z[0]&&(w=0)),w;)try{if(I=1,k&&(P=z[0]&2?k.return:z[0]?k.throw||((P=k.return)&&P.call(k),0):k.next)&&!(P=P.call(k,z[1])).done)return P;switch(k=0,P&&(z=[z[0]&2,P.value]),z[0]){case 0:case 1:P=z;break;case 4:return w.label++,{value:z[1],done:!1};case 5:w.label++,k=z[1],z=[0];continue;case 7:z=w.ops.pop(),w.trys.pop();continue;default:if(P=w.trys,!(P=P.length>0&&P[P.length-1])&&(z[0]===6||z[0]===2)){w=0;continue}if(z[0]===3&&(!P||z[1]>P[0]&&z[1]<P[3])){w.label=z[1];break}if(z[0]===6&&w.label<P[1]){w.label=P[1],P=z;break}if(P&&w.label<P[2]){w.label=P[2],w.ops.push(z);break}P[2]&&w.ops.pop(),w.trys.pop();continue}z=T.call(_,w)}catch(fe){z=[6,fe],k=0}finally{I=P=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}}var X=Object.create?(function(_,T,w,I){I===void 0&&(I=w);var k=Object.getOwnPropertyDescriptor(T,w);(!k||("get"in k?!T.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return T[w]}}),Object.defineProperty(_,I,k)}):(function(_,T,w,I){I===void 0&&(I=w),_[I]=T[w]});function ot(_,T){for(var w in _)w!=="default"&&!Object.prototype.hasOwnProperty.call(T,w)&&X(T,_,w)}function et(_){var T=typeof Symbol=="function"&&Symbol.iterator,w=T&&_[T],I=0;if(w)return w.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&I>=_.length&&(_=void 0),{value:_&&_[I++],done:!_}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")}function me(_,T){var w=typeof Symbol=="function"&&_[Symbol.iterator];if(!w)return _;var I=w.call(_),k,P=[],V;try{for(;(T===void 0||T-- >0)&&!(k=I.next()).done;)P.push(k.value)}catch(ie){V={error:ie}}finally{try{k&&!k.done&&(w=I.return)&&w.call(I)}finally{if(V)throw V.error}}return P}function G(){for(var _=[],T=0;T<arguments.length;T++)_=_.concat(me(arguments[T]));return _}function O(){for(var _=0,T=0,w=arguments.length;T<w;T++)_+=arguments[T].length;for(var I=Array(_),k=0,T=0;T<w;T++)for(var P=arguments[T],V=0,ie=P.length;V<ie;V++,k++)I[k]=P[V];return I}function B(_,T,w){if(w||arguments.length===2)for(var I=0,k=T.length,P;I<k;I++)(P||!(I in T))&&(P||(P=Array.prototype.slice.call(T,0,I)),P[I]=T[I]);return _.concat(P||Array.prototype.slice.call(T))}function F(_){return this instanceof F?(this.v=_,this):new F(_)}function N(_,T,w){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var I=w.apply(_,T||[]),k,P=[];return k=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),ie("next"),ie("throw"),ie("return",V),k[Symbol.asyncIterator]=function(){return this},k;function V(oe){return function(xe){return Promise.resolve(xe).then(oe,Te)}}function ie(oe,xe){I[oe]&&(k[oe]=function(He){return new Promise(function(Ge,ke){P.push([oe,He,Ge,ke])>1||Ie(oe,He)})},xe&&(k[oe]=xe(k[oe])))}function Ie(oe,xe){try{z(I[oe](xe))}catch(He){Ke(P[0][3],He)}}function z(oe){oe.value instanceof F?Promise.resolve(oe.value.v).then(fe,Te):Ke(P[0][2],oe)}function fe(oe){Ie("next",oe)}function Te(oe){Ie("throw",oe)}function Ke(oe,xe){oe(xe),P.shift(),P.length&&Ie(P[0][0],P[0][1])}}function te(_){var T,w;return T={},I("next"),I("throw",function(k){throw k}),I("return"),T[Symbol.iterator]=function(){return this},T;function I(k,P){T[k]=_[k]?function(V){return(w=!w)?{value:F(_[k](V)),done:!1}:P?P(V):V}:P}}function Pe(_){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var T=_[Symbol.asyncIterator],w;return T?T.call(_):(_=typeof et=="function"?et(_):_[Symbol.iterator](),w={},I("next"),I("throw"),I("return"),w[Symbol.asyncIterator]=function(){return this},w);function I(P){w[P]=_[P]&&function(V){return new Promise(function(ie,Ie){V=_[P](V),k(ie,Ie,V.done,V.value)})}}function k(P,V,ie,Ie){Promise.resolve(Ie).then(function(z){P({value:z,done:ie})},V)}}function pe(_,T){return Object.defineProperty?Object.defineProperty(_,"raw",{value:T}):_.raw=T,_}var Ne=Object.create?(function(_,T){Object.defineProperty(_,"default",{enumerable:!0,value:T})}):function(_,T){_.default=T},j=function(_){return j=Object.getOwnPropertyNames||function(T){var w=[];for(var I in T)Object.prototype.hasOwnProperty.call(T,I)&&(w[w.length]=I);return w},j(_)};function mt(_){if(_&&_.__esModule)return _;var T={};if(_!=null)for(var w=j(_),I=0;I<w.length;I++)w[I]!=="default"&&X(T,_,w[I]);return Ne(T,_),T}function Jt(_){return _&&_.__esModule?_:{default:_}}function $t(_,T,w,I){if(w==="a"&&!I)throw new TypeError("Private accessor was defined without a getter");if(typeof T=="function"?_!==T||!I:!T.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return w==="m"?I:w==="a"?I.call(_):I?I.value:T.get(_)}function Sn(_,T,w,I,k){if(I==="m")throw new TypeError("Private method is not writable");if(I==="a"&&!k)throw new TypeError("Private accessor was defined without a setter");if(typeof T=="function"?_!==T||!k:!T.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return I==="a"?k.call(_,w):k?k.value=w:T.set(_,w),w}function Qt(_,T){if(T===null||typeof T!="object"&&typeof T!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof _=="function"?T===_:_.has(T)}function Zt(_,T,w){if(T!=null){if(typeof T!="object"&&typeof T!="function")throw new TypeError("Object expected.");var I,k;if(w){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");I=T[Symbol.asyncDispose]}if(I===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");I=T[Symbol.dispose],w&&(k=I)}if(typeof I!="function")throw new TypeError("Object not disposable.");k&&(I=function(){try{k.call(this)}catch(P){return Promise.reject(P)}}),_.stack.push({value:T,dispose:I,async:w})}else w&&_.stack.push({async:!0});return T}var Ir=typeof SuppressedError=="function"?SuppressedError:function(_,T,w){var I=new Error(w);return I.name="SuppressedError",I.error=_,I.suppressed=T,I};function er(_){function T(P){_.error=_.hasError?new Ir(P,_.error,"An error was suppressed during disposal."):P,_.hasError=!0}var w,I=0;function k(){for(;w=_.stack.pop();)try{if(!w.async&&I===1)return I=0,_.stack.push(w),Promise.resolve().then(k);if(w.dispose){var P=w.dispose.call(w.value);if(w.async)return I|=2,Promise.resolve(P).then(k,function(V){return T(V),k()})}else I|=1}catch(V){T(V)}
11if(I===1)return _.hasError?Promise.reject(_.error):Promise.resolve();if(_.hasError)throw _.error}return k()}function Ar(_,T){return typeof _=="string"&&/^\.\.?\//.test(_)?_.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(w,I,k,P,V){return I?T?".jsx":".js":k&&(!P||!V)?w:k+P+"."+V.toLowerCase()+"js"}):_}var Ia={__extends:u,__assign:ee,__rest:de,__decorate:K,__param:ge,__esDecorate:Z,__runInitializers:re,__propKey:ae,__setFunctionName:Ce,__metadata:Ye,__awaiter:We,__generator:gt,__createBinding:X,__exportStar:ot,__values:et,__read:me,__spread:G,__spreadArrays:O,__spreadArray:B,__await:F,__asyncGenerator:N,__asyncDelegator:te,__asyncValues:Pe,__makeTemplateObject:pe,__importStar:mt,__importDefault:Jt,__classPrivateFieldGet:$t,__classPrivateFieldSet:Sn,__classPrivateFieldIn:Qt,__addDisposableResource:Zt,__disposeResources:er,__rewriteRelativeImportExtension:Ar}}),43619:((le,ne)=>{"use strict";var Y;Y={value:!0},ne.Observable=void 0;const Ve=G=>!!Symbol[G],u=G=>Ve(G)?Symbol[G]:"@@"+G,ee=u("iterator"),de=u("observable"),K=u("species");function ge(G,O){let B=G[O];if(B!=null){if(typeof B!="function")throw new TypeError(B+" is not a function");return B}}function Z(G){let O=G.constructor;return O!==void 0&&(O=O[K],O===null&&(O=void 0)),O!==void 0?O:me}function re(G){return G instanceof me}function ae(G){ae.log?ae.log(G):setTimeout(()=>{throw G})}function Ce(G){Promise.resolve().then(()=>{try{G()}catch(O){ae(O)}})}function Ye(G){let O=G._cleanup;if(O!==void 0&&(G._cleanup=void 0,!!O))try{if(typeof O=="function")O();else{let B=ge(O,"unsubscribe");B&&B.call(O)}}catch(B){ae(B)}}function We(G){G._observer=void 0,G._queue=void 0,G._state="closed"}function gt(G){let O=G._queue;if(O){G._queue=void 0,G._state="ready";for(let B=0;B<O.length&&(X(G,O[B].type,O[B].value),G._state!=="closed");++B);}}function X(G,O,B){G._state="running";let F=G._observer;try{let N=ge(F,O);switch(O){case"next":N&&N.call(F,B);break;case"error":if(We(G),N)N.call(F,B);else throw B;break;case"complete":We(G),N&&N.call(F);break}}catch(N){ae(N)}G._state==="closed"?Ye(G):G._state==="running"&&(G._state="ready")}function ot(G,O,B){if(G._state!=="closed"){if(G._state==="buffering"){G._queue.push({type:O,value:B});return}if(G._state!=="ready"){G._state="buffering",G._queue=[{type:O,value:B}],Ce(()=>gt(G));return}X(G,O,B)}}class et{constructor(O,B){this._cleanup=void 0,this._observer=O,this._queue=void 0,this._state="initializing";let F=this,N={get closed(){return F._state==="closed"},next(te){ot(F,"next",te)},error(te){ot(F,"error",te)},complete(){ot(F,"complete")}};try{this._cleanup=B.call(void 0,N)}catch(te){N.error(te)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(We(this),Ye(this))}}class me{constructor(O){if(!(this instanceof me))throw new TypeError("Observable cannot be called as a function");if(typeof O!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=O}subscribe(O){return(typeof O!="object"||O===null)&&(O={next:O,error:arguments[1],complete:arguments[2]}),new et(O,this._subscriber)}forEach(O){return new Promise((B,F)=>{if(typeof O!="function"){F(new TypeError(O+" is not a function"));return}function N(){te.unsubscribe(),B()}let te=this.subscribe({next(Pe){try{O(Pe,N)}catch(pe){F(pe),te.unsubscribe()}},error:F,complete:B})})}map(O){if(typeof O!="function")throw new TypeError(O+" is not a function");let B=Z(this);return new B(F=>this.subscribe({next(N){try{N=O(N)}catch(te){return F.error(te)}F.next(N)},error(N){F.error(N)},complete(){F.complete()}}))}filter(O){if(typeof O!="function")throw new TypeError(O+" is not a function");let B=Z(this);return new B(F=>this.subscribe({next(N){try{if(!O(N))return}catch(te){return F.error(te)}F.next(N)},error(N){F.error(N)},complete(){F.complete()}}))}reduce(O){if(typeof O!="function")throw new TypeError(O+" is not a function");let B=Z(this),F=arguments.length>1,N=!1,Pe=arguments[1];return new B(pe=>this.subscribe({next(Ne){let j=!N;if(N=!0,!j||F)try{Pe=O(Pe,Ne)}catch(mt){return pe.error(mt)}else Pe=Ne},error(Ne){pe.error(Ne)},complete(){if(!N&&!F)return pe.error(new TypeError("Cannot reduce an empty sequence"));pe.next(Pe),pe.complete()}}))}async all(){let O=[];return await this.forEach(B=>O.push(B)),O}concat(...O){let B=Z(this);return new B(F=>{let N,te=0;function Pe(pe){N=pe.subscribe({next(Ne){F.next(Ne)},error(Ne){F.error(Ne)},complete(){te===O.length?(N=void 0,F.complete()):Pe(B.from(O[te++]))}})}return Pe(this),()=>{N&&(N.unsubscribe(),N=void 0)}})}flatMap(O){if(typeof O!="function")throw new TypeError(O+" is not a function");let B=Z(this);return new B(F=>{let N=[],te=this.subscribe({next(pe){if(O)try{pe=O(pe)}catch(j){return F.error(j)}let Ne=B.from(pe).subscribe({next(j){F.next(j)},error(j){F.error(j)},complete(){let j=N.indexOf(Ne);j>=0&&N.splice(j,1),Pe()}});N.push(Ne)},error(pe){F.error(pe)},complete(){Pe()}});function Pe(){te.closed&&N.length===0&&F.complete()}return()=>
11{N.forEach(pe=>pe.unsubscribe()),te.unsubscribe()}})}[de](){return this}static from(O){let B=typeof this=="function"?this:me;if(O==null)throw new TypeError(O+" is not an object");let F=ge(O,de);if(F){let N=F.call(O);if(Object(N)!==N)throw new TypeError(N+" is not an object");return re(N)&&N.constructor===B?N:new B(te=>N.subscribe(te))}if(Ve("iterator")&&(F=ge(O,ee),F))return new B(N=>{Ce(()=>{if(!N.closed){for(let te of F.call(O))if(N.next(te),N.closed)return;N.complete()}})});if(Array.isArray(O))return new B(N=>{Ce(()=>{if(!N.closed){for(let te=0;te<O.length;++te)if(N.next(O[te]),N.closed)return;N.complete()}})});throw new TypeError(O+" is not observable")}static of(...O){let B=typeof this=="function"?this:me;return new B(F=>{Ce(()=>{if(!F.closed){for(let N=0;N<O.length;++N)if(F.next(O[N]),F.closed)return;F.complete()}})})}static get[K](){return this}}ne.Observable=me,Object.defineProperty(me,Symbol("extensions"),{value:{symbol:de,hostReportError:ae},configurable:!0})}),81401:(le=>{var ne=Object.prototype.hasOwnProperty;function Y(ee){return"[Throws: "+(ee?ee.message:"?")+"]"}function Ve(ee,de){if(ne.call(ee,de))try{return ee[de]}catch(K){return Y(K)}return ee[de]}function u(ee){var de=[];function K(ge){if(ge===null||typeof ge!="object")return ge;if(de.indexOf(ge)!==-1)return"[Circular]";if(de.push(ge),typeof ge.toJSON=="function")try{var Z=K(ge.toJSON());return de.pop(),Z}catch(Ce){return Y(Ce)}if(Array.isArray(ge)){var re=ge.map(K);return de.pop(),re}var ae=Object.keys(ge).reduce(function(Ce,Ye){return Ce[Ye]=K(Ve(ge,Ye)),Ce},{});return de.pop(),ae}return K(ee)}le.exports=function(ee,de,K){return JSON.stringify(u(ee),de,K)},le.exports.ensureProperties=u})}]);})(); 12 13//# sourceMappingURL=amplitude.2be6cfa025fca6348b46.js.map
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.