PageSourceSearch

https://dash.blinq.me/_next/static/chunks/0.s~jwk-~cbcw.js?dpl=dpl_CQX1uE3rVuDtB9Pgg3wrEvNmn4rg

js blinq.me collected 2026-10-01 10:15:09 UTC 208,959 bytes, 3 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37611,(e,t,r)=>{var n=Object.prototype.hasOwnProperty;function i(e){return"[Throws: "+(e?e.message:"?")+"]"}function o(e){var t=[];return function e(r){if(null===r||"object"!=typeof r)return r;if(-1!==t.indexOf(r))return"[Circular]";if(t.push(r),"function"==typeof r.toJSON)try{var o=e(r.toJSON());return t.pop(),o}catch(e){return i(e)}if(Array.isArray(r)){var a=r.map(e);return t.pop(),a}var s=Object.keys(r).reduce(function(t,o){return t[o]=e(function(e,t){if(n.call(e,t))try{return e[t]}catch(e){return i(e)}return e[t]}(r,o)),t},{});return t.pop(),s}(e)}t.exports=function(e,t,r){return JSON.stringify(o(e),t,r)},t.exports.ensureProperties=o},285665,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Observable=void 0;let n=e=>!!Symbol[e],i=e=>n(e)?Symbol[e]:"@@"+e,o=i("iterator"),a=i("observable"),s=i("species");function u(e,t){let r=e[t];if(null!=r){if("function"!=typeof r)throw TypeError(r+" is not a function");return r}}function l(e){let t=e.constructor;return void 0!==t&&null===(t=t[s])&&(t=void 0),void 0!==t?t:m}function c(e){c.log?c.log(e):setTimeout(()=>{throw e})}function d(e){Promise.resolve().then(()=>{try{e()}catch(e){c(e)}})}function f(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=u(t,"unsubscribe");e&&e.call(t)}}catch(e){c(e)}}function p(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";let n=e._observer;try{let i=u(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(p(e),i)i.call(n,r);else throw r;break;case"complete":p(e),i&&i.call(n)}}catch(e){c(e)}"closed"===e._state?f(e):"running"===e._state&&(e._state="ready")}function h(e,t,r){if("closed"!==e._state){if("buffering"===e._state)return void e._queue.push({type:t,value:r});if("ready"!==e._state){e._state="buffering",e._queue=[{type:t,value:r}],d(()=>(function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let r=0;r<t.length&&(g(e,t[r].type,t[r].value),"closed"!==e._state);++r);}})(e));return}g(e,t,r)}}class v{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let r=this,n={get closed(){return"closed"===r._state},next(e){h(r,"next",e)},error(e){h(r,"error",e)},complete(){h(r,"complete")}};try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(p(this),f(this))}}class m{constructor(e){if(!(this instanceof m))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,r)=>{if("function"!=typeof e)return void r(TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(r){try{r=e(r)}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=l(this),r=arguments.length>1,n=!1,i=arguments[1],o=i;return new t(t=>this.subscribe({next(i){let a=!n;if(n=!0,!a||r)try{o=e(o,i)}catch(e){return t.error(e)}else o=i},error(e){t.error(e)},complete(){if(!n&&!r)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=l(this);return new t(r=>{let n,i=0;return!function o(a){n=a.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=l(this);return new t(r=>{let n=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return r.error(e)}let a=t.from(i).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){let e=n.indexOf(a);e>=0&&n.splice(e,1),o()}});n.push(a)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>
1{n.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[a](){return this}static from(e){let t="function"==typeof this?this:m;if(null==e)throw TypeError(e+" is not an object");let r=u(e,a);if(r){let n=r.call(e);if(Object(n)!==n)throw TypeError(n+" is not an object");return n instanceof m&&n.constructor===t?n:new t(e=>n.subscribe(e))}if(n("iterator")&&(r=u(e,o)))return new t(t=>{d(()=>{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=>{d(()=>{if(!t.closed){for(let r=0;r<e.length;++r)if(t.next(e[r]),t.closed)return;t.complete()}})});throw TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:m)(t=>{d(()=>{if(!t.closed){for(let r=0;r<e.length;++r)if(t.next(e[r]),t.closed)return;t.complete()}})})}static get[s](){return this}}r.Observable=m,Object.defineProperty(m,Symbol("extensions"),{value:{symbol:a,hostReportError:c},configurable:!0})},79815,(e,t,r)=>{t.exports=e.r(285665).Observable},674585,821316,109292,499711,574437,693748,752698,e=>{"use strict";let t;var r,n,i,o,a,s,u,l,c,d,f,p,g,h,v,m,y,_,b,w,E,S,T,k,A,I,P,O,x,C=e.i(274466);(r=h||(h={}))[r.None=0]="None",r[r.Error=1]="Error",r[r.Warn=2]="Warn",r[r.Verbose=3]="Verbose",r[r.Debug=4]="Debug";var R=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},D=function(e){return function(){var t=(0,C.__assign)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},L=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=(0,C.__values)(t.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(!(a in e))return;e=e[a]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},N=function(e,t){return function(){var r,n,i={};try{for(var o=(0,C.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=L(e,s)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},M=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=r(),u=s.logger,l=s.logLevel;if(l&&l<h.Debug||!l||!u)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:R(1),time:{start:new Date().toISOString()},states:{}};n&&c.states&&(c.states.before=n());var d=e.apply(i,o);return d&&d.promise?d.promise.then(function(){n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=new Date().toISOString()),u.debug(JSON.stringify(c,null,2))}):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=new Date().toISOString()),u.debug(JSON.stringify(c,null,2))),d}};(n=v||(v={})).SET="$set",n.SET_ONCE="$setOnce",n.ADD="$add",n.APPEND="$append",n.PREPEND="$prepend",n.REMOVE="$remove",n.PREINSERT="$preInsert",n.POSTINSERT="$postInsert",n.UNSET="$unset",n.CLEAR_ALL="$clearAll",(i=m||(m={})).IDENTIFY="$identify",i.GROUP_IDENTIFY="$groupidentify",i.REVENUE="revenue_amount";var j="".concat("AMP","_unsent"),U="$default_instance",F="https://api2.amplitude.com/2/httpapi",q="https://api.eu.amplitude.com/2/httpapi",B="https://api2.amplitude.com/batch",H="https://api.eu.amplitude.com/batch",z="dclid",V="fbclid",W="gbraid",J="gclid",K="ko_click_id",$="li_fat_id",G="msclkid",Y="rdt_cid",X="ttclid",Q="twclid",Z="wbraid",ee={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},et=["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"],er=["authorization","cookie","set-cookie"],en=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!ei(t,r))return!1}return!0},ei=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,C.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if("object"==typeof s)i=i&&en(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else if(null==t)return!1;else if("object"==typeof t)return en(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},eo=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,C.__assign)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(y.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(y.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(y.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(y.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(y.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(y.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(y.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(y.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(y.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[y.CLEAR_ALL]="-",this}
1,e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return!(void 0!==this._properties[y.CLEAR_ALL]||this._propertySet.has(t))&&(e===y.ADD?"number"==typeof r:e===y.UNSET||e===y.REMOVE||ei(t,r))},e}();(o=y||(y={})).SET="$set",o.SET_ONCE="$setOnce",o.ADD="$add",o.APPEND="$append",o.PREPEND="$prepend",o.REMOVE="$remove",o.PREINSERT="$preInsert",o.POSTINSERT="$postInsert",o.UNSET="$unset",o.CLEAR_ALL="$clearAll";var ea=[y.CLEAR_ALL,y.UNSET,y.SET,y.SET_ONCE,y.ADD,y.APPEND,y.PREPEND,y.PREINSERT,y.POSTINSERT,y.REMOVE];e.s(["Identify",0,eo,"OrderedIdentifyOperations",0,ea],821316),(a=_||(_={})).Unknown="unknown",a.Skipped="skipped",a.Success="success",a.RateLimit="rate_limit",a.PayloadTooLarge="payload_too_large",a.Invalid="invalid",a.Failed="failed",a.Timeout="Timeout",a.SystemError="SystemError";var es=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=_.Unknown),{event:e,code:t,message:r}},eu=function(){var t="ampIntegrationContext";return"u">typeof globalThis&&void 0!==globalThis[t]?globalThis[t]:"u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof self?self:e.g},el=(0,C.__spreadArray)([],(0,C.__read)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),ec=function(e){var t,r=eu();if(!(null==(t=null==r?void 0:r.crypto)?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,ec);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,(0,C.__spreadArray)([],(0,C.__read)(n.entries()),!1).map(function(e){var t=(0,C.__read)(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(el[n]):el[n]}).join("")},ed=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 r,n;return(0,C.__awaiter)(this,void 0,void 0,function(){var i;return(0,C.__generator)(this,function(o){switch(o.label){case 0:if(void 0===e.name&&(e.name=ec(),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!=(r=e.type)?r:"enrichment",this.pluginStatus.set(i,"locked"),[4,null==(n=e.setup)?void 0:n.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 r;return(0,C.__awaiter)(this,void 0,void 0,function(){var n,i;return(0,C.__generator)(this,function(o){switch(o.label){case 0:if(this.pluginStatus.delete(e),-1===(n=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[n],this.plugins.splice(n,1),[4,null==(r=i.teardown)?void 0:r.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.call(e)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(r){t.queue.push([e,r]),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(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,a,s,u,l,c,d,f,p,g,h;return(0,C.__generator)(this,function(v){switch(v.label){case 0:if(!e)return[2];t=(0,C.__read)(e,1)[0],r=(0,C.__read)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),n=this.plugins.filter(function(e){return"before"===e.type}),v.label=1;case 1:v.trys.push([1,6,7,8]),o=(i=(0,C.__values)(n)).next(),v.label=2;case 2:if(o.done)return[3,5];if(!(a=o.value).execute)return[3,4];return[4,a.execute((0,C.__assign)({},t))];case 3:if(null===(s=v.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),r({event:t,code:0,message:""}),[2];t=s,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),v.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return f={error:v.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}),v.label=9;case 9:v.trys.push([9,14,15,16]),c=(l=(0,C.__values)(u)).next(),v.label=10;case 10:if(c.done)return[3,13];if(!(a=c.value).execute)return[3,12];return[4,a.execute((0,C.__assign)({},t))];case 11:if(null===(s=v.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),r({event:t,code:0,message:""}),[2];t=s,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),v.label=12;case 12:return c=l.next(),[3,10];case 13:return[3,16];case 14:return g={error:v.sent()},[3,16];case 15:try{c&&!c.done&&(h=l.return)&&h.call(l)}finally{if(g)throw g.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(JSON.stringify(t))),Promise.all(d.map(function(e){var r=(0,C.__assign)({},t);return e.execute(r).catch(function(e){return es(r,0,String(e))})})).then(function(e){var n=(0,C.__read)(e,1)[0]||es(t,100,"Event not tracked, no destination plugins on the instance");r(n)}),[2]}})})},e.prototype.flush=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,C.__generator)(this,function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return r.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return r.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 r;null==(r=t.onIdentityChanged)||r.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var r;null==(r=t.onSessionIdChanged)||r.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var r;null==(r=t.onOptOutChanged)||r.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,a;return(0,C.__generator)(this,function(s){switch(s.label){case 0:s.trys.push([0,7,8,9]),r=(t=(0,C.__values)(this._optOutListeners)).next(),s.label=1;case 1:if(r.done)return[3,6];n=r.value,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n(e)];case 3:return s.sent(),[3,5];case 4:return i=s.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return o={error:s.sent()},[3,9];case 8:try{r&&!r.done&&(a=t.return)&&a.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)||t.call(e)})},e}(),ef=function(e,t){return(0,C.__assign)((0,C.__assign)({},t),{event_type:m.IDENTIFY,user_properties:e.getUserProperties()})},ep=function(e,t,r,n){var i;return(0,C.__assign)((0,C.__assign)({},n),{event_type:m.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:((i={})[e]=t,i)})},eg=function(e,t,r){var n,i=new eo;return i.set(e,t),(0,C.__assign)((0,C.__assign)({},r),{event_type:m.IDENTIFY,user_properties:i.getUserProperties(),groups:((n={})[e]=t,n)})},eh=function(e){return{promise:e||Promise.resolve()}},ev=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 ed(this),this.name=e}return e.prototype._init=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,a;return(0,C.__generator)(this,function(s){switch(s.label){case 0:t=this[e],this[e]=[],s.label=1;case 1:s.trys.push([1,8,9,10]),n=(r=(0,C.__values)(t)).next(),s.label=2;case 2:if(n.done)return[3,7];if(!((i=(0,n.value)())&&"promise"in i))return[3,4];return[4,i.promise];case 3:return s.sent(),[3,6];case 4:return[4,i];case 5:s.sent(),s.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return o={error:s.sent()},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}
1return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:s.sent(),s.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,r){var n=(0,C.__assign)((0,C.__assign)((0,C.__assign)({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t});return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),eh(this.dispatch(n))},e.prototype.identify=function(e,t){var r=ef(e,t);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),eh(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var i=ep(e,t,r,n);return eh(this.dispatch(i))},e.prototype.setGroup=function(e,t,r){var n=eg(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),eh(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=(0,C.__assign)((0,C.__assign)({},t),{event_type:m.REVENUE,event_properties:e.getEventProperties()});return eh(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),eh())},e.prototype._addPlugin=function(e){return eh(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)),eh())},e.prototype._removePlugin=function(e){return eh(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(es(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,C.__generator)(this,function(r){return this.isReady?[2,this.process(e)]:[2,new Promise(function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t,r=null!=(t=this.userProperties)?t:{},n=(0,C.__assign)({},r);if(void 0===e)return n;var i={};return Object.keys(e).forEach(function(t){Object.values(v).includes(t)||(i[t]=e[t])}),ea.forEach(function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case v.CLEAR_ALL:Object.keys(n).forEach(function(e){delete n[e]});break;case v.UNSET:Object.keys(r).forEach(function(e){delete n[e]});break;case v.SET:Object.assign(n,r)}}}),Object.assign(n,i),n},e.prototype.process=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r;return(0,C.__generator)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),this.config.optOut)return[2,es(e,0,"Event skipped due to optOut config")];return e.event_type===m.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)];case 1:return 200===(t=n.sent()).code?this.config.loggerProvider.log(t.message):100===t.code?this.config.loggerProvider.warn(t.message):this.config.loggerProvider.error(t.message),[2,t];case 2:return r=String(n.sent()),this.config.loggerProvider.error(r),[2,t=es(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,!!e))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=!!e,this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return eh(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});return void 0===t?void this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e)):t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),em=function(e,t){var r=Math.max(t,1);return e.reduce(function(e,t,n){var i=Math.floor(n/r);return e[i]||(e[i]=[]),e[i].push(t),e},[])},ey="Amplitude Logger ",e_=function(){function e(){this.logLevel=h.None}return e.prototype.disable=function(){this.logLevel=h.None},e.prototype.enable=function(e){void 0===e&&(e=h.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Verbose||console.log("".concat(ey,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Warn||console.warn("".concat(ey,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Error||console.error("".concat(ey,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Debug||console.log("".concat(ey,"[Debug]: ").concat(e.join(" ")))},e}(),eb=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:U,logLevel:h.Warn,loggerProvider:new e_,offline:!1,optOut:!1,serverUrl:F,serverZone:"US",useBatch:!1}},ew=function(){function e(e){this._optOut=!1;var t,r,n,i,o=eb();this.apiKey=e.apiKey,this.flushIntervalMillis=null!=(t=e.flushIntervalMillis)?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!=(r=e.logLevel)?r: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!=(n=e.optOut)?n: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)?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=eE(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
1,enumerable:!1,configurable:!0}),e}(),eE=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=eb().serverZone),void 0===r&&(r=eb().useBatch),e)return{serverUrl:e,serverZone:void 0};var n,i=["US","EU"].includes(t)?t:eb().serverZone;return{serverZone:i,serverUrl:(n=r,"EU"===i?n?H:q:n?B:F)}},eS=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function eT(e){return e>=200&&e<300}var ek=new Set([F,q,B,H]);function eA(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var eI=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(0,C.__awaiter)(this,void 0,void 0,function(){var r,n=this;return(0,C.__generator)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(j,"_").concat(this.config.apiKey.substring(0,10)),[4,null==(t=this.config.storageProvider)?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map(function(e){return n.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=ec()),new Promise(function(r){t.queue.push({event:e,attempts:0,callback:function(e){return r(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},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),(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n=this;return(0,C.__generator)(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=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),[4,em(t,this.config.flushQueueSize).reduce(function(t,r){return(0,C.__awaiter)(n,void 0,void 0,function(){return(0,C.__generator)(this,function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}})})},Promise.resolve())];case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),(0,C.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s;return(0,C.__generator)(this,function(u){var l,c,d;switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,(0,C.__rest)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new eS,u.label=1;case 1:return u.trys.push([1,3,,4]),l=i=eE(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,void 0===(c=this.config.enableRequestBodyCompression)&&(c=!1),o=!!ek.has(l)||c,[4,this.config.transportProvider.send(i,n,o)];case 2:if(null===(a=u.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in a?this.fulfillRequest(e,a.statusCode,"".concat(a.status,": ").concat(eA(a))):this.fulfillRequest(e,a.statusCode,a.status),[2];return this.handleResponse(a,e),[3,4];case 3:return s=(d=u.sent())instanceof Error?d.message:String(d),this.config.loggerProvider.error(s),null==(r=this.diagnosticsClient)||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:s,stack_trace:R()}),this.handleResponse({status:_.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){eT(e.statusCode)||null==(r=this.diagnosticsClient)||r.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:eA(e),stack_trace:R()});var r,n=e.status;switch(n){case _.Success:this.handleSuccessResponse(e,t);break;case _.Invalid:this.handleInvalidResponse(e,t);break;case _.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case _.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' 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 r=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))return void this.fulfillRequest(t,e.statusCode,e.body.error);var n=new Set((0,C.__spreadArray)((0,C.__spreadArray)((0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,C.__read)(Object.values(e.body.eventsWithMissingFields)),!1),(0,C.__read)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,C.__read)(e.body.silencedEvents),!1).flat()),i=t.filter(function(t,i){return!n.has(i)||void r.fulfillRequest([t],e.statusCode,e.body.error)});i.length>0&&this.config.loggerProvider.warn(eA(e));
1var o=this.removeEventsExceedFlushMaxRetries(i);this.scheduleEvents(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length)return void this.fulfillRequest(t,e.statusCode,e.body.error);this.config.loggerProvider.warn(eA(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,a=new Set(n),s=new Set(i),u=new Set(o),l=t.filter(function(t,n){return t.event.user_id&&a.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)?void r.fulfillRequest([t],e.statusCode,e.body.error):(u.has(n)&&(t.timeout=r.throttleTimeout),!0)});l.length>0&&this.config.loggerProvider.warn(eA(e));var c=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){var n,i,o;eT(t)?null==(o=this.diagnosticsClient)||o.increment("analytics.events.sent",e.length):(null==(n=this.diagnosticsClient)||n.increment("analytics.events.dropped",e.length),null==(i=this.diagnosticsClient)||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:r,stack_trace:R()})),this.removeEvents(e),e.forEach(function(e){return e.callback(es(e.event,t,r))})},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}(),eP=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));en(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?(0,C.__assign)({},this.properties):{};return e[b.REVENUE_PRODUCT_ID]=this.productId,e[b.REVENUE_QUANTITY]=this.quantity,e[b.REVENUE_PRICE]=this.price,e[b.REVENUE_TYPE]=this.revenueType,e[b.REVENUE_CURRENCY]=this.currency,e[b.REVENUE]=this.revenue,e[b.RECEIPT]=this.receipt,e[b.RECEIPT_SIG]=this.receiptSig,e},e}();(s=b||(b={})).REVENUE_PRODUCT_ID="$productId",s.REVENUE_QUANTITY="$quantity",s.REVENUE_PRICE="$price",s.REVENUE_TYPE="$revenueType",s.REVENUE_CURRENCY="$currency",s.REVENUE="$revenue",s.RECEIPT="$receipt",s.RECEIPT_SIG="$receiptSig",e.s(["Revenue",0,eP,"RevenueProperty",0,b],109292);var eO=e.i(621108),ex=function(e){return void 0===e&&(e=U),eO.AnalyticsConnector.getInstance(e)},eC=function(e,t){ex(t).identityStore.editIdentity().setUserId(e).commit()},eR=function(e,t){ex(t).identityStore.editIdentity().setDeviceId(e).commit()},eD=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},eL=function(){function e(){this.name="identity",this.type="before",this.identityStore=ex().identityStore}return e.prototype.execute=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t;return(0,C.__generator)(this,function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return e.instanceName&&(this.identityStore=ex(e.instanceName).identityStore),[2]})})},e}(),eN=function(){var e,t=eu();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(
1Boolean).reduce(function(e,t){var r=t.split("=",2),n=eM(r[0]),i=eM(r[1]);return i&&(e[n]=i),e},{}):{}},eM=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},ej=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 r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.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}(),eU=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new ej(e,t)}return e.prototype.subscribe=function(e,t,r){var n=ec(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},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(0,C.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,C.__generator)(this,function(r){switch(r.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=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return 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.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(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,C.__generator)(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.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 o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,C.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,C.__generator)(this,function(i){switch(i.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[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!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=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(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,C.__awaiter)(this,void 0,void 0,function(){var r,n,i,o,a,s,u=this;return(0,C.__generator)(this,function(l){switch(l.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,a,s,l,c,d;return(0,C.__generator)(this,function(f){switch(f.label){case 0:i=!0,a=new AbortController,s=setTimeout(function(){return a.abort()},t),f.label=1;case 1:return f.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:a.signal})];case 2:if((l=f.sent()).ok)return[3,4];return[4,l.text()];case 3:return c=f.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(l.status,": ").concat(c)),401===l.status||403===l.status?(o.logger.error("Remote config client fetch failed with ".concat(l.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,i=!1):l.status>=400&&l.status<500&&429!==l.status&&(i=!1),[3,6];case 4:return[4,l.json()];case 5:return[2,{value:{remoteConfig:f.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=f.sent())instanceof Error&&"AbortError"===d.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: "),d),[3,9];case 8:return clearTimeout(s),[7];case 9:if(!i)return[2,"break"];if(!(n<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(r))})];case 10:f.sent(),f.label=11;case 11:return[2]}})},o=this,a=0,l.label=1;case 1:if(!(a<e))return[3,4];return[5,i(a)];case 2:if("object"==typeof(s=l.sent()))return[2,s.value];if("break"===s)return[3,4];l.label=3;case 3:return a++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}(),eF="tags",eq="counters",eB="histograms",eH="events",ez="internal",eV="last_flush_timestamp",eW=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=eu())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(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,r){var n=indexedDB.open(e.dbName,1);n.onerror=function(){e.dbPromise=null,r(Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(eF)||e.createObjectStore(eF,{keyPath:"key"}),e.objectStoreNames.contains(eq)||e.createObjectStore(eq,{keyPath:"key"}),e.objectStoreNames.contains(eB)||e.createObjectStore(eB,{keyPath:"key"}),e.objectStoreNames.contains(eH)||e.createObjectStore(eH,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(ez)||e.createObjectStore(ez,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,C.__generator)(this,function(o){switch(o.label){case 0:if(o.tr
1ys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return r=(t=o.sent().transaction([eF],"readwrite")).objectStore(eF),[2,new Promise(function(n){var o=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tags",e),n()},o.forEach(function(e){var t=(0,C.__read)(e,2),n=t[0],o=t[1];r.put({key:n,value:o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tag",n,o,e)}})})];case 2:return n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",n),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,C.__generator)(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 r=(t=o.sent().transaction([eq],"readwrite")).objectStore(eq),[2,new Promise(function(n){var o=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to increment counters",e),n()},o.forEach(function(e){var t=(0,C.__read)(e,2),n=t[0],o=t[1],a=r.get(n);a.onsuccess=function(){var e=a.result,t=e?e.value:0;r.put({key:n,value:t+o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},a.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}})})];case 2:return n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",n),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,C.__generator)(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 r=(t=o.sent().transaction([eB],"readwrite")).objectStore(eB),[2,new Promise(function(n){var o=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),n()},o.forEach(function(e){var t=(0,C.__read)(e,2),n=t[0],o=t[1],a=r.get(n);a.onsuccess=function(){var e,t=a.result;e=t?{key:n,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:n,count:o.count,min:o.min,max:o.max,sum:o.sum},r.put(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},a.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}})})];case 2:return n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,C.__generator)(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 r=(t=o.sent().transaction([eH],"readwrite")).objectStore(eH),[2,new Promise(function(n){t.oncomplete=function(){n()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event records",e),n()};var o=r.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){r.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 n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",n),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,C.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,C.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(r=o.sent().transaction([ez],"readwrite")).objectStore(ez),[2,new Promise(function(i,o){r.onabort=function(){return o(Error("Failed to set internal value"))};var a=n.put({key:e,value:t});a.onsuccess=function(){return i()},a.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(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,C.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=(t=i.sent().transaction([ez],"readonly")).objectStore(ez),[2,new Promise(function(n,i){t.onabort=function(){return i(Error("Failed to get internal value"))};var o=r.get(e);o.onsuccess=function(){return n(o.result)},o.onerror=function(){return i(Error("Failed to get internal value"))}})];case 2:return n=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",n),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,C.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(eV)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.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(0,C.__awaiter)(this,void 0,void 0,function(){var t;return(0,C.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(eV,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.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(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){var e,t,r,n,i,o,a;return(0,C.__generator)(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=s.sent().transaction([eF,eq,eB,eH],"readwrite"),[4,Promise.all([this.getAllFromStore(e,eF),this.getAllFromStore(e,eq),this.getAllFromStore(e,eB),this.getAllFromStore(e,eH)])];case 2:return r=(t=C.__read.apply(void 0,[s.sent(),4]))[0],n=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,eq),this.clearTable(e,eB),this.clearTable(e,eH)])];case 3:return s.sent(),[2,{tags:r,counters:n,histogramStats:i,events:o}];case 4:return a=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).getAll();i.onsuccess=function(){return r(i.result)},i.onerror=function(){return n(Error("Failed to get all from ".concat(t)))}})},e}(),eJ=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t}
1,eK=function(e,t){return 31*Math.abs(eJ(e.toString()))%1e5/1e5<t},e$=function(){var e=eu();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},eG=function(e){var t=eu();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent("sdk.error.uncaught",(0,C.__assign)({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,n=null==t?void 0:t.stack,i=eY({filename:e.filename,stack:n});i&&r({type:"error",message:e.message,stack:n,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,n=e.reason instanceof Error?e.reason:void 0,i=null==n?void 0:n.stack,o=eX(i),a=eY({filename:o,stack:i});a&&r({type:"unhandledrejection",message:null!=(t=null==n?void 0:n.message)?t:eQ(e.reason),stack:i,filename:o,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:a}})},!0)}},eY=function(e){var t,r,n=e$();if(0!==n.length)try{for(var i=(0,C.__values)(n),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.filename&&e.filename.includes(a))return"filename";if(e.stack&&e.stack.includes(a))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},eX=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},eQ=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},eZ=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===r?"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(n,null,2)),this.config=(0,C.__assign)({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=eK(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,eW.isSupported()?this.storage=new eW(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),eG(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");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)return void this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");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)return void this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.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)return void this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");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(0,C.__awaiter)(this,void 0,void 0,function(){var e,t,r,n;return(0,C.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=(0,C.__assign)({},this.inMemoryTags),t=(0,C.__assign)({},this.inMemoryCounters),r=(0,C.__assign)({},this.inMemoryHistograms),n=(0,C.__spreadArray)([],(0,C.__read)(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(r),this.storage.addEventRecords(n)])];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){var e,t,r,n,i,o,a,s,u,l;return(0,C.__generator)(this,function(c){switch(c.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return c.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=c.sent()).tags,r=e.counters,n=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),a={},r.forEach(function(e){a[e.key]=e.value}),s={}
1,n.forEach(function(e){s[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(a).length&&0===Object.keys(s).length&&0===u.length)return[2];return l={tags:o,histogram:s,counters:a,events:u},this.fetch(l),[2]}})})},e.prototype.fetch=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t;return(0,C.__generator)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!eu())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(!r.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=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){var e,t,r;return(0,C.__generator)(this,function(n){switch(n.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=n.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(r=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-r),[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=eK(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),e0=e.i(37611),e1=e0.default||e0,e2=function(e,t){var r,n,i;return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1&&("string"!=typeof(null==(n=null==(r=null==(i=eu())?void 0:i.chrome)?void 0:r.runtime)?void 0:n.id)||!!(null==e?void 0:e[t]))},e3=function(e){return e2(e,"attribution")},e4=function(e){return e2(e,"formInteractions")},e5=function(e){return e2(e,"pageViews")},e6=function(e){return e2(e,"sessions")},e8=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},e7=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},e9=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},te=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;if(!0===t)return{mainThreadBlock:!0};if("object"==typeof t&&null!==t)return t}},tt=function(e){if(e7(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},tr=function(e){if(e9(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},tn=function(e){var t;if(e8(e.autocapture)){var r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),(0,C.__assign)((0,C.__assign)({},r),{captureRules:null==(t=null==r?void 0:r.captureRules)?void 0:t.map(function(t){var r,n,i;if((null==(r=t.urls)?void 0:r.length)&&(null==(n=t.hosts)?void 0:n.length)){var o=JSON.stringify(t.hosts),a=JSON.stringify(t.urls);return null==(i=e.loggerProvider)||i.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,C.__assign)((0,C.__assign)({},t),{hosts:void 0})}return t})})}},ti=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return e5(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},to=function(e){if(e4(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},ta=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,a=n.resolve,s=e&&e[i];if("function"==typeof s){var u=s.apply(e,o);"function"==typeof a&&a(null==u?void 0:u.promise)}}return e},ts=function(e){return e&&void 0!==e._q};e.s(["convertProxyObjectToRealObject",0,ta,"isInstanceProxy",0,ts,"runQueuedFunctions",0,function(e,t){ta(e,t)}],499711);var tu=function(){if("u"<typeof navigator)return"";var e,t,r,n,i=navigator.userLanguage;return null!=(n=null!=(r=null!=(t=null==(e=navigator.languages)?void 0:e[0])?t:navigator.language)?r:i)?n:""},tl="2.42.5",tc="amplitude-ts",td=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(tc,"/").concat(tl),"u">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,r;return(0,C.__awaiter)(this,void 0,void 0,function(){var n,i,o;return(0,C.__generator)(this,function(a){return n=new Date().getTime(),i=null!=(t=this.config.lastEventId)?t:-1,o=null!=(r=e.event_id)?r:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=n),[2,(0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:tu()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:ec(),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}(),tf=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t;return(0,C.__generator)(this,function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(r){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),tp=function(){var e,t=eu();return null==(e=null==t?void 0:t.navigator)?void 0:e.locks},tg=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,C.__assign)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,C.__generator)(this,function(o){switch(o.label){case 0:return t="AMP_TEST",r=new e((0,C.__assign)({},this.options)),n=String(Date.now()),[4,r.transaction(t,function(e){var r,o;try{e.set(n);var a=e.get()===n;return!a&&i.config.diagnosticsClient&&(null==(r=i.config.diagnosticsClient)||r.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:n,sync:!0})),a}catch(e){if(i.config.diagnosticsClient){var s=e instanceof Error?e.message:String(e);null==(o=i.config.diagnosticsClient)||o.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:n,error:s,sync:!0})}return!1}
1finally{e.set(null)}})];case 1:return[2,o.sent()]}})})},e.prototype.get=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t;return(0,C.__generator)(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:return t=r.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var r=tm(t);if(void 0===r)return void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t));return JSON.parse(r)}catch(r){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,r;return(0,C.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s,u,l,c;return(0,C.__generator)(this,function(d){switch(d.label){case 0:n=eu(),d.label=1;case 1:if(d.trys.push([1,4,,5]),!(i=null==n?void 0:n.cookieStore))return[3,3];return[4,i.getAll(e)];case 2:if(o=d.sent()){o.length>1&&(null==(t=this.config.diagnosticsClient)||t.recordEvent("cookies.duplicate",{cookies:o.map(function(e){return e.domain})}),null==(r=this.config.diagnosticsClient)||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(s=(a=(0,C.__values)(o)).next();!s.done;s=a.next())if(u=s.value,ty(u.domain,this.options.domain))return[2,u.value]}catch(e){l={error:e}}finally{try{s&&!s.done&&(c=a.return)&&c.call(a)}finally{if(l)throw l.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,r,n=this,i=eu(),o=(null!=(r=null==(t=null==i?void 0:i.document)?void 0:t.cookie.split("; "))?r:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&o.length>1&&(a=o.find(function(t){var r;try{var i=s(t.substring(e.length+1));return i||null==(r=n.config.diagnosticsClient)||r.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),a||(a=o[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(r){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var r;try{var n=null!=(r=this.options.expirationDays)?r:0,i=null!==t?n:-1,o=void 0;if(i){var a=new Date;a.setTime(a.getTime()+24*i*36e5),o=a}var s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite));var u=eu();(null==u?void 0:u.document)&&(u.document.cookie=s)}catch(t){var l=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(l))}},e.prototype.remove=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(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(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(e){return[2]})})},e.isDomainWritable=function(t){return(0,C.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,C.__generator)(this,function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];r="AMP_TLDTEST",n=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.transaction(r,function(r){if(e.cachedTlds[t])return!0;try{r.set(1);var n=!!r.get();return n&&(e.cachedTlds[t]=!0),n}finally{r.set(null)}})];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return(0,C.__awaiter)(this,void 0,void 0,function(){var r,n,i=this;return(0,C.__generator)(this,function(o){switch(o.label){case 0:if(r=tp(),n=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!r)return[2,n()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.request("com.amplitude:cookie-lock:".concat(e),n)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,n()];case 4:return[2]}})})},e.cachedTlds={},e}(),th=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tv=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},tm=function(e){var t;
1return null!=(t=th(e))?t:tv(e)},ty=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()},t_=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),["AMP",t,e.substring(0,r)].filter(Boolean).join("_")},tb=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,C.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t;return(0,C.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=r.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(r){return[2,(null==(t=this.storage)?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var r;return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(n){try{null==(r=this.storage)||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(r){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),tw=function(e){function t(t){var r,n,i,o=this;try{i=null==(r=eu())?void 0:r.localStorage}catch(e){null==(n=null==t?void 0:t.loggerProvider)||n.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(0,C.__extends)(t,e),t.prototype.set=function(t,r){var n;return(0,C.__awaiter)(this,void 0,void 0,function(){var i;return(0,C.__generator)(this,function(o){switch(o.label){case 0:if(!(Array.isArray(r)&&r.length>1e3))return[3,2];return i=r.length-1e3,[4,e.prototype.set.call(this,t,r.slice(0,1e3))];case 1:return o.sent(),null==(n=this.loggerProvider)||n.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,r)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(tb),tE=function(e){function t(){var t;return e.call(this,null==(t=eu())?void 0:t.sessionStorage)||this}return(0,C.__extends)(t,e),t}(tb),tS=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,r,n,i,o,a,s,u,l,c,d,f,p,g,h,v,m,y,b,w,E,S,T=e.code||0,k=this.buildStatus(T);switch(k){case _.Success:return{status:k,statusCode:T,body:{eventsIngested:null!=(t=e.events_ingested)?t:0,payloadSizeBytes:null!=(r=e.payload_size_bytes)?r:0,serverUploadTime:null!=(n=e.server_upload_time)?n:0}};case _.Invalid:return{status:k,statusCode:T,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(a=e.events_with_invalid_fields)?a:{},eventsWithMissingFields:null!=(s=e.events_with_missing_fields)?s:{},eventsWithInvalidIdLengths:null!=(u=e.events_with_invalid_id_lengths)?u:{},epsThreshold:null!=(l=e.eps_threshold)?l:0,exceededDailyQuotaDevices:null!=(c=e.exceeded_daily_quota_devices)?c:{},silencedDevices:null!=(d=e.silenced_devices)?d:[],silencedEvents:null!=(f=e.silenced_events)?f:[],throttledDevices:null!=(p=e.throttled_devices)?p:{},throttledEvents:null!=(g=e.throttled_events)?g:[]}};case _.PayloadTooLarge:return{status:k,statusCode:T,body:{error:null!=(h=e.error)?h:""}};case _.RateLimit:return{status:k,statusCode:T,body:{error:null!=(v=e.error)?v:"",epsThreshold:null!=(m=e.eps_threshold)?m:0,throttledDevices:null!=(y=e.throttled_devices)?y:{},throttledUsers:null!=(b=e.throttled_users)?b:{},exceededDailyQuotaDevices:null!=(w=e.exceeded_daily_quota_devices)?w:{},exceededDailyQuotaUsers:null!=(E=e.exceeded_daily_quota_users)?E:{},throttledEvents:null!=(S=e.throttled_events)?S:[]}};case _.Timeout:default:return{status:k,statusCode:T}}},e.prototype.buildStatus=function(e){return eT(e)?_.Success:429===e?_.RateLimit:413===e?_.PayloadTooLarge:408===e?_.Timeout:e>
1=400&&e<500?_.Invalid:e>=500?_.Failed:_.Unknown},e}();function tT(){return"u">typeof CompressionStream}function tk(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t;return(0,C.__generator)(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]),[4,new Response(new Blob([e]).stream().pipeThrough(new t("gzip"))).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var tA=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=t,r}return(0,C.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,C.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,C.__generator)(this,function(i){return[2,new Promise(function(i,o){"u"<typeof XMLHttpRequest&&o(Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===n.state.done){var e=a.responseText;try{i(n.buildResponse(JSON.parse(e)))}catch(e){i(n.buildResponse({code:a.status}))}}};var s={"Content-Type":"application/json",Accept:"*/*"},u=JSON.stringify(t),l=r&&u.length>=2048&&tT(),c=function(e){var t,r;s=(0,C.__assign)((0,C.__assign)({},n.customHeaders),s);try{for(var i=(0,C.__values)(Object.entries(s)),o=i.next();!o.done;o=i.next()){var u=(0,C.__read)(o.value,2),l=u[0],c=u[1];a.setRequestHeader(l,c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}a.send(e)};(0,C.__awaiter)(n,void 0,void 0,function(){var e;return(0,C.__generator)(this,function(t){switch(t.label){case 0:if(!l)return[3,2];return[4,tk(u)];case 1:return(e=t.sent())?(s["Content-Encoding"]="gzip",c(e)):c(u),[3,3];case 2:c(u),t.label=3;case 3:return[2]}})}).catch(o)})]})})},t}(tS),tI=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return(0,C.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,C.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s,u,l;return(0,C.__generator)(this,function(c){switch(c.label){case 0:if("u"<typeof fetch)throw Error("FetchTransport is not supported");if(n=JSON.stringify(t),i=r&&n.length>=2048&&tT(),o=n,a={"Content-Type":"application/json",Accept:"*/*"},!i)return[3,2];return[4,tk(n)];case 1:(s=c.sent())&&(a["Content-Encoding"]="gzip",o=s),c.label=2;case 2:return[4,fetch(e,{headers:a=(0,C.__assign)((0,C.__assign)({},this.customHeaders),a),body:o,method:"POST"})];case 3:return[4,(u=c.sent()).text()];case 4:l=c.sent();try{return[2,this.buildResponse(JSON.parse(l))]}catch(e){return[2,this.buildResponse({code:u.status})]}}})})},t}(tS),tP=function(e){function t(){return e.call(this)||this}return(0,C.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,C.__awaiter)(this,void 0,void 0,function(){var r=this;return(0,C.__generator)(this,function(n){return[2,new Promise(function(n,i){var o=eu();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var a=JSON.stringify(t);if(o.navigator.sendBeacon(e,a))return n(r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:a.length,server_upload_time:Date.now()}));return n(r.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(tS),tO=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},tx=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},tC="[Amplitude]",tR="".concat(tC," Form Started"),tD="".concat(tC," Form Submitted"),tL="".concat(tC," File Downloaded"),tN="session_start",tM="session_end",tj="".concat(tC," File Extension"),tU="".concat(tC," File Name"),tF="".concat(tC," Link ID"),tq="".concat(tC," Link Text"),tB="".concat(tC," Link URL"),tH="".concat(tC," Form ID"),tz="".concat(tC," Form Name"),tV="".concat(tC," Form Destination"),tW="cookie",tJ={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},tK=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},t$=function(e,t,r,n,i,o){void 0===i&&(i=!0),e.referrer;var a=e.referring_domain,s=(0,C.__rest)(e,["referrer","referring_domain"]),u=t||{},l=(u.referrer,u.referring_domain),c=(0,C.__rest)(u,["referrer","referring_domain"]),d=r.excludeInternalReferrers;if(d){var f=tQ(d,n);if(!(f instanceof TypeError)&&e.referring_domain&&t2(e.referring_domain,o)){if
1("always"===f)return tZ(f,e.referring_domain,n),!1;else if("ifEmptyCampaign"===f&&Object.values((0,C.__assign)((0,C.__assign)({},e),{referring_domain:void 0,referrer:void 0})).every(function(e){return!e}))return tZ(f,e.referring_domain,n),!1}}if(tG(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Object.values(e).every(function(e){return!e})&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var p=JSON.stringify(s)!==JSON.stringify(c),g=tK(a||"")!==tK(l||""),h=!t||p||g;return h?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),h},tG=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})},tY=function(e,t){var r=t.startsWith(".")?t:".".concat(t);return!!(e.startsWith(".")?e:".".concat(e)).endsWith(r)},tX=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},tQ=function(e,t){if(!0===e)return tJ.always;if("object"==typeof e){var r=e.condition;if("string"==typeof r&&Object.keys(tJ).includes(r))return r;if(void 0===r)return tJ.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),TypeError(n)};function tZ(e,t,r){var n="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?r.debug(n):"ifEmptyCampaign"===e&&r.debug("".concat(n," with empty campaign parameters"))}var t0=["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"],t1=function(e){var t,r,n=e||(null==(r=null==(t=eu())?void 0:t.location)?void 0:r.hostname);if(!n)return"";var i=n.split("."),o=i[i.length-1],a=i[i.length-2];return(t0.find(function(e){return n.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],a=i[i.length-3]),a)?"".concat(a,".").concat(o):o},t2=function(e,t){var r=eu();return!!r&&tY(e,(t||"").trim()||t1(r.location.hostname))},t3=function(e){function t(t,r,n,i,o,a,s,u,l,c,d,f,p,g,v,m,y,_,b,w,E,S,T,k,A,I,P,O,x,C,R,D,L,N,M,j,U,F,q,B,H,z,V,W){void 0===n&&(n=new tf),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===u&&(u=1e3),void 0===l&&(l=5),void 0===c&&(c=30),void 0===d&&(d=tW),void 0===m&&(m=new e_),void 0===y&&(y=h.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===T&&(T=""),void 0===k&&(k="US"),void 0===P&&(P=18e5),void 0===O&&(O=new tw({loggerProvider:m})),void 0===x&&(x={ipAddress:!0,language:!0,platform:!0}),void 0===C&&(C="fetch"),void 0===R&&(R=!1),void 0===D&&(D=!0),void 0===F&&(F=!0),void 0===q&&(q=0),void 0===V&&(V=!1);var J,K=this;(K=e.call(this,{apiKey:t,storageProvider:O,transportProvider:t6(C)})||this).apiKey=t,K.appVersion=r,K.cookieOptions=i,K.defaultTracking=o,K.autocapture=a,K.flushIntervalMillis=u,K.flushMaxRetries=l,K.flushQueueSize=c,K.identityStorage=d,K.ingestionMetadata=f,K.instanceName=p,K.loggerProvider=m,K.logLevel=y,K.minIdLength=_,K.offline=b,K.partnerId=E,K.plan=S,K.serverUrl=T,K.serverZone=k,K.sessionTimeout=P,K.storageProvider=O,K.trackingOptions=x,K.transport=C,K.useBatch=R,K.fetchRemoteConfig=D,K.networkTrackingOptions=j,K.identify=U,K.enableDiagnostics=F,K.diagnosticsSampleRate=q,K.diagnosticsClient=B,K.remoteConfig=H,K.topLevelDomain=z,K.enableRequestBodyCompression=V,K.customEnrichment=W,K.version=tl,K._optOut=!1,K._cookieStorage=n,K.deviceId=s,K.lastEventId=g,K.lastEventTime=v,K.optOut=w,K.deferredSessionId=I,K.sessionId=A,K.pageCounter=N,K.userId=L,K.debugLogsEnabled=M,K.loggerProvider.enable(M?h.Debug:K.logLevel),K.networkTrackingOptions=j,K.identify=U,K.enableDiagnostics=F,K.diagnosticsSampleRate=q,K.diagnosticsClient=B;
1var $=null!=(J=null==H?void 0:H.fetchRemoteConfig)?J:D;return K.remoteConfig=K.remoteConfig||{},K.remoteConfig.fetchRemoteConfig=$,K.fetchRemoteConfig=$,K.topLevelDomain=z||t1(),K}return(0,C.__extends)(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())},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 tg&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(t_(this.apiKey),e)},t}(ew),t4=function(e,t,r){switch(void 0===e&&(e=tW),void 0===t&&(t={}),e){case"localStorage":return new tw;case"sessionStorage":return new tE;case"none":return new tf;default:return new tg((0,C.__assign)((0,C.__assign)({},t),{expirationDays:t.expiration}),r)}},t5=function(e){var t,r;return void 0===e&&(e={}),(null==(t=e.remoteConfig)?void 0:t.fetchRemoteConfig)===!0||(null==(r=e.remoteConfig)?void 0:r.fetchRemoteConfig)!==!1&&!1!==e.fetchRemoteConfig},t6=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new tA(r):"beacon"===t?new tP:new tI(r)},t8="data-amp-mask",t7="*****",t9=/\b(?:\d[ -]*?){13,16}\b/,re=/(\d{3}-?\d{2}-?\d{4})/g,rt=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,rr=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var r,n,i=e;i=(i=(i=i.replace(t9,t7)).replace(re,t7)).replace(rt,t7);try{for(var o=(0,C.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,t7)}catch(e){}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},rn=function(e){if("u"<typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(t8)?t7:e?e(document.title):document.title},ri=function(){function e(){}return e.prototype.parse=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(e){return[2,(0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)({},ee),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=eN();
1return{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,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!=(t=null==(e=r.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=eN();return(e={})[z]=t[z],e[V]=t[V],e[W]=t[W],e[J]=t[J],e[K]=t[K],e[$]=t[$],e[G]=t[G],e[Y]=t[Y],e[X]=t[X],e[Q]=t[Q],e[Z]=t[Z],e},e}(),ro=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},ra="AMP_PAGE_VIEW",rs=function(e){void 0===e&&(e={});var t,r,n,i=eu(),o=void 0,a=!1,s=e.trackOn,u=e.trackHistoryChanges,l=e.eventType,c=void 0===l?"[Amplitude] Page Viewed":l,d=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==o||o.error("Malformed URI sequence: ",e)}return t},f=function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var t,r,n;return(0,C.__generator)(this,function(i){switch(i.label){case 0:return t=d("u">typeof location&&location.href||""),n={event_type:c},r=[{}],[4,ru()];case 1:return[2,(n.event_properties=C.__assign.apply(void 0,[C.__assign.apply(void 0,r.concat([i.sent()])),{"[Amplitude] Page Domain":"u">typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"u">typeof location&&d(location.pathname)||"","[Amplitude] Page Title":rn(rr),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),n)]}})})},p=function(){return void 0===s||"function"==typeof s&&s()},g="u">typeof location?location.href:null,h=function(){(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,r,i,a,s;return(0,C.__generator)(this,function(l){switch(l.label){case 0:if(r=rc(u,e=location.href,g||"")&&p(),g=e,!r)return[3,4];if(i=void 0,n&&(i=ec(),n.set(ra,{pageViewId:i})),null==o||o.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return s=(a=t).track,[4,f(i)];case 2:s.apply(a,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var u,l,c;return(0,C.__generator)(this,function(d){switch(d.label){case 0:if(t=s,r=e,(o=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,i){try{n=new tb(i.sessionStorage)}catch(e){null==o||o.debug("sessionStorage is not available in this environment.")}i.addEventListener("popstate",h),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,r){var n=(0,C.__read)(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),a&&h()}})}if(!p())return[3,2];return o.log("Tracking page view event"),u=void 0,n&&(u=ec(),n.set(ra,{pageViewId:u})),c=(l=t).track,[4,f(u)];case 1:c.apply(l,[d.sent()]),d.label=2;case 2:return[2]}})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var t,i,a;return(0,C.__generator)(this,function(u){switch(u.label){case 0:if(!("attribution"===s&&rl(e)))return[3,4];if(null==o||o.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,!n)return[3,2];return[4,n.get(ra)];case 1:t=null==(i=u.sent())?void 0:i.pageViewId,u.label=2;case 2:return[4,f(t)];case 3:e.event_type=(a=u.sent()).event_type,e.event_properties=(0,C.__assign)((0,C.__assign)({},e.event_properties),a.event_properties),u.label=4;case 4:return r&&e.event_type===c&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=(0,C.__assign)((0,C.__assign)({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(e){return i&&(i.removeEventListener("popstate",h),a=!1),[2]})})}}},ru=function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,C.__generator)(this,function(t){switch(t.label){case 0:return e=ro,[4,new ri().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},rl=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[v.SET]||{},n=t[v.UNSET]||{},i=(0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(Object.keys(r)),!1),(0,C.__read)(Object.keys(n)),!1);return Object.keys(ee).every(function(e){return i.includes(e)})}return!1},rc=function(e,t,r){if("pathOnly"!==e)return t!==r;if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname},rd=function(){var e,t,r=[],n=function(e,t,n){e.addEventListener(t,n),r.push({element:e,type:t,handler:n})},i=function(){r.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),r=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(r,i){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var o,a;return(0,C.__generator)(this,function(s){return t=to(r),o=function(){if(!i)return void r.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");if("u">typeof document){var o=new WeakSet,a=function(e){if(!o.has(e)){o.add(e);var a=!1;n(e,"change",function(){var t,r=rp(e);a||i.track(tR,((t={})[tH]=rf(e.id),t[tz]=rf(e.name),t[tV]=r,t)),a=!0}),n(e,"submit",function(n){var o,s,u=rp(e);if(a||i.track(tR,((o={})[tH]=rf(e.id),o[tz]=rf(e.name),o[tV]=u,o)),a=!0,(null==t?void 0:t.shouldTrackSubmit)!==void 0)if("function"==typeof t.shouldTrackSubmit&&"u">typeof SubmitEvent&&n instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(n))return}catch(e){r.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else r.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(tD,((s={})[tH]=rf(e.id),s[tz]=rf(e.name),s[tV]=u,s)),a=!1})}};
1Array.from(document.getElementsByTagName("form")).forEach(a),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&a(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(a)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?o():(a=eu())?a.addEventListener("load",o):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return null==e||e.disconnect(),i(),[2]})})}}},rf=function(e){if("string"==typeof e)return e},rp=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},rg=function(){var e,t=[],r=function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})},n=function(){t.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,n){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var i,o;return(0,C.__generator)(this,function(a){return i=function(){if(!n)return void t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");if("u">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),a=null==i?void 0:i[1];a&&r(e,"click",function(){var r;a&&n.track(tL,((r={})[tj]=a,r[tU]=t.pathname,r[tF]=e.id,r[tq]=e.text,r[tB]=e.href,r))})},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),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=eu())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return null==e||e.disconnect(),n(),[2]})})}}},rh=!1,rv=function(e){rh||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."),rh=!0)},rm=function(){var e=eu(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))},n=function(){t.forEach(function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(n){return"u"<typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(e.offline=!navigator.onLine,r("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),r("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(e){return n(),[2]})})}}};function ry(e,t,r){var n,i,o=[];try{for(var a=(0,C.__values)(null!=t?t:[]),s=a.next();!s.done;s=a.next()){var u=s.value;try{o.push(new RegExp(u))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(u),e)}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return e.concat(o)}var r_=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],rb="data-amp-track-",rw=["div","span","h1","h2","h3","h4","h5","h6"],rE="https://app.amplitude.com",rS={
1US:rE,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},rT="__AMPLITUDE_MESSENGER_INSTANCE__",rk="__AMPLITUDE_MESSENGER__",rA=function(){function e(e){var t=(void 0===e?{}:e).origin;this[w]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=void 0===t?rE:t}return e.prototype.notify=function(e){var t,r,n,i;null==(r=null==(t=this.logger)?void 0:t.debug)||r.call(t,"Message sent: ",JSON.stringify(e)),null==(i=null==(n=window.opener)?void 0:n.postMessage)||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,a){n.requestCallbacks[i]={resolve:t,reject:a},n.notify(o),r.timeout>0&&setTimeout(function(){a(Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]},r.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null==(t=this.logger)||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.registerActionHandler=function(e,t){this.actionHandlers.has(e)&&(null==(o=null==(i=this.logger)?void 0:i.warn)||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var r,n,i,o,a=this.pendingMessages.get(e);if(a){this.pendingMessages.delete(e);try{for(var s=(0,C.__values)(a),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return(0,C.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,C.__generator)(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=(document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null==(n=document.head)||n.appendChild(i)}catch(e){r(e)}})).then(function(){}),this.scriptLoadPromises.set(e,r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r];case 2:return i.sent(),[3,4];case 3:throw n=i.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,i=void 0===e?{}:e,o=i.logger,a=i.endpoint;o&&(this.logger=o),a&&this.endpoint===rE&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null==(r=null==(t=this.logger)?void 0:t.debug)||r.call(t,"Setting up messenger"),this.messageHandler=function(e){if(null==(r=null==(t=n.logger)?void 0:t.debug)||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var t,r,i,o,a,s=e.data,u=null==s?void 0:s.action;if(u)if("id"in s&&s.id)null==(o=null==(i=n.logger)?void 0:i.debug)||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(s);else{if("ping"===u)return void n.notify({action:"pong"});var l=n.actionHandlers.get(u);if(l)l(s.data);else{var c=null!=(a=n.pendingMessages.get(u))?a:[];c.push(s.data),n.pendingMessages.set(u,c)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=eu();(null==e?void 0:e[rk])===this&&delete e[rk]},e}();w=rT;var rI="__AMPLITUDE_BACKGROUND_CAPTURE__",rP=e.i(79815);function rO(e,t){return new rP.default(function(r){e.subscribe({next:function(e){t(e).then(function(e){return r.next(e)}).catch(function(e){return r.error(e)})},error:function(e){r.error(e)},complete:function(){r.complete()}})})}function rx(e,t){return new rP.default(function(r){var n=!1,i=new Set,o=function(){var e,t;n=!0;try{for(var r=(0,C.__values)(i),o=r.next();!o.done;o=r.next()){var a=o.value;try{a.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.clear()},a=function(e){var t=e.subscribe({next:function(e){n||r.next(e)},error:function(e){n||(n=!0,r.error(e),o())},complete:function(){i.delete(t),n||0!==i.size||(r.complete(),o(),n=!0)}});i.add(t)};return a(e),a(t),o})}function rC(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new rP.default(function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){try{for(var r,n,i,o=(0,C.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;null==(i=s.next)||i.call(s,e)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},error:function(e){try{for(var r,i,o,a=(0,C.__values)(t),s=a.next();!s.done;s=a.next()){var u=s.value;null==(o=u.error)||o.call(u,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}n()},complete:function(){try{for(var e,r,i,o=(0,C.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;null==(i=s.complete)||i.call(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}n()}})),function(){t.delete(i),0===t.size&&r&&(r.unsubscribe(),r=null)}})}var rR="1.27.2",rD="[Amplitude] Element Clicked",rL="[Amplitude] Element Tag",rN="[Amplitude] Element Text",rM="[Amplitude] Page URL",rj="[Amplitude] Viewport Height",rU="[Amplitude] Viewport Width",rF="[Amplitude] Page View ID",rq="data-amp-mask-attributes",rB=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},rH=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},rz=["input","select","textarea"],rV=function(e,t){var r,n=null==(r=null==window?void 0:window.getComputedStyle)?void 0:r.call(window,e);return(null==n?void 0:n.getPropertyValue("cursor"))==="pointer"&&"click"===t},rW=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&rB(window.location.href,r))&&!!rB(window.location.href,t)},rJ=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var o,a,s=e.shouldTrackEventResolver,u=null==(a=null==(o=null==i?void 0:i.tagName)?void 0:o.toLowerCase)?void 0:a.call(o);if(!u)return!1;if(s)return s(n,i);if(!rW(e))return!1;var l=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof l)switch(l.toLowerCase()){case"hidden":case"password":return!1}var c=rV(i,n);if(r&&c)return!0;
1if(t&&!t.some(function(e){var t;return!!(null==(t=null==i?void 0:i.matches)?void 0:t.call(i,e))}))return!1;switch(u){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:if(c)return!0;return"click"===n}}},rK=function(e){var t,r,n,i=null==(r=null==(t=null==e?void 0:e.tagName)?void 0:t.toLowerCase)?void 0:r.call(t),o=e instanceof HTMLElement&&(null==(n=e.getAttribute("contenteditable"))?void 0:n.toLowerCase())==="true";return!rz.includes(i)&&!o},r$=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return null!=n&&("object"!=typeof n||0!==Object.keys(n).length)&&("string"!=typeof n||0!==n.trim().length)&&(t[r]=n),t},{})},rG=function(){var e;try{var t=eu(),r=null==(e=null==t?void 0:t.sessionStorage)?void 0:e.getItem("AMP_PAGE_VIEW");if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},rY=function(e,t){return e?t.some(function(t){var r;return null==(r=null==e?void 0:e.matches)?void 0:r.call(e,t)})?e:rY(null==e?void 0:e.parentElement,t):null},rX=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor};(u=E||(E={}))[u.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",u[u.MIDDLE=1]="MIDDLE",u[u.RIGHT=2]="RIGHT";var rQ="__AMPLITUDE_VISUAL_TAGGING__",rZ=rP,r0=eu(),r1=null==r0?void 0:r0.console,r2={},r3={},r4=!1,r5=function(e,t){if(!r1||"function"!=typeof r1[e]||!r3[e]&&(r3[e]=r1[e],r1[e]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if(r2[e]&&!r4){r4=!0;var n=r2[e];n&&n.forEach(function(r){try{r(e,t)}catch(e){}})}}catch(e){}return r4=!1,r3[e].apply(r1,t)},0))return Error("Console override failed");r2[e]?r2[e].push(t):r2[e]=[t]},r6=function(e){var t,r;try{for(var n=(0,C.__values)(Object.values(r2)),i=n.next();!i.done;i=n.next())for(var o=i.value,a=o.length-1;a>=0;a--)if(o[a]===e){o.splice(a,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},r8=eu(),r7=function(){return new rZ.default(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},r9=function(e){return void 0===e&&(e="click"),new rZ.default(function(t){var r,n=function(e){t.next(e)};return null==(r=eu())||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null==(t=eu())||t.document.removeEventListener(e,n,{capture:!0})}})},ne=function(){var e=rx(new rZ.default(function(e){var t=function(t){if(t instanceof ErrorEvent){var r={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?r=(0,C.__assign)((0,C.__assign)({},r),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(r.message=t.error),e.next(r)}};return r8.addEventListener("error",t),function(){r8.removeEventListener("error",t)}}),new rZ.default(function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return r8.addEventListener("unhandledrejection",t),function(){r8.removeEventListener("unhandledrejection",t)}}));return rx(e,new rZ.default(function(e){var t=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(i=r[0][0]),e.next({kind:"console",message:i})};return r5("error",t),function(){r6(t)}}))},nt=function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){console.error("Error matching event to filter",e)}return!1},nr=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;if(e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector)return r.querySelector(e.selector);return r}}catch(e){}},nn=function(e,t,r){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}})},ni={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},no=function(e){var t,r,n,i,o=Object.values(ni).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var a=(0,C.__values)(e),s=a.next();!s.done;s=a.next()){var u=s.value;try{try{for(var l=(n=void 0,(0,C.__values)(u.definition)),c=l.next();!c.done;c=l.next()){var d=ni[c.value.event_type];d&&o[d].add(u.id)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==u?void 0:u.id,e)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},na=function(e){var t,r,n,i,o=new Map;try{for(var a=(0,C.__values)(e),s=a.next();!s.done;s=a.next()){var u=s.value;try{for(var l=(n=void 0,(0,C.__values)(u.conditions)),c=l.next();!c.done;c=l.next()){var d=c.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(u)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},ns=function(e,t){var r,n,i,o,a=new Set;try{for(var s=(0,C.__values)(e),u=s.next();!u.done;u=s.next()){var l=u.value,c=t.get(l.id);if(c)try{for(var d=(i=void 0,(0,C.__values)(c)),f=d.next();!f.done;f=d.next()){var p=f.value;a.add(p)}}catch(e){i={error:e}}
1finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(a)},nu=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var i=ns(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return n.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return ni[t.event_type]===e.type&&t.filters.every(function(t){return nt(e,t)})})}),this.labeledEventToTriggerMap);try{for(var o=(0,C.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value;nn(s.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}(),nl=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",rq,t8]),nc=["type"],nd=["svg","path","g"],nf=["password","hidden"],np=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),ng=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=nh(n,!!t,n===e);if(!i||(r.push(i),i.optimized))break;n=n.parentElement}return r.reverse(),r.join(" > ")},nh=function(e,t,r){if(e.nodeType!==Node.ELEMENT_NODE)return null;var n,i,o=e.getAttribute("id");if(t){if(o)return new np(c(o),!0);var a=e.tagName.toLowerCase();if("body"===a||"head"===a||"html"===a)return new np(a,!0)}var s=e.tagName.toLowerCase();if(o)return new np(s+c(o),!0);var u=e.parentNode;if(!u||u.nodeType===Node.DOCUMENT_NODE)return new np(s,!0);function l(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]}function c(e){return"#"+CSS.escape(e)}for(var d=l(e),f=!1,p=!1,g=-1,h=-1,v=u.children,m=0;v&&(-1===g||!p)&&m<v.length;++m){var y=v[m];if(y.nodeType===Node.ELEMENT_NODE){if(h+=1,y===e){g=h;continue}if(!p&&y.tagName.toLowerCase()===s){f=!0;var _=new Set(d);if(!_.size){p=!0;continue}for(var b=l(y),w=0;w<b.length;++w){var E=b[w];if(_.has(E)&&(_.delete(E),!_.size)){p=!0;break}}}}}var S=s;if(r&&"input"===s.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(S+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),p)S+=":nth-child("+String(g+1)+")";else if(f)try{for(var T=(0,C.__values)(d),k=T.next();!k.done;k=T.next()){var A=k.value;S+="."+CSS.escape(A.slice(1))}}catch(e){n={error:e}}finally{try{k&&!k.done&&(i=T.return)&&i.call(T)}finally{if(n)throw n.error}}return new np(S,!1)},nv=function(e,t){var r,n,i,o=this;this.replaceSensitiveString=function(e){return rr(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,i,a=performance.now(),s=[];if(!e)return[];for(var u=function(e){var t=[];if(!e)return t;
1t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e),l=new Map,c=u.length-1;c>=0;c--){var d=u[c];if(d){var f,p=(f=d.getAttribute(rq))?f.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],g=c===u.length-1?[]:null!=(n=l.get(u[c+1]))?n:new Set,h=new Set((0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(g),!1),(0,C.__read)(p),!1));l.set(d,h)}}s=u.map(function(e){var t;return function(e,t){if(null===e)return null;var r,n,i,o,a,s,u=String(e.tagName).toLowerCase(),l={tag:u},c=Array.from(null!=(o=null==(i=e.parentElement)?void 0:i.children)?o:[]);c.length&&(l.index=c.indexOf(e),l.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null==(s=null==(a=e.previousElementSibling)?void 0:a.tagName)?void 0:s.toLowerCase();d&&(l.prevSib=String(d));var f=e.getAttribute("id");f&&(l.id=String(f));var p=Array.from(e.classList);p.length&&(l.classes=p);var g={},h=Array.from(e.attributes).filter(function(e){return!nl.has(e.name)}),v=!rK(e);if(!nf.includes(String(e.getAttribute("type")))&&!nd.includes(u))try{for(var m=(0,C.__values)(h),y=m.next();!y.done;y=m.next()){var _=y.value;if(!v||nc.includes(_.name)){if(t.has(_.name)){g[_.name]=t7;continue}g[_.name]=String(_.value).substring(0,128)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}return Object.keys(g).length&&(l.attrs=g),l}(e,null!=(t=l.get(e))?t:new Set)});var v=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=(0,C.__read)(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))})};try{for(var m=(0,C.__values)(s),y=m.next();!y.done;y=m.next()){var _=y.value;v(_)}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(t)throw t.error}}var b=performance.now();return null==(i=o.diagnosticsClient)||i.recordHistogram("autocapturePlugin.getHierarchy",b-a),s},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(r)},this.getElementPath=function(e){if(!e)return"";var t,r=performance.now(),n=ng(e),i=performance.now();return null==(t=o.diagnosticsClient)||t.recordHistogram("autocapturePlugin.getElementPath",i-r),n},this.getEventProperties=function(e,t,r){var n,i,a,s,u=null==(a=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:a.call(i),l="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},c=o.getHierarchy(t),d=null==(s=c[0])?void 0:s.attrs,f=o.getNearestLabel(t),p=Object.entries(null!=d?d:{}).reduce(function(e,t){var n=(0,C.__read)(t,2),i=n[0],o=n[1];if(i.startsWith(r)){var a=i.replace(r,"");a&&(e[a]=o||"")}return e},{}),g=((n={})["[Amplitude] Element Hierarchy"]=c,n[rL]=u,n[rN]=o.getText(t),n["[Amplitude] Element Position Left"]=null==l.left?null:Math.round(l.left),n["[Amplitude] Element Position Top"]=null==l.top?null:Math.round(l.top),n["[Amplitude] Element Attributes"]=p,n["[Amplitude] Element Path"]=o.getElementPath(t),n["[Amplitude] Element Parent Label"]=f,n[rM]=rH(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=rn(o.replaceSensitiveString),n[rj]=window.innerHeight,n[rU]=window.innerWidth,n),h=rG();if(h&&(g[rF]=h),g["[Amplitude] Element ID"]=t.getAttribute("id")||"",g["[Amplitude] Element Class"]=t.getAttribute("class"),g["[Amplitude] Element Aria Label"]=null==d?void 0:d["aria-label"],"a"===u&&"click"===e&&t instanceof HTMLAnchorElement){var v=t.href.substring(0,128);g["[Amplitude] Element Href"]=o.replaceSensitiveString(v)}return r$(g)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var a=o.addTypeAndTimestamp(e,t);if(("click"===a.type||"change"===a.type)&&null!==a.event.target){if(i&&rV(a.event.target,a.type))return a.closestTrackedAncestor=a.event.target,a.targetElementProperties=o.getEventProperties(a.type,a.closestTrackedAncestor,n),a;var s=rY(a.event.target,r);s&&(a.closestTrackedAncestor=s,a.targetElementProperties=o.getEventProperties(a.type,s,n))}return a},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=nr(e,t);if(r){if("TEXT"===e.elementExtractType)return o.getText(r);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return r.getAttribute(e.attribute)}}},this.getTextWithMaskedDescendants=function(e){var t,r,n="[".concat(t8,"], [contenteditable]");if(!e.querySelector(n))return e.innerText;var i="",a=Array.from(e.childNodes);try{for(var s=(0,C.__values)(a),u=s.next();!u.done;u=s.next()){var l=u.value;if(l.nodeType===Node.TEXT_NODE){i+=l.textContent||"";continue}if(l instanceof Element){if(l.hasAttribute(t8)||l.hasAttribute("contenteditable")){i+=t7;continue}i+=o.getTextWithMaskedDescendants(l)}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(t8,"]")))return t7;var t="";return t=e.querySelector("[".concat(t8,"], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveStr
1ing(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){if(!e)return{};var t,r,n,i=null==(n=null==(r=null==e?void 0:e.tagName)?void 0:r.toLowerCase)?void 0:n.call(r);return r$(((t={})[rL]=i,t[rN]=o.getText(e),t[rM]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var a=null!=(i=e.maskTextRegex)?i:[],s=[];try{for(var u=(0,C.__values)(a),l=u.next();!l.done;l=u.next()){var c=l.value;if(s.length>=25)break;if(c instanceof RegExp)s.push(c);else if("pattern"in c&&"string"==typeof c.pattern)try{s.push(RegExp(c.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=s},rZ=rP;(l=S||(S={})).ClickObservable="clickObservable",l.ChangeObservable="changeObservable",l.NavigateObservable="navigateObservable",l.MutationObservable="mutationObservable",l.ScrollObservable="scrollObservable",l.ExposureObservable="exposureObservable",l.BrowserErrorObservable="browserErrorObservable",l.SelectionObservable="selectionObservable",l.MouseMoveObservable="mouseMoveObservable";var nm=function(e,t){void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",rR);var r,n,i,o,a,s,u,l,c,d,f,p,g,h=e.dataAttributePrefix,v=void 0===h?rb:h,m=e.visualTaggingOptions,y=void 0===m?{enabled:!0}:m;e.cssSelectorAllowlist=null!=(r=e.cssSelectorAllowlist)?r:r_,e.actionClickAllowlist=null!=(n=e.actionClickAllowlist)?n:rw,e.debounceTime=null!=(i=e.debounceTime)?i:0;var _=(null==(o=e.viewportContentUpdated)?void 0:o.enabled)!==!1,b=null!=(u=null!=(s=null==(a=e.viewportContentUpdated)?void 0:a.exposureDuration)?s:e.exposureDuration)?u:150;e.viewportContentUpdated=(0,C.__assign)((0,C.__assign)({},e.viewportContentUpdated),{exposureDuration:b}),e.pageUrlExcludelist=null==(l=e.pageUrlExcludelist)?void 0:l.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(e){console.warn("Invalid regex pattern: ".concat(t.pattern),e)}return e},[]);var w="@amplitude/plugin-autocapture-browser",E=[],T=new nv(e,t),k=new Set,A=new Set,I=function(){var t,r,n,i=rC(r9().map(function(t){return T.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,v)})),o=rC(new rZ.default(function(t){var r,n=function(r){var n=T.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,v);t.next(n)};return null==(r=eu())||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null==(e=eu())?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(n=rC(new rZ.default(function(t){var r=function(r){var n=T.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,v);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var a=rC(r7().map(function(t){return T.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,v)})),s=new rZ.default(function(e){var t,r=function(t){e.next(t)};return null==(t=eu())||t.addEventListener("scroll",r),function(){var e;null==(e=eu())||e.removeEventListener("scroll",r)}}),u=(t=e.cssSelectorAllowlist,new rZ.default(function(e){var r,n=eu();if(!(null==n?void 0:n.IntersectionObserver))return function(){};var i=new IntersectionObserver(function(t){t.forEach(function(t){e.next(t)})},{root:null,rootMargin:"0px",threshold:1}),o=t.join(",");(null!=(r=null==n?void 0:n.document.querySelectorAll(o))?r:[]).forEach(function(e){i.observe(e)});var s=a.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(o)&&i.observe(e),e.querySelectorAll(o).forEach(function(e){i.observe(e)}))})})});return function(){s.unsubscribe(),i.disconnect()}}));return(r={})[S.ChangeObservable]=o,r[S.ClickObservable]=i,r[S.MutationObservable]=a,r[S.NavigateObservable]=n,r[S.ScrollObservable]=s,r[S.ExposureObservable]=u,r},P=no(Object.values(null!=(d=null==(c=e.pageActions)?void 0:c.labeledEvents)?d:{})),O=na(null!=(p=null==(f=e.pageActions)?void 0:f.triggers)?p:[]),x=new nu(P,O,T,e),R=function(t){var r,n;t&&(e.pageActions=(0,C.__assign)((0,C.__assign)({},e.pageActions),t),P=no(Object.values(null!=(r=e.pageActions.labeledEvents)?r:{})),O=na(null!=(n=e.pageActions.triggers)?n:[]),x.update(P,O,e))};return{name:w,type:"enrichment",setup:function(t,r){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var n,i,o,a,s,u,l,c,d,f,p,h,m,P,O,D,L,N,M,j,U;return(0,C.__generator)(this,function(F){if("u"<typeof document)return[2];if(n=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(e){R(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),o=rJ(e,e.cssSelectorAllowlist),a=rJ(e,e.actionClickAllowlist),B=(q={allObservables:s=I(),amplitude:r,shouldTrackEvent:o,evaluateTriggers:x.evaluate.bind(x)}).amplitude,H=q.allObservables,z=q.shouldTrackEvent,V=q.evaluateTriggers,u=H.clickObservable.filter(rX).filter(function(e){return z("click",e.closestTrackedAncestor)}).map(function(e){return V(e)}).subscribe(function(e){null==B||B.track(rD,e.targetElementProperties)}),E.push(u),J=(W={allObservables:s,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return T.getEventProperties.apply(T,(0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:o,evaluateTriggers:x.evaluate.bind(x)}).amplitude,K=W.allObservables,$=W.getEventProperties,G=W.shouldTrackEvent,Y=W.evaluateTriggers,l=K.changeObservable.filter(rX).filter(function(e){return G("change",e.closestTrackedAncestor)}).map(function(e){return Y(e)}).subscribe(function(e){null==J||J.track("[Amplitude] Element Changed",$("change",e.closestTrackedAncestor))}),E.push(l),Q=(X={allObservables:s,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return T.getEventProperties.apply(T,(0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:o,shouldTrackActionClick:a}).amplitude,Z=X.allObservables,ee=X.options,et=X.getEventProperties,er=X.shouldTrackEvent,en=X.shouldTrackActionClick,ei=Z.clickObservable,eo=Z.mutationObservable,ea=Z.navigateObservable,es=ei.filter(function(e){return!er("click",e.closestTrackedAncestor)}).map(function(e){var t=rY(e.event.target,ee.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=et(e.type,e.closestTrackedAncestor)),e}).filter(rX).filter(function(e){return en("click",e.closestTrackedAncestor)}),el=ea?rx(eo,ea):eo,ec=rx(es,el),ed=null,ef=null,(c=rO(ec,function(e){if(ed&&(clearTimeout(ed),ed=null),"click"===e.type)ef=e,ed=setTimeout(function(){ed=null,ef=null},500);else if(ef){var t=ef;return ef=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==Q||Q.track(rD,et("click",e.closestTrackedAncestor)))}))&&E.push(c),(ep={allObservables:s,amplitude:r}).amplitude,eg=ep.allObservables.scrollObservable,eh={maxX:0,maxY:0},ev=eg.subscribe(function(){var e,t,r,n,i=eu(),o=Math.floor(null!=(t=null!=(e=null==i?void 0:i.scrollX)?e:null==i?void 0:i.pageXOffset)?t:0),a=Math.floor(null!=(n=null!=(r=null==i?void 0:i.scrollY)?r:null==i?void 0:i.pageYOffset)?
1n:0);eh.maxX=Math.max(eh.maxX,o),eh.maxY=Math.max(eh.maxY,a)}),d={unsubscribe:function(){ev.unsubscribe()},getState:function(){return eh},reset:function(){eh.maxX=0,eh.maxY=0}},E.push(d),f={},p=eu(),h=function(e){e&&n||(setTimeout(function(){n=!1},100),n=!0,function(e){var t,r,n,i,o,a,s=e.amplitude,u=e.scrollTracker,l=e.currentElementExposed,c=e.elementExposedForPage,d=e.exposureTracker,f=e.isPageEnd,p=e.lastScroll,g=u.getState(),h=eu(),v=null!=(r=null==h?void 0:h.innerWidth)?r:0,m=null!=(n=null==h?void 0:h.innerHeight)?n:0,y=((t={})[rM]=rH(null!=(a=null==(o=null==(i=null==h?void 0:h.location)?void 0:i.href)?void 0:o.split("?")[0])?a:""),t["[Amplitude] Max Page X"]=g.maxX+v,t["[Amplitude] Max Page Y"]=g.maxY+m,t[rj]=m,t[rU]=v,t["[Amplitude] Element Exposed"]=Array.from(l),t),_=rG();if(_&&(y[rF]=_),0===l.size&&g.maxX===p.maxX&&g.maxY===p.maxY){f&&(u.reset(),c.clear(),null==d||d.reset());return}null==s||s.track("[Amplitude] Viewport Content Updated",y),p.maxX=g.maxX,p.maxY=g.maxY,l.clear(),f&&(u.reset(),c.clear(),null==d||d.reset())}({amplitude:r,scrollTracker:d,currentElementExposed:A,elementExposedForPage:k,exposureTracker:f.exposure,isPageEnd:e,lastScroll:i}))},m=function(e){!k.has(e)&&(k.add(e),A.add(e),JSON.stringify(Array.from(A)).length>=18e3&&h(!1))},_&&(ey=(em={allObservables:s,onExposure:m,dataExtractor:T,exposureDuration:b}).allObservables,e_=em.onExposure,eb=em.dataExtractor,eE=void 0===(ew=em.exposureDuration)?150:ew,eS=new Map,eT=new Map,ek=ey.exposureObservable.subscribe(function(e){var t=e.target;if(e.isIntersecting){if(!eS.get(t)){var r=setTimeout(function(){eS.set(t,!0),e_(eb.getElementPath(t)),eT.set(t,null)},eE);eT.set(t,r)}}else if(!e.isIntersecting&&e.intersectionRatio<1){var r=eT.get(t);r&&(clearTimeout(r),eT.set(t,null))}}),f.exposure={unsubscribe:function(){ek.unsubscribe()},reset:function(){eT.forEach(function(e){e&&clearTimeout(e)}),eT.clear(),eS.clear()}},f.exposure&&E.push(f.exposure),P=function(){h(!0)},null==p||p.addEventListener("beforeunload",P),g=function(){null==p||p.removeEventListener("beforeunload",P)},E.push({unsubscribe:function(){return g()}}),(O=s[S.NavigateObservable])?E.push(O.subscribe(function(){h(!0)})):p&&(D=function(){h(!0)},p.addEventListener("popstate",D),L=p.history.pushState,p.history&&L&&(p.history.pushState=new Proxy(L,{apply:function(e,t,r){var n=(0,C.__read)(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),h(!0)}})),E.push({unsubscribe:function(){p.removeEventListener("popstate",D),p.history&&L&&(p.history.pushState=L)}}))),null==(U=null==t?void 0:t.loggerProvider)||U.log("".concat(w," has been successfully added.")),window.opener&&y.enabled){var q,B,H,z,V,W,J,K,$,G,Y,X,Q,Z,ee,et,er,en,ei,eo,ea,es,el,ec,ed,ef,ep,eg,eh,ev,em,ey,e_,eb,ew,eE,eS,eT,ek;if(N=e.cssSelectorAllowlist,M=e.actionClickAllowlist,function(e,t){if(!0!==e[rQ]){e[rQ]=!0;var r=t.dataExtractor,n=t.isElementSelectable,i=t.cssSelectorAllowlist,o=t.actionClickAllowlist,a=null,s=function(t){e.notify({action:"element-selected",data:t})},u=function(t,r){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:r}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:r})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var l;a=null==(l=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:l.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!n||n((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:s,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:i,actionClickAllowlist:o,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:rR}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null==(t=e.logger)||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null==(e=null==a?void 0:a.close)||e.call(a)})}}(j=function(){var e=eu(),t=null==e?void 0:e[rk];if("object"==typeof t&&null!==t&&rT in t&&!0===t[rT])return t;var r=new rA(void 0);return e&&(e[rk]=r),r}(),{dataExtractor:T,isElementSelectable:rJ(e,(0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(N),!1),(0,C.__read)(M),!1)),cssSelectorAllowlist:N,actionClickAllowlist:M}),!0!==j[rI]){j[rI]=!0;var eA="https://cdn.amplitude.com/libs/background-capture-1.0.1.js.gz",eI=null,eP=function(e,t){var r,n;"background-capture-complete"===e&&(null==(n=null==(r=j.logger)?void 0:r.debug)||n.call(r,"Backgroun
1d capture complete"),j.notify({action:"background-capture-complete",data:t}))};j.registerActionHandler("initialize-background-capture",function(){null==(t=null==(e=j.logger)?void 0:e.debug)||t.call(e,"Initializing background capture (external script)");var e,t,r=new URL(eA,j.endpoint).toString();j.loadScriptOnce(r).then(function(){var e,t,r;null==(t=null==(e=j.logger)?void 0:e.debug)||t.call(e,"Background capture script loaded (external)"),eI=null==(r=null==window?void 0:window.amplitudeBackgroundCapture)?void 0:r.call(window,{messenger:j,onBackgroundCapture:eP}),j.notify({action:"background-capture-loaded"})}).catch(function(){var e;null==(e=j.logger)||e.warn("Failed to initialize background capture")})}),j.registerActionHandler("close-background-capture",function(){var e;null==(e=null==eI?void 0:eI.close)||e.call(eI),eI=null})}j.setup((0,C.__assign)({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:rS[t.serverZone]}))}return[2]})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n;return(0,C.__generator)(this,function(i){try{for(t=(e=(0,C.__values)(E)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]})})}}},rZ=rP,ny=(0,C.__spreadArray)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,C.__read)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),n_=["*"],nb=["mutation","navigate"];function nw(e,t){var r,n,i,o,a=t.event,s=a.pageX,u=a.pageY;e.yMin=Math.min(null!=(r=e.yMin)?r:u,u),e.yMax=Math.max(null!=(n=e.yMax)?n:u,u),e.xMin=Math.min(null!=(i=e.xMin)?i:s,s),e.xMax=Math.max(null!=(o=e.xMax)?o:s,s),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function nE(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:(0,C.__assign)({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}var rZ=rP;(c=T||(T={})).INCREASING="increasing",c.DECREASING="decreasing",(d=k||(k={})).X="x",d.Y="y";var nS=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new rZ.default(function(e){var r=null,n=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};if(null===r){r=o;return}o.x>r.x?(n===T.DECREASING&&e.next(k.X),n=T.INCREASING):o.x<r.x&&(n===T.INCREASING&&e.next(k.X),n=T.DECREASING),o.y>r.y?(i===T.DECREASING&&e.next(k.Y),i=T.INCREASING):o.y<r.y&&(i===T.INCREASING&&e.next(k.Y),i=T.DECREASING),r=o})})};function nT(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;return!(t.length<r)&&t[t.length-1]-t[0]<n}function nk(e){e.changes=[],e.startTime=void 0}function nA(e){for(var t=e.changes,r=e.thresholdMs,n=0,i=t[t.length-1];n<t.length&&!(i-t[n]<r);n++);0!==n&&(e.startTime=t[n],e.changes.splice(0,n))}var nI=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=void 0===r?20:r,i=e.thresholdMs,o=void 0===i?2e3:i;return new rZ.default(function(e){var r={changes:[],changesThreshold:n,thresholdMs:o},i={changes:[],changesThreshold:n,thresholdMs:o},a=void 0,s=null;function u(){void 0!==a&&(e.next(a),a=void 0,null!==s&&clearTimeout(s),nk(r),nk(i))}return t.subscribe(function(e){null!==s&&clearTimeout(s),t=e===k.X?r:i,n=+Date.now(),t.startTime=t.startTime||n,l=t.changes,c=t.changesThreshold,l.push(n),l.length>c&&l.shift();var t,n,l,c,d=function(e,t){var r=void 0;if(nT(e)&&(r=e.startTime),nT(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}(r,i);return d?(a=a||d,s=setTimeout(function(){u(),s=null},o)):u(),nA(r),nA(i),function(){null!==s&&(clearTimeout(s),s=null)}})})},nP=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,i=e.directionChanges,o=e.thresholdMs;return nI({mouseDirectionChangeObservable:nS({allWindowObservables:n}),directionChanges:void 0===i?20:i,thresholdMs:void 0===o?2e3:o}).subscribe(function(e){rW(r)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function nO(e,t,r,n){if(!n)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var nx=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-frustration-browser",n=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var o=!1!==e.deadClicks&&null!==e.deadClicks,a=!1!==e.rageClicks&&null!==e.rageClicks,s=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(s=!1);var u=nO(e,"rageClicks",n_,a),l=nO(e,"deadClicks",ny,o),c=nO(e,"errorClicks",ny,i),d=null!=(t=e.dataAttributePrefix)?t:rb,f=new nv(e),p=(0,C.__spreadArray)([],(0,C.__read)(new Set((0,C.__spreadArray)((0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(u),!1),(0,C.__read)(l),!1),(0,C.__read)(c),!1))),!1),g=function(){var e,t,r=rC(r9("pointerdown").map(function(e){return f.addAdditionalEventProperties(e,"click",p,d,!0)})),n=rC(ne().map(function(e){return f.addTypeAndTimestamp(e,"error")})),i=rC(r7().map(function(e){return f.addAdditionalEventProperties(e,"mutation",p,d)}));window.navigation&&(t=rC(new rZ.default(function(e){var t=function(t){e.next((0,C.__assign)((0,C.__assign)({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return f.addAdditionalEventProperties(e,"navigate",p,d)})));var o=rC(new rZ.default(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){var r=void 0,n=void 0;try{if(r=t.selectionStart,n=t.selectionEnd,r===n)return}catch(e){return}return e.next()}var i=window.getSelection();if(i&&!i.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),a=rC(new rZ.default(function(e){var t=function(t){e.next(t)},r={capture:!0};return r8.document.addEventListener("mousemove",t,r),function(){r8.document.removeEventListener("mousemove",t,r)}}));return(e={})[S.ClickObservable]=r,e[S.MutationObservable]=i,e[S.NavigateObservable]=t,e[S.BrowserErrorObservable]=n,e[S.SelectionObservable]=o,e[S.MouseMoveObservable]=a,e};return{name:r,type:"enrichment",setup:function(t,p){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var h,v,m,y,_,b,w,S;return(0,C.__generator)(this,function(T){var k,A,I,P,O,x,R,D,L,N,M,j,U,F,q,B,H,z,V,W,J,K;return"u"<typeof document?[2]:(h=g(),a&&(v=function(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,a=n.selectionObservable,s=[],u={},l=null;function c(e){s=[],u={},e&&(nw(u,e),s.push(e))}var d=rO(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return(0,C.__awaiter)(t,void 0,void 0,function(){var t;return(0,C.__generator)(this,function(r){var n,i,o,a;return(nw(u,e),t=null,0===s.length||(n=s).length>0&&n[n.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(o=Math.max(0,(i=s).length-4+1),a=i[o],e.timestamp-a.timestamp>=1e3)||u.isOutOfBounds)?(l&&(t=nE(s)),c(e)):s.push(e),(l&&(clearTimeout(l.timerId),l.resolve(t),l=null),s.length>=4)?[2,new Promise(function(e){l={resolve:e,timerId:setTimeout(function(){e(nE(s))},1e3)}})]:[2,null]})})}),f=null==a?void 0:a.subscribe(function(){c()}),p=d.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){p.unsubscribe(),null==f||f.unsubscribe()}}}({allObservables:h,amplitude:p,shouldTrackRageClick:rJ(e,u)}),n.push(v)),o&&(A=(k={amplitude:p,allObservables:h,getEventProperties:function(e,t){return f.getEventProperties(e,t,d)},shouldTrackDeadClick:rJ(e,l)}).amplitude,I=k.allObservables,P=k.getEventProperties,O=k.shouldTrackDeadClick,x=I.clickObservable,R=I.mutationObservable,D=I.navigateObservable,L=x.filter(function(e){return rX(e)&&O("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===E.LEFT_OR_TOUCH_CONTACT}),N=D?rx(R,D):R,M=rx(L,N),j=null,m=rO(M,function(e){if(j&&nb.includes(e.type))clearTimeout(j),j=null;else if("click"===e.type)return j?Promise.resolve(null):new Promise(function(t){j=setTimeout(function(){t(e),j=null},3e3)});return Promise.resolve(null)}).subscribe(function(e){if(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};A.track("[Amplitude] Dead Click",(0,C.__assign)((0,C.__assign)({},P("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}}),n.push(m)),i&&(F=(U={amplitude:p,allObservables:h,shouldTrackErrorClick:rJ(e,c)}).amplitude,q=U.allObservables,B=U.shouldTrackErrorClick,H=q.clickObservable,z=q.browserErrorObservable,V=H.filter(function(e){return rX(e)&&B("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===E.LEFT_OR_TOUCH_CONTACT}),W=null,J=null,K=function(){null!==W&&(clearTimeout(W),W=null),J=null},y=rx(V,z).subscribe(function(e){var t;if("click"===e.type){K(),J=e,W=setTimeout(K,2e3);return}"error"===e.type&&J&&(F.track("[Amplitude] Error Click",(0,C.__assign)(((t={})["[Amplitude] Kind"]=e.event.kind,t["[Amplitude] Message"]=e.event.message,t["[Amplitude] Stack"]=e.event.stack,t["[Amplitude] Filename"]=e.event.filename,t["[Amplitude] Line Number"]=e.event.lineNumber,t["[Amplitude] Column Number"]=e.event.columnNumber,t),J.targetElementProperties)),K())}),n.push(y)),s&&(_=void 0,b=void 0,"object"==typeof e.thrashedCursor&&(_=e.thrashedCursor.directionChanges,b=e.thrashedCursor.threshold,_&&_<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(_," is below the minimum of ").concat(5,", setting to ").concat(5)),_=5),b&&b>4e3&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(b," is above the maximum of ").concat(4e3,", setting to ").concat(4e3)),b=4e3)),w=nP({amplitude:p,options:e,allObservables:h,directionChanges:_,thresholdMs:b}),n.push(w)),null==(S=null==t?void 0:t.loggerProvider)||S.log("".concat(r," has been successfully added.")),[2])})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,i;return(0,C.__generator)(this,function(o){try{for(t=(e=(0,C.__values)(n)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]})})}}};function nC(e,t){var r=e.startTime+e.duration;return t.filter(function(t){return t.startTime<r&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}var nR=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",r=[],n=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(i,o){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var a,s,u;return(0,C.__generator)(this,function(l){return"u"<typeof document||(n&&(a=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(a=e.mainThreadBlock.durationThreshold),s=function(e){var t=e.amplitude,r=e.options,n=e.durationThreshold,i=void 0===n?100:n,o=function(){if("u"<typeof PerformanceObserver)return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(e){}return null}();if(!o)return{unsubscribe:function(){}};var a=[],s=new PerformanceObserver(function(e){var t,r,n=performance.now();try{for(var i=(0,C.__values)(e.getEntries()),o=i.next();!o.done;o=i.next()){var s=o.value;a.push(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var u=n-1e4;a.length>0&&a[0].startTime<u;)a.shift()});try{s.observe({entryTypes:["measure"]})}catch(e){}var u=new PerformanceObserver(function(e){var n,s;try{for(var u=(0,C.__values)(e.getEntries()),l=u.next();!l.done;l=u.next()){var c=l.value;if(!rW(r))return;if(!(c.duration<i)){var d="long-animation-frame"===o?function(e,t){var r,n=nC(e,t),i=null!=(r=e.scripts)?r:[],o=i.map(function(e){return e.sourceURL}
1).filter(Boolean),a=i.map(function(e){return e.sourceFunctionName}).filter(Boolean),s=i.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),u=i.map(function(e){return e.invokerType}).filter(Boolean),l=i.map(function(e){return e.invoker}).filter(Boolean);return(0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)((0,C.__assign)({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},n.length>0&&{"[Amplitude] Main Thread Block Measures":n}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":i.length}),o.length>0&&{"[Amplitude] Main Thread Block Script URLs":o}),a.length>0&&{"[Amplitude] Main Thread Block Script Functions":a}),s.length>0&&{"[Amplitude] Main Thread Block Script Positions":s}),u.length>0&&{"[Amplitude] Main Thread Block Invoker Types":u}),l.length>0&&{"[Amplitude] Main Thread Block Invokers":l})}(c,a):function(e,t){var r,n=nC(e,t),i=null!=(r=e.attribution)?r:[];return(0,C.__assign)((0,C.__assign)({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},n.length>0&&{"[Amplitude] Main Thread Block Measures":n}),i.length>0&&{"[Amplitude] Main Thread Block Attribution":i.map(function(e){return e.name})})}(c,a);t.track("[Amplitude] Main Thread Block",d)}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}});try{u.observe({entryTypes:[o]})}catch(e){return s.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){u.disconnect(),s.disconnect()}}}({amplitude:o,options:e,durationThreshold:a}),r.push(s)),null==(u=null==i?void 0:i.loggerProvider)||u.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,i;return(0,C.__generator)(this,function(o){try{for(t=(e=(0,C.__values)(r)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};function nD(e,t,r){e&&function e(t){var r,n,i=t.json,o=t.targetObject,a=t.allowlist,s=t.excludelist,u=t.ancestors,l=t.parentObject,c=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var f=(0,C.__values)(d),p=f.next();!p.done;p=f.next()){var g,h=p.value,v=(0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(u),!1),[h],!1);(g=o[h],"string"==typeof g||"number"==typeof g||"boolean"==typeof g||null==g)?(!nN(v,a)||nN(v,s))&&delete o[h]:e({json:i,targetObject:o[h],allowlist:a,excludelist:s,ancestors:v,parentObject:o,targetKey:h})}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}0===Object.keys(o).length&&l&&c&&delete l[c]}({json:e,allowlist:t.map(nL),excludelist:r.map(nL),ancestors:[]})}function nL(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function nN(e,t){return t.some(function(t){return function e(t,r,n,i){if(void 0===n&&(n=0),void 0===i&&(i=0),i===r.length)return n===t.length;if(n===t.length){for(;i<r.length&&"**"===r[i];)i++;return i===r.length}var o=r[i];if("**"===o){if(i+1===r.length)return!0;for(var a=n;a<=t.length;a++)if(e(t,r,a,i+1))return!0;return!1}return("*"===o||o===t[n])&&e(t,r,n+1,i+1)}(e,t)})}var nM=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,r,n=this.request.headers,i={};if(Array.isArray(n))n.forEach(function(e){var t=(0,C.__read)(e,2),r=t[0],n=t[1];i[r]=n});else if(n instanceof Headers)n.forEach(function(e,t){i[t]=e});else if("object"==typeof n&&null!==n)try{for(var o=(0,C.__values)(Object.entries(n)),a=o.next();!a.done;a=o.next()){var s=(0,C.__read)(a.value,2),u=s[0],l=s[1];i[u]=l}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return nz(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=eu();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=nU(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=[]),(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(r){return 0===e.length?[2,null]:[2,nB(this.body,e,t)]})})},e}(),nj=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),nz(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return nU(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=[]),(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(r){return 0===e.length?[2,null]:[2,nB(this.body,e,t)]})})},e}();function nU(e,t){var r,n,i,o,a=eu(),s=null==a?void 0:a.TextEncoder;if(s){if("string"==typeof e)o=e,i=new s().encode(o).length;else if(e instanceof Blob)i=(o=e).size;else if(e instanceof URLSearchParams)o=e,i=new s().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,l=0;try{for(var c=(0,C.__values)(e.entries()),d=c.next();!d.done;d=c.next()){var f=(0,C.__read)(d.value,2),p=f[0],g=f[1];if(u+=p.length,"string"==typeof g)u+=new s().encode(g).length;else{if(!(g instanceof Blob))return;u+=g.size}if(++l>=t)return}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}i=u}else if(e instanceof ReadableStream){o=e;return}return i}}var nF=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 r=this.response.headers,n={};return null==(t=null==r?void 0:r.forEach)||t.call(r,function(e,t){n[t]=e}),nz(n,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,r=null==(t=null==(e=this.response.headers)?void 0:e.get)?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(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=[]),(0,C.__awaiter)(this,void 0,void 0,function(){return(0,C.__generator)(this,function(r){switch(r.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,nB(r.sent(),e,t)]}})})},e}(),nq=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}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,r,n={},i=this.headersString.split("\r\n");try{for(var o=(0,C.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=(0,C.__read)(s.split(": "),2),l=u[0],c=u[1];l&&c&&(n[l]=c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return nz(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,C.__awaiter)(this,void 0,void 0,function(){var r;return(0,C.__generator)(this,function(n){return 0===e.length?[2,null]:(r=this.getJson())?(nD(r,e,t),[2,r]):[2,null]})})},e}();function nB(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return nD(n,t,r),n}catch(e){return null}}(f=A||(A={})).REDACT="redact",f.REMOVE="remove";var nH="[REDACTED]",nz=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,a=t.strategy,s=void 0===a?A.REMOVE:a,u=(0,C.__spreadArray)([],(0,C.__read)(er),!1),l={};try{for(var c=(0,C.__values)(Object.keys(e)),d=c.next();!d.done;d=c.next()){var f=d.value;!function(t){var r=t.toLowerCase();u.find(function(e){return e.toLowerCase()===r})?s===A.REDACT&&(l[t]=nH):o.find(function(e){return e.toLowerCase()===r})?l[t]=e[t]:s===A.REDACT&&(l[t]=nH)}(f)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return l},nV=function(){function e(e,t,r,n,i,o,a,s,u,l,c){void 0===a&&(a=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=o,this.status=a,this.duration=s,this.responseWrapper=u,this.error=l,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,r,n;
1return 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.headers((0,C.__spreadArray)([],(0,C.__read)(et),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(r=this.responseWrapper)?void 0:r.headers((0,C.__spreadArray)([],(0,C.__read)(et),!1)),responseBodySize:null==(n=this.responseWrapper)?void 0:n.bodySize}).filter(function(e){var t=(0,C.__read)(e,2);return void 0!==(t[0],t[1])}))},e}(),nW=function(e,t){void 0===t&&(t=ec()),this.callback=e,this.id=t};function nJ(e){try{e()}catch(e){}}var nK=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=eu();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=eu();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,a,s,u,l,c,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null==(i=null==(n=null==(r=this.globalScope)?void 0:r.XMLHttpRequest)?void 0:n.prototype)?void 0:i.open,p=null==(s=null==(a=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:a.prototype)?void 0:s.send,g=null==(c=null==(l=null==(u=this.globalScope)?void 0:u.XMLHttpRequest)?void 0:l.prototype)?void 0:c.setRequestHeader;f&&p&&g&&this.observeXhr(f,p,g);var h=null==(d=this.globalScope)?void 0:d.fetch;h&&this.observeFetch(h),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(r){try{r.callback(e)}catch(e){nJ(function(){var r;null==(r=t.logger)||r.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,i,o,a){if(void 0!==o&&void 0!==a){var s,u,l,c,d="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(u=t.url,d=t.method):u=null==(s=null==t?void 0:t.toString)?void 0:s.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==r?void 0:r.method)||d,n&&(l=n.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},l=0);var p=Math.floor(performance.now()-a),g=Math.floor(o+p),h=new nV(e,d,o,o,u,r,l,p,n,c,g);this.triggerEventCallbacks(h)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null==(e=Date.now)?void 0:e.call(Date),durationStart:null==(t=null==performance?void 0:performance.now)?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(r,n){return(0,C.__awaiter)(t,void 0,void 0,function(){var t,i,o,a=this;return(0,C.__generator)(this,function(s){switch(s.label){case 0:try{t=this.getTimestamps()}catch(e){nJ(function(){var t;return null==(t=a.logger)?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=s.sent(),[3,4];case 3:return o=s.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new nM(n):void 0,i?new nF(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){nJ(function(){var t;return null==(t=a.logger)?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 r;try{if("json"===e.responseType){if(null==(r=t.globalScope)?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){r instanceof Error&&"InvalidStateError"===r.name&&nJ(function(){var r;return null==(r=t.logger)?void 0:r.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})}return null}},e.prototype.observeXhr=function(t,r,n){if(this.globalScope&&t&&r){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=(0,C.__read)(r,2),a=i[0],s=i[1];try{this.$$AmplitudeAnalyticsEvent=(0,C.__assign)({method:a,url:null==(e=null==s?void 0:s.toString)?void 0:e.call(s),headers:{}},o.getTimestamps())}catch(e){nJ(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return t.apply(this,r)},i.send=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=this,a=e.createXhrJsonParser(this,o),s=t[0],u=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),r=new nq(i.status,e,t?parseInt(t,10):void 0,a),n=i.$$AmplitudeAnalyticsEvent.headers,l=new nj(s,n);u.status=i.status,o.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},l,r,void 0,u.startTime,u.durationStart)}catch(e){nJ(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),r.apply(i,t)},i.setRequestHeader=function(e,t){try{var r=this.$$AmplitudeAnalyticsEvent;r&&(r.headers[e]=t)}catch(e){nJ(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}n.apply(this,[e,t])}}},e}()),n$="[Amplitude] Network Request",rZ=rP,nG="500-599";function nY(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function nX(e,t){var r,n,i=t.split(",");try{for(var o=(0,C.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=(0,C.__read)(s.split("-").map(Number),2),l=u[0],c=u[1];if(e===l&&void 0===c||e>=l&&e<=c)return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function nQ(e){var t;if(e)try{var r=null==(t=eu())?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),a=n.href,s=n.host;n.hash="",n.search="";var u=n.href;return{query:i,fragment:o,href:a,hrefWithoutQueryOrHash:u,host:s}}catch(e){return}}function nZ(e){return"object"!=typeof e||null===e?e?(0,C.__spreadArray)([],(0,C.__read)(et),!1):void 0:0!==e.length?e:void 0}function n0(e){var t,r,n;return!(null==(t=null==e?void 0:e.allowlist)?void 0:t.length)&&!(null==(r=null==e?void 0:e.blocklist)?void 0:r.length)&&!(null==(n=null==e?void 0:e.excludelist)?void 0:n.length)}(I||(I={})).NetworkObservable="networkObservable";var n1=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new rZ.default(function(e){var r=new nW(function(t){var r={event:t,timestamp:Date.now(),type:"network"};e.next(r)});return nK.subscribe(r,t),function(){nK.unsubscribe(r)}});return(e={})[I.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,o){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var a;return(0,C.__generator)(this,function(s){var u,l,c,d,f;return"u"<typeof document?[2]:(a=n(),t=null==i?void 0:i.loggerProvider,l=(u={allObservables:a,networkTrackingOptions:e,amplitude:o,loggerProvider:t}).allObservables,c=u.networkTrackingOptions,d=u.amplitude,f=u.loggerProvider,P=l.networkObservable.filter(function(e){return function(e,t){void 0===t&&(t={});var r,n,i=nQ(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(nY(o,"*.amplitude.com")||nY(o,"amplitude.com"))||(null==(r=t.ignoreHosts)?void 0:r.find(function(e){return nY(o,e)})))&&(!!t.captureRules||void 0===e.status||!!nX(e.status,nG))&&(!t.captureRules||((0,C.__spreadArray)([],(0,C.__read)(t.captureRules),!1).reverse().find(function(t){if(n=function(e,t,r,n,i){if((!e.hosts||e.hosts.find(function(e){return nY(t,e)}))&&(!n||!e.urls||rB(n,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return(!r&&0!==r||!!nX(r,e.statusCodeRange||nG))&&!0}(t,o,e.status,e.url,e.method)){var r=nZ(t.responseHeaders);if(e.responseWrapper&&r){var i=e.responseWrapper.headers(r);i&&(e.responseHeaders=i)}var a=nZ(t.requestHeaders);if(e.requestWrapper&&a){var s=e.requestWrapper.headers(a);s&&(e.requestHeaders=s)}if(e.responseWrapper&&t.responseBody&&!n0(t.responseBody)){var u=t.responseBody.excludelist||t.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,u)}if(e.requestWrapper&&t.requestBody&&!n0(t.requestBody)){var u=t.requestBody.excludelist||t.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,u)}}return void 0!==n}),!!n))&&!(e.requestWrapper&&function(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find(function(e){return e.event_type===n$}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,c)}).subscribe(function(e){var t,r,n,i=e.event,o=nQ(i.url);if(o){var a=null==(r=i.responseWrapper)?void 0:r.bodySize,s=null==(n=i.requestWrapper)?void 0:n.bodySize;!function(e,t,r,n){(0,C.__awaiter)(this,void 0,void 0,function(){var i,o,a;return(0,C.__generator)(this,function(s){switch(s.label){case 0:if(!(t.requestBodyJson||t.responseBodyJson))return[3,2];return[4,Promise.all([t.requestBodyJson,t.responseBodyJson])];case 1:if(o=(i=C.__read.apply(void 0,[s.sent(),2]))[0],a=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch(e){null==n||n.debug("Failed to stringify response body")}s.label=2;case 2:return null==r||r.track(n$,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"]=s,t["[Amplitude] Response Body Size"]=a,t["[Amplitude] Request Type"]=i.type,t["[Amplitude] Request Headers"]=i.requestHeaders,t["[Amplitude] Response Headers"]=i.responseHeaders,t),i,d,f)}}),null==t||t.log("".concat(r," has been successfully added.")),[2])})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(e){return P.unsubscribe(),[2]})})}}};let n2=-1,n3=e=>{addEventListener("pageshow",t=>{t.persisted&&(n2=t.timeStamp,e(t))},!0)},n4=(e,t,r,n)=>{let i,o;return a=>{let s;t.value>=0&&(a||n)&&((o=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=o,s=t.value,t.rating=s>r[1]?"poor":s>r[0]?"needs-improvement":"good",e(t))}},n5=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},n6=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},n8=()=>{let e=n6();return e?.activationStart??0},n7=(e,t=-1)=>{let r=n6(),n="navigate";return n2>=0?n="back-forward-cache":r&&(document.prerendering||n8()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:n}},n9=new WeakMap;function ie(e,t){return n9.get(e)||n9.set(e,new t),n9.get(e)}class it{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.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 ir=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},ii=e=>{let t=!1;return()=>{t||(e(),t=!0)}},io=-1,ia=new Set,is=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,iu=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of ia)e();isFinite(io)||(io="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",iu,!0))}},il=()=>{if(io<0){let e=n8();io=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??is(),addEventListener("visibilitychange",iu,!0),addEventListener("prerenderingchange",iu,!0),n3(()=>{setTimeout(()=>{io=is()})})}return{get firstHiddenTime(){return io},onHidden(e){ia.add(e)}}},ic=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},id=[1800,3e3],ip=(e,t={})=>{ic(()=>{let r=il(),n,i=n7("FCP"),o=ir("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-n8(),0),i.entries.push(t),n(!0)))});o&&(n=n4(e,i,id,t.reportAllChanges),n3(r=>{n=n4(e,i=n7("FCP"),id,t.reportAllChanges),n5(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},ig=[.1,.25],ih=0,iv=1/0,im=0,iy=e=>{for(let t of e)t.interactionId&&(iv=Math.min(iv,t.interactionId),ih=(im=Math.max(im,t.interactionId))?(im-iv)/7+1:0)},i_=()=>t?ih:performance.interactionCount??0,ib=0;class iw{u=[];l=new Map;m;p;v(){ib=i_(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((i_()-ib)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.u.at(-1),r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>
1t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(r)}}}let iE=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=ii(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},iS=[200,500];class iT{m;h(e){this.m?.(e)}}let ik=[2500,4e3],iA=[800,1800],iI=e=>{document.prerendering?ic(()=>iI(e)):"complete"!==document.readyState?addEventListener("load",()=>iI(e),!0):setTimeout(e)};function iP(e){var t,r;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((r=(null==(t=e.entries[0])?void 0:t.startTime)||0,performance.timeOrigin+r)),navigationStart:Math.floor(performance.timeOrigin)}}var iO=function(){var e=null,r=eu(),n=null==r?void 0:r.document,i=null==r?void 0:r.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(r,o){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var a,s;return(0,C.__generator)(this,function(u){return void 0===n||(a=rH((null==i?void 0:i.href)||"",r.loggerProvider),s={"[Amplitude] Page Domain":(null==i?void 0:i.hostname)||"","[Amplitude] Page Location":a,"[Amplitude] Page Path":rH((null==i?void 0:i.pathname)||"",r.loggerProvider),"[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":rH(a.split("?")[0],r.loggerProvider)},((e,t={})=>{ic(()=>{let r=il(),n,i=n7("LCP"),o=ie(t,iT),a=e=>{for(let a of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(a),a.startTime<r.firstHiddenTime&&(i.value=Math.max(a.startTime-n8(),0),i.entries=[a],n())},s=ir("largest-contentful-paint",a);if(s){n=n4(e,i,ik,t.reportAllChanges);let r=ii(()=>{a(s.takeRecords()),s.disconnect(),n(!0)}),o=e=>{e.isTrusted&&(iE(r),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});n3(r=>{n=n4(e,i=n7("LCP"),ik,t.reportAllChanges),n5(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=iP(e)}),ip(function(e){s["[Amplitude] FCP"]=iP(e)}),((e,r={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let n=il();ic(()=>{"interactionCount"in performance||t||(t=ir("event",iy,{type:"event",buffered:!0,durationThreshold:0}));let i,o=n7("INP"),a=ie(r,iw),s=e=>{iE(()=>{for(let t of e)a.h(t);let t=a.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},u=ir("event",s,{durationThreshold:r.durationThreshold??40});i=n4(e,o,iS,r.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(u.takeRecords()),i(!0)}),n3(()=>{a.v(),i=n4(e,o=n7("INP"),iS,r.reportAllChanges)}))})})(function(e){s["[Amplitude] INP"]=iP(e)}),((e,t={})=>{let r=il();ip(ii(()=>{let n,i=n7("CLS",0),o=ie(t,it),a=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},s=ir("layout-shift",a);s&&(n=n4(e,i,ig,t.reportAllChanges),r.onHidden(()=>{a(s.takeRecords()),n(!0)}),n3(()=>{o.i=0,n=n4(e,i=n7("CLS",0),ig,t.reportAllChanges),n5(()=>n())}),setTimeout(n))}))})(function(e){s["[Amplitude] CLS"]=iP(e)}),((e,t={})=>{let r=n7("TTFB"),n=n4(e,r,iA,t.reportAllChanges);iI(()=>{let i=n6();i&&(r.value=Math.max(i.responseStart-n8(),0),r.entries=[i],n(!0),n3(()=>{(n=n4(e,r=n7("TTFB",0),iA,t.reportAllChanges))(!0)}))})})(function(e){s["[Amplitude] TTFB"]=iP(e)}),e=function(){"hidden"===n.visibilityState&&e&&(o.track("[Amplitude] Web Vitals",s),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]})})}}},ix=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),["AMP",t,e.substring(0,r)].filter(Boolean).join("_")},iC=function(){function e(e,t){var r;this.shouldTrackNewCampaign=!1,this.options=(0,C.__assign)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:tX((null==(r=t.cookieOptions)?void 0:r.domain)||t.topLevelDomain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=ix(t.apiKey,"MKTG"),this.webExpStorageKey=ix(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=ee,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(0,C.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,C.__generator)(this,function(r){switch(r.label){case 0:if(this.options.optOut)return[2];return[4,this.fetchCampaign()];case 1:if(t=C.__read.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||eD(this.sessionTimeout,this.lastEventTime),!t$(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:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,C.__awaiter)(this,void 0,void 0,function(){var e;return(0,C.__generator)(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 ri().parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n=(t=this.currentCampaign,r=this.options,ef(Object.entries((0,C.__assign)((0,C.__assign)({},ee),t)).reduce(function(e,t){var n,i=(0,C.__read)(t,2),o=i[0],a=i[1];return(e.setOnce("initial_".concat(o),null!=(n=null!=a?a:r.initialEmptyValue)?n:"EMPTY"),a)?e.set(o,a):e.unset(o)},new eo)));return e&&(n.event_id=e),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),iR=new Set([m.IDENTIFY,m.GROUP_IDENTIFY]),iD=function(e){void 0===e&&(e={});var t,r,n,i,o,a,s,u=null!=(t=e.fallbackAttributionEvent)&&t,l=eu(),c={},d=!1,f=!1,p=function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(e){switch(e.label){case 0:return[4,new ri().parse()];case 1:return c=ro(e.sent()),u&&(null==n||n.log("Tracking attribution fallback event."),null==r||r.track("[Amplitude] Attribution",c)),[2]}})})},g=function(){p()},h=function(e){return new Proxy(e,{apply:function(e,t,r){Reflect.apply(e,t,r),d&&g()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(u){switch(u.label){case 0:return r=t,n=e.loggerProvider,d=!0,n.log("Installing event property attribution tracking."),[4,p()];case 1:if(u.sent(),!l)return[2];if(l.addEventListener("popstate",g),!f){if(i=Reflect.get(l.history,"pushState"),o=Reflect.get(l.history,"replaceState"),!i||!o)return[2];a=h(i),l.history.pushState=a,s=h(o),l.history.replaceState=s,f=!0}return[2]}})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return iR.has(e.event_type)||(e.event_properties=(0,C.__assign)((0,C.__assign)({},c),e.event_properties)),[2,e]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,t;return(0,C.__generator)(this,function(r){return l&&(l.removeEventListener("popstate",g),e=Reflect.get(l.history,"pushState"),t=Reflect.get(l.history,"replaceState"),f&&e===a&&i&&(l.history.pushState=i),f&&t===s&&o&&(l.history.replaceState=o)),d=!1,f=!1,i=void 0,o=void 0,a=void 0,s=void 0,c={},[2]})})}}},iL="AMP_CURRENT_PAGE",iN="AMP_PREVIOUS_PAGE",iM="AMP_URL_INFO";(p=O||(O={})).Direct="direct",p.Internal="internal",p.External="external";var ij=new Set([m.IDENTIFY,m.GROUP_IDENTIFY,m.REVENUE]),iU=function(e){var t=(void 0===e?{}:e).internalDomains,r=void 0===t?[]:t,n=eu(),i=void 0,o=!1,a=void 0,s=!1,u=!1,l=function(e){var t;try{var r=rH(e,a);
1t=new URL(r).hostname}catch(e){null==a||a.error("Could not parse URL: ",e)}return t},c=function(e){var t="u">typeof location&&location.hostname||"",n=e?l(e):void 0;if(!n)return O.Direct;var i=r.some(function(e){return -1!==t.indexOf(e)}),o=r.some(function(e){return -1!==n.indexOf(e)});return t===n||o&&i?O.Internal:O.External},d=function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,a;return(0,C.__generator)(this,function(s){switch(s.label){case 0:if(!(i&&o))return[3,3];return[4,i.get(iM)];case 1:return e=s.sent(),t=rH("u">typeof location&&location.href||""),r=(null==e?void 0:e[iL])||"",n=void 0,n=t===r?(null==e?void 0:e[iN])||"":r||document.referrer||"",[4,i.set(iM,((a={})[iL]=t,a[iN]=n,a))];case 2:s.sent(),s.label=3;case 3:return[2]}})})},f=function(){d()};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var t,r,c,p,g,h,v,m;return(0,C.__generator)(this,function(y){switch(y.label){case 0:if((a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!n)return[3,7];try{i=new tb(n.sessionStorage)}catch(e){null==a||a.debug("sessionStorage is not available in this environment.")}return[4,null==i?void 0:i.isEnabled()];case 1:if(o=null!=(m=y.sent())&&m,!(i&&o))return[3,6];return r=(t="u">typeof document&&document.referrer||"")?l(t):void 0,c="u">typeof location&&location.hostname||"",p=rH("u">typeof location&&location.href||""),[4,i.get(iM)];case 2:if(h=(null==(g=y.sent())?void 0:g[iL])||"",!(r&&r!==c&&h!==p))return[3,4];return[4,i.set(iM,((v={})[iL]=p,v[iN]=t,v))];case 3:return y.sent(),[3,6];case 4:return[4,d()];case 5:y.sent(),y.label=6;case 6:n.addEventListener("popstate",f),s||(n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=(0,C.__read)(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),u&&f()}}),n.history.replaceState=new Proxy(n.history.replaceState,{apply:function(e,t,r){var n=(0,C.__read)(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),u&&f()}}),s=!0),y.label=7;case 7:return[2]}})})},execute:function(e){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var t,r,n;return(0,C.__generator)(this,function(a){switch(a.label){case 0:if(t=rH("u">typeof location&&location.href||""),!(i&&o))return[3,2];return[4,i.get(iM)];case 1:if(n=(null==(r=a.sent())?void 0:r[iN])||"",ij.has(e.event_type))return[2,e];e.event_properties=(0,C.__assign)((0,C.__assign)({},e.event_properties||{}),{"[Amplitude] Page Domain":iF(e,"[Amplitude] Page Domain","u">typeof location&&location.hostname||""),"[Amplitude] Page Location":iF(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":iF(e,"[Amplitude] Page Path","u">typeof location&&rH(location.pathname)||""),"[Amplitude] Page Title":iF(e,"[Amplitude] Page Title",rn(rr)),"[Amplitude] Page URL":iF(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":n,"[Amplitude] Previous Page Type":c(n)}),a.label=2;case 2:return[2,e]}})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(e){switch(e.label){case 0:if(n&&(n.removeEventListener("popstate",f),u=!1),!(i&&o))return[3,2];return[4,i.set(iM,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function iF(e,t,r){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?r:e.event_properties[t]}var iq=function(){var e,t,r;function n(t){if(t)try{var r=Function("return "+t)();if("function"==typeof r)return r;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(0,C.__awaiter)(void 0,void 0,void 0,function(){var o,a;return(0,C.__generator)(this,function(s){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null==(a=i.remoteConfig)?void 0:a.fetchRemoteConfig)&&(i.remoteConfigClient?(o=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){r=e&&"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body?n(e.body||""):n("")}),t=function(){var e;return null==(e=i.remoteConfigClient)?void 0:e.unsubscribe(o)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return(0,C.__awaiter)(void 0,void 0,void 0,function(){var n;return(0,C.__generator)(this,function(i){if(r)try{return[2,null!=(n=r(t))?n:null]}catch(t){null==e||e.error("Could not execute custom enrichment function",t)}return[2,t]})})},teardown:function(){return(0,C.__awaiter)(void 0,void 0,void 0,function(){return(0,C.__generator)(this,function(e){return t&&t(),[2]})})}}},iB="userProperty",iH="eventProperty",iz=function(e){return e===iB||e===iH},iV=function(e){var t=(0,C.__spreadArray)([],(0,C.__read)(new Set((Array.isArray(e)?e:[e]).filter(iz))),!1);return t.length>0?t:[iB]},iW=function(e,t){return iV(e.trackingMethod).includes(t)},iJ=function(e){return iW(e,iB)},iK=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return(0,C.__extends)(t,e),t.prototype.init=function(e,t,r){var n,i;return void 0===e&&(e=""),arguments.length>2?(n=t,i=r):"string"==typeof t?(n=t,i=void 0):(n=null==t?void 0:t.userId,i=t),eh(this._init((0,C.__assign)((0,C.__assign)({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,o,a,s,u,l;return(0,C.__awaiter)(this,void 0,void 0,function(){var c,d,f,p,g,v,m,y,_,b,w,E,S,T,k=this;return(0,C.__generator)(this,function(A){var I,P,O,x,R,D,L,N,M;switch(A.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,c=t5(t),d=null!=(r=t.loggerProvider)?r:new e_,t.loggerProvider||d.enable(null!=(n=t.logLevel)?n:h.Warn),f=null!=(i=t.serverZone)?i:"US",g=this._diagnosticsSampleRate,v=null==(o=t.enableDiagnostics)||o,!c)return[3,2];return p=new eU(t.apiKey,d,f,null==(a=t.remoteConfig)?void 0:a.serverUrl),[4,new Promise(function(e){null==p||p.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(d.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(g=i);var o=t.enabled;"boolean"==typeof o&&(v=o)}e()})})];case 1:A.sent(),A.label=2;case 2:return(m=new eZ(t.apiKey,d,f,{enabled:v,sampleRate:g})).setTag("library","".concat(tc,"/").concat(tl)),"u">typeof navigator&&m.setTag("user_agent",navigator.userAgent),[4,(I=t.apiKey,P=t,O=this,x=m,R={loggerProvider:d,serverZone:f,enableDiagnostics:v,diagnosticsSampleRate:g},void 0===P&&(P={}),(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a,s,u,l,c,d,f,p,g,h,v,m,y,_,b,w,E,S,T,k,A,D,L,N,M,j,U,F,q,B,H,z,V,W,J,K,$,G,Y,X,Q,Z,ee,et,er;return(0,C.__generator)(this,function(en){var ei,eo,ea,es;switch(en.label){case 0:if(e=P.identityStorage||tW,t="",!(e===tW&&!(null==(w=P.cookieOptions)?void 0:w.domain)&&(null==(E=P.cookieOptions)?void 0:E.domain)!==""))return[3,2];return[4,(ei=void 0,eo=x,(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a;return(0,C.__generator)(this,function(s){switch(s.label){case 0:return[4,new tg(void 0,{diagnosticsClient:eo}).isEnabled()];case 1:if(!s.sent()||!ei&&("u"<typeof location||!location.hostname)||1===(t=(e=null!=ei?ei:location.hostname).split(".")).length)return[2,""];for(r=[],n=1,t0.find(function(t){return e.endsWith(".".concat(t))})&&(n=2),i=t.length-n-1;i>=0;--i)r.push(t.slice(i).join("."));i=0,s.label=2;case 2:if(!(i<r.length))return[3,7];o=r[i],s.label=3;
1case 3:return s.trys.push([3,5,,6]),[4,tg.isDomainWritable(o)];case 4:if(s.sent())return[2,"."+o];return[3,6];case 5:return a=s.sent(),eo&&eo.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(o),error:a instanceof Error?a.message:String(a)}),[3,6];case 6:return i++,[3,2];case 7:return eo&&eo.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(e)}),[2,""]}})}))];case 1:t=en.sent(),en.label=2;case 2:return r=(0,C.__assign)({domain:null!=(T=null==(S=P.cookieOptions)?void 0:S.domain)?T:t,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},P.cookieOptions),n={duplicateResolverFn:function(e){var t=tm(e);return!!t&&ty(JSON.parse(t).cookieDomain,r.domain)},diagnosticsClient:x},[4,(ea=i=t4(P.identityStorage,r,n),void 0===(es=null==(A=null==(k=P.cookieOptions)?void 0:k.upgrade)||A)&&(es=!0),(0,C.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a,s,u;return(0,C.__generator)(this,function(l){switch(l.label){case 0:return e="".concat("amp","_").concat(I.substring(0,6)),[4,ea.getRaw(e)];case 1:if(!(t=l.sent()))return[2,{optOut:!1}];if(!es)return[3,3];return[4,ea.remove(e)];case 2:l.sent(),l.label=3;case 3:return n=(r=(0,C.__read)(t.split("."),6))[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],[2,{deviceId:n,userId:tx(i),sessionId:tO(a),lastEventId:tO(u),lastEventTime:tO(s),optOut:!!o}]}})}))];case 3:return o=en.sent(),[4,i.get(t_(I))];case 4:return a=en.sent(),l=!(u=(s=eN()).ampTimestamp?Number(s.ampTimestamp):void 0)||Date.now()<u,c=null!=(j=null!=(M=null!=(N=null!=(D=P.deviceId)?D:l?null!=(L=s.ampDeviceId)?L:s.deviceId:void 0)?N:null==a?void 0:a.deviceId)?M:o.deviceId)?j:ec(),d=null!=(U=null==a?void 0:a.lastEventId)?U:o.lastEventId,f=null!=(F=null==a?void 0:a.lastEventTime)?F:o.lastEventTime,p=null!=(B=null!=(q=P.optOut)?q:null==a?void 0:a.optOut)?B:o.optOut,g=null!=(H=null==a?void 0:a.sessionId)?H:o.sessionId,h=null==a?void 0:a.deferredSessionId,v=null!=(V=null!=(z=P.userId)?z:null==a?void 0:a.userId)?V:o.userId,O.previousSessionDeviceId=null!=(W=null==a?void 0:a.deviceId)?W:o.deviceId,O.previousSessionUserId=null!=(J=null==a?void 0:a.userId)?J:o.userId,m={ipAddress:null==($=null==(K=P.trackingOptions)?void 0:K.ipAddress)||$,language:null==(Y=null==(G=P.trackingOptions)?void 0:G.language)||Y,platform:null==(Q=null==(X=P.trackingOptions)?void 0:X.platform)||Q},y=null==a?void 0:a.pageCounter,_=null==a?void 0:a.debugLogsEnabled,void 0!==P.autocapture&&(P.defaultTracking=P.autocapture),[4,(b=new t3(I,P.appVersion,i,r,P.defaultTracking,P.autocapture,c,P.flushIntervalMillis,P.flushMaxRetries,P.flushQueueSize,e,P.ingestionMetadata,P.instanceName,d,f,null!=(Z=null==R?void 0:R.loggerProvider)?Z:P.loggerProvider,P.logLevel,P.minIdLength,P.offline,p,P.partnerId,P.plan,P.serverUrl,null!=(ee=null==R?void 0:R.serverZone)?ee:P.serverZone,g,h,P.sessionTimeout,P.storageProvider,m,P.transport,P.useBatch,P.fetchRemoteConfig,v,y,_,P.networkTrackingOptions,P.identify,null!=(et=null==R?void 0:R.enableDiagnostics)?et:P.enableDiagnostics,null!=(er=null==R?void 0:R.diagnosticsSampleRate)?er:O._diagnosticsSampleRate,x,P.remoteConfig,t,P.enableRequestBodyCompression,P.customEnrichment)).storageProvider.isEnabled()];case 5:return en.sent()||(b.loggerProvider.warn("Storage provider ".concat(b.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),b.storageProvider=new tf),[2,b]}})}))];case 3:if(y=A.sent(),!(c&&p))return[3,5];return[4,new Promise(function(e){null==p||p.subscribe("configs.analyticsSDK.browserSDK","all",function(t,r,n){y.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&function(e,t){if(e){!function e(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var r,n,i,o,a,s,u,l,c,d,f,p,g=Object.keys(t);try{for(var h=(0,C.__values)(g),v=h.next();!v.done;v=h.next()){var m=v.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){r={error:e}}finally{try{v&&!v.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}
1try{if(null==(c=null==(l=null==(u=t.autocapture)?void 0:u.networkTracking)?void 0:l.captureRules)?void 0:c.length)try{for(var _=(0,C.__values)(t.autocapture.networkTracking.captureRules),b=_.next();!b.done;b=_.next()){var w=b.value;try{for(var E=(a=void 0,(0,C.__values)(["responseHeaders","requestHeaders"])),S=E.next();!S.done;S=E.next()){var T=S.value,k=null!=(d=w[T])?d:{},A=k.captureSafeHeaders,I=k.allowlist;if(A||I){if(void 0!==I&&!Array.isArray(I)){delete w[T];continue}w[T]=(0,C.__spreadArray)((0,C.__spreadArray)([],(0,C.__read)(A?et:[]),!1),(0,C.__read)(null!=I?I:[]),!1)}}}catch(e){a={error:e}}finally{try{S&&!S.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}}}catch(e){i={error:e}}finally{try{b&&!b.done&&(o=_.return)&&o.call(_)}finally{if(i)throw i.error}}}catch(e){}var P=null==(f=t.autocapture)?void 0:f.frustrationInteractions;P&&(P.rageClick&&(P.rageClicks=P.rageClick,delete P.rageClick),P.deadClick&&(P.deadClicks=P.deadClick,delete P.deadClick));try{var O=null==(p=t.autocapture)?void 0:p.elementInteractions;if(O&&"object"==typeof O&&(!0===O.viewportContentUpdated&&(O.viewportContentUpdated={}),!1===O.viewportContentUpdated&&(O.viewportContentUpdated={enabled:!1}),void 0!==O.exposureDuration)){var x=O.viewportContentUpdated;void 0===x?O.viewportContentUpdated={exposureDuration:O.exposureDuration}:"object"==typeof x&&void 0===x.exposureDuration&&!1!==x.enabled&&(x.exposureDuration=O.exposureDuration),delete O.exposureDuration}}catch(e){}}}(e);try{var r,n,i,o,a,s,u;if(t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var l=(0,C.__assign)({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null==(i=e.autocapture.elementInteractions.pageUrlAllowlistRegex)?void 0:i.length)){l.elementInteractions=(0,C.__assign)({},e.autocapture.elementInteractions);var c=l.elementInteractions,d=null!=(o=c.pageUrlAllowlist)?o:[],f=e.autocapture.elementInteractions.pageUrlAllowlistRegex;c.pageUrlAllowlist=ry(d,f,t),delete c.pageUrlAllowlistRegex}if("object"==typeof e.autocapture.networkTracking&&null!==e.autocapture.networkTracking&&(null==(a=e.autocapture.networkTracking.captureRules)?void 0:a.length)){l.networkTracking=(0,C.__assign)({},e.autocapture.networkTracking);var p=null!=(s=l.networkTracking.captureRules)?s:[];try{for(var g=(0,C.__values)(p),h=g.next();!h.done;h=g.next()){var v=h.value;v.urls=ry(null!=(u=v.urls)?u:[],v.urlsRegex,t),delete v.urlsRegex}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=(0,C.__assign)({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},l)),"object"==typeof t.autocapture&&(t.autocapture=(0,C.__assign)((0,C.__assign)({},t.autocapture),l))}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:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,y),e()})})];case 4:A.sent(),A.label=5;case 5:return[4,e.prototype._init.call(this,y)];case 6:if(A.sent(),this.logBrowserOptions(y),this.config.remoteConfigClient=p,_=e3((D=this.config).defaultTracking)&&D.defaultTracking&&"object"==typeof D.defaultTracking&&D.defaultTracking.attribution&&"object"==typeof D.defaultTracking.attribution?(0,C.__assign)({},D.defaultTracking.attribution):{},!(e3(this.config.defaultTracking)&&iJ(_)))return[3,8];return this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,C.__awaiter)(k,void 0,void 0,function(){return(0,C.__generator)(this,function(t){switch(t.label){case 0:if(e)return[3,2];return this.webAttribution=new iC(_,this.config),[4,this.webAttribution.init()];case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new iC(_,this.config),[4,this.webAttribution.init()];case 7:A.sent(),A.label=8;case 8:if(E=!(!(w=(b=eN()).ampTimestamp?Number(b.ampTimestamp):void 0)||Date.now()<w)||Number.isNaN(Number(b.ampSessionId))?void 0:Number(b.ampSessionId),-1!==(S=this.config.deferredSessionId)||this.config.optOut||(S=Date.now()),this.setSessionId(null!=(l=null!=(u=null!=(s=t.sessionId)?s:E)?u:S)?l:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,C.__awaiter)(k,void 0,void 0,function(){return(0,C.__generator)(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(T=ex(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline)return[3,10];return[4,this.add(rm()).promise];case 9:A.sent(),A.label=10;case 10:return[4,this.add(new eI({diagnosticsClient:m})).promise];
1case 11:return A.sent(),[4,this.add(new td).promise];case 12:return A.sent(),[4,this.add(new eL).promise];case 13:if(A.sent(),rv(this.config),!e2(this.config.defaultTracking,"fileDownloads"))return[3,15];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(rg()).promise];case 14:A.sent(),A.label=15;case 15:if(!e4(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(rd()).promise];case 16:A.sent(),A.label=17;case 17:if(!e5(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(rs(ti(this.config))).promise];case 18:return A.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return(0,C.__awaiter)(k,void 0,void 0,function(){return(0,C.__generator)(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(rs(ti(this.config))).promise];case 1:return t.sent(),[2]}})})}),A.label=20;case 20:if(!(e3(this.config.defaultTracking)&&iW(_,iH)))return[3,22];return this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(iD(_)).promise];case 21:A.sent(),A.label=22;case 22:if(!e7(this.config.autocapture))return[3,24];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(nm(tt(this.config),{diagnosticsClient:m})).promise];case 23:A.sent(),A.label=24;case 24:if(!e9(this.config.autocapture))return[3,26];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(nx(tr(this.config))).promise];case 25:A.sent(),A.label=26;case 26:if(!e8(this.config.autocapture))return[3,28];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(n1(tn(this.config))).promise];case 27:A.sent(),A.label=28;case 28:if(!("boolean"==typeof(L=this.config.autocapture)?L:"object"==typeof L&&!0===L.webVitals))return[3,30];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(iO()).promise];case 29:A.sent(),A.label=30;case 30:if("object"!=typeof(N=this.config.autocapture)||!0!==N.performanceTracking&&"object"!=typeof N.performanceTracking)return[3,32];return this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(nR(te(this.config))).promise];case 31:A.sent(),A.label=32;case 32:if(!e2(this.config.autocapture,"pageUrlEnrichment"))return[3,34];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(iU()).promise];case 33:A.sent(),A.label=34;case 34:if(!("boolean"==typeof(M=this.config.customEnrichment)?M:"object"==typeof M&&null!==M&&!1!==M.enabled))return[3,36];return this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(iq()).promise];case 35:A.sent(),A.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return A.sent(),T.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=(0,C.__rest)(t,["time"]);k.track(e.eventType,n,"number"==typeof r?{time:r}:void 0)}),[2]}})})},t.prototype.getUserId=function(){var e;return null==(e=this.config)?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),(e!==this.config.userId||void 0===e)&&(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),eC(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null==(e=this.config)?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),eR(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(ec()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null==(e=this.config)?void 0:e.deviceId,userId:null==(t=this.config)?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,r,n,i=new eo,o=null!=(n=e.userProperties)?n:{};try{for(var a=(0,C.__values)(Object.entries(o)),s=a.next();!s.done;s=a.next()){var u=(0,C.__read)(s.value,2),l=u[0],c=u[1];i.set(l,c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null==(e=this.config)?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null==(e=this.config)?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),eh(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,eh(Promise.resolve());
1if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return eh(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!=(t=this.config.lastEventId)?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,e6(this.config.defaultTracking)&&(n&&i&&r.push(this.track(tM,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var a=this.trackCampaignEventIfNeeded(++o,r);return this.config.identify&&r.push(this.track(ef(this.config.identify)).promise),e6(this.config.defaultTracking)&&r.push(this.track(tN,void 0,{event_id:a?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,eh(Promise.all(r))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=t6(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(ts(t)){var n=t._q;t._q=[],t=ta(new eo,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},t.prototype.groupIdentify=function(t,r,n,i){if(ts(n)){var o=n._q;n._q=[],n=ta(new eo,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(ts(t)){var n=t._q;t._q=[],t=ta(new eP,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!iJ(this.webAttribution.options))return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return(0,C.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,C.__generator)(this,function(o){return r=Date.now(),n=eD(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type!==tN&&t.event_type!==tM&&(!t.session_id||t.session_id===this.getSessionId())&&(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=(0,C.__assign)((0,C.__assign)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",e1(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}(ev);e.s(["AmplitudeBrowser",0,iK],574437);var i$=function(){var e=new iK;return{init:M(e.init.bind(e),"init",D(e),N(e,["config"])),add:M(e.add.bind(e),"add",D(e),N(e,["config.apiKey","timeline.plugins"])),remove:M(e.remove.bind(e),"remove",D(e),N(e,["config.apiKey","timeline.plugins"])),track:M(e.track.bind(e),"track",D(e),N(e,["config.apiKey","timeline.queue.length"])),logEvent:M(e.logEvent.bind(e),"logEvent",D(e),N(e,["config.apiKey","timeline.queue.length"])),identify:M(e.identify.bind(e),"identify",D(e),N(e,["config.apiKey","timeline.queue.length"])),groupIdentify:M(e.groupIdentify.bind(e),"groupIdentify",D(e),N(e,["config.apiKey","timeline.queue.length"])),setGroup:M(e.setGroup.bind(e),"setGroup",D(e),N(e,["config.apiKey","timeline.queue.length"])),revenue:M(e.revenue.bind(e),"revenue",D(e),N(e,["config.apiKey","timeline.queue.length"])),flush:M(e.flush.bind(e),"flush",D(e),N(e,["config.apiKey","timeline.queue.length"])),getUserId:M(e.getUserId.bind(e),"getUserId",D(e),N(e,["config","config.userId"])),setUserId:M(e.setUserId.bind(e),"setUserId",D(e),N(e,["config","config.userId"])),getDeviceId:M(e.getDeviceId.bind(e),"getDeviceId",D(e),N(e,["config","config.deviceId"])),setDeviceId:M(e.setDeviceId.bind(e),"setDeviceId",D(e),N(e,["config","config.deviceId"])),reset:M(e.reset.bind(e),"reset",D(e),N(e,["config","config.userId","config.deviceId"])),getSessionId:M(e.getSessionId.bind(e),"getSessionId",D(e),N(e,["config"])),setSessionId:M(e.setSessionId.bind(e),"setSessionId",D(e),N(e,["config"])),extendSession:M(e.extendSession.bind(e),"extendSession",D(e),N(e,["config"])),setOptOut:M(e.setOptOut.bind(e),"setOptOut",D(e),N(e,["config"])),setTransport:M(e.setTransport.bind(e),"setTransport",D(e),N(e,["config"])),getIdentity:M(e.getIdentity.bind(e),"getIdentity",D(e),N(e,["config"])),setIdentity:M(e.setIdentity.bind(e),"setIdentity",D(e),N(e,["config","config.userId","config.deviceId"])),getOptOut:M(e.getOptOut.bind(e),"getOptOut",D(e),N(e,["config"])),_setDiagnosticsSampleRate:
1M(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",D(e),N(e,["config"]))}};let iG=i$();e.s(["createInstance",0,i$,"default",0,iG],693748),e.s([],468824),e.i(468824),(g=x||(x={})).US="US",g.EU="EU",g.STAGING="STAGING",e.s(["DEFAULT_ACTION_CLICK_ALLOWLIST",0,rw,"DEFAULT_CSS_SELECTOR_ALLOWLIST",0,r_,"DEFAULT_DATA_ATTRIBUTE_PREFIX",0,rb,"EXCLUDE_INTERNAL_REFERRERS_CONDITIONS",0,tJ,"IdentifyOperation",0,v,"LogLevel",0,h,"OfflineDisabled",0,null,"RevenueProperty",0,b,"ServerZone",0,x,"SpecialEventType",0,m],752698),e.i(752698);var iY=iG.add,iX=iG.extendSession,iQ=iG.flush,iZ=iG.getDeviceId,i0=iG.getIdentity,i1=iG.getOptOut,i2=iG.getSessionId,i3=iG.getUserId,i4=iG.groupIdentify,i5=iG.identify,i6=iG.init,i8=iG.logEvent,i7=iG.remove,i9=iG.reset,oe=iG.revenue,ot=iG.setDeviceId,or=iG.setGroup,on=iG.setIdentity,oi=iG.setOptOut,oo=iG.setSessionId,oa=iG.setTransport,os=iG.setUserId,ou=iG.track,ol=iG._setDiagnosticsSampleRate;e.s(["_setDiagnosticsSampleRate",0,ol,"add",0,iY,"extendSession",0,iX,"flush",0,iQ,"getDeviceId",0,iZ,"getIdentity",0,i0,"getOptOut",0,i1,"getSessionId",0,i2,"getUserId",0,i3,"groupIdentify",0,i4,"identify",0,i5,"init",0,i6,"logEvent",0,i8,"remove",0,i7,"reset",0,i9,"revenue",0,oe,"setDeviceId",0,ot,"setGroup",0,or,"setIdentity",0,on,"setOptOut",0,oi,"setSessionId",0,oo,"setTransport",0,oa,"setUserId",0,os,"track",0,ou],674585)}]);
2
3//# sourceMappingURL=0h-vil~ckjnx1.js.map

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