(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,427968,(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 s=r.map(e);return t.pop(),s}var a=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(),a}(e)}t.exports=function(e,t,r){return JSON.stringify(o(e),t,r)},t.exports.ensureProperties=o},14919,(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"),s=i("observable"),a=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[a])&&(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{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 s=!n;if(n=!0,!s||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(){for(var e=arguments.length,t=Array(e),r=0;r{let r,i=0;return!function o(s){r=s.subscribe({next(t){e.next(t)},error(t){e.error(t)},complete(){i===t.length?(r=void 0,e.complete()):o(n.from(t[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=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 s=t.from(i).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){let e=n.indexOf(s);e>=0&&n.splice(e,1),o()}});n.push(s)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[s](){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,s);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{d(()=>{if(!e.closed){for(let r=0;r{t.exports=e.r(14919).Observable},203218,236414,373392,988141,949524,153867,657481,236535,523858,333681,344962,264843,23799,851107,750095,229569,615117,603709,724896,e=>{"use strict";let t;var r,n,i,o,s,a,u,l,c,d,f,p,g,h,v,m,y,_,b,w,E,S,T,k,I,A,C,P,O,x,R=e.i(824627);(r=v||(v={}))[r.None=0]="None",r[r.Error=1]="Error",r[r.Warn=2]="Warn",r[r.Verbose=3]="Verbose",r[r.Debug=4]="Debug",e.s(["LogLevel",0,v],236414);var D=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},L=function(e){return function(){var t=(0,R.__assign)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},N=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=(0,R.__values)(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},M=function(e,t){return function(){var r,n,i={};try{for(var o=(0,R.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=N(e,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},U=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s1e3)return!1;for(var t in e){var r=e[t];if(!ed(t,r))return!1}return!0},ed=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,R.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&ec(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{s&&!s.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 ec(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},ef=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,R.__assign)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(_.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(_.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(_.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(_.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(_.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(_.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(_.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(_.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(_.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[_.CLEAR_ALL]="-",this},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[_.CLEAR_ALL]||this._propertySet.has(t))&&(e===_.ADD?"number"==typeof r:e===_.UNSET||e===_.REMOVE||ed(t,r))},e}();(o=_||(_={})).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 ep=[_.CLEAR_ALL,_.UNSET,_.SET,_.SET_ONCE,_.ADD,_.APPEND,_.PREPEND,_.PREINSERT,_.POSTINSERT,_.REMOVE];e.s(["Identify",0,ef,"OrderedIdentifyOperations",0,ep],153867),(s=b||(b={})).Unknown="unknown",s.Skipped="skipped",s.Success="success",s.RateLimit="rate_limit",s.PayloadTooLarge="payload_too_large",s.Invalid="invalid",s.Failed="failed",s.Timeout="Timeout",s.SystemError="SystemError",e.s(["Status",0,b],657481);var eg=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=b.Unknown),{event:e,code:t,message:r}},eh=e.i(362548),ev=(0,R.__spreadArray)([],(0,R.__read)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),em=function(e){var t,r=(0,eh.getGlobalScope)();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,em);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,(0,R.__spreadArray)([],(0,R.__read)(n.entries()),!1).map(function(e){var t=(0,R.__read)(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(ev[n]):ev[n]}).join("")},ey=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var r,n;return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(i){switch(i.label){case 0:if(this.plugins.some(function(t){return t.name===e.name}))return this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=em(),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."))),e.type=null!=(r=e.type)?r:"enrichment",[4,null==(n=e.setup)?void 0:n.call(e,t,this.client)];case 1:return i.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var r;return(0,R.__awaiter)(this,void 0,void 0,function(){var n,i;return(0,R.__generator)(this,function(o){switch(o.label){case 0:if(-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.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,R.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,s,a,u,l,c,d,f,p,g,h;return(0,R.__generator)(this,function(v){switch(v.label){case 0:if(!e)return[2];t=(0,R.__read)(e,1)[0],r=(0,R.__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,R.__values)(n)).next(),v.label=2;case 2:if(o.done)return[3,5];if(!(s=o.value).execute)return[3,4];return[4,s.execute((0,R.__assign)({},t))];case 3:if(null===(a=v.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),r({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(s.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];case 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,R.__values)(u)).next(),v.label=10;case 10:if(c.done)return[3,13];if(!(s=c.value).execute)return[3,12];return[4,s.execute((0,R.__assign)({},t))];case 11:if(null===(a=v.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),r({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(s.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,R.__assign)({},t);return e.execute(r).catch(function(e){return eg(r,0,String(e))})})).then(function(e){var n=(0,R.__read)(e,1)[0]||eg(t,100,"Event not tracked, no destination plugins on the instance");r(n)}),[2]}})})},e.prototype.flush=function(){return(0,R.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,s;return(0,R.__generator)(this,function(a){switch(a.label){case 0:a.trys.push([0,7,8,9]),r=(t=(0,R.__values)(this._optOutListeners)).next(),a.label=1;case 1:if(r.done)return[3,6];n=r.value,a.label=2;case 2:return a.trys.push([2,4,,5]),[4,n(e)];case 3:return a.sent(),[3,5];case 4:return i=a.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return o={error:a.sent()},[3,9];case 8:try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(o)throw o.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null==(t=e.onReset)||t.call(e)})},e}(),e_=function(e,t){return(0,R.__assign)((0,R.__assign)({},t),{event_type:y.IDENTIFY,user_properties:e.getUserProperties()})},eb=function(e,t,r,n){var i;return(0,R.__assign)((0,R.__assign)({},n),{event_type:y.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:((i={})[e]=t,i)})},ew=function(e,t,r){var n,i=new ef;return i.set(e,t),(0,R.__assign)((0,R.__assign)({},r),{event_type:y.IDENTIFY,user_properties:i.getUserProperties(),groups:((n={})[e]=t,n)})},eE=function(e){return{promise:e||Promise.resolve()}};e.s(["returnWrapper",0,eE],236535);var eS=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 ey(this),this.name=e}return e.prototype._init=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,s;return(0,R.__generator)(this,function(a){switch(a.label){case 0:t=this[e],this[e]=[],a.label=1;case 1:a.trys.push([1,8,9,10]),n=(r=(0,R.__values)(t)).next(),a.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 a.sent(),[3,6];case 4:return[4,i];case 5:a.sent(),a.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return o={error:a.sent()},[3,10];case 9:try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(o)throw o.error}return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:a.sent(),a.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,r){var n=(0,R.__assign)((0,R.__assign)((0,R.__assign)({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t});return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),eE(this.dispatch(n))},e.prototype.identify=function(e,t){var r=e_(e,t);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),eE(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var i=eb(e,t,r,n);return eE(this.dispatch(i))},e.prototype.setGroup=function(e,t,r){var n=ew(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),eE(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=(0,R.__assign)((0,R.__assign)({},t),{event_type:y.REVENUE,event_properties:e.getEventProperties()});return eE(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),eE())},e.prototype._addPlugin=function(e){return eE(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)),eE())},e.prototype._removePlugin=function(e){return eE(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(eg(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,R.__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,R.__assign)({},r);if(void 0===e)return n;var i={};return Object.keys(e).forEach(function(t){Object.values(m).includes(t)||(i[t]=e[t])}),ep.forEach(function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case m.CLEAR_ALL:Object.keys(n).forEach(function(e){delete n[e]});break;case m.UNSET:Object.keys(r).forEach(function(e){delete n[e]});break;case m.SET:Object.assign(n,r)}}}),Object.assign(n,i),n},e.prototype.process=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){var t,r;return(0,R.__generator)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),this.config.optOut)return[2,eg(e,0,"Event skipped due to optOut config")];return e.event_type===y.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=eg(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 eE(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}(),eT=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},[])},ek="Amplitude Logger ",eI=function(){function e(){this.logLevel=v.None}return e.prototype.disable=function(){this.logLevel=v.None},e.prototype.enable=function(e){void 0===e&&(e=v.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t=200&&e<300}e.s(["Config",0,eC,"RequestMetadata",0,eO,"createServerConfig",0,eP],333681);var eR=new Set([F,B,H,G]);function eD(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var eL=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,R.__awaiter)(this,void 0,void 0,function(){var r,n=this;return(0,R.__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=em()),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.attemptsthis.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,R.__awaiter)(this,void 0,void 0,function(){var t,r,n=this;return(0,R.__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,eT(t,this.config.flushQueueSize).reduce(function(t,r){return(0,R.__awaiter)(n,void 0,void 0,function(){return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){var n,i,o,s,a;return(0,R.__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,R.__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 eO,u.label=1;case 1:return u.trys.push([1,3,,4]),l=i=eP(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,void 0===(c=this.config.enableRequestBodyCompression)&&(c=!1),o=!!eR.has(l)||c,[4,this.config.transportProvider.send(i,n,this.config._enableRequestBodyCompressionExperimental&&o)];case 2:if(null===(s=u.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(eD(s))):this.fulfillRequest(e,s.statusCode,s.status),[2];return this.handleResponse(s,e),[3,4];case 3:return a=(d=u.sent())instanceof Error?d.message:String(d),this.config.loggerProvider.error(a),null==(r=this.diagnosticsClient)||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:a,stack_trace:D()}),this.handleResponse({status:b.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){ex(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:eD(e),stack_trace:D()});var r,n=e.status;switch(n){case b.Success:this.handleSuccessResponse(e,t);break;case b.Invalid:this.handleInvalidResponse(e,t);break;case b.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case b.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,R.__spreadArray)((0,R.__spreadArray)((0,R.__spreadArray)((0,R.__spreadArray)([],(0,R.__read)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,R.__read)(Object.values(e.body.eventsWithMissingFields)),!1),(0,R.__read)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,R.__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(eD(e));var 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(eD(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,s=new Set(n),a=new Set(i),u=new Set(o),l=t.filter(function(t,n){return t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.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(eD(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;ex(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:D()})),this.removeEvents(e),e.forEach(function(e){return e.callback(eg(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}(),eN=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));ec(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?(0,R.__assign)({},this.properties):{};return e[w.REVENUE_PRODUCT_ID]=this.productId,e[w.REVENUE_QUANTITY]=this.quantity,e[w.REVENUE_PRICE]=this.price,e[w.REVENUE_TYPE]=this.revenueType,e[w.REVENUE_CURRENCY]=this.currency,e[w.REVENUE]=this.revenue,e[w.RECEIPT]=this.receipt,e[w.RECEIPT_SIG]=this.receiptSig,e},e}();(a=w||(w={})).REVENUE_PRODUCT_ID="$productId",a.REVENUE_QUANTITY="$quantity",a.REVENUE_PRICE="$price",a.REVENUE_TYPE="$revenueType",a.REVENUE_CURRENCY="$currency",a.REVENUE="$revenue",a.RECEIPT="$receipt",a.RECEIPT_SIG="$receiptSig";var eM=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:eU(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),eU=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ej=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),eq=function(){return(eq=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function eB(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var eH=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=eF(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next())if(s.value===i)return e===t}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),u=Array.isArray(t);if(a!==u)return!1;if(a&&u){for(var l=0;ltypeof globalThis?globalThis:e.g,ez=function(){function e(){this.identityStore=new eG,this.eventBridge=new ej,this.applicationContextProvider=new eM}return e.getInstance=function(t){return eV.analyticsConnectorInstances||(eV.analyticsConnectorInstances={}),eV.analyticsConnectorInstances[t]||(eV.analyticsConnectorInstances[t]=new e),eV.analyticsConnectorInstances[t]},e}();e.s(["AnalyticsConnector",0,ez],344962);var eW=function(e){return void 0===e&&(e=q),ez.getInstance(e)},eK=function(e,t){eW(t).identityStore.editIdentity().setUserId(e).commit()},eJ=function(e,t){eW(t).identityStore.editIdentity().setDeviceId(e).commit()};e.s(["getAnalyticsConnector",0,eW,"setConnectorDeviceId",0,eJ,"setConnectorUserId",0,eK],264843);var e$=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},eX=function(){function e(){this.name="identity",this.type="before",this.identityStore=eW().identityStore}return e.prototype.execute=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){var t;return(0,R.__generator)(this,function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return e.instanceName&&(this.identityStore=eW(e.instanceName).identityStore),[2]})})},e}(),eY=function(){var e,t=(0,eh.getGlobalScope)();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var r=t.split("=",2),n=eQ(r[0]),i=eQ(r[1]);return i&&(e[n]=i),e},{}):{}},eQ=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},eZ=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}(),e0=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 eZ(e,t)}return e.prototype.subscribe=function(e,t,r){var n=em(),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,R.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,R.__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 callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,R.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){var r,n,i,o,s,a,u=this;return(0,R.__generator)(this,function(l){switch(l.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,s,a,l,c,d;return(0,R.__generator)(this,function(f){switch(f.label){case 0:i=!0,s=new AbortController,a=setTimeout(function(){return s.abort()},t),f.label=1;case 1:return f.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:s.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(a),[7];case 9:if(!i)return[2,"break"];if(!(n=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,R.__awaiter)(this,void 0,void 0,function(){var e,t,r,n;return(0,R.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=(0,R.__assign)({},this.inMemoryTags),t=(0,R.__assign)({},this.inMemoryCounters),r=(0,R.__assign)({},this.inMemoryHistograms),n=(0,R.__spreadArray)([],(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a,u,l;return(0,R.__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}),s={},r.forEach(function(e){s[e.key]=e.value}),a={},n.forEach(function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),u=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(s).length&&0===Object.keys(a).length&&0===u.length)return[2];return l={tags:o,histogram:a,counters:s,events:u},this.fetch(l),[2]}})})},e.prototype.fetch=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){var t;return(0,R.__generator)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!(0,eh.getGlobalScope)())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,R.__awaiter)(this,void 0,void 0,function(){var e,t,r;return(0,R.__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=e9(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),ts=e.i(427968),ta=ts.default||ts,tu=function(e,t){return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1},tl=function(e){return tu(e,"attribution")},tc=function(e){return tu(e,"formInteractions")},td=function(e){return tu(e,"pageViews")},tf=function(e){return tu(e,"sessions")},tp=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},tg=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},th=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},tv=function(e){if(tg(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},tm=function(e){if(th(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},ty=function(e){var t;if(tp(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,R.__assign)((0,R.__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),s=JSON.stringify(t.urls);return null==(i=e.loggerProvider)||i.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,R.__assign)((0,R.__assign)({},t),{hosts:void 0})}return t})})}},t_=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return td(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}},tb=function(e){return tl(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?(0,R.__assign)({},e.defaultTracking.attribution):{}},tw=function(e){if(tc(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},tE=function(e,t){for(var r=0;rtypeof 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,R.__awaiter)(this,void 0,void 0,function(){var n,i,o;return(0,R.__generator)(this,function(s){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,R.__assign)((0,R.__assign)((0,R.__assign)((0,R.__assign)((0,R.__assign)((0,R.__assign)((0,R.__assign)((0,R.__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:tT()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:em(),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}(),tC=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){var t;return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(r){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),tP=function(){var e,t=(0,eh.getGlobalScope)();return null==(e=null==t?void 0:t.navigator)?void 0:e.locks},tO=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,R.__assign)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,R.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,R.__generator)(this,function(o){switch(o.label){case 0:return t="AMP_TEST",r=new e((0,R.__assign)({},this.options)),n=String(Date.now()),[4,r.transaction(t,function(e){var r,o;try{e.set(n);var s=e.get()===n;return!s&&i.config.diagnosticsClient&&(null==(r=i.config.diagnosticsClient)||r.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:n,sync:!0})),s}catch(e){if(i.config.diagnosticsClient){var a=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:a,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,o.sent()]}})})},e.prototype.get=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){var t;return(0,R.__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=tD(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,R.__awaiter)(this,void 0,void 0,function(){var n,i,o,s,a,u,l,c;return(0,R.__generator)(this,function(d){switch(d.label){case 0:n=(0,eh.getGlobalScope)(),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(a=(s=(0,R.__values)(o)).next();!a.done;a=s.next())if(u=a.value,tL(u.domain,this.options.domain))return[2,u.value]}catch(e){l={error:e}}finally{try{a&&!a.done&&(c=s.return)&&c.call(s)}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=(0,eh.getGlobalScope)(),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+"=")}),s=void 0,a=this.config.duplicateResolverFn;if("function"==typeof a&&o.length>1&&(s=o.find(function(t){var r;try{var i=a(t.substring(e.length+1));return i||null==(r=n.config.diagnosticsClient)||r.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),s||(s=o[0]),s)return s.substring(e.length+1)},e.prototype.set=function(e,t){return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__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 s=new Date;s.setTime(s.getTime()+24*i*36e5),o=s}var a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite));var u=(0,eh.getGlobalScope)();(null==u?void 0:u.document)&&(u.document.cookie=a)}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,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(e){return[2]})})},e.isDomainWritable=function(t){return(0,R.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){var r,n,i=this;return(0,R.__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}(),tx=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tR=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},tD=function(e){var t;return null!=(t=tx(e))?t:tR(e)},tL=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()},tN=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),["AMP",t,e.substring(0,r)].filter(Boolean).join("_")},tM=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,R.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){var t;return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(r){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),tU=function(e){function t(t){var r,n,i,o=this;try{i=null==(r=(0,eh.getGlobalScope)())?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,R.__extends)(t,e),t.prototype.set=function(t,r){var n;return(0,R.__awaiter)(this,void 0,void 0,function(){var i;return(0,R.__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}(tM),tj=function(e){function t(){var t;return e.call(this,null==(t=(0,eh.getGlobalScope)())?void 0:t.sessionStorage)||this}return(0,R.__extends)(t,e),t}(tM),tq=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,s,a,u,l,c,d,f,p,g,h,v,m,y,_,w,E,S,T=e.code||0,k=this.buildStatus(T);switch(k){case b.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 b.Invalid:return{status:k,statusCode:T,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(s=e.events_with_invalid_fields)?s:{},eventsWithMissingFields:null!=(a=e.events_with_missing_fields)?a:{},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 b.PayloadTooLarge:return{status:k,statusCode:T,body:{error:null!=(h=e.error)?h:""}};case b.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!=(_=e.throttled_users)?_:{},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 b.Timeout:default:return{status:k,statusCode:T}}},e.prototype.buildStatus=function(e){return ex(e)?b.Success:429===e?b.RateLimit:413===e?b.PayloadTooLarge:408===e?b.Timeout:e>=400&&e<500?b.Invalid:e>=500?b.Failed:b.Unknown},e}();function tF(){return"u">typeof CompressionStream}function tB(e){return(0,R.__awaiter)(this,void 0,void 0,function(){var t;return(0,R.__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]}})})}e.s(["BaseTransport",0,tq],750095);var tH=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,R.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,R.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,R.__generator)(this,function(i){return[2,new Promise(function(i,o){"u"=2048&&tF(),c=function(e){var t,r;a=(0,R.__assign)((0,R.__assign)({},n.customHeaders),a);try{for(var i=(0,R.__values)(Object.entries(a)),o=i.next();!o.done;o=i.next()){var u=(0,R.__read)(o.value,2),l=u[0],c=u[1];s.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}}s.send(e)};(0,R.__awaiter)(n,void 0,void 0,function(){var e;return(0,R.__generator)(this,function(t){switch(t.label){case 0:if(!l)return[3,2];return[4,tB(u)];case 1:return(e=t.sent())?(a["Content-Encoding"]="gzip",c(e)):c(u),[3,3];case 2:c(u),t.label=3;case 3:return[2]}})}).catch(o)})]})})},t}(tq),tG=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return(0,R.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,R.__awaiter)(this,void 0,void 0,function(){var n,i,o,s,a,u,l;return(0,R.__generator)(this,function(c){switch(c.label){case 0:if("u"=2048&&tF(),o=n,s={"Content-Type":"application/json",Accept:"*/*"},!i)return[3,2];return[4,tB(n)];case 1:(a=c.sent())&&(s["Content-Encoding"]="gzip",o=a),c.label=2;case 2:return[4,fetch(e,{headers:s=(0,R.__assign)((0,R.__assign)({},this.customHeaders),s),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}(tq),tV=function(e){function t(){return e.call(this)||this}return(0,R.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,R.__awaiter)(this,void 0,void 0,function(){var r=this;return(0,R.__generator)(this,function(n){return[2,new Promise(function(n,i){var o=(0,eh.getGlobalScope)();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);if(o.navigator.sendBeacon(e,s))return n(r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}));return n(r.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(tq),tz=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},tW=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},tK="[Amplitude]",tJ="".concat(tK," Form Started"),t$="".concat(tK," Form Submitted"),tX="".concat(tK," File Downloaded"),tY="session_start",tQ="session_end",tZ="".concat(tK," File Extension"),t0="".concat(tK," File Name"),t1="".concat(tK," Link ID"),t2="".concat(tK," Link Text"),t3="".concat(tK," Link URL"),t4="".concat(tK," Form ID"),t5="".concat(tK," Form Name"),t6="".concat(tK," Form Destination"),t8="cookie",t7={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},t9=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},re=function(e,t,r,n,i,o){void 0===i&&(i=!0),e.referrer;var s=e.referring_domain,a=(0,R.__rest)(e,["referrer","referring_domain"]),u=t||{},l=(u.referrer,u.referring_domain),c=(0,R.__rest)(u,["referrer","referring_domain"]),d=r.excludeInternalReferrers;if(d){var f=ri(d,n);if(!(f instanceof TypeError)&&e.referring_domain&&ru(e.referring_domain,o)){if("always"===f)return ro(f,e.referring_domain,n),!1;else if("ifEmptyCampaign"===f&&Object.values((0,R.__assign)((0,R.__assign)({},e),{referring_domain:void 0,referrer:void 0})).every(function(e){return!e}))return ro(f,e.referring_domain,n),!1}}if(rt(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(a)!==JSON.stringify(c),g=t9(s||"")!==t9(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},rt=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})},rr=function(e,t){var r=t.startsWith(".")?t:".".concat(t);return!!(e.startsWith(".")?e:".".concat(e)).endsWith(r)},rn=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},ri=function(e,t){if(!0===e)return t7.always;if("object"==typeof e){var r=e.condition;if("string"==typeof r&&Object.keys(t7).includes(r))return r;if(void 0===r)return t7.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),TypeError(n)};function ro(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 rs=["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"],ra=function(e){var t,r,n=e||(null==(r=null==(t=(0,eh.getGlobalScope)())?void 0:t.location)?void 0:r.hostname);if(!n)return"";var i=n.split("."),o=i[i.length-1],s=i[i.length-2];return(rs.find(function(e){return n.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],s=i[i.length-3]),s)?"".concat(s,".").concat(o):o},ru=function(e,t){var r=(0,eh.getGlobalScope)();return!!r&&rr(e,(t||"").trim()||ra(r.location.hostname))},rl=function(e){function t(t,r,n,i,o,s,a,u,l,c,d,f,p,g,h,m,y,_,b,w,E,S,T,k,I,A,C,P,O,x,R,D,L,N,M,U,j,q,F,B,H,G,V,z,W){void 0===n&&(n=new tC),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=t8),void 0===m&&(m=new eI),void 0===y&&(y=v.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===T&&(T=""),void 0===k&&(k="US"),void 0===C&&(C=18e5),void 0===P&&(P=new tU({loggerProvider:m})),void 0===O&&(O={ipAddress:!0,language:!0,platform:!0}),void 0===x&&(x="fetch"),void 0===R&&(R=!1),void 0===D&&(D=!0),void 0===q&&(q=!0),void 0===F&&(F=0),void 0===V&&(V=!1),void 0===z&&(z=!1);var K,J=this;(J=e.call(this,{apiKey:t,storageProvider:P,transportProvider:rf(x)})||this).apiKey=t,J.appVersion=r,J.cookieOptions=i,J.defaultTracking=o,J.autocapture=s,J.flushIntervalMillis=u,J.flushMaxRetries=l,J.flushQueueSize=c,J.identityStorage=d,J.ingestionMetadata=f,J.instanceName=p,J.loggerProvider=m,J.logLevel=y,J.minIdLength=_,J.offline=b,J.partnerId=E,J.plan=S,J.serverUrl=T,J.serverZone=k,J.sessionTimeout=C,J.storageProvider=P,J.trackingOptions=O,J.transport=x,J.useBatch=R,J.fetchRemoteConfig=D,J.networkTrackingOptions=U,J.identify=j,J.enableDiagnostics=q,J.diagnosticsSampleRate=F,J.diagnosticsClient=B,J.remoteConfig=H,J.topLevelDomain=G,J.enableRequestBodyCompression=V,J._enableRequestBodyCompressionExperimental=z,J.customEnrichment=W,J.version=tk,J._optOut=!1,J._cookieStorage=n,J.deviceId=a,J.lastEventId=g,J.lastEventTime=h,J.optOut=w,J.deferredSessionId=A,J.sessionId=I,J.pageCounter=N,J.userId=L,J.debugLogsEnabled=M,J.loggerProvider.enable(M?v.Debug:J.logLevel),J.networkTrackingOptions=U,J.identify=j,J.enableDiagnostics=q,J.diagnosticsSampleRate=F,J.diagnosticsClient=B;var $=null!=(K=null==H?void 0:H.fetchRemoteConfig)?K:D;return J.remoteConfig=J.remoteConfig||{},J.remoteConfig.fetchRemoteConfig=$,J.fetchRemoteConfig=$,J.topLevelDomain=G||ra(),J}return(0,R.__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 tO&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(tN(this.apiKey),e)},t}(eC),rc=function(e,t,r){switch(void 0===e&&(e=t8),void 0===t&&(t={}),e){case"localStorage":return new tU;case"sessionStorage":return new tj;case"none":return new tC;default:return new tO((0,R.__assign)((0,R.__assign)({},t),{expirationDays:t.expiration}),r)}},rd=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},rf=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new tH(r):"beacon"===t?new tV:new tG(r)},rp="data-amp-mask",rg="*****",rh=/\b(?:\d[ -]*?){13,16}\b/,rv=/(\d{3}-?\d{2}-?\d{4})/g,rm=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,ry=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var r,n,i=e;i=(i=(i=i.replace(rh,rg)).replace(rv,rg)).replace(rm,rg);try{for(var o=(0,R.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,rg)}catch(e){}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},r_=function(e){if("u"typeof location&&location.href||""),n={event_type:c},r=[{}],[4,rT()];case 1:return[2,(n.event_properties=R.__assign.apply(void 0,[R.__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":r_(ry),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),n)]}})})},p=function(){return void 0===a||"function"==typeof a&&a()},g="u">typeof location?location.href:null,h=function(){(0,R.__awaiter)(void 0,void 0,void 0,function(){var e,r,i,s,a;return(0,R.__generator)(this,function(l){switch(l.label){case 0:if(r=rI(u,e=location.href,g||"")&&p(),g=e,!r)return[3,4];if(i=void 0,n&&(i=em(),n.set(rE,{pageViewId:i})),null==o||o.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return a=(s=t).track,[4,f(i)];case 2:a.apply(s,[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,a){return(0,R.__awaiter)(void 0,void 0,void 0,function(){var u,l,c;return(0,R.__generator)(this,function(d){switch(d.label){case 0:if(t=a,r=e,(o=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),s=!0,i&&(n=new tM(i.sessionStorage),i.addEventListener("popstate",h),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,r){var n=(0,R.__read)(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),s&&h()}})),!p())return[3,2];return o.log("Tracking page view event"),u=void 0,n&&(u=em(),n.set(rE,{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,R.__awaiter)(void 0,void 0,void 0,function(){var t,i,s;return(0,R.__generator)(this,function(u){switch(u.label){case 0:if(!("attribution"===a&&rk(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(rE)];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=(s=u.sent()).event_type,e.event_properties=(0,R.__assign)((0,R.__assign)({},e.event_properties),s.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,R.__assign)((0,R.__assign)({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}})})},teardown:function(){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(e){return i&&(i.removeEventListener("popstate",h),s=!1),[2]})})}}},rT=function(){return(0,R.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,R.__generator)(this,function(t){switch(t.label){case 0:return e=rw,[4,new rb().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},rk=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[m.SET]||{},n=t[m.UNSET]||{},i=(0,R.__spreadArray)((0,R.__spreadArray)([],(0,R.__read)(Object.keys(r)),!1),(0,R.__read)(Object.keys(n)),!1);return Object.keys(ea).every(function(e){return i.includes(e)})}return!1},rI=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},rA=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,R.__awaiter)(void 0,void 0,void 0,function(){var o,s;return(0,R.__generator)(this,function(a){return t=tw(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,s=function(e){if(!o.has(e)){o.add(e);var s=!1;n(e,"change",function(){var t,r=rP(e);s||i.track(tJ,((t={})[t4]=rC(e.id),t[t5]=rC(e.name),t[t6]=r,t)),s=!0}),n(e,"submit",function(n){var o,a,u=rP(e);if(s||i.track(tJ,((o={})[t4]=rC(e.id),o[t5]=rC(e.name),o[t6]=u,o)),s=!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(t$,((a={})[t4]=rC(e.id),a[t5]=rC(e.name),a[t6]=u,a)),s=!1})}};Array.from(document.getElementsByTagName("form")).forEach(s),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(s)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?o():(s=(0,eh.getGlobalScope)())?s.addEventListener("load",o):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return null==e||e.disconnect(),i(),[2]})})}}},rC=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},rO=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,R.__awaiter)(void 0,void 0,void 0,function(){var i,o;return(0,R.__generator)(this,function(s){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),s=null==i?void 0:i[1];s&&r(e,"click",function(){var r;s&&n.track(tX,((r={})[tZ]=s,r[t0]=t.pathname,r[t1]=e.id,r[t2]=e.text,r[t3]=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=(0,eh.getGlobalScope)())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return null==e||e.disconnect(),n(),[2]})})}}},rx=!1,rR=function(e){rx||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(, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),rx=!0)},rD=function(){var e=(0,eh.getGlobalScope)(),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,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(n){return"u"0&&setTimeout(function(){s(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,s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var a=(0,R.__values)(s),u=a.next();!u.done;u=a.next()){var l=u.value;t(l)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return(0,R.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,R.__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,s=i.endpoint;o&&(this.logger=o),s&&this.endpoint===rj&&(this.endpoint=s),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,s,a=e.data,u=null==a?void 0:a.action;if(u)if("id"in a&&a.id)null==(o=null==(i=n.logger)?void 0:i.debug)||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===u)return void n.notify({action:"pong"});var l=n.actionHandlers.get(u);if(l)l(a.data);else{var c=null!=(s=n.pendingMessages.get(u))?s:[];c.push(a.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=(0,eh.getGlobalScope)();(null==e?void 0:e[rH])===this&&delete e[rH]},e}();function rV(e){var t=(0,eh.getGlobalScope)(),r=null==t?void 0:t[rH];if("object"==typeof r&&null!==r&&rB in r&&!0===r[rB])return r;var n=new rG(e);return t&&(t[rH]=n),n}E=rB,e.s(["getOrCreateWindowMessenger",0,rV],615117);var rz="__AMPLITUDE_BACKGROUND_CAPTURE__";function rW(e,t){var r;if(!0!==e[rz]){e[rz]=!0;var n=null!=(r=null==t?void 0:t.scriptUrl)?r:rF,i=null,o=function(t,r){var n,i;"background-capture-complete"===t&&(null==(i=null==(n=e.logger)?void 0:n.debug)||i.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(){null==(r=null==(t=e.logger)?void 0:t.debug)||r.call(t,"Initializing background capture (external script)");var t,r,s=new URL(n,e.endpoint).toString();e.loadScriptOnce(s).then(function(){var t,r,n;null==(r=null==(t=e.logger)?void 0:t.debug)||r.call(t,"Background capture script loaded (external)"),i=null==(n=null==window?void 0:window.amplitudeBackgroundCapture)?void 0:n.call(window,{messenger:e,onBackgroundCapture:o}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null==(t=e.logger)||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null==(e=null==i?void 0:i.close)||e.call(i),i=null})}}e.s(["enableBackgroundCapture",0,rW],603709);var rK=e.i(523072);function rJ(e,t){return new rK.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 r$(e,t){return new rK.default(function(r){var n=!1,i=new Set,o=function(){var e,t;n=!0;try{for(var r=(0,R.__values)(i),o=r.next();!o.done;o=r.next()){var s=o.value;try{s.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()},s=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 s(e),s(t),o})}function rX(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new rK.default(function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){try{for(var r,n,i,o=(0,R.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;null==(i=a.next)||i.call(a,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},error:function(e){try{for(var r,i,o,s=(0,R.__values)(t),a=s.next();!a.done;a=s.next()){var u=a.value;null==(o=u.error)||o.call(u,e)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}n()},complete:function(){try{for(var e,r,i,o=(0,R.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;null==(i=a.complete)||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.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 rY="1.24.1",rQ="[Amplitude] Element Clicked",rZ="[Amplitude] Element Tag",r0="[Amplitude] Element Text",r1="[Amplitude] Page URL",r2="[Amplitude] Viewport Height",r3="[Amplitude] Viewport Width",r4="[Amplitude] Page View ID",r5="data-amp-mask-attributes",r6=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},r8=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},r7=["input","select","textarea"],r9=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},ne=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&r6(window.location.href,r))&&!!r6(window.location.href,t)},nt=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var o,s,a=e.shouldTrackEventResolver,u=null==(s=null==(o=null==i?void 0:i.tagName)?void 0:o.toLowerCase)?void 0:s.call(o);if(!u)return!1;if(a)return a(n,i);if(!ne(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=r9(i,n);if(r&&c)return!0;if(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}}},nr=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!r7.includes(i)&&!o},nn=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},{})},ni=function(){var e;try{var t=(0,eh.getGlobalScope)(),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){}},no=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:no(null==e?void 0:e.parentElement,t):null},ns=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor};(u=S||(S={}))[u.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",u[u.MIDDLE=1]="MIDDLE",u[u.RIGHT=2]="RIGHT";var na="__AMPLITUDE_VISUAL_TAGGING__",nu=rK,nl=(0,eh.getGlobalScope)(),nc=null==nl?void 0:nl.console,nd={},nf={},np=!1,ng=function(e,t){if(!nc||"function"!=typeof nc[e]||!nf[e]&&(nf[e]=nc[e],nc[e]=function(){for(var t=[],r=0;r=0;s--)if(o[s]===e){o.splice(s,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},nv=(0,eh.getGlobalScope)(),nm=function(){return new nu.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()}})},ny=function(e){return void 0===e&&(e="click"),new nu.default(function(t){var r,n=function(e){t.next(e)};return null==(r=(0,eh.getGlobalScope)())||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null==(t=(0,eh.getGlobalScope)())||t.document.removeEventListener(e,n,{capture:!0})}})},n_=function(){var e=r$(new nu.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,R.__assign)((0,R.__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 nv.addEventListener("error",t),function(){nv.removeEventListener("error",t)}}),new nu.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 nv.addEventListener("unhandledrejection",t),function(){nv.removeEventListener("unhandledrejection",t)}}));return r$(e,new nu.default(function(e){var t=function(t){for(var r=[],n=1;n ")},nL=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 nR(c(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new nR(s,!0)}var a=e.tagName.toLowerCase();if(o)return new nR(a+c(o),!0);var u=e.parentNode;if(!u||u.nodeType===Node.DOCUMENT_NODE)return new nR(a,!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=0;c--){var d=u[c];if(d){var f,p=(f=d.getAttribute(r5))?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,R.__spreadArray)((0,R.__spreadArray)([],(0,R.__read)(g),!1),(0,R.__read)(p),!1));l.set(d,h)}}a=u.map(function(e){var t;return function(e,t){if(null===e)return null;var r,n,i,o,s,a,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==(a=null==(s=e.previousElementSibling)?void 0:s.tagName)?void 0:a.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!nC.has(e.name)}),v=!nr(e);if(!nx.includes(String(e.getAttribute("type")))&&!nO.includes(u))try{for(var m=(0,R.__values)(h),y=m.next();!y.done;y=m.next()){var _=y.value;if(!v||nP.includes(_.name)){if(t.has(_.name)){g[_.name]=rg;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,R.__read)(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))})};try{for(var m=(0,R.__values)(a),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-s),a},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=nD(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,s,a,u=null==(s=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:s.call(i),l="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},c=o.getHierarchy(t),d=null==(a=c[0])?void 0:a.attrs,f=o.getNearestLabel(t),p=Object.entries(null!=d?d:{}).reduce(function(e,t){var n=(0,R.__read)(t,2),i=n[0],o=n[1];if(i.startsWith(r)){var s=i.replace(r,"");s&&(e[s]=o||"")}return e},{}),g=((n={})["[Amplitude] Element Hierarchy"]=c,n[rZ]=u,n[r0]=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[r1]=r8(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=r_(o.replaceSensitiveString),n[r2]=window.innerHeight,n[r3]=window.innerWidth,n),h=ni();if(h&&(g[r4]=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 nn(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 s=o.addTypeAndTimestamp(e,t);if(("click"===s.type||"change"===s.type)&&null!==s.event.target){if(i&&r9(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=no(s.event.target,r);a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,n))}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=nw(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(rp,"], [contenteditable]");if(!e.querySelector(n))return e.innerText;var i="",s=Array.from(e.childNodes);try{for(var a=(0,R.__values)(s),u=a.next();!u.done;u=a.next()){var l=u.value;if(l.nodeType===Node.TEXT_NODE){i+=l.textContent||"";continue}if(l instanceof Element){if(l.hasAttribute(rp)||l.hasAttribute("contenteditable")){i+=rg;continue}i+=o.getTextWithMaskedDescendants(l)}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(rp,"]")))return rg;var t="";return t=e.querySelector("[".concat(rp,"], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveString(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 nn(((t={})[rZ]=i,t[r0]=o.getText(e),t[r1]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!=(i=e.maskTextRegex)?i:[],a=[];try{for(var u=(0,R.__values)(s),l=u.next();!l.done;l=u.next()){var c=l.value;if(a.length>=25)break;if(c instanceof RegExp)a.push(c);else if("pattern"in c&&"string"==typeof c.pattern)try{a.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=a},nu=rK;(l=T||(T={})).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",rY);var r,n,i,o,s,a,u,l,c,d,f,p,g=e.dataAttributePrefix,h=void 0===g?rM:g,v=e.visualTaggingOptions,m=void 0===v?{enabled:!0}:v;e.cssSelectorAllowlist=null!=(r=e.cssSelectorAllowlist)?r:rN,e.actionClickAllowlist=null!=(n=e.actionClickAllowlist)?n:rU,e.debounceTime=null!=(i=e.debounceTime)?i:0;var y=null!=(a=null!=(s=null==(o=e.viewportContentUpdated)?void 0:o.exposureDuration)?s:e.exposureDuration)?a:150;e.viewportContentUpdated=(0,R.__assign)((0,R.__assign)({},e.viewportContentUpdated),{exposureDuration:y}),e.pageUrlExcludelist=null==(u=e.pageUrlExcludelist)?void 0:u.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 _="@amplitude/plugin-autocapture-browser",b=[],w=new nN(e,t),E=new Set,S=new Set,k=function(){var t,r,n,i=rX(ny().map(function(t){return w.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,h)})),o=rX(new nu.default(function(t){var r,n=function(r){var n=w.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,h);t.next(n)};return null==(r=(0,eh.getGlobalScope)())||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null==(e=(0,eh.getGlobalScope)())?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(n=rX(new nu.default(function(t){var r=function(r){var n=w.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,h);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var s=rX(nm().map(function(t){return w.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,h)})),a=new nu.default(function(e){var t,r=function(t){e.next(t)};return null==(t=(0,eh.getGlobalScope)())||t.addEventListener("scroll",r),function(){var e;null==(e=(0,eh.getGlobalScope)())||e.removeEventListener("scroll",r)}}),u=(t=e.cssSelectorAllowlist,new nu.default(function(e){var r,n=(0,eh.getGlobalScope)();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 a=s.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(){a.unsubscribe(),i.disconnect()}}));return(r={})[T.ChangeObservable]=o,r[T.ClickObservable]=i,r[T.MutationObservable]=s,r[T.NavigateObservable]=n,r[T.ScrollObservable]=a,r[T.ExposureObservable]=u,r},I=nT(Object.values(null!=(c=null==(l=e.pageActions)?void 0:l.labeledEvents)?c:{})),A=nk(null!=(f=null==(d=e.pageActions)?void 0:d.triggers)?f:[]),C=new nA(I,A,w,e),P=function(t){var r,n;t&&(e.pageActions=(0,R.__assign)((0,R.__assign)({},e.pageActions),t),I=nT(Object.values(null!=(r=e.pageActions.labeledEvents)?r:{})),A=nk(null!=(n=e.pageActions.triggers)?n:[]),C.update(I,A,e))};return{name:_,type:"enrichment",setup:function(t,r){return(0,R.__awaiter)(void 0,void 0,void 0,function(){var n,i,o,s,a,u,l,c,d,f,g,v,I,A,O,x,D,L,N,M;return(0,R.__generator)(this,function(U){var j,q,F,B,H,G,V,z,W,K,J,$,X,Y,Q,Z,ee,et,er,en,ei,eo,es,ea,eu,el,ec,ed,ef,ep,eg,ev,em,ey,e_,eb,ew,eE,eS;return"u"=18e3&&v(!1))},dataExtractor:w,exposureDuration:y}).allObservables,em=eg.onExposure,ey=eg.dataExtractor,eb=void 0===(e_=eg.exposureDuration)?150:e_,ew=new Map,eE=new Map,eS=ev.exposureObservable.subscribe(function(e){var t=e.target;if(e.isIntersecting){if(!ew.get(t)){var r=setTimeout(function(){ew.set(t,!0),em(ey.getElementPath(t)),eE.set(t,null)},eb);eE.set(t,r)}}else if(!e.isIntersecting&&e.intersectionRatio<1){var r=eE.get(t);r&&(clearTimeout(r),eE.set(t,null))}}),f.exposure={unsubscribe:function(){eS.unsubscribe()},reset:function(){eE.forEach(function(e){e&&clearTimeout(e)}),eE.clear(),ew.clear()}},f.exposure&&b.push(f.exposure),I=function(){v(!0)},null==g||g.addEventListener("beforeunload",I),p=function(){null==g||g.removeEventListener("beforeunload",I)},b.push({unsubscribe:function(){return p()}}),(A=a[T.NavigateObservable])?b.push(A.subscribe(function(){v(!0)})):g&&(O=function(){v(!0)},g.addEventListener("popstate",O),x=g.history.pushState,g.history&&x&&(g.history.pushState=new Proxy(x,{apply:function(e,t,r){var n=(0,R.__read)(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),v(!0)}})),b.push({unsubscribe:function(){g.removeEventListener("popstate",O),g.history&&x&&(g.history.pushState=x)}})),null==(M=null==t?void 0:t.loggerProvider)||M.log("".concat(_," has been successfully added.")),window.opener&&m.enabled&&(D=e.cssSelectorAllowlist,L=e.actionClickAllowlist,!function(e,t){if(!0!==e[na]){e[na]=!0;var r=t.dataExtractor,n=t.isElementSelectable,i=t.cssSelectorAllowlist,o=t.actionClickAllowlist,s=null,a=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;s=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:a,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:i,actionClickAllowlist:o,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:rY}}}),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==s?void 0:s.close)||e.call(s)})}}(N=rV(),{dataExtractor:w,isElementSelectable:nt(e,(0,R.__spreadArray)((0,R.__spreadArray)([],(0,R.__read)(D),!1),(0,R.__read)(L),!1)),cssSelectorAllowlist:D,actionClickAllowlist:L}),rW(N),N.setup((0,R.__assign)({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:rq[t.serverZone]}))),[2])})})},execute:function(e){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,R.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n;return(0,R.__generator)(this,function(i){try{for(t=(e=(0,R.__values)(b)).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]})})}}},nu=rK,nU=(0,R.__spreadArray)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,R.__read)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),nj=["*"],nq=["mutation","navigate"];function nF(e,t){var r,n,i,o,s=t.event,a=s.pageX,u=s.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:a,a),e.xMax=Math.max(null!=(o=e.xMax)?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function nB(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:(0,R.__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 nu=rK;(c=k||(k={})).INCREASING="increasing",c.DECREASING="decreasing",(d=I||(I={})).X="x",d.Y="y";var nH=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new nu.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===k.DECREASING&&e.next(I.X),n=k.INCREASING):o.xr.y?(i===k.DECREASING&&e.next(I.Y),i=k.INCREASING):o.yc&&l.shift();var t,n,l,c,d=function(e,t){var r=void 0;if(nG(e)&&(r=e.startTime),nG(t)){var n=t.startTime;n&&(!r||n0&&n[n.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(o=Math.max(0,(i=a).length-4+1),s=i[o],e.timestamp-s.timestamp>=1e3)||u.isOutOfBounds)?(l&&(t=nB(a)),c(e)):a.push(e),(l&&(clearTimeout(l.timerId),l.resolve(t),l=null),a.length>=4)?[2,new Promise(function(e){l={resolve:e,timerId:setTimeout(function(){e(nB(a))},1e3)}})]:[2,null]})})}),f=null==s?void 0:s.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:nt(e,u)}),n.push(v)),o&&(I=(k={amplitude:p,allObservables:h,getEventProperties:function(e,t){return f.getEventProperties(e,t,d)},shouldTrackDeadClick:nt(e,l)}).amplitude,A=k.allObservables,C=k.getEventProperties,P=k.shouldTrackDeadClick,O=A.clickObservable,x=A.mutationObservable,D=A.navigateObservable,L=O.filter(function(e){return ns(e)&&P("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===S.LEFT_OR_TOUCH_CONTACT}),N=D?r$(x,D):x,M=r$(L,N),U=null,m=rJ(M,function(e){if(U&&nq.includes(e.type))clearTimeout(U),U=null;else if("click"===e.type)return U?Promise.resolve(null):new Promise(function(t){U=setTimeout(function(){t(e),U=null},3e3)});return Promise.resolve(null)}).subscribe(function(e){if(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};I.track("[Amplitude] Dead Click",(0,R.__assign)((0,R.__assign)({},C("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}}),n.push(m)),i&&(q=(j={amplitude:p,allObservables:h,shouldTrackErrorClick:nt(e,c)}).amplitude,F=j.allObservables,B=j.shouldTrackErrorClick,H=F.clickObservable,G=F.browserErrorObservable,V=H.filter(function(e){return ns(e)&&B("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===S.LEFT_OR_TOUCH_CONTACT}),z=null,W=null,K=function(){null!==z&&(clearTimeout(z),z=null),W=null},y=r$(V,G).subscribe(function(e){var t;if("click"===e.type){K(),W=e,z=setTimeout(K,2e3);return}"error"===e.type&&W&&(q.track("[Amplitude] Error Click",(0,R.__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),W.targetElementProperties)),K())}),n.push(y)),a&&(_=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=nK({amplitude:p,options:e,allObservables:h,directionChanges:_,thresholdMs:b}),n.push(w)),null==(E=null==t?void 0:t.loggerProvider)||E.log("".concat(r," has been successfully added.")),[2])})})},execute:function(e){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,R.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,i;return(0,R.__generator)(this,function(o){try{for(t=(e=(0,R.__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 nX(e,t,r){e&&function e(t){var r,n,i=t.json,o=t.targetObject,s=t.allowlist,a=t.excludelist,u=t.ancestors,l=t.parentObject,c=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var f=(0,R.__values)(d),p=f.next();!p.done;p=f.next()){var g,h=p.value,v=(0,R.__spreadArray)((0,R.__spreadArray)([],(0,R.__read)(u),!1),[h],!1);(g=o[h],"string"==typeof g||"number"==typeof g||"boolean"==typeof g||null==g)?(!nQ(v,s)||nQ(v,a))&&delete o[h]:e({json:i,targetObject:o[h],allowlist:s,excludelist:a,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(nY),excludelist:r.map(nY),ancestors:[]})}function nY(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function nQ(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=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 n2=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}),n6(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,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__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,R.__awaiter)(this,void 0,void 0,function(){return(0,R.__generator)(this,function(r){switch(r.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,n4(r.sent(),e,t)]}})})},e}(),n3=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,R.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value,u=(0,R.__read)(a.split(": "),2),l=u[0],c=u[1];l&&c&&(n[l]=c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n6(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,R.__awaiter)(this,void 0,void 0,function(){var r;return(0,R.__generator)(this,function(n){return 0===e.length?[2,null]:(r=this.getJson())?(nX(r,e,t),[2,r]):[2,null]})})},e}();function n4(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return nX(n,t,r),n}catch(e){return null}}(f=A||(A={})).REDACT="redact",f.REMOVE="remove";var n5="[REDACTED]",n6=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?A.REMOVE:s,u=(0,R.__spreadArray)([],(0,R.__read)(el),!1),l={};try{for(var c=(0,R.__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})?a===A.REDACT&&(l[t]=n5):o.find(function(e){return e.toLowerCase()===r})?l[t]=e[t]:a===A.REDACT&&(l[t]=n5)}(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},n8=function(){function e(e,t,r,n,i,o,s,a,u,l,c){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=u,this.error=l,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,r,n;return Object.fromEntries(Object.entries({type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null==(e=this.requestWrapper)?void 0:e.headers((0,R.__spreadArray)([],(0,R.__read)(eu),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(r=this.responseWrapper)?void 0:r.headers((0,R.__spreadArray)([],(0,R.__read)(eu),!1)),responseBodySize:null==(n=this.responseWrapper)?void 0:n.bodySize}).filter(function(e){var t=(0,R.__read)(e,2);return void 0!==(t[0],t[1])}))},e}(),n7=function(e,t){void 0===t&&(t=em()),this.callback=e,this.id=t};function n9(e){try{e()}catch(e){}}var ie=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=(0,eh.getGlobalScope)();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=(0,eh.getGlobalScope)();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,s,a,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==(a=null==(s=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:s.prototype)?void 0:a.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){n9(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,s){if(void 0!==o&&void 0!==s){var a,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==(a=null==t?void 0:t.toString)?void 0:a.call(t),u)try{var f=new URL(u);u="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}d=(null==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()-s),g=Math.floor(o+p),h=new n8(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,R.__awaiter)(t,void 0,void 0,function(){var t,i,o,s=this;return(0,R.__generator)(this,function(a){switch(a.label){case 0:try{t=this.getTimestamps()}catch(e){n9(function(){var t;return null==(t=s.logger)?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=a.sent(),[3,4];case 3:return o=a.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new nZ(n):void 0,i?new n2(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){n9(function(){var t;return null==(t=s.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&&n9(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=l&&e<=c)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function is(e){var t;if(e)try{var r=null==(t=(0,eh.getGlobalScope)())?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),s=n.href,a=n.host;n.hash="",n.search="";var u=n.href;return{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:u,host:a}}catch(e){return}}function ia(e){return"object"!=typeof e||null===e?e?(0,R.__spreadArray)([],(0,R.__read)(eu),!1):void 0:0!==e.length?e:void 0}function iu(e){var t,r;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)}(C||(C={})).NetworkObservable="networkObservable";var il=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new nu.default(function(e){var r=new n7(function(t){var r={event:t,timestamp:Date.now(),type:"network"};e.next(r)});return ie.subscribe(r,t),function(){ie.unsubscribe(r)}});return(e={})[C.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,o){return(0,R.__awaiter)(void 0,void 0,void 0,function(){var s;return(0,R.__generator)(this,function(a){var u,l,c,d,f;return"u"{addEventListener("pageshow",t=>{t.persisted&&(ic=t.timeStamp,e(t))},!0)},ip=(e,t,r,n)=>{let i,o;return s=>{let a;t.value>=0&&(s||n)&&((o=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=o,a=t.value,t.rating=a>r[1]?"poor":a>r[0]?"needs-improvement":"good",e(t))}},ig=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},ih=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart{let e=ih();return e?.activationStart??0},im=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=ih(),n="navigate";return ic>=0?n="back-forward-cache":r&&(document.prerendering||iv()>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}},iy=new WeakMap;function i_(e,t){return iy.get(e)||iy.set(e,new t),iy.get(e)}class ib{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 iw=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};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{}},iE=e=>{let t=!1;return()=>{t||(e(),t=!0)}},iS=-1,iT=new Set,ik=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,iI=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of iT)e();isFinite(iS)||(iS="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",iI,!0))}},iA=()=>{if(iS<0){let e=iv();iS=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??ik(),addEventListener("visibilitychange",iI,!0),addEventListener("prerenderingchange",iI,!0),id(()=>{setTimeout(()=>{iS=ik()})})}return{get firstHiddenTime(){return iS},onHidden(e){iT.add(e)}}},iC=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},iP=[1800,3e3],iO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};iC(()=>{let r=iA(),n,i=im("FCP"),o=iw("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime{n=ip(e,i=im("FCP"),iP,t.reportAllChanges),ig(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},ix=[.1,.25],iR=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=iA();iO(iE(()=>{let n,i=im("CLS",0),o=i_(t,ib),s=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},a=iw("layout-shift",s);a&&(n=ip(e,i,ix,t.reportAllChanges),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),id(()=>{o.i=0,n=ip(e,i=im("CLS",0),ix,t.reportAllChanges),ig(()=>n())}),setTimeout(n))}))},iD=0,iL=1/0,iN=0,iM=e=>{for(let t of e)t.interactionId&&(iL=Math.min(iL,t.interactionId),iD=(iN=Math.max(iN,t.interactionId))?(iN-iL)/7+1:0)},iU=()=>t?iD:performance.interactionCount??0,ij=0;class iq{u=[];l=new Map;m;p;v(){ij=iU(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((iU()-ij)/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)=>t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(r)}}}let iF=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=iE(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},iB=[200,500],iH=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let n=iA();iC(()=>{"interactionCount"in performance||t||(t=iw("event",iM,{type:"event",buffered:!0,durationThreshold:0}));let i,o=im("INP"),s=i_(r,iq),a=e=>{iF(()=>{for(let t of e)s.h(t);let t=s.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},u=iw("event",a,{durationThreshold:r.durationThreshold??40});i=ip(e,o,iB,r.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{a(u.takeRecords()),i(!0)}),id(()=>{s.v(),i=ip(e,o=im("INP"),iB,r.reportAllChanges)}))})};class iG{m;h(e){this.m?.(e)}}let iV=[2500,4e3],iz=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};iC(()=>{let r=iA(),n,i=im("LCP"),o=i_(t,iG),s=e=>{for(let s of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(s),s.startTime{s(a.takeRecords()),a.disconnect(),n(!0)}),o=e=>{e.isTrusted&&(iF(r),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});id(r=>{n=ip(e,i=im("LCP"),iV,t.reportAllChanges),ig(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})},iW=[800,1800],iK=e=>{document.prerendering?iC(()=>iK(e)):"complete"!==document.readyState?addEventListener("load",()=>iK(e),!0):setTimeout(e)},iJ=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=im("TTFB"),n=ip(e,r,iW,t.reportAllChanges);iK(()=>{let i=ih();i&&(r.value=Math.max(i.responseStart-iv(),0),r.entries=[i],n(!0),id(()=>{(n=ip(e,r=im("TTFB",0),iW,t.reportAllChanges))(!0)}))})};function i$(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 iX=function(){var e=null,t=(0,eh.getGlobalScope)(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return(0,R.__awaiter)(void 0,void 0,void 0,function(){var o,s;return(0,R.__generator)(this,function(a){return void 0===r||(o=r8((null==n?void 0:n.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":r8((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":r8(o.split("?")[0],t.loggerProvider)},iz(function(e){s["[Amplitude] LCP"]=i$(e)}),iO(function(e){s["[Amplitude] FCP"]=i$(e)}),iH(function(e){s["[Amplitude] INP"]=i$(e)}),iR(function(e){s["[Amplitude] CLS"]=i$(e)}),iJ(function(e){s["[Amplitude] TTFB"]=i$(e)}),e=function(){"hidden"===r.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}},iY=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),["AMP",t,e.substring(0,r)].filter(Boolean).join("_")},iQ=function(){function e(e,t){var r;this.shouldTrackNewCampaign=!1,this.options=(0,R.__assign)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:rn((null==(r=t.cookieOptions)?void 0:r.domain)||t.topLevelDomain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=iY(t.apiKey,"MKTG"),this.webExpStorageKey=iY(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=ea,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,R.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,R.__generator)(this,function(r){switch(r.label){case 0:if(this.options.optOut)return[2];return[4,this.fetchCampaign()];case 1:if(t=R.__read.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||e$(this.sessionTimeout,this.lastEventTime),!re(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,R.__awaiter)(this,void 0,void 0,function(){var e;return(0,R.__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 rb().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,e_(Object.entries((0,R.__assign)((0,R.__assign)({},ea),t)).reduce(function(e,t){var n,i=(0,R.__read)(t,2),o=i[0],s=i[1];return(e.setOnce("initial_".concat(o),null!=(n=null!=s?s:r.initialEmptyValue)?n:"EMPTY"),s)?e.set(o,s):e.unset(o)},new ef)));return e&&(n.event_id=e),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),iZ="AMP_CURRENT_PAGE",i0="AMP_PREVIOUS_PAGE",i1="AMP_URL_INFO";(p=O||(O={})).Direct="direct",p.Internal="internal",p.External="external";var i2=new Set([y.IDENTIFY,y.GROUP_IDENTIFY,y.REVENUE]),i3=function(e){var t=(void 0===e?{}:e).internalDomains,r=void 0===t?[]:t,n=(0,eh.getGlobalScope)(),i=void 0,o=!1,s=void 0,a=!1,u=!1,l=function(e){var t;try{var r=r8(e,s);t=new URL(r).hostname}catch(e){null==s||s.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(){(0,R.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,s;return(0,R.__generator)(this,function(a){switch(a.label){case 0:if(!(i&&o))return[3,3];return[4,i.get(i1)];case 1:return e=a.sent(),t=r8("u">typeof location&&location.href||""),r=(null==e?void 0:e[iZ])||"",n=void 0,n=t===r?(null==e?void 0:e[i0])||"":r||document.referrer||"",[4,i.set(i1,((s={})[iZ]=t,s[i0]=n,s))];case 2:a.sent(),a.label=3;case 3:return[2]}})})};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(t){switch(t.label){case 0:if((s=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!n)return[3,2];return[4,(i=new tM(n.sessionStorage)).isEnabled()];case 1:o=t.sent(),n.addEventListener("popstate",d),a||(n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=(0,R.__read)(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),u&&d()}}),n.history.replaceState=new Proxy(n.history.replaceState,{apply:function(e,t,r){var n=(0,R.__read)(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),u&&d()}}),a=!0),t.label=2;case 2:return[2]}})})},execute:function(e){return(0,R.__awaiter)(void 0,void 0,void 0,function(){var t,r,n,s,a;return(0,R.__generator)(this,function(u){switch(u.label){case 0:if(t=r8("u">typeof location&&location.href||""),!(i&&o))return[3,5];return[4,i.get(i1)];case 1:if(null==(r=u.sent())?void 0:r[iZ])return[3,3];return[4,i.set(i1,((a={})[iZ]=t,a[i0]=document.referrer||"",a))];case 2:u.sent(),u.label=3;case 3:return[4,i.get(i1)];case 4:if(n=u.sent(),s="",n&&(s=n[i0]||""),i2.has(e.event_type))return[2,e];e.event_properties=(0,R.__assign)((0,R.__assign)({},e.event_properties||{}),{"[Amplitude] Page Domain":i4(e,"[Amplitude] Page Domain","u">typeof location&&location.hostname||""),"[Amplitude] Page Location":i4(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":i4(e,"[Amplitude] Page Path","u">typeof location&&r8(location.pathname)||""),"[Amplitude] Page Title":i4(e,"[Amplitude] Page Title",r_(ry)),"[Amplitude] Page URL":i4(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":s,"[Amplitude] Previous Page Type":c(s)}),u.label=5;case 5:return[2,e]}})})},teardown:function(){return(0,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(e){switch(e.label){case 0:if(n&&(n.removeEventListener("popstate",d),u=!1),!(i&&o))return[3,2];return[4,i.set(i1,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function i4(e,t,r){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?r:e.event_properties[t]}var i5=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,R.__awaiter)(void 0,void 0,void 0,function(){var o,s;return(0,R.__generator)(this,function(a){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null==(s=i.remoteConfig)?void 0:s.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,R.__awaiter)(void 0,void 0,void 0,function(){var n;return(0,R.__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,R.__awaiter)(void 0,void 0,void 0,function(){return(0,R.__generator)(this,function(e){return t&&t(),[2]})})}}};let i6={init:U((g=new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t._enableRequestBodyCompressionExperimentalValue=!1,t}return(0,R.__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),eE(this._init((0,R.__assign)((0,R.__assign)({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,o,s,a,u,l;return(0,R.__awaiter)(this,void 0,void 0,function(){var c,d,f,p,g,h,m,y,_,b,w,E,S,T,k=this;return(0,R.__generator)(this,function(I){var A,C,P,O,x,D,L;switch(I.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,c=rd(t),d=null!=(r=t.loggerProvider)?r:new eI,t.loggerProvider||d.enable(null!=(n=t.logLevel)?n:v.Warn),f=null!=(i=t.serverZone)?i:"US",g=this._diagnosticsSampleRate,h=null==(o=t.enableDiagnostics)||o,!c)return[3,2];return p=new e0(t.apiKey,d,f,null==(s=t.remoteConfig)?void 0:s.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&&(h=o)}e()})})];case 1:I.sent(),I.label=2;case 2:return(m=new to(t.apiKey,d,f,{enabled:h,sampleRate:g})).setTag("library","".concat(tI,"/").concat(tk)),"u">typeof navigator&&m.setTag("user_agent",navigator.userAgent),[4,(A=t.apiKey,C=t,P=this,O=m,x={loggerProvider:d,serverZone:f,enableDiagnostics:h,diagnosticsSampleRate:g},void 0===C&&(C={}),(0,R.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,s,a,u,l,c,d,f,p,g,h,v,m,y,_,b,w,E,S,T,k,I,D,L,N,M,U,j,q,F,B,H,G,V,z,W,K,J,$,X,Y,Q,Z,ee,et,er;return(0,R.__generator)(this,function(en){var ei,eo,es,ea;switch(en.label){case 0:if(e=C.identityStorage||t8,t="",!(e===t8&&!(null==(w=C.cookieOptions)?void 0:w.domain)&&(null==(E=C.cookieOptions)?void 0:E.domain)!==""))return[3,2];return[4,(ei=void 0,eo=O,(0,R.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,s;return(0,R.__generator)(this,function(a){switch(a.label){case 0:return[4,new tO(void 0,{diagnosticsClient:eo}).isEnabled()];case 1:if(!a.sent()||!ei&&("u"=0;--i)r.push(t.slice(i).join("."));i=0,a.label=2;case 2:if(!(i1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},t.prototype._enableRequestBodyCompressionExperimental=function(e){if(!this.config){this._enableRequestBodyCompressionExperimentalValue=e;return}},t}(eS))).init.bind(g),"init",L(g),M(g,["config"])),add:U(g.add.bind(g),"add",L(g),M(g,["config.apiKey","timeline.plugins"])),remove:U(g.remove.bind(g),"remove",L(g),M(g,["config.apiKey","timeline.plugins"])),track:U(g.track.bind(g),"track",L(g),M(g,["config.apiKey","timeline.queue.length"])),logEvent:U(g.logEvent.bind(g),"logEvent",L(g),M(g,["config.apiKey","timeline.queue.length"])),identify:U(g.identify.bind(g),"identify",L(g),M(g,["config.apiKey","timeline.queue.length"])),groupIdentify:U(g.groupIdentify.bind(g),"groupIdentify",L(g),M(g,["config.apiKey","timeline.queue.length"])),setGroup:U(g.setGroup.bind(g),"setGroup",L(g),M(g,["config.apiKey","timeline.queue.length"])),revenue:U(g.revenue.bind(g),"revenue",L(g),M(g,["config.apiKey","timeline.queue.length"])),flush:U(g.flush.bind(g),"flush",L(g),M(g,["config.apiKey","timeline.queue.length"])),getUserId:U(g.getUserId.bind(g),"getUserId",L(g),M(g,["config","config.userId"])),setUserId:U(g.setUserId.bind(g),"setUserId",L(g),M(g,["config","config.userId"])),getDeviceId:U(g.getDeviceId.bind(g),"getDeviceId",L(g),M(g,["config","config.deviceId"])),setDeviceId:U(g.setDeviceId.bind(g),"setDeviceId",L(g),M(g,["config","config.deviceId"])),reset:U(g.reset.bind(g),"reset",L(g),M(g,["config","config.userId","config.deviceId"])),getSessionId:U(g.getSessionId.bind(g),"getSessionId",L(g),M(g,["config"])),setSessionId:U(g.setSessionId.bind(g),"setSessionId",L(g),M(g,["config"])),extendSession:U(g.extendSession.bind(g),"extendSession",L(g),M(g,["config"])),setOptOut:U(g.setOptOut.bind(g),"setOptOut",L(g),M(g,["config"])),setTransport:U(g.setTransport.bind(g),"setTransport",L(g),M(g,["config"])),getIdentity:U(g.getIdentity.bind(g),"getIdentity",L(g),M(g,["config"])),setIdentity:U(g.setIdentity.bind(g),"setIdentity",L(g),M(g,["config","config.userId","config.deviceId"])),getOptOut:U(g.getOptOut.bind(g),"getOptOut",L(g),M(g,["config"])),_setDiagnosticsSampleRate:U(g._setDiagnosticsSampleRate.bind(g),"_setDiagnosticsSampleRate",L(g),M(g,["config"])),_enableRequestBodyCompressionExperimental:U(g._enableRequestBodyCompressionExperimental.bind(g),"_enableRequestBodyCompressionExperimental",L(g),M(g,["config"]))};e.s([],168565),e.i(168565),(h=x||(x={})).US="US",h.EU="EU",h.STAGING="STAGING",e.s(["ServerZone",0,x],724896),e.s(["DEFAULT_ACTION_CLICK_ALLOWLIST",0,rU,"DEFAULT_CSS_SELECTOR_ALLOWLIST",0,rN,"DEFAULT_DATA_ATTRIBUTE_PREFIX",0,rM,"EXCLUDE_INTERNAL_REFERRERS_CONDITIONS",0,t7,"IdentifyOperation",0,m,"LogLevel",0,v,"OfflineDisabled",0,null,"RevenueProperty",0,w,"ServerZone",0,x,"SpecialEventType",0,y],158377),e.i(158377);var i8=i6.add,i7=(i6.extendSession,i6.flush,i6.getDeviceId,i6.getIdentity,i6.getOptOut,i6.getSessionId,i6.getUserId,i6.groupIdentify,i6.identify),i9=i6.init,oe=(i6.logEvent,i6.remove,i6.reset),ot=(i6.revenue,i6.setDeviceId,i6.setGroup,i6.setIdentity,i6.setOptOut,i6.setSessionId,i6.setTransport,i6.setUserId),or=i6.track;i6._setDiagnosticsSampleRate,i6._enableRequestBodyCompressionExperimental,e.s(["add",0,i8,"identify",0,i7,"init",0,i9,"reset",0,oe,"setUserId",0,ot,"track",0,or],203218)}]);