1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{6489:function(e,u){"use strict";/*! 2 * cookie 3 * Copyright(c) 2012-2014 Roman Shtylman 4 * Copyright(c) 2015 Douglas Christopher Wilson 5 * MIT Licensed 6 */u.Q=function(e,u){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var b={},y=(u||{}).decode||decode,w=0;w<e.length;){var T=e.indexOf("=",w);if(-1===T)break;var _=e.indexOf(";",w);if(-1===_)_=e.length;else if(_<T){w=e.lastIndexOf(";",T-1)+1;continue}var P=e.slice(w,T).trim();if(void 0===b[P]){var R=e.slice(T+1,_).trim();34===R.charCodeAt(0)&&(R=R.slice(1,-1)),b[P]=function(e,u){try{return u(e)}catch(u){return e}}(R,y)}w=_+1}return b},u.q=function(e,u,w){var T=w||{},_=T.encode||encode;if("function"!=typeof _)throw TypeError("option encode is invalid");if(!y.test(e))throw TypeError("argument name is invalid");var P=_(u);if(P&&!y.test(P))throw TypeError("argument val is invalid");var R=e+"="+P;if(null!=T.maxAge){var D=T.maxAge-0;if(isNaN(D)||!isFinite(D))throw TypeError("option maxAge is invalid");R+="; Max-Age="+Math.floor(D)}if(T.domain){if(!y.test(T.domain))throw TypeError("option domain is invalid");R+="; Domain="+T.domain}if(T.path){if(!y.test(T.path))throw TypeError("option path is invalid");R+="; Path="+T.path}if(T.expires){var U=T.expires;if("[object Date]"!==b.call(U)&&!(U instanceof Date)||isNaN(U.valueOf()))throw TypeError("option expires is invali
6d");R+="; Expires="+U.toUTCString()}if(T.httpOnly&&(R+="; HttpOnly"),T.secure&&(R+="; Secure"),T.priority)switch("string"==typeof T.priority?T.priority.toLowerCase():T.priority){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(T.sameSite)switch("string"==typeof T.sameSite?T.sameSite.toLowerCase():T.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return R};var b=Object.prototype.toString,y=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function decode(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function encode(e){return encodeURIComponent(e)}},6840:function(e,u,b){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return b(3365)}])},481:function(e,u,b){"use strict";b.d(u,{z:function(){return Provider}});var y=b(5893),w=b(7294),T=b(708);let _=(0,w.createContext)({skipDoorslam:!0,setSkipDoorslam:e=>{}});function Provider(e){let{children:u}=e,[b,w]=(0,T.Z)(["skip_doorslam","abtest_web_organicdoorslam"]),P=(null==b?void 0:b.skip_doorslam)==="yes"||(null==b?void 0:b.skip_doorslam)===!0;return(0,y.jsx)(_.Provider,{value:{skipDoorslam:P,setSkipDoorslam:e=>{e?w("skip_doorslam","true"):w("skip_doorslam","false")}},children:u})}u.Z=_},5381:function(e,u,b){"use strict";b.d(u,{z:function(){return Provider}});var y=b(5893),w=b(7294);let T=(0,w.createContext)({podcast:null,setPodcast:e=>{},episode:null,setEpisode:e=>{},audioRef:null,setAudioRef:e=>{},isPlaying:!1,setIsPlaying:e=>{},duration:0,setDuration:e=>{},timeProgress:0,setTimeProgress:e=>{},volume:60,setVolume:e=>{},muteVolume:!1,setMuteVolume:e=>{},play:(e,u)=>{}});function Provider(e){let{children:u}=e,[b,_]=(0,w.useState)(null),[P,R]=(0,w.useState)(null),[D,U]=(0,w.useState)(null),[j,F]=(0,w.useState)(!1),[q,G]=(0,w.useState)(0),[B,J]=(0,w.useState)(0),[W,V]=(0,w.useState)(60),[H,z]=(0,w.useState)(!1);return(0,y.jsx)(T.Provider,{value:{podcast:P,setPodcast:R,episode:D,setEpisode:U,audioRef:b,setAudioRef:_,isPlaying:j,setIsPlaying:F,duration:q,setDuration:G,timeProgress:B,setTimeProgress:J,volume:W,setVolume:V,muteVolume:H,setMuteVolume:z,play:(e,u)=>{R(e),U(u),F(!0)}},children:u})}u.Z=T},2057:function(e,u,b){"use strict";b.d(u,{z:function(){return Provider}});var y=b(5893),w=b(7294);let T=(0,w.createContext)({showRegisterModal:e=>{},dismissRegisterModal:()=>{},registerModalVisible:!1,registerAction:()=>{}});function Provider(e){let{children:u}=e,[b,_]=(0,w.useState)(!1),[P,R]=(0,w.useState)(()=>{});return(0,y.jsx)(T.Provider,{value:{showRegisterModal:e=>{_(!0),R(()=>e)},dismissRegisterModal:()=>{_(!1),R(()=>{})},registerModalVisible:b,registerAction:P},children:u})}u.Z=T},647:function(e,u,b){"use strict";b.d(u,{z:function(){return Provider}});var y=b(5893),w=b(7294);let T=(0,w.createContext)({showToast:(e,u)=>{},dismissToast:()=>{},toastMessage:"",toastAction:()=>{}});function Provider(e){let{children:u}=e,[b,_]=(0,w.useState)(""),[P,R]=(0,w.useState)(()=>{});return(0,y.jsx)(T.Provider,{value:{showToast:(e,u)=>{_(e),R(()=>u),setTimeout(()=>{_(""),R(()=>{})},3e3)},dismissToast:()=>{_(""),R(()=>{})},toastMessage:b,toastAction:P},children:u})}u.Z=T},7563:function(e,u,b){"use strict";b.d(u,{z:function(){return Provider}});var y=b(5893),w=b(7294),T=b(708);let _=(0,w.createContext)({hasDismissedWebSubscribeExperiment:!1,setHasDismissedWebSubscribeExperiment:e=>{},isDisplayingFullDoorslam:!1,setIsDisplayingFullDoorslam:e=>{}});function Provider(e){let{children:u}=e,[b,P]=(0,T.Z)(["has_dismissed_web_subscribe_experiment"]),[R,D]=(0,w.useState)(!1),U=(null==b?void 0:b.has_dismissed_web_subscribe_experiment)==="yes"||(null==b?void 0:b.has_dismissed_web_subscribe_experiment)===!0;return(0,y.jsx)(_.Provider,{value:{hasDismissedWebSubscribeExperiment:U,setHasDismissedWebSubscribeExperiment:e=>{e?P("has_dismissed_web_subscribe_experiment","true"):P("has_dismissed_web_subscribe_experiment","false")},isDisplayingFullDoorslam:R,setIsDisplayingFullDoorslam:D},children:u})}u.Z=_}
6,1342:function(e,u,b){"use strict";Object.defineProperty(u,"__esModule",{value:!0}),function(e,u){for(var b in u)Object.defineProperty(e,b,{enumerable:!0,get:u[b]})}(u,{noSSR:function(){return noSSR},default:function(){return dynamic}});let y=b(8754),w=(b(7294),y._(b(4304)));function convertModule(e){return{default:(null==e?void 0:e.default)||e}}function noSSR(e,u){return delete u.webpack,delete u.modules,e(u)}function dynamic(e,u){let b=w.default,y={loading:e=>{let{error:u,isLoading:b,pastDelay:y}=e;return null}};e instanceof Promise?y.loader=()=>e:"function"==typeof e?y.loader=e:"object"==typeof e&&(y={...y,...e}),y={...y,...u};let T=y.loader;return(y.loadableGenerated&&(y={...y,...y.loadableGenerated},delete y.loadableGenerated),"boolean"!=typeof y.ssr||y.ssr)?b({...y,loader:()=>null!=T?T().then(convertModule):Promise.resolve(convertModule(()=>null))}):(delete y.webpack,delete y.modules,noSSR(b,y))}("function"==typeof u.default||"object"==typeof u.default&&null!==u.default)&&void 0===u.default.__esModule&&(Object.defineProperty(u.default,"__esModule",{value:!0}),Object.assign(u.default,u),e.exports=u.default)},43:function(e,u,b){"use strict";Object.defineProperty(u,"__esModule",{value:!0}),Object.defineProperty(u,"LoadableContext",{enumerable:!0,get:function(){return T}});let y=b(8754),w=y._(b(7294)),T=w.default.createContext(null)},4304:function(e,u,b){"use strict";/** 7@copyright (c) 2017-present James Kyle <[email protected]> 8 MIT License 9 Permission is hereby granted, free of charge, to any person obtaining 10a copy of this software and associated documentation files (the 11"Software"), to deal in the Software without restriction, including 12without limitation the rights to use, copy, modify, merge, publish, 13distribute, sublicense, and/or sell copies of the Software, and to 14permit persons to whom the Software is furnished to do so, subject to 15the following conditions: 16 The above copyright notice and this permission notice shall be 17included in all copies or substantial portions of the Software. 18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE 25*/Object.defineProperty(u,"__esModule",{value:!0}),Object.defineProperty(u,"default",{enumerable:!0,get:function(){return D}});let y=b(8754),w=y._(b(7294)),T=b(43),_=[],P=[],R=!1;function load(e){let u=e(),b={loading:!0,loaded:null,error:null};return b.promise=u.then(e=>(b.loading=!1,b.loaded=e,e)).catch(e=>{throw b.loading=!1,b.error=e,e}),b}let LoadableSubscription=class LoadableSubscription{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:u}=this;e.loading&&("number"==typeof u.delay&&(0===u.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},u.delay)),"number"==typeof u.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},u.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,u){this._loadFn=e,this._opts=u,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}};function Loadable(e){return function(e,u){let b=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},u),y=null;function init(){if(!y){let u=new LoadableSubscription(e,b);y={getCurrentValue:u.getCurrentValue.bind(u),subscribe:u.subscribe.bind(u),retry:u.retry.bind(u),promise:u.promise.bind(u)}}return y.promise()}if(!R){let e=b.webpack?b.webpack():b.modules;e&&P.push(u=>{for(let b of e)if(u.includes(b))return init()})}
25function LoadableComponent(e,u){!function(){init();let e=w.default.useContext(T.LoadableContext);e&&Array.isArray(b.modules)&&b.modules.forEach(u=>{e(u)})}();let _=w.default.useSyncExternalStore(y.subscribe,y.getCurrentValue,y.getCurrentValue);return w.default.useImperativeHandle(u,()=>({retry:y.retry}),[]),w.default.useMemo(()=>{var u;return _.loading||_.error?w.default.createElement(b.loading,{isLoading:_.loading,pastDelay:_.pastDelay,timedOut:_.timedOut,error:_.error,retry:y.retry}):_.loaded?w.default.createElement((u=_.loaded)&&u.default?u.default:u,e):null},[e,_])}return LoadableComponent.preload=()=>init(),LoadableComponent.displayName="LoadableComponent",w.default.forwardRef(LoadableComponent)}(load,e)}function flushInitializers(e,u){let b=[];for(;e.length;){let y=e.pop();b.push(y(u))}return Promise.all(b).then(()=>{if(e.length)return flushInitializers(e,u)})}Loadable.preloadAll=()=>new Promise((e,u)=>{flushInitializers(_).then(e,u)}),Loadable.preloadReady=e=>(void 0===e&&(e=[]),new Promise(u=>{let res=()=>(R=!0,u());flushInitializers(P,e).then(res,res)})),window.__NEXT_PRELOADREADY=Loadable.preloadReady;let D=Loadable},3365:function(e,u,b){"use strict";b.r(u),b.d(u,{default:function(){return App},reportWebVitals:function(){return reportWebVitals}});var y=b(5893);b(415),b(254);var w=b(5152),T=b.n(w),_=b(9008),P=b.n(_),R=b(1163),D=b(7294),U=b(5885),j=b(9347);let CookiesProvider=class CookiesProvider extends D.Component{constructor(e){super(e),e.cookies?this.cookies=e.cookies:this.cookies=new U.Z(void 0,e.defaultSetOptions)}render(){return D.createElement(j.zt,{value:this.cookies},this.props.children)}};var F=b(481),q=b(5381),G=b(2057),B=b(647),J=b(7563),context=function(e){let{children:u}=e;return(0,y.jsx)(G.z,{children:(0,y.jsx)(B.z,{children:(0,y.jsx)(J.z,{children:(0,y.jsx)(F.z,{children:(0,y.jsx)(q.z,{children:u})})})})})};let W=T()(()=>b.e(4413).then(b.bind(b,4413)),{loadableGenerated:{webpack:()=>[4413]},ssr:!1}),V=T()(()=>b.e(1403).then(b.bind(b,1403)),{loadableGenerated:{webpack:()=>[1403]},ssr:!1});var layout=function(e){let{children:u}=e;return(0,y.jsx)(CookiesProvider,{defaultSetOptions:{path:"/"},children:(0,y.jsxs)(context,{children:[(0,y.jsx)(V,{}),u,(0,y.jsx)(W,{})]})})},H=b(8403);let z=T()(()=>b.e(5072).then(b.bind(b,5072)),{loadableGenerated:{webpack:()=>[5072]},ssr:!1}),X=T()(()=>b.e(2987).then(b.bind(b,2987)),{loadableGenerated:{webpack:()=>[2987]},ssr:!1});function App(e){let{Component:u,pageProps:b}=e,w=(0,R.useRouter)(),T=(0,D.useRef)(!1),[_,U]=(0,D.useState)(!0);return(0,D.useEffect)(()=>{if(_&&w.isReady&&!T.current){let e=localStorage.getItem("accountId");T.current=!0,U(!1),e&&(0,H.jh)(e)}},[_,T,w.isReady]),(0,y.jsxs)(layout,{children:[(0,y.jsxs)(P(),{children:[(0,y.jsx)("meta",{httpEquiv:"x-ua-compatible",content:"ie=edge"}),(0,y.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0, user-scalable=0, viewport-fit=cover"})]}),(0,y.jsx)(z,{}),(0,y.jsx)(X,{}),(0,y.jsx)(u,{...b})]})}function reportWebVitals(e){"web-vital"===e.label&&window.gtag&&window.gtag("event",e.name,{value:Math.round("CLS"===e.name?1e3*e.value:e.value),event_label:e.id,non_interaction:!0})}},8403:function(e,u,b){"use strict";let y;b.d(u,{zz:function(){return analitycsEvent},bU:function(){return analitycsSearch},jh:function(){return analitycsSetUserId},q5:function(){return analitycsTap},tV:function(){return analitycsView},L:function(){return analitycsViewDoorslam}});var w,T,_,P,R,D,U,j,F,q,G,B,J,W,V,H,z,X,K,Z,Y=b(5518),Q=b(7582);(w=G||(G={}))[w.None=0]="None",w[w.Error=1]="Error",w[w.Warn=2]="Warn",w[w.Verbose=3]="Verbose",w[w.Debug=4]="Debug";var getStacktrace=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},getClientLogConfig=function(e){return function(){var u=(0,Q.pi)({},e.config);return{logger:u.loggerProvider,logLevel:u.logLevel}}},getValueByStringPath=function(e,u){var b,y;u=(u=u.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var w=(0,Q.XA)(u.split(".")),T=w.next();!T.done;T=w.next()){var _=T.value;if(!(_ in e))return;e=e[_]}}catch(e){b={error:e}}finally{try{T&&!T.done&&(y=w.return)&&y.call(w)}finally{if(b)throw b.error}}return e},getClientStates=function(e,u){return function(){var b,y,w={};try{for(var T=(0,Q.XA)(u),_=T.next();!_.done;_=T.next()){var P=_.value;w[P]=getValueByStringPath(e,P)}}catch(e){b={error:e}}finally{try{_&&!_.done&&(y=T.return)&&y.call(T)}finally{if(b)throw b.error}}return w}},debugWrapper=function(e,u,b,y,w){return void 0===w&&(w=null),function(){for(var T=[],_=0;_<arguments.length;_++)T[_]=arguments[_];var P=b(),R=P.logger,D=P.logLevel;if(D&&D<G.Debug||!D||!R)return e.apply(w,T);var U={type:"invoke public method",name:u,args:T,stacktrace:getStacktrace(1),time:{start:new Date().toISOString()},states:{}};y&&U.states&&(U.states.before=y());var j=e.apply(w,T);return j&&j.promise?j.promise.then(function(){y&&U.states&&(U.states.after=y()),U.time&&(U.time.end=new Date().toISOString()),R.debug(JSON.stringify(U,null,2))}):(y&&U.states&&(U.states.after=y()),U.time&&(U.time.end=new Date().toISOString()),R.debug(JSON.stringify(U,null,2))),j}},returnWrapper=function(e){return{promise:e||Promise.resolve()}},ee=function(){function RemoteConfigLocalStorage(e,u){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=u}return RemoteConfigLocalStorage.prototype.fetchConfig=function(){var e=null,u={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(u)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(u);try{var b=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(b))),Promise.resolve({remoteConfig:b.remoteConfig,lastFetch:new Date(b.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(u)}},RemoteConfigLocalStorage.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},RemoteConfigLocalStorage}(),getGlobalScope=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!==b.g?b.g:void 0},et=(0,Q.ev)([],(0,Q.CR)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),UUID=function(e){var u,b=getGlobalScope();if(!(null===(u=null==b?void 0:b.crypto)||void 0===u?void 0:u.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,UUID);var y=b.crypto.getRandomValues(new Uint8Array(16));return y[6]=15&y[6]|64,y[8]=63&y[8]|128,(0,Q.ev)([],(0,Q.CR)(y.entries()),!1).map(function(e){var u=(0,Q.CR)(e,2),b=u[0],y=u[1];return[4,6,8,10].includes(b)?"-".concat(et[y]):et[y]}).join("")},er=function(){function RemoteConfigClient(e,u,b,y){void 0===b&&(b="US"),this.callbackInfos=[],this.apiKey=e,this.serverUrl=y||("US"===b?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=u,this.storage=new ee(e,u)}return RemoteConfigClient.prototype.subscribe=function(e,u,b){var y=UUID(),w={id:y,key:e,deliveryMode:u,callback:b};return this.callbackInfos.push(w),"all"===u?this.subscribeAll(w):this.subscribeWaitForRemote(w,u.t
25imeout),y},RemoteConfigClient.prototype.unsubscribe=function(e){var u=this.callbackInfos.findIndex(function(u){return u.id===e});return -1===u?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(u,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},RemoteConfigClient.prototype.updateConfigs=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u=this;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:return[4,this.fetch()];case 1:return e=b.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(b){u.sendCallback(b,e,"remote")}),[2]}})})},RemoteConfigClient.prototype.subscribeAll=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y,w=this;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:return u=this.fetch().then(function(u){w.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(u))),w.sendCallback(e,u,"remote"),w.storage.setConfig(u)}),b=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([u,b])];case 1:return void 0!==(y=T.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(y))),this.sendCallback(e,y,"cache")),[4,u];case 2:return T.sent(),[2]}})})},RemoteConfigClient.prototype.subscribeWaitForRemote=function(e,u){return(0,Q.mG)(this,void 0,void 0,function(){var b,y;return(0,Q.Jh)(this,function(w){switch(w.label){case 0:b=new Promise(function(e,b){setTimeout(function(){b("Timeout exceeded")},u)}),w.label=1;case 1:return w.trys.push([1,3,,5]),[4,Promise.race([this.fetch(),b])];case 2:return y=w.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,y,"remote"),this.storage.setConfig(y),[3,5];case 3:return w.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(y=w.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,y,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,y,"remote")),[3,5];case 5:return[2]}})})},RemoteConfigClient.prototype.sendCallback=function(e,u,b){var y;e.lastCallback=new Date,y=e.key?e.key.split(".").reduce(function(e,u){return null===e?e:u in e?e[u]:null},u.remoteConfig):u.remoteConfig,e.callback(y,b,u.lastFetch)},RemoteConfigClient.prototype.fetch=function(e,u){return void 0===e&&(e=3),void 0===u&&(u=1e3),(0,Q.mG)(this,void 0,void 0,function(){var b,y,w,T,_,P,R=this;return(0,Q.Jh)(this,function(D){switch(D.label){case 0:b=u/e,y={remoteConfig:null,lastFetch:new Date},w=function(y){var w,_,P,D,U;return(0,Q.Jh)(this,function(j){switch(j.label){case 0:w=new AbortController,_=setTimeout(function(){return w.abort()},u),j.label=1;case 1:return j.trys.push([1,7,8,9]),[4,fetch(T.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:w.signal})];case 2:if((P=j.sent()).ok)return[3,4];return[4,P.text()];case 3:return D=j.sent(),T.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(P.status,": ").concat(D)),[3,6];case 4:return[4,P.json()];case 5:return[2,{value:{remoteConfig:j.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(U=j.sent())instanceof Error&&"AbortError"===U.name?T.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(u,"ms")):T.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),U),[3,9];case 8:return clearTimeout(_),[7];case 9:if(!(y<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,R.getJitterDelay(b))})];case 10:j.sent(),j.label=11;case 11:return[2]}})},T=this,_=0,D.label=1;case 1:if(!(_<e))return[3,4];return[5,w(_)];case 2:if("object"==typeof(P=D.sent()))return[2,P.value];D.label=3;case 3:return _++,[3,1];case 4:return[2,y]}})})},RemoteConfigClient.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},RemoteConfigClient.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),u=new URLSearchParams;return u.append("config_group",RemoteConfigClient.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(e,"?").concat(u.toString())},RemoteConfigClient.CONFIG_GROUP="browser",RemoteConfigClient}(),en={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},ei={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},eo=function(){function DiagnosticsStorage(e,u){this.dbPromise=null,this.logger=u,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}
25return DiagnosticsStorage.isSupported=function(){var e;return(null===(e=getGlobalScope())||void 0===e?void 0:e.indexedDB)!==void 0},DiagnosticsStorage.prototype.getDB=function(){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},DiagnosticsStorage.prototype.openDB=function(){var e=this;return new Promise(function(u,b){var y=indexedDB.open(e.dbName,1);y.onerror=function(){e.dbPromise=null,b(Error("Failed to open IndexedDB"))},y.onsuccess=function(){var b=y.result;b.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},b.onerror=function(u){e.logger.debug("DiagnosticsStorage: A global database error occurred.",u),b.close()},u(b)},y.onupgradeneeded=function(u){var b=u.target.result;e.createTables(b)}})},DiagnosticsStorage.prototype.createTables=function(e){e.objectStoreNames.contains(en.TAGS)||e.createObjectStore(en.TAGS,{keyPath:"key"}),e.objectStoreNames.contains(en.COUNTERS)||e.createObjectStore(en.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains(en.HISTOGRAMS)||e.createObjectStore(en.HISTOGRAMS,{keyPath:"key"}),e.objectStoreNames.contains(en.EVENTS)||e.createObjectStore(en.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(en.INTERNAL)||e.createObjectStore(en.INTERNAL,{keyPath:"key"})},DiagnosticsStorage.prototype.setTags=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y,w=this;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:if(T.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return b=(u=T.sent().transaction([en.TAGS],"readwrite")).objectStore(en.TAGS),[2,new Promise(function(y){var T=Object.entries(e);u.oncomplete=function(){y()},u.onabort=function(e){w.logger.debug("DiagnosticsStorage: Failed to set tags",e),y()},T.forEach(function(e){var u=(0,Q.CR)(e,2),y=u[0],T=u[1];b.put({key:y,value:T}).onerror=function(e){w.logger.debug("DiagnosticsStorage: Failed to set tag",y,T,e)}})})];case 2:return y=T.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",y),[3,3];case 3:return[2]}})})},DiagnosticsStorage.prototype.incrementCounters=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y,w=this;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:if(T.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return b=(u=T.sent().transaction([en.COUNTERS],"readwrite")).objectStore(en.COUNTERS),[2,new Promise(function(y){var T=Object.entries(e);u.oncomplete=function(){y()},u.onabort=function(e){w.logger.debug("DiagnosticsStorage: Failed to increment counters",e),y()},T.forEach(function(e){var u=(0,Q.CR)(e,2),y=u[0],T=u[1],_=b.get(y);_.onsuccess=function(){var e=_.result,u=e?e.value:0;b.put({key:y,value:u+T}).onerror=function(e){w.logger.debug("DiagnosticsStorage: Failed to update counter",y,e)}},_.onerror=function(e){w.logger.debug("DiagnosticsStorage: Failed to read existing counter",y,e)}})})];case 2:return y=T.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",y),[3,3];case 3:return[2]}})})},DiagnosticsStorage.prototype.setHistogramStats=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y,w=this;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:if(T.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return b=(u=T.sent().transaction([en.HISTOGRAMS],"readwrite")).objectStore(en.HISTOGRAMS),[2,new Promise(function(y){var T=Object.entries(e);u.oncomplete=function(){y()},u.onabort=function(e){w.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),y()},T.forEach(function(e){var u=(0,Q.CR)(e,2),y=u[0],T=u[1],_=b.get(y);_.onsuccess=function(){var e,u=_.result;e=u?{key:y,count:u.count+T.count,min:Math.min(u.min,T.min),max:Math.max(u.max,T.max),sum:u.sum+T.sum}:{key:y,count:T.count,min:T.min,max:T.max,sum:T.sum},b.put(e).onerror=function(e){w.logger.debug("DiagnosticsStorage: Failed to set histogram stats",y,e)}},_.onerror=function(e){w.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",y,e)}})})];case 2:return y=T.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",y),[3,3];case 3:return[2]}})})},DiagnosticsStorage.prototype.addEventRecords=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y,w=this;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:if(T.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return b=(u=T.sent().transaction([en.EVENTS],"readwrite")).objectStore(en.EVENTS),[2,new Promise(function(y){u.oncomplete=function(){y()},u.onabort=function(e){w.logger.debug("DiagnosticsStorage: Failed to add event records",e),y()};var T=b.count();T.onsuccess=function(){var u=Math.max(0,10-T.result);u<e.length&&w.logger.debug("DiagnosticsStorage: Only added ".concat(u," of ").concat(e.length," events due to storage limit")),e.slice(0,u).forEach(function(e){b.add(e).onerror=function(e){w.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},T.onerror=function(e){w.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return y=T.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",y),[3,3];case 3:return[2]}})})},DiagnosticsStorage.prototype.setInternal=function(e,u){return(0,Q.mG)(this,void 0,void 0,function(){var b,y,w;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:return T.trys.push([0,2,,3]),[4,this.getDB()];case 1:return y=(b=T.sent().transaction([en.INTERNAL],"readwrite")).objectStore(en.INTERNAL),[2,new Promise(function(w,T){b.onabort=function(){return T(Error("Failed to set internal value"))};var _=y.put({key:e,value:u});_.onsuccess=function(){return w()},_.onerror=function(){return T(Error("Failed to set internal value"))}})];case 2:return w=T.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",w),[3,3];case 3:return[2]}})})},DiagnosticsStorage.prototype.getInternal=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y;return(0,Q.Jh)(this,function(w){switch(w.label){case 0:return w.trys.push([0,2,,3]),[4,this.getDB()];case 1:return b=(u=w.sent().transaction([en.INTERNAL],"readonly")).objectStore(en.INTERNAL),[2,new Promise(function(y,w){u.onabort=function(){return w(Error("Failed to get internal value"))};var T=b.get(e);T.onsuccess=function(){return y(T.result)},T.onerror=function(){return w(Error("Failed to get internal value"))}})];case 2:return y=w.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",y),[2,void 0];case 3:return[2]}})})},DiagnosticsStorage.prototype.getLastFlushTimestamp=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:return b.trys.push([0,2,,3]),[4,this.getInternal(ei.LAST_FLUSH_TIMESTAMP)];case 1:return[2,(e=b.sent())?parseInt(e.value,10):void 0];case 2:return u=b.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",u),[2,void 0];case 3:return[2]}})})},DiagnosticsStorage.prototype.setLastFlushTimestamp=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:return b.trys.push([0,2,,3]),[4,this.setInternal(ei.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return b.sent(),[3,3];case 2:return u=b.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",u),[3,3];case 3:return[2]}})})},DiagnosticsStorage.prototype.clearTable=function(e,u){return new Promise(function(b,y){var w=e.objectStore(u).clear();w.onsuccess=function(){return b()},w.onerror=function(){return y(Error("Failed to clear table ".concat(u)))}})},DiagnosticsStorage.prototype.getAllAndClear=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u,b,y,w,T,_;return(0,Q.Jh)(this,function(P){switch(P.label){case 0:return P.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=P.sent().transaction([en.TAGS,en.COUNTERS,en.HISTOGRAMS,en.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(e,en.TAGS),this.getAllFromStore(e,en.COUNTERS),this.getAllFromStore(e,en.HISTOGRAMS),this.getAllFromStore(e,en.EVENTS)])];case 2:return b=(u=Q.CR.apply(void 0,[P.sent(),4]))[0],y=u[1],w=u[2],T=u[3],[4,Promise.all([this.clearTable(e,en.COUNTERS),this.clearTable(e,en.HISTOGRAMS),this.clearTable(e,en.EVENTS)])];case 3:return P.sent(),[2,{tags:b,counters:y,histogramStats:w,events:T}];case 4:return _=P.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",_),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},DiagnosticsStorage.prototype.getAllFromStore=function(e,u){return new Promise(function(b,y){var w=e.objectStore(u).getAll();w.onsuccess=function(){return b(w.result)},w.onerror=function(){return y(Error("Failed to get all from ".concat(u)))}})},DiagnosticsStorage}(),generateHashCode=function(e){var u=0;if(0===e.length)return u;for(var b=0;b<e.length;b++)u=(u<<5)-u+e.charCodeAt(b)|0;return u}
25,isTimestampInSampleTemp=function(e,u){return 31*Math.abs(generateHashCode(e.toString()))%1e5/1e5<u},es=function(){function DiagnosticsClient(e,u,b,y){void 0===b&&(b="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=u,this.serverUrl="US"===b?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(y,null,2)),this.config=(0,Q.pi)({enabled:!0,sampleRate:0},y),this.startTimestamp=Date.now(),this.shouldTrack=isTimestampInSampleTemp(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,eo.isSupported()?this.storage=new eo(e,u):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&this.increment("sdk.diagnostics.sampled.in.and.enabled")}return DiagnosticsClient.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},DiagnosticsClient.prototype.setTag=function(e,u){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}this.inMemoryTags[e]=u,this.startTimersIfNeeded()}},DiagnosticsClient.prototype.increment=function(e,u){if(void 0===u&&(u=1),this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+u,this.startTimersIfNeeded()}},DiagnosticsClient.prototype.recordHistogram=function(e,u){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=1e4){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var b=this.inMemoryHistograms[e];b?(b.count+=1,b.min=Math.min(b.min,u),b.max=Math.max(b.max,u),b.sum+=u):this.inMemoryHistograms[e]={count:1,min:u,max:u,sum:u},this.startTimersIfNeeded()}},DiagnosticsClient.prototype.recordEvent=function(e,u){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:u}),this.startTimersIfNeeded()}},DiagnosticsClient.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(u){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",u)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(u){e.logger.debug("DiagnosticsClient: Failed to flush",u)}).finally(function(){e.flushTimer=null})},3e5))},DiagnosticsClient.prototype.saveAllDataToStorage=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u,b,y;return(0,Q.Jh)(this,function(w){switch(w.label){case 0:if(!this.storage)return[2];return e=(0,Q.pi)({},this.inMemoryTags),u=(0,Q.pi)({},this.inMemoryCounters),b=(0,Q.pi)({},this.inMemoryHistograms),y=(0,Q.ev)([],(0,Q.CR)(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(u),this.storage.setHistogramStats(b),this.storage.addEventRecords(y)])];case 1:return w.sent(),[2]}})})},DiagnosticsClient.prototype._flush=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u,b,y,w,T,_,P,R,D;return(0,Q.Jh)(this,function(U){switch(U.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return U.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(u=(e=U.sent()).tags,b=e.counters,y=e.histogramStats,w=e.events,this.storage.setLastFlushTimestamp(Date.now()),T={},u.forEach(function(e){T[e.key]=e.value}),_={},b.forEach(function(e){_[e.key]=e.value}),P={}
25,y.forEach(function(e){P[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),R=w.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(_).length&&0===Object.keys(P).length&&0===R.length)return[2];return D={tags:T,histogram:P,counters:_,events:R},this.fetch(D),[2]}})})},DiagnosticsClient.prototype.fetch=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:if(b.trys.push([0,2,,3]),!getGlobalScope())throw Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:if(!b.sent().ok)return this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2];return this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3];case 2:return u=b.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",u),[3,3];case 3:return[2]}})})},DiagnosticsClient.prototype.initializeFlushInterval=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u,b;return(0,Q.Jh)(this,function(y){switch(y.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(u=y.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(b=e-u)>=3e5?this._flush():this._setFlushTimer(3e5-b),[2]}})})},DiagnosticsClient.prototype._setFlushTimer=function(e){var u=this;this.flushTimer=setTimeout(function(){u._flush().catch(function(e){u.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){u.flushTimer=null})},e)},DiagnosticsClient.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=isTimestampInSampleTemp(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},DiagnosticsClient}(),getQueryParams=function(){var e,u=getGlobalScope();return(null===(e=null==u?void 0:u.location)||void 0===e?void 0:e.search)?u.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,u){var b=u.split("=",2),y=tryDecodeURIComponent(b[0]),w=tryDecodeURIComponent(b[1]);return w&&(e[y]=w),e},{}):{}},tryDecodeURIComponent=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},ea=function(){function ApplicationContextProviderImpl(){}return ApplicationContextProviderImpl.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:getLanguage(),platform:"Web",os:void 0,deviceModel:void 0}},ApplicationContextProviderImpl}(),getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},eu=function(){function EventBridgeImpl(){this.queue=[]}return EventBridgeImpl.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},EventBridgeImpl.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(u){e(u)}),this.queue=[])},EventBridgeImpl}(),__assign=function(){return(__assign=Object.assign||function(e){for(var u,b=1,y=arguments.length;b<y;b++)for(var w in u=arguments[b])Object.prototype.hasOwnProperty.call(u,w
25)&&(e[w]=u[w]);return e}).apply(this,arguments)};function __values(e){var u="function"==typeof Symbol&&Symbol.iterator,b=u&&e[u],y=0;if(b)return b.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&y>=e.length&&(e=void 0),{value:e&&e[y++],done:!e}}};throw TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,u){var b="function"==typeof Symbol&&e[Symbol.iterator];if(!b)return e;var y,w,T=b.call(e),_=[];try{for(;(void 0===u||u-- >0)&&!(y=T.next()).done;)_.push(y.value)}catch(e){w={error:e}}finally{try{y&&!y.done&&(b=T.return)&&b.call(T)}finally{if(w)throw w.error}}return _}"function"==typeof SuppressedError&&SuppressedError;var isEqual=function(e,u){var b,y,w=typeof e;if(w!==typeof u)return!1;try{for(var T=__values(["string","number","boolean","undefined"]),_=T.next();!_.done;_=T.next())if(_.value===w)return e===u}catch(e){b={error:e}}finally{try{_&&!_.done&&(y=T.return)&&y.call(T)}finally{if(b)throw b.error}}if(null==e&&null==u)return!0;if(null==e||null==u||e.length!==u.length)return!1;var P=Array.isArray(e),R=Array.isArray(u);if(P!==R)return!1;if(P&&R){for(var D=0;D<e.length;D++)if(!isEqual(e[D],u[D]))return!1}else{if(!isEqual(Object.keys(e).sort(),Object.keys(u).sort()))return!1;var U=!0;return Object.keys(e).forEach(function(b){isEqual(e[b],u[b])||(U=!1)}),U}return!0};Object.entries||(Object.entries=function(e){for(var u=Object.keys(e),b=u.length,y=Array(b);b--;)y[b]=[u[b],e[u[b]]];return y});var el=function(){function IdentityStoreImpl(){this.identity={userProperties:{}},this.listeners=new Set}return IdentityStoreImpl.prototype.editIdentity=function(){var e=this,u=__assign({},this.identity.userProperties),b=__assign(__assign({},this.identity),{userProperties:u});return{setUserId:function(e){return b.userId=e,this},setDeviceId:function(e){return b.deviceId=e,this},setUserProperties:function(e){return b.userProperties=e,this},setOptOut:function(e){return b.optOut=e,this},updateUserProperties:function(e){var u,y,w,T,_,P,R=b.userProperties||{};try{for(var D=__values(Object.entries(e)),U=D.next();!U.done;U=D.next()){var j=__read(U.value,2),F=j[0],q=j[1];switch(F){case"$set":try{for(var G=(w=void 0,__values(Object.entries(q))),B=G.next();!B.done;B=G.next()){var J=__read(B.value,2),W=J[0],V=J[1];R[W]=V}}catch(e){w={error:e}}finally{try{B&&!B.done&&(T=G.return)&&T.call(G)}finally{if(w)throw w.error}}break;case"$unset":try{for(var H=(_=void 0,__values(Object.keys(q))),z=H.next();!z.done;z=H.next()){var W=z.value;delete R[W]}}catch(e){_={error:e}}finally{try{z&&!z.done&&(P=H.return)&&P.call(H)}finally{if(_)throw _.error}}break;case"$clearAll":R={}}}}catch(e){u={error:e}}finally{try{U&&!U.done&&(y=D.return)&&y.call(D)}finally{if(u)throw u.error}}return b.userProperties=R,this},commit:function(){return e.setIdentity(b),this}}},IdentityStoreImpl.prototype.getIdentity=function(){return __assign({},this.identity)},IdentityStoreImpl.prototype.setIdentity=function(e){var u=__assign({},this.identity);this.identity=__assign({},e),isEqual(u,this.identity)||this.listeners.forEach(function(u){u(e)})},IdentityStoreImpl.prototype.addIdentityListener=function(e){this.listeners.add(e)},IdentityStoreImpl.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},IdentityStoreImpl}(),ec="undefined"!=typeof globalThis?globalThis:void 0!==b.g?b.g:self,ed=function(){function AnalyticsConnector(){this.identityStore=new el,this.eventBridge=new eu,this.applicationContextProvider=new ea}return AnalyticsConnector.getInstance=function(e){return ec.analyticsConnectorInstances||(ec.analyticsConnectorInstances={}),ec.analyticsConnectorInstances[e]||(ec.analyticsConnectorInstances[e]=new AnalyticsConnector),ec.analyticsConnectorInstances[e]},AnalyticsConnector}(),ep="".concat("AMP","_unsent"),ef="$default_instance",eh="https://api2.amplitude.com/2/httpapi",eg="dclid",ev="fbclid",em="gbraid",eb="gclid",ey="ko_click_id",ew="li_fat_id",eS="msclkid",eE="rdt_cid",eC="ttclid",ek="twclid",eT="wbraid",e_={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},eI=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],eA=["authorization","cookie","set-cookie"],getAnalyticsConnector=function(e){return void 0===e&&(e=ef),ed.getInstance(e)},setConnectorUserId=function(e,u){getAnalyticsConnector(u).identityStore.editIdentity().setUserId(e).commit()},setConnectorDeviceId=function(e,u){getAnalyticsConnector(u).identityStore.editIdentity().setDeviceId(e).commit()};(T=B||(B={})).Unknown="unknown",T.Skipped="skipped",T.Success="success",T.RateLimit="rate_limit",T.PayloadTooLarge="payload_too_large",T.Invalid="invalid",T.Failed="failed",T.Timeout="Timeout",T.SystemError="SystemError";var chunk=function(e,u){var b=Math.max(u,1);return e.reduce(function(e,u,y){var w=Math.floor(y/b);return e[w]||(e[w]=[]),e[w].push(u),e},[])},buildResult=function(e,u,b){return void 0===u&&(u=0),void 0===b&&(b=B.Unknown),{event:e,code:u,message:b}},ex="Amplitude Logger ",eP=function(){function Logger(){this.logLevel=G.None}return Logger.prototype.disable=function(){this.logLevel=G.None},Logger.prototype.enable=function(e){void 0===e&&(e=G.Warn),this.logLevel=e},Logger.prototype.log=function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];this.logLevel<G.Verbose||console.log("".concat(ex,"[Log]: ").concat(e.join(" ")))},Logger.prototype.warn=function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];this.logLevel<G.Warn||console.warn("".concat(ex,"[Warn]: ").concat(e.join(" ")))},Logger.prototype.error=function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];this.logLevel<G.Error||console.error("".concat(ex,"[Error]: ").concat(e.join(" ")))},Logger.prototype.debug=function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];this.logLevel<G.Debug||console.log("".concat(ex,"[Debug]: ").concat(e.join(" ")))},Logger}(),getDefaultConfig=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:ef,logLevel:G.Warn,loggerProvider:new eP,offline:!1,optOut:!1,serverUrl:eh,serverZone:"US",useBatch:!1}},eO=function(){function Config(e){this._optOut=!1;var u,b,y,w,T=getDefaultConfig();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(u=e.flushIntervalMillis)&&void 0!==u?u:T.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||T.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||T.flushQueueSize,this.instanceName=e.instanceName||T.instanceName,this.loggerProvider=e.loggerProvider||T.loggerProvider,this.logLevel=null!==(b=e.logLevel)&&void 0!==b?b:T.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:T.offline,this.optOut=null!==(y=e.optOut)&&void 0!==y?y:T.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||T.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(w=e.useBatch)&&void 0!==w?w:T.useBatch,this.loggerProvider.enable(this.logLevel);var _=createServerConfig(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=_.serverZone,this.serverUrl=_.serverUrl}return Object.defineProperty(Config.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
25,enumerable:!1,configurable:!0}),Config}(),createServerConfig=function(e,u,b){if(void 0===e&&(e=""),void 0===u&&(u=getDefaultConfig().serverZone),void 0===b&&(b=getDefaultConfig().useBatch),e)return{serverUrl:e,serverZone:void 0};var y,w=["US","EU"].includes(u)?u:getDefaultConfig().serverZone;return{serverZone:w,serverUrl:(y=b,"EU"===w?y?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":y?"https://api2.amplitude.com/batch":eh)}},eR=function(){function RequestMetadata(){this.sdk={metrics:{histogram:{}}}}return RequestMetadata.prototype.recordHistogram=function(e,u){this.sdk.metrics.histogram[e]=u},RequestMetadata}();function isSuccessStatusCode(e){return e>=200&&e<300}function getResponseBodyString(e){var u="";try{"body"in e&&(u=JSON.stringify(e.body,null,2))}catch(e){}return u}var eD=function(){function Destination(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return Destination.prototype.setup=function(e){var u;return(0,Q.mG)(this,void 0,void 0,function(){var b,y=this;return(0,Q.Jh)(this,function(w){switch(w.label){case 0:return this.config=e,this.storageKey="".concat(ep,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(u=this.config.storageProvider)||void 0===u?void 0:u.get(this.storageKey)];case 1:return(b=w.sent())&&b.length>0&&Promise.all(b.map(function(e){return y.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},Destination.prototype.execute=function(e){var u=this;return e.insert_id||(e.insert_id=UUID()),new Promise(function(b){u.queue.push({event:e,attempts:0,callback:function(e){return b(e)},timeout:0}),u.schedule(u.config.flushIntervalMillis),u.saveEvents()})},Destination.prototype.removeEventsExceedFlushMaxRetries=function(e){var u=this;return e.filter(function(e){return e.attempts+=1,e.attempts<u.config.flushMaxRetries||(u.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},Destination.prototype.scheduleEvents=function(e){var u=this;e.forEach(function(e){u.schedule(0===e.timeout?u.config.flushIntervalMillis:e.timeout)})},Destination.prototype.schedule=function(e){var u=this;if(!this.config.offline&&(null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){u.queue=u.queue.map(function(e){return e.timeout=0,e}),u.flush(!0)},e);return}},Destination.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},Destination.prototype.flush=function(e){return void 0===e&&(e=!1),(0,Q.mG)(this,void 0,void 0,function(){var u,b,y=this;return(0,Q.Jh)(this,function(w){switch(w.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),u=[],b=[],this.queue.forEach(function(e){return 0===e.timeout?u.push(e):b.push(e)}),[4,chunk(u,this.config.flushQueueSize).reduce(function(u,b){return(0,Q.mG)(y,void 0,void 0,function(){return(0,Q.Jh)(this,function(y){switch(y.label){case 0:return[4,u];case 1:return y.sent(),[4,this.send(b,e)];case 2:return[2,y.sent()]}})})},Promise.resolve())];case 1:return w.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},Destination.prototype.send=function(e,u){return void 0===u&&(u=!0),(0,Q.mG)(this,void 0,void 0,function(){var b,y,w,T;return(0,Q.Jh)(this,function(_){switch(_.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];b={api_key:this.config.apiKey,events:e.map(function(e){var u=e.event;return u.extra,(0,Q._T)(u,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new eR,_.label=1;case 1:return _.trys.push([1,3,,4]),y=createServerConfig(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(y,b)];case 2:if(null===(w=_.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!u)return"body"in w?this.fulfillRequest(e,w.statusCode,"".concat(w.status,": ").concat(getResponseBodyString(w))):this.fulfillRequest(e,w.statusCode,w.status),[2];return this.handleResponse(w,e),[3,4];case 3:var P;return T=(P=_.sent())instanceof Error?P.message:String(P),this.config.loggerProvider.error(T),this.handleResponse({status:B.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},Destination.prototype.handleResponse=function(e,u){var b=e.status;switch(b){case B.Success:this.handleSuccessResponse(e,u);break;case B.Invalid:this.handleInvalidResponse(e,u);break;case B.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,u);break;case B.RateLimit:this.handleRateLimitResponse(e,u);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(b,"' provided for ").concat(u.length,' events"}')),this.handleOtherResponse(u)}},Destination.prototype.handleSuccessResponse=function(e,u){this.fulfillRequest(u,e.statusCode,"Event tracked successfully")},Destination.prototype.handleInvalidResponse=function(e,u){var b=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key")){this.fulfillRequest(u,e.statusCode,e.body.error);return}var y=(0,Q.ev)((0,Q.ev)((0,Q.ev)((0,Q.ev)([],(0,Q.CR)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,Q.CR)(Object.values(e.body.eventsWithMissingFields)),!1),(0,Q.CR)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,Q.CR)(e.body.silencedEvents),!1).flat(),w=new Set(y),T=u.filter(function(u,y){if(w.has(y)){b.fulfillRequest([u],e.statusCode,e.body.error);return}return!0});T.length>0&&this.config.loggerProvider.warn(getResponseBodyString(e));
25var _=this.removeEventsExceedFlushMaxRetries(T);this.scheduleEvents(_)},Destination.prototype.handlePayloadTooLargeResponse=function(e,u){if(1===u.length){this.fulfillRequest(u,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(getResponseBodyString(e)),this.config.flushQueueSize/=2;var b=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(b)},Destination.prototype.handleRateLimitResponse=function(e,u){var b=this,y=Object.keys(e.body.exceededDailyQuotaUsers),w=Object.keys(e.body.exceededDailyQuotaDevices),T=e.body.throttledEvents,_=new Set(y),P=new Set(w),R=new Set(T),D=u.filter(function(u,y){if(u.event.user_id&&_.has(u.event.user_id)||u.event.device_id&&P.has(u.event.device_id)){b.fulfillRequest([u],e.statusCode,e.body.error);return}return R.has(y)&&(u.timeout=b.throttleTimeout),!0});D.length>0&&this.config.loggerProvider.warn(getResponseBodyString(e));var U=this.removeEventsExceedFlushMaxRetries(D);this.scheduleEvents(U)},Destination.prototype.handleOtherResponse=function(e){var u=this,b=e.map(function(e){return e.timeout=e.attempts*u.retryTimeout,e}),y=this.removeEventsExceedFlushMaxRetries(b);this.scheduleEvents(y)},Destination.prototype.fulfillRequest=function(e,u,b){var y,w,T;isSuccessStatusCode(u)?null===(T=this.diagnosticsClient)||void 0===T||T.increment("analytics.events.sent",e.length):(null===(y=this.diagnosticsClient)||void 0===y||y.increment("analytics.events.dropped",e.length),null===(w=this.diagnosticsClient)||void 0===w||w.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:u,message:b,stack_trace:getStacktrace()})),this.removeEvents(e),e.forEach(function(e){return e.callback(buildResult(e.event,u,b))})},Destination.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},Destination.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(u){return!e.some(function(e){return e.event.insert_id===u.event.insert_id})}),this.saveEvents()},Destination}(),eL=function(){function IdentityEventSender(){this.name="identity",this.type="before",this.identityStore=getAnalyticsConnector().identityStore}return IdentityEventSender.prototype.execute=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u;return(0,Q.Jh)(this,function(b){return(u=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(u).commit(),[2,e]})})},IdentityEventSender.prototype.setup=function(e){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return e.instanceName&&(this.identityStore=getAnalyticsConnector(e.instanceName).identityStore),[2]})})},IdentityEventSender}(),isValidObject=function(e){if(Object.keys(e).length>1e3)return!1;for(var u in e){var b=e[u];if(!isValidProperties(u,b))return!1}return!0},isValidProperties=function(e,u){var b,y;if("string"!=typeof e)return!1;if(Array.isArray(u)){var w=!0;try{for(var T=(0,Q.XA)(u),_=T.next();!_.done;_=T.next()){var P=_.value;if(Array.isArray(P))return!1;if("object"==typeof P)w=w&&isValidObject(P);else if(!["number","string"].includes(typeof P))return!1;if(!w)return!1}}catch(e){b={error:e}}finally{try{_&&!_.done&&(y=T.return)&&y.call(T)}finally{if(b)throw b.error}}}else if(null==u)return!1;else if("object"==typeof u)return isValidObject(u);else if(!["number","string","boolean"].includes(typeof u))return!1;return!0},eN=function(){function Identify(){this._propertySet=new Set,this._properties={}}return Identify.prototype.getUserProperties=function(){return(0,Q.pi)({},this._properties)},Identify.prototype.set=function(e,u){return this._safeSet(J.SET,e,u),this},Identify.prototype.setOnce=function(e,u){return this._safeSet(J.SET_ONCE,e,u),this},Identify.prototype.append=function(e,u){return this._safeSet(J.APPEND,e,u),this},Identify.prototype.prepend=function(e,u){return this._safeSet(J.PREPEND,e,u),this},Identify.prototype.postInsert=function(e,u){return this._safeSet(J.POSTINSERT,e,u),this},Identify.prototype.preInsert=function(e,u){return this._safeSet(J.PREINSERT,e,u),this},Identify.prototype.remove=function(e,u){return this._safeSet(J.REMOVE,e,u),this},Identify.prototype.add=function(e,u){return this._safeSet(J.ADD,e,u),this},Identify.prototype.unset=function(e){return this._safeSet(J.UNSET,e,"-"),this},Identify.prototype.clearAll=function(){return this._properties={},this._properties[J.CLEAR_ALL]="-",this}
25,Identify.prototype._safeSet=function(e,u,b){if(this._validate(e,u,b)){var y=this._properties[e];return void 0===y&&(y={},this._properties[e]=y),y[u]=b,this._propertySet.add(u),!0}return!1},Identify.prototype._validate=function(e,u,b){return!(void 0!==this._properties[J.CLEAR_ALL]||this._propertySet.has(u))&&(e===J.ADD?"number"==typeof b:e===J.UNSET||e===J.REMOVE||isValidProperties(u,b))},Identify}();(_=J||(J={})).SET="$set",_.SET_ONCE="$setOnce",_.ADD="$add",_.APPEND="$append",_.PREPEND="$prepend",_.REMOVE="$remove",_.PREINSERT="$preInsert",_.POSTINSERT="$postInsert",_.UNSET="$unset",_.CLEAR_ALL="$clearAll";var eM=[J.CLEAR_ALL,J.UNSET,J.SET,J.SET_ONCE,J.ADD,J.APPEND,J.PREPEND,J.PREINSERT,J.POSTINSERT,J.REMOVE],eU=function(){function Revenue(){this.productId="",this.quantity=1,this.price=0}return Revenue.prototype.setProductId=function(e){return this.productId=e,this},Revenue.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},Revenue.prototype.setPrice=function(e){return this.price=e,this},Revenue.prototype.setRevenueType=function(e){return this.revenueType=e,this},Revenue.prototype.setCurrency=function(e){return this.currency=e,this},Revenue.prototype.setRevenue=function(e){return this.revenue=e,this},Revenue.prototype.setReceipt=function(e){return this.receipt=e,this},Revenue.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},Revenue.prototype.setEventProperties=function(e){return isValidObject(e)&&(this.properties=e),this},Revenue.prototype.getEventProperties=function(){var e=this.properties?(0,Q.pi)({},this.properties):{};return e[W.REVENUE_PRODUCT_ID]=this.productId,e[W.REVENUE_QUANTITY]=this.quantity,e[W.REVENUE_PRICE]=this.price,e[W.REVENUE_TYPE]=this.revenueType,e[W.REVENUE_CURRENCY]=this.currency,e[W.REVENUE]=this.revenue,e[W.RECEIPT]=this.receipt,e[W.RECEIPT_SIG]=this.receiptSig,e},Revenue}();(P=W||(W={})).REVENUE_PRODUCT_ID="$productId",P.REVENUE_QUANTITY="$quantity",P.REVENUE_PRICE="$price",P.REVENUE_TYPE="$revenueType",P.REVENUE_CURRENCY="$currency",P.REVENUE="$revenue",P.RECEIPT="$receipt",P.RECEIPT_SIG="$receiptSig";var isNewSession=function(e,u){return void 0===u&&(u=Date.now()),Date.now()-u>e};(R=V||(V={})).SET="$set",R.SET_ONCE="$setOnce",R.ADD="$add",R.APPEND="$append",R.PREPEND="$prepend",R.REMOVE="$remove",R.PREINSERT="$preInsert",R.POSTINSERT="$postInsert",R.UNSET="$unset",R.CLEAR_ALL="$clearAll",(D=H||(H={})).IDENTIFY="$identify",D.GROUP_IDENTIFY="$groupidentify",D.REVENUE="revenue_amount";var ej=function(){function Timeline(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return Timeline.prototype.register=function(e,u){var b,y;return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(w){switch(w.label){case 0:if(this.plugins.some(function(u){return u.name===e.name}))return this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=UUID(),this.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(b=e.type)&&void 0!==b?b:"enrichment",[4,null===(y=e.setup)||void 0===y?void 0:y.call(e,u,this.client)];case 1:return w.sent(),this.plugins.push(e),[2]}})})},Timeline.prototype.deregister=function(e,u){var b;return(0,Q.mG)(this,void 0,void 0,function(){var y,w;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:if(-1===(y=this.plugins.findIndex(function(u){return u.name===e})))return u.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return w=this.plugins[y],this.plugins.splice(y,1),[4,null===(b=w.teardown)||void 0===b?void 0:b.call(w)];case 1:return T.sent(),[2]}})})},Timeline.prototype.reset=function(e){this.applying=!1,this.plugins.map(function(e){var u;return null===(u=e.teardown)||void 0===u?void 0:u.call(e)}),this.plugins=[],this.client=e},Timeline.prototype.push=function(e){var u=this;return new Promise(function(b){u.queue.push([e,b]),u.scheduleApply(0)})},Timeline.prototype.scheduleApply=function(e){var u=this;this.applying||(this.applying=!0,setTimeout(function(){u.apply(u.queue.shift()).then(function(){u.applying=!1,u.queue.length>0&&u.scheduleApply(0)})},e))},Timeline.prototype.apply=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y,w,T,_,P,R,D,U,j,F,q,G,B;return(0,Q.Jh)(this,function(J){switch(J.label){case 0:if(!e)return[2];u=(0,Q.CR)(e,1)[0],b=(0,Q.CR)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",u),y=this.plugins.filter(function(e){return"before"===e.type}),J.label=1;case 1:J.trys.push([1,6,7,8]),T=(w=(0,Q.XA)(y)).next(),J.label=2;case 2:if(T.done)return[3,5];if(!(_=T.value).execute)return[3,4];return[4,_.execute((0,Q.pi)({},u))];case 3:if(null===(P=J.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(_.name),"', event: ").concat(JSON.stringify(u))),b({event:u,code:0,message:""}),[2];u=P,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(_.name),"', event: ").concat(JSON.stringify(u))),J.label=4;case 4:return T=w.next(),[3,2];case 5:return[3,8];case 6:return F={error:J.sent()},[3,8];case 7:try{T&&!T.done&&(q=w.return)&&q.call(w)}finally{if(F)throw F.error}
25return[7];case 8:R=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),J.label=9;case 9:J.trys.push([9,14,15,16]),U=(D=(0,Q.XA)(R)).next(),J.label=10;case 10:if(U.done)return[3,13];if(!(_=U.value).execute)return[3,12];return[4,_.execute((0,Q.pi)({},u))];case 11:if(null===(P=J.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(_.name),"', event: ").concat(JSON.stringify(u))),b({event:u,code:0,message:""}),[2];u=P,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(_.name),"', event: ").concat(JSON.stringify(u))),J.label=12;case 12:return U=D.next(),[3,10];case 13:return[3,16];case 14:return G={error:J.sent()},[3,16];case 15:try{U&&!U.done&&(B=D.return)&&B.call(D)}finally{if(G)throw G.error}return[7];case 16:return j=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(u))),Promise.all(j.map(function(e){var b=(0,Q.pi)({},u);return e.execute(b).catch(function(e){return buildResult(b,0,String(e))})})).then(function(e){var y=(0,Q.CR)(e,1)[0]||buildResult(u,100,"Event not tracked, no destination plugins on the instance");b(y)}),[2]}})})},Timeline.prototype.flush=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u=this;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return u.apply(e)}))];case 1:return b.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return b.sent(),[2]}})})},Timeline.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(u){var b;null===(b=u.onIdentityChanged)||void 0===b||b.call(u,e)})},Timeline.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(u){var b;null===(b=u.onSessionIdChanged)||void 0===b||b.call(u,e)})},Timeline.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(u){var b;null===(b=u.onOptOutChanged)||void 0===b||b.call(u,e)})},Timeline}(),createTrackEvent=function(e,u,b){var y="string"==typeof e?{event_type:e}:e;return(0,Q.pi)((0,Q.pi)((0,Q.pi)({},y),b),u&&{event_properties:u})},createIdentifyEvent=function(e,u){return(0,Q.pi)((0,Q.pi)({},u),{event_type:H.IDENTIFY,user_properties:e.getUserProperties()})},createGroupIdentifyEvent=function(e,u,b,y){var w;return(0,Q.pi)((0,Q.pi)({},y),{event_type:H.GROUP_IDENTIFY,group_properties:b.getUserProperties(),groups:((w={})[e]=u,w)})},createGroupEvent=function(e,u,b){var y,w=new eN;return w.set(e,u),(0,Q.pi)((0,Q.pi)({},b),{event_type:H.IDENTIFY,user_properties:w.getUserProperties(),groups:((y={})[e]=u,y)})},eF=function(){function AmplitudeCore(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 ej(this),this.name=e}return AmplitudeCore.prototype._init=function(e){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){switch(u.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return u.sent(),this.isReady=!0,[2]}})})},AmplitudeCore.prototype.runQueuedFunctions=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y,w,T,_;return(0,Q.Jh)(this,function(P){switch(P.label){case 0:u=this[e],this[e]=[],P.label=1;case 1:P.trys.push([1,8,9,10]),y=(b=(0,Q.XA)(u)).next(),P.label=2;case 2:if(y.done)return[3,7];if(!((w=(0,y.value)())&&"promise"in w))return[3,4];return[4,w.promise];case 3:return P.sent(),[3,6];case 4:return[4,w];case 5:P.sent(),P.label=6;case 6:return y=b.next(),[3,2];case 7:return[3,10];case 8:return T={error:P.sent()},[3,10];case 9:try{y&&!y.done&&(_=b.return)&&_.call(b)}finally{if(T)throw T.error}return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:P.sent(),P.label=12;case 12:return[2]}})})},AmplitudeCore.prototype.track=function(e,u,b){var y=createTrackEvent(e,u,b);return returnWrapper(this.dispatch(y))},AmplitudeCore.prototype.identify=function(e,u){var b=createIdentifyEvent(e,u);return returnWrapper(this.dispatch(b))},AmplitudeCore.prototype.groupIdentify=function(e,u,b,y){var w=createGroupIdentifyEvent(e,u,b,y);return returnWrapper(this.dispatch(w))},AmplitudeCore.prototype.setGroup=function(e,u,b){var y=createGroupEvent(e,u,b);return returnWrapper(this.dispatch(y))},AmplitudeCore.prototype.revenue=function(e,u){var b=(0,Q.pi)((0,Q.pi)({},u),{event_type:H.REVENUE,event_properties:e.getEventProperties()});return returnWrapper(this.dispatch(b))},AmplitudeCore.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),returnWrapper())},AmplitudeCore.prototype._addPlugin=function(e){return returnWrapper(this.timeline.register(e,this.config))},AmplitudeCore.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),returnWrapper())},AmplitudeCore.prototype._removePlugin=function(e){return returnWrapper(this.timeline.deregister(e,this.config))},AmplitudeCore.prototype.dispatchWithCallback=function(e,u){if(!this.isReady)return u(buildResult(e,0,"Client not initialized"));this.process(e).then(u)},AmplitudeCore.prototype.dispatch=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u=this;return(0,Q.Jh)(this,function(b){return this.isReady?[2,this.process(e)]:[2,new Promise(function(b){u.dispatchQ.push(u.dispatchWithCallback.bind(u,e,b))})]})})},AmplitudeCore.prototype.getOperationAppliedUserProperties=function(e){var u={};if(void 0===e)return u;var b={};return Object.keys(e).forEach(function(u){Object.values(V).includes(u)||(b[u]=e[u])}),eM.forEach(function(b){if(Object.keys(e).includes(b)){var y=e[b];switch(b){case V.CLEAR_ALL:Object.keys(u).forEach(function(e){delete u[e]});break;
25case V.UNSET:Object.keys(y).forEach(function(e){delete u[e]});break;case V.SET:Object.assign(u,y)}}}),Object.assign(u,b),u},AmplitudeCore.prototype.process=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u,b,y;return(0,Q.Jh)(this,function(w){switch(w.label){case 0:if(w.trys.push([0,2,,3]),this.config.optOut)return[2,buildResult(e,0,"Event skipped due to optOut config")];return e.event_type===H.IDENTIFY&&(u=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:u})),[4,this.timeline.push(e)];case 1:return 200===(b=w.sent()).code?this.config.loggerProvider.log(b.message):100===b.code?this.config.loggerProvider.warn(b.message):this.config.loggerProvider.error(b.message),[2,b];case 2:return y=String(w.sent()),this.config.loggerProvider.error(y),[2,b=buildResult(e,0,y)];case 3:return[2]}})})},AmplitudeCore.prototype.setOptOut=function(e){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!e));return}this._setOptOut(e)},AmplitudeCore.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.timeline.onOptOutChanged(e),this.config.optOut=!!e)},AmplitudeCore.prototype.flush=function(){return returnWrapper(this.timeline.flush())},AmplitudeCore.prototype.plugin=function(e){var u=this.timeline.plugins.find(function(u){return u.name===e});if(void 0===u){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e));return}return u},AmplitudeCore.prototype.plugins=function(e){return this.timeline.plugins.filter(function(u){return u instanceof e})},AmplitudeCore}(),isTrackingEnabled=function(e,u){return"boolean"==typeof e?e:(null==e?void 0:e[u])!==!1},isAttributionTrackingEnabled=function(e){return isTrackingEnabled(e,"attribution")},isPageViewTrackingEnabled=function(e){return isTrackingEnabled(e,"pageViews")},isSessionTrackingEnabled=function(e){return isTrackingEnabled(e,"sessions")},isNetworkTrackingEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},isElementInteractionsEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},isFrustrationInteractionsEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},getElementInteractionsConfig=function(e){if(isElementInteractionsEnabled(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},getFrustrationInteractionsConfig=function(e){if(isFrustrationInteractionsEnabled(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},getNetworkTrackingConfig=function(e){var u;if(isNetworkTrackingEnabled(e.autocapture)){var b=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?b=e.autocapture.networkTracking:e.networkTrackingOptions&&(b=e.networkTrackingOptions),(0,Q.pi)((0,Q.pi)({},b),{captureRules:null===(u=null==b?void 0:b.captureRules)||void 0===u?void 0:u.map(function(u){var b,y,w;if((null===(b=u.urls)||void 0===b?void 0:b.length)&&(null===(y=u.hosts)||void 0===y?void 0:y.length)){var T=JSON.stringify(u.hosts),_=JSON.stringify(u.urls);return null===(w=e.loggerProvider)||void 0===w||w.warn("Found network capture rule with both urls='".concat(_,"' and hosts='").concat(T,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,Q.pi)((0,Q.pi)({},u),{hosts:void 0})}return u})})}},getPageViewTrackingConfig=function(e){var u,trackOn=function(){return!1},b=void 0,y=e.pageCounter;return isPageViewTrackingEnabled(e.defaultTracking)&&(trackOn=void 0,u=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(trackOn=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(b=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(u=e.defaultTracking.pageViews.eventType))),{trackOn:trackOn,trackHistoryChanges:b,eventType:u,pageCounter:y}},convertProxyObjectToRealObject=function(e,u){for(var b=0;b<u.length;b++){var y=u[b],w=y.name,T=y.args,_=y.resolve,P=e&&e[w];if("function"==typeof P){var R=P.apply(e,T);"function"==typeof _&&_(null==R?void 0:R.promise)}}return e},isInstanceProxy=function(e){return e&&void 0!==e._q},language_getLanguage=function(){if("undefined"==typeof navigator)return"";var e,u,b,y,w=navigator.userLanguage;return null!==(y=null!==(b=null!==(u=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==u?u:navigator.language)&&void 0!==b?b:w)&&void 0!==y?y:""},eq="2.30.0",eG="amplitude-ts",eB=function(){function Context(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(eG,"/").concat(eq),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return Context.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},Context.prototype.execute=function(e){var u,b;return(0,Q.mG)(this,void 0,void 0,function(){var y,w,T;return(0,Q.Jh)(this,function(_){return y=new Date().getTime(),w=null!==(u=this.config.lastEventId)&&void 0!==u?u:-1,T=null!==(b=e.event_id)&&void 0!==b?b:w+1,this.config.lastEventId=T,e.time||(this.config.lastEventTime=y),[2,(0,Q.pi)((0,Q.pi)((0,Q.pi)((0,Q.pi)((0,Q.pi)((0,Q.pi)((0,Q.pi)((0,Q.pi)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:y},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:language_getLanguage()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:UUID(),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:T,library:this.library,user_agent:this.userAgent})]})})},Context}(),eJ=function(){function MemoryStorage(){this.memoryStorage=new Map}return MemoryStorage.prototype.isEnabled=function(){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(e){return[2,!0]})})},MemoryStorage.prototype.get=function(e){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return[2,this.memoryStorage.get(e)]})})},MemoryStorage.prototype.getRaw=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:return[4,this.get(e)];case 1:return[2,(u=b.sent())?JSON.stringify(u):void 0]}})})},MemoryStorage.prototype.set=function(e,u){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(b){return this.memoryStorage.set(e,u),[2]})})},MemoryStorage.prototype.remove=function(e){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return this.memoryStorage.delete(e),[2]})})},MemoryStorage.prototype.reset=function(){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(e){return this.memoryStorage.clear(),[2]})})},MemoryStorage}(),getCookieName=function(e,u,b){return void 0===u&&(u=""),void 0===b&&(b=10),["AMP",u,e.substring(0,b)].filter(
25Boolean).join("_")},eW=function(){function CookieStorage(e){this.options=(0,Q.pi)({},e)}return CookieStorage.prototype.isEnabled=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:if(!getGlobalScope())return[2,!1];CookieStorage.testValue=String(Date.now()),e=new CookieStorage(this.options),u="AMP_TEST",b.label=1;case 1:return b.trys.push([1,4,5,7]),[4,e.set(u,CookieStorage.testValue)];case 2:return b.sent(),[4,e.get(u)];case 3:return[2,b.sent()===CookieStorage.testValue];case 4:return b.sent(),[2,!1];case 5:return[4,e.remove(u)];case 6:return b.sent(),[7];case 7:return[2]}})})},CookieStorage.prototype.get=function(e){var u;return(0,Q.mG)(this,void 0,void 0,function(){var b,y;return(0,Q.Jh)(this,function(w){switch(w.label){case 0:return[4,this.getRaw(e)];case 1:if(!(b=w.sent()))return[2,void 0];try{if(y=null!==(u=decodeCookiesAsDefault(b))&&void 0!==u?u:decodeCookiesWithDoubleUrlEncoding(b),void 0===y)return console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(b)),[2,void 0];return[2,JSON.parse(y)]}catch(u){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(b)),[2,void 0]}return[2]}})})},CookieStorage.prototype.getRaw=function(e){var u,b;return(0,Q.mG)(this,void 0,void 0,function(){var y,w;return(0,Q.Jh)(this,function(T){return(w=(null!==(b=null===(u=null==(y=getGlobalScope())?void 0:y.document)||void 0===u?void 0:u.cookie.split("; "))&&void 0!==b?b:[]).find(function(u){return 0===u.indexOf(e+"=")}))?[2,w.substring(e.length+1)]:[2,void 0]})})},CookieStorage.prototype.set=function(e,u){var b;return(0,Q.mG)(this,void 0,void 0,function(){var y,w,T,_,P,R,D;return(0,Q.Jh)(this,function(U){try{y=null!==(b=this.options.expirationDays)&&void 0!==b?b:0,w=null!==u?y:-1,T=void 0,w&&((_=new Date).setTime(_.getTime()+864e5*w),T=_),P="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(u)))),T&&(P+="; expires=".concat(T.toUTCString())),P+="; path=/",this.options.domain&&(P+="; domain=".concat(this.options.domain)),this.options.secure&&(P+="; Secure"),this.options.sameSite&&(P+="; SameSite=".concat(this.options.sameSite)),(R=getGlobalScope())&&(R.document.cookie=P)}catch(u){D=u instanceof Error?u.message:String(u),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(D))}return[2]})})},CookieStorage.prototype.remove=function(e){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){switch(u.label){case 0:return[4,this.set(e,null)];case 1:return u.sent(),[2]}})})},CookieStorage.prototype.reset=function(){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(e){return[2]})})},CookieStorage}(),decodeCookiesAsDefault=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},decodeCookiesWithDoubleUrlEncoding=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},eV=function(){function BaseTransport(){}return BaseTransport.prototype.send=function(e,u){return Promise.resolve(null)},BaseTransport.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var u,b,y,w,T,_,P,R,D,U,j,F,q,G,J,W,V,H,z,X,K,Z,Y=e.code||0,Q=this.buildStatus(Y);switch(Q){case B.Success:return{status:Q,statusCode:Y,body:{eventsIngested:null!==(u=e.events_ingested)&&void 0!==u?u:0,payloadSizeBytes:null!==(b=e.payload_size_bytes)&&void 0!==b?b:0,serverUploadTime:null!==(y=e.server_upload_time)&&void 0!==y?y:0}};case B.Invalid:return{status:Q,statusCode:Y,body:{error:null!==(w=e.error)&&void 0!==w?w:"",missingField:null!==(T=e.missing_field)&&void 0!==T?T:"",eventsWithInvalidFields:null!==(_=e.events_with_invalid_fields)&&void 0!==_?_:{},eventsWithMissingFields:null!==(P=e.events_with_missing_fields)&&void 0!==P?P:{},eventsWithInvalidIdLengths:null!==(R=e.events_with_invalid_id_lengths)&&void 0!==R?R:{},epsThreshold:null!==(D=e.eps_threshold)&&void 0!==D?D:0,exceededDailyQuotaDevices:null!==(U=e.exceeded_daily_quota_devices)&&void 0!==U?U:{},silencedDevices:null!==(j=e.silenced_devices)&&void 0!==j?j:[],silencedEvents:null!==(F=e.silenced_events)&&void 0!==F?F:[],throttledDevices:null!==(q=e.throttled_devices)&&void 0!==q?q:{},throttledEvents:null!==(G=e.throttled_events)&&void 0!==G?G:[]}};case B.PayloadTooLarge:return{status:Q,statusCode:Y,body:{error:null!==(J=e.error)&&void 0!==J?J:""}}
25;case B.RateLimit:return{status:Q,statusCode:Y,body:{error:null!==(W=e.error)&&void 0!==W?W:"",epsThreshold:null!==(V=e.eps_threshold)&&void 0!==V?V:0,throttledDevices:null!==(H=e.throttled_devices)&&void 0!==H?H:{},throttledUsers:null!==(z=e.throttled_users)&&void 0!==z?z:{},exceededDailyQuotaDevices:null!==(X=e.exceeded_daily_quota_devices)&&void 0!==X?X:{},exceededDailyQuotaUsers:null!==(K=e.exceeded_daily_quota_users)&&void 0!==K?K:{},throttledEvents:null!==(Z=e.throttled_events)&&void 0!==Z?Z:[]}};case B.Timeout:default:return{status:Q,statusCode:Y}}},BaseTransport.prototype.buildStatus=function(e){return isSuccessStatusCode(e)?B.Success:429===e?B.RateLimit:413===e?B.PayloadTooLarge:408===e?B.Timeout:e>=400&&e<500?B.Invalid:e>=500?B.Failed:B.Unknown},BaseTransport}(),eH=function(e){function FetchTransport(){return null!==e&&e.apply(this,arguments)||this}return(0,Q.ZT)(FetchTransport,e),FetchTransport.prototype.send=function(e,u){return(0,Q.mG)(this,void 0,void 0,function(){var b,y,w;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:if("undefined"==typeof fetch)throw Error("FetchTransport is not supported");return b={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(u),method:"POST"},[4,fetch(e,b)];case 1:return[4,(y=T.sent()).text()];case 2:w=T.sent();try{return[2,this.buildResponse(JSON.parse(w))]}catch(e){return[2,this.buildResponse({code:y.status})]}return[2]}})})},FetchTransport}(eV),ez=function(){function BrowserStorage(e){this.storage=e}return BrowserStorage.prototype.isEnabled=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u,b;return(0,Q.Jh)(this,function(y){switch(y.label){case 0:if(!this.storage)return[2,!1];e=String(Date.now()),u=new BrowserStorage(this.storage),b="AMP_TEST",y.label=1;case 1:return y.trys.push([1,4,5,7]),[4,u.set(b,e)];case 2:return y.sent(),[4,u.get(b)];case 3:return[2,y.sent()===e];case 4:return y.sent(),[2,!1];case 5:return[4,u.remove(b)];case 6:return y.sent(),[7];case 7:return[2]}})})},BrowserStorage.prototype.get=function(e){return(0,Q.mG)(this,void 0,void 0,function(){var u;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:return b.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(u=b.sent()))return[2,void 0];return[2,JSON.parse(u)];case 2:return b.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},BrowserStorage.prototype.getRaw=function(e){var u;return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(b){return[2,(null===(u=this.storage)||void 0===u?void 0:u.getItem(e))||void 0]})})},BrowserStorage.prototype.set=function(e,u){var b;return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(y){try{null===(b=this.storage)||void 0===b||b.setItem(e,JSON.stringify(u))}catch(e){}return[2]})})},BrowserStorage.prototype.remove=function(e){var u;return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(b){try{null===(u=this.storage)||void 0===u||u.removeItem(e)}catch(e){}return[2]})})},BrowserStorage.prototype.reset=function(){var e;return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]})})},BrowserStorage}(),eX=function(e){function LocalStorage(u){var b,y,w,T=this;try{w=null===(b=getGlobalScope())||void 0===b?void 0:b.localStorage}catch(e){null===(y=null==u?void 0:u.loggerProvider)||void 0===y||y.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),w=void 0}return(T=e.call(this,w)||this).loggerProvider=null==u?void 0:u.loggerProvider,T}return(0,Q.ZT)(LocalStorage,e),LocalStorage.prototype.set=function(u,b){var y;return(0,Q.mG)(this,void 0,void 0,function(){var w;return(0,Q.Jh)(this,function(T){switch(T.label){case 0:if(!(Array.isArray(b)&&b.length>1e3))return[3,2];return w=b.length-1e3,[4,e.prototype.set.call(this,u,b.slice(0,1e3))];case 1:return T.sent(),null===(y=this.loggerProvider)||void 0===y||y.error("Failed to save ".concat(w," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,u,b)];case 3:T.sent(),T.label=4;case 4:return[2]}})})},LocalStorage}(ez),e$=function(e){function SessionStorage(){var u;return e.call(this,null===(u=getGlobalScope())||void 0===u?void 0:u.sessionStorage)||this}return(0,Q.ZT)(SessionStorage,e),SessionStorage}(ez),eK=function(e){function XHRTransport(){var u=null!==e&&e.apply(this,arguments)||this;return u.state={done:4},u}return(0,Q.ZT)(XHRTransport,e),XHRTransport.prototype.send=function(e,u){return(0,Q.mG)(this,void 0,void 0,function(){var b=this;return(0,Q.Jh)(this,function(y){return[2,new Promise(function(y,w){"undefined"==typeof XMLHttpRequest&&w(Error("XHRTransport is not supported."));var T=new XMLHttpRequest;T.open("POST",e,!0),T.onreadystatechange=function(){if(T.readyState===b.state.done){var e=T.responseText;try{y(b.buildResponse(JSON.parse(e)))}catch(e){y(b.buildResponse({code:T.status}))}}},T.setRequestHeader("Content-Type","application/json"),T.setRequestHeader("Accept","*/*"),T.send(JSON.stringify(u))})]})})},XHRTransport}(eV),eZ=function(e){function SendBeaconTransport(){return null!==e&&e.apply(this,arguments)||this}return(0,Q.ZT)(SendBeaconTransport,e),SendBeaconTransport.prototype.send=function(e,u){return(0,Q.mG)(this,void 0,void 0,function(){var b=this;return(0,Q.Jh)(this,function(y){return[2,new Promise(function(y,w){var T=getGlobalScope();if(!(null==T?void 0:T.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var _=JSON.stringify(u);
25if(T.navigator.sendBeacon(e,JSON.stringify(u)))return y(b.buildResponse({code:200,events_ingested:u.events.length,payload_size_bytes:_.length,server_upload_time:Date.now()}));return y(b.buildResponse({code:500}))}catch(e){w(e)}})]})})},SendBeaconTransport}(eV),parseTime=function(e){var u=parseInt(e,32);if(!isNaN(u))return u},decode=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},eY="[Amplitude]",eQ="".concat(eY," Form Started"),e0="".concat(eY," Form Submitted"),e1="".concat(eY," File Downloaded"),e2="session_start",e3="session_end",e4="".concat(eY," File Extension"),e5="".concat(eY," File Name"),e6="".concat(eY," Link ID"),e9="".concat(eY," Link Text"),e7="".concat(eY," Link URL"),e8="".concat(eY," Form ID"),te="".concat(eY," Form Name"),tt="".concat(eY," Form Destination"),tr="cookie",tn=function(e){function BrowserConfig(u,b,y,w,T,_,P,R,D,U,j,F,q,B,J,W,V,H,z,X,K,Z,Y,Q,ee,et,er,en,ei,eo,es,ea,eu,el,ec,ed,ep,ef,eh,eg){void 0===y&&(y=new eJ),void 0===w&&(w={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===R&&(R=1e3),void 0===D&&(D=5),void 0===U&&(U=30),void 0===j&&(j=tr),void 0===W&&(W=new eP),void 0===V&&(V=G.Warn),void 0===z&&(z=!1),void 0===X&&(X=!1),void 0===Y&&(Y=""),void 0===Q&&(Q="US"),void 0===et&&(et=18e5),void 0===er&&(er=new eX({loggerProvider:W})),void 0===en&&(en={ipAddress:!0,language:!0,platform:!0}),void 0===ei&&(ei="fetch"),void 0===eo&&(eo=!1),void 0===es&&(es=!0),void 0===ep&&(ep=!0),void 0===ef&&(ef=0);var ev=e.call(this,{apiKey:u,storageProvider:er,transportProvider:createTransport(ei)})||this;return ev.apiKey=u,ev.appVersion=b,ev.cookieOptions=w,ev.defaultTracking=T,ev.autocapture=_,ev.flushIntervalMillis=R,ev.flushMaxRetries=D,ev.flushQueueSize=U,ev.identityStorage=j,ev.ingestionMetadata=F,ev.instanceName=q,ev.loggerProvider=W,ev.logLevel=V,ev.minIdLength=H,ev.offline=z,ev.partnerId=K,ev.plan=Z,ev.serverUrl=Y,ev.serverZone=Q,ev.sessionTimeout=et,ev.storageProvider=er,ev.trackingOptions=en,ev.transport=ei,ev.useBatch=eo,ev.fetchRemoteConfig=es,ev.networkTrackingOptions=ec,ev.identify=ed,ev.enableDiagnostics=ep,ev.diagnosticsSampleRate=ef,ev.diagnosticsClient=eh,ev.remoteConfig=eg,ev.version=eq,ev._optOut=!1,ev._cookieStorage=y,ev.deviceId=P,ev.lastEventId=B,ev.lastEventTime=J,ev.optOut=X,ev.sessionId=ee,ev.pageCounter=eu,ev.userId=ea,ev.debugLogsEnabled=el,ev.loggerProvider.enable(el?G.Debug:ev.logLevel),ev.networkTrackingOptions=ec,ev.identify=ed,ev.enableDiagnostics=ep,ev.diagnosticsSampleRate=ef,ev.diagnosticsClient=eh,es&&(ev.remoteConfig||(ev.remoteConfig={fetchRemoteConfig:es}),ev.remoteConfig.fetchRemoteConfig||(ev.remoteConfig.fetchRemoteConfig=es)),ev}return(0,Q.ZT)(BrowserConfig,e),Object.defineProperty(BrowserConfig.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(BrowserConfig.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(BrowserConfig.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(BrowserConfig.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(BrowserConfig.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(BrowserConfig.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(BrowserConfig.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())}
25,enumerable:!1,configurable:!0}),Object.defineProperty(BrowserConfig.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(BrowserConfig.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),BrowserConfig.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(getCookieName(this.apiKey),e)},BrowserConfig}(eO),createCookieStorage=function(e,u){switch(void 0===e&&(e=tr),void 0===u&&(u={}),e){case"localStorage":return new eX;case"sessionStorage":return new e$;case"none":return new eJ;default:return new eW((0,Q.pi)((0,Q.pi)({},u),{expirationDays:u.expiration}))}},createTransport=function(e){return"xhr"===e?new eK:"beacon"===e?new eZ:new eH},ti="data-amp-mask",to="*****",ts=/\b(?:\d[ -]*?){13,16}\b/,ta=/(\d{3}-?\d{2}-?\d{4})/g,tu=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,replaceSensitiveString=function(e,u){if(void 0===u&&(u=[]),"string"!=typeof e)return"";var b,y,w=e;w=(w=(w=w.replace(ts,to)).replace(ta,to)).replace(tu,to);try{for(var T=(0,Q.XA)(u),_=T.next();!_.done;_=T.next()){var P=_.value;try{w=w.replace(P,to)}catch(e){}}}catch(e){b={error:e}}finally{try{_&&!_.done&&(y=T.return)&&y.call(T)}finally{if(b)throw b.error}}return w},getPageTitle=function(e){if("undefined"==typeof document||!document.title)return"";var u=document.querySelector("title");return u&&u.hasAttribute(ti)?to:e?e(document.title):document.title},tl=function(){function CampaignParser(){}return CampaignParser.prototype.parse=function(){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(e){return[2,(0,Q.pi)((0,Q.pi)((0,Q.pi)((0,Q.pi)({},e_),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},CampaignParser.prototype.getUtmParam=function(){var e=getQueryParams();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}},CampaignParser.prototype.getReferrer=function(){var e,u,b={referrer:void 0,referring_domain:void 0};try{b.referrer=document.referrer||void 0,b.referring_domain=null!==(u=null===(e=b.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==u?u:void 0}catch(e){}return b},CampaignParser.prototype.getClickIds=function(){var e,u=getQueryParams();return(e={})[eg]=u[eg],e[ev]=u[ev],e[em]=u[em],e[eb]=u[eb],e[ey]=u[ey],e[ew]=u[ew],e[eS]=u[eS],e[eE]=u[eE],e[eC]=u[eC],e[ek]=u[ek],e[eT]=u[eT],e},CampaignParser}(),omitUndefined=function(e){var u={};for(var b in e){var y=e[b];y&&(u[b]=y)}return u},pageViewTrackingPlugin=function(e){void 0===e&&(e={});var u,b,y=getGlobalScope(),w=void 0,T=!1,_=e.trackOn,P=e.trackHistoryChanges,R=e.eventType,D=void 0===R?"[Amplitude] Page Viewed":R,getDecodeURI=function(e){var u=e;try{u=decodeURI(e)}catch(e){null==w||w.error("Malformed URI sequence: ",e)}return u},createPageViewEvent=function(){return(0,Q.mG)(void 0,void 0,void 0,function(){var e,u,b;return(0,Q.Jh)(this,function(y){switch(y.label){case 0:return e=getDecodeURI("undefined"!=typeof location&&location.href||""),b={event_type:D},u=[{}],[4,getCampaignParams()];case 1:return[2,(b.event_properties=Q.pi.apply(void 0,[Q.pi.apply(void 0,u.concat([y.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&getDecodeURI(location.pathname)||"","[Amplitude] Page Title":getPageTitle(replaceSensitiveString),"[Amplitude] Page URL":e.split("?")[0]}]),b)]}})})},shouldTrackOnPageLoad=function(){return void 0===_||"function"==typeof _&&_()},U="undefined"!=typeof location?location.href:null,trackHistoryPageView=function(){return(0,Q.mG)(void 0,void 0,void 0,function(){var e,b,y,T;return(0,Q.Jh)(this,function(_){switch(_.label){case 0:if(b=shouldTrackHistoryPageView(P,e=location.href,U||"")&&shouldTrackOnPageLoad(),U=e,!b)return[3,4];if(null==w||w.log("Tracking page view event"),null!=u)return[3,1];return[3,3];case 1:return T=(y=u).track,[4,createPageViewEvent()];case 2:T.apply(y,[_.sent()]),_.label=3;case 3:_.label=4;case 4:return[2]}})})},trackHistoryPageViewWrapper=function(){trackHistoryPageView()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,_){return(0,Q.mG)(void 0,void 0,void 0,function(){var P,R;return(0,Q.Jh)(this,function(D){switch(D.label){case 0:if(u=_,b=e,(w=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),T=!0,y&&(y.addEventListener("popstate",trackHistoryPageViewWrapper),y.history.pushState=new Proxy(y.history.pushState,{apply:function(e,u,b){var y=(0,Q.CR)(b,3),w=y[0],_=y[1],P=y[2];e.apply(u,[w,_,P]),T&&trackHistoryPageView()}})),!shouldTrackOnPageLoad())return[3,2];return w.log("Tracking page view event"),R=(P=u).track,[4,createPageViewEvent()];case 1:R.apply(P,[D.sent()]),D.label=2;case 2:return[2]}})})},execute:function(e){return(0,Q.mG)(void 0,void 0,void 0,function(){var u;return(0,Q.Jh)(this,function(y){switch(y.label){case 0:if(!("attribution"===_&&isCampaignEvent(e)))return[3,2];
25return null==w||w.log("Enriching campaign event to page view event with campaign parameters"),[4,createPageViewEvent()];case 1:u=y.sent(),e.event_type=u.event_type,e.event_properties=(0,Q.pi)((0,Q.pi)({},e.event_properties),u.event_properties),y.label=2;case 2:return b&&e.event_type===D&&(b.pageCounter=b.pageCounter?b.pageCounter+1:1,e.event_properties=(0,Q.pi)((0,Q.pi)({},e.event_properties),{"[Amplitude] Page Counter":b.pageCounter})),[2,e]}})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(e){return y&&(y.removeEventListener("popstate",trackHistoryPageViewWrapper),T=!1),[2]})})}}},getCampaignParams=function(){return(0,Q.mG)(void 0,void 0,void 0,function(){var e;return(0,Q.Jh)(this,function(u){switch(u.label){case 0:return e=omitUndefined,[4,new tl().parse()];case 1:return[2,e.apply(void 0,[u.sent()])]}})})},isCampaignEvent=function(e){if("$identify"===e.event_type&&e.user_properties){var u=e.user_properties,b=u[V.SET]||{},y=u[V.UNSET]||{},w=(0,Q.ev)((0,Q.ev)([],(0,Q.CR)(Object.keys(b)),!1),(0,Q.CR)(Object.keys(y)),!1);return Object.keys(e_).every(function(e){return w.includes(e)})}return!1},shouldTrackHistoryPageView=function(e,u,b){if("pathOnly"===e){if(""==b)return!0;var y=new URL(u),w=new URL(b);return y.origin+y.pathname!==w.origin+w.pathname}return u!==b},formInteractionTracking=function(){var e,u=[],addEventListener=function(e,b,y){e.addEventListener(b,y),u.push({element:e,type:b,handler:y})},removeClickListeners=function(){u.forEach(function(e){var u=e.element,b=e.type,y=e.handler;null==u||u.removeEventListener(b,y)}),u=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(u,b){return(0,Q.mG)(void 0,void 0,void 0,function(){var y,w;return(0,Q.Jh)(this,function(T){return y=function(){if(!b){u.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 addFormInteractionListener=function(e){var u=!1;addEventListener(e,"change",function(){var y,w=extractFormAction(e);u||b.track(eQ,((y={})[e8]=stringOrUndefined(e.id),y[te]=stringOrUndefined(e.name),y[tt]=w,y)),u=!0}),addEventListener(e,"submit",function(){var y,w,T=extractFormAction(e);u||b.track(eQ,((y={})[e8]=stringOrUndefined(e.id),y[te]=stringOrUndefined(e.name),y[tt]=T,y)),b.track(e0,((w={})[e8]=stringOrUndefined(e.id),w[te]=stringOrUndefined(e.name),w[tt]=T,w)),u=!1})};Array.from(document.getElementsByTagName("form")).forEach(addFormInteractionListener),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&addFormInteractionListener(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(addFormInteractionListener)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?y():(w=getGlobalScope())?w.addEventListener("load",y):u.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return[2,e]})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return null==e||e.disconnect(),removeClickListeners(),[2]})})}}},stringOrUndefined=function(e){if("string"==typeof e)return e},extractFormAction=function(e){var u=e.getAttribute("action");try{u=new URL(encodeURI(null!=u?u:""),window.location.href).href}catch(e){}return u},fileDownloadTracking=function(){var e,u=[],addEventListener=function(e,b,y){e.addEventListener(b,y),u.push({element:e,type:b,handler:y})},removeClickListeners=function(){u.forEach(function(e){var u=e.element,b=e.type,y=e.handler;null==u||u.removeEventListener(b,y)}),u=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(u,b){return(0,Q.mG)(void 0,void 0,void 0,function(){var y,w;return(0,Q.Jh)(this,function(T){return y=function(){if(!b){u.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 addFileDownloadListener=function(e){try{u=new URL(e.href,window.location.href)}catch(e){return}var u,w=y.exec(u.href),T=null==w?void 0:w[1];T&&addEventListener(e,"click",function(){var y;T&&b.track(e1,((y={})[e4]=T,y[e5]=u.pathname,y[e6]=e.id,y[e9]=e.text,y[e7]=e.href,y))})},y=/\.(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)(\?.+)?$/;
25Array.from(document.getElementsByTagName("a")).forEach(addFileDownloadListener),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&addFileDownloadListener(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(addFileDownloadListener)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?y():(w=getGlobalScope())?w.addEventListener("load",y):u.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return[2,e]})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return null==e||e.disconnect(),removeClickListeners(),[2]})})}}},tc=!1,detNotify=function(e){tc||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."),tc=!0)},networkConnectivityCheckerPlugin=function(){var e=getGlobalScope(),u=[],addNetworkListener=function(b,y){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(b,y),u.push({type:b,handler:y}))},removeNetworkListeners=function(){u.forEach(function(u){var b=u.type,y=u.handler;null==e||e.removeEventListener(b,y)}),u=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,u){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(b){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,addNetworkListener("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){u.flush()},e.flushIntervalMillis)}),addNetworkListener("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(e){return removeNetworkListeners(),[2]})})}}};function mergeUrls(e,u,b){var y,w,T=[];try{for(var _=(0,Q.XA)(null!=u?u:[]),P=_.next();!P.done;P=_.next()){var R=P.value;try{T.push(new RegExp(R))}catch(e){b.loggerProvider.warn("Invalid regex pattern: ".concat(R),e)}}}catch(e){y={error:e}}finally{try{P&&!P.done&&(w=_.return)&&w.call(_)}finally{if(y)throw y.error}}return e.concat(T)}var td=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],tp="data-amp-track-",tf=["div","span","h1","h2","h3","h4","h5","h6"],th="[Amplitude] Element Clicked",tg="[Amplitude] Rage Click",tv="[Amplitude] Element Tag",tm="[Amplitude] Element Text",tb="[Amplitude] Page URL",ty="https://app.amplitude.com",tw={US:ty,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},tS="data-amp-mask-attributes";function isFunction_isFunction(e){return"function"==typeof e}function operate(e){return function(u){if(isFunction_isFunction(null==u?void 0:u.lift))return u.lift(function(u){try{return e(u,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}function createErrorClass(e){var u=e(function(e){Error.call(e),e.stack=Error().stack});return u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,u}var tE=createErrorClass(function(e){return function(u){e(this),this.message=u?u.length+" errors occurred during unsubscription:\n"+u.map(function(e,u){return u+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=u}});function arrRemove(e,u){if(e){var b=e.indexOf(u);0<=b&&e.splice(b,1)}}var tC=function(){var e;function Subscription(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return Subscription.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,u,b,y,w,T=this._parentage;if(T){if(this._parentage=null,Array.isArray(T))try{for(var _=(0,Q.XA)(T),P=_.next();!P.done;P=_.next())P.value.remove(this)}catch(u){e={error:u}}finally{try{P&&!P.done&&(u=_.return)&&u.call(_)}finally{if(e)throw e.error}}else T.remove(this)}var R=this.initialTeardown;
25if(isFunction_isFunction(R))try{R()}catch(e){w=e instanceof tE?e.errors:[e]}var D=this._finalizers;if(D){this._finalizers=null;try{for(var U=(0,Q.XA)(D),j=U.next();!j.done;j=U.next()){var F=j.value;try{execFinalizer(F)}catch(e){w=null!=w?w:[],e instanceof tE?w=(0,Q.ev)((0,Q.ev)([],(0,Q.CR)(w)),(0,Q.CR)(e.errors)):w.push(e)}}}catch(e){b={error:e}}finally{try{j&&!j.done&&(y=U.return)&&y.call(U)}finally{if(b)throw b.error}}}if(w)throw new tE(w)}},Subscription.prototype.add=function(e){var u;if(e&&e!==this){if(this.closed)execFinalizer(e);else{if(e instanceof Subscription){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(u=this._finalizers)&&void 0!==u?u:[]).push(e)}}},Subscription.prototype._hasParent=function(e){var u=this._parentage;return u===e||Array.isArray(u)&&u.includes(e)},Subscription.prototype._addParent=function(e){var u=this._parentage;this._parentage=Array.isArray(u)?(u.push(e),u):u?[u,e]:e},Subscription.prototype._removeParent=function(e){var u=this._parentage;u===e?this._parentage=null:Array.isArray(u)&&arrRemove(u,e)},Subscription.prototype.remove=function(e){var u=this._finalizers;u&&arrRemove(u,e),e instanceof Subscription&&e._removeParent(this)},Subscription.EMPTY=((e=new Subscription).closed=!0,e),Subscription}(),tk=tC.EMPTY;function isSubscription(e){return e instanceof tC||e&&"closed"in e&&isFunction_isFunction(e.remove)&&isFunction_isFunction(e.add)&&isFunction_isFunction(e.unsubscribe)}function execFinalizer(e){isFunction_isFunction(e)?e():e.unsubscribe()}var tT={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},t_={setTimeout:function(e,u){for(var b=[],y=2;y<arguments.length;y++)b[y-2]=arguments[y];var w=t_.delegate;return(null==w?void 0:w.setTimeout)?w.setTimeout.apply(w,(0,Q.ev)([e,u],(0,Q.CR)(b))):setTimeout.apply(void 0,(0,Q.ev)([e,u],(0,Q.CR)(b)))},clearTimeout:function(e){var u=t_.delegate;return((null==u?void 0:u.clearTimeout)||clearTimeout)(e)},delegate:void 0};function reportUnhandledError(e){t_.setTimeout(function(){var u=tT.onUnhandledError;if(u)u(e);else throw e})}function noop(){}var tI=createNotification("C",void 0,void 0);function createNotification(e,u,b){return{kind:e,value:u,error:b}}var tA=null;function errorContext(e){if(tT.useDeprecatedSynchronousErrorHandling){var u=!tA;if(u&&(tA={errorThrown:!1,error:null}),e(),u){var b=tA,y=b.errorThrown,w=b.error;if(tA=null,y)throw w}}else e()}var tx=function(e){function Subscriber(u){var b=e.call(this)||this;return b.isStopped=!1,u?(b.destination=u,isSubscription(u)&&u.add(b)):b.destination=tD,b}return(0,Q.ZT)(Subscriber,e),Subscriber.create=function(e,u,b){return new tR(e,u,b)},Subscriber.prototype.next=function(e){this.isStopped?handleStoppedNotification(createNotification("N",e,void 0),this):this._next(e)},Subscriber.prototype.error=function(e){this.isStopped?handleStoppedNotification(createNotification("E",void 0,e),this):(this.isStopped=!0,this._error(e))},Subscriber.prototype.complete=function(){this.isStopped?handleStoppedNotification(tI,this):(this.isStopped=!0,this._complete())},Subscriber.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},Subscriber.prototype._next=function(e){this.destination.next(e)},Subscriber.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},Subscriber.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Subscriber}(tC),tP=Function.prototype.bind;function bind(e,u){return tP.call(e,u)}var tO=function(){function ConsumerObserver(e){this.partialObserver=e}return ConsumerObserver.prototype.next=function(e){var u=this.partialObserver;if(u.next)try{u.next(e)}catch(e){handleUnhandledError(e)}},ConsumerObserver.prototype.error=function(e){var u=this.partialObserver;if(u.error)try{u.error(e)}catch(e){handleUnhandledError(e)}else handleUnhandledError(e)},ConsumerObserver.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){handleUnhandledError(e)}},ConsumerObserver}(),tR=function(e){function SafeSubscriber(u,b,y){var w,T,_=e.call(this)||this;return isFunction_isFunction(u)||!u?w={next:null!=u?u:void 0,error:null!=b?b:void 0,complete:null!=y?y:void 0}
25:_&&tT.useDeprecatedNextContext?((T=Object.create(u)).unsubscribe=function(){return _.unsubscribe()},w={next:u.next&&bind(u.next,T),error:u.error&&bind(u.error,T),complete:u.complete&&bind(u.complete,T)}):w=u,_.destination=new tO(w),_}return(0,Q.ZT)(SafeSubscriber,e),SafeSubscriber}(tx);function handleUnhandledError(e){tT.useDeprecatedSynchronousErrorHandling?tT.useDeprecatedSynchronousErrorHandling&&tA&&(tA.errorThrown=!0,tA.error=e):reportUnhandledError(e)}function handleStoppedNotification(e,u){var b=tT.onStoppedNotification;b&&t_.setTimeout(function(){return b(e,u)})}var tD={closed:!0,next:noop,error:function(e){throw e},complete:noop};function createOperatorSubscriber(e,u,b,y,w){return new tL(e,u,b,y,w)}var tL=function(e){function OperatorSubscriber(u,b,y,w,T,_){var P=e.call(this,u)||this;return P.onFinalize=T,P.shouldUnsubscribe=_,P._next=b?function(e){try{b(e)}catch(e){u.error(e)}}:e.prototype._next,P._error=w?function(e){try{w(e)}catch(e){u.error(e)}finally{this.unsubscribe()}}:e.prototype._error,P._complete=y?function(){try{y()}catch(e){u.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,P}return(0,Q.ZT)(OperatorSubscriber,e),OperatorSubscriber.prototype.unsubscribe=function(){var u;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var b=this.closed;e.prototype.unsubscribe.call(this),b||null===(u=this.onFinalize)||void 0===u||u.call(this)}},OperatorSubscriber}(tx);function map(e,u){return operate(function(b,y){var w=0;b.subscribe(createOperatorSubscriber(y,function(b){y.next(e.call(u,b,w++))}))})}var isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function isPromise(e){return isFunction_isFunction(null==e?void 0:e.then)}var tN="function"==typeof Symbol&&Symbol.observable||"@@observable";function identity(e){return e}var tM=function(){function Observable(e){e&&(this._subscribe=e)}return Observable.prototype.lift=function(e){var u=new Observable;return u.source=this,u.operator=e,u},Observable.prototype.subscribe=function(e,u,b){var y,w=this,T=(y=e)&&y instanceof tx||y&&isFunction_isFunction(y.next)&&isFunction_isFunction(y.error)&&isFunction_isFunction(y.complete)&&isSubscription(y)?e:new tR(e,u,b);return errorContext(function(){var e=w.operator,u=w.source;T.add(e?e.call(T,u):u?w._subscribe(T):w._trySubscribe(T))}),T},Observable.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(u){e.error(u)}},Observable.prototype.forEach=function(e,u){var b=this;return new(u=getPromiseCtor(u))(function(u,y){var w=new tR({next:function(u){try{e(u)}catch(e){y(e),w.unsubscribe()}},error:y,complete:u});b.subscribe(w)})},Observable.prototype._subscribe=function(e){var u;return null===(u=this.source)||void 0===u?void 0:u.subscribe(e)},Observable.prototype[tN]=function(){return this},Observable.prototype.pipe=function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];return(0===e.length?identity:1===e.length?e[0]:function(u){return e.reduce(function(e,u){return u(e)},u)})(this)},Observable.prototype.toPromise=function(e){var u=this;return new(e=getPromiseCtor(e))(function(e,b){var y;u.subscribe(function(e){return y=e},function(e){return b(e)},function(){return e(y)})})},Observable.create=function(e){return new Observable(e)},Observable}();function getPromiseCtor(e){var u;return null!==(u=null!=e?e:tT.Promise)&&void 0!==u?u:Promise}function isAsyncIterable(e){return Symbol.asyncIterator&&isFunction_isFunction(null==e?void 0:e[Symbol.asyncIterator])}function createInvalidObservableTypeError(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 tU="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function isIterable(e){return isFunction_isFunction(null==e?void 0:e[tU])}function readableStreamLikeToAsyncGenerator(e){return(0,Q.FC)(this,arguments,function(){var u,b,y;return(0,Q.Jh)(this,function(w){switch(w.label){case 0:u=e.getReader(),w.label=1;case 1:w.trys.push([1,,9,10]),w.label=2;case 2:return[4,(0,Q.qq)(u.read())];case 3:if(y=(b=w.sent()).value,!b.done)return[3,5];return[4,(0,Q.qq)(void 0)];case 4:return[2,w.sent()];case 5:return[4,(0,Q.qq)(y)];case 6:return[4,w.sent()];case 7:return w.sent(),[3,2];case 8:return[3,10];case 9:return u.releaseLock(),[7];case 10:return[2]}})})}function isReadableStreamLike(e){return isFunction_isFunction(null==e?void 0:e.getReader)}function innerFrom(e){if(e instanceof tM)return e;if(null!=e){if(isFunction_isFunction(e[tN]))return new tM(function(u){var b=e[tN]();if(isFunction_isFunction(b.subscribe))return b.subscribe(u);throw TypeError("Provided object does not correctly implement Symbol.observable")});if(isArrayLike(e))return new tM(function(u){for(var b=0;b<e.length&&!u.closed;b++)u.next(e[b]);u.complete()});
25if(isPromise(e))return new tM(function(u){e.then(function(e){u.closed||(u.next(e),u.complete())},function(e){return u.error(e)}).then(null,reportUnhandledError)});if(isAsyncIterable(e))return fromAsyncIterable(e);if(isIterable(e))return new tM(function(u){var b,y;try{for(var w=(0,Q.XA)(e),T=w.next();!T.done;T=w.next()){var _=T.value;if(u.next(_),u.closed)return}}catch(e){b={error:e}}finally{try{T&&!T.done&&(y=w.return)&&y.call(w)}finally{if(b)throw b.error}}u.complete()});if(isReadableStreamLike(e))return fromAsyncIterable(readableStreamLikeToAsyncGenerator(e))}throw createInvalidObservableTypeError(e)}function fromAsyncIterable(e){return new tM(function(u){(function(e,u){var b,y,w,T;return(0,Q.mG)(this,void 0,void 0,function(){var _;return(0,Q.Jh)(this,function(P){switch(P.label){case 0:P.trys.push([0,5,6,11]),b=(0,Q.KL)(e),P.label=1;case 1:return[4,b.next()];case 2:if((y=P.sent()).done)return[3,4];if(_=y.value,u.next(_),u.closed)return[2];P.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return w={error:P.sent()},[3,11];case 6:if(P.trys.push([6,,9,10]),!(y&&!y.done&&(T=b.return)))return[3,8];return[4,T.call(b)];case 7:P.sent(),P.label=8;case 8:return[3,10];case 9:if(w)throw w.error;return[7];case 10:return[7];case 11:return u.complete(),[2]}})})})(e,u).catch(function(e){return u.error(e)})})}var tj=createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),tF=function(e){function Subject(){var u=e.call(this)||this;return u.closed=!1,u.currentObservers=null,u.observers=[],u.isStopped=!1,u.hasError=!1,u.thrownError=null,u}return(0,Q.ZT)(Subject,e),Subject.prototype.lift=function(e){var u=new tq(this,this);return u.operator=e,u},Subject.prototype._throwIfClosed=function(){if(this.closed)throw new tj},Subject.prototype.next=function(e){var u=this;errorContext(function(){var b,y;if(u._throwIfClosed(),!u.isStopped){u.currentObservers||(u.currentObservers=Array.from(u.observers));try{for(var w=(0,Q.XA)(u.currentObservers),T=w.next();!T.done;T=w.next())T.value.next(e)}catch(e){b={error:e}}finally{try{T&&!T.done&&(y=w.return)&&y.call(w)}finally{if(b)throw b.error}}}})},Subject.prototype.error=function(e){var u=this;errorContext(function(){if(u._throwIfClosed(),!u.isStopped){u.hasError=u.isStopped=!0,u.thrownError=e;for(var b=u.observers;b.length;)b.shift().error(e)}})},Subject.prototype.complete=function(){var e=this;errorContext(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var u=e.observers;u.length;)u.shift().complete()}})},Subject.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(Subject.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),Subject.prototype._trySubscribe=function(u){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,u)},Subject.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},Subject.prototype._innerSubscribe=function(e){var u=this,b=this.hasError,y=this.isStopped,w=this.observers;return b||y?tk:(this.currentObservers=null,w.push(e),new tC(function(){u.currentObservers=null,arrRemove(w,e)}))},Subject.prototype._checkFinalizedStatuses=function(e){var u=this.hasError,b=this.thrownError,y=this.isStopped;u?e.error(b):y&&e.complete()},Subject.prototype.asObservable=function(){var e=new tM;return e.source=this,e},Subject.create=function(e,u){return new tq(e,u)},Subject}(tM),tq=function(e){function AnonymousSubject(u,b){var y=e.call(this)||this;return y.destination=u,y.source=b,y}return(0,Q.ZT)(AnonymousSubject,e),AnonymousSubject.prototype.next=function(e){var u,b;null===(b=null===(u=this.destination)||void 0===u?void 0:u.next)||void 0===b||b.call(u,e)},AnonymousSubject.prototype.error=function(e){var u,b;null===(b=null===(u=this.destination)||void 0===u?void 0:u.error)||void 0===b||b.call(u,e)},AnonymousSubject.prototype.complete=function(){var e,u;null===(u=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===u||u.call(e)},AnonymousSubject.prototype._subscribe=function(e){var u,b;return null!==(b=null===(u=this.source)||void 0===u?void 0:u.subscribe(e))&&void 0!==b?b:tk},AnonymousSubject}(tF);function share(e){void 0===e&&(e={});var u=e.connector,b=void 0===u?function(){return new tF}:u,y=e.resetOnError,w=void 0===y||y,T=e.resetOnComplete,_=void 0===T||T,P=e.resetOnRefCountZero,R=void 0===P||P;return function(e){var u,y,T,P=0,D=!1,U=!1,cancelReset=function(){null==y||y.unsubscribe(),y=void 0},reset=function(){cancelReset(),u=T=void 0,D=U=!1},resetAndUnsubscribe=function(){var e=u;reset(),null==e||e.unsubscribe()};return operate(function(e,j){P++,U||D||cancelReset();var F=T=null!=T?T:b();j.add(function(){0!=--P||U||D||(y=handleReset(resetAndUnsubscribe,R))}),F.subscribe(j),!u&&P>0&&(u=new tR({next:function(e){return F.next(e)},error:function(e){U=!0,cancelReset(),y=handleReset(reset,w,e),F.error(e)},complete:function(){D=!0,cancelReset(),y=handleReset(reset,_),F.complete()}}),innerFrom(e).subscribe(u))})(e)}}function handleReset(e,u){for(var b=[],y=2;y<arguments.length;y++)b[y-2]=arguments[y];if(!0===u){e();return}if(!1!==u){var w=new tR({next:function(){w.unsubscribe(),e()}});return innerFrom(u.apply(void 0,(0,Q.ev)([],(0,Q.CR)(b)))).subscribe(w)}}function executeSchedule(e,u,b,y,w){void 0===y&&(y=0),void 0===w&&(w=!1);var T=u.schedule(function(){b(),w?e.add(this.schedule(null,y)):this.unsubscribe()},y);if(e.add(T),!w)return T}function mergeMap(e,u,b){return(void 0===b&&(b=1/0),isFunction_isFunction(u))?mergeMap(function(b,y){return map(function(e,w){return u(b,e,y,w)})(innerFrom(e(b,y)))},b):("number"==typeof u&&(b=u),operate(function(u,y){var w,T,_,P,R,D,U,j,F,q,G,B;return w=b,D=[],U=0,j=0,F=!1,q=function(){!F||D.length||U||y.complete()},G=function(e){return U<w?B(e):D.push(e)},B=function(u){_&&y.next(u),U++;var b=!1;innerFrom(e(u,j++)).subscribe(createOperatorSubscriber(y,function(e){null==T||T(e),_?G(e):y.next(e)},function(){b=!0},void 0,function(){if(b)try{for(U--;D.length&&U<w;)!function(){var e=D.shift();P?executeSchedule(y,P,function(){return B(e)}):B(e)}();q()}catch(e){y.error(e)}}))},u.subscribe(createOperatorSubscriber(y,G,function(){F=!0,q()})),function(){null==R||R()}}))}var tG=Array.isArray,tB=["addListener","removeListener"],tJ=["addEventListener","removeEventListener"],tW=["on","off"];
25function fromEvent(e,u,b,y){if(isFunction_isFunction(b)&&(y=b,b=void 0),y)return fromEvent(e,u,b).pipe((w=y,map(function(e){return tG(e)?w.apply(void 0,(0,Q.ev)([],(0,Q.CR)(e))):w(e)})));var w,T=(0,Q.CR)(isFunction_isFunction(e.addEventListener)&&isFunction_isFunction(e.removeEventListener)?tJ.map(function(y){return function(w){return e[y](u,w,b)}}):isFunction_isFunction(e.addListener)&&isFunction_isFunction(e.removeListener)?tB.map(toCommonHandlerRegistry(e,u)):isFunction_isFunction(e.on)&&isFunction_isFunction(e.off)?tW.map(toCommonHandlerRegistry(e,u)):[],2),_=T[0],P=T[1];if(!_&&isArrayLike(e))return mergeMap(function(e){return fromEvent(e,u,b)})(innerFrom(e));if(!_)throw TypeError("Invalid event target");return new tM(function(e){var handler=function(){for(var u=[],b=0;b<arguments.length;b++)u[b]=arguments[b];return e.next(1<u.length?u:u[0])};return _(handler),function(){return P(handler)}})}function toCommonHandlerRegistry(e,u){return function(b){return function(y){return e[b](u,y)}}}var isUrlMatchAllowlist=function(e,u){return!u||!u.length||u.some(function(u){return"string"==typeof u?e===u:e.match(u)})},getDecodeURI=function(e,u){var b=e;try{b=decodeURI(e)}catch(e){null==u||u.error("Malformed URI sequence: ",e)}return b},tV=["input","select","textarea"],isElementPointerCursor=function(e,u){var b,y=null===(b=null==window?void 0:window.getComputedStyle)||void 0===b?void 0:b.call(window,e);return(null==y?void 0:y.getPropertyValue("cursor"))==="pointer"&&"click"===u},createShouldTrackEvent=function(e,u,b){return void 0===b&&(b=!1),function(y,w){var T,_,P=e.pageUrlAllowlist,R=e.pageUrlExcludelist,D=e.shouldTrackEventResolver,U=null===(_=null===(T=null==w?void 0:w.tagName)||void 0===T?void 0:T.toLowerCase)||void 0===_?void 0:_.call(T);if(!U)return!1;if(D)return D(y,w);if(!isUrlMatchAllowlist(window.location.href,P)||R&&R.length>0&&isUrlMatchAllowlist(window.location.href,R))return!1;var j=String(null==w?void 0:w.getAttribute("type"))||"";if("string"==typeof j)switch(j.toLowerCase()){case"hidden":case"password":return!1}var F=isElementPointerCursor(w,y);if(b&&F)return!0;if(u&&!u.some(function(e){var u;return!!(null===(u=null==w?void 0:w.matches)||void 0===u?void 0:u.call(w,e))}))return!1;switch(U){case"input":case"select":case"textarea":return"change"===y||"click"===y;default:if(F)return!0;return"click"===y}}},isNonSensitiveElement=function(e){var u,b,y,w=null===(b=null===(u=null==e?void 0:e.tagName)||void 0===u?void 0:u.toLowerCase)||void 0===b?void 0:b.call(u),T=e instanceof HTMLElement&&(null===(y=e.getAttribute("contenteditable"))||void 0===y?void 0:y.toLowerCase())==="true";return!tV.includes(w)&&!T},removeEmptyProperties=function(e){return Object.keys(e).reduce(function(u,b){var y=e[b];return null==y||"object"==typeof y&&0===Object.keys(y).length||"string"==typeof y&&0===y.trim().length||(u[b]=y),u},{})},getClosestElement=function(e,u){return e?u.some(function(u){var b;return null===(b=null==e?void 0:e.matches)||void 0===b?void 0:b.call(e,u)})?e:getClosestElement(null==e?void 0:e.parentElement,u):null},filterOutNonTrackableEvents=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor},tH="1.17.0",tz=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",tS,ti]),tX=["type"],t$=["svg","path","g"],tK=["password","hidden"],getDataSource=function(e,u){try{if("DOM_ELEMENT"===e.sourceType){var b=document.documentElement;if(e.scope&&u&&(b=u.closest(e.scope)),b&&e.selector)return b.querySelector(e.selector);return b}}catch(e){}},executeActions=function(e,u,b){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var y=b.extractDataFromDataSource(e.dataSource,u.closestTrackedAncestor);u.targetElementProperties[e.destinationKey]=y}})},DataExtractor=function(e,u){var b,y,w,T=this;this.replaceSensitiveString=function(e){return replaceSensitiveString(e,T.additionalMaskTextPatterns)},this.getHierarchy=function(e){var u,b,y,w,_=performance.now(),P=[];if(!e)return[];for(var R=function(e){var u=[];
25if(!e)return u;u.push(e);for(var b=e.parentElement;b&&"HTML"!==b.tagName;)u.push(b),b=b.parentElement;return u}(e),D=new Map,U=R.length-1;U>=0;U--){var j=R[U];if(j){var F,q=(F=j.getAttribute(tS))?F.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],G=U===R.length-1?[]:null!==(y=D.get(R[U+1]))&&void 0!==y?y:new Set,B=new Set((0,Q.ev)((0,Q.ev)([],(0,Q.CR)(G),!1),(0,Q.CR)(q),!1));D.set(j,B)}}P=R.map(function(e){var u;return function(e,u){if(null===e)return null;var b,y,w,T,_,P,R=String(e.tagName).toLowerCase(),D={tag:R},U=Array.from(null!==(T=null===(w=e.parentElement)||void 0===w?void 0:w.children)&&void 0!==T?T:[]);U.length&&(D.index=U.indexOf(e),D.indexOfType=U.filter(function(u){return u.tagName===e.tagName}).indexOf(e));var j=null===(P=null===(_=e.previousElementSibling)||void 0===_?void 0:_.tagName)||void 0===P?void 0:P.toLowerCase();j&&(D.prevSib=String(j));var F=e.getAttribute("id");F&&(D.id=String(F));var q=Array.from(e.classList);q.length&&(D.classes=q);var G={},B=Array.from(e.attributes).filter(function(e){return!tz.has(e.name)}),J=!isNonSensitiveElement(e);if(!tK.includes(String(e.getAttribute("type")))&&!t$.includes(R))try{for(var W=(0,Q.XA)(B),V=W.next();!V.done;V=W.next()){var H=V.value;if(!J||tX.includes(H.name)){if(u.has(H.name)){G[H.name]=to;continue}G[H.name]=String(H.value).substring(0,128)}}}catch(e){b={error:e}}finally{try{V&&!V.done&&(y=W.return)&&y.call(W)}finally{if(b)throw b.error}}return Object.keys(G).length&&(D.attrs=G),D}(e,null!==(u=D.get(e))&&void 0!==u?u:new Set)});var _loop_1=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(u){var b=(0,Q.CR)(u,2),y=b[0],w=b[1];e.attrs&&(e.attrs[y]=T.replaceSensitiveString(w))})};try{for(var J=(0,Q.XA)(P),W=J.next();!W.done;W=J.next()){var V=W.value;_loop_1(V)}}catch(e){u={error:e}}finally{try{W&&!W.done&&(b=J.return)&&b.call(J)}finally{if(u)throw u.error}}var H=performance.now();return null===(w=T.diagnosticsClient)||void 0===w||w.recordHistogram("autocapturePlugin.getHierarchy",H-_),P},this.getNearestLabel=function(e){var u,b=e.parentElement;if(!b)return"";try{u=b.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){u=null}return u?T.getText(u):T.getNearestLabel(b)},this.getEventProperties=function(e,u,b){var y,w,_,P,R=null===(_=null===(w=null==u?void 0:u.tagName)||void 0===w?void 0:w.toLowerCase)||void 0===_?void 0:_.call(w),D="function"==typeof u.getBoundingClientRect?u.getBoundingClientRect():{left:null,top:null},U=T.getHierarchy(u),j=null===(P=U[0])||void 0===P?void 0:P.attrs,F=T.getNearestLabel(u),q=Object.entries(null!=j?j:{}).reduce(function(e,u){var y=(0,Q.CR)(u,2),w=y[0],T=y[1];if(w.startsWith(b)){var _=w.replace(b,"");_&&(e[_]=T||"")}return e},{}),G=((y={})["[Amplitude] Element Hierarchy"]=U,y[tv]=R,y[tm]=T.getText(u),y["[Amplitude] Element Position Left"]=null==D.left?null:Math.round(D.left),y["[Amplitude] Element Position Top"]=null==D.top?null:Math.round(D.top),y["[Amplitude] Element Attributes"]=q,y["[Amplitude] Element Parent Label"]=F,y[tb]=getDecodeURI(window.location.href.split("?")[0]),y["[Amplitude] Page Title"]=getPageTitle(T.replaceSensitiveString),y["[Amplitude] Viewport Height"]=window.innerHeight,y["[Amplitude] Viewport Width"]=window.innerWidth,y);return G["[Amplitude] Element ID"]=u.getAttribute("id")||"",G["[Amplitude] Element Class"]=u.getAttribute("class"),G["[Amplitude] Element Aria Label"]=null==j?void 0:j["aria-label"],"a"===R&&"click"===e&&u instanceof HTMLAnchorElement&&(G["[Amplitude] Element Href"]=T.replaceSensitiveString(u.href)),removeEmptyProperties(G)},this.addAdditionalEventProperties=function(e,u,b,y,w){void 0===w&&(w=!1);var _={event:e,timestamp:Date.now(),type:u};if(("click"===_.type||"change"===_.type)&&null!==_.event.target){if(w&&isElementPointerCursor(_.event.target,_.type))return _.closestTrackedAncestor=_.event.target,_.targetElementProperties=T.getEventProperties(_.type,_.closestTrackedAncestor,y),_;var P=getClosestElement(_.event.target,b);P&&(_.closestTrackedAncestor=P,_.targetElementProperties=T.getEventProperties(_.type,P,y))}return _},this.extractDataFromDataSource=function(e,u){if("DOM_ELEMENT"===e.sourceType){var b=getDataSource(e,u);if(b){if("TEXT"===e.elementExtractType)return T.getText(b);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return b.getAttribute(e.attribute)}}},this.getText=function(e){if(null!==e.closest("[".concat(ti,"]")))return to;var u="";if(e.querySelector("[".concat(ti,"], [contenteditable]"))){var b=e.cloneNode(!0);b.querySelectorAll("[".concat(ti,"], [contenteditable]")).forEac
25h(function(e){e.innerText=to}),u=b.innerText||""}else u=e.innerText||"";return T.replaceSensitiveString(u.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){if(!e)return{};var u,b,y,w=null===(y=null===(b=null==e?void 0:e.tagName)||void 0===b?void 0:b.toLowerCase)||void 0===y?void 0:y.call(b);return removeEmptyProperties(((u={})[tv]=w,u[tm]=T.getText(e),u[tb]=window.location.href.split("?")[0],u))},this.diagnosticsClient=null==u?void 0:u.diagnosticsClient;var _=null!==(w=e.maskTextRegex)&&void 0!==w?w:[],P=[];try{for(var R=(0,Q.XA)(_),D=R.next();!D.done;D=R.next()){var U=D.value;if(P.length>=25)break;if(U instanceof RegExp)P.push(U);else if("pattern"in U&&"string"==typeof U.pattern)try{P.push(RegExp(U.pattern,"i"))}catch(e){}}}catch(e){b={error:e}}finally{try{D&&!D.done&&(y=R.return)&&y.call(R)}finally{if(b)throw b.error}}this.additionalMaskTextPatterns=P},tZ=function(){function WindowMessenger(e){var u=(void 0===e?{}:e).origin,b=void 0===u?ty:u,y=this;this.endpoint=ty,this.requestCallbacks={},this.onSelect=function(e){y.notify({action:"element-selected",data:e})},this.onTrack=function(e,u){"selector-mode-changed"===e?y.notify({action:"track-selector-mode-changed",data:u}):"selector-moved"===e&&y.notify({action:"track-selector-moved",data:u})},this.endpoint=b}return WindowMessenger.prototype.notify=function(e){var u,b,y,w;null===(b=null===(u=this.logger)||void 0===u?void 0:u.debug)||void 0===b||b.call(u,"Message sent: ",JSON.stringify(e)),null===(w=null===(y=window.opener)||void 0===y?void 0:y.postMessage)||void 0===w||w.call(y,e,this.endpoint)},WindowMessenger.prototype.sendRequest=function(e,u,b){var y=this;void 0===b&&(b={timeout:15e3});var w="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),T={id:w,action:e,args:u};return new Promise(function(u,_){y.requestCallbacks[w]={resolve:u,reject:_},y.notify(T),(null==b?void 0:b.timeout)>0&&setTimeout(function(){_(Error("".concat(e," timed out (id: ").concat(w,")"))),delete y.requestCallbacks[w]},b.timeout)})},WindowMessenger.prototype.handleResponse=function(e){var u;if(!this.requestCallbacks[e.id]){null===(u=this.logger)||void 0===u||u.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},WindowMessenger.prototype.setup=function(e){var u=this,b=void 0===e?{dataExtractor:new DataExtractor({})}:e,y=b.logger,w=b.endpoint,T=b.isElementSelectable,_=b.cssSelectorAllowlist,P=b.actionClickAllowlist,R=b.dataExtractor;this.logger=y,w&&this.endpoint===ty&&(this.endpoint=w);var D=null;window.addEventListener("message",function(e){if(null===(y=null===(b=u.logger)||void 0===b?void 0:b.debug)||void 0===y||y.call(b,"Message received: ",JSON.stringify(e)),u.endpoint===e.origin){var b,y,w,U,j,F=null==e?void 0:e.data,q=null==F?void 0:F.action;if(q){if("id"in F)null===(U=null===(w=u.logger)||void 0===w?void 0:w.debug)||void 0===U||U.call(w,"Received Response to previous request: ",JSON.stringify(e)),u.handleResponse(F);else if("ping"===q)u.notify({action:"pong"});else if("initialize-visual-tagging-selector"===q){var G,B=null==F?void 0:F.data;(G="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise(function(e,u){var b;try{var y=document.createElement("script");y.type="text/javascript",y.async=!0,y.src=G,y.addEventListener("load",function(){e({status:!0})},{once:!0}),y.addEventListener("error",function(){u({status:!1,message:"Failed to load the script ".concat(G)})}),null===(b=document.head)||void 0===b||b.appendChild(y)}catch(e){u(e)}})).then(function(){var e;D=null===(e=null==window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:R.getEventTagProps,isElementSelectable:function(e){return!T||T((null==B?void 0:B.actionType)||"click",e)},onTrack:u.onTrack,onSelect:u.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:u,cssSelectorAllowlist:_,actionClickAllowlist:P,extractDataFromDataSource:R.extractDataFromDataSource,dataExtractor:R,diagnostics:{autocapture:{version:tH}}}),u.notify({action:"selector-loaded"})}).catch(function(){var e;
25null===(e=u.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")})}else"close-visual-tagging-selector"===q&&(null===(j=null==D?void 0:D.close)||void 0===j||j.call(D))}}}),this.notify({action:"page-loaded"})},WindowMessenger}();function filter(e,u){return operate(function(b,y){var w=0;b.subscribe(createOperatorSubscriber(y,function(b){return e.call(u,b,w++)&&y.next(b)}))})}var tY=function(e){function Action(u,b){return e.call(this)||this}return(0,Q.ZT)(Action,e),Action.prototype.schedule=function(e,u){return void 0===u&&(u=0),this},Action}(tC),tQ={setInterval:function(e,u){for(var b=[],y=2;y<arguments.length;y++)b[y-2]=arguments[y];var w=tQ.delegate;return(null==w?void 0:w.setInterval)?w.setInterval.apply(w,(0,Q.ev)([e,u],(0,Q.CR)(b))):setInterval.apply(void 0,(0,Q.ev)([e,u],(0,Q.CR)(b)))},clearInterval:function(e){var u=tQ.delegate;return((null==u?void 0:u.clearInterval)||clearInterval)(e)},delegate:void 0},t0=function(e){function AsyncAction(u,b){var y=e.call(this,u,b)||this;return y.scheduler=u,y.work=b,y.pending=!1,y}return(0,Q.ZT)(AsyncAction,e),AsyncAction.prototype.schedule=function(e,u){if(void 0===u&&(u=0),this.closed)return this;this.state=e;var b,y=this.id,w=this.scheduler;return null!=y&&(this.id=this.recycleAsyncId(w,y,u)),this.pending=!0,this.delay=u,this.id=null!==(b=this.id)&&void 0!==b?b:this.requestAsyncId(w,this.id,u),this},AsyncAction.prototype.requestAsyncId=function(e,u,b){return void 0===b&&(b=0),tQ.setInterval(e.flush.bind(e,this),b)},AsyncAction.prototype.recycleAsyncId=function(e,u,b){if(void 0===b&&(b=0),null!=b&&this.delay===b&&!1===this.pending)return u;null!=u&&tQ.clearInterval(u)},AsyncAction.prototype.execute=function(e,u){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var b=this._execute(e,u);if(b)return b;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},AsyncAction.prototype._execute=function(e,u){var b,y=!1;try{this.work(e)}catch(e){y=!0,b=e||Error("Scheduled action threw falsy error")}if(y)return this.unsubscribe(),b},AsyncAction.prototype.unsubscribe=function(){if(!this.closed){var u=this.id,b=this.scheduler,y=b.actions;this.work=this.state=this.scheduler=null,this.pending=!1,arrRemove(y,this),null!=u&&(this.id=this.recycleAsyncId(b,u,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},AsyncAction}(tY),t1={now:function(){return(t1.delegate||Date).now()},delegate:void 0},t2=function(){function Scheduler(e,u){void 0===u&&(u=Scheduler.now),this.schedulerActionCtor=e,this.now=u}return Scheduler.prototype.schedule=function(e,u,b){return void 0===u&&(u=0),new this.schedulerActionCtor(this,e).schedule(b,u)},Scheduler.now=t1.now,Scheduler}(),t3=new(function(e){function AsyncScheduler(u,b){void 0===b&&(b=t2.now);var y=e.call(this,u,b)||this;return y.actions=[],y._active=!1,y}return(0,Q.ZT)(AsyncScheduler,e),AsyncScheduler.prototype.flush=function(e){var u,b=this.actions;if(this._active){b.push(e);return}this._active=!0;do if(u=e.execute(e.state,e.delay))break;while(e=b.shift());if(this._active=!1,u){for(;e=b.shift();)e.unsubscribe();throw u}},AsyncScheduler}(t2))(t0);function mergeAll(e){return void 0===e&&(e=1/0),mergeMap(identity,e)}var t4=new tM(function(e){return e.complete()});function isScheduler(e){return e&&isFunction_isFunction(e.schedule)}function last(e){return e[e.length-1]}function popScheduler(e){return isScheduler(last(e))?e.pop():void 0}function observeOn(e,u){return void 0===u&&(u=0),operate(function(b,y){b.subscribe(createOperatorSubscriber(y,function(b){return executeSchedule(y,e,function(){return y.next(b)},u)},function(){return executeSchedule(y,e,function(){return y.complete()},u)},function(b){return executeSchedule(y,e,function(){return y.error(b)},u)}))})}function subscribeOn(e,u){return void 0===u&&(u=0),operate(function(b,y){y.add(e.schedule(function(){return b.subscribe(y)},u))})}function scheduleAsyncIterable(e,u){if(!e)throw Error("Iterable cannot be null");return new tM(function(b){executeSchedule(b,u,function(){var y=e[Symbol.asyncIterator]();executeSchedule(b,u,function(){y.next().then(function(e){e.done?b.complete():b.next(e.value)})},0,!0)})})}function from(e,u){return u?function(e,u){if(null!=e){if(isFunction_isFunction(e[tN]))return innerFrom(e).pipe(subscribeOn(u),observeOn(u));if(isArrayLike(e))return new tM(function(b){var y=0;return u.schedule(function(){y===e.length?b.complete():(b.next(e[y++]),b.closed||this.schedule())})});
25if(isPromise(e))return innerFrom(e).pipe(subscribeOn(u),observeOn(u));if(isAsyncIterable(e))return scheduleAsyncIterable(e,u);if(isIterable(e))return new tM(function(b){var y;return executeSchedule(b,u,function(){y=e[tU](),executeSchedule(b,u,function(){var e,u,w;try{u=(e=y.next()).value,w=e.done}catch(e){b.error(e);return}w?b.complete():b.next(u)},0,!0)}),function(){return isFunction_isFunction(null==y?void 0:y.return)&&y.return()}});if(isReadableStreamLike(e))return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(e),u)}throw createInvalidObservableTypeError(e)}(e,u):innerFrom(e)}function merge(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];var b=popScheduler(e),y="number"==typeof last(e)?e.pop():1/0;return e.length?1===e.length?innerFrom(e[0]):mergeAll(y)(from(e,b)):t4}function take(e){return e<=0?function(){return t4}:operate(function(u,b){var y=0;u.subscribe(createOperatorSubscriber(b,function(u){++y<=e&&(b.next(u),e<=y&&b.complete())}))})}function isValidDate(e){return e instanceof Date&&!isNaN(e)}function timer(e,u,b){void 0===e&&(e=0),void 0===b&&(b=t3);var y=-1;return null!=u&&(isScheduler(u)?b=u:y=u),new tM(function(u){var w=isValidDate(e)?+e-b.now():e;w<0&&(w=0);var T=0;return b.schedule(function(){u.closed||(u.next(T++),0<=y?this.schedule(void 0,y):u.complete())},w)})}var t5=createErrorClass(function(e){return function(u){void 0===u&&(u=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=u}});function timeoutErrorFactory(e){throw new t5(e)}var createMutationObservable=function(){return new tM(function(e){var u=new MutationObserver(function(u){e.next(u)});return u.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return u.disconnect()}})},createClickObservable=function(e){return void 0===e&&(e="click"),fromEvent(document,e,{capture:!0})},matchEventToFilter=function(e,u){try{if("[Amplitude] Element Text"===u.subprop_key)return"is"===u.subprop_op&&u.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===u.subprop_key)return"autotrack css match"===u.subprop_op&&!!e.closestTrackedAncestor.closest(u.subprop_value.toString())}catch(e){console.error("Error matching event to filter",e)}return!1},t6={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},groupLabeledEventIdsByEventType=function(e){var u,b,y,w,T=Object.values(t6).reduce(function(e,u){return e[u]=new Set,e},{});if(!e)return T;try{for(var _=(0,Q.XA)(e),P=_.next();!P.done;P=_.next()){var R=P.value;try{try{for(var D=(y=void 0,(0,Q.XA)(R.definition)),U=D.next();!U.done;U=D.next()){var j=t6[U.value.event_type];j&&T[j].add(R.id)}}catch(e){y={error:e}}finally{try{U&&!U.done&&(w=D.return)&&w.call(D)}finally{if(y)throw y.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==R?void 0:R.id,e)}}}catch(e){u={error:e}}finally{try{P&&!P.done&&(b=_.return)&&b.call(_)}finally{if(u)throw u.error}}return T},createLabeledEventToTriggerMap=function(e){var u,b,y,w,T=new Map;try{for(var _=(0,Q.XA)(e),P=_.next();!P.done;P=_.next()){var R=P.value;try{for(var D=(y=void 0,(0,Q.XA)(R.conditions)),U=D.next();!U.done;U=D.next()){var j=U.value;if("LABELED_EVENT"===j.type){var F=j.match.eventId,q=T.get(F);q||(q=[],T.set(F,q)),q.push(R)}}}catch(e){y={error:e}}finally{try{U&&!U.done&&(w=D.return)&&w.call(D)}finally{if(y)throw y.error}}}}catch(e){u={error:e}}finally{try{P&&!P.done&&(b=_.return)&&b.call(_)}finally{if(u)throw u.error}}return T},matchLabeledEventsToTriggers=function(e,u){var b,y,w,T,_=new Set;try{for(var P=(0,Q.XA)(e),R=P.next();!R.done;R=P.next()){var D=R.value,U=u.get(D.id);if(U)try{for(var j=(w=void 0,(0,Q.XA)(U)),F=j.next();!F.done;F=j.next()){var q=F.value;_.add(q)}}catch(e){w={error:e}}finally{try{F&&!F.done&&(T=j.return)&&T.call(j)}finally{if(w)throw w.error}}}}catch(e){b={error:e}}finally{try{R&&!R.done&&(y=P.return)&&y.call(P)}finally{if(b)throw b.error}}return Array.from(_)},t9=function(){function TriggerEvaluator(e,u,b,y){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=u,this.dataExtractor=b,this.options=y}return TriggerEvaluator.prototype.evaluate=function(e){var u,b,y=this.options.pageActions;if(!y)return e;var w=matchLabeledEventsToTriggers(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return y.labeledEvents[e]}).filter(function(u){return u.definition.some(function(u){return t6[u.event_type]===e.type&&u.filters.every(function(u){return matchEventToFilter(e,u)})})}),this.labeledEventToTriggerMap);try{for(var T=(0,Q.XA)(w),_=T.next();!_.done;_=T.next()){var P=_.value;executeActions(P.actions,e,this.dataExtractor)}}catch(e){u={error:e}}finally{try{_&&!_.done&&(b=T.return)&&b.call(T)}finally{if(u)throw u.error}}return e},TriggerEvaluator.prototype.update=function(e,u,b){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=u,this.options=b},TriggerEvaluator}();(U=z||(z={})).ClickObservable="clickObservable",U.ChangeObservable="changeObservable",U.NavigateObservable="navigateObservable",U.MutationObservable="mutationObservable";var autocapturePlugin=function(e,u){void 0===e&&(e={}),null==u||u.diagnosticsClient.setTag("plugin.autocapture.version",tH);var b,y,w,T,_,P,R,D,U,j,F,q=e.dataAttributePrefix,G=void 0===q?tp:q,B=e.visualTaggingOptions,J=void 0===B?{enabled:!0,messenger:new tZ}:B;e.cssSelectorAllowlist=null!==(T=e.cssSelectorAllowlist)&&void 0!==T?T:td,e.actionClickAllowlist=null!==(_=e.actionClickAllowlist)&&void 0!==_?_:tf,e.debounceTime=null!==(P=e.debounceTime)&&void 0!==P?P:0,e.pageUrlExcludelist=null===(R=e.pageUrlExcludelist)||void 0===R?void 0:R.reduce(function(e,u){if("string"==typeof u&&e.push(u),u instanceof RegExp&&e.push(u),"object"==typeof u&&null!==u&&"pattern"in u)try{e.push(new RegExp(u.pattern))}catch(e){console.warn("Invalid regex pattern: ".concat(u.pattern),e)}return e},[]);var W="@amplitude/plugin-autocapture-browser",V=[],H=new DataExtractor(e,u),createObservables=function(){var u,b,y=createClickObservable().pipe(map(function(u){return H.addAdditionalEventProperties(u,"click",e.cssSelectorAllowlist,G)}),share()),w=fromEvent(document,"change",{capture:!0}).pipe(map(function(u){return H.addAdditionalEventProperties(u,"change",e.cssSelectorAllowlist,G)}),share());window.navigation&&(b=fromEvent(window.navigation,"navigate").pipe(map(function(u){return H.addAdditionalEventProperties(u,"navigate",e.cssSelectorAllowlist,G)}),share()));var T=createMutationObservable().pipe(map(function(u){return H.addAdditionalEventProperties(u,"mutation",e.cssSelectorAllowlist,G)}),share());return(u={})[z.ClickObservable]=y,u[z.ChangeObservable]=w,u[z.NavigateObservable]=b,u[z.MutationObservable]=T,u},X=groupLabeledEventIdsByEventType(Object.values(null!==(U=null===(D=e.pageActions)||void 0===D?void 0:D.labeledEvents)&&void 0!==U?U:{})),K=createLabeledEventToTriggerMap(null!==(F=null===(j=e.pageActions)||void 0===j?void 0:j.triggers)&&void 0!==F?F:[]),Z=(b=X,y=K,w=e,new t9(b,y,H,w)),recomputePageActionsData=function(u){var b,y;u&&(e.pageActions=(0,Q.pi)((0,Q.pi)({},e.pageActions),u),X=groupLabeledEventIdsByEventType(Object.values(null!==(b=e.pageActions.labeledEvents)&&void 0!==b?b:{})),K=createLabeledEventToTriggerMap(null!==(y=e.pageActions.triggers)&&void 0!==y?y:[]),Z.update(X,K,e))};return{name:W,type:"enrichment",setup:function(u,b){return(0,Q.mG)(void 0,void 0,void 0,function(){var y,w,T,_,P,R,D,U,j,F;return(0,Q.Jh)(this,function(q){var B,z,X,K,Y,ee,et,er,en,ei,eo,es,ea,eu,el,ec,ed,ep,ef,eh,eg,ev,em,eb,ey,ew,eS,eE,eC,ek,eT,e_;return"undefined"==typeof document||(u.fetchRemoteConfig&&(u.remoteConfigClient?u.remoteConfigClient.subscribe("analyticsSDK.pageActions","all",function(e){recomputePageActionsData(e)}):u.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),y=createShouldTrackEvent(e,e.cssSelectorAllowlist),w=createShouldTrackEvent(e,e.actionClickAllowlist),z=(B={allObservables:T=createObservables(),options:e,amplitude:b,shouldTrackEvent:y,evaluateTriggers:Z.evaluate.bind(Z)}).amplitude,X=B.allObservables,K=B.options,Y=B.shouldTrackEvent,ee=B.evaluateTriggers,ei=merge((et=X.clickObservable).pipe(operate(function(e,u){var b,y=!1;e.subscribe(createOperatorSubscriber(u,function(e){var w=b;b=e,y&&u.next([w,e]),y=!0}))}),filter(function(e){var u=(0,Q.CR)(e,2),b=u[0],y=u[1],w=b.event.target!==y.event.target,T=20>=Math.abs(y.event.screenX-b.event.screenX)&&20>=Math.abs(y.event.screenY-b.event.screenY);return w&&!T})),et.pipe((er=K.debounceTime,void 0===en&&(en=t3),operate(function(e,u){var b=null,y=null,w=null,emit=function(){if(b){b.unsubscribe(),b=null;var e=y;y=null,u.next(e)}};function emitWhenIdle(){var e=w+er,y=en.now();if(y<e){b=this.schedule(void 0,e-y),u.add(b);return}emit()}e.subscribe(createOperatorSubscriber(u,function(e){y=e,w=en.now(),b||(b=en.schedule(emitWhenIdle,er),u.add(b))},function(){emit(),u.complete()},void 0,function(){y=b=null}))})),map(function(){return"timeout"}))),_=et.pipe((void 0===eo&&(eo=t3),es=timer(0,eo),function delayWhen(e,u){return u?function(b){return function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];return mergeAll(1)(from(e,popScheduler(e)))}(u.pipe(take(1),operate(function(e,u){e.subscribe(createOperatorSubscriber(u,noop))})),b.pipe(delayWhen(e)))}:mergeMap(function(u,b){return innerFrom(e(u,b)).pipe(take(1),map(function(){return u}))})}(function(){return es})),filter(filterOutNonTrackableEvents),filter(function(e){return Y("click",e.closestTrackedAncestor)}),map(function(e){return ee(e)}),operate(function(e,u){var b=[];return e.subscribe(createOperatorSubscriber(u,function(e){return b.push(e)},function(){u.next(b),u.complete()}
25)),innerFrom(ei).subscribe(createOperatorSubscriber(u,function(){var e=b;b=[],u.next(e)},noop)),function(){b=null}})).subscribe(function(e){var u,b,y=(e.length,th);try{for(var w=(0,Q.XA)(e),T=w.next();!T.done;T=w.next()){var _=T.value;null==z||z.track(y,_.targetElementProperties)}}catch(e){u={error:e}}finally{try{T&&!T.done&&(b=w.return)&&b.call(w)}finally{if(u)throw u.error}}}),V.push(_),eu=(ea={allObservables:T,getEventProperties:function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];return H.getEventProperties.apply(H,(0,Q.ev)((0,Q.ev)([],(0,Q.CR)(e),!1),[G],!1))},amplitude:b,shouldTrackEvent:y,evaluateTriggers:Z.evaluate.bind(Z)}).amplitude,el=ea.allObservables,ec=ea.getEventProperties,ed=ea.shouldTrackEvent,ep=ea.evaluateTriggers,P=el.changeObservable.pipe(filter(filterOutNonTrackableEvents),filter(function(e){return ed("change",e.closestTrackedAncestor)}),map(function(e){return ep(e)})).subscribe(function(e){null==eu||eu.track("[Amplitude] Element Changed",ec("change",e.closestTrackedAncestor))}),V.push(P),eh=(ef={allObservables:T,options:e,getEventProperties:function(){for(var e=[],u=0;u<arguments.length;u++)e[u]=arguments[u];return H.getEventProperties.apply(H,(0,Q.ev)((0,Q.ev)([],(0,Q.CR)(e),!1),[G],!1))},amplitude:b,shouldTrackEvent:y,shouldTrackActionClick:w}).amplitude,eg=ef.allObservables,ev=ef.options,em=ef.getEventProperties,eb=ef.shouldTrackEvent,ey=ef.shouldTrackActionClick,ew=eg.clickObservable,eS=eg.mutationObservable,eE=eg.navigateObservable,eC=ew.pipe(filter(function(e){return!eb("click",e.closestTrackedAncestor)}),map(function(e){var u=getClosestElement(e.event.target,ev.actionClickAllowlist);return e.closestTrackedAncestor=u,null!==e.closestTrackedAncestor&&(e.targetElementProperties=em(e.type,e.closestTrackedAncestor)),e}),filter(filterOutNonTrackableEvents),filter(function(e){return ey("click",e.closestTrackedAncestor)})),ek=[eS],eE&&ek.push(eE),eT=merge.apply(void 0,(0,Q.ev)([],(0,Q.CR)(ek),!1)),R=eC.pipe(operate(function(e,u){var b=null,y=0,w=!1,checkComplete=function(){return w&&!b&&u.complete()};e.subscribe(createOperatorSubscriber(u,function(e){null==b||b.unsubscribe();var w=0,T=y++;innerFrom(eT.pipe(take(1),function(e,u){var b=isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,y=b.first,w=b.each,T=b.with,_=void 0===T?timeoutErrorFactory:T,P=b.scheduler,R=void 0===P?null!=u?u:t3:P,D=b.meta,U=void 0===D?null:D;if(null==y&&null==w)throw TypeError("No timeout provided.");return operate(function(e,u){var b,T,P=null,D=0,startTimer=function(e){T=executeSchedule(u,R,function(){try{b.unsubscribe(),innerFrom(_({meta:U,lastValue:P,seen:D})).subscribe(u)}catch(e){u.error(e)}},e)};b=e.subscribe(createOperatorSubscriber(u,function(e){null==T||T.unsubscribe(),D++,u.next(P=e),w>0&&startTimer(w)},void 0,void 0,function(){(null==T?void 0:T.closed)||null==T||T.unsubscribe(),P=null})),D||startTimer(null!=y?"number"==typeof y?y:+y-R.now():w)})}({first:500,with:function(){return t4}}),map(function(){return e}))).subscribe(b=createOperatorSubscriber(u,function(b){return u.next(e_?e_(e,b,T,w++):b)},function(){b=null,checkComplete()}))},function(){w=!0,checkComplete()}))})).subscribe(function(e){null==eh||eh.track(th,em("click",e.closestTrackedAncestor))}),V.push(R),null===(j=null==u?void 0:u.loggerProvider)||void 0===j||j.log("".concat(W," has been successfully added.")),window.opener&&J.enabled&&(D=e.cssSelectorAllowlist,U=e.actionClickAllowlist,null===(F=J.messenger)||void 0===F||F.setup((0,Q.pi)((0,Q.pi)({dataExtractor:H,logger:null==u?void 0:u.loggerProvider},(null==u?void 0:u.serverZone)&&{endpoint:tw[u.serverZone]}),{isElementSelectable:createShouldTrackEvent(e,(0,Q.ev)((0,Q.ev)([],(0,Q.CR)(D),!1),(0,Q.CR)(U),!1)),cssSelectorAllowlist:D,actionClickAllowlist:U})))),[2]})})},execute:function(e){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return[2,e]})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){var e,u,b,y;return(0,Q.Jh)(this,function(w){try{for(u=(e=(0,Q.XA)(V)).next();!u.done;u=e.next())u.value.unsubscribe()}catch(e){b={error:e}}finally{try{u&&!u.done&&(y=e.return)&&y.call(e)}finally{if(b)throw b.error}}return[2]})})}}},t7=(0,Q.ev)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,Q.CR)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),t8=["*"],re=Array.isArray;function addCoordinates(e,u){var b,y,w,T,_=u.event,P=_.clientX,R=_.clientY;e.yMin=Math.min(null!==(b=e.yMin)&&void 0!==b?b:R,R),e.yMax=Math.max(null!==(y=e.yMax)&&void 0!==y?y:R,R),e.xMin=Math.min(null!==(w=e.xMin)&&void 0!==w?w:P,P),e.xMax=Math.max(null!==(T=e.xMax)&&void 0!==T?T:P,P),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function getRageClickAnalyticsEvent(e){var u=e[0],b=e[e.length-1];return{rageClickEvent:(0,Q.pi)({"[Amplitude] Begin Time":new Date(u.timestamp).toISOString(),"[Amplitude] End Time":new Date(b.timestamp).toISOString(),"[Amplitude] Duration":b.timestamp-u.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.clientX,Y:e.event.clientY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},u.targetElementProperties),time:u.timestamp}}var frustrationPlugin=function(e){void 0===e&&(e={});var u,b,y,w,T,_="@amplitude/plugin-frustration-browser",P=[],R=null!==(b=null===(u=e.rageClicks)||void 0===u?void 0:u.cssSelectorAllowlist)&&void 0!==b?b:t8,D=null!==(w=null===(y=e.deadClicks)||void 0===y?void 0:y.cssSelectorAllowlist)&&void 0!==w?w:t7,U=null!==(T=e.dataAttributePrefix)&&void 0!==T?T:tp,j=new DataExtractor(e),F=(0,Q.ev)([],(0,Q.CR)(new Set((0,Q.ev)((0,Q.ev)([],(0,Q.CR)(R),!1),(0,Q.CR)(D),!1))),!1),createObservables=function(){var e,u,b=createClickObservable("pointerdown").pipe(map(function(e){return j.addAdditionalEventProperties(e,"click",F,U,!0)}),share());window.navigation&&(u=fromEvent(window.navigation,"navigate").pipe(map(function(e){return j.addAdditionalEventProperties(e,"navigate",F,U)}),share()));var y=createMutationObservable().pipe(map(function(e){return j.addAdditionalEventProperties(e,"mutation",F,U)}),share());return(e={})[z.ClickObservable]=b,e[z.ChangeObservable]=new tM,e[z.NavigateObservable]=u,e[z.MutationObservable]=y,e};return{name:_,type:"enrichment",setup:function(u,b){return(0,Q.mG)(void 0,void 0,void 0,function(){var y,w,T,F,q,G;return(0,Q.Jh)(this,function(B){var J,W,V,H,z,X,K,Z,Y,ee,et,er,en,ei;return"undefined"==typeof document||(y=createShouldTrackEvent(e,R),w=createShouldTrackEvent(e,D),F=function(e){var u,b=e.amplitude,y=e.allObservables,w=e.shouldTrackRageClick,T=y.clickObservable,_=[],P={};function resetClickWindow(e){_=[],P={},e&&(addCoordinates(P,e),_.push(e))}return T.pipe(filter(filterOutNonTrackableEvents),filter(function(e){return w("click",e.closestTrackedAncestor)}),map(function(e){if(u&&clearTimeout(u),addCoordinates(P,e),0===_.length)return _.push(e),null;if((y=_).length>0&&y[y.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(T=Math.max(0,(w=_).length-4+1),R=w[T],e.timestamp-R.timestamp>=1e3)||P.isOutOfBounds){var y,w,T,R,D=_.length>=4?getRageClickAnalyticsEvent(_):null;return resetClickWindow(e),D}return _.push(e),_.length>=4&&(u=setTimeout(function(){var e=getRageClickAnalyticsEvent(_),u=e.rageClickEvent,y=e.time;b.track(tg,u,{time:y}),resetClickWindow()},1e3)),null}),filter(function(e){return null!==e})).subscribe(function(e){null!==e&&b.track(tg,e.rageClickEvent,{time:e.time})})}({allObservables:T=createObservables(),amplitude:b,shouldTrackRageClick:y}),P.push(F),W=(J={amplitude:b,allObservables:T,getEventProperties:function(e,u){return j.getEventProperties(e,u,U)},shouldTrackDeadClick:w}).amplitude,V=J.allObservables,H=J.getEventProperties,z=J.shouldTrackDeadClick,X=V.clickObservable,K=V.mutationObservable,Z=V.navigateObservable,Y=X.pipe(filter(filterOutNonTrackableEvents),filter(function(e){return z("click",e.closestTrackedAncestor)}),filter(function(e){return null===e.event.target.closest('a[target="_blank"]')})),ee=[K],Z&&ee.push(Z),et=merge.apply(void 0,(0,Q.ev)([],(0,Q.CR)(ee),!1)),q=Y.pipe(mergeMap(function(e){var u;return(function(){for(var e,u,b=[],y=0;y<arguments.length;y++)b[y]=arguments[y];return 1===(b=1===(u=b).length&&re(u[0])?u[0]:u).length?innerFrom(b[0]):new tM((e=b,function(u){for(var b=[],_loop_1=function(y){b.push(innerFrom(e[y]).subscribe(createOperatorSubscriber(u,function(e){if(b){for(var w=0;w<b.length;w++)w!==y&&b[w].unsubscribe();b=null}u.next(e)})))},y=0;b&&!u.closed&&y<e.length;y++)_loop_1(y)}))})(new tM(function(b){return u=setTimeout(function(){return b.next(e)},3e3),function(){clearTimeout(u)}}),et.pipe(take(1),map(function(){return null}))).pipe(filter(function(e){return null!==e}))}),(void 0===er&&(er=t3),en=timer(3e3,er),ei=void 0,operate(function(e,u){var b=null!=ei?ei:{},y=b.leading,w=void 0===y||y,T=b.trailing,_=void 0!==T&&T,P=!1,R=null,D=null,U=!1,endThrottling=function(){null==D||D.unsubscribe(),D=null,_&&(send(),U&&u.complete())},cleanupThrottling=function(){D=null,U&&u.complete()},startThrottle=function(e){return D=innerFrom(en).subscribe(createOperatorSubscriber(u,endThrottling,cleanupThrottling))},send=function(){if(P){P=!1;var e=R;R=null,u.next(e),U||startThrottle(e)}};e.subscribe(createOperatorSubscriber(u,function(e){P=!0,R=e,D&&!D.closed||(w?send():startThrottle(e))},function(){U=!0,_&&P&&D&&!D.closed||u.complete()}
25))}))).subscribe(function(e){var u={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};W.track("[Amplitude] Dead Click",(0,Q.pi)((0,Q.pi)({},H("click",e.closestTrackedAncestor)),u),{time:e.timestamp})}),P.push(q),null===(G=null==u?void 0:u.loggerProvider)||void 0===G||G.log("".concat(_," has been successfully added."))),[2]})})},execute:function(e){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return[2,e]})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){var e,u,b,y;return(0,Q.Jh)(this,function(w){try{for(u=(e=(0,Q.XA)(P)).next();!u.done;u=e.next())u.value.unsubscribe()}catch(e){b={error:e}}finally{try{u&&!u.done&&(y=e.return)&&y.call(e)}finally{if(b)throw b.error}}return[2]})})}}};function pruneJson(e,u,b){e&&function _pruneJson(e){var u,b,y=e.json,w=e.targetObject,T=e.allowlist,_=e.excludelist,P=e.ancestors,R=e.parentObject,D=e.targetKey;w||(w=y);var U=Object.keys(w);try{for(var j=(0,Q.XA)(U),F=j.next();!F.done;F=j.next()){var q,G=F.value,B=(0,Q.ev)((0,Q.ev)([],(0,Q.CR)(P),!1),[G],!1);(q=w[G],"string"==typeof q||"number"==typeof q||"boolean"==typeof q||null==q)?(!hasPathMatchInList(B,T)||hasPathMatchInList(B,_))&&delete w[G]:_pruneJson({json:y,targetObject:w[G],allowlist:T,excludelist:_,ancestors:B,parentObject:w,targetKey:G})}}catch(e){u={error:e}}finally{try{F&&!F.done&&(b=j.return)&&b.call(j)}finally{if(u)throw u.error}}0===Object.keys(w).length&&R&&D&&delete R[D]}({json:e,allowlist:u.map(tokenizeJsonPath),excludelist:b.map(tokenizeJsonPath),ancestors:[]})}function tokenizeJsonPath(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function hasPathMatchInList(e,u){return u.some(function(u){return function isPathMatch(e,u,b,y){if(void 0===b&&(b=0),void 0===y&&(y=0),y===u.length)return b===e.length;if(b===e.length){for(;y<u.length&&"**"===u[y];)y++;return y===u.length}var w=u[y];if("**"===w){if(y+1===u.length)return!0;for(var T=b;T<=e.length;T++)if(isPathMatch(e,u,T,y+1))return!0;return!1}return("*"===w||w===e[b])&&isPathMatch(e,u,b+1,y+1)}(e,u)})}var rt=function(){function RequestWrapperFetch(e){this.request=e}return RequestWrapperFetch.prototype.headers=function(e){void 0===e&&(e=[]);var u,b,y=this.request.headers,w={};if(Array.isArray(y))y.forEach(function(e){var u=(0,Q.CR)(e,2),b=u[0],y=u[1];w[b]=y});else if(y instanceof Headers)y.forEach(function(e,u){w[u]=e});else if("object"==typeof y&&null!==y)try{for(var T=(0,Q.XA)(Object.entries(y)),_=T.next();!_.done;_=T.next()){var P=(0,Q.CR)(_.value,2),R=P[0],D=P[1];w[R]=D}}catch(e){u={error:e}}finally{try{_&&!_.done&&(b=T.return)&&b.call(T)}finally{if(u)throw u.error}}return pruneHeaders(w,{allow:e})},Object.defineProperty(RequestWrapperFetch.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=getGlobalScope();if(null==e?void 0:e.TextEncoder){var u=this.request.body;return this._bodySize=getBodySize(u,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(RequestWrapperFetch.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(RequestWrapperFetch.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),RequestWrapperFetch.prototype.json=function(e,u){return void 0===e&&(e=[]),void 0===u&&(u=[]),(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(b){return 0===e.length?[2,null]:[2,safeParseAndPruneBody(this.body,e,u)]})})},RequestWrapperFetch}(),rr=function(){function RequestWrapperXhr(e,u){this.bodyRaw=e,this.requestHeaders=u}return RequestWrapperXhr.prototype.headers=function(e){return void 0===e&&(e=[]),pruneHeaders(this.requestHeaders,{allow:e})},Object.defineProperty(RequestWrapperXhr.prototype,"bodySize",{get:function(){return getBodySize(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(RequestWrapperXhr.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null}
25,enumerable:!1,configurable:!0}),RequestWrapperXhr.prototype.json=function(e,u){return void 0===e&&(e=[]),void 0===u&&(u=[]),(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(b){return 0===e.length?[2,null]:[2,safeParseAndPruneBody(this.body,e,u)]})})},RequestWrapperXhr}();function getBodySize(e,u){var b,y,w,T,_=getGlobalScope(),P=null==_?void 0:_.TextEncoder;if(P){if("string"==typeof e)T=e,w=new P().encode(T).length;else if(e instanceof Blob)w=(T=e).size;else if(e instanceof URLSearchParams)T=e,w=new P().encode(T.toString()).length;else if(ArrayBuffer.isView(e))w=(T=e).byteLength;else if(e instanceof ArrayBuffer)w=(T=e).byteLength;else if(e instanceof FormData){var R=0,D=0;try{for(var U=(0,Q.XA)(e.entries()),j=U.next();!j.done;j=U.next()){var F=(0,Q.CR)(j.value,2),q=F[0],G=F[1];if(R+=q.length,"string"==typeof G)R+=new P().encode(G).length;else{if(!(G instanceof Blob))return;R+=G.size}if(++D>=u)return}}catch(e){b={error:e}}finally{try{j&&!j.done&&(y=U.return)&&y.call(U)}finally{if(b)throw b.error}}w=R}else if(e instanceof ReadableStream){T=e;return}return w}}var rn=function(){function ResponseWrapperFetch(e){this.response=e}return ResponseWrapperFetch.prototype.headers=function(e){var u;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var b=this.response.headers,y={};return null===(u=null==b?void 0:b.forEach)||void 0===u||u.call(b,function(e,u){y[u]=e}),pruneHeaders(y,{allow:e})}},Object.defineProperty(ResponseWrapperFetch.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,u,b=null===(u=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===u?void 0:u.call(e,"content-length"),y=b?parseInt(b,10):void 0;return this._bodySize=y,y},enumerable:!1,configurable:!0}),Object.defineProperty(ResponseWrapperFetch.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),ResponseWrapperFetch.prototype.text=function(){return(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(e){switch(e.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this.clonedResponse.text(),new Promise(function(e){return setTimeout(function(){return e(null)},500)})])];case 2:return[2,e.sent()];case 3:return e.sent(),[2,null];case 4:return[2]}})})},ResponseWrapperFetch.prototype.json=function(e,u){return void 0===e&&(e=[]),void 0===u&&(u=[]),(0,Q.mG)(this,void 0,void 0,function(){return(0,Q.Jh)(this,function(b){switch(b.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,safeParseAndPruneBody(b.sent(),e,u)]}})})},ResponseWrapperFetch}(),ri=function(){function ResponseWrapperXhr(e,u,b,y){this.statusCode=e,this.headersString=u,this.size=b,this.getJson=y}return Object.defineProperty(ResponseWrapperXhr.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(ResponseWrapperXhr.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),ResponseWrapperXhr.prototype.headers=function(e){if(void 0===e&&(e=[]),!this.headersString)return{};var u,b,y={},w=this.headersString.split("\r\n");try{for(var T=(0,Q.XA)(w),_=T.next();!_.done;_=T.next()){var P=_.value,R=(0,Q.CR)(P.split(": "),2),D=R[0],U=R[1];D&&U&&(y[D]=U)}}catch(e){u={error:e}}finally{try{_&&!_.done&&(b=T.return)&&b.call(T)}finally{if(u)throw u.error}}return pruneHeaders(y,{allow:e})},ResponseWrapperXhr.prototype.json=function(e,u){return void 0===e&&(e=[]),void 0===u&&(u=[]),(0,Q.mG)(this,void 0,void 0,function(){var b;return(0,Q.Jh)(this,function(y){return 0===e.length?[2,null]:(b=this.getJson())?(pruneJson(b,e,u),[2,b]):[2,null]})})},ResponseWrapperXhr}();function safeParseAndPruneBody(e,u,b){if(!e)return null;try{var y=JSON.parse(e);return pruneJson(y,u,b),y}catch(e){return null}}(j=X||(X={})).REDACT="redact",j.REMOVE="remove";var ro="[REDACTED]",pruneHeaders=function(e,u){var b,y,w=u.allow,T=void 0===w?[]:w,_=u.strategy,P=void 0===_?X.REMOVE:_,R=(0,Q.ev)([],(0,Q.CR)(eA),!1),D={};try{for(var U=(0,Q.XA)(Object.keys(e)),j=U.next();!j.done;j=U.next()){var F=j.value;!function(u){var b=u.toLowerCase();R.find(function(e){return e.toLowerCase()===b})?P===X.REDACT&&(D[u]=ro):T.find(function(e){return e.toLowerCase()===b})?D[u]=e[u]:P===X.REDACT&&(D[u]=ro)}(F)}}catch(e){b={error:e}}finally{try{j&&!j.done&&(y=U.return)&&y.call(U)}finally{if(b)throw b.error}}return D},rs=function(){function NetworkRequestEvent(e,u,b,y,w,T,_,P,R,D,U){void 0===_&&(_=0),this.type=e,this.method=u,this.timestamp=b,this.startTime=y,this.url=w,this.requestWrapper=T,this.status=_,this.duration=P,this.responseWrapper=R,this.error=D,this.endTime=U}
25return NetworkRequestEvent.prototype.toSerializable=function(){var e,u,b,y;return Object.fromEntries(Object.entries({type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers((0,Q.ev)([],(0,Q.CR)(eI),!1)),requestBodySize:null===(u=this.requestWrapper)||void 0===u?void 0:u.bodySize,responseHeaders:null===(b=this.responseWrapper)||void 0===b?void 0:b.headers((0,Q.ev)([],(0,Q.CR)(eI),!1)),responseBodySize:null===(y=this.responseWrapper)||void 0===y?void 0:y.bodySize}).filter(function(e){var u=(0,Q.CR)(e,2);return void 0!==(u[0],u[1])}))},NetworkRequestEvent}(),NetworkEventCallback=function(e,u){void 0===u&&(u=UUID()),this.callback=e,this.id=u},ra=new(function(){function NetworkObserver(e){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=e;var u=getGlobalScope();NetworkObserver.isSupported()&&(this.globalScope=u)}return NetworkObserver.isSupported=function(){var e=getGlobalScope();return!!e&&!!e.fetch},NetworkObserver.prototype.subscribe=function(e,u){var b,y,w,T,_,P,R,D,U,j;if(this.logger||(this.logger=u),this.eventCallbacks.set(e.id,e),!this.isObserving){var F=null===(w=null===(y=null===(b=this.globalScope)||void 0===b?void 0:b.XMLHttpRequest)||void 0===y?void 0:y.prototype)||void 0===w?void 0:w.open,q=null===(P=null===(_=null===(T=this.globalScope)||void 0===T?void 0:T.XMLHttpRequest)||void 0===_?void 0:_.prototype)||void 0===P?void 0:P.send,G=null===(U=null===(D=null===(R=this.globalScope)||void 0===R?void 0:R.XMLHttpRequest)||void 0===D?void 0:D.prototype)||void 0===U?void 0:U.setRequestHeader;F&&q&&G&&this.observeXhr(F,q,G);var B=null===(j=this.globalScope)||void 0===j?void 0:j.fetch;B&&this.observeFetch(B),this.isObserving=!0}},NetworkObserver.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},NetworkObserver.prototype.triggerEventCallbacks=function(e){var u=this;this.eventCallbacks.forEach(function(b){var y;try{b.callback(e)}catch(e){null===(y=u.logger)||void 0===y||y.debug("an unexpected error occurred while triggering event callbacks",e)}})},NetworkObserver.prototype.handleNetworkRequestEvent=function(e,u,b,y,w,T,_){if(void 0!==T&&void 0!==_){var P,R,D,U,j="GET";if("object"==typeof u&&null!==u&&"url"in u&&"method"in u?(R=u.url,j=u.method):R=null===(P=null==u?void 0:u.toString)||void 0===P?void 0:P.call(u),R)try{var F=new URL(R);R="".concat(F.protocol,"//").concat(F.host).concat(F.pathname).concat(F.search).concat(F.hash)}catch(e){}j=(null==b?void 0:b.method)||j,y&&(D=y.status),w&&(U={name:w.name||"UnknownError",message:w.message||"An unknown error occurred"},D=0);var q=Math.floor(performance.now()-_),G=Math.floor(T+q),B=new rs(e,j,T,T,R,b,D,q,y,U,G);this.triggerEventCallbacks(B)}},NetworkObserver.prototype.getTimestamps=function(){var e,u;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(u=null==performance?void 0:performance.now)||void 0===u?void 0:u.call(performance)}},NetworkObserver.prototype.observeFetch=function(e){var u=this;this.globalScope&&e&&(this.globalScope.fetch=function(b,y){return(0,Q.mG)(u,void 0,void 0,function(){var u,w,T,_,P;return(0,Q.Jh)(this,function(R){switch(R.label){case 0:try{u=this.getTimestamps()}catch(e){null===(_=this.logger)||void 0===_||_.debug("an unexpected error occurred while retrieving timestamps",e)}R.label=1;case 1:return R.trys.push([1,3,,4]),[4,e(b,y)];case 2:return w=R.sent(),[3,4];case 3:return T=R.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",b,y?new rt(y):void 0,w?new rn(w):void 0,T,null==u?void 0:u.startTime,null==u?void 0:u.durationStart)}catch(e){null===(P=this.logger)||void 0===P||P.debug("an unexpected error occurred while handling fetch",e)}if(w)return[2,w];throw T}})})})},NetworkObserver.createXhrJsonParser=function(e,u){return function(){var b,y;try{if("json"===e.responseType){if(null===(b=u.globalScope)||void 0===b?void 0:b.structuredClone)return u.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(b){b instanceof Error&&"InvalidStateError"===b.name&&(null===(y=u.logger)||void 0===y||y.error("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'")))}return null}},NetworkObserver.prototype.observeXhr=function(e,u,b){if(this.globalScope&&e&&u){var y=this.globalScope.XMLHttpRequest.prototype,w=this;y.open=function(){for(var u,b,y=[],T=0;T<arguments.length;T++)y[T]=arguments[T];var _=(0,Q.CR)(y,2),P=_[0],R=_[1];try{this.$$AmplitudeAnalyticsEvent=(0,Q.pi)({method:P,url:null===(u=null==R?void 0:R.toString)||void 0===u?void 0:u.call(R),headers:{}},w.getTimestamps())}catch(e){null===(b=w.logger)||void 0===b||b.error("an unexpected error occurred while calling xhr open",e)}return e.apply(this,y)},y.send=function(){for(var e=[],b=0;b<arguments.length;b++)e[b]=arguments[b];var y=this,T=NetworkObserver.createXhrJsonParser(this,w),_=e[0],P=y.$$AmplitudeAnalyticsEvent;return y.addEventListener("loadend",function(){var e;try{var u=y.getAllResponseHeaders(),b=y.getResponseHeader("content-length"),R=new ri(y.status,u,b?parseInt(b,10):void 0,T),D=y.$$AmplitudeAnalyticsEvent.headers,U=new rr(_,D);P.status=y.status,w.handleNetworkRequestEvent("xhr",{url:P.url,method:P.method},U,R,void 0,P.startTime,P.durationStart)}catch(u){null===(e=w.logger)||void 0===e||e.error("an unexpected error occurred while handling xhr send",u)}}),u.apply(y,e)},y.setRequestHeader=function(e,u){var y;try{this.$$AmplitudeAnalyticsEvent.headers[e]=u}catch(e){null===(y=w.logger)||void 0===y||y.error("an unexpected error occurred while calling xhr setRequestHeader",e)}b.apply(this,[e,u])}}},NetworkObserver}()),ru="[Amplitude] Network Request",rl="500-599";function wildcardMatch(e,u){var b="^"+u.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(b).test(e)}function isStatusCodeInRange(e,u){var b,y,w=u.split(",");try{for(var T=(0,Q.XA)(w),_=T.next();!_.done;_=T.next()){var P=_.value,R=(0,Q.CR)(P.split("-").map(Number),2),D=R[0],U=R[1];if(e===D&&void 0===U||e>=D&&e<=U)return!0}}catch(e){b={error:e}}finally{try{_&&!_.done&&(y=T.return)&&y.call(T)}finally{if(b)throw b.error}}return!1}function parseUrl(e){var u;if(e)try{var b=null===(u=getGlobalScope())||void 0===u?void 0:u.location.href,y=new URL(e,b),w=y.searchParams.toString(),T=y.hash.replace("#",""),_=y.href,P=y.host;y.hash="",y.search="";var R=y.href;
25return{query:w,fragment:T,href:_,hrefWithoutQueryOrHash:R,host:P}}catch(e){return}}function parseHeaderCaptureRule(e){return"object"!=typeof e||null===e?e?(0,Q.ev)([],(0,Q.CR)(eI),!1):void 0:0!==e.length?e:void 0}function isBodyCaptureRuleEmpty(e){var u,b;return!(null===(u=null==e?void 0:e.allowlist)||void 0===u?void 0:u.length)&&!(null===(b=null==e?void 0:e.blocklist)||void 0===b?void 0:b.length)}(K||(K={})).NetworkObservable="networkObservable";var networkCapturePlugin=function(e){void 0===e&&(e={});var u,b="@amplitude/plugin-network-capture-browser",y=[],createObservables=function(){var e,b=new tM(function(e){var b=new NetworkEventCallback(function(u){var b={event:u,timestamp:Date.now(),type:"network"};e.next(b)});return ra.subscribe(b,u),function(){ra.unsubscribe(b)}});return(e={})[K.NetworkObservable]=b,e};return{name:b,type:"enrichment",setup:function(w,T){return(0,Q.mG)(void 0,void 0,void 0,function(){var _,P;return(0,Q.Jh)(this,function(R){var D,U,j,F,q;return"undefined"==typeof document||(_=createObservables(),u=null==w?void 0:w.loggerProvider,U=(D={allObservables:_,networkTrackingOptions:e,amplitude:T,loggerProvider:u}).allObservables,j=D.networkTrackingOptions,F=D.amplitude,q=D.loggerProvider,P=U.networkObservable.pipe(filter(function(e){return function(e,u){void 0===u&&(u={});var b,y,w=parseUrl(e.url);if(!w)return!1;var T=w.host;return!(!1!==u.ignoreAmplitudeRequests&&(wildcardMatch(T,"*.amplitude.com")||wildcardMatch(T,"amplitude.com"))||(null===(b=u.ignoreHosts)||void 0===b?void 0:b.find(function(e){return wildcardMatch(T,e)}))||!u.captureRules&&void 0!==e.status&&!isStatusCodeInRange(e.status,rl)||u.captureRules&&((0,Q.ev)([],(0,Q.CR)(u.captureRules),!1).reverse().find(function(u){var b,w,_;if(b=e.status,w=e.url,_=e.method,y=u.hosts&&!u.hosts.find(function(e){return wildcardMatch(T,e)})||w&&u.urls&&!isUrlMatchAllowlist(w,u.urls)||_&&u.methods&&!u.methods.find(function(e){return _.toLowerCase()===e.toLowerCase()||"*"===e})?void 0:!b&&0!==b||!!isStatusCodeInRange(b,u.statusCodeRange||rl)){var P=parseHeaderCaptureRule(u.responseHeaders);if(e.responseWrapper&&P){var R=e.responseWrapper.headers(P);R&&(e.responseHeaders=R)}var D=parseHeaderCaptureRule(u.requestHeaders);if(e.requestWrapper&&D){var U=e.requestWrapper.headers(D);U&&(e.requestHeaders=U)}e.responseWrapper&&u.responseBody&&!isBodyCaptureRuleEmpty(u.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(u.responseBody.allowlist,u.responseBody.blocklist)),e.requestWrapper&&u.requestBody&&!isBodyCaptureRuleEmpty(u.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(u.requestBody.allowlist,u.requestBody.blocklist))}return void 0!==y}),!y)||e.requestWrapper&&function(e,u){if(e.includes("amplitude.com"))try{var b=u.body;if("string"!=typeof b)return!1;if(JSON.parse(b).events.find(function(e){return e.event_type===ru}))return!0}catch(e){}return!1}(T,e.requestWrapper))}(e.event,j)})).subscribe(function(e){var u,b,y,w=e.event,T=parseUrl(w.url);if(T){var _=null===(b=w.responseWrapper)||void 0===b?void 0:b.bodySize,P=null===(y=w.requestWrapper)||void 0===y?void 0:y.bodySize;(function(e,u,b,y){(0,Q.mG)(this,void 0,void 0,function(){var w,T,_;return(0,Q.Jh)(this,function(P){switch(P.label){case 0:if(!(u.requestBodyJson||u.responseBodyJson))return[3,2];return[4,Promise.all([u.requestBodyJson,u.responseBodyJson])];case 1:if(T=(w=Q.CR.apply(void 0,[P.sent(),2]))[0],_=w[1],T)try{e["[Amplitude] Request Body"]=JSON.stringify(T)}catch(e){null==y||y.debug("Failed to stringify request body",e)}if(_)try{e["[Amplitude] Response Body"]=JSON.stringify(_)}catch(e){null==y||y.debug("Failed to stringify response body")}P.label=2;case 2:return null==b||b.track(ru,e),[2]}})})})(((u={})["[Amplitude] URL"]=T.hrefWithoutQueryOrHash,u["[Amplitude] URL Query"]=T.query,u["[Amplitude] URL Fragment"]=T.fragment,u["[Amplitude] Request Method"]=w.method,u["[Amplitude] Status Code"]=w.status,u["[Amplitude] Start Time"]=w.startTime,u["[Amplitude] Completion Time"]=w.endTime,u["[Amplitude] Duration"]=w.duration,u["[Amplitude] Request Body Size"]=P,u["[Amplitude] Response Body Size"]=_,u["[Amplitude] Request Type"]=w.type,u["[Amplitude] Request Headers"]=w.requestHeaders,u["[Amplitude] Response Headers"]=w.responseHeaders,u),w,F,q)}}),y.push(P),null==u||u.log("".concat(b," has been successfully added."))),[2]})})},execute:function(e){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return[2,e]})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){var e,u,b,w;return(0,Q.Jh)(this,function(T){try{for(u=(e=(0,Q.XA)(y)).next();!u.done;u=e.next())u.value.unsubscribe()}catch(e){b={error:e}}finally{try{u&&!u.done&&(w=e.return)&&w.call(e)}finally{if(b)throw b.error}}return[2]})})}}};let rc=-1,t=e=>{addEventListener("pageshow",u=>{u.persisted&&(rc=u.timeStamp,e(u))},!0)},n=(e,u,b,y)=>{let w,T;return _=>{var P;u.value>=0&&(_||y)&&((T=u.value-(w??0))||void 0===w)&&(w=u.value,u.delta=T,u.rating=(P=u.value)>b[1]?"poor":P>b[0]?"needs-improvement":"good",e(u))}},i=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},o=()=>{let e=s();return e?.activationStart??0},r=(e,u=-1)=>{let b=s(),y="navigate";return rc>=0?y="back-forward-cache":b&&(document.prerendering||o()>0?y="prerender":document.wasDiscarded?y="restore":b.type&&(y=b.type.replace(/_/g,"-"))),{name:e,value:u,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:y}},rd=new WeakMap;function a(e,u){return rd.get(e)||rd.set(e,new u),rd.get(e)}let d=class d{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let u=this.o[0],b=this.o.at(-1);this.i&&u&&b&&e.startTime-b.startTime<1e3&&e.startTime-u.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}};let h=(e,u,b={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let y=new PerformanceObserver(e=>{Promise.resolve().then(()=>{u(e.getEntries())})});return y.observe({type:e,buffered:!0,...b}),y}}catch{}},f=e=>{let u=!1;return()=>{u||(e(),u=!0)}},rp=-1,rf=new Set,m=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,p=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of rf)e();isFinite(rp)||(rp="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",p,!0))}},v=()=>{if(rp<0){let e=o(),u=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(u=>"hidden"===u.name&&u.startTime>e)[0]?.startTime;rp=u??m(),addEventListener("visibilitychange",p,!0),addEventListener("prerenderingchange",p,!0),t(()=>{setTimeout(()=>{rp=m()})})}return{get firstHiddenTime(){return rp},onHidden(e){rf.add(e)}}},g=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},rh=[1800,3e3],E=(e,u={})=>{g(()=>{let b=v(),y,w=r("FCP"),T=h("paint",e=>{for(let u of e)"first-contentful-paint"===u.name&&(T.disconnect(),u.startTime<b.firstHiddenTime&&(w.value=Math.max(u.startTime-o(),0),w.entries.push(u),y(!0)))});T&&(y=n(e,w,rh,u.reportAllChanges),t(b=>{y=n(e,w=r("FCP"),rh,u.reportAllChanges),i(()=>{w.value=performance.now()-b.timeStamp,y(!0)})}))})},rg=[.1,.25],L=(e,u={})=>{let b=v();E(f(()=>{let y,w=r("CLS",0),T=a(u,d),l=e=>{for(let u of e)T.h(u);T.i>w.value&&(w.value=T.i,w.entries=T.o,y())},_=h("layout-shift",l);_&&(y=n(e,w,rg,u.reportAllChanges),b.onHidden(()=>{l(_.takeRecords()),y(!0)}),t(()=>{T.i=0,y=n(e,w=r("CLS",0),rg,u.reportAllChanges),i(()=>y())}),setTimeout(y))}))},rv=0,rm=1/0,rb=0,M=e=>{for(let u of e)u.interactionId&&(rm=Math.min(rm,u.interactionId),rv=(rb=Math.max(rb,u.interactionId))?(rb-rm)/7+1:0)},C=()=>y?rv:performance.interactionCount??0,I=()=>{"interactionCount"in performance||y||(y=h("event",M,{type:"event",buffered:!0,durationThreshold:0}))},ry=0;let k=class k{u=[];l=new Map;m;p;v(){ry=C(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((C()-ry)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let u=this.u.at(-1),b=this.l.get(e.interactionId);if(b||this.u.length<10||e.duration>u.P){if(b?e.duration>b.P?(b.entries=[e],b.P=e.duration):e.duration===b.P&&e.startTime===b.entries[0].startTime&&b.entries.push(e):(b={
25id:e.interactionId,entries:[e],P:e.duration},this.l.set(b.id,b),this.u.push(b)),this.u.sort((e,u)=>u.P-e.P),this.u.length>10){let e=this.u.splice(10);for(let u of e)this.l.delete(u.id)}this.p?.(b)}}};let A=e=>{let u=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=f(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),u(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},rw=[200,500],S=(e,u={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let b=v();g(()=>{I();let y,w=r("INP"),T=a(u,k),f=e=>{A(()=>{for(let u of e)T.h(u);let u=T.L();u&&u.P!==w.value&&(w.value=u.P,w.entries=u.entries,y())})},_=h("event",f,{durationThreshold:u.durationThreshold??40});y=n(e,w,rw,u.reportAllChanges),_&&(_.observe({type:"first-input",buffered:!0}),b.onHidden(()=>{f(_.takeRecords()),y(!0)}),t(()=>{T.v(),y=n(e,w=r("INP"),rw,u.reportAllChanges)}))})};let N=class N{m;h(e){this.m?.(e)}};let rS=[2500,4e3],x=(e,u={})=>{g(()=>{let b=v(),y,w=r("LCP"),T=a(u,N),m=e=>{for(let _ of(u.reportAllChanges||(e=e.slice(-1)),e))T.h(_),_.startTime<b.firstHiddenTime&&(w.value=Math.max(_.startTime-o(),0),w.entries=[_],y())},_=h("largest-contentful-paint",m);if(_){y=n(e,w,rS,u.reportAllChanges);let b=f(()=>{m(_.takeRecords()),_.disconnect(),y(!0)}),c=e=>{e.isTrusted&&(A(b),removeEventListener(e.type,c,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,c,{capture:!0});t(b=>{y=n(e,w=r("LCP"),rS,u.reportAllChanges),i(()=>{w.value=performance.now()-b.timeStamp,y(!0)})})}})},rE=[800,1800],O=e=>{document.prerendering?g(()=>O(e)):"complete"!==document.readyState?addEventListener("load",()=>O(e),!0):setTimeout(e)},$=(e,u={})=>{let b=r("TTFB"),y=n(e,b,rE,u.reportAllChanges);O(()=>{let w=s();w&&(b.value=Math.max(w.responseStart-o(),0),b.entries=[w],y(!0),t(()=>{(y=n(e,b=r("TTFB",0),rE,u.reportAllChanges))(!0)}))})};function processMetric(e){var u,b;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((b=(null===(u=e.entries[0])||void 0===u?void 0:u.startTime)||0,performance.timeOrigin+b)),navigationStart:Math.floor(performance.timeOrigin)}}var webVitalsPlugin=function(){var e=null,u=getGlobalScope(),b=null==u?void 0:u.document,y=null==u?void 0:u.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(u,w){return(0,Q.mG)(void 0,void 0,void 0,function(){var T,_,P;return(0,Q.Jh)(this,function(R){return T=function(e){if(!e)return"";var b,y=e;try{y=decodeURI(e)}catch(e){null===(b=u.loggerProvider)||void 0===b||b.error("Malformed URI sequence: ",e)}return y},void 0===b||(_=T(null==y?void 0:y.href),P={"[Amplitude] Page Domain":(null==y?void 0:y.hostname)||"","[Amplitude] Page Location":_,"[Amplitude] Page Path":T(null==y?void 0:y.pathname),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":_.split("?")[0]},x(function(e){P["[Amplitude] LCP"]=processMetric(e)}),E(function(e){P["[Amplitude] FCP"]=processMetric(e)}),S(function(e){P["[Amplitude] INP"]=processMetric(e)}),L(function(e){P["[Amplitude] CLS"]=processMetric(e)}),$(function(e){P["[Amplitude] TTFB"]=processMetric(e)}),e=function(){"hidden"===b.visibilityState&&e&&(w.track("[Amplitude] Web Vitals",P),b.removeEventListener("visibilitychange",e),e=null)},b.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return[2,e]})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(u){return e&&(null==b||b.removeEventListener("visibilitychange",e)),[2]})})}}},getStorageKey=function(e,u,b){return void 0===u&&(u=""),void 0===b&&(b=10),["AMP",u,e.substring(0,b)].filter(Boolean).join("_")},domainWithoutSubdomain=function(e){var u=e.split(".");return u.length<=2?e:u.slice(u.length-2,u.length).join(".")},isNewCampaign=function(e,u,b,y,w){void 0===w&&(w=!0),e.referrer;var T=e.referring_domain,_=(0,Q._T)(e,["referrer","referring_domain"]),P=u||{},R=(P.referrer,P.referring_domain),D=(0,Q._T)(P,["referrer","referring_domain"]);if(isExcludedReferrer(b.excludeReferrers,e.referring_domain))return y.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!w&&Object.values(e).every(function(e){return!e})&&u)return y.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var U=JSON.stringify(_)!==JSON.stringify(D),j=domainWithoutSubdomain(T||"")!==domainWithoutSubdomain(R||""),F=!u||U||j;return F?y.debug("This is a new campaign. An $identify event will be sent."):y.debug("This is not a new campaign because it's the same as the previous one."),F},isExcludedReferrer=function(e,u){return void 0===e&&(e=[]),void 0===u&&(u=""),e.some(function(e){return e instanceof RegExp?e.test(u):e===u})},getDefaultExcludedReferrers=function(e){var u=e;return u?(u.startsWith(".")&&(u=u.substring(1)),[new RegExp("".concat(u.replace(".","\\."),"$"))]):[]},rC=function(){function WebAttribution(e,u){var b;this.shouldTrackNewCampaign=!1,this.options=(0,Q.pi)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:getDefaultExcludedReferrers(null===(b=u.cookieOptions)||void 0===b?void 0:b.domain)},e),this.storage=u.cookieStorage,this.storageKey=getStorageKey(u.apiKey,"MKTG"),this.webExpStorageKey=getStorageKey(u.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=e_,this.sessionTimeout=u.sessionTimeout,this.lastEventTime=u.lastEventTime,this.logger=u.loggerProvider,u.loggerProvider.log("Installing web attribution tracking.")}return WebAttribution.prototype.init=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e,u;return(0,Q.Jh)(this,function(b){switch(b.label){case 0:return[4,this.fetchCampaign()];case 1:if(u=Q.CR.apply(void 0,[b.sent(),2]),this.currentCampaign=u[0],this.previousCampaign=u[1],e=!this.lastEventTime||isNewSession(this.sessionTimeout,this.lastEventTime),!isNewCampaign(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:b.sent(),b.label=3;case 3:return[2]}})})},WebAttribution.prototype.fetchCampaign=function(){return(0,Q.mG)(this,void 0,void 0,function(){var e;return(0,Q.Jh)(this,function(u){switch(u.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:if(!(e=u.sent()))return[3,3];return[4,this.storage.remove(this.webExpStorageKey)];case 2:u.sent(),u.label=3;case 3:return[4,Promise.all([e||new tl().parse(),this.storage.get(this.storageKey)])];case 4:return[2,u.sent()]}})})},WebAttribution.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var u,b,y=(u=this.currentCampaign,b=this.options,createIdentifyEvent(Object.entries((0,Q.pi)((0,Q.pi)({},e_),u)).reduce(function(e,u){var y,w=(0,Q.CR)(u,2),T=w[0],_=w[1];return(e.setOnce("initial_".concat(T),null!==(y=null!=_?_:b.initialEmptyValue)&&void 0!==y?y:"EMPTY"),_)?e.set(T,_):e.unset(T)},new eN)));return e&&(y.event_id=e),y},WebAttribution.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},WebAttribution}(),rk="AMP_CURRENT_PAGE",rT="AMP_PREVIOUS_PAGE",r_="AMP_URL_INFO";(F=Z||(Z={})).Direct="direct",F.Internal="internal",F.External="external";var rI=new Set([H.IDENTIFY,H.GROUP_IDENTIFY,H.REVENUE]),pageUrlEnrichmentPlugin=function(){var e=getGlobalScope(),u=void 0,b=!1,y=void 0,w=!1,T=!1,getHostname=function(e){var u;
25try{var b=getDecodeURI(e,y);u=new URL(b).hostname}catch(e){null==y||y.error("Could not parse URL: ",e)}return u},getPrevPageType=function(e){var u="undefined"!=typeof location&&location.hostname||"";switch(e?getHostname(e):void 0){case void 0:return Z.Direct;case u:return Z.Internal;default:return Z.External}},saveUrlInfoWrapper=function(){(0,Q.mG)(void 0,void 0,void 0,function(){var e,y,w,T,_;return(0,Q.Jh)(this,function(P){switch(P.label){case 0:if(!(u&&b))return[3,3];return[4,u.get(r_)];case 1:return e=P.sent(),y=getDecodeURI("undefined"!=typeof location&&location.href||""),w=(null==e?void 0:e[rk])||"",T=void 0,T=y===w?(null==e?void 0:e[rT])||"":w||document.referrer||"",[4,u.set(r_,((_={})[rk]=y,_[rT]=T,_))];case 2:P.sent(),P.label=3;case 3:return[2]}})})};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(_,P){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(P){switch(P.label){case 0:if((y=_.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),T=!0,!e)return[3,2];return[4,(u=new ez(e.sessionStorage)).isEnabled()];case 1:b=P.sent(),e.addEventListener("popstate",saveUrlInfoWrapper),w||(e.history.pushState=new Proxy(e.history.pushState,{apply:function(e,u,b){var y=(0,Q.CR)(b,3),w=y[0],_=y[1],P=y[2];e.apply(u,[w,_,P]),T&&saveUrlInfoWrapper()}}),e.history.replaceState=new Proxy(e.history.replaceState,{apply:function(e,u,b){var y=(0,Q.CR)(b,3),w=y[0],_=y[1],P=y[2];e.apply(u,[w,_,P]),T&&saveUrlInfoWrapper()}}),w=!0),P.label=2;case 2:return[2]}})})},execute:function(e){return(0,Q.mG)(void 0,void 0,void 0,function(){var y,w,T,_,P;return(0,Q.Jh)(this,function(R){switch(R.label){case 0:if(y=getDecodeURI("undefined"!=typeof location&&location.href||""),!(u&&b))return[3,5];return[4,u.get(r_)];case 1:if(null==(w=R.sent())?void 0:w[rk])return[3,3];return[4,u.set(r_,((P={})[rk]=y,P[rT]=document.referrer||"",P))];case 2:R.sent(),R.label=3;case 3:return[4,u.get(r_)];case 4:if(T=R.sent(),_="",T&&(_=T[rT]||""),rI.has(e.event_type))return[2,e];e.event_properties=(0,Q.pi)((0,Q.pi)({},e.event_properties||{}),{"[Amplitude] Page Domain":addIfNotExist(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":addIfNotExist(e,"[Amplitude] Page Location",y),"[Amplitude] Page Path":addIfNotExist(e,"[Amplitude] Page Path","undefined"!=typeof location&&getDecodeURI(location.pathname)||""),"[Amplitude] Page Title":addIfNotExist(e,"[Amplitude] Page Title",getPageTitle(replaceSensitiveString)),"[Amplitude] Page URL":addIfNotExist(e,"[Amplitude] Page URL",y.split("?")[0]),"[Amplitude] Previous Page Location":_,"[Amplitude] Previous Page Type":getPrevPageType(_)}),R.label=5;case 5:return[2,e]}})})},teardown:function(){return(0,Q.mG)(void 0,void 0,void 0,function(){return(0,Q.Jh)(this,function(y){switch(y.label){case 0:if(e&&(e.removeEventListener("popstate",saveUrlInfoWrapper),T=!1),!(u&&b))return[3,2];return[4,u.set(r_,{})];case 1:y.sent(),y.label=2;case 2:return[2]}})})}}};function addIfNotExist(e,u,b){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[u])?b:e.event_properties[u]}var rA={init:debugWrapper((q=new(function(e){function AmplitudeBrowser(){var u=null!==e&&e.apply(this,arguments)||this;return u._diagnosticsSampleRate=0,u}return(0,Q.ZT)(AmplitudeBrowser,e),AmplitudeBrowser.prototype.init=function(e,u,b){var y,w;return void 0===e&&(e=""),arguments.length>2?(y=u,w=b):"string"==typeof u?(y=u,w=void 0):(y=null==u?void 0:u.userId,w=u),returnWrapper(this._init((0,Q.pi)((0,Q.pi)({},w),{userId:y,apiKey:e})))},AmplitudeBrowser.prototype._init=function(u){var b,y,w,T,_;return(0,Q.mG)(this,void 0,void 0,function(){var P,R,D,U,j,F,q,G,B,J=this;return(0,Q.Jh)(this,function(W){var V,H,z,X,K;switch(W.label){case 0:if(this.initializing)return[2];return this.initializing=!0,[4,(V=u.apiKey,H=u,z=this,void 0===H&&(H={}),(0,Q.mG)(void 0,void 0,void 0,function(){var e,u,b,y,w,T,_,P,R,D,U,j,F,q,G,B,J,W,X,K,Z,Y,ee,et,er,en,ei,eo,es,ea,eu,el,ec,ed,ep,ef,eh,eg,ev,em,eb,ey,ew,eS,eE;return(0,Q.Jh)(this,function(eC){var ek,eT,e_;switch(eC.label){case 0:if(e=H.identityStorage||tr,Z={},!(e!==tr))return[3,1];return b="",[3,5];case 1:if(!(null!==(ee=null===(Y=H.cookieOptions)||void 0===Y?void 0:Y.domain)&&void 0!==ee))return[3,2];return y=ee,[3,4];case 2:return[4,(0,Q.mG)(void 0,void 0,void 0,function(){var e,u,b,y,w,T,_;return(0,Q.Jh)(this,function(P){switch(P.label){case 0:return[4,new eW().isEnabled()];case 1:if(!P.sent()||!ek&&("undefined"==typeof location||!location.hostname))return[2,""];for(e=(null!=ek?ek:location.hostname).split("."),u=[],b="AMP_TLDTEST",y=e.length-2;y>=0;--y)u.push(e.slice(y).join("."));y=0,P.label=2;case 2:if(!(y<u.length))return[3,7];return T={domain:"."+(w=u[y])},[4,(_=new eW(T)).set(b,1)];case 3:return P.sent(),[4,_.get(b)];case 4:if(!P.sent())return[3,6];return[4,_.remove(b)];case 5:return P.sent(),[2,"."+w];case 6:return y++,[3,2];case 7:return[2,""]}})})];case 3:y=eC.sent(),eC.label=4;case 4:b=y,eC.label=5;case 5:return u=Q.pi.apply(void 0,[(Z.domain=b,Z.expiration=365,Z.sameSite="Lax",Z.secure=!1,Z.upgrade=!0,Z),H.cookieOptions]),[4,(eT=w=createCookieStorage(H.identityStorage,u),void 0===(e_=null===(er=null===(et=H.cookieOptions)||void 0===et?void 0:et.upgrade)||void 0===er||er)&&(e_=!0),(0,Q.mG)(void 0,void 0,void 0,function(){var e,u,b,y,w,T,_,P,R;return(0,Q.Jh)(this,function(D){switch(D.label){case 0:return e="".concat("amp","_").concat(V.substring(0,6)),[4,eT.getRaw(e)];case 1:if(!(u=D.sent()))return[2,{optOut:!1}];if(!e_)return[3,3];
25return[4,eT.remove(e)];case 2:D.sent(),D.label=3;case 3:return y=(b=(0,Q.CR)(u.split("."),6))[0],w=b[1],T=b[2],_=b[3],P=b[4],R=b[5],[2,{deviceId:y,userId:decode(w),sessionId:parseTime(_),lastEventId:parseTime(R),lastEventTime:parseTime(P),optOut:!!T}]}})}))];case 6:return T=eC.sent(),[4,w.get(getCookieName(V))];case 7:return _=eC.sent(),D=!(R=(P=getQueryParams()).ampTimestamp?Number(P.ampTimestamp):void 0)||Date.now()<R,U=null!==(ea=null!==(es=null!==(eo=null!==(en=H.deviceId)&&void 0!==en?en:D?null!==(ei=P.ampDeviceId)&&void 0!==ei?ei:P.deviceId:void 0)&&void 0!==eo?eo:null==_?void 0:_.deviceId)&&void 0!==es?es:T.deviceId)&&void 0!==ea?ea:UUID(),j=null!==(eu=null==_?void 0:_.lastEventId)&&void 0!==eu?eu:T.lastEventId,F=null!==(el=null==_?void 0:_.lastEventTime)&&void 0!==el?el:T.lastEventTime,q=null!==(ed=null!==(ec=H.optOut)&&void 0!==ec?ec:null==_?void 0:_.optOut)&&void 0!==ed?ed:T.optOut,G=null!==(ep=null==_?void 0:_.sessionId)&&void 0!==ep?ep:T.sessionId,B=null!==(eh=null!==(ef=H.userId)&&void 0!==ef?ef:null==_?void 0:_.userId)&&void 0!==eh?eh:T.userId,z.previousSessionDeviceId=null!==(eg=null==_?void 0:_.deviceId)&&void 0!==eg?eg:T.deviceId,z.previousSessionUserId=null!==(ev=null==_?void 0:_.userId)&&void 0!==ev?ev:T.userId,J={ipAddress:null===(eb=null===(em=H.trackingOptions)||void 0===em?void 0:em.ipAddress)||void 0===eb||eb,language:null===(ew=null===(ey=H.trackingOptions)||void 0===ey?void 0:ey.language)||void 0===ew||ew,platform:null===(eE=null===(eS=H.trackingOptions)||void 0===eS?void 0:eS.platform)||void 0===eE||eE},W=null==_?void 0:_.pageCounter,X=null==_?void 0:_.debugLogsEnabled,void 0!==H.autocapture&&(H.defaultTracking=H.autocapture),[4,(K=new tn(V,H.appVersion,w,u,H.defaultTracking,H.autocapture,U,H.flushIntervalMillis,H.flushMaxRetries,H.flushQueueSize,e,H.ingestionMetadata,H.instanceName,j,F,H.loggerProvider,H.logLevel,H.minIdLength,H.offline,q,H.partnerId,H.plan,H.serverUrl,H.serverZone,G,H.sessionTimeout,H.storageProvider,J,H.transport,H.useBatch,H.fetchRemoteConfig,B,W,X,H.networkTrackingOptions,H.identify,H.enableDiagnostics,void 0,void 0,H.remoteConfig)).storageProvider.isEnabled()];case 8:return eC.sent()||(K.loggerProvider.warn("Storage provider ".concat(K.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),K.storageProvider=new eJ),[2,K]}})}))];case 1:if(!(null===(b=(P=W.sent()).remoteConfig)||void 0===b?void 0:b.fetchRemoteConfig))return[3,3];return R=new er(P.apiKey,P.loggerProvider,P.serverZone,null===(y=P.remoteConfig)||void 0===y?void 0:y.serverUrl),[4,new Promise(function(e){null==R||R.subscribe("configs.analyticsSDK.browserSDK","all",function(u,b,y){P.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:u,source:b,lastFetch:y},null,2)),u&&function(e,u){if(e){!function translateRemoteConfigToLocal(e){if(!("object"!=typeof e||null===e||Array.isArray(e))){var u,b,y,w,T,_,P,R,D,U,j,F=Object.keys(e);try{for(var q=(0,Q.XA)(F),G=q.next();!G.done;G=q.next()){var B=G.value;try{var J=e[B];"boolean"==typeof(null==J?void 0:J.enabled)&&(J.enabled?(delete J.enabled,0===Object.keys(J).length&&(e[B]=!0)):e[B]=!1),translateRemoteConfigToLocal(J)}catch(e){}}}catch(e){u={error:e}}finally{try{G&&!G.done&&(b=q.return)&&b.call(q)}finally{if(u)throw u.error}}try{if(null===(D=null===(R=null===(P=e.autocapture)||void 0===P?void 0:P.networkTracking)||void 0===R?void 0:R.captureRules)||void 0===D?void 0:D.length)try{for(var W=(0,Q.XA)(e.autocapture.networkTracking.captureRules),V=W.next();!V.done;V=W.next()){var H=V.value;try{for(var z=(T=void 0,(0,Q.XA)(["responseHeaders","requestHeaders"])),X=z.next();!X.done;X=z.next()){var K=X.value,Z=null!==(U=H[K])&&void 0!==U?U:{},Y=Z.captureSafeHeaders,ee=Z.allowlist;if(Y||ee){if(void 0!==ee&&!Array.isArray(ee)){delete H[K];continue}H[K]=(0,Q.ev)((0,Q.ev)([],(0,Q.CR)(Y?eI:[]),!1),(0,Q.CR)(null!=ee?ee:[]),!1)}}}catch(e){T={error:e}}finally{try{X&&!X.done&&(_=z.return)&&_.call(z)}finally{if(T)throw T.error}}}}catch(e){y={error:e}}finally{try{V&&!V.done&&(w=W.return)&&w.call(W)}finally{if(y)throw y.error}}}catch(e){}var et=null===(j=e.autocapture)||void 0===j?void 0:j.frustrationInteractions;et&&(et.rageClick&&(et.rageClicks=et.rageClick,delete et.rageClick),et.deadClick&&(et.deadClicks=et.deadClick,delete et.deadClick))}}(e);try{var b,y,w,T,_,P,R;if(u.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(u.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var D=(0,Q.pi)({},e.autocapture);if(void 0===u.autocapture&&(u.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null===(w=e.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===w?void 0:w.length)){D.elementInteractions=(0,Q.pi)({},e.autocapture.elementInteractions);var U=D.elementInteractions,j=null!==(T=U.pageUrlAllowlist)&&void 0!==T?T:[],F=e.autocapture.elementInteractions.pageUrlAllowlistRegex;U.pageUrlAllowlist=mergeUrls(j,F,u),delete U.pageUrlAllowlistRegex}
25if("object"==typeof e.autocapture.networkTracking&&null!==e.autocapture.networkTracking&&(null===(_=e.autocapture.networkTracking.captureRules)||void 0===_?void 0:_.length)){D.networkTracking=(0,Q.pi)({},e.autocapture.networkTracking);var q=D.networkTracking,G=null!==(P=q.captureRules)&&void 0!==P?P:[];try{for(var B=(0,Q.XA)(G),J=B.next();!J.done;J=B.next()){var W=J.value;W.urls=mergeUrls(null!==(R=W.urls)&&void 0!==R?R:[],W.urlsRegex,u),delete W.urlsRegex}}catch(e){b={error:e}}finally{try{J&&!J.done&&(y=B.return)&&y.call(B)}finally{if(b)throw b.error}}}"boolean"==typeof u.autocapture&&(u.autocapture=(0,Q.pi)({attribution:u.autocapture,fileDownloads:u.autocapture,formInteractions:u.autocapture,pageViews:u.autocapture,sessions:u.autocapture,elementInteractions:u.autocapture,webVitals:u.autocapture,frustrationInteractions:u.autocapture},D)),"object"==typeof u.autocapture&&(u.autocapture=(0,Q.pi)((0,Q.pi)({},u.autocapture),D))}u.defaultTracking=u.autocapture}u.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(u))}catch(e){u.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(u,P),e()})})];case 2:W.sent(),W.label=3;case 3:return(D=new es(P.apiKey,P.loggerProvider,P.serverZone,{enabled:P.enableDiagnostics,sampleRate:P.diagnosticsSampleRate||this._diagnosticsSampleRate})).setTag("library","".concat(eG,"/").concat(eq)),[4,e.prototype._init.call(this,P)];case 4:if(W.sent(),this.logBrowserOptions(P),this.config.diagnosticsClient=D,this.config.remoteConfigClient=R,!isAttributionTrackingEnabled(this.config.defaultTracking))return[3,6];return U=isAttributionTrackingEnabled((X=this.config).defaultTracking)&&X.defaultTracking&&"object"==typeof X.defaultTracking&&X.defaultTracking.attribution&&"object"==typeof X.defaultTracking.attribution?(0,Q.pi)({},X.defaultTracking.attribution):{},this.webAttribution=new rC(U,this.config),[4,this.webAttribution.init()];case 5:W.sent(),W.label=6;case 6:if(q=!(F=(j=getQueryParams()).ampTimestamp?Number(j.ampTimestamp):void 0)||Date.now()<F,this.config.identify&&this.identify(this.config.identify),G=q&&!Number.isNaN(Number(j.ampSessionId))?Number(j.ampSessionId):void 0,this.setSessionId(null!==(_=null!==(T=null!==(w=u.sessionId)&&void 0!==w?w:G)&&void 0!==T?T:this.config.sessionId)&&void 0!==_?_:Date.now()),(B=getAnalyticsConnector(u.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),!(null!==this.config.offline))return[3,8];return[4,this.add(networkConnectivityCheckerPlugin()).promise];case 7:W.sent(),W.label=8;case 8:return[4,this.add(new eD({diagnosticsClient:D})).promise];case 9:return W.sent(),[4,this.add(new eB).promise];case 10:return W.sent(),[4,this.add(new eL).promise];case 11:if(W.sent(),detNotify(this.config),!isTrackingEnabled(this.config.defaultTracking,"fileDownloads"))return[3,13];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(fileDownloadTracking()).promise];case 12:W.sent(),W.label=13;case 13:if(!isTrackingEnabled(this.config.defaultTracking,"formInteractions"))return[3,15];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(formInteractionTracking()).promise];case 14:W.sent(),W.label=15;case 15:if(!isPageViewTrackingEnabled(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(pageViewTrackingPlugin(getPageViewTrackingConfig(this.config))).promise];case 16:W.sent(),W.label=17;case 17:if(!isElementInteractionsEnabled(this.config.autocapture))return[3,19];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(autocapturePlugin(getElementInteractionsConfig(this.config),{diagnosticsClient:D})).promise];case 18:W.sent(),W.label=19;case 19:if(!isFrustrationInteractionsEnabled(this.config.autocapture))return[3,21];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(frustrationPlugin(getFrustrationInteractionsConfig(this.config))).promise];case 20:W.sent(),W.label=21;case 21:if(!isNetworkTrackingEnabled(this.config.autocapture))return[3,23];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(networkCapturePlugin(getNetworkTrackingConfig(this.config))).promise];case 22:W.sent(),W.label=23;case 23:if(!("boolean"==typeof(K=this.config.autocapture)?K:"object"==typeof K&&!0===K.webVitals))return[3,25];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(webVitalsPlugin()).promise];case 24:W.sent(),W.label=25;case 25:if(!isTrackingEnabled(this.config.autocapture,"pageUrlEnrichment"))return[3,27];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(pageUrlEnrichmentPlugin()).promise];case 26:W.sent(),W.label=27;case 27:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 28:return W.sent(),B.eventBridge.setEventReceiver(function(e){var u=e.eventProperties||{},b=u.time,y=(0,Q._T)(u,["time"]),w="number"==typeof b?{time:b}:void 0;J.track(e.eventType,y,w)}),[2]}})})},AmplitudeBrowser.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},AmplitudeBrowser.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,this.timeline.onIdentityChanged({userId:e}),setConnectorUserId(e,this.config.instanceName))},AmplitudeBrowser.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},AmplitudeBrowser.prototype.setDeviceId=function(e){if(!this.config){this.q.push(this.setDeviceId.bind(this,e));return}this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),setConnectorDeviceId(e,this.config.instanceName))},AmplitudeBrowser.prototype.reset=function(){this.setDeviceId(UUID()),this.setUserId(void 0)},AmplitudeBrowser.prototype.getIdentity=function(){var e,u;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(u=this.config)||void 0===u?void 0:u.userId,userProperties:this.userProperties}},AmplitudeBrowser.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},AmplitudeBrowser.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},AmplitudeBrowser.prototype.setSessionId=function(e){var u,b=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),returnWrapper(Promise.resolve());if(e===this.config.sessionId)return returnWrapper(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var y=this.getSessionId();
25y!==e&&this.timeline.onSessionIdChanged(e);var w=this.config.lastEventTime,T=null!==(u=this.config.lastEventId)&&void 0!==u?u:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,isSessionTrackingEnabled(this.config.defaultTracking)&&(y&&w&&b.push(this.track(e3,void 0,{device_id:this.previousSessionDeviceId,event_id:++T,session_id:y,time:w+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var _=this.trackCampaignEventIfNeeded(++T,b);return isSessionTrackingEnabled(this.config.defaultTracking)&&b.push(this.track(e2,void 0,{event_id:_?++T:T,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,returnWrapper(Promise.all(b))},AmplitudeBrowser.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},AmplitudeBrowser.prototype.setTransport=function(e){if(!this.config){this.q.push(this.setTransport.bind(this,e));return}this.config.transportProvider=createTransport(e)},AmplitudeBrowser.prototype.identify=function(u,b){if(isInstanceProxy(u)){var y=u._q;u._q=[],u=convertProxyObjectToRealObject(new eN,y)}return(null==b?void 0:b.user_id)&&this.setUserId(b.user_id),(null==b?void 0:b.device_id)&&this.setDeviceId(b.device_id),e.prototype.identify.call(this,u,b)},AmplitudeBrowser.prototype.groupIdentify=function(u,b,y,w){if(isInstanceProxy(y)){var T=y._q;y._q=[],y=convertProxyObjectToRealObject(new eN,T)}return e.prototype.groupIdentify.call(this,u,b,y,w)},AmplitudeBrowser.prototype.revenue=function(u,b){if(isInstanceProxy(u)){var y=u._q;u._q=[],u=convertProxyObjectToRealObject(new eU,y)}return e.prototype.revenue.call(this,u,b)},AmplitudeBrowser.prototype.trackCampaignEventIfNeeded=function(e,u){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var b=this.webAttribution.generateCampaignEvent(e);return u?u.push(this.track(b).promise):this.track(b),this.config.loggerProvider.log("Tracking attribution."),!0},AmplitudeBrowser.prototype.process=function(u){return(0,Q.mG)(this,void 0,void 0,function(){var b,y,w;return(0,Q.Jh)(this,function(T){return b=Date.now(),y=isNewSession(this.config.sessionTimeout,this.config.lastEventTime),w=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),u.event_type===e2||u.event_type===e3||u.session_id&&u.session_id!==this.getSessionId()||(y||w?(this.setSessionId(b),w&&this.config.loggerProvider.log("Created a new session for new campaign.")):y||this.trackCampaignEventIfNeeded()),u.event_type===H.IDENTIFY&&u.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(u.user_properties)),[2,e.prototype.process.call(this,u)]})})},AmplitudeBrowser.prototype.logBrowserOptions=function(e){try{var u=(0,Q.pi)((0,Q.pi)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(u))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},AmplitudeBrowser.prototype._setDiagnosticsSampleRate=function(e){if(!(e>1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},AmplitudeBrowser}(eF))).init.bind(q),"init",getClientLogConfig(q),getClientStates(q,["config"])),add:debugWrapper(q.add.bind(q),"add",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.plugins"])),remove:debugWrapper(q.remove.bind(q),"remove",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.plugins"])),track:debugWrapper(q.track.bind(q),"track",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.queue.length"])),logEvent:debugWrapper(q.logEvent.bind(q),"logEvent",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.queue.length"])),identify:debugWrapper(q.identify.bind(q),"identify",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.queue.length"])),groupIdentify:debugWrapper(q.groupIdentify.bind(q),"groupIdentify",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.queue.length"])),setGroup:debugWrapper(q.setGroup.bind(q),"setGroup",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.queue.length"])),revenue:debugWrapper(q.revenue.bind(q),"revenue",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.queue.length"])),flush:debugWrapper(q.flush.bind(q),"flush",getClientLogConfig(q),getClientStates(q,["config.apiKey","timeline.queue.length"])),getUserId:debugWrapper(q.getUserId.bind(q),"getUserId",getClientLogConfig(q),getClientStates(q,["config","config.userId"])),setUserId:debugWrapper(q.setUserId.bind(q),"setUserId",getClientLogConfig(q),getClientStates(q,["config","config.userId"])),getDeviceId:debugWrapper(q.getDeviceId.bind(q),"getDeviceId",getClientLogConfig(q),getClientStates(q,["config","config.deviceId"])),setDeviceId:debugWrapper(q.setDeviceId.bind(q),"setDeviceId",getClientLogConfig(q),getClientStates(q,["config","config.deviceId"])),reset:debugWrapper(q.reset.bind(q),"reset",getClientLogConfig(q),getClientStates(q,["config","config.userId","config.deviceId"])),getSessionId:debugWrapper(q.getSessionId.bind(q),"getSessionId",getClientLogConfig(q),getClientStates(q,["config"])),setSessionId:debugWrapper(q.setSessionId.bind(q),"setSessionId",getClientLogConfig(q),getClientStates(q,["config"])),extendSession:debugWrapper(q.extendSession.bind(q),"extendSession",getClientLogConfig(q),getClientStates(q,["config"])),setOptOut:debugWrapper(q.setOptOut.bind(q),"setOptOut",getClientLogConfig(q),getClientStates(q,["config"])),setTransport:debugWrapper(q.setTransport.bind(q),"setTransport",getClientLogConfig(q),getClientStates(q,["config"])),getIdentity:debugWrapper(q.getIdentity.bind(q),"getIdentity",getClientLogConfig(q),getClientStates(q,["config"])),getOptOut:debugWrapper(q.getOptOut.bind(q),"getOptOut",getClientLogConfig(q),getClientStates(q,["config"])),_setDiagnosticsSampleRate:debugWrapper(q._setDiagnosticsSampleRate.bind(q),"_setDiagnosticsSampleRate",getClientLogConfig(q),getClientStates(q,["config"]))};rA.add,rA.extendSession,rA.flush,rA.getDeviceId,rA.getIdentity,rA.getOptOut,rA.getSessionId,rA.getUserId,rA.groupIdentify,rA.identify;
25var rx=rA.init,rP=(rA.logEvent,rA.remove,rA.reset,rA.revenue,rA.setDeviceId,rA.setGroup,rA.setOptOut,rA.setSessionId,rA.setTransport,rA.setUserId),rO=rA.track;rA._setDiagnosticsSampleRate;var rR=b(9429);let rD=!1;function initAmplitude(){rD||(rx("9213fffa3f2a404fc7411e062d0dc47e",{defaultTracking:{sessions:!1,pageViews:!1,formInteractions:!1,fileDownloads:!1}}),rD=!0)}function getCommonProps(){return{custom_session_id:(0,rR.M)(),"is-desktop":Y.nI,"is-tablet":Y.Em,"is-mobile":Y.tq,device_type:Y.nI?"desktop":Y.Em?"tablet":"mobile",url:window.location.href}}function analitycsSetUserId(e){var u;initAmplitude(),rP(e),null===(u=window.dataLayer)||void 0===u||u.push({event:"setUserId",userId:e})}function analitycsView(e){var u;let b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};initAmplitude(),rO({home:"Viewed Home",shows:"Viewed shows",search:"Viewed Search Initial","best-of":"Viewed best_of",contact:"Viewed contact us",favorites:"Viewed favorites",listen_later:"Viewed listen later",login:"Viewed login",register:"Viewed Sign Up Email",recover:"Viewed recover",subscription_modal:"Viewed subscription modal",subscription_modal_second:"Viewed subscription modal second screen",subscription_modal_stay_tuned:"Viewed subscription modal stay tuned",playlist:"Viewed playlist",hc_add_your_podcast:"Viewed hc add your podcast",hc_bugs:"Viewed hc bugs",hc_ideas:"Viewed hc ideas"}[e]||"Viewed ".concat(e),{...getCommonProps(),screen:e,slug:b.slug,"show-id":b.showId,"show-name":b.showName,"episode-id":b.episodeId,playlist_id:b.playlistId}),null===(u=window.dataLayer)||void 0===u||u.push({event:"view",customSessionId:(0,rR.M)(),isDesktop:Y.nI,isTablet:Y.Em,isMobile:Y.tq,screen:e,...b})}function analitycsViewDoorslam(e,u){var b;let y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};initAmplitude(),rO("Viewed ".concat(e,"_doorslam"),{...getCommonProps(),"is-dismissible":u,"show-id":y.showId,"show-name":y.showName,"episode-id":y.episodeId,module:"doorslam",screen:e}),null===(b=window.dataLayer)||void 0===b||b.push({event:"view-doorslam",customSessionId:(0,rR.M)(),isDesktop:Y.nI,isTablet:Y.Em,isMobile:Y.tq,type:e,isDismissible:u,...y})}function analitycsTap(e,u,b){var y;let w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};initAmplitude(),rO("tap",{...getCommonProps(),label:e,module:u,screen:b,slug:w.slug,"show-id":w.showId,"show-name":w.showName,"episode-id":w.episodeId,"is-searching":w.isSearching,playlist_id:w.playlistId}),null===(y=window.dataLayer)||void 0===y||y.push({event:"tap",customSessionId:(0,rR.M)(),isDesktop:Y.nI,isTablet:Y.Em,isMobile:Y.tq,label:e,module:u,screen:b,...w})}function analitycsEvent(e,u,b){var y;let w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};initAmplitude(),rO({"add-to-listen-later":"listen later add","remove-from-listen-later":"listen later remove","add-to-favorites":"favorite add","remove-from-favorites":"favorite remove","undo-remove-favorite":"favorite undo remove",registered:"registered",signin:"login",logout:"logout"}[e]||e,{...getCommonProps(),label:e,module:u,screen:b,slug:w.slug,"show-id":w.showId,"show-name":w.showName,"episode-id":w.episodeId,"login-method":w.loginMehtod}),null===(y=window.dataLayer)||void 0===y||y.push({event:"event",customSessionId:(0,rR.M)(),isDesktop:Y.nI,isTablet:Y.Em,isMobile:Y.tq,label:e,module:u,screen:b,...w})}function analitycsSearch(e,u,b){var y;let w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};initAmplitude(),rO("search",{...getCommonProps(),query:e,type:u,screen:b,slug:w.slug}),null===(y=window.dataLayer)||void 0===y||y.push({event:"search",customSessionId:(0,rR.M)(),isDesktop:Y.nI,isTablet:Y.Em,isMobile:Y.tq,query:e,type:u,screen:b,...w})}},9429:function(e,u,b){"use strict";b.d(u,{M:function(){return getSessionId},e:function(){return refreshSessionId}});var y=b(7632);let w="customSessionId",T="customSessionLastRefresh";function setNewSessionId(e){let u=(0,y.Z)();localStorage.setItem(w,u),localStorage.setItem(T,e.toString())}function refreshSessionId(){let e=localStorage.getItem(w),u=new Date;if(null===e)setNewSessionId(u);else{let e=new Date,b=localStorage.getItem(T);null!==b&&(e=new Date(b));let y=u.getTime()-e.getTime();3e5<y&&setNewSessionId(u)}}function getSessionId(){refreshSessionId();let e=localStorage.getItem(w);return e}},254:function(){},415:function(){},5152:function(e,u,b){e.exports=b(1342)},9008:function(e,u,b){e.exports=b(9201)},1163:function(e,u,b){e.exports=b(9974)},9347:function(e,u,b){"use strict";b.d(u,{zt:function(){return _},ZP:function(){return R}});var y=b(7294),w=b(5885).Z;let T=y.createContext(new w),{Provider:_,Consumer:P}=T;var R=T},708:function(e,u,b){"use strict";b.d(u,{Z:function(){return useCookies}});var y=b(7294),w=b(9347);function useCookies(e){let u=(0,y.useContext)(w.ZP);if(!u)throw Error("Missing <CookiesProvider>");let[b,T]=(0,y.useState)(()=>u.getAll());"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement&&(0,y.useLayoutEffect)(()=>{function onChange(){let y=u.getAll({doNotUpdate:!0});(function(e,u,b){if(!e)return!0;for(let y of e)if(u[y]!==b[y])return!0;return!1})(e||null,y,b)&&T(y)}return u.addChangeListener(onChange),()=>{u.removeChangeListener(onChange)}},[u,b]);let _=(0,y.useMemo)(()=>u.set.bind(u),[u]),P=(0,y.useMemo)(()=>u.remove.bind(u),[u]),R=(0,y.useMemo)(()=>u.update.bind(u),[u]);return[b,_,P,R]}},5518:function(e,u,b){"use strict";var y,w,T,_,P,R,D=b(7294);D&&"object"==typeof D&&"default"in D&&D.default;var U=b(3451),j=new U,F=j.getBrowser(),q=j.getCPU(),G=j.getDevice(),B=j.getEngine(),J=j.getOS(),W=j.getUA(),V={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},H={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},setDefaults=function(e){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";return e||u},getNavigatorInstance=function(){return!!("undefined"!=typeof window&&(window.navigator||navigator))&&(window.navigator||navigator)},isIOS13Check=function(e){var u=getNavigatorInstance();return u&&u.platform&&(-1!==u.platform.indexOf(e)||"MacIntel"===u.platform&&u.maxTouchPoints>1&&!window.MSStream)},isBrowserType=function(e){return e.type===V.Browser},isEdgeType=function(e){return e.name===H.Edge},isEdgeChromiumType=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},getIPad13=function(){return isIOS13Check("iPad")};G.type,V.SmartTv,G.type,V.Console,G.type,V.Wearable,G.type,V.Embedded,F.name===H.MobileSafari||getIPad13(),F.name,H.Chromium;var z=(y=G.type)===V.Mobile||y===V.Tablet||getIPad13(),X=(G.type,V.Mobile,G.type===V.Tablet||getIPad13()
25),K=(isBrowserType(G),isBrowserType(G)),Z="Android"===J.name,Y=(J.name,"iOS"===J.name||getIPad13());F.name,H.Chrome,F.name,H.Firefox,(w=F.name)===H.Safari||H.MobileSafari,F.name,H.Opera,(T=F.name)===H.InternetExplorer||H.Ie,setDefaults(J.version),setDefaults(J.name),setDefaults(F.version),setDefaults(F.major),setDefaults(F.name),setDefaults(G.vendor),setDefaults(G.model),setDefaults(B.name),setDefaults(B.version),setDefaults(W),isEdgeType(F)||isEdgeChromiumType(W),F.name,H.Yandex,setDefaults(G.type,"browser"),(_=getNavigatorInstance())&&(/iPad|iPhone|iPod/.test(_.platform)||"MacIntel"===_.platform&&_.maxTouchPoints>1)&&window.MSStream,getIPad13(),isIOS13Check("iPhone"),isIOS13Check("iPod"),"string"==typeof(R=(P=getNavigatorInstance())&&P.userAgent&&P.userAgent.toLowerCase())&&/electron/.test(R),isEdgeChromiumType(W),isEdgeType(F)&&isEdgeChromiumType(W),J.name,J.name,F.name,H.MIUI,F.name,H.SamsungBrowser,u.Dt=Z,u.nI=K,u.gn=Y,u.tq=z,u.Em=X},3451:function(e,u,b){var y;!function(w,T){"use strict";var _="function",P="undefined",R="object",D="string",U="major",j="model",F="name",q="type",G="vendor",B="version",J="architecture",W="console",V="mobile",H="tablet",z="smarttv",X="wearable",K="embedded",Z="Amazon",Y="Apple",Q="ASUS",ee="BlackBerry",et="Browser",er="Chrome",en="Firefox",ei="Google",eo="Huawei",es="Microsoft",ea="Motorola",eu="Opera",el="Samsung",ec="Sharp",ed="Sony",ep="Xiaomi",ef="Zebra",eh="Facebook",eg="Chromium OS",ev="Mac OS",extend=function(e,u){var b={};for(var y in e)u[y]&&u[y].length%2==0?b[y]=u[y].concat(e[y]):b[y]=e[y];return b},enumerize=function(e){for(var u={},b=0;b<e.length;b++)u[e[b].toUpperCase()]=e[b];return u},has=function(e,u){return typeof e===D&&-1!==lowerize(u).indexOf(lowerize(e))},lowerize=function(e){return e.toLowerCase()},trim=function(e,u){if(typeof e===D)return e=e.replace(/^\s\s*/,""),typeof u===P?e:e.substring(0,350)},rgxMapper=function(e,u){for(var b,y,w,P,D,U,j=0;j<u.length&&!D;){var F=u[j],q=u[j+1];for(b=y=0;b<F.length&&!D&&F[b];)if(D=F[b++].exec(e))for(w=0;w<q.length;w++)U=D[++y],typeof(P=q[w])===R&&P.length>0?2===P.length?typeof P[1]==_?this[P[0]]=P[1].call(this,U):this[P[0]]=P[1]:3===P.length?typeof P[1]!==_||P[1].exec&&P[1].test?this[P[0]]=U?U.replace(P[1],P[2]):T:this[P[0]]=U?P[1].call(this,U,P[2]):T:4===P.length&&(this[P[0]]=U?P[3].call(this,U.replace(P[1],P[2])):T):this[P]=U||T;j+=2}},strMapper=function(e,u){for(var b in u)if(typeof u[b]===R&&u[b].length>0){for(var y=0;y<u[b].length;y++)if(has(u[b][y],e))return"?"===b?T:b}else if(has(u[b],e))return"?"===b?T:b;return e},em={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},eb={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[B,[F,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[B,[F,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[F,B],[/opios[\/ ]+([\w\.]+)/i],[B,[F,eu+" Mini"]],[/\bopr\/([\w\.]+)/i],[B,[F,eu]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[F,B],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[B,[F,"UC"+et]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[B,[F,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[B,[F,"WeChat"]],[/konqueror\/([\w\.]+)/i],[B,[F,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[B,[F,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[B,[F,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[F,/(.+)/,"$1 Secure "+et],B],[/\bfocus\/([\w\.]+)/i],[B,[F,en+" Focus"]],[/\bopt\/([\w\.]+)/i],[B,[F,eu+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[B,[F,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[B,[F,"Dolphin"]],[/coast\/([\w\.]+)/i],[B,[F,eu+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[B,[F,"MIUI "+et]],[/fxios\/([-\w\.]+)/i],[B,[F,en]],[/\bqihu|(qi?ho?o?|360)browser/i],[[F,"360 "+et]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[F,/(.+)/,"$1 "+et],B],[/(comodo_dragon)\/([\w\.]+)/i],[[F,/_/g," "],B],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[F,B],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[F],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[F,eh],B],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[F,B],[/\bgsa\/([\w\.]+) .*safari\//i],[B,[F,"GSA"]],[/musical_ly(?:.
vendor: 4,863 bytes, line 25
25+app_?version\/|_)([\w\.]+)/i],[B,[F,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[B,[F,er+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[F,er+" WebView"],B],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[B,[F,"Android "+et]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[F,B],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[B,[F,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[B,F],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[F,[B,strMapper,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[F,B],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[F,"Netscape"],B],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[B,[F,en+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[F,B],[/(cobalt)\/([\w\.]+)/i],[F,[B,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[J,"amd64"]],[/(ia32(?=;))/i],[[J,lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[J,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[J,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[J,"armhf"]],[/windows (ce|mobile); ppc;/i],[[J,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[J,/ower/,"",lowerize]],[/(sun4\w)[;\)]/i],[[J,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[J,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[j,[G,el],[q,H]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[j,[G,el],[q,V]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[j,[G,Y],[q,V]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[j,[G,Y],[q,H]],[/(macintosh);/i],[j,[G,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[j,[G,ec],[q,V]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[j,[G,eo],[q,H]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[j,[G,eo],[q,V]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[j,/_/g," "],[G,ep],[q,V]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[j,/_/g," "],[G,ep],[q,H]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[j,[G,"OPPO"],[q,V]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[j,[G,"Vivo"],[q,V]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[j,[G,"Realme"],[q,V]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[j,[G,ea],[q,V]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[j,[G,ea],[q,H]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[j,[G,"LG"],[q,H]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[j,[G,"LG"],[q,V]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[j,[G,"Lenovo"],[q,H]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[j,/_/g," "],[G,"Nokia"],[q,V]],[/(pixel c)\b/i],[j,[G,ei],[q,H]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[j,[G,ei],[q,V]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[j,[G,ed],[q,V]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[j,"Xperia Tablet"],[G,ed],[q,H]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[j,[G,"OnePlus"],[q,V]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[j,[G,Z],[q,H]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[j,/(.+)/g,"Fire Phone $1"],[G,Z],[q,V]],[/(playbook);[-\w\),; ]+(rim)/i],[j,G,[q,H]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[j,[G,ee],[q,V]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[j,[G,Q],[q,H]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[j,[G,Q],[q,V]],[/(nexus 9)/i],[j,[G,"HTC"],[q,H]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;
25|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[G,[j,/_/g," "],[q,V]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[j,[G,"Acer"],[q,H]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[j,[G,"Meizu"],[q,V]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[G,j,[q,V]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[G,j,[q,H]],[/(surface duo)/i],[j,[G,es],[q,H]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[j,[G,"Fairphone"],[q,V]],[/(u304aa)/i],[j,[G,"AT&T"],[q,V]],[/\bsie-(\w*)/i],[j,[G,"Siemens"],[q,V]],[/\b(rct\w+) b/i],[j,[G,"RCA"],[q,H]],[/\b(venue[\d ]{2,7}) b/i],[j,[G,"Dell"],[q,H]],[/\b(q(?:mv|ta)\w+) b/i],[j,[G,"Verizon"],[q,H]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[j,[G,"Barnes & Noble"],[q,H]],[/\b(tm\d{3}\w+) b/i],[j,[G,"NuVision"],[q,H]],[/\b(k88) b/i],[j,[G,"ZTE"],[q,H]],[/\b(nx\d{3}j) b/i],[j,[G,"ZTE"],[q,V]],[/\b(gen\d{3}) b.+49h/i],[j,[G,"Swiss"],[q,V]],[/\b(zur\d{3}) b/i],[j,[G,"Swiss"],[q,H]],[/\b((zeki)?tb.*\b) b/i],[j,[G,"Zeki"],[q,H]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[G,"Dragon Touch"],j,[q,H]],[/\b(ns-?\w{0,9}) b/i],[j,[G,"Insignia"],[q,H]],[/\b((nxa|next)-?\w{0,9}) b/i],[j,[G,"NextBook"],[q,H]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[G,"Voice"],j,[q,V]],[/\b(lvtel\-)?(v1[12]) b/i],[[G,"LvTel"],j,[q,V]],[/\b(ph-1) /i],[j,[G,"Essential"],[q,V]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[j,[G,"Envizen"],[q,H]],[/\b(trio[-\w\. ]+) b/i],[j,[G,"MachSpeed"],[q,H]],[/\btu_(1491) b/i],[j,[G,"Rotor"],[q,H]],[/(shield[\w ]+) b/i],[j,[G,"Nvidia"],[q,H]],[/(sprint) (\w+)/i],[G,j,[q,V]],[/(kin\.[onetw]{3})/i],[[j,/\./g," "],[G,es],[q,V]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[j,[G,ef],[q,H]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[j,[G,ef],[q,V]],[/smart-tv.+(samsung)/i],[G,[q,z]],[/hbbtv.+maple;(\d+)/i],[[j,/^/,"SmartTV"],[G,el],[q,z]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[G,"LG"],[q,z]],[/(apple) ?tv/i],[G,[j,Y+" TV"],[q,z]],[/crkey/i],[[j,er+"cast"],[G,ei],[q,z]],[/droid.+aft(\w+)( bui|\))/i],[j,[G,Z],[q,z]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[j,[G,ec],[q,z]],[/(bravia[\w ]+)( bui|\))/i],[j,[G,ed],[q,z]],[/(mitv-\w{5}) bui/i],[j,[G,ep],[q,z]],[/Hbbtv.*(technisat) (.*);/i],[G,j,[q,z]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[G,trim],[j,trim],[q,z]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[q,z]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[G,j,[q,W]],[/droid.+; (shield) bui/i],[j,[G,"Nvidia"],[q,W]],[/(playstation [345portablevi]+)/i],[j,[G,ed],[q,W]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[j,[G,es],[q,W]],[/((pebble))app/i],[G,j,[q,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[j,[G,Y],[q,X]],[/droid.+; (glass) \d/i],[j,[G,ei],[q,X]],[/droid.+; (wt63?0{2,3})\)/i],[j,[G,ef],[q,X]],[/(quest( 2| pro)?)/i],[j,[G,eh],[q,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[G,[q,K]],[/(aeobc)\b/i],[j,[G,Z],[q,K]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[j,[q,V]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[j,[q,H]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[q,H]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[q,V]],[/(android[-\w\. ]{0,9});.+buil/i],[j,[G,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[B,[F,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[B,[F,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[F,B],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[B,F]],os:[[/microsoft (windows) (vista|xp)/i],[F,B],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[F,[B,strMapper,em]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[F,"Windows"],[B,strMapper,em]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[B,/_/g,"."],[F,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[F,ev],[B,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[B,F],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[F,B],[/\(bb(10);/i],[B,[F,ee]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[B,[F,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+);
25 rv:.+ gecko\/([\w\.]+)/i],[B,[F,en+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[B,[F,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[B,[F,"watchOS"]],[/crkey\/([\d\.]+)/i],[B,[F,er+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[F,eg],B],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[F,B],[/(sunos) ?([\w\.\d]*)/i],[[F,"Solaris"],B],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[F,B]]},UAParser=function(e,u){if(typeof e===R&&(u=e,e=T),!(this instanceof UAParser))return new UAParser(e,u).getResult();var b=typeof w!==P&&w.navigator?w.navigator:T,y=e||(b&&b.userAgent?b.userAgent:""),W=b&&b.userAgentData?b.userAgentData:T,z=u?extend(eb,u):eb,X=b&&b.userAgent==y;return this.getBrowser=function(){var e,u={};return u[F]=T,u[B]=T,rgxMapper.call(u,y,z.browser),u[U]=typeof(e=u[B])===D?e.replace(/[^\d\.]/g,"").split(".")[0]:T,X&&b&&b.brave&&typeof b.brave.isBrave==_&&(u[F]="Brave"),u},this.getCPU=function(){var e={};return e[J]=T,rgxMapper.call(e,y,z.cpu),e},this.getDevice=function(){var e={};return e[G]=T,e[j]=T,e[q]=T,rgxMapper.call(e,y,z.device),X&&!e[q]&&W&&W.mobile&&(e[q]=V),X&&"Macintosh"==e[j]&&b&&typeof b.standalone!==P&&b.maxTouchPoints&&b.maxTouchPoints>2&&(e[j]="iPad",e[q]=H),e},this.getEngine=function(){var e={};return e[F]=T,e[B]=T,rgxMapper.call(e,y,z.engine),e},this.getOS=function(){var e={};return e[F]=T,e[B]=T,rgxMapper.call(e,y,z.os),X&&!e[F]&&W&&"Unknown"!=W.platform&&(e[F]=W.platform.replace(/chrome os/i,eg).replace(/macos/i,ev)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(e){return y=typeof e===D&&e.length>350?trim(e,350):e,this},this.setUA(y),this};UAParser.VERSION="1.0.36",UAParser.BROWSER=enumerize([F,B,U]),UAParser.CPU=enumerize([J]),UAParser.DEVICE=enumerize([j,G,q,W,V,z,H,X,K]),UAParser.ENGINE=UAParser.OS=enumerize([F,B]),typeof u!==P?(e.exports&&(u=e.exports=UAParser),u.UAParser=UAParser):b.amdO?T!==(y=(function(){return UAParser}).call(u,b,u,e))&&(e.exports=y):typeof w!==P&&(w.UAParser=UAParser);var ey=typeof w!==P&&(w.jQuery||w.Zepto);if(ey&&!ey.ua){var ew=new UAParser;ey.ua=ew.getResult(),ey.ua.get=function(){return ew.getUA()},ey.ua.set=function(e){ew.setUA(e);var u=ew.getResult();for(var b in u)ey.ua[b]=u[b]}}}("object"==typeof window?window:this)},5885:function(e,u,b){"use strict";b.d(u,{Z:function(){return w}});var y=b(6489);function readCookie(e,u={}){let b=e&&"j"===e[0]&&":"===e[1]?e.substr(2):e;if(!u.doNotParse)try{return JSON.parse(b)}catch(e){}return e}var w=class{constructor(e,u={}){var b;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;let e=this.cookies;this.cookies=y.Q(document.cookie),this._checkChanges(e)};let w="undefined"==typeof document?"":document.cookie;this.cookies="string"==typeof(b=e||w)?y.Q(b):"object"==typeof b&&null!==b?b:{},this.defaultSetOptions=u,this.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie}_emitChange(e){for(let u=0;u<this.changeListeners.length;++u)this.changeListeners[u](e)}_checkChanges(e){let u=new Set(Object.keys(e).concat(Object.keys(this.cookies)));u.forEach(u=>{e[u]!==this.cookies[u]&&this._emitChange({name:u,value:readCookie(e[u])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(e,u={}){return u.doNotUpdate||this.update(),readCookie(this.cookies[e],u)}getAll(e={}){e.doNotUpdate||this.update();let u={};for(let b in this.cookies)u[b]=readCookie(this.cookies[b],e);return u}set(e,u,b){b=b?Object.assign(Object.assign({},this.defaultSetOptions),b):this.defaultSetOptions;let w="string"==typeof u?u:JSON.stringify(u);this.cookies=Object.assign(Object.assign({},this.cookies),{[e]:w}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=y.q(e,w,b)),this._emitChange({name:e,value:u,options:b})}remove(e,u){let b=u=Object.assign(Object.assign({},u),{expires:new Date(1970,1,1,0,0,1),maxAge:0}
25);this.cookies=Object.assign({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=y.q(e,"",b)),this._emitChange({name:e,value:void 0,options:u})}addChangeListener(e){this.changeListeners.push(e),1===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(e){let u=this.changeListeners.indexOf(e);u>=0&&this.changeListeners.splice(u,1),0===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}},7632:function(e,u,b){"use strict";let y;b.d(u,{Z:function(){return esm_browser_v4}});let w="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var T={randomUUID:w};let _=new Uint8Array(16),P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1));var esm_browser_v4=function(e,u,b){if(T.randomUUID&&!u&&!e)return T.randomUUID();e=e||{};let w=e.random||(e.rng||function(){if(!y&&!(y="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return y(_)})();if(w[6]=15&w[6]|64,w[8]=63&w[8]|128,u){b=b||0;for(let e=0;e<16;++e)u[b+e]=w[e];return u}return function(e,u=0){return P[e[u+0]]+P[e[u+1]]+P[e[u+2]]+P[e[u+3]]+"-"+P[e[u+4]]+P[e[u+5]]+"-"+P[e[u+6]]+P[e[u+7]]+"-"+P[e[u+8]]+P[e[u+9]]+"-"+P[e[u+10]]+P[e[u+11]]+P[e[u+12]]+P[e[u+13]]+P[e[u+14]]+P[e[u+15]]}(w)}},7582:function(e,u,b){"use strict";b.d(u,{CR:function(){return __read},FC:function(){return __asyncGenerator},Jh:function(){return __generator},KL:function(){return __asyncValues},XA:function(){return __values},ZT:function(){return __extends},_T:function(){return __rest},ev:function(){return __spreadArray},mG:function(){return __awaiter},pi:function(){return __assign},qq:function(){return __await}});var extendStatics=function(e,u){return(extendStatics=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,u){e.__proto__=u}||function(e,u){for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(e[b]=u[b])})(e,u)};function __extends(e,u){if("function"!=typeof u&&null!==u)throw TypeError("Class extends value "+String(u)+" is not a constructor or null");function __(){this.constructor=e}extendStatics(e,u),e.prototype=null===u?Object.create(u):(__.prototype=u.prototype,new __)}var __assign=function(){return(__assign=Object.assign||function(e){for(var u,b=1,y=arguments.length;b<y;b++)for(var w in u=arguments[b])Object.prototype.hasOwnProperty.call(u,w
25)&&(e[w]=u[w]);return e}).apply(this,arguments)};function __rest(e,u){var b={};for(var y in e)Object.prototype.hasOwnProperty.call(e,y)&&0>u.indexOf(y)&&(b[y]=e[y]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var w=0,y=Object.getOwnPropertySymbols(e);w<y.length;w++)0>u.indexOf(y[w])&&Object.prototype.propertyIsEnumerable.call(e,y[w])&&(b[y[w]]=e[y[w]]);return b}function __awaiter(e,u,b,y){return new(b||(b=Promise))(function(w,T){function fulfilled(e){try{step(y.next(e))}catch(e){T(e)}}function rejected(e){try{step(y.throw(e))}catch(e){T(e)}}function step(e){var u;e.done?w(e.value):((u=e.value)instanceof b?u:new b(function(e){e(u)})).then(fulfilled,rejected)}step((y=y.apply(e,u||[])).next())})}function __generator(e,u){var b,y,w,T={label:0,sent:function(){if(1&w[0])throw w[1];return w[1]},trys:[],ops:[]},_=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return _.next=verb(0),_.throw=verb(1),_.return=verb(2),"function"==typeof Symbol&&(_[Symbol.iterator]=function(){return this}),_;function verb(P){return function(R){return function(P){if(b)throw TypeError("Generator is already executing.");for(;_&&(_=0,P[0]&&(T=0)),T;)try{if(b=1,y&&(w=2&P[0]?y.return:P[0]?y.throw||((w=y.return)&&w.call(y),0):y.next)&&!(w=w.call(y,P[1])).done)return w;switch(y=0,w&&(P=[2&P[0],w.value]),P[0]){case 0:case 1:w=P;break;case 4:return T.label++,{value:P[1],done:!1};case 5:T.label++,y=P[1],P=[0];continue;case 7:P=T.ops.pop(),T.trys.pop();continue;default:if(!(w=(w=T.trys).length>0&&w[w.length-1])&&(6===P[0]||2===P[0])){T=0;continue}if(3===P[0]&&(!w||P[1]>w[0]&&P[1]<w[3])){T.label=P[1];break}if(6===P[0]&&T.label<w[1]){T.label=w[1],w=P;break}if(w&&T.label<w[2]){T.label=w[2],T.ops.push(P);break}w[2]&&T.ops.pop(),T.trys.pop();continue}P=u.call(e,T)}catch(e){P=[6,e],y=0}finally{b=w=0}if(5&P[0])throw P[1];return{value:P[0]?P[1]:void 0,done:!0}}([P,R])}}}function __values(e){var u="function"==typeof Symbol&&Symbol.iterator,b=u&&e[u],y=0;if(b)return b.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&y>=e.length&&(e=void 0),{value:e&&e[y++],done:!e}}};throw TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,u){var b="function"==typeof Symbol&&e[Symbol.iterator];if(!b)return e;var y,w,T=b.call(e),_=[];try{for(;(void 0===u||u-- >0)&&!(y=T.next()).done;)_.push(y.value)}catch(e){w={error:e}}finally{try{y&&!y.done&&(b=T.return)&&b.call(T)}finally{if(w)throw w.error}}return _}function __spreadArray(e,u,b){if(b||2==arguments.length)for(var y,w=0,T=u.length;w<T;w++)!y&&w in u||(y||(y=Array.prototype.slice.call(u,0,w)),y[w]=u[w]);return e.concat(y||Array.prototype.slice.call(u))}function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}function __asyncGenerator(e,u,b){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var y,w=b.apply(e,u||[]),T=[];return y=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),verb("next"),verb("throw"),verb("return",function(e){return function(u){return Promise.resolve(u).then(e,reject)}}),y[Symbol.asyncIterator]=function(){return this},y;function verb(e,u){w[e]&&(y[e]=function(u){return new Promise(function(b,y){T.push([e,u,b,y])>1||resume(e,u)})},u&&(y[e]=u(y[e])))}function resume(e,u){try{var b;(b=w[e](u)).value instanceof __await?Promise.resolve(b.value.v).then(fulfill,reject):settle(T[0][2],b)}catch(e){settle(T[0][3],e)}}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,u){e(u),T.shift(),T.length&&resume(T[0][0],T[0][1])}}function __asyncValues(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var u,b=e[Symbol.asyncIterator];return b?b.call(e):(e=__values(e),u={},verb("next"),verb("throw"),verb("return"),u[Symbol.asyncIterator]=function(){return this},u);function verb(b){u[b]=e[b]&&function(u){return new Promise(function(y,w){!function(e,u,b,y){Promise.resolve(y).then(function(u){e({value:u,done:b})},u)}(y,w,(u=e[b](u)).done,u.value)})}}}"function"==typeof SuppressedError&&SuppressedError}},function(e){var __webpack_exec__=function(u){return e(e.s=u)};e.O(0,[9774,179],function(){return __webpack_exec__(6840),__webpack_exec__(9974)}),_N_E=e.O()}]);
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.