PageSourceSearch

https://addx.co/_next/static/chunks/ad588e3ab3d4cda7d0fba9f988baf6cd15769e08.f3bd3f0784480bd2e64a.js

js addx.co collected 2026-10-02 03:42:20 UTC 146,462 bytes, 1 lines download raw bytes

1(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[16],{"2fq0":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return f}));var r=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:i(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),i=function(){return"undefined"!==typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},o=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}(),s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}"function"===typeof SuppressedError&&SuppressedError;var c=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=a(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(h){n={error:h}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var u=Array.isArray(e),l=Array.isArray(t);if(u!==l)return!1;if(!u||!l){var d=Object.keys(e).sort(),f=Object.keys(t).sort();if(!c(d,f))return!1;var p=!0;return Object.keys(e).forEach((function(n){c(e[n],t[n])||(p=!1)})),p}for(var v=0;v<e.length;v++)if(!c(e[v],t[v]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var l=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=s({},this.identity.userProperties),n=s(s({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,c,l=n.userProperties||{};try{for(var d=a(Object.entries(e)),f=d.next();!f.done;f=d.next()){var p=u(f.value,2),v=p[0],h=p[1];switch(v){case"$set":try{for(var g=(i=void 0,a(Object.entries(h))),y=g.next();!y.done;y=g.next()){var m=u(y.value,2),b=m[0],w=m[1];l[b]=w}}catch(S){i={error:S}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var E=(s=void 0,a(Object.keys(h))),_=E.next();!_.done;_=E.next()){delete l[b=_.value]}}catch(I){s={error:I}}finally{try{_&&!_.done&&(c=E.return)&&c.call(E)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(T){t={error:T}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return s({},this.identity)},e.prototype.setIdentity=function(e){var t=s({},this.identity);this.identity=s({},e),c(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),d="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof e?e:self,f=function(){function e(){this.identityStore=new l,this.eventBridge=new o,this.applicationContextProvider=new r}return e.getInstance=function(t){return d.analyticsConnectorInstances||(d.analyticsConnectorInstances={}),d.analyticsConnectorInstances[t]||(d.analyticsConnectorInstances[t]=new e),d.analyticsConnectorInstances[t]},e}()}).call(this,n("yLpj"))},"9S6E":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return r}));var r=function(){return"undefined"!==typeof globalThis&&"undefined"!==typeof globalThis.ampIntegrationContext?globalThis.ampIntegrationContext:"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof self?self:"undefined"!==typeof e?e:void 0}}).call(this,n("yLpj"))},MY0U:function(e,t,n){"use strict";n.d(t,"c",(function(){return ui})),n.d(t,"d",(function(){return ci})),n.d(t,"e",(function(){return li})),n.d(t,"b",(function(){return di})),n.d(t,"f",(function(){return fi})),n.d(t,"g",(function(){return pi})),n.d(t,"a",(function(){return vi}));var r={};n.r(r),n.d(r,"SpecialEventType",(function(){return Rr})),n.d(r,"IdentifyOperation",(function(){return Ar})),n.d(r,"RevenueProperty",(function(){return Cr})),n.d(r,"LogLevel",(function(){return le})),n.d(r,"ServerZone",(function(){return Kt})),n.d(r,"Status",(function(){return $t})),n.d(r,"OfflineDisabled",(function(){return Re})),n.d(r,"DEFAULT_CSS_SELECTOR_ALLOWLIST",(function(){return Ur})),n.d(r,"DEFAULT_DATA_ATTRIBUTE_PREFIX",(function(){return Mr})),n.d(r,"DEFAULT_ACTION_CLICK_ALLOWLIST",(function(){return qr}));var i={};n.r(i),n.d(i,"createInstance",(function(){return Dr})),n.d(i,"add",(function(){return Fr})),n.d(i,"extendSession",(function(){return Vr})),n.d(i,"flush",(function(){return Br})),n.d(i,"getDeviceId",(function(){return $r})),n.d(i,"getSessionId",(function(){return Kr})),n.d(i,"getUserId",(function(){return Hr})),n.d(i,"groupIdentify",(function(){return Gr})),n.d(i,"identify",(function(){return zr})),n.d(i,"init",(function(){return Wr})),n.d(i,"logEvent",(function(){return Jr})),n.d(i,"remove",(function(){return Qr})),n.d(i,"reset",(function(){return Yr})),n.d(i,"revenue",(function(){return Zr})),n.d(i,"setDeviceId",(function(){return Xr})),n.d(i,"setGroup",(function(){return ei})),n.d(i,"setOptOut",(function(){return ti})),n.d(i,"setSessionId",(function(){return ni})),n.d(i,"setTransport",(function(){return ri})),n.d(i,"setUserId",(function(){return ii})),n.d(i,"track",(function(){return oi})),n.d(i,"runQueuedFunctions",(function(){return Le})),n.d(i,"Revenue",(function(){return X})),n.d(i,"Identify",(function(){return W})),n.d(i,"Types",(function(){return r}));var o=n("cpVT");var s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}
1function u(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function c(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(u){a=[6,u],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}Object.create;function l(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function f(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var p;!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(p||(p={}));var v=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},h=function(e){return function(){var t=s({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},g=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=l(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},y=function(e,t){return function(){var n,r,i={};try{for(var o=l(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=g(e,a)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},m=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),u=a.logger,c=a.logLevel;if(c&&c<p.Debug||!c||!u)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:v(1),time:{start:(new Date).toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then((function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),u.debug(JSON.stringify(l,null,2))})):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),u.debug(JSON.stringify(l,null,2))),d}},b=function(e,t){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function w(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var E=function(){return(E=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};
1function _(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function S(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(u){a=[6,u],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}Object.create;function I(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}Object.create;"function"===typeof SuppressedError&&SuppressedError;var T,O=function(e){return{promise:e||Promise.resolve()}};!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(T||(T={}));var k="AMP",P="".concat(k,"_unsent"),x={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},A=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=T.Unknown),{event:e,code:t,message:n}},C="Amplitude Logger ",R=function(){function e(){this.logLevel=p.None}return e.prototype.disable=function(){this.logLevel=p.None},e.prototype.enable=function(e){void 0===e&&(e=p.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Verbose||console.log("".concat(C,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Warn||console.warn("".concat(C,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Error||console.error("".concat(C,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Debug||console.log("".concat(C,"[Debug]: ").concat(e.join(" ")))},e}(),L=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:p.Warn,loggerProvider:new R,offline:!1,optOut:!1,serverUrl:"https://api2.amplitude.com/2/httpapi",serverZone:"US",useBatch:!1}},j=function(){function e(e){var t,n,r,i;this._optOut=!1;var o=L();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(r=e.optOut)&&void 0!==r?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=N(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
1,enumerable:!1,configurable:!0}),e}(),D=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":"https://api2.amplitude.com/2/httpapi"},N=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=L().serverZone),void 0===n&&(n=L().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:L().serverZone;return{serverZone:r,serverUrl:D(r,n)}},U=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}(),M=n("TSkg"),q=f([],d(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),F=function(e){var t,n=Object(M.a)();if(!(null===(t=null===n||void 0===n?void 0:n.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,F)}(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,f([],d(r.entries()),!1).map((function(e){var t=d(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(q[r]):q[r]})).join("")};function V(e){return e>=200&&e<300}var B=new Set(["https://api2.amplitude.com/2/httpapi","https://api.eu.amplitude.com/2/httpapi","https://api2.amplitude.com/batch","https://api.eu.amplitude.com/batch"]);function $(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(n){}return t}var K,H=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?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return u(this,void 0,void 0,(function(){var n,r=this;return c(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(P,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map((function(e){return r.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=F()),new Promise((function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.queue.push(r),t.schedule(t.config.flushIntervalMillis),t.saveEvents()}))},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter((function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleEvents=function(e){var t=this;e.forEach((function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)}))},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout((function(){t.queue=t.queue.map((function(e){return e.timeout=0,e})),t.flush(!0)}),e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),u(this,void 0,void 0,(function(){var t,n,r=this;return c(this,(function(i){switch(i.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):n.push(e)})),[4,function(e,t){var n=Math.max(t,1);return e.reduce((function(e,t,r){var i=Math.floor(r/n);return e[i]||(e[i]=[]),e[i].push(t),e}),[])}(t,this.config.flushQueueSize).reduce((function(t,n){return u(r,void 0,void 0,(function(){return c(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve())]);case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}}))}))},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),u(this,void 0,void 0,(function(){var r,i,o,s,u,l;return c(this,(function(c){switch(c.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;t.extra;return a(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new U,c.label=1;case 1:return c.trys.push([1,3,,4]),i=N(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,o=function(e,t){return void 0===t&&(t=!1),!!B.has(e)||t}(i,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(i,r,this.config._enableRequestBodyCompressionExperimental&&o)];case 2:return null===(s=c.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(s,e),[3,4]):("body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat($(s))):this.fulfillRequest(e,s.statusCode,s.status),[2]);case 3:return u=c.sent(),l=(d=u)instanceof Error?d.message:String(d),this.config.loggerProvider.error(l),null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map((function(e){return e.event.event_type})),message:l,stack_trace:v()}),this.handleResponse({status:T.Failed,statusCode:0},e),[3,4];case 4:return[2]}var d}))}))},e.prototype.handleResponse=function(e,t){var n;V(e.statusCode)||null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful",{events:t.map((function(e){return e.event.event_type})),code:e.statusCode,status:e.status,body:$(e),stack_trace:v()});var r=e.status;switch(r){case T.Success:this.handleSuccessResponse(e,t);break;case T.Invalid:this.handleInvalidResponse(e,t);break;case T.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case T.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var r=f(f(f(f([],d(Object.values(e.body.eventsWithInvalidFields)),!1),d(Object.values(e.body.eventsWithMissingFields)),!1),d(Object.values(e.body.eventsWithInvalidIdLengths)),!1),d(e.body.silencedEvents),!1).flat(),i=new Set(r),o=t.filter((function(t,r){if(!i.has(r))return!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));o.length>0&&this.config.loggerProvider.warn($(e));
1var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn($(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),u=new Set(o),c=t.filter((function(t,r){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return u.has(r)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));c.length>0&&this.config.loggerProvider.warn($(e));var l=this.removeEventsExceedFlushMaxRetries(c);this.scheduleEvents(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;V(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(r=this.diagnosticsClient)||void 0===r||r.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map((function(e){return e.event.event_type})),code:t,message:n,stack_trace:v()})),this.removeEvents(e),e.forEach((function(e){return e.callback(A(e.event,t,n))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map((function(e){return e.event}));this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter((function(t){return!e.some((function(e){return e.event.insert_id===t.event.insert_id}))})),this.saveEvents()},e}(),G=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!z(t,n))return!1}return!0},z=function(e,t){var n,r;if("string"!==typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=l(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&&G(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(null===t||void 0===t)return!1;if("object"===typeof t)return G(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},W=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return s({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(K.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(K.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(K.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(K.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(K.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(K.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(K.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(K.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(K.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[K.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return void 0===this._properties[K.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===K.ADD?"number"===typeof n:e===K.UNSET||e===K.REMOVE||z(t,n)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(K||(K={}));var J,Q,Y,Z=[K.CLEAR_ALL,K.UNSET,K.SET,K.SET_ONCE,K.ADD,K.APPEND,K.PREPEND,K.PREINSERT,K.POSTINSERT,K.REMOVE],X=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){return G(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?s({},this.properties):{};return e[J.REVENUE_PRODUCT_ID]=this.productId,e[J.REVENUE_QUANTITY]=this.quantity,e[J.REVENUE_PRICE]=this.price,e[J.REVENUE_TYPE]=this.revenueType,e[J.REVENUE_CURRENCY]=this.currency,e[J.REVENUE]=this.revenue,e[J.RECEIPT]=this.receipt,e[J.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(J||(J={})),function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(Q||(Q={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Y||(Y={}));var ee=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,r;return u(this,void 0,void 0,(function(){return c(this,(function(i){switch(i.label){case 0:return this.plugins.some((function(t){return t.name===e.name}))?(this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=F(),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!==(n=e.type)&&void 0!==n?n:"enrichment",[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var n;return u(this,void 0,void 0,(function(){var r,i;return c(this,(function(o){switch(o.label){case 0:return-1===(r=this.plugins.findIndex((function(t){return t.name===e})))?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=i.teardown)||void 0===n?void 0:n.call(i)]);case 1:return o.sent(),[2]}}))}))},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map((function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)})),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(n){t.queue.push([e,n]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return u(this,void 0,void 0,(function(){var t,n,r,i,o,a,u,f,p,v,h,g,y,m,b,w,E,_,S,I;return c(this,(function(c){switch(c.label){case 0:if(!e)return[2];t=d(e,1),n=t[0],r=d(e,2),i=r[1],this.loggerProvider.log("Timeline.apply: Initial event",n),o=this.plugins.filter((function(e){return"before"===e.type})),c.label=1;case 1:c.trys.push([1,6,7,8]),a=l(o),u=a.next(),c.label=2;case 2:return u.done?[3,5]:(g=u.value).execute?[4,g.execute(s({},n))]:[3,4];case 3:if(null===(y=c.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(g.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=y,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(g.name),"', event: ").concat(JSON.stringify(n))),c.label=4;case 4:return u=a.next(),[3,2];case 5:return[3,8];case 6:return f=c.sent(),E={error:f},[3,8];case 7:try{u&&!u.done&&(_=a.return)&&_.call(a)}finally{if(E)throw E.error}
1return[7];case 8:p=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),c.label=9;case 9:c.trys.push([9,14,15,16]),v=l(p),h=v.next(),c.label=10;case 10:return h.done?[3,13]:(g=h.value).execute?[4,g.execute(s({},n))]:[3,12];case 11:if(null===(y=c.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(g.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=y,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(g.name),"', event: ").concat(JSON.stringify(n))),c.label=12;case 12:return h=v.next(),[3,10];case 13:return[3,16];case 14:return m=c.sent(),S={error:m},[3,16];case 15:try{h&&!h.done&&(I=v.return)&&I.call(v)}finally{if(S)throw S.error}return[7];case 16:return b=this.plugins.filter((function(e){return"destination"===e.type})),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),w=b.map((function(e){var t=s({},n);return e.execute(t).catch((function(e){return A(t,0,String(e))}))})),Promise.all(w).then((function(e){var t=d(e,1)[0]||A(n,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return u(this,void 0,void 0,(function(){var e,t,n,r=this;return c(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return r.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),n=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onIdentityChanged)||void 0===n||n.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onSessionIdChanged)||void 0===n||n.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onOptOutChanged)||void 0===n||n.call(t,e)})),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return u(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return c(this,(function(u){switch(u.label){case 0:u.trys.push([0,7,8,9]),t=l(this._optOutListeners),n=t.next(),u.label=1;case 1:if(n.done)return[3,6];r=n.value,u.label=2;case 2:return u.trys.push([2,4,,5]),[4,r(e)];case 3:return u.sent(),[3,5];case 4:return i=u.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return o=u.sent(),s={error:o},[3,9];case 8:try{n&&!n.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2]}}
1))}))},e.prototype.onReset=function(){this.plugins.forEach((function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)}))},e}(),te=function(e,t){return s(s({},t),{event_type:Y.IDENTIFY,user_properties:e.getUserProperties()})},ne=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 ee(this),this.name=e}return e.prototype._init=function(e){return u(this,void 0,void 0,(function(){return c(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 u(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u;return c(this,(function(c){switch(c.label){case 0:t=this[e],this[e]=[],c.label=1;case 1:c.trys.push([1,8,9,10]),n=l(t),r=n.next(),c.label=2;case 2:return r.done?[3,7]:(i=r.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return c.sent(),[3,6];case 4:return[4,o];case 5:c.sent(),c.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return s=c.sent(),a={error:s},[3,10];case 9:try{r&&!r.done&&(u=n.return)&&u.call(n)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:c.sent(),c.label=12;case 12:return[2]}}
1))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return s(s(s({},"string"===typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),O(this.dispatch(r))},e.prototype.identify=function(e,t){var n=te(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),O(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=function(e,t,n,r){var i;return s(s({},r),{event_type:Y.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})}(e,t,n,r);return O(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,i=new W;return i.set(e,t),s(s({},n),{event_type:Y.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),O(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=function(e,t){return s(s({},t),{event_type:Y.REVENUE,event_properties:e.getEventProperties()})}(e,t);return O(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),O())},e.prototype._addPlugin=function(e){return O(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)),O())},e.prototype._removePlugin=function(e){return O(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(A(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return u(this,void 0,void 0,(function(){var t=this;return c(this,(function(n){return this.isReady?[2,this.process(e)]:[2,new Promise((function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=null!==(t=this.userProperties)&&void 0!==t?t:{},r=s({},n);if(void 0===e)return r;var i={};return Object.keys(e).forEach((function(t){Object.values(Q).includes(t)||(i[t]=e[t])})),Z.forEach((function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case Q.CLEAR_ALL:Object.keys(r).forEach((function(e){delete r[e]}));break;case Q.UNSET:Object.keys(n).forEach((function(e){delete r[e]}));break;case Q.SET:Object.assign(r,n)}}})),Object.assign(r,i),r},e.prototype.process=function(e){return u(this,void 0,void 0,(function(){var t,n,r;return c(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,A(e,0,"Event skipped due to optOut config")]:(e.event_type===Y.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(r=i.sent()).code?this.config.loggerProvider.log(r.message):100===r.code?this.config.loggerProvider.warn(r.message):this.config.loggerProvider.error(r.message),[2,r];case 2:return t=i.sent(),n=String(t),this.config.loggerProvider.error(n),[2,r=A(e,0,n)];case 3:return[2]}}
1))}))},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return O(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find((function(t){return t.name===e}));if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter((function(t){return t instanceof e}))},e}(),re=function(e,t){return(re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function ie(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}re(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var oe=function(){return(oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function ae(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function ue(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(u){a=[6,u],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}Object.create;function ce(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}Object.create;"function"===typeof SuppressedError&&SuppressedError;var le,de=function(e,t){return"boolean"===typeof e?e:!1!==(null===e||void 0===e?void 0:e[t])},fe=function(e){return de(e,"attribution")},pe=function(e){return de(e,"pageViews")},ve=function(e){return de(e,"sessions")},he=function(e){return"boolean"===typeof e?e:"object"===typeof e&&(!0===e.elementInteractions||"object"===typeof e.elementInteractions)},ge=function(e){if(he(e.autocapture)&&"object"===typeof e.autocapture&&"object"===typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},ye=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return pe(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"===typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"===typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}}
1,me={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},be=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},we=function(e,t,n,r,i){void 0===i&&(i=!0);e.referrer;var o=e.referring_domain,s=se(e,["referrer","referring_domain"]),a=t||{},u=(a.referrer,a.referring_domain),c=se(a,["referrer","referring_domain"]);if(Ee(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var l=JSON.stringify(s)!==JSON.stringify(c),d=be(o||"")!==be(u||""),f=!t||l||d;return f?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),f},Ee=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}))},_e=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},Se=n("9S6E"),Ie=function(){var e,t=Object(Se.a)();return(null===(e=null===t||void 0===t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=Te(n[0]),i=Te(n[1]);return i?(e[r]=i,e):e}),{}):{}},Te=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(t){return""}},Oe=function(){function e(){}return e.prototype.parse=function(){return ae(this,void 0,void 0,(function(){return ue(this,(function(e){return[2,oe(oe(oe(oe({},me),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Ie();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(r){}return n},e.prototype.getClickIds=function(){var e,t=Ie();return(e={}).dclid=t.dclid,e.fbclid=t.fbclid,e.gbraid=t.gbraid,e.gclid=t.gclid,e.ko_click_id=t.ko_click_id,e.li_fat_id=t.li_fat_id,e.msclkid=t.msclkid,e.rdt_cid=t.rdt_cid,e.ttclid=t.ttclid,e.twclid=t.twclid,e.wbraid=t.wbraid,e},e}(),ke=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},Pe=function(){function e(e,t){var n,r,i,o;this.shouldTrackNewCampaign=!1,this.options=oe({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:_e(null===(n=t.cookieOptions)||void 0===n?void 0:n.domain)},e),this.storage=t.cookieStorage,this.storageKey=(r=t.apiKey,void 0===(i="MKTG")&&(i=""),void 0===o&&(o=10),[k,i,r.substring(0,o)].filter(Boolean).join("_")),this.currentCampaign=me,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return ae(this,void 0,void 0,(function(){var e,t;return ue(this,(function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:return t=ce.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||ke(this.sessionTimeout,this.lastEventTime),we(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}
1))}))},e.prototype.fetchCampaign=function(){return ae(this,void 0,void 0,(function(){return ue(this,(function(e){switch(e.label){case 0:return[4,Promise.all([(new Oe).parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t=function(e,t){var n=oe(oe({},me),e),r=Object.entries(n).reduce((function(e,n){var r,i=ce(n,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(r=null!==s&&void 0!==s?s:t.initialEmptyValue)&&void 0!==r?r:"EMPTY"),s?e.set(o,s):e.unset(o)}),new W);return te(r)}(this.currentCampaign,this.options);return e&&(t.event_id=e),t},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),xe=n("2fq0"),Ae=function(e){return void 0===e&&(e="$default_instance"),xe.a.getInstance(e)},Ce=function(){function e(){this.name="identity",this.type="before",this.identityStore=Ae().identityStore}return e.prototype.execute=function(e){return ae(this,void 0,void 0,(function(){var t;return ue(this,(function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return ae(this,void 0,void 0,(function(){return ue(this,(function(t){return e.instanceName&&(this.identityStore=Ae(e.instanceName).identityStore),[2]}))}))},e}(),Re=null,Le=function(e,t){je(e,t)},je=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,s=r.resolve,a=e&&e[i];if("function"===typeof a){var u=a.apply(e,o);"function"===typeof s&&s(null===u||void 0===u?void 0:u.promise)}}return e},De=function(e){return e&&void 0!==e._q},Ne=function(){var e,t,n,r;if("undefined"===typeof navigator)return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},Ue=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="amplitude-ts/".concat("2.10.0"),"undefined"!==typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return _(this,void 0,void 0,(function(){var r,i,o;return S(this,(function(s){return r=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,o=null!==(n=e.event_id)&&void 0!==n?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,E(E(E(E(E(E(E(E({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:Ne()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:F(),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}();!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(le||(le={}));var Me=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return u(this,void 0,void 0,(function(){return c(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return u(this,void 0,void 0,(function(){return c(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return u(this,void 0,void 0,(function(){var t;return c(this,(function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return u(this,void 0,void 0,(function(){return c(this,(function(n){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return u(this,void 0,void 0,(function(){return c(this,(function(t){return this.memoryStorage.delete(e),[2]}))}
1))},e.prototype.reset=function(){return u(this,void 0,void 0,(function(){return c(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),qe=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[k,t,e.substring(0,n)].filter(Boolean).join("_")},Fe=function(){function e(e){this.options=oe({},e)}return e.prototype.isEnabled=function(){return ae(this,void 0,void 0,(function(){var t,n;return ue(this,(function(r){switch(r.label){case 0:if(!Object(Se.a)())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return r.sent(),[4,t.get(n)];case 3:return[2,r.sent()===e.testValue];case 4:return r.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return ae(this,void 0,void 0,(function(){var n,r;return ue(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(n=i.sent()))return[2,void 0];try{return void 0===(r=null!==(t=Ve(n))&&void 0!==t?t:Be(n))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]):[2,JSON.parse(r)]}catch(o){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]}return[2]}}
1))}))},e.prototype.getRaw=function(e){var t,n;return ae(this,void 0,void 0,(function(){var r,i,o;return ue(this,(function(s){return r=Object(Se.a)(),i=null!==(n=null===(t=null===r||void 0===r?void 0:r.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[],(o=i.find((function(t){return 0===t.indexOf(e+"=")})))?[2,o.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var n;return ae(this,void 0,void 0,(function(){var r,i,o,s,a,u,c;return ue(this,(function(l){try{r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=void 0,(i=null!==t?r:-1)&&((s=new Date).setTime(s.getTime()+24*i*60*60*1e3),o=s),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)),(u=Object(Se.a)())&&(u.document.cookie=a)}catch(d){c=d instanceof Error?d.message:String(d),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return ae(this,void 0,void 0,(function(){return ue(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 ae(this,void 0,void 0,(function(){return ue(this,(function(e){return[2]}))}))},e}(),Ve=function(e){try{return decodeURIComponent(atob(e))}catch(t){return}},Be=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(t){return}},$e=function(){function e(){}return e.prototype.send=function(e,t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,n,r,i,o,s,a,u,c,l,d,f,p,v,h,g,y,m,b,w,E,_;if("object"!==typeof e)return null;var S=e.code||0,I=this.buildStatus(S);switch(I){case T.Success:return{status:I,statusCode:S,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case T.Invalid:return{status:I,statusCode:S,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(u=e.events_with_invalid_id_lengths)&&void 0!==u?u:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(v=e.throttled_events)&&void 0!==v?v:[]}};case T.PayloadTooLarge:return{status:I,statusCode:S,body:{error:null!==(h=e.error)&&void 0!==h?h:""}};case T.RateLimit:return{status:I,statusCode:S,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(m=e.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(E=e.exceeded_daily_quota_users)&&void 0!==E?E:{},throttledEvents:null!==(_=e.throttled_events)&&void 0!==_?_:[]}};case T.Timeout:default:return{status:I,statusCode:S}}},e.prototype.buildStatus=function(e){return V(e)?T.Success:429===e?T.RateLimit:413===e?T.PayloadTooLarge:408===e?T.Timeout:e>=400&&e<500?T.Invalid:e>=500?T.Failed:T.Unknown},e}(),Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ie(t,e),t.prototype.send=function(e,t){return ae(this,void 0,void 0,(function(){var n,r,i;return ue(this,(function(o){switch(o.label){case 0:if("undefined"===typeof fetch)throw new Error("FetchTransport is not supported");return n={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"}
1,[4,fetch(e,n)];case 1:return[4,(r=o.sent()).text()];case 2:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(s){return[2,this.buildResponse({code:r.status})]}return[2]}}))}))},t}($e),He=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return _(this,void 0,void 0,(function(){var t,n,r;return S(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return _(this,void 0,void 0,(function(){var t;return S(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=n.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}}
1))}))},e.prototype.getRaw=function(e){var t;return _(this,void 0,void 0,(function(){return S(this,(function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var n;return _(this,void 0,void 0,(function(){return S(this,(function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(i){}return[2]}))}))},e.prototype.remove=function(e){var t;return _(this,void 0,void 0,(function(){return S(this,(function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(r){}return[2]}))}))},e.prototype.reset=function(){var e;return _(this,void 0,void 0,(function(){return S(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(n){}return[2]}))}))},e}(),Ge=function(e){function t(t){var n,r=this;return(r=e.call(this,null===(n=Object(Se.a)())||void 0===n?void 0:n.localStorage)||this).loggerProvider=null===t||void 0===t?void 0:t.loggerProvider,r}return w(t,e),t.prototype.set=function(t,n){var r;return _(this,void 0,void 0,(function(){var i;return S(this,(function(o){switch(o.label){case 0:return Array.isArray(n)&&n.length>1e3?(i=n.length-1e3,[4,e.prototype.set.call(this,t,n.slice(0,1e3))]):[3,2];case 1:return o.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}}
1))}))},t}(He),ze=function(e){function t(){var t;return e.call(this,null===(t=Object(Se.a)())||void 0===t?void 0:t.sessionStorage)||this}return w(t,e),t}(He),We=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return w(t,e),t.prototype.send=function(e,t){return _(this,void 0,void 0,(function(){var n=this;return S(this,(function(r){return[2,new Promise((function(i,o){"undefined"===typeof XMLHttpRequest&&o(new Error("XHRTransport is not supported."));var s=new XMLHttpRequest;s.open("POST",e,!0),s.onreadystatechange=function(){if(s.readyState===n.state.done){var e=s.responseText;try{i(n.buildResponse(JSON.parse(e)))}catch(r){i(n.buildResponse({code:s.status}))}}},s.setRequestHeader("Content-Type","application/json"),s.setRequestHeader("Accept","*/*"),s.send(JSON.stringify(t))}))]}))}))},t}($e),Je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return w(t,e),t.prototype.send=function(e,t){return _(this,void 0,void 0,(function(){var n=this;return S(this,(function(r){return[2,new Promise((function(r,i){var o=Object(Se.a)();if(!(null===o||void 0===o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return r(o.navigator.sendBeacon(e,JSON.stringify(t))?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(a){i(a)}}))]}))}))},t}($e),Qe=function(e,t,n){return void 0===n&&(n=!0),_(void 0,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,d;return S(this,(function(f){switch(f.label){case 0:return r=function(e){return"".concat(k.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(r)];case 1:return(i=f.sent())?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:f.sent(),f.label=3;case 3:return o=I(i.split("."),6),s=o[0],a=o[1],u=o[2],c=o[3],l=o[4],d=o[5],[2,{deviceId:s,userId:Ze(a),sessionId:Ye(c),lastEventId:Ye(d),lastEventTime:Ye(l),optOut:Boolean(u)}]}}))}))},Ye=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ze=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(t){return}},Xe=("".concat("[Amplitude]"," Page Viewed"),"".concat("[Amplitude]"," Form Started")),et="".concat("[Amplitude]"," Form Submitted"),tt="".concat("[Amplitude]"," File Downloaded"),nt="".concat("[Amplitude]"," File Extension"),rt="".concat("[Amplitude]"," File Name"),it="".concat("[Amplitude]"," Link ID"),ot="".concat("[Amplitude]"," Link Text"),st="".concat("[Amplitude]"," Link URL"),at="".concat("[Amplitude]"," Form ID"),ut="".concat("[Amplitude]"," Form Name"),ct="".concat("[Amplitude]"," Form Destination"),lt=function(e){function t(t,n,r,i,o,s,a,u,c,l,d,f,p,v,h,g,y,m,b,w,E,_,S,I,T,O,k,P,x,A,C,L,j,D){void 0===r&&(r=new Me),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===u&&(u=1e3),void 0===c&&(c=5),void 0===l&&(l=30),void 0===d&&(d="cookie"),void 0===g&&(g=new R),void 0===y&&(y=le.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===S&&(S=""),void 0===I&&(I="US"),void 0===O&&(O=18e5),void 0===k&&(k=new Ge({loggerProvider:g})),void 0===P&&(P={ipAddress:!0,language:!0,platform:!0}),void 0===x&&(x="fetch"),void 0===A&&(A=!1),void 0===C&&(C=!1);var N=e.call(this,{apiKey:t,storageProvider:k,transportProvider:pt(x)})||this;return N.apiKey=t,N.appVersion=n,N.cookieOptions=i,N.defaultTracking=o,N.autocapture=s,N.flushIntervalMillis=u,N.flushMaxRetries=c,N.flushQueueSize=l,N.identityStorage=d,N.ingestionMetadata=f,N.instanceName=p,N.loggerProvider=g,N.logLevel=y,N.minIdLength=m,N.offline=b,N.partnerId=E,N.plan=_,N.serverUrl=S,N.serverZone=I,N.sessionTimeout=O,N.storageProvider=k,N.trackingOptions=P,N.transport=x,N.useBatch=A,N.fetchRemoteConfig=C,N._optOut=!1,N._cookieStorage=r,N.deviceId=a,N.lastEventId=v,N.lastEventTime=h,N.optOut=w,N.sessionId=T,N.pageCounter=j,N.userId=L,N.debugLogsEnabled=D,N.loggerProvider.enable(D?le.Debug:N.logLevel),N}return w(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())}
1,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,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,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(qe(this.apiKey),e)},t}(j),dt=function(e,t,n){return void 0===t&&(t={}),_(void 0,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,d,f,p,v,h,g,y,m,b,w,_,I,T,O,k,P,x,A,C,R,L,j,D,N,U,M,q,V,B,$,K,H,G,z,W;return S(this,(function(S){switch(S.label){case 0:return r=t.identityStorage||"cookie",_={},"cookie"===r?[3,1]:(o="",[3,5]);case 1:return null===(T=null===(I=t.cookieOptions)||void 0===I?void 0:I.domain)||void 0===T?[3,2]:(s=T,[3,4]);case 2:return[4,vt()];case 3:s=S.sent(),S.label=4;case 4:o=s,S.label=5;case 5:return i=E.apply(void 0,[(_.domain=o,_.expiration=365,_.sameSite="Lax",_.secure=!1,_.upgrade=!0,_),t.cookieOptions]),a=ft(t.identityStorage,i),[4,Qe(e,a,null===(k=null===(O=t.cookieOptions)||void 0===O?void 0:O.upgrade)||void 0===k||k)];case 6:return u=S.sent(),[4,a.get(qe(e))];case 7:return c=S.sent(),l=Ie(),d=null!==(R=null!==(C=null!==(A=null!==(x=null!==(P=t.deviceId)&&void 0!==P?P:l.ampDeviceId)&&void 0!==x?x:l.deviceId)&&void 0!==A?A:null===c||void 0===c?void 0:c.deviceId)&&void 0!==C?C:u.deviceId)&&void 0!==R?R:F(),f=null!==(L=null===c||void 0===c?void 0:c.lastEventId)&&void 0!==L?L:u.lastEventId,p=null!==(j=null===c||void 0===c?void 0:c.lastEventTime)&&void 0!==j?j:u.lastEventTime,v=null!==(N=null!==(D=t.optOut)&&void 0!==D?D:null===c||void 0===c?void 0:c.optOut)&&void 0!==N?N:u.optOut,h=null!==(U=null===c||void 0===c?void 0:c.sessionId)&&void 0!==U?U:u.sessionId,g=null!==(q=null!==(M=t.userId)&&void 0!==M?M:null===c||void 0===c?void 0:c.userId)&&void 0!==q?q:u.userId,n.previousSessionDeviceId=null!==(V=null===c||void 0===c?void 0:c.deviceId)&&void 0!==V?V:u.deviceId,n.previousSessionUserId=null!==(B=null===c||void 0===c?void 0:c.userId)&&void 0!==B?B:u.userId,y={ipAddress:null===(K=null===($=t.trackingOptions)||void 0===$?void 0:$.ipAddress)||void 0===K||K,language:null===(G=null===(H=t.trackingOptions)||void 0===H?void 0:H.language)||void 0===G||G,platform:null===(W=null===(z=t.trackingOptions)||void 0===z?void 0:z.platform)||void 0===W||W},m=null===c||void 0===c?void 0:c.pageCounter,b=null===c||void 0===c?void 0:c.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(w=new lt(e,t.appVersion,a,i,t.defaultTracking,t.autocapture,d,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,r,t.ingestionMetadata,t.instanceName,f,p,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,v,t.partnerId,t.plan,t.serverUrl,t.serverZone,h,t.sessionTimeout,t.storageProvider,y,t.transport,t.useBatch,t.fetchRemoteConfig,g,m,b)).storageProvider.isEnabled()];case 8:return S.sent()||(w.loggerProvider.warn("Storage provider ".concat(w.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),w.storageProvider=new Me),[2,w]}}))}))},ft=function(e,t){switch(void 0===e&&(e="cookie"),void 0===t&&(t={}),e){case"localStorage":return new Ge;case"sessionStorage":return new ze;case"none":return new Me;case"cookie":default:return new Fe(E(E({},t),{expirationDays:t.expiration}))}},pt=function(e){return"xhr"===e?new We:"beacon"===e?new Je:new Ke},vt=function(e){return _(void 0,void 0,void 0,(function(){var t,n,r,i,o,s,a;
1return S(this,(function(u){switch(u.label){case 0:return[4,(new Fe).isEnabled()];case 1:if(!u.sent()||!e&&("undefined"===typeof location||!location.hostname))return[2,""];for(t=null!==e&&void 0!==e?e:location.hostname,n=t.split("."),r=[],i="AMP_TLDTEST",o=n.length-2;o>=0;--o)r.push(n.slice(o).join("."));o=0,u.label=2;case 2:return o<r.length?(s=r[o],[4,(a=new Fe({domain:"."+s})).set(i,1)]):[3,7];case 3:return u.sent(),[4,a.get(i)];case 4:return u.sent()?[4,a.remove(i)]:[3,6];case 5:return u.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))};var ht=function(){return(ht=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function gt(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function yt(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(u){a=[6,u],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}Object.create;function mt(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function bt(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var wt=/\b(?:\d[ -]*?){13,16}\b/,Et=/(\d{3}-?\d{2}-?\d{4})/g,_t=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,St=function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!==typeof e)return"";var i=e;i=(i=(i=i.replace(wt,"*****")).replace(Et,"*****")).replace(_t,"*****");try{for(var o=l(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,"*****")}catch(u){}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},It=function(e){if("undefined"===typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute("data-amp-mask")?"*****":e?e(document.title):document.title},Tt=function(){var e,t=Object(M.a)();return(null===(e=null===t||void 0===t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=Ot(n[0]),i=Ot(n[1]);return i?(e[r]=i,e):e}),{}):{}},Ot=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(t){return""}},kt=function(){function e(){}return e.prototype.parse=function(){return u(this,void 0,void 0,(function(){return c(this,(function(e){return[2,s(s(s(s({},x),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Tt();
1return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(r){}return n},e.prototype.getClickIds=function(){var e,t=Tt();return(e={}).dclid=t.dclid,e.fbclid=t.fbclid,e.gbraid=t.gbraid,e.gclid=t.gclid,e.ko_click_id=t.ko_click_id,e.li_fat_id=t.li_fat_id,e.msclkid=t.msclkid,e.rdt_cid=t.rdt_cid,e.ttclid=t.ttclid,e.twclid=t.twclid,e.wbraid=t.wbraid,e},e}(),Pt=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},xt=function(e){var t;void 0===e&&(e={});var n,r=Object(M.a)(),i=void 0,o=!1,s=e.trackOn,a=e.trackHistoryChanges,u=e.eventType,c=void 0===u?"[Amplitude] Page Viewed":u,l=function(e){var t=e;try{t=decodeURI(e)}catch(n){null===i||void 0===i||i.error("Malformed URI sequence: ",n)}return t},d=function(){return gt(void 0,void 0,void 0,(function(){var e,t,n;return yt(this,(function(r){switch(r.label){case 0:return e=l("undefined"!==typeof location&&location.href||""),n={event_type:c},t=[{}],[4,At()];case 1:return[2,(n.event_properties=ht.apply(void 0,[ht.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!==typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!==typeof location&&l(location.pathname)||"","[Amplitude] Page Title":It(St),"[Amplitude] Page URL":e.split("?")[0]}]),n)]}}))}))},f=function(){return"undefined"===typeof s||"function"===typeof s&&s()},p="undefined"!==typeof location?location.href:null,v=function(){return gt(void 0,void 0,void 0,(function(){var e,n,r,o;return yt(this,(function(s){switch(s.label){case 0:return e=location.href,n=Rt(a,e,p||"")&&f(),p=e,n?(null===i||void 0===i||i.log("Tracking page view event"),null!==t&&void 0!==t?[3,1]:(void 0,[3,3])):[3,4];case 1:return o=(r=t).track,[4,d()];case 2:o.apply(r,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}}
1))}))},h=function(){v()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return gt(void 0,void 0,void 0,(function(){var a,u;return yt(this,(function(c){switch(c.label){case 0:return t=s,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",h),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=mt(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&v()}})),f()?(i.log("Tracking page view event"),u=(a=t).track,[4,d()]):[3,2];case 1:u.apply(a,[c.sent()]),c.label=2;case 2:return[2]}}))}))},execute:function(e){return gt(void 0,void 0,void 0,(function(){var t;return yt(this,(function(r){switch(r.label){case 0:return"attribution"===s&&Ct(e)?(null===i||void 0===i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()]):[3,2];case 1:t=r.sent(),e.event_type=t.event_type,e.event_properties=ht(ht({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===c&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=ht(ht({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}}))}))},teardown:function(){return gt(void 0,void 0,void 0,(function(){return yt(this,(function(e){return r&&(r.removeEventListener("popstate",h),o=!1),[2]}))}))}}},At=function(){return gt(void 0,void 0,void 0,(function(){var e;return yt(this,(function(t){switch(t.label){case 0:return e=Pt,[4,(new kt).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},Ct=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[Q.SET]||{},r=t[Q.UNSET]||{},i=bt(bt([],mt(Object.keys(n)),!1),mt(Object.keys(r)),!1);return Object.keys(x).every((function(e){return i.includes(e)}))}return!1},Rt=function(e,t,n){switch(e){case"pathOnly":if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname;default:return t!==n}},Lt=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,r){return _(void 0,void 0,void 0,(function(){var i;return S(this,(function(o){return null===(i=Object(Se.a)())||void 0===i||i.addEventListener("load",(function(){if(r){if("undefined"!==typeof document){var i=function(e){var t=!1;n(e,"change",(function(){var n;t||r.track(Xe,((n={})[at]=jt(e.id),n[ut]=jt(e.name),n[ct]=e.action,n)),t=!0})),n(e,"submit",(function(){var n,i;t||r.track(Xe,((n={})[at]=jt(e.id),n[ut]=jt(e.name),n[ct]=e.action,n)),r.track(et,((i={})[at]=jt(e.id),i[ut]=jt(e.name),i[ct]=e.action,i)),t=!1}))};Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!==typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"===typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")})),[2]}))}))},execute:function(e){return _(void 0,void 0,void 0,(function(){return S(this,(function(t){return[2,e]}))}))},teardown:function(){return _(void 0,void 0,void 0,(function(){return S(this,(function(n){return null===e||void 0===e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null===t||void 0===t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},jt=function(e){if("string"===typeof e)return e},Dt=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(n,r){return _(void 0,void 0,void 0,(function(){var i;return S(this,(function(o){return null===(i=Object(Se.a)())||void 0===i||i.addEventListener("load",(function(){if(r){if("undefined"!==typeof document){var o=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(i){return}var o=s.exec(n.href),a=null===o||void 0===o?void 0:o[1];a&&function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})}(e,"click",(function(){var t;a&&r.track(tt,((t={})[nt]=a,t[rt]=n.pathname,t[it]=e.id,t[ot]=e.text,t[st]=e.href,t))}))},s=/\.(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)$/;
1Array.from(document.getElementsByTagName("a")).forEach(o),"undefined"!==typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&o(e),"querySelectorAll"in e&&"function"===typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(o)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")})),[2]}))}))},execute:function(e){return _(void 0,void 0,void 0,(function(){return S(this,(function(t){return[2,e]}))}))},teardown:function(){return _(void 0,void 0,void 0,(function(){return S(this,(function(n){return null===e||void 0===e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null===t||void 0===t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},Nt=!1,Ut=function(){var e=Object(Se.a)(),t=[],n=function(n,r){e&&(e.addEventListener(n,r),t.push({type:n,handler:r}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return _(void 0,void 0,void 0,(function(){return S(this,(function(r){return e.offline=!navigator.onLine,n("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),n("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]}))}))},teardown:function(){return _(void 0,void 0,void 0,(function(){return S(this,(function(n){return t.forEach((function(t){var n=t.type,r=t.handler;e&&e.removeEventListener(n,r)})),t=[],[2]}))}))}}};var Mt=function(){return(Mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function qt(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function Ft(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(u){a=[6,u],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}Object.create;function Vt(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function Bt(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var $t,Kt;!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}($t||($t={})),function(e){e.US="US",e.EU="EU"}(Kt||(Kt={}));const Ht=(e,t)=>
1t.some(t=>e instanceof t);let Gt,zt;const Wt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap;let Yt={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return Wt.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return tn(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Zt(e){Yt=e(Yt)}function Xt(e){return(zt||(zt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(nn(this),t),tn(this.request)}:function(...t){return tn(e.apply(nn(this),t))}}function en(e){return"function"===typeof e?Xt(e):(e instanceof IDBTransaction&&function(e){if(Wt.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});Wt.set(e,t)}(e),Ht(e,Gt||(Gt=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Yt):e)}function tn(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(tn(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",o)});return Qt.set(t,e),t}(e);if(Jt.has(e))return Jt.get(e);const t=en(e);return t!==e&&(Jt.set(e,t),Qt.set(t,e)),t}const nn=e=>Qt.get(e);function rn(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=tn(s);return r&&s.addEventListener("upgradeneeded",e=>{r(tn(s.result),e.oldVersion,e.newVersion,tn(s.transaction),e)}),n&&s.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{o&&e.addEventListener("close",()=>o()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}function on(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),tn(n).then(()=>{})}const sn=["get","getKey","getAll","getAllKeys","count"],an=["put","add","delete","clear"],un=new Map;function cn(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(un.get(t))return un.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=an.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!sn.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),i&&o.done]))[0]};return un.set(t,o),o}Zt(e=>({...e,get:(t,n,r)=>cn(t,n)||e.get(t,n,r),has:(t,n)=>!!cn(t,n)||e.has(t,n)}));const ln=["continue","continuePrimaryKey","advance"],dn={},fn=new WeakMap,pn=new WeakMap,vn={get(e,t){if(!ln.includes(t))return e[t];let n=dn[t];return n||(n=dn[t]=function(...e){fn.set(this,pn.get(this)[t](...e))}),n}};async function*hn(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,vn);for(pn.set(n,t),Qt.set(n,nn(t));t;)yield n,t=await(fn.get(n)||t.continue()),fn.delete(n)}function gn(e,t){return t===Symbol.asyncIterator&&Ht(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ht(e,[IDBIndex,IDBObjectStore])}Zt(e=>({...e,get:(t,n,r)=>gn(t,n)?hn:e.get(t,n,r),has:(t,n)=>gn(t,n)||e.has(t,n)}));var yn=function(e,t){return qt(void 0,void 0,void 0,(function(){return Ft(this,(function(n){switch(n.label){case 0:return[4,rn(e,1,{upgrade:function(e){t.forEach((function(t){e.objectStoreNames.contains(t)||e.createObjectStore(t)}))}})];case 1:return[2,n.sent()]}}))}))},mn=function(e){var t=e.loggerProvider,n=e.apiKey,r=e.configKeys;return qt(void 0,void 0,void 0,(function(){var e,i,o,s,a,u;return Ft(this,(function(c){switch(c.label){case 0:return e="".concat(n.substring(0,10),"_amp_config"),[4,yn(e,r)];case 1:return i=c.sent(),o="".concat(n.substring(0,10),"_amp_config_meta"),[4,(l=o,qt(void 0,void 0,void 0,(function(){return Ft(this,(function(e){switch(e.label){case 0:return[4,rn(l,1,{upgrade:function(e){e.objectStoreNames.contains("lastFetchedSessionId")||e.createObjectStore("lastFetchedSessionId")}})];case 1:return[2,e.sent()]}}))})))];case 2:s=c.sent(),c.label=3;case 3:return c.trys.push([3,8,,9]),[4,s.get("lastFetchedSessionId","sessionId")];case 4:return(a=c.sent())&&Date.now()-a>=2592e5?(i.close(),[4,on(e)]):[3,7];case 5:return c.sent(),[4,yn(e,r)];case 6:i=c.sent(),c.label=7;case 7:return[3,9];case 8:return u=c.sent(),t.warn("Failed to reset store: ".concat(u)),[3,9];case 9:return[2,{storeRemoteConfig:function(e,n){return qt(void 0,void 0,void 0,(function(){var r,o,a,u,c,l;return Ft(this,(function(d){switch(d.label){case 0:return d.trys.push([0,7,,8]),n?[4,s.put("lastFetchedSessionId",n,"sessionId")]:[3,2];case 1:d.sent(),d.label=2;case 2:for(u in r=function(t){var n,r;return Ft(this,(function(o){switch(o.label){case 0:return n=e.configs[t],r=i.transaction(t,"readwrite"),[4,Promise.all(Bt(Bt([],Vt(Object.keys(n).map((function(e){return r.store.put(Mt({},n[e]),e)}))),!1),[r.done],!1))];case 1:return o.sent(),[2]}}))},o=e.configs,a=[],o)a.push(u);c=0,d.label=3;case 3:return c<a.length?(u=a[c])in o?[5,r(u)]:[3,5]:[3,6];case 4:d.sent(),d.label=5;case 5:return c++,[3,3];case 6:return[3,8];case 7:return l=d.sent(),t.warn("Failed to store remote config: ".concat(l)),[3,8];case 8:return[2]}}
1))}))},getRemoteConfig:function(e,n){return qt(void 0,void 0,void 0,(function(){var r;return Ft(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,i.get(e,n)];case 1:return[2,o.sent()];case 2:return r=o.sent(),t.warn("Failed to fetch remote config: ".concat(r)),[3,3];case 3:return[2,void 0]}}))}))},getLastFetchedSessionId:function(){return qt(void 0,void 0,void 0,(function(){var e;return Ft(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,s.get("lastFetchedSessionId","sessionId")];case 1:return[2,n.sent()];case 2:return e=n.sent(),t.warn("Failed to fetch lastFetchedSessionId: ".concat(e)),[3,3];case 3:return[2,void 0]}}))}))},remoteConfigHasValues:function(e){return qt(void 0,void 0,void 0,(function(){var n;return Ft(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,i.getAll(e)];case 1:return[2,!!r.sent().length];case 2:return n=r.sent(),t.warn("Failed to fetch remote config: ".concat(n)),[3,3];case 3:return[2,!1]}}))}))}}]}var l}))}))},bn="Remote config fetch rejected due to timeout after 5 seconds",wn=function(){function e(e){var t=e.localConfig,n=e.configKeys,r=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(e,t,n){return qt(r,void 0,void 0,(function(){var r,i,o,s,a;return Ft(this,(function(u){switch(u.label){case 0:return r=Date.now(),this.remoteConfigIDBStore?[4,this.remoteConfigIDBStore.getLastFetchedSessionId()]:[3,3];case 1:return(i=u.sent())&&n&&i===n?[4,this.remoteConfigIDBStore.getRemoteConfig(e,t)]:[3,3];case 2:return o=u.sent(),this.metrics.fetchTimeIDB=Date.now()-r,[2,o];case 3:return[4,this.fetchWithTimeout(n)];case 4:return(s=u.sent())&&(a=s.configs&&s.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-r,[2,a[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-r,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return qt(r,void 0,void 0,(function(){var t,n,r;return Ft(this,(function(i){switch(i.label){case 0:return t=new AbortController,n=setTimeout((function(){return t.abort()}),5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return r=i.sent(),clearTimeout(n),[2,r]}}))}))},this.fetchRemoteConfig=function(e,t){return qt(r,void 0,void 0,(function(){var n,r,i,o,s,a;return Ft(this,(function(u){switch(u.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:bn})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),u.label=1;case 1:return u.trys.push([1,3,,4]),n=new URLSearchParams({api_key:this.localConfig.apiKey,config_keys:this.configKeys.join(",")}),r={headers:{"Content-Type":"application/json",Accept:"*/*"},method:"GET"},i="".concat(this.getServerUrl(),"?").concat(n.toString()),this.attempts+=1,[4,fetch(i,Mt(Mt({},r),{signal:e}))];case 2:if(null===(o=u.sent()))return[2,this.completeRequest({err:"Unexpected error occurred"})];switch((new $e).buildStatus(o.status)){case $t.Success:return this.attempts=0,[2,this.parseAndStoreConfig(o,t)];case $t.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}return[3,4];case 3:return s=u.sent(),a=s,e.aborted?[2,this.completeRequest({err:bn})]:[2,this.completeRequest({err:a.message})];case 4:return[2]}}
1))}))},this.retryFetch=function(e,t){return qt(r,void 0,void 0,(function(){var n=this;return Ft(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(e){return setTimeout(e,n.attempts*n.retryTimeout)}))];case 1:return r.sent(),[2,this.fetchRemoteConfig(e,t)]}}))}))},this.parseAndStoreConfig=function(e,t){return qt(r,void 0,void 0,(function(){var n;return Ft(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return n=r.sent(),this.remoteConfigIDBStore?[4,this.remoteConfigIDBStore.storeRemoteConfig(n,t)]:[3,3];case 2:r.sent(),r.label=3;case 3:return this.completeRequest({success:"Remote config successfully fetched"}),[2,n]}}))}))},this.localConfig=t,this.configKeys=n}return e.prototype.initialize=function(){return qt(this,void 0,void 0,(function(){var e;return Ft(this,(function(t){switch(t.label){case 0:return e=this,[4,mn({apiKey:this.localConfig.apiKey,loggerProvider:this.localConfig.loggerProvider,configKeys:this.configKeys})];case 1:return e.remoteConfigIDBStore=t.sent(),[2]}}))}))},e.prototype.getServerUrl=function(){return this.localConfig.serverZone===Kt.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===Kt.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,n=e.success;if(t)throw new Error(t);n&&this.localConfig.loggerProvider.log(n)},e}(),En=function(e){var t=e.localConfig,n=e.configKeys;return qt(void 0,void 0,void 0,(function(){var e;return Ft(this,(function(r){switch(r.label){case 0:return[4,(e=new wn({localConfig:t,configKeys:n})).initialize()];case 1:return r.sent(),[2,e]}}))}))},_n=function(){function e(e){this.config=e,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return e.prototype.initialize=function(){return _(this,void 0,void 0,(function(){var e;return S(this,(function(t){switch(t.label){case 0:return e=this,[4,En({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return e.remoteConfigFetch=t.sent(),[2]}}))}))},e.prototype.generateJoinedConfig=function(){var e,t,n;return _(this,void 0,void 0,(function(){var r,i,o;return S(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),(i=this.remoteConfigFetch)?[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)]:[3,2];case 1:i=s.sent(),s.label=2;case 2:return r=i,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(r,null,2)),r&&"autocapture"in r&&(this.config.autocapture=r.autocapture,this.config.defaultTracking=this.config.autocapture),this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),null!==(e=(n=this.config).requestMetadata)&&void 0!==e||(n.requestMetadata=new U),this.config.requestMetadata.recordHistogram("remote_config_fetch_time",null===(t=this.remoteConfigFetch)||void 0===t?void 0:t.fetchTime),[3,4];case 3:return o=s.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",o),[3,4];case 4:return[2,this.config]}}))}))},e}();var Sn=function(){return(Sn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function In(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function Tn(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(u){a=[6,u],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}Object.create;function On(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);
1if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function kn(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function Pn(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var xn=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],An=["div","span","h1","h2","h3","h4","h5","h6"];function Cn(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return Rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rn(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ln(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jn(e,t,n){return t&&Ln(e.prototype,t),n&&Ln(e,n),e}var Dn=function(){return"function"===typeof Symbol},Nn=function(e){return Dn()&&Boolean(Symbol[e])},Un=function(e){return Nn(e)?Symbol[e]:"@@"+e};Dn()&&!Nn("observable")&&(Symbol.observable=Symbol("observable"));var Mn=Un("iterator"),qn=Un("observable"),Fn=Un("species");function Vn(e,t){var n=e[t];if(null!=n){if("function"!==typeof n)throw new TypeError(n+" is not a function");return n}}function Bn(e){var t=e.constructor;return void 0!==t&&null===(t=t[Fn])&&(t=void 0),void 0!==t?t:Zn}function $n(e){return e instanceof Zn}function Kn(e){Kn.log?Kn.log(e):setTimeout((function(){throw e}))}function Hn(e){Promise.resolve().then((function(){try{e()}catch(t){Kn(t)}}))}function Gn(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"===typeof t)t();else{var n=Vn(t,"unsubscribe");n&&n.call(t)}}catch(r){Kn(r)}}function zn(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Wn(e,t,n){e._state="running";var r=e._observer;try{var i=Vn(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(zn(e),!i)throw n;i.call(r,n);break;case"complete":zn(e),i&&i.call(r)}}catch(o){Kn(o)}"closed"===e._state?Gn(e):"running"===e._state&&(e._state="ready")}function Jn(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void Hn((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Wn(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Wn(e,t,n);e._queue.push({type:t,value:n})}}var Qn=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new Yn(this);try{this._cleanup=t.call(void 0,n)}catch(r){n.error(r)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(zn(this),Gn(this))},jn(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),Yn=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){Jn(this._subscription,"next",e)},t.error=function(e){Jn(this._subscription,"error",e)},t.complete=function(){Jn(this._subscription,"complete")},jn(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Zn=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!==typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"===typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new Qn(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"===typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(n){r(n),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!==typeof e)throw new TypeError(e+" is not a function");return new(Bn(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(r){return n.error(r)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!==typeof e)throw new TypeError(e+" is not a function");return new(Bn(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(r){return n.error(r)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!==typeof e)throw new TypeError(e+" is not a function");var n=Bn(this),r=arguments.length>1,i=!1,o=arguments[1],s=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{s=e(s,t)}catch(a){return n.error(a)}else s=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(s),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=Bn(this);return new i((function(t){var r,o=0;return function e(s){r=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!==typeof e)throw new TypeError(e+" is not a function");var n=Bn(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(a){return r.error(a)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){r.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}
1return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[qn]=function(){return this},e.from=function(t){var n="function"===typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=Vn(t,qn);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return $n(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(Nn("iterator")&&(r=Vn(t,Mn)))return new n((function(e){Hn((function(){if(!e.closed){for(var n,i=Cn(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){Hn((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i="function"===typeof this?this:e;return new i((function(e){Hn((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},jn(e,null,[{key:Fn,get:function(){return this}}]),e}();function Xn(e,t){return new Zn((function(n){var r=!1,i=new Set,o=function(){var e,t;r=!0;try{for(var n=l(i),o=n.next();!o.done;o=n.next()){var s=o.value;try{s.unsubscribe()}catch(a){}}}catch(u){e={error:u}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),o())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),o(),r=!0)}});i.add(t)};return s(e),s(t),o}))}function er(e){var t=new Set,n=null;function r(){null===n||void 0===n||n.unsubscribe(),n=null,t.clear()}return new Zn((function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){var n,r,i;try{for(var o=l(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.next)||void 0===i||i.call(a,e)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},error:function(e){var n,i,o;try{for(var s=l(t),a=s.next();!a.done;a=s.next()){var u=a.value;null===(o=u.error)||void 0===o||o.call(u,e)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,i;try{for(var o=l(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.complete)||void 0===i||i.call(a)}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}}))}Dn()&&Object.defineProperty(Zn,Symbol("extensions"),{value:{symbol:qn,hostReportError:Kn},configurable:!0});var tr,nr={US:"https://app.amplitude.com",EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var rr="__AMPLITUDE_MESSENGER_INSTANCE__",ir=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?"https://app.amplitude.com":t;this[tr]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise((function(t,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),n.timeout>0&&setTimeout((function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var n,r,i,o;this.actionHandlers.has(e)&&(null===(o=null===(i=this.logger)||void 0===i?void 0:i.warn)||void 0===o||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var a=l(s),u=a.next();!u.done;u=a.next()){t(u.value)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return u(this,void 0,void 0,(function(){var t,n,r;return c(this,(function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise((function(t,n){var r;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(){n({status:!1,message:"Failed to load the script ".concat(e)})})),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(o){n(o)}}))}(e).then((function(){})),this.scriptLoadPromises.set(e,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),this.scriptLoadPromises.delete(e),r;case 4:return[2]}}
1))}))},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,s=i.endpoint;o&&(this.logger=o),s&&"https://app.amplitude.com"===this.endpoint&&(this.endpoint=s),this.isSetup||(this.isSetup=!0,null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,n,i,o,s;if(null===(n=null===(t=r.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var a=e.data,u=null===a||void 0===a?void 0:a.action;if(u)if("id"in a&&a.id)null===(o=null===(i=r.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(a);else{if("ping"===u)return void r.notify({action:"pong"});var c=r.actionHandlers.get(u);if(c)c(a.data);else{var l=null!==(s=r.pendingMessages.get(u))&&void 0!==s?s:[];l.push(a.data),r.pendingMessages.set(u,l)}}}},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=Object(M.a)();(null===e||void 0===e?void 0:e.__AMPLITUDE_MESSENGER__)===this&&delete e.__AMPLITUDE_MESSENGER__},e}();function or(e){var t,n=Object(M.a)(),r=null===n||void 0===n?void 0:n.__AMPLITUDE_MESSENGER__;if("object"===typeof(t=r)&&null!==t&&rr in t&&!0===t[rr])return r;var i=new ir(e);return n&&(n.__AMPLITUDE_MESSENGER__=i),i}tr=rr;var sr=function(e,t){return!t||!t.length||t.some((function(t){return"string"===typeof t?e===t:e.match(t)}))},ar=["input","select","textarea"],ur=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null===r||void 0===r?void 0:r.getPropertyValue("cursor"))&&"click"===t},cr=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,s,a=e.shouldTrackEventResolver,u=null===(s=null===(o=null===i||void 0===i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!u)return!1;if(a)return a(r,i);if(!function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&sr(window.location.href,n))&&!!sr(window.location.href,t)}(e))return!1;var c=String(null===i||void 0===i?void 0:i.getAttribute("type"))||"";if("string"===typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}var l=ur(i,r);if(n&&l)return!0;if(t&&!t.some((function(e){var t;return!!(null===(t=null===i||void 0===i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))})))return!1;switch(u){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:return!!l||"click"===r}}},lr=function(e){return Object.keys(e).reduce((function(t,n){var r=e[n];return function(e){return void 0===e||null===e||"object"===typeof e&&0===Object.keys(e).length||"string"===typeof e&&0===e.trim().length}(r)||(t[n]=r),t}),{})},dr=function(e,t){return e?t.some((function(t){var n;return null===(n=null===e||void 0===e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)}))?e:dr(null===e||void 0===e?void 0:e.parentElement,t):null};var fr,pr=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(fr||(fr={}));function vr(e){var t,n,r=e.amplitude,i=e.allObservables,o=e.options,s=e.getEventProperties,a=e.shouldTrackEvent,u=e.shouldTrackActionClick,c=i.clickObservable,l=i.mutationObservable,d=i.navigateObservable,f=c.filter((function(e){return!a("click",e.closestTrackedAncestor)})).map((function(e){var t=dr(e.event.target,o.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=s(e.type,e.closestTrackedAncestor)),e})).filter(pr).filter((function(e){return u("click",e.closestTrackedAncestor)})),p=d?Xn(l,d):l,v=Xn(f,p),h=null,g=null;return(t=v,n=function(e){if(h&&(clearTimeout(h),h=null),"click"===e.type)return g=e,h=setTimeout((function(){h=null,g=null}),500),Promise.resolve(null);if(g){var t=g;return g=null,Promise.resolve(t)}return Promise.resolve(null)},new Zn((function(e){t.subscribe({next:function(t){n(t).then((function(t){return e.next(t)}
1)).catch((function(t){return e.error(t)}))},error:function(t){e.error(t)},complete:function(){e.complete()}})}))).subscribe((function(e){e&&(null===r||void 0===r||r.track("[Amplitude] Element Clicked",s("click",e.closestTrackedAncestor)))}))}var hr=Object(M.a)();null===hr||void 0===hr||hr.console;var gr=Object(M.a)(),yr=function(e,t,n){e.forEach((function(e){if("string"!==typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}}))},mr={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},br=function(e){var t,n,r,i,o=Object.values(mr).reduce((function(e,t){return e[t]=new Set,e}),{});if(!e)return o;try{for(var s=On(e),a=s.next();!a.done;a=s.next()){var u=a.value;try{try{for(var c=(r=void 0,On(u.definition)),l=c.next();!l.done;l=c.next()){var d=l.value,f=mr[d.event_type];f&&o[f].add(u.id)}}catch(p){r={error:p}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}catch(v){console.warn("Skipping Labeled Event due to malformed definition",null===u||void 0===u?void 0:u.id,v)}}}catch(h){t={error:h}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},wr=function(e){var t,n,r,i,o=new Map;try{for(var s=On(e),a=s.next();!a.done;a=s.next()){var u=a.value;try{for(var c=(r=void 0,On(u.conditions)),l=c.next();!l.done;l=c.next()){var d=l.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(u)}}}catch(v){r={error:v}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},Er=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return mr[t.event_type]===e.type&&t.filters.every((function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(n){return console.error("Error matching event to filter",n),!1}return!1}(e,t)}))}))}))},_r=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var i=function(e,t){var n,r,i,o,s=new Set;try{for(var a=On(e),u=a.next();!u.done;u=a.next()){var c=u.value,l=t.get(c.id);if(l)try{for(var d=(i=void 0,On(l)),f=d.next();!f.done;f=d.next()){var p=f.value;s.add(p)}}catch(v){i={error:v}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(h){n={error:h}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return Array.from(s)}(Er(e,Array.from(this.groupedLabeledEvents[e.type]).map((function(e){return r.labeledEvents[e]}))),this.labeledEventToTriggerMap);try{for(var o=On(i),s=o.next();!s.done;s=o.next()){var a=s.value;yr(a.actions,e,this.dataExtractor)}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}(),Sr=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot","data-amp-mask-attributes","data-amp-mask"]),Ir=["type"],Tr=["svg","path","g"],Or=["password","hidden"];function kr(e,t){var n,r,i,o,s,a;if(null===e)return null;var u=String(e.tagName).toLowerCase(),c={tag:u},l=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);l.length&&(c.index=l.indexOf(e),c.indexOfType=l.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var d=null===(a=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===a?void 0:a.toLowerCase();d&&(c.prevSib=String(d));var f=e.getAttribute("id");f&&(c.id=String(f));var p=Array.from(e.classList);p.length&&(c.classes=p);var v={},h=Array.from(e.attributes).filter((function(e){return!Sr.has(e.name)})),g=!function(e){var t,n,r,i=null===(n=null===(t=null===e||void 0===e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!ar.includes(i)&&!o}(e);if(!Or.includes(String(e.getAttribute("type")))&&!Tr.includes(u))try{for(var y=On(h),m=y.next();!m.done;m=y.next()){var b=m.value;g&&!Ir.includes(b.name)||(t.has(b.name)?v[b.name]="*****":v[b.name]=String(b.value).substring(0,128))}}catch(w){n={error:w}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}return Object.keys(v).length&&(c.attrs=v),c}var Pr,xr=function(e,t){var n,r,i,o=this;
1this.replaceSensitiveString=function(e){return St(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,s,a=performance.now();if(!e)return[];for(var u,c=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),l=new Map,d=c.length-1;d>=0;d--){var f=c[d];if(f){var p=(u=f.getAttribute("data-amp-mask-attributes"))?u.split(",").map((function(e){return e.trim()})).filter((function(e){return e.length>0&&"id"!==e&&"class"!==e})):[],v=d===c.length-1?[]:null!==(r=l.get(c[d+1]))&&void 0!==r?r:new Set,h=new Set(Pn(Pn([],kn(v),!1),kn(p),!1));l.set(f,h)}}s=c.map((function(e){var t;return kr(e,null!==(t=l.get(e))&&void 0!==t?t:new Set)}));var g=function(e){(null===e||void 0===e?void 0:e.attrs)&&Object.entries(e.attrs).forEach((function(t){var n=kn(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))}))};try{for(var y=On(s),m=y.next();!m.done;m=y.next())g(m.value)}catch(w){t={error:w}}finally{try{m&&!m.done&&(n=y.return)&&n.call(y)}finally{if(t)throw t.error}}var b=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",b-a),s},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(r){t=null}return t?o.getText(t):o.getNearestLabel(n)},this.getEventProperties=function(e,t,n){var r,i,s,a,u,c,l=null===(s=null===(i=null===t||void 0===t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"===typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},f=o.getHierarchy(t),p=null===(a=f[0])||void 0===a?void 0:a.attrs,v=o.getNearestLabel(t),h=(u=null!==p&&void 0!==p?p:{},c=n,Object.entries(u).reduce((function(e,t){var n=kn(t,2),r=n[0],i=n[1];if(r.startsWith(c)){var o=r.replace(c,"");o&&(e[o]=i||"")}return e}),{})),g=((r={})["[Amplitude] Element Hierarchy"]=f,r["[Amplitude] Element Tag"]=l,r["[Amplitude] Element Text"]=o.getText(t),r["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),r["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),r["[Amplitude] Element Attributes"]=h,r["[Amplitude] Element Parent Label"]=v,r["[Amplitude] Page URL"]=function(e,t){var n=e;try{n=decodeURI(e)}catch(r){null===t||void 0===t||t.error("Malformed URI sequence: ",r)}return n}(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=It(o.replaceSensitiveString),r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);if(g["[Amplitude] Element ID"]=t.getAttribute("id")||"",g["[Amplitude] Element Class"]=t.getAttribute("class"),g["[Amplitude] Element Aria Label"]=null===p||void 0===p?void 0:p["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var y=t.href.substring(0,128);g["[Amplitude] Element Href"]=o.replaceSensitiveString(y)}return lr(g)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var s=o.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i&&ur(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,r),s;var a=dr(s.event.target,n);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,r)),s}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(r){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?o.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat("data-amp-mask","], [contenteditable]");if(!e.querySelector(r))return e.innerText;var i="",s=Array.from(e.childNodes);try{for(var a=On(s),u=a.next();!u.done;u=a.next()){var c=u.value;c.nodeType!==Node.TEXT_NODE?c instanceof Element&&(c.hasAttribute("data-amp-mask")||c.hasAttribute("contenteditable")?i+="*****":i+=o.getTextWithMaskedDescendants(c)):i+=c.textContent||""}}
1catch(l){t={error:l}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat("data-amp-mask","]")))return"*****";var t="";return t=e.querySelector("[".concat("data-amp-mask","], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null===e||void 0===e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),s=((t={})["[Amplitude] Element Tag"]=i,t["[Amplitude] Element Text"]=o.getText(e),t["[Amplitude] Page URL"]=window.location.href.split("?")[0],t);return lr(s)},this.diagnosticsClient=null===t||void 0===t?void 0:t.diagnosticsClient;var s=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],a=[];try{for(var u=On(s),c=u.next();!c.done;c=u.next()){var l=c.value;if(a.length>=25)break;if(l instanceof RegExp)a.push(l);else if("pattern"in l&&"string"===typeof l.pattern)try{a.push(new RegExp(l.pattern,"i"))}catch(d){}}}catch(f){n={error:f}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=a};!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(Pr||(Pr={}));var Ar,Cr,Rr,Lr=function(e,t){var n,r,i,o,s,a,u,c;void 0===e&&(e={}),null===t||void 0===t||t.diagnosticsClient.setTag("plugin.autocapture.version","1.23.2");var l=e.dataAttributePrefix,d=void 0===l?"data-amp-track-":l,f=e.visualTaggingOptions,p=void 0===f?{enabled:!0}:f;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:xn,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:An,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.pageUrlExcludelist=null===(o=e.pageUrlExcludelist)||void 0===o?void 0:o.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(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e}),[]);var v="@amplitude/plugin-autocapture-browser",h=[],g=new xr(e,t),y=function(){var t,n,r,i=er((void 0===n&&(n="click"),new Zn((function(e){var t=function(t){e.next(t)};return gr.document.addEventListener(n,t,{capture:!0}),function(){gr.document.removeEventListener(n,t,{capture:!0})}}))).map((function(t){return g.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,d)}))),o=er(new Zn((function(t){var n,r=function(n){var r=g.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,d);t.next(r)};return null===(n=Object(M.a)())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=Object(M.a)())||void 0===e?void 0:e.document.removeEventListener("change",r)}})));window.navigation&&(r=er(new Zn((function(t){var n=function(n){var r=g.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,d);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}}))));var s=er(new Zn((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()}})).map((function(t){return g.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,d)})));return(t={})[Pr.ChangeObservable]=o,t[Pr.ClickObservable]=i,t[Pr.MutationObservable]=s,t[Pr.NavigateObservable]=r,t},m=br(Object.values(null!==(a=null===(s=e.pageActions)||void 0===s?void 0:s.labeledEvents)&&void 0!==a?a:{})),b=wr(null!==(c=null===(u=e.pageActions)||void 0===u?void 0:u.triggers)&&void 0!==c?c:[]),w=function(e,t,n,r){return new _r(e,t,n,r)}(m,b,g,e);return{name:v,type:"enrichment",setup:function(t,n){return In(void 0,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,f,E;return Tn(this,(function(_){return"undefined"===typeof document||(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",(function(t){!function(t){var n,r;t&&(e.pageActions=Sn(Sn({},e.pageActions),t),m=br(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),b=wr(null!==(r=e.pageActions.triggers)&&void 0!==r?r:[]),w.update(m,b,e))}(t)})):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),r=cr(e,e.cssSelectorAllowlist),i=cr(e,e.actionClickAllowlist),o=y(),s=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(pr).filter((function(e){return r("click",e.closestTrackedAncestor)})).map((function(e){return i(e)})).subscribe((function(e){null===t||void 0===t||t.track("[Amplitude] Element Clicked",e.targetElementProperties)}))}({allObservables:o,amplitude:n,shouldTrackEvent:r,evaluateTriggers:w.evaluate.bind(w)}),h.push(s),a=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(pr).filter((function(e){return i("change",e.closestTrackedAncestor)})).map((function(e){return o(e)})).subscribe((function(e){null===t||void 0===t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))}))}({allObservables:o,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g.getEventProperties.apply(g,Pn(Pn([],kn(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,evaluateTriggers:w.evaluate.bind(w)}),h.push(a),(u=vr({allObservables:o,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g.getEventProperties.apply(g,Pn(Pn([],kn(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}))&&h.push(u),null===(E=null===t||void 0===t?void 0:t.loggerProvider)||void 0===E||E.log("".concat(v," has been successfully added.")),window.opener&&p.enabled&&(c=e.cssSelectorAllowlist,l=e.actionClickAllowlist,function(e,t){var n=e;if(!0!==n.__AMPLITUDE_VISUAL_TAGGING__){n.__AMPLITUDE_VISUAL_TAGGING__=!0;
1var r=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,s=t.actionClickAllowlist,a=null,u=function(t){e.notify({action:"element-selected",data:t})},c=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};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 n;a=null===(n=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===n?void 0:n.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!i||i((null===t||void 0===t?void 0:t.actionType)||"click",e)},onTrack:c,onSelect:u,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:s,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:"1.23.2"}}}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))})),e.registerActionHandler("close-visual-tagging-selector",(function(){var e;null===(e=null===a||void 0===a?void 0:a.close)||void 0===e||e.call(a)}))}}(f=or(),{dataExtractor:g,isElementSelectable:cr(e,Pn(Pn([],kn(c),!1),kn(l),!1)),cssSelectorAllowlist:c,actionClickAllowlist:l}),function(e,t){var n,r=e;if(!0!==r.__AMPLITUDE_BACKGROUND_CAPTURE__){r.__AMPLITUDE_BACKGROUND_CAPTURE__=!0;var i=null!==(n=null===t||void 0===t?void 0:t.scriptUrl)&&void 0!==n?n:"https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.2.js.gz",o=null,s=function(t,n){var r,i;"background-capture-complete"===t&&(null===(i=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===i||i.call(r,"Background capture complete"),e.notify({action:"background-capture-complete",data:n}))};e.registerActionHandler("initialize-background-capture",(function(){var t,n;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Initializing background capture (external script)");var r=new URL(i,e.endpoint).toString();e.loadScriptOnce(r).then((function(){var t,n,r;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Background capture script loaded (external)"),o=null===(r=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===r?void 0:r.call(window,{messenger:e,onBackgroundCapture:s}),e.notify({action:"background-capture-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")}))})),e.registerActionHandler("close-background-capture",(function(){var e;null===(e=null===o||void 0===o?void 0:o.close)||void 0===e||e.call(o),o=null}))}}(f),f.setup(Sn({logger:null===t||void 0===t?void 0:t.loggerProvider},(null===t||void 0===t?void 0:t.serverZone)&&{endpoint:nr[t.serverZone]})))),[2]}))}))},execute:function(e){return In(void 0,void 0,void 0,(function(){return Tn(this,(function(t){return[2,e]}))}))},teardown:function(){return In(void 0,void 0,void 0,(function(){var e,t,n,r;return Tn(this,(function(i){try{for(e=On(h),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(o){n={error:o}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},jr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return w(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"===typeof t?(r=t,i=void 0):(r=null===t||void 0===t?void 0:t.userId,i=t),O(this._init(E(E({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i;return _(this,void 0,void 0,(function(){var o,s,a,u,c,l=this;return S(this,(function(d){switch(d.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,dt(t.apiKey,t,this)]);case 1:return o=d.sent(),t.fetchRemoteConfig?[4,(v=o,_(void 0,void 0,void 0,(function(){var e;return S(this,(function(t){switch(t.label){case 0:return[4,(e=new _n(v)).initialize()];case 1:return t.sent(),[2,e]}}))})))]:[3,4];case 2:return[4,d.sent().generateJoinedConfig()];case 3:o=d.sent(),d.label=4;case 4:return[4,e.prototype._init.call(this,o)];case 5:return d.sent(),this.logBrowserOptions(o),fe(this.config.defaultTracking)?(p=this.config,s=fe(p.defaultTracking)&&p.defaultTracking&&"object"===typeof p.defaultTracking&&p.defaultTracking.attribution&&"object"===typeof p.defaultTracking.attribution?oe({},p.defaultTracking.attribution):{}
vendor: 4,458 bytes, line 1
1,this.webAttribution=new Pe(s,this.config),[4,this.webAttribution.init()]):[3,7];case 6:d.sent(),d.label=7;case 7:return a=Ie(),u=Number.isNaN(Number(a.ampSessionId))?void 0:Number(a.ampSessionId),this.setSessionId(null!==(i=null!==(r=null!==(n=t.sessionId)&&void 0!==n?n:u)&&void 0!==r?r:this.config.sessionId)&&void 0!==i?i:Date.now()),(c=Ae(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===Re?[3,9]:[4,this.add(Ut()).promise];case 8:d.sent(),d.label=9;case 9:return[4,this.add(new H).promise];case 10:return d.sent(),[4,this.add(new Ue).promise];case 11:return d.sent(),[4,this.add(new Ce).promise];case 12:return d.sent(),function(e){Nt||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n  defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),Nt=!0)}(this.config),f=this.config.defaultTracking,de(f,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Dt()).promise]):[3,14];case 13:d.sent(),d.label=14;case 14:return function(e){return de(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Lt()).promise]):[3,16];case 15:d.sent(),d.label=16;case 16:return pe(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(xt(ye(this.config))).promise]):[3,18];case 17:d.sent(),d.label=18;case 18:return he(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Lr(ge(this.config))).promise]):[3,20];case 19:d.sent(),d.label=20;case 20:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 21:return d.sent(),c.eventBridge.setEventReceiver((function(e){l.track(e.eventType,e.eventProperties)})),[2]}var f,p,v}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,function(e,t){Ae(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),this.config.deviceId=e,function(e,t){Ae(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName)):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(F()),this.setUserId(void 0)},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),O(Promise.resolve());if(e===this.config.sessionId)return O(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId(),i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,ve(this.config.defaultTracking)&&(r&&i&&n.push(this.track("session_end",void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,n);return ve(this.config.defaultTracking)&&n.push(this.track("session_start",void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,O(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=
1Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=pt(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(De(t)){var r=t._q;t._q=[],t=je(new W,r)}return(null===n||void 0===n?void 0:n.user_id)&&this.setUserId(n.user_id),(null===n||void 0===n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(De(r)){var o=r._q;r._q=[],r=je(new W,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(De(t)){var r=t._q;t._q=[],t=je(new X,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return _(this,void 0,void 0,(function(){var n,r,i;return S(this,(function(o){return n=Date.now(),r=ke(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),"session_start"===t.event_type||"session_end"===t.event_type||t.session_id&&t.session_id!==this.getSessionId()||(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=E(E({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(n){this.config.loggerProvider.error("Error logging browser config",n)}},t}(ne),Dr=function(){var e=new jr;return{init:m(e.init.bind(e),"init",h(e),y(e,["config"])),add:m(e.add.bind(e),"add",h(e),y(e,["config.apiKey","timeline.plugins"])),remove:m(e.remove.bind(e),"remove",h(e),y(e,["config.apiKey","timeline.plugins"])),track:m(e.track.bind(e),"track",h(e),y(e,["config.apiKey","timeline.queue.length"])),logEvent:m(e.logEvent.bind(e),"logEvent",h(e),y(e,["config.apiKey","timeline.queue.length"])),identify:m(e.identify.bind(e),"identify",h(e),y(e,["config.apiKey","timeline.queue.length"])),groupIdentify:m(e.groupIdentify.bind(e),"groupIdentify",h(e),y(e,["config.apiKey","timeline.queue.length"])),setGroup:m(e.setGroup.bind(e),"setGroup",h(e),y(e,["config.apiKey","timeline.queue.length"])),revenue:m(e.revenue.bind(e),"revenue",h(e),y(e,["config.apiKey","timeline.queue.length"])),flush:m(e.flush.bind(e),"flush",h(e),y(e,["config.apiKey","timeline.queue.length"])),getUserId:m(e.getUserId.bind(e),"getUserId",h(e),y(e,["config","config.userId"])),setUserId:m(e.setUserId.bind(e),"setUserId",h(e),y(e,["config","config.userId"])),getDeviceId:m(e.getDeviceId.bind(e),"getDeviceId",h(e),y(e,["config","config.deviceId"])),setDeviceId:m(e.setDeviceId.bind(e),"setDeviceId",h(e),y(e,["config","config.deviceId"])),reset:m(e.reset.bind(e),"reset",h(e),y(e,["config","config.userId","config.deviceId"])),getSessionId:m(e.getSessionId.bind(e),"getSessionId",h(e),y(e,["config"])),setSessionId:m(e.setSessionId.bind(e),"setSessionId",h(e),y(e,["config"])),extendSession:m(e.extendSession.bind(e),"extendSession",h(e),y(e,["config"])),setOptOut:m(e.setOptOut.bind(e),"setOptOut",h(e),y(e,["config"])),setTransport:m(e.setTransport.bind(e),"setTransport",h(e),y(e,["config"]))}},Nr=Dr();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(Ar||(Ar={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(Cr||(Cr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Rr||(Rr={}));var Ur=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],Mr="data-amp-track-",qr=["div","span","h1","h2","h3","h4","h5","h6"],Fr=Nr.add,Vr=Nr.extendSession,Br=Nr.flush,$r=Nr.getDeviceId,Kr=Nr.getSessionId,Hr=Nr.getUserId,Gr=Nr.groupIdentify,zr=Nr.identify,Wr=Nr.init,Jr=Nr.logEvent,Qr=Nr.remove,Yr=Nr.reset,Zr=Nr.revenue,Xr=Nr.setDeviceId,ei=Nr.setGroup,ti=Nr.
1setOptOut,ni=Nr.setSessionId,ri=Nr.setTransport,ii=Nr.setUserId,oi=Nr.track;function si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ai(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?si(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):si(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ui=function(){return window.location.href.split("/")[4]},ci=function(){Wr("5178d393dc2dad45db35eea6bd91acc1",null,{defaultTracking:{attribution:!0,pageViews:!1,sessions:!0,fileDownloads:!1,formInteractions:!1},cookieOptions:{domain:".addx.co"}}).promise.then((function(){})),window.amplitude=i},li=function(e){},di=function(e,t){},fi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ai({},t);Jr(e,n)},pi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ai({},t);return Jr(e,n).promise},vi=function(){return Br().promise}},TSkg:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return r}));var r=function(){return"undefined"!==typeof globalThis&&"undefined"!==typeof globalThis.ampIntegrationContext?globalThis.ampIntegrationContext:"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof self?self:"undefined"!==typeof e?e:void 0}}).call(this,n("yLpj"))}}]);

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