1 line
118 KiB
JavaScript
1 line
118 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.amplitude=t():e.amplitude=t()}(this,(function(){return function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.d(t,{default:function(){return Ti}});var n={};e.r(n),e.d(n,{DEFAULT_ACTION_CLICK_ALLOWLIST:function(){return Mt},DEFAULT_CSS_SELECTOR_ALLOWLIST:function(){return qt},DEFAULT_DATA_ATTRIBUTE_PREFIX:function(){return jt},IdentifyOperation:function(){return D},LogLevel:function(){return g},OfflineDisabled:function(){return Le},RevenueProperty:function(){return q},ServerZone:function(){return Oe},SpecialEventType:function(){return j},Status:function(){return y}});var r={};e.r(r),e.d(r,{Identify:function(){return K},Revenue:function(){return z},Types:function(){return n},add:function(){return oi},createInstance:function(){return ri},extendSession:function(){return ui},flush:function(){return si},getDeviceId:function(){return ai},getSessionId:function(){return ci},getUserId:function(){return li},groupIdentify:function(){return di},identify:function(){return fi},init:function(){return pi},logEvent:function(){return hi},remove:function(){return vi},reset:function(){return gi},revenue:function(){return yi},runQueuedFunctions:function(){return Ue},setDeviceId:function(){return mi},setGroup:function(){return bi},setOptOut:function(){return wi},setSessionId:function(){return Si},setTransport:function(){return _i},setUserId:function(){return Ei},track:function(){return Ii}});var i=function(e,t){return i=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])},i(e,t)};function o(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}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return u=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},u.apply(this,arguments)};function s(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 a(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{a(r.next(e))}catch(e){o(e)}}function s(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,s)}a((r=r.apply(e,t||[])).next())}))}function c(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(e,u)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}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),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}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))}function p(e){return this instanceof p?(this.v=e,this):new p(e)}function h(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof p?Promise.resolve(n.value.v).then(a,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function a(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function v(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=l(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError;var g;!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"}(g||(g={}));var y,m=function(e){return function(){var t=u({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},b=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 u=o.value;if(!(u in e))return;e=e[u]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},w=function(e,t){return function(){var n,r,i={};try{for(var o=l(t),u=o.next();!u.done;u=o.next()){var s=u.value;i[s]=b(e,s)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},S=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];var s=n(),a=s.logger,c=s.logLevel;if(c&&c<g.Debug||!c||!a)return e.apply(i,o);var l,d={type:"invoke public method",name:t,args:o,stacktrace:(l=1,void 0===l&&(l=0),((new Error).stack||"").split("\n").slice(2+l).map((function(e){return e.trim()}))),time:{start:(new Date).toISOString()},states:{}};r&&d.states&&(d.states.before=r());var f=e.apply(i,o);return f&&f.promise?f.promise.then((function(){r&&d.states&&(d.states.after=r()),d.time&&(d.time.end=(new Date).toISOString()),a.debug(JSON.stringify(d,null,2))})):(r&&d.states&&(d.states.after=r()),d.time&&(d.time.end=(new Date).toISOString()),a.debug(JSON.stringify(d,null,2))),f}},_=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"}(y||(y={}));var E="AMP",I="".concat(E,"_unsent"),T="https://api2.amplitude.com/2/httpapi",k=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=y.Unknown),{event:e,code:t,message:n}},P="Amplitude Logger ",O=function(){function e(){this.logLevel=g.None}return e.prototype.disable=function(){this.logLevel=g.None},e.prototype.enable=function(e){void 0===e&&(e=g.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Verbose||console.log("".concat(P,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Warn||console.warn("".concat(P,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Error||console.error("".concat(P,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Debug||console.log("".concat(P,"[Debug]: ").concat(e.join(" ")))},e}(),x=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:g.Warn,loggerProvider:new O,offline:!1,optOut:!1,serverUrl:T,serverZone:"US",useBatch:!1}},A=function(){function e(e){var t,n,r,i;this._optOut=!1;var o=x();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 u=R(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=u.serverZone,this.serverUrl=u.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),C=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":T},R=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=x().serverZone),void 0===n&&(n=x().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:x().serverZone;return{serverZone:r,serverUrl:C(r,n)}},N=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}(),L=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,L)};function U(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var D,q,j,M=function(){function e(){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return e.prototype.setup=function(e){var t;return a(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(I,"_").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=L()),new Promise((function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.addToQueue(r)}))},e.prototype.getTryableList=function(e){var t=this;return e.filter((function(e){return e.attempts<t.config.flushMaxRetries?(e.attempts+=1,!0):(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleTryable=function(e,t){var n=this;void 0===t&&(t=!1),e.forEach((function(e){t&&(n.queue=n.queue.concat(e)),0!==e.timeout?setTimeout((function(){e.timeout=0,n.schedule(0)}),e.timeout):n.schedule(n.config.flushIntervalMillis)}))},e.prototype.addToQueue=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.getTryableList(e);this.scheduleTryable(n,!0),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||this.config.offline||(this.scheduled=setTimeout((function(){t.flush(!0).then((function(){t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var t,n,r,i=this;return c(this,(function(o){switch(o.label){case 0:return this.config.offline?(this.config.loggerProvider.debug("Skipping flush while offline."),[2]):(t=[],n=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):n.push(e)})),this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),u=t,s=this.config.flushQueueSize,a=Math.max(s,1),r=u.reduce((function(e,t,n){var r=Math.floor(n/a);return e[r]||(e[r]=[]),e[r].push(t),e}),[]),[4,Promise.all(r.map((function(t){return i.send(t,e)})))]);case 1:return o.sent(),this.scheduleTryable(n),[2]}var u,s,a}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),a(this,void 0,void 0,(function(){var n,r,i,o,u;return c(this,(function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;t.extra;return s(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new N,a.label=1;case 1:return a.trys.push([1,3,,4]),r=R(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,n)];case 2:return null===(i=a.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(i,e),[3,4]):("body"in i?this.fulfillRequest(e,i.statusCode,"".concat(i.status,": ").concat(U(i))):this.fulfillRequest(e,i.statusCode,i.status),[2]);case 3:return o=a.sent(),u=(c=o)instanceof Error?c.message:String(c),this.config.loggerProvider.error(u),this.handleResponse({status:y.Failed,statusCode:0},e),[3,4];case 4:return[2]}var c}))}))},e.prototype.handleResponse=function(e,t){var n=e.status;switch(n){case y.Success:this.handleSuccessResponse(e,t);break;case y.Invalid:this.handleInvalidResponse(e,t);break;case y.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case y.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var 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(U(e));var u=this.getTryableList(o);this.scheduleTryable(u)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(U(e)),this.config.flushQueueSize/=2;var n=this.getTryableList(t);this.scheduleTryable(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,u=new Set(r),s=new Set(i),a=new Set(o),c=t.filter((function(t,r){if(!(t.event.user_id&&u.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)))return a.has(r)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));c.length>0&&this.config.loggerProvider.warn(U(e));var l=this.getTryableList(c);this.scheduleTryable(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),r=this.getTryableList(n);this.scheduleTryable(r)},e.prototype.fulfillRequest=function(e,t,n){this.removeEvents(e),e.forEach((function(e){return e.callback(k(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}();!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"}(D||(D={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(q||(q={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(j||(j={}));var F=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!V(t,n))return!1}return!0},V=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),u=o.next();!u.done;u=o.next()){var s=u.value;if(Array.isArray(s))return!1;if("object"==typeof s)i=i&&F(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(null==t)return!1;if("object"==typeof t)return F(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},K=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return u({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(D.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(D.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(D.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(D.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(D.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(D.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(D.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(D.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(D.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[D.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[D.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===D.ADD?"number"==typeof n:e===D.UNSET||e===D.REMOVE||V(t,n)))},e}(),z=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.setRevenue=function(e){return this.revenue=e,this},e.prototype.setEventProperties=function(e){return F(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?u({},this.properties):{};return e[q.REVENUE_PRODUCT_ID]=this.productId,e[q.REVENUE_QUANTITY]=this.quantity,e[q.REVENUE_PRICE]=this.price,e[q.REVENUE_TYPE]=this.revenueType,e[q.REVENUE]=this.revenue,e},e}(),$=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var n,r;return a(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}))?(t.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=L(),t.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){var t;return a(this,void 0,void 0,(function(){var n,r;return c(this,(function(i){switch(i.label){case 0:return n=this.plugins.findIndex((function(t){return t.name===e})),r=this.plugins[n],this.plugins.splice(n,1),[4,null===(t=r.teardown)||void 0===t?void 0:t.call(r)];case 1:return i.sent(),[2]}}))}))},e.prototype.reset=function(e){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 a(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,f,p,h,v,g,y,m,b,w,S,_,E,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],o=this.plugins.filter((function(e){return"before"===e.type})),c.label=1;case 1:c.trys.push([1,6,7,8]),s=l(o),a=s.next(),c.label=2;case 2:return a.done?[3,5]:(g=a.value).execute?[4,g.execute(u({},n))]:[3,4];case 3:if(null===(y=c.sent()))return i({event:n,code:0,message:""}),[2];n=y,c.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return f=c.sent(),S={error:f},[3,8];case 7:try{a&&!a.done&&(_=s.return)&&_.call(s)}finally{if(S)throw S.error}return[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]),h=l(p),v=h.next(),c.label=10;case 10:return v.done?[3,13]:(g=v.value).execute?[4,g.execute(u({},n))]:[3,12];case 11:if(null===(y=c.sent()))return i({event:n,code:0,message:""}),[2];n=y,c.label=12;case 12:return v=h.next(),[3,10];case 13:return[3,16];case 14:return m=c.sent(),E={error:m},[3,16];case 15:try{v&&!v.done&&(I=h.return)&&I.call(h)}finally{if(E)throw E.error}return[7];case 16:return b=this.plugins.filter((function(e){return"destination"===e.type})),w=b.map((function(e){var t=u({},n);return e.execute(t).catch((function(e){return k(t,0,String(e))}))})),Promise.all(w).then((function(e){var t=d(e,1)[0]||k(n,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return a(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}(),B=function(e,t){return u(u({},t),{event_type:j.IDENTIFY,user_properties:e.getUserProperties()})},W=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 $(this),this.name=e}return e.prototype._init=function(e){return a(this,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,u,s,a;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 u=c.sent(),s={error:u},[3,10];case 9:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(s)throw s.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]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return u(u(u({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return _(this.dispatch(r))},e.prototype.identify=function(e,t){var n=B(e,t);return _(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=function(e,t,n,r){var i;return u(u({},r),{event_type:j.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})}(e,t,n,r);return _(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,i=new K;return i.set(e,t),u(u({},n),{event_type:j.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return _(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=function(e,t){return u(u({},t),{event_type:j.REVENUE,event_properties:e.getEventProperties()})}(e,t);return _(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),_())},e.prototype._addPlugin=function(e){return _(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)),_())},e.prototype._removePlugin=function(e){return _(this.timeline.deregister(e))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(k(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return a(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.process=function(e){return a(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,k(e,0,"Event skipped due to optOut config")]:[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=k(e,0,n)];case 3:return[2]}}))}))},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=Boolean(e)},e.prototype.flush=function(){return _(this.timeline.flush())},e}(),J=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},Q=function(e){return J(e,"attribution")},H=function(e){return J(e,"pageViews")},Y=function(e){return J(e,"sessions")},Z=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},G=function(e){if(Z(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},X=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return H(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}},ee="dclid",te="fbclid",ne="gbraid",re="gclid",ie="ko_click_id",oe="li_fat_id",ue="msclkid",se="rtd_cid",ae="ttclid",ce="twclid",le="wbraid",de={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,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},fe=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},pe=function(e,t,n,r){void 0===r&&(r=!0);e.referrer;var i=e.referring_domain,o=s(e,["referrer","referring_domain"]),u=t||{},a=(u.referrer,u.referring_domain),c=s(u,["referrer","referring_domain"]);if(he(n.excludeReferrers,e.referring_domain))return!1;if(!r&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return!1;var l=JSON.stringify(o)!==JSON.stringify(c),d=fe(i||"")!==fe(a||"");return!t||l||d},he=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}))},ve=function(){var t="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[t]?globalThis[t]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==e.g?e.g:void 0},ge=function(){var e,t=ve();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=ye(n[0]),i=ye(n[1]);return i?(e[r]=i,e):e}),{}):{}},ye=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},me=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){return[2,u(u(u(u({},de),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=ge();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=ge();return(e={})[ee]=t[ee],e[te]=t[te],e[ne]=t[ne],e[re]=t[re],e[ie]=t[ie],e[oe]=t[oe],e[ue]=t[ue],e[se]=t[se],e[ae]=t[ae],e[ce]=t[ce],e[le]=t[le],e},e}(),be=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},we=function(){function e(e,t){var n,r,i,o,s,a;this.shouldTrackNewCampaign=!1,this.options=u({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(r=null===(n=t.cookieOptions)||void 0===n?void 0:n.domain,i=r,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[])},e),this.storage=t.cookieStorage,this.storageKey=(o=t.apiKey,void 0===(s="MKTG")&&(s=""),void 0===a&&(a=10),[E,s,o.substring(0,a)].filter(Boolean).join("_")),this.currentCampaign=de,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return a(this,void 0,void 0,(function(){var e,t;return c(this,(function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:return t=d.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||be(this.sessionTimeout,this.lastEventTime),pe(this.currentCampaign,this.previousCampaign,this.options,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]}}))}))},e.prototype.fetchCampaign=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,Promise.all([(new me).parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r,i,o=(t=this.currentCampaign,n=this.options,r=u(u({},de),t),i=Object.entries(r).reduce((function(e,t){var r,i=d(t,2),o=i[0],u=i[1];return e.setOnce("initial_".concat(o),null!==(r=null!=u?u:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),u?e.set(o,u):e.unset(o)}),new K),B(i));return e&&(o.event_id=e),o},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Se=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:_e(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),_e=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ee=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}(),Ie=function(){return Ie=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},Ie.apply(this,arguments)};function Te(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 ke(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var Pe=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Te(["string","number","boolean","undefined"]),u=o.next();!u.done;u=o.next()){if(u.value===i)return e===t}}catch(e){n={error:e}}finally{try{u&&!u.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 s=Array.isArray(e),a=Array.isArray(t);if(s!==a)return!1;if(!s||!a){var c=Object.keys(e).sort(),l=Object.keys(t).sort();if(!Pe(c,l))return!1;var d=!0;return Object.keys(e).forEach((function(n){Pe(e[n],t[n])||(d=!1)})),d}for(var f=0;f<e.length;f++)if(!Pe(e[f],t[f]))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 Oe,xe=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Ie({},this.identity.userProperties),n=Ie(Ie({},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,u,s,a=n.userProperties||{};try{for(var c=Te(Object.entries(e)),l=c.next();!l.done;l=c.next()){var d=ke(l.value,2),f=d[0],p=d[1];switch(f){case"$set":try{for(var h=(i=void 0,Te(Object.entries(p))),v=h.next();!v.done;v=h.next()){var g=ke(v.value,2),y=g[0],m=g[1];a[y]=m}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(u=void 0,Te(Object.keys(p))),w=b.next();!w.done;w=b.next()){delete a[y=w.value]}}catch(e){u={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(u)throw u.error}}break;case"$clearAll":a={}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return n.userProperties=a,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return Ie({},this.identity)},e.prototype.setIdentity=function(e){var t=Ie({},this.identity);this.identity=Ie({},e),Pe(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}(),Ae="undefined"!=typeof globalThis?globalThis:void 0!==e.g?e.g:self,Ce=function(){function e(){this.identityStore=new xe,this.eventBridge=new Ee,this.applicationContextProvider=new Se}return e.getInstance=function(t){return Ae.analyticsConnectorInstances||(Ae.analyticsConnectorInstances={}),Ae.analyticsConnectorInstances[t]||(Ae.analyticsConnectorInstances[t]=new e),Ae.analyticsConnectorInstances[t]},e}(),Re=function(e){return void 0===e&&(e="$default_instance"),Ce.getInstance(e)},Ne=function(){function e(){this.name="identity",this.type="before",this.identityStore=Re().identityStore}return e.prototype.execute=function(e){return a(this,void 0,void 0,(function(){var t;return c(this,(function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return a(this,void 0,void 0,(function(){return c(this,(function(t){return e.instanceName&&(this.identityStore=Re(e.instanceName).identityStore),[2]}))}))},e}(),Le=null,Ue=function(e,t){De(e,t)},De=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,u=r.resolve,s=e&&e[i];if("function"==typeof s){var a=s.apply(e,o);"function"==typeof u&&u(null==a?void 0:a.promise)}}return e},qe=function(e){return e&&void 0!==e._q},je=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:""},Me=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="amplitude-ts/".concat("2.11.8"),"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 a(this,void 0,void 0,(function(){var r,i,o;return c(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,u(u(u(u(u(u(u(u({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:je()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:L(),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}(),Fe=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return a(this,void 0,void 0,(function(){return c(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return a(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 a(this,void 0,void 0,(function(){return c(this,(function(n){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return a(this,void 0,void 0,(function(){return c(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),Ve=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[E,t,e.substring(0,n)].filter(Boolean).join("_")},Ke=function(){function e(e){this.options=u({},e)}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){var t,n;return c(this,(function(r){switch(r.label){case 0:if(!ve())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 a(this,void 0,void 0,(function(){var n,r;return c(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=ze(n))&&void 0!==t?t:$e(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(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,n;return a(this,void 0,void 0,(function(){var r,i,o;return c(this,(function(u){return r=ve(),i=null!==(n=null===(t=null==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 a(this,void 0,void 0,(function(){var r,i,o,u,s,a,l;return c(this,(function(c){try{r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=void 0,(i=null!==t?r:-1)&&((u=new Date).setTime(u.getTime()+24*i*60*60*1e3),o=u),s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite)),(a=ve())&&(a.document.cookie=s)}catch(t){l=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(l))}return[2]}))}))},e.prototype.remove=function(e){return a(this,void 0,void 0,(function(){return c(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 a(this,void 0,void 0,(function(){return c(this,(function(e){return[2]}))}))},e}(),ze=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},$e=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},Be=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,n,r,i,o,u,s,a,c,l,d,f,p,h,v,g,m,b,w,S,_,E;if("object"!=typeof e)return null;var I=e.code||0,T=this.buildStatus(I);switch(T){case y.Success:return{status:T,statusCode:I,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case y.Invalid:return{status:T,statusCode:I,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(u=e.events_with_invalid_fields)&&void 0!==u?u:{},eventsWithMissingFields:null!==(s=e.events_with_missing_fields)&&void 0!==s?s:{},eventsWithInvalidIdLengths:null!==(a=e.events_with_invalid_id_lengths)&&void 0!==a?a:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case y.PayloadTooLarge:return{status:T,statusCode:I,body:{error:null!==(v=e.error)&&void 0!==v?v:""}};case y.RateLimit:return{status:T,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(b=e.throttled_devices)&&void 0!==b?b:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(E=e.throttled_events)&&void 0!==E?E:[]}};case y.Timeout:default:return{status:T,statusCode:I}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?y.Success:429===e?y.RateLimit:413===e?y.PayloadTooLarge:408===e?y.Timeout:e>=400&&e<500?y.Invalid:e>=500?y.Failed:y.Unknown},e}(),We=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i;return c(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"},[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(e){return[2,this.buildResponse({code:r.status})]}return[2]}}))}))},t}(Be),Je=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){var t,n,r;return c(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 a(this,void 0,void 0,(function(){var t;return c(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]}}))}))},e.prototype.getRaw=function(e){var t;return a(this,void 0,void 0,(function(){return c(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 a(this,void 0,void 0,(function(){return c(this,(function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return a(this,void 0,void 0,(function(){return c(this,(function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return a(this,void 0,void 0,(function(){return c(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),Qe=1e3,He=function(e){function t(t){var n,r=this;return(r=e.call(this,null===(n=ve())||void 0===n?void 0:n.localStorage)||this).loggerProvider=null==t?void 0:t.loggerProvider,r}return o(t,e),t.prototype.set=function(t,n){var r;return a(this,void 0,void 0,(function(){var i;return c(this,(function(o){switch(o.label){case 0:return Array.isArray(n)&&n.length>Qe?(i=n.length-Qe,[4,e.prototype.set.call(this,t,n.slice(0,Qe))]):[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(Qe,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t}(Je),Ye=function(e){function t(){var t;return e.call(this,null===(t=ve())||void 0===t?void 0:t.sessionStorage)||this}return o(t,e),t}(Je),Ze=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return o(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var n=this;return c(this,(function(r){return[2,new Promise((function(r,i){"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done){var e=o.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}(Be),Ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var n=this;return c(this,(function(r){return[2,new Promise((function(r,i){var o=ve();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var u=JSON.stringify(t);return r(o.navigator.sendBeacon(e,JSON.stringify(t))?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:u.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(Be),Xe=function(e,t,n){return void 0===n&&(n=!0),a(void 0,void 0,void 0,(function(){var r,i,o,u,s,a,l,f,p;return c(this,(function(c){switch(c.label){case 0:return r=function(e){return"".concat(E.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(r)];case 1:return(i=c.sent())?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:c.sent(),c.label=3;case 3:return o=d(i.split("."),6),u=o[0],s=o[1],a=o[2],l=o[3],f=o[4],p=o[5],[2,{deviceId:u,userId:tt(s),sessionId:et(l),lastEventId:et(p),lastEventTime:et(f),optOut:Boolean(a)}]}}))}))},et=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},tt=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},nt="[Amplitude]",rt=("".concat(nt," Page Viewed"),"".concat(nt," Form Started")),it="".concat(nt," Form Submitted"),ot="".concat(nt," File Downloaded"),ut="session_start",st="session_end",at="".concat(nt," File Extension"),ct="".concat(nt," File Name"),lt="".concat(nt," Link ID"),dt="".concat(nt," Link Text"),ft="".concat(nt," Link URL"),pt="".concat(nt," Form ID"),ht="".concat(nt," Form Name"),vt="".concat(nt," Form Destination"),gt="cookie",yt=function(e){function t(t,n,r,i,o,u,s,a,c,l,d,f,p,h,v,y,m,b,w,S,_,E,I,T,k,P,x,A,C,R,N,L,U,D){void 0===r&&(r=new Fe),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===a&&(a=1e3),void 0===c&&(c=5),void 0===l&&(l=30),void 0===d&&(d=gt),void 0===y&&(y=new O),void 0===m&&(m=g.Warn),void 0===w&&(w=!1),void 0===S&&(S=!1),void 0===I&&(I=""),void 0===T&&(T="US"),void 0===P&&(P=18e5),void 0===x&&(x=new He({loggerProvider:y})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===C&&(C="fetch"),void 0===R&&(R=!1),void 0===N&&(N=!1);var q=e.call(this,{apiKey:t,storageProvider:x,transportProvider:wt(C)})||this;return q.apiKey=t,q.appVersion=n,q.cookieOptions=i,q.defaultTracking=o,q.autocapture=u,q.flushIntervalMillis=a,q.flushMaxRetries=c,q.flushQueueSize=l,q.identityStorage=d,q.ingestionMetadata=f,q.instanceName=p,q.loggerProvider=y,q.logLevel=m,q.minIdLength=b,q.offline=w,q.partnerId=_,q.plan=E,q.serverUrl=I,q.serverZone=T,q.sessionTimeout=P,q.storageProvider=x,q.trackingOptions=A,q.transport=C,q.useBatch=R,q.fetchRemoteConfig=N,q._optOut=!1,q._cookieStorage=r,q.deviceId=s,q.lastEventId=h,q.lastEventTime=v,q.optOut=S,q.sessionId=k,q.pageCounter=U,q.userId=L,q.debugLogsEnabled=D,q.loggerProvider.enable(D?g.Debug:q.logLevel),q}return o(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,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(Ve(this.apiKey),e)},t}(A),mt=function(e,t,n){return void 0===t&&(t={}),a(void 0,void 0,void 0,(function(){var r,i,o,s,a,l,d,f,p,h,v,g,y,m,b,w,S,_,E,I,T,k,P,O,x,A,C,R,N,U,D,q,j,M,F,V,K,z,$,B,W,J,Q;return c(this,(function(c){switch(c.label){case 0:return r=t.identityStorage||gt,E={},r===gt?[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,St()];case 3:s=c.sent(),c.label=4;case 4:o=s,c.label=5;case 5:return i=u.apply(void 0,[(E.domain=o,E.expiration=365,E.sameSite="Lax",E.secure=!1,E.upgrade=!0,E),t.cookieOptions]),a=bt(t.identityStorage,i),[4,Xe(e,a,null===(P=null===(k=t.cookieOptions)||void 0===k?void 0:k.upgrade)||void 0===P||P)];case 6:return l=c.sent(),[4,a.get(Ve(e))];case 7:return d=c.sent(),f=ge(),p=null!==(R=null!==(C=null!==(A=null!==(x=null!==(O=t.deviceId)&&void 0!==O?O:f.ampDeviceId)&&void 0!==x?x:f.deviceId)&&void 0!==A?A:null==d?void 0:d.deviceId)&&void 0!==C?C:l.deviceId)&&void 0!==R?R:L(),h=null!==(N=null==d?void 0:d.lastEventId)&&void 0!==N?N:l.lastEventId,v=null!==(U=null==d?void 0:d.lastEventTime)&&void 0!==U?U:l.lastEventTime,g=null!==(q=null!==(D=t.optOut)&&void 0!==D?D:null==d?void 0:d.optOut)&&void 0!==q?q:l.optOut,y=null!==(j=null==d?void 0:d.sessionId)&&void 0!==j?j:l.sessionId,m=null!==(F=null!==(M=t.userId)&&void 0!==M?M:null==d?void 0:d.userId)&&void 0!==F?F:l.userId,n.previousSessionDeviceId=null!==(V=null==d?void 0:d.deviceId)&&void 0!==V?V:l.deviceId,n.previousSessionUserId=null!==(K=null==d?void 0:d.userId)&&void 0!==K?K:l.userId,b={ipAddress:null===($=null===(z=t.trackingOptions)||void 0===z?void 0:z.ipAddress)||void 0===$||$,language:null===(W=null===(B=t.trackingOptions)||void 0===B?void 0:B.language)||void 0===W||W,platform:null===(Q=null===(J=t.trackingOptions)||void 0===J?void 0:J.platform)||void 0===Q||Q},w=null==d?void 0:d.pageCounter,S=null==d?void 0:d.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(_=new yt(e,t.appVersion,a,i,t.defaultTracking,t.autocapture,p,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,r,t.ingestionMetadata,t.instanceName,h,v,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,g,t.partnerId,t.plan,t.serverUrl,t.serverZone,y,t.sessionTimeout,t.storageProvider,b,t.transport,t.useBatch,t.fetchRemoteConfig,m,w,S)).storageProvider.isEnabled()];case 8:return c.sent()||(_.loggerProvider.warn("Storage provider ".concat(_.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),_.storageProvider=new Fe),[2,_]}}))}))},bt=function(e,t){switch(void 0===e&&(e=gt),void 0===t&&(t={}),e){case"localStorage":return new He;case"sessionStorage":return new Ye;case"none":return new Fe;default:return new Ke(u(u({},t),{expirationDays:t.expiration}))}},wt=function(e){return"xhr"===e?new Ze:"beacon"===e?new Ge:new We},St=function(e){return a(void 0,void 0,void 0,(function(){var t,n,r,i,o,u,s;return c(this,(function(a){switch(a.label){case 0:return[4,(new Ke).isEnabled()];case 1:if(!a.sent()||!e&&("undefined"==typeof location||!location.hostname))return[2,""];for(t=null!=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,a.label=2;case 2:return o<r.length?(u=r[o],[4,(s=new Ke({domain:"."+u})).set(i,1)]):[3,7];case 3:return a.sent(),[4,s.get(i)];case 4:return a.sent()?[4,s.remove(i)]:[3,6];case 5:return a.sent(),[2,"."+u];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},_t=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},Et=function(e){var t;void 0===e&&(e={});var n,r,i=ve(),o=void 0,s=e.trackOn,l=e.trackHistoryChanges,f=e.eventType,p=void 0===f?"[Amplitude] Page Viewed":f,h=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==o||o.error("Malformed URI sequence: ",e)}return t},v=function(){return a(void 0,void 0,void 0,(function(){var e,t,n;return c(this,(function(r){switch(r.label){case 0:return e=h("undefined"!=typeof location&&location.href||""),n={event_type:p},t=[{}],[4,It()];case 1:return[2,(n.event_properties=u.apply(void 0,[u.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&&h(location.pathname)||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":e.split("?")[0]}]),n)]}}))}))},g=function(){return void 0===s||"function"==typeof s&&s()},y="undefined"!=typeof location?location.href:null,m=function(){return a(void 0,void 0,void 0,(function(){var e,n,r,i;return c(this,(function(u){switch(u.label){case 0:return e=location.href,n=kt(l,e,y||"")&&g(),y=e,n?(null==o||o.log("Tracking page view event"),null!=t?[3,1]:(void 0,[3,3])):[3,4];case 1:return i=(r=t).track,[4,v()];case 2:i.apply(r,[u.sent()]),u.label=3;case 3:u.label=4;case 4:return[2]}}))}))},b=function(){m()},w={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,u){return a(void 0,void 0,void 0,(function(){var s,a;return c(this,(function(c){switch(c.label){case 0:return t=u,r=e,(o=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),i&&(i.addEventListener("popstate",b),n=i.history.pushState,i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,n){var r=d(n,3),i=r[0],o=r[1],u=r[2];e.apply(t,[i,o,u]),m()}})),g()?(o.log("Tracking page view event"),a=(s=t).track,[4,v()]):[3,2];case 1:a.apply(s,[c.sent()]),c.label=2;case 2:return[2]}}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){var t;return c(this,(function(n){switch(n.label){case 0:return"attribution"===s&&Tt(e)?(null==o||o.log("Enriching campaign event to page view event with campaign parameters"),[4,v()]):[3,2];case 1:t=n.sent(),e.event_type=t.event_type,e.event_properties=u(u({},e.event_properties),t.event_properties),n.label=2;case 2:return r&&e.event_type===p&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=u(u({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return c(this,(function(e){return i&&(i.removeEventListener("popstate",b),n&&(i.history.pushState=n)),[2]}))}))}};return w},It=function(){return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:return e=_t,[4,(new me).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},Tt=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[D.SET]||{},r=t[D.UNSET]||{},i=f(f([],d(Object.keys(n)),!1),d(Object.keys(r)),!1);return Object.keys(de).every((function(e){return i.includes(e)}))}return!1},kt=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},Pt=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 a(void 0,void 0,void 0,(function(){var i;return c(this,(function(o){return null===(i=ve())||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(rt,((n={})[pt]=Ot(e.id),n[ht]=Ot(e.name),n[vt]=e.action,n)),t=!0})),n(e,"submit",(function(){var n,i;t||r.track(rt,((n={})[pt]=Ot(e.id),n[ht]=Ot(e.name),n[vt]=e.action,n)),r.track(it,((i={})[pt]=Ot(e.id),i[ht]=Ot(e.name),i[vt]=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 a(void 0,void 0,void 0,(function(){return c(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return c(this,(function(n){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},Ot=function(e){if("string"==typeof e)return e},xt=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(n,r){return a(void 0,void 0,void 0,(function(){var i;return c(this,(function(o){return null===(i=ve())||void 0===i||i.addEventListener("load",(function(){if(r){if("undefined"!=typeof document){var i=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(e){return}var i=o.exec(n.href),u=null==i?void 0:i[1];u&&function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})}(e,"click",(function(){var t;u&&r.track(ot,((t={})[at]=u,t[ct]=n.pathname,t[lt]=e.id,t[dt]=e.text,t[ft]=e.href,t))}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}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 a(void 0,void 0,void 0,(function(){return c(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return c(this,(function(n){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},At=!1,Ct=function(){var e=ve(),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 a(void 0,void 0,void 0,(function(){return c(this,(function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,n("online",(function(){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 a(void 0,void 0,void 0,(function(){return c(this,(function(n){return t.forEach((function(t){var n=t.type,r=t.handler;e&&e.removeEventListener(n,r)})),t=[],[2]}))}))}}};!function(e){e.US="US",e.EU="EU"}(Oe||(Oe={}));var Rt="Remote config fetch rejected due to timeout after 5 seconds",Nt="Unexpected error occurred",Lt=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 a(r,void 0,void 0,(function(){var r,i,o;return c(this,(function(u){switch(u.label){case 0:return r=Date.now(),[4,this.fetchWithTimeout(n)];case 1:return(i=u.sent())&&(o=i.configs&&i.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-r,[2,o[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-r,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return a(r,void 0,void 0,(function(){var t,n,r;return c(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 a(r,void 0,void 0,(function(){var n,r,i,o,s,a,d,f,p,h,v,g;return c(this,(function(c){switch(c.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:Rt})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),c.label=1;case 1:c.trys.push([1,3,,4]),n=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(r=l(this.configKeys),i=r.next();!i.done;i=r.next())o=i.value,n.append("config_keys",o)}catch(e){h={error:e}}finally{try{i&&!i.done&&(v=r.return)&&v.call(r)}finally{if(h)throw h.error}}return t&&n.set("session_id",String(t)),s={headers:{Accept:"*/*"},method:"GET"},a="".concat(this.getServerUrl(),"?").concat(n.toString()),this.attempts+=1,[4,fetch(a,u(u({},s),{signal:e}))];case 2:if(null===(d=c.sent()))return[2,this.completeRequest({err:Nt})];switch((new Be).buildStatus(d.status)){case y.Success:return this.attempts=0,[2,this.parseAndStoreConfig(d)];case y.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 f=c.sent(),p=f,e.aborted?[2,this.completeRequest({err:Rt})]:[2,this.completeRequest({err:null!==(g=p.message)&&void 0!==g?g:Nt})];case 4:return[2]}}))}))},this.retryFetch=function(e,t){return a(r,void 0,void 0,(function(){var n=this;return c(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){return a(r,void 0,void 0,(function(){var t;return c(this,(function(n){switch(n.label){case 0:return[4,e.json()];case 1:return t=n.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}}))}))},this.localConfig=t,this.configKeys=n}return e.prototype.getServerUrl=function(){return this.localConfig.serverZone===Oe.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===Oe.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}(),Ut=function(e){var t=e.localConfig,n=e.configKeys;return a(void 0,void 0,void 0,(function(){return c(this,(function(e){return[2,new Lt({localConfig:t,configKeys:n})]}))}))},Dt=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 a(this,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:return e=this,[4,Ut({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return e.remoteConfigFetch=t.sent(),[2]}}))}))},e.prototype.generateJoinedConfig=function(){var e,t,n,r;return a(this,void 0,void 0,(function(){var i,o,s;return c(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(o=this.remoteConfigFetch)?[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)]:[3,2];case 1:o=a.sent(),a.label=2;case 2:return i=o,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(i,null,2)),i&&"autocapture"in i&&("boolean"==typeof i.autocapture&&(this.config.autocapture=i.autocapture),"object"==typeof i.autocapture&&(void 0===this.config.autocapture&&(this.config.autocapture=i.autocapture),"boolean"==typeof this.config.autocapture&&(this.config.autocapture=u({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},i.autocapture)),"object"==typeof this.config.autocapture&&(this.config.autocapture=u(u({},this.config.autocapture),i.autocapture))),this.config.defaultTracking=this.config.autocapture),this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),null!==(e=(r=this.config).requestMetadata)&&void 0!==e||(r.requestMetadata=new N),(null===(t=this.remoteConfigFetch)||void 0===t?void 0:t.metrics.fetchTimeAPISuccess)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),(null===(n=this.remoteConfigFetch)||void 0===n?void 0:n.metrics.fetchTimeAPIFail)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return s=a.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",s),[3,4];case 4:return[2,this.config]}}))}))},e}(),qt=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],jt="data-amp-track-",Mt=["div","span","h1","h2","h3","h4","h5","h6"],Ft="[Amplitude] Element Clicked",Vt="[Amplitude] Element Tag",Kt="[Amplitude] Element Text",zt="[Amplitude] Element Selector",$t="[Amplitude] Page URL",Bt="https://app.amplitude.com",Wt={US:Bt,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},Jt="amp-visual-tagging-selector-highlight",Qt=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Ht(e){return"function"==typeof e}function Yt(e){return Ht(null==e?void 0:e.then)}function Zt(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Gt=Zt((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Xt(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var en=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=l(o),s=u.next();!s.done;s=u.next()){s.value.remove(this)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else o.remove(this);var a=this.initialTeardown;if(Ht(a))try{a()}catch(e){i=e instanceof Gt?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var p=l(c),h=p.next();!h.done;h=p.next()){var v=h.value;try{nn(v)}catch(e){i=null!=i?i:[],e instanceof Gt?i=f(f([],d(i)),d(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}if(i)throw new Gt(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)nn(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Xt(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Xt(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();en.EMPTY;function tn(e){return e instanceof en||e&&"closed"in e&&Ht(e.remove)&&Ht(e.add)&&Ht(e.unsubscribe)}function nn(e){Ht(e)?e():e.unsubscribe()}var rn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},on={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=on.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,f([e,t],d(n))):setTimeout.apply(void 0,f([e,t],d(n)))},clearTimeout:function(e){var t=on.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function un(e){on.setTimeout((function(){var t=rn.onUnhandledError;if(!t)throw e;t(e)}))}function sn(){}var an=cn("C",void 0,void 0);function cn(e,t,n){return{kind:e,value:t,error:n}}var ln=null;var dn=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,tn(t)&&t.add(n)):n.destination=mn,n}return o(t,e),t.create=function(e,t,n){return new vn(e,t,n)},t.prototype.next=function(e){this.isStopped?yn(function(e){return cn("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?yn(cn("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?yn(an,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(en),fn=Function.prototype.bind;function pn(e,t){return fn.call(e,t)}var hn=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){gn(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){gn(e)}else gn(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){gn(e)}},e}(),vn=function(e){function t(t,n,r){var i,o,u=e.call(this)||this;Ht(t)||!t?i={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&rn.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},i={next:t.next&&pn(t.next,o),error:t.error&&pn(t.error,o),complete:t.complete&&pn(t.complete,o)}):i=t;return u.destination=new hn(i),u}return o(t,e),t}(dn);function gn(e){var t;rn.useDeprecatedSynchronousErrorHandling?(t=e,rn.useDeprecatedSynchronousErrorHandling&&ln&&(ln.errorThrown=!0,ln.error=t)):un(e)}function yn(e,t){var n=rn.onStoppedNotification;n&&on.setTimeout((function(){return n(e,t)}))}var mn={closed:!0,next:sn,error:function(e){throw e},complete:sn},bn="function"==typeof Symbol&&Symbol.observable||"@@observable";function wn(e){return e}function Sn(e){return 0===e.length?wn:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var _n=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,i=this,o=(r=e)&&r instanceof dn||function(e){return e&&Ht(e.next)&&Ht(e.error)&&Ht(e.complete)}(r)&&tn(r)?e:new vn(e,t,n);return function(e){if(rn.useDeprecatedSynchronousErrorHandling){var t=!ln;if(t&&(ln={errorThrown:!1,error:null}),e(),t){var n=ln,r=n.errorThrown,i=n.error;if(ln=null,r)throw i}}else e()}((function(){var e=i,t=e.operator,n=e.source;o.add(t?t.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=En(t))((function(t,r){var i=new vn({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[bn]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Sn(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=En(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function En(e){var t;return null!==(t=null!=e?e:rn.Promise)&&void 0!==t?t:Promise}function In(e){return Ht(e[bn])}function Tn(e){return Symbol.asyncIterator&&Ht(null==e?void 0:e[Symbol.asyncIterator])}function kn(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Pn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function On(e){return Ht(null==e?void 0:e[Pn])}function xn(e){return h(this,arguments,(function(){var t,n,r;return c(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,p(t.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,p(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,p(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function An(e){return Ht(null==e?void 0:e.getReader)}function Cn(e){if(e instanceof _n)return e;if(null!=e){if(In(e))return i=e,new _n((function(e){var t=i[bn]();if(Ht(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Qt(e))return r=e,new _n((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Yt(e))return n=e,new _n((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,un)}));if(Tn(e))return Rn(e);if(On(e))return t=e,new _n((function(e){var n,r;try{for(var i=l(t),o=i.next();!o.done;o=i.next()){var u=o.value;if(e.next(u),e.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()}));if(An(e))return Rn(xn(e))}var t,n,r,i;throw kn(e)}function Rn(e){return new _n((function(t){(function(e,t){var n,r,i,o;return a(this,void 0,void 0,(function(){var u,s;return c(this,(function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),n=v(e),a.label=1;case 1:return[4,n.next()];case 2:if((r=a.sent()).done)return[3,4];if(u=r.value,t.next(u),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=a.sent(),i={error:s},[3,11];case 6:return a.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function Nn(e){return function(t){if(function(e){return Ht(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Ln(e,t,n,r,i){return new Un(e,t,n,r,i)}var Un=function(e){function t(t,n,r,i,o,u){var s=e.call(this,t)||this;return s.onFinalize=o,s.shouldUnsubscribe=u,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return o(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(dn);function Dn(e,t){return Nn((function(n,r){var i=0;n.subscribe(Ln(r,(function(n){r.next(e.call(t,n,i++))})))}))}function qn(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(o),!i)return o}function jn(e,t,n){return void 0===n&&(n=1/0),Ht(t)?jn((function(n,r){return Dn((function(e,i){return t(n,e,r,i)}))(Cn(e(n,r)))}),n):("number"==typeof t&&(n=t),Nn((function(t,r){return function(e,t,n,r,i,o,u,s){var a=[],c=0,l=0,d=!1,f=function(){!d||a.length||c||t.complete()},p=function(e){return c<r?h(e):a.push(e)},h=function(e){o&&t.next(e),c++;var s=!1;Cn(n(e,l++)).subscribe(Ln(t,(function(e){null==i||i(e),o?p(e):t.next(e)}),(function(){s=!0}),void 0,(function(){if(s)try{c--;for(var e=function(){var e=a.shift();u?qn(t,u,(function(){return h(e)})):h(e)};a.length&&c<r;)e();f()}catch(e){t.error(e)}})))};return e.subscribe(Ln(t,p,(function(){d=!0,f()}))),function(){null==s||s()}}(t,r,e,n)})))}var Mn=Array.isArray;function Fn(e){return Dn((function(t){return function(e,t){return Mn(t)?e.apply(void 0,f([],d(t))):e(t)}(e,t)}))}var Vn,Kn,zn=["addListener","removeListener"],$n=["addEventListener","removeEventListener"],Bn=["on","off"];function Wn(e,t,n,r){if(Ht(n)&&(r=n,n=void 0),r)return Wn(e,t,n).pipe(Fn(r));var i=d(function(e){return Ht(e.addEventListener)&&Ht(e.removeEventListener)}(e)?$n.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return Ht(e.addListener)&&Ht(e.removeListener)}(e)?zn.map(Jn(e,t)):function(e){return Ht(e.on)&&Ht(e.off)}(e)?Bn.map(Jn(e,t)):[],2),o=i[0],u=i[1];if(!o&&Qt(e))return jn((function(e){return Wn(e,t,n)}))(Cn(e));if(!o)throw new TypeError("Invalid event target");return new _n((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return o(t),function(){return u(t)}}))}function Jn(e,t){return function(n){return function(r){return e[n](t,r)}}}function Qn(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};Vn=u(u({},n),t),Kn=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Vn.root,n);var r=Hn(e,"all",(function(){return Hn(e,"two",(function(){return Hn(e,"one",(function(){return Hn(e,"none")}))}))}));if(r){var i=or(ur(r,e));return i.length>0&&(r=i[0]),Zn(r)}throw new Error("Selector was not found.")}function Hn(e,t,n){for(var r=null,i=[],o=e,u=0,s=function(){var e,s,a=nr(function(e){var t=e.getAttribute("id");if(t&&Vn.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||nr.apply(void 0,f([],d(function(e){var t=Array.from(e.attributes).filter((function(e){return Vn.attr(e.name,e.value)}));return t.map((function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}}))}(o)),!1))||nr.apply(void 0,f([],d(function(e){var t=Array.from(e.classList).filter(Vn.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(o)),!1))||nr(function(e){var t=e.tagName.toLowerCase();if(Vn.tagName(t))return{name:t,penalty:2};return null}(o))||[{name:"*",penalty:3}],c=function(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;var r=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}(o);if("all"==t)c&&(a=a.concat(a.filter(tr).map((function(e){return er(e,c)}))));else if("two"==t)a=a.slice(0,1),c&&(a=a.concat(a.filter(tr).map((function(e){return er(e,c)}))));else if("one"==t){var p=d(a=a.slice(0,1),1)[0];c&&tr(p)&&(a=[er(p,c)])}else"none"==t&&(a=[{name:"*",penalty:3}],c&&(a=[er(a[0],c)]));try{for(var h=(e=void 0,l(a)),v=h.next();!v.done;v=h.next()){(p=v.value).level=u}}catch(t){e={error:t}}finally{try{v&&!v.done&&(s=h.return)&&s.call(h)}finally{if(e)throw e.error}}if(i.push(a),i.length>=Vn.seedMinLength&&(r=Yn(i,n)))return"break";o=o.parentElement,u++};o;){if("break"===s())break}return r||(r=Yn(i,n)),!r&&n?n():r}function Yn(e,t){var n,r;if(e.reduce((function(e,t){return e*t.length}),1)>Vn.threshold)return t?t():null;var i=or(ir(e));try{for(var o=l(i),u=o.next();!u.done;u=o.next()){var s=u.value;if(Xn(s))return s}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function Zn(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var i=e[r].level||0;n=t.level===i-1?"".concat(e[r].name," > ").concat(n):"".concat(e[r].name," ").concat(n),t=e[r]}return n}function Gn(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function Xn(e){var t=Zn(e);switch(Kn.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function er(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function tr(e){return"html"!==e.name&&!e.name.startsWith("#")}function nr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(rr);return n.length>0?n:null}function rr(e){return null!=e}function ir(e,t){var n,r,i,o,u,s;return void 0===t&&(t=[]),c(this,(function(a){switch(a.label){case 0:if(!(e.length>0))return[3,9];a.label=1;case 1:a.trys.push([1,6,7,8]),n=l(e[0]),r=n.next(),a.label=2;case 2:return r.done?[3,5]:(i=r.value,[5,l(ir(e.slice(1,e.length),t.concat(i)))]);case 3:a.sent(),a.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return o=a.sent(),u={error:o},[3,8];case 7:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(u)throw u.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:a.sent(),a.label=11;case 11:return[2]}}))}function or(e){return f([],d(e),!1).sort((function(e,t){return Gn(e)-Gn(t)}))}function ur(e,t,n){var r,i,o;return void 0===n&&(n={counter:0,visited:new Map}),c(this,(function(u){switch(u.label){case 0:if(!(e.length>2&&e.length>Vn.optimizedMinLength))return[3,5];r=1,u.label=1;case 1:return r<e.length-1?n.counter>Vn.maxNumberOfTries?[2]:(n.counter+=1,(i=f([],d(e),!1)).splice(r,1),o=Zn(i),n.visited.has(o)?[2]:Xn(i)&&function(e,t){return Kn.querySelector(Zn(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return u.sent(),n.visited.set(o,!0),[5,l(ur(i,t,n))];case 3:u.sent(),u.label=4;case 4:return r++,[3,1];case 5:return[2]}}))}var sr=["input","select","textarea"],ar=function(e,t){return function(n,r){var i,o,u,s=e.pageUrlAllowlist,a=e.shouldTrackEventResolver,c=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!c)return!1;if(a)return a(n,r);if(!pr(window.location.href,s))return!1;var l=String(null==r?void 0:r.getAttribute("type"))||"";if("string"==typeof l)switch(l.toLowerCase()){case"hidden":case"password":return!1}if(t){var d=t.some((function(e){var t;return!!(null===(t=null==r?void 0:r.matches)||void 0===t?void 0:t.call(r,e))}));if(!d)return!1}switch(c){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:var f=null===(u=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===u?void 0:u.call(window,r);return!(!f||"pointer"!==f.getPropertyValue("cursor")||"click"!==n)||"click"===n}}},cr=function(e){if(null==e)return!1;if("string"==typeof e){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0},lr=function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!sr.includes(i)&&!o},dr=function(e){var t="";return lr(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach((function(e){var n,r="";(n=e)&&3===n.nodeType?e.textContent&&(r=e.textContent):r=dr(e),t+=r.split(/(\s+)/).filter(cr).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),t},fr=function(e,t){var n,r,i="";try{return i=Qn(e,{className:function(e){return e!==Jt},maxNumberOfTries:1e3})}catch(e){if(t){var o=e;t.warn("Failed to get selector with finder, use fallback strategy instead: ".concat(o.toString()))}}var u=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);u&&(i=u);var s=e.getAttribute("id"),a=e.getAttribute("class");if(s)i="#".concat(s);else if(a){var c=a.split(" ").filter((function(e){return e!==Jt})).join(".");c&&(i="".concat(i,".").concat(c))}return i},pr=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},hr=function(e){return Object.keys(e).reduce((function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t}),{})},vr=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}if(t){var r=t.textContent||"";return cr(r)?r:""}return vr(n)},gr=function(e,t){return e?t.some((function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)}))?e:gr(null==e?void 0:e.parentElement,t):null},yr=function(e,t){var n,r,i;if(!e)return{};var o=null===(i=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u=fr(e,t),s=((n={})[Vt]=o,n[Kt]=dr(e),n[zt]=u,n[$t]=window.location.href.split("?")[0],n);return hr(s)};var mr=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)},br=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?Bt:t,r=this;this.endpoint=Bt,this.requestCallbacks={},this.onSelect=function(e){r.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?r.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&r.notify({action:"track-selector-moved",data:t})},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,u){r.requestCallbacks[i]={resolve:t,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(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.setup=function(e){var t=this,n=void 0===e?{}:e,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,s=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===Bt&&(this.endpoint=i);var a=null;window.addEventListener("message",(function(e){var n,r,i,c,l;if(null===(r=null===(n=t.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var d,f=null==e?void 0:e.data,p=null==f?void 0:f.action;if(p)if("id"in f)null===(c=null===(i=t.logger)||void 0===i?void 0:i.debug)||void 0===c||c.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(f);else if("ping"===p)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var h=null==f?void 0:f.data;(d="/scripts/lib/visual-tagging-selector-1.0.0-alpha.js",new Promise((function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=d,r.addEventListener("load",(function(){e({status:!0})}),{once:!0}),r.addEventListener("error",(function(){t({status:!1,message:"Failed to load the script ".concat(d)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(e){t(e)}}))).then((function(){var e;a=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:yr,isElementSelectable:function(e){return!o||o((null==h?void 0:h.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:Jt,messenger:t,cssSelectorAllowlist:u,actionClickAllowlist:s}),t.notify({action:"selector-loaded"})})).catch((function(){var e;null===(e=t.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===p&&(null===(l=null==a?void 0:a.close)||void 0===l||l.call(a))}})),this.notify({action:"page-loaded"})},e}(),wr=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],Sr=["type"],_r=["svg","path","g"],Er=["password","hidden"];var Ir=function(e){var t;return e?(t=function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(null===i)n+=4;else{var o=Tr(i);n+=o?Array.from(o).length:4}if(n>t)return e.slice(0,r)}return e}(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).map((function(e){return function(e){var t,n,r,i,o,u;if(null===e)return null;var s=String(e.tagName).toLowerCase(),a={tag:s},c=Array.from(null!==(i=null===(r=e.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);c.length&&(a.index=c.indexOf(e),a.indexOfType=c.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var d=null===(u=null===(o=e.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===u?void 0:u.toLowerCase();d&&(a.prevSib=String(d));var f=e.getAttribute("id");f&&(a.id=String(f));var p=Array.from(e.classList);p.length&&(a.classes=p);var h={},v=Array.from(e.attributes).filter((function(e){return!wr.includes(e.name)})),g=!lr(e);if(!Er.includes(String(e.getAttribute("type")))&&!_r.includes(s))try{for(var y=l(v),m=y.next();!m.done;m=y.next()){var b=m.value;g&&!Sr.includes(b.name)||(h[b.name]=String(b.value).substring(0,128))}}catch(e){t={error:e}}finally{try{m&&!m.done&&(n=y.return)&&n.call(y)}finally{if(t)throw t.error}}return Object.keys(h).length&&(a.attrs=h),a}(e)})),1024),t):[]};function Tr(e,t){void 0===t&&(t=!1);try{if(null==e)return t?"None":null;if("string"==typeof e)return t?(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(e,"'"):e.includes("'")?'"'.concat(e.replace(/'/g,"\\'"),'"'):"'".concat(e,"'"):e;if("boolean"==typeof e)return e?"True":"False";if(Array.isArray(e)){var n=e.map((function(e){return Tr(e,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof e){var r=Object.entries(e).filter((function(e){return null!=d(e,1)[0]})).map((function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(String(Tr(n,!0)),": ").concat(String(Tr(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return e.toString()}catch(e){return null}}function kr(e,t){return Nn((function(n,r){var i=0;n.subscribe(Ln(r,(function(n){return e.call(t,n,i++)&&r.next(n)})))}))}var Pr=function(e){function t(t,n){return e.call(this)||this}return o(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(en),Or={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Or.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,f([e,t],d(n))):setInterval.apply(void 0,f([e,t],d(n)))},clearInterval:function(e){var t=Or.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},xr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return o(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),Or.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&Or.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Xt(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Pr),Ar={now:function(){return(Ar.delegate||Date).now()},delegate:void 0},Cr=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Ar.now,e}(),Rr=new(function(e){function t(t,n){void 0===n&&(n=Cr.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return o(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Cr))(xr),Nr=Rr;function Lr(e){return void 0===e&&(e=1/0),jn(wn,e)}var Ur=new _n((function(e){return e.complete()}));function Dr(e){return e&&Ht(e.schedule)}function qr(e){return e[e.length-1]}function jr(e){return Dr(qr(e))?e.pop():void 0}function Mr(e,t){return void 0===t&&(t=0),Nn((function(n,r){n.subscribe(Ln(r,(function(n){return qn(r,e,(function(){return r.next(n)}),t)}),(function(){return qn(r,e,(function(){return r.complete()}),t)}),(function(n){return qn(r,e,(function(){return r.error(n)}),t)})))}))}function Fr(e,t){return void 0===t&&(t=0),Nn((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function Vr(e,t){if(!e)throw new Error("Iterable cannot be null");return new _n((function(n){qn(n,t,(function(){var r=e[Symbol.asyncIterator]();qn(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Kr(e,t){if(null!=e){if(In(e))return function(e,t){return Cn(e).pipe(Fr(t),Mr(t))}(e,t);if(Qt(e))return function(e,t){return new _n((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if(Yt(e))return function(e,t){return Cn(e).pipe(Fr(t),Mr(t))}(e,t);if(Tn(e))return Vr(e,t);if(On(e))return function(e,t){return new _n((function(n){var r;return qn(n,t,(function(){r=e[Pn](),qn(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return Ht(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(An(e))return function(e,t){return Vr(xn(e),t)}(e,t)}throw kn(e)}function zr(e,t){return t?Kr(e,t):Cn(e)}function $r(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=jr(e),r=function(e,t){return"number"==typeof qr(e)?e.pop():t}(e,1/0),i=e;return i.length?1===i.length?Cn(i[0]):Lr(r)(zr(i,n)):Ur}function Br(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Lr(1)(zr(e,jr(e)))}function Wr(e){return e<=0?function(){return Ur}:Nn((function(t,n){var r=0;t.subscribe(Ln(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}function Jr(e,t){return t?function(n){return Br(t.pipe(Wr(1),Nn((function(e,t){e.subscribe(Ln(t,sn))}))),n.pipe(Jr(e)))}:jn((function(t,n){return Cn(e(t,n)).pipe(Wr(1),function(e){return Dn((function(){return e}))}(t))}))}function Qr(e){return e instanceof Date&&!isNaN(e)}function Hr(e,t){void 0===t&&(t=Rr);var n=function(e,t,n){void 0===e&&(e=0),void 0===n&&(n=Nr);var r=-1;return null!=t&&(Dr(t)?n=t:r=t),new _n((function(t){var i=Qr(e)?+e-n.now():e;i<0&&(i=0);var o=0;return n.schedule((function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())}),i)}))}(e,t);return Jr((function(){return n}))}function Yr(e){var t,n,r,i=e.amplitude,o=e.allObservables,u=e.options,s=e.shouldTrackEvent,a=o.clickObservable,c=a.pipe(Nn((function(e,t){var n,r=!1;e.subscribe(Ln(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),kr((function(e){var t=d(e,2),n=t[0],r=t[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),f=$r(c,a.pipe((t=u.debounceTime,void 0===n&&(n=Rr),Nn((function(e,r){var i=null,o=null,u=null,s=function(){if(i){i.unsubscribe(),i=null;var e=o;o=null,r.next(e)}};function a(){var e=u+t,o=n.now();if(o<e)return i=this.schedule(void 0,e-o),void r.add(i);s()}e.subscribe(Ln(r,(function(e){o=e,u=n.now(),i||(i=n.schedule(a,t),r.add(i))}),(function(){s(),r.complete()}),void 0,(function(){o=i=null})))}))),Dn((function(){return"timeout"}))));return a.pipe(Hr(0),kr(mr),kr((function(e){return s("click",e.closestTrackedAncestor)})),(r=f,Nn((function(e,t){var n=[];return e.subscribe(Ln(t,(function(e){return n.push(e)}),(function(){t.next(n),t.complete()}))),Cn(r).subscribe(Ln(t,(function(){var e=n;n=[],t.next(e)}),sn)),function(){n=null}})))).subscribe((function(e){var t,n,r=(e.length,Ft);try{for(var o=l(e),u=o.next();!u.done;u=o.next()){var s=u.value;null==i||i.track(r,s.targetElementProperties,{time:s.timestamp})}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}))}var Zr,Gr=Zt((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Xr(e){throw new Gr(e)}function ei(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,u=e.shouldTrackActionClick,s=n.clickObservable,a=n.mutationObservable,c=n.navigateObservable,l=s.pipe(kr((function(e){return!o("click",e.closestTrackedAncestor)})),Dn((function(e){var t=gr(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})),kr(mr),kr((function(e){return u("click",e.closestTrackedAncestor)}))),p=[a];c&&p.push(c);var h,v,g=$r.apply(void 0,f([],d(p),!1)),y=l.pipe((h=function(e){return g.pipe(Wr(1),function(e,t){var n=Qr(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,o=n.with,u=void 0===o?Xr:o,s=n.scheduler,a=void 0===s?null!=t?t:Rr:s,c=n.meta,l=void 0===c?null:c;if(null==r&&null==i)throw new TypeError("No timeout provided.");return Nn((function(e,t){var n,o,s=null,c=0,d=function(e){o=qn(t,a,(function(){try{n.unsubscribe(),Cn(u({meta:l,lastValue:s,seen:c})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(Ln(t,(function(e){null==o||o.unsubscribe(),c++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),s=null}))),!c&&d(null!=r?"number"==typeof r?r:+r-a.now():i)}))}({first:500,with:function(){return Ur}}),Dn((function(){return e})))},Nn((function(e,t){var n=null,r=0,i=!1,o=function(){return i&&!n&&t.complete()};e.subscribe(Ln(t,(function(e){null==n||n.unsubscribe();var i=0,u=r++;Cn(h(e,u)).subscribe(n=Ln(t,(function(n){return t.next(v?v(e,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return y.subscribe((function(e){null==t||t.track(Ft,i("click",e.closestTrackedAncestor),{time:e.timestamp})}))}!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"}(Zr||(Zr={}));var ti=function(e){var t,n,r;void 0===e&&(e={});var i=e.dataAttributePrefix,o=void 0===i?jt:i,s=e.visualTaggingOptions,p=void 0===s?{enabled:!0,messenger:new br}:s;e.cssSelectorAllowlist=null!==(t=e.cssSelectorAllowlist)&&void 0!==t?t:qt,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:Mt,e.debounceTime=null!==(r=e.debounceTime)&&void 0!==r?r:0;var h="@amplitude/plugin-autocapture-browser",v=[],g=void 0,y=function(e,t){var n,r,i,u=null===(i=null===(r=null==t?void 0:t.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),s="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},a=t.getAttribute("aria-label"),c=function(e,t){return e.getAttributeNames().reduce((function(n,r){if(r.startsWith(t)){var i=r.replace(t,""),o=e.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(t,o),l=vr(t),d=fr(t,g),f=((n={})["[Amplitude] Element ID"]=t.getAttribute("id")||"",n["[Amplitude] Element Class"]=t.getAttribute("class"),n["[Amplitude] Element Hierarchy"]=Ir(t),n[Vt]=u,n[Kt]=dr(t),n["[Amplitude] Element Position Left"]=null==s.left?null:Math.round(s.left),n["[Amplitude] Element Position Top"]=null==s.top?null:Math.round(s.top),n["[Amplitude] Element Aria Label"]=a,n["[Amplitude] Element Attributes"]=c,n[zt]=d,n["[Amplitude] Element Parent Label"]=l,n[$t]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===u&&"click"===e&&t instanceof HTMLAnchorElement&&(f["[Amplitude] Element Href"]=t.href),hr(f)},m=function(t,n){var r={event:t,timestamp:Date.now(),type:n};if(function(e){return"click"===e.type||"change"===e.type}(r)&&null!==r.event.target){var i=gr(r.event.target,e.cssSelectorAllowlist);return i&&(r.closestTrackedAncestor=i,r.targetElementProperties=y(r.type,i)),r}return r};return{name:h,type:"enrichment",setup:function(t,n){return a(void 0,void 0,void 0,(function(){var r,i,o,s,a,l,b,w,S,_;return c(this,(function(c){return g=t.loggerProvider,"undefined"==typeof document||(r=ar(e,e.cssSelectorAllowlist),i=ar(e,e.actionClickAllowlist),o=function(){var e,t,n=Wn(document,"click",{capture:!0}).pipe(Dn((function(e){return m(e,"click")}))),r=Wn(document,"change",{capture:!0}).pipe(Dn((function(e){return m(e,"change")})));window.navigation&&(t=Wn(window.navigation,"navigate").pipe(Dn((function(e){return m(e,"navigate")}))));var i=new _n((function(e){var t=new MutationObserver((function(t){e.next(t)}));return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})).pipe(Dn((function(e){return m(e,"mutation")})));return(e={})[Zr.ClickObservable]=n,e[Zr.ChangeObservable]=r,e[Zr.NavigateObservable]=t,e[Zr.MutationObservable]=i,e}(),s=Yr({allObservables:o,options:e,amplitude:n,shouldTrackEvent:r}),v.push(s),a=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent;return n.changeObservable.pipe(kr(mr),kr((function(e){return i("change",e.closestTrackedAncestor)}))).subscribe((function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))}))}({allObservables:o,getEventProperties:y,amplitude:n,shouldTrackEvent:r}),v.push(a),l=ei({allObservables:o,options:e,getEventProperties:y,amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}),v.push(l),null===(S=null==t?void 0:t.loggerProvider)||void 0===S||S.log("".concat(h," has been successfully added.")),window.opener&&p.enabled&&(b=e.cssSelectorAllowlist,w=e.actionClickAllowlist,null===(_=p.messenger)||void 0===_||_.setup(u(u({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:Wt[t.serverZone]}),{isElementSelectable:ar(e,f(f([],d(b),!1),d(w),!1)),cssSelectorAllowlist:b,actionClickAllowlist:w})))),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return c(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){var e,t,n,r;return c(this,(function(i){try{for(e=l(v),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},ni=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(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.userId,i=t),_(this._init(u(u({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i;return a(this,void 0,void 0,(function(){var o,s,l,d,f,p=this;return c(this,(function(h){switch(h.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,mt(t.apiKey,t,this)]);case 1:return o=h.sent(),t.fetchRemoteConfig?[4,(g=o,a(void 0,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:return[4,(e=new Dt(g)).initialize()];case 1:return t.sent(),[2,e]}}))})))]:[3,4];case 2:return[4,h.sent().generateJoinedConfig()];case 3:o=h.sent(),h.label=4;case 4:return[4,e.prototype._init.call(this,o)];case 5:return h.sent(),this.logBrowserOptions(o),Q(this.config.defaultTracking)?(s=function(e){return Q(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?u({},e.defaultTracking.attribution):{}}(this.config),this.webAttribution=new we(s,this.config),[4,this.webAttribution.init()]):[3,7];case 6:h.sent(),h.label=7;case 7:return l=ge(),d=Number.isNaN(Number(l.ampSessionId))?void 0:Number(l.ampSessionId),this.setSessionId(null!==(i=null!==(r=null!==(n=t.sessionId)&&void 0!==n?n:d)&&void 0!==r?r:this.config.sessionId)&&void 0!==i?i:Date.now()),(f=Re(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===Le?[3,9]:[4,this.add(Ct()).promise];case 8:h.sent(),h.label=9;case 9:return[4,this.add(new M).promise];case 10:return h.sent(),[4,this.add(new Me).promise];case 11:return h.sent(),[4,this.add(new Ne).promise];case 12:return h.sent(),function(e){At||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."),At=!0)}(this.config),v=this.config.defaultTracking,J(v,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(xt()).promise]):[3,14];case 13:h.sent(),h.label=14;case 14:return function(e){return J(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Pt()).promise]):[3,16];case 15:h.sent(),h.label=16;case 16:return H(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Et(X(this.config))).promise]):[3,18];case 17:h.sent(),h.label=18;case 18:return Z(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(ti(G(this.config))).promise]):[3,20];case 19:h.sent(),h.label=20;case 20:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 21:return h.sent(),f.eventBridge.setEventReceiver((function(e){p.track(e.eventType,e.eventProperties)})),[2]}var v,g}))}))},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){Re(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){Re(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName)):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(L()),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)),_(Promise.resolve());if(e===this.config.sessionId)return _(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,Y(this.config.defaultTracking)&&(r&&i&&n.push(this.track(st,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 u=this.trackCampaignEventIfNeeded(++o,n);return Y(this.config.defaultTracking)&&n.push(this.track(ut,void 0,{event_id:u?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,_(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=wt(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(qe(t)){var r=t._q;t._q=[],t=De(new K,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(qe(r)){var o=r._q;r._q=[],r=De(new K,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(qe(t)){var r=t._q;t._q=[],t=De(new z,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 a(this,void 0,void 0,(function(){var n,r,i;return c(this,(function(o){return n=Date.now(),r=be(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===ut||t.event_type===st||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=u(u({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t}(W),ri=function(){var e=new ni;return{init:S(e.init.bind(e),"init",m(e),w(e,["config"])),add:S(e.add.bind(e),"add",m(e),w(e,["config.apiKey","timeline.plugins"])),remove:S(e.remove.bind(e),"remove",m(e),w(e,["config.apiKey","timeline.plugins"])),track:S(e.track.bind(e),"track",m(e),w(e,["config.apiKey","timeline.queue.length"])),logEvent:S(e.logEvent.bind(e),"logEvent",m(e),w(e,["config.apiKey","timeline.queue.length"])),identify:S(e.identify.bind(e),"identify",m(e),w(e,["config.apiKey","timeline.queue.length"])),groupIdentify:S(e.groupIdentify.bind(e),"groupIdentify",m(e),w(e,["config.apiKey","timeline.queue.length"])),setGroup:S(e.setGroup.bind(e),"setGroup",m(e),w(e,["config.apiKey","timeline.queue.length"])),revenue:S(e.revenue.bind(e),"revenue",m(e),w(e,["config.apiKey","timeline.queue.length"])),flush:S(e.flush.bind(e),"flush",m(e),w(e,["config.apiKey","timeline.queue.length"])),getUserId:S(e.getUserId.bind(e),"getUserId",m(e),w(e,["config","config.userId"])),setUserId:S(e.setUserId.bind(e),"setUserId",m(e),w(e,["config","config.userId"])),getDeviceId:S(e.getDeviceId.bind(e),"getDeviceId",m(e),w(e,["config","config.deviceId"])),setDeviceId:S(e.setDeviceId.bind(e),"setDeviceId",m(e),w(e,["config","config.deviceId"])),reset:S(e.reset.bind(e),"reset",m(e),w(e,["config","config.userId","config.deviceId"])),getSessionId:S(e.getSessionId.bind(e),"getSessionId",m(e),w(e,["config"])),setSessionId:S(e.setSessionId.bind(e),"setSessionId",m(e),w(e,["config"])),extendSession:S(e.extendSession.bind(e),"extendSession",m(e),w(e,["config"])),setOptOut:S(e.setOptOut.bind(e),"setOptOut",m(e),w(e,["config"])),setTransport:S(e.setTransport.bind(e),"setTransport",m(e),w(e,["config"]))}},ii=ri(),oi=ii.add,ui=ii.extendSession,si=ii.flush,ai=ii.getDeviceId,ci=ii.getSessionId,li=ii.getUserId,di=ii.groupIdentify,fi=ii.identify,pi=ii.init,hi=ii.logEvent,vi=ii.remove,gi=ii.reset,yi=ii.revenue,mi=ii.setDeviceId,bi=ii.setGroup,wi=ii.setOptOut,Si=ii.setSessionId,_i=ii.setTransport,Ei=ii.setUserId,Ii=ii.track,Ti=r;return t=t.default}()})); |