@amplitude/analytics-browser 1.6.7 → 1.7.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/cjs/config.d.ts +3 -0
- package/lib/cjs/config.d.ts.map +1 -1
- package/lib/cjs/config.js +7 -5
- package/lib/cjs/config.js.map +1 -1
- package/lib/cjs/cookie-migration/index.d.ts.map +1 -1
- package/lib/cjs/cookie-migration/index.js +11 -6
- package/lib/cjs/cookie-migration/index.js.map +1 -1
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.d.ts.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/config.d.ts +3 -0
- package/lib/esm/config.d.ts.map +1 -1
- package/lib/esm/config.js +7 -5
- package/lib/esm/config.js.map +1 -1
- package/lib/esm/cookie-migration/index.d.ts.map +1 -1
- package/lib/esm/cookie-migration/index.js +11 -6
- package/lib/esm/cookie-migration/index.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.d.ts.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/amplitude-min.js +1 -1
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/amplitude-snippet-instructions.html +1 -1
- package/lib/scripts/amplitude-snippet-min.js +1 -1
- package/lib/scripts/config.d.ts +3 -0
- package/lib/scripts/config.d.ts.map +1 -1
- package/lib/scripts/cookie-migration/index.d.ts.map +1 -1
- package/lib/scripts/version.d.ts +1 -1
- package/lib/scripts/version.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};function n(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function r(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function u(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))}function o(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(a){return function(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(i=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(6===u[0]&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e],n=0}finally{i=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function a(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}var c,l,d,p,f,h,v,g,b=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},y=function(){var e,t=b();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 i=t.split("=",2),n=m(i[0]),r=m(i[1]);return r?(e[n]=r,e):e}),{}):{}},m=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},w="dclid",I="fbclid",_="gbraid",S="gclid",E="ko_click_id",k="msclkid",O="ttclid",T="twclid",x="wbraid",P={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,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},R=function(){function e(){}return e.prototype.parse=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,i(i(i(i({},P),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=y();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,i={referrer:void 0,referring_domain:void 0};try{i.referrer=document.referrer||void 0,i.referring_domain=null!==(t=null===(e=i.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return i},e.prototype.getClickIds=function(){var e,t=y();return(e={})[w]=t[w],e[I]=t[I],e[_]=t[_],e[S]=t[S],e[E]=t[E],e[k]=t[k],e[O]=t[O],e[T]=t[T],e[x]=t[x],e},e}();!function(e){e.US="US",e.EU="EU"}(c||(c={})),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"}(l||(l={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(d||(d={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(p||(p={})),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(f||(f={})),function(e){e.BEFORE="before",e.ENRICHMENT="enrichment",e.DESTINATION="destination"}(h||(h={})),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"}(v||(v={})),function(e){e.XHR="xhr",e.SendBeacon="beacon",e.Fetch="fetch"}(g||(g={}));var N,U,q=Object.freeze({__proto__:null,get ServerZone(){return c},get SpecialEventType(){return p},get IdentifyOperation(){return l},get RevenueProperty(){return d},get LogLevel(){return f},get PluginType(){return h},get Status(){return v},get TransportType(){return g}}),D="AMP",C="".concat(D,"_unsent"),A="https://api2.amplitude.com/2/httpapi",j=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!M(t,i))return!1}return!0},M=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var r=!0;try{for(var o=s(t),u=o.next();!u.done;u=o.next()){var a=u.value;if(Array.isArray(a))return!1;if("object"==typeof a)r=r&&j(a);else if(!["number","string"].includes(typeof a))return!1;if(!r)return!1}}catch(e){i={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}}else{if(null==t)return!1;if("object"==typeof t)return j(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},L=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return i({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(l.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(l.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(l.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(l.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(l.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(l.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(l.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(l.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(l.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[l.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,i){if(this._validate(e,t,i)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=i,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,i){return void 0===this._properties[l.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===l.ADD?"number"==typeof i:e===l.UNSET||e===l.REMOVE||M(t,i)))},e}(),V=function(e,t){return i(i({},t),{event_type:p.IDENTIFY,user_properties:e.getUserProperties()})},z=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=v.Unknown),{event:e,code:t,message:i}},B=function(){function e(){this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,e.setup(t)];case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},e.prototype.reset=function(){this.applying=!1,this.plugins=[]},e.prototype.push=function(e){var t=this;return new Promise((function(i){t.queue.push([e,i]),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 r(this,void 0,void 0,(function(){var t,n,r,a,c,l,d,p,f,v,g,b,y,m,w,I,_,S;return o(this,(function(o){switch(o.label){case 0:if(!e)return[2];t=u(e,1),n=t[0],r=u(e,2),a=r[1],c=this.plugins.filter((function(e){return e.type===h.BEFORE})),o.label=1;case 1:o.trys.push([1,6,7,8]),l=s(c),d=l.next(),o.label=2;case 2:return d.done?[3,5]:[4,d.value.execute(i({},n))];case 3:n=o.sent(),o.label=4;case 4:return d=l.next(),[3,2];case 5:return[3,8];case 6:return p=o.sent(),w={error:p},[3,8];case 7:try{d&&!d.done&&(I=l.return)&&I.call(l)}finally{if(w)throw w.error}return[7];case 8:f=this.plugins.filter((function(e){return e.type===h.ENRICHMENT})),o.label=9;case 9:o.trys.push([9,14,15,16]),v=s(f),g=v.next(),o.label=10;case 10:return g.done?[3,13]:[4,g.value.execute(i({},n))];case 11:n=o.sent(),o.label=12;case 12:return g=v.next(),[3,10];case 13:return[3,16];case 14:return b=o.sent(),_={error:b},[3,16];case 15:try{g&&!g.done&&(S=v.return)&&S.call(v)}finally{if(_)throw _.error}return[7];case 16:return y=this.plugins.filter((function(e){return e.type===h.DESTINATION})),m=y.map((function(e){var t=i({},n);return e.execute(t).catch((function(e){return z(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=u(e,1)[0];a(t)})),[2]}}))}))},e.prototype.flush=function(){return r(this,void 0,void 0,(function(){var e,t,i,n=this;return o(this,(function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return r.sent(),t=this.plugins.filter((function(e){return e.type===h.DESTINATION})),i=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(i)];case 2:return r.sent(),[2]}}))}))},e}(),F="Event rejected due to exceeded retry count",Q=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new B,this.name=e}return e.prototype._init=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return r(this,void 0,void 0,(function(){var t,i,n,r,u,a;return o(this,(function(o){switch(o.label){case 0:t=this[e],this[e]=[],o.label=1;case 1:o.trys.push([1,6,7,8]),i=s(t),n=i.next(),o.label=2;case 2:return n.done?[3,5]:[4,(0,n.value)()];case 3:o.sent(),o.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return r=o.sent(),u={error:r},[3,8];case 7:try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(u)throw u.error}return[7];case 8:return[2]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return i(i(i({},"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 i=V(e,t);return this.dispatch(i)},e.prototype.groupIdentify=function(e,t,n,r){var o=function(e,t,n,r){var o;return i(i({},r),{event_type:p.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(o={},o[e]=t,o)})}(e,t,n,r);return this.dispatch(o)},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,o=new L;return o.set(e,t),i(i({},n),{event_type:p.IDENTIFY,user_properties:o.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 i(i({},t),{event_type:p.REVENUE,event_properties:e.getEventProperties()})}(e,t);return this.dispatch(n)},e.prototype.add=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.config?[2,this.timeline.register(e,this.config)]:(this.q.push(this.add.bind(this,e)),[2])}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.config?[2,this.timeline.deregister(e)]:(this.q.push(this.remove.bind(this,e)),[2])}))}))},e.prototype.dispatchWithCallback=function(e,t){if(!this.config)return t(z(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(i){return this.config?[2,this.process(e)]:[2,new Promise((function(i){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,i))}))]}))}))},e.prototype.process=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.config.optOut?[2,z(e,0,"Event skipped due to optOut config")]:[4,this.timeline.push(e)];case 1:return 200===(n=r.sent()).code?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=r.sent(),i=String(t),this.config.loggerProvider.error(i),[2,n=z(e,0,i)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config?this.config.optOut=Boolean(e):this.q.push(this.setOptOut.bind(this,Boolean(e)))},e.prototype.flush=function(){return this.timeline.flush()},e}(),$=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 j(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?i({},this.properties):{};return e[d.REVENUE_PRODUCT_ID]=this.productId,e[d.REVENUE_QUANTITY]=this.quantity,e[d.REVENUE_PRICE]=this.price,e[d.REVENUE_TYPE]=this.revenueType,e[d.REVENUE]=this.revenue,e},e}(),K="Amplitude Logger ",W=function(){function e(){this.logLevel=f.None}return e.prototype.disable=function(){this.logLevel=f.None},e.prototype.enable=function(e){void 0===e&&(e=f.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Verbose||console.log("".concat(K,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Warn||console.warn("".concat(K,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Error||console.error("".concat(K,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Debug||console.log("".concat(K,"[Debug]: ").concat(e.join(" ")))},e}(),Z=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:f.Warn,loggerProvider:new W,optOut:!1,serverUrl:A,serverZone:c.US,useBatch:!1}},G=function(){function e(e){var t,i,n;this._optOut=!1;var r=Z();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis||r.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||r.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||r.flushQueueSize,this.loggerProvider=e.loggerProvider||r.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:r.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:r.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||r.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(n=e.useBatch)&&void 0!==n?n:r.useBatch,this.loggerProvider.enable(this.logLevel);var o=H(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),J=function(e,t){return e===c.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":A},H=function(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=Z().serverZone),void 0===i&&(i=Z().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=[c.US,c.EU].includes(t)?t:Z().serverZone;return{serverZone:n,serverUrl:J(n,i)}},Y=function(){function e(){this.name="amplitude",this.type=h.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return e.prototype.setup=function(e){var t;return r(this,void 0,void 0,(function(){var i,n=this;return o(this,(function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(C,"_").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 i=r.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map((function(e){return n.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n={event:e,attempts:0,callback:function(e){return i(e)},timeout:0};t.addToQueue(n)}))},e.prototype.addToQueue=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.filter((function(t){return t.attempts<e.config.flushMaxRetries?(t.attempts+=1,!0):(e.fulfillRequest([t],500,F),!1)}));n.forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(e.config.flushIntervalMillis)})),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||(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),r(this,void 0,void 0,(function(){var t,i,n,r=this;return o(this,(function(o){switch(o.label){case 0:return t=[],i=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):i.push(e)})),this.queue=i,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),s=t,u=this.config.flushQueueSize,a=Math.max(u,1),n=s.reduce((function(e,t,i){var n=Math.floor(i/a);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(n.map((function(t){return r.send(t,e)})))];case 1:return o.sent(),[2]}var s,u,a}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),r(this,void 0,void 0,(function(){var i,r,s,u,a;return o(this,(function(o){switch(o.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];i={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,n(t,["extra"])})),options:{min_id_length:this.config.minIdLength}},o.label=1;case 1:return o.trys.push([1,3,,4]),r=H(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,i)];case 2:if(null===(s=o.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t){if("body"in s){u="";try{u=JSON.stringify(s.body,null,2)}catch(e){}this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(u))}else this.fulfillRequest(e,s.statusCode,s.status);return[2]}return this.handleReponse(s,e),[3,4];case 3:return a=o.sent(),this.fulfillRequest(e,0,String(a)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case v.Success:this.handleSuccessResponse(e,t);break;case v.Invalid:this.handleInvalidResponse(e,t);break;case v.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case v.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.handleOtherReponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var i=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=a(a(a(a([],u(Object.values(e.body.eventsWithInvalidFields)),!1),u(Object.values(e.body.eventsWithMissingFields)),!1),u(Object.values(e.body.eventsWithInvalidIdLengths)),!1),u(e.body.silencedEvents),!1).flat(),r=new Set(n),o=t.filter((function(t,n){if(!r.has(n))return!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,a([],u(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,a([],u(t),!1))):this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var i=this,n=Object.keys(e.body.exceededDailyQuotaUsers),r=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),c=new Set(r),l=new Set(o),d=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&c.has(t.event.device_id)))return l.has(n)&&(t.timeout=i.throttleTimeout),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,a([],u(d),!1))},e.prototype.handleOtherReponse=function(e){var t=this;this.addToQueue.apply(this,a([],u(e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e}))),!1))},e.prototype.fulfillRequest=function(e,t,i){this.saveEvents(),e.forEach((function(e){return e.callback(z(e.event,t,i))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map((function(e){return e.event})));this.config.storageProvider.set(this.storageKey,e)}},e}(),X=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return{promise:e.apply(void 0,a([],u(t),!1))}}},ee=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},te=function(e){return function(){var t=i({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ie=function(e,t){var i,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var r=s(t.split(".")),o=r.next();!o.done;o=r.next()){var u=o.value;if(!(u in e))return;e=e[u]}}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},ne=function(e,t){return function(){var i,n,r={};try{for(var o=s(t),u=o.next();!u.done;u=o.next()){var a=u.value;r[a]=ie(e,a)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return r}},re=function(e,t,i,n,r){return void 0===r&&(r=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var u=i(),a=u.logger,c=u.logLevel;if(c&&c<f.Debug||!c||!a)return e.apply(r,o);var l={type:"invoke public method",name:t,args:o,stacktrace:ee(1),time:{start:(new Date).toISOString()},states:{}};n&&l.states&&(l.states.before=n());var d=e.apply(r,o);return d&&d.promise?d.promise.then((function(){n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=(new Date).toISOString()),a.debug(JSON.stringify(l,null,2))})):(n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=(new Date).toISOString()),a.debug(JSON.stringify(l,null,2))),d}},oe=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,oe)},se=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return[4,this.get(e)];case 1:return[2,(t=i.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(i){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),ue=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,i,n,r,o,s,u,a,c,l,d,p,f,h,g,b,y,m,w,I,_,S;if("object"!=typeof e)return null;var E=e.code||0,k=this.buildStatus(E);switch(k){case v.Success:return{status:k,statusCode:E,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(i=e.payload_size_bytes)&&void 0!==i?i:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case v.Invalid:return{status:k,statusCode:E,body:{error:null!==(r=e.error)&&void 0!==r?r:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(u=e.events_with_missing_fields)&&void 0!==u?u:{},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!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case v.PayloadTooLarge:return{status:k,statusCode:E,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case v.RateLimit:return{status:k,statusCode:E,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(m=e.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(I=e.exceeded_daily_quota_devices)&&void 0!==I?I:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case v.Timeout:default:return{status:k,statusCode:E}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?v.Success:429===e?v.RateLimit:413===e?v.PayloadTooLarge:408===e?v.Timeout:e>=400&&e<500?v.Invalid:e>=500?v.Failed:v.Unknown},e}(),ae=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=10),[D,t,e.substring(0,i)].filter(Boolean).join("_")},ce=function(){function e(e,t){var i,n;this.storage=t.storage,this.storageKey=ae(e,"MKTG"),this.parser=new R,this.track=t.track,this.onNewCampaign=t.onNewCampaign,this.disabled=Boolean(t.disabled),this.trackNewCampaigns=Boolean(t.trackNewCampaigns),this.trackPageViews=Boolean(t.trackPageViews),this.excludeReferrers=null!==(i=t.excludeReferrers)&&void 0!==i?i:[],"undefined"!=typeof location&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(n=t.initialEmptyValue)&&void 0!==n?n:"EMPTY"}return e.prototype.isNewCampaign=function(e,t,i){void 0===i&&(i=!1),e.referrer;var r=e.referring_domain,o=n(e,["referrer","referring_domain"]),s=t||{};s.referrer;var u=s.referring_domain,a=n(s,["referrer","referring_domain"]);if(e.referring_domain&&this.excludeReferrers.includes(e.referring_domain))return!1;var c=JSON.stringify(o)!==JSON.stringify(a),l=i?le(r||"")!==le(u||""):r!==u;return!t||c||l},e.prototype.saveCampaignToStorage=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.storage.set(this.storageKey,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getCampaignFromStorage=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.createCampaignEvent=function(e){var t=this,n=i(i({},P),e),r=Object.entries(n).reduce((function(e,i){var n=u(i,2),r=n[0],o=n[1];return e.setOnce("initial_".concat(r),o||t.initialEmptyValue),o?e.set(r,o):e.unset(r)}),new L),o={event_type:"Page View",event_properties:{page_title:"undefined"!=typeof document&&document.title||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||""}};return i(i({},V(r)),this.trackPageViews&&o)},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){switch(n.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return t=n.sent(),[4,this.getCampaignFromStorage()];case 2:if(i=n.sent(),!e){if(!this.trackNewCampaigns||!this.isNewCampaign(t,i))return[2];this.onNewCampaign(t)}return[4,this.track(this.createCampaignEvent(t))];case 3:return n.sent(),[4,this.saveCampaignToStorage(t)];case 4:return n.sent(),[2]}}))}))},e}(),le=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},de=function(){function e(e){this.options=i({},e)}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!b())return[2,!1];t=String(Date.now()),i=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=i.sent()))return[2,void 0];try{try{t=decodeURIComponent(atob(t))}catch(e){}return[2,JSON.parse(t)]}catch(e){return[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){return i=b(),n=null!==(t=null==i?void 0:i.document.cookie.split("; "))&&void 0!==t?t:[],(r=n.find((function(t){return 0===t.indexOf(e+"=")})))?[2,r.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){var n,r,s,u,a,c;return o(this,(function(o){try{n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,s=void 0,(r=null!==t?n:-1)&&((u=new Date).setTime(u.getTime()+24*r*60*60*1e3),s=u),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),s&&(a+="; expires=".concat(s.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(c=b())&&(c.document.cookie=a)}catch(e){}return[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(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 r(this,void 0,void 0,(function(){return o(this,(function(e){return[2]}))}))},e}(),pe=function(){function e(e,t){this.storage=e,this.storageKey=ae(t),this.cache={optOut:!1}}return e.prototype.load=function(){var e;return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return t=this,[4,this.storage.get(this.storageKey)];case 1:return t.cache=null!==(e=i.sent())&&void 0!==e?e:{optOut:!1},[2,this]}}))}))},e.prototype.setSession=function(e){this.cache=i(i({},this.cache),e),this.storage.set(this.storageKey,this.cache)},e.prototype.getSessionId=function(){return this.cache.sessionId},e.prototype.setSessionId=function(e){this.setSession({sessionId:e})},e.prototype.getDeviceId=function(){return this.cache.deviceId},e.prototype.setDeviceId=function(e){this.setSession({deviceId:e})},e.prototype.getUserId=function(){return this.cache.userId},e.prototype.setUserId=function(e){this.setSession({userId:e})},e.prototype.getLastEventTime=function(){return this.cache.lastEventTime},e.prototype.setLastEventTime=function(e){this.setSession({lastEventTime:e})},e.prototype.getOptOut=function(){return this.cache.optOut},e.prototype.setOptOut=function(e){this.setSession({optOut:e})},e.prototype.getLastEventId=function(){return this.cache.lastEventId},e.prototype.setLastEventId=function(e){this.setSession({lastEventId:e})},e}(),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){switch(r.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,i)];case 1:return[4,r.sent().json()];case 2:return n=r.sent(),[2,this.buildResponse(n)]}}))}))},i}(ue),he="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ve={exports:{}};N=ve,U=ve.exports,function(e,t){var i="function",n="undefined",r="object",o="string",s="model",u="name",a="type",c="vendor",l="version",d="architecture",p="console",f="mobile",h="tablet",v="smarttv",g="wearable",b="embedded",y="Amazon",m="Apple",w="ASUS",I="BlackBerry",_="Browser",S="Chrome",E="Firefox",k="Google",O="Huawei",T="LG",x="Microsoft",P="Motorola",R="Opera",q="Samsung",D="Sony",C="Xiaomi",A="Zebra",j="Facebook",M=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},L=function(e,t){return typeof e===o&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===o)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===n?e:e.substring(0,275)},B=function(e,n){for(var o,s,u,a,c,l,d=0;d<n.length&&!c;){var p=n[d],f=n[d+1];for(o=s=0;o<p.length&&!c;)if(c=p[o++].exec(e))for(u=0;u<f.length;u++)l=c[++s],typeof(a=f[u])===r&&a.length>0?2===a.length?typeof a[1]==i?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==i||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):t:this[a[0]]=l?a[1].call(this,l,a[2]):t:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):t):this[a]=l||t;d+=2}},F=function(e,i){for(var n in i)if(typeof i[n]===r&&i[n].length>0){for(var o=0;o<i[n].length;o++)if(L(i[n][o],e))return"?"===n?t:n}else if(L(i[n],e))return"?"===n?t:n;return e},Q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,l],[/opios[\/ ]+([\w\.]+)/i],[l,[u,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[l,[u,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,l],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l,[u,"UC"+_]],[/\bqbcore\/([\w\.]+)/i],[l,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[l,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[l,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+_],l],[/\bfocus\/([\w\.]+)/i],[l,[u,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[l,[u,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[l,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[u,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[l,[u,"MIUI "+_]],[/fxios\/([-\w\.]+)/i],[l,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+_]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+_],l],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],l],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,l],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,j],l],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,l],[/\bgsa\/([\w\.]+) .*safari\//i],[l,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[l,[u,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,S+" WebView"],l],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l,[u,"Android "+_]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,l],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[l,[u,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[l,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[l,F,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,l],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],l],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l,[u,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,V]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[s,[c,q],[a,h]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[s,[c,q],[a,f]],[/((ipod|iphone)\d+,\d+)/i],[s,[c,m],[a,f]],[/(ipad\d+,\d+)/i],[s,[c,m],[a,h]],[/\((ip(?:hone|od)[\w ]*);/i],[s,[c,m],[a,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[s,[c,m],[a,h]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[s,[c,O],[a,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[s,[c,O],[a,f]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[s,/_/g," "],[c,C],[a,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[s,/_/g," "],[c,C],[a,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[s,[c,"OPPO"],[a,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[s,[c,"Vivo"],[a,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[s,[c,"Realme"],[a,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[s,[c,P],[a,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[s,[c,P],[a,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[c,T],[a,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[s,[c,T],[a,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[s,[c,"Lenovo"],[a,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[s,/_/g," "],[c,"Nokia"],[a,f]],[/(pixel c)\b/i],[s,[c,k],[a,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[s,[c,k],[a,f]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[s,[c,D],[a,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[s,"Xperia Tablet"],[c,D],[a,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[s,[c,"OnePlus"],[a,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[s,[c,y],[a,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[s,/(.+)/g,"Fire Phone $1"],[c,y],[a,f]],[/(playbook);[-\w\),; ]+(rim)/i],[s,c,[a,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[s,[c,I],[a,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[s,[c,w],[a,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[s,[c,w],[a,f]],[/(nexus 9)/i],[s,[c,"HTC"],[a,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[c,[s,/_/g," "],[a,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[s,[c,"Acer"],[a,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[s,[c,"Meizu"],[a,f]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[s,[c,"Sharp"],[a,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[c,s,[a,f]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[c,s,[a,h]],[/(surface duo)/i],[s,[c,x],[a,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[s,[c,"Fairphone"],[a,f]],[/(u304aa)/i],[s,[c,"AT&T"],[a,f]],[/\bsie-(\w*)/i],[s,[c,"Siemens"],[a,f]],[/\b(rct\w+) b/i],[s,[c,"RCA"],[a,h]],[/\b(venue[\d ]{2,7}) b/i],[s,[c,"Dell"],[a,h]],[/\b(q(?:mv|ta)\w+) b/i],[s,[c,"Verizon"],[a,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[s,[c,"Barnes & Noble"],[a,h]],[/\b(tm\d{3}\w+) b/i],[s,[c,"NuVision"],[a,h]],[/\b(k88) b/i],[s,[c,"ZTE"],[a,h]],[/\b(nx\d{3}j) b/i],[s,[c,"ZTE"],[a,f]],[/\b(gen\d{3}) b.+49h/i],[s,[c,"Swiss"],[a,f]],[/\b(zur\d{3}) b/i],[s,[c,"Swiss"],[a,h]],[/\b((zeki)?tb.*\b) b/i],[s,[c,"Zeki"],[a,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],s,[a,h]],[/\b(ns-?\w{0,9}) b/i],[s,[c,"Insignia"],[a,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[s,[c,"NextBook"],[a,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],s,[a,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],s,[a,f]],[/\b(ph-1) /i],[s,[c,"Essential"],[a,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[s,[c,"Envizen"],[a,h]],[/\b(trio[-\w\. ]+) b/i],[s,[c,"MachSpeed"],[a,h]],[/\btu_(1491) b/i],[s,[c,"Rotor"],[a,h]],[/(shield[\w ]+) b/i],[s,[c,"Nvidia"],[a,h]],[/(sprint) (\w+)/i],[c,s,[a,f]],[/(kin\.[onetw]{3})/i],[[s,/\./g," "],[c,x],[a,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[s,[c,A],[a,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[s,[c,A],[a,f]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,s,[a,p]],[/droid.+; (shield) bui/i],[s,[c,"Nvidia"],[a,p]],[/(playstation [345portablevi]+)/i],[s,[c,D],[a,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[s,[c,x],[a,p]],[/smart-tv.+(samsung)/i],[c,[a,v]],[/hbbtv.+maple;(\d+)/i],[[s,/^/,"SmartTV"],[c,q],[a,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,T],[a,v]],[/(apple) ?tv/i],[c,[s,m+" TV"],[a,v]],[/crkey/i],[[s,S+"cast"],[c,k],[a,v]],[/droid.+aft(\w)( bui|\))/i],[s,[c,y],[a,v]],[/\(dtv[\);].+(aquos)/i],[s,[c,"Sharp"],[a,v]],[/(bravia[\w- ]+) bui/i],[s,[c,D],[a,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[c,z],[s,z],[a,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[a,v]],[/((pebble))app/i],[c,s,[a,g]],[/droid.+; (glass) \d/i],[s,[c,k],[a,g]],[/droid.+; (wt63?0{2,3})\)/i],[s,[c,A],[a,g]],[/(quest( 2)?)/i],[s,[c,j],[a,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[a,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[s,[a,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[s,[a,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[a,h]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[a,f]],[/(android[-\w\. ]{0,9});.+buil/i],[s,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,l],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,l],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[l,F,Q]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[l,F,Q]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[l,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[l,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,l],[/\(bb(10);/i],[l,[u,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[l,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l,[u,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[l,[u,S+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],l],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,l],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],l],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,l]]},K=function(i,p){if(typeof i===r&&(p=i,i=t),!(this instanceof K))return new K(i,p).getResult();var f=i||(typeof e!==n&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:""),h=p?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}($,p):$;return this.getBrowser=function(){var e,i={};return i[u]=t,i[l]=t,B.call(i,f,h.browser),i.major=typeof(e=i.version)===o?e.replace(/[^\d\.]/g,"").split(".")[0]:t,i},this.getCPU=function(){var e={};return e[d]=t,B.call(e,f,h.cpu),e},this.getDevice=function(){var e={};return e[c]=t,e[s]=t,e[a]=t,B.call(e,f,h.device),e},this.getEngine=function(){var e={};return e[u]=t,e[l]=t,B.call(e,f,h.engine),e},this.getOS=function(){var e={};return e[u]=t,e[l]=t,B.call(e,f,h.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return f},this.setUA=function(e){return f=typeof e===o&&e.length>275?z(e,275):e,this},this.setUA(f),this};K.VERSION="0.7.31",K.BROWSER=M([u,l,"major"]),K.CPU=M([d]),K.DEVICE=M([s,c,a,p,f,v,h,g,b]),K.ENGINE=K.OS=M([u,l]),N.exports&&(U=N.exports=K),U.UAParser=K;var W=typeof e!==n&&(e.jQuery||e.Zepto);if(W&&!W.ua){var Z=new K;W.ua=Z.getResult(),W.ua.get=function(){return Z.getUA()},W.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var i in t)W.ua[i]=t[i]}}}("object"==typeof window?window:he);var ge=ve.exports,be=function(){function e(){this.ua=new ve.exports.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:we(),platform:"Web",os:ye(this.ua),deviceModel:me(this.ua)}},e}(),ye=function(e){var t,i;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(i=e.browser)||void 0===i?void 0:i.major].filter((function(e){return null!=e})).join(" ")},me=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},we=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ie=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}(),_e=function(){return _e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},_e.apply(this,arguments)},Se=function(e,t){var i=typeof e;if(i!==typeof t)return!1;for(var n=0,r=["string","number","boolean","undefined"];n<r.length;n++){if(r[n]===i)return e===t}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var o=Array.isArray(e),s=Array.isArray(t);if(o!==s)return!1;if(!o||!s){var u=Object.keys(e).sort(),a=Object.keys(t).sort();if(!Se(u,a))return!1;var c=!0;return Object.keys(e).forEach((function(i){Se(e[i],t[i])||(c=!1)})),c}for(var l=0;l<e.length;l++)if(!Se(e[l],t[l]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),i=t.length,n=new Array(i);i--;)n[i]=[t[i],e[t[i]]];return n});var Ee=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=_e({},this.identity.userProperties),i=_e(_e({},this.identity),{userProperties:t});return{setUserId:function(e){return i.userId=e,this},setDeviceId:function(e){return i.deviceId=e,this},setUserProperties:function(e){return i.userProperties=e,this},updateUserProperties:function(e){for(var t=i.userProperties||{},n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],s=o[0],u=o[1];switch(s){case"$set":for(var a=0,c=Object.entries(u);a<c.length;a++){var l=c[a],d=l[0],p=l[1];t[d]=p}break;case"$unset":for(var f=0,h=Object.keys(u);f<h.length;f++){delete t[d=h[f]]}break;case"$clearAll":t={}}}return i.userProperties=t,this},commit:function(){return e.setIdentity(i),this}}},e.prototype.getIdentity=function(){return _e({},this.identity)},e.prototype.setIdentity=function(e){var t=_e({},this.identity);this.identity=_e({},e),Se(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}(),ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Oe=function(){function e(){this.identityStore=new Ee,this.eventBridge=new Ie,this.applicationContextProvider=new be}return e.getInstance=function(t){return ke.analyticsConnectorInstances||(ke.analyticsConnectorInstances={}),ke.analyticsConnectorInstances[t]||(ke.analyticsConnectorInstances[t]=new e),ke.analyticsConnectorInstances[t]},e}(),Te=function(){return Oe.getInstance("$default_instance")},xe=function(){function e(){this.name="identity",this.type=h.BEFORE,this.identityStore=Te().identityStore}return e.prototype.execute=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return Promise.resolve(void 0)},e}(),Pe=function(){var e,t,i,n;if("undefined"==typeof navigator)return"";var r=navigator.userLanguage;return null!==(n=null!==(i=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==i?i:r)&&void 0!==n?n:""},Re=function(e,t){Ne(e,t)},Ne=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,u=e&&e[r];if("function"==typeof u){var a=u.apply(e,o);"function"==typeof s&&s(null==a?void 0:a.promise)}}return e},Ue=function(e){return e&&void 0!==e._q},qe=function(){function e(){var e;this.name="context",this.type=h.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("1.6.7"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new ge(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,u;return o(this,(function(o){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),t=(new Date).getTime(),n=this.uaResult.browser.name,r=this.uaResult.browser.version,s=this.uaResult.device.model||this.uaResult.os.name,u=this.uaResult.device.vendor,[2,i(i(i(i(i(i(i(i(i(i(i(i({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.osName&&{os_name:n}),this.config.trackingOptions.osVersion&&{os_version:r}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),this.config.trackingOptions.deviceModel&&{device_model:s}),this.config.trackingOptions.language&&{language:Pe()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:oe(),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:this.eventId++,library:this.library})]}))}))},e.prototype.isSessionValid=function(){var e=this.config.lastEventTime||Date.now();return Date.now()-e<this.config.sessionTimeout},e}(),De=function(){function e(){}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!b())return[2,!1];t=String(Date.now()),i=new e,n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=i.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return i.sent(),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,(null===(t=b())||void 0===t?void 0:t.localStorage.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){return o(this,(function(n){try{null===(i=b())||void 0===i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return r(this,void 0,void 0,(function(){return o(this,(function(i){try{null===(t=b())||void 0===t||t.localStorage.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return r(this,void 0,void 0,(function(){return o(this,(function(t){try{null===(e=b())||void 0===e||e.localStorage.clear()}catch(e){}return[2]}))}))},e}(),Ce=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return t(i,e),i.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(n){return[2,new Promise((function(n,r){"undefined"==typeof XMLHttpRequest&&r(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===i.state.done)try{var e=o.responseText,t=JSON.parse(e),s=i.buildResponse(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},i}(ue),Ae=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(n){return[2,new Promise((function(n,r){var o=b();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?i.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(e){r(e)}}))]}))}))},i}(ue),je=function(){var e=new se;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:e,disableCookies:!1,domain:"",sessionManager:new pe(e,""),sessionTimeout:18e5,storageProvider:new se,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new fe}},Me=function(e){function n(t,n,r){var o,s,u,a,c,l,d,p,f,h,v,g,b=this,y=je();return(b=e.call(this,i(i({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30},r),{apiKey:t,storageProvider:null!==(o=null==r?void 0:r.storageProvider)&&void 0!==o?o:y.storageProvider,transportProvider:null!==(s=null==r?void 0:r.transportProvider)&&void 0!==s?s:y.transportProvider}))||this).cookieStorage=null!==(u=null==r?void 0:r.cookieStorage)&&void 0!==u?u:y.cookieStorage,b.sessionManager=null!==(a=null==r?void 0:r.sessionManager)&&void 0!==a?a:y.sessionManager,b.sessionTimeout=null!==(c=null==r?void 0:r.sessionTimeout)&&void 0!==c?c:y.sessionTimeout,b.appVersion=null==r?void 0:r.appVersion,b.attribution=null==r?void 0:r.attribution,b.cookieExpiration=null!==(l=null==r?void 0:r.cookieExpiration)&&void 0!==l?l:y.cookieExpiration,b.cookieSameSite=null!==(d=null==r?void 0:r.cookieSameSite)&&void 0!==d?d:y.cookieSameSite,b.cookieSecure=null!==(p=null==r?void 0:r.cookieSecure)&&void 0!==p?p:y.cookieSecure,b.deviceId=null==r?void 0:r.deviceId,b.disableCookies=null!==(f=null==r?void 0:r.disableCookies)&&void 0!==f?f:y.disableCookies,b.domain=null!==(h=null==r?void 0:r.domain)&&void 0!==h?h:y.domain,b.lastEventTime=null!==(v=b.lastEventTime)&&void 0!==v?v:null==r?void 0:r.lastEventTime,b.optOut=Boolean(null==r?void 0:r.optOut),b.partnerId=null==r?void 0:r.partnerId,b.sessionId=null==r?void 0:r.sessionId,b.trackingOptions=null!==(g=null==r?void 0:r.trackingOptions)&&void 0!==g?g:y.trackingOptions,b.userId=n,b}return t(n,e),Object.defineProperty(n.prototype,"deviceId",{get:function(){return this.sessionManager.getDeviceId()},set:function(e){this.sessionManager.setDeviceId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"userId",{get:function(){return this.sessionManager.getUserId()},set:function(e){this.sessionManager.setUserId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sessionId",{get:function(){return this.sessionManager.getSessionId()},set:function(e){this.sessionManager.setSessionId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"optOut",{get:function(){return this.sessionManager.getOptOut()},set:function(e){var t;null===(t=this.sessionManager)||void 0===t||t.setOptOut(Boolean(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastEventTime",{get:function(){return this.sessionManager.getLastEventTime()},set:function(e){this.sessionManager.setLastEventTime(e)},enumerable:!1,configurable:!0}),n}(G),Le=function(e,t,n){return r(void 0,void 0,void 0,(function(){var r,s,u,a,c,l,d,p,f,h,v,g,b,m,w,I,_;return o(this,(function(o){switch(o.label){case 0:return r=je(),null===(b=null==n?void 0:n.domain)||void 0===b?[3,1]:(u=b,[3,3]);case 1:return[4,$e()];case 2:u=o.sent(),o.label=3;case 3:return s=u,[4,Ve(i(i({},n),{domain:s}))];case 4:return a=o.sent(),c=ae(e),[4,a.get(c)];case 5:return l=o.sent(),d=y(),[4,new pe(a,e).load()];case 6:return p=o.sent(),f=Me.bind,h=[void 0,e,null!=t?t:null==l?void 0:l.userId],v=[i({},n)],g={cookieStorage:a,sessionManager:p,deviceId:Fe(null==l?void 0:l.deviceId,null==n?void 0:n.deviceId,d.deviceId),domain:s,optOut:null!==(m=null==n?void 0:n.optOut)&&void 0!==m?m:Boolean(null==l?void 0:l.optOut)},[4,a.get(c)];case 7:return g.sessionId=null!==(I=null===(w=o.sent())||void 0===w?void 0:w.sessionId)&&void 0!==I?I:null==n?void 0:n.sessionId,[4,Be(n)];case 8:return[2,new(f.apply(Me,h.concat([i.apply(void 0,v.concat([(g.storageProvider=o.sent(),g.trackingOptions=i(i({},r.trackingOptions),null==n?void 0:n.trackingOptions),g.transportProvider=null!==(_=null==n?void 0:n.transportProvider)&&void 0!==_?_:Qe(null==n?void 0:n.transport),g)]))])))]}}))}))},Ve=function(e,t){return void 0===t&&(t=je()),r(void 0,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return n=i(i({},t),e),r=null==e?void 0:e.cookieStorage,(s=!r)?[3,2]:[4,r.isEnabled()];case 1:s=!o.sent(),o.label=2;case 2:return s?[2,ze(n)]:[2,r]}}))}))},ze=function(e){return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(n){switch(n.label){case 0:return t=new de({domain:e.domain,expirationDays:e.cookieExpiration,sameSite:e.cookieSameSite,secure:e.cookieSecure}),(i=e.disableCookies)?[3,2]:[4,t.isEnabled()];case 1:i=!n.sent(),n.label=2;case 2:return i?[4,(t=new De).isEnabled()]:[3,4];case 3:n.sent()||(t=new se),n.label=4;case 4:return[2,t]}}))}))},Be=function(e){return r(void 0,void 0,void 0,(function(){var t,i,n,r,u,a,c;return o(this,(function(o){switch(o.label){case 0:if(e&&Object.prototype.hasOwnProperty.call(e,"storageProvider")&&!e.storageProvider)return[3,9];o.label=1;case 1:o.trys.push([1,7,8,9]),t=s([null==e?void 0:e.storageProvider,new De]),i=t.next(),o.label=2;case 2:return i.done?[3,6]:(n=i.value,(r=n)?[4,n.isEnabled()]:[3,4]);case 3:r=o.sent(),o.label=4;case 4:if(r)return[2,n];o.label=5;case 5:return i=t.next(),[3,2];case 6:return[3,9];case 7:return u=o.sent(),a={error:u},[3,9];case 8:try{i&&!i.done&&(c=t.return)&&c.call(t)}finally{if(a)throw a.error}return[7];case 9:return[2,void 0]}}))}))},Fe=function(e,t,i){return t||i||e||oe()},Qe=function(e){return e===g.XHR?new Ce:e===g.SendBeacon?new Ae:je().transportProvider},$e=function(e){return r(void 0,void 0,void 0,(function(){var t,i,n,r,s,u,a;return o(this,(function(o){switch(o.label){case 0:return[4,(new de).isEnabled()];case 1:if(!o.sent()||!e&&"undefined"==typeof location)return[2,""];for(t=null!=e?e:location.hostname,i=t.split("."),n=[],r="AMP_TLDTEST",s=i.length-2;s>=0;--s)n.push(i.slice(s).join("."));s=0,o.label=2;case 2:return s<n.length?(u=n[s],[4,(a=new de({domain:"."+u})).set(r,1)]):[3,7];case 3:return o.sent(),[4,a.get(r)];case 4:return o.sent()?[4,a.remove(r)]:[3,6];case 5:return o.sent(),[2,"."+u];case 6:return s++,[3,2];case 7:return[2,""]}}))}))},Ke=function(e,t){return r(void 0,void 0,void 0,(function(){var i,n,r,s,a,c,l,d,p;return o(this,(function(o){switch(o.label){case 0:return[4,(i=new de).isEnabled()];case 1:return o.sent()&&!(null==t?void 0:t.disableCookies)||(i=new De),[4,i.isEnabled()];case 2:return o.sent()?(n=function(e){return"".concat(D.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,i.getRaw(n)]):[2,{optOut:!1}];case 3:return(r=o.sent())?[4,i.remove(n)]:[2,{optOut:!1}];case 4:return o.sent(),s=u(r.split("."),5),a=s[0],c=s[1],l=s[2],d=s[3],p=s[4],[2,{deviceId:a,userId:Ze(c),sessionId:We(d),lastEventTime:We(p),optOut:Boolean(l)}]}}))}))},We=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ze=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Ge=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.init=function(t,n,s){var u,a,c;return void 0===t&&(t=""),r(this,void 0,void 0,(function(){var r,l,d,p,f=this;return o(this,(function(o){switch(o.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,Ke(t,s)]);case 1:return r=o.sent(),[4,Le(t,n||r.userId,i(i({},s),{deviceId:null!==(u=r.deviceId)&&void 0!==u?u:null==s?void 0:s.deviceId,sessionId:null!==(a=r.sessionId)&&void 0!==a?a:null==s?void 0:s.sessionId,optOut:null!==(c=null==s?void 0:s.optOut)&&void 0!==c?c:r.optOut,lastEventTime:r.lastEventTime}))];case 2:return l=o.sent(),[4,e.prototype._init.call(this,l)];case 3:return o.sent(),d=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),d=!0),(p=Te()).eventBridge.setEventReceiver((function(e){f.track(e.eventType,e.eventProperties)})),p.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new qe)];case 4:return o.sent(),[4,this.add(new xe)];case 5:return o.sent(),[4,this.add(new Y)];case 6:return o.sent(),this.initializing=!1,[4,this.runAttributionStrategy(l.attribution,d)];case 7:return o.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return o.sent(),[2]}}))}))},n.prototype.runAttributionStrategy=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return n=this.track.bind(this),r=this.setSessionId.bind(this,Date.now()),[4,ze(this.config)];case 1:return s=o.sent(),[4,new ce(this.config.apiKey,i(i({},e),{storage:s,track:n,onNewCampaign:r})).send(t)];case 2:return o.sent(),[2]}}))}))},n.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},n.prototype.setUserId=function(e){this.config?this.config.userId=e:this.q.push(this.setUserId.bind(this,e))},n.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},n.prototype.setDeviceId=function(e){this.config?this.config.deviceId=e:this.q.push(this.setDeviceId.bind(this,e))},n.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(oe())},n.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},n.prototype.setSessionId=function(e){this.config?(this.config.sessionId=e,this.config.lastEventTime=void 0):this.q.push(this.setSessionId.bind(this,e))},n.prototype.setTransport=function(e){this.config?this.config.transportProvider=Qe(e):this.q.push(this.setTransport.bind(this,e))},n.prototype.identify=function(t,i){if(Ue(t)){var n=t._q;t._q=[],t=Ne(new L,n)}return(null==i?void 0:i.user_id)&&this.setUserId(i.user_id),(null==i?void 0:i.device_id)&&this.setDeviceId(i.device_id),e.prototype.identify.call(this,t,i)},n.prototype.groupIdentify=function(t,i,n,r){if(Ue(n)){var o=n._q;n._q=[],n=Ne(new L,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},n.prototype.revenue=function(t,i){if(Ue(t)){var n=t._q;t._q=[],t=Ne(new $,n)}return e.prototype.revenue.call(this,t,i)},n}(Q),Je=function(){var e=new Ge;return{init:re(X(e.init.bind(e)),"init",te(e),ne(e,["config"])),add:re(X(e.add.bind(e)),"add",te(e),ne(e,["config.apiKey","timeline.plugins"])),remove:re(X(e.remove.bind(e)),"remove",te(e),ne(e,["config.apiKey","timeline.plugins"])),track:re(X(e.track.bind(e)),"track",te(e),ne(e,["config.apiKey","timeline.queue.length"])),logEvent:re(X(e.logEvent.bind(e)),"logEvent",te(e),ne(e,["config.apiKey","timeline.queue.length"])),identify:re(X(e.identify.bind(e)),"identify",te(e),ne(e,["config.apiKey","timeline.queue.length"])),groupIdentify:re(X(e.groupIdentify.bind(e)),"groupIdentify",te(e),ne(e,["config.apiKey","timeline.queue.length"])),setGroup:re(X(e.setGroup.bind(e)),"setGroup",te(e),ne(e,["config.apiKey","timeline.queue.length"])),revenue:re(X(e.revenue.bind(e)),"revenue",te(e),ne(e,["config.apiKey","timeline.queue.length"])),flush:re(X(e.flush.bind(e)),"flush",te(e),ne(e,["config.apiKey","timeline.queue.length"])),getUserId:re(e.getUserId.bind(e),"getUserId",te(e),ne(e,["config","config.userId"])),setUserId:re(e.setUserId.bind(e),"setUserId",te(e),ne(e,["config","config.userId"])),getDeviceId:re(e.getDeviceId.bind(e),"getDeviceId",te(e),ne(e,["config","config.deviceId"])),setDeviceId:re(e.setDeviceId.bind(e),"setDeviceId",te(e),ne(e,["config","config.deviceId"])),reset:re(e.reset.bind(e),"reset",te(e),ne(e,["config","config.userId","config.deviceId"])),getSessionId:re(e.getSessionId.bind(e),"getSessionId",te(e),ne(e,["config"])),setSessionId:re(e.setSessionId.bind(e),"setSessionId",te(e),ne(e,["config"])),setOptOut:re(e.setOptOut.bind(e),"setOptOut",te(e),ne(e,["config"])),setTransport:re(e.setTransport.bind(e),"setTransport",te(e),ne(e,["config"]))}},He=Je(),Ye=He.add,Xe=He.flush,et=He.getDeviceId,tt=He.getSessionId,it=He.getUserId,nt=He.groupIdentify,rt=He.identify,ot=He.init,st=He.logEvent,ut=He.remove,at=He.reset,ct=He.revenue,lt=He.setDeviceId,dt=He.setGroup,pt=He.setOptOut,ft=He.setSessionId,ht=He.setTransport,vt=He.setUserId,gt=He.track,bt=Object.freeze({__proto__:null,add:Ye,flush:Xe,getDeviceId:et,getSessionId:tt,getUserId:it,groupIdentify:nt,identify:rt,init:ot,logEvent:st,remove:ut,reset:at,revenue:ct,setDeviceId:lt,setGroup:dt,setOptOut:pt,setSessionId:ft,setTransport:ht,setUserId:vt,track:gt,Types:q,createInstance:Je,runQueuedFunctions:Re,Revenue:$,Identify:L});!function(){var e=b();if(e){if(e.amplitude=Object.assign(e.amplitude||{},bt),e.amplitude.invoked){var t=e.amplitude._q;e.amplitude._q=[],Re(bt,t);for(var i=0;i<e.amplitude._iq.length;i++){var n=Object.assign(e.amplitude._iq[i],Je()),r=n._q;n._q=[],Re(n,r)}}}else console.error("[Amplitude] Error: GlobalScope is not defined")}()}();
|
|
1
|
+
!function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};function n(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function r(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function u(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))}function o(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(a){return function(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(i=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(6===u[0]&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e],n=0}finally{i=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function a(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}var c,l,d,p,f,h,v,g,b=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},y=function(){var e,t=b();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 i=t.split("=",2),n=m(i[0]),r=m(i[1]);return r?(e[n]=r,e):e}),{}):{}},m=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},w="dclid",I="fbclid",_="gbraid",S="gclid",E="ko_click_id",k="msclkid",O="ttclid",T="twclid",x="wbraid",P={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,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},R=function(){function e(){}return e.prototype.parse=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,i(i(i(i({},P),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=y();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,i={referrer:void 0,referring_domain:void 0};try{i.referrer=document.referrer||void 0,i.referring_domain=null!==(t=null===(e=i.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return i},e.prototype.getClickIds=function(){var e,t=y();return(e={})[w]=t[w],e[I]=t[I],e[_]=t[_],e[S]=t[S],e[E]=t[E],e[k]=t[k],e[O]=t[O],e[T]=t[T],e[x]=t[x],e},e}();!function(e){e.US="US",e.EU="EU"}(c||(c={})),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"}(l||(l={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(d||(d={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(p||(p={})),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(f||(f={})),function(e){e.BEFORE="before",e.ENRICHMENT="enrichment",e.DESTINATION="destination"}(h||(h={})),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"}(v||(v={})),function(e){e.XHR="xhr",e.SendBeacon="beacon",e.Fetch="fetch"}(g||(g={}));var N,U,q=Object.freeze({__proto__:null,get ServerZone(){return c},get SpecialEventType(){return p},get IdentifyOperation(){return l},get RevenueProperty(){return d},get LogLevel(){return f},get PluginType(){return h},get Status(){return v},get TransportType(){return g}}),D="AMP",C="".concat(D,"_unsent"),A="https://api2.amplitude.com/2/httpapi",j=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!M(t,i))return!1}return!0},M=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var r=!0;try{for(var o=s(t),u=o.next();!u.done;u=o.next()){var a=u.value;if(Array.isArray(a))return!1;if("object"==typeof a)r=r&&j(a);else if(!["number","string"].includes(typeof a))return!1;if(!r)return!1}}catch(e){i={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}}else{if(null==t)return!1;if("object"==typeof t)return j(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},L=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return i({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(l.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(l.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(l.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(l.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(l.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(l.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(l.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(l.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(l.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[l.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,i){if(this._validate(e,t,i)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=i,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,i){return void 0===this._properties[l.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===l.ADD?"number"==typeof i:e===l.UNSET||e===l.REMOVE||M(t,i)))},e}(),V=function(e,t){return i(i({},t),{event_type:p.IDENTIFY,user_properties:e.getUserProperties()})},z=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=v.Unknown),{event:e,code:t,message:i}},B=function(){function e(){this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,e.setup(t)];case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},e.prototype.reset=function(){this.applying=!1,this.plugins=[]},e.prototype.push=function(e){var t=this;return new Promise((function(i){t.queue.push([e,i]),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 r(this,void 0,void 0,(function(){var t,n,r,a,c,l,d,p,f,v,g,b,y,m,w,I,_,S;return o(this,(function(o){switch(o.label){case 0:if(!e)return[2];t=u(e,1),n=t[0],r=u(e,2),a=r[1],c=this.plugins.filter((function(e){return e.type===h.BEFORE})),o.label=1;case 1:o.trys.push([1,6,7,8]),l=s(c),d=l.next(),o.label=2;case 2:return d.done?[3,5]:[4,d.value.execute(i({},n))];case 3:n=o.sent(),o.label=4;case 4:return d=l.next(),[3,2];case 5:return[3,8];case 6:return p=o.sent(),w={error:p},[3,8];case 7:try{d&&!d.done&&(I=l.return)&&I.call(l)}finally{if(w)throw w.error}return[7];case 8:f=this.plugins.filter((function(e){return e.type===h.ENRICHMENT})),o.label=9;case 9:o.trys.push([9,14,15,16]),v=s(f),g=v.next(),o.label=10;case 10:return g.done?[3,13]:[4,g.value.execute(i({},n))];case 11:n=o.sent(),o.label=12;case 12:return g=v.next(),[3,10];case 13:return[3,16];case 14:return b=o.sent(),_={error:b},[3,16];case 15:try{g&&!g.done&&(S=v.return)&&S.call(v)}finally{if(_)throw _.error}return[7];case 16:return y=this.plugins.filter((function(e){return e.type===h.DESTINATION})),m=y.map((function(e){var t=i({},n);return e.execute(t).catch((function(e){return z(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=u(e,1)[0];a(t)})),[2]}}))}))},e.prototype.flush=function(){return r(this,void 0,void 0,(function(){var e,t,i,n=this;return o(this,(function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return r.sent(),t=this.plugins.filter((function(e){return e.type===h.DESTINATION})),i=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(i)];case 2:return r.sent(),[2]}}))}))},e}(),F="Event rejected due to exceeded retry count",Q=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new B,this.name=e}return e.prototype._init=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return r(this,void 0,void 0,(function(){var t,i,n,r,u,a;return o(this,(function(o){switch(o.label){case 0:t=this[e],this[e]=[],o.label=1;case 1:o.trys.push([1,6,7,8]),i=s(t),n=i.next(),o.label=2;case 2:return n.done?[3,5]:[4,(0,n.value)()];case 3:o.sent(),o.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return r=o.sent(),u={error:r},[3,8];case 7:try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(u)throw u.error}return[7];case 8:return[2]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return i(i(i({},"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 i=V(e,t);return this.dispatch(i)},e.prototype.groupIdentify=function(e,t,n,r){var o=function(e,t,n,r){var o;return i(i({},r),{event_type:p.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(o={},o[e]=t,o)})}(e,t,n,r);return this.dispatch(o)},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,o=new L;return o.set(e,t),i(i({},n),{event_type:p.IDENTIFY,user_properties:o.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 i(i({},t),{event_type:p.REVENUE,event_properties:e.getEventProperties()})}(e,t);return this.dispatch(n)},e.prototype.add=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.config?[2,this.timeline.register(e,this.config)]:(this.q.push(this.add.bind(this,e)),[2])}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.config?[2,this.timeline.deregister(e)]:(this.q.push(this.remove.bind(this,e)),[2])}))}))},e.prototype.dispatchWithCallback=function(e,t){if(!this.config)return t(z(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(i){return this.config?[2,this.process(e)]:[2,new Promise((function(i){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,i))}))]}))}))},e.prototype.process=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.config.optOut?[2,z(e,0,"Event skipped due to optOut config")]:[4,this.timeline.push(e)];case 1:return 200===(n=r.sent()).code?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=r.sent(),i=String(t),this.config.loggerProvider.error(i),[2,n=z(e,0,i)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config?this.config.optOut=Boolean(e):this.q.push(this.setOptOut.bind(this,Boolean(e)))},e.prototype.flush=function(){return this.timeline.flush()},e}(),$=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 j(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?i({},this.properties):{};return e[d.REVENUE_PRODUCT_ID]=this.productId,e[d.REVENUE_QUANTITY]=this.quantity,e[d.REVENUE_PRICE]=this.price,e[d.REVENUE_TYPE]=this.revenueType,e[d.REVENUE]=this.revenue,e},e}(),K="Amplitude Logger ",W=function(){function e(){this.logLevel=f.None}return e.prototype.disable=function(){this.logLevel=f.None},e.prototype.enable=function(e){void 0===e&&(e=f.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Verbose||console.log("".concat(K,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Warn||console.warn("".concat(K,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Error||console.error("".concat(K,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Debug||console.log("".concat(K,"[Debug]: ").concat(e.join(" ")))},e}(),Z=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:f.Warn,loggerProvider:new W,optOut:!1,serverUrl:A,serverZone:c.US,useBatch:!1}},G=function(){function e(e){var t,i,n;this._optOut=!1;var r=Z();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis||r.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||r.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||r.flushQueueSize,this.loggerProvider=e.loggerProvider||r.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:r.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:r.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||r.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(n=e.useBatch)&&void 0!==n?n:r.useBatch,this.loggerProvider.enable(this.logLevel);var o=H(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),J=function(e,t){return e===c.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":A},H=function(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=Z().serverZone),void 0===i&&(i=Z().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=[c.US,c.EU].includes(t)?t:Z().serverZone;return{serverZone:n,serverUrl:J(n,i)}},Y=function(){function e(){this.name="amplitude",this.type=h.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return e.prototype.setup=function(e){var t;return r(this,void 0,void 0,(function(){var i,n=this;return o(this,(function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(C,"_").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 i=r.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map((function(e){return n.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n={event:e,attempts:0,callback:function(e){return i(e)},timeout:0};t.addToQueue(n)}))},e.prototype.addToQueue=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.filter((function(t){return t.attempts<e.config.flushMaxRetries?(t.attempts+=1,!0):(e.fulfillRequest([t],500,F),!1)}));n.forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(e.config.flushIntervalMillis)})),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||(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),r(this,void 0,void 0,(function(){var t,i,n,r=this;return o(this,(function(o){switch(o.label){case 0:return t=[],i=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):i.push(e)})),this.queue=i,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),s=t,u=this.config.flushQueueSize,a=Math.max(u,1),n=s.reduce((function(e,t,i){var n=Math.floor(i/a);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(n.map((function(t){return r.send(t,e)})))];case 1:return o.sent(),[2]}var s,u,a}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),r(this,void 0,void 0,(function(){var i,r,s,u,a;return o(this,(function(o){switch(o.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];i={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,n(t,["extra"])})),options:{min_id_length:this.config.minIdLength}},o.label=1;case 1:return o.trys.push([1,3,,4]),r=H(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,i)];case 2:if(null===(s=o.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t){if("body"in s){u="";try{u=JSON.stringify(s.body,null,2)}catch(e){}this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(u))}else this.fulfillRequest(e,s.statusCode,s.status);return[2]}return this.handleReponse(s,e),[3,4];case 3:return a=o.sent(),this.fulfillRequest(e,0,String(a)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case v.Success:this.handleSuccessResponse(e,t);break;case v.Invalid:this.handleInvalidResponse(e,t);break;case v.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case v.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.handleOtherReponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var i=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=a(a(a(a([],u(Object.values(e.body.eventsWithInvalidFields)),!1),u(Object.values(e.body.eventsWithMissingFields)),!1),u(Object.values(e.body.eventsWithInvalidIdLengths)),!1),u(e.body.silencedEvents),!1).flat(),r=new Set(n),o=t.filter((function(t,n){if(!r.has(n))return!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,a([],u(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,a([],u(t),!1))):this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var i=this,n=Object.keys(e.body.exceededDailyQuotaUsers),r=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),c=new Set(r),l=new Set(o),d=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&c.has(t.event.device_id)))return l.has(n)&&(t.timeout=i.throttleTimeout),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,a([],u(d),!1))},e.prototype.handleOtherReponse=function(e){var t=this;this.addToQueue.apply(this,a([],u(e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e}))),!1))},e.prototype.fulfillRequest=function(e,t,i){this.saveEvents(),e.forEach((function(e){return e.callback(z(e.event,t,i))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map((function(e){return e.event})));this.config.storageProvider.set(this.storageKey,e)}},e}(),X=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return{promise:e.apply(void 0,a([],u(t),!1))}}},ee=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},te=function(e){return function(){var t=i({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ie=function(e,t){var i,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var r=s(t.split(".")),o=r.next();!o.done;o=r.next()){var u=o.value;if(!(u in e))return;e=e[u]}}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},ne=function(e,t){return function(){var i,n,r={};try{for(var o=s(t),u=o.next();!u.done;u=o.next()){var a=u.value;r[a]=ie(e,a)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return r}},re=function(e,t,i,n,r){return void 0===r&&(r=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var u=i(),a=u.logger,c=u.logLevel;if(c&&c<f.Debug||!c||!a)return e.apply(r,o);var l={type:"invoke public method",name:t,args:o,stacktrace:ee(1),time:{start:(new Date).toISOString()},states:{}};n&&l.states&&(l.states.before=n());var d=e.apply(r,o);return d&&d.promise?d.promise.then((function(){n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=(new Date).toISOString()),a.debug(JSON.stringify(l,null,2))})):(n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=(new Date).toISOString()),a.debug(JSON.stringify(l,null,2))),d}},oe=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,oe)},se=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return[4,this.get(e)];case 1:return[2,(t=i.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(i){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),ue=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,i,n,r,o,s,u,a,c,l,d,p,f,h,g,b,y,m,w,I,_,S;if("object"!=typeof e)return null;var E=e.code||0,k=this.buildStatus(E);switch(k){case v.Success:return{status:k,statusCode:E,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(i=e.payload_size_bytes)&&void 0!==i?i:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case v.Invalid:return{status:k,statusCode:E,body:{error:null!==(r=e.error)&&void 0!==r?r:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(u=e.events_with_missing_fields)&&void 0!==u?u:{},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!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case v.PayloadTooLarge:return{status:k,statusCode:E,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case v.RateLimit:return{status:k,statusCode:E,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(m=e.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(I=e.exceeded_daily_quota_devices)&&void 0!==I?I:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case v.Timeout:default:return{status:k,statusCode:E}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?v.Success:429===e?v.RateLimit:413===e?v.PayloadTooLarge:408===e?v.Timeout:e>=400&&e<500?v.Invalid:e>=500?v.Failed:v.Unknown},e}(),ae=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=10),[D,t,e.substring(0,i)].filter(Boolean).join("_")},ce=function(){function e(e,t){var i,n;this.storage=t.storage,this.storageKey=ae(e,"MKTG"),this.parser=new R,this.track=t.track,this.onNewCampaign=t.onNewCampaign,this.disabled=Boolean(t.disabled),this.trackNewCampaigns=Boolean(t.trackNewCampaigns),this.trackPageViews=Boolean(t.trackPageViews),this.excludeReferrers=null!==(i=t.excludeReferrers)&&void 0!==i?i:[],"undefined"!=typeof location&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(n=t.initialEmptyValue)&&void 0!==n?n:"EMPTY"}return e.prototype.isNewCampaign=function(e,t,i){void 0===i&&(i=!1),e.referrer;var r=e.referring_domain,o=n(e,["referrer","referring_domain"]),s=t||{};s.referrer;var u=s.referring_domain,a=n(s,["referrer","referring_domain"]);if(e.referring_domain&&this.excludeReferrers.includes(e.referring_domain))return!1;var c=JSON.stringify(o)!==JSON.stringify(a),l=i?le(r||"")!==le(u||""):r!==u;return!t||c||l},e.prototype.saveCampaignToStorage=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.storage.set(this.storageKey,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getCampaignFromStorage=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.createCampaignEvent=function(e){var t=this,n=i(i({},P),e),r=Object.entries(n).reduce((function(e,i){var n=u(i,2),r=n[0],o=n[1];return e.setOnce("initial_".concat(r),o||t.initialEmptyValue),o?e.set(r,o):e.unset(r)}),new L),o={event_type:"Page View",event_properties:{page_title:"undefined"!=typeof document&&document.title||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||""}};return i(i({},V(r)),this.trackPageViews&&o)},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){switch(n.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return t=n.sent(),[4,this.getCampaignFromStorage()];case 2:if(i=n.sent(),!e){if(!this.trackNewCampaigns||!this.isNewCampaign(t,i))return[2];this.onNewCampaign(t)}return[4,this.track(this.createCampaignEvent(t))];case 3:return n.sent(),[4,this.saveCampaignToStorage(t)];case 4:return n.sent(),[2]}}))}))},e}(),le=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},de=function(){function e(e){this.options=i({},e)}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!b())return[2,!1];t=String(Date.now()),i=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=i.sent()))return[2,void 0];try{try{t=decodeURIComponent(atob(t))}catch(e){}return[2,JSON.parse(t)]}catch(e){return[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){return i=b(),n=null!==(t=null==i?void 0:i.document.cookie.split("; "))&&void 0!==t?t:[],(r=n.find((function(t){return 0===t.indexOf(e+"=")})))?[2,r.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){var n,r,s,u,a,c;return o(this,(function(o){try{n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,s=void 0,(r=null!==t?n:-1)&&((u=new Date).setTime(u.getTime()+24*r*60*60*1e3),s=u),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),s&&(a+="; expires=".concat(s.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(c=b())&&(c.document.cookie=a)}catch(e){}return[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(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 r(this,void 0,void 0,(function(){return o(this,(function(e){return[2]}))}))},e}(),pe=function(){function e(e,t){this.storage=e,this.storageKey=ae(t),this.cache={optOut:!1}}return e.prototype.load=function(){var e;return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return t=this,[4,this.storage.get(this.storageKey)];case 1:return t.cache=null!==(e=i.sent())&&void 0!==e?e:{optOut:!1},[2,this]}}))}))},e.prototype.setSession=function(e){this.cache=i(i({},this.cache),e),this.storage.set(this.storageKey,this.cache)},e.prototype.getSessionId=function(){return this.cache.sessionId},e.prototype.setSessionId=function(e){this.setSession({sessionId:e})},e.prototype.getDeviceId=function(){return this.cache.deviceId},e.prototype.setDeviceId=function(e){this.setSession({deviceId:e})},e.prototype.getUserId=function(){return this.cache.userId},e.prototype.setUserId=function(e){this.setSession({userId:e})},e.prototype.getLastEventTime=function(){return this.cache.lastEventTime},e.prototype.setLastEventTime=function(e){this.setSession({lastEventTime:e})},e.prototype.getOptOut=function(){return this.cache.optOut},e.prototype.setOptOut=function(e){this.setSession({optOut:e})},e.prototype.getLastEventId=function(){return this.cache.lastEventId},e.prototype.setLastEventId=function(e){this.setSession({lastEventId:e})},e}(),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){switch(r.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,i)];case 1:return[4,r.sent().json()];case 2:return n=r.sent(),[2,this.buildResponse(n)]}}))}))},i}(ue),he="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ve={exports:{}};N=ve,U=ve.exports,function(e,t){var i="function",n="undefined",r="object",o="string",s="model",u="name",a="type",c="vendor",l="version",d="architecture",p="console",f="mobile",h="tablet",v="smarttv",g="wearable",b="embedded",y="Amazon",m="Apple",w="ASUS",I="BlackBerry",_="Browser",S="Chrome",E="Firefox",k="Google",O="Huawei",T="LG",x="Microsoft",P="Motorola",R="Opera",q="Samsung",D="Sony",C="Xiaomi",A="Zebra",j="Facebook",M=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},L=function(e,t){return typeof e===o&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===o)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===n?e:e.substring(0,275)},B=function(e,n){for(var o,s,u,a,c,l,d=0;d<n.length&&!c;){var p=n[d],f=n[d+1];for(o=s=0;o<p.length&&!c;)if(c=p[o++].exec(e))for(u=0;u<f.length;u++)l=c[++s],typeof(a=f[u])===r&&a.length>0?2===a.length?typeof a[1]==i?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==i||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):t:this[a[0]]=l?a[1].call(this,l,a[2]):t:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):t):this[a]=l||t;d+=2}},F=function(e,i){for(var n in i)if(typeof i[n]===r&&i[n].length>0){for(var o=0;o<i[n].length;o++)if(L(i[n][o],e))return"?"===n?t:n}else if(L(i[n],e))return"?"===n?t:n;return e},Q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,l],[/opios[\/ ]+([\w\.]+)/i],[l,[u,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[l,[u,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,l],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l,[u,"UC"+_]],[/\bqbcore\/([\w\.]+)/i],[l,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[l,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[l,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+_],l],[/\bfocus\/([\w\.]+)/i],[l,[u,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[l,[u,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[l,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[u,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[l,[u,"MIUI "+_]],[/fxios\/([-\w\.]+)/i],[l,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+_]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+_],l],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],l],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,l],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,j],l],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,l],[/\bgsa\/([\w\.]+) .*safari\//i],[l,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[l,[u,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,S+" WebView"],l],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l,[u,"Android "+_]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,l],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[l,[u,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[l,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[l,F,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,l],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],l],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l,[u,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,V]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[s,[c,q],[a,h]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[s,[c,q],[a,f]],[/((ipod|iphone)\d+,\d+)/i],[s,[c,m],[a,f]],[/(ipad\d+,\d+)/i],[s,[c,m],[a,h]],[/\((ip(?:hone|od)[\w ]*);/i],[s,[c,m],[a,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[s,[c,m],[a,h]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[s,[c,O],[a,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[s,[c,O],[a,f]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[s,/_/g," "],[c,C],[a,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[s,/_/g," "],[c,C],[a,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[s,[c,"OPPO"],[a,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[s,[c,"Vivo"],[a,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[s,[c,"Realme"],[a,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[s,[c,P],[a,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[s,[c,P],[a,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[c,T],[a,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[s,[c,T],[a,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[s,[c,"Lenovo"],[a,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[s,/_/g," "],[c,"Nokia"],[a,f]],[/(pixel c)\b/i],[s,[c,k],[a,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[s,[c,k],[a,f]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[s,[c,D],[a,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[s,"Xperia Tablet"],[c,D],[a,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[s,[c,"OnePlus"],[a,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[s,[c,y],[a,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[s,/(.+)/g,"Fire Phone $1"],[c,y],[a,f]],[/(playbook);[-\w\),; ]+(rim)/i],[s,c,[a,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[s,[c,I],[a,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[s,[c,w],[a,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[s,[c,w],[a,f]],[/(nexus 9)/i],[s,[c,"HTC"],[a,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[c,[s,/_/g," "],[a,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[s,[c,"Acer"],[a,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[s,[c,"Meizu"],[a,f]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[s,[c,"Sharp"],[a,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[c,s,[a,f]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[c,s,[a,h]],[/(surface duo)/i],[s,[c,x],[a,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[s,[c,"Fairphone"],[a,f]],[/(u304aa)/i],[s,[c,"AT&T"],[a,f]],[/\bsie-(\w*)/i],[s,[c,"Siemens"],[a,f]],[/\b(rct\w+) b/i],[s,[c,"RCA"],[a,h]],[/\b(venue[\d ]{2,7}) b/i],[s,[c,"Dell"],[a,h]],[/\b(q(?:mv|ta)\w+) b/i],[s,[c,"Verizon"],[a,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[s,[c,"Barnes & Noble"],[a,h]],[/\b(tm\d{3}\w+) b/i],[s,[c,"NuVision"],[a,h]],[/\b(k88) b/i],[s,[c,"ZTE"],[a,h]],[/\b(nx\d{3}j) b/i],[s,[c,"ZTE"],[a,f]],[/\b(gen\d{3}) b.+49h/i],[s,[c,"Swiss"],[a,f]],[/\b(zur\d{3}) b/i],[s,[c,"Swiss"],[a,h]],[/\b((zeki)?tb.*\b) b/i],[s,[c,"Zeki"],[a,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],s,[a,h]],[/\b(ns-?\w{0,9}) b/i],[s,[c,"Insignia"],[a,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[s,[c,"NextBook"],[a,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],s,[a,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],s,[a,f]],[/\b(ph-1) /i],[s,[c,"Essential"],[a,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[s,[c,"Envizen"],[a,h]],[/\b(trio[-\w\. ]+) b/i],[s,[c,"MachSpeed"],[a,h]],[/\btu_(1491) b/i],[s,[c,"Rotor"],[a,h]],[/(shield[\w ]+) b/i],[s,[c,"Nvidia"],[a,h]],[/(sprint) (\w+)/i],[c,s,[a,f]],[/(kin\.[onetw]{3})/i],[[s,/\./g," "],[c,x],[a,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[s,[c,A],[a,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[s,[c,A],[a,f]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,s,[a,p]],[/droid.+; (shield) bui/i],[s,[c,"Nvidia"],[a,p]],[/(playstation [345portablevi]+)/i],[s,[c,D],[a,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[s,[c,x],[a,p]],[/smart-tv.+(samsung)/i],[c,[a,v]],[/hbbtv.+maple;(\d+)/i],[[s,/^/,"SmartTV"],[c,q],[a,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,T],[a,v]],[/(apple) ?tv/i],[c,[s,m+" TV"],[a,v]],[/crkey/i],[[s,S+"cast"],[c,k],[a,v]],[/droid.+aft(\w)( bui|\))/i],[s,[c,y],[a,v]],[/\(dtv[\);].+(aquos)/i],[s,[c,"Sharp"],[a,v]],[/(bravia[\w- ]+) bui/i],[s,[c,D],[a,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[c,z],[s,z],[a,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[a,v]],[/((pebble))app/i],[c,s,[a,g]],[/droid.+; (glass) \d/i],[s,[c,k],[a,g]],[/droid.+; (wt63?0{2,3})\)/i],[s,[c,A],[a,g]],[/(quest( 2)?)/i],[s,[c,j],[a,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[a,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[s,[a,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[s,[a,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[a,h]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[a,f]],[/(android[-\w\. ]{0,9});.+buil/i],[s,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,l],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,l],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[l,F,Q]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[l,F,Q]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[l,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[l,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,l],[/\(bb(10);/i],[l,[u,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[l,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l,[u,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[l,[u,S+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],l],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,l],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],l],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,l]]},K=function(i,p){if(typeof i===r&&(p=i,i=t),!(this instanceof K))return new K(i,p).getResult();var f=i||(typeof e!==n&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:""),h=p?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}($,p):$;return this.getBrowser=function(){var e,i={};return i[u]=t,i[l]=t,B.call(i,f,h.browser),i.major=typeof(e=i.version)===o?e.replace(/[^\d\.]/g,"").split(".")[0]:t,i},this.getCPU=function(){var e={};return e[d]=t,B.call(e,f,h.cpu),e},this.getDevice=function(){var e={};return e[c]=t,e[s]=t,e[a]=t,B.call(e,f,h.device),e},this.getEngine=function(){var e={};return e[u]=t,e[l]=t,B.call(e,f,h.engine),e},this.getOS=function(){var e={};return e[u]=t,e[l]=t,B.call(e,f,h.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return f},this.setUA=function(e){return f=typeof e===o&&e.length>275?z(e,275):e,this},this.setUA(f),this};K.VERSION="0.7.31",K.BROWSER=M([u,l,"major"]),K.CPU=M([d]),K.DEVICE=M([s,c,a,p,f,v,h,g,b]),K.ENGINE=K.OS=M([u,l]),N.exports&&(U=N.exports=K),U.UAParser=K;var W=typeof e!==n&&(e.jQuery||e.Zepto);if(W&&!W.ua){var Z=new K;W.ua=Z.getResult(),W.ua.get=function(){return Z.getUA()},W.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var i in t)W.ua[i]=t[i]}}}("object"==typeof window?window:he);var ge=ve.exports,be=function(){function e(){this.ua=new ve.exports.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:we(),platform:"Web",os:ye(this.ua),deviceModel:me(this.ua)}},e}(),ye=function(e){var t,i;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(i=e.browser)||void 0===i?void 0:i.major].filter((function(e){return null!=e})).join(" ")},me=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},we=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ie=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}(),_e=function(){return _e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},_e.apply(this,arguments)},Se=function(e,t){var i=typeof e;if(i!==typeof t)return!1;for(var n=0,r=["string","number","boolean","undefined"];n<r.length;n++){if(r[n]===i)return e===t}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var o=Array.isArray(e),s=Array.isArray(t);if(o!==s)return!1;if(!o||!s){var u=Object.keys(e).sort(),a=Object.keys(t).sort();if(!Se(u,a))return!1;var c=!0;return Object.keys(e).forEach((function(i){Se(e[i],t[i])||(c=!1)})),c}for(var l=0;l<e.length;l++)if(!Se(e[l],t[l]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),i=t.length,n=new Array(i);i--;)n[i]=[t[i],e[t[i]]];return n});var Ee=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=_e({},this.identity.userProperties),i=_e(_e({},this.identity),{userProperties:t});return{setUserId:function(e){return i.userId=e,this},setDeviceId:function(e){return i.deviceId=e,this},setUserProperties:function(e){return i.userProperties=e,this},updateUserProperties:function(e){for(var t=i.userProperties||{},n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],s=o[0],u=o[1];switch(s){case"$set":for(var a=0,c=Object.entries(u);a<c.length;a++){var l=c[a],d=l[0],p=l[1];t[d]=p}break;case"$unset":for(var f=0,h=Object.keys(u);f<h.length;f++){delete t[d=h[f]]}break;case"$clearAll":t={}}}return i.userProperties=t,this},commit:function(){return e.setIdentity(i),this}}},e.prototype.getIdentity=function(){return _e({},this.identity)},e.prototype.setIdentity=function(e){var t=_e({},this.identity);this.identity=_e({},e),Se(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}(),ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Oe=function(){function e(){this.identityStore=new Ee,this.eventBridge=new Ie,this.applicationContextProvider=new be}return e.getInstance=function(t){return ke.analyticsConnectorInstances||(ke.analyticsConnectorInstances={}),ke.analyticsConnectorInstances[t]||(ke.analyticsConnectorInstances[t]=new e),ke.analyticsConnectorInstances[t]},e}(),Te=function(){return Oe.getInstance("$default_instance")},xe=function(){function e(){this.name="identity",this.type=h.BEFORE,this.identityStore=Te().identityStore}return e.prototype.execute=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return Promise.resolve(void 0)},e}(),Pe=function(){var e,t,i,n;if("undefined"==typeof navigator)return"";var r=navigator.userLanguage;return null!==(n=null!==(i=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==i?i:r)&&void 0!==n?n:""},Re=function(e,t){Ne(e,t)},Ne=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,u=e&&e[r];if("function"==typeof u){var a=u.apply(e,o);"function"==typeof s&&s(null==a?void 0:a.promise)}}return e},Ue=function(e){return e&&void 0!==e._q},qe=function(){function e(){var e;this.name="context",this.type=h.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("1.7.0-beta.0"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new ge(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,u;return o(this,(function(o){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),t=(new Date).getTime(),n=this.uaResult.browser.name,r=this.uaResult.browser.version,s=this.uaResult.device.model||this.uaResult.os.name,u=this.uaResult.device.vendor,[2,i(i(i(i(i(i(i(i(i(i(i(i({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.osName&&{os_name:n}),this.config.trackingOptions.osVersion&&{os_version:r}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),this.config.trackingOptions.deviceModel&&{device_model:s}),this.config.trackingOptions.language&&{language:Pe()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:oe(),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:this.eventId++,library:this.library})]}))}))},e.prototype.isSessionValid=function(){var e=this.config.lastEventTime||Date.now();return Date.now()-e<this.config.sessionTimeout},e}(),De=function(){function e(){}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!b())return[2,!1];t=String(Date.now()),i=new e,n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=i.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return i.sent(),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,(null===(t=b())||void 0===t?void 0:t.localStorage.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){return o(this,(function(n){try{null===(i=b())||void 0===i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return r(this,void 0,void 0,(function(){return o(this,(function(i){try{null===(t=b())||void 0===t||t.localStorage.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return r(this,void 0,void 0,(function(){return o(this,(function(t){try{null===(e=b())||void 0===e||e.localStorage.clear()}catch(e){}return[2]}))}))},e}(),Ce=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return t(i,e),i.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(n){return[2,new Promise((function(n,r){"undefined"==typeof XMLHttpRequest&&r(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===i.state.done)try{var e=o.responseText,t=JSON.parse(e),s=i.buildResponse(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},i}(ue),Ae=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(n){return[2,new Promise((function(n,r){var o=b();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?i.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(e){r(e)}}))]}))}))},i}(ue),je=function(){var e=new se;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:e,cookieUpgrade:!0,disableCookies:!1,domain:"",sessionManager:new pe(e,""),sessionTimeout:18e5,storageProvider:new se,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new fe}},Me=function(e){function n(t,n,r){var o,s,u,a,c,l,d,p,f,h,v,g,b,y=this,m=je();return(y=e.call(this,i(i({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30},r),{apiKey:t,storageProvider:null!==(o=null==r?void 0:r.storageProvider)&&void 0!==o?o:m.storageProvider,transportProvider:null!==(s=null==r?void 0:r.transportProvider)&&void 0!==s?s:m.transportProvider}))||this).cookieStorage=null!==(u=null==r?void 0:r.cookieStorage)&&void 0!==u?u:m.cookieStorage,y.sessionManager=null!==(a=null==r?void 0:r.sessionManager)&&void 0!==a?a:m.sessionManager,y.sessionTimeout=null!==(c=null==r?void 0:r.sessionTimeout)&&void 0!==c?c:m.sessionTimeout,y.appVersion=null==r?void 0:r.appVersion,y.attribution=null==r?void 0:r.attribution,y.cookieExpiration=null!==(l=null==r?void 0:r.cookieExpiration)&&void 0!==l?l:m.cookieExpiration,y.cookieSameSite=null!==(d=null==r?void 0:r.cookieSameSite)&&void 0!==d?d:m.cookieSameSite,y.cookieSecure=null!==(p=null==r?void 0:r.cookieSecure)&&void 0!==p?p:m.cookieSecure,y.cookieUpgrade=null!==(f=null==r?void 0:r.cookieUpgrade)&&void 0!==f?f:m.cookieUpgrade,y.deviceId=null==r?void 0:r.deviceId,y.disableCookies=null!==(h=null==r?void 0:r.disableCookies)&&void 0!==h?h:m.disableCookies,y.domain=null!==(v=null==r?void 0:r.domain)&&void 0!==v?v:m.domain,y.lastEventTime=null!==(g=y.lastEventTime)&&void 0!==g?g:null==r?void 0:r.lastEventTime,y.optOut=Boolean(null==r?void 0:r.optOut),y.partnerId=null==r?void 0:r.partnerId,y.sessionId=null==r?void 0:r.sessionId,y.trackingOptions=null!==(b=null==r?void 0:r.trackingOptions)&&void 0!==b?b:m.trackingOptions,y.userId=n,y}return t(n,e),Object.defineProperty(n.prototype,"deviceId",{get:function(){return this.sessionManager.getDeviceId()},set:function(e){this.sessionManager.setDeviceId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"userId",{get:function(){return this.sessionManager.getUserId()},set:function(e){this.sessionManager.setUserId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sessionId",{get:function(){return this.sessionManager.getSessionId()},set:function(e){this.sessionManager.setSessionId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"optOut",{get:function(){return this.sessionManager.getOptOut()},set:function(e){var t;null===(t=this.sessionManager)||void 0===t||t.setOptOut(Boolean(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastEventTime",{get:function(){return this.sessionManager.getLastEventTime()},set:function(e){this.sessionManager.setLastEventTime(e)},enumerable:!1,configurable:!0}),n}(G),Le=function(e,t,n){return r(void 0,void 0,void 0,(function(){var r,s,u,a,c,l,d,p,f,h,v,g,b,m,w,I,_;return o(this,(function(o){switch(o.label){case 0:return r=je(),null===(b=null==n?void 0:n.domain)||void 0===b?[3,1]:(u=b,[3,3]);case 1:return[4,$e()];case 2:u=o.sent(),o.label=3;case 3:return s=u,[4,Ve(i(i({},n),{domain:s}))];case 4:return a=o.sent(),c=ae(e),[4,a.get(c)];case 5:return l=o.sent(),d=y(),[4,new pe(a,e).load()];case 6:return p=o.sent(),f=Me.bind,h=[void 0,e,null!=t?t:null==l?void 0:l.userId],v=[i({},n)],g={cookieStorage:a,sessionManager:p,deviceId:Fe(null==l?void 0:l.deviceId,null==n?void 0:n.deviceId,d.deviceId),domain:s,optOut:null!==(m=null==n?void 0:n.optOut)&&void 0!==m?m:Boolean(null==l?void 0:l.optOut)},[4,a.get(c)];case 7:return g.sessionId=null!==(I=null===(w=o.sent())||void 0===w?void 0:w.sessionId)&&void 0!==I?I:null==n?void 0:n.sessionId,[4,Be(n)];case 8:return[2,new(f.apply(Me,h.concat([i.apply(void 0,v.concat([(g.storageProvider=o.sent(),g.trackingOptions=i(i({},r.trackingOptions),null==n?void 0:n.trackingOptions),g.transportProvider=null!==(_=null==n?void 0:n.transportProvider)&&void 0!==_?_:Qe(null==n?void 0:n.transport),g)]))])))]}}))}))},Ve=function(e,t){return void 0===t&&(t=je()),r(void 0,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return n=i(i({},t),e),r=null==e?void 0:e.cookieStorage,(s=!r)?[3,2]:[4,r.isEnabled()];case 1:s=!o.sent(),o.label=2;case 2:return s?[2,ze(n)]:[2,r]}}))}))},ze=function(e){return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(n){switch(n.label){case 0:return t=new de({domain:e.domain,expirationDays:e.cookieExpiration,sameSite:e.cookieSameSite,secure:e.cookieSecure}),(i=e.disableCookies)?[3,2]:[4,t.isEnabled()];case 1:i=!n.sent(),n.label=2;case 2:return i?[4,(t=new De).isEnabled()]:[3,4];case 3:n.sent()||(t=new se),n.label=4;case 4:return[2,t]}}))}))},Be=function(e){return r(void 0,void 0,void 0,(function(){var t,i,n,r,u,a,c;return o(this,(function(o){switch(o.label){case 0:if(e&&Object.prototype.hasOwnProperty.call(e,"storageProvider")&&!e.storageProvider)return[3,9];o.label=1;case 1:o.trys.push([1,7,8,9]),t=s([null==e?void 0:e.storageProvider,new De]),i=t.next(),o.label=2;case 2:return i.done?[3,6]:(n=i.value,(r=n)?[4,n.isEnabled()]:[3,4]);case 3:r=o.sent(),o.label=4;case 4:if(r)return[2,n];o.label=5;case 5:return i=t.next(),[3,2];case 6:return[3,9];case 7:return u=o.sent(),a={error:u},[3,9];case 8:try{i&&!i.done&&(c=t.return)&&c.call(t)}finally{if(a)throw a.error}return[7];case 9:return[2,void 0]}}))}))},Fe=function(e,t,i){return t||i||e||oe()},Qe=function(e){return e===g.XHR?new Ce:e===g.SendBeacon?new Ae:je().transportProvider},$e=function(e){return r(void 0,void 0,void 0,(function(){var t,i,n,r,s,u,a;return o(this,(function(o){switch(o.label){case 0:return[4,(new de).isEnabled()];case 1:if(!o.sent()||!e&&"undefined"==typeof location)return[2,""];for(t=null!=e?e:location.hostname,i=t.split("."),n=[],r="AMP_TLDTEST",s=i.length-2;s>=0;--s)n.push(i.slice(s).join("."));s=0,o.label=2;case 2:return s<n.length?(u=n[s],[4,(a=new de({domain:"."+u})).set(r,1)]):[3,7];case 3:return o.sent(),[4,a.get(r)];case 4:return o.sent()?[4,a.remove(r)]:[3,6];case 5:return o.sent(),[2,"."+u];case 6:return s++,[3,2];case 7:return[2,""]}}))}))},Ke=function(e,t){return r(void 0,void 0,void 0,(function(){var i,n,r,s,a,c,l,d,p,f;return o(this,(function(o){switch(o.label){case 0:return[4,(i=new de).isEnabled()];case 1:return o.sent()&&!(null==t?void 0:t.disableCookies)||(i=new De),[4,i.isEnabled()];case 2:return o.sent()?(n=function(e){return"".concat(D.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,i.getRaw(n)]):[2,{optOut:!1}];case 3:return(r=o.sent())?(null!==(f=null==t?void 0:t.cookieUpgrade)&&void 0!==f?f:je().cookieUpgrade)?[4,i.remove(n)]:[3,5]:[2,{optOut:!1}];case 4:o.sent(),o.label=5;case 5:return s=u(r.split("."),5),a=s[0],c=s[1],l=s[2],d=s[3],p=s[4],[2,{deviceId:a,userId:Ze(c),sessionId:We(d),lastEventTime:We(p),optOut:Boolean(l)}]}}))}))},We=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ze=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Ge=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.init=function(t,n,s){var u,a,c;return void 0===t&&(t=""),r(this,void 0,void 0,(function(){var r,l,d,p,f=this;return o(this,(function(o){switch(o.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,Ke(t,s)]);case 1:return r=o.sent(),[4,Le(t,n||r.userId,i(i({},s),{deviceId:null!==(u=r.deviceId)&&void 0!==u?u:null==s?void 0:s.deviceId,sessionId:null!==(a=r.sessionId)&&void 0!==a?a:null==s?void 0:s.sessionId,optOut:null!==(c=null==s?void 0:s.optOut)&&void 0!==c?c:r.optOut,lastEventTime:r.lastEventTime}))];case 2:return l=o.sent(),[4,e.prototype._init.call(this,l)];case 3:return o.sent(),d=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),d=!0),(p=Te()).eventBridge.setEventReceiver((function(e){f.track(e.eventType,e.eventProperties)})),p.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new qe)];case 4:return o.sent(),[4,this.add(new xe)];case 5:return o.sent(),[4,this.add(new Y)];case 6:return o.sent(),this.initializing=!1,[4,this.runAttributionStrategy(l.attribution,d)];case 7:return o.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return o.sent(),[2]}}))}))},n.prototype.runAttributionStrategy=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return n=this.track.bind(this),r=this.setSessionId.bind(this,Date.now()),[4,ze(this.config)];case 1:return s=o.sent(),[4,new ce(this.config.apiKey,i(i({},e),{storage:s,track:n,onNewCampaign:r})).send(t)];case 2:return o.sent(),[2]}}))}))},n.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},n.prototype.setUserId=function(e){this.config?this.config.userId=e:this.q.push(this.setUserId.bind(this,e))},n.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},n.prototype.setDeviceId=function(e){this.config?this.config.deviceId=e:this.q.push(this.setDeviceId.bind(this,e))},n.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(oe())},n.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},n.prototype.setSessionId=function(e){this.config?(this.config.sessionId=e,this.config.lastEventTime=void 0):this.q.push(this.setSessionId.bind(this,e))},n.prototype.setTransport=function(e){this.config?this.config.transportProvider=Qe(e):this.q.push(this.setTransport.bind(this,e))},n.prototype.identify=function(t,i){if(Ue(t)){var n=t._q;t._q=[],t=Ne(new L,n)}return(null==i?void 0:i.user_id)&&this.setUserId(i.user_id),(null==i?void 0:i.device_id)&&this.setDeviceId(i.device_id),e.prototype.identify.call(this,t,i)},n.prototype.groupIdentify=function(t,i,n,r){if(Ue(n)){var o=n._q;n._q=[],n=Ne(new L,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},n.prototype.revenue=function(t,i){if(Ue(t)){var n=t._q;t._q=[],t=Ne(new $,n)}return e.prototype.revenue.call(this,t,i)},n}(Q),Je=function(){var e=new Ge;return{init:re(X(e.init.bind(e)),"init",te(e),ne(e,["config"])),add:re(X(e.add.bind(e)),"add",te(e),ne(e,["config.apiKey","timeline.plugins"])),remove:re(X(e.remove.bind(e)),"remove",te(e),ne(e,["config.apiKey","timeline.plugins"])),track:re(X(e.track.bind(e)),"track",te(e),ne(e,["config.apiKey","timeline.queue.length"])),logEvent:re(X(e.logEvent.bind(e)),"logEvent",te(e),ne(e,["config.apiKey","timeline.queue.length"])),identify:re(X(e.identify.bind(e)),"identify",te(e),ne(e,["config.apiKey","timeline.queue.length"])),groupIdentify:re(X(e.groupIdentify.bind(e)),"groupIdentify",te(e),ne(e,["config.apiKey","timeline.queue.length"])),setGroup:re(X(e.setGroup.bind(e)),"setGroup",te(e),ne(e,["config.apiKey","timeline.queue.length"])),revenue:re(X(e.revenue.bind(e)),"revenue",te(e),ne(e,["config.apiKey","timeline.queue.length"])),flush:re(X(e.flush.bind(e)),"flush",te(e),ne(e,["config.apiKey","timeline.queue.length"])),getUserId:re(e.getUserId.bind(e),"getUserId",te(e),ne(e,["config","config.userId"])),setUserId:re(e.setUserId.bind(e),"setUserId",te(e),ne(e,["config","config.userId"])),getDeviceId:re(e.getDeviceId.bind(e),"getDeviceId",te(e),ne(e,["config","config.deviceId"])),setDeviceId:re(e.setDeviceId.bind(e),"setDeviceId",te(e),ne(e,["config","config.deviceId"])),reset:re(e.reset.bind(e),"reset",te(e),ne(e,["config","config.userId","config.deviceId"])),getSessionId:re(e.getSessionId.bind(e),"getSessionId",te(e),ne(e,["config"])),setSessionId:re(e.setSessionId.bind(e),"setSessionId",te(e),ne(e,["config"])),setOptOut:re(e.setOptOut.bind(e),"setOptOut",te(e),ne(e,["config"])),setTransport:re(e.setTransport.bind(e),"setTransport",te(e),ne(e,["config"]))}},He=Je(),Ye=He.add,Xe=He.flush,et=He.getDeviceId,tt=He.getSessionId,it=He.getUserId,nt=He.groupIdentify,rt=He.identify,ot=He.init,st=He.logEvent,ut=He.remove,at=He.reset,ct=He.revenue,lt=He.setDeviceId,dt=He.setGroup,pt=He.setOptOut,ft=He.setSessionId,ht=He.setTransport,vt=He.setUserId,gt=He.track,bt=Object.freeze({__proto__:null,add:Ye,flush:Xe,getDeviceId:et,getSessionId:tt,getUserId:it,groupIdentify:nt,identify:rt,init:ot,logEvent:st,remove:ut,reset:at,revenue:ct,setDeviceId:lt,setGroup:dt,setOptOut:pt,setSessionId:ft,setTransport:ht,setUserId:vt,track:gt,Types:q,createInstance:Je,runQueuedFunctions:Re,Revenue:$,Identify:L});!function(){var e=b();if(e){if(e.amplitude=Object.assign(e.amplitude||{},bt),e.amplitude.invoked){var t=e.amplitude._q;e.amplitude._q=[],Re(bt,t);for(var i=0;i<e.amplitude._iq.length;i++){var n=Object.assign(e.amplitude._iq[i],Je()),r=n._q;n._q=[],Re(n,r)}}}else console.error("[Amplitude] Error: GlobalScope is not defined")}()}();
|
|
Binary file
|