PageSourceSearch

https://tele2.kz/new/_next/static/chunks/7730-cb7f5b3e59b10b18.js

js tele2.kz collected 2026-09-24 09:18:06 UTC 184,227 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7730],{27730:function(e,t,n){"use strict";let r;n.d(t,{yl:function(){return i5},S1:function(){return i6},j:function(){return i9}});var i,o,s,a,u,c,l,d,f,p,h,v,g,m,y,b,w,S,E,T,I,k,_,P,O,R,C,A,x,N={};n.r(N);var D=function(e,t){return(D=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function L(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var j=function(){return(j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function U(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function F(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}function M(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function q(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function $(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,(i=m||(m={}))[i.None=0]="None",i[i.Error=1]="Error",i[i.Warn=2]="Warn",i[i.Verbose=3]="Verbose",i[i.Debug=4]="Debug";var V=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},H=function(e){return function(){var t=j({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},z=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=q(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},W=function(e,t){return function(){var n,r,i={};try{for(var o=q(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=z(e,a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},K=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),u=a.logger,c=a.logLevel;if(c&&c<m.Debug||!c||!u)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:V(1),time:{start:new Date().toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then(function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),u.debug(JSON.stringify(l,null,2))}):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),u.debug(JSON.stringify(l,null,2))),d}},J=function(e){return{promise:e||Promise.resolve()}},G="Amplitude Logger ",Y=function(){function e(){this.logLevel=m.None}return e.prototype.disable=function(){this.logLevel=m.None},e.prototype.enable=function(e){void 0===e&&(e=m.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Verbose||console.log("".concat(G,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Warn||console.warn("".concat(G,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Error||console.error("".concat(G,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<m.Debug||console.log("".concat(G,"[Debug]: ").concat(e.join(" ")))},e}(),Q=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),Z=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0},X=$([],B(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),ee=function(e){var t,n=Z();if(!(null===(t=null==n?void 0:n.crypto)||void 0===t?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,ee);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,$([],B(r.entries()),!1).map(function(e){var t=B(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(X[r]):X[r]}).join("")}
1,et={INVALID_API_KEY:401,FORBIDDEN:403,RATE_LIMIT:429},en=function(){function e(t,n,r,i,o,s){void 0===r&&(r="US"),void 0===s&&(s=e.CONFIG_GROUP),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=t,this.serverUrl=i||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=n,this.storage=new Q(t,n),this.customFetch=o,this.configGroup=s}return e.prototype.subscribe=function(e,t,n){var r=ee(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return -1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return F(this,void 0,void 0,function(){var e,t=this;return M(this,function(n){switch(n.label){case 0:if(this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5)return this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2];return[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(n){t.sendCallback(n,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(e){return F(this,void 0,void 0,function(){var t,n,r=this;return M(this,function(i){switch(i.label){case 0:return[4,Promise.race([t=this.getOrCreateFetchPromise().then(function(t){r.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),r.sendCallback(e,t,"remote"),r.storage.setConfig(t)}),this.storage.fetchConfig().then(function(e){return e})])];case 1:return void 0!==(n=i.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending c
1allback because cache is empty (first time user).")),[4,t];case 2:return i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return F(this,void 0,void 0,function(){var n,r;return M(this,function(i){switch(i.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.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 null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),F(this,void 0,void 0,function(){var n,r,i,o,s,a,u=this;return M(this,function(c){switch(c.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,s,a,c,l,d,f,p,h;return M(this,function(v){switch(v.label){case 0:i=!0,s=new AbortController,a=setTimeout(function(){return s.abort()},t),v.label=1;case 1:var g,m;if(v.trys.push([1,10,11,12]),c=o.getUrlParams(),l={Accept:"*/*"},!o.customFetch)return[3,3];return[4,(g=o.customFetch({url:c,method:"GET",headers:l,signal:s.signal}),m=s.signal,new Promise(function(e,t){var n=function(){var e=Error("Remote config custom fetch aborted by timeout");e.name="AbortError",t(e)};m.addEventListener("abort",n,{once:!0}),g.then(function(t){m.removeEventListener("abort",n),e(t)},function(e){m.removeEventListener("abort",n),t(e)})}))];case 2:return f=v.sent(),[3,5];case 3:return[4,fetch(c,{method:"GET",headers:l,signal:s.signal})];case 4:f=v.sent(),v.label=5;case 5:if((d=f).ok||d.status>=200&&d.status<300)return[3,7];return[4,d.text()];case 6:return p=v.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(d.status,": ").concat(p)),d.status===et.INVALID_API_KEY||d.status===et.FORBIDDEN?(o.logger.error("Remote config client fetch failed with ".concat(d.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,i=!1):d.status>=400&&d.status<500&&d.status!==et.RATE_LIMIT&&(i=!1),[3,9];case 7:return[4,d.json()];case 8:return[2,{value:{remoteConfig:v.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(h=v.sent())instanceof Error&&"AbortError"===h.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),h),[3,12];case 11:return clearTimeout(a),[7];case 12:if(!i)return[2,"break"];if(!(r<e-1))return[3,14];return[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(n))})];case 13:v.sent(),v.label=14;case 14:return[2]}})},o=this,s=0,c.label=1;case 1:if(!(s<e))return[3,4];return[5,i(s)];case 2:if("object"==typeof(a=c.sent()))return[2,a.value];if("break"===a)return[3,4];c.label=3;case 3:return s++,[3,1];case 4:return[2,r]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),t=new URLSearchParams;return t.append("config_group",this.configGroup),"".concat(this.serverUrl,"/").concat(e,"?").concat(t.toString())},e.CONFIG_GROUP="browser",e}(),er={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},ei={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},eo=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return(null===(e=Z())||void 0===e?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return F(this,void 0,void 0,function(){return M(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;
1n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(){var t=r.result;if(!t){e.logger.debug("DiagnosticsStorage: Missing DB during upgrade.");return}e.createTables(t)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(er.TAGS)||e.createObjectStore(er.TAGS,{keyPath:"key"}),e.objectStoreNames.contains(er.COUNTERS)||e.createObjectStore(er.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains(er.HISTOGRAMS)||e.createObjectStore(er.HISTOGRAMS,{keyPath:"key"}),e.objectStoreNames.contains(er.EVENTS)||e.createObjectStore(er.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(er.INTERNAL)||e.createObjectStore(er.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(e){return F(this,void 0,void 0,function(){var t,n,r,i=this;return M(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([er.TAGS],"readwrite")).objectStore(er.TAGS),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tags",e),r()},o.forEach(function(e){var t=B(e,2),r=t[0],o=t[1];n.put({key:r,value:o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tag",r,o,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",r),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return F(this,void 0,void 0,function(){var t,n,r,i=this;return M(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([er.COUNTERS],"readwrite")).objectStore(er.COUNTERS),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to increment counters",e),r()},o.forEach(function(e){var t=B(e,2),r=t[0],o=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",r),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return F(this,void 0,void 0,function(){var t,n,r,i=this;return M(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([er.HISTOGRAMS],"readwrite")).objectStore(er.HISTOGRAMS),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),r()},o.forEach(function(e){var t=B(e,2),r=t[0],o=t[1],s=n.get(r);s.onsuccess=function(){var e,t=s.result;e=t?{key:r,count:t.count+o.count,min:Math.min(t.min,o.min),max:Math.max(t.max,o.max),sum:t.sum+o.sum}:{key:r,count:o.count,min:o.min,max:o.max,sum:o.sum},n.put(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return F(this,void 0,void 0,function(){var t,n,r,i=this;return M(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([er.EVENTS],"readwrite")).objectStore(er.EVENTS),[2,new Promise(function(r){t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event records",e),r()};var o=n.count();o.onsuccess=function(){var t=Math.max(0,10-o.result);t<e.length&&i.logger.debug("DiagnosticsStorage: Only added ".concat(t," of ").concat(e.length," events due to storage limit")),e.slice(0,t).forEach(function(e){n.add(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},o.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",r),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return F(this,void 0,void 0,function(){var n,r,i;return M(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=(n=o.sent().transaction([er.INTERNAL],"readwrite")).objectStore(er.INTERNAL),[2,new Promise(function(i,o){n.onabort=function(){return o(Error("Failed to set internal value"))};var s=r.put({key:e,value:t});s.onsuccess=function(){return i()},s.onerror=function(){return o(Error("Failed to set internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",i),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return F(this,void 0,void 0,function(){var t,n,r;return M(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(t=i.sent().transaction([er.INTERNAL],"readonly")).objectStore(er.INTERNAL),[2,new Promise(function(r,i){t.onabort=function(){return i(Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return r(o.result)},o.onerror=function(){return i(Error("Failed to get internal value"))}})];case 2:return r=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",r),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return F(this,void 0,void 0,function(){var e,t;return M(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(ei.LAST_FLUSH_TIMESTAMP)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return F(this,void 0,void 0,function(){var t;return M(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(ei.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return F(this,void 0,void 0,function(){var e,t,n,r,i,o,s;return M(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=a.sent().transaction([er.TAGS,er.COUNTERS,er.HISTOGRAMS,er.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(e,er.TAGS),this.getAllFromStore(e,er.COUNTERS),this.getAllFromStore(e,er.HISTOGRAMS),this.getAllFromStore(e,er.EVENTS)])];case 2:return n=(t=B.apply(void 0,[a.sent(),4]))[0],r=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,er.COUNTERS),this.clearTable(e,er.HISTOGRAMS),this.clearTable(e,er.EVENTS)])];case 3:return a.sent(),[2,{tags:n,counters:r,histogramStats:i,events:o}];case 4:return s=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",s),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(Error("Failed to get all from ".concat(t)))}})},e}(),es=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}
1,ea=function(e,t){return 31*Math.abs(es(e.toString()))%1e5/1e5<t},eu=function(){var e=Z();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},ec=function(e){var t=Z();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",j({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=el({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=ed(i),s=el({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:ef(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}},el=function(e){var t,n,r=eu();if(0!==r.length)try{for(var i=q(r),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.filename&&e.filename.includes(s))return"filename";if(e.stack&&e.stack.includes(s))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},ed=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},ef=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},ep=function(){function e(e,t,n,r,i){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=j({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=ea(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,i?this.storage=i:eo.isSupported()?this.storage=new eo(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),ec(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}this.inMemoryTags[e]=t,this.startTimersIfNeeded()}},e.prototype.increment=function(e,t){if(void 0===t&&(t=1),this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=1e4){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},3e5))},e.prototype.saveAllDataToStorage=function(){return F(this,void 0,void 0,function(){var e,t,n,r;return M(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=j({},this.inMemoryTags),t=j({},this.inMemoryCounters),n=j({},this.inMemoryHistograms),r=$([],B(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return F(this,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u,c;return M(this,function(l){switch(l.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return l.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=l.sent()).tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),s={}
1,n.forEach(function(e){s[e.key]=e.value}),a={},r.forEach(function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),u=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(s).length&&0===Object.keys(a).length&&0===u.length)return[2];return c={tags:o,histogram:a,counters:s,events:u},this.fetch(c),[2]}})})},e.prototype.fetch=function(e){return F(this,void 0,void 0,function(){var t;return M(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!Z())throw 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(e)})];case 1:if(!n.sent().ok)return this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2];return this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return F(this,void 0,void 0,function(){var e,t,n;return M(this,function(r){switch(r.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=r.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(n=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-n),[2]}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=ea(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),eh=function(){var e,t=Z();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=ev(n[0]),i=ev(n[1]);return i&&(e[r]=i),e},{}):{}},ev=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}};class eg{getApplicationContext(){return{versionName:this.versionName,language:em(),platform:"Web",os:void 0,deviceModel:void 0}}}let em=()=>"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||"";class ey{constructor(){this.queue=[]}logEvent(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)}setEventReceiver(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(t=>{e(t)}),this.queue=[])}}let eb=(e,t)=>{let n=typeof e;if(n!==typeof t)return!1;for(let r of["string","number","boolean","undefined"])if(r===n)return e===t;if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;let r=Array.isArray(e),i=Array.isArray(t);if(r!==i)return!1;if(r&&i){for(let n=0;n<e.length;n++)if(!eb(e[n],t[n]))return!1}else{let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(!eb(n,r))return!1;let i=!0;return Object.keys(e).forEach(n=>{eb(e[n],t[n])||(i=!1)}),i}return!0};Object.entries||(Object.entries=function(e){let t=Object.keys(e),n=t.length,r=Array(n);for(;n--;)r[n]=[t[n],e[t[n]]];return r});class ew{constructor(){this.identity={userProperties:{}},this.listeners=new Set}editIdentity(){let e=this,t=Object.assign({},this.identity.userProperties),n=Object.assign(Object.assign({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut(e){return n.optOut=e,this},updateUserProperties:function(e){let t=n.userProperties||{};for(let[n,r]of Object.entries(e))switch(n){case"$set":for(let[e,n]of Object.entries(r))t[e]=n;break;case"$unset":for(let e of Object.keys(r))delete t[e];break;case"$clearAll":t={}}return n.userProperties=t,this},commit:function(){return e.setIdentity(n),this}}}getIdentity(){return Object.assign({},this.identity)}setIdentity(e){let t=Object.assign({},this.identity);this.identity=Object.assign({}
1,e),eb(t,this.identity)||this.listeners.forEach(t=>{t(e)})}addIdentityListener(e){this.listeners.add(e)}removeIdentityListener(e){this.listeners.delete(e)}}let eS="undefined"!=typeof globalThis?globalThis:void 0!==n.g?n.g:self;class eE{constructor(){this.identityStore=new ew,this.eventBridge=new ey,this.applicationContextProvider=new eg}static getInstance(e){return eS.analyticsConnectorInstances||(eS.analyticsConnectorInstances={}),eS.analyticsConnectorInstances[e]||(eS.analyticsConnectorInstances[e]=new eE),eS.analyticsConnectorInstances[e]}}var eT="".concat("AMP","_unsent"),eI="$default_instance",ek="https://api2.amplitude.com/2/httpapi",e_="https://api.eu.amplitude.com/2/httpapi",eP="https://api2.amplitude.com/batch",eO="https://api.eu.amplitude.com/batch",eR="dclid",eC="fbclid",eA="gbraid",ex="gclid",eN="ko_click_id",eD="li_fat_id",eL="msclkid",ej="rdt_cid",eU="ttclid",eF="twclid",eM="wbraid",eq={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},eB=["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"],e$=function(e){return void 0===e||""===e?eI:e},eV=function(e){return eE.getInstance(e$(e))},eH=function(e,t){eV(t).identityStore.editIdentity().setUserId(e).commit()},ez=function(e,t){eV(t).identityStore.editIdentity().setDeviceId(e).commit()};(o=y||(y={})).Unknown="unknown",o.Skipped="skipped",o.Success="success",o.RateLimit="rate_limit",o.PayloadTooLarge="payload_too_large",o.Invalid="invalid",o.Failed="failed",o.Timeout="Timeout",o.SystemError="SystemError";var eW="Event skipped due to empty event type",eK=function(e,t){var n=Math.max(t,1);return e.reduce(function(e,t,r){var i=Math.floor(r/n);return e[i]||(e[i]=[]),e[i].push(t),e},[])},eJ=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=y.Unknown),{event:e,code:t,message:n}},eG=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:eI,logLevel:m.Warn,loggerProvider:new Y,offline:!1,optOut:!1,serverUrl:ek,serverZone:"US",useBatch:!1}},eY=function(){function e(e){this._optOut=!1;var t,n,r,i,o=eG();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e$(e.instanceName),this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(r=e.optOut)&&void 0!==r?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=eQ(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),eQ=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=eG().serverZone),void 0===n&&(n=eG().useBatch),e)return{serverUrl:e,serverZone:void 0};var r,i=["US","EU"].includes(t)?t:eG().serverZone;return{serverZone:i,serverUrl:(r=n,"EU"===i?r?eO:e_:r?eP:ek)}},eZ=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function eX(e){return e>=200&&e<300}var e0=new Set([ek,e_,eP,eO]);function e1(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var e2=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return F(this,void 0,void 0,function(){var n,r=this;return M(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(eT,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map(function(e){return r.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=ee()),new Promise(function(n){t.queue.push({event:e,attempts:0,callback:function(e){return n(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})}
1,e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline&&(null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),F(this,void 0,void 0,function(){var t,n,r=this;return M(this,function(i){switch(i.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),[4,eK(t,this.config.flushQueueSize).reduce(function(t,n){return F(r,void 0,void 0,function(){return M(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())];case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),F(this,void 0,void 0,function(){var r,i,o,s,a;return M(this,function(u){var c,l,d;switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,U(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new eZ,u.label=1;case 1:return u.trys.push([1,3,,4]),c=i=eQ(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,void 0===(l=this.config.enableRequestBodyCompression)&&(l=!1),o=!!e0.has(c)||l,[4,this.config.transportProvider.send(i,r,o)];case 2:if(null===(s=u.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(e1(s))):this.fulfillRequest(e,s.statusCode,s.status),[2];return this.handleResponse(s,e),[3,4];case 3:return a=(d=u.sent())instanceof Error?d.message:String(d),this.config.loggerProvider.error(a),null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:a,stack_trace:V()}),this.handleResponse({status:y.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){eX(e.statusCode)||null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:e1(e),stack_trace:V()});var n,r=e.status;switch(r){case y.Success:this.handleSuccessResponse(e,t);break;case y.Invalid:this.handleInvalidResponse(e,t);break;case y.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case y.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key")){this.fulfillRequest(t,e.statusCode,e.body.error);return}var r=$($($($([],B(Object.values(e.body.eventsWithInvalidFields)),!1),B(Object.values(e.body.eventsWithMissingFields)),!1),B(Object.values(e.body.eventsWithInvalidIdLengths)),!1),B(e.body.silencedEvents),!1).flat(),i=new Set(r),o=t.filter(function(t,r){if(i.has(r)){n.fulfillRequest([t],e.statusCode,e.body.error);return}return!0});o.length>0&&this.config.loggerProvider.warn(e1(e));
1var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length){this.fulfillRequest(t,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(e1(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),u=new Set(o),c=t.filter(function(t,r){if(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)){n.fulfillRequest([t],e.statusCode,e.body.error);return}return u.has(r)&&(t.timeout=n.throttleTimeout),!0});c.length>0&&this.config.loggerProvider.warn(e1(e));var l=this.removeEventsExceedFlushMaxRetries(c);this.scheduleEvents(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;eX(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(r=this.diagnosticsClient)||void 0===r||r.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:V()})),this.removeEvents(e),e.forEach(function(e){return e.callback(eJ(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}(),e3=function(){function e(){this.name="identity",this.type="before",this.identityStore=eV().identityStore}return e.prototype.execute=function(e){return F(this,void 0,void 0,function(){var t;return M(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return F(this,void 0,void 0,function(){return M(this,function(t){return e.instanceName&&(this.identityStore=eV(e.instanceName).identityStore),[2]})})},e}(),e4=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!e5(t,n))return!1}return!0},e5=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=q(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&e4(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else if(null==t)return!1;else if("object"==typeof t)return e4(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},e6=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return j({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(b.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(b.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(b.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(b.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(b.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(b.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(b.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(b.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(b.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[b.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return!(void 0!==this._properties[b.CLEAR_ALL]||this._propertySet.has(t))&&(e===b.ADD?"number"==typeof n:e===b.UNSET||e===b.REMOVE||e5(t,n))},e}();(s=b||(b={})).SET="$set",s.SET_ONCE="$setOnce",s.ADD="$add",s.APPEND="$append",s.PREPEND="$prepend",s.REMOVE="$remove",s.PREINSERT="$preInsert",s.POSTINSERT="$postInsert",s.UNSET="$unset",s.CLEAR_ALL="$clearAll";var e9=[b.CLEAR_ALL,b.UNSET,b.SET,b.SET_ONCE,b.ADD,b.APPEND,b.PREPEND,b.PREINSERT,b.POSTINSERT,b.REMOVE];(a=w||(w={})).SET="$set",a.SET_ONCE="$setOnce",a.ADD="$add",a.APPEND="$append",a.PREPEND="$prepend",a.REMOVE="$remove",a.PREINSERT="$preInsert",a.POSTINSERT="$postInsert",a.UNSET="$unset",a.CLEAR_ALL="$clearAll",(u=S||(S={})).IDENTIFY="$identify",u.GROUP_IDENTIFY="$groupidentify",u.REVENUE="revenue_amount";var e8=function(e,t){return j(j({},t),{event_type:S.IDENTIFY,user_properties:e.getUserProperties()})},e7=function(e,t,n,r){var i;return j(j({},r),{event_type:S.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:((i={})[e]=t,i)})},te=function(e,t,n){var r,i=new e6;return i.set(e,t),j(j({},n),{event_type:S.IDENTIFY,user_properties:i.getUserProperties(),groups:((r={})[e]=t,r)}
1)},tt=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));e4(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?j({},this.properties):{};return e[E.REVENUE_PRODUCT_ID]=this.productId,e[E.REVENUE_QUANTITY]=this.quantity,e[E.REVENUE_PRICE]=this.price,e[E.REVENUE_TYPE]=this.revenueType,e[E.REVENUE_CURRENCY]=this.currency,e[E.REVENUE]=this.revenue,e[E.RECEIPT]=this.receipt,e[E.RECEIPT_SIG]=this.receiptSig,e},e}();(c=E||(E={})).REVENUE_PRODUCT_ID="$productId",c.REVENUE_QUANTITY="$quantity",c.REVENUE_PRICE="$price",c.REVENUE_TYPE="$revenueType",c.REVENUE_CURRENCY="$currency",c.REVENUE="$revenue",c.RECEIPT="$receipt",c.RECEIPT_SIG="$receiptSig";var tn=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},tr=n(95775),ti=n.n(tr)()||tr,to=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,r;return F(this,void 0,void 0,function(){var i;return M(this,function(o){switch(o.label){case 0:if(void 0===e.name&&(e.name=ee(),this.loggerProvider.warn("Plugin name is undefined.\n      Generating a random UUID for plugin name: ".concat(e.name,".\n      Set a name for the plugin to prevent it from being added multiple times."))),i=e.name,this.pluginStatus.has(i))return this.loggerProvider.warn("Plugin with name ".concat(i," already exists, skipping registration")),[2];return e.type=null!==(n=e.type)&&void 0!==n?n:"enrichment",this.pluginStatus.set(i,"locked"),[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)];case 1:if(o.sent(),"locked"!==this.pluginStatus.get(i))return[2];return this.plugins.push(e),this.pluginStatus.set(i,"installed"),[2]}})})},e.prototype.deregister=function(e,t){var n;return F(this,void 0,void 0,function(){var r,i;return M(this,function(o){switch(o.label){case 0:if(this.pluginStatus.delete(e),-1===(r=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return i=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=i.teardown)||void 0===n?void 0:n.call(i)];case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return F(this,void 0,void 0,function(){var t,n,r,i,o,s,a,u,c,l,d,f,p,h,v;return M(this,function(g){switch(g.label){case 0:if(!e)return[2];t=B(e,1)[0],n=B(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),r=this.plugins.filter(function(e){return"before"===e.type}),g.label=1;case 1:g.trys.push([1,6,7,8]),o=(i=q(r)).next(),g.label=2;case 2:if(o.done)return[3,5];if(!(s=o.value).execute)return[3,4];return[4,s.execute(j({},t))];case 3:if(null===(a=g.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(s.name),"', event: ").concat(ti(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(s.name),"', event: ").concat(ti(t))),g.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return f={error:g.sent()},[3,8];
1case 7:try{o&&!o.done&&(p=i.return)&&p.call(i)}finally{if(f)throw f.error}return[7];case 8:u=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),g.label=9;case 9:g.trys.push([9,14,15,16]),l=(c=q(u)).next(),g.label=10;case 10:if(l.done)return[3,13];if(!(s=l.value).execute)return[3,12];return[4,s.execute(j({},t))];case 11:if(null===(a=g.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(s.name),"', event: ").concat(ti(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(s.name),"', event: ").concat(ti(t))),g.label=12;case 12:return l=c.next(),[3,10];case 13:return[3,16];case 14:return h={error:g.sent()},[3,16];case 15:try{l&&!l.done&&(v=c.return)&&v.call(c)}finally{if(h)throw h.error}return[7];case 16:return d=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(ti(t))),Promise.all(d.map(function(e){var n=j({},t);return e.execute(n).catch(function(e){return eJ(n,0,String(e))})})).then(function(e){n(B(e,1)[0]||eJ(t,100,"Event not tracked, no destination plugins on the instance"))}),[2]}})})},e.prototype.flush=function(){return F(this,void 0,void 0,function(){var e,t=this;return M(this,function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return n.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return n.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onIdentityChanged)||void 0===n||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onSessionIdChanged)||void 0===n||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onOptOutChanged)||void 0===n||n.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return F(this,void 0,void 0,function(){var t,n,r,i,o,s;return M(this,function(a){switch(a.label){case 0:a.trys.push([0,7,8,9]),n=(t=q(this._optOutListeners)).next(),a.label=1;case 1:if(n.done)return[3,6];r=n.value,a.label=2;case 2:return a.trys.push([2,4,,5]),[4,r(e)];case 3:return a.sent(),[3,5];case 4:return i=a.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return o={error:a.sent()},[3,9];case 8:try{n&&!n.done&&(s=t.return)&&s.call(t)}finally{if(o)throw o.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)})},e}(),ts=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new to(this),this.name=e}return e.prototype._init=function(e){return F(this,void 0,void 0,function(){var t=this;return M(this,function(n){switch(n.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q",function(){return t.isReady=!0})];case 1:return n.sent(),[2]}})})},e.prototype.runQueuedFunctions=function(e,t){return F(this,void 0,void 0,function(){var n,r,i,o,s,a;return M(this,function(u){switch(u.label){case 0:n=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),i=(r=q(n)).next(),u.label=2;case 2:if(i.done)return[3,7];if(!((o=(0,i.value)())&&"promise"in o))return[3,4];return[4,o.promise];case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return i=r.next(),[3,2];case 7:return[3,10];case 8:return s={error:u.sent()},[3,10];case 9:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}
1return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e,t)];case 11:return u.sent(),[3,13];case 12:null==t||t(),u.label=13;case 13:return[2]}})})},e.prototype.track=function(e,t,n){var r=j(j(j({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t});return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),J(this.dispatch(r))},e.prototype.identify=function(e,t){var n=e8(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),J(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=e7(e,t,n,r);return J(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=te(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),J(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=j(j({},t),{event_type:S.REVENUE,event_properties:e.getEventProperties()});return J(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),J())},e.prototype._addPlugin=function(e){return J(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),J())},e.prototype._removePlugin=function(e){return J(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(eJ(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return F(this,void 0,void 0,function(){var t=this;return M(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=j({},null!==(t=this.userProperties)&&void 0!==t?t:{});if(void 0===e)return n;var r={};return Object.keys(e).forEach(function(t){Object.values(w).includes(t)||(r[t]=e[t])}),e9.forEach(function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case w.CLEAR_ALL:Object.keys(n).forEach(function(e){delete n[e]});break;case w.UNSET:Object.keys(r).forEach(function(e){delete n[e]});break;case w.SET:Object.assign(n,r)}}}),Object.assign(n,r),n},e.prototype.process=function(e){return F(this,void 0,void 0,function(){var t,n,r;return M(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),this.config.optOut)return[2,eJ(e,0,"Event skipped due to optOut config")];if("string"!=typeof(t=e.event_type)||0===t.trim().length)return this.config.loggerProvider.error(eW),[2,eJ(e,0,eW)];return e.event_type===S.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)];case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return r=String(i.sent()),this.config.loggerProvider.error(r),[2,n=eJ(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){if(!this.isReady){this.q.push(this._setOptOut.bind(this,Boolean(e)));return}this._setOptOut(e)},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return J(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});if(void 0===t){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e));return}return t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),ta=function(e,t){var n,r,i;return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1&&("string"!=typeof(null===(r=null===(n=null==(i=Z())?void 0:i.chrome)||void 0===n?void 0:n.runtime)||void 0===r?void 0:r.id)||!!(null==e?void 0:e[t]))},tu=function(e){return ta(e,"attribution")},tc=function(e){return ta(e,"formInteractions")},tl=function(e){return ta(e,"pageViews")},td=function(e){return ta(e,"sessions")},tf=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},tp=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},th=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},tv=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;return!0===t?{mainThreadBlock:!0}:"object"==typeof t&&null!==t?t:void 0}},tg=function(e){if(tp(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},tm=function(e){if(th(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},ty=function(e){if(tf(e.autocapture)){var t,n,r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.
1networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),j(j({},r),{captureRules:(t=null==r?void 0:r.captureRules,n=e.loggerProvider,null==t?void 0:t.map(function(e){var t,r;if((null===(t=e.urls)||void 0===t?void 0:t.length)&&(null===(r=e.hosts)||void 0===r?void 0:r.length)){var i=JSON.stringify(e.hosts),o=JSON.stringify(e.urls);return null==n||n.warn("Found network capture rule with both urls='".concat(o,"' and hosts='").concat(i,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),j(j({},e),{hosts:void 0})}return e}))})}},tb=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return tl(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},tw=function(e){if(tc(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},tS=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,s=r.resolve,a=e&&e[i];if("function"==typeof a){var u=a.apply(e,o);"function"==typeof s&&s(null==u?void 0:u.promise)}}return e},tE=function(e){return e&&void 0!==e._q},tT=function(e){var t,n;return"string"==typeof(null===(n=null===(t=e.chrome)||void 0===t?void 0:t.runtime)||void 0===n?void 0:n.id)},tI=function(e){var t=e.ServiceWorkerGlobalScope;return"function"==typeof t&&e instanceof t},tk=function(e){var t=e.WorkerGlobalScope;return"function"==typeof t&&e instanceof t},t_=function(e){var t,n;return"string"==typeof(null===(n=null===(t=e.process)||void 0===t?void 0:t.versions)||void 0===n?void 0:n.node)},tP=function(){if("undefined"==typeof navigator)return"";var e,t,n,r,i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},tO="2.45.10",tR="amplitude-ts",tC=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(tR,"/").concat(tO),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return F(this,void 0,void 0,function(){var r,i,o;return M(this,function(s){return r=new Date().getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,o=null!==(n=e.event_id)&&void 0!==n?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,j(j(j(j(j(j(j(j({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:tP()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:ee(),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}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]})})},e}(),tA=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return F(this,void 0,void 0,function(){return M(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return F(this,void 0,void 0,function(){return M(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return F(this,void 0,void 0,function(){var t;return M(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return F(this,void 0,void 0,function(){return M(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return F(this,void 0,void 0,function(){return M(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return F(this,void 0,void 0,function(){return M(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),tx=function(){var e,t=Z();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks},tN=function(){function e(e,t){void 0===t&&(t={}),this.options=j({},e),this.config=t}return e.prototype.isEnabled=function(){return F(this,void 0,void 0,function(){var t,n,r,i,o=this;return M(this,function(s){switch(s.label){case 0:return t="AMP_TEST",n=j({},this.options),r=new e(n),i=String(Date.now()),[4,r.transaction(t,function(e){var n,r;try{e.set(i);var s=e.get()===i;return!s&&o.config.diagnosticsClient&&(null===(n=o.config.diagnosticsClient)||void 0===n||n.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:i,sync:!0})),s}catch(e){if(o.config.diagnosticsClient){var a=e instanceof Error?e.message:String(e);null===(r=o.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:i,error:a,sync:!0})}return!1}
1finally{e.set(null)}})];case 1:return[2,s.sent()]}})})},e.prototype.get=function(e){return F(this,void 0,void 0,function(){var t;return M(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=tj(t);if(void 0===n){console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t));return}return JSON.parse(n)}catch(n){console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t));return}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,n;return F(this,void 0,void 0,function(){var r,i,o,s,a,u,c,l;return M(this,function(d){switch(d.label){case 0:r=Z(),d.label=1;case 1:if(d.trys.push([1,4,,5]),!(i=null==r?void 0:r.cookieStore))return[3,3];return[4,i.getAll(e)];case 2:if(o=d.sent()){o.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:o.map(function(e){return e.domain})}),null===(n=this.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(a=(s=q(o)).next();!a.done;a=s.next())if(u=a.value,tU(u.domain,this.options.domain))return[2,u.value]}catch(e){c={error:e}}finally{try{a&&!a.done&&(l=s.return)&&l.call(s)}finally{if(c)throw c.error}}}d.label=3;case 3:return[3,5];case 4:return d.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=Z(),o=(null!==(n=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),s=void 0,a=this.config.duplicateResolverFn;if("function"==typeof a&&o.length>1&&(s=o.find(function(t){var n;try{var i=a(t.substring(e.length+1));return i||null===(n=r.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),s||(s=o[0]),s)return s.substring(e.length+1)},e.prototype.set=function(e,t){return F(this,void 0,void 0,function(){return M(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=Z();if(!r||!r.document||"function"!=typeof r.btoa||"function"!=typeof r.encodeURIComponent)return;var i=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=null!==t?i:-1,s=void 0;if(o){var a=new Date;a.setTime(a.getTime()+864e5*o),s=a}var u="".concat(e,"=").concat(r.btoa(r.encodeURIComponent(JSON.stringify(t))));s&&(u+="; expires=".concat(s.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),r.document.cookie=u}catch(t){var c=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}},e.prototype.remove=function(e){return F(this,void 0,void 0,function(){return M(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return F(this,void 0,void 0,function(){return M(this,function(e){return[2]})})},e.isDomainWritable=function(t){return F(this,void 0,void 0,function(){var n,r,i;return M(this,function(o){switch(o.label){case 0:if(e.cachedTlds[t])return[2,!0];n={domain:"."+t},r="AMP_TLDTEST",i=new e(n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,i.transaction(r,function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!o.sent()];case 3:return o.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return F(this,void 0,void 0,function(){var n,r,i=this;return M(this,function(o){switch(o.label){case 0:if(n=tx(),r=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!n)return[2,r()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),r)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,r()];case 4:return[2]}})})},e.cachedTlds={},e}(),tD=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tL=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},tj=function(e){var t;return null!==(t=tD(e))&&void 0!==t?t:tL(e)},tU=function(e,t){if(""===e&&""===t)return!0;
1if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},tF=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},tM=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return F(this,void 0,void 0,function(){var t,n,r;return M(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return F(this,void 0,void 0,function(){var t;return M(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return F(this,void 0,void 0,function(){return M(this,function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return F(this,void 0,void 0,function(){return M(this,function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return F(this,void 0,void 0,function(){return M(this,function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return F(this,void 0,void 0,function(){return M(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]})})},e}(),tq=function(e){function t(t){var n,r,i,o=this;try{i=null===(n=Z())||void 0===n?void 0:n.localStorage}catch(e){null===(r=null==t?void 0:t.loggerProvider)||void 0===r||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return L(t,e),t.prototype.set=function(t,n){var r;return F(this,void 0,void 0,function(){var i;return M(this,function(o){switch(o.label){case 0:if(!(Array.isArray(n)&&n.length>1e3))return[3,2];return i=n.length-1e3,[4,e.prototype.set.call(this,t,n.slice(0,1e3))];case 1:return o.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(tM),tB=function(e){function t(){var t;return e.call(this,null===(t=Z())||void 0===t?void 0:t.sessionStorage)||this}return L(t,e),t}(tM);function t$(){return"undefined"!=typeof CompressionStream}function tV(e){return F(this,void 0,void 0,function(){var t,n;return M(this,function(r){switch(r.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),n=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(n).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var tH=function(){function e(){}return e.prototype.send=function(e,t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,n,r,i,o,s,a,u,c,l,d,f,p,h,v,g,m,b,w,S,E,T,I=e.code||0,k=this.buildStatus(I);switch(k){case y.Success:return{status:k,statusCode:I,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case y.Invalid:return{status:k,statusCode:I,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{}
1,eventsWithInvalidIdLengths:null!==(u=e.events_with_invalid_id_lengths)&&void 0!==u?u:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case y.PayloadTooLarge:return{status:k,statusCode:I,body:{error:null!==(v=e.error)&&void 0!==v?v:""}};case y.RateLimit:return{status:k,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(b=e.throttled_devices)&&void 0!==b?b:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(E=e.exceeded_daily_quota_users)&&void 0!==E?E:{},throttledEvents:null!==(T=e.throttled_events)&&void 0!==T?T:[]}};case y.Timeout:default:return{status:k,statusCode:I}}},e.prototype.buildStatus=function(e){return eX(e)?y.Success:429===e?y.RateLimit:413===e?y.PayloadTooLarge:408===e?y.Timeout:e>=400&&e<500?y.Invalid:e>=500?y.Failed:y.Unknown},e}(),tz=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=t,n}return L(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),F(this,void 0,void 0,function(){var r=this;return M(this,function(i){return[2,new Promise(function(i,o){"undefined"==typeof XMLHttpRequest&&o(Error("XHRTransport is not supported."));var s=new XMLHttpRequest;s.open("POST",e,!0),s.onreadystatechange=function(){if(s.readyState===r.state.done){var e=s.responseText;try{i(r.buildResponse(JSON.parse(e)))}catch(e){i(r.buildResponse({code:s.status}))}}};var a={"Content-Type":"application/json",Accept:"*/*"},u=JSON.stringify(t),c=n&&u.length>=2048&&t$(),l=function(e){var t,n;a=j(j({},r.customHeaders),a);try{for(var i=q(Object.entries(a)),o=i.next();!o.done;o=i.next()){var u=B(o.value,2),c=u[0],l=u[1];s.setRequestHeader(c,l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}s.send(e)};F(r,void 0,void 0,function(){var e;return M(this,function(t){switch(t.label){case 0:if(!c)return[3,2];return[4,tV(u)];case 1:return(e=t.sent())?(a["Content-Encoding"]="gzip",l(e)):l(u),[3,3];case 2:l(u),t.label=3;case 3:return[2]}})}).catch(o)})]})})},t}(tH),tW=function(e){function t(t,n,r){void 0===t&&(t={});var i=e.call(this)||this;return i.customHeaders=t,i.enableKeepalive=!1!==n,i.referrerPolicy=r,i}return L(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),F(this,void 0,void 0,function(){var r,i,o,s,a,u,c,l,d;return M(this,function(f){switch(f.label){case 0:if("undefined"==typeof fetch)throw Error("FetchTransport is not supported");if(r=JSON.stringify(t),i=n&&r.length>=2048&&t$(),o=r,s={"Content-Type":"application/json",Accept:"*/*"},!i)return[3,2];return[4,tV(r)];case 1:(a=f.sent())&&(s["Content-Encoding"]="gzip",o=a),f.label=2;case 2:return s=j(j({},this.customHeaders),s),u="string"==typeof o?o.length:o.byteLength,c={headers:s,body:o,method:"POST",keepalive:this.enableKeepalive&&u<=16384},this.referrerPolicy&&(c.referrerPolicy=this.referrerPolicy),[4,fetch(e,c)];case 3:return[4,(l=f.sent()).text()];case 4:d=f.sent();try{return[2,this.buildResponse(JSON.parse(d))]}catch(e){return[2,this.buildResponse({code:l.status})]}return[2]}})})},t}(tH),tK=function(e){function t(){return e.call(this)||this}return L(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),F(this,void 0,void 0,function(){var n=this;return M(this,function(r){return[2,new Promise(function(r,i){var o=Z();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);if(o.navigator.sendBeacon(e,s))return r(n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}));return r(n.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(tH),tJ=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},tG=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},tY="[Amplitude]",tQ="".concat(tY," Form Started"),tZ="".concat(tY," Form Submitted"),tX="".concat(tY," File Downloaded"),t0="session_start",t1="session_end",t2="".concat(tY," File Extension"),t3="".concat(tY," File Name"),t4="".concat(tY," Link ID"),t5="".concat(tY," Link Text"),t6="".concat(tY," Link URL"),t9="".concat(tY," Form ID"),t8="".concat(tY," Form Name"),t7="".concat(tY," Form Destination"),ne="cookie",nt={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},nn=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},nr=function(e,t,n,r,i,o){void 0===i&&(i=!0),e.referrer;var s=e.referring_domain,a=U(e,["referrer","referring_domain"]),u=t||{},c=(u.referrer,u.referring_domain),l=U(u,["referrer","referring_domain"]),d=n.excludeInternalReferrers;if(d){var f=na(d,r);if(!(f instanceof TypeError)&&e.referring_domain&&nl(e.referring_domain,o)&&("always"===f||"ifEmptyCampaign"===f&&Object.values(j(j({},e),{referring_domain:void 0,referrer:void 0})).every(function(e){return!e})))return function(e,t,n){var r="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");"always"===e?n.debug(r):"ifEmptyCampaign"===e&&n.debug("".concat(r," with empty campaign parameters"))}(f,e.referring_domain,r),!1}if(ni(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Object.values(e).every(function(e){return!e})&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var p=JSON.stringify(a)!==JSON.stringify(l),h=nn(s||"")!==nn(c||""),v=!t||p||h;return v?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),v},ni=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},no=function(e,t){var n=t.startsWith(".")?t:".".concat(t);return!!(e.startsWith(".")?e:".".concat(e)).endsWith(n)},ns=function(e){var t=e;
1return t?(t.startsWith(".")&&(t=t.substring(1)),[RegExp("".concat(t.replace(".","\\."),"$"))]):[]},na=function(e,t){if(!0===e)return nt.always;if("object"==typeof e){var n=e.condition;if("string"==typeof n&&Object.keys(nt).includes(n))return n;if(void 0===n)return nt.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),TypeError(r)},nu=["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"],nc=function(e){var t,n,r=e||(null===(n=null===(t=Z())||void 0===t?void 0:t.location)||void 0===n?void 0:n.hostname);if(!r)return"";var i=r.split("."),o=i[i.length-1],s=i[i.length-2];return(nu.find(function(e){return r.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],s=i[i.length-3]),s)?"".concat(s,".").concat(o):o},nl=function(e,t){var n=Z();return!!n&&no(e,(t||"").trim()||nc(n.location.hostname))},nd=function(e){function t(t,n,r,i,o,s,a,u,c,l,d,f,p,h,v,g,y,b,w,S,E,T,I,k,_,P,O,R,C,A,x,N,D,L,j,U,F,M,q,B,$,V,H,z){void 0===r&&(r=new tA),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===u&&(u=1e3),void 0===c&&(c=5),void 0===l&&(l=30),void 0===d&&(d=ne),void 0===g&&(g=new Y),void 0===y&&(y=m.Warn),void 0===w&&(w=!1),void 0===S&&(S=!1),void 0===I&&(I=""),void 0===k&&(k="US"),void 0===O&&(O=18e5),void 0===R&&(R=new tq({loggerProvider:g})),void 0===C&&(C={ipAddress:!0,language:!0,platform:!0}),void 0===A&&(A="fetch"),void 0===x&&(x=!1),void 0===N&&(N=!0),void 0===M&&(M=!0),void 0===q&&(q=0),void 0===H&&(H=!1);var W,K=this;(K=e.call(this,{apiKey:t,instanceName:p,storageProvider:R,transportProvider:nh(A)})||this).apiKey=t,K.appVersion=n,K.cookieOptions=i,K.defaultTracking=o,K.autocapture=s,K.flushIntervalMillis=u,K.flushMaxRetries=c,K.flushQueueSize=l,K.identityStorage=d,K.ingestionMetadata=f,K.loggerProvider=g,K.logLevel=y,K.minIdLength=b,K.offline=w,K.partnerId=E,K.plan=T,K.serverUrl=I,K.serverZone=k,K.sessionTimeout=O,K.storageProvider=R,K.trackingOptions=C,K.transport=A,K.useBatch=x,K.fetchRemoteConfig=N,K.networkTrackingOptions=U,K.identify=F,K.enableDiagnostics=M,K.diagnosticsSampleRate=q,K.diagnosticsClient=B,K.remoteConfig=$,K.topLevelDomain=V,K.enableRequestBodyCompression=H,K.customEnrichment=z,K.version=tO,K._optOut=!1,K._cookieStorage=r,K.deviceId=a,K.lastEventId=h,K.lastEventTime=v,K.optOut=S,K.deferredSessionId=P,K.sessionId=_,K.pageCounter=L,K.userId=D,K.debugLogsEnabled=j,K.loggerProvider.enable(j?m.Debug:K.logLevel),K.networkTrackingOptions=U,K.identify=F,K.enableDiagnostics=M,K.diagnosticsSampleRate=q,K.diagnosticsClient=B;var J=null!==(W=null==$?void 0:$.fetchRemoteConfig)&&void 0!==W?W:N;return K.remoteConfig=K.remoteConfig||{},K.remoteConfig.fetchRemoteConfig=J,K.fetchRemoteConfig=J,K.topLevelDomain=V||nc(),K}return L(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof tN&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(tF(this.apiKey),e)},t}(eY),nf=function(e,t,n){switch(void 0===e&&(e=ne),void 0===t&&(t={}),e){case"localStorage":return new tq;case"sessionStorage":return new tB;case"none":return new tA;default:return new tN(j(j({},t),{expirationDays:t.expiration}),n)}},np=function(e){var t,n;return void 0===e&&(e={}),(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)===!0||(null===(n=e.remoteConfig)||void 0===n?void 0:n.fetchRemoteConfig)!==!1&&!1!==e.fetchRemoteConfig},nh=function(e){var t="object"==typeof e?e.type:e,n="object"==typeof e?e.headers:void 0,r="object"==typeof e?e.enableKeepalive:void 0,i="object"==typeof e?e.referrerPolicy:void 0;return"xhr"===t?new tz(n):"beacon"===t?new tK:new tW(n,r,i)},nv=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0},ng="*****",nm=/\b(?:\d[ -]*?){13,16}\b/,ny=/(\d{3}-?\d{2}-?\d{4})/g,nb=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,nw=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var n,r,i=e;i=(i=(i=i.replace(nm,ng)).replace(ny,ng)).replace(nb,ng);try{for(var o=q(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,ng)}catch(e){}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},nS=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute("data-amp-mask")?ng:e?e(document.title):document.title},nE=function(){var e,t=nv();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=nT(n[0]),i=nT(n[1]);return i&&(e[r]=i),e},{}):{}},nT=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},nI="dclid",nk="fbclid",n_="gbraid",nP="gclid",nO="ko_click_id",nR="li_fat_id",nC="msclkid",nA="rdt_cid",nx="ttclid",nN="twclid",nD="wbraid",nL={utm_campaign:void 0,utm_c
1ontent: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},nj=function(){function e(){}return e.prototype.parse=function(){return F(this,void 0,void 0,function(){return M(this,function(e){return[2,j(j(j(j({},nL),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=nE();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=nE();return(e={})[nI]=t[nI],e[nk]=t[nk],e[n_]=t[n_],e[nP]=t[nP],e[nO]=t[nO],e[nR]=t[nR],e[nC]=t[nC],e[nA]=t[nA],e[nx]=t[nx],e[nN]=t[nN],e[nD]=t[nD],e},e}();(l=T||(T={})).SET="$set",l.SET_ONCE="$setOnce",l.ADD="$add",l.APPEND="$append",l.PREPEND="$prepend",l.REMOVE="$remove",l.PREINSERT="$preInsert",l.POSTINSERT="$postInsert",l.UNSET="$unset",l.CLEAR_ALL="$clearAll",(d=I||(I={})).IDENTIFY="$identify",d.GROUP_IDENTIFY="$groupidentify",d.REVENUE="revenue_amount";var nU=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},nF=function(e){void 0===e&&(e={});var t,n,r=nv(),i=void 0,o=!1,s=e.trackOn,a=e.trackHistoryChanges,u=e.eventType,c=void 0===u?"[Amplitude] Page Viewed":u,l=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},d=function(){return F(void 0,void 0,void 0,function(){var e,t,n;return M(this,function(r){switch(r.label){case 0:return e=l("undefined"!=typeof location&&location.href||""),n={event_type:c},t=[{}],[4,nM()];case 1:return[2,(n.event_properties=j.apply(void 0,[j.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&l(location.pathname)||"","[Amplitude] Page Title":nS(nw),"[Amplitude] Page URL":e.split("?")[0]}]),n)]}})})},f=function(){return void 0===s||"function"==typeof s&&s()},p="undefined"!=typeof location?location.href:null,h=function(){return F(void 0,void 0,void 0,function(){var e,n,r,o;return M(this,function(s){switch(s.label){case 0:if(n=nB(a,e=location.href,p||"")&&f(),p=e,!n)return[3,4];if(null==i||i.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return o=(r=t).track,[4,d()];case 2:o.apply(r,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}})})},v=function(){h()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return F(void 0,void 0,void 0,function(){var a,u;return M(this,function(c){switch(c.label){case 0:if(t=s,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",v),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=B(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&h()}})),!f())return[3,2];return i.log("Tracking page view event"),u=(a=t).track,[4,d()];case 1:u.apply(a,[c.sent()]),c.label=2;case 2:return[2]}})})},execute:function(e){return F(void 0,void 0,void 0,function(){var t;return M(this,function(r){switch(r.label){case 0:if(!("attribution"===s&&nq(e)))return[3,2];return null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()];case 1:t=r.sent(),e.event_type=t.event_type,e.event_properties=j(j({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===c&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=j(j({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(e){return r&&(r.removeEventListener("popstate",v),o=!1),[2]})})}}},nM=function(){return F(void 0,void 0,void 0,function(){var e;return M(this,function(t){switch(t.label){case 0:return e=nU,[4,new nj().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},nq=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[T.SET]||{},r=t[T.UNSET]||{},i=$($([],B(Object.keys(n)),!1),B(Object.keys(r)),!1);return Object.keys(nL).every(function(e){return i.includes(e)})}return!1},nB=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;
1var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},n$=function(){var e,t,n=[],r=function(e,t,r){e.addEventListener(t,r),n.push({element:e,type:t,handler:r})},i=function(){n.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),n=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(n,i){return F(void 0,void 0,void 0,function(){var o,s;return M(this,function(a){return t=tw(n),o=function(){if(!i){n.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if("undefined"!=typeof document){var o=new WeakSet,s=function(e){if(!o.has(e)){o.add(e);var s=!1;r(e,"change",function(){var t,n=nH(e);s||i.track(tQ,((t={})[t9]=nV(e.id),t[t8]=nV(e.name),t[t7]=n,t)),s=!0}),r(e,"submit",function(r){var o,a,u=nH(e);if(s||i.track(tQ,((o={})[t9]=nV(e.id),o[t8]=nV(e.name),o[t7]=u,o)),s=!0,(null==t?void 0:t.shouldTrackSubmit)!==void 0){if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&r instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(r))return}catch(e){n.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else n.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.")}i.track(tZ,((a={})[t9]=nV(e.id),a[t8]=nV(e.name),a[t7]=u,a)),s=!1})}};Array.from(document.getElementsByTagName("form")).forEach(s),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){try{if("FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll){var t=e.querySelectorAll("form");null==t||t.forEach(s)}}catch(e){n.loggerProvider.warn("Failed to track form interactions for an added node: ".concat(String(e)))}})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?o():(s=Z())?s.addEventListener("load",o):n.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return F(void 0,void 0,void 0,function(){return M(this,function(t){return[2,e]})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(t){return null==e||e.disconnect(),i(),[2]})})}}},nV=function(e){if("string"==typeof e)return e},nH=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},nz=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,r){return F(void 0,void 0,void 0,function(){var i,o;return M(this,function(s){return i=function(){if(!r){t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if("undefined"!=typeof document){var i=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,i=o.exec(t.href),s=null==i?void 0:i[1];s&&n(e,"click",function(){var n;s&&r.track(tX,((n={})[t2]=s,n[t3]=t.pathname,n[t4]=e.id,n[t5]=e.text,n[t6]=e.href,n))})},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){try{if("A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll){var n=e.querySelectorAll("a");null==n||n.forEach(i)}}catch(e){t.loggerProvider.warn("Failed to track file downloads for an added node: ".concat(String(e)))}})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=Z())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return F(void 0,void 0,void 0,function(){return M(this,function(t){return[2,e]})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},nW=!1,nK=function(e){nW||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n  defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),nW=!0)},nJ=function(){var e=Z(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))},r=function(){t.forEach(function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return F(void 0,void 0,void 0,function(){return M(this,function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,n("online",function(){!1!==e.offline&&(e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis))}),n("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0}),[2])})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(e){return r(),[2]})})}}};function nG(e,t,n){var r,i,o=[];try{for(var s=q(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var u=a.value;try{o.push(RegExp(u))}catch(e){n.warn("Invalid regex pattern: ".concat(u),e)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return e.concat(o)}var nY="[Amplitude] Element Tag",nQ="[Amplitude] Element Text",nZ="[Amplitude] Element Selector",nX="[Amplitude] Page URL",n0="https://app.amplitude.com",n1={US:n0,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},n2="amp-visual-tagging-selector-highlight";function n3(e,t,n){for(var r=null,i=[],o=e,s=0;o&&"break"!==function(){var e,a,u,c,l=rt((e=o.getAttribute("id"))&&k.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null)||rt.apply(void 0,$([],B(Array.from(o.attributes).filter(function(e){return k.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})),!1))||rt.apply(void 0,$([],B(Array.from(o.classList).filter(k.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})),!1))||rt((a=o.tagName.toLowerCase(),k.tagName(a)?{name:a,penalty:2}:null))||[n8()],d=function(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}(o);if("all"==t)d&&(l=l.concat(l.filter(re).map(function(e){return n7(e,d)})));else if("two"==t)l=l.slice(0,1),d&&(l=l.concat(l.filter(re).map(function(e){return n7(e,d)})));else if("one"==t){var f=B(l=l.slice(0,1),1)[0];d&&re(f)&&(l=[n7(f,d)])}
1else"none"==t&&(l=[n8()],d&&(l=[n7(l[0],d)]));try{for(var p=(u=void 0,q(l)),h=p.next();!h.done;h=p.next()){var f=h.value;f.level=s}}catch(e){u={error:e}}finally{try{h&&!h.done&&(c=p.return)&&c.call(p)}finally{if(u)throw u.error}}if(i.push(l),i.length>=k.seedMinLength&&(r=n4(i,n)))return"break";o=o.parentElement,s++}(););return(r||(r=n4(i,n)),!r&&n)?n():r}function n4(e,t){var n,r,i=rr(function e(t,n){var r,i,o,s,a;return void 0===n&&(n=[]),M(this,function(u){switch(u.label){case 0:if(!(t.length>0))return[3,9];u.label=1;case 1:u.trys.push([1,6,7,8]),i=(r=q(t[0])).next(),u.label=2;case 2:if(i.done)return[3,5];return o=i.value,[5,q(e(t.slice(1,t.length),n.concat(o)))];case 3:u.sent(),u.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return s={error:u.sent()},[3,8];case 7:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,n];case 10:u.sent(),u.label=11;case 11:return[2]}})}(e));if(i.length>k.threshold)return t?t():null;try{for(var o=q(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(n9(a))return a}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function n5(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var i=e[r].level||0;n=t.level===i-1?"".concat(e[r].name," > ").concat(n):"".concat(e[r].name," ").concat(n),t=e[r]}return n}function n6(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function n9(e){var t=n5(e);switch(_.querySelectorAll(t).length){case 0:throw Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function n8(){return{name:"*",penalty:3}}function n7(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function re(e){return"html"!==e.name&&!e.name.startsWith("#")}function rt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(rn);return n.length>0?n:null}function rn(e){return null!=e}function rr(e){return $([],B(e),!1).sort(function(e,t){return n6(e)-n6(t)})}var ri=["input","select","textarea"],ro=function(e){return!(null==e||"string"==typeof e&&(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))},rs=function(e){var t,n,r=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t);return!ri.includes(r)},ra=function(e){var t="";return rs(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach(function(e){var n="";e&&3===e.nodeType?e.textContent&&(n=e.textContent):n=ra(e),t+=n.split(/(\s+)/).filter(ro).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}),t},ru=function(e,t){var n,r,i="";try{return i=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n,r={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};_=(n=(k=j(j({},r),t)).root).nodeType===Node.DOCUMENT_NODE?n:n===r.root?n.ownerDocument:n;var i=n3(e,"all",function(){return n3(e,"two",function(){return n3(e,"one",function(){return n3(e,"none")})})});if(i){var o=rr(function e(t,n,r){var i,o,s;return void 0===r&&(r={counter:0,visited:new Map}),M(this,function(a){switch(a.label){case 0:if(!(t.length>2&&t.length>k.optimizedMinLength))return[3,5];i=1,a.label=1;case 1:var u;if(!(i<t.length-1))return[3,5];if(r.counter>k.maxNumberOfTries||(r.counter+=1,(o=$([],B(t),!1)).splice(i,1),s=n5(o),r.visited.has(s)))return[2];if(!(n9(o)&&(u=o,_.querySelector(n5(u))===n)))return[3,4];return[4,o];case 2:return a.sent(),r.visited.set(s,!0),[5,q(e(o,n,r))];case 3:a.sent(),a.label=4;case 4:return i++,[3,1];case 5:return[2]}})}(i,e));return o.length>0&&(i=o[0]),n5(i)}throw Error("Selector was not found.")}(e,{className:function(e){return e!==n2}})}catch(e){t&&t.warn("Failed to get selector with finder, use fallback strategy instead: ".concat(e.toString()))}var o=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);
1if(o&&(i=o),e.id)i="#".concat(e.id);else if(e.className){var s=e.className.split(" ").filter(function(e){return e!==n2}).join(".");s&&(i="".concat(i,".").concat(s))}return i},rc=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return null==r||"object"==typeof r&&0===Object.keys(r).length||"string"==typeof r&&0===r.trim().length||(t[n]=r),t},{})},rl=function(e){var t=e.parentElement;if(!t)return"";var n=t.querySelector(":scope>span,h1,h2,h3,h4,h5,h6");if(n){var r=n.textContent||"";return ro(r)?r:""}return rl(t)},rd=function(e,t){return e&&"querySelectorAll"in e&&"function"==typeof e.querySelectorAll?Array.from(t.reduce(function(t,n){return n&&Array.from(e.querySelectorAll(n)).forEach(function(e){t.add(e)}),t},new Set)):[]},rf=function(e,t){return e?t.some(function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)})?e:rf(null==e?void 0:e.parentElement,t):null},rp=function(e,t){if(!e)return{};var n,r,i,o=null===(i=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),s=ru(e,t);return rc(((n={})[nY]=o,n[nQ]=ra(e),n[nZ]=s,n[nX]=window.location.href.split("?")[0],n))},rh=function(){function e(e){var t=(void 0===e?{}:e).origin,n=this;this.endpoint=n0,this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=void 0===t?n0:t}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.setup=function(e){var t=this,n=void 0===e?{}:e,r=n.logger,i=n.endpoint,o=n.isElementSelectable;this.logger=r,i&&this.endpoint===n0&&(this.endpoint=i);var s=null;window.addEventListener("message",function(e){if(null===(r=null===(n=t.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var n,r,i,a=null==e?void 0:e.data,u=null==a?void 0:a.action;if(u){if("ping"===u)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===u){var c,l=null==a?void 0:a.data;(c="https://cdn.amplitude.com/libs/visual-tagging-selector-0.2.2.js.gz",new Promise(function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=c,r.addEventListener("load",function(){e({status:!0})},{once:!0}),r.addEventListener("error",function(){t({status:!1,message:"Failed to load the script ".concat(c)})}),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(e){t(e)}})).then(function(){var e;s=null===(e=null==window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:rp,isElementSelectable:function(e){return!o||o((null==l?void 0:l.actionType)||"click",e)},onSelect:t.onSelect,onTrack:t.onTrack,visualHighlightClass:n2}),t.notify({action:"selector-loaded"})}).catch(function(){var e;
1null===(e=t.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")})}else"close-visual-tagging-selector"===u&&(null===(i=null==s?void 0:s.close)||void 0===i||i.call(s))}}}),this.notify({action:"page-loaded"})},e}(),rv=["a","button","input","select","textarea","label","[data-amp-default-track]",".amp-default-track"],rg=function(e){void 0===e&&(e={});var t,n=e.cssSelectorAllowlist,r=void 0===n?rv:n,i=e.pageUrlAllowlist,o=e.shouldTrackEventResolver,s=e.dataAttributePrefix,a=void 0===s?"data-amp-track-":s,u=e.visualTaggingOptions,c=void 0===u?{enabled:!0,messenger:new rh}:u,l="@amplitude/plugin-autocapture-browser",d=[],f=void 0,p=function(e,t,n){e.addEventListener(t,n),d.push({element:e,type:t,handler:n})},h=function(){d.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),d=[]},v=function(e,t){if(!t)return!1;var n,s,a,u,c=null===(a=null===(s=null==t?void 0:t.tagName)||void 0===s?void 0:s.toLowerCase)||void 0===a?void 0:a.call(s);if(!c)return!1;if(o)return o(e,t);if(n=window.location.href,!(!i||!i.length||i.some(function(e){return"string"==typeof e?n===e:n.match(e)})))return!1;var l=(null==t?void 0:t.type)||"";if("string"==typeof l)switch(l.toLowerCase()){case"hidden":case"password":return!1}if(r&&!r.some(function(e){var n;return!!(null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e))}))return!1;switch(c){case"input":case"select":case"textarea":return"change"===e||"click"===e;default:var d=null===(u=null==window?void 0:window.getComputedStyle)||void 0===u?void 0:u.call(window,t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e)return!0;return"click"===e}},g=function(e,t){var n,r,i,o=null===(i=null===(r=null==t?void 0:t.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),s="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},u=t.getAttribute("aria-label"),c=t.getAttributeNames().reduce(function(e,n){if(n.startsWith(a)){var r=n.replace(a,""),i=t.getAttribute(n);r&&(e[r]=i||"")}return e},{}),l=rl(t),d=ru(t,f),p=((n={})["[Amplitude] Element ID"]=t.id,n["[Amplitude] Element Class"]=t.className,n[nY]=o,n[nQ]=ra(t),n["[Amplitude] Element Position Left"]=null==s.left?null:Math.round(s.left),n["[Amplitude] Element Position Top"]=null==s.top?null:Math.round(s.top),n["[Amplitude] Element Aria Label"]=u,n["[Amplitude] Element Attributes"]=c,n[nZ]=d,n["[Amplitude] Element Parent Label"]=l,n[nX]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===o&&"click"===e&&t instanceof HTMLAnchorElement&&(p["[Amplitude] Element Href"]=t.href),rc(p)};return{name:l,type:"enrichment",setup:function(e,n){return F(void 0,void 0,void 0,function(){var i,o,s,a,u;return M(this,function(d){return n?(f=e.loggerProvider,"undefined"==typeof document||(i=function(e){v("click",e)&&p(e,"click",function(t){((null==t?void 0:t.target)==(null==t?void 0:t.currentTarget)||rf(null==t?void 0:t.target,r)==(null==t?void 0:t.currentTarget))&&(null==n||n.track("[Amplitude] Element Clicked",g("click",e)))}),v("change",e)&&p(e,"change",function(t){((null==t?void 0:t.target)==(null==t?void 0:t.currentTarget)||rf(null==t?void 0:t.target,r)==(null==t?void 0:t.currentTarget))&&(null==n||n.track("[Amplitude] Element Changed",g("change",e)))})},"undefined"!=typeof MutationObserver&&(t=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&rd(e,r).map(i)})})})),o=function(){rd(document.body,r).forEach(i),null==t||t.observe(document.body,{subtree:!0,childList:!0})},document.body?o():window.addEventListener("load",o),null===(a=null==e?void 0:e.loggerProvider)||void 0===a||a.log("".concat(l," has been successfully added.")),window.opener&&c.enabled&&(null===(u=c.messenger)||void 0===u||u.setup(j(j({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:n1[e.serverZone]}),{isElementSelectable:v})))),[2]):(null===(s=null==e?void 0:e.loggerProvider)||void 0===s||s.warn("".concat(l," plugin requires a later version of @amplitude/analytics-browser. Events are not tracked.")),[2])})})},execute:function(e){return F(void 0,void 0,void 0,function(){return M(this,function(t){return[2,e]})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(e){return t&&t.disconnect(),h(),[2]})})}}},rm=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0},ry=$([],B(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),rb=function(e){var t,n=rm();if(!(null===(t=null==n?void 0:n.crypto)||void 0===t?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,rb);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,$([],B(r.entries()),!1).map(function(e){var t=B(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(ry[r]):ry[r]}).join("")};function rw(e,t,n){e&&function e(t){var n,r,i=t.json,o=t.targetObject,s=t.allowlist,a=t.excludelist,u=t.ancestors,c=t.parentObject,l=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var f=q(d),p=f.next();!p.done;p=f.next()){var h,v=p.value,g=$($([],B(u),!1),[v],!1);(h=o[v],"string"==typeof h||"number"==typeof h||"boolean"==typeof h||null==h)?(!rE(g,s)||rE(g,a))&&delete o[v]:e({json:i,targetObject:o[v],allowlist:s,excludelist:a,ancestors:g,parentObject:o,targetKey:v})}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}0===Object.keys(o).length&&c&&l&&delete c[l]}({json:e,allowlist:t.map(rS),excludelist:n.map(rS),ancestors:[]})}function rS(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function rE(e,t){return t.some(function(t){return function e(t,n,r,i){if(void 0===r&&(r=0),void 0===i&&(i=0),i===n.length)return r===t.length;if(r===t.length){for(;i<n.length&&"**"===n[i];)i++;return i===n.length}var o=n[i];if("**"===o){if(i+1===n.length)return!0;for(var s=r;s<=t.length;s++)if(e(t,n,s,i+1))return!0;return!1}return("*"===o||o===t[r])&&e(t,n,r+1,i+1)}(e,t)})}var rT=["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"],rI=["authorization","cookie","set-cookie"],rk=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,n,r=this.request.headers,i={};if(Array.isArray(r))r.forEach(function(e){var t=B(e,2),n=t[0],r=t[1];i[n]=r});else if(r instanceof Headers)r.forEach(function(e,t){i[t]=e});else if("object"==typeof r&&null!==r)try{for(var o=q(Object.entries(r)),s=o.next();!s.done;s=o.next()){var a=B(s.value,2),u=a[0],c=a[1];i[u]=c}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return rx(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=rm();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=rP(t,100),this._bodySize}}
1,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"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),F(this,void 0,void 0,function(){return M(this,function(n){return 0===e.length?[2,null]:[2,rC(this.body,e,t)]})})},e}(),r_=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),rx(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return rP(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),F(this,void 0,void 0,function(){return M(this,function(n){return 0===e.length?[2,null]:[2,rC(this.body,e,t)]})})},e}();function rP(e,t){var n,r,i,o,s=rm(),a=null==s?void 0:s.TextEncoder;if(a){if("string"==typeof e)o=e,i=new a().encode(o).length;else if(e instanceof Blob)i=(o=e).size;else if(e instanceof URLSearchParams)o=e,i=new a().encode(o.toString()).length;else if(ArrayBuffer.isView(e))i=(o=e).byteLength;else if(e instanceof ArrayBuffer)i=(o=e).byteLength;else if(e instanceof FormData){var u=0,c=0;try{for(var l=q(e.entries()),d=l.next();!d.done;d=l.next()){var f=B(d.value,2),p=f[0],h=f[1];if(u+=p.length,"string"==typeof h)u+=new a().encode(h).length;else{if(!(h instanceof Blob))return;u+=h.size}if(++c>=t)return}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}i=u}else if(e instanceof ReadableStream){o=e;return}return i}}var rO=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null===(t=null==n?void 0:n.forEach)||void 0===t||t.call(n,function(e,t){r[t]=e}),rx(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,n=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return F(this,void 0,void 0,function(){return M(this,function(e){switch(e.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this.clonedResponse.text(),new Promise(function(e){return setTimeout(function(){return e(null)},500)})])];case 2:return[2,e.sent()];case 3:return e.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),F(this,void 0,void 0,function(){return M(this,function(n){switch(n.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,rC(n.sent(),e,t)]}})})},e}(),rR=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}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(e){if(void 0===e&&(e=[]),!this.headersString)return{};var t,n,r={},i=this.headersString.split("\r\n");try{for(var o=q(i),s=o.next();!s.done;s=o.next()){var a=s.value,u=B(a.split(": "),2),c=u[0],l=u[1];c&&l&&(r[c]=l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return rx(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),F(this,void 0,void 0,function(){var n;return M(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?(rw(n,e,t),[2,n]):[2,null]})})},e}();
1function rC(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return rw(r,t,n),r}catch(e){return null}}(f=P||(P={})).REDACT="redact",f.REMOVE="remove";var rA="[REDACTED]",rx=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?P.REMOVE:s,u=$([],B(rI),!1),c={};try{for(var l=q(Object.keys(e)),d=l.next();!d.done;d=l.next()){var f=d.value;!function(t){var n=t.toLowerCase();u.find(function(e){return e.toLowerCase()===n})?a===P.REDACT&&(c[t]=rA):o.find(function(e){return e.toLowerCase()===n})?c[t]=e[t]:a===P.REDACT&&(c[t]=rA)}(f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return c},rN=function(){function e(e,t,n,r,i,o,s,a,u,c,l){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=u,this.error=c,this.endTime=l}return e.prototype.toSerializable=function(){var e,t,n,r;return Object.fromEntries(Object.entries({type:this.type,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:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers($([],B(rT),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(n=this.responseWrapper)||void 0===n?void 0:n.headers($([],B(rT),!1)),responseBodySize:null===(r=this.responseWrapper)||void 0===r?void 0:r.bodySize}).filter(function(e){var t=B(e,2);return void 0!==(t[0],t[1])}))},e}(),rD=function(e,t){void 0===t&&(t=rb()),this.callback=e,this.id=t};function rL(e){try{e()}catch(e){}}var rj=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=rm();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=rm();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,u,c,l,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.XMLHttpRequest)||void 0===r?void 0:r.prototype)||void 0===i?void 0:i.open,p=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send,h=null===(l=null===(c=null===(u=this.globalScope)||void 0===u?void 0:u.XMLHttpRequest)||void 0===c?void 0:c.prototype)||void 0===l?void 0:l.setRequestHeader;f&&p&&h&&this.observeXhr(f,p,h);var v=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;v&&this.observeFetch(v),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(n){try{n.callback(e)}catch(e){rL(function(){var n;null===(n=t.logger)||void 0===n||n.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){if(void 0!==o&&void 0!==s){var a,u,c,l,d="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(u=t.url,d=t.method):u=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t),u)try{var f=new URL(u);u="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}d=(null==n?void 0:n.method)||d,r&&(c=r.status),i&&(l={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},c=0);var p=Math.floor(performance.now()-s),h=new rN(e,d,o,o,u,n,c,p,r,l,Math.floor(o+p));this.triggerEventCallbacks(h)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null==performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return F(t,void 0,void 0,function(){var t,i,o,s=this;return M(this,function(a){switch(a.label){case 0:try{t=this.getTimestamps()}catch(e){rL(function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=a.sent(),[3,4];case 3:return o=a.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new rk(r):void 0,i?new rO(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){rL(function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)})}if(i)return[2,i];throw o}})})})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null===(n=t.globalScope)||void 0===n?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}
1catch(n){n instanceof Error&&"InvalidStateError"===n.name&&rL(function(){var n;return null===(n=t.logger)||void 0===n?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this,s=B(n,2),a=s[0],u=s[1];try{i.$$AmplitudeAnalyticsEvent=j({method:a,url:null===(e=null==u?void 0:u.toString)||void 0===e?void 0:e.call(u),headers:{}},o.getTimestamps())}catch(e){rL(function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return t.apply(i,n)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,s=e.createXhrJsonParser(this,o),a=t[0],u=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new rR(i.status,e,t?parseInt(t,10):void 0,s),r=i.$$AmplitudeAnalyticsEvent.headers,c=new r_(a,r);u.status=i.status,o.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},c,n,void 0,u.startTime,u.durationStart)}catch(e){rL(function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),n.apply(i,t)},i.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(e){rL(function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}r.apply(this,[e,t])}}},e}()),rU="[Amplitude] Network Request",rF=n(49329),rM=n.n(rF),rq="500-599";function rB(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function r$(e,t){var n,r,i=t.split(",");try{for(var o=q(i),s=o.next();!s.done;s=o.next()){var a=s.value,u=B(a.split("-").map(Number),2),c=u[0],l=u[1];if(e===c&&void 0===l||e>=c&&e<=l)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function rV(e){var t;if(e)try{var n=null===(t=rm())||void 0===t?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),s=r.href,a=r.host;r.hash="",r.search="";var u=r.href;return{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:u,host:a}}catch(e){return}}function rH(e){return"object"!=typeof e||null===e?e?$([],B(rT),!1):void 0:0!==e.length?e:void 0}function rz(e){var t,n;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(n=null==e?void 0:e.blocklist)||void 0===n?void 0:n.length)}(O||(O={})).NetworkObservable="networkObservable";var rW=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new(rM())(function(e){var n=new rD(function(t){var n={event:t,timestamp:Date.now(),type:"network"};e.next(n)});return rj.subscribe(n,t),function(){rj.unsubscribe(n)}});return(e={})[O.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,o){return F(void 0,void 0,void 0,function(){return M(this,function(s){var a,u,c,l,d;return"undefined"==typeof document||(u=(a={allObservables:r(),networkTrackingOptions:e,amplitude:o,loggerProvider:t=null==i?void 0:i.loggerProvider}).allObservables,c=a.networkTrackingOptions,l=a.amplitude,d=a.loggerProvider,R=u.networkObservable.filter(function(e){return function(e,t){void 0===t&&(t={});var n,r,i=rV(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(rB(o,"*.amplitude.com")||rB(o,"amplitude.com"))||(null===(n=t.ignoreHosts)||void 0===n?void 0:n.find(function(e){return rB(o,e)}))||!t.captureRules&&void 0!==e.status&&!r$(e.status,rq)||t.captureRules&&($([],B(t.captureRules),!1).reverse().find(function(t){if(r=function(e,t,n,r,i){var o;if(!e.hosts||e.hosts.find(function(e){return rB(t,e)}))return r&&e.urls&&!(!(o=e.urls)||!o.length||o.some(function(e){return"string"==typeof e?r===e:r.match(e)}))||i&&e.methods&&!e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})?void 0:!n&&0!==n||!!r$(n,e.statusCodeRange||rq)}(t,o,e.status,e.url,e.method)){var n=rH(t.responseHeaders);if(e.responseWrapper&&n){var i=e.responseWrapper.headers(n);i&&(e.responseHeaders=i)}var s=rH(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!rz(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!rz(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==r}),!r)||e.requestWrapper&&function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find(function(e){return e.event_type===rU}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,c)}).subscribe(function(e){var t,n,r,i=e.event,o=rV(i.url);if(o){var s=null===(n=i.responseWrapper)||void 0===n?void 0:n.bodySize,a=null===(r=i.requestWrapper)||void 0===r?void 0:r.bodySize;(function(e,t,n,r){F(this,void 0,void 0,function(){var i,o,s;return M(this,function(a){switch(a.label){case 0:if(!(t.requestBodyJson||t.responseBodyJson))return[3,2];return[4,Promise.all([t.requestBodyJson,t.responseBodyJson])];case 1:if(o=(i=B.apply(void 0,[a.sent(),2]))[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==r||r.debug("Failed to stringify response body")}a.label=2;case 2:return null==n||n.track(rU,e),[2]}})})})(((t={})["[Amplitude] URL"]=o.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=o.query,t["[Amplitude] URL Fragment"]=o.fragment,t["[Amplitude] Request Method"]=i.method,t["[Amplitude] Status Code"]=i.status,t["[Amplitude] Start Time"]=i.startTime,t["[Amplitude] Completion Time"]=i.endTime,t["[Amplitude] Duration"]=i.duration,t["[Amplitude] Request Body Size"]=a,t["[Amplitude] Response Body Size"]=s,t["[Amplitude] Request Type"]=i.type,t["[Amplitude] Request Headers"]=i.requestHeaders,t["[Amplitude] Response Headers"]=i.responseHeaders,t),i,l,d)}}),null==t||t.log("".concat(n," has been successfully added."))),[2]})})},execute:function(e){return F(void 0,void 0,void 0,function(){return M(this,function(t){return[2,e]})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(e){return R.unsubscribe(),[2]})})}}},rK=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0},rJ=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n};let rG=-1,rY=e=>{addEventListener("pageshow",t=>{t.persisted&&(rG=t.timeStamp,e(t))},!0)},rQ=(e,t,n,r)=>{let i,o;return s=>{var a;t.value>=0&&(s||r)&&((o=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=(a=t.value)>n[1]?"poor":a>n[0]?"needs-improvement":"good",e(t))}},rZ=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},rX=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},r0=()=>{let e=rX();return e?.activationStart??0},r1=(e,t=-1)=>{let n=rX(),r="navigate";return rG>=0?r="back-forward-cache":n&&(document.prerendering||r0()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},r2=new WeakMap;function r3(e,t){return r2.get(e)||r2.set(e,new t),r2.get(e)}class r4{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}let r5=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},r6=e=>{let t=!1;return()=>{t||(e(),t=!0)}},r9=-1,r8=new Set,r7=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ie=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of r8)e();isFinite(r9)||(r9="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",ie,!0))}},it=()=>{if(r9<0){let e=r0(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;r9=t??r7(),addEventListener("visibilitychange",ie,!0),addEventListener("prerenderingchange",ie,!0),rY(()=>{setTimeout(()=>{r9=r7()})})}return{get firstHiddenTime(){return r9},onHidden(e){r8.add(e)}}},ir=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},ii=[1800,3e3],io=(e,t={})=>{ir(()=>{let n=it(),r,i=r1("FCP"),o=r5("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-r0(),0),i.entries.push(t),r(!0)))});o&&(r=rQ(e,i,ii,t.reportAllChanges),rY(n=>{r=rQ(e,i=r1("FCP"),ii,t.reportAllChanges),rZ(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},is=[.1,.25],ia=(e,t={})=>{let n=it();io(r6(()=>{let r,i=r1("CLS",0),o=r3(t,r4),s=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=r5("layout-shift",s);a&&(r=rQ(e,i,is,t.reportAllChanges),n.onHidden(()=>{s(a.takeRecords()),r(!0)}),rY(()=>{o.i=0,r=rQ(e,i=r1("CLS",0),is,t.reportAllChanges),rZ(()=>r())}),setTimeout(r))}))},iu=0,ic=1/0,il=0,id=e=>{for(let t of e)t.interactionId&&(ic=Math.min(ic,t.interactionId),iu=(il=Math.max(il,t.interactionId))?(il-ic)/7+1:0)},ip=()=>r?iu:performance.interactionCount??0,ih=()=>{"interactionCount"in performance||r||(r=r5("event",id,{type:"event",buffered:!0,durationThreshold:0}))},iv=0;class ig{u=[];l=new Map;m;p;v(){iv=ip(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((ip()-iv)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.u.at(-1),n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((e,t)=>
1t.P-e.P),this.u.length>10){let e=this.u.splice(10);for(let t of e)this.l.delete(t.id)}this.p?.(n)}}}let im=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=r6(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},iy=[200,500],ib=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let n=it();ir(()=>{ih();let r,i=r1("INP"),o=r3(t,ig),s=e=>{im(()=>{for(let t of e)o.h(t);let t=o.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,r())})},a=r5("event",s,{durationThreshold:t.durationThreshold??40});r=rQ(e,i,iy,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),r(!0)}),rY(()=>{o.v(),r=rQ(e,i=r1("INP"),iy,t.reportAllChanges)}))})};class iw{m;h(e){this.m?.(e)}}let iS=[2500,4e3],iE=(e,t={})=>{ir(()=>{let n=it(),r,i=r1("LCP"),o=r3(t,iw),s=e=>{for(let s of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(s),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-r0(),0),i.entries=[s],r())},a=r5("largest-contentful-paint",s);if(a){r=rQ(e,i,iS,t.reportAllChanges);let n=r6(()=>{s(a.takeRecords()),a.disconnect(),r(!0)}),o=e=>{e.isTrusted&&(im(n),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});rY(n=>{r=rQ(e,i=r1("LCP"),iS,t.reportAllChanges),rZ(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})},iT=[800,1800],iI=e=>{document.prerendering?ir(()=>iI(e)):"complete"!==document.readyState?addEventListener("load",()=>iI(e),!0):setTimeout(e)},ik=(e,t={})=>{let n=r1("TTFB"),r=rQ(e,n,iT,t.reportAllChanges);iI(()=>{let i=rX();i&&(n.value=Math.max(i.responseStart-r0(),0),n.entries=[i],r(!0),rY(()=>{(r=rQ(e,n=r1("TTFB",0),iT,t.reportAllChanges))(!0)}))})};function i_(e){var t,n;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((n=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0,performance.timeOrigin+n)),navigationStart:Math.floor(performance.timeOrigin)}}var iP=function(){var e=null,t=rK(),n=null==t?void 0:t.document,r=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return F(void 0,void 0,void 0,function(){var o,s;return M(this,function(a){return void 0===n||(o=rJ((null==r?void 0:r.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==r?void 0:r.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":rJ((null==r?void 0:r.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":rJ(o.split("?")[0],t.loggerProvider)},iE(function(e){s["[Amplitude] LCP"]=i_(e)}),io(function(e){s["[Amplitude] FCP"]=i_(e)}),ib(function(e){s["[Amplitude] INP"]=i_(e)}),ia(function(e){s["[Amplitude] CLS"]=i_(e)}),ik(function(e){s["[Amplitude] TTFB"]=i_(e)}),e=function(){"hidden"===n.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return F(void 0,void 0,void 0,function(){return M(this,function(t){return[2,e]})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]})})}}},iO=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},iR=function(){function e(){}return e.prototype.parse=function(){return F(this,void 0,void 0,function(){return M(this,function(e){return[2,j(j(j(j({},eq),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=eh();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=eh();return(e={})[eR]=t[eR],e[eC]=t[eC],e[eA]=t[eA],e[ex]=t[ex],e[eN]=t[eN],e[eD]=t[eD],e[eL]=t[eL],e[ej]=t[ej],e[eU]=t[eU],e[eF]=t[eF],e[eM]=t[eM],e},e}(),iC=function(){function e(e,t){var n;this.shouldTrackNewCampaign=!1,this.options=j({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:ns((null===(n=t.cookieOptions)||void 0===n?void 0:n.domain)||t.topLevelDomain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=iO(t.apiKey,"MKTG"),this.webExpStorageKey=iO(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=eq,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,this.topLevelDomain=t.topLevelDomain,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return F(this,void 0,void 0,function(){var e,t;return M(this,function(n){switch(n.label){case 0:if(this.options.optOut)return[2];return[4,this.fetchCampaign()];case 1:if(t=B.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||tn(this.sessionTimeout,this.lastEventTime),!nr(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return F(this,void 0,void 0,function(){var e;return M(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:if(!(e=t.sent()))return[3,3];return[4,this.storage.remove(this.webExpStorageKey)];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||new iR().parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r=(t=this.currentCampaign,n=this.options,e8(Object.entries(j(j({},eq),t)).reduce(function(e,t){var r,i=B(t,2),o=i[0],s=i[1];return(e.setOnce("initial_".concat(o),null!==(r=null!=s?s:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),s)?e.set(o,s):e.unset(o)},new e6)));return e&&(r.event_id=e),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),iA=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},ix=new Set([S.IDENTIFY,S.GROUP_IDENTIFY]),iN=function(e){void 0===e&&(e={});var t,n,r,i,o,s,a,u=null!==(t=e.fallbackAttributionEvent)&&void 0!==t&&t,c=Z(),l={},d=!1,f=!1,p=function(){return F(void 0,void 0,void 0,function(){return M(this,function(e){switch(e.label){case 0:return[4,new iR().parse()];case 1:return l=iA(e.sent()),u&&(null==r||r.log("Tracking attribution fallback event."),null==n||n.track("[Amplitude] Attribution",l)),[2]}})})},h=function(){p()},v=function(e){return new Proxy(e,{apply:function(e,t,n){Reflect.apply(e,t,n),d&&h()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return F(void 0,void 0,void 0,function(){return M(this,function(u){switch(u.label){case 0:return n=t,r=e.loggerProvider,d=!0,r.log("Installing event property attribution tracking."),[4,p()];case 1:if(u.sent(),!c)return[2];if(c.addEventListener("popstate",h),!f){if(i=Reflect.get(c.history,"pushState"),o=Reflect.get(c.history,"replaceState"),!i||!o)return[2];s=v(i),c.history.pushState=s,a=v(o),c.history.replaceState=a,f=!0}return[2]}})})},execute:function(e){return F(void 0,void 0,void 0,function(){return M(this,function(t){return ix.has(e.event_type)||(e.event_properties=j(j({},l),e.event_properties)),[2,e]})})},teardown:function(){return F(void 0,void 0,void 0,function(){var e,t;return M(this,function(n){return c&&(c.removeEventListener("popstate",h),e=Reflect.get(c.history,"pushState"),t=Reflect.get(c.history,"replaceState"),f&&e===s&&i&&(c.history.pushState=i),f&&t===a&&o&&(c.history.replaceState=o)),d=!1,f=!1,i=void 0,o=void 0,s=void 0,a=void 0,l={},[2]})})}}};(p=C||(C={})).SET="$set",p.SET_ONCE="$setOnce",p.ADD="$add",p.APPEND="$append",p.PREPEND="$prepend",p.REMOVE="$remove",p.PREINSERT="$preInsert",p.POSTINSERT="$postInsert",p.UNSET="$unset",p.CLEAR_ALL="$clearAll",(h=A||(A={})).IDENTIFY="$identify",h.GROUP_IDENTIFY="$groupidentify",h.REVENUE="revenue_amount";var iD=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0},iL=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},ij=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return F(this,void 0,void 0,function(){var t,n,r;return M(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return F(this,void 0,void 0,function(){var t;return M(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return F(this,void 0,void 0,function(){return M(this,function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return F(this,void 0,void 0,function(){return M(this,function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return F(this,void 0,void 0,function(){return M(this,function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return F(this,void 0,void 0,function(){return M(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]})})},e}(),iU="*****",iF=/\b(?:\d[ -]*?){13,16}\b/,iM=/(\d{3}-?\d{2}-?\d{4})/g,iq=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,iB=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var n,r,i=e;i=(i=(i=i.replace(iF,iU)).replace(iM,iU)).replace(iq,iU);try{for(var o=q(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,iU)}catch(e){}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},i$=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");
1return t&&t.hasAttribute("data-amp-mask")?iU:e?e(document.title):document.title},iV="AMP_CURRENT_PAGE",iH="AMP_PREVIOUS_PAGE",iz="AMP_URL_INFO";(v=x||(x={})).Direct="direct",v.Internal="internal",v.External="external";var iW=new Set([A.IDENTIFY,A.GROUP_IDENTIFY,A.REVENUE]),iK=function(e){var t=(void 0===e?{}:e).internalDomains,n=void 0===t?[]:t,r=iD(),i=void 0,o=!1,s=void 0,a=!1,u=!1,c=function(e){var t;try{var n=iL(e,s);t=new URL(n).hostname}catch(e){null==s||s.error("Could not parse URL: ",e)}return t},l=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?c(e):void 0;if(!r)return x.Direct;var i=n.some(function(e){return -1!==t.indexOf(e)}),o=n.some(function(e){return -1!==r.indexOf(e)});return t===r||o&&i?x.Internal:x.External},d=function(){F(void 0,void 0,void 0,function(){var e,t,n,r,s;return M(this,function(a){switch(a.label){case 0:if(!(i&&o))return[3,3];return[4,i.get(iz)];case 1:return e=a.sent(),t=iL("undefined"!=typeof location&&location.href||""),n=(null==e?void 0:e[iV])||"",r=void 0,r=t===n?(null==e?void 0:e[iH])||"":n||document.referrer||"",[4,i.set(iz,((s={})[iV]=t,s[iH]=r,s))];case 2:a.sent(),a.label=3;case 3:return[2]}})})};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return F(void 0,void 0,void 0,function(){return M(this,function(t){switch(t.label){case 0:if((s=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!r)return[3,2];return[4,(i=new ij(r.sessionStorage)).isEnabled()];case 1:o=t.sent(),r.addEventListener("popstate",d),a||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=B(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),u&&d()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=B(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),u&&d()}}),a=!0),t.label=2;case 2:return[2]}})})},execute:function(e){return F(void 0,void 0,void 0,function(){var t,n,r,s,a;return M(this,function(u){switch(u.label){case 0:if(t=iL("undefined"!=typeof location&&location.href||""),!(i&&o))return[3,5];return[4,i.get(iz)];case 1:if(null==(n=u.sent())?void 0:n[iV])return[3,3];return[4,i.set(iz,((a={})[iV]=t,a[iH]=document.referrer||"",a))];case 2:u.sent(),u.label=3;case 3:return[4,i.get(iz)];case 4:if(r=u.sent(),s="",r&&(s=r[iH]||""),iW.has(e.event_type))return[2,e];e.event_properties=j(j({},e.event_properties||{}),{"[Amplitude] Page Domain":iJ(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":iJ(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":iJ(e,"[Amplitude] Page Path","undefined"!=typeof location&&iL(location.pathname)||""),"[Amplitude] Page Title":iJ(e,"[Amplitude] Page Title",i$(iB)),"[Amplitude] Page URL":iJ(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":s,"[Amplitude] Previous Page Type":l(s)}),u.label=5;case 5:return[2,e]}})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(e){switch(e.label){case 0:if(r&&(r.removeEventListener("popstate",d),u=!1),!(i&&o))return[3,2];return[4,i.set(iz,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function iJ(e,t,n){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?n:e.event_properties[t]}var iG=function(){var e,t,n;function r(t){if(t)try{var n=Function("return "+t)();if("function"==typeof n)return n;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(t){null==e||e.error("Could not create custom enrichment function",t)}return function(e){return e}}return{name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,o){return F(void 0,void 0,void 0,function(){var o,s;return M(this,function(a){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null===(s=i.remoteConfig)||void 0===s?void 0:s.fetchRemoteConfig)&&(i.remoteConfigClient?(o=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){n=e&&"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body?r(e.body||""):r("")}),t=function(){var e;return null===(e=i.remoteConfigClient)||void 0===e?void 0:e.unsubscribe(o)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return F(void 0,void 0,void 0,function(){var r;return M(this,function(i){if(n)try{return[2,null!==(r=n(t))&&void 0!==r?r:null]}catch(t){null==e||e.error("Could not execute custom enrichment function",t)}return[2,t]})})},teardown:function(){return F(void 0,void 0,void 0,function(){return M(this,function(e){return t&&t(),[2]})})}}},iY="userProperty",iQ="eventProperty",iZ=function(e){return e===iY||e===iQ},iX=[iY,iQ],i0=function(e){var t=$([],B(new Set((Array.isArray(e)?e:[e]).filter(iZ))),!1);return t.length>0?t:$([],B(iX),!1)},i1=function(e,t){return i0(e.trackingMethod).includes(t)},i2=function(e){return i1(e,iY)},i3=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return L(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>
12?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),J(this._init(j(j({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o,s,a,u,c;return F(this,void 0,void 0,function(){var l,d,f,p,h,v,g,y,b,w,S,E,T,I,k=this;return M(this,function(_){var P,O,R,C,A,x,D,L,V;switch(_.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,l=np(t),d=null!==(n=t.loggerProvider)&&void 0!==n?n:new Y,t.loggerProvider||d.enable(null!==(r=t.logLevel)&&void 0!==r?r:m.Warn),f=null!==(i=t.serverZone)&&void 0!==i?i:"US",h=this._diagnosticsSampleRate,v=null===(o=t.enableDiagnostics)||void 0===o||o,!l)return[3,2];return p=new en(t.apiKey,d,f,null===(s=t.remoteConfig)||void 0===s?void 0:s.serverUrl),[4,new Promise(function(e){null==p||p.subscribe("configs.diagnostics.browserSDK","all",function(t,n,r){if(d.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(h=i);var o=t.enabled;"boolean"==typeof o&&(v=o)}e()})})];case 1:_.sent(),_.label=2;case 2:return(g=new ep(t.apiKey,d,f,{enabled:v,sampleRate:h})).setTag("library","".concat(tR,"/").concat(tO)),g.setTag("platform","Web"),g.setTag("web_environment",function(){var e=Z();if(!e)return"unknown";var t=tT(e);return tI(e)?t?"chrome_extension_service_worker":"service_worker":tk(e)?"web_worker":void 0!==e.document?t?"chrome_extension":"browser":t_(e)?"node":"unknown"}()),"undefined"!=typeof navigator&&g.setTag("user_agent",navigator.userAgent),[4,(P=t.apiKey,O=t,R=this,C=g,A={loggerProvider:d,serverZone:f,enableDiagnostics:v,diagnosticsSampleRate:h},void 0===O&&(O={}),F(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u,c,l,d,f,p,h,v,g,m,y,b,w,S,E,T,I,k,_,x,N,D,L,U,q,$,V,H,z,W,K,J,G,Y,Q,Z,X,et,en,er,ei,eo,es;return M(this,function(ea){var eu,ec,el;switch(ea.label){case 0:if(e=O.identityStorage||ne,t="",!(e===ne&&!(null===(S=O.cookieOptions)||void 0===S?void 0:S.domain)&&(null===(E=O.cookieOptions)||void 0===E?void 0:E.domain)!==""))return[3,2];return[4,(eu=void 0,F(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s;return M(this,function(a){switch(a.label){case 0:return[4,new tN(void 0,{diagnosticsClient:C}).isEnabled()];case 1:if(!a.sent()||!eu&&("undefined"==typeof location||!location.hostname)||1===(t=(e=null!=eu?eu:location.hostname).split(".")).length)return[2,""];for(n=[],r=1,nu.find(function(t){return e.endsWith(".".concat(t))})&&(r=2),i=t.length-r-1;i>=0;--i)n.push(t.slice(i).join("."));i=0,a.label=2;case 2:if(!(i<n.length))return[3,7];o=n[i],a.label=3;case 3:return a.trys.push([3,5,,6]),[4,tN.isDomainWritable(o)];case 4:if(a.sent())return[2,"."+o];return[3,6];case 5:return s=a.sent(),C&&C.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(o),error:s instanceof Error?s.message:String(s)}),[3,6];case 6:return i++,[3,2];case 7:return C&&C.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(e)}),[2,""]}})}))];case 1:t=ea.sent(),ea.label=2;case 2:return n=j({domain:null!==(I=null===(T=O.cookieOptions)||void 0===T?void 0:T.domain)&&void 0!==I?I:t,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},O.cookieOptions),r={duplicateResolverFn:function(e){var t=tj(e);return!!t&&tU(JSON.parse(t).cookieDomain,n.domain)},diagnosticsClient:C},[4,(ec=i=nf(O.identityStorage,n,r),void 0===(el=null===(_=null===(k=O.cookieOptions)||void 0===k?void 0:k.upgrade)||void 0===_||_)&&(el=!0),F(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u;return M(this,function(c){switch(c.label){case 0:return e="".concat("amp","_").concat(P.substring(0,6)),[4,ec.getRaw(e)];case 1:if(!(t=c.sent()))return[2,{optOut:!1}];if(!el)return[3,3];return[4,ec.remove(e)];case 2:c.sent(),c.label=3;case 3:return r=(n=B(t.split("."),6))[0],i=n[1],o=n[2],s=n[3],a=n[4],u=n[5],[2,{deviceId:r,userId:tG(i),sessionId:tJ(s),lastEventId:tJ(u),lastEventTime:tJ(a),optOut:Boolean(o)}]}})}))];case 3:return o=ea.sent(),[4,i.get(tF(P))];case 4:return s=ea.sent(),c=!(u=(a=eh()).ampTimestamp?Number(a.ampTimestamp):void 0)||Date.now()<u,l=null!==(U=null!==(L=null!==(D=null!==(x=O.deviceId)&&void 0!==x?x:c?null!==(N=a.ampDeviceId)&&void 0!==N?N:a.deviceId:void 0)&&void 0!==D?D:null==s?void 0:s.deviceId)&&void 0!==L?L:o.deviceId)&&void 0!==U?U:ee(),d=null!==(q=null==s?void 0:s.lastEventId)&&void 0!==q?q:o.lastEventId,f=null!==($=null==s?void 0:s.lastEventTime)&&void 0!==$?$:o.lastEventTime,p=null!==(H=null!==(V=O.optOut)&&void 0!==V?V:null==s?void 0:s.optOut)&&void 0!==H?H:o.optOut,h=null!==(z=null==s?void 0:s.sessionId)&&void 0!==z?z:
1o.sessionId,v=null==s?void 0:s.deferredSessionId,g=null!==(K=null!==(W=O.userId)&&void 0!==W?W:null==s?void 0:s.userId)&&void 0!==K?K:o.userId,R.previousSessionDeviceId=null!==(J=null==s?void 0:s.deviceId)&&void 0!==J?J:o.deviceId,R.previousSessionUserId=null!==(G=null==s?void 0:s.userId)&&void 0!==G?G:o.userId,m={ipAddress:null===(Q=null===(Y=O.trackingOptions)||void 0===Y?void 0:Y.ipAddress)||void 0===Q||Q,language:null===(X=null===(Z=O.trackingOptions)||void 0===Z?void 0:Z.language)||void 0===X||X,platform:null===(en=null===(et=O.trackingOptions)||void 0===et?void 0:et.platform)||void 0===en||en},y=null==s?void 0:s.pageCounter,b=null==s?void 0:s.debugLogsEnabled,void 0!==O.autocapture&&(O.defaultTracking=O.autocapture),[4,(w=new nd(P,O.appVersion,i,n,O.defaultTracking,O.autocapture,l,O.flushIntervalMillis,O.flushMaxRetries,O.flushQueueSize,e,O.ingestionMetadata,O.instanceName,d,f,null!==(er=null==A?void 0:A.loggerProvider)&&void 0!==er?er:O.loggerProvider,O.logLevel,O.minIdLength,O.offline,p,O.partnerId,O.plan,O.serverUrl,null!==(ei=null==A?void 0:A.serverZone)&&void 0!==ei?ei:O.serverZone,h,v,O.sessionTimeout,O.storageProvider,m,O.transport,O.useBatch,O.fetchRemoteConfig,g,y,b,O.networkTrackingOptions,O.identify,null!==(eo=null==A?void 0:A.enableDiagnostics)&&void 0!==eo?eo:O.enableDiagnostics,null!==(es=null==A?void 0:A.diagnosticsSampleRate)&&void 0!==es?es:R._diagnosticsSampleRate,C,O.remoteConfig,t,O.enableRequestBodyCompression,O.customEnrichment)).storageProvider.isEnabled()];case 5:return ea.sent()||(w.loggerProvider.warn("Storage provider ".concat(w.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),w.storageProvider=new tA),[2,w]}})}))];case 3:if(y=_.sent(),!(l&&p))return[3,5];return[4,new Promise(function(e){null==p||p.subscribe("configs.analyticsSDK.browserSDK","all",function(t,n,r){y.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&function(e,t){var n,r;if(e){!function e(t){if(!("object"!=typeof t||null===t||Array.isArray(t))){var n,r,i,o,s,a,u,c,l,d,f,p,h=Object.keys(t);try{for(var v=q(h),g=v.next();!g.done;g=v.next()){var m=g.value;try{var y=t[m];"boolean"==typeof(null==y?void 0:y.enabled)&&(y.enabled?(delete y.enabled,0===Object.keys(y).length&&(t[m]=!0)):t[m]=!1),e(y)}catch(e){}}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}try{if(null===(l=null===(c=null===(u=t.autocapture)||void 0===u?void 0:u.networkTracking)||void 0===c?void 0:c.captureRules)||void 0===l?void 0:l.length)try{for(var b=q(t.autocapture.networkTracking.captureRules),w=b.next();!w.done;w=b.next()){var S=w.value;try{for(var E=(s=void 0,q(["responseHeaders","requestHeaders"])),T=E.next();!T.done;T=E.next()){var I=T.value,k=null!==(d=S[I])&&void 0!==d?d:{},_=k.captureSafeHeaders,P=k.allowlist;if(_||P){if(void 0!==P&&!Array.isArray(P)){delete S[I];continue}S[I]=$($([],B(_?eB:[]),!1),B(null!=P?P:[]),!1)}}}catch(e){s={error:e}}finally{try{T&&!T.done&&(a=E.return)&&a.call(E)}finally{if(s)throw s.error}}}}catch(e){i={error:e}}
1finally{try{w&&!w.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}catch(e){}var O=null===(f=t.autocapture)||void 0===f?void 0:f.frustrationInteractions;O&&(O.rageClick&&(O.rageClicks=O.rageClick,delete O.rageClick),O.deadClick&&(O.deadClicks=O.deadClick,delete O.deadClick));try{var R=null===(p=t.autocapture)||void 0===p?void 0:p.elementInteractions;if(R&&"object"==typeof R&&(!0===R.viewportContentUpdated&&(R.viewportContentUpdated={}),!1===R.viewportContentUpdated&&(R.viewportContentUpdated={enabled:!1}),void 0!==R.exposureDuration)){var C=R.viewportContentUpdated;void 0===C?R.viewportContentUpdated={exposureDuration:R.exposureDuration}:"object"==typeof C&&void 0===C.exposureDuration&&!1!==C.enabled&&(C.exposureDuration=R.exposureDuration),delete R.exposureDuration}}catch(e){}}}(e);try{if(t.loggerProvider.debug("Update browser config with remote configuration:",ti(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var i=j({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null===(n=e.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===n?void 0:n.length)){i.elementInteractions=j({},e.autocapture.elementInteractions);var o=i.elementInteractions,s=null!==(r=o.pageUrlAllowlist)&&void 0!==r?r:[],a=e.autocapture.elementInteractions.pageUrlAllowlistRegex;o.pageUrlAllowlist=nG(s,a,t.loggerProvider),delete o.pageUrlAllowlistRegex}var u=function(e,t){if("object"==typeof e&&null!==e&&(null===(i=e.captureRules)||void 0===i?void 0:i.length)){var n,r,i,o,s,a=j({},e),u=null!==(o=a.captureRules)&&void 0!==o?o:[];try{for(var c=q(u),l=c.next();!l.done;l=c.next()){var d=l.value;d.urls=nG(null!==(s=d.urls)&&void 0!==s?s:[],d.urlsRegex,t),delete d.urlsRegex}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return a}}(e.autocapture.networkTracking,t.loggerProvider);u&&(i.networkTracking=u),"boolean"==typeof t.autocapture&&(t.autocapture=j({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},i)),"object"==typeof t.autocapture&&(t.autocapture=j(j({},t.autocapture),i))}t.defaultTracking=t.autocapture}"customEnrichment"in e&&null!==e.customEnrichment&&!1!==t.customEnrichment&&(t.customEnrichment=e.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",ti(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,y),e()})})];case 4:_.sent(),_.label=5;case 5:return[4,e.prototype._init.call(this,y)];case 6:if(_.sent(),this.logBrowserOptions(y),this.config.remoteConfigClient=p,b=tu((x=this.config).defaultTracking)&&x.defaultTracking&&"object"==typeof x.defaultTracking&&x.defaultTracking.attribution&&"object"==typeof x.defaultTracking.attribution?j({},x.defaultTracking.attribution):{},!(tu(this.config.defaultTracking)&&i2(b)))return[3,8];return this.config.optOut&&this.timeline.addOptOutListener(function(e){return F(k,void 0,void 0,function(){return M(this,function(t){switch(t.label){case 0:if(e)return[3,2];return this.webAttribution=new iC(b,this.config),[4,this.webAttribution.init()];case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new iC(b,this.config),[4,this.webAttribution.init()];case 7:_.sent(),_.label=8;case 8:if(E=!(!(S=(w=eh()).ampTimestamp?Number(w.ampTimestamp):void 0)||Date.now()<S)||Number.isNaN(Number(w.ampSessionId))?void 0:Number(w.ampSessionId),-1!==(T=this.config.deferredSessionId)||this.config.optOut||(T=Date.now()),this.setSessionId(null!==(c=null!==(u=null!==(a=t.sessionId)&&void 0!==a?a:E)&&void 0!==u?u:T)&&void 0!==c?c:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return F(k,void 0,void 0,function(){return M(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(I=eV(this.config.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),!(null!==this.config.offline))return[3,10];return[4,this.add(nJ()).promise];case 9:_.sent(),_.label=10;case 10:return[4,this.add(new e2({diagnosticsClient:g})).promise];case 11:return _.sent(),[4,this.add(new tC).promise];case 12:return _.sent(),[4,this.add(new e3).promise];case 13:if(_.sent(),nK(this.config),!ta(this.config.defaultTracking,"fileDownloads"))return[3,15];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(nz()).promise];case 14:_.sent(),_.label=15;case 15:if(!tc(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(n$()).promise];case 16:_.sent(),_.label=17;case 17:if(!tl(this.config.defaultTracking))return[3,20];if(this.config.optOut)return[3,19];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(nF(tb(this.config))).promise];case 18:return _.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return F(k,void 0,void 0,function(){return M(this,function(t){switch(t.label){case 0:if(e)return[2];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(nF(tb(this.config))).promise];case 1:return t.sent(),[2]}})})}),_.label=20;case 20:if(!(tu(this.config.defaultTracking)&&i1(b,iQ)))return[3,22];return this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(iN(b)).promise];case 21:_.sent(),_.label=22;case 22:if(!tp(this.config.autocapture))return[3,24];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(rg(tg(this.config),{diagnosticsClient:g})).promise];case 23:_.sent(),_.label=24;case 24:if(!th(this.config.autocapture))return[3,26];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add((0,N.frustrationPlugin)(tm(this.config))).promise];case 25:_.sent(),_.label=26;case 26:if(!tf(this.config.autocapture))return[3,28];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(rW(ty(this.config))).promise];case 27:_.sent(),_.label=28;case 28:if(!("boolean"==typeof(D=this.config.autocapture)?D:"object"==typeof D&&!0===D.webVitals))return[3,30];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(iP()).promise];case 29:_.sent(),_.label=30;case 30:if(!("object"==typeof(L=this.config.autocapture)&&(!0===L.performanceTracking||"object"==typeof L.performanceTracking)))return[3,32];return this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add((0,N.performancePlugin)(tv(this.config))).promise];case 31:_.sent(),_.label=32;case 32:if(!ta(this.config.autocapture,"pageUrlEnrichment"))return[3,34];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(iK()).promise];case 33:_.sent(),_.label=34;case 34:if(!("boolean"==typeof(V=this.config.customEnrichment)?V:"object"==typeof V&&null!==V&&!1!==V.enabled))return[3,36];return this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(iG()).promise];case 35:_.sent(),_.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return _.sent(),I.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{}
1,n=t.time,r=U(t,["time"]);k.track(e.eventType,r,"number"==typeof n?{time:n}:void 0)}),[2]}})})},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){if(!this.config){this.q.push(this.setUserId.bind(this,e));return}this.config.loggerProvider.debug("function setUserId: ",e),(e!==this.config.userId||void 0===e)&&(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),eH(e,this.config.instanceName))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){if(!this.config){this.q.push(this.setDeviceId.bind(this,e));return}this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),ez(e,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(ee()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var t,n,r,i=new e6,o=null!==(r=e.userProperties)&&void 0!==r?r:{};try{for(var s=q(Object.entries(o)),a=s.next();!a.done;a=s.next()){var u=B(a.value,2),c=u[0],l=u[1];i.set(c,l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),J(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,J(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return J(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,td(this.config.defaultTracking)&&(r&&i&&n.push(this.track(t1,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(e8(this.config.identify)).promise),td(this.config.defaultTracking)&&n.push(this.track(t0,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,J(Promise.all(n))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(e){if(!this.config){this.q.push(this.setTransport.bind(this,e));return}this.config.transportProvider=nh(e)},t.prototype.identify=function(t,n){if(tE(t)){var r=t._q;t._q=[],t=tS(new e6,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(tE(r)){var o=r._q;r._q=[],r=tS(new e6,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(tE(t)){var r=t._q;t._q=[],t=tS(new tt,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!i2(this.webAttribution.options))return!1;var n=this.webAttribution.generateCampaignEvent(e);
1return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return F(this,void 0,void 0,function(){var n,r,i;return M(this,function(o){return n=Date.now(),r=tn(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===t0||t.event_type===t1||t.session_id&&t.session_id!==this.getSessionId()||(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=j(j({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",ti(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){if(!(e>1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},t}(ts),i4={init:K((g=new i3).init.bind(g),"init",H(g),W(g,["config"])),add:K(g.add.bind(g),"add",H(g),W(g,["config.apiKey","timeline.plugins"])),remove:K(g.remove.bind(g),"remove",H(g),W(g,["config.apiKey","timeline.plugins"])),track:K(g.track.bind(g),"track",H(g),W(g,["config.apiKey","timeline.queue.length"])),logEvent:K(g.logEvent.bind(g),"logEvent",H(g),W(g,["config.apiKey","timeline.queue.length"])),identify:K(g.identify.bind(g),"identify",H(g),W(g,["config.apiKey","timeline.queue.length"])),groupIdentify:K(g.groupIdentify.bind(g),"groupIdentify",H(g),W(g,["config.apiKey","timeline.queue.length"])),setGroup:K(g.setGroup.bind(g),"setGroup",H(g),W(g,["config.apiKey","timeline.queue.length"])),revenue:K(g.revenue.bind(g),"revenue",H(g),W(g,["config.apiKey","timeline.queue.length"])),flush:K(g.flush.bind(g),"flush",H(g),W(g,["config.apiKey","timeline.queue.length"])),getUserId:K(g.getUserId.bind(g),"getUserId",H(g),W(g,["config","config.userId"])),setUserId:K(g.setUserId.bind(g),"setUserId",H(g),W(g,["config","config.userId"])),getDeviceId:K(g.getDeviceId.bind(g),"getDeviceId",H(g),W(g,["config","config.deviceId"])),setDeviceId:K(g.setDeviceId.bind(g),"setDeviceId",H(g),W(g,["config","config.deviceId"])),reset:K(g.reset.bind(g),"reset",H(g),W(g,["config","config.userId","config.deviceId"])),getSessionId:K(g.getSessionId.bind(g),"getSessionId",H(g),W(g,["config"])),setSessionId:K(g.setSessionId.bind(g),"setSessionId",H(g),W(g,["config"])),extendSession:K(g.extendSession.bind(g),"extendSession",H(g),W(g,["config"])),setOptOut:K(g.setOptOut.bind(g),"setOptOut",H(g),W(g,["config"])),setTransport:K(g.setTransport.bind(g),"setTransport",H(g),W(g,["config"])),getIdentity:K(g.getIdentity.bind(g),"getIdentity",H(g),W(g,["config"])),setIdentity:K(g.setIdentity.bind(g),"setIdentity",H(g),W(g,["config","config.userId","config.deviceId"])),getOptOut:K(g.getOptOut.bind(g),"getOptOut",H(g),W(g,["config"])),_setDiagnosticsSampleRate:K(g._setDiagnosticsSampleRate.bind(g),"_setDiagnosticsSampleRate",H(g),W(g,["config"]))};i4.add,i4.extendSession;var i5=i4.flush,i6=(i4.getDeviceId,i4.getIdentity,i4.getOptOut,i4.getSessionId,i4.getUserId,i4.groupIdentify,i4.identify,i4.init),i9=(i4.logEvent,i4.remove,i4.reset,i4.revenue,i4.setDeviceId,i4.setGroup,i4.setIdentity,i4.setOptOut,i4.setSessionId,i4.setTransport,i4.setUserId,i4.track);i4._setDiagnosticsSampleRate},95775:function(e){var t=Object.prototype.hasOwnProperty;function n(e){var n=[];return function e(r){if(null===r||"object"!=typeof r)return r;if(-1!==n.indexOf(r))return"[Circular]";if(n.push(r),"function"==typeof r.toJSON)try{var i=e(r.toJSON());return n.pop(),i}catch(e){return"[Throws: "+(e?e.message:"?")+"]"}if(Array.isArray(r)){var o=r.map(e);return n.pop(),o}var s=Object.keys(r).reduce(function(n,i){return n[i]=e((t.call(r,i),r[i])),n},{});return n.pop(),s}(e)}e.exports=function(e,t,r){return JSON.stringify(n(e),t,r)},e.exports.ensureProperties=n},49329:function(e,t,n){e.exports=n(60516).Observable},60516:function(e,t){"use strict";t.Observable=void 0;let n=e=>Boolean(Symbol[e]),r=e=>n(e)?Symbol[e]:"@@"+e,i=r("iterator"),o=r("observable"),s=r("species");function a(e,t){let n=e[t];if(null!=n){if("function"!=typeof n)throw TypeError(n+" is not a function");return n}}function u(e){let t=e.constructor;return void 0!==t&&null===(t=t[s])&&(t=void 0),void 0!==t?t:g}function c(e){c.log?c.log(e):setTimeout(()=>{throw e})}function l(e){Promise.resolve().then(()=>{try{e()}catch(e){c(e)}})}function d(e){let t=e._cleanup;if(void 0!==t){if(e._cleanup=void 0,!t)return;try{if("function"==typeof t)t();else{let e=a(t,"unsubscribe");e&&e.call(t)}}catch(e){c(e)}}}function f(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function p(e,t,n){e._state="running";let r=e._observer;try{let i=a(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(f(e),i)i.call(r,n);else throw n;break;case"complete":f(e),i&&i.call(r)}}catch(e){c(e)}"closed"===e._state?d(e):"running"===e._state&&(e._state="ready")}function h(e,t,n){if("closed"!==e._state){if("buffering"===e._state){e._queue.push({type:t,value:n});return}if("ready"!==e._state){e._state="buffering",e._queue=[{type:t,value:n}],l(()=>(function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let n=0;n<t.length&&(p(e,t[n].type,t[n].value),"closed"!==e._state);++n);}})(e));return}
1p(e,t,n)}}class v{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,r={get closed(){return"closed"===n._state},next(e){h(n,"next",e)},error(e){h(n,"error",e)},complete(){h(n,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(f(this),d(this))}}class g{constructor(e){if(!(this instanceof g))throw TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return("object"!=typeof e||null===e)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new v(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if("function"!=typeof e){n(TypeError(e+" is not a function"));return}function r(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,r)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t})})}map(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(n){try{n=e(n)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=u(this),n=arguments.length>1,r=!1,i=arguments[1],o=i;return new t(t=>this.subscribe({next(i){let s=!r;if(r=!0,!s||n)try{o=e(o,i)}catch(e){return t.error(e)}else o=i},error(e){t.error(e)},complete(){if(!r&&!n)return t.error(TypeError("Cannot reduce an empty sequence"));t.next(o),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=u(this);return new t(n=>{let r;let i=0;return!function o(s){r=s.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){i===e.length?(r=void 0,n.complete()):o(t.from(e[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=u(this);return new t(n=>{let r=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return n.error(e)}let s=t.from(i).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){let e=r.indexOf(s);e>=0&&r.splice(e,1),o()}});r.push(s)},error(e){n.error(e)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[o](){return this}static from(e){let t="function"==typeof this?this:g;if(null==e)throw TypeError(e+" is not an object");let r=a(e,o);if(r){let n=r.call(e);if(Object(n)!==n)throw TypeError(n+" is not an object");return n instanceof g&&n.constructor===t?n:new t(e=>n.subscribe(e))}if(n("iterator")&&(r=a(e,i)))return new t(t=>{l(()=>{if(!t.closed){for(let n of r.call(e))if(t.next(n),t.closed)return;t.complete()}})});if(Array.isArray(e))return new t(t=>{l(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})});throw TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:g)(t=>{l(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})})}static get[s](){return this}}t.Observable=g,Object.defineProperty(g,Symbol("extensions"),{value:{symbol:o,hostReportError:c},configurable:!0})}}]);

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.