import{A as ci,Hb as lc,Ib as dc,Jb as pc,Kb as fc,Lb as mc,N as dr,Ob as gc,Q as ac,S as pr,a as g,b as D,c as oc,cb as ui,f as Nn,g as p,h as sc,t as ai,ub as cc,wb as uc}from"./chunk-OH6EAVV4.js";p();p();function hc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hc(Object(n),!0).forEach(function(r){E(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function kr(t){return kr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kr(t)}function Q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Z(t,e,n){return e&&_c(t.prototype,e),n&&_c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lp(t,e){if(t==null)return{};var n,r,i=function(s,a){if(s==null)return{};var c,l,u={},d=Object.keys(s);for(l=0;l<d.length;l++)c=d[l],a.indexOf(c)>=0||(u[c]=s[c]);return u}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ce(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,s,a=[],c=!0,l=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(a.push(o.value),!r||a.length!==r);c=!0);}catch(u){l=!0,s=u}finally{try{c||i.return==null||i.return()}finally{if(l)throw s}}return a}}(t,e)||ps(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Un(t){return function(e){if(Array.isArray(e))return jo(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||ps(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ps(t,e){if(t){if(typeof t=="string")return jo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jo(t,e):void 0}}function jo(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function dt(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ps(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,o=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}var dn={DEBUG:!1,LIB_VERSION:"1.132.2"},dp=Array.isArray,iu=Object.prototype,ou=iu.hasOwnProperty,Ni=iu.toString,le=dp||function(t){return Ni.call(t)==="[object Array]"},ut=function(t){return typeof t=="function"},bt=function(t){return t===Object(t)&&!le(t)},Oo=function(t){if(bt(t)){for(var e in t)if(ou.call(t,e))return!1;return!0}return!1},M=function(t){return t===void 0},be=function(t){return Ni.call(t)=="[object String]"},lt=function(t){return t===null},Bt=function(t){return M(t)||lt(t)},at=function(t){return Ni.call(t)=="[object Number]"},gi=function(t){return Ni.call(t)==="[object Boolean]"},pp=function(t){return t instanceof FormData},_=typeof window<"u"?window:void 0,Me=typeof globalThis<"u"?globalThis:_,su=Array.prototype,vc=su.forEach,yc=su.indexOf,Sr=Me?.navigator,x=Me?.document,Xe=Me?.location,Wo=Me?.fetch,zo=Me!=null&&Me.XMLHttpRequest&&"withCredentials"in new Me.XMLHttpRequest?Me.XMLHttpRequest:void 0,Sc=Me?.AbortController,re=Sr?.userAgent,Pe=_??{},Ec="[PostHog.js]",b={_log:function(t){if(_&&(dn.DEBUG||Pe.POSTHOG_DEBUG)&&!M(_.console)&&_.console){for(var e=("__rrweb_original__"in _.console[t])?_.console[t].__rrweb_original__:_.console[t],n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.apply(void 0,[Ec].concat(r))}},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];b._log.apply(b,["log"].concat(e))},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];b._log.apply(b,["warn"].concat(e))},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];b._log.apply(b,["error"].concat(e))},critical:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=console).error.apply(t,[Ec].concat(n))},uninitializedWarning:function(t){b.error("You must initialize PostHog before calling ".concat(t))}},yi={},Ci=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Fn(t,e,n){if(le(t)){if(vc&&t.forEach===vc)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===yi)return}}}function J(t,e,n){if(!Bt(t)){if(le(t))return Fn(t,e,n);if(pp(t)){var r,i=dt(t.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(e.call(n,o[1],o[0])===yi)return}}catch(a){i.e(a)}finally{i.f()}}else for(var s in t)if(ou.call(t,s)&&e.call(n,t[s],s)===yi)return}}var me=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Fn(n,function(i){for(var o in i)i[o]!==void 0&&(t[o]=i[o])}),t};function j(t,e){return t.indexOf(e)!==-1}function hi(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var au=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},bc=function(t){try{return t()}catch{return}},fp=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){b.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),b.critical(i)}}},Yo=function(t){var e={};return J(t,function(n,r){be(n)&&n.length>0&&(e[r]=n)}),e};function mp(t,e){return n=t,r=function(o){return be(o)&&!lt(e)?o.slice(0,e):o},i=new Set,function o(s,a){return s!==Object(s)?r?r(s,a):s:i.has(s)?void 0:(i.add(s),le(s)?(c=[],Fn(s,function(l){c.push(o(l))})):(c={},J(s,function(l,u){i.has(l)||(c[u]=o(l,u))})),c);var c}(n);var n,r,i}var ct,gp=function(t){var e,n,r,i,o="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`)).length,i=0;i<r;i++){var s=t.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),lt(a)||(n>e&&(o+=t.substring(e,n)),o+=a,e=n=i+1)}return n>e&&(o+=t.substring(e,t.length)),o},Ut=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation),e}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},function(e,n,r,i,o){if(e)if(e.addEventListener&&!i)e.addEventListener(n,r,!!o);else{var s="on"+n,a=e[s];e[s]=function(c,l,u){return function(d){if(d=d||t(_?.event)){var f,m=!0;ut(u)&&(f=u(d));var h=l.call(c,d);return f!==!1&&h!==!1||(m=!1),m}}}(e,r,a)}else b.error("No valid element provided to register_event")}}();function wr(t,e){var n=function(){if(!x)return e("document not found");var r=x.createElement("script");r.type="text/javascript",r.src=t,r.onload=function(s){return e(void 0,s)},r.onerror=function(s){return e(s)};var i,o=x.querySelectorAll("body > script");o.length>0?(i=o[0].parentNode)===null||i===void 0||i.insertBefore(r,o[0]):x.body.appendChild(r)};x!=null&&x.body?n():x?.addEventListener("DOMContentLoaded",n)}(function(t){t.GZipJS="gzip-js",t.Base64="base64"})(ct||(ct={}));var cu="$people_distinct_id",hr="__alias",_r="__timers",Tc="$autocapture_disabled_server_side",Vo="$heatmaps_enabled_server_side",Jo="$session_recording_enabled_server_side",Ic="$console_log_recording_enabled_server_side",kc="$session_recording_network_payload_capture",wc="$session_recording_canvas_recording",xc="$replay_sample_rate",Rc="$replay_minimum_duration",Si="$sesid",Er="$session_is_sampled",Pn="$enabled_feature_flags",Ko="$early_access_features",On="$stored_person_properties",Xt="$stored_group_properties",Xo="$surveys",Ei="$flag_call_reported",Mt="$user_state",Qo="$client_session_props",Zo="$capture_rate_limit",es="$initial_campaign_params",ts="$initial_referrer_info",bi="$epp",ns="__POSTHOG_TOOLBAR__",hp=[cu,hr,"__cmpns",_r,Jo,Vo,Si,Pn,Mt,Ko,Xt,On,Xo,Ei,Qo,Zo,es,ts,bi],Fo="$active_feature_flags",li="$override_feature_flags",Ac="$feature_flag_payloads",Nc=function(t){var e,n={},r=dt(hi(t||{}));try{for(r.s();!(e=r.n()).done;){var i=Ce(e.value,2),o=i[0],s=i[1];s&&(n[o]=s)}}catch(a){r.e(a)}finally{r.f()}return n},_p=function(){function t(e){Q(this,t),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Z(t,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Pn),n=this.instance.get_property(li);if(!n)return e||{};for(var r=me({},e),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this._override_warning||(b.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this._override_warning=!0),r}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Ac)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var n=this.instance.config.token,r=this.instance.get_property(On),i=this.instance.get_property(Xt),o={token:n,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r,group_properties:i,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:o,compression:this.instance.config.disable_compression?void 0:ct.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(s){var a;e.setReloadingPaused(!1);var c=!0;s.statusCode===200&&(e.$anon_distinct_id=void 0,c=!1),e.receivedFeatureFlags((a=s.json)!==null&&a!==void 0?a:{},c),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r,i=this.getFlagVariants()[e],o="".concat(i),s=this.instance.get_property(Ei)||{};return(n.send_event||!("send_event"in n))&&(!(e in s)||!s[e].includes(o))&&(le(s[e])?s[e].push(o):s[e]=[o],(r=this.instance.persistence)===null||r===void 0||r.register(E({},Ei,s)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:i})),i}b.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,n);b.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(n){return n!==e})}},{key:"receivedFeatureFlags",value:function(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();(function(o,s){var a,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=o.featureFlags,d=o.featureFlagPayloads;if(u)if(le(u)){var f,m={};if(u)for(var h=0;h<u.length;h++)m[u[h]]=!0;s&&s.register((E(f={},Fo,u),E(f,Pn,m),f))}else{var v=u,T=d;o.errorsWhileComputingFlags&&(v=w(w({},c),v),T=w(w({},l),T)),s&&s.register((E(a={},Fo,Object.keys(Nc(v))),E(a,Pn,v||{}),E(a,Ac,T||{}),a))}})(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return b.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(li);else if(le(e)){for(var n={},r=0;r<e.length;r++)n[e[r]]=!0;this.instance.persistence.register(E({},li,n))}else this.instance.persistence.register(E({},li,e))}},{key:"onFeatureFlags",value:function(e){var n=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var r=this._prepareFeatureFlagsForCallbacks(),i=r.flags,o=r.flagVariants;e(i,o)}return function(){return n.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=E({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var s=w(w({},this.getFlagVariants()),{},E({},e,n));(r=this.instance.persistence)===null||r===void 0||r.register((E(i={},Fo,Object.keys(Nc(s))),E(i,Pn,s),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(Ko);if(i&&!r)return e(i);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(o){var s;if(o.json){var a=o.json.earlyAccessFeatures;return(s=n.instance.persistence)===null||s===void 0||s.register(E({},Ko,a)),e(a)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter(function(r){return n[r]}),flagVariants:Object.keys(n).filter(function(r){return n[r]}).reduce(function(r,i){return r[i]=n[i],r},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;this.featureFlagEventHandlers.forEach(function(o){return o(r,i,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(On)||{};this.instance.register(E({},On,w(w({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(On)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Xt)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(function(i){r[i]=w(w({},r[i]),e[i]),delete e[i]}),this.instance.register(E({},Xt,w(w({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(Xt)||{};this.instance.register(E({},Xt,w(w({},n),{},E({},e,{}))))}else this.instance.unregister(Xt)}}]),t}();Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return at(t)&&isFinite(t)&&Math.floor(t)===t});var Cc="0123456789abcdef",vp=function(){function t(e){if(Q(this,t),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return Z(t,[{key:"toString",value:function(){for(var e="",n=0;n<this.bytes.length;n++)e=e+Cc.charAt(this.bytes[n]>>>4)+Cc.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new t(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}],[{key:"fromFieldsV7",value:function(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||n<0||r<0||i<0||e>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new t(o)}}]),t}(),yp=function(){function t(){Q(this,t),E(this,"timestamp",0),E(this,"counter",0),E(this,"random",new Sp)}return Z(t,[{key:"generate",value:function(){var e=this.generateOrAbort();if(M(e)){this.timestamp=0;var n=this.generateOrAbort();if(M(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return vp.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),t}(),uu=function(t){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};_&&!M(_.crypto)&&crypto.getRandomValues&&(uu=function(t){return crypto.getRandomValues(t)});var Pc,Sp=function(){function t(){Q(this,t),E(this,"buffer",new Uint32Array(8)),E(this,"cursor",1/0)}return Z(t,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(uu(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),t}(),Qt=function(){return Ep().toString()},Ep=function(){return(Pc||(Pc=new yp)).generate()},bp="Thu, 01 Jan 1970 00:00:00 GMT",fr="",Tp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ip(t,e){if(e){var n=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x;if(fr)return fr;if(!o||["localhost","127.0.0.1"].includes(i))return"";for(var s=i.split("."),a=Math.min(s.length,8),c="dmn_chk_"+Qt(),l=new RegExp("(^|;)\\s*"+c+"=1");!fr&&a--;){var u=s.slice(a).join("."),d=c+"=1;domain=."+u;o.cookie=d,l.test(o.cookie)&&(o.cookie=d+";expires="+bp,fr=u)}return fr}(t);if(!n){var r=function(i){var o=i.match(Tp);return o?o[0]:""}(t);r!==n&&b.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var ye,It={is_supported:function(){return!!x},error:function(t){b.error("cookieStore error: "+t)},get:function(t){if(x){try{for(var e=t+"=",n=x.cookie.split(";").filter(function(o){return o.length}),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},parse:function(t){var e;try{e=JSON.parse(It.get(t))||{}}catch{}return e},set:function(t,e,n,r,i){if(x)try{var o="",s="",a=Ip(x.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),o="; expires="+c.toUTCString()}i&&(s="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&b.warn("cookieStore warning: large cookie, len="+l.length),x.cookie=l,l}catch{return}},remove:function(t,e){try{It.set(t,"",-1,e)}catch{return}}},Do=null,oe={is_supported:function(){if(!lt(Do))return Do;var t=!0;if(M(_))t=!1;else try{var e="__mplssupport__";oe.set(e,"xyz"),oe.get(e)!=='"xyz"'&&(t=!1),oe.remove(e)}catch{t=!1}return t||b.error("localStorage unsupported; falling back to cookie store"),Do=t,t},error:function(t){b.error("localStorage error: "+t)},get:function(t){try{return _?.localStorage.getItem(t)}catch(e){oe.error(e)}return null},parse:function(t){try{return JSON.parse(oe.get(t))||{}}catch{}return null},set:function(t,e){try{_?.localStorage.setItem(t,JSON.stringify(e))}catch(n){oe.error(n)}},remove:function(t){try{_?.localStorage.removeItem(t)}catch(e){oe.error(e)}}},kp=["distinct_id",Si,Er,bi],vr=w(w({},oe),{},{parse:function(t){try{var e={};try{e=It.parse(t)||{}}catch{}var n=me(e,JSON.parse(oe.get(t)||"{}"));return oe.set(t,n),n}catch{}return null},set:function(t,e,n,r,i){try{oe.set(t,e);var o={};kp.forEach(function(s){e[s]&&(o[s]=e[s])}),Object.keys(o).length&&It.set(t,o,n,r,i)}catch(s){oe.error(s)}},remove:function(t,e){try{_?.localStorage.removeItem(t),It.remove(t,e)}catch(n){oe.error(n)}}}),di={},wp={is_supported:function(){return!0},error:function(t){b.error("memoryStorage error: "+t)},get:function(t){return di[t]||null},parse:function(t){return di[t]||null},set:function(t,e){di[t]=e},remove:function(t){delete di[t]}},ln=null,Se={is_supported:function(){if(!lt(ln))return ln;if(ln=!0,M(_))ln=!1;else try{var t="__support__";Se.set(t,"xyz"),Se.get(t)!=='"xyz"'&&(ln=!1),Se.remove(t)}catch{ln=!1}return ln},error:function(t){b.error("sessionStorage error: ",t)},get:function(t){try{return _?.sessionStorage.getItem(t)}catch(e){Se.error(e)}return null},parse:function(t){try{return JSON.parse(Se.get(t))||null}catch{}return null},set:function(t,e){try{_?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Se.error(n)}},remove:function(t){try{_?.sessionStorage.removeItem(t)}catch(e){Se.error(e)}}},xp=["localhost","127.0.0.1"],lu=function(t){var e=x?.createElement("a");return M(e)?null:(e.href=t,e)},Rp=function(t,e){return!!function(n){try{new RegExp(n)}catch{return!1}return!0}(e)&&new RegExp(e).test(t)},Ap=function(t){var e,n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",i=[];return J(t,function(o,s){M(o)||M(s)||s==="undefined"||(e=encodeURIComponent(function(a){return a instanceof File}(o)?o.name:o.toString()),n=encodeURIComponent(s),i[i.length]=n+"="+e)}),i.join(r)},Oc=function(t,e){for(var n,r=((t.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===e){n=o;break}}if(!le(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch{b.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Ti=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Qe="Mobile",Ii="iOS",Tt="Android",xr="Tablet",du=Tt+" "+xr,pu="iPad",fu="Apple",mu=fu+" Watch",Pi="Safari",Bn="BlackBerry",gu="Samsung",hu=gu+"Browser",_u=gu+" Internet",fn="Chrome",Np=fn+" OS",vu=fn+" "+Ii,fs="Internet Explorer",yu=fs+" "+Qe,ms="Opera",Cp=ms+" Mini",gs="Edge",Su="Microsoft "+gs,Dn="Firefox",Eu=Dn+" "+Ii,Rr="Nintendo",Ar="PlayStation",Mn="Xbox",bu=Tt+" "+Qe,Tu=Qe+" "+Pi,yr="Windows",rs=yr+" Phone",Fc="Nokia",is="Ouya",Iu="Generic",Pp=Iu+" "+Qe.toLowerCase(),ku=Iu+" "+xr.toLowerCase(),os="Konqueror",Ne="(\\d+(\\.\\d+)?)",Mo=new RegExp("Version/"+Ne),Op=new RegExp(Mn,"i"),Fp=new RegExp(Ar+" \\w+","i"),Dp=new RegExp(Rr+" \\w+","i"),hs=new RegExp(Bn+"|PlayBook|BB10","i"),Mp={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Lp=function(t,e){return e&&j(e,fu)||function(n){return j(n,Pi)&&!j(n,fn)&&!j(n,Tt)}(t)},Dc=function(t,e){return e=e||"",j(t," OPR/")&&j(t,"Mini")?Cp:j(t," OPR/")?ms:hs.test(t)?Bn:j(t,"IE"+Qe)||j(t,"WPDesktop")?yu:j(t,hu)?_u:j(t,gs)||j(t,"Edg/")?Su:j(t,"FBIOS")?"Facebook "+Qe:j(t,fn)?fn:j(t,"CriOS")?vu:j(t,"UCWEB")||j(t,"UCBrowser")?"UC Browser":j(t,"FxiOS")?Eu:j(t,Tt)?bu:j(t.toLowerCase(),os.toLowerCase())?os:Lp(t,e)?j(t,Qe)?Tu:Pi:j(t,Dn)?Dn:j(t,"MSIE")||j(t,"Trident/")?fs:j(t,"Gecko")?Dn:""},Up=(E(ye={},yu,[new RegExp("rv:"+Ne)]),E(ye,Su,[new RegExp(gs+"?\\/"+Ne)]),E(ye,fn,[new RegExp(fn+"/"+Ne)]),E(ye,vu,[new RegExp("CriOS\\/"+Ne)]),E(ye,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Ne)]),E(ye,Pi,[Mo]),E(ye,Tu,[Mo]),E(ye,ms,[new RegExp("(Opera|OPR)\\/"+Ne)]),E(ye,Dn,[new RegExp(Dn+"\\/"+Ne)]),E(ye,Eu,[new RegExp("FxiOS\\/"+Ne)]),E(ye,os,[new RegExp("Konqueror[:/]?"+Ne,"i")]),E(ye,Bn,[new RegExp(Bn+" "+Ne),Mo]),E(ye,bu,[new RegExp("android\\s"+Ne)]),E(ye,_u,[new RegExp(hu+"\\/"+Ne)]),E(ye,fs,[new RegExp("(rv:|MSIE )"+Ne)]),E(ye,"Mozilla",[new RegExp("rv:"+Ne)]),ye),Mc=[[new RegExp(Mn+"; "+Mn+" (.*?)[);]","i"),function(t){return[Mn,t&&t[1]||""]}],[new RegExp(Rr,"i"),[Rr,""]],[new RegExp(Ar,"i"),[Ar,""]],[hs,[Bn,""]],[new RegExp(yr,"i"),function(t,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[rs,""];if(new RegExp(Qe).test(e)&&!/IEMobile\b/.test(e))return[yr+" "+Qe,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=Mp[r]||"";return/arm/i.test(e)&&(i="RT"),[yr,i]}return[yr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(t){if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Ii,e.join(".")]}return[Ii,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(t){var e="";return t&&t.length>=3&&(e=M(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Tt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Tt+")","i"),function(t){if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Tt,e.join(".")]}return[Tt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(t){var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Np,""]],[/Linux|debian/i,["Linux",""]]],Lc=function(t){return Dp.test(t)?Rr:Fp.test(t)?Ar:Op.test(t)?Mn:new RegExp(is,"i").test(t)?is:new RegExp("("+rs+"|WPDesktop)","i").test(t)?rs:/iPad/.test(t)?pu:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?mu:hs.test(t)?Bn:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Fc,"i").test(t)?Fc:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Qe).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Tt:du:Tt:new RegExp("(pda|"+Qe+")","i").test(t)?Pp:new RegExp(xr,"i").test(t)&&!new RegExp(xr+" pc","i").test(t)?ku:""},pi="https?://(.*)",Bp=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"],ge={campaignParams:function(t){var e=Bp.concat(t||[]),n={};return J(e,function(r){var i=x?Oc(x.URL,r):"";i.length&&(n[r]=i)}),n},searchEngine:function(){var t=x?.referrer;return t?t.search(pi+"google.([^/?]*)")===0?"google":t.search(pi+"bing.com")===0?"bing":t.search(pi+"yahoo.com")===0?"yahoo":t.search(pi+"duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var t=ge.searchEngine(),e=t!="yahoo"?"q":"p",n={};if(!lt(t)){n.$search_engine=t;var r=x?Oc(x.referrer,e):"";r.length&&(n.ph_keyword=r)}return n},browser:Dc,browserVersion:function(t,e){var n=Dc(t,e),r=Up[n];if(M(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(t){for(var e=0;e<Mc.length;e++){var n=Ce(Mc[e],2),r=n[0],i=n[1],o=r.exec(t),s=o&&(ut(i)?i(o,t):i);if(s)return s}return["",""]},device:Lc,deviceType:function(t){var e=Lc(t);return e===pu||e===du||e==="Kobo"||e==="Kindle Fire"||e===ku?xr:e===Rr||e===Mn||e===Ar||e===is?"Console":e===mu?"Wearable":e?Qe:"Desktop"},referrer:function(){return x?.referrer||"$direct"},referringDomain:function(){var t;return x!=null&&x.referrer&&((t=lu(x.referrer))===null||t===void 0?void 0:t.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},properties:function(){if(!re)return{};var t=Ce(ge.os(re),2),e=t[0],n=t[1];return me(Yo({$os:e,$os_version:n,$browser:ge.browser(re,navigator.vendor),$device:ge.device(re),$device_type:ge.deviceType(re)}),{$current_url:Xe?.href,$host:Xe?.host,$pathname:Xe?.pathname,$raw_user_agent:re.length>1e3?re.substring(0,997)+"...":re,$browser_version:ge.browserVersion(re,navigator.vendor),$browser_language:ge.browserLanguage(),$screen_height:_?.screen.height,$screen_width:_?.screen.width,$viewport_height:_?.innerHeight,$viewport_width:_?.innerWidth,$lib:"web",$lib_version:dn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:au()/1e3})},people_properties:function(){if(!re)return{};var t=Ce(ge.os(re),2),e=t[0],n=t[1];return me(Yo({$os:e,$os_version:n,$browser:ge.browser(re,navigator.vendor)}),{$browser_version:ge.browserVersion(re,navigator.vendor)})}},$p=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Lo=function(){function t(e){Q(this,t),this.config=e,this.props={},this.campaign_params_saved=!1,this.name=function(n){var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"}(e),this.storage=this.buildStorage(e),this.load(),this.update_config(e,e),this.save()}return Z(t,[{key:"buildStorage",value:function(e){$p.indexOf(e.persistence.toLowerCase())===-1&&(b.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&oe.is_supported()?oe:n==="localstorage+cookie"&&vr.is_supported()?vr:n==="sessionstorage"&&Se.is_supported()?Se:n==="memory"?wp:n==="cookie"?It:vr.is_supported()?vr:It}},{key:"properties",value:function(){var e={};return J(this.props,function(n,r){if(r===Pn&&bt(n))for(var i=Object.keys(n),o=0;o<i.length;o++)e["$feature/".concat(i[o])]=n[i[o]];else a=r,c=!1,(lt(s=hp)?c:yc&&s.indexOf===yc?s.indexOf(a)!=-1:(J(s,function(l){if(c||(c=l===a))return yi}),c))||(e[r]=n);var s,a,c}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=me({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,n,r){var i=this;if(bt(e)){M(n)&&(n="None"),this.expire_days=M(r)?this.default_expiry:r;var o=!1;if(J(e,function(s,a){i.props.hasOwnProperty(a)&&i.props[a]!==n||(i.props[a]=s,o=!0)}),o)return this.save(),!0}return!1}},{key:"register",value:function(e,n){var r=this;if(bt(e)){this.expire_days=M(n)?this.default_expiry:n;var i=!1;if(J(e,function(o,s){e.hasOwnProperty(s)&&r.props[s]!==o&&(r.props[s]=o,i=!0)}),i)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(ge.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"set_initial_campaign_params",value:function(){this.register_once(E({},es,ge.campaignParams(this.config.custom_campaign_params)),void 0)}},{key:"update_search_keyword",value:function(){this.register(ge.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(ge.referrerInfo())}},{key:"set_initial_referrer_info",value:function(){this.register_once(E({},ts,ge.referrerInfo()),void 0)}},{key:"get_referrer_info",value:function(){return Yo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,n={};return J([ts,es],function(r){var i=e.props[r];i&&J(i,function(o,s){var a;n["$initial_"+(a=s,a.replace(/^\$/,""))]=o})}),n}},{key:"safe_merge",value:function(e){return J(this.props,function(n,r){r in e||(e[r]=n)}),e}},{key:"update_config",value:function(e,n){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var r=this.buildStorage(e),i=this.props;this.clear(),this.storage=r,this.props=i,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,n){var r=this.props[_r]||{};r[e]=n,this.props[_r]=r,this.save()}},{key:"remove_event_timer",value:function(e){var n=(this.props[_r]||{})[e];return M(n)||(delete this.props[_r][e],this.save()),n}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,n){this.props[e]=n,this.save()}}]),t}(),Hp=2,qp=4,Gp=Z(function t(e){var n,r,i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Q(this,t),E(this,"bucketSize",100),E(this,"refillRate",10),E(this,"mutationBuckets",{}),E(this,"loggedTracker",{}),E(this,"refillBuckets",function(){Object.keys(i.mutationBuckets).forEach(function(s){i.mutationBuckets[s]=i.mutationBuckets[s]+i.refillRate,i.mutationBuckets[s]>=i.bucketSize&&delete i.mutationBuckets[s]})}),E(this,"getNodeOrRelevantParent",function(s){var a=i.rrweb.mirror.getNode(s);if(a?.nodeName!=="svg"&&a instanceof Element){var c=a.closest("svg");if(c)return[i.rrweb.mirror.getId(c),c]}return[s,a]}),E(this,"numberOfChanges",function(s){var a,c,l,u,d,f,m,h;return((a=(c=s.removes)===null||c===void 0?void 0:c.length)!==null&&a!==void 0?a:0)+((l=(u=s.attributes)===null||u===void 0?void 0:u.length)!==null&&l!==void 0?l:0)+((d=(f=s.texts)===null||f===void 0?void 0:f.length)!==null&&d!==void 0?d:0)+((m=(h=s.adds)===null||h===void 0?void 0:h.length)!==null&&m!==void 0?m:0)}),E(this,"throttleMutations",function(s){if(s.type!==3||s.data.source!==0)return s;var a=s.data,c=i.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(u){var d,f,m,h=Ce(i.getNodeOrRelevantParent(u.id),2),v=h[0],T=h[1];return i.mutationBuckets[v]===0?!1:(i.mutationBuckets[v]=(d=i.mutationBuckets[v])!==null&&d!==void 0?d:i.bucketSize,i.mutationBuckets[v]=Math.max(i.mutationBuckets[v]-1,0),i.mutationBuckets[v]===0&&(i.loggedTracker[v]||(i.loggedTracker[v]=!0,(f=(m=i.options).onBlockedNode)===null||f===void 0||f.call(m,v,T))),u)}));var l=i.numberOfChanges(a);return l!==0||c===l?s:void 0}),this.rrweb=e,this.options=o,this.refillRate=(n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,this.bucketSize=(r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,setInterval(function(){i.refillBuckets()},1e3)}),_i=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}(_i||{});function _s(t){return t?Ci(t).split(/\s+/):[]}function ki(t){var e="";switch(kr(t.className)){case"string":e=t.className;break;case"object":e=("baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return _s(e)}function wu(t){return Bt(t)?null:Ci(t).split(/(\s+)/).filter(function(e){return Ln(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function wi(t){var e="";return as(t)&&!Nu(t)&&t.childNodes&&t.childNodes.length&&J(t.childNodes,function(n){var r;xu(n)&&n.textContent&&(e+=(r=wu(n.textContent))!==null&&r!==void 0?r:"")}),Ci(e)}function vs(t){return!!t&&t.nodeType===1}function Zt(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function xu(t){return!!t&&t.nodeType===3}function Ru(t){return!!t&&t.nodeType===11}var ss=["a","button","form","input","select","textarea","label"];function Au(t){var e=t.parentNode;return!(!e||!vs(e))&&e}function jp(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!_||!t||Zt(t,"html")||!vs(t))return!1;if(n!=null&&n.url_allowlist){var o=_.location.href,s=n.url_allowlist;if(s&&!s.some(function(v){return o.match(v)}))return!1}if(n!=null&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some(function(v){return e.type===v}))return!1}for(var c=!1,l=[t],u=!0,d=t;d.parentNode&&!Zt(d,"body");)if(Ru(d.parentNode))l.push(d.parentNode.host),d=d.parentNode.host;else{if(!(u=Au(d)))break;if(r||ss.indexOf(u.tagName.toLowerCase())>-1)c=!0;else{var f=_.getComputedStyle(u);f&&f.getPropertyValue("cursor")==="pointer"&&(c=!0)}l.push(u),d=u}if(!function(v,T){var F=T?.element_allowlist;if(M(F))return!0;var L,N=dt(v);try{var $=function(){var I=L.value;if(F.some(function(B){return I.tagName.toLowerCase()===B}))return{v:!0}};for(N.s();!(L=N.n()).done;){var H=$();if(kr(H)==="object")return H.v}}catch(I){N.e(I)}finally{N.f()}return!1}(l,n)||!function(v,T){var F=T?.css_selector_allowlist;if(M(F))return!0;var L,N=dt(v);try{var $=function(){var I=L.value;if(F.some(function(B){return I.matches(B)}))return{v:!0}};for(N.s();!(L=N.n()).done;){var H=$();if(kr(H)==="object")return H.v}}catch(I){N.e(I)}finally{N.f()}return!1}(l,n))return!1;var m=_.getComputedStyle(t);if(m&&m.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var h=t.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return c?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(ss.indexOf(h)>-1||t.getAttribute("contenteditable")==="true")}}function as(t){for(var e=t;e.parentNode&&!Zt(e,"body");e=e.parentNode){var n=ki(e);if(j(n,"ph-sensitive")||j(n,"ph-no-capture"))return!1}if(j(ki(t),"ph-include"))return!0;var r=t.type||"";if(be(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(be(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function Nu(t){return!!(Zt(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Zt(t,"select")||Zt(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Cu="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Wp=new RegExp("^(?:".concat(Cu,")$")),zp=new RegExp(Cu),Pu="\\d{3}-?\\d{2}-?\\d{4}",Yp=new RegExp("^(".concat(Pu,")$")),Vp=new RegExp("(".concat(Pu,")"));function Ln(t){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Bt(t)||be(t)&&(t=Ci(t),(e?Wp:zp).test((t||"").replace(/[- ]/g,""))||(e?Yp:Vp).test(t)))}function Uc(t){var e=wi(t);return Ln(e="".concat(e," ").concat(Ou(t)).trim())?e:""}function Ou(t){var e="";return t&&t.childNodes&&t.childNodes.length&&J(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var i=wi(n);e="".concat(e," ").concat(i).trim(),n.childNodes&&n.childNodes.length&&(e="".concat(e," ").concat(Ou(n)).trim())}catch(o){b.error(o)}}),e}function Jp(t){return function(e){var n=e.map(function(r){var i,o,s="";if(r.tag_name&&(s+=r.tag_name),r.attr_class){r.attr_class.sort();var a,c=dt(r.attr_class);try{for(c.s();!(a=c.n()).done;){var l=a.value;s+=".".concat(l.replace(/"/g,""))}}catch(f){c.e(f)}finally{c.f()}}var u=w(w(w(w({},r.text?{text:r.text}:{}),{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{}),r.attr_id?{attr_id:r.attr_id}:{}),r.attributes),d={};return hi(u).sort(function(f,m){var h=Ce(f,1)[0],v=Ce(m,1)[0];return h.localeCompare(v)}).forEach(function(f){var m=Ce(f,2),h=m[0],v=m[1];return d[Bc(h.toString())]=Bc(v.toString())}),s+=":",s+=hi(u).map(function(f){var m=Ce(f,2),h=m[0],v=m[1];return"".concat(h,'="').concat(v,'"')}).join("")});return n.join(";")}(function(e){return e.map(function(n){var r,i,o={text:(r=n.$el_text)===null||r===void 0?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)===null||i===void 0?void 0:i.slice(0,2048),attr_class:Kp(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return hi(n).filter(function(s){return Ce(s,1)[0].indexOf("attr__")===0}).forEach(function(s){var a=Ce(s,2),c=a[0],l=a[1];return o.attributes[c]=l}),o})}(t))}function Bc(t){return t.replace(/"|\\"/g,'\\"')}function Kp(t){var e=t.attr__class;return e?le(e)?e:_s(e):void 0}var cs="[SessionRecording]",us="redacted",Uo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(t){return t},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},Xp=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Qp=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Zp=["/s/","/e/","/i/"];function $c(t,e,n,r){if(Bt(t))return t;var i=e?.["content-length"]||function(o){return new Blob([o]).size}(t);return be(i)&&(i=parseInt(i)),i>n?cs+" ".concat(r," body too large to record (").concat(i," bytes)"):t}function Hc(t,e){if(Bt(t))return t;var n=t;return Ln(n,!1)||(n=cs+" "+e+" body "+us),J(Qp,function(r){var i,o;(i=n)!==null&&i!==void 0&&i.length&&((o=n)===null||o===void 0?void 0:o.indexOf(r))!==-1&&(n=cs+" "+e+" body "+us+" as might contain: "+r)}),n}var ef=function(t,e){var n,r,i,o={payloadSizeLimitBytes:Uo.payloadSizeLimitBytes,performanceEntryTypeToObserve:Un(Uo.performanceEntryTypeToObserve)},s=t.session_recording.recordHeaders!==!1&&e.recordHeaders,a=t.session_recording.recordBody!==!1&&e.recordBody,c=t.capture_performance!==!1&&e.recordPerformance,l=(n=o,i=Math.min(1e6,(r=n.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),function(f){return f!=null&&f.requestBody&&(f.requestBody=$c(f.requestBody,f.requestHeaders,i,"Request")),f!=null&&f.responseBody&&(f.responseBody=$c(f.responseBody,f.responseHeaders,i,"Response")),f}),u=function(f){return l(function(v){var T=lu(v.name);if(!(T&&T.pathname&&Zp.some(function(F){return T.pathname.indexOf(F)===0})))return v}((h=(m=f).requestHeaders,Bt(h)||J(Object.keys(h??{}),function(v){Xp.includes(v.toLowerCase())&&(h[v]=us)}),m)));var m,h},d=ut(t.session_recording.maskNetworkRequestFn);return d&&ut(t.session_recording.maskCapturedNetworkRequestFn)&&b.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=function(f){var m=t.session_recording.maskNetworkRequestFn({url:f.name});return w(w({},f),{},{name:m?.url})}),o.maskRequestFn=ut(t.session_recording.maskCapturedNetworkRequestFn)?function(f){var m,h,v,T=u(f);return T&&(m=(h=(v=t.session_recording).maskCapturedNetworkRequestFn)===null||h===void 0?void 0:h.call(v,T))!==null&&m!==void 0?m:void 0}:function(f){return function(m){if(!M(m))return m.requestBody=Hc(m.requestBody,"Request"),m.responseBody=Hc(m.responseBody,"Response"),m}(u(f))},w(w(w({},Uo),o),{},{recordHeaders:s,recordBody:a,recordPerformance:c,recordInitialRequests:c})},tf="__ph_opt_in_out_";function nf(t,e){Mu(!0,t,e)}function rf(t,e){Mu(!1,t,e)}function of(t,e){return Du(t,e)==="1"}function Fu(t,e){return!!function(n){if(n&&n.respectDnt){var r=n&&n.window||_,i=r?.navigator,o=!1;return J([i?.doNotTrack,i.msDoNotTrack,r.doNotTrack],function(s){j([!0,1,"1","yes"],s)&&(o=!0)}),o}return!1}(e)||Du(t,e)==="0"}function sf(t,e){ys(e=e||{}).remove(Ss(t,e),!!e.crossSubdomainCookie)}function ys(t){return(t=t||{}).persistenceType==="localStorage"?oe:t.persistenceType==="localStorage+cookie"?vr:It}function Ss(t,e){return((e=e||{}).persistencePrefix||tf)+t}function Du(t,e){return ys(e).get(Ss(t,e))}function Mu(t,e,n){be(e)&&e.length?(ys(n=n||{}).set(Ss(e,n),t?1:0,at(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&t&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):b.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token")}function Lu(t){var e=!1;try{var n=t.config.token,r=t.config.respect_dnt,i=t.config.opt_out_capturing_persistence_type,o=t.config.opt_out_capturing_cookie_prefix||void 0,s=t.config.window;n&&(e=Fu(n,{respectDnt:r,persistenceType:i,persistencePrefix:o,window:s}))}catch(a){b.error("Unexpected error when checking capturing opt-out status: "+a)}return e}var Et,Uu=3e5,qc=Uu;(function(t){t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(Et||(Et={}));var Lt,af=[Et.MouseMove,Et.MouseInteraction,Et.Scroll,Et.ViewportResize,Et.Input,Et.TouchMove,Et.MediaInteraction,Et.Drag],Gc=function(t){return{rrwebMethod:t,enqueuedAt:Date.now(),attempt:1}},We="[SessionRecording]",cf=function(){function t(e){var n=this;if(Q(this,t),E(this,"queuedRRWebEvents",[]),E(this,"isIdle",!1),E(this,"_linkedFlagSeen",!1),E(this,"_lastActivityTimestamp",Date.now()),E(this,"windowId",null),E(this,"sessionId",null),E(this,"_linkedFlag",null),E(this,"_forceAllowLocalhostNetworkCapture",!1),E(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,_?.addEventListener("beforeunload",function(){n._flushBuffer()}),_?.addEventListener("offline",function(){n._tryAddCustomEvent("browser offline",{})}),_?.addEventListener("online",function(){n._tryAddCustomEvent("browser online",{})}),_?.addEventListener("visibilitychange",function(){if(x!=null&&x.visibilityState){var r="window "+x.visibilityState;n._tryAddCustomEvent(r,{})}}),!this.instance.sessionManager)throw b.error(We+" started without valid sessionManager"),new Error(We+" started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer(),this._setupSampling()}return Z(t,[{key:"rrwebRecord",get:function(){var e;return Pe==null||(e=Pe.rrweb)===null||e===void 0?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw b.error(We+" started without valid sessionManager"),new Error(We+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){var e=this.instance.get_property(Er);return gi(e)?e:null}},{key:"sessionDuration",get:function(){var e,n,r=(e=this.buffer)===null||e===void 0?void 0:e.data[((n=this.buffer)===null||n===void 0?void 0:n.data.length)-1],i=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return r?r.timestamp-i:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Jo),n=!this.instance.config.disable_session_recording;return _&&e&&n}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Ic),n=this.instance.config.enable_recording_console_log;return n??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(wc);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,n,r=this.instance.get_property(kc),i={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.recordBody},o=i?.recordHeaders||r?.recordHeaders,s=i?.recordBody||r?.recordBody,a=this.instance.config.capture_performance||r?.capturePerformance;return o||s||a?{recordHeaders:o,recordBody:s,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(xc);return at(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(Rc);return at(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?Bt(this._linkedFlag)||this._linkedFlagSeen?gi(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),b.info(We+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,b.info(We+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var n,r=this.sessionId!==e,i=this.sampleRate;if(at(i)){var o,s=this.isSampled,a=r||!gi(s);a?o=Math.random()<i:o=s,!o&&a&&b.warn(We+" Sample rate (".concat(i,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i}),(n=this.instance.persistence)===null||n===void 0||n.register(E({},Er,o))}else{var c;(c=this.instance.persistence)===null||c===void 0||c.register(E({},Er,null))}}},{key:"afterDecideResponse",value:function(e){var n,r,i,o=this;if(this._persistDecideResponse(e),this._linkedFlag=((n=e.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(r=e.sessionRecording)!==null&&r!==void 0&&r.endpoint&&(this._endpoint=(i=e.sessionRecording)===null||i===void 0?void 0:i.endpoint),this._setupSampling(),!Bt(this._linkedFlag)){var s=be(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=be(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(c,l){var u=bt(l)&&s in l,d=a?l[s]===a:u;if(d){var f={linkedFlag:s,linkedVariant:a},m="linked flag matched";b.info(We+" "+m,f),o._tryAddCustomEvent(m,f)}o._linkedFlagSeen=d})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;at(this.sampleRate)&&lt(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(n){e.makeSamplingDecision(n)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var n=this.instance.persistence,r=function(){var i,o,s,a,c,l,u,d,f=(i=e.sessionRecording)===null||i===void 0?void 0:i.sampleRate,m=Bt(f)?null:parseFloat(f),h=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;n.register((E(d={},Jo,!!e.sessionRecording),E(d,Ic,(s=e.sessionRecording)===null||s===void 0?void 0:s.consoleLogRecordingEnabled),E(d,kc,w({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),E(d,wc,{enabled:(c=e.sessionRecording)===null||c===void 0?void 0:c.recordCanvas,fps:(l=e.sessionRecording)===null||l===void 0?void 0:l.canvasFps,quality:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasQuality}),E(d,xc,m),E(d,Rc,M(h)?null:h),d))};r(),this.sessionManager.onSessionId(r)}}},{key:"log",value:function(e){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(e)]}},timestamp:au()})}},{key:"_startCapture",value:function(){var e=this;M(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||Lu(this.instance)||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():wr(this.instance.requestRouter.endpointFor("assets","/static/recorder.js?v=".concat(dn.LIB_VERSION)),function(n){if(n)return b.error(We+" could not load recorder.js",n);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var n;return e.type===3&&af.indexOf((n=e.data)===null||n===void 0?void 0:n.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var n=this.isInteractiveEvent(e);n||this.isIdle||e.timestamp-this._lastActivityTimestamp>qc&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:qc}));var r=!1;if(n&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)),!this.isIdle){var i=this.sessionManager.checkAndGetSessionAndWindowId(!n,e.timestamp),o=i.windowId,s=i.sessionId,a=this.sessionId!==s,c=this.windowId!==o;this.windowId=o,this.sessionId=s,(r||[Hp,qp].indexOf(e.type)===-1&&(c||a))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(n){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):b.warn(We+" could not emit queued rrweb event.",n,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,n){var r=this;return this._tryRRWebMethod(Gc(function(){return r.rrwebRecord.addCustomEvent(e,n)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Gc(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},i=this.instance.config.session_recording,o=0,s=Object.entries(i||{});o<s.length;o++){var a=Ce(s[o],2),c=a[0],l=a[1];c in r&&(r[c]=l)}if(this.canvasRecording&&this.canvasRecording.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.canvasRecording.fps},r.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new Gp(this.rrwebRecord,{onBlockedNode:function(d,f){var m="Too many mutations on node '".concat(d,"'. Rate limiting. This could be due to SVG animations or something similar");b.info(m,{node:f}),n.log(We+" "+m,"warn")}}),this._scheduleFullSnapshot();var u=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(w({emit:function(d){n.onRRwebEmit(d)},plugins:u},r)),this.instance._addCaptureHook(function(d){try{if(d==="$pageview"){var f=_?n._maskUrl(_.location.href):"";if(!f)return;n._tryAddCustomEvent("$pageview",{href:f}),n._tryTakeFullSnapshot()}}catch(m){b.error("Could not add $pageview to rrweb session",m)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:u.map(function(d){return d?.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else b.error(We+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},Uu)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return Pe.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(Pe.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&ut(Pe.getRecordNetworkPlugin)&&(!xp.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(Pe.getRecordNetworkPlugin(ef(this.instance.config,this.networkPayloadCapture))):b.info(We+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&bt(e)){if(e.type===_i.Meta){var n=this._maskUrl(e.data.href);if(this._lastHref=n,!n)return;e.data.href=n}else this._pageViewFallBack();e.type===_i.FullSnapshot&&this._scheduleFullSnapshot();var r=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(r){var i=function(a){var c=a;if(c&&bt(c)&&c.type===6&&bt(c.data)&&c.data.plugin==="rrweb/console@1"){c.data.payload.payload.length>10&&(c.data.payload.payload=c.data.payload.payload.slice(0,10),c.data.payload.payload.push("...[truncated]"));for(var l=[],u=0;u<c.data.payload.payload.length;u++)c.data.payload.payload[u]&&c.data.payload.payload[u].length>2e3?l.push(c.data.payload.payload[u].slice(0,2e3)+"...[truncated]"):l.push(c.data.payload.payload[u]);return c.data.payload.payload=l,a}return a}(r),o=JSON.stringify(i).length;if(this._updateWindowAndSessionIds(i),!this.isIdle||i.type===_i.Custom){var s={$snapshot_bytes:o,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(s):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&_){var e=this._maskUrl(_.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var n=Un(this.queuedRRWebEvents);this.queuedRRWebEvents=[],n.forEach(function(r){Date.now()-r.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:r.enqueuedAt,attempt:r.attempt,queueLength:n.length}):e._tryRRWebMethod(r)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:r.enqueuedAt,attempt:r.attempt,queueLength:n.length})})}}},{key:"_maskUrl",value:function(e){var n=this.instance.config.session_recording;if(n.maskNetworkRequestFn){var r,i={url:e};return(r=i=n.maskNetworkRequestFn(i))===null||r===void 0?void 0:r.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var n=this.minimumDuration,r=this.sessionDuration,i=at(r)&&r>=0,o=at(n)&&i&&r<n;return this.status==="buffering"||o?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer||this.clearBuffer()):this.buffer&&this.buffer.data.length!==0?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var n,r=this,i=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+i>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),lt(this.buffer.sessionId)&&!lt(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){r._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),t}(),uf=function(){function t(e){Q(this,t),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Z(t,[{key:"call",value:function(){var e=this,n={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(On),group_properties:this.instance.get_property(Xt),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:n,compression:this.instance.config.disable_compression?void 0:ct.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(r){return e.parseDecideResponse(r.json)}})}},{key:"parseDecideResponse",value:function(e){var n=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var r=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},r),r)b.error("Failed to fetch feature flags from PostHog.");else{if(!x||!x.body)return b.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){n.parseDecideResponse(e)},500);this.instance._afterDecideResponse(e);var i=_?.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&M(i)&&wr(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),function(c){if(c)return b.error("Could not load exception autocapture script",c);_.extendPostHogWithExceptionAutocapture(n.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var o,s=dt(e.siteApps);try{var a=function(){var c=o.value,l=c.id,u=c.url,d=n.instance.requestRouter.endpointFor("api",u);Pe["__$$ph_site_app_".concat(l)]=n.instance,wr(d,function(f){f&&b.error("Error while initializing PostHog app with config id ".concat(l),f)})};for(s.s();!(o=s.n()).done;)a()}catch(c){s.e(c)}finally{s.f()}}else e.siteApps.length>0&&b.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),t}(),lf=_!=null&&_.location?Ti(_.location.hash,"__posthog")||Ti(location.hash,"state"):null,jc="_postHogToolbarParams";(function(t){t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED"})(Lt||(Lt={}));var df=function(){function t(e){Q(this,t),this.instance=e}return Z(t,[{key:"setToolbarState",value:function(e){Pe.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=Pe.ph_toolbar_state)!==null&&e!==void 0?e:Lt.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!_||!x)return!1;r=(e=r)!==null&&e!==void 0?e:_.location,o=(n=o)!==null&&n!==void 0?n:_.history;try{if(!i){try{_.localStorage.setItem("test","test"),_.localStorage.removeItem("test")}catch{return!1}i=_?.localStorage}var s,a=lf||Ti(r.hash,"__posthog")||Ti(r.hash,"state"),c=a?bc(function(){return JSON.parse(atob(decodeURIComponent(a)))})||bc(function(){return JSON.parse(decodeURIComponent(a))}):null;return c&&c.action==="ph_authorize"?((s=c).source="url",s&&Object.keys(s).length>0&&(c.desiredHash?r.hash=c.desiredHash:o?o.replaceState(o.state,"",r.pathname+r.search):r.hash="")):((s=JSON.parse(i.getItem(jc)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(e){(Pe.ph_load_toolbar||Pe.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var n=this,r=!(x==null||!x.getElementById(ns));if(!_||r)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,o=w(w({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(_.localStorage.setItem(jc,JSON.stringify(w(w({},o),{},{source:void 0}))),this.getToolbarState()===Lt.LOADED)this._callLoadToolbar(o);else if(this.getToolbarState()===Lt.UNINITIALIZED){this.setToolbarState(Lt.LOADING);var s=3e5,a=Math.floor(Date.now()/s)*s;wr(this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(a)),function(c){if(c)return b.error("Failed to load toolbar",c),void n.setToolbarState(Lt.UNINITIALIZED);n.setToolbarState(Lt.LOADED),n._callLoadToolbar(o)}),Ut(_,"turbolinks:load",function(){n.setToolbarState(Lt.UNINITIALIZED),n.loadToolbar(o)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,n,r)}}]),t}(),pf=function(){function t(e){Q(this,t),E(this,"isPaused",!0),E(this,"queue",[]),E(this,"flushTimeoutMs",3e3),this.sendRequest=e}return Z(t,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},r=Object.values(n);[].concat(Un(r.filter(function(i){return i.url.indexOf("/e")===0})),Un(r.filter(function(i){return i.url.indexOf("/e")!==0}))).map(function(i){e.sendRequest(w(w({},i),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var n=e.formatQueue(),r=function(o){var s=n[o],a=new Date().getTime();s.data&&le(s.data)&&J(s.data,function(c){c.offset=Math.abs(c.timestamp-a),delete c.timestamp}),e.sendRequest(s)};for(var i in n)r(i)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return J(this.queue,function(n){var r,i=n,o=(i?i.batchKey:null)||i.url;M(e[o])&&(e[o]=w(w({},i),{},{data:[]})),(r=e[o].data)===null||r===void 0||r.push(i.data)}),this.queue=[],e}}]),t}(),ze=Uint8Array,Oe=Uint16Array,$n=Uint32Array,Es=new ze([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),bs=new ze([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Wc=new ze([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bu=function(t,e){for(var n=new Oe(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new $n(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},$u=Bu(Es,2),ff=$u[0],ls=$u[1];ff[28]=258,ls[258]=28;for(ds=Bu(bs,0)[1],xi=new Oe(32768),K=0;K<32768;++K)Kt=(43690&K)>>>1|(21845&K)<<1,Kt=(61680&(Kt=(52428&Kt)>>>2|(13107&Kt)<<2))>>>4|(3855&Kt)<<4,xi[K]=((65280&Kt)>>>8|(255&Kt)<<8)>>>1;var Kt,ds,xi,K,br=function(t,e,n){for(var r=t.length,i=0,o=new Oe(e);i<r;++i)++o[t[i]-1];var s,a=new Oe(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new Oe(1<<e);var c=15-e;for(i=0;i<r;++i)if(t[i])for(var l=i<<4|t[i],u=e-t[i],d=a[t[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[xi[d]>>>c]=l}else for(s=new Oe(r),i=0;i<r;++i)s[i]=xi[a[t[i]-1]++]>>>15-t[i];return s},mn=new ze(288);for(K=0;K<144;++K)mn[K]=8;for(K=144;K<256;++K)mn[K]=9;for(K=256;K<280;++K)mn[K]=7;for(K=280;K<288;++K)mn[K]=8;var Ri=new ze(32);for(K=0;K<32;++K)Ri[K]=5;var mf=br(mn,9,0),gf=br(Ri,5,0),Hu=function(t){return(t/8>>0)+(7&t&&1)},qu=function(t,e,n){(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Oe?Oe:t instanceof $n?$n:ze)(n-e);return r.set(t.subarray(e,n)),r},Dt=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},mr=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Bo=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return[new ze(0),0];if(i==1){var s=new ze(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(H,I){return H.f-I.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var m=new Oe(f+1),h=hf(n[u-1],m,0);if(h>e){r=0;var v=0,T=h-e,F=1<<T;for(o.sort(function(H,I){return m[I.s]-m[H.s]||H.f-I.f});r<i;++r){var L=o[r].s;if(!(m[L]>e))break;v+=F-(1<<h-m[L]),m[L]=e}for(v>>>=T;v>0;){var N=o[r].s;m[N]<e?v-=1<<e-m[N]++-1:++r}for(;r>=0&&v;--r){var $=o[r].s;m[$]==e&&(--m[$],++v)}h=e}return[new ze(m),h]},hf=function t(e,n,r){return e.s==-1?Math.max(t(e.l,n,r+1),t(e.r,n,r+1)):n[e.s]=r},zc=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Oe(++e),r=0,i=t[0],o=1,s=function(c){n[r++]=c},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[n.subarray(0,r),e]},gr=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},vi=function(t,e,n){var r=n.length,i=Hu(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<r;++o)t[i+o+4]=n[o];return 8*(i+4+r)},Yc=function(t,e,n,r,i,o,s,a,c,l,u){Dt(e,u++,n),++i[256];for(var d=Bo(i,15),f=d[0],m=d[1],h=Bo(o,15),v=h[0],T=h[1],F=zc(f),L=F[0],N=F[1],$=zc(v),H=$[0],I=$[1],B=new Oe(19),U=0;U<L.length;++U)B[31&L[U]]++;for(U=0;U<H.length;++U)B[31&H[U]]++;for(var fe=Bo(B,7),ue=fe[0],$e=fe[1],Y=19;Y>4&&!ue[Wc[Y-1]];--Y);var De,xe,Re,He,qe=l+5<<3,Ee=gr(i,mn)+gr(o,Ri)+s,Ge=gr(i,f)+gr(o,v)+s+14+3*Y+gr(B,ue)+(2*B[16]+3*B[17]+7*B[18]);if(qe<=Ee&&qe<=Ge)return vi(e,u,t.subarray(c,c+l));if(Dt(e,u,1+(Ge<Ee)),u+=2,Ge<Ee){De=br(f,m,0),xe=f,Re=br(v,T,0),He=v;var Yt=br(ue,$e,0);for(Dt(e,u,N-257),Dt(e,u+5,I-1),Dt(e,u+10,Y-4),u+=14,U=0;U<Y;++U)Dt(e,u+3*U,ue[Wc[U]]);u+=3*Y;for(var Rn=[L,H],Ae=0;Ae<2;++Ae){var Ke=Rn[Ae];for(U=0;U<Ke.length;++U){var je=31&Ke[U];Dt(e,u,Yt[je]),u+=ue[je],je>15&&(Dt(e,u,Ke[U]>>>5&127),u+=Ke[U]>>>12)}}}else De=mf,xe=mn,Re=gf,He=Ri;for(U=0;U<a;++U)if(r[U]>255){je=r[U]>>>18&31,mr(e,u,De[je+257]),u+=xe[je+257],je>7&&(Dt(e,u,r[U]>>>23&31),u+=Es[je]);var An=31&r[U];mr(e,u,Re[An]),u+=He[An],An>3&&(mr(e,u,r[U]>>>5&8191),u+=bs[An])}else mr(e,u,De[r[U]]),u+=xe[r[U]];return mr(e,u,De[256]),u+xe[256]},_f=new $n([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),vf=new ze(0),yf=function(){for(var t=new $n(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),Sf=function(t,e,n,r,i){return function(o,s,a,c,l,u){var d=o.length,f=new ze(c+d+5*(1+Math.floor(d/7e3))+l),m=f.subarray(c,f.length-l),h=0;if(!s||d<8)for(var v=0;v<=d;v+=65535){var T=v+65535;T<d?h=vi(m,h,o.subarray(v,T)):(m[v]=u,h=vi(m,h,o.subarray(v,d)))}else{for(var F=_f[s-1],L=F>>>13,N=8191&F,$=(1<<a)-1,H=new Oe(32768),I=new Oe($+1),B=Math.ceil(a/3),U=2*B,fe=function(Po){return(o[Po]^o[Po+1]<<B^o[Po+2]<<U)&$},ue=new $n(25e3),$e=new Oe(288),Y=new Oe(32),De=0,xe=0,Re=(v=0,0),He=0,qe=0;v<d;++v){var Ee=fe(v),Ge=32767&v,Yt=I[Ee];if(H[Ge]=Yt,I[Ee]=Ge,He<=v){var Rn=d-v;if((De>7e3||Re>24576)&&Rn>423){h=Yc(o,m,0,ue,$e,Y,xe,Re,qe,v-qe,h),Re=De=xe=0,qe=v;for(var Ae=0;Ae<286;++Ae)$e[Ae]=0;for(Ae=0;Ae<30;++Ae)Y[Ae]=0}var Ke=2,je=0,An=N,Vt=Ge-Yt&32767;if(Rn>2&&Ee==fe(v-Vt))for(var sp=Math.min(L,Rn)-1,ap=Math.min(32767,v),cp=Math.min(258,Rn);Vt<=ap&&--An&&Ge!=Yt;){if(o[v+Ke]==o[v+Ke-Vt]){for(var Jt=0;Jt<cp&&o[v+Jt]==o[v+Jt-Vt];++Jt);if(Jt>Ke){if(Ke=Jt,je=Vt,Jt>sp)break;var up=Math.min(Vt,Jt-2),tc=0;for(Ae=0;Ae<up;++Ae){var Co=v-Vt+Ae+32768&32767,nc=Co-H[Co]+32768&32767;nc>tc&&(tc=nc,Yt=Co)}}}Vt+=(Ge=Yt)-(Yt=H[Ge])+32768&32767}if(je){ue[Re++]=268435456|ls[Ke]<<18|ds[je];var rc=31&ls[Ke],ic=31&ds[je];xe+=Es[rc]+bs[ic],++$e[257+rc],++Y[ic],He=v+Ke,++De}else ue[Re++]=o[v],++$e[o[v]]}}h=Yc(o,m,u,ue,$e,Y,xe,Re,qe,v-qe,h),u||(h=vi(m,h,vf))}return qu(f,0,c+Hu(h)+l)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!i)},$o=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function Ef(t,e){e===void 0&&(e={});var n=function(){var a=4294967295;return{p:function(c){for(var l=a,u=0;u<c.length;++u)l=yf[255&l^c[u]]^l>>>8;a=l},d:function(){return 4294967295^a}}}(),r=t.length;n.p(t);var i,o=Sf(t,e,10+((i=e).filename&&i.filename.length+1||0),8),s=o.length;return function(a,c){var l=c.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=c.level<2?4:c.level==9?2:0,a[9]=3,c.mtime!=0&&$o(a,4,Math.floor(new Date(c.mtime||Date.now())/1e3)),l){a[3]=8;for(var u=0;u<=l.length;++u)a[u+10]=l.charCodeAt(u)}}(o,e),$o(o,s-8,n.d()),$o(o,s-4,r),o}var bf=!!zo||!!Wo,Vc="text/plain",Ai=function(t,e){var n=Ce(t.split("?"),2),r=n[0],i=n[1],o=w({},e);i?.split("&").forEach(function(a){var c=Ce(a.split("="),1)[0];delete o[c]});var s=Ap(o);return s=s?(i?i+"&":"")+s:i,"".concat(r,"?").concat(s)},Tf=function(t){return"data="+encodeURIComponent(typeof t=="string"?t:JSON.stringify(t))},Ho=function(t){var e=t.data,n=t.compression;if(e){if(n===ct.GZipJS){var r=Ef(function(o,s){var a=o.length;if(!s&&typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var c=new ze(o.length+(o.length>>>1)),l=0,u=function(h){c[l++]=h},d=0;d<a;++d){if(l+5>c.length){var f=new ze(l+8+(a-d<<1));f.set(c),c=f}var m=o.charCodeAt(d);m<128||s?u(m):m<2048?(u(192|m>>>6),u(128|63&m)):m>55295&&m<57344?(u(240|(m=65536+(1047552&m)|1023&o.charCodeAt(++d))>>>18),u(128|m>>>12&63),u(128|m>>>6&63),u(128|63&m)):(u(224|m>>>12),u(128|m>>>6&63),u(128|63&m))}return qu(c,0,l)}(JSON.stringify(e)),{mtime:0});return{contentType:Vc,body:new Blob([r],{type:Vc})}}if(n===ct.Base64){var i=function(o){var s,a,c,l,u,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,m=0,h="",v=[];if(!o)return o;o=gp(o);do s=(u=o.charCodeAt(f++)<<16|o.charCodeAt(f++)<<8|o.charCodeAt(f++))>>18&63,a=u>>12&63,c=u>>6&63,l=63&u,v[m++]=d.charAt(s)+d.charAt(a)+d.charAt(c)+d.charAt(l);while(f<o.length);switch(h=v.join(""),o.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"="}return h}(JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:Tf(i)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Tr=[];zo&&Tr.push({transport:"XHR",method:function(t){var e,n=new zo;n.open(t.method||"GET",t.url,!0);var r=(e=Ho(t))!==null&&e!==void 0?e:{},i=r.contentType,o=r.body;J(t.headers,function(s,a){n.setRequestHeader(a,s)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(n.readyState===4){var s,a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}(s=t.callback)===null||s===void 0||s.call(t,a)}},n.send(o)}}),Wo&&Tr.push({transport:"fetch",method:function(t){var e,n,r=(e=Ho(t))!==null&&e!==void 0?e:{},i=r.contentType,o=r.body,s=new Headers;J(s,function(u,d){s.append(d,u)}),i&&s.append("Content-Type",i);var a=t.url,c=null;if(Sc){var l=new Sc;c={signal:l.signal,timeout:setTimeout(function(){return l.abort()},t.timeout)}}Wo(a,{method:t?.method||"GET",headers:s,keepalive:t.method==="POST",body:o,signal:(n=c)===null||n===void 0?void 0:n.signal}).then(function(u){return u.text().then(function(d){var f,m={statusCode:u.status,text:d};if(u.status===200)try{m.json=JSON.parse(d)}catch(h){b.error(h)}(f=t.callback)===null||f===void 0||f.call(t,m)})}).catch(function(u){var d;b.error(u),(d=t.callback)===null||d===void 0||d.call(t,{statusCode:0,text:u})}).finally(function(){return c?clearTimeout(c.timeout):null})}}),Sr!=null&&Sr.sendBeacon&&Tr.push({transport:"sendBeacon",method:function(t){var e=Ai(t.url,{beacon:"1"});try{var n,r=(n=Ho(t))!==null&&n!==void 0?n:{},i=r.contentType,o=r.body,s=typeof o=="string"?new Blob([o],{type:i}):o;Sr.sendBeacon(e,s)}catch{}}});var If=["retriesPerformedSoFar"],pn,kf=function(){function t(e){var n=this;Q(this,t),E(this,"isPolling",!1),E(this,"pollIntervalMs",3e3),E(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!M(_)&&"onLine"in _.navigator&&(this.areWeOnline=_.navigator.onLine,_.addEventListener("online",function(){n.areWeOnline=!0,n.flush()}),_.addEventListener("offline",function(){n.areWeOnline=!1}))}return Z(t,[{key:"retriableRequest",value:function(e){var n=this,r=e.retriesPerformedSoFar,i=lp(e,If);at(r)&&r>0&&(i.url=Ai(i.url,{retry_count:r})),this.instance._send_request(w(w({},i),{},{callback:function(o){var s;o.statusCode!==200&&(o.statusCode<400||o.statusCode>=500)&&(r??0)<10?n.enqueue(w({},i)):(s=i.callback)===null||s===void 0||s.call(i,o)}}))}},{key:"enqueue",value:function(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=function(s){var a=3e3*Math.pow(2,s),c=a/2,l=Math.min(18e5,a),u=(Math.random()-.5)*(l-c);return Math.ceil(l+u)}(n),i=Date.now()+r;this.queue.push({retryAt:i,requestOptions:e});var o="Enqueued failed request for retry in ".concat(r);navigator.onLine||(o+=" (Browser is offline)"),b.warn(o),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),n=[],r=this.queue.filter(function(a){return a.retryAt<e||(n.push(a),!1)});if(this.queue=n,r.length>0){var i,o=dt(r);try{for(o.s();!(i=o.n()).done;){var s=i.value.requestOptions;this.retriableRequest(s)}}catch(a){o.e(a)}finally{o.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=dt(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestOptions;try{this.instance._send_request(w(w({},r),{},{transport:"sendBeacon"}))}catch(i){b.error(i)}}}catch(i){n.e(i)}finally{n.f()}this.queue=[]}}]),t}(),fi=1800,wf=function(){function t(e,n,r,i){Q(this,t),E(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||Qt,this._windowIdGenerator=i||Qt;var o=e.persistence_name||e.token,s=e.session_idle_timeout_seconds||fi;if(at(s)?s>fi?b.warn("session_idle_timeout_seconds cannot be  greater than 30 minutes. Using 30 minutes instead."):s<60&&b.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(b.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),s=fi),this._sessionTimeoutMs=1e3*Math.min(Math.max(s,60),fi),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=Se.parse(this._window_id_storage_key),c=Se.parse(this._primary_window_exists_storage_key);a&&!c?this._windowId=a:Se.remove(this._window_id_storage_key),Se.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return Z(t,[{key:"onSessionId",value:function(e){var n=this;return M(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){n._sessionIdChangedHandlers=n._sessionIdChangedHandlers.filter(function(r){return r!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Se.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Se.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Se.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,n,r){e===this._sessionId&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._sessionId=e,this.persistence.register(E({},Si,[n,e,r])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Si];return le(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;_?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&Se.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),r=Ce(this._getSessionId(),3),i=r[0],o=r[1],s=r[2],a=this._getWindowId(),c=s&&s>0&&Math.abs(n-s)>864e5,l=!1,u=!o,d=!e&&Math.abs(n-i)>this._sessionTimeoutMs;u||d||c?(o=this._sessionIdGenerator(),a=this._windowIdGenerator(),b.info("[SessionId] new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:c}}),s=n,l=!0):a||(a=this._windowIdGenerator(),l=!0);var f=i===0||!e||c?n:i,m=s===0?new Date().getTime():s;return this._setWindowId(a),this._setSessionId(o,f,m),l&&this._sessionIdChangedHandlers.forEach(function(h){return h(o,a)}),{sessionId:o,windowId:a,sessionStartTimestamp:m}}}]),t}();(function(t){t.US="us",t.EU="eu",t.CUSTOM="custom"})(pn||(pn={}));var Jc="i.posthog.com",xf=function(){function t(e){Q(this,t),E(this,"_regionCache",{}),this.instance=e}return Z(t,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,n=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return n==="https://app.posthog.com"?"https://us.posthog.com":n}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=pn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=pn.EU:this._regionCache[this.apiHost]=pn.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(n&&(n=n[0]==="/"?n:"/".concat(n)),e==="ui")return(this.uiHost||this.apiHost.replace(".".concat(Jc),".posthog.com"))+n;if(this.region===pn.CUSTOM)return this.apiHost+n;var r=Jc+n;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}}]),t}(),Rf=Z(function t(e,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:["error"];Q(this,t),this.name="posthog-js",this.setupOnce=function(s){s(function(a){var c,l,u,d,f;if(!(o==="*"||o.includes(a.level))||!e.__loaded)return a;a.tags||(a.tags={});var m=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));a.tags["PostHog Person URL"]=m,e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h=((c=a.exception)===null||c===void 0?void 0:c.values)||[],v={$exception_message:((l=h[0])===null||l===void 0?void 0:l.value)||a.message,$exception_type:(u=h[0])===null||u===void 0?void 0:u.type,$exception_personURL:m,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((d=h[0])===null||d===void 0?void 0:d.value)||a.message,$sentry_exception_type:(f=h[0])===null||f===void 0?void 0:f.type,$sentry_tags:a.tags,$level:a.level};return n&&r&&(v.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),e.capture("$exception",v),a})}});function Af(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var o=r.config.segment;if(!o)return i();var s=function(c){var l=function(){return c.anonymousId()||Qt()};r.config.get_device_id=l,c.id()&&(r.register({distinct_id:c.id(),$device_id:l()}),r.persistence.set_property(Mt,"identified")),i()},a=o.user();"then"in a&&ut(a.then)?a.then(function(c){return s(c)}):s(a)})(t,function(){n.register(function(r){Promise&&Promise.resolve||b.warn("This browser does not have Promise support, and can not use the segment integration");var i=function(o,s){var a;if(!s)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||r.reset(),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(r.register({distinct_id:o.event.userId}),r.reloadFeatureFlags());var c=r._calculate_event_properties(s,(a=o.event.properties)!==null&&a!==void 0?a:{});return o.event.properties=Object.assign({},c,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(o){return i(o,o.event.event)},page:function(o){return i(o,"$pageview")},identify:function(o){return i(o,"$identify")},screen:function(o){return i(o,"$screen")}}}(t)).then(function(){e()})})}var Nf=function(){function t(e){Q(this,t),this._instance=e}return Z(t,[{key:"doPageView",value:function(){var e,n=this._previousScrollProperties();return this._currentPath=(e=_?.location.pathname)!==null&&e!==void 0?e:"",this._instance.scrollManager.resetContext(),n}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,n=this._instance.scrollManager.getContext();if(!e||!n)return{};var r=n.maxScrollHeight,i=n.lastScrollY,o=n.maxScrollY,s=n.maxContentHeight,a=n.lastContentY,c=n.maxContentY;return M(r)||M(i)||M(o)||M(s)||M(a)||M(c)?{}:(r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),c=Math.ceil(c),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:i,$prev_pageview_last_scroll_percentage:r<=1?1:mi(i/r,0,1),$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:r<=1?1:mi(o/r,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:s<=1?1:mi(a/s,0,1),$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:s<=1?1:mi(c/s,0,1)})}}]),t}();function mi(t,e,n){return Math.max(e,Math.min(t,n))}var Cf={icontains:function(t){return!!_&&_.location.href.toLowerCase().indexOf(t.toLowerCase())>-1},regex:function(t){return!!_&&Rp(_.location.href,t)},exact:function(t){return _?.location.href===t}},Pf=function(){function t(e){Q(this,t),this.instance=e}return Z(t,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,n=Pe?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||wr(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),function(r){if(r)return b.error("Could not load surveys script",r);Pe.extendPostHogWithSurveys(e.instance)})}},{key:"getSurveys",value:function(e){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);var i=this.instance.get_property(Xo);if(i&&!r)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(o){var s;if(o.statusCode!==200||!o.json)return e([]);var a=o.json.surveys||[];return(s=n.instance.persistence)===null||s===void 0||s.register(E({},Xo,a)),e(a)}})}},{key:"getActiveMatchingSurveys",value:function(e){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(i){var o=i.filter(function(s){return!(!s.start_date||s.end_date)}).filter(function(s){var a,c,l,u;if(!s.conditions)return!0;var d=(a=s.conditions)===null||a===void 0||!a.url||Cf[(c=(l=s.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&c!==void 0?c:"icontains"](s.conditions.url),f=(u=s.conditions)===null||u===void 0||!u.selector||x?.querySelector(s.conditions.selector);return d&&f}).filter(function(s){if(!s.linked_flag_key&&!s.targeting_flag_key)return!0;var a=!s.linked_flag_key||n.instance.featureFlags.isFeatureEnabled(s.linked_flag_key),c=!s.targeting_flag_key||n.instance.featureFlags.isFeatureEnabled(s.targeting_flag_key);return a&&c});return e(o)},r)}}]),t}(),Of=function(){function t(e){var n,r,i=this;Q(this,t),E(this,"serverLimits",{}),E(this,"lastEventRateLimited",!1),E(this,"checkForLimiting",function(o){var s=o.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(function(a){b.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),i.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void b.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:s})}}),this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)===null||n===void 0?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)===null||r===void 0?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return Z(t,[{key:"clientRateLimitContext",value:function(){var e,n,r,i=arguments.length>0&&arguments[0]!==void 0&&arguments[0],o=new Date().getTime(),s=(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property(Zo))!==null&&e!==void 0?e:{tokens:this.captureEventsBurstLimit,last:o};s.tokens+=(o-s.last)/1e3*this.captureEventsPerSecond,s.last=o,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var a=s.tokens<1;return a||i||(s.tokens=Math.max(0,s.tokens-1)),!a||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(r=this.instance.persistence)===null||r===void 0||r.set_property(Zo,s),{isRateLimited:a,remainingTokens:s.tokens}}},{key:"isServerRateLimited",value:function(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}]),t}(),Ff=function(){return w({initialPathName:Xe?.pathname||"",referringDomain:ge.referringDomain()},ge.campaignParams())},Df=function(){function t(e,n,r){var i=this;Q(this,t),E(this,"_onSessionIdCallback",function(o){var s=i._getStoredProps();if(!s||s.sessionId!==o){var a={sessionId:o,props:i._sessionSourceParamGenerator()};i._persistence.register(E({},Qo,a))}}),this._sessionIdManager=e,this._persistence=n,this._sessionSourceParamGenerator=r||Ff,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return Z(t,[{key:"_getStoredProps",value:function(){return this._persistence.props[Qo]}},{key:"getSessionProps",value:function(){var e,n=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return n?{$client_session_initial_referring_host:n.referringDomain,$client_session_initial_pathname:n.initialPathName,$client_session_initial_utm_source:n.utm_source,$client_session_initial_utm_campaign:n.utm_campaign,$client_session_initial_utm_medium:n.utm_medium,$client_session_initial_utm_content:n.utm_content,$client_session_initial_utm_term:n.utm_term}:{}}}]),t}(),Mf=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Kc=function(t,e){if(!t)return!1;var n=t.toLowerCase();return Mf.concat(e||[]).some(function(r){var i=r.toLowerCase();return n.indexOf(i)!==-1})},Gu=function(){function t(){Q(this,t),this.clicks=[]}return Z(t,[{key:"isRageClick",value:function(e,n,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}]),t}();function Xc(t){var e;return t.id===ns||!((e=t.closest)===null||e===void 0||!e.call(t,"#"+ns))}var Lf=function(){function t(e){var n;Q(this,t),E(this,"rageclicks",new Gu),E(this,"_enabledServerSide",!1),E(this,"_initialized",!1),this.instance=e,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[Vo])}return Z(t,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(b.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return M(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(E({},Vo,n)),this._enabledServerSide=n,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;_&&x&&(Ut(x,"click",function(n){return e._onClick(n||_?.event)},!1,!0),Ut(x,"mousemove",function(n){return e._onMouseMove(n||_?.event)},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=function(a,c,l){for(var u=a;u&&!Zt(u,"body");){if(u===l)return!1;if(j(c,_?.getComputedStyle(u).position))return!0;u=Au(u)}return!1}(e.target,["fixed","sticky"],o);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:n}}},{key:"_onClick",value:function(e){var n;if(!Xc(e.target)){var r=this._getProperties(e,"click");(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(w(w({},r),{},{type:"rageclick"})),this._capture(r)}}},{key:"_onMouseMove",value:function(e){var n=this;Xc(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){n._capture(n._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(_){var n=_.location.href;this.buffer=this.buffer||{},this.buffer[n]||(this.buffer[n]=[]),this.buffer[n].push(e)}}}]),t}(),Uf=function(){function t(e){var n=this;Q(this,t),E(this,"_updateScrollData",function(){var r,i,o,s;n.context||(n.context={});var a=n.scrollElement(),c=n.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,u=c+(a?.clientHeight||0),d=a?.scrollHeight||0;n.context.lastScrollY=Math.ceil(c),n.context.maxScrollY=Math.max(c,(r=n.context.maxScrollY)!==null&&r!==void 0?r:0),n.context.maxScrollHeight=Math.max(l,(i=n.context.maxScrollHeight)!==null&&i!==void 0?i:0),n.context.lastContentY=u,n.context.maxContentY=Math.max(u,(o=n.context.maxContentY)!==null&&o!==void 0?o:0),n.context.maxContentHeight=Math.max(d,(s=n.context.maxContentHeight)!==null&&s!==void 0?s:0)}),this.instance=e}return Z(t,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){_?.addEventListener("scroll",this._updateScrollData,!0),_?.addEventListener("scrollend",this._updateScrollData,!0),_?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return _?.document.documentElement;var e,n=dt(le(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=_?.document.querySelector(r);if(i)return i}}catch(o){n.e(o)}finally{n.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return _&&(_.scrollY||_.pageYOffset||_.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return _&&(_.scrollX||_.pageXOffset||_.document.documentElement.scrollLeft)||0}}]),t}(),Bf=function(){function t(){Q(this,t),E(this,"events",{}),this.events={}}return Z(t,[{key:"on",value:function(e,n){var r=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(n),function(){r.events[e]=r.events[e].filter(function(i){return i!==n})}}},{key:"emit",value:function(e,n){var r,i=dt(this.events[e]||[]);try{for(i.s();!(r=i.n()).done;)(0,r.value)(n)}catch(a){i.e(a)}finally{i.f()}var o,s=dt(this.events["*"]||[]);try{for(s.s();!(o=s.n()).done;)(0,o.value)(e,n)}catch(a){s.e(a)}finally{s.f()}}}]),t}(),qo="$copy_autocapture";function Go(t,e){return e.length>t?e.slice(0,t)+"...":e}var $f=function(){function t(e){Q(this,t),E(this,"_initialized",!1),E(this,"_isDisabledServerSide",null),E(this,"rageclicks",new Gu),E(this,"_elementsChainAsString",!1),this.instance=e}return Z(t,[{key:"config",get:function(){var e,n=bt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)===null||e===void 0?void 0:e.map(function(r){return new RegExp(r)}),n}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(_&&x){var n=function(i){i=i||_?.event;try{e._captureEvent(i)}catch(o){b.error("Failed to capture event",o)}},r=function(i){i=i||_?.event,e._captureEvent(i,qo)};Ut(x,"submit",n,!1,!0),Ut(x,"change",n,!1,!0),Ut(x,"click",n,!1,!0),this.config.capture_copied_text&&(Ut(x,"copy",r,!1,!0),Ut(x,"cut",r,!1,!0))}}else b.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(E({},Tc,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,n,r=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Tc],i=this._isDisabledServerSide;if(lt(i)&&!gi(r)&&!this.instance.config.advanced_disable_decide)return!1;var o=(n=this._isDisabledServerSide)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!o}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var n=e;do n=n.previousSibling;while(n&&!vs(n));return n}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!as(e))return{};var n={};return J(e.attributes,function(r){if(r.name&&r.name.indexOf("data-ph-capture-attribute")===0){var i=r.name.replace("data-ph-capture-attribute-",""),o=r.value;i&&o&&Ln(o)&&(n[i]=o)}}),n}},{key:"_getPropertiesFromElement",value:function(e,n,r){var i,o=e.tagName.toLowerCase(),s={tag_name:o};ss.indexOf(o)>-1&&!r&&(o.toLowerCase()==="a"||o.toLowerCase()==="button"?s.$el_text=Go(1024,Uc(e)):s.$el_text=Go(1024,wi(e)));var a=ki(e);a.length>0&&(s.classes=a.filter(function(f){return f!==""}));var c=(i=this.config)===null||i===void 0?void 0:i.element_attribute_ignorelist;J(e.attributes,function(f){var m;if((!Nu(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(c==null||!c.includes(f.name))&&!n&&Ln(f.value)&&(m=f.name,!be(m)||m.substring(0,10)!=="_ngcontent"&&m.substring(0,7)!=="_nghost")){var h=f.value;f.name==="class"&&(h=_s(h).join(" ")),s["attr__"+f.name]=Go(1024,h)}});for(var l=1,u=1,d=e;d=this._previousElementSibling(d);)l++,d.tagName===e.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return M(e.target)?e.srcElement||null:(n=e.target)!==null&&n!==void 0&&n.shadowRoot?e.composedPath()[0]||null:e.target||null;var n}},{key:"_captureEvent",value:function(e){var n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var i,o=this._getEventTarget(e);xu(o)&&(o=o.parentNode||null),r==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!==null&&i!==void 0&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var s=r===qo;if(o&&jp(o,e,this.config,s,s?["copy","cut"]:void 0)){for(var a,c,l=[o],u=o;u.parentNode&&!Zt(u,"body");)Ru(u.parentNode)?(l.push(u.parentNode.host),u=u.parentNode.host):(l.push(u.parentNode),u=u.parentNode);var d,f=[],m={},h=!1;if(J(l,function(N){var $=as(N);N.tagName.toLowerCase()==="a"&&(d=N.getAttribute("href"),d=$&&Ln(d)&&d),j(ki(N),"ph-no-capture")&&(h=!0),f.push(n._getPropertiesFromElement(N,n.instance.config.mask_all_element_attributes,n.instance.config.mask_all_text));var H=n._getAugmentPropertiesFromElement(N);me(m,H)}),this.instance.config.mask_all_text||(o.tagName.toLowerCase()==="a"||o.tagName.toLowerCase()==="button"?f[0].$el_text=Uc(o):f[0].$el_text=wi(o)),d&&(f[0].attr__href=d),h)return!1;var v=me(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:Jp(f)}:{$elements:f},(a=f[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(c=f[0])===null||c===void 0?void 0:c.$el_text}:{},m);if(r===qo){var T,F=wu(_==null||(T=_.getSelection())===null||T===void 0?void 0:T.toString()),L=e.type||"clipboard";if(!F)return!1;v.$selected_content=F,v.$copy_type=L}return this.instance.capture(r,v),!0}}}},{key:"isBrowserSupported",value:function(){return ut(x?.querySelectorAll)}}]),t}(),Ir={},Qc=function(){},Cn="posthog",ju=!bf&&re?.indexOf("MSIE")===-1&&re?.indexOf("Mozilla")===-1,Zc=function(){var t,e,n;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=x?.location,n=e?.hostname,!!be(n)&&n.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Qc,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Xe&&be(Xe?.search)&&Xe.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(_==null||(t=_.location)===null||t===void 0?void 0:t.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(r){var i="Bad HTTP status: "+r.statusCode+" "+r.text;b.error(i)},get_device_id:function(r){return r},_onCapture:Qc,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always"}},eu=function(t){var e={};M(t.process_person)||(e.person_profiles=t.process_person),M(t.xhr_headers)||(e.request_headers=t.xhr_headers),M(t.cookie_name)||(e.persistence_name=t.cookie_name),M(t.disable_cookie)||(e.disable_persistence=t.disable_cookie);var n=me({},e,t);return le(t.property_blacklist)&&(M(t.property_denylist)?n.property_denylist=t.property_blacklist:le(t.property_denylist)?n.property_denylist=[].concat(Un(t.property_blacklist),Un(t.property_denylist)):b.error("Invalid value for property_denylist config: "+t.property_denylist)),n},Hf=function(){function t(){Q(this,t),E(this,"__forceAllowLocalhost",!1)}return Z(t,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){b.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),t}(),Wu=function(){function t(){var e=this;Q(this,t),E(this,"webPerformance",new Hf),E(this,"_debugEventEmitter",new Bf),this.config=Zc(),this.decideEndpointWasHit=!1,this.SentryIntegration=Rf,this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new _p(this),this.toolbar=new df(this),this.scrollManager=new Uf(this),this.pageViewManager=new Nf(this),this.surveys=new Pf(this),this.rateLimiter=new Of(this),this.requestRouter=new xf(this),this.people={set:function(n,r,i){var o=be(n)?E({},n,r):n;e.setPersonProperties(o),i?.({})},set_once:function(n,r,i){var o=be(n)?E({},n,r):n;e.setPersonProperties(void 0,o),i?.({})}},this.on("eventCaptured",function(n){return b.info("send",n)})}return Z(t,[{key:"init",value:function(e,n,r){if(r&&r!==Cn){var i,o=(i=Ir[r])!==null&&i!==void 0?i:new t;return o._init(e,n,r),Ir[r]=o,Ir[Cn][r]=o,o}return this._init(e,n,r)}},{key:"_init",value:function(e){var n,r,i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(M(e)||function(T){return be(T)&&T.trim().length===0}(e))return b.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return b.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(me({},Zc(),eu(o),{name:s,token:e})),this.compression=o.disable_compression?void 0:ct.Base64,this.persistence=new Lo(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new Lo(w(w({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new pf(function(T){return i._send_retriable_request(T)}),this._retryQueue=new kf(this),this.__request_queue=[],this.sessionManager=new wf(this.config,this.persistence),this.sessionPropsManager=new Df(this.sessionManager,this.persistence),this.sessionRecording=new cf(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new $f(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Lf(this),this.heatmaps.startIfEnabled(),dn.DEBUG=dn.DEBUG||this.config.debug,this._gdpr_init(),((n=o.bootstrap)===null||n===void 0?void 0:n.distinctID)!==void 0){var a,c,l=this.config.get_device_id(Qt()),u=(a=o.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?l:o.bootstrap.distinctID;this.persistence.set_property(Mt,(c=o.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:u})}if(this._hasBootstrappedFeatureFlags()){var d,f,m=Object.keys(((d=o.bootstrap)===null||d===void 0?void 0:d.featureFlags)||{}).filter(function(T){var F,L;return!((F=o.bootstrap)===null||F===void 0||(L=F.featureFlags)===null||L===void 0||!L[T])}).reduce(function(T,F){var L,N;return T[F]=((L=o.bootstrap)===null||L===void 0||(N=L.featureFlags)===null||N===void 0?void 0:N[F])||!1,T},{}),h=Object.keys(((f=o.bootstrap)===null||f===void 0?void 0:f.featureFlagPayloads)||{}).filter(function(T){return m[T]}).reduce(function(T,F){var L,N,$,H;return(L=o.bootstrap)!==null&&L!==void 0&&(N=L.featureFlagPayloads)!==null&&N!==void 0&&N[F]&&(T[F]=($=o.bootstrap)===null||$===void 0||(H=$.featureFlagPayloads)===null||H===void 0?void 0:H[F]),T},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:h})}if(!this.get_distinct_id()){var v=this.config.get_device_id(Qt());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(Mt,"anonymous")}return _==null||(r=_.addEventListener)===null||r===void 0||r.call(_,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?Af(this,function(){return i._loaded()}):this._loaded(),ut(this.config._onCapture)&&this.on("eventCaptured",function(T){return i.config._onCapture(T.event,T)}),this}},{key:"_afterDecideResponse",value:function(e){var n,r,i,o,s;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=j(e.supportedCompression,ct.GZipJS)?ct.GZipJS:j(e.supportedCompression,ct.Base64)?ct.Base64:void 0),(n=e.analytics)!==null&&n!==void 0&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),(r=this.sessionRecording)===null||r===void 0||r.afterDecideResponse(e),(i=this.autocapture)===null||i===void 0||i.afterDecideResponse(e),(o=this.heatmaps)===null||o===void 0||o.afterDecideResponse(e),(s=this.surveys)===null||s===void 0||s.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,n=this.config.advanced_disable_decide;n||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(r){b.critical("`loaded` function failed",r)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){x&&e.capture("$pageview",{title:x.title},{send_instantly:!0})},1),n||(new uf(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Fn(this.__request_queue,function(n){return e._send_retriable_request(n)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,n;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(n=this._retryQueue)===null||n===void 0||n.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var n=this;this.__loaded&&(ju?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Ai(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression=e.compression==="best-available"?this.compression:e.compression,function(r){var i,o,s,a=w({},r);a.timeout=a.timeout||6e4,a.url=Ai(a.url,{_:new Date().getTime().toString(),ver:dn.LIB_VERSION,compression:a.compression});var c=(i=a.transport)!==null&&i!==void 0?i:"XHR",l=(o=(s=function(u,d){for(var f=0;f<u.length;f++)if(d(u[f]))return u[f]}(Tr,function(u){return u.transport===c}))===null||s===void 0?void 0:s.method)!==null&&o!==void 0?o:Tr[0].method;if(!l)throw new Error("No available transport method");l(a)}(w(w({},e),{},{callback:function(r){var i,o,s;n.rateLimiter.checkForLimiting(r),r.statusCode>=400&&((o=(s=n.config).on_request_error)===null||o===void 0||o.call(s,r)),(i=e.callback)===null||i===void 0||i.call(e,r)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var n,r=this,i=[],o=[],s=[];Fn(e,function(c){c&&(n=c[0],le(n)?s.push(c):ut(c)?c.call(r):le(c)&&n==="alias"?i.push(c):le(c)&&n.indexOf("capture")!==-1&&ut(r[n])?s.push(c):o.push(c))});var a=function(c,l){Fn(c,function(u){if(le(u[0])){var d=l;J(u,function(f){d=d[f[0]].apply(d,f.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};a(i,this),a(o,this),a(s,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,n;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)===null||n===void 0?void 0:n.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,n,r){var i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return b.uninitializedWarning("posthog.capture");if(!Lu(this))if(!M(e)&&be(e)){if(!re||this.config.opt_out_useragent_filter||!Kc(re,this.config.custom_blocked_useragents)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&(this.sessionPersistence.update_campaign_params(),this.persistence.set_initial_campaign_params()),this.config.save_referrer&&(this.sessionPersistence.update_referrer_info(),this.persistence.set_initial_referrer_info());var s={uuid:Qt(),event:e,properties:this._calculate_event_properties(e,n||{})};if(r==null||!r._noHeatmaps){var a,c=(a=this.heatmaps)===null||a===void 0?void 0:a.getAndClearBuffer();c&&(s.properties.$heatmap_data=c)}o&&(s.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r?.$set&&(s.$set=r?.$set);var l=this._calculate_set_once_properties(r?.$set_once);l&&(s.$set_once=l),(s=mp(s,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=r?.timestamp||new Date,M(r?.timestamp)||(s.properties.$event_time_override_provided=!0,s.properties.$event_time_override_system_time=new Date);var u=w(w({},s.properties.$set),s.$set);Oo(u)||this.setPersonPropertiesForFlags(u),this._debugEventEmitter.emit("eventCaptured",s);var d={method:"POST",url:(i=r?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:s,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),s}b.critical("This capture call is ignored due to client rate limiting.")}}else b.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(n){return e(n.event)})}},{key:"_calculate_event_properties",value:function(e,n){if(!this.persistence||!this.sessionPersistence)return n;var r=this.persistence.remove_event_timer(e),i=w({},n);if(i.token=this.config.token,e==="$snapshot"){var o=w(w({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=o.distinct_id,i}var s=ge.properties();if(this.sessionManager){var a=this.sessionManager.checkAndGetSessionAndWindowId(),c=a.sessionId,l=a.windowId;i.$session_id=c,i.$window_id=l}if(this.requestRouter.region===pn.CUSTOM&&(i.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var u=this.sessionPropsManager.getSessionProps();i=me(i,u)}if(!this.config.disable_scroll_properties){var d={};e==="$pageview"?d=this.pageViewManager.doPageView():e==="$pageleave"&&(d=this.pageViewManager.doPageLeave()),i=me(i,d)}if(e==="$pageview"&&x&&(i.title=x.title),!M(r)){var f=new Date().getTime()-r;i.$duration=parseFloat((f/1e3).toFixed(3))}re&&this.config.opt_out_useragent_filter&&(i.$browser_type=Kc(re,this.config.custom_blocked_useragents)?"bot":"browser"),(i=me({},s,this.persistence.properties(),this.sessionPersistence.properties(),i)).$is_identified=this._isIdentified(),le(this.config.property_denylist)?J(this.config.property_denylist,function(h){delete i[h]}):b.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;return m&&(i=m(i,e)),i.$process_person_profile=this._hasPersonProcessing(),i}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var n=me({},this.persistence.get_initial_props(),e||{});return Oo(n)?void 0:n}},{key:"register",value:function(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}},{key:"register_once",value:function(e,n,r){var i;(i=this.persistence)===null||i===void 0||i.register_once(e,n,r)}},{key:"register_for_session",value:function(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.register(e)}},{key:"unregister",value:function(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}},{key:"unregister_for_session",value:function(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}},{key:"_register_single",value:function(e,n){this.register(E({},e,n))}},{key:"getFeatureFlag",value:function(e,n){return this.featureFlags.getFeatureFlag(e,n)}},{key:"getFeatureFlagPayload",value:function(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}},{key:"isFeatureEnabled",value:function(e,n){return this.featureFlags.isFeatureEnabled(e,n)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n)}},{key:"getEarlyAccessFeatures",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,n)}},{key:"on",value:function(e,n){return this._debugEventEmitter.on(e,n)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:function(){}}},{key:"getSurveys",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,n)}},{key:"getActiveMatchingSurveys",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,n)}},{key:"identify",value:function(e,n,r){if(!this.__loaded||!this.persistence)return b.uninitializedWarning("posthog.identify");if(at(e)&&(e=e.toString(),b.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))b.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==i&&e!==this.get_property(hr)&&(this.unregister(hr),this.register({distinct_id:e}));var s=(this.persistence.get_property(Mt)||"anonymous")==="anonymous";e!==i&&s?(this.persistence.set_property(Mt,"identified"),this.setPersonPropertiesForFlags(n||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(Ei))}}else b.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,n){(e||n)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:n||{}}))}},{key:"group",value:function(e,n,r){if(e&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:w(w({},i),{},E({},e,n))}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(E({},e,r))),i[e]===n||r||this.reloadFeatureFlags()}}else b.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,n)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var n,r,i,o;if(!this.__loaded)return b.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");(n=this.persistence)===null||n===void 0||n.clear(),(r=this.sessionPersistence)===null||r===void 0||r.clear(),(i=this.persistence)===null||i===void 0||i.set_property(Mt,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId();var a=this.config.get_device_id(Qt());this.register_once({distinct_id:a,$device_id:e?a:s},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionId,i=n.sessionStartTimestamp,o=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(r));if(e!=null&&e.withTimestamp&&i){var s,a=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!i)return o;var c=Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0);o+="?t=".concat(c)}return o}},{key:"alias",value:function(e,n){return e===this.get_property(cu)?(b.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(M(n)&&(n=this.get_distinct_id()),e!==n?(this._register_single(hr,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(b.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var n,r,i,o,s=w({},this.config);bt(e)&&(me(this.config,eu(e)),(n=this.persistence)===null||n===void 0||n.update_config(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new Lo(w(w({},this.config),{},{persistence:"sessionStorage"})),oe.is_supported()&&oe.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(dn.DEBUG=!0),(r=this.sessionRecording)===null||r===void 0||r.startIfEnabledOrStop(),(i=this.autocapture)===null||i===void 0||i.startIfEnabled(),(o=this.heatmaps)===null||o===void 0||o.startIfEnabled(),this.surveys.loadIfEnabled())}},{key:"startSessionRecording",value:function(e){if(e!=null&&e.sampling){var n,r,i=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId();(r=this.persistence)===null||r===void 0||r.register(E({},Er,!0)),b.info("Session recording started with sampling override for session: ",i?.sessionId)}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}},{key:"getSessionProperty",value:function(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}},{key:"toString",value:function(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Cn;return n!==Cn&&(n=Cn+"."+n),n}},{key:"_isIdentified",value:function(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(Mt))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property(Mt))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,n,r,i;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Oo(this.getGroups())&&((e=this.persistence)===null||e===void 0||(n=e.props)===null||n===void 0||!n[hr])&&((r=this.persistence)===null||r===void 0||(i=r.props)===null||i===void 0||!i[bi]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return this.config.person_profiles==="never"?(b.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(bi,!0),!0)}},{key:"_gdpr_init",value:function(){this.config.opt_out_capturing_persistence_type==="localStorage"&&oe.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!It.get("ph_optout")||(It.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var n,r,i,o,s;if(e&&e.clear_persistence)i=!0;else{if(!e||!e.enable_persistence)return;i=!1}this.config.disable_persistence||((n=this.persistence)===null||n===void 0?void 0:n.disabled)===i||(o=this.persistence)===null||o===void 0||o.set_disabled(i),this.config.disable_persistence||((r=this.sessionPersistence)===null||r===void 0?void 0:r.disabled)===i||(s=this.sessionPersistence)===null||s===void 0||s.set_disabled(i)}},{key:"_gdpr_call_func",value:function(e,n){return n=me({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},n||{}),oe.is_supported()||n.persistence_type!=="localStorage"||(n.persistence_type="cookie"),e(this.config.token,{capture:n.capture,captureEventName:n.capture_event_name,captureProperties:n.capture_properties,persistenceType:n.persistence_type,persistencePrefix:n.cookie_prefix,cookieExpiration:n.cookie_expiration,crossSubdomainCookie:n.cross_subdomain_cookie,secureCookie:n.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=me({enable_persistence:!0},e||{}),this._gdpr_call_func(nf,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var n=me({clear_persistence:!0},e||{});this._gdpr_call_func(rf,n),this._gdpr_update_persistence(n)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(of,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Fu,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var n=me({enable_persistence:!0},e??{});this._gdpr_call_func(sf,n),this._gdpr_update_persistence(n)}},{key:"debug",value:function(e){e===!1?(_?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(_?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),t}();(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=fp(t.prototype[e[n]])})(Wu,["identify"]);var tu,nu;(function(t){t.Popover="popover",t.API="api",t.Widget="widget"})(tu||(tu={})),function(t){t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link"}(nu||(nu={}));var ru,Oi=(ru=Ir[Cn]=new Wu,function(){function t(){t.done||(t.done=!0,ju=!1,J(Ir,function(e){e._dom_loaded()}))}x!=null&&x.addEventListener&&(x.readyState==="complete"?t():x.addEventListener("DOMContentLoaded",t,!1)),_&&Ut(_,"load",t,!0)}(),ru);p();p();p();p();p();p();p();var zu=Object.prototype.toString;function gn(t){switch(zu.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ye(t,Error)}}function Hn(t,e){return zu.call(t)===`[object ${e}]`}function Fi(t){return Hn(t,"ErrorEvent")}function Di(t){return Hn(t,"DOMError")}function Ts(t){return Hn(t,"DOMException")}function de(t){return Hn(t,"String")}function qn(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function hn(t){return t===null||qn(t)||typeof t!="object"&&typeof t!="function"}function pt(t){return Hn(t,"Object")}function _n(t){return typeof Event<"u"&&Ye(t,Event)}function Is(t){return typeof Element<"u"&&Ye(t,Element)}function ks(t){return Hn(t,"RegExp")}function kt(t){return!!(t&&t.then&&typeof t.then=="function")}function ws(t){return pt(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Ye(t,e){try{return t instanceof e}catch{return!1}}function Nr(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}p();function wt(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Mi(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let i=t[r];try{Nr(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Yu(t,e,n=!1){return de(t)?ks(e)?e.test(t):de(e)?n?t===e:t.includes(e):!1:!1}function xt(t,e=[],n=!1){return e.some(r=>Yu(t,r,n))}function Rs(t,e,n=250,r,i,o,s){if(!o.exception||!o.exception.values||!s||!Ye(s.originalException,Error))return;let a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=qf(xs(t,e,i,s.originalException,r,o.exception.values,a,0),n))}function xs(t,e,n,r,i,o,s,a){if(o.length>=n+1)return o;let c=[...o];if(Ye(r[i],Error)){Vu(s,a);let l=t(e,r[i]),u=c.length;Ju(l,i,u,a),c=xs(t,e,n,r[i],i,[l,...c],l,u)}return Array.isArray(r.errors)&&r.errors.forEach((l,u)=>{if(Ye(l,Error)){Vu(s,a);let d=t(e,l),f=c.length;Ju(d,`errors[${u}]`,f,a),c=xs(t,e,n,l,i,[d,...c],d,f)}}),c}function Vu(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=D(g(g({},t.mechanism),t.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:e})}function Ju(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=D(g({},t.mechanism),{type:"chained",source:e,exception_id:n,parent_id:r})}function qf(t,e){return t.map(n=>(n.value&&(n.value=wt(n.value,e)),n))}p();p();p();var Ze="8.22.0";var O=globalThis;function Gn(t,e,n){let r=n||O,i=r.__SENTRY__=r.__SENTRY__||{},o=i[Ze]=i[Ze]||{};return o[t]||(o[t]=e())}var jn=O,Gf=80;function ft(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,i=[],o=0,s=0,a=" > ",c=a.length,l,u=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||Gf;for(;n&&o++<r&&(l=jf(n,u),!(l==="html"||o>1&&s+i.length*c+l.length>=d));)i.push(l),s+=l.length,n=n.parentNode;return i.reverse().join(a)}catch{return"<unknown>"}}function jf(t,e){let n=t,r=[];if(!n||!n.tagName)return"";if(jn.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=e&&e.length?e.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(i&&i.length)i.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let s=n.className;if(s&&de(s)){let a=s.split(/\s+/);for(let c of a)r.push(`.${c}`)}}let o=["aria-label","type","name","title","alt"];for(let s of o){let a=n.getAttribute(s);a&&r.push(`[${s}="${a}"]`)}return r.join("")}function As(){try{return jn.document.location.href}catch{return""}}function Ns(t){return jn.document&&jn.document.querySelector?jn.document.querySelector(t):null}function Cr(t){if(!jn.HTMLElement)return null;let e=t,n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}p();p();var et=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;p();var Wf="Sentry Logger ",Pr=["debug","info","warn","error","log","assert","trace"],Wn={};function Rt(t){if(!("console"in O))return t();let e=O.console,n={},r=Object.keys(Wn);r.forEach(i=>{let o=Wn[i];n[i]=e[i],e[i]=o});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function zf(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return et?Pr.forEach(n=>{e[n]=(...r)=>{t&&Rt(()=>{O.console[n](`${Wf}[${n}]:`,...r)})}}):Pr.forEach(n=>{e[n]=()=>{}}),e}var S=zf();var Yf=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Vf(t){return t==="http"||t==="https"}function tt(t,e=!1){let{host:n,path:r,pass:i,port:o,projectId:s,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${s}`}function Ku(t){let e=Yf.exec(t);if(!e){Rt(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,i="",o="",s="",a=""]=e.slice(1),c="",l=a,u=l.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){let d=l.match(/^\d+/);d&&(l=d[0])}return Xu({host:o,pass:i,path:c,projectId:l,port:s,protocol:n,publicKey:r})}function Xu(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Jf(t){if(!et)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(s=>t[s]?!1:(S.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?Vf(r)?e&&isNaN(parseInt(e,10))?(S.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(S.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(S.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Or(t){let e=typeof t=="string"?Ku(t):Xu(t);if(!(!e||!Jf(e)))return e}p();var Te=class extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}};p();p();function ee(t,e,n){if(!(e in t))return;let r=t[e],i=n(r);typeof i=="function"&&Li(i,r),t[e]=i}function ie(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{et&&S.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function Li(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,ie(t,"__sentry_original__",e)}catch{}}function vn(t){return t.__sentry_original__}function Ps(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function Ui(t){if(gn(t))return g({message:t.message,name:t.name,stack:t.stack},Zu(t));if(_n(t)){let e=g({type:t.type,target:Qu(t.target),currentTarget:Qu(t.currentTarget)},Zu(t));return typeof CustomEvent<"u"&&Ye(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Qu(t){try{return Is(t)?ft(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Zu(t){if(typeof t=="object"&&t!==null){let e={};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function Os(t,e=40){let n=Object.keys(Ui(t));n.sort();let r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return wt(r,e);for(let i=n.length;i>0;i--){let o=n.slice(0,i).join(", ");if(!(o.length>e))return i===n.length?o:wt(o,e)}return""}function X(t){return Cs(t,new Map)}function Cs(t,e){if(Kf(t)){let n=e.get(t);if(n!==void 0)return n;let r={};e.set(t,r);for(let i of Object.keys(t))typeof t[i]<"u"&&(r[i]=Cs(t[i],e));return r}if(Array.isArray(t)){let n=e.get(t);if(n!==void 0)return n;let r=[];return e.set(t,r),t.forEach(i=>{r.push(Cs(i,e))}),r}return t}function Kf(t){if(!pt(t))return!1;try{let e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}p();p();var At="?",el=/\(error: (.*)\)/,tl=/captureMessage|captureException/;function $i(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{let o=[],s=n.split(`
`);for(let a=r;a<s.length;a++){let c=s[a];if(c.length>1024)continue;let l=el.test(c)?c.replace(el,"$1"):c;if(!l.match(/\S*Error: /)){for(let u of e){let d=u(l);if(d){o.push(d);break}}if(o.length>=50+i)break}}return nl(o.slice(i))}}function Ds(t){return Array.isArray(t)?$i(...t):t}function nl(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(Bi(e).function||"")&&e.pop(),e.reverse(),tl.test(Bi(e).function||"")&&(e.pop(),tl.test(Bi(e).function||"")&&e.pop()),e.slice(0,50).map(n=>D(g({},n),{filename:n.filename||Bi(e).filename,function:n.function||At}))}function Bi(t){return t[t.length-1]||{}}var Fs="<anonymous>";function Le(t){try{return!t||typeof t!="function"?Fs:t.name||Fs}catch{return Fs}}function Hi(t){let e=t.exception;if(e){let n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}var qi={},rl={};function Ie(t,e){qi[t]=qi[t]||[],qi[t].push(e)}function ke(t,e){rl[t]||(e(),rl[t]=!0)}function se(t,e){let n=t&&qi[t];if(n)for(let r of n)try{r(e)}catch(i){et&&S.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${Le(r)}
Error:`,i)}}function Ms(t){let e="console";Ie(e,t),ke(e,Xf)}function Xf(){"console"in O&&Pr.forEach(function(t){t in O.console&&ee(O.console,t,function(e){return Wn[t]=e,function(...n){se("console",{args:n,level:t});let i=Wn[t];i&&i.apply(O.console,n)}})})}p();p();var Ls=O;function Gi(){if(!("fetch"in Ls))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Fr(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Us(){if(typeof EdgeRuntime=="string")return!0;if(!Gi())return!1;if(Fr(Ls.fetch))return!0;let t=!1,e=Ls.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Fr(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){et&&S.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}p();var il=1e3;function Nt(){return Date.now()/il}function Qf(){let{performance:t}=O;if(!t||!t.now)return Nt;let e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/il}var te=Qf(),Dr,he=(()=>{let{performance:t}=O;if(!t||!t.now){Dr="none";return}let e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i<e,s=t.timing&&t.timing.navigationStart,c=typeof s=="number"?Math.abs(s+n-r):e,l=c<e;return o||l?i<=c?(Dr="timeOrigin",t.timeOrigin):(Dr="navigationStart",s):(Dr="dateNow",r)})();function Mr(t,e){let n="fetch";Ie(n,t),ke(n,()=>sl(void 0,e))}function $s(t){let e="fetch-body-resolved";Ie(e,t),ke(e,()=>sl(em))}function sl(t,e=!1){e&&!Us()||ee(O,"fetch",function(n){return function(...r){let{method:i,url:o}=tm(r),s={args:r,fetchData:{method:i,url:o},startTimestamp:te()*1e3};t||se("fetch",g({},s));let a=new Error().stack;return n.apply(O,r).then(c=>Nn(this,null,function*(){if(t)t(c);else{let l=D(g({},s),{endTimestamp:te()*1e3,response:c});se("fetch",l)}return c}),c=>{if(!t){let l=D(g({},s),{endTimestamp:te()*1e3,error:c});throw se("fetch",l),gn(c)&&c.stack===void 0&&(c.stack=a,ie(c,"framesToPop",1)),c}})}})}function Zf(t,e){if(t&&t.body){let n=t.body.getReader();function r(o){return Nn(this,arguments,function*({done:i}){if(i)return Promise.resolve();try{let s=yield Promise.race([n.read(),new Promise(a=>{setTimeout(()=>{a({done:!0})},5e3)})]);yield r(s)}catch{}})}n.read().then(r).then(()=>{e()}).catch(()=>{})}}function em(t){return Nn(this,null,function*(){let e;try{e=t.clone()}catch{}yield Zf(e,()=>{se("fetch-body-resolved",{endTimestamp:te()*1e3,response:t})})})}function Bs(t,e){return!!t&&typeof t=="object"&&!!t[e]}function ol(t){return typeof t=="string"?t:t?Bs(t,"url")?t.url:t.toString?t.toString():"":""}function tm(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:ol(n),method:Bs(r,"method")?String(r.method).toUpperCase():"GET"}}let e=t[0];return{url:ol(e),method:Bs(e,"method")?String(e.method).toUpperCase():"GET"}}p();var ji=null;function Lr(t){let e="error";Ie(e,t),ke(e,nm)}function nm(){ji=O.onerror,O.onerror=function(t,e,n,r,i){return se("error",{column:r,error:i,line:n,msg:t,url:e}),ji&&!ji.__SENTRY_LOADER__?ji.apply(this,arguments):!1},O.onerror.__SENTRY_INSTRUMENTED__=!0}p();var Wi=null;function Ur(t){let e="unhandledrejection";Ie(e,t),ke(e,rm)}function rm(){Wi=O.onunhandledrejection,O.onunhandledrejection=function(t){return se("unhandledrejection",t),Wi&&!Wi.__SENTRY_LOADER__?Wi.apply(this,arguments):!0},O.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}p();function Hs(){return"npm"}p();function al(){let t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(i){if(t)return e.has(i)?!0:(e.add(i),!1);for(let o=0;o<e.length;o++)if(e[o]===i)return!0;return e.push(i),!1}function r(i){if(t)e.delete(i);else for(let o=0;o<e.length;o++)if(e[o]===i){e.splice(o,1);break}}return[n,r]}p();function G(){let t=O,e=t.crypto||t.msCrypto,n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{let r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function cl(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function mt(t){let{message:e,event_id:n}=t;if(e)return e;let r=cl(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function zn(t,e,n){let r=t.exception=t.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=e||""),o.type||(o.type=n||"Error")}function $t(t,e){let n=cl(t);if(!n)return;let r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism=g(g(g({},r),i),e),e&&"data"in e){let o=g(g({},i&&i.data),e.data);n.mechanism.data=o}}function zi(t){if(t&&t.__sentry_captured__)return!0;try{ie(t,"__sentry_captured__",!0)}catch{}return!1}function Br(t){return Array.isArray(t)?t:[t]}p();function gt(t,e=100,n=1/0){try{return qs("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Yi(t,e=3,n=100*1024){let r=gt(t,e);return am(r)>n?Yi(t,e-1,n):r}function qs(t,e,n=1/0,r=1/0,i=al()){let[o,s]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&!Number.isNaN(e))return e;let a=im(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(o(e))return"[Circular ~]";let l=e;if(l&&typeof l.toJSON=="function")try{let m=l.toJSON();return qs("",m,c-1,r,i)}catch{}let u=Array.isArray(e)?[]:{},d=0,f=Ui(e);for(let m in f){if(!Object.prototype.hasOwnProperty.call(f,m))continue;if(d>=r){u[m]="[MaxProperties ~]";break}let h=f[m];u[m]=qs(m,h,c-1,r,i),d++}return s(e),u}function im(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Nr(e))return"[VueViewModel]";if(ws(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${Le(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=om(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function om(t){let e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function sm(t){return~-encodeURI(t).split(/%..|./).length}function am(t){return sm(JSON.stringify(t))}p();p();var Ht;(function(t){t[t.PENDING=0]="PENDING";let n=1;t[t.RESOLVED=n]="RESOLVED";let r=2;t[t.REJECTED=r]="REJECTED"})(Ht||(Ht={}));function nt(t){return new ht(e=>{e(t)})}function en(t){return new ht((e,n)=>{n(t)})}var ht=class t{constructor(e){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),this._state=Ht.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new t((r,i)=>{this._handlers.push([!1,o=>{if(!e)r(o);else try{r(e(o))}catch(s){i(s)}},o=>{if(!n)i(o);else try{r(n(o))}catch(s){i(s)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let i,o;return this.then(s=>{o=!1,i=s,e&&e()},s=>{o=!0,i=s,e&&e()}).then(()=>{if(o){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(Ht.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Ht.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===Ht.PENDING){if(kt(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Ht.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Ht.RESOLVED&&n[1](this._value),this._state===Ht.REJECTED&&n[2](this._value),n[0]=!0)})}}};function Gs(t){let e=[];function n(){return t===void 0||e.length<t}function r(s){return e.splice(e.indexOf(s),1)[0]||Promise.resolve(void 0)}function i(s){if(!n())return en(new Te("Not adding Promise because buffer limit was reached."));let a=s();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function o(s){return new ht((a,c)=>{let l=e.length;if(!l)return a(!0);let u=setTimeout(()=>{s&&s>0&&a(!1)},s);e.forEach(d=>{nt(d).then(()=>{--l||(clearTimeout(u),a(!0))},c)})})}return{$:e,add:i,drain:o}}p();function rt(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function js(t){return t.split(/[?#]/,1)[0]}p();var ul=["fatal","error","warning","log","info","debug"];function Ws(t){return t==="warn"?"warning":ul.includes(t)?t:"log"}p();p();var Yn="baggage",zs="sentry-",dl=/^sentry-/,pl=8192;function $r(t){let e=fl(t);if(!e)return;let n=Object.entries(e).reduce((r,[i,o])=>{if(i.match(dl)){let s=i.slice(zs.length);r[s]=o}return r},{});if(Object.keys(n).length>0)return n}function Vn(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,i])=>(i&&(n[`${zs}${r}`]=i),n),{});return cm(e)}function fl(t){if(!(!t||!de(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=ll(n);return Object.entries(r).forEach(([i,o])=>{e[i]=o}),e},{}):ll(t)}function ll(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function cm(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],i)=>{let o=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,s=i===0?o:`${e},${o}`;return s.length>pl?(et&&S.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):s},"")}var ml=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function gl(t){if(!t)return;let e=t.match(ml);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function Ys(t,e){let n=gl(t),r=$r(e),{traceId:i,parentSpanId:o,parentSampled:s}=n||{};return n?{traceId:i||G(),parentSpanId:o||G().substring(16),spanId:G().substring(16),sampled:s,dsc:r||{}}:{traceId:i||G(),spanId:G().substring(16)}}function yn(t=G(),e=G().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}p();function _t(t,e=[]){return[t,e]}function Js(t,e){let[n,r]=t;return[n,[...r,e]]}function Vi(t,e){let n=t[1];for(let r of n){let i=r[0].type;if(e(r,i))return!0}return!1}function Vs(t){return O.__SENTRY__&&O.__SENTRY__.encodePolyfill?O.__SENTRY__.encodePolyfill(t):new TextEncoder().encode(t)}function Ks(t){let[e,n]=t,r=JSON.stringify(e);function i(o){typeof r=="string"?r=typeof o=="string"?r+o:[Vs(r),o]:r.push(typeof o=="string"?Vs(o):o)}for(let o of n){let[s,a]=o;if(i(`
${JSON.stringify(s)}
`),typeof a=="string"||a instanceof Uint8Array)i(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(gt(a))}i(c)}}return typeof r=="string"?r:um(r)}function um(t){let e=t.reduce((i,o)=>i+o.length,0),n=new Uint8Array(e),r=0;for(let i of t)n.set(i,r),r+=i.length;return n}function Xs(t){return[{type:"span"},t]}function Qs(t){let e=typeof t.data=="string"?Vs(t.data):t.data;return[X({type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),e]}var lm={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function Ji(t){return lm[t]}function Ki(t){if(!t||!t.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function Zs(t,e,n,r){let i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return g(g(g({event_id:t.event_id,sent_at:new Date().toISOString()},e&&{sdk:e}),!!n&&r&&{dsn:tt(r)}),i&&{trace:X(g({},i))})}p();function ea(t,e,n){let r=[{type:"client_report"},{timestamp:n||Nt(),discarded_events:t}];return _t(e?{dsn:e}:{},[r])}p();function hl(t,e=Date.now()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?6e4:r-e}function _l(t,e){return t[e]||t.all||0}function ta(t,e,n=Date.now()){return _l(t,e)>n}function na(t,{statusCode:e,headers:n},r=Date.now()){let i=g({},t),o=n&&n["x-sentry-rate-limits"],s=n&&n["retry-after"];if(o)for(let a of o.trim().split(",")){let[c,l,,,u]=a.split(":",5),d=parseInt(c,10),f=(isNaN(d)?60:d)*1e3;if(!l)i.all=r+f;else for(let m of l.split(";"))m==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(i[m]=r+f):i[m]=r+f}else s?i.all=r+hl(s,r):e===429&&(i.all=r+60*1e3);return i}p();function Sn(){return{traceId:G(),spanId:G().substring(16)}}p();var Xi=O;function ra(){let t=Xi.chrome,e=t&&t.app&&t.app.runtime,n="history"in Xi&&!!Xi.history.pushState&&!!Xi.history.replaceState;return!e&&n}p();var R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;p();p();p();function vt(){return Hr(O),O}function Hr(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Ze,e[Ze]=e[Ze]||{}}p();p();p();p();function vl(t){let e=te(),n={sid:G(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>dm(n)};return t&&qt(n,t),n}function qt(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||te(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:G()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function yl(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),qt(t,n)}function dm(t){return X({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}p();var ia="_sentrySpan";function tn(t,e){e?ie(t,ia,e):delete t[ia]}function En(t){return t[ia]}var pm=100,oa=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Sn()}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags=g({},this._tags),e._extra=g({},this._extra),e._contexts=g({},this._contexts),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata=g({},this._sdkProcessingMetadata),e._propagationContext=g({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,tn(e,En(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&qt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=g(g({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,n){return this._tags=D(g({},this._tags),{[e]:n}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=g(g({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,n){return this._extra=D(g({},this._extra),{[e]:n}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,[r,i]=n instanceof Ve?[n.getScopeData(),n.getRequestSession()]:pt(n)?[e,e.requestSession]:[],{tags:o,extra:s,user:a,contexts:c,level:l,fingerprint:u=[],propagationContext:d}=r||{};return this._tags=g(g({},this._tags),o),this._extra=g(g({},this._extra),s),this._contexts=g(g({},this._contexts),c),a&&Object.keys(a).length&&(this._user=a),l&&(this._level=l),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),i&&(this._requestSession=i),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,tn(this,void 0),this._attachments=[],this._propagationContext=Sn(),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:pm;if(r<=0)return this;let i=g({timestamp:Nt()},e),o=this._breadcrumbs;return o.push(i),this._breadcrumbs=o.length>r?o.slice(-r):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:En(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=g(g({},this._sdkProcessingMetadata),e),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n&&n.event_id?n.event_id:G();if(!this._client)return S.warn("No client configured on scope - will not capture exception!"),r;let i=new Error("Sentry syntheticException");return this._client.captureException(e,D(g({originalException:e,syntheticException:i},n),{event_id:r}),this),r}captureMessage(e,n,r){let i=r&&r.event_id?r.event_id:G();if(!this._client)return S.warn("No client configured on scope - will not capture message!"),i;let o=new Error(e);return this._client.captureMessage(e,n,D(g({originalException:e,syntheticException:o},r),{event_id:i}),this),i}captureEvent(e,n){let r=n&&n.event_id?n.event_id:G();return this._client?(this._client.captureEvent(e,D(g({},n),{event_id:r}),this),r):(S.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}},Ve=oa;function Sl(){return Gn("defaultCurrentScope",()=>new Ve)}function El(){return Gn("defaultIsolationScope",()=>new Ve)}var sa=class{constructor(e,n){let r;e?r=e:r=new Ve;let i;n?i=n:i=new Ve,this._stack=[{scope:r}],this._isolationScope=i}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(i){throw this._popScope(),i}return kt(r)?r.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Jn(){let t=vt(),e=Hr(t);return e.stack=e.stack||new sa(Sl(),El())}function fm(t){return Jn().withScope(t)}function mm(t,e){let n=Jn();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function bl(t){return Jn().withScope(()=>t(Jn().getIsolationScope()))}function Tl(){return{withIsolationScope:bl,withScope:fm,withSetScope:mm,withSetIsolationScope:(t,e)=>bl(e),getCurrentScope:()=>Jn().getScope(),getIsolationScope:()=>Jn().getIsolationScope()}}function nn(t){let e=Hr(t);return e.acs?e.acs:Tl()}p();function q(){let t=vt();return nn(t).getCurrentScope()}function ae(){let t=vt();return nn(t).getIsolationScope()}function Qi(){return Gn("globalScope",()=>new Ve)}function bn(...t){let e=vt(),n=nn(e);if(t.length===2){let[r,i]=t;return r?n.withSetScope(r,i):n.withScope(i)}return n.withScope(t[0])}function C(){return q().getClient()}p();var gm="_sentryMetrics";function qr(t){let e=t[gm];if(!e)return;let n={};for(let[,[r,i]]of e)(n[r]||(n[r]=[])).push(X(i));return n}p();var pe="sentry.source",Kn="sentry.sample_rate",yt="sentry.op",W="sentry.origin",Xn="sentry.idle_span_finish_reason",Qn="sentry.measurement_unit",Zn="sentry.measurement_value",aa="sentry.profile_id",Gr="sentry.exclusive_time";p();function ca(t){if(t<400&&t>=100)return{code:1};if(t>=400&&t<500)switch(t){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(t>=500&&t<600)switch(t){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"unknown_error"}}function er(t,e){t.setAttribute("http.response.status_code",e);let n=ca(e);n.message!=="unknown_error"&&t.setStatus(n)}var Zi=0,la=1;function kl(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:o,status:s,origin:a}=P(t);return X({parent_span_id:o,span_id:e,trace_id:n,data:r,op:i,status:s,origin:a})}function da(t){let{spanId:e,traceId:n}=t.spanContext(),{parent_span_id:r}=P(t);return X({parent_span_id:r,span_id:e,trace_id:n})}function tr(t){let{traceId:e,spanId:n}=t.spanContext(),r=it(t);return yn(e,n,r)}function St(t){return typeof t=="number"?Il(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Il(t.getTime()):te()}function Il(t){return t>9999999999?t/1e3:t}function P(t){if(ym(t))return t.getSpanJSON();try{let{spanId:e,traceId:n}=t.spanContext();if(vm(t)){let{attributes:r,startTime:i,name:o,endTime:s,parentSpanId:a,status:c}=t;return X({span_id:e,trace_id:n,data:r,description:o,parent_span_id:a,start_timestamp:St(i),timestamp:St(s)||void 0,status:eo(c),op:r[yt],origin:r[W],_metrics_summary:qr(t)})}return{span_id:e,trace_id:n}}catch{return{}}}function vm(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function ym(t){return typeof t.getSpanJSON=="function"}function it(t){let{traceFlags:e}=t.spanContext();return e===la}function eo(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"unknown_error"}var Tn="_sentryChildSpans",ua="_sentryRootSpan";function to(t,e){let n=t[ua]||t;ie(e,ua,n),t[Tn]?t[Tn].add(e):ie(t,Tn,new Set([e]))}function wl(t,e){t[Tn]&&t[Tn].delete(e)}function rn(t){let e=new Set;function n(r){if(!e.has(r)&&it(r)){e.add(r);let i=r[Tn]?Array.from(r[Tn]):[];for(let o of i)n(o)}}return n(t),Array.from(e)}function z(t){return t[ua]||t}function V(){let t=vt(),e=nn(t);return e.getActiveSpan?e.getActiveSpan():En(q())}var xl=!1;function no(){xl||(xl=!0,Lr(pa),Ur(pa))}function pa(){let t=V(),e=t&&z(t);if(e){let n="internal_error";R&&S.log(`[Tracing] Root span: ${n} -> Global error occured`),e.setStatus({code:2,message:n})}}pa.tag="sentry_tracingErrorCallback";p();var Rl="_sentryScope",Al="_sentryIsolationScope";function Nl(t,e,n){t&&(ie(t,Al,n),ie(t,Rl,e))}function fa(t){return{scope:t[Rl],isolationScope:t[Al]}}p();p();function Ue(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||Sm();return!!e&&(e.enableTracing||"tracesSampleRate"in e||"tracesSampler"in e)}function Sm(){let t=C();return t&&t.getOptions()}p();var Je=class{constructor(e={}){this._traceId=e.traceId||G(),this._spanId=e.spanId||G().substring(16)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Zi}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}};p();p();p();var nr="production";var Cl="_frozenDsc";function ma(t,e){ie(t,Cl,e)}function on(t,e){let n=e.getOptions(),{publicKey:r}=e.getDsn()||{},i=X({environment:n.environment||nr,release:n.release,public_key:r,trace_id:t});return e.emit("createDsc",i),i}function Fe(t){let e=C();if(!e)return{};let n=on(P(t).trace_id||"",e),r=z(t),i=r[Cl];if(i)return i;let o=r.spanContext().traceState,s=o&&o.get("sentry.dsc"),a=s&&$r(s);if(a)return a;let c=P(r),l=c.data||{},u=l[Kn];u!=null&&(n.sample_rate=`${u}`);let d=l[pe],f=c.description;return d!=="url"&&f&&(n.transaction=f),n.sampled=String(it(r)),e.emit("createDsc",n,r),n}p();function Pl(t){if(!R)return;let{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=P(t),{spanId:i}=t.spanContext(),o=it(t),s=z(t),a=s===t,c=`[Tracing] Starting ${o?"sampled":"unsampled"} ${a?"root ":""}span`,l=[`op: ${n}`,`name: ${e}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!a){let{op:u,description:d}=P(s);l.push(`root ID: ${s.spanContext().spanId}`),u&&l.push(`root op: ${u}`),d&&l.push(`root description: ${d}`)}S.log(`${c}
  ${l.join(`
  `)}`)}function Ol(t){if(!R)return;let{description:e="< unknown name >",op:n="< unknown op >"}=P(t),{spanId:r}=t.spanContext(),o=z(t)===t,s=`[Tracing] Finishing "${n}" ${o?"root ":""}span "${e}" with ID ${r}`;S.log(s)}p();p();function ro(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(typeof e!="number"||isNaN(e)||e<0||e>1){R&&S.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`);return}return e}function Fl(t,e){if(!Ue(t))return[!1];let n;typeof t.tracesSampler=="function"?n=t.tracesSampler(e):e.parentSampled!==void 0?n=e.parentSampled:typeof t.tracesSampleRate<"u"?n=t.tracesSampleRate:n=1;let r=ro(n);return r===void 0?(R&&S.warn("[Tracing] Discarding transaction because of invalid sample rate."),[!1]):r?Math.random()<r?[!0,r]:(R&&S.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),[!1,r]):(R&&S.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,r])}p();p();function Em(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function Dl(t,e,n,r){let i=Ki(n),o=g(g({sent_at:new Date().toISOString()},i&&{sdk:i}),!!r&&e&&{dsn:tt(e)}),s="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return _t(o,[s])}function Ml(t,e,n,r){let i=Ki(n),o=t.type&&t.type!=="replay_event"?t.type:"event";Em(t,n&&n.sdk);let s=Zs(t,i,r,e);return delete t.sdkProcessingMetadata,_t(s,[[{type:o},t]])}function Ll(t,e){function n(u){return!!u.trace_id&&!!u.public_key}let r=Fe(t[0]),i=e&&e.getDsn(),o=e&&e.getOptions().tunnel,s=g(g({sent_at:new Date().toISOString()},n(r)&&{trace:r}),!!o&&i&&{dsn:tt(i)}),a=e&&e.getOptions().beforeSendSpan,c=a?u=>a(P(u)):u=>P(u),l=[];for(let u of t){let d=c(u);d&&l.push(Xs(d))}return _t(s,l)}p();function io(t,e,n){let r=V(),i=r&&z(r);i&&i.addEvent(t,{[Zn]:e,[Qn]:n})}function oo(t){if(!t||t.length===0)return;let e={};return t.forEach(n=>{let r=n.attributes||{},i=r[Qn],o=r[Zn];typeof i=="string"&&typeof o=="number"&&(e[n.name]={value:o,unit:i})}),e}var Ul=1e3,rr=class{constructor(e={}){this._traceId=e.traceId||G(),this._spanId=e.spanId||G().substring(16),this._startTime=e.startTimestamp||te(),this._attributes={},this.setAttributes(g({[W]:"manual",[yt]:e.op},e.attributes)),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this}addLinks(e){return this}recordException(e,n){}spanContext(){let{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?la:Zi}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=St(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this}end(e){this._endTime||(this._endTime=St(e),Ol(this),this._onSpanEnded())}getSpanJSON(){return X({data:this._attributes,description:this._name,op:this._attributes[yt],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:eo(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[W],_metrics_summary:qr(this),profile_id:this._attributes[aa],exclusive_time:this._attributes[Gr],measurements:oo(this._events),is_segment:this._isStandaloneSpan&&z(this)===this||void 0,segment_id:this._isStandaloneSpan?z(this).spanContext().spanId:void 0})}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){R&&S.log("[Tracing] Adding an event to span:",e);let i=Bl(n)?n:r||te(),o=Bl(n)?{}:n||{},s={name:e,time:St(i),attributes:o};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=C();if(e&&e.emit("spanEnd",this),!(this._isStandaloneSpan||this===z(this)))return;if(this._isStandaloneSpan){this._sampled?Tm(Ll([this],e)):(R&&S.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}let r=this._convertSpanToTransaction();r&&(fa(this).scope||q()).captureEvent(r)}_convertSpanToTransaction(){if(!$l(P(this)))return;this._name||(R&&S.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:n}=fa(this),i=(e||q()).getClient()||C();if(this._sampled!==!0){R&&S.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),i&&i.recordDroppedEvent("sample_rate","transaction");return}let s=rn(this).filter(d=>d!==this&&!bm(d)).map(d=>P(d)).filter($l),a=this._attributes[pe],c=g({contexts:{trace:kl(this)},spans:s.length>Ul?s.sort((d,f)=>d.start_timestamp-f.start_timestamp).slice(0,Ul):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:g({capturedSpanScope:e,capturedSpanIsolationScope:n},X({dynamicSamplingContext:Fe(this)})),_metrics_summary:qr(this)},a&&{transaction_info:{source:a}}),l=oo(this._events);return l&&Object.keys(l).length&&(R&&S.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),c.measurements=l),c}};function Bl(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function $l(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function bm(t){return t instanceof rr&&t.isStandaloneSpan()}function Tm(t){let e=C();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}let r=e.getTransport();r&&r.send(t).then(null,i=>{R&&S.error("Error while sending span:",i)})}var ql="__SENTRY_SUPPRESS_TRACING__";function _e(t){let e=Gl();if(e.startInactiveSpan)return e.startInactiveSpan(t);let n=km(t),{forceTransaction:r,parentSpan:i}=t;return(t.scope?s=>bn(t.scope,s):i!==void 0?s=>jr(i,s):s=>s())(()=>{let s=q(),a=xm(s);return t.onlyIfParent&&!a?new Je:Im({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}function jr(t,e){let n=Gl();return n.withActiveSpan?n.withActiveSpan(t,e):bn(r=>(tn(r,t||void 0),e(r)))}function Im({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){if(!Ue())return new Je;let i=ae(),o;if(t&&!n)o=wm(t,r,e),to(t,o);else if(t){let s=Fe(t),{traceId:a,spanId:c}=t.spanContext(),l=it(t);o=Hl(g({traceId:a,parentSpanId:c},e),r,l),ma(o,s)}else{let{traceId:s,dsc:a,parentSpanId:c,sampled:l}=g(g({},i.getPropagationContext()),r.getPropagationContext());o=Hl(g({traceId:s,parentSpanId:c},e),r,l),a&&ma(o,a)}return Pl(o),Nl(o,r,i),o}function km(t){let e=t.experimental||{},n=g({isStandalone:e.standalone},t);if(t.startTime){let r=g({},n);return r.startTimestamp=St(t.startTime),delete r.startTime,r}return n}function Gl(){let t=vt();return nn(t)}function Hl(t,e,n){let r=C(),i=r&&r.getOptions()||{},{name:o="",attributes:s}=t,[a,c]=e.getScopeData().sdkProcessingMetadata[ql]?[!1]:Fl(i,{name:o,parentSampled:n,attributes:s,transactionContext:{name:o,parentSampled:n}}),l=new rr(D(g({},t),{attributes:g({[pe]:"custom"},t.attributes),sampled:a}));return c!==void 0&&l.setAttribute(Kn,c),r&&r.emit("spanStart",l),l}function wm(t,e,n){let{spanId:r,traceId:i}=t.spanContext(),o=e.getScopeData().sdkProcessingMetadata[ql]?!1:it(t),s=o?new rr(D(g({},n),{parentSpanId:r,traceId:i,sampled:o})):new Je({traceId:i});to(t,s);let a=C();return a&&(a.emit("spanStart",s),n.endTimestamp&&a.emit("spanEnd",s)),s}function xm(t){let e=En(t);if(!e)return;let n=C();return(n?n.getOptions():{}).parentSpanIsAlwaysRootSpan?z(e):e}var ir={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Rm="heartbeatFailed",Am="idleTimeout",Nm="finalTimeout",Cm="externalFinish";function so(t,e={}){let n=new Map,r=!1,i,o=Cm,s=!e.disableAutoFinish,a=[],{idleTimeout:c=ir.idleTimeout,finalTimeout:l=ir.finalTimeout,childSpanTimeout:u=ir.childSpanTimeout,beforeSpanEnd:d}=e,f=C();if(!f||!Ue())return new Je;let m=q(),h=V(),v=Pm(t);v.end=new Proxy(v.end,{apply(I,B,U){d&&d(v);let[fe,...ue]=U,$e=fe||te(),Y=St($e),De=rn(v).filter(Ee=>Ee!==v);if(!De.length)return H(Y),Reflect.apply(I,B,[Y,...ue]);let xe=De.map(Ee=>P(Ee).timestamp).filter(Ee=>!!Ee),Re=xe.length?Math.max(...xe):void 0,He=P(v).start_timestamp,qe=Math.min(He?He+l/1e3:1/0,Math.max(He||-1/0,Math.min(Y,Re||1/0)));return H(qe),Reflect.apply(I,B,[qe,...ue])}});function T(){i&&(clearTimeout(i),i=void 0)}function F(I){T(),i=setTimeout(()=>{!r&&n.size===0&&s&&(o=Am,v.end(I))},c)}function L(I){i=setTimeout(()=>{!r&&s&&(o=Rm,v.end(I))},u)}function N(I){T(),n.set(I,!0);let B=te();L(B+u/1e3)}function $(I){if(n.has(I)&&n.delete(I),n.size===0){let B=te();F(B+c/1e3)}}function H(I){r=!0,n.clear(),a.forEach(Y=>Y()),tn(m,h);let B=P(v),{start_timestamp:U}=B;if(!U)return;(B.data||{})[Xn]||v.setAttribute(Xn,o),S.log(`[Tracing] Idle span "${B.op}" finished`);let ue=rn(v).filter(Y=>Y!==v),$e=0;ue.forEach(Y=>{Y.isRecording()&&(Y.setStatus({code:2,message:"cancelled"}),Y.end(I),R&&S.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Y,void 0,2)));let De=P(Y),{timestamp:xe=0,start_timestamp:Re=0}=De,He=Re<=I,qe=(l+c)/1e3,Ee=xe-Re<=qe;if(R){let Ge=JSON.stringify(Y,void 0,2);He?Ee||S.log("[Tracing] Discarding span since it finished after idle span final timeout",Ge):S.log("[Tracing] Discarding span since it happened after idle span was finished",Ge)}(!Ee||!He)&&(wl(v,Y),$e++)}),$e>0&&v.setAttribute("sentry.idle_span_discarded_spans",$e)}return a.push(f.on("spanStart",I=>{if(r||I===v||P(I).timestamp)return;rn(v).includes(I)&&N(I.spanContext().spanId)})),a.push(f.on("spanEnd",I=>{r||$(I.spanContext().spanId)})),a.push(f.on("idleSpanEnableAutoFinish",I=>{I===v&&(s=!0,F(),n.size&&L())})),e.disableAutoFinish||F(),setTimeout(()=>{r||(v.setStatus({code:2,message:"deadline_exceeded"}),o=Nm,v.end())},l),v}function Pm(t){let e=_e(t);return tn(q(),e),R&&S.log("[Tracing] Started span is an idle span"),e}p();p();p();function ao(t,e,n,r=0){return new ht((i,o)=>{let s=t[r];if(e===null||typeof s!="function")i(e);else{let a=s(g({},e),n);R&&s.id&&a===null&&S.log(`Event processor "${s.id}" dropped event`),kt(a)?a.then(c=>ao(t,c,n,r+1).then(i)).then(null,o):ao(t,a,n,r+1).then(i).then(null,o)}})}p();function jl(t,e){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:o}=e;Om(t,e),r&&Mm(t,r),Lm(t,n),Fm(t,i),Dm(t,o)}function ga(t,e){let{extra:n,tags:r,user:i,contexts:o,level:s,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:l,eventProcessors:u,attachments:d,propagationContext:f,transactionName:m,span:h}=e;Wr(t,"extra",n),Wr(t,"tags",r),Wr(t,"user",i),Wr(t,"contexts",o),Wr(t,"sdkProcessingMetadata",a),s&&(t.level=s),m&&(t.transactionName=m),h&&(t.span=h),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),l.length&&(t.fingerprint=[...t.fingerprint,...l]),u.length&&(t.eventProcessors=[...t.eventProcessors,...u]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext=g(g({},t.propagationContext),f)}function Wr(t,e,n){if(n&&Object.keys(n).length){t[e]=g({},t[e]);for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[e][r]=n[r])}}function Om(t,e){let{extra:n,tags:r,user:i,contexts:o,level:s,transactionName:a}=e,c=X(n);c&&Object.keys(c).length&&(t.extra=g(g({},c),t.extra));let l=X(r);l&&Object.keys(l).length&&(t.tags=g(g({},l),t.tags));let u=X(i);u&&Object.keys(u).length&&(t.user=g(g({},u),t.user));let d=X(o);d&&Object.keys(d).length&&(t.contexts=g(g({},d),t.contexts)),s&&(t.level=s),a&&t.type!=="transaction"&&(t.transaction=a)}function Fm(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function Dm(t,e){t.sdkProcessingMetadata=g(g({},t.sdkProcessingMetadata),e)}function Mm(t,e){t.contexts=g({trace:da(e)},t.contexts),t.sdkProcessingMetadata=g({dynamicSamplingContext:Fe(e)},t.sdkProcessingMetadata);let n=z(e),r=P(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function Lm(t,e){t.fingerprint=t.fingerprint?Br(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}function zl(t,e,n,r,i,o){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=t,c=D(g({},e),{event_id:e.event_id||n.event_id||G(),timestamp:e.timestamp||Nt()}),l=n.integrations||t.integrations.map(T=>T.name);Um(c,t),Hm(c,l),i&&i.emit("applyFrameMetadata",e),e.type===void 0&&Bm(c,t.stackParser);let u=Gm(r,n.captureContext);n.mechanism&&$t(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Qi().getScopeData();if(o){let T=o.getScopeData();ga(f,T)}if(u){let T=u.getScopeData();ga(f,T)}let m=[...n.attachments||[],...f.attachments];m.length&&(n.attachments=m),jl(c,f);let h=[...d,...f.eventProcessors];return ao(h,c,n).then(T=>(T&&$m(T),typeof s=="number"&&s>0?qm(T,s,a):T))}function Um(t,e){let{environment:n,release:r,dist:i,maxValueLength:o=250}=e;"environment"in t||(t.environment="environment"in e?n:nr),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&i!==void 0&&(t.dist=i),t.message&&(t.message=wt(t.message,o));let s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=wt(s.value,o));let a=t.request;a&&a.url&&(a.url=wt(a.url,o))}var Wl=new WeakMap;function Bm(t,e){let n=O._sentryDebugIds;if(!n)return;let r,i=Wl.get(e);i?r=i:(r=new Map,Wl.set(e,r));let o=Object.entries(n).reduce((s,[a,c])=>{let l,u=r.get(a);u?l=u:(l=e(a),r.set(a,l));for(let d=l.length-1;d>=0;d--){let f=l[d];if(f.filename){s[f.filename]=c;break}}return s},{});try{t.exception.values.forEach(s=>{s.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=o[a.filename])})})}catch{}}function $m(t){let e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?e[i.abs_path]=i.debug_id:i.filename&&(e[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,i])=>{n.push({type:"sourcemap",code_file:r,debug_id:i})})}function Hm(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function qm(t,e,n){if(!t)return null;let r=g(g(g(g(g({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>g(g({},i),i.data&&{data:gt(i.data,e,n)}))}),t.user&&{user:gt(t.user,e,n)}),t.contexts&&{contexts:gt(t.contexts,e,n)}),t.extra&&{extra:gt(t.extra,e,n)});return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=gt(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>g(g({},i),i.data&&{data:gt(i.data,e,n)}))),r}function Gm(t,e){if(!e)return t;let n=t?t.clone():new Ve;return n.update(e),n}function Yl(t){if(t)return jm(t)?{captureContext:t}:zm(t)?{captureContext:t}:t}function jm(t){return t instanceof Ve||typeof t=="function"}var Wm=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function zm(t){return Object.keys(t).some(e=>Wm.includes(e))}function sn(t,e){return q().captureException(t,Yl(e))}function zr(t,e){return q().captureEvent(t,e)}function co(t,e){ae().setContext(t,e)}function uo(){return ae().lastEventId()}function lo(t){return Nn(this,null,function*(){let e=C();return e?e.flush(t):(R&&S.warn("Cannot flush events. No client defined."),Promise.resolve(!1))})}function Yr(t){let e=C(),n=ae(),r=q(),{release:i,environment:o=nr}=e&&e.getOptions()||{},{userAgent:s}=O.navigator||{},a=vl(g(g({release:i,environment:o,user:r.getUser()||n.getUser()},s&&{userAgent:s}),t)),c=n.getSession();return c&&c.status==="ok"&&qt(c,{status:"exited"}),po(),n.setSession(a),r.setSession(a),a}function po(){let t=ae(),e=q(),n=e.getSession()||t.getSession();n&&yl(n),Jl(),t.setSession(),e.setSession()}function Jl(){let t=ae(),e=q(),n=C(),r=e.getSession()||t.getSession();r&&n&&n.captureSession(r)}function Vr(t=!1){if(t){po();return}Jl()}p();var Ym="7";function Kl(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function Vm(t){return`${Kl(t)}${t.projectId}/envelope/`}function Jm(t,e){return Ps(g({sentry_key:t.publicKey,sentry_version:Ym},e&&{sentry_client:`${e.name}/${e.version}`}))}function ha(t,e,n){return e||`${Vm(t)}?${Jm(t,n)}`}function _a(t,e){let n=Or(t);if(!n)return"";let r=`${Kl(n)}embed/error-page/`,i=`dsn=${tt(n)}`;for(let o in e)if(o!=="dsn"&&o!=="onClose")if(o==="user"){let s=e.user;if(!s)continue;s.name&&(i+=`&name=${encodeURIComponent(s.name)}`),s.email&&(i+=`&email=${encodeURIComponent(s.email)}`)}else i+=`&${encodeURIComponent(o)}=${encodeURIComponent(e[o])}`;return`${r}?${i}`}p();p();var Xl=[];function Km(t){let e={};return t.forEach(n=>{let{name:r}=n,i=e[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function va(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=Br(n(e)):r=e;let i=Km(r),o=i.findIndex(s=>s.name==="Debug");if(o>-1){let[s]=i.splice(o,1);i.push(s)}return i}function Ql(t,e){let n={};return e.forEach(r=>{r&&Sa(t,r,n)}),n}function ya(t,e){for(let n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function Sa(t,e,n){if(n[e.name]){R&&S.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,Xl.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),Xl.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,o)=>r(i,o,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),i=Object.assign((o,s)=>r(o,s,t),{id:e.name});t.addEventProcessor(i)}R&&S.log(`Integration installed: ${e.name}`)}var Zl="Not capturing exception because it's already been captured.",Jr=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=Or(e.dsn):R&&S.warn("No DSN provided, client will not send events."),this._dsn){let n=ha(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(D(g({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:n}))}}captureException(e,n,r){let i=G();if(zi(e))return R&&S.log(Zl),i;let o=g({event_id:i},n);return this._process(this.eventFromException(e,o).then(s=>this._captureEvent(s,o,r))),o.event_id}captureMessage(e,n,r,i){let o=g({event_id:G()},r),s=qn(e)?e:String(e),a=hn(e)?this.eventFromMessage(s,n,o):this.eventFromException(e,o);return this._process(a.then(c=>this._captureEvent(c,o,i))),o.event_id}captureEvent(e,n,r){let i=G();if(n&&n.originalException&&zi(n.originalException))return R&&S.log(Zl),i;let o=g({event_id:i},n),a=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,o,a||r)),o.event_id}captureSession(e){typeof e.release!="string"?R&&S.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),qt(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):nt(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let n=this._integrations[e.name];Sa(this,e,this._integrations),n||ya(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=Ml(e,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=Js(r,Qs(o));let i=this.sendEnvelope(r);i&&i.then(o=>this.emit("afterSendEvent",e,o),null)}sendSession(e){let n=Dl(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){let i=typeof r=="number"?r:1,o=`${e}:${n}`;R&&S.log(`Recording outcome: "${o}"${i>1?` (${i} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+i}}on(e,n){let r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{let i=r.indexOf(n);i>-1&&r.splice(i,1)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(i=>i(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(R&&S.error("Error while sending event:",n),n)):(R&&S.error("Transport disabled"),nt({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Ql(this,e),ya(this,e)}_updateSessionFromEvent(e,n){let r=!1,i=!1,o=n.exception&&n.exception.values;if(o){i=!0;for(let c of o){let l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}let s=e.status==="ok";(s&&e.errors===0||s&&r)&&(qt(e,D(g({},r&&{status:"crashed"}),{errors:e.errors||Number(i||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return new ht(n=>{let r=0,i=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),n(!0)):(r+=i,e&&r>=e&&(clearInterval(o),n(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,i=ae()){let o=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s.length>0&&(n.integrations=s),this.emit("preprocessEvent",e,n),e.type||i.setLastEventId(e.event_id||n.event_id),zl(o,e,n,r,this,i).then(a=>{if(a===null)return a;let c=g(g({},i.getPropagationContext()),r?r.getPropagationContext():void 0);if(!(a.contexts&&a.contexts.trace)&&c){let{traceId:u,spanId:d,parentSpanId:f,dsc:m}=c;a.contexts=g({trace:X({trace_id:u,span_id:d,parent_span_id:f})},a.contexts);let h=m||on(u,this);a.sdkProcessingMetadata=g({dynamicSamplingContext:h},a.sdkProcessingMetadata)}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(R){let o=i;o.logLevel==="log"?S.log(o.message):S.warn(o)}})}_processEvent(e,n,r){let i=this.getOptions(),{sampleRate:o}=i,s=td(e),a=ed(e),c=e.type||"error",l=`before send for type \`${c}\``,u=typeof o>"u"?void 0:ro(o);if(a&&typeof u=="number"&&Math.random()>u)return this.recordDroppedEvent("sample_rate","error",e),en(new Te(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));let d=c==="replay_event"?"replay":c,m=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,m).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",d,e),new Te("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return h;let T=Qm(this,i,h,n);return Xm(T,l)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",d,e),s){let L=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",L)}throw new Te(`${l} returned \`null\`, will not send event.`,"log")}let v=r&&r.getSession();if(!s&&v&&this._updateSessionFromEvent(v,h),s){let F=h.sdkProcessingMetadata&&h.sdkProcessingMetadata.spanCountBeforeProcessing||0,L=h.spans?h.spans.length:0,N=F-L;N>0&&this.recordDroppedEvent("before_send","span",N)}let T=h.transaction_info;if(s&&T&&h.transaction!==e.transaction){let F="custom";h.transaction_info=D(g({},T),{source:F})}return this.sendEvent(h,n),h}).then(null,h=>{throw h instanceof Te?h:(this.captureException(h,{data:{__sentry__:!0},originalException:h}),new Te(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${h}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[i,o]=n.split(":");return{reason:i,category:o,quantity:r}})}_flushOutcomes(){R&&S.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){R&&S.log("No outcomes to send");return}if(!this._dsn){R&&S.log("No dsn provided, will not send outcomes");return}R&&S.log("Sending outcomes:",e);let n=ea(e,this._options.tunnel&&tt(this._dsn));this.sendEnvelope(n)}};function Xm(t,e){let n=`${e} must return \`null\` or a valid event.`;if(kt(t))return t.then(r=>{if(!pt(r)&&r!==null)throw new Te(n);return r},r=>{throw new Te(`${e} rejected with ${r}`)});if(!pt(t)&&t!==null)throw new Te(n);return t}function Qm(t,e,n,r){let{beforeSend:i,beforeSendTransaction:o,beforeSendSpan:s}=e;if(ed(n)&&i)return i(n,r);if(td(n)){if(n.spans&&s){let a=[];for(let c of n.spans){let l=s(c);l?a.push(l):t.recordDroppedEvent("before_send","span")}n.spans=a}if(o){if(n.spans){let a=n.spans.length;n.sdkProcessingMetadata=D(g({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:a})}return o(n,r)}}return n}function ed(t){return t.type===void 0}function td(t){return t.type==="transaction"}p();function Ea(t,e){e.debug===!0&&(R?S.enable():Rt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),q().update(e.initialScope);let r=new t(e);return ba(r),r.init(),r}function ba(t){q().setClient(t)}p();var Zm=64;function fo(t,e,n=Gs(t.bufferSize||Zm)){let r={},i=s=>n.drain(s);function o(s){let a=[];if(Vi(s,(d,f)=>{let m=Ji(f);if(ta(r,m)){let h=nd(d,f);t.recordDroppedEvent("ratelimit_backoff",m,h)}else a.push(d)}),a.length===0)return nt({});let c=_t(s[0],a),l=d=>{Vi(c,(f,m)=>{let h=nd(f,m);t.recordDroppedEvent(d,Ji(m),h)})},u=()=>e({body:Ks(c)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&R&&S.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=na(r,d),d),d=>{throw l("network_error"),d});return n.add(u).then(d=>d,d=>{if(d instanceof Te)return R&&S.error("Skipped sending event because buffer is full."),l("queue_overflow"),nt({});throw d})}return{send:o,flush:i}}function nd(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}p();function Kr(t,e,n=[e],r="npm"){let i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(o=>({name:`${r}:@sentry/${o}`,version:Ze})),version:Ze}),t._metadata=i}p();var eg=100;function Ct(t,e){let n=C(),r=ae();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:o=eg}=n.getOptions();if(o<=0)return;let s=Nt(),a=g({timestamp:s},t),c=i?Rt(()=>i(a,e)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,o))}p();var rd,tg="FunctionToString",id=new WeakMap,ng=()=>({name:tg,setupOnce(){rd=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=vn(this),n=id.has(C())&&e!==void 0?e:this;return rd.apply(n,t)}}catch{}},setup(t){id.set(t,!0)}}),or=ng;p();var rg=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler"],ig="InboundFilters",og=(t={})=>({name:ig,processEvent(e,n,r){let i=r.getOptions(),o=sg(t,i);return ag(e,o)?null:e}}),sr=og;function sg(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:rg],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function ag(t,e){return e.ignoreInternal&&fg(t)?(R&&S.warn(`Event dropped due to being internal Sentry Error.
Event: ${mt(t)}`),!0):cg(t,e.ignoreErrors)?(R&&S.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${mt(t)}`),!0):gg(t)?(R&&S.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${mt(t)}`),!0):ug(t,e.ignoreTransactions)?(R&&S.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${mt(t)}`),!0):lg(t,e.denyUrls)?(R&&S.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${mt(t)}.
Url: ${mo(t)}`),!0):dg(t,e.allowUrls)?!1:(R&&S.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${mt(t)}.
Url: ${mo(t)}`),!0)}function cg(t,e){return t.type||!e||!e.length?!1:pg(t).some(n=>xt(n,e))}function ug(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let n=t.transaction;return n?xt(n,e):!1}function lg(t,e){if(!e||!e.length)return!1;let n=mo(t);return n?xt(n,e):!1}function dg(t,e){if(!e||!e.length)return!0;let n=mo(t);return n?xt(n,e):!0}function pg(t){let e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),e}function fg(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function mg(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function mo(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?mg(e):null}catch{return R&&S.error(`Cannot extract url for event ${mt(t)}`),null}}function gg(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}p();var hg="Dedupe",_g=()=>{let t;return{name:hg,processEvent(e){if(e.type)return e;try{if(vg(e,t))return R&&S.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},ar=_g;function vg(t,e){return e?!!(yg(t,e)||Sg(t,e)):!1}function yg(t,e){let n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!ad(t,e)||!sd(t,e))}function Sg(t,e){let n=od(e),r=od(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!ad(t,e)||!sd(t,e))}function sd(t,e){let n=Hi(t),r=Hi(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){let o=r[i],s=n[i];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function ad(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function od(t){return t.exception&&t.exception.values&&t.exception.values[0]}p();function Ta(t,e,n,r,i="auto.http.browser"){if(!t.fetchData)return;let o=Ue()&&e(t.fetchData.url);if(t.endTimestamp&&o){let h=t.fetchData.__span;if(!h)return;let v=r[h];v&&(bg(v,t),delete r[h]);return}let s=q(),a=C(),{method:c,url:l}=t.fetchData,u=Eg(l),d=u?rt(u).host:void 0,f=!!V(),m=o&&f?_e({name:`${c} ${l}`,attributes:{url:l,type:"fetch","http.method":c,"http.url":u,"server.address":d,[W]:i,[yt]:"http.client"}}):new Je;if(t.fetchData.__span=m.spanContext().spanId,r[m.spanContext().spanId]=m,n(t.fetchData.url)&&a){let h=t.args[0];t.args[1]=t.args[1]||{};let v=t.args[1];v.headers=cd(h,a,s,v,Ue()&&f?m:void 0)}return m}function cd(t,e,n,r,i){let o=ae(),{traceId:s,spanId:a,sampled:c,dsc:l}=g(g({},o.getPropagationContext()),n.getPropagationContext()),u=i?tr(i):yn(s,a,c),d=Vn(l||(i?Fe(i):on(s,e))),f=r.headers||(typeof Request<"u"&&Ye(t,Request)?t.headers:void 0);if(f)if(typeof Headers<"u"&&Ye(f,Headers)){let m=new Headers(f);return m.append("sentry-trace",u),d&&m.append(Yn,d),m}else if(Array.isArray(f)){let m=[...f,["sentry-trace",u]];return d&&m.push([Yn,d]),m}else{let m="baggage"in f?f.baggage:void 0,h=[];return Array.isArray(m)?h.push(...m):m&&h.push(m),d&&h.push(d),D(g({},f),{"sentry-trace":u,baggage:h.length>0?h.join(","):void 0})}else return{"sentry-trace":u,baggage:d}}function Eg(t){try{return new URL(t).href}catch{return}}function bg(t,e){if(e.response){er(t,e.response.status);let n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){let r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:2,message:"internal_error"});t.end()}p();var A=O,Ia=0;function ka(){return Ia>0}function Ug(){Ia++,setTimeout(()=>{Ia--})}function kn(t,e={},n){if(typeof t!="function")return t;try{let i=t.__sentry_wrapped__;if(i)return i;if(vn(t))return t}catch{return t}let r=function(){let i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);let o=i.map(s=>kn(s,e));return t.apply(this,o)}catch(o){throw Ug(),bn(s=>{s.addEventProcessor(a=>(e.mechanism&&(zn(a,void 0,void 0),$t(a,e.mechanism)),a.extra=D(g({},a.extra),{arguments:i}),a)),sn(o)}),o}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}Li(r,t),ie(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}p();p();var ce=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;p();function go(t,e){let n=Ra(t,e),r={type:e&&e.name,value:Gg(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Bg(t,e,n,r){let i=C(),o=i&&i.getOptions().normalizeDepth,s=zg(e),a={__serialized__:Yi(e,o)};if(s)return{exception:{values:[go(t,s)]},extra:a};let c={exception:{values:[{type:_n(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:jg(e,{isUnhandledRejection:r})}]},extra:a};if(n){let l=Ra(t,n);l.length&&(c.exception.values[0].stacktrace={frames:l})}return c}function wa(t,e){return{exception:{values:[go(t,e)]}}}function Ra(t,e){let n=e.stacktrace||e.stack||"",r=Hg(e),i=qg(e);try{return t(n,r,i)}catch{}return[]}var $g=/Minified React error #\d+;/i;function Hg(t){return t&&$g.test(t.message)?1:0}function qg(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Gg(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function ld(t,e,n,r){let i=n&&n.syntheticException||void 0,o=ho(t,e,i,r);return $t(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),nt(o)}function dd(t,e,n="info",r,i){let o=r&&r.syntheticException||void 0,s=xa(t,e,o,i);return s.level=n,r&&r.event_id&&(s.event_id=r.event_id),nt(s)}function ho(t,e,n,r,i){let o;if(Fi(e)&&e.error)return wa(t,e.error);if(Di(e)||Ts(e)){let s=e;if("stack"in e)o=wa(t,e);else{let a=s.name||(Di(s)?"DOMError":"DOMException"),c=s.message?`${a}: ${s.message}`:a;o=xa(t,c,n,r),zn(o,c)}return"code"in s&&(o.tags=D(g({},o.tags),{"DOMException.code":`${s.code}`})),o}return gn(e)?wa(t,e):pt(e)||_n(e)?(o=Bg(t,e,n,i),$t(o,{synthetic:!0}),o):(o=xa(t,e,n,r),zn(o,`${e}`,void 0),$t(o,{synthetic:!0}),o)}function xa(t,e,n,r){let i={};if(r&&n){let o=Ra(t,n);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]})}if(qn(e)){let{__sentry_template_string__:o,__sentry_template_values__:s}=e;return i.logentry={message:o,params:s},i}return i.message=e,i}function jg(t,{isUnhandledRejection:e}){let n=Os(t),r=e?"promise rejection":"exception";return Fi(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:_n(t)?`Event \`${Wg(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Wg(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function zg(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];if(n instanceof Error)return n}}p();function pd(t,{metadata:e,tunnel:n,dsn:r}){let i=g(g({event_id:t.event_id,sent_at:new Date().toISOString()},e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}}),!!n&&!!r&&{dsn:tt(r)}),o=Yg(t);return _t(i,[o])}function Yg(t){return[{type:"user_report"},t]}var _o=class extends Jr{constructor(e){let n=g({parentSpanIsAlwaysRootSpan:!0},e),r=A.SENTRY_SDK_SOURCE||Hs();Kr(n,"browser",["browser"],r),super(n),n.sendClientReports&&A.document&&A.document.addEventListener("visibilitychange",()=>{A.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return ld(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return dd(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){ce&&S.warn("SDK not enabled, will not capture user feedback.");return}let n=pd(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}};p();p();p();p();var we=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;p();p();var Vg=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",ot=(t,e,n,r)=>{let i,o;return s=>{e.value>=0&&(s||r)&&(o=e.value-(i||0),(o||i===void 0)&&(i=e.value,e.delta=o,e.rating=Vg(e.value,n),t(e)))}};p();p();var k=O;p();var fd=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;p();p();var Gt=()=>k.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];var an=()=>{let t=Gt();return t&&t.activationStart||0};var st=(t,e)=>{let n=Gt(),r="navigate";return n&&(k.document&&k.document.prerendering||an()>0?r="prerender":k.document&&k.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:fd(),navigationType:r}};p();var Be=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let r=new PerformanceObserver(i=>{Promise.resolve().then(()=>{e(i.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}};p();var cn=t=>{let e=n=>{(n.type==="pagehide"||k.document&&k.document.visibilityState==="hidden")&&t(n)};k.document&&(addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0))};p();var cr=t=>{let e=!1;return n=>{e||(t(n),e=!0)}};p();p();var Xr=-1,Jg=()=>{Xr=k.document.visibilityState==="hidden"&&!k.document.prerendering?0:1/0},vo=t=>{k.document.visibilityState==="hidden"&&Xr>-1&&(Xr=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("visibilitychange",vo,!0),removeEventListener("prerenderingchange",vo,!0))},Kg=()=>{addEventListener("visibilitychange",vo,!0),addEventListener("prerenderingchange",vo,!0)},un=()=>(k.document&&Xr<0&&(Jg(),Kg()),{get firstHiddenTime(){return Xr}});p();var Pt=t=>{k.document&&k.document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()};var Xg=[1800,3e3],md=(t,e={})=>{Pt(()=>{let n=un(),r=st("FCP"),i,s=Be("paint",a=>{a.forEach(c=>{c.name==="first-contentful-paint"&&(s.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-an(),0),r.entries.push(c),i(!0)))})});s&&(i=ot(t,r,Xg,e.reportAllChanges))})};var Qg=[.1,.25],gd=(t,e={})=>{md(cr(()=>{let n=st("CLS",0),r,i=0,o=[],s=c=>{c.forEach(l=>{if(!l.hadRecentInput){let u=o[0],d=o[o.length-1];i&&u&&d&&l.startTime-d.startTime<1e3&&l.startTime-u.startTime<5e3?(i+=l.value,o.push(l)):(i=l.value,o=[l])}}),i>n.value&&(n.value=i,n.entries=o,r())},a=Be("layout-shift",s);a&&(r=ot(t,n,Qg,e.reportAllChanges),cn(()=>{s(a.takeRecords()),r(!0)}),setTimeout(r,0))}))};p();var Zg=[100,300],hd=(t,e={})=>{Pt(()=>{let n=un(),r=st("FID"),i,o=c=>{c.startTime<n.firstHiddenTime&&(r.value=c.processingStart-c.startTime,r.entries.push(c),i(!0))},s=c=>{c.forEach(o)},a=Be("first-input",s);i=ot(t,r,Zg,e.reportAllChanges),a&&cn(cr(()=>{s(a.takeRecords()),a.disconnect()}))})};p();p();var _d=0,Aa=1/0,yo=0,eh=t=>{t.forEach(e=>{e.interactionId&&(Aa=Math.min(Aa,e.interactionId),yo=Math.max(yo,e.interactionId),_d=yo?(yo-Aa)/7+1:0)})},Na,vd=()=>Na?_d:performance.interactionCount||0,yd=()=>{"interactionCount"in performance||Na||(Na=Be("event",eh,{type:"event",buffered:!0,durationThreshold:0}))};var th=[200,500],nh=0,bd=()=>vd()-nh,Sd=10,jt=[],Ca={},Ed=t=>{let e=jt[jt.length-1],n=Ca[t.interactionId];if(n||jt.length<Sd||e&&t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{let r={id:t.interactionId,latency:t.duration,entries:[t]};Ca[r.id]=r,jt.push(r)}jt.sort((r,i)=>i.latency-r.latency),jt.splice(Sd).forEach(r=>{delete Ca[r.id]})}},rh=()=>{let t=Math.min(jt.length-1,Math.floor(bd()/50));return jt[t]},Td=(t,e={})=>{Pt(()=>{yd();let n=st("INP"),r,i=s=>{s.forEach(c=>{c.interactionId&&Ed(c),c.entryType==="first-input"&&!jt.some(u=>u.entries.some(d=>c.duration===d.duration&&c.startTime===d.startTime))&&Ed(c)});let a=rh();a&&a.latency!==n.value&&(n.value=a.latency,n.entries=a.entries,r())},o=Be("event",i,{durationThreshold:e.durationThreshold!=null?e.durationThreshold:40});r=ot(t,n,th,e.reportAllChanges),o&&("PerformanceEventTiming"in k&&"interactionId"in PerformanceEventTiming.prototype&&o.observe({type:"first-input",buffered:!0}),cn(()=>{i(o.takeRecords()),n.value<0&&bd()>0&&(n.value=0,n.entries=[]),r(!0)}))})};p();var ih=[2500,4e3],Id={},kd=(t,e={})=>{Pt(()=>{let n=un(),r=st("LCP"),i,o=a=>{let c=a[a.length-1];c&&c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-an(),0),r.entries=[c],i())},s=Be("largest-contentful-paint",o);if(s){i=ot(t,r,ih,e.reportAllChanges);let a=cr(()=>{Id[r.id]||(o(s.takeRecords()),s.disconnect(),Id[r.id]=!0,i(!0))});["keydown","click"].forEach(c=>{k.document&&addEventListener(c,()=>setTimeout(a,0),!0)}),cn(a)}})};p();var oh=[800,1800],Pa=t=>{k.document&&k.document.prerendering?Pt(()=>Pa(t)):k.document&&k.document.readyState!=="complete"?addEventListener("load",()=>Pa(t),!0):setTimeout(t,0)},wd=(t,e={})=>{let n=st("TTFB"),r=ot(t,n,oh,e.reportAllChanges);Pa(()=>{let i=Gt();if(i){let o=i.responseStart;if(o<=0||o>performance.now())return;n.value=Math.max(o-an(),0),n.entries=[i],r(!0)}})};var Qr={},So={},xd,Rd,Ad,Nd,Cd;function Oa(t,e=!1){return Zr("cls",t,sh,xd,e)}function Fa(t,e=!1){return Zr("lcp",t,ch,Ad,e)}function Da(t){return Zr("fid",t,ah,Rd)}function Ma(t){return Zr("ttfb",t,uh,Nd)}function La(t){return Zr("inp",t,lh,Cd)}function Wt(t,e){return Pd(t,e),So[t]||(dh(t),So[t]=!0),Od(t,e)}function ur(t,e){let n=Qr[t];if(!(!n||!n.length))for(let r of n)try{r(e)}catch(i){we&&S.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${Le(r)}
Error:`,i)}}function sh(){return gd(t=>{ur("cls",{metric:t}),xd=t},{reportAllChanges:!0})}function ah(){return hd(t=>{ur("fid",{metric:t}),Rd=t})}function ch(){return kd(t=>{ur("lcp",{metric:t}),Ad=t},{reportAllChanges:!0})}function uh(){return wd(t=>{ur("ttfb",{metric:t}),Nd=t})}function lh(){return Td(t=>{ur("inp",{metric:t}),Cd=t})}function Zr(t,e,n,r,i=!1){Pd(t,e);let o;return So[t]||(o=n(),So[t]=!0),r&&e({metric:r}),Od(t,e,i?o:void 0)}function dh(t){let e={};t==="event"&&(e.durationThreshold=0),Be(t,n=>{ur(t,{entries:n})},e)}function Pd(t,e){Qr[t]=Qr[t]||[],Qr[t].push(e)}function Od(t,e,n){return()=>{n&&n();let r=Qr[t];if(!r)return;let i=r.indexOf(e);i!==-1&&r.splice(i,1)}}function Fd(t){return"duration"in t}p();p();function Eo(t){return typeof t=="number"&&isFinite(t)}function wn(t,e,n,i){var r=oc(i,[]);let o=P(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),jr(t,()=>{let s=_e(g({startTime:e},r));return s&&s.end(n),s})}function ei(){return k&&k.addEventListener&&k.performance}function ne(t){return t/1e3}var ph=2147483647,Dd=0,ve={},Ot,ti;function Ba(){let t=ei();if(t&&he){t.mark&&k.performance.mark("sentry-tracing-init");let e=gh(),n=fh(),r=mh(),i=hh();return()=>{e(),n(),r(),i()}}return()=>{}}function $a(){Wt("longtask",({entries:t})=>{for(let e of t){if(!V())return;let n=ne(he+e.startTime),r=ne(e.duration),i=_e({name:"Main UI thread blocked",op:"ui.long-task",startTime:n,attributes:{[W]:"auto.ui.browser.metrics"}});i&&i.end(n+r)}})}function Ha(){new PerformanceObserver(e=>{for(let n of e.getEntries()){if(!V()||!n.scripts[0])return;let r=ne(he+n.startTime),i=ne(n.duration),o={[W]:"auto.ui.browser.metrics"},s=n.scripts[0];if(s){let{invoker:c,invokerType:l,sourceURL:u,sourceFunctionName:d,sourceCharPosition:f}=s;o["browser.script.invoker"]=c,o["browser.script.invoker_type"]=l,u&&(o["code.filepath"]=u),d&&(o["code.function"]=d),f!==-1&&(o["browser.script.source_char_position"]=f)}let a=_e({name:"Main UI thread blocked",op:"ui.long-animation-frame",startTime:r,attributes:o});a&&a.end(r+i)}}).observe({type:"long-animation-frame",buffered:!0})}function qa(){Wt("event",({entries:t})=>{for(let e of t){if(!V())return;if(e.name==="click"){let n=ne(he+e.startTime),r=ne(e.duration),i={name:ft(e.target),op:`ui.interaction.${e.name}`,startTime:n,attributes:{[W]:"auto.ui.browser.metrics"}},o=Cr(e.target);o&&(i.attributes["ui.component_name"]=o);let s=_e(i);s&&s.end(n+r)}}})}function fh(){return Oa(({metric:t})=>{let e=t.entries[t.entries.length-1];e&&(we&&S.log("[Measurements] Adding CLS"),ve.cls={value:t.value,unit:""},ti=e)},!0)}function mh(){return Fa(({metric:t})=>{let e=t.entries[t.entries.length-1];e&&(we&&S.log("[Measurements] Adding LCP"),ve.lcp={value:t.value,unit:"millisecond"},Ot=e)},!0)}function gh(){return Da(({metric:t})=>{let e=t.entries[t.entries.length-1];if(!e)return;let n=ne(he),r=ne(e.startTime);we&&S.log("[Measurements] Adding FID"),ve.fid={value:t.value,unit:"millisecond"},ve["mark.fid"]={value:n+r,unit:"second"}})}function hh(){return Ma(({metric:t})=>{t.entries[t.entries.length-1]&&(we&&S.log("[Measurements] Adding TTFB"),ve.ttfb={value:t.value,unit:"millisecond"})})}function Ga(t){let e=ei();if(!e||!k.performance.getEntries||!he)return;we&&S.log("[Tracing] Adding & adjusting spans using Performance API");let n=ne(he),r=e.getEntries(),{op:i,start_timestamp:o}=P(t);if(r.slice(Dd).forEach(s=>{let a=ne(s.startTime),c=ne(Math.max(0,s.duration));if(!(i==="navigation"&&o&&n+a<o))switch(s.entryType){case"navigation":{vh(t,s,n);break}case"mark":case"paint":case"measure":{_h(t,s,a,c,n);let l=un(),u=s.startTime<l.firstHiddenTime;s.name==="first-paint"&&u&&(we&&S.log("[Measurements] Adding FP"),ve.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&u&&(we&&S.log("[Measurements] Adding FCP"),ve.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{Sh(t,s,s.name,a,c,n);break}}}),Dd=Math.max(r.length-1,0),Eh(t),i==="pageload"){Th(ve),["fcp","fp","lcp"].forEach(a=>{let c=ve[a];if(!c||!o||n>=o)return;let l=c.value,u=n+ne(l),d=Math.abs((u-o)*1e3),f=d-l;we&&S.log(`[Measurements] Normalized ${a} from ${l} to ${d} (${f})`),c.value=d});let s=ve["mark.fid"];s&&ve.fid&&(wn(t,s.value,s.value+ne(ve.fid.value),{name:"first input delay",op:"ui.action",attributes:{[W]:"auto.ui.browser.metrics"}}),delete ve["mark.fid"]),"fcp"in ve||delete ve.cls,Object.entries(ve).forEach(([a,c])=>{io(a,c.value,c.unit)}),bh(t)}Ot=void 0,ti=void 0,ve={}}function _h(t,e,n,r,i){let o=Gt(),s=ne(o?o.requestStart:0),a=i+Math.max(n,s),c=i+n,l=c+r,u={[W]:"auto.resource.browser.metrics"};return a!==c&&(u["sentry.browser.measure_happened_before_request"]=!0,u["sentry.browser.measure_start_time"]=a),wn(t,a,l,{name:e.name,op:e.entryType,attributes:u}),a}function vh(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{bo(t,e,r,n)}),bo(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),bo(t,e,"fetch",n,"cache","domainLookupStart"),bo(t,e,"domainLookup",n,"DNS"),yh(t,e,n)}function bo(t,e,n,r,i,o){let s=o?e[o]:e[`${n}End`],a=e[`${n}Start`];!a||!s||wn(t,r+ne(a),r+ne(s),{op:"browser",name:i||n,attributes:{[W]:"auto.ui.browser.metrics"}})}function yh(t,e,n){let r=n+ne(e.requestStart),i=n+ne(e.responseEnd),o=n+ne(e.responseStart);e.responseEnd&&(wn(t,r,i,{op:"browser",name:"request",attributes:{[W]:"auto.ui.browser.metrics"}}),wn(t,o,i,{op:"browser",name:"response",attributes:{[W]:"auto.ui.browser.metrics"}}))}function Sh(t,e,n,r,i,o){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let s=rt(n),a={[W]:"auto.resource.browser.metrics"};Ua(a,e,"transferSize","http.response_transfer_size"),Ua(a,e,"encodedBodySize","http.response_content_length"),Ua(a,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(a["resource.render_blocking_status"]=e.renderBlockingStatus),s.protocol&&(a["url.scheme"]=s.protocol.split(":").pop()),s.host&&(a["server.address"]=s.host),a["url.same_origin"]=n.includes(k.location.origin);let c=o+r,l=c+i;wn(t,c,l,{name:n.replace(k.location.origin,""),op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",attributes:a})}function Eh(t){let e=k.navigator;if(!e)return;let n=e.connection;n&&(n.effectiveType&&t.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&t.setAttribute("connectionType",n.type),Eo(n.rtt)&&(ve["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Eo(e.deviceMemory)&&t.setAttribute("deviceMemory",`${e.deviceMemory} GB`),Eo(e.hardwareConcurrency)&&t.setAttribute("hardwareConcurrency",String(e.hardwareConcurrency))}function bh(t){Ot&&(we&&S.log("[Measurements] Adding LCP Data"),Ot.element&&t.setAttribute("lcp.element",ft(Ot.element)),Ot.id&&t.setAttribute("lcp.id",Ot.id),Ot.url&&t.setAttribute("lcp.url",Ot.url.trim().slice(0,200)),t.setAttribute("lcp.size",Ot.size)),ti&&ti.sources&&(we&&S.log("[Measurements] Adding CLS Data"),ti.sources.forEach((e,n)=>t.setAttribute(`cls.source.${n+1}`,ft(e.node))))}function Ua(t,e,n,r){let i=e[n];i!=null&&i<ph&&(t[r]=i)}function Th(t){let e=Gt();if(!e)return;let{responseStart:n,requestStart:r}=e;r<=n&&(we&&S.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}p();var Ih=1e3,Md,ja,Wa;function za(t){let e="dom";Ie(e,t),ke(e,kh)}function kh(){if(!k.document)return;let t=se.bind(null,"dom"),e=Ld(t,!0);k.document.addEventListener("click",e,!1),k.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let r=k[n]&&k[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(ee(r,"addEventListener",function(i){return function(o,s,a){if(o==="click"||o=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},u=l[o]=l[o]||{refCount:0};if(!u.handler){let d=Ld(t);u.handler=d,i.call(this,o,d,a)}u.refCount++}catch{}return i.call(this,o,s,a)}}),ee(r,"removeEventListener",function(i){return function(o,s,a){if(o==="click"||o=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__||{},u=l[o];u&&(u.refCount--,u.refCount<=0&&(i.call(this,o,u.handler,a),u.handler=void 0,delete l[o]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return i.call(this,o,s,a)}}))})}function wh(t){if(t.type!==ja)return!1;try{if(!t.target||t.target._sentryId!==Wa)return!1}catch{}return!0}function xh(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function Ld(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;let r=Rh(n);if(xh(n.type,r))return;ie(n,"_sentryCaptured",!0),r&&!r._sentryId&&ie(r,"_sentryId",G());let i=n.type==="keypress"?"input":n.type;wh(n)||(t({event:n,name:i,global:e}),ja=n.type,Wa=r?r._sentryId:void 0),clearTimeout(Md),Md=k.setTimeout(()=>{Wa=void 0,ja=void 0},Ih)}}function Rh(t){try{return t.target}catch{return null}}p();var To;function xn(t){let e="history";Ie(e,t),ke(e,Ah)}function Ah(){if(!ra())return;let t=k.onpopstate;k.onpopstate=function(...n){let r=k.location.href,i=To;if(To=r,se("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){let i=r.length>2?r[2]:void 0;if(i){let o=To,s=String(i);To=s,se("history",{from:o,to:s})}return n.apply(this,r)}}ee(k.history,"pushState",e),ee(k.history,"replaceState",e)}p();var Io={};function Ya(t){let e=Io[t];if(e)return e;let n=k[t];if(Fr(n))return Io[t]=n.bind(k);let r=k.document;if(r&&typeof r.createElement=="function")try{let i=r.createElement("iframe");i.hidden=!0,r.head.appendChild(i);let o=i.contentWindow;o&&o[t]&&(n=o[t]),r.head.removeChild(i)}catch(i){we&&S.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return n&&(Io[t]=n.bind(k))}function ko(t){Io[t]=void 0}p();var zt="__sentry_xhr_v3__";function ni(t){let e="xhr";Ie(e,t),ke(e,Nh)}function Nh(){if(!k.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;ee(t,"open",function(e){return function(...n){let r=te()*1e3,i=de(n[0])?n[0].toUpperCase():void 0,o=Ch(n[1]);if(!i||!o)return e.apply(this,n);this[zt]={method:i,url:o,request_headers:{}},i==="POST"&&o.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let s=()=>{let a=this[zt];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}let c={endTimestamp:te()*1e3,startTimestamp:r,xhr:this};se("xhr",c)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?ee(this,"onreadystatechange",function(a){return function(...c){return s(),a.apply(this,c)}}):this.addEventListener("readystatechange",s),ee(this,"setRequestHeader",function(a){return function(...c){let[l,u]=c,d=this[zt];return d&&de(l)&&de(u)&&(d.request_headers[l.toLowerCase()]=u),a.apply(this,c)}}),e.apply(this,n)}}),ee(t,"send",function(e){return function(...n){let r=this[zt];if(!r)return e.apply(this,n);n[0]!==void 0&&(r.body=n[0]);let i={startTimestamp:te()*1e3,xhr:this};return se("xhr",i),e.apply(this,n)}})}function Ch(t){if(de(t))return t;try{return t.toString()}catch{}}p();var Va=[],wo=new Map;function Ja(){if(ei()&&he){let e=Ph();return()=>{e()}}return()=>{}}var Ud={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function Ph(){return La(({metric:t})=>{let e=C();if(!e||t.value==null)return;let n=t.entries.find(I=>I.duration===t.value&&Ud[I.name]);if(!n)return;let{interactionId:r}=n,i=Ud[n.name],o=e.getOptions(),s=ne(he+n.startTime),a=ne(t.value),c=q(),l=V(),u=l?z(l):void 0,f=(r!=null?wo.get(r):void 0)||u,m=f?P(f).description:c.getScopeData().transactionName,h=c.getUser(),v=e.getIntegrationByName("Replay"),T=v&&v.getReplayId(),F=h!==void 0?h.email||h.id||h.ip_address:void 0,L;try{L=c.getScopeData().contexts.profile.profile_id}catch{}let N=ft(n.target),$=X({release:o.release,environment:o.environment,transaction:m,[Gr]:t.value,[W]:"auto.http.browser.inp",user:F||void 0,profile_id:L||void 0,replay_id:T||void 0,"user_agent.original":k.navigator&&k.navigator.userAgent}),H=_e({name:N,op:`ui.interaction.${i}`,attributes:$,startTime:s,experimental:{standalone:!0}});H.addEvent("inp",{[Qn]:"millisecond",[Zn]:t.value}),H.end(s+a)})}function Ka(t){let e=({entries:n})=>{let r=V(),i=r&&z(r);n.forEach(o=>{if(!Fd(o)||!i)return;let s=o.interactionId;if(s!=null&&!wo.has(s)){if(Va.length>10){let a=Va.shift();wo.delete(a)}Va.push(s),wo.set(s,i)}})};Wt("event",e),Wt("first-input",e)}function Bd(t,e=Ya("fetch")){let n=0,r=0;function i(o){let s=o.body.length;n+=s,r++;let a=g({body:o.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15},t.fetchOptions);if(!e)return ko("fetch"),en("No fetch implementation available");try{return e(t.url,a).then(c=>(n-=s,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ko("fetch"),n-=s,r--,en(c)}}return fo(t,i)}p();var Oh=30;var Fh=50;function Xa(t,e,n,r){let i={filename:t,function:e==="<anonymous>"?At:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var Dh=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Mh=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Lh=/\((\S*)(?::(\d+))(?::(\d+))\)/,Uh=t=>{let e=Dh.exec(t);if(e){let[,r,i,o]=e;return Xa(r,At,+i,+o)}let n=Mh.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){let s=Lh.exec(n[2]);s&&(n[2]=s[1],n[3]=s[2],n[4]=s[3])}let[i,o]=Hd(n[1]||At,n[2]);return Xa(o,i,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Bh=[Oh,Uh],$h=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Hh=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,qh=t=>{let e=$h.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let o=Hh.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let r=e[3],i=e[1]||At;return[i,r]=Hd(i,r),Xa(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Gh=[Fh,qh];var jh=[Bh,Gh],$d=$i(...jh),Hd=(t,e)=>{let n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:At,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};p();p();var xo=1024,Wh="Breadcrumbs",zh=(t={})=>{let e=g({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:Wh,setup(n){e.console&&Ms(Jh(n)),e.dom&&za(Vh(n,e.dom)),e.xhr&&ni(Kh(n)),e.fetch&&Mr(Xh(n)),e.history&&xn(Qh(n)),e.sentry&&n.on("beforeSendEvent",Yh(n))}}},ri=zh;function Yh(t){return function(n){C()===t&&Ct({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:mt(n)},{event:n})}}function Vh(t,e){return function(r){if(C()!==t)return;let i,o,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>xo&&(ce&&S.warn(`\`dom.maxStringLength\` cannot exceed ${xo}, but a value of ${a} was configured. Sentry will use ${xo} instead.`),a=xo),typeof s=="string"&&(s=[s]);try{let l=r.event,u=Zh(l)?l.target:l;i=ft(u,{keyAttrs:s,maxStringLength:a}),o=Cr(u)}catch{i="<unknown>"}if(i.length===0)return;let c={category:`ui.${r.name}`,message:i};o&&(c.data={"ui.component_name":o}),Ct(c,{event:r.event,name:r.name,global:r.global})}}function Jh(t){return function(n){if(C()!==t)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Ws(n.level),message:Mi(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Mi(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Ct(r,{input:n.args,level:n.level})}}function Kh(t){return function(n){if(C()!==t)return;let{startTimestamp:r,endTimestamp:i}=n,o=n.xhr[zt];if(!r||!i||!o)return;let{method:s,url:a,status_code:c,body:l}=o,u={method:s,url:a,status_code:c},d={xhr:n.xhr,input:l,startTimestamp:r,endTimestamp:i};Ct({category:"xhr",data:u,type:"http"},d)}}function Xh(t){return function(n){if(C()!==t)return;let{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){let o=n.fetchData,s={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i};Ct({category:"fetch",data:o,level:"error",type:"http"},s)}else{let o=n.response,s=D(g({},n.fetchData),{status_code:o&&o.status}),a={input:n.args,response:o,startTimestamp:r,endTimestamp:i};Ct({category:"fetch",data:s,type:"http"},a)}}}function Qh(t){return function(n){if(C()!==t)return;let r=n.from,i=n.to,o=rt(A.location.href),s=r?rt(r):void 0,a=rt(i);(!s||!s.path)&&(s=o),o.protocol===a.protocol&&o.host===a.host&&(i=a.relative),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),Ct({category:"navigation",data:{from:r,to:i}})}}function Zh(t){return!!t&&!!t.target}p();var e_=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],t_="BrowserApiErrors",n_=(t={})=>{let e=g({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t);return{name:t_,setupOnce(){e.setTimeout&&ee(A,"setTimeout",qd),e.setInterval&&ee(A,"setInterval",qd),e.requestAnimationFrame&&ee(A,"requestAnimationFrame",r_),e.XMLHttpRequest&&"XMLHttpRequest"in A&&ee(XMLHttpRequest.prototype,"send",i_);let n=e.eventTarget;n&&(Array.isArray(n)?n:e_).forEach(o_)}}},Gd=n_;function qd(t){return function(...e){let n=e[0];return e[0]=kn(n,{mechanism:{data:{function:Le(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function r_(t){return function(e){return t.apply(this,[kn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Le(t)},handled:!1,type:"instrument"}})])}}function i_(t){return function(...e){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&ee(n,i,function(o){let s={mechanism:{data:{function:i,handler:Le(o)},handled:!1,type:"instrument"}},a=vn(o);return a&&(s.mechanism.data.handler=Le(a)),kn(o,s)})}),t.apply(this,e)}}function o_(t){let e=A,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(ee(n,"addEventListener",function(r){return function(i,o,s){try{typeof o.handleEvent=="function"&&(o.handleEvent=kn(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Le(o),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,kn(o,{mechanism:{data:{function:"addEventListener",handler:Le(o),target:t},handled:!1,type:"instrument"}}),s])}}),ee(n,"removeEventListener",function(r){return function(i,o,s){let a=o;try{let c=a&&a.__sentry_wrapped__;c&&r.call(this,i,c,s)}catch{}return r.call(this,i,a,s)}}))}p();var s_="GlobalHandlers",a_=(t={})=>{let e=g({onerror:!0,onunhandledrejection:!0},t);return{name:s_,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(c_(n),jd("onerror")),e.onunhandledrejection&&(u_(n),jd("onunhandledrejection"))}}},ii=a_;function c_(t){Lr(e=>{let{stackParser:n,attachStacktrace:r}=Wd();if(C()!==t||ka())return;let{msg:i,url:o,line:s,column:a,error:c}=e,l=p_(ho(n,c||i,void 0,r,!1),o,s,a);l.level="error",zr(l,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function u_(t){Ur(e=>{let{stackParser:n,attachStacktrace:r}=Wd();if(C()!==t||ka())return;let i=l_(e),o=hn(i)?d_(i):ho(n,i,void 0,r,!0);o.level="error",zr(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function l_(t){if(hn(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function d_(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function p_(t,e,n,r){let i=t.exception=t.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=de(e)&&e.length>0?e:As();return c.length===0&&c.push({colno:l,filename:d,function:At,in_app:!0,lineno:u}),t}function jd(t){ce&&S.log(`Global Handler attached: ${t}`)}function Wd(){let t=C();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}p();var oi=()=>({name:"HttpContext",preprocessEvent(t){if(!A.navigator&&!A.location&&!A.document)return;let e=t.request&&t.request.url||A.location&&A.location.href,{referrer:n}=A.document||{},{userAgent:r}=A.navigator||{},i=g(g(g({},t.request&&t.request.headers),n&&{Referer:n}),r&&{"User-Agent":r}),o=D(g(g({},t.request),e&&{url:e}),{headers:i});t.request=o}});p();var f_="cause",m_=5,g_="LinkedErrors",h_=(t={})=>{let e=t.limit||m_,n=t.key||f_;return{name:g_,preprocessEvent(r,i,o){let s=o.getOptions();Rs(go,s.stackParser,s.maxValueLength,n,e,r,i)}}},si=h_;function zd(t){return[sr(),or(),Gd(),ri(),ii(),si(),ar(),oi()]}function __(t={}){let e={defaultIntegrations:zd(),release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:A.SENTRY_RELEASE&&A.SENTRY_RELEASE.id?A.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return g(g({},e),t)}function v_(){let t=A,e=t.chrome?"chrome":"browser",n=t[e],r=n&&n.runtime&&n.runtime.id,i=A.location&&A.location.href||"",o=["chrome-extension:","moz-extension:","ms-browser-extension:"],s=!!r&&A===A.top&&o.some(c=>i.startsWith(`${c}//`)),a=typeof t.nw<"u";return!!r&&!s&&!a}function Qa(t={}){let e=__(t);if(v_()){Rt(()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")});return}ce&&(Gi()||S.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."));let n=D(g({},e),{stackParser:Ds(e.stackParser||$d),integrations:va(e),transport:e.transport||Bd}),r=Ea(_o,n);return e.autoSessionTracking&&y_(),r}function Ro(t={}){if(!A.document){ce&&S.error("Global document not defined in showReportDialog call");return}let e=q(),n=e.getClient(),r=n&&n.getDsn();if(!r){ce&&S.error("DSN not configured for showReportDialog call");return}if(e&&(t.user=g(g({},e.getUser()),t.user)),!t.eventId){let a=uo();a&&(t.eventId=a)}let i=A.document.createElement("script");i.async=!0,i.crossOrigin="anonymous",i.src=_a(r,t),t.onLoad&&(i.onload=t.onLoad);let{onClose:o}=t;if(o){let a=c=>{if(c.data==="__sentry_reportdialog_closed__")try{o()}finally{A.removeEventListener("message",a)}};A.addEventListener("message",a)}let s=A.document.head||A.document.body;s?s.appendChild(i):ce&&S.error("Not injecting report dialog. No injection point found in HTML")}function y_(){if(typeof A.document>"u"){ce&&S.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}Yr({ignoreDuration:!0}),Vr(),xn(({from:t,to:e})=>{t!==void 0&&t!==e&&(Yr({ignoreDuration:!0}),Vr())})}p();var Yd=new WeakMap,Za=new Map,Ao={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0};function Jd(t,e){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:s}=g({traceFetch:Ao.traceFetch,traceXHR:Ao.traceXHR},e),a=typeof i=="function"?i:u=>!0,c=u=>T_(u,s),l={};n&&(t.addEventProcessor(u=>(u.type==="transaction"&&u.spans&&u.spans.forEach(d=>{if(d.op==="http.client"){let f=Za.get(d.span_id);f&&(d.timestamp=f/1e3,Za.delete(d.span_id))}}),u)),$s(u=>{if(u.response){let d=Yd.get(u.response);d&&u.endTimestamp&&Za.set(d,u.endTimestamp)}}),Mr(u=>{let d=Ta(u,a,c,l);if(u.response&&u.fetchData.__span&&Yd.set(u.response,u.fetchData.__span),d){let f=Kd(u.fetchData.url),m=f?rt(f).host:void 0;d.setAttributes({"http.url":f,"server.address":m})}o&&d&&Vd(d)})),r&&ni(u=>{let d=I_(u,a,c,l);o&&d&&Vd(d)})}function S_(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Vd(t){let{url:e}=P(t).data||{};if(!e||typeof e!="string")return;let n=Wt("resource",({entries:r})=>{r.forEach(i=>{S_(i)&&i.name.endsWith(e)&&(b_(i).forEach(s=>t.setAttribute(...s)),setTimeout(n))})})}function E_(t){let e="unknown",n="unknown",r="";for(let i of t){if(i==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(i))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=i}return r===t&&(e=r),{name:e,version:n}}function Ft(t=0){return((he||performance.timeOrigin)+t)/1e3}function b_(t){let{name:e,version:n}=E_(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),he?[...r,["http.request.redirect_start",Ft(t.redirectStart)],["http.request.fetch_start",Ft(t.fetchStart)],["http.request.domain_lookup_start",Ft(t.domainLookupStart)],["http.request.domain_lookup_end",Ft(t.domainLookupEnd)],["http.request.connect_start",Ft(t.connectStart)],["http.request.secure_connection_start",Ft(t.secureConnectionStart)],["http.request.connection_end",Ft(t.connectEnd)],["http.request.request_start",Ft(t.requestStart)],["http.request.response_start",Ft(t.responseStart)],["http.request.response_end",Ft(t.responseEnd)]]:r}function T_(t,e){let n=A.location&&A.location.href;if(n){let r,i;try{r=new URL(t,n),i=new URL(n).origin}catch{return!1}let o=r.origin===i;return e?xt(r.toString(),e)||o&&xt(r.pathname,e):o}else{let r=!!t.match(/^\/(?!\/)/);return e?xt(t,e):r}}function I_(t,e,n,r){let i=t.xhr,o=i&&i[zt];if(!i||i.__sentry_own_request__||!o)return;let s=Ue()&&e(o.url);if(t.endTimestamp&&s){let f=i.__sentry_xhr_span_id__;if(!f)return;let m=r[f];m&&o.status_code!==void 0&&(er(m,o.status_code),m.end(),delete r[f]);return}let a=Kd(o.url),c=a?rt(a).host:void 0,l=!!V(),u=s&&l?_e({name:`${o.method} ${o.url}`,attributes:{type:"xhr","http.method":o.method,"http.url":a,url:o.url,"server.address":c,[W]:"auto.http.browser",[yt]:"http.client"}}):new Je;i.__sentry_xhr_span_id__=u.spanContext().spanId,r[i.__sentry_xhr_span_id__]=u;let d=C();return i.setRequestHeader&&n(o.url)&&d&&k_(i,d,Ue()&&l?u:void 0),u}function k_(t,e,n){let r=q(),i=ae(),{traceId:o,spanId:s,sampled:a,dsc:c}=g(g({},i.getPropagationContext()),r.getPropagationContext()),l=n&&Ue()?tr(n):yn(o,s,a),u=Vn(c||(n?Fe(n):on(o,e)));w_(t,l,u)}function w_(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(Yn,n)}catch{}}function Kd(t){try{return new URL(t,A.location.origin).href}catch{return}}p();p();function Xd(){A&&A.document?A.document.addEventListener("visibilitychange",()=>{let t=V();if(!t)return;let e=z(t);if(A.document.hidden&&e){let n="cancelled",{op:r,status:i}=P(e);ce&&S.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),i||e.setStatus({code:2,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):ce&&S.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var x_="BrowserTracing",R_=g(D(g({},ir),{instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!1,enableInp:!0,_experiments:{}}),Ao),ec=(t={})=>{no();let{enableInp:e,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:i},beforeStartSpan:o,idleTimeout:s,finalTimeout:a,childSpanTimeout:c,markBackgroundSpan:l,traceFetch:u,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:m,instrumentPageLoad:h,instrumentNavigation:v}=g(g({},R_),t),T=Ba();e&&Ja(),r&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Ha():n&&$a(),i&&qa();let F={name:void 0,source:void 0};function L(N,$){let H=$.op==="pageload",I=o?o($):$,B=I.attributes||{};$.name!==I.name&&(B[pe]="custom",I.attributes=B),F.name=I.name,F.source=B[pe];let U=so(I,{idleTimeout:s,finalTimeout:a,childSpanTimeout:c,disableAutoFinish:H,beforeSpanEnd:ue=>{T(),Ga(ue)}});function fe(){["interactive","complete"].includes(A.document.readyState)&&N.emit("idleSpanEnableAutoFinish",U)}return H&&A.document&&(A.document.addEventListener("readystatechange",()=>{fe()}),fe()),U}return{name:x_,afterAllSetup(N){let $,H=A.location&&A.location.href;N.on("startNavigationSpan",I=>{C()===N&&($&&!P($).timestamp&&(ce&&S.log(`[Tracing] Finishing current root span with op: ${P($).op}`),$.end()),$=L(N,g({op:"navigation"},I)))}),N.on("startPageLoadSpan",(I,B={})=>{if(C()!==N)return;$&&!P($).timestamp&&(ce&&S.log(`[Tracing] Finishing current root span with op: ${P($).op}`),$.end());let U=B.sentryTrace||Qd("sentry-trace"),fe=B.baggage||Qd("baggage"),ue=Ys(U,fe);q().setPropagationContext(ue),$=L(N,g({op:"pageload"},I))}),N.on("spanEnd",I=>{let B=P(I).op;if(I!==z(I)||B!=="navigation"&&B!=="pageload")return;let U=q(),fe=U.getPropagationContext();U.setPropagationContext(D(g({},fe),{sampled:fe.sampled!==void 0?fe.sampled:it(I),dsc:fe.dsc||Fe(I)}))}),A.location&&(h&&Zd(N,{name:A.location.pathname,startTime:he?he/1e3:void 0,attributes:{[pe]:"url",[W]:"auto.pageload.browser"}}),v&&xn(({to:I,from:B})=>{if(B===void 0&&H&&H.indexOf(I)!==-1){H=void 0;return}B!==I&&(H=void 0,No(N,{name:A.location.pathname,attributes:{[pe]:"url",[W]:"auto.navigation.browser"}}))})),l&&Xd(),i&&A_(s,a,c,F),e&&Ka(),Jd(N,{traceFetch:u,traceXHR:d,tracePropagationTargets:N.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:f,enableHTTPTimings:m})}}};function Zd(t,e,n){t.emit("startPageLoadSpan",e,n),q().setTransactionName(e.name);let r=V();return(r&&P(r).op)==="pageload"?r:void 0}function No(t,e){ae().setPropagationContext(Sn()),q().setPropagationContext(Sn()),t.emit("startNavigationSpan",e),q().setTransactionName(e.name);let n=V();return(n&&P(n).op)==="navigation"?n:void 0}function Qd(t){let e=Ns(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function A_(t,e,n,r){let i,o=()=>{let s="ui.action.click",a=V(),c=a&&z(a);if(c){let l=P(c).op;if(["navigation","pageload"].includes(l)){ce&&S.warn(`[Tracing] Did not create ${s} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(Xn,"interactionInterrupted"),i.end(),i=void 0),!r.name){ce&&S.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`);return}i=so({name:r.name,op:s,attributes:{[pe]:r.source||"url"}},{idleTimeout:t,finalTimeout:e,childSpanTimeout:n})};A.document&&addEventListener("click",o,{once:!1,capture:!0})}var ep=typeof __SENTRY_DEBUG__>"u"?!0:__SENTRY_DEBUG__;function P_(){return[sr(),or(),ri(),ii(),si(),ar(),oi()]}function O1(t){let e=g({defaultIntegrations:P_()},t);return Kr(e,"angular"),O_(),Qa(e)}function O_(){let e=ui&&ui.major?parseInt(ui.major,10):void 0;e&&(e<14&&ep&&S.warn(`This Sentry SDK does not officially support Angular ${e}.`,"This SDK only supports Angular 14 and above.","If you're using lower Angular versions, check the Angular Version Compatibility table in our docs: https://docs.sentry.io/platforms/javascript/guides/angular/#angular-version-compatibility.","Otherwise, please consider upgrading your Angular version."),co("angular",{version:e}))}var F_=typeof Zone<"u"&&Zone.root&&Zone.root.run;function lr(t){return F_?Zone.root.run(t):t()}function D_(t){return t&&t.ngOriginalError?t.ngOriginalError:t}function M_(t){return tp(t.error)?t.error:typeof ErrorEvent<"u"&&t.error instanceof ErrorEvent&&t.error.message?t.error.message:typeof t.error=="string"?`Server returned code ${t.status} with body "${t.error}"`:t.message}function tp(t){if(t instanceof Error)return!0;if(t===null||typeof t!="object")return!1;let e=t;return de(e.name)&&de(e.message)&&(e.stack===void 0||de(e.stack))}var L_=(()=>{class t{constructor(n){this._options=g({logErrors:!0},n)}ngOnDestroy(){this._removeAfterSendEventListener&&this._removeAfterSendEventListener()}handleError(n){let r=this._extractError(n)||"Handled unknown error",i=lr(()=>sn(r,{mechanism:{type:"angular",handled:!1}}));if(this._options.logErrors&&console.error(r),this._options.showDialog){let o=C();o&&!this._removeAfterSendEventListener?this._removeAfterSendEventListener=o.on("afterSendEvent",s=>{!s.type&&s.event_id&&lr(()=>{Ro(D(g({},this._options.dialogOptions),{eventId:s.event_id}))})}):o||lr(()=>{Ro(D(g({},this._options.dialogOptions),{eventId:i}))})}}_extractError(n){if(this._options.extractor){let r=this._defaultExtractor.bind(this);return this._options.extractor(n,r)}return this._defaultExtractor(n)}_defaultExtractor(n){let r=D_(n);return r instanceof uc?M_(r):typeof r=="string"||tp(r)?r:null}}return t.\u0275fac=function(n){return new(n||t)(pr("errorHandlerOptions"))},t.\u0275prov=dr({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function F1(t){return new L_(t)}var U_="ui.angular.routing";var np;function D1(t={}){return t.instrumentNavigation!==!1&&(np=!0),ec(D(g({},t),{instrumentNavigation:!1}))}function B_(t,e){let n=e&&P(e).data||{};e&&n[pe]==="url"&&(e.updateName(t),e.setAttribute(pe,"route"),e.setAttribute(W,`auto.${P(e).op}.angular`))}var M1=(()=>{class t{constructor(n){this._router=n,this.navStart$=this._router.events.pipe(ai(r=>r instanceof lc),ci(r=>{if(!np){ep&&S.error("Angular integration has tracing enabled, but Tracing integration is not configured");return}this._routingSpan&&(this._routingSpan.end(),this._routingSpan=null);let i=C(),o=js(r.url);if(i){this._isPageloadOngoing()?this._pageloadOngoing=!1:lr(()=>{No(i,{name:o,attributes:{[W]:"auto.navigation.angular",[pe]:"url"}})}),this._routingSpan=lr(()=>_e({name:`${r.url}`,op:U_,attributes:g({[W]:"auto.ui.angular",[pe]:"url",url:o},r.navigationTrigger&&{navigationTrigger:r.navigationTrigger})}))||null;return}})),this.resEnd$=this._router.events.pipe(ai(r=>r instanceof mc),ci(r=>{let i=$_(r.state.root);i&&q().setTransactionName(i);let o=V(),s=o&&z(o);B_(i,s)})),this.navEnd$=this._router.events.pipe(ai(r=>r instanceof dc||r instanceof pc||r instanceof fc),ci(()=>{this._routingSpan&&(lr(()=>{this._routingSpan.end()}),this._routingSpan=null)})),this._routingSpan=null,this._pageloadOngoing=!0,this._subscription=new sc,this._subscription.add(this.navStart$.subscribe()),this._subscription.add(this.resEnd$.subscribe()),this._subscription.add(this.navEnd$.subscribe())}ngOnDestroy(){this._subscription.unsubscribe()}_isPageloadOngoing(){if(!this._pageloadOngoing)return!1;let n=V();if(!n)return this._pageloadOngoing=!1,!1;let r=z(n);return this._pageloadOngoing=P(r).op==="pageload",this._pageloadOngoing}}return t.\u0275fac=function(n){return new(n||t)(pr(gc))},t.\u0275prov=dr({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function $_(t){let e=[],n=t&&t.firstChild;for(;n;){let i=n&&n.routeConfig&&n.routeConfig.path;if(i==null)break;e.push(i),n=n.firstChild}let r=e.filter(i=>i).join("/");return r?`/${r}/`:"/"}var rp="phc_2IIu9OBRVjlpKCcHMIVTRhtWHmOZ0SwfwewdunPCi56",ip="https://eu.i.posthog.com",op="https://d2670d6627d2077cb8947e2bfb817cd6@sentry.sparecores.net/3",W1=(()=>{let e=class e{constructor(r){this.platformId=r,this.trackingInitialized=!1}initializeTracking(){cc(this.platformId)&&!this.trackingInitialized&&rp&&ip&&typeof window<"u"&&typeof document<"u"&&(Oi.init(rp,{api_host:ip,persistence:"sessionStorage"}),this.trackingInitialized=!0)}trackEvent(r,i){this.trackingInitialized&&Oi.capture(r,i)}getId(){return Oi.get_distinct_id()}SentryException(r,i){op&&op!==""&&(sn(r,i),lo(2e3).then(()=>{}))}};e.\u0275fac=function(i){return new(i||e)(pr(ac))},e.\u0275prov=dr({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();export{O1 as a,F1 as b,D1 as c,M1 as d,W1 as e};
//# sourceMappingURL=chunk-UHVJKSZT.js.map
