1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cf7e7522-5ac1-41c2-a3b8-e2c7438c85a0",e._sentryDebugIdIdentifier="sentry-dbid-cf7e7522-5ac1-41c2-a3b8-e2c7438c85a0")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9778],{35062:function(e,t,n){n.d(t,{S1:function(){return ra},Iv:function(){return rs},j:function(){return ru}});var r,i,o,a,s,u,c,l,d,f,h,p,v,g,m,y,b,_=n(76684);(r=d||(d={}))[r.None=0]="None",r[r.Error=1]="Error",r[r.Warn=2]="Warn",r[r.Verbose=3]="Verbose",r[r.Debug=4]="Debug";var w=function(e){return function(){var t=(0,_.__assign)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},E=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=(0,_.__values)(t.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(!(a in e))return;e=e[a]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},x=function(e,t){return function(){var n,r,i={};try{for(var o=(0,_.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=E(e,s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},S=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=n(),u=s.logger,c=s.logLevel;if(c&&c<d.Debug||!c||!u)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:(Error().stack||"").split("\n").slice(3).map(function(e){return e.trim()}),time:{start:new Date().toISOString()},states:{}};r&&l.states&&(l.states.before=r());var f=e.apply(i,o);return f&&f.promise?f.promise.then(function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),u.debug(JSON.stringify(l,null,2))}):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),u.debug(JSON.stringify(l,null,2))),f}},I=function(e){return{promise:e||Promise.resolve()}};(i=f||(f={})).Unknown="unknown",i.Skipped="skipped",i.Success="success",i.RateLimit="rate_limit",i.PayloadTooLarge="payload_too_large",i.Invalid="invalid",i.Failed="failed",i.Timeout="Timeout",i.SystemError="SystemError";var k="".concat("AMP","_unsent"),T="https://api2.amplitude.com/2/httpapi",P=function(e,t){var n=Math.max(t,1);return e.reduce(function(e,t,r){var i=Math.floor(r/n);return e[i]||(e[i]=[]),e[i].push(t),e},[])},A=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=f.Unknown),{event:e,code:t,message:n}},C="Amplitude Logger ",N=function(){function e(){this.logLevel=d.None}return e.prototype.disable=function(){this.logLevel=d.None},e.prototype.enable=function(e){void 0===e&&(e=d.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<d.Verbose||console.log("".concat(C,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<d.Warn||console.warn("".concat(C,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<d.Error||console.error("".concat(C,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<d.Debug||console.log("".concat(C,"[Debug]: ").concat(e.join(" ")))},e}(),O=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:d.Warn,loggerProvider:new N,offline:!1,optOut:!1,serverUrl:T,serverZone:"US",useBatch:!1}},R=function(){function e(e){this._optOut=!1;var t,n,r,i,o=O();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(r=e.optOut)&&void 0!==r?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=L(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
1,enumerable:!1,configurable:!0}),e}(),L=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=O().serverZone),void 0===n&&(n=O().useBatch),e)return{serverUrl:e,serverZone:void 0};var r,i=["US","EU"].includes(t)?t:O().serverZone;return{serverZone:i,serverUrl:(r=n,"EU"===i?r?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":r?"https://api2.amplitude.com/batch":T)}},D=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}(),U=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,U)};function M(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var q=function(){function e(){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return e.prototype.setup=function(e){var t;return(0,_.__awaiter)(this,void 0,void 0,function(){var n,r=this;return(0,_.__generator)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(k,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map(function(e){return r.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=U()),new Promise(function(n){t.addToQueue({event:e,attempts:0,callback:function(e){return n(e)},timeout:0})})},e.prototype.getTryableList=function(e){var t=this;return e.filter(function(e){return e.attempts<t.config.flushMaxRetries?(e.attempts+=1,!0):(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleTryable=function(e,t){var n=this;void 0===t&&(t=!1),e.forEach(function(e){if(t&&(n.queue=n.queue.concat(e)),0===e.timeout){n.schedule(n.config.flushIntervalMillis);return}setTimeout(function(){e.timeout=0,n.schedule(0)},e.timeout)})},e.prototype.addToQueue=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.getTryableList(e);this.scheduleTryable(n,!0),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||this.config.offline||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,_.__awaiter)(this,void 0,void 0,function(){var t,n,r=this;return(0,_.__generator)(this,function(i){switch(i.label){case 0:if(this.config.offline)return this.config.loggerProvider.debug("Skipping flush while offline."),[2];return t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,P(t,this.config.flushQueueSize).reduce(function(t,n){return(0,_.__awaiter)(r,void 0,void 0,function(){return(0,_.__generator)(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())];case 1:return i.sent(),this.scheduleTryable(n),[2]}})})},e.prototype.send=function(e,t){return void 0===t&&(t=!0),(0,_.__awaiter)(this,void 0,void 0,function(){var n,r,i,o;return(0,_.__generator)(this,function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,(0,_.__rest)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new D,a.label=1;case 1:return a.trys.push([1,3,,4]),r=L(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,n)];case 2:if(null===(i=a.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in i?this.fulfillRequest(e,i.statusCode,"".concat(i.status,": ").concat(M(i))):this.fulfillRequest(e,i.statusCode,i.status),[2];return this.handleResponse(i,e),[3,4];case 3:var s;return o=(s=a.sent())instanceof Error?s.message:String(s),this.config.loggerProvider.error(o),this.handleResponse({status:f.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){var n=e.status;switch(n){case f.Success:this.handleSuccessResponse(e,t);break;case f.Invalid:this.handleInvalidResponse(e,t);break;case f.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case f.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key")){this.fulfillRequest(t,e.statusCode,e.body.error);return}var r=new Set((0,_.__spreadArray)((0,_.__spreadArray)((0,_.__spreadArray)((0,_.__spreadArray)([],(0,_.__read)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,_.__read)(Object.values(e.body.eventsWithMissingFields)),!1),(0,_.__read)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,_.__read)(e.body.silencedEvents),!1).flat()),i=t.filter(function(t,i){if(r.has(i)){n.fulfillRequest([t],e.statusCode,e.body.error);return}return!0});i.length>0&&this.config.loggerProvider.warn(M(e));var o=this.getTryableList(i);this.scheduleTryable(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length){this.fulfillRequest(t,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(M(e)),this.config.flushQueueSize/=2;var n=this.getTryableList(t);this.scheduleTryable(n)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,a=new Set(r),s=new Set(i),u=new Set(o),c=t.filter(function(t,r){if(t.event.user_id&&a.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)){n.fulfillRequest([t],e.statusCode,e.body.error);return}return u.has(r)&&(t.timeout=n.throttleTimeout),!0});c.length>0&&this.config.loggerProvider.warn(M(e));var l=this.getTryableList(c);this.scheduleTryable(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.getTryableList(n);this.scheduleTryable(r)},e.prototype.fulfillRequest=function(e,t,n){this.removeEvents(e),e.forEach(function(e){return e.callback(A(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.s
1ome(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}();(o=h||(h={})).SET="$set",o.SET_ONCE="$setOnce",o.ADD="$add",o.APPEND="$append",o.PREPEND="$prepend",o.REMOVE="$remove",o.PREINSERT="$preInsert",o.POSTINSERT="$postInsert",o.UNSET="$unset",o.CLEAR_ALL="$clearAll",(a=p||(p={})).REVENUE_PRODUCT_ID="$productId",a.REVENUE_QUANTITY="$quantity",a.REVENUE_PRICE="$price",a.REVENUE_TYPE="$revenueType",a.REVENUE="$revenue",(s=v||(v={})).IDENTIFY="$identify",s.GROUP_IDENTIFY="$groupidentify",s.REVENUE="revenue_amount";var j=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!F(t,n))return!1}return!0},F=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,_.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if("object"==typeof s)i=i&&j(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else if(null==t)return!1;else if("object"==typeof t)return j(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},z=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,_.__assign)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(h.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(h.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(h.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(h.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(h.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(h.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(h.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(h.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(h.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[h.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return!(void 0!==this._properties[h.CLEAR_ALL]||this._propertySet.has(t))&&(e===h.ADD?"number"==typeof n:e===h.UNSET||e===h.REMOVE||F(t,n))},e}(),B=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?(0,_.__assign)({},this.properties):{};return e[p.REVENUE_PRODUCT_ID]=this.productId,e[p.REVENUE_QUANTITY]=this.quantity,e[p.REVENUE_PRICE]=this.price,e[p.REVENUE_TYPE]=this.revenueType,e[p.REVENUE]=this.revenue,e},e}(),V=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var n,r;return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(i){switch(i.label){case 0:if(this.plugins.some(function(t){return t.name===e.name}))return t.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=U(),t.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(n=e.type)&&void 0!==n?n:"enrichment",[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)];case 1:return i.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var n;return(0,_.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,_.__generator)(this,function(o){switch(o.label){case 0:if(-1===(r=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return i=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=i.teardown)||void 0===n?void 0:n.call(i)];case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this.applying=!1,this.plugins.map(function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)}),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,a,s,u,c,l,d,f,h,p;return(0,_.__generator)(this,function(v){switch(v.label){case 0:if(!e)return[2];t=(0,_.__read)(e,1)[0],n=(0,_.__read)(e,2)[1],r=this.plugins.filter(function(e){return"before"===e.type}),v.label=1;case 1:v.trys.push([1,6,7,8]),o=(i=(0,_.__values)(r)).next(),v.label=2;case 2:if(o.done)return[3,5];if(!(a=o.value).execute)return[3,4];return[4,a.execute((0,_.__assign)({},t))];case 3:if(null===(s=v.sent()))return n({event:t,code:0,message:""}),[2];t=s,v.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return d={error:v.sent()},[3,8];case 7:try{o&&!o.done&&(f=i.return)&&f.call(i)}finally{if(d)throw d.error}
1return[7];case 8:u=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),v.label=9;case 9:v.trys.push([9,14,15,16]),l=(c=(0,_.__values)(u)).next(),v.label=10;case 10:if(l.done)return[3,13];if(!(a=l.value).execute)return[3,12];return[4,a.execute((0,_.__assign)({},t))];case 11:if(null===(s=v.sent()))return n({event:t,code:0,message:""}),[2];t=s,v.label=12;case 12:return l=c.next(),[3,10];case 13:return[3,16];case 14:return h={error:v.sent()},[3,16];case 15:try{l&&!l.done&&(p=c.return)&&p.call(c)}finally{if(h)throw h.error}return[7];case 16:return Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){var n=(0,_.__assign)({},t);return e.execute(n).catch(function(e){return A(n,0,String(e))})})).then(function(e){var r=(0,_.__read)(e,1)[0]||A(t,100,"Event not tracked, no destination plugins on the instance");n(r)}),[2]}})})},e.prototype.flush=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,_.__generator)(this,function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return n.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return n.sent(),[2]}})})},e}(),K=function(e,t){return(0,_.__assign)((0,_.__assign)({},t),{event_type:v.IDENTIFY,user_properties:e.getUserProperties()})},Y=function(e,t,n,r){var i;return(0,_.__assign)((0,_.__assign)({},r),{event_type:v.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:((i={})[e]=t,i)})},H=function(e,t,n){var r,i=new z;return i.set(e,t),(0,_.__assign)((0,_.__assign)({},n),{event_type:v.IDENTIFY,user_properties:i.getUserProperties(),groups:((r={})[e]=t,r)})},$=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new V(this),this.name=e}return e.prototype._init=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,a;return(0,_.__generator)(this,function(s){switch(s.label){case 0:t=this[e],this[e]=[],s.label=1;case 1:s.trys.push([1,8,9,10]),r=(n=(0,_.__values)(t)).next(),s.label=2;case 2:if(r.done)return[3,7];if(!((i=(0,r.value)())&&"promise"in i))return[3,4];return[4,i.promise];case 3:return s.sent(),[3,6];case 4:return[4,i];case 5:s.sent(),s.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return o={error:s.sent()},[3,10];case 9:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:s.sent(),s.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,n){var r=(0,_.__assign)((0,_.__assign)((0,_.__assign)({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t});return I(this.dispatch(r))},e.prototype.identify=function(e,t){var n=K(e,t);return I(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=Y(e,t,n,r);return I(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=H(e,t,n);return I(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=(0,_.__assign)((0,_.__assign)({},t),{event_type:v.REVENUE,event_properties:e.getEventProperties()});return I(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),I())},e.prototype._addPlugin=function(e){return I(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),I())},e.prototype._removePlugin=function(e){return I(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(A(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,_.__generator)(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.process=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,_.__generator)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),this.config.optOut)return[2,A(e,0,"Event skipped due to optOut config")];return[4,this.timeline.push(e)];case 1:return 200===(t=r.sent()).code?this.config.loggerProvider.log(t.message):100===t.code?this.config.loggerProvider.warn(t.message):this.config.loggerProvider.error(t.message),[2,t];case 2:return n=String(r.sent()),this.config.loggerProvider.error(n),[2,t=A(e,0,n)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!e));return}this._setOptOut(e)},e.prototype._setOptOut=function(e){this.config.optOut=!!e},e.prototype.flush=function(){return I(this.timeline.flush())},e}(),W=function(e,t){return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1},J=function(e){return W(e,"attribution")},Q=function(e){return W(e,"pageViews")},Z=function(e){return W(e,"sessions")},G=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},X=function(e){if(G(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},ee=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return Q(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},et="dclid",en="fbclid",er="gbraid",ei="gclid",eo="ko_click_id",ea="li_fat_id",es="msclkid",eu="rtd_cid",ec="ttclid",el="twclid",ed="wbraid",ef={utm_campaign:void 0,utm_c
1ontent:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},eh=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},ep=function(e,t,n,r,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,a=(0,_.__rest)(e,["referrer","referring_domain"]),s=t||{},u=(s.referrer,s.referring_domain),c=(0,_.__rest)(s,["referrer","referring_domain"]);if(ev(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Object.values(e).every(function(e){return!e})&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var l=JSON.stringify(a)!==JSON.stringify(c),d=eh(o||"")!==eh(u||""),f=!t||l||d;return f?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),f},ev=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},eg=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},em=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0},ey=function(){var e,t=em();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=eb(n[0]),i=eb(n[1]);return i&&(e[r]=i),e},{}):{}},eb=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},e_=function(){function e(){}return e.prototype.parse=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(e){return[2,(0,_.__assign)((0,_.__assign)((0,_.__assign)((0,_.__assign)({},ef),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=ey();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=ey();return(e={})[et]=t[et],e[en]=t[en],e[er]=t[er],e[ei]=t[ei],e[eo]=t[eo],e[ea]=t[ea],e[es]=t[es],e[eu]=t[eu],e[ec]=t[ec],e[el]=t[el],e[ed]=t[ed],e},e}(),ew=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},eE=function(){function e(e,t){var n,r,i;this.shouldTrackNewCampaign=!1,this.options=(0,_.__assign)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:eg(null===(n=t.cookieOptions)||void 0===n?void 0:n.domain)},e),this.storage=t.cookieStorage,this.storageKey=(r=t.apiKey,void 0===i&&(i=10),["AMP","MKTG",r.substring(0,i)].filter(Boolean).join("_")),this.currentCampaign=ef,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,_.__generator)(this,function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:if(t=_.__read.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||ew(this.sessionTimeout,this.lastEventTime),!ep(this.currentCampaign,this.previousCampaign,this.options,this.logger,e))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(e){switch(e.label){case 0:return[4,Promise.all([new e_().parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r=(t=this.currentCampaign,n=this.options,K(Object.entries((0,_.__assign)((0,_.__assign)({},ef),t)).reduce(function(e,t){var r,i=(0,_.__read)(t,2),o=i[0],a=i[1];return(e.setOnce("initial_".concat(o),null!==(r=null!=a?a:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),a)?e.set(o,a):e.unset(o)},new z)));return e&&(r.event_id=e),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),ex=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:eS(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),eS=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},eI=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}(),ek=function(){return(ek=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function eT(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);
vendor: 7,231 bytes, line 1
1if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function eP(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var eA=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=eT(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next())if(a.value===i)return e===t}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var s=Array.isArray(e),u=Array.isArray(t);if(s!==u)return!1;if(s&&u){for(var c=0;c<e.length;c++)if(!eA(e[c],t[c]))return!1}else{if(!eA(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var l=!0;return Object.keys(e).forEach(function(n){eA(e[n],t[n])||(l=!1)}),l}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var eC=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=ek({},this.identity.userProperties),n=ek(ek({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,a,s,u=n.userProperties||{};try{for(var c=eT(Object.entries(e)),l=c.next();!l.done;l=c.next()){var d=eP(l.value,2),f=d[0],h=d[1];switch(f){case"$set":try{for(var p=(i=void 0,eT(Object.entries(h))),v=p.next();!v.done;v=p.next()){var g=eP(v.value,2),m=g[0],y=g[1];u[m]=y}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,eT(Object.keys(h))),_=b.next();!_.done;_=b.next()){var m=_.value;delete u[m]}}catch(e){a={error:e}}finally{try{_&&!_.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return n.userProperties=u,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return ek({},this.identity)},e.prototype.setIdentity=function(e){var t=ek({},this.identity);this.identity=ek({},e),eA(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}(),eN="undefined"!=typeof globalThis?globalThis:void 0!==n.g?n.g:self,eO=function(){function e(){this.identityStore=new eC,this.eventBridge=new eI,this.applicationContextProvider=new ex}return e.getInstance=function(t){return eN.analyticsConnectorInstances||(eN.analyticsConnectorInstances={}),eN.analyticsConnectorInstances[t]||(eN.analyticsConnectorInstances[t]=new e),eN.analyticsConnectorInstances[t]},e}(),eR=function(e){return void 0===e&&(e="$default_instance"),eO.getInstance(e)},eL=function(e,t){eR(t).identityStore.editIdentity().setUserId(e).commit()},eD=function(e,t){eR(t).identityStore.editIdentity().setDeviceId(e).commit()},eU=function(){function e(){this.name="identity",this.type="before",this.identityStore=eR().identityStore}return e.prototype.execute=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){var t;return(0,_.__generator)(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(t){return e.instanceName&&(this.identityStore=eR(e.instanceName).identityStore),[2]})})},e}(),eM=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,a=r.resolve,s=e&&e[i];if("function"==typeof s){var u=s.apply(e,o);"function"==typeof a&&a(null==u?void 0:u.promise)}}return e},eq=function(e){return e&&void 0!==e._q},ej=function(){if("undefined"==typeof navigator)return"";var e,t,n,r,i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},eF=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat("amplitude-ts","/").concat("2.11.11"),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return(0,_.__awaiter)(this,void 0,void 0,function(){var r,i,o;return(0,_.__generator)(this,function(a){return r=new Date().getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,o=null!==(n=e.event_id)&&void 0!==n?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,(0,_.__assign)((0,_.__assign)((0,_.__assign)((0,_.__assign)((0,_.__assign)((0,_.__assign)((0,_.__assign)((0,_.__assign)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:ej()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:U(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]})})},e}(),ez=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){var t;return(0,_.__generator)(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),eB=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(
1Boolean).join("_")},eV=function(){function e(e){this.options=(0,_.__assign)({},e)}return e.prototype.isEnabled=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,_.__generator)(this,function(r){switch(r.label){case 0:if(!em())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return r.sent(),[4,t.get(n)];case 3:return[2,r.sent()===e.testValue];case 4:return r.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){var t;return(0,_.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,_.__generator)(this,function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(n=i.sent()))return[2,void 0];try{if(r=null!==(t=eK(n))&&void 0!==t?t:eY(n),void 0===r)return console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0];return[2,JSON.parse(r)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]}return[2]}})})},e.prototype.getRaw=function(e){var t,n;return(0,_.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,_.__generator)(this,function(o){return(i=(null!==(n=null===(t=null==(r=em())?void 0:r.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).find(function(t){return 0===t.indexOf(e+"=")}))?[2,i.substring(e.length+1)]:[2,void 0]})})},e.prototype.set=function(e,t){var n;return(0,_.__awaiter)(this,void 0,void 0,function(){var r,i,o,a,s,u,c;return(0,_.__generator)(this,function(l){try{r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,i=null!==t?r:-1,o=void 0,i&&((a=new Date).setTime(a.getTime()+864e5*i),o=a),s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite)),(u=em())&&(u.document.cookie=s)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]})})},e.prototype.remove=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(e){return[2]})})},e}(),eK=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},eY=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},eH=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,n,r,i,o,a,s,u,c,l,d,h,p,v,g,m,y,b,_,w,E,x,S=e.code||0,I=this.buildStatus(S);switch(I){case f.Success:return{status:I,statusCode:S,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case f.Invalid:return{status:I,statusCode:S,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(a=e.events_with_invalid_fields)&&void 0!==a?a:{},eventsWithMissingFields:null!==(s=e.events_with_missing_fields)&&void 0!==s?s:{},eventsWithInvalidIdLengths:null!==(u=e.events_with_invalid_id_lengths)&&void 0!==u?u:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(h=e.silenced_events)&&void 0!==h?h:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(v=e.throttled_events)&&void 0!==v?v:[]}};case f.PayloadTooLarge:return{status:I,statusCode:S,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case f.RateLimit:return{status:I,statusCode:S,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(b=e.throttled_devices)&&void 0!==b?b:{},throttledUsers:null!==(_=e.throttled_users)&&void 0!==_?_:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(E=e.exceeded_daily_quota_users)&&void 0!==E?E:{},throttledEvents:null!==(x=e.throttled_events)&&void 0!==x?x:[]}};case f.Timeout:default:return{status:I,statusCode:S}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?f.Success:429===e?f.RateLimit:413===e?f.PayloadTooLarge:408===e?f.Timeout:e>
1=400&&e<500?f.Invalid:e>=500?f.Failed:f.Unknown},e}(),e$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,_.__extends)(t,e),t.prototype.send=function(e,t){return(0,_.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,_.__generator)(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw Error("FetchTransport is not supported");return[4,fetch(e,{headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"})];case 1:return[4,(n=i.sent()).text()];case 2:r=i.sent();try{return[2,this.buildResponse(JSON.parse(r))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(eH),eW=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){var t,n,r;return(0,_.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,_.__awaiter)(this,void 0,void 0,function(){var t;return(0,_.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,_.__awaiter)(this,void 0,void 0,function(){return(0,_.__generator)(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]})})},e}(),eJ=function(e){function t(t){var n,r=this;return(r=e.call(this,null===(n=em())||void 0===n?void 0:n.localStorage)||this).loggerProvider=null==t?void 0:t.loggerProvider,r}return(0,_.__extends)(t,e),t.prototype.set=function(t,n){var r;return(0,_.__awaiter)(this,void 0,void 0,function(){var i;return(0,_.__generator)(this,function(o){switch(o.label){case 0:if(!(Array.isArray(n)&&n.length>1e3))return[3,2];return i=n.length-1e3,[4,e.prototype.set.call(this,t,n.slice(0,1e3))];case 1:return o.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(eW),eQ=function(e){function t(){var t;return e.call(this,null===(t=em())||void 0===t?void 0:t.sessionStorage)||this}return(0,_.__extends)(t,e),t}(eW),eZ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return(0,_.__extends)(t,e),t.prototype.send=function(e,t){return(0,_.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,_.__generator)(this,function(r){return[2,new Promise(function(r,i){"undefined"==typeof XMLHttpRequest&&i(Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done){var e=o.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))})]})})},t}(eH),eG=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,_.__extends)(t,e),t.prototype.send=function(e,t){return(0,_.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,_.__generator)(this,function(r){return[2,new Promise(function(r,i){var o=em();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var a=JSON.stringify(t);if(o.navigator.sendBeacon(e,JSON.stringify(t)))return r(n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:a.length,server_upload_time:Date.now()}));return r(n.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(eH),eX=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},e0=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},e1="[Amplitude]",e2="".concat(e1," Form Started"),e4="".concat(e1," Form Submitted"),e3="".concat(e1," File Downloaded"),e5="session_start",e7="session_end",e6="".concat(e1," File Extension"),e8="".concat(e1," File Name"),e9="".concat(e1," Link ID"),te="".concat(e1," Link Text"),tt="".concat(e1," Link URL"),tn="".concat(e1," Form ID"),tr="".concat(e1," Form Name"),ti="".concat(e1," Form Destination"),to="cookie",ta=function(e){function t(t,n,r,i,o,a,s,u,c,l,f,h,p,v,g,m,y,b,_,w,E,x,S,I,k,T,P,A,C,O,R,L,D,U){void 0===r&&(r=new ez),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===u&&(u=1e3),void 0===c&&(c=5),void 0===l&&(l=30),void 0===f&&(f=to),void 0===m&&(m=new N),void 0===y&&(y=d.Warn),void 0===_&&(_=!1),void 0===w&&(w=!1),void 0===S&&(S=""),void 0===I&&(I="US"),void 0===T&&(T=18e5),void 0===P&&(P=new eJ({loggerProvider:m})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===C&&(C="fetch"),void 0===O&&(O=!1),void 0===R&&(R=!1);var M=e.call(this,{apiKey:t,storageProvider:P,transportProvider:tu(C)})||this;return M.apiKey=t,M.appVersion=n,M.cookieOptions=i,M.defaultTracking=o,M.autocapture=a,M.flushIntervalMillis=u,M.flushMaxRetries=c,M.flushQueueSize=l,M.identityStorage=f,M.ingestionMetadata=h,M.instanceName=p,M.loggerProvider=m,M.logLevel=y,M.minIdLength=b,M.offline=_,M.partnerId=E,M.plan=x,M.serverUrl=S,M.serverZone=I,M.sessionTimeout=T,M.storageProvider=P,M.trackingOptions=A,M.transport=C,M.useBatch=O,M.fetchRemoteConfig=R,M._optOut=!1,M._cookieStorage=r,M.deviceId=s,M.lastEventId=v,M.lastEventTime=g,M.optOut=w,M.sessionId=k,M.pageCounter=D,M.userId=L,M.debugLogsEnabled=U,M.loggerProvider.enable(U?d.Debug:M.logLevel),M}return(0,_.__extends)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(eB(this.apiKey),e)},t}(R),ts=function(e,t){switch(void 0===e&&(e=to),void 0===t&&(t={}),e){case"localStorage":return new eJ;case"sessionStorage":return new eQ;case"none":return new ez;default:return new eV((0,_.__assign)((0,_.__assign)({},t),{expirationDays:t.expiration}))}},tu=function(e){return"xhr"===e?new eZ:"beacon"===e?new eG:new e$},tc=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},tl=function(e){void 0===e&&(e={});var t,n,r,i=em(),o=void 0,a=e.trackOn,s=e.trackHistoryChanges,u=e.eventType,c=void 0===u?"[Amplitude] Page Viewed":u,l=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==o||o.error("Malformed URI sequence: ",e)}return t},d=function(){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var e,t,n;return(0,_.__generator)(this,function(r){switch(r.label){case 0:return e=l("undefined"!=typeof location&&location.href||""),n={event_type:c},t=[{}],[4,td()];case 1:return[2,(n.event_properties=_.__assign.apply(void 0,[_.__assign.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&l(location.pathname)||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":e.split("?")[0]}]),n)]}})})},f=function(){return void 0===a||"function"==typeof a&&a()},h="undefined"!=typeof location?location.href:null,p=function(){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var e,n,r,i;return(0,_.__generator)(this,function(a){switch(a.label){case 0:if(n=th(s,e=location.href,h||"")&&f(),h=e,!n)return[3,4];if(null==o||o.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return i=(r=t).track,[4,d()];case 2:i.apply(r,[a.sent()]),a.label=3;case 3:a.label=4;case 4:return[2]}})})},v=function(){p()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,a){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var s,u;return(0,_.__generator)(this,function(c){switch(c.label){case 0:if(t=a,r=e,(o=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),i&&(i.addEventListener("popstate",v),n=i.history.pushState,i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,n){var r=(0,_.__read)(n,3),i=r[0],o=r[1],a=r[2];e.apply(t,[i,o,a]),p()}})),!f())return[3,2];return o.log("Tracking page view event"),u=(s=t).track,[4,d()];case 1:u.apply(s,[c.sent()]),c.label=2;case 2:return[2]}})})},execute:function(e){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var t;return(0,_.__generator)(this,function(n){switch(n.label){case 0:if(!("attribution"===a&&tf(e)))return[3,2];
1return null==o||o.log("Enriching campaign event to page view event with campaign parameters"),[4,d()];case 1:t=n.sent(),e.event_type=t.event_type,e.event_properties=(0,_.__assign)((0,_.__assign)({},e.event_properties),t.event_properties),n.label=2;case 2:return r&&e.event_type===c&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=(0,_.__assign)((0,_.__assign)({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}})})},teardown:function(){return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(e){return i&&(i.removeEventListener("popstate",v),n&&(i.history.pushState=n)),[2]})})}}},td=function(){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,_.__generator)(this,function(t){switch(t.label){case 0:return e=tc,[4,new e_().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},tf=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[h.SET]||{},r=t[h.UNSET]||{},i=(0,_.__spreadArray)((0,_.__spreadArray)([],(0,_.__read)(Object.keys(n)),!1),(0,_.__read)(Object.keys(r)),!1);return Object.keys(ef).every(function(e){return i.includes(e)})}return!1},th=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},tp=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,r){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var i;return(0,_.__generator)(this,function(o){return null===(i=em())||void 0===i||i.addEventListener("load",function(){if(!r){t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if("undefined"!=typeof document){var i=function(e){var t=!1;n(e,"change",function(){var n;t||r.track(e2,((n={})[tn]=tv(e.id),n[tr]=tv(e.name),n[ti]=e.action,n)),t=!0}),n(e,"submit",function(){var n,i;t||r.track(e2,((n={})[tn]=tv(e.id),n[tr]=tv(e.name),n[ti]=e.action,n)),r.track(e4,((i={})[tn]=tv(e.id),i[tr]=tv(e.name),i[ti]=e.action,i)),t=!1})};Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}}),[2]})})},execute:function(e){return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},tv=function(e){if("string"==typeof e)return e},tg=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,r){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var i;return(0,_.__generator)(this,function(o){return null===(i=em())||void 0===i||i.addEventListener("load",function(){if(!r){t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if("undefined"!=typeof document){var i=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,i=o.exec(t.href),a=null==i?void 0:i[1];a&&n(e,"click",function(){var n;a&&r.track(e3,((n={})[e6]=a,n[e8]=t.pathname,n[e9]=e.id,n[te]=e.text,n[tt]=e.href,n))})},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;
1Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}}),[2]})})},execute:function(e){return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},tm=!1,ty=function(e){tm||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),tm=!0)},tb=function(){var e=em(),t=[],n=function(n,r){e&&(e.addEventListener(n,r),t.push({type:n,handler:r}))},r=function(){t.forEach(function(t){var n=t.type,r=t.handler;e&&e.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(e.offline=!navigator.onLine,n("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),n("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(e){return r(),[2]})})}}};(u=g||(g={})).US="US",u.EU="EU";var t_="Remote config fetch rejected due to timeout after 5 seconds",tw="Unexpected error occurred",tE=function(){function e(e){var t=e.localConfig,n=e.configKeys,r=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(e,t,n){return(0,_.__awaiter)(r,void 0,void 0,function(){var r,i,o;return(0,_.__generator)(this,function(a){switch(a.label){case 0:return r=Date.now(),[4,this.fetchWithTimeout(n)];case 1:if((i=a.sent())&&(o=i.configs&&i.configs[e]))return this.metrics.fetchTimeAPISuccess=Date.now()-r,[2,o[t]];return this.metrics.fetchTimeAPIFail=Date.now()-r,[2,void 0]}})})},this.fetchWithTimeout=function(e){return(0,_.__awaiter)(r,void 0,void 0,function(){var t,n,r;return(0,_.__generator)(this,function(i){switch(i.label){case 0:return t=new AbortController,n=setTimeout(function(){return t.abort()},5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return r=i.sent(),clearTimeout(n),[2,r]}})})},this.fetchRemoteConfig=function(e,t){return(0,_.__awaiter)(r,void 0,void 0,function(){var n,r,i,o,a,s,u,c,l,d,h;return(0,_.__generator)(this,function(p){switch(p.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:t_})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),p.label=1;case 1:p.trys.push([1,3,,4]),n=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(i=(r=(0,_.__values)(this.configKeys)).next();!i.done;i=r.next())o=i.value,n.append("config_keys",o)}catch(e){l={error:e}}finally{try{i&&!i.done&&(d=r.return)&&d.call(r)}finally{if(l)throw l.error}}return t&&n.set("session_id",String(t)),a={headers:{Accept:"*/*"},method:"GET"},s="".concat(this.getServerUrl(),"?").concat(n.toString()),this.attempts+=1,[4,fetch(s,(0,_.__assign)((0,_.__assign)({},a),{signal:e}))];case 2:if(null===(u=p.sent()))return[2,this.completeRequest({err:tw})];switch(new eH().buildStatus(u.status)){case f.Success:return this.attempts=0,[2,this.parseAndStore
1Config(u)];case f.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}return[3,4];case 3:if(c=p.sent(),e.aborted)return[2,this.completeRequest({err:t_})];return[2,this.completeRequest({err:null!==(h=c.message)&&void 0!==h?h:tw})];case 4:return[2]}})})},this.retryFetch=function(e,t){return(0,_.__awaiter)(r,void 0,void 0,function(){var n=this;return(0,_.__generator)(this,function(r){switch(r.label){case 0:return[4,new Promise(function(e){return setTimeout(e,n.attempts*n.retryTimeout)})];case 1:return r.sent(),[2,this.fetchRemoteConfig(e,t)]}})})},this.parseAndStoreConfig=function(e){return(0,_.__awaiter)(r,void 0,void 0,function(){var t;return(0,_.__generator)(this,function(n){switch(n.label){case 0:return[4,e.json()];case 1:return t=n.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}})})},this.localConfig=t,this.configKeys=n}return e.prototype.getServerUrl=function(){return this.localConfig.serverZone===g.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===g.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,n=e.success;if(t)throw Error(t);n&&this.localConfig.loggerProvider.log(n)},e}(),tx=function(e){var t=e.localConfig,n=e.configKeys;return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(e){return[2,new tE({localConfig:t,configKeys:n})]})})},tS=function(){function e(e){this.config=e,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return e.prototype.initialize=function(){return(0,_.__awaiter)(this,void 0,void 0,function(){var e;return(0,_.__generator)(this,function(t){switch(t.label){case 0:return e=this,[4,tx({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return e.remoteConfigFetch=t.sent(),[2]}})})},e.prototype.generateJoinedConfig=function(){var e,t,n,r;return(0,_.__awaiter)(this,void 0,void 0,function(){var i,o,a;return(0,_.__generator)(this,function(s){switch(s.label){case 0:if(s.trys.push([0,3,,4]),!(o=this.remoteConfigFetch))return[3,2];return[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)];case 1:o=s.sent(),s.label=2;case 2:return i=o,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(i,null,2)),i&&"autocapture"in i&&("boolean"==typeof i.autocapture&&(this.config.autocapture=i.autocapture),"object"==typeof i.autocapture&&(void 0===this.config.autocapture&&(this.config.autocapture=i.autocapture),"boolean"==typeof this.config.autocapture&&(this.config.autocapture=(0,_.__assign)({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},i.autocapture)),"object"==typeof this.config.autocapture&&(this.config.autocapture=(0,_.__assign)((0,_.__assign)({},this.config.autocapture),i.autocapture))),this.config.defaultTracking=this.config.autocapture),this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),null!==(e=(r=this.config).requestMetadata)&&void 0!==e||(r.requestMetadata=new D),(null===(t=this.remoteConfigFetch)||void 0===t?void 0:t.metrics.fetchTimeAPISuccess)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),(null===(n=this.remoteConfigFetch)||void 0===n?void 0:n.metrics.fetchTimeAPIFail)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return a=s.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",a),[3,4];case 4:return[2,this.config]}})})},e}(),tI=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],tk=["div","span","h1","h2","h3","h4","h5","h6"],tT="[Amplitude] Element Clicked",tP="[Amplitude] Element Tag",tA="[Amplitude] Element Text",tC="[Amplitude] Element Selector",tN="[Amplitude] Page URL",tO="https://app.amplitude.com",tR={US:tO,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},tL="amp-visual-tagging-selector-highlight",tD=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function tU(e){return"function"==typeof e}function tM(e){return tU(null==e?void 0:e.then)}function tq(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var tj=tq(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function tF(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var tz=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,n,r,i,o=this._parentage;if(o){if(this._parentage=null,Array.isArray(o))try{for(var a=(0,_.__values)(o),s=a.next();!s.done;s=a.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this)}var u=this.initialTeardown;
1if(tU(u))try{u()}catch(e){i=e instanceof tj?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=(0,_.__values)(c),d=l.next();!d.done;d=l.next()){var f=d.value;try{tV(f)}catch(e){i=null!=i?i:[],e instanceof tj?i=(0,_.__spreadArray)((0,_.__spreadArray)([],(0,_.__read)(i)),(0,_.__read)(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new tj(i)}},t.prototype.add=function(e){var n;if(e&&e!==this){if(this.closed)tV(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&tF(t,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&tF(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}();function tB(e){return e instanceof tz||e&&"closed"in e&&tU(e.remove)&&tU(e.add)&&tU(e.unsubscribe)}function tV(e){tU(e)?e():e.unsubscribe()}tz.EMPTY;var tK={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},tY={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=tY.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,(0,_.__spreadArray)([e,t],(0,_.__read)(n))):setTimeout.apply(void 0,(0,_.__spreadArray)([e,t],(0,_.__read)(n)))},clearTimeout:function(e){var t=tY.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function tH(e){tY.setTimeout(function(){var t=tK.onUnhandledError;if(t)t(e);else throw e})}function t$(){}var tW=tJ("C",void 0,void 0);function tJ(e,t,n){return{kind:e,value:t,error:n}}var tQ=null,tZ=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,tB(t)&&t.add(n)):n.destination=t3,n}return(0,_.__extends)(t,e),t.create=function(e,t,n){return new t1(e,t,n)},t.prototype.next=function(e){this.isStopped?t4(tJ("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?t4(tJ("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?t4(tW,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(tz),tG=Function.prototype.bind;function tX(e,t){return tG.call(e,t)}var t0=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){t2(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){t2(e)}else t2(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){t2(e)}},e}(),t1=function(e){function t(t,n,r){var i,o,a=e.call(this)||this;return tU(t)||!t?i={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:a&&tK.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return a.unsubscribe()},i={next:t.next&&tX(t.next,o),error:t.error&&tX(t.error,o),complete:t.complete&&tX(t.complete,o)}):i=t,a.destination=new t0(i),a}return(0,_.__extends)(t,e),t}(tZ);function t2(e){tK.useDeprecatedSynchronousErrorHandling?tK.useDeprecatedSynchronousErrorHandling&&tQ&&(tQ.errorThrown=!0,tQ.error=e):tH(e)}function t4(e,t){var n=tK.onStoppedNotification;n&&tY.setTimeout(function(){return n(e,t)})}var t3={closed:!0,next:t$,error:function(e){throw e},complete:t$},t5="function"==typeof Symbol&&Symbol.observable||"@@observable";function t7(e){return e}var t6=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,i=this,o=(r=e)&&r instanceof tZ||r&&tU(r.next)&&tU(r.error)&&tU(r.complete)&&tB(r)?e:new t1(e,t,n
1);return function(e){if(tK.useDeprecatedSynchronousErrorHandling){var t=!tQ;if(t&&(tQ={errorThrown:!1,error:null}),e(),t){var n=tQ,r=n.errorThrown,i=n.error;if(tQ=null,r)throw i}}else e()}(function(){var e=i.operator,t=i.source;o.add(e?e.call(o,t):t?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=t8(t))(function(t,r){var i=new t1({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[t5]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===e.length?t7:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=t8(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function t8(e){var t;return null!==(t=null!=e?e:tK.Promise)&&void 0!==t?t:Promise}function t9(e){return Symbol.asyncIterator&&tU(null==e?void 0:e[Symbol.asyncIterator])}function ne(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var nt="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function nn(e){return tU(null==e?void 0:e[nt])}function nr(e){return(0,_.__asyncGenerator)(this,arguments,function(){var t,n,r;return(0,_.__generator)(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,(0,_.__await)(t.read())];case 3:if(r=(n=i.sent()).value,!n.done)return[3,5];return[4,(0,_.__await)(void 0)];case 4:return[2,i.sent()];case 5:return[4,(0,_.__await)(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ni(e){return tU(null==e?void 0:e.getReader)}function no(e){if(e instanceof t6)return e;if(null!=e){if(tU(e[t5]))return new t6(function(t){var n=e[t5]();if(tU(n.subscribe))return n.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")});if(tD(e))return new t6(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()});if(tM(e))return new t6(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,tH)});if(t9(e))return na(e);if(nn(e))return new t6(function(t){var n,r;try{for(var i=(0,_.__values)(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()});if(ni(e))return na(nr(e))}throw ne(e)}function na(e){return new t6(function(t){(function(e,t){var n,r,i,o;return(0,_.__awaiter)(this,void 0,void 0,function(){var a;return(0,_.__generator)(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),n=(0,_.__asyncValues)(e),s.label=1;case 1:return[4,n.next()];case 2:if((r=s.sent()).done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i={error:s.sent()},[3,11];case 6:if(s.trys.push([6,,9,10]),!(r&&!r.done&&(o=n.return)))return[3,8];return[4,o.call(n)];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}function ns(e){return function(t){if(tU(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}function nu(e,t,n,r,i){return new nc(e,t,n,r,i)}var nc=function(e){function t(t,n,r,i,o,a){var s=e.call(this,t)||this;return s.onFinalize=o,s.shouldUnsubscribe=a,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return(0,_.__extends)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),n||null===(t=this.onFinalize)||void 0===t||t.call(this)}},t}(tZ);function nl(e,t){return ns(function(n,r){var i=0;n.subscribe(nu(r,function(n){r.next(e.call(t,n,i++))}))})}
1function nd(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function nf(e,t,n){return(void 0===n&&(n=1/0),tU(t))?nf(function(n,r){return nl(function(e,i){return t(n,e,r,i)})(no(e(n,r)))},n):("number"==typeof t&&(n=t),ns(function(t,r){var i,o,a,s,u,c,l,d,f;return i=n,a=[],s=0,u=0,c=!1,l=function(){!c||a.length||s||r.complete()},d=function(e){return s<i?f(e):a.push(e)},f=function(t){s++;var n=!1;no(e(t,u++)).subscribe(nu(r,function(e){o?d(e):r.next(e)},function(){n=!0},void 0,function(){if(n)try{for(s--;a.length&&s<i;)!function(){var e=a.shift();f(e)}();l()}catch(e){r.error(e)}}))},t.subscribe(nu(r,d,function(){c=!0,l()})),function(){}}))}var nh=Array.isArray,np=["addListener","removeListener"],nv=["addEventListener","removeEventListener"],ng=["on","off"];function nm(e,t,n,r){if(tU(n)&&(r=n,n=void 0),r)return nm(e,t,n).pipe((i=r,nl(function(e){return nh(e)?i.apply(void 0,(0,_.__spreadArray)([],(0,_.__read)(e))):i(e)})));var i,o=(0,_.__read)(tU(e.addEventListener)&&tU(e.removeEventListener)?nv.map(function(r){return function(i){return e[r](t,i,n)}}):tU(e.addListener)&&tU(e.removeListener)?np.map(ny(e,t)):tU(e.on)&&tU(e.off)?ng.map(ny(e,t)):[],2),a=o[0],s=o[1];if(!a&&tD(e))return nf(function(e){return nm(e,t,n)})(no(e));if(!a)throw TypeError("Invalid event target");return new t6(function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return a(t),function(){return s(t)}})}function ny(e,t){return function(n){return function(r){return e[n](t,r)}}}function nb(e,t,n){for(var r=null,i=[],o=e,a=0;o&&"break"!==function(){var e,s,u,c,l=nT((e=o.getAttribute("id"))&&m.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null)||nT.apply(void 0,(0,_.__spreadArray)([],(0,_.__read)(Array.from(o.attributes).filter(function(e){return m.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})),!1))||nT.apply(void 0,(0,_.__spreadArray)([],(0,_.__read)(Array.from(o.classList).filter(m.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})),!1))||nT((s=o.tagName.toLowerCase(),m.tagName(s)?{name:s,penalty:2}:null))||[nS()],d=function(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}(o);if("all"==t)d&&(l=l.concat(l.filter(nk).map(function(e){return nI(e,d)})));else if("two"==t)l=l.slice(0,1),d&&(l=l.concat(l.filter(nk).map(function(e){return nI(e,d)})));else if("one"==t){var f=(0,_.__read)(l=l.slice(0,1),1)[0];d&&nk(f)&&(l=[nI(f,d)])}else"none"==t&&(l=[nS()],d&&(l=[nI(l[0],d)]));try{for(var h=(u=void 0,(0,_.__values)(l)),p=h.next();!p.done;p=h.next()){var f=p.value;f.level=a}}catch(e){u={error:e}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}if(i.push(l),i.length>=m.seedMinLength&&(r=n_(i,n)))return"break";o=o.parentElement,a++}(););return(r||(r=n_(i,n)),!r&&n)?n():r}function n_(e,t){if(e.reduce(function(e,t){return e*t.length},1)>m.threshold)return t?t():null;var n,r,i=nA(function e(t,n){var r,i,o,a,s;return void 0===n&&(n=[]),(0,_.__generator)(this,function(u){switch(u.label){case 0:if(!(t.length>0))return[3,9];u.label=1;case 1:u.trys.push([1,6,7,8]),i=(r=(0,_.__values)(t[0])).next(),u.label=2;case 2:if(i.done)return[3,5];return o=i.value,[5,(0,_.__values)(e(t.slice(1,t.length),n.concat(o)))];case 3:u.sent(),u.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return a={error:u.sent()},[3,8];case 7:try{i&&!i.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}return[7];case 8:return[3,11];case 9:return[4,n];case 10:u.sent(),u.label=11;case 11:return[2]}})}(e));try{for(var o=(0,_.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value;if(nx(s))return s}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function nw(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var i=e[r].level||0;n=t.level===i-1?"".concat(e[r].name," > ").concat(n):"".concat(e[r].name," ").concat(n),t=e[r]}return n}function nE(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function nx(e){var t=nw(e);switch(y.querySelectorAll(t).length){case 0:throw Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function nS(){return{name:"*",penalty:3}}function nI(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function nk(e){return"html"!==e.name&&!e.name.startsWith("#")}function nT(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(nP);return n.length>0?n:null}function nP(e){return null!=e}function nA(e){return(0,_.__spreadArray)([],(0,_.__read)(e),!1).sort(function(e,t){return nE(e)-nE(t)})}var nC=["input","select","textarea"],nN=function(e,t){return function(n,r){var i,o,a,s=e.pageUrlAllowlist,u=e.shouldTrackEventResolver,c=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!c)return!1;if(u)return u(n,r);if(!nU(window.location.href,s))return!1;var l=String(null==r?void 0:r.getAttribute("type"))||"";if("string"==typeof l)switch(l.toLowerCase()){case"hidden":case"password":return!1}if(t&&!t.some(function(e){var t;return!!(null===(t=null==r?void 0:r.matches)||void 0===t?void 0:t.call(r,e))}))return!1;switch(c){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:var d=null===(a=null==window?void 0:window.getComputedStyle)||void 0===a?void 0:a.call(window,r);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===n)return!0;return"click"===n}}},nO=function(e){return!(null==e||"string"==typeof e&&(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11}
1)|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))},nR=function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase())==="true";return!nC.includes(i)&&!o},nL=function(e){var t="";return nR(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach(function(e){var n="";e&&3===e.nodeType?e.textContent&&(n=e.textContent):n=nL(e),t+=n.split(/(\s+)/).filter(nO).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}),t},nD=function(e,t){var n,r,i="";try{return i=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n,r={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};y=(n=(m=(0,_.__assign)((0,_.__assign)({},r),t)).root).nodeType===Node.DOCUMENT_NODE?n:n===r.root?n.ownerDocument:n;var i=nb(e,"all",function(){return nb(e,"two",function(){return nb(e,"one",function(){return nb(e,"none")})})});if(i){var o=nA(function e(t,n,r){var i,o,a;return void 0===r&&(r={counter:0,visited:new Map}),(0,_.__generator)(this,function(s){switch(s.label){case 0:if(!(t.length>2&&t.length>m.optimizedMinLength))return[3,5];i=1,s.label=1;case 1:var u;if(!(i<t.length-1))return[3,5];if(r.counter>m.maxNumberOfTries||(r.counter+=1,(o=(0,_.__spreadArray)([],(0,_.__read)(t),!1)).splice(i,1),a=nw(o),r.visited.has(a)))return[2];if(!(nx(o)&&(u=o,y.querySelector(nw(u))===n)))return[3,4];return[4,o];case 2:return s.sent(),r.visited.set(a,!0),[5,(0,_.__values)(e(o,n,r))];case 3:s.sent(),s.label=4;case 4:return i++,[3,1];case 5:return[2]}})}(i,e));return o.length>0&&(i=o[0]),nw(i)}throw Error("Selector was not found.")}(e,{className:function(e){return e!==tL},maxNumberOfTries:1e3})}catch(e){t&&t.warn("Failed to get selector with finder, use fallback strategy instead: ".concat(e.toString()))}var o=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);o&&(i=o);var a=e.getAttribute("id"),s=e.getAttribute("class");if(a)i="#".concat(a);else if(s){var u=s.split(" ").filter(function(e){return e!==tL}).join(".");u&&(i="".concat(i,".").concat(u))}return i},nU=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},nM=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return null==r||"object"==typeof r&&0===Object.keys(r).length||"string"==typeof r&&0===r.trim().length||(t[n]=r),t},{})},nq=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}if(t){var r=t.textContent||"";return nO(r)?r:""}return nq(n)},nj=function(e,t){return e?t.some(function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)})?e:nj(null==e?void 0:e.parentElement,t):null},nF=function(e,t){if(!e)return{};var n,r,i,o=null===(i=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),a=nD(e,t);return nM(((n={})[tP]=o,n[tA]=nL(e),n[tC]=a,n[tN]=window.location.href.split("?")[0],n))},nz=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor},nB=function(){function e(e){var t=(void 0===e?{}:e).origin,n=this;this.endpoint=tO,this.requestCallbacks={},this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=void 0===t?tO:t}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,a){r.requestCallbacks[i]={resolve:t,reject:a},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout(function(){a(Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.setup=function(e){var t=this,n=void 0===e?{}:e,r=n.logger,i=n.endpoint,o=n.isElementSelectable,a=n.cssSelectorAllowlist,s=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===tO&&(this.endpoint=i);var u=null;window.addEventListener("message",function(e){if(null===(r=null===(n=t.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var n,r,i,c,l,d=null==e?void 0:e.data,f=null==d?void 0:d.action;if(f){if("id"in d)null===(c=null===(i=t.logger)||void 0===i?void 0:i.debug)||void 0===c||c.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(d);else if("ping"===f)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===f){var h,p=null==d?void 0:d.data;(h="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise(function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=h,r.addEventListener("load",function(){e({status:!0})},{once:!0}),r.addEventListener("error",function(){t({status:!1,message:"Failed to load the script ".concat(h)})}),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(e){t(e)}})).then(function(){var e;u=null===(e=null==window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:nF,isElementSelectable:function(e){return!o||o((null==p?void 0:p.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:tL,messenger:t,cssSelectorAllowlist:a,actionClickAllowlist:s}),t.notify({action:"selector-loaded"})}).catch(function(){var e;
1null===(e=t.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")})}else"close-visual-tagging-selector"===f&&(null===(l=null==u?void 0:u.close)||void 0===l||l.call(u))}}}),this.notify({action:"page-loaded"})},e}(),nV=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],nK=["type"],nY=["svg","path","g"],nH=["password","hidden"];function n$(e,t){return ns(function(n,r){var i=0;n.subscribe(nu(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}var nW=function(e){function t(t,n){return e.call(this)||this}return(0,_.__extends)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(tz),nJ={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=nJ.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,(0,_.__spreadArray)([e,t],(0,_.__read)(n))):setInterval.apply(void 0,(0,_.__spreadArray)([e,t],(0,_.__read)(n)))},clearInterval:function(e){var t=nJ.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},nQ=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,_.__extends)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n,r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),nJ.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&nJ.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,tF(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(nW),nZ={now:function(){return(nZ.delegate||Date).now()},delegate:void 0},nG=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=nZ.now,e}(),nX=new(function(e){function t(t,n){void 0===n&&(n=nG.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return(0,_.__extends)(t,e),t.prototype.flush=function(e){var t,n=this.actions;if(this._active){n.push(e);return}this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,t){for(;e=n.shift();)e.unsubscribe();throw t}},t}(nG))(nQ);function n0(e){return void 0===e&&(e=1/0),nf(t7,e)}var n1=new t6(function(e){return e.complete()});function n2(e){return e&&tU(e.schedule)}function n4(e){return e[e.length-1]}function n3(e){return n2(n4(e))?e.pop():void 0}function n5(e,t){return void 0===t&&(t=0),ns(function(n,r){n.subscribe(nu(r,function(n){return nd(r,e,function(){return r.next(n)},t)},function(){return nd(r,e,function(){return r.complete()},t)},function(n){return nd(r,e,function(){return r.error(n)},t)}))})}function n7(e,t){return void 0===t&&(t=0),ns(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function n6(e,t){if(!e)throw Error("Iterable cannot be null");return new t6(function(n){nd(n,t,function(){var r=e[Symbol.asyncIterator]();nd(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function n8(e,t){return t?function(e,t){if(null!=e){if(tU(e[t5]))return no(e).pipe(n7(t),n5(t));if(tD(e))return new t6(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})});if(tM(e))return no(e).pipe(n7(t),n5(t));if(t9(e))return n6(e,t);if(nn(e))return new t6(function(n){var r;return nd(n,t,function(){r=e[nt](),nd(n,t,function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return tU(null==r?void 0:r.return)&&r.return()}});if(ni(e))return n6(nr(e),t)}throw ne(e)}(e,t):no(e)}function n9(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=n3(t),i=(e=1/0,"number"==typeof n4(t)?t.pop():e);return t.length?1===t.length?no(t[0]):n0(i)(n8(t,r)):n1}function re(e){return e<=0?function(){return n1}:ns(function(t,n){var r=0;t.subscribe(nu(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function rt(e){return e instanceof Date&&!isNaN(e)}var rn=tq(function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function rr(e){throw new rn(e)}(c=b||(b={})).ClickObservable="clickObservable",c.ChangeObservable="changeObservable",c.NavigateObservable="navigateObservable",c.MutationObservable="mutationObservable";var ri=function(e){void 0===e&&(e={});var t,n,r,i=e.dataAttributePrefix,o=void 0===i?"data-amp-track-":i,a=e.visualTaggingOptions,s=void 0===a?{enabled:!0,messenger:new nB}:a;e.cssSelectorAllowlist=null!==(t=e.cssSelectorAllowlist)&&void 0!==t?t:tI,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:tk,e.debounceTime=null!==(r=e.debounceTime)&&void 0!==r?r:0;var u="@amplitude/plugin-autocapture-browser",c=[],l=void 0,d=function(){var e,t,n=nm(document,"click",{capture:!0}).pipe(nl(function(e){return h(e,"click")})),r=nm(document,"change",{capture:!0}).pipe(nl(function(e){return h(e,"change")}));window.navigation&&(t=nm(window.navigation,"navigate").pipe(nl(function(e){return h(e,"navigate")})));var i=new t6(function(e){var t=new MutationObserver(function(t){e.next(t)});return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}}).pipe(nl(function(e){return h(e,"mutation")}));return(e={})[b.ClickObservable]=n,e[b.ChangeObservable]=r,e[b.NavigateObservable]=t,e[b.MutationObservable]=i,e},f=function(e,t){var n,r,i,a,s=null===(a=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===a?void 0:a.call(i),u="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},c=t.getAttribute("aria-label"),d=t.getAttributeNames().reduce(function(e,n){if(n.startsWith(o)){var r=n.replace(o,""),i=t.getAttribute(n);r&&(e[r]=i||"")}return e},{}),f=nq(t),h=nD(t,l),p=((r={})["[Amplitude] Element ID"]=t.getAttribute("id")||"",r["[Amplitude] Element Class"]=t.getAttribute("class"),r["[Amplitude] Element Hierarchy"]=(n=t)?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(null===i)n+=4;else{var o=function e(t,n){void 0===n&&(n=!1);try{if(null==t){if(n)return"None";return null}if("string"==typeof t){if(n){if((t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"'))return"'".concat(t,"'");if(t.includes("'"))return'"'.concat(t.replace(/'/g,"\\'"),'"');return"'".concat(t,"'")}return t}if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var r=t.map(function(t){return e(t,!0)});return"[".concat(r.join(", "),"]")}else if("object"==typeof t){var i=Object.entries(t).filter(function(e){var t=(0,_.__read)(e,1)[0];return null!=t}).map(function(t){var n=(0,_.__read)(t,2),r=n[0],i=n[1];return"".concat(String(e(r,!0)),": ").concat(String(e(i,!0)))}),o="{".concat(i.join(", "),"}");return o.includes("\\'")&&(o=o.replace(/'/g,"'").replace(/'/g,"\\'")),o}return t.toString()}catch(e){return null}}(i);n+=o?Array.from(o).length:4}if(n>1024)return e.slice(0,r)}return e}((function(e){var t=[];if(!e)return t;
1t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t})(n).map(function(e){return function(e){if(null===e)return null;var t,n,r,i,o,a,s=String(e.tagName).toLowerCase(),u={tag:s},c=Array.from(null!==(i=null===(r=e.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);c.length&&(u.index=c.indexOf(e),u.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var l=null===(a=null===(o=e.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===a?void 0:a.toLowerCase();l&&(u.prevSib=String(l));var d=e.getAttribute("id");d&&(u.id=String(d));var f=Array.from(e.classList);f.length&&(u.classes=f);var h={},p=Array.from(e.attributes).filter(function(e){return!nV.includes(e.name)}),v=!nR(e);if(!nH.includes(String(e.getAttribute("type")))&&!nY.includes(s))try{for(var g=(0,_.__values)(p),m=g.next();!m.done;m=g.next()){var y=m.value;(!v||nK.includes(y.name))&&(h[y.name]=String(y.value).substring(0,128))}}catch(e){t={error:e}}finally{try{m&&!m.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}return Object.keys(h).length&&(u.attrs=h),u}(e)}),0):[],r[tP]=s,r[tA]=nL(t),r["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),r["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),r["[Amplitude] Element Aria Label"]=c,r["[Amplitude] Element Attributes"]=d,r[tC]=h,r["[Amplitude] Element Parent Label"]=f,r[tN]=window.location.href.split("?")[0],r["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);return"a"===s&&"click"===e&&t instanceof HTMLAnchorElement&&(p["[Amplitude] Element Href"]=t.href),nM(p)},h=function(t,n){var r={event:t,timestamp:Date.now(),type:n};if(("click"===r.type||"change"===r.type)&&null!==r.event.target){var i=nj(r.event.target,e.cssSelectorAllowlist);i&&(r.closestTrackedAncestor=i,r.targetElementProperties=f(r.type,i))}return r};return{name:u,type:"enrichment",setup:function(t,n){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var r,i,o,a,h,p,v,g,m,y;return(0,_.__generator)(this,function(b){var w,E,x,S,I,k,T,P,A,C,N,O,R,L,D,U,M,q,j,F,z,B,V,K,Y,H,$,W,J,Q,Z,G,X,ee;return l=t.loggerProvider,"undefined"==typeof document||(r=nN(e,e.cssSelectorAllowlist),i=nN(e,e.actionClickAllowlist),E=(w={allObservables:o=d(),options:e,amplitude:n,shouldTrackEvent:r}).amplitude,x=w.allObservables,S=w.options,I=w.shouldTrackEvent,A=n9((k=x.clickObservable).pipe(ns(function(e,t){var n,r=!1;e.subscribe(nu(t,function(e){var i=n;n=e,r&&t.next([i,e]),r=!0}))}),n$(function(e){var t=(0,_.__read)(e,2),n=t[0],r=t[1],i=n.event.target!==r.event.target,o=20>=Math.abs(r.event.screenX-n.event.screenX)&&20>=Math.abs(r.event.screenY-n.event.screenY);return i&&!o})),k.pipe((T=S.debounceTime,void 0===P&&(P=nX),ns(function(e,t){var n=null,r=null,i=null,o=function(){if(n){n.unsubscribe(),n=null;var e=r;r=null,t.next(e)}};function a(){var e=i+T,r=P.now();if(r<e){n=this.schedule(void 0,e-r),t.add(n);return}o()}e.subscribe(nu(t,function(e){r=e,i=P.now(),n||(n=P.schedule(a,T),t.add(n))},function(){o(),t.complete()},void 0,function(){r=n=null}))})),nl(function(){return"timeout"}))),a=k.pipe((void 0===C&&(C=nX),N=0,O=C,void 0===N&&(N=0),void 0===R&&(R=nX),L=-1,null!=O&&(n2(O)?R=O:L=O),D=new t6(function(e){var t=rt(N)?+N-R.now():N;t<0&&(t=0);var n=0;return R.schedule(function(){e.closed||(e.next(n++),0<=L?this.schedule(void 0,L):e.complete())},t)}),function e(t,n){return n?function(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n0(1)(n8(e,n3(e)))}(n.pipe(re(1),ns(function(e,t){e.subscribe(nu(t,t$))})),r.pipe(e(t)))}:nf(function(e,n){return no(t(e,n)).pipe(re(1),nl(function(){return e}))})}(function(){return D})),n$(nz),n$(function(e){return I("click",e.closestTrackedAncestor)}),ns(function(e,t){var n=[];return e.subscribe(nu(t,function(e){return n.push(e)},function(){t.next(n),t.complete()})),no(A).subscribe(nu(t,function(){var e=n;n=[],t.next(e)},t$)),function(){n=null}})).subscribe(function(e){var t,n,r=(e.length,tT);try{for(var i=(0,_.__values)(e),o=i.next();!o.done;o=i.next()){var a=o.value;null==E||E.track(r,a.targetElementProperties,{time:a.timestamp})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}),c.push(a),M=(U={allObservables:o,getEventProperties:f,amplitude:n,shouldTrackEvent:r}).amplitude,q=U.allObservables,j=U.getEventProperties,F=U.shouldTrackEvent,h=q.changeObservable.pipe(n$(nz),n$(function(e){return F("change",e.closestTrackedAncestor)})).subscribe(function(e){null==M||M.track("[Amplitude] Element Changed",j("change",e.closestTrackedAncestor))}),c.push(h),B=(z={allObservables:o,options:e,getEventProperties:f,amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}).amplitude,V=z.allObservables,K=z.options,Y=z.getEventProperties,H=z.shouldTrackEvent,$=z.shouldTrackActionClick,W=V.clickObservable,J=V.mutationObservable,Q=V.navigateObservable,Z=W.pipe(n$(function(e){return!H("click",e.closestTrackedAncestor)}),nl(function(e){var t=nj(e.event.target,K.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=Y(e.type,e.closestTrackedAncestor)),e}),n$(nz),n$(function(e){return $("click",e.closestTrackedAncestor)})),G=[J],Q&&G.push(Q),X=n9.apply(void 0,(0,_.__spreadArray)([],(0,_.__read)(G),!1)),p=Z.pipe((ee=function(e){return X.pipe(re(1),function(e,t){var n=rt(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,o=n.with,a=void 0===o?rr:o,s=n.scheduler,u=void 0===s?nX:s,c=n.meta,l=void 0===c?null:c;if(null==r&&null==i)throw TypeError("No timeout provided.");return ns(function(e,t){var n,o,s=null,c=0,d=function(e){o=nd(t,u,function(){try{n.unsubscribe(),no(a({meta:l,lastValue:s,seen:c})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(nu(t,function(e){null==o||o.unsubscribe(),c++,t.next(s=e),i>0&&d(i)},void 0,void 0,function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),s=null})),c||d(null!=r?"number"==typeof r?r:+r-u.now():i)})}({first:500,with:function(){return n1}}),nl(function(){return e}))},ns(function(e,t){var n=null,r=0,i=!1,o=function(){return i&&!n&&t.complete()};
1e.subscribe(nu(t,function(e){null==n||n.unsubscribe(),no(ee(e,r++)).subscribe(n=nu(t,function(e){return t.next(e)},function(){n=null,o()}))},function(){i=!0,o()}))}))).subscribe(function(e){null==B||B.track(tT,Y("click",e.closestTrackedAncestor),{time:e.timestamp})}),c.push(p),null===(m=null==t?void 0:t.loggerProvider)||void 0===m||m.log("".concat(u," has been successfully added.")),window.opener&&s.enabled&&(v=e.cssSelectorAllowlist,g=e.actionClickAllowlist,null===(y=s.messenger)||void 0===y||y.setup((0,_.__assign)((0,_.__assign)({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:tR[t.serverZone]}),{isElementSelectable:nN(e,(0,_.__spreadArray)((0,_.__spreadArray)([],(0,_.__read)(v),!1),(0,_.__read)(g),!1)),cssSelectorAllowlist:v,actionClickAllowlist:g})))),[2]})})},execute:function(e){return(0,_.__awaiter)(void 0,void 0,void 0,function(){return(0,_.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,_.__generator)(this,function(i){try{for(t=(e=(0,_.__values)(c)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}},ro={init:S((l=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,_.__extends)(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),I(this._init((0,_.__assign)((0,_.__assign)({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i;return(0,_.__awaiter)(this,void 0,void 0,function(){var o,a,s,u,c,l=this;return(0,_.__generator)(this,function(d){var f,h,p,v,g;switch(d.label){case 0:if(this.initializing)return[2];return this.initializing=!0,[4,(f=t.apiKey,h=t,p=this,void 0===h&&(h={}),(0,_.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,a,s,u,c,l,d,v,g,m,y,b,w,E,x,S,I,k,T,P,A,C,N,O,R,L,D,M,q,j,F,z,B,V,K,Y,H,$;return(0,_.__generator)(this,function(W){var J,Q,Z;switch(W.label){case 0:if(e=h.identityStorage||to,E={},!(e!==to))return[3,1];return n="",[3,5];case 1:if(!(null!==(S=null===(x=h.cookieOptions)||void 0===x?void 0:x.domain)&&void 0!==S))return[3,2];return r=S,[3,4];case 2:return[4,(0,_.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o;return(0,_.__generator)(this,function(a){switch(a.label){case 0:return[4,new eV().isEnabled()];case 1:if(!a.sent()||"undefined"==typeof location||!location.hostname)return[2,""];for(e=(null!=J?J:location.hostname).split("."),t=[],n="AMP_TLDTEST",r=e.length-2;r>=0;--r)t.push(e.slice(r).join("."));r=0,a.label=2;case 2:if(!(r<t.length))return[3,7];return[4,(o=new eV({domain:"."+(i=t[r])})).set(n,1)];case 3:return a.sent(),[4,o.get(n)];case 4:if(!a.sent())return[3,6];return[4,o.remove(n)];case 5:return a.sent(),[2,"."+i];case 6:return r++,[3,2];case 7:return[2,""]}})})];case 3:r=W.sent(),W.label=4;case 4:n=r,W.label=5;case 5:return t=_.__assign.apply(void 0,[(E.domain=n,E.expiration=365,E.sameSite="Lax",E.secure=!1,E.upgrade=!0,E),h.cookieOptions]),[4,(Q=i=ts(h.identityStorage,t),void 0===(Z=null===(k=null===(I=h.cookieOptions)||void 0===I?void 0:I.upgrade)||void 0===k||k)&&(Z=!0),(0,_.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,a,s,u;return(0,_.__generator)(this,function(c){switch(c.label){case 0:return e="".concat("amp","_").concat(f.substring(0,6)),[4,Q.getRaw(e)];case 1:if(!(t=c.sent()))return[2,{optOut:!1}];if(!Z)return[3,3];return[4,Q.remove(e)];case 2:c.sent(),c.label=3;case 3:return r=(n=(0,_.__read)(t.split("."),6))[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],[2,{deviceId:r,userId:e0(i),sessionId:eX(a),lastEventId:eX(u),lastEventTime:eX(s),optOut:!!o}]}})}))];case 6:return o=W.sent(),[4,i.get(eB(f))];case 7:return a=W.sent(),s=ey(),u=null!==(N=null!==(C=null!==(A=null!==(P=null!==(T=h.deviceId)&&void 0!==T?T:s.ampDeviceId)&&void 0!==P?P:s.deviceId)&&void 0!==A?A:null==a?void 0:a.deviceId)&&void 0!==C?C:o.deviceId)&&void 0!==N?N:U(),c=null!==(O=null==a?void 0:a.lastEventId)&&void 0!==O?O:o.lastEventId,l=null!==(R=null==a?void 0:a.lastEventTime)&&void 0!==R?R:o.lastEventTime,d=null!==(D=null!==(L=h.optOut)&&void 0!==L?L:null==a?void 0:a.optOut)&&void 0!==D?D:o.optOut,v=null!==(M=null==a?void 0:a.sessionId)&&void 0!==M?M:o.sessionId,g=null!==(j=null!==(q=h.userId)&&void 0!==q?q:null==a?void 0:a.userId)&&void 0!==j?j:o.userId,p.previousSessionDeviceId=null!==(F=null==a?void 0:a.deviceId)&&void 0!==F?F:o.deviceId,p.previousSessionUserId=null!==(z=null==a?void 0:a.userId)&&void 0!==z?z:
1o.userId,m={ipAddress:null===(V=null===(B=h.trackingOptions)||void 0===B?void 0:B.ipAddress)||void 0===V||V,language:null===(Y=null===(K=h.trackingOptions)||void 0===K?void 0:K.language)||void 0===Y||Y,platform:null===($=null===(H=h.trackingOptions)||void 0===H?void 0:H.platform)||void 0===$||$},y=null==a?void 0:a.pageCounter,b=null==a?void 0:a.debugLogsEnabled,void 0!==h.autocapture&&(h.defaultTracking=h.autocapture),[4,(w=new ta(f,h.appVersion,i,t,h.defaultTracking,h.autocapture,u,h.flushIntervalMillis,h.flushMaxRetries,h.flushQueueSize,e,h.ingestionMetadata,h.instanceName,c,l,h.loggerProvider,h.logLevel,h.minIdLength,h.offline,d,h.partnerId,h.plan,h.serverUrl,h.serverZone,v,h.sessionTimeout,h.storageProvider,m,h.transport,h.useBatch,h.fetchRemoteConfig,g,y,b)).storageProvider.isEnabled()];case 8:return W.sent()||(w.loggerProvider.warn("Storage provider ".concat(w.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),w.storageProvider=new ez),[2,w]}})}))];case 1:if(o=d.sent(),!t.fetchRemoteConfig)return[3,4];return[4,(v=o,(0,_.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,_.__generator)(this,function(t){switch(t.label){case 0:return[4,(e=new tS(v)).initialize()];case 1:return t.sent(),[2,e]}})}))];case 2:return[4,d.sent().generateJoinedConfig()];case 3:o=d.sent(),d.label=4;case 4:return[4,e.prototype._init.call(this,o)];case 5:if(d.sent(),this.logBrowserOptions(o),!J(this.config.defaultTracking))return[3,7];return a=J((g=this.config).defaultTracking)&&g.defaultTracking&&"object"==typeof g.defaultTracking&&g.defaultTracking.attribution&&"object"==typeof g.defaultTracking.attribution?(0,_.__assign)({},g.defaultTracking.attribution):{},this.webAttribution=new eE(a,this.config),[4,this.webAttribution.init()];case 6:d.sent(),d.label=7;case 7:if(u=Number.isNaN(Number((s=ey()).ampSessionId))?void 0:Number(s.ampSessionId),this.setSessionId(null!==(i=null!==(r=null!==(n=t.sessionId)&&void 0!==n?n:u)&&void 0!==r?r:this.config.sessionId)&&void 0!==i?i:Date.now()),(c=eR(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),!(null!==this.config.offline))return[3,9];return[4,this.add(tb()).promise];case 8:d.sent(),d.label=9;case 9:return[4,this.add(new q).promise];case 10:return d.sent(),[4,this.add(new eF).promise];case 11:return d.sent(),[4,this.add(new eU).promise];case 12:if(d.sent(),ty(this.config),!W(this.config.defaultTracking,"fileDownloads"))return[3,14];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(tg()).promise];case 13:d.sent(),d.label=14;case 14:if(!W(this.config.defaultTracking,"formInteractions"))return[3,16];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(tp()).promise];case 15:d.sent(),d.label=16;case 16:if(!Q(this.config.defaultTracking))return[3,18];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(tl(ee(this.config))).promise];case 17:d.sent(),d.label=18;case 18:if(!G(this.config.autocapture))return[3,20];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(ri(X(this.config))).promise];case 19:d.sent(),d.label=20;case 20:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 21:return d.sent(),c.eventBridge.setEventReceiver(function(e){l.track(e.eventType,e.eventProperties)}),[2]}})})},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){if(!this.config){this.q.push(this.setUserId.bind(this,e));return}this.config.loggerProvider.debug("function setUserId: ",e),(e!==this.config.userId||void 0===e)&&(this.config.userId=e,eL(e,this.config.instanceName))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){if(!this.config){this.q.push(this.setDeviceId.bind(this,e));return}this.config.loggerProvider.debug("function setDeviceId: ",e),this.config.deviceId=e,eD(e,this.config.instanceName)}
1,t.prototype.reset=function(){this.setDeviceId(U()),this.setUserId(void 0)},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),I(Promise.resolve());if(e===this.config.sessionId)return I(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId(),i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Z(this.config.defaultTracking)&&(r&&i&&n.push(this.track(e7,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var a=this.trackCampaignEventIfNeeded(++o,n);return Z(this.config.defaultTracking)&&n.push(this.track(e5,void 0,{event_id:a?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,I(Promise.all(n))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(e){if(!this.config){this.q.push(this.setTransport.bind(this,e));return}this.config.transportProvider=tu(e)},t.prototype.identify=function(t,n){if(eq(t)){var r=t._q;t._q=[],t=eM(new z,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(eq(r)){var o=r._q;r._q=[],r=eM(new z,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(eq(t)){var r=t._q;t._q=[],t=eM(new B,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return(0,_.__awaiter)(this,void 0,void 0,function(){var n,r,i;return(0,_.__generator)(this,function(o){return n=Date.now(),r=ew(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===e5||t.event_type===e7||t.session_id&&t.session_id!==this.getSessionId()||(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=(0,_.__assign)((0,_.__assign)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t}($))).init.bind(l),"init",w(l),x(l,["config"])),add:S(l.add.bind(l),"add",w(l),x(l,["config.apiKey","timeline.plugins"])),remove:S(l.remove.bind(l),"remove",w(l),x(l,["config.apiKey","timeline.plugins"])),track:S(l.track.bind(l),"track",w(l),x(l,["config.apiKey","timeline.queue.length"])),logEvent:S(l.logEvent.bind(l),"logEvent",w(l),x(l,["config.apiKey","timeline.queue.length"])),identify:S(l.identify.bind(l),"identify",w(l),x(l,["config.apiKey","timeline.queue.length"])),groupIdentify:S(l.groupIdentify.bind(l),"groupIdentify",w(l),x(l,["config.apiKey","timeline.queue.length"])),setGroup:S(l.setGroup.bind(l),"setGroup",w(l),x(l,["config.apiKey","timeline.queue.length"])),revenue:S(l.revenue.bind(l),"revenue",w(l),x(l,["config.apiKey","timeline.queue.length"])),flush:S(l.flush.bind(l),"flush",w(l),x(l,["config.apiKey","timeline.queue.length"])),getUserId:S(l.getUserId.bind(l),"getUserId",w(l),x(l,["config","config.userId"])),setUserId:S(l.setUserId.bind(l),"setUserId",w(l),x(l,["config","config.userId"])),getDeviceId:S(l.getDeviceId.bind(l),"getDeviceId",w(l),x(l,["config","config.deviceId"])),setDeviceId:S(l.setDeviceId.bind(l),"setDeviceId",w(l),x(l,["config","config.deviceId"])),reset:S(l.reset.bind(l),"reset",w(l),x(l,["config","config.userId","config.deviceId"])),getSessionId:S(l.getSessionId.bind(l),"getSessionId",w(l),x(l,["config"])),setSessionId:S(l.setSessionId.bind(l),"setSessionId",w(l),x(l,["config"])),extendSession:S(l.extendSession.bind(l),"extendSession",w(l),x(l,["config"])),setOptOut:S(l.setOptOut.bind(l),"setOptOut",w(l),x(l,["config"])),setTransport:S(l.setTransport.bind(l),"setTransport",w(l),x(l,["config"]))};
1ro.add,ro.extendSession,ro.flush,ro.getDeviceId,ro.getSessionId,ro.getUserId,ro.groupIdentify,ro.identify;var ra=ro.init,rs=(ro.logEvent,ro.remove,ro.reset,ro.revenue,ro.setDeviceId,ro.setGroup,ro.setOptOut,ro.setSessionId,ro.setTransport,ro.setUserId),ru=ro.track},35851:function(e,t,n){n.d(t,{A:function(){return m},Toaster:function(){return E}});var r=n(55444),i=n(29832),o=e=>{switch(e){case"success":return u;case"info":return l;case"warning":return c;case"error":return d;default:return null}},a=Array(12).fill(0),s=e=>{let{visible:t,className:n}=e;return r.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":t},r.createElement("div",{className:"sonner-spinner"},a.map((e,t)=>r.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(t)}))))},u=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),c=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),l=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),d=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),f=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),h=()=>{let[e,t]=r.useState(document.hidden);return r.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e},p=1,v=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:p++,o=this.toasts.find(e=>e.id===i),a=void 0===e.dismissible||e.dismissible;return o?this.toasts=this.toasts.map(t=>t.id===i?(this.publish({...t,...e,id:i,title:n}),{...t,...e,id:i,dismissible:a,title:n}):t):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
1this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let n;if(!t)return;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let i=e instanceof Promise?e:e(),o=void 0!==n,a,s=i.then(async e=>{if(a=["resolve",e],r.isValidElement(e))o=!1,this.create({id:n,type:"default",message:e});else if(g(e)&&!e.ok){o=!1;let r="function"==typeof t.error?await t.error("HTTP error! status: ".concat(e.status)):t.error,i="function"==typeof t.description?await t.description("HTTP error! status: ".concat(e.status)):t.description;this.create({id:n,type:"error",message:r,description:i})}else if(void 0!==t.success){o=!1;let r="function"==typeof t.success?await t.success(e):t.success,i="function"==typeof t.description?await t.description(e):t.description;this.create({id:n,type:"success",message:r,description:i})}}).catch(async e=>{if(a=["reject",e],void 0!==t.error){o=!1;let r="function"==typeof t.error?await t.error(e):t.error,i="function"==typeof t.description?await t.description(e):t.description;this.create({id:n,type:"error",message:r,description:i})}}).finally(()=>{var e;o&&(this.dismiss(n),n=void 0),null==(e=t.finally)||e.call(t)}),u=()=>new Promise((e,t)=>s.then(()=>"reject"===a[0]?t(a[1]):e(a[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,t)=>{let n=(null==t?void 0:t.id)||p++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},g=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,m=Object.assign((e,t)=>{let n=(null==t?void 0:t.id)||p++;return v.addToast({title:e,...t,id:n}),n},{success:v.success,info:v.info,warning:v.warning,error:v.error,custom:v.custom,message:v.message,promise:v.promise,dismiss:v.dismiss,loading:v.loading},{getHistory:()=>v.toasts});function y(e){return void 0!==e.label}function b(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}!function(e){let{insertAt:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"undefined"==typeof document)return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
1left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
1:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
1--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var _=e=>{var t,n,i,a,u,c,l,d,p,v,g,m,_,w;let{invert:E,toast:x,unstyled:S,interacting:I,setHeights:k,visibleToasts:T,heights:P,index:A,toasts:C,expanded:N,removeToast:O,defaultRichColors:R,closeButton:L,style:D,cancelButtonStyle:U,actionButtonStyle:M,className:q="",descriptionClassName:j="",duration:F,position:z,gap:B,loadingIcon:V,expandByDefault:K,classNames:Y,icons:H,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:W}=e,[J,Q]=r.useState(null),[Z,G]=r.useState(null),[X,ee]=r.useState(!1),[et,en]=r.useState(!1),[er,ei]=r.useState(!1),[eo,ea]=r.useState(!1),[es,eu]=r.useState(!1),[ec,el]=r.useState(0),[ed,ef]=r.useState(0),eh=r.useRef(x.duration||F||4e3),ep=r.useRef(null),ev=r.useRef(null),eg=0===A,em=A+1<=T,ey=x.type,eb=!1!==x.dismissible,e_=x.className||"",ew=x.descriptionClassName||"",eE=r.useMemo(()=>P.findIndex(e=>e.toastId===x.id)||0,[P,x.id]),ex=r.useMemo(()=>{var e;return null!=(e=x.closeButton)?e:L},[x.closeButton,L]),eS=r.useMemo(()=>x.duration||F||4e3,[x.duration,F]),eI=r.useRef(0),ek=r.useRef(0),eT=r.useRef(0),eP=r.useRef(null),[eA,eC]=z.split("-"),eN=r.useMemo(()=>
1P.reduce((e,t,n)=>n>=eE?e:e+t.height,0),[P,eE]),eO=h(),eR=x.invert||E,eL="loading"===ey;ek.current=r.useMemo(()=>eE*B+eN,[eE,eN]),r.useEffect(()=>{eh.current=eS},[eS]),r.useEffect(()=>{ee(!0)},[]),r.useEffect(()=>{let e=ev.current;if(e){let t=e.getBoundingClientRect().height;return ef(t),k(e=>[{toastId:x.id,height:t,position:x.position},...e]),()=>k(e=>e.filter(e=>e.toastId!==x.id))}},[k,x.id]),r.useLayoutEffect(()=>{if(!X)return;let e=ev.current,t=e.style.height;e.style.height="auto";let n=e.getBoundingClientRect().height;e.style.height=t,ef(n),k(e=>e.find(e=>e.toastId===x.id)?e.map(e=>e.toastId===x.id?{...e,height:n}:e):[{toastId:x.id,height:n,position:x.position},...e])},[X,x.title,x.description,k,x.id]);let eD=r.useCallback(()=>{en(!0),el(ek.current),k(e=>e.filter(e=>e.toastId!==x.id)),setTimeout(()=>{O(x)},200)},[x,O,k,ek]);return r.useEffect(()=>{let e;if((!x.promise||"loading"!==ey)&&x.duration!==1/0&&"loading"!==x.type)return N||I||W&&eO?(()=>{if(eT.current<eI.current){let e=new Date().getTime()-eI.current;eh.current=eh.current-e}eT.current=new Date().getTime()})():eh.current!==1/0&&(eI.current=new Date().getTime(),e=setTimeout(()=>{var e;null==(e=x.onAutoClose)||e.call(x,x),eD()},eh.current)),()=>clearTimeout(e)},[N,I,x,ey,W,eO,eD]),r.useEffect(()=>{x.delete&&eD()},[eD,x.delete]),r.createElement("li",{tabIndex:0,ref:ev,className:b(q,e_,null==Y?void 0:Y.toast,null==(t=null==x?void 0:x.classNames)?void 0:t.toast,null==Y?void 0:Y.default,null==Y?void 0:Y[ey],null==(n=null==x?void 0:x.classNames)?void 0:n[ey]),"data-sonner-toast":"","data-rich-colors":null!=(i=x.richColors)?i:R,"data-styled":!(x.jsx||x.unstyled||S),"data-mounted":X,"data-promise":!!x.promise,"data-swiped":es,"data-removed":et,"data-visible":em,"data-y-position":eA,"data-x-position":eC,"data-index":A,"data-front":eg,"data-swiping":er,"data-dismissible":eb,"data-type":ey,"data-invert":eR,"data-swipe-out":eo,"data-swipe-direction":Z,"data-expanded":!!(N||K&&X),style:{"--index":A,"--toasts-before":A,"--z-index":C.length-A,"--offset":"".concat(et?ec:ek.current,"px"),"--initial-height":K?"auto":"".concat(ed,"px"),...D,...x.style},onPointerDown:e=>{eL||!eb||(ep.current=new Date,el(ek.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(ei(!0),eP.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,n,r;if(eo||!eb)return;eP.current=null;let i=Number((null==(e=ev.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),o=Number((null==(t=ev.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),a=new Date().getTime()-(null==(n=ep.current)?void 0:n.getTime()),s="x"===J?i:o;if(Math.abs(s)>=20||Math.abs(s)/a>.11){el(ek.current),null==(r=x.onDismiss)||r.call(x,x),G("x"===J?i>0?"right":"left":o>0?"down":"up"),eD(),ea(!0),eu(!1);return}ei(!1),Q(null)},onPointerMove:t=>{var n,r,i,o;if(!eP.current||!eb||(null==(n=window.getSelection())?void 0:n.toString().length)>0)return;let a=t.clientY-eP.current.y,s=t.clientX-eP.current.x,u=null!=(r=e.swipeDirections)?r:function(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}(z);!J&&(Math.abs(s)>1||Math.abs(a)>1)&&Q(Math.abs(s)>Math.abs(a)?"x":"y");let c={x:0,y:0};"y"===J?(u.includes("top")||u.includes("bottom"))&&(u.includes("top")&&a<0||u.includes("bottom")&&a>0)&&(c.y=a):"x"===J&&(u.includes("left")||u.includes("right"))&&(u.includes("left")&&s<0||u.includes("right")&&s>0)&&(c.x=s),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&eu(!0),null==(i=ev.current)||i.style.setProperty("--swipe-amount-x","".concat(c.x,"px")),null==(o=ev.current)||o.style.setProperty("--swipe-amount-y","".concat(c.y,"px"))}},ex&&!x.jsx?r.createElement("button",{"aria-label":$,"data-disabled":eL,"data-close-button":!0,onClick:eL||!eb?()=>{}:()=>{var e;eD(),null==(e=x.onDismiss)||e.call(x,x)},className:b(null==Y?void 0:Y.closeButton,null==(a=null==x?void 0:x.classNames)?void 0:a.closeButton)},null!=(u=null==H?void 0:H.close)?u:f):null,x.jsx||(0,r.isValidElement)(x.title)?x.jsx?x.jsx:"function"==typeof x.title?x.title():x.title:r.createElement(r.Fragment,null,ey||x.icon||x.promise?r.createElement("div",{"data-icon":"",className:b(null==Y?void 0:Y.icon,null==(c=null==x?void 0:x.classNames)?void 0:c.icon)},x.promise||"loading"===x.type&&!x.icon?x.icon||(null!=H&&H.loading?r.createElement("div",{className:b(null==Y?void 0:Y.loader,null==(m
1=null==x?void 0:x.classNames)?void 0:m.loader,"sonner-loader"),"data-visible":"loading"===ey},H.loading):V?r.createElement("div",{className:b(null==Y?void 0:Y.loader,null==(_=null==x?void 0:x.classNames)?void 0:_.loader,"sonner-loader"),"data-visible":"loading"===ey},V):r.createElement(s,{className:b(null==Y?void 0:Y.loader,null==(w=null==x?void 0:x.classNames)?void 0:w.loader),visible:"loading"===ey})):null,"loading"!==x.type?x.icon||(null==H?void 0:H[ey])||o(ey):null):null,r.createElement("div",{"data-content":"",className:b(null==Y?void 0:Y.content,null==(l=null==x?void 0:x.classNames)?void 0:l.content)},r.createElement("div",{"data-title":"",className:b(null==Y?void 0:Y.title,null==(d=null==x?void 0:x.classNames)?void 0:d.title)},"function"==typeof x.title?x.title():x.title),x.description?r.createElement("div",{"data-description":"",className:b(j,ew,null==Y?void 0:Y.description,null==(p=null==x?void 0:x.classNames)?void 0:p.description)},"function"==typeof x.description?x.description():x.description):null),(0,r.isValidElement)(x.cancel)?x.cancel:x.cancel&&y(x.cancel)?r.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||U,onClick:e=>{var t,n;y(x.cancel)&&eb&&(null==(n=(t=x.cancel).onClick)||n.call(t,e),eD())},className:b(null==Y?void 0:Y.cancelButton,null==(v=null==x?void 0:x.classNames)?void 0:v.cancelButton)},x.cancel.label):null,(0,r.isValidElement)(x.action)?x.action:x.action&&y(x.action)?r.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||M,onClick:e=>{var t,n;y(x.action)&&(null==(n=(t=x.action).onClick)||n.call(t,e),e.defaultPrevented||eD())},className:b(null==Y?void 0:Y.actionButton,null==(g=null==x?void 0:x.classNames)?void 0:g.actionButton)},x.action.label):null))};function w(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}var E=(0,r.forwardRef)(function(e,t){let{invert:n,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:s,closeButton:u,className:c,offset:l,mobileOffset:d,theme:f="light",richColors:h,duration:p,style:g,visibleToasts:m=3,toastOptions:y,dir:b=w(),gap:E=14,loadingIcon:x,icons:S,containerAriaLabel:I="Notifications",pauseWhenPageIsHidden:k}=e,[T,P]=r.useState([]),A=r.useMemo(()=>Array.from(new Set([o].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,o]),[C,N]=r.useState([]),[O,R]=r.useState(!1),[L,D]=r.useState(!1),[U,M]=r.useState("system"!==f?f:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=r.useRef(null),j=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=r.useRef(null),z=r.useRef(!1),B=r.useCallback(e=>{P(t=>{var n;return null!=(n=t.find(t=>t.id===e.id))&&n.delete||v.dismiss(e.id),t.filter(t=>{let{id:n}=t;return n!==e.id})})},[]);return r.useEffect(()=>v.subscribe(e=>{if(e.dismiss){P(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t));return}setTimeout(()=>{i.flushSync(()=>{P(t=>{let n=t.findIndex(t=>t.id===e.id);return -1!==n?[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]:[e,...t]})})})}),[]),r.useEffect(()=>{if("system"!==f){M(f);return}if("system"===f&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",e=>{let{matches:t}=e;M(t?"dark":"light")})}catch(t){e.addListener(e=>{let{matches:t}=e;try{M(t?"dark":"light")}catch(e){console.error(e)}})}},[f]),r.useEffect(()=>{T.length<=1&&R(!1)},[T]),r.useEffect(()=>{let e=e=>{var t,n;a.every(t=>e[t]||e.code===t)&&(R(!0),null==(t=q.current)||t.focus()),"Escape"===e.code&&(document.activeElement===q.current||null!=(n=q.current)&&n.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),r.useEffect(()=>{if(q.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,z.current=!1)}},[q.current]),r.createElement("section",{ref:t,"aria-label":"".concat(I," ").concat(j),tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((t,i)=>{var o;let a;let[f,v]=t.split("-");return T.length?r.createElement("ol",{key:t,dir:"auto"===b?w():b,tabIndex:-1,ref:q,className:c,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":f,"data-lifted":O&&T.length>1&&!s,"data-x-position":v,style:{"--front-toast-height":"".concat((null==(o=C[0])?void 0:o.height)||0,"px"),"--width":"".concat(356,"px"),"--gap":"".concat(E,"px"),...g,...(a={}
1,[l,d].forEach((e,t)=>{let n=1===t,r=n?"--mobile-offset":"--offset",i=n?"16px":"32px";function o(e){["top","right","bottom","left"].forEach(t=>{a["".concat(r,"-").concat(t)]="number"==typeof e?"".concat(e,"px"):e})}"number"==typeof e||"string"==typeof e?o(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?a["".concat(r,"-").concat(t)]=i:a["".concat(r,"-").concat(t)]="number"==typeof e[t]?"".concat(e[t],"px"):e[t]}):o(i)}),a)},onBlur:e=>{z.current&&!e.currentTarget.contains(e.relatedTarget)&&(z.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||z.current||(z.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{L||R(!1)},onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||D(!0)},onPointerUp:()=>D(!1)},T.filter(e=>!e.position&&0===i||e.position===t).map((i,o)=>{var a,c;return r.createElement(_,{key:i.id,icons:S,index:o,toast:i,defaultRichColors:h,duration:null!=(a=null==y?void 0:y.duration)?a:p,className:null==y?void 0:y.className,descriptionClassName:null==y?void 0:y.descriptionClassName,invert:n,visibleToasts:m,closeButton:null!=(c=null==y?void 0:y.closeButton)?c:u,interacting:L,position:t,style:null==y?void 0:y.style,unstyled:null==y?void 0:y.unstyled,classNames:null==y?void 0:y.classNames,cancelButtonStyle:null==y?void 0:y.cancelButtonStyle,actionButtonStyle:null==y?void 0:y.actionButtonStyle,removeToast:B,toasts:T.filter(e=>e.position==i.position),heights:C.filter(e=>e.position==i.position),setHeights:N,expandByDefault:s,gap:E,loadingIcon:x,expanded:O,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))})},16645:function(e,t,n){n.d(t,{useReadContracts:function(){return c}});var r=n(52237),i=n(40932),o=n(55444),a=n(54881),s=n(19357),u=n(73042);function c(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{contracts:n=[],query:c={}}=t,l=(0,u.useConfig)(t),d=(0,s.useChainId)({config:l}),f=function(e,t={}){return{async queryFn({queryKey:n}){let i=[],o=n[1].contracts.length;for(let e=0;e<o;e++){let r=n[1].contracts[e],o=(t.contracts?.[e]).abi;i.push({...r,abi:o})}let{scopeKey:a,...s}=n[1];return(0,r.J)(e,{...s,contracts:i})},queryKey:function(e={}){let t=[];for(let n of e.contracts??[]){let{abi:r,...i}=n;t.push({...i,chainId:i.chainId??e.chainId})}return["readContracts",(0,i.OP)({...e,contracts:t})]}(t)}}(l,{...t,chainId:d}),h=(0,o.useMemo)(()=>{var e;let t=!1;for(let e of n){let{abi:n,address:r,functionName:i}=e;if(!n||!r||!i){t=!1;break}t=!0}return!!(t&&(null===(e=c.enabled)||void 0===e||e))},[n,c.enabled]);return(0,a.aM)({...f,...c,enabled:h,structuralSharing:null!==(e=c.structuralSharing)&&void 0!==e?e:i.if})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.