import{e as cy}from"./utils-CHEaCvah.js";function ly(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var dy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ju(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ep(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var wa={exports:{}},ie={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var wl;function fy(){if(wl)return ie;wl=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),d=Symbol.iterator;function f(x){return x===null||typeof x!="object"?null:(x=d&&x[d]||x["@@iterator"],typeof x=="function"?x:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,m={};function _(x,P,B){this.props=x,this.context=P,this.refs=m,this.updater=B||h}_.prototype.isReactComponent={},_.prototype.setState=function(x,P){if(typeof x!="object"&&typeof x!="function"&&x!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,x,P,"setState")},_.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function g(){}g.prototype=_.prototype;function v(x,P,B){this.props=x,this.context=P,this.refs=m,this.updater=B||h}var y=v.prototype=new g;y.constructor=v,p(y,_.prototype),y.isPureReactComponent=!0;var w=Array.isArray,R=Object.prototype.hasOwnProperty,E={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function T(x,P,B){var H,W={},X=null,se=null;if(P!=null)for(H in P.ref!==void 0&&(se=P.ref),P.key!==void 0&&(X=""+P.key),P)R.call(P,H)&&!O.hasOwnProperty(H)&&(W[H]=P[H]);var _e=arguments.length-2;if(_e===1)W.children=B;else if(1<_e){for(var ye=Array(_e),Oe=0;Oe<_e;Oe++)ye[Oe]=arguments[Oe+2];W.children=ye}if(x&&x.defaultProps)for(H in _e=x.defaultProps,_e)W[H]===void 0&&(W[H]=_e[H]);return{$$typeof:t,type:x,key:X,ref:se,props:W,_owner:E.current}}function S(x,P){return{$$typeof:t,type:x.type,key:P,ref:x.ref,props:x.props,_owner:x._owner}}function b(x){return typeof x=="object"&&x!==null&&x.$$typeof===t}function C(x){var P={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(B){return P[B]})}var k=/\/+/g;function I(x,P){return typeof x=="object"&&x!==null&&x.key!=null?C(""+x.key):P.toString(36)}function D(x,P,B,H,W){var X=typeof x;(X==="undefined"||X==="boolean")&&(x=null);var se=!1;if(x===null)se=!0;else switch(X){case"string":case"number":se=!0;break;case"object":switch(x.$$typeof){case t:case e:se=!0}}if(se)return se=x,W=W(se),x=H===""?"."+I(se,0):H,w(W)?(B="",x!=null&&(B=x.replace(k,"$&/")+"/"),D(W,P,B,"",function(Oe){return Oe})):W!=null&&(b(W)&&(W=S(W,B+(!W.key||se&&se.key===W.key?"":(""+W.key).replace(k,"$&/")+"/")+x)),P.push(W)),1;if(se=0,H=H===""?".":H+":",w(x))for(var _e=0;_e<x.length;_e++){X=x[_e];var ye=H+I(X,_e);se+=D(X,P,B,ye,W)}else if(ye=f(x),typeof ye=="function")for(x=ye.call(x),_e=0;!(X=x.next()).done;)X=X.value,ye=H+I(X,_e++),se+=D(X,P,B,ye,W);else if(X==="object")throw P=String(x),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return se}function N(x,P,B){if(x==null)return x;var H=[],W=0;return D(x,H,"","",function(X){return P.call(B,X,W++)}),H}function M(x){if(x._status===-1){var P=x._result;P=P(),P.then(function(B){(x._status===0||x._status===-1)&&(x._status=1,x._result=B)},function(B){(x._status===0||x._status===-1)&&(x._status=2,x._result=B)}),x._status===-1&&(x._status=0,x._result=P)}if(x._status===1)return x._result.default;throw x._result}var L={current:null},$={transition:null},U={ReactCurrentDispatcher:L,ReactCurrentBatchConfig:$,ReactCurrentOwner:E};return ie.Children={map:N,forEach:function(x,P,B){N(x,function(){P.apply(this,arguments)},B)},count:function(x){var P=0;return N(x,function(){P++}),P},toArray:function(x){return N(x,function(P){return P})||[]},only:function(x){if(!b(x))throw Error("React.Children.only expected to receive a single React element child.");return x}},ie.Component=_,ie.Fragment=n,ie.Profiler=i,ie.PureComponent=v,ie.StrictMode=r,ie.Suspense=a,ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,ie.cloneElement=function(x,P,B){if(x==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+x+".");var H=p({},x.props),W=x.key,X=x.ref,se=x._owner;if(P!=null){if(P.ref!==void 0&&(X=P.ref,se=E.current),P.key!==void 0&&(W=""+P.key),x.type&&x.type.defaultProps)var _e=x.type.defaultProps;for(ye in P)R.call(P,ye)&&!O.hasOwnProperty(ye)&&(H[ye]=P[ye]===void 0&&_e!==void 0?_e[ye]:P[ye])}var ye=arguments.length-2;if(ye===1)H.children=B;else if(1<ye){_e=Array(ye);for(var Oe=0;Oe<ye;Oe++)_e[Oe]=arguments[Oe+2];H.children=_e}return{$$typeof:t,type:x.type,key:W,ref:X,props:H,_owner:se}},ie.createContext=function(x){return x={$$typeof:o,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},x.Provider={$$typeof:s,_context:x},x.Consumer=x},ie.createElement=T,ie.createFactory=function(x){var P=T.bind(null,x);return P.type=x,P},ie.createRef=function(){return{current:null}},ie.forwardRef=function(x){return{$$typeof:u,render:x}},ie.isValidElement=b,ie.lazy=function(x){return{$$typeof:l,_payload:{_status:-1,_result:x},_init:M}},ie.memo=function(x,P){return{$$typeof:c,type:x,compare:P===void 0?null:P}},ie.startTransition=function(x){var P=$.transition;$.transition={};try{x()}finally{$.transition=P}},ie.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},ie.useCallback=function(x,P){return L.current.useCallback(x,P)},ie.useContext=function(x){return L.current.useContext(x)},ie.useDebugValue=function(){},ie.useDeferredValue=function(x){return L.current.useDeferredValue(x)},ie.useEffect=function(x,P){return L.current.useEffect(x,P)},ie.useId=function(){return L.current.useId()},ie.useImperativeHandle=function(x,P,B){return L.current.useImperativeHandle(x,P,B)},ie.useInsertionEffect=function(x,P){return L.current.useInsertionEffect(x,P)},ie.useLayoutEffect=function(x,P){return L.current.useLayoutEffect(x,P)},ie.useMemo=function(x,P){return L.current.useMemo(x,P)},ie.useReducer=function(x,P,B){return L.current.useReducer(x,P,B)},ie.useRef=function(x){return L.current.useRef(x)},ie.useState=function(x){return L.current.useState(x)},ie.useSyncExternalStore=function(x,P,B){return L.current.useSyncExternalStore(x,P,B)},ie.useTransition=function(){return L.current.useTransition()},ie.version="18.2.0",ie}var Cl;function En(){return Cl||(Cl=1,wa.exports=fy()),wa.exports}var ki=En();const hy=Ju(ki),PM=ly({__proto__:null,default:hy},[ki]),tp=Object.prototype.toString;function br(t){switch(tp.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Zt(t,Error)}}function Hr(t,e){return tp.call(t)===`[object ${e}]`}function Qu(t){return Hr(t,"ErrorEvent")}function Rl(t){return Hr(t,"DOMError")}function py(t){return Hr(t,"DOMException")}function Pt(t){return Hr(t,"String")}function Zu(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function ec(t){return t===null||Zu(t)||typeof t!="object"&&typeof t!="function"}function Hn(t){return Hr(t,"Object")}function Yo(t){return typeof Event<"u"&&Zt(t,Event)}function gy(t){return typeof Element<"u"&&Zt(t,Element)}function my(t){return Hr(t,"RegExp")}function $i(t){return!!(t&&t.then&&typeof t.then=="function")}function _y(t){return Hn(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function np(t){return typeof t=="number"&&t!==t}function Zt(t,e){try{return t instanceof e}catch{return!1}}function rp(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Er(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Ca(t,e){let n=t;const r=n.length;if(r<=150)return n;e>r&&(e=r);let i=Math.max(e-60,0);i<5&&(i=0);let s=Math.min(i+140,r);return s>r-5&&(s=r),s===r&&(i=Math.max(s-140,0)),n=n.slice(i,s),i>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function fo(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{rp(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function vy(t,e,n=!1){return Pt(t)?my(e)?e.test(t):Pt(e)?n?t===e:t.includes(e):!1:!1}function jr(t,e=[],n=!1){return e.some(r=>vy(t,r,n))}function ip(t,e,n=250,r,i,s,o){if(!s.exception||!s.exception.values||!o||!Zt(o.originalException,Error))return;const u=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;u&&(s.exception.values=yy(nu(t,e,i,o.originalException,r,s.exception.values,u,0),n))}function nu(t,e,n,r,i,s,o,u){if(s.length>=n+1)return s;let a=[...s];if(Zt(r[i],Error)){kl(o,u);const c=t(e,r[i]),l=a.length;xl(c,i,l,u),a=nu(t,e,n,r[i],i,[c,...a],c,l)}return Array.isArray(r.errors)&&r.errors.forEach((c,l)=>{if(Zt(c,Error)){kl(o,u);const d=t(e,c),f=a.length;xl(d,`errors[${l}]`,f,u),a=nu(t,e,n,c,i,[d,...a],d,f)}}),a}function kl(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function xl(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function yy(t,e){return t.map(n=>(n.value&&(n.value=Er(n.value,e)),n))}function hs(t){return t&&t.Math==Math?t:void 0}const Z=typeof globalThis=="object"&&hs(globalThis)||typeof window=="object"&&hs(window)||typeof self=="object"&&hs(self)||typeof global=="object"&&hs(global)||function(){return this}()||{};function tc(){return Z}function sp(t,e,n){const r=n||Z,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const Tr=tc(),Sy=80;function vn(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,o=0;const u=" > ",a=u.length;let c;const l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||Sy;for(;n&&s++<r&&(c=by(n,l),!(c==="html"||s>1&&o+i.length*a+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(u)}catch{return"<unknown>"}}function by(t,e){const n=t,r=[];let i,s,o,u,a;if(!n||!n.tagName)return"";if(Tr.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const c=e&&e.length?e.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(c&&c.length)c.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Pt(i))for(s=i.split(/\s+/),a=0;a<s.length;a++)r.push(`.${s[a]}`);const l=["aria-label","type","name","title","alt"];for(a=0;a<l.length;a++)o=l[a],u=n.getAttribute(o),u&&r.push(`[${o}="${u}"]`);return r.join("")}function op(){try{return Tr.document.location.href}catch{return""}}function ap(t){return Tr.document&&Tr.document.querySelector?Tr.document.querySelector(t):null}function up(t){if(!Tr.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement&&e.dataset.sentryComponent)return e.dataset.sentryComponent;e=e.parentNode}return null}const qr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ey="Sentry Logger ",ho=["debug","info","warn","error","log","assert","trace"],po={};function yn(t){if(!("console"in Z))return t();const e=Z.console,n={},r=Object.keys(po);r.forEach(i=>{const s=po[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function Ty(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return qr?ho.forEach(n=>{e[n]=(...r)=>{t&&yn(()=>{Z.console[n](`${Ey}[${n}]:`,...r)})}}):ho.forEach(n=>{e[n]=()=>{}}),e}const A=Ty(),Iy=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function wy(t){return t==="http"||t==="https"}function Vn(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:u,publicKey:a}=t;return`${u}://${a}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function cp(t){const e=Iy.exec(t);if(!e){yn(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,i="",s,o="",u]=e.slice(1);let a="",c=u;const l=c.split("/");if(l.length>1&&(a=l.slice(0,-1).join("/"),c=l.pop()),c){const d=c.match(/^\d+/);d&&(c=d[0])}return lp({host:s,pass:i,path:a,projectId:c,port:o,protocol:n,publicKey:r})}function lp(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Cy(t){if(!qr)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(A.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?wy(r)?e&&isNaN(parseInt(e,10))?(A.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(A.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(A.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function dp(t){const e=typeof t=="string"?cp(t):lp(t);if(!(!e||!Cy(e)))return e}class Mt 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}}function Ge(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&fp(i,r),t[e]=i}function Sn(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{qr&&A.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function fp(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,Sn(t,"__sentry_original__",e)}catch{}}function nc(t){return t.__sentry_original__}function Ry(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function hp(t){if(br(t))return{message:t.message,name:t.name,stack:t.stack,...Al(t)};if(Yo(t)){const e={type:t.type,target:Ol(t.target),currentTarget:Ol(t.currentTarget),...Al(t)};return typeof CustomEvent<"u"&&Zt(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Ol(t){try{return gy(t)?vn(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Al(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function ky(t,e=40){const n=Object.keys(hp(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return Er(n[0],e);for(let r=n.length;r>0;r--){const i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:Er(i,e)}return""}function ze(t){return ru(t,new Map)}function ru(t,e){if(xy(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))typeof t[i]<"u"&&(r[i]=ru(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(ru(i,e))}),r}return t}function xy(t){if(!Hn(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const pp=50,Dl=/\(error: (.*)\)/,Ml=/captureMessage|captureException/;function gp(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{const i=[],s=n.split(`
`);for(let o=r;o<s.length;o++){const u=s[o];if(u.length>1024)continue;const a=Dl.test(u)?u.replace(Dl,"$1"):u;if(!a.match(/\S*Error: /)){for(const c of e){const l=c(a);if(l){i.push(l);break}}if(i.length>=pp)break}}return Ay(i)}}function Oy(t){return Array.isArray(t)?gp(...t):t}function Ay(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),Ml.test(e[e.length-1].function||"")&&(e.pop(),Ml.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,pp).map(n=>({...n,filename:n.filename||e[e.length-1].filename,function:n.function||"?"}))}const Ra="<anonymous>";function en(t){try{return!t||typeof t!="function"?Ra:t.name||Ra}catch{return Ra}}const to={},Ll={};function Kn(t,e){to[t]=to[t]||[],to[t].push(e)}function Yn(t,e){Ll[t]||(e(),Ll[t]=!0)}function Et(t,e){const n=t&&to[t];if(n)for(const r of n)try{r(e)}catch(i){qr&&A.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${en(r)}
Error:`,i)}}function mp(t){const e="console";Kn(e,t),Yn(e,Dy)}function Dy(){"console"in Z&&ho.forEach(function(t){t in Z.console&&Ge(Z.console,t,function(e){return po[t]=e,function(...n){Et("console",{args:n,level:t});const i=po[t];i&&i.apply(Z.console,n)}})})}function he(){const t=Z,e=t.crypto||t.msCrypto;let n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const 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 _p(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function hn(t){const{message:e,event_id:n}=t;if(e)return e;const r=_p(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function iu(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function jn(t,e){const n=_p(t);if(!n)return;const r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...e},e&&"data"in e){const s={...i&&i.data,...e.data};n.mechanism.data=s}}function My(t,e,n=5){if(e.lineno===void 0)return;const r=t.length,i=Math.max(Math.min(r-1,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,i-n),i).map(s=>Ca(s,0)),e.context_line=Ca(t[Math.min(r-1,i)],e.colno||0),e.post_context=t.slice(Math.min(i+1,r),i+1+n).map(s=>Ca(s,0))}function Nl(t){if(t&&t.__sentry_captured__)return!0;try{Sn(t,"__sentry_captured__",!0)}catch{}return!1}function vp(t){return Array.isArray(t)?t:[t]}const dr=Z,Ly=1e3;let Pl,su,ou;function yp(t){const e="dom";Kn(e,t),Yn(e,Ny)}function Ny(){if(!dr.document)return;const t=Et.bind(null,"dom"),e=$l(t,!0);dr.document.addEventListener("click",e,!1),dr.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=dr[n]&&dr[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ge(r,"addEventListener",function(i){return function(s,o,u){if(s==="click"||s=="keypress")try{const a=this,c=a.__sentry_instrumentation_handlers__=a.__sentry_instrumentation_handlers__||{},l=c[s]=c[s]||{refCount:0};if(!l.handler){const d=$l(t);l.handler=d,i.call(this,s,d,u)}l.refCount++}catch{}return i.call(this,s,o,u)}}),Ge(r,"removeEventListener",function(i){return function(s,o,u){if(s==="click"||s=="keypress")try{const a=this,c=a.__sentry_instrumentation_handlers__||{},l=c[s];l&&(l.refCount--,l.refCount<=0&&(i.call(this,s,l.handler,u),l.handler=void 0,delete c[s]),Object.keys(c).length===0&&delete a.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,u)}}))})}function Py(t){if(t.type!==su)return!1;try{if(!t.target||t.target._sentryId!==ou)return!1}catch{}return!0}function $y(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function $l(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Uy(n);if($y(n.type,r))return;Sn(n,"_sentryCaptured",!0),r&&!r._sentryId&&Sn(r,"_sentryId",he());const i=n.type==="keypress"?"input":n.type;Py(n)||(t({event:n,name:i,global:e}),su=n.type,ou=r?r._sentryId:void 0),clearTimeout(Pl),Pl=dr.setTimeout(()=>{ou=void 0,su=void 0},Ly)}}function Uy(t){try{return t.target}catch{return null}}const go=tc();function Sp(){if(!("fetch"in go))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function au(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function bp(){if(typeof EdgeRuntime=="string")return!0;if(!Sp())return!1;if(au(go.fetch))return!0;let t=!1;const e=go.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=au(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){qr&&A.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Fy(){return"ReportingObserver"in go}function Xo(t){const e="fetch";Kn(e,t),Yn(e,By)}function By(){bp()&&Ge(Z,"fetch",function(t){return function(...e){const{method:n,url:r}=Hy(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Et("fetch",{...i}),t.apply(Z,e).then(s=>{const o={...i,endTimestamp:Date.now(),response:s};return Et("fetch",o),s},s=>{const o={...i,endTimestamp:Date.now(),error:s};throw Et("fetch",o),s})}})}function uu(t,e){return!!t&&typeof t=="object"&&!!t[e]}function Ul(t){return typeof t=="string"?t:t?uu(t,"url")?t.url:t.toString?t.toString():"":""}function Hy(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:Ul(n),method:uu(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:Ul(e),method:uu(e,"method")?String(e.method).toUpperCase():"GET"}}let ps=null;function Ep(t){const e="error";Kn(e,t),Yn(e,jy)}function jy(){ps=Z.onerror,Z.onerror=function(t,e,n,r,i){return Et("error",{column:r,error:i,line:n,msg:t,url:e}),ps&&!ps.__SENTRY_LOADER__?ps.apply(this,arguments):!1},Z.onerror.__SENTRY_INSTRUMENTED__=!0}let gs=null;function Tp(t){const e="unhandledrejection";Kn(e,t),Yn(e,qy)}function qy(){gs=Z.onunhandledrejection,Z.onunhandledrejection=function(t){return Et("unhandledrejection",t),gs&&!gs.__SENTRY_LOADER__?gs.apply(this,arguments):!0},Z.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const ms=tc();function Gy(){const t=ms.chrome,e=t&&t.app&&t.app.runtime,n="history"in ms&&!!ms.history.pushState&&!!ms.history.replaceState;return!e&&n}const ii=Z;let _s;function Ui(t){const e="history";Kn(e,t),Yn(e,zy)}function zy(){if(!Gy())return;const t=ii.onpopstate;ii.onpopstate=function(...n){const r=ii.location.href,i=_s;if(_s=r,Et("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=_s,o=String(i);_s=o,Et("history",{from:s,to:o})}return n.apply(this,r)}}Ge(ii.history,"pushState",e),Ge(ii.history,"replaceState",e)}const Wy=Z,Xt="__sentry_xhr_v3__";function Jo(t){const e="xhr";Kn(e,t),Yn(e,Vy)}function Vy(){if(!Wy.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;Ge(t,"open",function(e){return function(...n){const r=Date.now(),i=Pt(n[0])?n[0].toUpperCase():void 0,s=Ky(n[1]);if(!i||!s)return e.apply(this,n);this[Xt]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const u=this[Xt];if(u&&this.readyState===4){try{u.status_code=this.status}catch{}const a={args:[i,s],endTimestamp:Date.now(),startTimestamp:r,xhr:this};Et("xhr",a)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Ge(this,"onreadystatechange",function(u){return function(...a){return o(),u.apply(this,a)}}):this.addEventListener("readystatechange",o),Ge(this,"setRequestHeader",function(u){return function(...a){const[c,l]=a,d=this[Xt];return d&&Pt(c)&&Pt(l)&&(d.request_headers[c.toLowerCase()]=l),u.apply(this,a)}}),e.apply(this,n)}}),Ge(t,"send",function(e){return function(...n){const r=this[Xt];if(!r)return e.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const i={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return Et("xhr",i),e.apply(this,n)}})}function Ky(t){if(Pt(t))return t;try{return t.toString()}catch{}}function Yy(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Xy(){return"npm"}function Jy(){return!Yy()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function cu(){return typeof window<"u"&&(!Jy()||Qy())}function Qy(){return Z.process!==void 0&&Z.process.type==="renderer"}function Zy(){const t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(i){if(t)return e.has(i)?!0:(e.add(i),!1);for(let s=0;s<e.length;s++)if(e[s]===i)return!0;return e.push(i),!1}function r(i){if(t)e.delete(i);else for(let s=0;s<e.length;s++)if(e[s]===i){e.splice(s,1);break}}return[n,r]}function vt(t,e=100,n=1/0){try{return lu("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ip(t,e=3,n=100*1024){const r=vt(t,e);return rS(r)>n?Ip(t,e-1,n):r}function lu(t,e,n=1/0,r=1/0,i=Zy()){const[s,o]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&!np(e))return e;const u=eS(t,e);if(!u.startsWith("[object "))return u;if(e.__sentry_skip_normalization__)return e;const a=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(a===0)return u.replace("object ","");if(s(e))return"[Circular ~]";const c=e;if(c&&typeof c.toJSON=="function")try{const h=c.toJSON();return lu("",h,a-1,r,i)}catch{}const l=Array.isArray(e)?[]:{};let d=0;const f=hp(e);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(d>=r){l[h]="[MaxProperties ~]";break}const p=f[h];l[h]=lu(h,p,a-1,r,i),d++}return o(e),l}function eS(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(rp(e))return"[VueViewModel]";if(_y(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${en(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=tS(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function tS(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function nS(t){return~-encodeURI(t).split(/%..|./).length}function rS(t){return nS(JSON.stringify(t))}function iS(t,e){let n=0;for(let r=t.length-1;r>=0;r--){const i=t[r];i==="."?t.splice(r,1):i===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}const sS=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function oS(t){const e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=sS.exec(e);return n?n.slice(1):[]}function Fl(...t){let e="",n=!1;for(let r=t.length-1;r>=-1&&!n;r--){const i=r>=0?t[r]:"/";i&&(e=`${i}/${e}`,n=i.charAt(0)==="/")}return e=iS(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function Bl(t){let e=0;for(;e<t.length&&t[e]==="";e++);let n=t.length-1;for(;n>=0&&t[n]==="";n--);return e>n?[]:t.slice(e,n-e+1)}function aS(t,e){t=Fl(t).slice(1),e=Fl(e).slice(1);const n=Bl(t.split("/")),r=Bl(e.split("/")),i=Math.min(n.length,r.length);let s=i;for(let u=0;u<i;u++)if(n[u]!==r[u]){s=u;break}let o=[];for(let u=s;u<n.length;u++)o.push("..");return o=o.concat(r.slice(s)),o.join("/")}function uS(t,e){return oS(t)[2]}var Wt;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(Wt||(Wt={}));function Rr(t){return new Gr(e=>{e(t)})}function rc(t){return new Gr((e,n)=>{n(t)})}let Gr=class An{constructor(e){An.prototype.__init.call(this),An.prototype.__init2.call(this),An.prototype.__init3.call(this),An.prototype.__init4.call(this),this._state=Wt.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new An((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new An((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(Wt.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Wt.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===Wt.PENDING){if($i(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Wt.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Wt.RESOLVED&&n[1](this._value),this._state===Wt.REJECTED&&n[2](this._value),n[0]=!0)})}}};function cS(t){const e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]}function i(o){if(!n())return rc(new Mt("Not adding Promise because buffer limit was reached."));const u=o();return e.indexOf(u)===-1&&e.push(u),u.then(()=>r(u)).then(null,()=>r(u).then(null,()=>{})),u}function s(o){return new Gr((u,a)=>{let c=e.length;if(!c)return u(!0);const l=setTimeout(()=>{o&&o>0&&u(!1)},o);e.forEach(d=>{Rr(d).then(()=>{--c||(clearTimeout(l),u(!0))},a)})})}return{$:e,add:i,drain:s}}function Bn(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const 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 lS(t){return t.split(/[\?#]/,1)[0]}const dS=["fatal","error","warning","log","info","debug"];function wp(t){return t==="warn"?"warning":dS.includes(t)?t:"log"}const Cp=1e3;function Fi(){return Date.now()/Cp}function fS(){const{performance:t}=Z;if(!t||!t.now)return Fi;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/Cp}const tn=fS(),Xe=(()=>{const{performance:t}=Z;if(!t||!t.now)return;const e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,o=t.timing&&t.timing.navigationStart,a=typeof o=="number"?Math.abs(o+n-r):e,c=a<e;return s||c?i<=a?t.timeOrigin:o:r})(),du="baggage",Rp="sentry-",hS=/^sentry-/,pS=8192;function kp(t){if(!Pt(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,i)=>{const s=Hl(i);for(const o of Object.keys(s))r[o]=s[o];return r},{});else{if(!t)return;e=Hl(t)}const n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(hS)){const o=i.slice(Rp.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function xp(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,i])=>(i&&(n[`${Rp}${r}`]=i),n),{});return gS(e)}function Hl(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function gS(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],i)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=i===0?s:`${e},${s}`;return o.length>pS?(qr&&A.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const mS=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function ic(t){if(!t)return;const e=t.match(mS);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 _S(t,e){const n=ic(t),r=kp(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceparentData:n,dynamicSamplingContext:r||{},propagationContext:{traceId:i||he(),parentSpanId:s||he().substring(16),spanId:he().substring(16),sampled:o,dsc:r||{}}}:{traceparentData:n,dynamicSamplingContext:void 0,propagationContext:{traceId:i||he(),spanId:he().substring(16)}}}function Op(t,e){const n=ic(t),r=kp(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceId:i||he(),parentSpanId:s||he().substring(16),spanId:he().substring(16),sampled:o,dsc:r||{}}:{traceId:i||he(),spanId:he().substring(16)}}function sc(t=he(),e=he().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function rn(t,e=[]){return[t,e]}function vS(t,e){const[n,r]=t;return[n,[...r,e]]}function kr(t,e){const n=t[1];for(const r of n){const i=r[0].type;if(e(r,i))return!0}return!1}function yS(t,e){return kr(t,(n,r)=>e.includes(r))}function fu(t,e){return(e||new TextEncoder).encode(t)}function Ap(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(o){typeof i=="string"?i=typeof o=="string"?i+o:[fu(i,e),o]:i.push(typeof o=="string"?fu(o,e):o)}for(const o of r){const[u,a]=o;if(s(`
${JSON.stringify(u)}
`),typeof a=="string"||a instanceof Uint8Array)s(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(vt(a))}s(c)}}return typeof i=="string"?i:SS(i)}function SS(t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function bS(t,e,n){let r=typeof t=="string"?e.encode(t):t;function i(a){const c=r.subarray(0,a);return r=r.subarray(a+1),c}function s(){let a=r.indexOf(10);return a<0&&(a=r.length),JSON.parse(n.decode(i(a)))}const o=s(),u=[];for(;r.length;){const a=s(),c=typeof a.length=="number"?a.length:void 0;u.push([a,c?i(c):s()])}return[o,u]}function ES(t,e){const n=typeof t.data=="string"?fu(t.data,e):t.data;return[ze({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const TS={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function jl(t){return TS[t]}function oc(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function Dp(t,e,n,r){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:Vn(r)},...i&&{trace:ze({...i})}}}function IS(t,e,n){const r=[{type:"client_report"},{timestamp:Fi(),discarded_events:t}];return rn(e?{dsn:e}:{},[r])}const wS=60*1e3;function Mp(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?wS:r-e}function CS(t,e){return t[e]||t.all||0}function Lp(t,e,n=Date.now()){return CS(t,e)>n}function Np(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(const u of s.trim().split(",")){const[a,c,,,l]=u.split(":",5),d=parseInt(a,10),f=(isNaN(d)?60:d)*1e3;if(!c)i.all=r+f;else for(const h of c.split(";"))h==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(i[h]=r+f):i[h]=r+f}else o?i.all=r+Mp(o,r):e===429&&(i.all=r+60*1e3);return i}function RS(t,e){return t(e.stack||"",1)}function kS(t,e){const n={type:e.name||e.constructor.name,value:e.message},r=RS(t,e);return r.length&&(n.stacktrace={frames:r}),n}function xS(t,e){return t??e()}function no(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const q=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Bi="production";function ac(){return sp("globalEventProcessors",()=>[])}function Pp(t){ac().push(t)}function mo(t,e,n,r=0){return new Gr((i,s)=>{const o=t[r];if(e===null||typeof o!="function")i(e);else{const u=o({...e},n);q&&o.id&&u===null&&A.log(`Event processor "${o.id}" dropped event`),$i(u)?u.then(a=>mo(t,a,n,r+1).then(i)).then(null,s):mo(t,u,n,r+1).then(i).then(null,s)}})}function $p(t){const e=tn(),n={sid:he(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>OS(n)};return t&&qn(n,t),n}function qn(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||tn(),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:he()),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{const 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 Up(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),qn(t,n)}function OS(t){return ze({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}})}const AS=0,Fp=1;function uc(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:s,status:o,tags:u,origin:a}=pe(t);return ze({data:r,op:i,parent_span_id:s,span_id:e,status:o,tags:u,trace_id:n,origin:a})}function Qo(t){const{traceId:e,spanId:n}=t.spanContext(),r=cc(t);return sc(e,n,r)}function Zo(t){return typeof t=="number"?ql(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?ql(t.getTime()):tn()}function ql(t){return t>9999999999?t/1e3:t}function pe(t){return DS(t)?t.getSpanJSON():typeof t.toJSON=="function"?t.toJSON():{}}function DS(t){return typeof t.getSpanJSON=="function"}function cc(t){const{traceFlags:e}=t.spanContext();return!!(e&Fp)}function lc(t,e,n,r,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:u=1e3}=t,a={...e,event_id:e.event_id||n.event_id||he(),timestamp:e.timestamp||Fi()},c=n.integrations||t.integrations.map(_=>_.name);MS(a,t),PS(a,c),e.type===void 0&&LS(a,t.stackParser);const l=US(r,n.captureContext);n.mechanism&&jn(a,n.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],f=a0().getScopeData();if(s){const _=s.getScopeData();zl(f,_)}if(l){const _=l.getScopeData();zl(f,_)}const h=[...n.attachments||[],...f.attachments];h.length&&(n.attachments=h),jp(a,f);const p=[...d,...ac(),...f.eventProcessors];return mo(p,a,n).then(_=>(_&&NS(_),typeof o=="number"&&o>0?$S(_,o,u):_))}function MS(t,e){const{environment:n,release:r,dist:i,maxValueLength:s=250}=e;"environment"in t||(t.environment="environment"in e?n:Bi),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&i!==void 0&&(t.dist=i),t.message&&(t.message=Er(t.message,s));const o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=Er(o.value,s));const u=t.request;u&&u.url&&(u.url=Er(u.url,s))}const Gl=new WeakMap;function LS(t,e){const n=Z._sentryDebugIds;if(!n)return;let r;const i=Gl.get(e);i?r=i:(r=new Map,Gl.set(e,r));const s=Object.keys(n).reduce((o,u)=>{let a;const c=r.get(u);c?a=c:(a=e(u),r.set(u,a));for(let l=a.length-1;l>=0;l--){const d=a[l];if(d.filename){o[d.filename]=n[u];break}}return o},{});try{t.exception.values.forEach(o=>{o.stacktrace.frames.forEach(u=>{u.filename&&(u.debug_id=s[u.filename])})})}catch{}}function NS(t){const 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||[];const n=t.debug_meta.images;Object.keys(e).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:e[r]})})}function PS(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function $S(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:vt(i.data,e,n)}}))},...t.user&&{user:vt(t.user,e,n)},...t.contexts&&{contexts:vt(t.contexts,e,n)},...t.extra&&{extra:vt(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=vt(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>{const s=pe(i).data;return s&&(i.data=vt(s,e,n)),i})),r}function US(t,e){if(!e)return t;const n=t?t.clone():new Or;return n.update(e),n}function FS(t){if(t)return BS(t)?{captureContext:t}:jS(t)?{captureContext:t}:t}function BS(t){return t instanceof Or||typeof t=="function"}const HS=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function jS(t){return Object.keys(t).some(e=>HS.includes(e))}function Hi(t,e){return ge().captureException(t,FS(e))}function _o(t,e){const n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return ge().captureMessage(t,n,r)}function ji(t,e){return ge().captureEvent(t,e)}function qS(t){ge().configureScope(t)}function nn(t,e){ge().addBreadcrumb(t,e)}function Bp(t,e){ge().setContext(t,e)}function GS(t){ge().setExtras(t)}function zS(t,e){ge().setExtra(t,e)}function WS(t){ge().setTags(t)}function VS(t,e){ge().setTag(t,e)}function KS(t){ge().setUser(t)}function Tn(...t){const e=ge();if(t.length===2){const[n,r]=t;return n?e.withScope(()=>(e.getStackTop().scope=n,r(n))):e.withScope(r)}return e.withScope(t[0])}function YS(t){return ta(()=>t(Ut()))}function hu(t,e){return Tn(n=>(n.setSpan(t),e(n)))}function XS(t,e){return ge().startTransaction({...t},e)}async function JS(t){const e=K();return e?e.flush(t):(q&&A.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function QS(t){const e=K();return e?e.close(t):(q&&A.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function ZS(){return ge().lastEventId()}function K(){return ge().getClient()}function e0(){return!!K()}function Ae(){return ge().getScope()}function pu(t){const e=K(),n=Ut(),r=Ae(),{release:i,environment:s=Bi}=e&&e.getOptions()||{},{userAgent:o}=Z.navigator||{},u=$p({release:i,environment:s,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...t}),a=n.getSession();return a&&a.status==="ok"&&qn(a,{status:"exited"}),dc(),n.setSession(u),r.setSession(u),u}function dc(){const t=Ut(),e=Ae(),n=e.getSession()||t.getSession();n&&Up(n),Hp(),t.setSession(),e.setSession()}function Hp(){const t=Ut(),e=Ae(),n=K(),r=e.getSession()||t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function gu(t=!1){if(t){dc();return}Hp()}function vo(t){return t.transaction}function ea(t,e,n){const r=e.getOptions(),{publicKey:i}=e.getDsn()||{},{segment:s}=n&&n.getUser()||{},o=ze({environment:r.environment||Bi,release:r.release,user_segment:s,public_key:i,trace_id:t});return e.emit&&e.emit("createDsc",o),o}function xr(t){const e=K();if(!e)return{};const n=ea(pe(t).trace_id||"",e,Ae()),r=vo(t);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:s,source:o}=r.metadata;s!=null&&(n.sample_rate=`${s}`);const u=pe(r);return o&&o!=="url"&&(n.transaction=u.description),n.sampled=String(cc(r)),e.emit&&e.emit("createDsc",n),n}function jp(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;t0(t,e),r&&i0(t,r),s0(t,n),n0(t,i),r0(t,s)}function zl(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:u,breadcrumbs:a,fingerprint:c,eventProcessors:l,attachments:d,propagationContext:f,transactionName:h,span:p}=e;si(t,"extra",n),si(t,"tags",r),si(t,"user",i),si(t,"contexts",s),si(t,"sdkProcessingMetadata",u),o&&(t.level=o),h&&(t.transactionName=h),p&&(t.span=p),a.length&&(t.breadcrumbs=[...t.breadcrumbs,...a]),c.length&&(t.fingerprint=[...t.fingerprint,...c]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...f}}function si(t,e,n){if(n&&Object.keys(n).length){t[e]={...t[e]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[e][r]=n[r])}}function t0(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:u}=e,a=ze(n);a&&Object.keys(a).length&&(t.extra={...a,...t.extra});const c=ze(r);c&&Object.keys(c).length&&(t.tags={...c,...t.tags});const l=ze(i);l&&Object.keys(l).length&&(t.user={...l,...t.user});const d=ze(s);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts}),o&&(t.level=o),u&&(t.transaction=u)}function n0(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function r0(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function i0(t,e){t.contexts={trace:uc(e),...t.contexts};const n=vo(e);if(n){t.sdkProcessingMetadata={dynamicSamplingContext:xr(e),...t.sdkProcessingMetadata};const r=pe(n).description;r&&(t.tags={transaction:r,...t.tags})}}function s0(t,e){t.fingerprint=t.fingerprint?vp(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}const o0=100;let ka,Or=class ro{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Wl()}static clone(e){return e?e.clone():new ro}clone(){const e=new ro;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,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={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}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,segment:void 0,username:void 0},this._session&&qn(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={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...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}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e;if(n instanceof ro){const r=n.getScopeData();this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&Object.keys(r.user).length&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint.length&&(this._fingerprint=r.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),r.propagationContext&&(this._propagationContext=r.propagationContext)}else if(Hn(n)){const r=e;this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint&&(this._fingerprint=r.fingerprint),r.requestSession&&(this._requestSession=r.requestSession),r.propagationContext&&(this._propagationContext=r.propagationContext)}return 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._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Wl(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:o0;if(r<=0)return this;const i={timestamp:Fi(),...e},s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>r?s.slice(-r):s,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}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:n,_contexts:r,_tags:i,_extra:s,_user:o,_level:u,_fingerprint:a,_eventProcessors:c,_propagationContext:l,_sdkProcessingMetadata:d,_transactionName:f,_span:h}=this;return{breadcrumbs:e,attachments:n,contexts:r,tags:i,extra:s,user:o,level:u,fingerprint:a||[],eventProcessors:c,propagationContext:l,sdkProcessingMetadata:d,transactionName:f,span:h}}applyToEvent(e,n={},r=[]){jp(e,this.getScopeData());const i=[...r,...ac(),...this._eventProcessors];return mo(i,e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:he();if(!this._client)return A.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:he();if(!this._client)return A.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:he();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(A.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)}};function a0(){return ka||(ka=new Or),ka}function Wl(){return{traceId:he(),spanId:he().substring(16)}}const yo="7.120.0",qp=parseFloat(yo),u0=100;let fc=class{constructor(e,n,r,i=qp){this._version=i;let s;n?s=n:(s=new Or,s.setClient(e));let o;r?o=r:(o=new Or,o.setClient(e)),this._stack=[{scope:s}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const n=this.getStackTop();n.client=e,n.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const n=this.pushScope();let r;try{r=e(n)}catch(i){throw this.popScope(),i}return $i(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}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:he(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:he(),s=new Error(e);return this.getScope().captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:he();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...n,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=u0}=i.getOptions&&i.getOptions()||{};if(o<=0)return;const a={timestamp:Fi(),...e},c=s?yn(()=>s(a,n)):a;c!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n),this.getIsolationScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n),this.getIsolationScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n),this.getIsolationScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=mu(this);try{e(this)}finally{mu(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return q&&A.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return q&&!r&&(this.getClient()?A.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`):A.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&Up(r),this._sendSessionUpdate(),n.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=Bi}=r&&r.getOptions()||{},{userAgent:o}=Z.navigator||{},u=$p({release:i,environment:s,user:n.getUser(),...o&&{userAgent:o},...e}),a=n.getSession&&n.getSession();return a&&a.status==="ok"&&qn(a,{status:"exited"}),this.endSession(),n.setSession(u),u}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_callExtensionMethod(e,...n){const i=zr().__SENTRY__;if(i&&i.extensions&&typeof i.extensions[e]=="function")return i.extensions[e].apply(this,n);q&&A.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function zr(){return Z.__SENTRY__=Z.__SENTRY__||{extensions:{},hub:void 0},Z}function mu(t){const e=zr(),n=So(e);return Gp(e,t),n}function ge(){const t=zr();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return c0(t)}function Ut(){return ge().getIsolationScope()}function c0(t=zr()){return(!l0(t)||So(t).isOlderThan(qp))&&Gp(t,new fc),So(t)}function ta(t,e={}){const n=zr();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function l0(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function So(t){return sp("hub",()=>new fc,t)}function Gp(t,e){if(!t)return!1;const n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}function $t(t){return(t||ge()).getScope().getTransaction()}const d0=ic;let Vl=!1;function f0(){Vl||(Vl=!0,Ep(_u),Tp(_u))}function _u(){const t=$t();if(t){const e="internal_error";q&&A.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}_u.tag="sentry_tracingErrorCallback";var Kl;(function(t){const e="ok";t.Ok=e;const n="deadline_exceeded";t.DeadlineExceeded=n;const r="unauthenticated";t.Unauthenticated=r;const i="permission_denied";t.PermissionDenied=i;const s="not_found";t.NotFound=s;const o="resource_exhausted";t.ResourceExhausted=o;const u="invalid_argument";t.InvalidArgument=u;const a="unimplemented";t.Unimplemented=a;const c="unavailable";t.Unavailable=c;const l="internal_error";t.InternalError=l;const d="unknown_error";t.UnknownError=d;const f="cancelled";t.Cancelled=f;const h="already_exists";t.AlreadyExists=h;const p="failed_precondition";t.FailedPrecondition=p;const m="aborted";t.Aborted=m;const _="out_of_range";t.OutOfRange=_;const g="data_loss";t.DataLoss=g})(Kl||(Kl={}));function hc(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}const h0=hc;function na(t,e){t.setTag("http.status_code",String(e)),t.setData("http.response.status_code",e);const n=hc(e);n!=="unknown_error"&&t.setStatus(n)}function pc(t,e,n=()=>{}){let r;try{r=t()}catch(i){throw e(i),n(),i}return p0(r,e,n)}function p0(t,e,n){return $i(t)?t.then(r=>(n(),r),r=>{throw e(r),n(),r}):(n(),t)}function Wr(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=K(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function g0(t,e,n=()=>{},r=()=>{}){const i=ge(),s=Ae(),o=s.getSpan(),u=ia(t),a=ra(i,{parentSpan:o,spanContext:u,forceTransaction:!1,scope:s});return s.setSpan(a),pc(()=>e(a),c=>{a&&a.setStatus("internal_error"),n(c,a)},()=>{a&&a.end(),s.setSpan(o),r()})}function m0(t,e){const n=ia(t);return ta(()=>Tn(t.scope,r=>{const i=ge(),s=r.getSpan(),u=t.onlyIfParent&&!s?void 0:ra(i,{parentSpan:s,spanContext:n,forceTransaction:t.forceTransaction,scope:r});return pc(()=>e(u),()=>{if(u){const{status:a}=pe(u);(!a||a==="ok")&&u.setStatus("internal_error")}},()=>u&&u.end())}))}function _0(t,e){const n=ia(t);return ta(()=>Tn(t.scope,r=>{const i=ge(),s=r.getSpan(),u=t.onlyIfParent&&!s?void 0:ra(i,{parentSpan:s,spanContext:n,forceTransaction:t.forceTransaction,scope:r});function a(){u&&u.end()}return pc(()=>e(u,a),()=>{if(u&&u.isRecording()){const{status:c}=pe(u);(!c||c==="ok")&&u.setStatus("internal_error")}})}))}function Ir(t){if(!Wr())return;const e=ia(t),n=ge(),r=t.scope?t.scope.getSpan():qi();if(t.onlyIfParent&&!r)return;const o=(t.scope||Ae()).clone();return ra(n,{parentSpan:r,spanContext:e,forceTransaction:t.forceTransaction,scope:o})}function qi(){return Ae().getSpan()}const v0=({sentryTrace:t,baggage:e},n)=>{const r=Ae(),{traceparentData:i,dynamicSamplingContext:s,propagationContext:o}=_S(t,e);r.setPropagationContext(o),q&&i&&A.log(`[Tracing] Continuing trace ${i.traceId}.`);const u={...i,metadata:ze({dynamicSamplingContext:s})};return n?ta(()=>n(u)):u};function ra(t,{parentSpan:e,spanContext:n,forceTransaction:r,scope:i}){if(!Wr())return;const s=Ut();let o;if(e&&!r)o=e.startChild(n);else if(e){const u=xr(e),{traceId:a,spanId:c}=e.spanContext(),l=cc(e);o=t.startTransaction({traceId:a,parentSpanId:c,parentSampled:l,...n,metadata:{dynamicSamplingContext:u,...n.metadata}})}else{const{traceId:u,dsc:a,parentSpanId:c,sampled:l}={...s.getPropagationContext(),...i.getPropagationContext()};o=t.startTransaction({traceId:u,parentSpanId:c,parentSampled:l,...n,metadata:{dynamicSamplingContext:a,...n.metadata}})}return i.setSpan(o),y0(o,i,s),o}function ia(t){if(t.startTime){const e={...t};return e.startTimestamp=Zo(t.startTime),delete e.startTime,e}return t}const zp="_sentryScope",Wp="_sentryIsolationScope";function y0(t,e,n){t&&(Sn(t,Wp,n),Sn(t,zp,e))}function S0(t){return{scope:t[zp],isolationScope:t[Wp]}}let _i;function Vp(t){return _i?_i.get(t):void 0}function Kp(t){const e=Vp(t);if(!e)return;const n={};for(const[,[r,i]]of e)n[r]||(n[r]=[]),n[r].push(ze(i));return n}function b0(t,e,n,r,i,s){const o=qi();if(o){const u=Vp(o)||new Map,a=`${t}:${e}@${r}`,c=u.get(s);if(c){const[,l]=c;u.set(s,[a,{min:Math.min(l.min,n),max:Math.max(l.max,n),count:l.count+=1,sum:l.sum+=n,tags:l.tags}])}else u.set(s,[a,{min:n,max:n,count:1,sum:n,tags:i}]);_i||(_i=new WeakMap),_i.set(o,u)}}const ot="sentry.source",Ln="sentry.sample_rate",hi="sentry.op",Nn="sentry.origin",E0="profile_id";let Yp=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},Xp=class Jp{constructor(e={}){this._traceId=e.traceId||he(),this._spanId=e.spanId||he().substring(16),this._startTime=e.startTimestamp||tn(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[Nn]:e.origin||"manual",[hi]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[hi]}set op(e){this.setAttribute(hi,e)}get origin(){return this._attributes[Nn]}set origin(e){this.setAttribute(Nn,e)}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?Fp:AS}}startChild(e){const n=new Jp({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n);const r=vo(this);if(n.transaction=r,q&&r){const i=e&&e.op||"< unknown op >",s=pe(n).description||"< unknown name >",o=r.spanContext().spanId,u=`[Tracing] Starting '${i}' span on transaction '${s}' (${o}).`;A.log(u),this._logMessage=u}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setAttribute(e,n){n===void 0?delete this._attributes[e]:this._attributes[e]=n}setAttributes(e){Object.keys(e).forEach(n=>this.setAttribute(n,e[n]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return na(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status==="ok"}finish(e){return this.end(e)}end(e){if(this._endTime)return;const n=vo(this);if(q&&n&&n.spanContext().spanId!==this._spanId){const r=this._logMessage;r&&A.log(r.replace("Starting","Finishing"))}this._endTime=Zo(e)}toTraceparent(){return Qo(this)}toContext(){return ze({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return uc(this)}getSpanJSON(){return ze({data:this._getData(),description:this._name,op:this._attributes[hi],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Nn],_metrics_summary:Kp(this),profile_id:this._attributes[E0],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:n}=this,r=Object.keys(e).length>0,i=Object.keys(n).length>0;if(!(!r&&!i))return r&&i?{...e,...n}:r?e:n}},Qp=class extends Xp{constructor(e,n){super(e),this._contexts={},this._hub=n||ge(),this._name=e.name||"",this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;const r=this._metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[ot]&&{source:this._attributes[ot]},...this._attributes[Ln]&&{sampleRate:this._attributes[Ln]}}}set metadata(e){this._metadata=e}setName(e,n="custom"){this._name=e,this.setAttribute(ot,n)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Yp(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){const n=Zo(e),r=this._finishTransaction(n);if(r)return this._hub.captureEvent(r)}toContext(){const e=super.toContext();return ze({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return xr(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||(q&&A.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this._sampled!==!0){q&&A.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}const r=this.spanRecorder?this.spanRecorder.spans.filter(l=>l!==this&&pe(l).timestamp):[];if(this._trimEnd&&r.length>0){const l=r.map(d=>pe(d).timestamp).filter(Boolean);this._endTime=l.reduce((d,f)=>d>f?d:f)}const{scope:i,isolationScope:s}=S0(this),{metadata:o}=this,{source:u}=o,a={contexts:{...this._contexts,trace:uc(this)},spans:r,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:i,capturedSpanIsolationScope:s,...ze({dynamicSamplingContext:xr(this)})},_metrics_summary:Kp(this),...u&&{transaction_info:{source:u}}};return Object.keys(this._measurements).length>0&&(q&&A.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),a.measurements=this._measurements),q&&A.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),a}};const vi={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},T0="finishReason",tr=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];let I0=class extends Yp{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){if(e.spanContext().spanId!==this.transactionSpanId){const n=e.end;e.end=(...r)=>(this._popActivity(e.spanContext().spanId),n.apply(e,r)),pe(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}},w0=class extends Qp{constructor(e,n,r=vi.idleTimeout,i=vi.finalTimeout,s=vi.heartbeatInterval,o=!1,u=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=s,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=tr[4],this._autoFinishAllowed=!u,o&&(q&&A.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),n.getScope().setSpan(this)),u||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=tr[3],this.end())},this._finalTimeout)}end(e){const n=Zo(e);if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setAttribute(T0,this._finishReason),this.spanRecorder){q&&A.log("[Tracing] finishing IdleTransaction",new Date(n*1e3).toISOString(),this.op);for(const r of this._beforeFinishCallbacks)r(this,n);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanContext().spanId===this.spanContext().spanId)return!0;pe(r).timestamp||(r.setStatus("cancelled"),r.end(n),q&&A.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));const{start_timestamp:i,timestamp:s}=pe(r),o=i&&i<n,u=(this._finalTimeout+this._idleTimeout)/1e3,a=s&&i&&s-i<u;if(q){const c=JSON.stringify(r,void 0,2);o?a||A.log("[Tracing] discarding Span since it finished after Transaction final timeout",c):A.log("[Tracing] discarding Span since it happened after Transaction was finished",c)}return o&&a}),q&&A.log("[Tracing] flushing IdleTransaction")}else q&&A.log("[Tracing] No active IdleTransaction");if(this._onScope){const r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new I0(n,r,this.spanContext().spanId,e),q&&A.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=tr[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(q&&A.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=tr[1],this.end(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),q&&A.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,q&&A.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(q&&A.log(`[Tracing] popActivity ${e}`),delete this.activities[e],q&&A.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=tn();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=tr[5],this.end(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(q&&A.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=tr[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){q&&A.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function Zp(t,e,n){if(!Wr(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setAttribute(Ln,Number(t.sampled)),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setAttribute(Ln,Number(r))):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setAttribute(Ln,Number(r))):(r=1,t.setAttribute(Ln,r)),eg(r)?r?(t.sampled=Math.random()<r,t.sampled?(q&&A.log(`[Tracing] starting ${t.op} transaction - ${pe(t).description}`),t):(q&&A.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):(q&&A.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):(q&&A.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function eg(t){return np(t)||!(typeof t=="number"||typeof t=="boolean")?(q&&A.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)}.`),!1):t<0||t>1?(q&&A.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function C0(){const e=this.getScope().getSpan();return e?{"sentry-trace":Qo(e)}:{}}function R0(t,e){const n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=t.instrumenter||"sentry";i!==s&&(q&&A.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter.
The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let o=new Qp(t,this);return o=Zp(o,r,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...e}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function bo(t,e,n,r,i,s,o,u=!1){const a=t.getClient(),c=a&&a.getOptions()||{};let l=new w0(e,t,n,r,o,i,u);return l=Zp(l,c,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),l.isRecording()&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",l),l}function gc(){const t=zr();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=R0),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=C0),f0())}function tg(t,e,n){const r=$t();r&&r.setMeasurement(t,e,n)}function k0(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 x0(t,e,n,r){const i=oc(n),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&e&&{dsn:Vn(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return rn(s,[o])}function ng(t,e,n,r){const i=oc(n),s=t.type&&t.type!=="replay_event"?t.type:"event";k0(t,n&&n.sdk);const o=Dp(t,i,r,e);return delete t.sdkProcessingMetadata,rn(o,[[{type:s},t]])}const O0="7";function rg(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function A0(t){return`${rg(t)}${t.projectId}/envelope/`}function D0(t,e){return Ry({sentry_key:t.publicKey,sentry_version:O0,...e&&{sentry_client:`${e.name}/${e.version}`}})}function ig(t,e={}){const n=typeof e=="string"?e:e.tunnel,r=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return n||`${A0(t)}?${D0(t,r)}`}function M0(t,e){const n=dp(t);if(!n)return"";const r=`${rg(n)}embed/error-page/`;let i=`dsn=${Vn(n)}`;for(const s in e)if(s!=="dsn"&&s!=="onClose")if(s==="user"){const o=e.user;if(!o)continue;o.name&&(i+=`&name=${encodeURIComponent(o.name)}`),o.email&&(i+=`&email=${encodeURIComponent(o.email)}`)}else i+=`&${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`;return`${r}?${i}`}const Yl=[];function L0(t){const e={};return t.forEach(n=>{const{name:r}=n,i=e[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.keys(e).map(n=>e[n])}function N0(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=vp(n(e)):r=e;const i=L0(r),s=U0(i,o=>o.name==="Debug");if(s!==-1){const[o]=i.splice(s,1);i.push(o)}return i}function P0(t,e){const n={};return e.forEach(r=>{r&&sg(t,r,n)}),n}function Xl(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function sg(t,e,n){if(n[e.name]){q&&A.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,Yl.indexOf(e.name)===-1&&(e.setupOnce(Pp,ge),Yl.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),t.on&&typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,o)=>r(s,o,t),{id:e.name});t.addEventProcessor(i)}q&&A.log(`Integration installed: ${e.name}`)}function $0(t){const e=K();if(!e||!e.addIntegration){q&&A.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}function U0(t,e){for(let n=0;n<t.length;n++)if(e(t[n])===!0)return n;return-1}function xe(t,e){return Object.assign(function(...r){return e(...r)},{id:t})}function F0(t,e,n,r){const i=Object.entries(ze(r)).sort((s,o)=>s[0].localeCompare(o[0]));return`${t}${e}${n}${i}`}function B0(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e&=e}return e>>>0}function H0(t){let e="";for(const n of t){const r=Object.entries(n.tags),i=r.length>0?`|#${r.map(([s,o])=>`${s}:${o}`).join(",")}`:"";e+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${i}|T${n.timestamp}
`}return e}function j0(t){return t.replace(/[^\w]+/gi,"_")}function q0(t){return t.replace(/[^\w\-.]+/gi,"_")}function G0(t){return t.replace(/[^\w\-./]+/gi,"")}const z0=[[`
`,"\\n"],["\r","\\r"],[" ","\\t"],["\\","\\\\"],["|","\\u{7c}"],[",","\\u{2c}"]];function W0(t){for(const[e,n]of z0)if(t===e)return n;return t}function V0(t){return[...t].reduce((e,n)=>e+W0(n),"")}function K0(t){const e={};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=G0(n);e[r]=V0(String(t[n]))}return e}function Y0(t,e,n,r){const i={sent_at:new Date().toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&e&&(i.dsn=Vn(e));const s=X0(t);return rn(i,[s])}function X0(t){const e=H0(t);return[{type:"statsd",length:e.length},e]}const Jl="Not capturing exception because it's already been captured.";class J0{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=dp(e.dsn):q&&A.warn("No DSN provided, client will not send events."),this._dsn){const n=ig(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(Nl(e)){q&&A.log(Jl);return}let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const o=Zu(e)?e:String(e),u=ec(e)?this.eventFromMessage(o,n,r):this.eventFromException(e,r);return this._process(u.then(a=>this._captureEvent(a,r,i)).then(a=>{s=a})),s}captureEvent(e,n,r){if(n&&n.originalException&&Nl(n.originalException)){q&&A.log(Jl);return}let i=n&&n.event_id;const o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,n,o||r).then(u=>{i=u})),i}captureSession(e){typeof e.release!="string"?q&&A.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),qn(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):Rr(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return q&&A.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const n=this._integrations[e.name];sg(this,e,this._integrations),n||Xl(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=ng(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=vS(r,ES(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const n=x0(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=typeof r=="number"?r:1,s=`${e}:${n}`;q&&A.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}captureAggregateMetrics(e){q&&A.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const n=Y0(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=P0(this,e),Xl(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const a of s){const c=a.mechanism;if(c&&c.handled===!1){r=!0;break}}}const o=e.status==="ok";(o&&e.errors===0||o&&r)&&(qn(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Gr(n=>{let r=0;const i=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=i,e&&r>=e&&(clearInterval(s),n(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,i=Ut()){const s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o.length>0&&(n.integrations=o),this.emit("preprocessEvent",e,n),lc(s,e,n,r,this,i).then(u=>{if(u===null)return u;const a={...i.getPropagationContext(),...r?r.getPropagationContext():void 0};if(!(u.contexts&&u.contexts.trace)&&a){const{traceId:l,spanId:d,parentSpanId:f,dsc:h}=a;u.contexts={trace:{trace_id:l,span_id:d,parent_span_id:f},...u.contexts};const p=h||ea(l,this,r);u.sdkProcessingMetadata={dynamicSamplingContext:p,...u.sdkProcessingMetadata}}return u})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(q){const s=i;s.logLevel==="log"?A.log(s.message):A.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i,o=ag(e),u=og(e),a=e.type||"error",c=`before send for type \`${a}\``;if(u&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),rc(new Mt(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const l=a==="replay_event"?"replay":a,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,f).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",l,e),new Mt("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return h;const m=Z0(i,h,n);return Q0(m,c)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",l,e),o){const g=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw new Mt(`${c} returned \`null\`, will not send event.`,"log")}const p=r&&r.getSession();if(!o&&p&&this._updateSessionFromEvent(p,h),o){const _=h.sdkProcessingMetadata&&h.sdkProcessingMetadata.spanCountBeforeProcessing||0,g=h.spans?h.spans.length:0,v=_-g;v>0&&this.recordDroppedEvent("before_send","span",v)}const m=h.transaction_info;if(o&&m&&h.transaction!==e.transaction){const _="custom";h.transaction_info={...m,source:_}}return this.sendEvent(h,n),h}).then(null,h=>{throw h instanceof Mt?h:(this.captureException(h,{data:{__sentry__:!0},originalException:h}),new Mt(`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))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,n=>{q&&A.error("Error while sending event:",n)});q&&A.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{const[r,i]=n.split(":");return{reason:r,category:i,quantity:e[n]}})}}function Q0(t,e){const n=`${e} must return \`null\` or a valid event.`;if($i(t))return t.then(r=>{if(!Hn(r)&&r!==null)throw new Mt(n);return r},r=>{throw new Mt(`${e} rejected with ${r}`)});if(!Hn(t)&&t!==null)throw new Mt(n);return t}function Z0(t,e,n){const{beforeSend:r,beforeSendTransaction:i}=t;if(og(e)&&r)return r(e,n);if(ag(e)&&i){if(e.spans){const s=e.spans.length;e.sdkProcessingMetadata={...e.sdkProcessingMetadata,spanCountBeforeProcessing:s}}return i(e,n)}return e}function og(t){return t.type===void 0}function ag(t){return t.type==="transaction"}function ug(t){const e=K();!e||!e.addEventProcessor||e.addEventProcessor(t)}const cg="c",lg="g",mc="s",dg="d",eb=5e3;class tb{constructor(e){this._value=e}get weight(){return 1}add(e){this._value+=e}toString(){return`${this._value}`}}class nb{constructor(e){this._last=e,this._min=e,this._max=e,this._sum=e,this._count=1}get weight(){return 5}add(e){this._last=e,e<this._min&&(this._min=e),e>this._max&&(this._max=e),this._sum+=e,this._count++}toString(){return`${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`}}class rb{constructor(e){this._value=[e]}get weight(){return this._value.length}add(e){this._value.push(e)}toString(){return this._value.join(":")}}class ib{constructor(e){this.first=e,this._value=new Set([e])}get weight(){return this._value.size}add(e){this._value.add(e)}toString(){return Array.from(this._value).map(e=>typeof e=="string"?B0(e):e).join(":")}}const sb={[cg]:tb,[lg]:nb,[dg]:rb,[mc]:ib};function ob(t,e){e.debug===!0&&(q?A.enable():yn(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Ae().update(e.initialScope);const r=new t(e);fg(r),ab(r)}function fg(t){const n=ge().getStackTop();n.client=t,n.scope.setClient(t)}function ab(t){t.init?t.init():t.setupIntegrations&&t.setupIntegrations()}const ub=30;function _c(t,e,n=cS(t.bufferSize||ub)){let r={};const i=o=>n.drain(o);function s(o){const u=[];if(kr(o,(d,f)=>{const h=jl(f);if(Lp(r,h)){const p=Ql(d,f);t.recordDroppedEvent("ratelimit_backoff",h,p)}else u.push(d)}),u.length===0)return Rr();const a=rn(o[0],u),c=d=>{kr(a,(f,h)=>{const p=Ql(f,h);t.recordDroppedEvent(d,jl(h),p)})},l=()=>e({body:Ap(a,t.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&q&&A.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=Np(r,d),d),d=>{throw c("network_error"),d});return n.add(l).then(d=>d,d=>{if(d instanceof Mt)return q&&A.error("Skipped sending event because buffer is full."),c("queue_overflow"),Rr();throw d})}return s.__sentry__baseTransport__=!0,{send:s,flush:i}}function Ql(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}const cb=100,Zl=5e3,lb=36e5;function xa(t,e){q&&A.info(`[Offline]: ${t}`,e)}function db(t){return e=>{const n=t(e),r=e.createStore?e.createStore(e):void 0;let i=Zl,s;function o(l,d,f){return yS(l,["replay_event","replay_recording","client_report"])?!1:e.shouldStore?e.shouldStore(l,d,f):!0}function u(l){r&&(s&&clearTimeout(s),s=setTimeout(async()=>{s=void 0;const d=await r.pop();d&&(xa("Attempting to send previously queued event"),c(d).catch(f=>{xa("Failed to retry sending",f)}))},l),typeof s!="number"&&s.unref&&s.unref())}function a(){s||(u(i),i=Math.min(i*2,lb))}async function c(l){try{const d=await n.send(l);let f=cb;if(d){if(d.headers&&d.headers["retry-after"])f=Mp(d.headers["retry-after"]);else if((d.statusCode||0)>=400)return d}return u(f),i=Zl,d}catch(d){if(r&&await o(l,d,i))return await r.insert(l),a(),xa("Error sending. Event queued",d),{};throw d}}return e.flushAtStartup&&a(),{send:c,flush:l=>n.flush(l)}}}function hg(t,e){let n;return kr(t,(r,i)=>(e.includes(i)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function fb(t,e){return n=>{const r=t(n);return{...r,send:async i=>{const s=hg(i,["event","transaction","profile","replay_event"]);return s&&(s.release=e),r.send(i)}}}}function hb(t,e){return rn(e?{...t[0],dsn:e}:t[0],t[1])}function pb(t,e){return n=>{const r=t(n),i=new Map;function s(a,c){const l=c?`${a}:${c}`:a;let d=i.get(l);if(!d){const f=cp(a);if(!f)return;const h=ig(f,n.tunnel);d=c?fb(t,c)({...n,url:h}):t({...n,url:h}),i.set(l,d)}return[a,d]}async function o(a){function c(f){const h=f&&f.length?f:["event"];return hg(a,h)}const l=e({envelope:a,getEvent:c}).map(f=>typeof f=="string"?s(f,void 0):s(f.dsn,f.release)).filter(f=>!!f);return l.length===0&&l.push(["",r]),(await Promise.all(l.map(([f,h])=>h.send(hb(a,f)))))[0]}async function u(a){const c=[await r.flush(a)];for(const[,l]of i)c.push(await l.flush(a));return c.every(l=>l)}return{send:o,flush:u}}}function gb(t,e){const n={sent_at:new Date().toISOString()};e&&(n.dsn=Vn(e));const r=t.map(mb);return rn(n,r)}function mb(t){return[{type:"span"},t]}function pg(t,e){const n=e&&yb(e)?e.getClient():e,r=n&&n.getDsn(),i=n&&n.getOptions().tunnel;return vb(t,r)||_b(t,i)}function _b(t,e){return e?ed(t)===ed(e):!1}function vb(t,e){return e?t.includes(e.host):!1}function ed(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function yb(t){return t.getClient!==void 0}function Sb(t,...e){const n=new String(String.raw(t,...e));return n.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=e,n}function gg(t,e,n=[e],r="npm"){const i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:yo})),version:yo}),t._metadata=i}const mg=new Map,td=new Set;function bb(t){if(Z._sentryModuleMetadata)for(const e of Object.keys(Z._sentryModuleMetadata)){const n=Z._sentryModuleMetadata[e];if(td.has(e))continue;td.add(e);const r=t(e);for(const i of r.reverse())if(i.filename){mg.set(i.filename,n);break}}}function Eb(t,e){return bb(t),mg.get(e)}function Tb(t,e){try{e.exception.values.forEach(n=>{if(n.stacktrace)for(const r of n.stacktrace.frames||[]){if(!r.filename)continue;const i=Eb(t,r.filename);i&&(r.module_metadata=i)}})}catch{}}function Ib(t){try{t.exception.values.forEach(e=>{if(e.stacktrace)for(const n of e.stacktrace.frames||[])delete n.module_metadata})}catch{}}const _g="ModuleMetadata",wb=()=>({name:_g,setupOnce(){},setup(t){typeof t.on=="function"&&t.on("beforeEnvelope",e=>{kr(e,(n,r)=>{if(r==="event"){const i=Array.isArray(n)?n[1]:void 0;i&&(Ib(i),n[1]=i)}})})},processEvent(t,e,n){const r=n.getOptions().stackParser;return Tb(r,t),t}}),vg=wb,Cb=xe(_g,vg),Rb=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],kb=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],yg="InboundFilters",xb=(t={})=>({name:yg,setupOnce(){},processEvent(e,n,r){const i=r.getOptions(),s=Ob(t,i);return Ab(e,s)?null:e}}),vc=xb,Sg=xe(yg,vc);function Ob(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:Rb],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:kb],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function Ab(t,e){return e.ignoreInternal&&$b(t)?(q&&A.warn(`Event dropped due to being internal Sentry Error.
Event: ${hn(t)}`),!0):Db(t,e.ignoreErrors)?(q&&A.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${hn(t)}`),!0):Mb(t,e.ignoreTransactions)?(q&&A.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${hn(t)}`),!0):Lb(t,e.denyUrls)?(q&&A.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${hn(t)}.
Url: ${Eo(t)}`),!0):Nb(t,e.allowUrls)?!1:(q&&A.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${hn(t)}.
Url: ${Eo(t)}`),!0)}function Db(t,e){return t.type||!e||!e.length?!1:Pb(t).some(n=>jr(n,e))}function Mb(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?jr(n,e):!1}function Lb(t,e){if(!e||!e.length)return!1;const n=Eo(t);return n?jr(n,e):!1}function Nb(t,e){if(!e||!e.length)return!0;const n=Eo(t);return n?jr(n,e):!0}function Pb(t){const 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}`)),q&&e.length===0&&A.error(`Could not extract message for event ${hn(t)}`),e}function $b(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Ub(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Eo(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Ub(e):null}catch{return q&&A.error(`Cannot extract url for event ${hn(t)}`),null}}let nd;const bg="FunctionToString",rd=new WeakMap,Fb=()=>({name:bg,setupOnce(){nd=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=nc(this),n=rd.has(K())&&e!==void 0?e:this;return nd.apply(n,t)}}catch{}},setup(t){rd.set(t,!0)}}),yc=Fb,Eg=xe(bg,yc),Bb="cause",Hb=5,Tg="LinkedErrors",jb=(t={})=>{const e=t.limit||Hb,n=t.key||Bb;return{name:Tg,setupOnce(){},preprocessEvent(r,i,s){const o=s.getOptions();ip(kS,o.stackParser,o.maxValueLength,n,e,r,i)}}},qb=jb,Gb=xe(Tg,qb),zb=Object.freeze(Object.defineProperty({__proto__:null,FunctionToString:Eg,InboundFilters:Sg,LinkedErrors:Gb},Symbol.toStringTag,{value:"Module"}));class Wb{constructor(e){this._client=e,this._buckets=new Map,this._interval=setInterval(()=>this.flush(),eb)}add(e,n,r,i="none",s={},o=tn()){const u=Math.floor(o),a=q0(n),c=K0(s),l=j0(i),d=F0(e,a,l,c);let f=this._buckets.get(d);const h=f&&e===mc?f.metric.weight:0;f?(f.metric.add(r),f.timestamp<u&&(f.timestamp=u)):(f={metric:new sb[e](r),timestamp:u,metricType:e,name:a,unit:l,tags:c},this._buckets.set(d,f));const p=typeof r=="string"?f.metric.weight-h:r;b0(e,a,p,l,s,d)}flush(){if(this._buckets.size!==0){if(this._client.captureAggregateMetrics){const e=Array.from(this._buckets).map(([,n])=>n);this._client.captureAggregateMetrics(e)}this._buckets.clear()}}close(){clearInterval(this._interval),this.flush()}}const Ig="MetricsAggregator",Vb=()=>({name:Ig,setupOnce(){},setup(t){t.metricsAggregator=new Wb(t)}}),wg=Vb,Kb=xe(Ig,wg);function sa(t,e,n,r={}){const i=K(),s=Ae();if(i){if(!i.metricsAggregator){q&&A.warn("No metrics aggregator enabled. Please add the MetricsAggregator integration to use metrics APIs");return}const{unit:o,tags:u,timestamp:a}=r,{release:c,environment:l}=i.getOptions(),d=s.getTransaction(),f={};c&&(f.release=c),l&&(f.environment=l),d&&(f.transaction=pe(d).description||""),q&&A.log(`Adding value of ${n} to ${t} metric ${e}`),i.metricsAggregator.add(t,e,n,o,{...f,...u},a)}}function Yb(t,e=1,n){sa(cg,t,e,n)}function Xb(t,e,n){sa(dg,t,e,n)}function Jb(t,e,n){sa(mc,t,e,n)}function Qb(t,e,n){sa(lg,t,e,n)}const Zb={increment:Yb,distribution:Xb,set:Jb,gauge:Qb,MetricsAggregator:Kb,metricsAggregatorIntegration:wg},eE=zb,ue=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,z=Z;function Cg(){z.document?z.document.addEventListener("visibilitychange",()=>{const t=$t();if(z.document.hidden&&t){const e="cancelled",{op:n,status:r}=pe(t);ue&&A.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.end()}}):ue&&A.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Gi=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||r===void 0)&&(r=e.value,e.delta=i,t(e)))}},tE=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,nE=()=>{const t=z.performance.timing,e=z.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},oa=()=>z.__WEB_VITALS_POLYFILL__?z.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||nE()):z.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],Sc=()=>{const t=oa();return t&&t.activationStart||0},zi=(t,e)=>{const n=oa();let r="navigate";return n&&(z.document&&z.document.prerendering||Sc()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:tE(),navigationType:r}},Vr=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(i=>{e(i.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},Wi=(t,e)=>{const n=r=>{(r.type==="pagehide"||z.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};z.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))},rE=(t,e={})=>{const n=zi("CLS",0);let r,i=0,s=[];const o=a=>{a.forEach(c=>{if(!c.hadRecentInput){const l=s[0],d=s[s.length-1];i&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-l.startTime<5e3?(i+=c.value,s.push(c)):(i=c.value,s=[c]),i>n.value&&(n.value=i,n.entries=s,r&&r())}})},u=Vr("layout-shift",o);if(u){r=Gi(t,n,e.reportAllChanges);const a=()=>{o(u.takeRecords()),r(!0)};return Wi(a),a}};let To=-1;const iE=()=>{z.document&&z.document.visibilityState&&(To=z.document.visibilityState==="hidden"&&!z.document.prerendering?0:1/0)},sE=()=>{Wi(({timeStamp:t})=>{To=t},!0)},bc=()=>(To<0&&(iE(),sE()),{get firstHiddenTime(){return To}}),oE=t=>{const e=bc(),n=zi("FID");let r;const i=u=>{u.startTime<e.firstHiddenTime&&(n.value=u.processingStart-u.startTime,n.entries.push(u),r(!0))},s=u=>{u.forEach(i)},o=Vr("first-input",s);r=Gi(t,n),o&&Wi(()=>{s(o.takeRecords()),o.disconnect()},!0)};let Rg=0,Oa=1/0,vs=0;const aE=t=>{t.forEach(e=>{e.interactionId&&(Oa=Math.min(Oa,e.interactionId),vs=Math.max(vs,e.interactionId),Rg=vs?(vs-Oa)/7+1:0)})};let vu;const uE=()=>vu?Rg:performance.interactionCount||0,cE=()=>{"interactionCount"in performance||vu||(vu=Vr("event",aE,{type:"event",buffered:!0,durationThreshold:0}))},kg=()=>uE(),id=10,Kt=[],Aa={},sd=t=>{const e=Kt[Kt.length-1],n=Aa[t.interactionId];if(n||Kt.length<id||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};Aa[r.id]=r,Kt.push(r)}Kt.sort((r,i)=>i.latency-r.latency),Kt.splice(id).forEach(r=>{delete Aa[r.id]})}},lE=()=>{const t=Math.min(Kt.length-1,Math.floor(kg()/50));return Kt[t]},dE=(t,e)=>{e=e||{},cE();const n=zi("INP");let r;const i=o=>{o.forEach(a=>{a.interactionId&&sd(a),a.entryType==="first-input"&&!Kt.some(l=>l.entries.some(d=>a.duration===d.duration&&a.startTime===d.startTime))&&sd(a)});const u=lE();u&&u.latency!==n.value&&(n.value=u.latency,n.entries=u.entries,r())},s=Vr("event",i,{durationThreshold:e.durationThreshold||40});r=Gi(t,n,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Wi(()=>{i(s.takeRecords()),n.value<0&&kg()>0&&(n.value=0,n.entries=[]),r(!0)}))},od={},fE=t=>{const e=bc(),n=zi("LCP");let r;const i=o=>{const u=o[o.length-1];if(u){const a=Math.max(u.startTime-Sc(),0);a<e.firstHiddenTime&&(n.value=a,n.entries=[u],r())}},s=Vr("largest-contentful-paint",i);if(s){r=Gi(t,n);const o=()=>{od[n.id]||(i(s.takeRecords()),s.disconnect(),od[n.id]=!0,r(!0))};return["keydown","click"].forEach(u=>{z.document&&addEventListener(u,o,{once:!0,capture:!0})}),Wi(o,!0),o}},yu=t=>{z.document&&(z.document.prerendering?addEventListener("prerenderingchange",()=>yu(t),!0):z.document.readyState!=="complete"?addEventListener("load",()=>yu(t),!0):setTimeout(t,0))},hE=(t,e)=>{e=e||{};const n=zi("TTFB"),r=Gi(t,n,e.reportAllChanges);yu(()=>{const i=oa();if(i){if(n.value=Math.max(i.responseStart-Sc(),0),n.value<0||n.value>performance.now())return;n.entries=[i],r(!0)}})},yi={},Io={};let xg,Og,Ag,Dg,Mg;function pE(t,e=!1){return Vi("cls",t,vE,xg,e)}function Lg(t,e=!1){return Vi("lcp",t,SE,Ag,e)}function gE(t){return Vi("ttfb",t,bE,Dg)}function mE(t){return Vi("fid",t,yE,Og)}function _E(t){return Vi("inp",t,EE,Mg)}function bn(t,e){return Ng(t,e),Io[t]||(TE(t),Io[t]=!0),Pg(t,e)}function Kr(t,e){const n=yi[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(i){ue&&A.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${en(r)}
Error:`,i)}}function vE(){return rE(t=>{Kr("cls",{metric:t}),xg=t},{reportAllChanges:!0})}function yE(){return oE(t=>{Kr("fid",{metric:t}),Og=t})}function SE(){return fE(t=>{Kr("lcp",{metric:t}),Ag=t})}function bE(){return hE(t=>{Kr("ttfb",{metric:t}),Dg=t})}function EE(){return dE(t=>{Kr("inp",{metric:t}),Mg=t})}function Vi(t,e,n,r,i=!1){Ng(t,e);let s;return Io[t]||(s=n(),Io[t]=!0),r&&e({metric:r}),Pg(t,e,i?s:void 0)}function TE(t){const e={};t==="event"&&(e.durationThreshold=0),Vr(t,n=>{Kr(t,{entries:n})},e)}function Ng(t,e){yi[t]=yi[t]||[],yi[t].push(e)}function Pg(t,e,n){return()=>{n&&n();const r=yi[t];if(!r)return;const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}function Da(t){return typeof t=="number"&&isFinite(t)}function Ar(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const IE=2147483647;function $e(t){return t/1e3}function Ec(){return z&&z.addEventListener&&z.performance}let ad=0,Re={},Ot,Si;function $g(){const t=Ec();if(t&&Xe){t.mark&&z.performance.mark("sentry-tracing-init");const e=RE(),n=wE(),r=CE(),i=kE();return()=>{e(),n(),r(),i()}}return()=>{}}function Ug(){bn("longtask",({entries:t})=>{for(const e of t){const n=$t();if(!n)return;const r=$e(Xe+e.startTime),i=$e(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function Fg(){bn("event",({entries:t})=>{for(const e of t){const n=$t();if(!n)return;if(e.name==="click"){const r=$e(Xe+e.startTime),i=$e(e.duration),s={description:vn(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i},o=up(e.target);o&&(s.attributes={"ui.component_name":o}),n.startChild(s)}}})}function Bg(t,e){if(Ec()&&Xe){const r=xE(t,e);return()=>{r()}}return()=>{}}function wE(){return pE(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(ue&&A.log("[Measurements] Adding CLS"),Re.cls={value:t.value,unit:""},Si=e)},!0)}function CE(){return Lg(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(ue&&A.log("[Measurements] Adding LCP"),Re.lcp={value:t.value,unit:"millisecond"},Ot=e)},!0)}function RE(){return mE(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=$e(Xe),r=$e(e.startTime);ue&&A.log("[Measurements] Adding FID"),Re.fid={value:t.value,unit:"millisecond"},Re["mark.fid"]={value:n+r,unit:"second"}})}function kE(){return gE(({metric:t})=>{t.entries[t.entries.length-1]&&(ue&&A.log("[Measurements] Adding TTFB"),Re.ttfb={value:t.value,unit:"millisecond"})})}const 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 xE(t,e){return _E(({metric:n})=>{if(n.value===void 0)return;const r=n.entries.find(y=>y.duration===n.value&&ud[y.name]!==void 0),i=K();if(!r||!i)return;const s=ud[r.name],o=i.getOptions(),u=$e(Xe+r.startTime),a=$e(n.value),c=r.interactionId!==void 0?t[r.interactionId]:void 0;if(c===void 0)return;const{routeName:l,parentContext:d,activeTransaction:f,user:h,replayId:p}=c,m=h!==void 0?h.email||h.id||h.ip_address:void 0,_=f!==void 0?f.getProfileId():void 0,g=new Xp({startTimestamp:u,endTimestamp:u+a,op:`ui.interaction.${s}`,name:vn(r.target),attributes:{release:o.release,environment:o.environment,transaction:l,...m!==void 0&&m!==""?{user:m}:{},..._!==void 0?{profile_id:_}:{},...p!==void 0?{replay_id:p}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),v=$E(d,o,e);if(v&&Math.random()<v){const y=g?gb([g],i.getDsn()):void 0,w=i&&i.getTransport();w&&y&&w.send(y).then(null,R=>{ue&&A.error("Error while sending interaction:",R)});return}})}function Hg(t){const e=Ec();if(!e||!z.performance.getEntries||!Xe)return;ue&&A.log("[Tracing] Adding & adjusting spans using Performance API");const n=$e(Xe),r=e.getEntries(),{op:i,start_timestamp:s}=pe(t);if(r.slice(ad).forEach(o=>{const u=$e(o.startTime),a=$e(o.duration);if(!(t.op==="navigation"&&s&&n+u<s))switch(o.entryType){case"navigation":{AE(t,o,n);break}case"mark":case"paint":case"measure":{OE(t,o,u,a,n);const c=bc(),l=o.startTime<c.firstHiddenTime;o.name==="first-paint"&&l&&(ue&&A.log("[Measurements] Adding FP"),Re.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&l&&(ue&&A.log("[Measurements] Adding FCP"),Re.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{ME(t,o,o.name,u,a,n);break}}}),ad=Math.max(r.length-1,0),LE(t),i==="pageload"){PE(Re),["fcp","fp","lcp"].forEach(u=>{if(!Re[u]||!s||n>=s)return;const a=Re[u].value,c=n+$e(a),l=Math.abs((c-s)*1e3),d=l-a;ue&&A.log(`[Measurements] Normalized ${u} from ${a} to ${l} (${d})`),Re[u].value=l});const o=Re["mark.fid"];o&&Re.fid&&(Ar(t,{description:"first input delay",endTimestamp:o.value+$e(Re.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete Re["mark.fid"]),"fcp"in Re||delete Re.cls,Object.keys(Re).forEach(u=>{tg(u,Re[u].value,Re[u].unit)}),NE(t)}Ot=void 0,Si=void 0,Re={}}function OE(t,e,n,r,i){const s=i+n,o=s+r;return Ar(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function AE(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{ys(t,e,r,n)}),ys(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),ys(t,e,"fetch",n,"cache","domainLookupStart"),ys(t,e,"domainLookup",n,"DNS"),DE(t,e,n)}function ys(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],u=e[`${n}Start`];!u||!o||Ar(t,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+$e(u),endTimestamp:r+$e(o)})}function DE(t,e,n){e.responseEnd&&(Ar(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+$e(e.requestStart),endTimestamp:n+$e(e.responseEnd)}),Ar(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+$e(e.responseStart),endTimestamp:n+$e(e.responseEnd)}))}function ME(t,e,n,r,i,s){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const o=Bn(n),u={};Ma(u,e,"transferSize","http.response_transfer_size"),Ma(u,e,"encodedBodySize","http.response_content_length"),Ma(u,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(u["resource.render_blocking_status"]=e.renderBlockingStatus),o.protocol&&(u["url.scheme"]=o.protocol.split(":").pop()),o.host&&(u["server.address"]=o.host),u["url.same_origin"]=n.includes(z.location.origin);const a=s+r,c=a+i;Ar(t,{description:n.replace(z.location.origin,""),endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:u})}function LE(t){const e=z.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),Da(n.rtt)&&(Re["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Da(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Da(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function NE(t){Ot&&(ue&&A.log("[Measurements] Adding LCP Data"),Ot.element&&t.setTag("lcp.element",vn(Ot.element)),Ot.id&&t.setTag("lcp.id",Ot.id),Ot.url&&t.setTag("lcp.url",Ot.url.trim().slice(0,200)),t.setTag("lcp.size",Ot.size)),Si&&Si.sources&&(ue&&A.log("[Measurements] Adding CLS Data"),Si.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,vn(e.node))))}function Ma(t,e,n,r){const i=e[n];i!=null&&i<IE&&(t[r]=i)}function PE(t){const e=oa();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(ue&&A.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function $E(t,e,n){if(!Wr(e))return!1;let r;return t!==void 0&&typeof e.tracesSampler=="function"?r=e.tracesSampler({transactionContext:t,name:t.name,parentSampled:t.parentSampled,attributes:{...t.data,...t.attributes},location:z.location}):t!==void 0&&t.sampled!==void 0?r=t.sampled:typeof e.tracesSampleRate<"u"?r=e.tracesSampleRate:r=1,eg(r)?r===!0?n:r===!1?0:r*n:(ue&&A.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}function UE(t,e,n,r,i="auto.http.browser"){if(!Wr()||!t.fetchData)return;const s=e(t.fetchData.url);if(t.endTimestamp&&s){const h=t.fetchData.__span;if(!h)return;const p=r[h];p&&(HE(p,t),delete r[h]);return}const o=Ae(),u=K(),{method:a,url:c}=t.fetchData,l=BE(c),d=l?Bn(l).host:void 0,f=s?Ir({name:`${a} ${c}`,onlyIfParent:!0,attributes:{url:c,type:"fetch","http.method":a,"http.url":l,"server.address":d,[Nn]:i},op:"http.client"}):void 0;if(f&&(t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f),n(t.fetchData.url)&&u){const h=t.args[0];t.args[1]=t.args[1]||{};const p=t.args[1];p.headers=FE(h,u,o,p,f)}return f}function FE(t,e,n,r,i){const s=i||n.getSpan(),o=Ut(),{traceId:u,spanId:a,sampled:c,dsc:l}={...o.getPropagationContext(),...n.getPropagationContext()},d=s?Qo(s):sc(u,a,c),f=xp(l||(s?xr(s):ea(u,e,n))),h=r.headers||(typeof Request<"u"&&Zt(t,Request)?t.headers:void 0);if(h)if(typeof Headers<"u"&&Zt(h,Headers)){const p=new Headers(h);return p.append("sentry-trace",d),f&&p.append(du,f),p}else if(Array.isArray(h)){const p=[...h,["sentry-trace",d]];return f&&p.push([du,f]),p}else{const p="baggage"in h?h.baggage:void 0,m=[];return Array.isArray(p)?m.push(...p):p&&m.push(p),f&&m.push(f),{...h,"sentry-trace":d,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":d,baggage:f}}function BE(t){try{return new URL(t).href}catch{return}}function HE(t,e){if(e.response){na(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus("internal_error");t.end()}const Su=["localhost",/^\/(?!\/)/],xi={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Su,tracePropagationTargets:Su};function Tc(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:xi.traceFetch,traceXHR:xi.traceXHR,...t},u=typeof s=="function"?s:l=>!0,a=l=>zE(l,r||i),c={};e&&Xo(l=>{const d=UE(l,u,a,c);if(d){const f=jg(l.fetchData.url),h=f?Bn(f).host:void 0;d.setAttributes({"http.url":f,"server.address":h})}o&&d&&cd(d)}),n&&Jo(l=>{const d=WE(l,u,a,c);o&&d&&cd(d)})}function jE(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function cd(t){const{url:e}=pe(t).data||{};if(!e||typeof e!="string")return;const n=bn("resource",({entries:r})=>{r.forEach(i=>{jE(i)&&i.name.endsWith(e)&&(GE(i).forEach(o=>t.setAttribute(...o)),setTimeout(n))})})}function qE(t){let e="unknown",n="unknown",r="";for(const 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 It(t=0){return((Xe||performance.timeOrigin)+t)/1e3}function GE(t){const{name:e,version:n}=qE(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),Xe?[...r,["http.request.redirect_start",It(t.redirectStart)],["http.request.fetch_start",It(t.fetchStart)],["http.request.domain_lookup_start",It(t.domainLookupStart)],["http.request.domain_lookup_end",It(t.domainLookupEnd)],["http.request.connect_start",It(t.connectStart)],["http.request.secure_connection_start",It(t.secureConnectionStart)],["http.request.connection_end",It(t.connectEnd)],["http.request.request_start",It(t.requestStart)],["http.request.response_start",It(t.responseStart)],["http.request.response_end",It(t.responseEnd)]]:r}function zE(t,e){return jr(t,e||Su)}function WE(t,e,n,r){const i=t.xhr,s=i&&i[Xt];if(!Wr()||!i||i.__sentry_own_request__||!s)return;const o=e(s.url);if(t.endTimestamp&&o){const h=i.__sentry_xhr_span_id__;if(!h)return;const p=r[h];p&&s.status_code!==void 0&&(na(p,s.status_code),p.end(),delete r[h]);return}const u=Ae(),a=Ut(),c=jg(s.url),l=c?Bn(c).host:void 0,d=o?Ir({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":c,url:s.url,"server.address":l,[Nn]:"auto.http.browser"},op:"http.client"}):void 0;d&&(i.__sentry_xhr_span_id__=d.spanContext().spanId,r[i.__sentry_xhr_span_id__]=d);const f=K();if(i.setRequestHeader&&n(s.url)&&f){const{traceId:h,spanId:p,sampled:m,dsc:_}={...a.getPropagationContext(),...u.getPropagationContext()},g=d?Qo(d):sc(h,p,m),v=xp(_||(d?xr(d):ea(h,f,u)));VE(i,g,v)}return d}function VE(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(du,n)}catch{}}function jg(t){try{return new URL(t,z.location.origin).href}catch{return}}function KE(t,e=!0,n=!0){if(!z||!z.location){ue&&A.warn("Could not initialize routing instrumentation due to invalid location");return}let r=z.location.href,i;e&&(i=t({name:z.location.pathname,startTimestamp:Xe?Xe/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&Ui(({to:s,from:o})=>{if(o===void 0&&r&&r.indexOf(s)!==-1){r=void 0;return}o!==s&&(r=void 0,i&&(ue&&A.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.end()),i=t({name:z.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const YE="BrowserTracing",XE={...vi,markBackgroundTransactions:!0,routingInstrumentation:KE,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...xi},ld=10;let JE=class{constructor(e){this.name=YE,this._hasSetTracePropagationTargets=!1,gc(),ue&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...XE,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=$g(),this._interactionIdToRouteNameMapping={},this.options.enableInp&&Bg(this._interactionIdToRouteNameMapping,this.options.interactionsSampleRate),this.options.enableLongTask&&Ug(),this.options._experiments.enableInteractions&&Fg(),this._latestRoute={name:void 0,context:void 0}}setupOnce(e,n){this._getCurrentHub=n;const i=n().getClient(),s=i&&i.getOptions(),{routingInstrumentation:o,startTransactionOnLocationChange:u,startTransactionOnPageLoad:a,markBackgroundTransactions:c,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:h,_experiments:p}=this.options,m=s&&s.tracePropagationTargets,_=m||this.options.tracePropagationTargets;ue&&this._hasSetTracePropagationTargets&&m&&A.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),o(g=>{const v=this._createRouteTransaction(g);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(v,g,n),v},a,u),c&&Cg(),p.enableInteractions&&this._registerInteractionListener(),this.options.enableInp&&this._registerInpInteractionListener(),Tc({traceFetch:l,traceXHR:d,tracePropagationTargets:_,shouldCreateSpanForRequest:f,enableHTTPTimings:h})}_createRouteTransaction(e){if(!this._getCurrentHub){ue&&A.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const n=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=this.options,u=e.op==="pageload";let a;if(u){const h=u?dd("sentry-trace"):"",p=u?dd("baggage"):void 0,{traceId:m,dsc:_,parentSpanId:g,sampled:v}=Op(h,p);a={traceId:m,parentSpanId:g,parentSampled:v,...e,metadata:{...e.metadata,dynamicSamplingContext:_},trimEnd:!0}}else a={trimEnd:!0,...e};const c=typeof r=="function"?r(a):a,l=c===void 0?{...a,sampled:!1}:c;l.metadata=l.name!==a.name?{...l.metadata,source:"custom"}:l.metadata,this._latestRoute.name=l.name,this._latestRoute.context=l,l.sampled===!1&&ue&&A.log(`[Tracing] Will not send ${l.op} transaction because of beforeNavigate.`),ue&&A.log(`[Tracing] Starting ${l.op} transaction on scope`);const{location:d}=z,f=bo(n,l,i,s,!0,{location:d},o,u);return u&&z.document&&(z.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(z.document.readyState)&&f.sendAutoFinishSignal()}),["interactive","complete"].includes(z.document.readyState)&&f.sendAutoFinishSignal()),f.registerBeforeFinishCallback(h=>{this._collectWebVitals(),Hg(h)}),f}_registerInteractionListener(){let e;const n=()=>{const{idleTimeout:r,finalTimeout:i,heartbeatInterval:s}=this.options,o="ui.action.click",u=$t();if(u&&u.op&&["navigation","pageload"].includes(u.op)){ue&&A.warn(`[Tracing] Did not create ${o} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.end(),e=void 0),!this._getCurrentHub){ue&&A.warn(`[Tracing] Did not create ${o} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRoute.name){ue&&A.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}const a=this._getCurrentHub(),{location:c}=z,l={name:this._latestRoute.name,op:o,trimEnd:!0,data:{[ot]:this._latestRoute.context?QE(this._latestRoute.context):"url"}};e=bo(a,l,r,i,!0,{location:c},s)};["click"].forEach(r=>{z.document&&addEventListener(r,n,{once:!1,capture:!0})})}_registerInpInteractionListener(){const e=({entries:n})=>{const r=K(),i=r!==void 0&&r.getIntegrationByName!==void 0?r.getIntegrationByName("Replay"):void 0,s=i!==void 0?i.getReplayId():void 0,o=$t(),u=Ae(),a=u!==void 0?u.getUser():void 0;n.forEach(c=>{if(ZE(c)){const l=c.interactionId;if(l===void 0)return;const d=this._interactionIdToRouteNameMapping[l],f=c.duration,h=c.startTime,p=Object.keys(this._interactionIdToRouteNameMapping),m=p.length>0?p.reduce((_,g)=>this._interactionIdToRouteNameMapping[_].duration<this._interactionIdToRouteNameMapping[g].duration?_:g):void 0;if(c.entryType==="first-input"&&p.map(g=>this._interactionIdToRouteNameMapping[g]).some(g=>g.duration===f&&g.startTime===h)||!l)return;if(d)d.duration=Math.max(d.duration,f);else if(p.length<ld||m===void 0||f>this._interactionIdToRouteNameMapping[m].duration){const _=this._latestRoute.name,g=this._latestRoute.context;_&&g&&(m&&Object.keys(this._interactionIdToRouteNameMapping).length>=ld&&delete this._interactionIdToRouteNameMapping[m],this._interactionIdToRouteNameMapping[l]={routeName:_,duration:f,parentContext:g,user:a,activeTransaction:o,replayId:s,startTime:h})}}})};bn("event",e),bn("first-input",e)}};function dd(t){const e=ap(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function QE(t){const e=t.attributes&&t.attributes[ot],n=t.data&&t.data[ot],r=t.metadata&&t.metadata.source;return e||n||r}function ZE(t){return"duration"in t}const eT="BrowserTracing",tT={...vi,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...xi},nT=(t={})=>{const e=ue?!!(t.tracePropagationTargets||t.tracingOrigins):!1;gc(),!t.tracePropagationTargets&&t.tracingOrigins&&(t.tracePropagationTargets=t.tracingOrigins);const n={...tT,...t},r=$g(),i={};n.enableInp&&Bg(i,n.interactionsSampleRate),n.enableLongTask&&Ug(),n._experiments.enableInteractions&&Fg();const s={name:void 0,context:void 0};function o(u){const a=ge(),{beforeStartSpan:c,idleTimeout:l,finalTimeout:d,heartbeatInterval:f}=n,h=u.op==="pageload";let p;if(h){const v=h?fd("sentry-trace"):"",y=h?fd("baggage"):void 0,{traceId:w,dsc:R,parentSpanId:E,sampled:O}=Op(v,y);p={traceId:w,parentSpanId:E,parentSampled:O,...u,metadata:{...u.metadata,dynamicSamplingContext:R},trimEnd:!0}}else p={trimEnd:!0,...u};const m=c?c(p):p;m.metadata=m.name!==p.name?{...m.metadata,source:"custom"}:m.metadata,s.name=m.name,s.context=m,m.sampled===!1&&ue&&A.log(`[Tracing] Will not send ${m.op} transaction because of beforeNavigate.`),ue&&A.log(`[Tracing] Starting ${m.op} transaction on scope`);const{location:_}=z,g=bo(a,m,l,d,!0,{location:_},f,h);return h&&z.document&&(z.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(z.document.readyState)&&g.sendAutoFinishSignal()}),["interactive","complete"].includes(z.document.readyState)&&g.sendAutoFinishSignal()),g.registerBeforeFinishCallback(v=>{r(),Hg(v)}),g}return{name:eT,setupOnce:()=>{},afterAllSetup(u){const a=u.getOptions(),{markBackgroundSpan:c,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:h,_experiments:p}=n,m=a&&a.tracePropagationTargets,_=m||n.tracePropagationTargets;ue&&e&&m&&A.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.");let g,v=z.location&&z.location.href;if(u.on&&(u.on("startNavigationSpan",y=>{g&&(ue&&A.log(`[Tracing] Finishing current transaction with op: ${pe(g).op}`),g.end()),g=o({op:"navigation",...y})}),u.on("startPageLoadSpan",y=>{g&&(ue&&A.log(`[Tracing] Finishing current transaction with op: ${pe(g).op}`),g.end()),g=o({op:"pageload",...y})})),n.instrumentPageLoad&&u.emit&&z.location){const y={name:z.location.pathname,startTimestamp:Xe?Xe/1e3:void 0,origin:"auto.pageload.browser",attributes:{[ot]:"url"}};qg(u,y)}n.instrumentNavigation&&u.emit&&z.location&&Ui(({to:y,from:w})=>{if(w===void 0&&v&&v.indexOf(y)!==-1){v=void 0;return}if(w!==y){v=void 0;const R={name:z.location.pathname,origin:"auto.navigation.browser",attributes:{[ot]:"url"}};Gg(u,R)}}),c&&Cg(),p.enableInteractions&&rT(n,s),n.enableInp&&sT(i,s),Tc({traceFetch:l,traceXHR:d,tracePropagationTargets:_,shouldCreateSpanForRequest:f,enableHTTPTimings:h})},options:n}};function qg(t,e){if(!t.emit)return;t.emit("startPageLoadSpan",e);const n=qi();return(n&&pe(n).op)==="pageload"?n:void 0}function Gg(t,e){if(!t.emit)return;t.emit("startNavigationSpan",e);const n=qi();return(n&&pe(n).op)==="navigation"?n:void 0}function fd(t){const e=ap(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function rT(t,e){let n;const r=()=>{const{idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=t,u="ui.action.click",a=$t();if(a&&a.op&&["navigation","pageload"].includes(a.op)){ue&&A.warn(`[Tracing] Did not create ${u} transaction because a pageload or navigation transaction is in progress.`);return}if(n&&(n.setFinishReason("interactionInterrupted"),n.end(),n=void 0),!e.name){ue&&A.warn(`[Tracing] Did not create ${u} transaction because _latestRouteName is missing.`);return}const{location:c}=z,l={name:e.name,op:u,trimEnd:!0,data:{[ot]:e.context?oT(e.context):"url"}};n=bo(ge(),l,i,s,!0,{location:c},o)};["click"].forEach(i=>{z.document&&addEventListener(i,r,{once:!1,capture:!0})})}function iT(t){return"duration"in t}const hd=10;function sT(t,e){const n=({entries:r})=>{const i=K(),s=i!==void 0&&i.getIntegrationByName!==void 0?i.getIntegrationByName("Replay"):void 0,o=s!==void 0?s.getReplayId():void 0,u=$t(),a=Ae(),c=a!==void 0?a.getUser():void 0;r.forEach(l=>{if(iT(l)){const d=l.interactionId;if(d===void 0)return;const f=t[d],h=l.duration,p=l.startTime,m=Object.keys(t),_=m.length>0?m.reduce((g,v)=>t[g].duration<t[v].duration?g:v):void 0;if(l.entryType==="first-input"&&m.map(v=>t[v]).some(v=>v.duration===h&&v.startTime===p)||!d)return;if(f)f.duration=Math.max(f.duration,h);else if(m.length<hd||_===void 0||h>t[_].duration){const g=e.name,v=e.context;g&&v&&(_&&Object.keys(t).length>=hd&&delete t[_],t[d]={routeName:g,duration:h,parentContext:v,user:c,activeTransaction:u,replayId:o,startTime:p})}}})};bn("event",n),bn("first-input",n)}function oT(t){const e=t.attributes&&t.attributes[ot],n=t.data&&t.data[ot],r=t.metadata&&t.metadata.source;return e||n||r}const V=Z;let bu=0;function zg(){return bu>0}function aT(){bu++,setTimeout(()=>{bu--})}function Gn(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(nc(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{const s=i.map(o=>Gn(o,e));return t.apply(this,s)}catch(s){throw aT(),Tn(o=>{o.addEventProcessor(u=>(e.mechanism&&(iu(u,void 0),jn(u,e.mechanism)),u.extra={...u.extra,arguments:i},u)),Hi(s)}),s}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}fp(r,t),Sn(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const le=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Ic(t,e){const n=wc(t,e),r={type:e&&e.name,value:dT(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function uT(t,e,n,r){const i=K(),s=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:Yo(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:fT(e,{isUnhandledRejection:r})}]},extra:{__serialized__:Ip(e,s)}};if(n){const u=wc(t,n);u.length&&(o.exception.values[0].stacktrace={frames:u})}return o}function La(t,e){return{exception:{values:[Ic(t,e)]}}}function wc(t,e){const n=e.stacktrace||e.stack||"",r=lT(e);try{return t(n,r)}catch{}return[]}const cT=/Minified React error #\d+;/i;function lT(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(cT.test(t.message))return 1}return 0}function dT(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Wg(t,e,n,r){const i=n&&n.syntheticException||void 0,s=Cc(t,e,i,r);return jn(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),Rr(s)}function Vg(t,e,n="info",r,i){const s=r&&r.syntheticException||void 0,o=Eu(t,e,s,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Rr(o)}function Cc(t,e,n,r,i){let s;if(Qu(e)&&e.error)return La(t,e.error);if(Rl(e)||py(e)){const o=e;if("stack"in e)s=La(t,e);else{const u=o.name||(Rl(o)?"DOMError":"DOMException"),a=o.message?`${u}: ${o.message}`:u;s=Eu(t,a,n,r),iu(s,a)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return br(e)?La(t,e):Hn(e)||Yo(e)?(s=uT(t,e,n,i),jn(s,{synthetic:!0}),s):(s=Eu(t,e,n,r),iu(s,`${e}`),jn(s,{synthetic:!0}),s)}function Eu(t,e,n,r){const i={};if(r&&n){const s=wc(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(Zu(e)){const{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function fT(t,{isUnhandledRejection:e}){const n=ky(t),r=e?"promise rejection":"exception";return Qu(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Yo(t)?`Event \`${hT(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function hT(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Kg(t,{metadata:e,tunnel:n,dsn:r}){const i={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:Vn(r)}},s=pT(t);return rn(i,[s])}function pT(t){return[{type:"user_report"},t]}class Yg extends J0{constructor(e){const n=V.SENTRY_SDK_SOURCE||Xy();gg(e,"browser",["browser"],n),super(e),e.sendClientReports&&V.document&&V.document.addEventListener("visibilitychange",()=>{V.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return Wg(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Vg(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){le&&A.warn("SDK not enabled, will not capture user feedback.");return}const n=Kg(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)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){le&&A.log("No outcomes to send");return}if(!this._dsn){le&&A.log("No dsn provided, will not send outcomes");return}le&&A.log("Sending outcomes:",e);const n=IS(e,this._options.tunnel&&Vn(this._dsn));this._sendEnvelope(n)}}let pi;function gT(){if(pi)return pi;if(au(V.fetch))return pi=V.fetch.bind(V);const t=V.document;let e=V.fetch;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){le&&A.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return pi=e.bind(V)}function mT(){pi=void 0}function Xg(t,e=gT()){let n=0,r=0;function i(s){const o=s.body.length;n+=o,r++;const u={body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,u).then(a=>(n-=o,r--,{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}))}catch(a){return mT(),n-=o,r--,rc(a)}}return _c(t,i)}const _T=4;function Jg(t){function e(n){return new Gr((r,i)=>{const s=new XMLHttpRequest;s.onerror=i,s.onreadystatechange=()=>{s.readyState===_T&&r({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",t.url);for(const o in t.headers)Object.prototype.hasOwnProperty.call(t.headers,o)&&s.setRequestHeader(o,t.headers[o]);s.send(n.body)})}return _c(t,e)}const Yr="?",vT=10,yT=20,ST=30,bT=40,ET=50;function Ki(t,e,n,r){const i={filename:t,function:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const TT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,IT=/\((\S*)(?::(\d+))(?::(\d+))\)/,wT=t=>{const e=TT.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const s=IT.exec(e[2]);s&&(e[2]=s[1],e[3]=s[2],e[4]=s[3])}const[r,i]=rm(e[1]||Yr,e[2]);return Ki(i,r,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},Qg=[ST,wT],CT=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,RT=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kT=t=>{const e=CT.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=RT.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let r=e[3],i=e[1]||Yr;return[i,r]=rm(i,r),Ki(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Zg=[ET,kT],xT=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,OT=t=>{const e=xT.exec(t);return e?Ki(e[2],e[1]||Yr,+e[3],e[4]?+e[4]:void 0):void 0},em=[bT,OT],AT=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,DT=t=>{const e=AT.exec(t);return e?Ki(e[2],e[3]||Yr,+e[1]):void 0},MT=[vT,DT],LT=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,NT=t=>{const e=LT.exec(t);return e?Ki(e[5],e[3]||e[4]||Yr,+e[1],+e[2]):void 0},PT=[yT,NT],tm=[Qg,Zg,em],nm=gp(...tm),rm=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Yr,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Ss=1024,im="Breadcrumbs",$T=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:im,setupOnce(){},setup(n){e.console&&mp(BT(n)),e.dom&&yp(FT(n,e.dom)),e.xhr&&Jo(HT(n)),e.fetch&&Xo(jT(n)),e.history&&Ui(qT(n)),e.sentry&&n.on&&n.on("beforeSendEvent",UT(n))}}},Rc=$T,sm=xe(im,Rc);function UT(t){return function(n){K()===t&&nn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:hn(n)},{event:n})}}function FT(t,e){return function(r){if(K()!==t)return;let i,s,o=typeof e=="object"?e.serializeAttribute:void 0,u=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;u&&u>Ss&&(le&&A.warn(`\`dom.maxStringLength\` cannot exceed ${Ss}, but a value of ${u} was configured. Sentry will use ${Ss} instead.`),u=Ss),typeof o=="string"&&(o=[o]);try{const c=r.event,l=GT(c)?c.target:c;i=vn(l,{keyAttrs:o,maxStringLength:u}),s=up(l)}catch{i="<unknown>"}if(i.length===0)return;const a={category:`ui.${r.name}`,message:i};s&&(a.data={"ui.component_name":s}),nn(a,{event:r.event,name:r.name,global:r.global})}}function BT(t){return function(n){if(K()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:wp(n.level),message:fo(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${fo(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;nn(r,{input:n.args,level:n.level})}}function HT(t){return function(n){if(K()!==t)return;const{startTimestamp:r,endTimestamp:i}=n,s=n.xhr[Xt];if(!r||!i||!s)return;const{method:o,url:u,status_code:a,body:c}=s,l={method:o,url:u,status_code:a},d={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:i};nn({category:"xhr",data:l,type:"http"},d)}}function jT(t){return function(n){if(K()!==t)return;const{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i};nn({category:"fetch",data:s,level:"error",type:"http"},o)}else{const s=n.response,o={...n.fetchData,status_code:s&&s.status},u={input:n.args,response:s,startTimestamp:r,endTimestamp:i};nn({category:"fetch",data:o,type:"http"},u)}}}function qT(t){return function(n){if(K()!==t)return;let r=n.from,i=n.to;const s=Bn(V.location.href);let o=r?Bn(r):void 0;const u=Bn(i);(!o||!o.path)&&(o=s),s.protocol===u.protocol&&s.host===u.host&&(i=u.relative),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),nn({category:"navigation",data:{from:r,to:i}})}}function GT(t){return!!t&&!!t.target}const om="Dedupe",zT=()=>{let t;return{name:om,setupOnce(){},processEvent(e){if(e.type)return e;try{if(WT(e,t))return le&&A.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},am=zT,um=xe(om,am);function WT(t,e){return e?!!(VT(t,e)||KT(t,e)):!1}function VT(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!lm(t,e)||!cm(t,e))}function KT(t,e){const n=pd(e),r=pd(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!lm(t,e)||!cm(t,e))}function cm(t,e){let n=gd(t),r=gd(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++){const s=r[i],o=n[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function lm(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 pd(t){return t.exception&&t.exception.values&&t.exception.values[0]}function gd(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const dm="GlobalHandlers",YT=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:dm,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(XT(n),md("onerror")),e.onunhandledrejection&&(JT(n),md("onunhandledrejection"))}}},kc=YT,fm=xe(dm,kc);function XT(t){Ep(e=>{const{stackParser:n,attachStacktrace:r}=pm();if(K()!==t||zg())return;const{msg:i,url:s,line:o,column:u,error:a}=e,c=a===void 0&&Pt(i)?eI(i,s,o,u):hm(Cc(n,a||i,void 0,r,!1),s,o,u);c.level="error",ji(c,{originalException:a,mechanism:{handled:!1,type:"onerror"}})})}function JT(t){Tp(e=>{const{stackParser:n,attachStacktrace:r}=pm();if(K()!==t||zg())return;const i=QT(e),s=ec(i)?ZT(i):Cc(n,i,void 0,r,!0);s.level="error",ji(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function QT(t){if(ec(t))return t;const e=t;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return t}function ZT(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function eI(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s=Qu(t)?t.message:t,o="Error";const u=s.match(i);return u&&(o=u[1],s=u[2]),hm({exception:{values:[{type:o,value:s}]}},e,n,r)}function hm(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},u=o.stacktrace=o.stacktrace||{},a=u.frames=u.frames||[],c=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,d=Pt(e)&&e.length>0?e:op();return a.length===0&&a.push({colno:c,filename:d,function:"?",in_app:!0,lineno:l}),t}function md(t){le&&A.log(`Global Handler attached: ${t}`)}function pm(){const t=K();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const gm="HttpContext",tI=()=>({name:gm,setupOnce(){},preprocessEvent(t){if(!V.navigator&&!V.location&&!V.document)return;const e=t.request&&t.request.url||V.location&&V.location.href,{referrer:n}=V.document||{},{userAgent:r}=V.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),xc=tI,mm=xe(gm,xc),nI="cause",rI=5,_m="LinkedErrors",iI=(t={})=>{const e=t.limit||rI,n=t.key||nI;return{name:_m,setupOnce(){},preprocessEvent(r,i,s){const o=s.getOptions();ip(Ic,o.stackParser,o.maxValueLength,n,e,r,i)}}},Oc=iI,vm=xe(_m,Oc),sI=["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"],ym="TryCatch",oI=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:ym,setupOnce(){e.setTimeout&&Ge(V,"setTimeout",_d),e.setInterval&&Ge(V,"setInterval",_d),e.requestAnimationFrame&&Ge(V,"requestAnimationFrame",aI),e.XMLHttpRequest&&"XMLHttpRequest"in V&&Ge(XMLHttpRequest.prototype,"send",uI);const n=e.eventTarget;n&&(Array.isArray(n)?n:sI).forEach(cI)}}},Ac=oI,Sm=xe(ym,Ac);function _d(t){return function(...e){const n=e[0];return e[0]=Gn(n,{mechanism:{data:{function:en(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function aI(t){return function(e){return t.apply(this,[Gn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:en(t)},handled:!1,type:"instrument"}})])}}function uI(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&Ge(n,i,function(s){const o={mechanism:{data:{function:i,handler:en(s)},handled:!1,type:"instrument"}},u=nc(s);return u&&(o.mechanism.data.handler=en(u)),Gn(s,o)})}),t.apply(this,e)}}function cI(t){const e=V,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Ge(n,"addEventListener",function(r){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Gn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:en(s),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,Gn(s,{mechanism:{data:{function:"addEventListener",handler:en(s),target:t},handled:!1,type:"instrument"}}),o])}}),Ge(n,"removeEventListener",function(r){return function(i,s,o){const u=s;try{const a=u&&u.__sentry_wrapped__;a&&r.call(this,i,a,o)}catch{}return r.call(this,i,u,o)}}))}const bm=[vc(),yc(),Ac(),Rc(),kc(),Oc(),am(),xc()];function Em(t){return[...bm]}function Tm(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=Em()),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),V.SENTRY_RELEASE&&V.SENTRY_RELEASE.id&&(t.release=V.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);const e={...t,stackParser:Oy(t.stackParser||nm),integrations:N0(t),transport:t.transport||(Sp()?Xg:Jg)};ob(Yg,e),t.autoSessionTracking&&pI()}const lI=(t={},e=ge())=>{if(!V.document){le&&A.error("Global document not defined in showReportDialog call");return}const{client:n,scope:r}=e.getStackTop(),i=t.dsn||n&&n.getDsn();if(!i){le&&A.error("DSN not configured for showReportDialog call");return}r&&(t.user={...r.getUser(),...t.user}),t.eventId||(t.eventId=e.lastEventId());const s=V.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=M0(i,t),t.onLoad&&(s.onload=t.onLoad);const{onClose:o}=t;if(o){const a=c=>{if(c.data==="__sentry_reportdialog_closed__")try{o()}finally{V.removeEventListener("message",a)}};V.addEventListener("message",a)}const u=V.document.head||V.document.body;u?u.appendChild(s):le&&A.error("Not injecting report dialog. No injection point found in HTML")};function dI(){}function fI(t){t()}function hI(t){return Gn(t)()}function pI(){if(typeof V.document>"u"){le&&A.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}pu({ignoreDuration:!0}),gu(),Ui(({from:t,to:e})=>{t!==void 0&&t!==e&&(pu({ignoreDuration:!0}),gu())})}function gI(t){const e=K();e&&e.captureUserFeedback(t)}const mI=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumbs:sm,Dedupe:um,GlobalHandlers:fm,HttpContext:mm,LinkedErrors:vm,TryCatch:Sm},Symbol.toStringTag,{value:"Module"})),be=Z,Dc="sentryReplaySession",_I="replay_event",Mc="Unable to send Replay",vI=3e5,yI=9e5,SI=5e3,bI=5500,EI=6e4,TI=5e3,II=3,vd=15e4,bs=5e3,wI=3e3,CI=300,Lc=2e7,RI=4999,kI=15e3,yd=36e5;function xI(t,e){return t??e()}function wo(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}var Pe;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Pe||(Pe={}));function OI(t){return t.nodeType===t.ELEMENT_NODE}function bi(t){const e=wo([t,"optionalAccess",n=>n.host]);return wo([e,"optionalAccess",n=>n.shadowRoot])===t}function Ei(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function AI(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function DI(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function Co(t){try{const e=t.rules||t.cssRules;return e?AI(Array.from(e,Im).join("")):null}catch{return null}}function Im(t){let e;if(LI(t))try{e=Co(t.styleSheet)||DI(t)}catch{}else if(NI(t)&&t.selectorText.includes(":"))return MI(t.cssText);return e||t.cssText}function MI(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function LI(t){return"styleSheet"in t}function NI(t){return"selectorText"in t}class wm{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){if(!e)return-1;const n=wo([this,"access",r=>r.getMeta,"call",r=>r(e),"optionalAccess",r=>r.id]);return xI(n,()=>-1)}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function PI(){return new wm}function aa({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function Oi({isMasked:t,element:e,value:n,maskInputFn:r}){let i=n||"";return t?(r&&(i=r(i,e)),"*".repeat(i.length)):i}function Dr(t){return t.toLowerCase()}function Tu(t){return t.toUpperCase()}const Sd="__rrweb_original__";function $I(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let r=0;r<t.width;r+=n)for(let i=0;i<t.height;i+=n){const s=e.getImageData,o=Sd in s?s[Sd]:s;if(new Uint32Array(o.call(e,r,i,Math.min(n,t.width-r),Math.min(n,t.height-i)).data.buffer).some(a=>a!==0))return!1}return!0}function Nc(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Dr(e):null}function Ro(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}let UI=1;const FI=new RegExp("[^a-z0-9-_:]"),Ai=-2;function Pc(){return UI++}function BI(t){if(t instanceof HTMLFormElement)return"form";const e=Dr(t.tagName);return FI.test(e)?"div":e}function HI(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let nr,bd;const jI=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qI=/^(?:[a-z+]+:)?\/\//i,GI=/^www\..*/i,zI=/^(data:)([^,]*),(.*)/i;function ko(t,e){return(t||"").replace(jI,(n,r,i,s,o,u)=>{const a=i||o||u,c=r||s||"";if(!a)return n;if(qI.test(a)||GI.test(a))return`url(${c}${a}${c})`;if(zI.test(a))return`url(${c}${a}${c})`;if(a[0]==="/")return`url(${c}${HI(e)+a}${c})`;const l=e.split("/"),d=a.split("/");l.pop();for(const f of d)f!=="."&&(f===".."?l.pop():l.push(f));return`url(${c}${l.join("/")}${c})`})}const WI=/^[^ \t\n\r\u000c]+/,VI=/^[, \t\n\r\u000c]+/;function KI(t,e){if(e.trim()==="")return e;let n=0;function r(s){let o;const u=s.exec(e.substring(n));return u?(o=u[0],n+=o.length,o):""}const i=[];for(;r(VI),!(n>=e.length);){let s=r(WI);if(s.slice(-1)===",")s=pr(t,s.substring(0,s.length-1)),i.push(s);else{let o="";s=pr(t,s);let u=!1;for(;;){const a=e.charAt(n);if(a===""){i.push((s+o).trim());break}else if(u)a===")"&&(u=!1);else if(a===","){n+=1,i.push((s+o).trim());break}else a==="("&&(u=!0);o+=a,n+=1}}}return i.join(", ")}function pr(t,e){if(!e||e.trim()==="")return e;const n=t.createElement("a");return n.href=e,n.href}function YI(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function $c(){const t=document.createElement("a");return t.href="",t.href}function Cm(t,e,n,r,i,s){return r&&(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?pr(t,r):n==="srcset"?KI(t,r):n==="style"?ko(r,$c()):e==="object"&&n==="data"?pr(t,r):typeof s=="function"?s(n,r,i):r)}function Rm(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function XI(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}if(n)return t.matches(n)}catch{}return!1}function JI(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function Pn(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:Pn(t.parentNode,e,n,r+1)}function gr(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(JI(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Mr(t,e,n,r,i,s){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const c=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let u=-1,a=-1;if(s){if(a=Pn(o,gr(r,i)),a<0)return!0;u=Pn(o,gr(e,n),a>=0?a:1/0)}else{if(u=Pn(o,gr(e,n)),u<0)return!1;a=Pn(o,gr(r,i),u>=0?u:1/0)}return u>=0?a>=0?u<=a:!0:a>=0?!1:!!s}catch{}return!!s}function QI(t,e,n){const r=t.contentWindow;if(!r)return;let i=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const u=setTimeout(()=>{i||(e(),i=!0)},n);t.addEventListener("load",()=>{clearTimeout(u),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||t.src===o||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function ZI(t,e,n){let r=!1,i;try{i=t.sheet}catch{return}if(i)return;const s=setTimeout(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{clearTimeout(s),r=!0,e()})}function ew(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskAttributeFn:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:p={},maskTextFn:m,maskInputFn:_,dataURLOptions:g={},inlineImages:v,recordCanvas:y,keepIframeSrcFn:w,newlyAddedElement:R=!1}=e,E=tw(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Pe.Document,childNodes:[],compatMode:t.compatMode}:{type:Pe.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Pe.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:E};case t.ELEMENT_NODE:return rw(t,{doc:n,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:h,maskAttributeFn:a,maskInputOptions:p,maskInputFn:_,dataURLOptions:g,inlineImages:v,recordCanvas:y,keepIframeSrcFn:w,newlyAddedElement:R,rootId:E,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f});case t.TEXT_NODE:return nw(t,{maskAllText:u,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:p,maskInputFn:_,rootId:E});case t.CDATA_SECTION_NODE:return{type:Pe.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:Pe.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function tw(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function nw(t,e){const{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:s,unmaskTextSelector:o,maskTextFn:u,maskInputOptions:a,maskInputFn:c,rootId:l}=e,d=t.parentNode&&t.parentNode.tagName;let f=t.textContent;const h=d==="STYLE"?!0:void 0,p=d==="SCRIPT"?!0:void 0,m=d==="TEXTAREA"?!0:void 0;if(h&&f){try{t.nextSibling||t.previousSibling||wo([t,"access",g=>g.parentNode,"access",g=>g.sheet,"optionalAccess",g=>g.cssRules])&&(f=Co(t.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,t)}f=ko(f,$c())}p&&(f="SCRIPT_PLACEHOLDER");const _=Mr(t,r,s,i,o,n);if(!h&&!p&&!m&&f&&_&&(f=u?u(f,t.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(a.textarea||_)&&(f=c?c(f,t.parentNode):f.replace(/[\S]/g,"*")),d==="OPTION"&&f){const g=aa({type:null,tagName:d,maskInputOptions:a});f=Oi({isMasked:Mr(t,r,s,i,o,g),element:t,value:f,maskInputFn:c})}return{type:Pe.Text,textContent:f||"",isStyle:h,rootId:l}}function rw(t,e){const{doc:n,blockClass:r,blockSelector:i,unblockSelector:s,inlineStylesheet:o,maskInputOptions:u={},maskAttributeFn:a,maskInputFn:c,dataURLOptions:l={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:m,maskTextClass:_,unmaskTextClass:g,maskTextSelector:v,unmaskTextSelector:y}=e,w=XI(t,r,i,s),R=BI(t);let E={};const O=t.attributes.length;for(let S=0;S<O;S++){const b=t.attributes[S];b.name&&!Rm(R,b.name,b.value)&&(E[b.name]=Cm(n,R,Dr(b.name),b.value,t,a))}if(R==="link"&&o){const S=Array.from(n.styleSheets).find(C=>C.href===t.href);let b=null;S&&(b=Co(S)),b&&(delete E.rel,delete E.href,E._cssText=ko(b,S.href))}if(R==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const S=Co(t.sheet);S&&(E._cssText=ko(S,$c()))}if(R==="input"||R==="textarea"||R==="select"||R==="option"){const S=t,b=Nc(S),C=Ro(S,Tu(R),b),k=S.checked;if(b!=="submit"&&b!=="button"&&C){const I=Mr(S,_,v,g,y,aa({type:b,tagName:Tu(R),maskInputOptions:u}));E.value=Oi({isMasked:I,element:S,value:C,maskInputFn:c})}k&&(E.checked=k)}if(R==="option"&&(t.selected&&!u.select?E.selected=!0:delete E.selected),R==="canvas"&&f){if(t.__context==="2d")$I(t)||(E.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){const S=t.toDataURL(l.type,l.quality),b=document.createElement("canvas");b.width=t.width,b.height=t.height;const C=b.toDataURL(l.type,l.quality);S!==C&&(E.rr_dataURL=S)}}if(R==="img"&&d){nr||(nr=n.createElement("canvas"),bd=nr.getContext("2d"));const S=t,b=S.crossOrigin;S.crossOrigin="anonymous";const C=()=>{S.removeEventListener("load",C);try{nr.width=S.naturalWidth,nr.height=S.naturalHeight,bd.drawImage(S,0,0),E.rr_dataURL=nr.toDataURL(l.type,l.quality)}catch(k){console.warn(`Cannot inline img src=${S.currentSrc}! Error: ${k}`)}b?E.crossOrigin=b:S.removeAttribute("crossorigin")};S.complete&&S.naturalWidth!==0?C():S.addEventListener("load",C)}if((R==="audio"||R==="video")&&(E.rr_mediaState=t.paused?"paused":"played",E.rr_mediaCurrentTime=t.currentTime),p||(t.scrollLeft&&(E.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(E.rr_scrollTop=t.scrollTop)),w){const{width:S,height:b}=t.getBoundingClientRect();E={class:E.class,rr_width:`${S}px`,rr_height:`${b}px`}}R==="iframe"&&!h(E.src)&&(t.contentDocument||(E.rr_src=E.src),delete E.src);let T;try{customElements.get(R)&&(T=!0)}catch{}return{type:Pe.Element,tagName:R,attributes:E,childNodes:[],isSVG:YI(t)||void 0,needBlock:w,rootId:m,isCustom:T}}function Se(t){return t==null?"":t.toLowerCase()}function iw(t,e){if(e.comment&&t.type===Pe.Comment)return!0;if(t.type===Pe.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(Se(t.attributes.name).match(/^msapplication-tile(image|color)$/)||Se(t.attributes.name)==="application-name"||Se(t.attributes.rel)==="icon"||Se(t.attributes.rel)==="apple-touch-icon"||Se(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&Se(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Se(t.attributes.property).match(/^(og|twitter|fb):/)||Se(t.attributes.name).match(/^(og|twitter):/)||Se(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(Se(t.attributes.name)==="robots"||Se(t.attributes.name)==="googlebot"||Se(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(Se(t.attributes.name)==="author"||Se(t.attributes.name)==="generator"||Se(t.attributes.name)==="framework"||Se(t.attributes.name)==="publisher"||Se(t.attributes.name)==="progid"||Se(t.attributes.property).match(/^article:/)||Se(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(Se(t.attributes.name)==="google-site-verification"||Se(t.attributes.name)==="yandex-verification"||Se(t.attributes.name)==="csrf-token"||Se(t.attributes.name)==="p:domain_verify"||Se(t.attributes.name)==="verify-v1"||Se(t.attributes.name)==="verification"||Se(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function mr(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:h=!0,maskInputOptions:p={},maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:y={},inlineImages:w=!1,recordCanvas:R=!1,onSerialize:E,onIframeLoad:O,iframeLoadTimeout:T=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:b=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:k=!1}=e;let{preserveWhiteSpace:I=!0}=e;const D=ew(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:u,unblockSelector:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,dataURLOptions:y,inlineImages:w,recordCanvas:R,keepIframeSrcFn:C,newlyAddedElement:k});if(!D)return console.warn(t,"not serialized"),null;let N;r.hasNode(t)?N=r.getId(t):iw(D,v)||!I&&D.type===Pe.Text&&!D.isStyle&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?N=Ai:N=Pc();const M=Object.assign(D,{id:N});if(r.add(t,M),N===Ai)return null;E&&E(t);let L=!f;if(M.type===Pe.Element){L=L&&!M.needBlock,delete M.needBlock;const $=t.shadowRoot;$&&Ei($)&&(M.isShadowHost=!0)}if((M.type===Pe.Document||M.type===Pe.Element)&&L){v.headWhitespace&&M.type===Pe.Element&&M.tagName==="head"&&(I=!1);const $={doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:u,unblockSelector:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:f,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:y,inlineImages:w,recordCanvas:R,preserveWhiteSpace:I,onSerialize:E,onIframeLoad:O,iframeLoadTimeout:T,onStylesheetLoad:S,stylesheetLoadTimeout:b,keepIframeSrcFn:C};for(const U of Array.from(t.childNodes)){const x=mr(U,$);x&&M.childNodes.push(x)}if(OI(t)&&t.shadowRoot)for(const U of Array.from(t.shadowRoot.childNodes)){const x=mr(U,$);x&&(Ei(t.shadowRoot)&&(x.isShadow=!0),M.childNodes.push(x))}}return t.parentNode&&bi(t.parentNode)&&Ei(t.parentNode)&&(M.isShadow=!0),M.type===Pe.Element&&M.tagName==="iframe"&&QI(t,()=>{const $=t.contentDocument;if($&&O){const U=mr($,{doc:$,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:y,inlineImages:w,recordCanvas:R,preserveWhiteSpace:I,onSerialize:E,onIframeLoad:O,iframeLoadTimeout:T,onStylesheetLoad:S,stylesheetLoadTimeout:b,keepIframeSrcFn:C});U&&O(t,U)}},T),M.type===Pe.Element&&M.tagName==="link"&&M.attributes.rel==="stylesheet"&&ZI(t,()=>{if(S){const $=mr(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:y,inlineImages:w,recordCanvas:R,preserveWhiteSpace:I,onSerialize:E,onIframeLoad:O,iframeLoadTimeout:T,onStylesheetLoad:S,stylesheetLoadTimeout:b,keepIframeSrcFn:C});$&&S(t,$)}},b),M}function sw(t,e){const{mirror:n=new wm,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:s=null,maskAllText:o=!1,maskTextClass:u="rr-mask",unmaskTextClass:a=null,maskTextSelector:c=null,unmaskTextSelector:l=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:h=!1,maskAllInputs:p=!1,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOM:v=!1,dataURLOptions:y,preserveWhiteSpace:w,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:O,onStylesheetLoad:T,stylesheetLoadTimeout:S,keepIframeSrcFn:b=()=>!1}=e||{};return mr(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,maskAllText:o,maskTextClass:u,unmaskTextClass:a,maskTextSelector:c,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:p===!1?{}:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:y,inlineImages:f,recordCanvas:h,preserveWhiteSpace:w,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:O,onStylesheetLoad:T,stylesheetLoadTimeout:S,keepIframeSrcFn:b,newlyAddedElement:!1})}function an(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function tt(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const fr=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let Ed={map:{},getId(){return console.error(fr),-1},getNode(){return console.error(fr),null},removeNodeFromMap(){console.error(fr)},has(){return console.error(fr),!1},reset(){console.error(fr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ed=new Proxy(Ed,{get(t,e,n){return e==="map"&&console.error(fr),Reflect.get(t,e,n)}}));function Di(t,e,n={}){let r=null,i=0;return function(...s){const o=Date.now();!i&&n.leading===!1&&(i=o);const u=e-(o-i),a=this;u<=0||u>e?(r&&(fw(r),r=null),i=o,t.apply(a,s)):!r&&n.trailing!==!1&&(r=ua(()=>{i=n.leading===!1?0:Date.now(),r=null,t.apply(a,s)},u))}}function km(t,e,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(o){ua(()=>{n.set.call(this,o)},0),s&&s.set&&s.set.call(this,o)}}),()=>km(t,e,s||{},!0)}function Uc(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}let xo=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(xo=()=>new Date().getTime());function xm(t){const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:an([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||an([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||an([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:an([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||an([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||an([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function Om(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Am(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Dm(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function yt(t,e,n,r,i){if(!t)return!1;const s=Dm(t);if(!s)return!1;const o=gr(e,n);if(!i){const c=r&&s.matches(r);return o(s)&&!c}const u=Pn(s,o);let a=-1;return u<0?!1:(r&&(a=Pn(s,gr(null,r))),u>-1&&a<0?!0:u<a)}function ow(t,e){return e.getId(t)!==-1}function Na(t,e){return e.getId(t)===Ai}function Mm(t,e){if(bi(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?Mm(t.parentNode,e):!0:!0}function Iu(t){return!!t.changedTouches}function aw(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Lm(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function Nm(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function wu(t){return!!an([t,"optionalAccess",e=>e.shadowRoot])}class uw{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return xS(this.styleIDMap.get(e),()=>-1)}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Pm(t){let e=null;return an([t,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function cw(t){let e=t,n;for(;n=Pm(e);)e=n;return e}function lw(t){const e=t.ownerDocument;if(!e)return!1;const n=cw(t);return e.contains(n)}function $m(t){const e=t.ownerDocument;return e?e.contains(t)||lw(t):!1}const Td={};function Fc(t){const e=Td[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch{}return Td[t]=r.bind(window)}function dw(...t){return Fc("requestAnimationFrame")(...t)}function ua(...t){return Fc("setTimeout")(...t)}function fw(...t){return Fc("clearTimeout")(...t)}var te=(t=>(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))(te||{}),ne=(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",t[t.CustomElement=16]="CustomElement",t))(ne||{}),Ze=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ze||{}),Gt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Gt||{});function hw(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function Id(t){return"__ln"in t}class pw{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=hw([n,"optionalAccess",i=>i.next])||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&Id(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&Id(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const wd=(t,e)=>`${t}@${e}`;class gw{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new pw,i=a=>{let c=a,l=Ai;for(;l===Ai;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},s=a=>{if(!a.parentNode||!$m(a))return;const c=bi(a.parentNode)?this.mirror.getId(Pm(a)):this.mirror.getId(a.parentNode),l=i(a);if(c===-1||l===-1)return r.addNode(a);const d=mr(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Lm(f,this.mirror)&&this.iframeManager.addIframe(f),Nm(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),wu(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,h)=>{this.iframeManager.attachIframe(f,h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,h)=>{this.stylesheetManager.attachLinkElement(f,h)}});d&&(e.push({parentId:c,nextId:l,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Cd(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||s(a);for(const a of this.addedSet)!Rd(this.droppedSet,a)&&!Cd(this.removes,a,this.mirror)||Rd(this.movedSet,a)?s(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const c=this.mirror.getId(o.value.parentNode),l=i(o.value);c!==-1&&l!==-1&&(a=o)}if(!a){let c=r.tail;for(;c;){const l=c;if(c=c.previous,l){const d=this.mirror.getId(l.value.parentNode);if(i(l.value)===-1)continue;if(d!==-1){a=l;break}else{const h=l.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=h.parentNode.host;if(this.mirror.getId(p)!==-1){a=l;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),s(a.value)}const u={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:c}=a;if(typeof c.style=="string"){const l=JSON.stringify(a.styleDiff),d=JSON.stringify(a._unchangedStyles);l.length<c.style.length&&(l+d).split("var(").length===c.style.split("var(").length&&(c.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:c}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(u))},this.processMutation=e=>{if(!Na(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!yt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Mr(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Dm(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=Nc(n),u=n.tagName;i=Ro(n,u,o);const a=aa({maskInputOptions:this.maskInputOptions,tagName:u,type:o}),c=Mr(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);i=Oi({isMasked:c,element:n,value:i,maskInputFn:this.maskInputFn})}if(yt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||i===e.oldValue)return;let s=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Rm(n.tagName,r)&&(s.attributes[r]=Cm(this.doc,Dr(n.tagName),Dr(r),i,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const u of Array.from(n.style)){const a=n.style.getPropertyValue(u),c=n.style.getPropertyPriority(u);a!==o.style.getPropertyValue(u)||c!==o.style.getPropertyPriority(u)?c===""?s.styleDiff[u]=a:s.styleDiff[u]=[a,c]:s._unchangedStyles[u]=[a,c]}for(const u of Array.from(o.style))n.style.getPropertyValue(u)===""&&(s.styleDiff[u]=!1)}break}case"childList":{if(yt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),i=bi(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);yt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Na(n,this.mirror)||!ow(n,this.mirror)||(this.addedSet.has(n)?(Cu(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||Mm(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[wd(r,i)]?Cu(this.movedSet,n):this.removes.push({parentId:i,id:r,isShadow:bi(e.target)&&Ei(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Na(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[wd(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);yt(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach(r=>this.genAdds(r)),wu(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Cu(t,e){t.delete(e),e.childNodes.forEach(n=>Cu(t,n))}function Cd(t,e,n){return t.length===0?!1:Um(t,e,n)}function Um(t,e,n){const{parentNode:r}=e;if(!r)return!1;const i=n.getId(r);return t.some(s=>s.id===i)?!0:Um(t,r,n)}function Rd(t,e){return t.size===0?!1:Fm(t,e)}function Fm(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:Fm(t,n):!1}let Ti;function mw(t){Ti=t}function _w(){Ti=void 0}const ce=t=>Ti?(...n)=>{try{return t(...n)}catch(r){if(Ti&&Ti(r)===!0)return()=>{};throw r}}:t;function Dt(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const _r=[];function Yi(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function Bm(t,e){const n=new gw;_r.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const i=Dt([window,"optionalAccess",o=>o.Zone,"optionalAccess",o=>o.__symbol__,"optionalCall",o=>o("MutationObserver")]);i&&window[i]&&(r=window[i]);const s=new r(ce(o=>{t.onMutation&&t.onMutation(o)===!1||n.processMutations.bind(n)(o)}));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function vw({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],u;const a=Di(ce(d=>{const f=Date.now()-u;t(o.map(h=>(h.timeOffset-=f,h)),d),o=[],u=null}),s),c=ce(Di(ce(d=>{const f=Yi(d),{clientX:h,clientY:p}=Iu(d)?d.changedTouches[0]:d;u||(u=xo()),o.push({x:h,y:p,id:r.getId(f),timeOffset:xo()-u}),a(typeof DragEvent<"u"&&d instanceof DragEvent?ne.Drag:d instanceof MouseEvent?ne.MouseMove:ne.TouchMove)}),i,{trailing:!1})),l=[tt("mousemove",c,n),tt("touchmove",c,n),tt("drag",c,n)];return ce(()=>{l.forEach(d=>d())})}function yw({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const u=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let c=null;const l=d=>f=>{const h=Yi(f);if(yt(h,r,i,s,!0))return;let p=null,m=d;if("pointerType"in f){switch(f.pointerType){case"mouse":p=Gt.Mouse;break;case"touch":p=Gt.Touch;break;case"pen":p=Gt.Pen;break}p===Gt.Touch?Ze[d]===Ze.MouseDown?m="TouchStart":Ze[d]===Ze.MouseUp&&(m="TouchEnd"):Gt.Pen}else Iu(f)&&(p=Gt.Touch);p!==null?(c=p,(m.startsWith("Touch")&&p===Gt.Touch||m.startsWith("Mouse")&&p===Gt.Mouse)&&(p=null)):Ze[d]===Ze.Click&&(p=c,c=null);const _=Iu(f)?f.changedTouches[0]:f;if(!_)return;const g=n.getId(h),{clientX:v,clientY:y}=_;ce(t)({type:Ze[m],id:g,x:v,y,...p!==null&&{pointerType:p}})};return Object.keys(Ze).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&u[d]!==!1).forEach(d=>{let f=Dr(d);const h=l(d);if(window.PointerEvent)switch(Ze[d]){case Ze.MouseDown:case Ze.MouseUp:f=f.replace("mouse","pointer");break;case Ze.TouchStart:case Ze.TouchEnd:return}a.push(tt(f,h,e))}),ce(()=>{a.forEach(d=>d())})}function Hm({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){const u=ce(Di(ce(a=>{const c=Yi(a);if(!c||yt(c,r,i,s,!0))return;const l=n.getId(c);if(c===e&&e.defaultView){const d=xm(e.defaultView);t({id:l,x:d.left,y:d.top})}else t({id:l,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return tt("scroll",u,e)}function Sw({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const i=ce(Di(ce(()=>{const s=Om(),o=Am();(n!==s||r!==o)&&(t({width:Number(o),height:Number(s)}),n=s,r=o)}),200));return tt("resize",i,e)}const bw=["INPUT","TEXTAREA","SELECT"],kd=new WeakMap;function Ew({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,ignoreClass:o,ignoreSelector:u,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:h,maskTextSelector:p,unmaskTextSelector:m}){function _(O){let T=Yi(O);const S=O.isTrusted,b=T&&Tu(T.tagName);if(b==="OPTION"&&(T=T.parentElement),!T||!b||bw.indexOf(b)<0||yt(T,r,i,s,!0))return;const C=T;if(C.classList.contains(o)||u&&C.matches(u))return;const k=Nc(T);let I=Ro(C,b,k),D=!1;const N=aa({maskInputOptions:a,tagName:b,type:k}),M=Mr(T,f,p,h,m,N);(k==="radio"||k==="checkbox")&&(D=T.checked),I=Oi({isMasked:M,element:T,value:I,maskInputFn:c}),g(T,d?{text:I,isChecked:D,userTriggered:S}:{text:I,isChecked:D});const L=T.name;k==="radio"&&L&&D&&e.querySelectorAll(`input[type="radio"][name="${L}"]`).forEach($=>{if($!==T){const U=Oi({isMasked:M,element:$,value:Ro($,b,k),maskInputFn:c});g($,d?{text:U,isChecked:!D,userTriggered:!1}:{text:U,isChecked:!D})}})}function g(O,T){const S=kd.get(O);if(!S||S.text!==T.text||S.isChecked!==T.isChecked){kd.set(O,T);const b=n.getId(O);ce(t)({...T,id:b})}}const y=(l.input==="last"?["change"]:["input","change"]).map(O=>tt(O,ce(_),e)),w=e.defaultView;if(!w)return()=>{y.forEach(O=>O())};const R=w.Object.getOwnPropertyDescriptor(w.HTMLInputElement.prototype,"value"),E=[[w.HTMLInputElement.prototype,"value"],[w.HTMLInputElement.prototype,"checked"],[w.HTMLSelectElement.prototype,"value"],[w.HTMLTextAreaElement.prototype,"value"],[w.HTMLSelectElement.prototype,"selectedIndex"],[w.HTMLOptionElement.prototype,"selected"]];return R&&R.set&&y.push(...E.map(O=>km(O[0],O[1],{set(){ce(_)({target:this,isTrusted:!1})}},!1,w))),ce(()=>{y.forEach(O=>O())})}function Oo(t){const e=[];function n(r,i){if(Es("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Es("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Es("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Es("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return n(t,e)}function un(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function Tw({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:ce((l,d,f)=>{const[h,p]=f,{id:m,styleId:_}=un(d,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,adds:[{rule:h,index:p}]}),l.apply(d,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:ce((l,d,f)=>{const[h]=f,{id:p,styleId:m}=un(d,e,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,removes:[{index:h}]}),l.apply(d,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:ce((l,d,f)=>{const[h]=f,{id:p,styleId:m}=un(d,e,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,replace:h}),l.apply(d,f)})}));let u;r.CSSStyleSheet.prototype.replaceSync&&(u=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:ce((l,d,f)=>{const[h]=f,{id:p,styleId:m}=un(d,e,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,replaceSync:h}),l.apply(d,f)})}));const a={};Ts("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Ts("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Ts("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Ts("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(a).forEach(([l,d])=>{c[l]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[l].insertRule,{apply:ce((f,h,p)=>{const[m,_]=p,{id:g,styleId:v}=un(h.parentStyleSheet,e,n.styleMirror);return(g&&g!==-1||v&&v!==-1)&&t({id:g,styleId:v,adds:[{rule:m,index:[...Oo(h),_||0]}]}),f.apply(h,p)})}),d.prototype.deleteRule=new Proxy(c[l].deleteRule,{apply:ce((f,h,p)=>{const[m]=p,{id:_,styleId:g}=un(h.parentStyleSheet,e,n.styleMirror);return(_&&_!==-1||g&&g!==-1)&&t({id:_,styleId:g,removes:[{index:[...Oo(h),m]}]}),f.apply(h,p)})})}),ce(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=s,o&&(r.CSSStyleSheet.prototype.replace=o),u&&(r.CSSStyleSheet.prototype.replaceSync=u),Object.entries(a).forEach(([l,d])=>{d.prototype.insertRule=c[l].insertRule,d.prototype.deleteRule=c[l].deleteRule})})}function jm({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.getId(n.host);const i=n.nodeName==="#document"?Dt([n,"access",o=>o.defaultView,"optionalAccess",o=>o.Document]):Dt([n,"access",o=>o.ownerDocument,"optionalAccess",o=>o.defaultView,"optionalAccess",o=>o.ShadowRoot]),s=Dt([i,"optionalAccess",o=>o.prototype])?Object.getOwnPropertyDescriptor(Dt([i,"optionalAccess",o=>o.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!i||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return Dt([s,"access",o=>o.get,"optionalAccess",o=>o.call,"call",o=>o(this)])},set(o){const u=Dt([s,"access",a=>a.set,"optionalAccess",a=>a.call,"call",a=>a(this,o)]);if(r!==null&&r!==-1)try{e.adoptStyleSheets(o,r)}catch{}return u}}),ce(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Iw({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:ce((u,a,c)=>{const[l,d,f]=c;if(n.has(l))return s.apply(a,[l,d,f]);const{id:h,styleId:p}=un(Dt([a,"access",m=>m.parentRule,"optionalAccess",m=>m.parentStyleSheet]),e,r.styleMirror);return(h&&h!==-1||p&&p!==-1)&&t({id:h,styleId:p,set:{property:l,value:d,priority:f},index:Oo(a.parentRule)}),u.apply(a,c)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:ce((u,a,c)=>{const[l]=c;if(n.has(l))return o.apply(a,[l]);const{id:d,styleId:f}=un(Dt([a,"access",h=>h.parentRule,"optionalAccess",h=>h.parentStyleSheet]),e,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&t({id:d,styleId:f,remove:{property:l},index:Oo(a.parentRule)}),u.apply(a,c)})}),ce(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o})}function ww({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:i,sampling:s,doc:o}){const u=ce(c=>Di(ce(l=>{const d=Yi(l);if(!d||yt(d,e,n,r,!0))return;const{currentTime:f,volume:h,muted:p,playbackRate:m}=d;t({type:c,id:i.getId(d),currentTime:f,volume:h,muted:p,playbackRate:m})}),s.media||500)),a=[tt("play",u(0),o),tt("pause",u(1),o),tt("seeked",u(2),o),tt("volumechange",u(3),o),tt("ratechange",u(4),o)];return ce(()=>{a.forEach(c=>c())})}function Cw({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,s=n.FontFace;n.FontFace=function(a,c,l){const d=new s(a,c,l);return i.set(d,{family:a,buffer:typeof c!="string",descriptors:l,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};const o=Uc(e.fonts,"add",function(u){return function(a){return ua(ce(()=>{const c=i.get(a);c&&(t(c),i.delete(a))}),0),u.apply(this,[a])}});return r.push(()=>{n.FontFace=s}),r.push(o),ce(()=>{r.forEach(u=>u())})}function Rw(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,selectionCb:o}=t;let u=!0;const a=ce(()=>{const c=e.getSelection();if(!c||u&&Dt([c,"optionalAccess",f=>f.isCollapsed]))return;u=c.isCollapsed||!1;const l=[],d=c.rangeCount||0;for(let f=0;f<d;f++){const h=c.getRangeAt(f),{startContainer:p,startOffset:m,endContainer:_,endOffset:g}=h;yt(p,r,i,s,!0)||yt(_,r,i,s,!0)||l.push({start:n.getId(p),startOffset:m,end:n.getId(_),endOffset:g})}o({ranges:l})});return a(),tt("selectionchange",a)}function kw({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:Uc(n.customElements,"define",function(i){return function(s,o,u){try{e({define:{name:s}})}catch{}return i.apply(this,[s,o,u])}})}function xw(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};const r=Bm(t,t.doc),i=vw(t),s=yw(t),o=Hm(t),u=Sw(t,{win:n}),a=Ew(t),c=ww(t),l=Tw(t,{win:n}),d=jm(t,t.doc),f=Iw(t,{win:n}),h=t.collectFonts?Cw(t):()=>{},p=Rw(t),m=kw(t),_=[];for(const g of t.plugins)_.push(g.observer(g.callback,n,g.options));return ce(()=>{_r.forEach(g=>g.reset()),r.disconnect(),i(),s(),o(),u(),a(),c(),l(),d(),f(),h(),p(),m(),_.forEach(g=>g())})}function Es(t){return typeof window[t]<"u"}function Ts(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Ru{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,i){const s=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let u=s.get(n);return u||(u=this.generateIdFn(),s.set(n,u),o.set(u,n)),u}getIds(e,n){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return n.map(s=>this.getId(e,s,r,i))}getRemoteId(e,n,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const s=i.get(n);return s||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}function xd(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}class Ow{constructor(){this.crossOriginIframeMirror=new Ru(Pc),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Aw{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ru(Pc),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ru(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),xd([this,"access",r=>r.loadListener,"optionalCall",r=>r(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const s=this.transformCrossOriginEvent(i,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case te.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:te.IncrementalSnapshot,data:{source:ne.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case te.Meta:case te.Load:case te.DomContentLoaded:return!1;case te.Plugin:return n;case te.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case te.IncrementalSnapshot:switch(n.data.source){case ne.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const i=this.crossOriginIframeRootIdMap.get(e);i&&this.patchRootIdOnNode(r.node,i)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case ne.Drag:case ne.TouchMove:case ne.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case ne.ViewportResize:return!1;case ne.MediaInteraction:case ne.MouseInteraction:case ne.Scroll:case ne.CanvasMutation:case ne.Input:return this.replaceIds(n.data,e,["id"]),n;case ne.StyleSheetRule:case ne.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case ne.Font:return n;case ne.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case ne.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),xd([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(i=>{this.replaceStyleIds(i,e,["styleId"])})]),n}}return!1}replace(e,n,r,i){for(const s of i)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=e.getIds(r,n[s]):n[s]=e.getId(r,n[s]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==Pe.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class Dw{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Mw{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Ei(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Bm({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Hm({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),ua(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(jm({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(Uc(e.prototype,"attachShadow",function(i){return function(s){const o=i.call(this,s);return this.shadowRoot&&$m(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Od{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class Lw{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new uw,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},i=[];for(const s of e){let o;this.styleMirror.has(s)?o=this.styleMirror.getId(s):(o=this.styleMirror.add(s),i.push({styleId:o,rules:Array.from(s.rules||CSSRule,(u,a)=>({rule:Im(u),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Nw{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){dw(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==n)}add(e,n){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let Ce,Ao;const mt=PI();function pn(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:s=null,unblockSelector:o=null,ignoreClass:u="rr-ignore",ignoreSelector:a=null,maskAllText:c=!1,maskTextClass:l="rr-mask",unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:h=null,inlineStylesheet:p=!0,maskAllInputs:m,maskInputOptions:_,slimDOMOptions:g,maskAttributeFn:v,maskInputFn:y,maskTextFn:w,maxCanvasSize:R=null,packFn:E,sampling:O={},dataURLOptions:T={},mousemoveWait:S,recordCanvas:b=!1,recordCrossOriginIframes:C=!1,recordAfter:k=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:I=!1,collectFonts:D=!1,inlineImages:N=!1,plugins:M,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:$=new Set([]),errorHandler:U,onMutation:x,getCanvasManager:P}=t;mw(U);const B=C?window.parent===window:!0;let H=!1;if(!B)try{window.parent.document&&(H=!1)}catch{H=!0}if(B&&!e)throw new Error("emit function is required");S!==void 0&&O.mousemove===void 0&&(O.mousemove=S),mt.reset();const W=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:_!==void 0?_:{},X=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};aw();let se,_e=0;const ye=J=>{for(const He of M||[])He.eventProcessor&&(J=He.eventProcessor(J));return E&&!H&&(J=E(J)),J};Ce=(J,He)=>{const re=J;if(re.timestamp=xo(),no([_r,"access",G=>G[0],"optionalAccess",G=>G.isFrozen,"call",G=>G()])&&re.type!==te.FullSnapshot&&!(re.type===te.IncrementalSnapshot&&re.data.source===ne.Mutation)&&_r.forEach(G=>G.unfreeze()),B)no([e,"optionalCall",G=>G(ye(re),He)]);else if(H){const G={type:"rrweb",event:ye(re),origin:window.location.origin,isCheckout:He};window.parent.postMessage(G,"*")}if(re.type===te.FullSnapshot)se=re,_e=0;else if(re.type===te.IncrementalSnapshot){if(re.data.source===ne.Mutation&&re.data.isAttachIframe)return;_e++;const G=r&&_e>=r,j=n&&se&&re.timestamp-se.timestamp>n;(G||j)&&er(!0)}};const Oe=J=>{Ce({type:te.IncrementalSnapshot,data:{source:ne.Mutation,...J}})},ni=J=>Ce({type:te.IncrementalSnapshot,data:{source:ne.Scroll,...J}}),Cn=J=>Ce({type:te.IncrementalSnapshot,data:{source:ne.CanvasMutation,...J}}),Ia=J=>Ce({type:te.IncrementalSnapshot,data:{source:ne.AdoptedStyleSheet,...J}}),gt=new Lw({mutationCb:Oe,adoptedStyleSheetCb:Ia}),rt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Ow:new Aw({mirror:mt,mutationCb:Oe,stylesheetManager:gt,recordCrossOriginIframes:C,wrappedEmit:Ce});for(const J of M||[])J.getMirror&&J.getMirror({nodeMirror:mt,crossOriginIframeMirror:rt.crossOriginIframeMirror,crossOriginIframeStyleMirror:rt.crossOriginIframeStyleMirror});const Rn=new Nw,ds=$w(P,{mirror:mt,win:window,mutationCb:J=>Ce({type:te.IncrementalSnapshot,data:{source:ne.CanvasMutation,...J}}),recordCanvas:b,blockClass:i,blockSelector:s,unblockSelector:o,maxCanvasSize:R,sampling:O.canvas,dataURLOptions:T,errorHandler:U}),kn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Dw:new Mw({mutationCb:Oe,scrollCb:ni,bypassOptions:{onMutation:x,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:W,dataURLOptions:T,maskAttributeFn:v,maskTextFn:w,maskInputFn:y,recordCanvas:b,inlineImages:N,sampling:O,slimDOMOptions:X,iframeManager:rt,stylesheetManager:gt,canvasManager:ds,keepIframeSrcFn:L,processedNodeManager:Rn},mirror:mt}),er=(J=!1)=>{Ce({type:te.Meta,data:{href:window.location.href,width:Am(),height:Om()}},J),gt.reset(),kn.init(),_r.forEach(re=>re.lock());const He=sw(document,{mirror:mt,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:p,maskAllInputs:W,maskAttributeFn:v,maskInputFn:y,maskTextFn:w,slimDOM:X,dataURLOptions:T,recordCanvas:b,inlineImages:N,onSerialize:re=>{Lm(re,mt)&&rt.addIframe(re),Nm(re,mt)&>.trackLinkElement(re),wu(re)&&kn.addShadowRoot(re.shadowRoot,document)},onIframeLoad:(re,G)=>{rt.attachIframe(re,G),kn.observeAttachShadow(re)},onStylesheetLoad:(re,G)=>{gt.attachLinkElement(re,G)},keepIframeSrcFn:L});if(!He)return console.warn("Failed to snapshot the document");Ce({type:te.FullSnapshot,data:{node:He,initialOffset:xm(window)}}),_r.forEach(re=>re.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&>.adoptStyleSheets(document.adoptedStyleSheets,mt.getId(document))};Ao=er;try{const J=[],He=G=>ce(xw)({onMutation:x,mutationCb:Oe,mousemoveCb:(j,Q)=>Ce({type:te.IncrementalSnapshot,data:{source:Q,positions:j}}),mouseInteractionCb:j=>Ce({type:te.IncrementalSnapshot,data:{source:ne.MouseInteraction,...j}}),scrollCb:ni,viewportResizeCb:j=>Ce({type:te.IncrementalSnapshot,data:{source:ne.ViewportResize,...j}}),inputCb:j=>Ce({type:te.IncrementalSnapshot,data:{source:ne.Input,...j}}),mediaInteractionCb:j=>Ce({type:te.IncrementalSnapshot,data:{source:ne.MediaInteraction,...j}}),styleSheetRuleCb:j=>Ce({type:te.IncrementalSnapshot,data:{source:ne.StyleSheetRule,...j}}),styleDeclarationCb:j=>Ce({type:te.IncrementalSnapshot,data:{source:ne.StyleDeclaration,...j}}),canvasMutationCb:Cn,fontCb:j=>Ce({type:te.IncrementalSnapshot,data:{source:ne.Font,...j}}),selectionCb:j=>{Ce({type:te.IncrementalSnapshot,data:{source:ne.Selection,...j}})},customElementCb:j=>{Ce({type:te.IncrementalSnapshot,data:{source:ne.CustomElement,...j}})},blockClass:i,ignoreClass:u,ignoreSelector:a,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,maskInputOptions:W,inlineStylesheet:p,sampling:O,recordCanvas:b,inlineImages:N,userTriggeredOnInput:I,collectFonts:D,doc:G,maskAttributeFn:v,maskInputFn:y,maskTextFn:w,keepIframeSrcFn:L,blockSelector:s,unblockSelector:o,slimDOMOptions:X,dataURLOptions:T,mirror:mt,iframeManager:rt,stylesheetManager:gt,shadowDomManager:kn,processedNodeManager:Rn,canvasManager:ds,ignoreCSSAttributes:$,plugins:no([M,"optionalAccess",j=>j.filter,"call",j=>j(Q=>Q.observer),"optionalAccess",j=>j.map,"call",j=>j(Q=>({observer:Q.observer,options:Q.options,callback:we=>Ce({type:te.Plugin,data:{plugin:Q.name,payload:we}})}))])||[]},{});rt.addLoadListener(G=>{try{J.push(He(G.contentDocument))}catch(j){console.warn(j)}});const re=()=>{er(),J.push(He(document))};return document.readyState==="interactive"||document.readyState==="complete"?re():(J.push(tt("DOMContentLoaded",()=>{Ce({type:te.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&re()})),J.push(tt("load",()=>{Ce({type:te.Load,data:{}}),k==="load"&&re()},window))),()=>{J.forEach(G=>G()),Rn.destroy(),Ao=void 0,_w()}}catch(J){console.warn(J)}}function Pw(t){if(!Ao)throw new Error("please take full snapshot after start recording");Ao(t)}pn.mirror=mt;pn.takeFullSnapshot=Pw;function $w(t,e){try{return t?t(e):new Od}catch{return console.warn("Unable to initialize CanvasManager"),new Od}}const Uw=3,Fw=5;function Bc(t){return t>9999999999?t:t*1e3}function Pa(t){return t>9999999999?t/1e3:t}function Xi(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:te.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:vt(e,10,1e3)}}),e.category==="console")))}const Bw="button,a";function qm(t){return t.closest(Bw)||t}function Gm(t){const e=zm(t);return!e||!(e instanceof Element)?e:qm(e)}function zm(t){return Hw(t)?t.target:t}function Hw(t){return typeof t=="object"&&!!t&&"target"in t}let cn;function jw(t){return cn||(cn=[],qw()),cn.push(t),()=>{const e=cn?cn.indexOf(t):-1;e>-1&&cn.splice(e,1)}}function qw(){Ge(be,"open",function(t){return function(...e){if(cn)try{cn.forEach(n=>n())}catch{}return t.apply(be,e)}})}function Gw(t,e,n){t.handleClick(e,n)}class zw{constructor(e,n,r=Xi){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scollTimeout=n.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=jw(()=>{this._lastMutation=Ad()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(Vw(n,this._ignoreSelector)||!Kw(e))return;const r={timestamp:Pa(e.timestamp),clickBreadcrumb:e,clickCount:0,node:n};this._clicks.some(i=>i.node===r.node&&Math.abs(i.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=Pa(e)}registerScroll(e=Date.now()){this._lastScroll=Pa(e)}registerClick(e){const n=qm(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){const e=[],n=Ad();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&e.push(r)});for(const r of e){const i=this._clicks.indexOf(r);i>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(i,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,i=e.mutationAfter&&e.mutationAfter<=this._threshold,s=!r&&!i,{clickCount:o,clickBreadcrumb:u}=e;if(s){const a=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,c=a<this._timeout*1e3?"mutation":"timeout",l={type:"default",message:u.message,timestamp:u.timestamp,category:"ui.slowClickDetected",data:{...u.data,url:be.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:c,clickCount:o||1}};this._addBreadcrumbEvent(n,l);return}if(o>1){const a={type:"default",message:u.message,timestamp:u.timestamp,category:"ui.multiClick",data:{...u.data,url:be.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const Ww=["A","BUTTON","INPUT"];function Vw(t,e){return!!(!Ww.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function Kw(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function Ad(){return Date.now()/1e3}function Yw(t,e){try{if(!Xw(e))return;const{source:n}=e.data;if(n===ne.Mutation&&t.registerMutation(e.timestamp),n===ne.Scroll&&t.registerScroll(e.timestamp),Jw(e)){const{type:r,id:i}=e.data,s=pn.mirror.getNode(i);s instanceof HTMLElement&&r===Ze.Click&&t.registerClick(s)}}catch{}}function Xw(t){return t.type===Uw}function Jw(t){return t.data.source===ne.MouseInteraction}function Nt(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var Do;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Do||(Do={}));const Qw=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Zw(t){const e={};for(const n in t)if(Qw.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}const e1=t=>e=>{if(!t.isEnabled())return;const n=t1(e);if(!n)return;const r=e.name==="click",i=r?e.event:void 0;r&&t.clickDetector&&i&&i.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&Gw(t.clickDetector,n,Gm(e.event)),Xi(t,n)};function Wm(t,e){const n=pn.mirror.getId(t),r=n&&pn.mirror.getNode(n),i=r&&pn.mirror.getMeta(r),s=i&&r1(i)?i:null;return{message:e,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(o=>o.type===Do.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:Zw(s.attributes)}}:{}}}function t1(t){const{target:e,message:n}=n1(t);return Nt({category:`ui.${t.name}`,...Wm(e,n)})}function n1(t){const e=t.name==="click";let n,r=null;try{r=e?Gm(t.event):zm(t.event),n=vn(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function r1(t){return t.type===Do.Element}function i1(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=s1(e);n&&Xi(t,n)}function s1(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s,target:o}=t;if(!o||o1(o)||!s)return null;const u=e||r||i,a=s.length===1;if(!u&&a)return null;const c=vn(o,{maxStringLength:200})||"<unknown>",l=Wm(o,c);return Nt({category:"ui.keyDown",message:c,data:{...l.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s}})}function o1(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}const Dd={resource:d1,paint:c1,navigation:l1};function a1(t){return t.map(u1).filter(Boolean)}function u1(t){return Dd[t.entryType]?Dd[t.entryType](t):null}function Lr(t){return((Xe||be.performance.timeOrigin)+t)/1e3}function c1(t){const{duration:e,entryType:n,name:r,startTime:i}=t,s=Lr(i);return{type:n,name:r,start:s,end:s+e,data:void 0}}function l1(t){const{entryType:e,name:n,decodedBodySize:r,duration:i,domComplete:s,encodedBodySize:o,domContentLoadedEventStart:u,domContentLoadedEventEnd:a,domInteractive:c,loadEventStart:l,loadEventEnd:d,redirectCount:f,startTime:h,transferSize:p,type:m}=t;return i===0?null:{type:`${e}.${m}`,start:Lr(h),end:Lr(s),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:c,domContentLoadedEventStart:u,domContentLoadedEventEnd:a,loadEventStart:l,loadEventEnd:d,domComplete:s,redirectCount:f}}}function d1(t){const{entryType:e,initiatorType:n,name:r,responseEnd:i,startTime:s,decodedBodySize:o,encodedBodySize:u,responseStatus:a,transferSize:c}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:Lr(s),end:Lr(i),name:r,data:{size:c,statusCode:a,decodedBodySize:o,encodedBodySize:u}}}function f1(t){const e=t.entries,n=e[e.length-1],r=n?n.element:void 0,i=t.value,s=Lr(i);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:s,end:s,data:{value:i,size:i,nodeId:r?pn.mirror.getId(r):void 0}}}function h1(t){function e(i){t.performanceEntries.includes(i)||t.performanceEntries.push(i)}function n({entries:i}){i.forEach(e)}const r=[];return["navigation","paint","resource"].forEach(i=>{r.push(bn(i,n))}),r.push(Lg(({metric:i})=>{t.replayPerformanceEntries.push(f1(i))})),()=>{r.forEach(i=>i())}}const ve=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,p1='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([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]),i=new t([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]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function g1(){const t=new Blob([p1]);return URL.createObjectURL(t)}function et(t,e){ve&&(A.info(t),e&&Vm(t))}function wr(t,e){ve&&(A.info(t),e&&setTimeout(()=>{Vm(t)},0))}function Vm(t){nn({category:"console",data:{logger:"replay"},level:"info",message:t},{level:"info"})}class Hc extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Lc}.`)}}class Km{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>Lc)throw new Hc;this.events.push(e)}finish(){return new Promise(e=>{const n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map(n=>n.timestamp).sort()[0];return e?Bc(e):null}}class m1{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){et("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(e,n){const r=this._getAndIncrementId();return new Promise((i,s)=>{const o=({data:u})=>{const a=u;if(a.method===e&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){ve&&A.error("[Replay]",a.response),s(new Error("Error in compression worker"));return}i(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:e,arg:n})})}_getAndIncrementId(){return this._id++}}class _1{constructor(e){this._worker=new m1(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const n=Bc(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>Lc?Promise.reject(new Hc):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{ve&&A.warn('[Replay] Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class v1{constructor(e){this._fallback=new Km,this._compression=new _1(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{et("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:n}=this._fallback,r=[];for(const i of e)r.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._used=this._compression;try{await Promise.all(r)}catch(i){ve&&A.warn("[Replay] Failed to add events when switching buffers.",i)}}}function y1({useCompression:t,workerUrl:e}){if(t&&window.Worker){const n=S1(e);if(n)return n}return et("[Replay] Using simple buffer"),new Km}function S1(t){try{const e=t||b1();if(!e)return;et(`[Replay] Using compression worker${t?` from ${t}`:""}`);const n=new Worker(e);return new v1(n)}catch{et("[Replay] Failed to create compression worker")}}function b1(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?g1():""}function jc(){try{return"sessionStorage"in be&&!!be.sessionStorage}catch{return!1}}function E1(t){T1(),t.session=void 0}function T1(){if(jc())try{be.sessionStorage.removeItem(Dc)}catch{}}function Ym(t){return t===void 0?!1:Math.random()<t}function Xm(t){const e=Date.now(),n=t.id||he(),r=t.started||e,i=t.lastActivity||e,s=t.segmentId||0,o=t.sampled,u=t.previousSessionId;return{id:n,started:r,lastActivity:i,segmentId:s,sampled:o,previousSessionId:u}}function qc(t){if(jc())try{be.sessionStorage.setItem(Dc,JSON.stringify(t))}catch{}}function I1(t,e){return Ym(t)?"session":e?"buffer":!1}function Md({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const i=I1(t,e),s=Xm({sampled:i,previousSessionId:r});return n&&qc(s),s}function w1(t){if(!jc())return null;try{const e=be.sessionStorage.getItem(Dc);if(!e)return null;const n=JSON.parse(e);return wr("[Replay] Loading existing session",t),Xm(n)}catch{return null}}function ku(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function Jm(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return ku(t.started,e,r)||ku(t.lastActivity,n,r)}function Qm(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!Jm(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function $a({traceInternals:t,sessionIdleExpire:e,maxReplayDuration:n,previousSessionId:r},i){const s=i.stickySession&&w1(t);return s?Qm(s,{sessionIdleExpire:e,maxReplayDuration:n})?(wr("[Replay] Session in sessionStorage is expired, creating new one..."),Md(i,{previousSessionId:s.id})):s:(wr("[Replay] Creating new session",t),Md(i,{previousSessionId:r}))}function C1(t){return t.type===te.Custom}function Gc(t,e,n){return e_(t,e)?(Zm(t,e,n),!0):!1}function R1(t,e,n){return e_(t,e)?Zm(t,e,n):Promise.resolve(null)}async function Zm(t,e,n){if(!t.eventBuffer)return null;try{n&&t.recordingMode==="buffer"&&t.eventBuffer.clear(),n&&(t.eventBuffer.hasCheckout=!0);const r=t.getOptions(),i=k1(e,r.beforeAddRecordingEvent);return i?await t.eventBuffer.addEvent(i):void 0}catch(r){const i=r&&r instanceof Hc?"addEventSizeExceeded":"addEvent";ve&&A.error(r),await t.stop({reason:i});const s=K();s&&s.recordDroppedEvent("internal_sdk_error","replay")}}function e_(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=Bc(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(et(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,t.getOptions()._experiments.traceInternals),!1):!0}function k1(t,e){try{if(typeof e=="function"&&C1(t))return e(t)}catch(n){return ve&&A.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return t}function zc(t){return!t.type}function xu(t){return t.type==="transaction"}function x1(t){return t.type==="replay_event"}function Ld(t){return t.type==="feedback"}function t_(t){const e=D1();return(n,r)=>{if(!t.isEnabled()||!zc(n)&&!xu(n))return;const i=r&&r.statusCode;if(!(e&&(!i||i<200||i>=300))){if(xu(n)){O1(t,n);return}A1(t,n)}}}function O1(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}function A1(t,e){const n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||setTimeout(()=>{t.sendBufferedReplayOrFlush()})}function D1(){const t=K();if(!t)return!1;const e=t.getTransport();return e&&e.send.__sentry__baseTransport__||!1}function M1(t){return e=>{!t.isEnabled()||!zc(e)||L1(t,e)}}function L1(t,e){const n=e.exception&&e.exception.values&&e.exception.values[0].value;if(typeof n=="string"&&(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Nt({category:"replay.hydrate-error"});Xi(t,r)}}function N1(t,e){return t.type||!t.exception||!t.exception.values||!t.exception.values.length?!1:!!(e.originalException&&e.originalException.__rrweb__)}function P1(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:te.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function $1(t,e){return t.recordingMode!=="buffer"||e.message===Mc||!e.exception||e.type?!1:Ym(t.getOptions().errorSampleRate)}function U1(t,e=!1){const n=e?t_(t):void 0;return Object.assign((r,i)=>t.isEnabled()?x1(r)?(delete r.breadcrumbs,r):!zc(r)&&!xu(r)&&!Ld(r)||!t.checkAndHandleExpiredSession()?r:Ld(r)?(t.flush(),r.contexts.feedback.replay_id=t.getSessionId(),P1(t,r),r):N1(r,i)&&!t.getOptions()._experiments.captureExceptions?(ve&&A.log("[Replay] Ignoring error from rrweb internals",r),null):(($1(t,r)||t.recordingMode==="session")&&(r.tags={...r.tags,replayId:t.getSessionId()}),n&&n(r,{statusCode:200}),r):r,{id:"Replay"})}function ca(t,e){return e.map(({type:n,start:r,end:i,name:s,data:o})=>{const u=t.throttledAddEvent({type:te.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:i,data:o}}});return typeof u=="string"?Promise.resolve(null):u})}function F1(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function B1(t){return e=>{if(!t.isEnabled())return;const n=F1(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(ca(t,[n]),!1)))}}function H1(t,e){return ve&&t.getOptions()._experiments.traceInternals?!1:pg(e,K())}function la(t,e){t.isEnabled()&&e!==null&&(H1(t,e.name)||t.addUpdate(()=>(ca(t,[e]),!0)))}function j1(t){const{startTimestamp:e,endTimestamp:n,fetchData:r,response:i}=t;if(!n)return null;const{method:s,url:o}=r;return{type:"resource.fetch",start:e/1e3,end:n/1e3,name:o,data:{method:s,statusCode:i?i.status:void 0}}}function q1(t){return e=>{if(!t.isEnabled())return;const n=j1(e);la(t,n)}}function G1(t){const{startTimestamp:e,endTimestamp:n,xhr:r}=t,i=r[Xt];if(!e||!n||!i)return null;const{method:s,url:o,status_code:u}=i;return o===void 0?null:{type:"resource.xhr",name:o,start:e/1e3,end:n/1e3,data:{method:s,statusCode:u}}}function z1(t){return e=>{if(!t.isEnabled())return;const n=G1(e);la(t,n)}}function da(t,e){if(t)try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=s_(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function n_(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function r_(t){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[s_(t)];if(!t)return[void 0]}catch{return ve&&A.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return ve&&A.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Mo(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function i_(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:i,method:s,statusCode:o,request:u,response:a}=e;return{type:t,start:n/1e3,end:r/1e3,name:i,data:ze({method:s,statusCode:o,request:u,response:a})}}function Mi(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function gn(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:i,warnings:s}=W1(n);return r.body=i,s&&s.length>0&&(r._meta={warnings:s}),r}function Ou(t,e){return Object.keys(t).reduce((n,r)=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=t[r]),n},{})}function s_(t){return new URLSearchParams(t).toString()}function W1(t){if(!t||typeof t!="string")return{body:t};const e=t.length>vd,n=V1(t);if(e){const r=t.slice(0,vd);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function V1(t){const e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function Lo(t,e){const n=K1(t);return jr(n,e)}function K1(t,e=be.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(be.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function Y1(t,e,n){try{const r=await J1(t,e,n),i=i_("resource.fetch",r);la(n.replay,i)}catch(r){ve&&A.error("[Replay] Failed to capture fetch breadcrumb",r)}}function X1(t,e,n){const{input:r,response:i}=e,s=r?o_(r):void 0,o=da(s,n.textEncoder),u=i?n_(i.headers.get("content-length")):void 0;o!==void 0&&(t.data.request_body_size=o),u!==void 0&&(t.data.response_body_size=u)}async function J1(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r}=e,{url:o,method:u,status_code:a=0,request_body_size:c,response_body_size:l}=t.data,d=Lo(o,n.networkDetailAllowUrls)&&!Lo(o,n.networkDetailDenyUrls),f=d?Q1(n,e.input,c):Mi(c),h=await Z1(d,n,e.response,l);return{startTimestamp:i,endTimestamp:s,url:o,method:u,statusCode:a,request:f,response:h}}function Q1({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const i=n?nC(n,e):{};if(!t)return gn(i,r,void 0);const s=o_(n),[o,u]=r_(s),a=gn(i,r,o);return u?Mo(a,u):a}async function Z1(t,{networkCaptureBodies:e,textEncoder:n,networkResponseHeaders:r},i,s){if(!t&&s!==void 0)return Mi(s);const o=i?a_(i.headers,r):{};if(!i||!e&&s!==void 0)return gn(o,s,void 0);const[u,a]=await tC(i),c=eC(u,{networkCaptureBodies:e,textEncoder:n,responseBodySize:s,captureDetails:t,headers:o});return a?Mo(c,a):c}function eC(t,{networkCaptureBodies:e,textEncoder:n,responseBodySize:r,captureDetails:i,headers:s}){try{const o=t&&t.length&&r===void 0?da(t,n):r;return i?e?gn(s,o,t):gn(s,o,void 0):Mi(o)}catch(o){return ve&&A.warn("[Replay] Failed to serialize response body",o),gn(s,r,void 0)}}async function tC(t){const e=rC(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await iC(e)]}catch(n){return ve&&A.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}function o_(t=[]){if(!(t.length!==2||typeof t[1]!="object"))return t[1].body}function a_(t,e){const n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function nC(t,e){return t.length===1&&typeof t[0]!="string"?Nd(t[0],e):t.length===2?Nd(t[1],e):{}}function Nd(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?a_(n,e):Array.isArray(n)?{}:Ou(n,e):{}}function rC(t){try{return t.clone()}catch(e){ve&&A.warn("[Replay] Failed to clone response body",e)}}function iC(t){return new Promise((e,n)=>{const r=setTimeout(()=>n(new Error("Timeout while trying to read response body")),500);sC(t).then(i=>e(i),i=>n(i)).finally(()=>clearTimeout(r))})}async function sC(t){return await t.text()}async function oC(t,e,n){try{const r=uC(t,e,n),i=i_("resource.xhr",r);la(n.replay,i)}catch(r){ve&&A.error("[Replay] Failed to capture xhr breadcrumb",r)}}function aC(t,e,n){const{xhr:r,input:i}=e;if(!r)return;const s=da(i,n.textEncoder),o=r.getResponseHeader("content-length")?n_(r.getResponseHeader("content-length")):fC(r.response,r.responseType,n.textEncoder);s!==void 0&&(t.data.request_body_size=s),o!==void 0&&(t.data.response_body_size=o)}function uC(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r,input:o,xhr:u}=e,{url:a,method:c,status_code:l=0,request_body_size:d,response_body_size:f}=t.data;if(!a)return null;if(!u||!Lo(a,n.networkDetailAllowUrls)||Lo(a,n.networkDetailDenyUrls)){const E=Mi(d),O=Mi(f);return{startTimestamp:i,endTimestamp:s,url:a,method:c,statusCode:l,request:E,response:O}}const h=u[Xt],p=h?Ou(h.request_headers,n.networkRequestHeaders):{},m=Ou(cC(u),n.networkResponseHeaders),[_,g]=n.networkCaptureBodies?r_(o):[void 0],[v,y]=n.networkCaptureBodies?lC(u):[void 0],w=gn(p,d,_),R=gn(m,f,v);return{startTimestamp:i,endTimestamp:s,url:a,method:c,statusCode:l,request:g?Mo(w,g):w,response:y?Mo(R,y):R}}function cC(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
`).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i.toLowerCase()]=s,n},{}):{}}function lC(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return dC(t.response,t.responseType)}catch(n){e.push(n)}return ve&&A.warn("[Replay] Failed to get xhr response body",...e),[void 0]}function dC(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch{return ve&&A.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return ve&&A.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function fC(t,e,n){try{const r=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return da(r,n)}catch{return}}function hC(t){const e=K();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:u}=t.getOptions(),a={replay:t,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:u};e&&e.on?e.on("beforeAddBreadcrumb",(c,l)=>pC(a,c,l)):(Xo(q1(t)),Jo(z1(t)))}catch{}}function pC(t,e,n){if(e.data)try{gC(e)&&_C(n)&&(aC(e,n,t),oC(e,n,t)),mC(e)&&vC(n)&&(X1(e,n,t),Y1(e,n,t))}catch{ve&&A.warn("Error when enriching network breadcrumb")}}function gC(t){return t.category==="xhr"}function mC(t){return t.category==="fetch"}function _C(t){return t&&t.xhr}function vC(t){return t&&t.response}let Pd=null;function yC(t){return!!t.category}const SC=t=>e=>{if(!t.isEnabled())return;const n=bC(e);n&&Xi(t,n)};function bC(t){const e=t.getLastBreadcrumb&&t.getLastBreadcrumb();return Pd===e||!e||(Pd=e,!yC(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))?null:e.category==="console"?EC(e):Nt(e)}function EC(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||e.length===0)return Nt(t);let n=!1;const r=e.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>bs?(n=!0,`${i.slice(0,bs)}…`):i;if(typeof i=="object")try{const s=vt(i,7);return JSON.stringify(s).length>bs?(n=!0,`${JSON.stringify(s,null,2).slice(0,bs)}…`):s}catch{}return i});return Nt({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function TC(t){const e=Ae(),n=K();e.addScopeListener(SC(t)),yp(e1(t)),Ui(B1(t)),hC(t);const r=U1(t,!$d(n));n&&n.addEventProcessor?n.addEventProcessor(r):ug(r),$d(n)&&(n.on("beforeSendEvent",M1(t)),n.on("afterSendEvent",t_(t)),n.on("createDsc",i=>{const s=t.getSessionId();s&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(i.replay_id=s)}),n.on("startTransaction",i=>{t.lastTransaction=i}),n.on("finishTransaction",i=>{t.lastTransaction=i}),n.on("beforeSendFeedback",(i,s)=>{const o=t.getSessionId();s&&s.includeReplay&&t.isEnabled()&&o&&i.contexts&&i.contexts.feedback&&(i.contexts.feedback.replay_id=o)}))}function $d(t){return!!(t&&t.on)}async function IC(t){try{return Promise.all(ca(t,[wC(be.performance.memory)]))}catch{return[]}}function wC(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function CC(t,e,n){let r,i,s;const o=n&&n.maxWait?Math.max(n.maxWait,e):0;function u(){return a(),r=t(),r}function a(){i!==void 0&&clearTimeout(i),s!==void 0&&clearTimeout(s),i=s=void 0}function c(){return i!==void 0||s!==void 0?u():r}function l(){return i&&clearTimeout(i),i=setTimeout(u,e),o&&s===void 0&&(s=setTimeout(u,o)),r}return l.cancel=a,l.flush=c,l}function RC(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){ve&&A.warn("[Replay] Received replay event after session expired.");return}const i=r||!e;e=!0,t.clickDetector&&Yw(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&i&&t.setInitialState(),!Gc(t,n,i))return!0;if(!i)return!1;if(xC(t,i),t.session&&t.session.previousSessionId)return!0;if(t.recordingMode==="buffer"&&t.session&&t.eventBuffer){const s=t.eventBuffer.getEarliestTimestamp();s&&(et(`[Replay] Updating session start time to earliest event in buffer to ${new Date(s)}`,t.getOptions()._experiments.traceInternals),t.session.started=s,t.getOptions().stickySession&&qc(t.session))}return t.recordingMode==="session"&&t.flush(),!0})}}function kC(t){const e=t.getOptions();return{type:te.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function xC(t,e){!e||!t.session||t.session.segmentId!==0||Gc(t,kC(t),!1)}function OC(t,e,n,r){return rn(Dp(t,oc(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function AC({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}
`;if(typeof t=="string")n=`${r}${t}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+t.length),n.set(s),n.set(t,s.length)}return n}async function DC({client:t,scope:e,replayId:n,event:r}){const i=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,s={event_id:n,integrations:i};t.emit&&t.emit("preprocessEvent",r,s);const o=await lc(t.getOptions(),r,s,e,t,Ut());if(!o)return null;o.platform=o.platform||"javascript";const u=t.getSdkMetadata&&t.getSdkMetadata(),{name:a,version:c}=u&&u.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:c||"0.0.0"},o}async function MC({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:i,session:s}){const o=AC({recordingData:t,headers:{segment_id:n}}),{urls:u,errorIds:a,traceIds:c,initialTimestamp:l}=r,d=K(),f=Ae(),h=d&&d.getTransport(),p=d&&d.getDsn();if(!d||!h||!p||!s.sampled)return;const m={type:_I,replay_start_timestamp:l/1e3,timestamp:i/1e3,error_ids:a,trace_ids:c,urls:u,replay_id:e,segment_id:n,replay_type:s.sampled},_=await DC({scope:f,client:d,replayId:e,event:m});if(!_){d.recordDroppedEvent("event_processor","replay",m),et("An event processor returned `null`, will not send event.");return}delete _.sdkProcessingMetadata;const g=OC(_,o,p,d.getOptions().tunnel);let v;try{v=await h.send(g)}catch(w){const R=new Error(Mc);try{R.cause=w}catch{}throw R}if(!v)return v;if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new u_(v.statusCode);const y=Np({},v);if(Lp(y,"replay"))throw new c_(y);return v}class u_ extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class c_ extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function l_(t,e={count:0,interval:TI}){const{recordingData:n,options:r}=t;if(n.length)try{return await MC(t),!0}catch(i){if(i instanceof u_||i instanceof c_)throw i;if(Bp("Replays",{_retryCount:e.count}),ve&&r._experiments&&r._experiments.captureExceptions&&Hi(i),e.count>=II){const s=new Error(`${Mc} - max retries exceeded`);try{s.cause=i}catch{}throw s}return e.interval*=++e.count,new Promise((s,o)=>{setTimeout(async()=>{try{await l_(t,e),s(!0)}catch(u){o(u)}},e.interval)})}}const d_="__THROTTLED",LC="__SKIPPED";function NC(t,e,n){const r=new Map,i=u=>{const a=u-n;r.forEach((c,l)=>{l<a&&r.delete(l)})},s=()=>[...r.values()].reduce((u,a)=>u+a,0);let o=!1;return(...u)=>{const a=Math.floor(Date.now()/1e3);if(i(a),s()>=e){const l=o;return o=!0,l?LC:d_}o=!1;const c=r.get(a)||0;return r.set(a,c+1),t(...u)}}class ln{constructor({options:e,recordingOptions:n}){ln.prototype.__init.call(this),ln.prototype.__init2.call(this),ln.prototype.__init3.call(this),ln.prototype.__init4.call(this),ln.prototype.__init5.call(this),ln.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:vI,sessionIdleExpire:yI},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=e,this._debouncedFlush=CC(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=NC((o,u)=>R1(this,o,u),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:i}=this.getOptions(),s=r?{threshold:Math.min(wI,r),timeout:r,scrollTimeout:CI,ignoreSelector:i?i.join(","):""}:void 0;s&&(this.clickDetector=new zw(this,s))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(e){const{errorSampleRate:n,sessionSampleRate:r}=this._options;if(!(n<=0&&r<=0)){if(this._initializeSessionForSampling(e),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",wr(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");wr("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();const e=$a({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");wr("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const e=$a({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=pn({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:EI},emit:RC(this),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this._handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{et(`[Replay] Stopping Replay${n?` triggered by ${n}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,E1(this)}catch(r){this._handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),et("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),et("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();et("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const n=e();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&ku(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${be.location.pathname}${be.location.hash}${be.location.search}`,n=`${be.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){const r=this._throttledAddEvent(e,n);if(r===d_){const i=Nt({category:"replay.throttled"});this.addUpdate(()=>!Gc(this,{type:Fw,timestamp:i.timestamp||0,data:{tag:"breadcrumb",payload:i,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastTransaction||Ae().getTransaction(),r=(e&&pe(e).data||{})[ot];if(!(!e||!r||!["route","custom"].includes(r)))return pe(e).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=y1({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){ve&&A.error("[Replay]",e),ve&&this._options._experiments&&this._options._experiments.captureExceptions&&Hi(e)}_initializeSessionForSampling(e){const n=this._options.errorSampleRate>0,r=$a({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return Qm(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{be.document.addEventListener("visibilitychange",this._handleVisibilityChange),be.addEventListener("blur",this._handleWindowBlur),be.addEventListener("focus",this._handleWindowFocus),be.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(TC(this),this._hasInitializedCoreListeners=!0)}catch(e){this._handleException(e)}this._performanceCleanupCallback=h1(this)}_removeListeners(){try{be.document.removeEventListener("visibilitychange",this._handleVisibilityChange),be.removeEventListener("blur",this._handleWindowBlur),be.removeEventListener("focus",this._handleWindowFocus),be.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{be.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=Nt({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=Nt({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{i1(this,e)}}_doChangeToBackgroundTasks(e){!this.session||Jm(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){et("[Replay] Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:te.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){const e=a1(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(ca(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:n}=this;if(!e||!n||e.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){ve&&A.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await IC(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await l_({replayId:e,recordingData:s,segmentId:i,eventContext:r,session:this.session,options:this.getOptions(),timestamp:n})}catch(n){this._handleException(n),this.stop({reason:"sendReplay"});const r=K();r&&r.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){ve&&A.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,i=Date.now()-n;this._debouncedFlush.cancel();const s=i<this._options.minReplayDuration,o=i>this._options.maxReplayDuration+5e3;if(s||o){et(`[Replay] Session duration (${Math.floor(i/1e3)}s) is too ${s?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),s&&this._debouncedFlush();return}const u=this.eventBuffer;if(u&&this.session.segmentId===0&&!u.hasCheckout&&et("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(a){ve&&A.error(a)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&qc(this.session)}__init6(){this._onMutationHandler=e=>{const n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=r&&n>r;if(n>i||s){const o=Nt({category:"replay.mutations",data:{count:n,limit:s}});this._createCustomBreadcrumb(o)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function oi(t,e,n,r){const i=typeof r=="string"?r.split(","):[],s=[...t,...i,...e];return typeof n<"u"&&(typeof n=="string"&&s.push(`.${n}`),yn(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),s.join(",")}function PC({mask:t,unmask:e,block:n,unblock:r,ignore:i,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:a,ignoreClass:c}){const l=['base[href="/"]'],d=oi(t,[".sentry-mask","[data-sentry-mask]"],u,a),f=oi(e,[".sentry-unmask","[data-sentry-unmask]"]),h={maskTextSelector:d,unmaskTextSelector:f,blockSelector:oi(n,[".sentry-block","[data-sentry-block]",...l],s,o),unblockSelector:oi(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:oi(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],c)};return s instanceof RegExp&&(h.blockClass=s),u instanceof RegExp&&(h.maskTextClass=u),h}function $C({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:i,value:s}){return!r||i.unmaskTextSelector&&t.matches(i.unmaskTextSelector)?s:n.includes(e)||e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s}const Ud='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',UC=["content-length","content-type","accept"];let Fd=!1;const FC=t=>new Ji(t);class Ji{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=SI,flushMaxDelay:n=bI,minReplayDuration:r=RI,maxReplayDuration:i=yd,stickySession:s=!0,useCompression:o=!0,workerUrl:u,_experiments:a={},sessionSampleRate:c,errorSampleRate:l,maskAllText:d=!0,maskAllInputs:f=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:p=750,mutationLimit:m=1e4,slowClickTimeout:_=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:y=[],networkCaptureBodies:w=!0,networkRequestHeaders:R=[],networkResponseHeaders:E=[],mask:O=[],maskAttributes:T=["title","placeholder"],unmask:S=[],block:b=[],unblock:C=[],ignore:k=[],maskFn:I,beforeAddRecordingEvent:D,beforeErrorSampling:N,blockClass:M,blockSelector:L,maskInputOptions:$,maskTextClass:U,maskTextSelector:x,ignoreClass:P}={}){this.name=Ji.id;const B=PC({mask:O,unmask:S,block:b,unblock:C,ignore:k,blockClass:M,blockSelector:L,maskTextClass:U,maskTextSelector:x,ignoreClass:P});if(this._recordingOptions={maskAllInputs:f,maskAllText:d,maskInputOptions:{...$||{},password:!0},maskTextFn:I,maskInputFn:I,maskAttributeFn:(H,W,X)=>$C({maskAttributes:T,maskAllText:d,privacyOptions:B,key:H,value:W,el:X}),...B,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:H=>{try{H.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,kI),maxReplayDuration:Math.min(i,yd),stickySession:s,sessionSampleRate:c,errorSampleRate:l,useCompression:o,workerUrl:u,blockAllMedia:h,maskAllInputs:f,maskAllText:d,mutationBreadcrumbLimit:p,mutationLimit:m,slowClickTimeout:_,slowClickIgnoreSelectors:g,networkDetailAllowUrls:v,networkDetailDenyUrls:y,networkCaptureBodies:w,networkRequestHeaders:Bd(R),networkResponseHeaders:Bd(E),beforeAddRecordingEvent:D,beforeErrorSampling:N,_experiments:a},typeof c=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysSessionSampleRate: ${c} })`),this._initialOptions.sessionSampleRate=c),typeof l=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysOnErrorSampleRate: ${l} })`),this._initialOptions.errorSampleRate=l),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Ud}`:Ud),this._isInitialized&&cu())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Fd}set _isInitialized(e){Fd=e}setupOnce(){cu()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(e){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(e)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const e=BC(this._initialOptions);this._replay=new ln({options:e,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const n=K().getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}Ji.__initStatic();function BC(t){const e=K(),n=e&&e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...ze(t)};return n?(t.sessionSampleRate==null&&t.errorSampleRate==null&&n.replaysSessionSampleRate==null&&n.replaysOnErrorSampleRate==null&&yn(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof n.replaysSessionSampleRate=="number"&&(r.sessionSampleRate=n.replaysSessionSampleRate),typeof n.replaysOnErrorSampleRate=="number"&&(r.errorSampleRate=n.replaysOnErrorSampleRate),r):(yn(()=>{console.warn("SDK client is not available.")}),r)}function Bd(t){return[...UC,...t.map(e=>e.toLowerCase())]}function HC(){const t=K();return t&&t.getIntegrationByName&&t.getIntegrationByName("Replay")}var Hd;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Hd||(Hd={}));function jC(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function Au(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:Au(t.parentNode,e,n,r+1)}function jd(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(jC(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}const hr=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let qd={map:{},getId(){return console.error(hr),-1},getNode(){return console.error(hr),null},removeNodeFromMap(){console.error(hr)},has(){return console.error(hr),!1},reset(){console.error(hr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(qd=new Proxy(qd,{get(t,e,n){return e==="map"&&console.error(hr),Reflect.get(t,e,n)}}));function Wc(t,e,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(o){h_(()=>{n.set.call(this,o)},0),s&&s.set&&s.set.call(this,o)}}),()=>Wc(t,e,s||{},!0)}function Vc(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString());function qC(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function fa(t,e,n,r,i){if(!t)return!1;const s=qC(t);if(!s)return!1;const o=jd(e,n),u=Au(s,o);let a=-1;return u<0?!1:(r&&(a=Au(s,jd(null,r))),u>-1&&a<0?!0:u<a)}const Gd={};function f_(t){const e=Gd[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch{}return Gd[t]=r.bind(window)}function xn(...t){return f_("requestAnimationFrame")(...t)}function h_(...t){return f_("setTimeout")(...t)}var Nr=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Nr||{});let io;function GC(t){io=t}const zd=t=>io?(...n)=>{try{return t(...n)}catch(r){if(io&&io(r)===!0)return()=>{};throw r}}:t;var vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zC=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Is=0;Is<vr.length;Is++)zC[vr.charCodeAt(Is)]=Is;var WC=function(t){var e=new Uint8Array(t),n,r=e.length,i="";for(n=0;n<r;n+=3)i+=vr[e[n]>>2],i+=vr[(e[n]&3)<<4|e[n+1]>>4],i+=vr[(e[n+1]&15)<<2|e[n+2]>>6],i+=vr[e[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const Wd=new Map;function VC(t,e){let n=Wd.get(t);return n||(n=new Map,Wd.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const p_=(t,e,n)=>{if(!t||!(m_(t,e)||typeof t=="object"))return;const r=t.constructor.name,i=VC(n,r);let s=i.indexOf(t);return s===-1&&(s=i.length,i.push(t)),s};function so(t,e,n){if(t instanceof Array)return t.map(r=>so(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const r=t.constructor.name,i=WC(t);return{rr_type:r,base64:i}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[so(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const r=t.constructor.name,{src:i}=t;return{rr_type:r,src:i}}else if(t instanceof HTMLCanvasElement){const r="HTMLImageElement",i=t.toDataURL();return{rr_type:r,src:i}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[so(t.data,e,n),t.width,t.height]};if(m_(t,e)||typeof t=="object"){const r=t.constructor.name,i=p_(t,e,n);return{rr_type:r,index:i}}}}return t}const g_=(t,e,n)=>t.map(r=>so(r,e,n)),m_=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>t instanceof e[i]);function KC(t,e,n,r,i){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const u of o)try{if(typeof e.CanvasRenderingContext2D.prototype[u]!="function")continue;const a=Vc(e.CanvasRenderingContext2D.prototype,u,function(c){return function(...l){return fa(this.canvas,n,r,i,!0)||h_(()=>{const d=g_(l,e,this);t(this.canvas,{type:Nr["2D"],property:u,args:d})},0),c.apply(this,l)}});s.push(a)}catch{const c=Wc(e.CanvasRenderingContext2D.prototype,u,{set(l){t(this.canvas,{type:Nr["2D"],property:u,args:[l],setter:!0})}});s.push(c)}return()=>{s.forEach(u=>u())}}function YC(t){return t==="experimental-webgl"?"webgl":t}function Vd(t,e,n,r,i){const s=[];try{const o=Vc(t.HTMLCanvasElement.prototype,"getContext",function(u){return function(a,...c){if(!fa(this,e,n,r,!0)){const l=YC(a);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(c[0]&&typeof c[0]=="object"){const d=c[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return u.apply(this,[a,...c])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function Kd(t,e,n,r,i,s,o,u){const a=[],c=Object.getOwnPropertyNames(t);for(const l of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof t[l]!="function")continue;const d=Vc(t,l,function(f){return function(...h){const p=f.apply(this,h);if(p_(p,u,this),"tagName"in this.canvas&&!fa(this.canvas,r,i,s,!0)){const m=g_(h,u,this),_={type:e,property:l,args:m};n(this.canvas,_)}return p}});a.push(d)}catch{const f=Wc(t,l,{set(h){n(this.canvas,{type:e,property:l,args:[h],setter:!0})}});a.push(f)}return a}function XC(t,e,n,r,i,s){const o=[];return o.push(...Kd(e.WebGLRenderingContext.prototype,Nr.WebGL,t,n,r,i,s,e)),typeof e.WebGL2RenderingContext<"u"&&o.push(...Kd(e.WebGL2RenderingContext.prototype,Nr.WebGL2,t,n,r,i,s,e)),()=>{o.forEach(u=>u())}}var JC='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function QC(){const t=new Blob([JC]);return URL.createObjectURL(t)}class ZC{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(d,f)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(d)||this.pendingCanvasMutations.set(d,[]),this.pendingCanvasMutations.get(d).push(f)};const{sampling:n="all",win:r,blockClass:i,blockSelector:s,unblockSelector:o,maxCanvasSize:u,recordCanvas:a,dataURLOptions:c,errorHandler:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,l&&GC(l),!e.enableManualSnapshot&&zd(()=>{a&&n==="all"&&this.initCanvasMutationObserver(r,i,s,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,i,s,o,u,{dataURLOptions:c})})()}initCanvasFPSObserver(e,n,r,i,s,o,u){const a=Vd(n,r,i,s,!0),c=this.takeSnapshot(!1,e,n,r,i,s,o,u.dataURLOptions);this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,n,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Vd(e,n,r,i,!1),o=KC(this.processMutation.bind(this),e,n,r,i),u=XC(this.processMutation.bind(this),e,n,r,i,this.mirror);this.resetObservers=()=>{s(),o(),u()}}snapshot(e){const{options:n}=this,r=this.takeSnapshot(!0,n.sampling==="all"?2:n.sampling||2,n.win,n.blockClass,n.blockSelector,n.unblockSelector,n.maxCanvasSize,n.dataURLOptions,e);this.resetObservers=()=>{cancelAnimationFrame(r)}}takeSnapshot(e,n,r,i,s,o,u,a,c){const l=new Map,d=new Worker(QC());d.onmessage=g=>{const v=g.data,{id:y}=v;if(l.set(y,!1),!("base64"in v))return;const{base64:w,type:R,width:E,height:O}=v;this.mutationCb({id:y,type:Nr["2D"],commands:[{property:"clearRect",args:[0,0,E,O]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:w}],type:R}]},0,0,E,O]}]})};const f=1e3/n;let h=0,p;const m=g=>{if(g)return[g];const v=[];return r.document.querySelectorAll("canvas").forEach(y=>{fa(y,i,s,o)||v.push(y)}),v},_=g=>{if(h&&g-h<f){p=xn(_);return}h=g,m(c).forEach(v=>{const y=this.mirror.getId(v);if(!l.get(y)&&!(!v.width||!v.height)){if(l.set(y,!0),!e&&["webgl","webgl2"].includes(v.__context)){const w=v.getContext(v.__context);no([w,"optionalAccess",R=>R.getContextAttributes,"call",R=>R(),"optionalAccess",R=>R.preserveDrawingBuffer])===!1&&w.clear(w.COLOR_BUFFER_BIT)}createImageBitmap(v).then(w=>{d.postMessage({id:y,bitmap:w,width:v.width,height:v.height,dataURLOptions:a,maxCanvasSize:u},[w])}).catch(w=>{zd(()=>{throw w})()})}}),p=xn(_)};return p=xn(_),p}startPendingCanvasMutationFlusher(){xn(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,xn(e)};xn(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),xn(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;const i=r.map(o=>{const{type:u,...a}=o;return a}),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:i}),this.pendingCanvasMutations.delete(e)}}const Yd={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},__="ReplayCanvas",ws=1280,eR=(t={})=>{const[e,n]=t.maxCanvasSize||[],r={quality:t.quality||"medium",enableManualSnapshot:t.enableManualSnapshot,maxCanvasSize:[e?Math.min(e,ws):ws,n?Math.min(n,ws):ws]};let i;const s=new Promise(o=>i=o);return{name:__,setupOnce(){},getOptions(){const{quality:o,enableManualSnapshot:u,maxCanvasSize:a}=r;return{enableManualSnapshot:u,recordCanvas:!0,getCanvasManager:c=>{const l=new ZC({...c,enableManualSnapshot:u,maxCanvasSize:a,errorHandler:d=>{try{typeof d=="object"&&(d.__rrweb__=!0)}catch{}}});return i(l),l},...Yd[o]||Yd.medium}},async snapshot(o){(await s).snapshot(o)}}},v_=eR,tR=xe(__,v_),Xn=Z,Ua="#ffffff",Xd="inherit",Fa="rgba(108, 95, 199, 1)",Jd={fontFamily:"system-ui, 'Helvetica Neue', Arial, sans-serif",fontSize:"14px",background:Ua,backgroundHover:"#f6f6f7",foreground:"#2b2233",border:"1.5px solid rgba(41, 35, 47, 0.13)",borderRadius:"25px",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",success:"#268d75",error:"#df3338",submitBackground:"rgba(88, 74, 192, 1)",submitBackgroundHover:Fa,submitBorder:Fa,submitOutlineFocus:"#29232f",submitForeground:Ua,submitForegroundHover:Ua,cancelBackground:"transparent",cancelBackgroundHover:"var(--background-hover)",cancelBorder:"var(--border)",cancelOutlineFocus:"var(--input-outline-focus)",cancelForeground:"var(--foreground)",cancelForegroundHover:"var(--foreground)",inputBackground:Xd,inputForeground:Xd,inputBorder:"var(--border)",inputOutlineFocus:Fa,formBorderRadius:"20px",formContentBorderRadius:"6px"},Qd={light:Jd,dark:{...Jd,background:"#29232f",backgroundHover:"#352f3b",foreground:"#ebe6ef",border:"1.5px solid rgba(235, 230, 239, 0.15)",success:"#2da98c",error:"#f55459"}},nR="Report a Bug",rR="Cancel",iR="Send Bug Report",sR="Report a Bug",oR="your.email@example.org",aR="Email",uR="What's the bug? What did you expect?",cR="Description",lR="Your Name",dR="Name",fR="(required)",hR="Thank you for your report!",y_="widget",S_="api";async function pR({client:t,scope:e,event:n}){const r={};t.emit&&t.emit("preprocessEvent",n,r);const i=await lc(t.getOptions(),n,r,e,t,Ut());return i===null?(t.recordDroppedEvent("event_processor","feedback",n),null):(i.platform=i.platform||"javascript",i)}async function gR({feedback:{message:t,email:e,name:n,source:r,url:i}},{includeReplay:s=!0}={}){const o=K(),u=o&&o.getTransport(),a=o&&o.getDsn();if(!o||!u||!a)return;const c={contexts:{feedback:{contact_email:e,name:n,message:t,url:i,source:r}},type:"feedback"};return Tn(async l=>{l.clearBreadcrumbs(),[S_,y_].includes(String(r))&&l.setLevel("info");const d=await pR({scope:l,client:o,event:c});if(!d)return;o.emit&&o.emit("beforeSendFeedback",d,{includeReplay:!!s});const f=ng(d,a,o.getOptions()._metadata,o.getOptions().tunnel);let h;try{h=await u.send(f)}catch(p){const m=new Error("Unable to send Feedback");try{m.cause=p}catch{}throw m}if(h){if(typeof h.statusCode=="number"&&(h.statusCode<200||h.statusCode>=300))throw new Error("Unable to send Feedback");return h}})}function b_({name:t,email:e,message:n,source:r=S_,url:i=op()},s={}){if(!n)throw new Error("Unable to submit feedback with empty message");return gR({feedback:{name:t,email:e,message:n,url:i,source:r}},s)}const Dn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Zd(t,e){return{...t,...e,themeDark:{...t.themeDark,...e.themeDark},themeLight:{...t.themeLight,...e.themeLight}}}function mR(t){const e=t.createElement("style");return e.textContent=`
.widget__actor {
position: fixed;
left: var(--left);
right: var(--right);
bottom: var(--bottom);
top: var(--top);
z-index: var(--z-index);
line-height: 16px;
display: flex;
align-items: center;
gap: 8px;
border-radius: var(--border-radius);
cursor: pointer;
font-family: inherit;
font-size: var(--font-size);
font-weight: 600;
padding: 16px;
text-decoration: none;
z-index: 9000;
color: var(--foreground);
background-color: var(--background);
border: var(--border);
box-shadow: var(--box-shadow);
opacity: 1;
transition: opacity 0.1s ease-in-out;
}
.widget__actor:hover {
background-color: var(--background-hover);
}
.widget__actor svg {
width: 16px;
height: 16px;
}
.widget__actor--hidden {
opacity: 0;
pointer-events: none;
visibility: hidden;
}
.widget__actor__text {
}
@media (max-width: 600px) {
.widget__actor__text {
display: none;
}
}
.feedback-icon path {
fill: var(--foreground);
}
`,e}function _R(t){const e=t.createElement("style");return e.textContent=`
.dialog {
line-height: 25px;
background-color: rgba(0, 0, 0, 0.05);
border: none;
position: fixed;
inset: 0;
z-index: 10000;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
opacity: 1;
transition: opacity 0.2s ease-in-out;
}
.dialog:not([open]) {
opacity: 0;
pointer-events: none;
visibility: hidden;
}
.dialog:not([open]) .dialog__content {
transform: translate(0, -16px) scale(0.98);
}
.dialog__content {
position: fixed;
left: var(--left);
right: var(--right);
bottom: var(--bottom);
top: var(--top);
border: var(--border);
border-radius: var(--form-border-radius);
background-color: var(--background);
color: var(--foreground);
width: 320px;
max-width: 100%;
max-height: calc(100% - 2rem);
display: flex;
flex-direction: column;
box-shadow: var(--box-shadow);
transition: transform 0.2s ease-in-out;
transform: translate(0, 0) scale(1);
}
.dialog__header {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 20px;
font-weight: 600;
padding: 24px 24px 0 24px;
margin: 0;
margin-bottom: 16px;
}
.brand-link {
display: inline-flex;
}
.error {
color: var(--error);
margin-bottom: 16px;
}
.form {
display: grid;
overflow: auto;
flex-direction: column;
gap: 16px;
padding: 0 24px 24px;
}
.form__error-container {
color: var(--error);
}
.form__error-container--hidden {
display: none;
}
.form__label {
display: flex;
flex-direction: column;
gap: 4px;
margin: 0px;
}
.form__label__text {
display: grid;
gap: 4px;
align-items: center;
grid-auto-flow: column;
grid-auto-columns: max-content;
}
.form__label__text--required {
font-size: 0.85em;
}
.form__input {
line-height: inherit;
background-color: var(--input-background);
box-sizing: border-box;
border: var(--input-border);
border-radius: var(--form-content-border-radius);
color: var(--input-foreground);
font-family: inherit;
font-size: var(--font-size);
font-weight: 500;
padding: 6px 12px;
}
.form__input::placeholder {
color: var(--input-foreground);
opacity: 0.65;
}
.form__input:focus-visible {
outline: 1px auto var(--input-outline-focus);
}
.form__input--textarea {
font-family: inherit;
resize: vertical;
}
.btn-group {
display: grid;
gap: 8px;
margin-top: 8px;
}
.btn {
line-height: inherit;
border: var(--cancel-border);
border-radius: var(--form-content-border-radius);
cursor: pointer;
font-family: inherit;
font-size: var(--font-size);
font-weight: 600;
padding: 6px 16px;
}
.btn[disabled] {
opacity: 0.6;
pointer-events: none;
}
.btn--primary {
background-color: var(--submit-background);
border-color: var(--submit-border);
color: var(--submit-foreground);
}
.btn--primary:hover {
background-color: var(--submit-background-hover);
color: var(--submit-foreground-hover);
}
.btn--primary:focus-visible {
outline: 1px auto var(--submit-outline-focus);
}
.btn--default {
background-color: var(--cancel-background);
color: var(--cancel-foreground);
font-weight: 500;
}
.btn--default:hover {
background-color: var(--cancel-background-hover);
color: var(--cancel-foreground-hover);
}
.btn--default:focus-visible {
outline: 1px auto var(--cancel-outline-focus);
}
.success-message {
background-color: var(--background);
border: var(--border);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
font-weight: 600;
color: var(--success);
padding: 12px 24px;
line-height: 25px;
display: grid;
align-items: center;
grid-auto-flow: column;
gap: 6px;
cursor: default;
}
.success-icon path {
fill: var(--success);
}
`,e}function ef(t){return`
--background: ${t.background};
--background-hover: ${t.backgroundHover};
--foreground: ${t.foreground};
--error: ${t.error};
--success: ${t.success};
--border: ${t.border};
--border-radius: ${t.borderRadius};
--box-shadow: ${t.boxShadow};
--submit-background: ${t.submitBackground};
--submit-background-hover: ${t.submitBackgroundHover};
--submit-border: ${t.submitBorder};
--submit-outline-focus: ${t.submitOutlineFocus};
--submit-foreground: ${t.submitForeground};
--submit-foreground-hover: ${t.submitForegroundHover};
--cancel-background: ${t.cancelBackground};
--cancel-background-hover: ${t.cancelBackgroundHover};
--cancel-border: ${t.cancelBorder};
--cancel-outline-focus: ${t.cancelOutlineFocus};
--cancel-foreground: ${t.cancelForeground};
--cancel-foreground-hover: ${t.cancelForegroundHover};
--input-background: ${t.inputBackground};
--input-foreground: ${t.inputForeground};
--input-border: ${t.inputBorder};
--input-outline-focus: ${t.inputOutlineFocus};
--form-border-radius: ${t.formBorderRadius};
--form-content-border-radius: ${t.formContentBorderRadius};
`}function vR(t,e,n){const r=t.createElement("style");return r.textContent=`
:host {
--bottom: 1rem;
--right: 1rem;
--top: auto;
--left: auto;
--z-index: 100000;
--font-family: ${n.light.fontFamily};
--font-size: ${n.light.fontSize};
position: fixed;
left: var(--left);
right: var(--right);
bottom: var(--bottom);
top: var(--top);
z-index: var(--z-index);
font-family: var(--font-family);
font-size: var(--font-size);
${ef(e==="dark"?n.dark:n.light)}
}
${e==="system"?`
@media (prefers-color-scheme: dark) {
:host {
${ef(n.dark)}
}
}`:""}
}`,r}function yR({id:t,colorScheme:e,themeDark:n,themeLight:r}){try{const i=Xn.document,s=i.createElement("div");s.id=t;const o=s.attachShadow({mode:"open"});return o.appendChild(vR(i,e,{dark:n,light:r})),o.appendChild(_R(i)),{shadow:o,host:s}}catch{throw A.warn("[Feedback] Browser does not support shadow DOM API"),new Error("Browser does not support shadow DOM API.")}}async function SR(t,e,n){if(!t)return;const r=()=>{t&&t.showError("There was a problem submitting feedback, please wait and try again.")};t.hideError();try{return await b_({...e,source:y_},n)}catch(i){Dn&&A.error(i),r()}}function st(t,e){return Object.entries(e).forEach(([n,r])=>{t.setAttributeNS(null,n,r)}),t}const rr=20,bR="http://www.w3.org/2000/svg";function ER(){const t=u=>Xn.document.createElementNS(bR,u),e=st(t("svg"),{class:"feedback-icon",width:`${rr}`,height:`${rr}`,viewBox:`0 0 ${rr} ${rr}`,fill:"none"}),n=st(t("g"),{clipPath:"url(#clip0_57_80)"}),r=st(t("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});e.appendChild(n).appendChild(r);const i=t("defs"),s=st(t("clipPath"),{id:"clip0_57_80"}),o=st(t("rect"),{width:`${rr}`,height:`${rr}`,fill:"white"});return s.appendChild(o),i.appendChild(s),e.appendChild(i).appendChild(s).appendChild(o),{get el(){return e}}}function Te(t,e,...n){const i=Xn.document.createElement(t);e&&Object.entries(e).forEach(([s,o])=>{s==="className"&&typeof o=="string"?i.setAttribute("class",o):typeof o=="boolean"&&o?i.setAttribute(s,""):typeof o=="string"?i.setAttribute(s,o):s.startsWith("on")&&typeof o=="function"&&i.addEventListener(s.substring(2).toLowerCase(),o)});for(const s of n)E_(i,s);return i}function E_(t,e){const n=Xn.document;if(!(typeof e>"u"||e===null))if(Array.isArray(e))for(const r of e)E_(t,r);else e===!1||(typeof e=="string"?t.appendChild(n.createTextNode(e)):e instanceof Node?t.appendChild(e):t.appendChild(n.createTextNode(String(e))))}function TR({buttonLabel:t,onClick:e}){function n(i){e&&e(i)}const r=Te("button",{type:"button",className:"widget__actor","aria-label":t,"aria-hidden":"false"},ER().el,t?Te("span",{className:"widget__actor__text"},t):null);return r.addEventListener("click",n),{get el(){return r},show:()=>{r.classList.remove("widget__actor--hidden"),r.setAttribute("aria-hidden","false")},hide:()=>{r.classList.add("widget__actor--hidden"),r.setAttribute("aria-hidden","true")}}}function IR({label:t}){return{el:Te("button",{type:"submit",className:"btn btn--primary","aria-label":t},t)}}function Ba(t,e){const n=t.get(e);return typeof n=="string"?n.trim():""}function wR({nameLabel:t,namePlaceholder:e,emailLabel:n,emailPlaceholder:r,messageLabel:i,messagePlaceholder:s,isRequiredLabel:o,cancelButtonLabel:u,submitButtonLabel:a,showName:c,showEmail:l,isNameRequired:d,isEmailRequired:f,defaultName:h,defaultEmail:p,onCancel:m,onSubmit:_}){const{el:g}=IR({label:a});function v(C){if(C.preventDefault(),C.target instanceof HTMLFormElement)try{if(_){const k=new FormData(C.target),I={name:Ba(k,"name"),email:Ba(k,"email"),message:Ba(k,"message")};_(I)}}catch{}}const y=Te("div",{className:"form__error-container form__error-container--hidden","aria-hidden":"true"});function w(C){y.textContent=C,y.classList.remove("form__error-container--hidden"),y.setAttribute("aria-hidden","false")}function R(){y.textContent="",y.classList.add("form__error-container--hidden"),y.setAttribute("aria-hidden","true")}const E=Te("input",{id:"name",type:c?"text":"hidden","aria-hidden":c?"false":"true",name:"name",required:d,className:"form__input",placeholder:e,value:h}),O=Te("input",{id:"email",type:l?"text":"hidden","aria-hidden":l?"false":"true",name:"email",required:f,className:"form__input",placeholder:r,value:p}),T=Te("textarea",{id:"message",autoFocus:"true",rows:"5",name:"message",required:!0,className:"form__input form__input--textarea",placeholder:s}),S=Te("button",{type:"button",className:"btn btn--default","aria-label":u,onClick:C=>{m&&m(C)}},u),b=Te("form",{className:"form",onSubmit:v},[y,c&&Te("label",{htmlFor:"name",className:"form__label"},[Te("span",{className:"form__label__text"},t,d&&Te("span",{className:"form__label__text--required"},` ${o}`)),E]),!c&&E,l&&Te("label",{htmlFor:"email",className:"form__label"},[Te("span",{className:"form__label__text"},n,f&&Te("span",{className:"form__label__text--required"},` ${o}`)),O]),!l&&O,Te("label",{htmlFor:"message",className:"form__label"},[Te("span",{className:"form__label__text"},i,Te("span",{className:"form__label__text--required"},` ${o}`)),T]),Te("div",{className:"btn-group"},[g,S])]);return{get el(){return b},showError:w,hideError:R}}const CR="http://www.w3.org/2000/svg";function RR({colorScheme:t}){const e=o=>Xn.document.createElementNS(CR,o),n=st(e("svg"),{class:"sentry-logo",width:"32",height:"30",viewBox:"0 0 72 66",fill:"none"}),r=st(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});n.append(r);const i=e("defs"),s=e("style");return s.textContent=`
path {
fill: ${t==="dark"?"#fff":"#362d59"};
}`,t==="system"&&(s.textContent+=`
@media (prefers-color-scheme: dark) {
path: {
fill: '#fff';
}
}
`),i.append(s),n.append(i),{get el(){return n}}}function kR({formTitle:t,showBranding:e,showName:n,showEmail:r,isNameRequired:i,isEmailRequired:s,colorScheme:o,defaultName:u,defaultEmail:a,onClosed:c,onCancel:l,onSubmit:d,...f}){let h=null;function p(){m(),c&&c()}function m(){h&&(h.open=!1)}function _(){h&&(h.open=!0)}function g(){return h&&h.open===!0||!1}const{el:v,showError:y,hideError:w}=wR({showEmail:r,showName:n,isEmailRequired:s,isNameRequired:i,defaultName:u,defaultEmail:a,onSubmit:d,onCancel:l,...f});return h=Te("dialog",{className:"dialog",open:!0,onClick:p},Te("div",{className:"dialog__content",onClick:R=>{R.stopPropagation()}},Te("h2",{className:"dialog__header"},t,e&&Te("a",{className:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer"},RR({colorScheme:o}).el)),v)),{get el(){return h},showError:y,hideError:w,open:_,close:m,checkIsOpen:g}}const Cs=16,tf=17,xR="http://www.w3.org/2000/svg";function OR(){const t=a=>Xn.document.createElementNS(xR,a),e=st(t("svg"),{class:"success-icon",width:`${Cs}`,height:`${tf}`,viewBox:`0 0 ${Cs} ${tf}`,fill:"none"}),n=st(t("g"),{clipPath:"url(#clip0_57_156)"}),r=st(t("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),i=st(t("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});e.appendChild(n).append(i,r);const s=t("defs"),o=st(t("clipPath"),{id:"clip0_57_156"}),u=st(t("rect"),{width:`${Cs}`,height:`${Cs}`,fill:"white",transform:"translate(0 0.5)"});return o.appendChild(u),s.appendChild(o),e.appendChild(s).appendChild(o).appendChild(u),{get el(){return e}}}function AR({message:t,onRemove:e}){function n(){r&&(r.remove(),e&&e())}const r=Te("div",{className:"success-message",onClick:n},OR().el,t);return{el:r,remove:n}}function nf({shadow:t,options:{shouldCreateActor:e=!0,...n},attachTo:r}){let i,s,o=!1;function u(){if(t)try{const g=AR({message:n.successMessageText,onRemove:()=>{v&&clearTimeout(v),l()}});if(!g.el)throw new Error("Unable to show success message");t.appendChild(g.el);const v=setTimeout(()=>{g&&g.remove()},5e3)}catch(g){A.error(g)}}async function a(g){if(!s)return;const v=[];if(n.isNameRequired&&!g.name&&v.push(n.nameLabel),n.isEmailRequired&&!g.email&&v.push(n.emailLabel),g.message||v.push(n.messageLabel),v.length>0){s.showError(`Please enter in the following required fields: ${v.join(", ")}`);return}if(!await SR(s,g)){n.onSubmitError&&n.onSubmitError();return}m(),u(),n.onSubmitSuccess&&n.onSubmitSuccess()}function c(){const g=K(),v=g&&g.getIntegrationByName&&g.getIntegrationByName("Replay");v&&v.flush().catch(y=>{Dn&&A.error(y)})}function l(){i&&i.show()}function d(){i&&i.hide()}function f(){i&&i.el&&i.el.remove()}function h(){try{if(s){s.open(),o=!0,n.onFormOpen&&n.onFormOpen(),c();return}const g=n.useSentryUser,v=Ae(),y=v&&v.getUser();if(s=kR({colorScheme:n.colorScheme,showBranding:n.showBranding,showName:n.showName||n.isNameRequired,showEmail:n.showEmail||n.isEmailRequired,isNameRequired:n.isNameRequired,isEmailRequired:n.isEmailRequired,formTitle:n.formTitle,cancelButtonLabel:n.cancelButtonLabel,submitButtonLabel:n.submitButtonLabel,emailLabel:n.emailLabel,emailPlaceholder:n.emailPlaceholder,messageLabel:n.messageLabel,messagePlaceholder:n.messagePlaceholder,nameLabel:n.nameLabel,namePlaceholder:n.namePlaceholder,isRequiredLabel:n.isRequiredLabel,defaultName:g&&y&&y[g.name]||"",defaultEmail:g&&y&&y[g.email]||"",onClosed:()=>{l(),o=!1,n.onFormClose&&n.onFormClose()},onCancel:()=>{p(),l()},onSubmit:a}),!s.el)throw new Error("Unable to open Feedback dialog");t.appendChild(s.el),d(),n.onFormOpen&&n.onFormOpen(),c()}catch(g){A.error(g)}}function p(){s&&(s.close(),o=!1,n.onFormClose&&n.onFormClose())}function m(){if(s){p();const g=s.el;g&&g.remove(),s=void 0}}function _(){o||h(),d()}return r?r.addEventListener("click",_):e&&(i=TR({buttonLabel:n.buttonLabel,onClick:_}),i.el&&t.appendChild(i.el)),{get actor(){return i},get dialog(){return s},showActor:l,hideActor:d,removeActor:f,openDialog:h,closeDialog:p,removeDialog:m}}const Rs=Xn.document,DR=t=>new Qi(t);class Qi{static __initStatic(){this.id="Feedback"}constructor({autoInject:e=!0,id:n="sentry-feedback",isEmailRequired:r=!1,isNameRequired:i=!1,showBranding:s=!0,showEmail:o=!0,showName:u=!0,useSentryUser:a={email:"email",name:"username"},themeDark:c,themeLight:l,colorScheme:d="system",buttonLabel:f=nR,cancelButtonLabel:h=rR,submitButtonLabel:p=iR,formTitle:m=sR,emailPlaceholder:_=oR,emailLabel:g=aR,messagePlaceholder:v=uR,messageLabel:y=cR,namePlaceholder:w=lR,nameLabel:R=dR,isRequiredLabel:E=fR,successMessageText:O=hR,onFormClose:T,onFormOpen:S,onSubmitError:b,onSubmitSuccess:C}={}){this.name=Qi.id,this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1,this.options={autoInject:e,showBranding:s,id:n,isEmailRequired:r,isNameRequired:i,showEmail:o,showName:u,useSentryUser:a,colorScheme:d,themeDark:{...Qd.dark,...c},themeLight:{...Qd.light,...l},buttonLabel:f,cancelButtonLabel:h,submitButtonLabel:p,formTitle:m,emailLabel:g,emailPlaceholder:_,messageLabel:y,messagePlaceholder:v,nameLabel:R,namePlaceholder:w,isRequiredLabel:E,successMessageText:O,onFormClose:T,onFormOpen:S,onSubmitError:b,onSubmitSuccess:C}}setupOnce(){if(cu())try{this._cleanupWidgetIfExists();const{autoInject:e}=this.options;if(!e)return;this._createWidget(this.options)}catch(e){Dn&&A.error(e)}}openDialog(){this._widget||this._createWidget({...this.options,shouldCreateActor:!1}),this._widget&&this._widget.openDialog()}closeDialog(){this._widget&&this._widget.closeDialog()}attachTo(e,n){try{const r=Zd(this.options,n||{});return this._ensureShadowHost(r,({shadow:i})=>{const s=typeof e=="string"?Rs.querySelector(e):typeof e.addEventListener=="function"?e:null;if(!s)return Dn&&A.error("[Feedback] Unable to attach to target element"),null;const o=nf({shadow:i,options:r,attachTo:s});return this._widgets.add(o),this._widget||(this._widget=o),o})}catch(r){return Dn&&A.error(r),null}}createWidget(e){try{return this._createWidget(Zd(this.options,e||{}))}catch(n){return Dn&&A.error(n),null}}removeWidget(e){if(!e)return!1;try{if(this._widgets.has(e))return e.removeActor(),e.removeDialog(),this._widgets.delete(e),this._widget===e&&(this._widget=null),!0}catch(n){Dn&&A.error(n)}return!1}getWidget(){return this._widget}remove(){this._host&&this._host.remove(),this._initialize()}_initialize(){this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1}_cleanupWidgetIfExists(){this._host&&this.remove();const e=Rs.querySelector(`#${this.options.id}`);e&&e.remove()}_createWidget(e){return this._ensureShadowHost(e,({shadow:n})=>{const r=nf({shadow:n,options:e});return!this._hasInsertedActorStyles&&r.actor&&(n.appendChild(mR(Rs)),this._hasInsertedActorStyles=!0),this._widgets.add(r),this._widget||(this._widget=r),r})}_ensureShadowHost(e,n){let r=!1;if(!this._shadow||!this._host){const{id:s,colorScheme:o,themeLight:u,themeDark:a}=e,{shadow:c,host:l}=yR({id:s,colorScheme:o,themeLight:u,themeDark:a});this._shadow=c,this._host=l,r=!0}this._host.dataset.sentryFeedbackColorscheme=e.colorScheme;const i=n({shadow:this._shadow,host:this._host});return r&&Rs.body.appendChild(this._host),i}}Qi.__initStatic();const T_="CaptureConsole",MR=(t={})=>{const e=t.levels||ho;return{name:T_,setupOnce(){},setup(n){"console"in Z&&mp(({args:r,level:i})=>{K()!==n||!e.includes(i)||LR(r,i)})}}},I_=MR;xe(T_,I_);function LR(t,e){const n={level:wp(e),extra:{arguments:t}};Tn(r=>{if(r.addEventProcessor(o=>(o.logger="console",jn(o,{handled:!1,type:"console"}),o)),e==="assert"&&t[0]===!1){const o=`Assertion failed: ${fo(t.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",t.slice(1)),_o(o,n);return}const i=t.find(o=>o instanceof Error);if(e==="error"&&i){Hi(i,n);return}const s=fo(t," ");_o(s,n)})}const w_="Debug",NR=(t={})=>{const e={debugger:!1,stringify:!1,...t};return{name:w_,setupOnce(){},setup(n){n.on&&n.on("beforeSendEvent",(r,i)=>{if(e.debugger)debugger;yn(()=>{e.stringify?(console.log(JSON.stringify(r,null,2)),i&&Object.keys(i).length&&console.log(JSON.stringify(i,null,2))):(console.log(r),i&&Object.keys(i).length&&console.log(i))})})}}},C_=NR;xe(w_,C_);const Pr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,R_="Dedupe",PR=()=>{let t;return{name:R_,setupOnce(){},processEvent(e){if(e.type)return e;try{if($R(e,t))return Pr&&A.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},k_=PR;xe(R_,k_);function $R(t,e){return e?!!(UR(t,e)||FR(t,e)):!1}function UR(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!O_(t,e)||!x_(t,e))}function FR(t,e){const n=rf(e),r=rf(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!O_(t,e)||!x_(t,e))}function x_(t,e){let n=sf(t),r=sf(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++){const s=r[i],o=n[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function O_(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 rf(t){return t.exception&&t.exception.values&&t.exception.values[0]}function sf(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const A_="ExtraErrorData",BR=(t={})=>{const e=t.depth||3,n=t.captureErrorCause||!1;return{name:A_,setupOnce(){},processEvent(r,i){return HR(r,i,e,n)}}},D_=BR;xe(A_,D_);function HR(t,e={},n,r){if(!e.originalException||!br(e.originalException))return t;const i=e.originalException.name||e.originalException.constructor.name,s=jR(e.originalException,r);if(s){const o={...t.contexts},u=vt(s,n);return Hn(u)&&(Sn(u,"__sentry_skip_normalization__",!0),o[i]=u),{...t,contexts:o}}return t}function jR(t,e){try{const n=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],r={};for(const i of Object.keys(t)){if(n.indexOf(i)!==-1)continue;const s=t[i];r[i]=br(s)?s.toString():s}if(e&&t.cause!==void 0&&(r.cause=br(t.cause)?t.cause.toString():t.cause),typeof t.toJSON=="function"){const i=t.toJSON();for(const s of Object.keys(i)){const o=i[s];r[s]=br(o)?o.toString():o}}return r}catch(n){Pr&&A.error("Unable to extract extra data from the Error object:",n)}return null}function qM(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const qR=Z,M_="ReportingObserver",of=new WeakMap,GR=(t={})=>{const e=t.types||["crash","deprecation","intervention"];function n(r){if(of.has(K()))for(const i of r)Tn(s=>{s.setExtra("url",i.url);const o=`ReportingObserver [${i.type}]`;let u="No details available";if(i.body){const a={};for(const c in i.body)a[c]=i.body[c];if(s.setExtra("body",a),i.type==="crash"){const c=i.body;u=[c.crashId||"",c.reason||""].join(" ").trim()||u}else u=i.body.message||u}_o(`${o}: ${u}`)})}return{name:M_,setupOnce(){if(!Fy())return;new qR.ReportingObserver(n,{buffered:!0,types:e}).observe()},setup(r){of.set(r,!0)}}},L_=GR;xe(M_,L_);const N_="RewriteFrames",zR=(t={})=>{const e=t.root,n=t.prefix||"app:///",r=t.iteratee||(o=>{if(!o.filename)return o;const u=/^[a-zA-Z]:\\/.test(o.filename)||o.filename.includes("\\")&&!o.filename.includes("/"),a=/^\//.test(o.filename);if(u||a){const c=u?o.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):o.filename,l=e?aS(e,c):uS(c);o.filename=`${n}${l}`}return o});function i(o){try{return{...o,exception:{...o.exception,values:o.exception.values.map(u=>({...u,...u.stacktrace&&{stacktrace:s(u.stacktrace)}}))}}}catch{return o}}function s(o){return{...o,frames:o&&o.frames&&o.frames.map(u=>r(u))}}return{name:N_,setupOnce(){},processEvent(o){let u=o;return o.exception&&Array.isArray(o.exception.values)&&(u=i(u)),u}}},P_=zR;xe(N_,P_);const $_="SessionTiming",WR=()=>{const t=Date.now();return{name:$_,setupOnce(){},processEvent(e){const n=Date.now();return{...e,extra:{...e.extra,"session:start":t,"session:duration":n-t,"session:end":n}}}}},U_=WR;xe($_,U_);const F_="HttpClient",VR=(t={})=>{const e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:F_,setupOnce(){},setup(n){tk(n,e),nk(n,e)}}},B_=VR;xe(F_,B_);function KR(t,e,n,r){if(j_(t,n.status,n.url)){const i=rk(e,r);let s,o,u,a;G_()&&([{headers:s,cookies:u},{headers:o,cookies:a}]=[{cookieHeader:"Cookie",obj:i},{cookieHeader:"Set-Cookie",obj:n}].map(({cookieHeader:l,obj:d})=>{const f=JR(d.headers);let h;try{const p=f[l]||f[l.toLowerCase()]||void 0;p&&(h=H_(p))}catch{Pr&&A.log(`Could not extract cookies from header ${l}`)}return{headers:f,cookies:h}}));const c=q_({url:i.url,method:i.method,status:n.status,requestHeaders:s,responseHeaders:o,requestCookies:u,responseCookies:a});ji(c)}}function YR(t,e,n,r){if(j_(t,e.status,e.responseURL)){let i,s,o;if(G_()){try{const a=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;a&&(s=H_(a))}catch{Pr&&A.log("Could not extract cookies from response headers")}try{o=QR(e)}catch{Pr&&A.log("Could not extract headers from response")}i=r}const u=q_({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:o,responseCookies:s});ji(u)}}function XR(t){if(t){const e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function H_(t){return t.split("; ").reduce((e,n)=>{const[r,i]=n.split("=");return e[r]=i,e},{})}function JR(t){const e={};return t.forEach((n,r)=>{e[r]=n}),e}function QR(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
`).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i]=s,n},{}):{}}function ZR(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function ek(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function tk(t,e){bp()&&Xo(n=>{if(K()!==t)return;const{response:r,args:i}=n,[s,o]=i;r&&KR(e,s,r,o)})}function nk(t,e){"XMLHttpRequest"in Z&&Jo(n=>{if(K()!==t)return;const r=n.xhr,i=r[Xt];if(!i)return;const{method:s,request_headers:o}=i;try{YR(e,r,s,o)}catch(u){Pr&&A.warn("Error while extracting response event form XHR response",u)}})}function j_(t,e,n){return ek(t.failedRequestStatusCodes,e)&&ZR(t.failedRequestTargets,n)&&!pg(n,K())}function q_(t){const e=`HTTP Client Error with status code: ${t.status}`,n={message:e,exception:{values:[{type:"Error",value:e}]},request:{url:t.url,method:t.method,headers:t.requestHeaders,cookies:t.requestCookies},contexts:{response:{status_code:t.status,headers:t.responseHeaders,cookies:t.responseCookies,body_size:XR(t.responseHeaders)}}};return jn(n,{type:"http.client",handled:!1}),n}function rk(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}function G_(){const t=K();return t?!!t.getOptions().sendDefaultPii:!1}const Ha=Z,ik=7,z_="ContextLines",sk=(t={})=>{const e=t.frameContextLines!=null?t.frameContextLines:ik;return{name:z_,setupOnce(){},processEvent(n){return ok(n,e)}}},W_=sk;xe(z_,W_);function ok(t,e){const n=Ha.document,r=Ha.location&&lS(Ha.location.href);if(!n||!r)return t;const i=t.exception&&t.exception.values;if(!i||!i.length)return t;const s=n.documentElement.innerHTML;if(!s)return t;const o=["<!DOCTYPE html>","<html>",...s.split(`
`),"</html>"];return i.forEach(u=>{const a=u.stacktrace;a&&a.frames&&(a.frames=a.frames.map(c=>ak(c,o,r,e)))}),t}function ak(t,e,n,r){return t.filename!==n||!t.lineno||!e.length||My(e,t,r),t}function Li(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function uk(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const r=Li(n);return i=>r.then(s=>i(s.transaction(e,"readwrite").objectStore(e)))}function V_(t){return Li(t.getAllKeys())}function ck(t,e,n){return t(r=>V_(r).then(i=>{if(!(i.length>=n))return r.put(e,Math.max(...i,0)+1),Li(r.transaction)}))}function lk(t){return t(e=>V_(e).then(n=>{if(n.length!==0)return Li(e.get(n[0])).then(r=>(e.delete(n[0]),Li(e.transaction).then(()=>r)))}))}function dk(t){let e;function n(){return e==null&&(e=uk(t.dbName||"sentry-offline",t.storeName||"queue")),e}return{insert:async r=>{try{const i=await Ap(r,t.textEncoder);await ck(n(),i,t.maxQueueSize||30)}catch{}},pop:async()=>{try{const r=await lk(n());if(r)return bS(r,t.textEncoder||new TextEncoder,t.textDecoder||new TextDecoder)}catch{}}}}function fk(t){return e=>t({...e,createStore:dk})}function hk(t){return fk(db(t))}const af=1e6,oo=String(0),pk="main";let K_="",Y_="",X_="",Du=V.navigator&&V.navigator.userAgent||"",J_="";const gk=V.navigator&&V.navigator.language||V.navigator&&V.navigator.languages&&V.navigator.languages[0]||"";function mk(t){return typeof t=="object"&&t!==null&&"getHighEntropyValues"in t}const uf=V.navigator&&V.navigator.userAgentData;mk(uf)&&uf.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(t=>{if(K_=t.platform||"",X_=t.architecture||"",J_=t.model||"",Y_=t.platformVersion||"",t.fullVersionList&&t.fullVersionList.length>0){const e=t.fullVersionList[t.fullVersionList.length-1];Du=`${e.brand} ${e.version}`}}).catch(t=>{});function _k(t){return!("thread_metadata"in t)}function vk(t){return _k(t)?bk(t):t}function yk(t){const e=t&&t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id;return typeof e=="string"&&e.length!==32&&le&&A.log(`[Profiling] Invalid traceId: ${e} on profiled event`),typeof e!="string"?"":e}function Sk(t,e,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const i=yk(r),s=vk(n),o=e||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Date.now()),u=typeof r.timestamp=="number"?r.timestamp*1e3:Date.now();return{event_id:t,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Bi,runtime:{name:"javascript",version:V.navigator.userAgent},os:{name:K_,version:Y_,build_number:Du},device:{locale:gk,model:J_,manufacturer:Du,architecture:X_,is_emulator:!1},debug_meta:{images:Ik(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||he(),trace_id:i,active_thread_id:oo,relative_start_ns:"0",relative_end_ns:((u-o)*1e6).toFixed(0)}]}}function Q_(t){return t.op==="pageload"}function bk(t){let e,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[oo]:{name:pk}}};if(!t.samples.length)return r;const i=t.samples[0].timestamp,s=typeof performance.timeOrigin=="number"?performance.timeOrigin:Xe||0,o=s-(Xe||s);for(let u=0;u<t.samples.length;u++){const a=t.samples[u];if(a.stackId===void 0){e===void 0&&(e=n,r.stacks[e]=[],n++),r.samples[u]={elapsed_since_start_ns:((a.timestamp+o-i)*af).toFixed(0),stack_id:e,thread_id:oo};continue}let c=t.stacks[a.stackId];const l=[];for(;c;){l.push(c.frameId);const f=t.frames[c.frameId];r.frames[c.frameId]===void 0&&(r.frames[c.frameId]={function:f.name,abs_path:typeof f.resourceId=="number"?t.resources[f.resourceId]:void 0,lineno:f.line,colno:f.column}),c=c.parentId===void 0?void 0:t.stacks[c.parentId]}const d={elapsed_since_start_ns:((a.timestamp+o-i)*af).toFixed(0),stack_id:n,thread_id:oo};r.stacks[n]=l,r.samples[u]=d,n++}return r}function Ek(t,e){if(!e.length)return t;for(const n of e)t[1].push([{type:"profile"},n]);return t}function Tk(t){const e=[];return kr(t,(n,r)=>{if(r==="transaction")for(let i=1;i<n.length;i++){const s=n[i];s&&s.contexts&&s.contexts.profile&&s.contexts.profile.profile_id&&e.push(n[i])}}),e}const cf=new WeakMap;function Ik(t){const e=Z._sentryDebugIds;if(!e)return[];const n=K(),r=n&&n.getOptions(),i=r&&r.stackParser;if(!i)return[];let s;const o=cf.get(i);o?s=o:(s=new Map,cf.set(i,s));const u=Object.keys(e).reduce((c,l)=>{let d;const f=s.get(l);f?d=f:(d=i(l),s.set(l,d));for(let h=d.length-1;h>=0;h--){const p=d[h],m=p&&p.filename;if(p&&m){c[m]=e[l];break}}return c},{}),a=[];for(const c of t)c&&u[c]&&a.push({type:"sourcemap",code_file:c,debug_id:u[c]});return a}function wk(t){return typeof t!="number"&&typeof t!="boolean"||typeof t=="number"&&isNaN(t)?(le&&A.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t===!0||t===!1?!0:t<0||t>1?(le&&A.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function Ck(t){return t.samples.length<2?(le&&A.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):t.frames.length?!0:(le&&A.log("[Profiling] Discarding profile because it contains no frames"),!1)}let Z_=!1;const ev=3e4;function Rk(t){return typeof t=="function"}function kk(){const t=V.Profiler;if(!Rk(t)){le&&A.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const e=10,n=Math.floor(ev/e);try{return new t({sampleInterval:e,maxBufferSize:n})}catch{le&&(A.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),A.log("[Profiling] Disabling profiling for current user session.")),Z_=!0}}function Mu(t){if(Z_)return le&&A.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!t.isRecording())return le&&A.log("[Profiling] Discarding profile because transaction was not sampled."),!1;const e=K(),n=e&&e.getOptions();if(!n)return le&&A.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return wk(r)?r?(r===!0?!0:Math.random()<r)?!0:(le&&A.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(le&&A.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(le&&A.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function xk(t,e,n,r){return Ck(n)?Sk(t,e,n,r):null}const $n=new Map;function Ok(){return $n.size}function Ak(t){const e=$n.get(t);return e&&$n.delete(t),e}function Dk(t,e){if($n.set(t,e),$n.size>30){const n=$n.keys().next().value;$n.delete(n)}}function Mk(t){return t?Mu(t)?Lu(t):t:(le&&A.log("[Profiling] Transaction is undefined, skipping profiling"),t)}function Lu(t){let e;Q_(t)&&(e=tn()*1e3);const n=kk();if(!n)return t;le&&A.log(`[Profiling] started profiling transaction: ${pe(t).description}`);const r=he();async function i(){return!t||!n?null:n.stop().then(a=>(s&&(V.clearTimeout(s),s=void 0),le&&A.log(`[Profiling] stopped profiling of transaction: ${pe(t).description}`),a?(Dk(r,a),null):(le&&A.log(`[Profiling] profiler returned null profile for: ${pe(t).description}`,"this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started"),null))).catch(a=>(le&&A.log("[Profiling] error while stopping profiler:",a),null))}let s=V.setTimeout(()=>{le&&A.log("[Profiling] max profile duration elapsed, stopping profiling for:",pe(t).description),i()},ev);const o=t.end.bind(t);function u(){return t?(i().then(()=>{t.setContext("profile",{profile_id:r,start_timestamp:e}),o()},()=>{o()}),t):o()}return t.end=u,t}const tv="BrowserProfiling",Lk=()=>({name:tv,setupOnce(){},setup(t){const n=Ae().getTransaction();if(n&&Q_(n)&&Mu(n)&&Lu(n),typeof t.on!="function"){A.warn("[Profiling] Client does not support hooks, profiling will be disabled");return}t.on("startTransaction",r=>{Mu(r)&&Lu(r)}),t.on("beforeEnvelope",r=>{if(!Ok())return;const i=Tk(r);if(!i.length)return;const s=[];for(const o of i){const u=o&&o.contexts,a=u&&u.profile&&u.profile.profile_id,c=u&&u.profile&&u.profile.start_timestamp;if(typeof a!="string"){le&&A.log("[Profiling] cannot find profile for a transaction without a profile context");continue}if(!a){le&&A.log("[Profiling] cannot find profile for a transaction without a profile context");continue}u&&u.profile&&delete u.profile;const l=Ak(a);if(!l){le&&A.log(`[Profiling] Could not retrieve profile for transaction: ${a}`);continue}const d=xk(a,c,l,o);d&&s.push(d)}Ek(r,s)})}}),nv=Lk,Nk=xe(tv,nv);let rv={};V.Sentry&&V.Sentry.Integrations&&(rv=V.Sentry.Integrations);const Pk={...rv,...eE,...mI},GM=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumbs:sm,BrowserClient:Yg,BrowserProfilingIntegration:Nk,BrowserTracing:JE,Dedupe:um,Feedback:Qi,FunctionToString:Eg,GlobalHandlers:fm,HttpContext:mm,Hub:fc,InboundFilters:Sg,Integrations:Pk,LinkedErrors:vm,ModuleMetadata:Cb,Replay:Ji,ReplayCanvas:tR,SDK_VERSION:yo,SEMANTIC_ATTRIBUTE_SENTRY_OP:hi,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:Nn,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:Ln,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:ot,Scope:Or,TryCatch:Sm,WINDOW:V,addBreadcrumb:nn,addEventProcessor:ug,addGlobalEventProcessor:Pp,addIntegration:$0,addTracingExtensions:gc,breadcrumbsIntegration:Rc,browserApiErrorsIntegration:Ac,browserProfilingIntegration:nv,browserTracingIntegration:nT,captureConsoleIntegration:I_,captureEvent:ji,captureException:Hi,captureMessage:_o,captureSession:gu,captureUserFeedback:gI,chromeStackLineParser:Qg,close:QS,configureScope:qS,contextLinesIntegration:W_,continueTrace:v0,createTransport:_c,createUserFeedbackEnvelope:Kg,debugIntegration:C_,dedupeIntegration:k_,defaultIntegrations:bm,defaultRequestInstrumentationOptions:xi,defaultStackLineParsers:tm,defaultStackParser:nm,endSession:dc,eventFromException:Wg,eventFromMessage:Vg,exceptionFromError:Ic,extraErrorDataIntegration:D_,extractTraceparentData:d0,feedbackIntegration:DR,flush:JS,forceLoad:dI,functionToStringIntegration:yc,geckoStackLineParser:Zg,getActiveSpan:qi,getActiveTransaction:$t,getClient:K,getCurrentHub:ge,getCurrentScope:Ae,getDefaultIntegrations:Em,getHubFromCarrier:So,getReplay:HC,getSpanStatusFromHttpCode:hc,globalHandlersIntegration:kc,httpClientIntegration:B_,httpContextIntegration:xc,inboundFiltersIntegration:vc,init:Tm,instrumentOutgoingRequests:Tc,isInitialized:e0,lastEventId:ZS,linkedErrorsIntegration:Oc,makeBrowserOfflineTransport:hk,makeFetchTransport:Xg,makeMain:mu,makeMultiplexedTransport:pb,makeXHRTransport:Jg,metrics:Zb,moduleMetadataIntegration:vg,onLoad:fI,onProfilingStartRouteTransaction:Mk,opera10StackLineParser:MT,opera11StackLineParser:PT,parameterize:Sb,replayCanvasIntegration:v_,replayIntegration:FC,reportingObserverIntegration:L_,rewriteFramesIntegration:P_,sendFeedback:b_,sessionTimingIntegration:U_,setContext:Bp,setCurrentClient:fg,setExtra:zS,setExtras:GS,setHttpStatus:na,setMeasurement:tg,setTag:VS,setTags:WS,setUser:KS,showReportDialog:lI,spanStatusfromHttpCode:h0,startBrowserTracingNavigationSpan:Gg,startBrowserTracingPageLoadSpan:qg,startInactiveSpan:Ir,startSession:pu,startSpan:m0,startSpanManual:_0,startTransaction:XS,trace:g0,winjsStackLineParser:em,withActiveSpan:hu,withIsolationScope:YS,withScope:Tn,wrap:hI},Symbol.toStringTag,{value:"Module"}));function zM(t){const e={...t};gg(e,"react"),Tm(e)}var ja={exports:{}},fe={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var lf;function $k(){if(lf)return fe;lf=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,u=t?Symbol.for("react.context"):60110,a=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,l=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,m=t?Symbol.for("react.block"):60121,_=t?Symbol.for("react.fundamental"):60117,g=t?Symbol.for("react.responder"):60118,v=t?Symbol.for("react.scope"):60119;function y(R){if(typeof R=="object"&&R!==null){var E=R.$$typeof;switch(E){case e:switch(R=R.type,R){case a:case c:case r:case s:case i:case d:return R;default:switch(R=R&&R.$$typeof,R){case u:case l:case p:case h:case o:return R;default:return E}}case n:return E}}}function w(R){return y(R)===c}return fe.AsyncMode=a,fe.ConcurrentMode=c,fe.ContextConsumer=u,fe.ContextProvider=o,fe.Element=e,fe.ForwardRef=l,fe.Fragment=r,fe.Lazy=p,fe.Memo=h,fe.Portal=n,fe.Profiler=s,fe.StrictMode=i,fe.Suspense=d,fe.isAsyncMode=function(R){return w(R)||y(R)===a},fe.isConcurrentMode=w,fe.isContextConsumer=function(R){return y(R)===u},fe.isContextProvider=function(R){return y(R)===o},fe.isElement=function(R){return typeof R=="object"&&R!==null&&R.$$typeof===e},fe.isForwardRef=function(R){return y(R)===l},fe.isFragment=function(R){return y(R)===r},fe.isLazy=function(R){return y(R)===p},fe.isMemo=function(R){return y(R)===h},fe.isPortal=function(R){return y(R)===n},fe.isProfiler=function(R){return y(R)===s},fe.isStrictMode=function(R){return y(R)===i},fe.isSuspense=function(R){return y(R)===d},fe.isValidElementType=function(R){return typeof R=="string"||typeof R=="function"||R===r||R===c||R===s||R===i||R===d||R===f||typeof R=="object"&&R!==null&&(R.$$typeof===p||R.$$typeof===h||R.$$typeof===o||R.$$typeof===u||R.$$typeof===l||R.$$typeof===_||R.$$typeof===g||R.$$typeof===v||R.$$typeof===m)},fe.typeOf=y,fe}var df;function Uk(){return df||(df=1,ja.exports=$k()),ja.exports}var qa,ff;function Fk(){if(ff)return qa;ff=1;var t=Uk(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[t.ForwardRef]=r,s[t.Memo]=i;function o(p){return t.isMemo(p)?i:s[p.$$typeof]||e}var u=Object.defineProperty,a=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,f=Object.prototype;function h(p,m,_){if(typeof m!="string"){if(f){var g=d(m);g&&g!==f&&h(p,g,_)}var v=a(m);c&&(v=v.concat(c(m)));for(var y=o(p),w=o(m),R=0;R<v.length;++R){var E=v[R];if(!n[E]&&!(_&&_[E])&&!(w&&w[E])&&!(y&&y[E])){var O=l(m,E);try{u(p,E,O)}catch{}}}}return p}return qa=h,qa}var Bk=Fk();const Hk=Ju(Bk),jk="ui.react.render",qk="ui.react.update",Gk="ui.react.mount",hf="/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/profiler.tsx",zk="unknown";class iv extends ki.Component{static __initStatic(){this.defaultProps={disabled:!1,includeRender:!0,includeUpdates:!0}}constructor(e){super(e);const{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=Ir({name:`<${n}>`,onlyIfParent:!0,op:Gk,origin:"auto.ui.react.profiler",attributes:{"ui.component_name":n}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:e,includeUpdates:n=!0}){if(n&&this._mountSpan&&e!==this.props.updateProps){const r=Object.keys(e).filter(i=>e[i]!==this.props.updateProps[i]);if(r.length>0){const i=tn();this._updateSpan=hu(this._mountSpan,()=>Ir({name:`<${this.props.name}>`,onlyIfParent:!0,op:qk,origin:"auto.ui.react.profiler",startTimestamp:i,attributes:{"ui.component_name":this.props.name,"ui.react.changed_props":r}}))}}return!0}componentDidUpdate(){this._updateSpan&&(this._updateSpan.end(),this._updateSpan=void 0)}componentWillUnmount(){const e=tn(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){const i=pe(this._mountSpan).timestamp;hu(this._mountSpan,()=>{const s=Ir({onlyIfParent:!0,name:`<${n}>`,op:jk,origin:"auto.ui.react.profiler",startTimestamp:i,attributes:{"ui.component_name":n}});s&&s.end(e)})}}render(){return this.props.children}}iv.__initStatic();function WM(t,e){const n=t.displayName||t.name||zk,r=i=>ki.createElement(iv,{...e,name:n,updateProps:i,__self:this,__source:{fileName:hf,lineNumber:159}},ki.createElement(t,{...i,__self:this,__source:{fileName:hf,lineNumber:160}}));return r.displayName=`profiler(${n})`,Hk(r,t),r}const Wk=Object.prototype.toString;function Kc(t,e){return Wk.call(t)===`[object ${e}]`}function mn(t){return Kc(t,"String")}function sv(t){return Kc(t,"Object")}function ov(t){return Kc(t,"RegExp")}function In(t){return!!(t&&t.then&&typeof t.then=="function")}function Vk(t){return typeof t=="number"&&t!==t}function pf(t,e){try{return t instanceof e}catch{return!1}}function Kk(t,e,n=!1){return mn(t)?ov(e)?e.test(t):mn(e)?n?t===e:t.includes(e):!1:!1}function Yk(t,e=[],n=!1){return e.some(r=>Kk(t,r,n))}function ks(t){return t&&t.Math==Math?t:void 0}const Ie=typeof globalThis=="object"&&ks(globalThis)||typeof window=="object"&&ks(window)||typeof self=="object"&&ks(self)||typeof global=="object"&&ks(global)||function(){return this}()||{};function Yc(){return Ie}function av(t,e,n){const r=n||Ie,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const Ii=Yc(),Xk=80;function No(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,o=0;const u=" > ",a=u.length;let c;const l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||Xk;for(;n&&s++<r&&(c=Jk(n,l),!(c==="html"||s>1&&o+i.length*a+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(u)}catch{return"<unknown>"}}function Jk(t,e){const n=t,r=[];let i,s,o,u,a;if(!n||!n.tagName)return"";if(Ii.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const c=e&&e.length?e.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(c&&c.length)c.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&mn(i))for(s=i.split(/\s+/),a=0;a<s.length;a++)r.push(`.${s[a]}`);const l=["aria-label","type","name","title","alt"];for(a=0;a<l.length;a++)o=l[a],u=n.getAttribute(o),u&&r.push(`[${o}="${u}"]`);return r.join("")}function Qk(t){return Ii.document&&Ii.document.querySelector?Ii.document.querySelector(t):null}function Zk(t){if(!Ii.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement&&e.dataset.sentryComponent)return e.dataset.sentryComponent;e=e.parentNode}return null}const Zi=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ex="Sentry Logger ",gf=["debug","info","warn","error","log","assert","trace"],mf={};function uv(t){if(!("console"in Ie))return t();const e=Ie.console,n={},r=Object.keys(mf);r.forEach(i=>{const s=mf[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function tx(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Zi?gf.forEach(n=>{e[n]=(...r)=>{t&&uv(()=>{Ie.console[n](`${ex}[${n}]:`,...r)})}}):gf.forEach(n=>{e[n]=()=>{}}),e}const F=tx();function nx(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:u,publicKey:a}=t;return`${u}://${a}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function nt(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&rx(i,r),t[e]=i}function Po(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Zi&&F.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function rx(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,Po(t,"__sentry_original__",e)}catch{}}function St(t){return Nu(t,new Map)}function Nu(t,e){if(ix(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))typeof t[i]<"u"&&(r[i]=Nu(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(Nu(i,e))}),r}return t}function ix(t){if(!sv(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const Ga="<anonymous>";function cv(t){try{return!t||typeof t!="function"?Ga:t.name||Ga}catch{return Ga}}const ao={},_f={};function es(t,e){ao[t]=ao[t]||[],ao[t].push(e)}function ts(t,e){_f[t]||(e(),_f[t]=!0)}function Qt(t,e){const n=t&&ao[t];if(n)for(const r of n)try{r(e)}catch(i){Zi&&F.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${cv(r)}
Error:`,i)}}function Ue(){const t=Ie,e=t.crypto||t.msCrypto;let n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const 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 Pu(t){return Array.isArray(t)?t:[t]}const $u=Yc();function sx(){if(!("fetch"in $u))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function vf(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ox(){if(typeof EdgeRuntime=="string")return!0;if(!sx())return!1;if(vf($u.fetch))return!0;let t=!1;const e=$u.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=vf(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){Zi&&F.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function ax(t){const e="fetch";es(e,t),ts(e,ux)}function ux(){ox()&&nt(Ie,"fetch",function(t){return function(...e){const{method:n,url:r}=cx(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Qt("fetch",{...i}),t.apply(Ie,e).then(s=>{const o={...i,endTimestamp:Date.now(),response:s};return Qt("fetch",o),s},s=>{const o={...i,endTimestamp:Date.now(),error:s};throw Qt("fetch",o),s})}})}function Uu(t,e){return!!t&&typeof t=="object"&&!!t[e]}function yf(t){return typeof t=="string"?t:t?Uu(t,"url")?t.url:t.toString?t.toString():"":""}function cx(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:yf(n),method:Uu(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:yf(e),method:Uu(e,"method")?String(e.method).toUpperCase():"GET"}}let xs=null;function lx(t){const e="error";es(e,t),ts(e,dx)}function dx(){xs=Ie.onerror,Ie.onerror=function(t,e,n,r,i){return Qt("error",{column:r,error:i,line:n,msg:t,url:e}),xs&&!xs.__SENTRY_LOADER__?xs.apply(this,arguments):!1},Ie.onerror.__SENTRY_INSTRUMENTED__=!0}let Os=null;function fx(t){const e="unhandledrejection";es(e,t),ts(e,hx)}function hx(){Os=Ie.onunhandledrejection,Ie.onunhandledrejection=function(t){return Qt("unhandledrejection",t),Os&&!Os.__SENTRY_LOADER__?Os.apply(this,arguments):!0},Ie.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const As=Yc();function px(){const t=As.chrome,e=t&&t.app&&t.app.runtime,n="history"in As&&!!As.history.pushState&&!!As.history.replaceState;return!e&&n}const ai=Ie;let Ds;function gx(t){const e="history";es(e,t),ts(e,mx)}function mx(){if(!px())return;const t=ai.onpopstate;ai.onpopstate=function(...n){const r=ai.location.href,i=Ds;if(Ds=r,Qt("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=Ds,o=String(i);Ds=o,Qt("history",{from:s,to:o})}return n.apply(this,r)}}nt(ai.history,"pushState",e),nt(ai.history,"replaceState",e)}const _x=Ie,gi="__sentry_xhr_v3__";function vx(t){const e="xhr";es(e,t),ts(e,yx)}function yx(){if(!_x.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;nt(t,"open",function(e){return function(...n){const r=Date.now(),i=mn(n[0])?n[0].toUpperCase():void 0,s=Sx(n[1]);if(!i||!s)return e.apply(this,n);this[gi]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const u=this[gi];if(u&&this.readyState===4){try{u.status_code=this.status}catch{}const a={args:[i,s],endTimestamp:Date.now(),startTimestamp:r,xhr:this};Qt("xhr",a)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?nt(this,"onreadystatechange",function(u){return function(...a){return o(),u.apply(this,a)}}):this.addEventListener("readystatechange",o),nt(this,"setRequestHeader",function(u){return function(...a){const[c,l]=a,d=this[gi];return d&&mn(c)&&mn(l)&&(d.request_headers[c.toLowerCase()]=l),u.apply(this,a)}}),e.apply(this,n)}}),nt(t,"send",function(e){return function(...n){const r=this[gi];if(!r)return e.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const i={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return Qt("xhr",i),e.apply(this,n)}})}function Sx(t){if(mn(t))return t;try{return t.toString()}catch{}}function bx(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Ex(){return!bx()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Un(t,e){return t.require(e)}function zn(t){let e;try{e=Un(module,t)}catch{}try{const{cwd:n}=Un(module,"process");e=Un(module,`${n()}/node_modules/${t}`)}catch{}return e}var Vt;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(Vt||(Vt={}));class dn{constructor(e){dn.prototype.__init.call(this),dn.prototype.__init2.call(this),dn.prototype.__init3.call(this),dn.prototype.__init4.call(this),this._state=Vt.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new dn((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new dn((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(Vt.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Vt.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===Vt.PENDING){if(In(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Vt.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Vt.RESOLVED&&n[1](this._value),this._state===Vt.REJECTED&&n[2](this._value),n[0]=!0)})}}}function ha(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const 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 $o(t){return t.split(/[\?#]/,1)[0]}function Uo(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function Tx(t,e={}){const n=t.method&&t.method.toUpperCase();let r="",i="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,i="route"):(t.originalUrl||t.url)&&(r=$o(t.originalUrl||t.url||""));let s="";return e.method&&n&&(s+=n),e.method&&e.path&&(s+=" "),e.path&&r&&(s+=r),[s,i]}const lv=1e3;function Xc(){return Date.now()/lv}function Ix(){const{performance:t}=Ie;if(!t||!t.now)return Xc;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/lv}const ns=Ix(),pt=(()=>{const{performance:t}=Ie;if(!t||!t.now)return;const e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,o=t.timing&&t.timing.navigationStart,a=typeof o=="number"?Math.abs(o+n-r):e,c=a<e;return s||c?i<=a?t.timeOrigin:o:r})(),Fu="baggage",dv="sentry-",wx=/^sentry-/,Cx=8192;function Rx(t){if(!mn(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,i)=>{const s=Sf(i);for(const o of Object.keys(s))r[o]=s[o];return r},{});else{if(!t)return;e=Sf(t)}const n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(wx)){const o=i.slice(dv.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function fv(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,i])=>(i&&(n[`${dv}${r}`]=i),n),{});return kx(e)}function Sf(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function kx(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],i)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=i===0?s:`${e},${s}`;return o.length>Cx?(Zi&&F.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const xx=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Ox(t){if(!t)return;const e=t.match(xx);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 Ax(t,e){const n=Ox(t),r=Rx(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceId:i||Ue(),parentSpanId:s||Ue().substring(16),spanId:Ue().substring(16),sampled:o,dsc:r||{}}:{traceId:i||Ue(),spanId:Ue().substring(16)}}function Jc(t=Ue(),e=Ue().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function Dx(t,e=[]){return[t,e]}function oe(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const de=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,hv="production";function Mx(){return av("globalEventProcessors",()=>[])}function Bu(t,e,n,r=0){return new dn((i,s)=>{const o=t[r];if(e===null||typeof o!="function")i(e);else{const u=o({...e},n);de&&o.id&&u===null&&F.log(`Event processor "${o.id}" dropped event`),In(u)?u.then(a=>Bu(t,a,n,r+1).then(i)).then(null,s):Bu(t,u,n,r+1).then(i).then(null,s)}})}function Lx(t){const e=ns(),n={sid:Ue(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Px(n)};return t&&pa(n,t),n}function pa(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||ns(),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:Ue()),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{const 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 Nx(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),pa(t,n)}function Px(t){return St({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}})}const $x=0,pv=1;function Qc(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:s,status:o,tags:u,origin:a}=Qe(t);return St({data:r,op:i,parent_span_id:s,span_id:e,status:o,tags:u,trace_id:n,origin:a})}function ga(t){const{traceId:e,spanId:n}=t.spanContext(),r=Zc(t);return Jc(e,n,r)}function ma(t){return typeof t=="number"?bf(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?bf(t.getTime()):ns()}function bf(t){return t>9999999999?t/1e3:t}function Qe(t){return Ux(t)?t.getSpanJSON():typeof t.toJSON=="function"?t.toJSON():{}}function Ux(t){return typeof t.getSpanJSON=="function"}function Zc(t){const{traceFlags:e}=t.spanContext();return!!(e&pv)}function Fx(...t){const e=sn();if(t.length===2){const[n,r]=t;return n?e.withScope(()=>(e.getStackTop().scope=n,r(n))):e.withScope(r)}return e.withScope(t[0])}function Xr(){return sn().getClient()}function Jr(){return sn().getScope()}function Fo(t){return t.transaction}function el(t,e,n){const r=e.getOptions(),{publicKey:i}=e.getDsn()||{},{segment:s}=n&&n.getUser()||{},o=St({environment:r.environment||hv,release:r.release,user_segment:s,public_key:i,trace_id:t});return e.emit&&e.emit("createDsc",o),o}function $r(t){const e=Xr();if(!e)return{};const n=el(Qe(t).trace_id||"",e,Jr()),r=Fo(t);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:s,source:o}=r.metadata;s!=null&&(n.sample_rate=`${s}`);const u=Qe(r);return o&&o!=="url"&&(n.transaction=u.description),n.sampled=String(Zc(r)),e.emit&&e.emit("createDsc",n),n}function Bx(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;Hx(t,e),r&&Gx(t,r),zx(t,n),jx(t,i),qx(t,s)}function Hx(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:u}=e,a=St(n);a&&Object.keys(a).length&&(t.extra={...a,...t.extra});const c=St(r);c&&Object.keys(c).length&&(t.tags={...c,...t.tags});const l=St(i);l&&Object.keys(l).length&&(t.user={...l,...t.user});const d=St(s);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts}),o&&(t.level=o),u&&(t.transaction=u)}function jx(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function qx(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function Gx(t,e){t.contexts={trace:Qc(e),...t.contexts};const n=Fo(e);if(n){t.sdkProcessingMetadata={dynamicSamplingContext:$r(e),...t.sdkProcessingMetadata};const r=Qe(n).description;r&&(t.tags={transaction:r,...t.tags})}}function zx(t,e){t.fingerprint=t.fingerprint?Pu(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}const Wx=100;class Cr{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ef()}static clone(e){return e?e.clone():new Cr}clone(){const e=new Cr;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,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={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}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,segment:void 0,username:void 0},this._session&&pa(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={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...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}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e;if(n instanceof Cr){const r=n.getScopeData();this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&Object.keys(r.user).length&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint.length&&(this._fingerprint=r.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),r.propagationContext&&(this._propagationContext=r.propagationContext)}else if(sv(n)){const r=e;this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint&&(this._fingerprint=r.fingerprint),r.requestSession&&(this._requestSession=r.requestSession),r.propagationContext&&(this._propagationContext=r.propagationContext)}return 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._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Ef(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:Wx;if(r<=0)return this;const i={timestamp:Xc(),...e},s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>r?s.slice(-r):s,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}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:n,_contexts:r,_tags:i,_extra:s,_user:o,_level:u,_fingerprint:a,_eventProcessors:c,_propagationContext:l,_sdkProcessingMetadata:d,_transactionName:f,_span:h}=this;return{breadcrumbs:e,attachments:n,contexts:r,tags:i,extra:s,user:o,level:u,fingerprint:a||[],eventProcessors:c,propagationContext:l,sdkProcessingMetadata:d,transactionName:f,span:h}}applyToEvent(e,n={},r=[]){Bx(e,this.getScopeData());const i=[...r,...Mx(),...this._eventProcessors];return Bu(i,e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:Ue();if(!this._client)return F.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:Ue();if(!this._client)return F.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Ue();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(F.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)}}function Ef(){return{traceId:Ue(),spanId:Ue().substring(16)}}const Vx="7.114.0",gv=parseFloat(Vx),Kx=100;class mv{constructor(e,n,r,i=gv){this._version=i;let s;n?s=n:(s=new Cr,s.setClient(e));let o;r?o=r:(o=new Cr,o.setClient(e)),this._stack=[{scope:s}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const n=this.getStackTop();n.client=e,n.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const n=this.pushScope();let r;try{r=e(n)}catch(i){throw this.popScope(),i}return In(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}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Ue(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:Ue(),s=new Error(e);return this.getScope().captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Ue();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...n,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=Kx}=i.getOptions&&i.getOptions()||{};if(o<=0)return;const a={timestamp:Xc(),...e},c=s?uv(()=>s(a,n)):a;c!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n),this.getIsolationScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n),this.getIsolationScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n),this.getIsolationScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=Tf(this);try{e(this)}finally{Tf(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return de&&F.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return de&&!r&&(this.getClient()?F.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`):F.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&Nx(r),this._sendSessionUpdate(),n.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=hv}=r&&r.getOptions()||{},{userAgent:o}=Ie.navigator||{},u=Lx({release:i,environment:s,user:n.getUser(),...o&&{userAgent:o},...e}),a=n.getSession&&n.getSession();return a&&a.status==="ok"&&pa(a,{status:"exited"}),this.endSession(),n.setSession(u),u}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_callExtensionMethod(e,...n){const i=Jn().__SENTRY__;if(i&&i.extensions&&typeof i.extensions[e]=="function")return i.extensions[e].apply(this,n);de&&F.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Jn(){return Ie.__SENTRY__=Ie.__SENTRY__||{extensions:{},hub:void 0},Ie}function Tf(t){const e=Jn(),n=Hu(e);return _v(e,t),n}function sn(){const t=Jn();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Yx(t)}function tl(){return sn().getIsolationScope()}function Yx(t=Jn()){return(!Jx(t)||Hu(t).isOlderThan(gv))&&_v(t,new mv),Hu(t)}function Xx(t,e={}){const n=Jn();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function Jx(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function Hu(t){return av("hub",()=>new mv,t)}function _v(t,e){if(!t)return!1;const n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}function Wn(t){return(t||sn()).getScope().getTransaction()}let If=!1;function Qx(){If||(If=!0,lx(ju),fx(ju))}function ju(){const t=Wn();if(t){const e="internal_error";de&&F.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}ju.tag="sentry_tracingErrorCallback";var wf;(function(t){const e="ok";t.Ok=e;const n="deadline_exceeded";t.DeadlineExceeded=n;const r="unauthenticated";t.Unauthenticated=r;const i="permission_denied";t.PermissionDenied=i;const s="not_found";t.NotFound=s;const o="resource_exhausted";t.ResourceExhausted=o;const u="invalid_argument";t.InvalidArgument=u;const a="unimplemented";t.Unimplemented=a;const c="unavailable";t.Unavailable=c;const l="internal_error";t.InternalError=l;const d="unknown_error";t.UnknownError=d;const f="cancelled";t.Cancelled=f;const h="already_exists";t.AlreadyExists=h;const p="failed_precondition";t.FailedPrecondition=p;const m="aborted";t.Aborted=m;const _="out_of_range";t.OutOfRange=_;const g="data_loss";t.DataLoss=g})(wf||(wf={}));function Zx(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function nl(t,e){t.setTag("http.status_code",String(e)),t.setData("http.response.status_code",e);const n=Zx(e);n!=="unknown_error"&&t.setStatus(n)}function eO(t,e,n=()=>{}){let r;try{r=t()}catch(i){throw e(i),n(),i}return tO(r,e,n)}function tO(t,e,n){return In(t)?t.then(r=>(n(),r),r=>{throw e(r),n(),r}):(n(),t)}function Qr(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=Xr(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function nO(t,e){const n=Sv(t);return Xx(()=>Fx(t.scope,r=>{const i=sn(),s=r.getSpan(),u=t.onlyIfParent&&!s?void 0:yv(i,{parentSpan:s,spanContext:n,forceTransaction:t.forceTransaction,scope:r});return eO(()=>e(u),()=>{if(u){const{status:a}=Qe(u);(!a||a==="ok")&&u.setStatus("internal_error")}},()=>u&&u.end())}))}function vv(t){if(!Qr())return;const e=Sv(t),n=sn(),r=t.scope?t.scope.getSpan():rO();if(t.onlyIfParent&&!r)return;const o=(t.scope||Jr()).clone();return yv(n,{parentSpan:r,spanContext:e,forceTransaction:t.forceTransaction,scope:o})}function rO(){return Jr().getSpan()}function yv(t,{parentSpan:e,spanContext:n,forceTransaction:r,scope:i}){if(!Qr())return;const s=tl();let o;if(e&&!r)o=e.startChild(n);else if(e){const u=$r(e),{traceId:a,spanId:c}=e.spanContext(),l=Zc(e);o=t.startTransaction({traceId:a,parentSpanId:c,parentSampled:l,...n,metadata:{dynamicSamplingContext:u,...n.metadata}})}else{const{traceId:u,dsc:a,parentSpanId:c,sampled:l}={...s.getPropagationContext(),...i.getPropagationContext()};o=t.startTransaction({traceId:u,parentSpanId:c,parentSampled:l,...n,metadata:{dynamicSamplingContext:a,...n.metadata}})}return i.setSpan(o),iO(o,i,s),o}function Sv(t){if(t.startTime){const e={...t};return e.startTimestamp=ma(t.startTime),delete e.startTime,e}return t}const bv="_sentryScope",Ev="_sentryIsolationScope";function iO(t,e,n){t&&(Po(t,Ev,n),Po(t,bv,e))}function sO(t){return{scope:t[bv],isolationScope:t[Ev]}}const _n="sentry.source",yr="sentry.sample_rate",Ms="sentry.op",Fn="sentry.origin",oO="profile_id";class Tv{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class _a{constructor(e={}){this._traceId=e.traceId||Ue(),this._spanId=e.spanId||Ue().substring(16),this._startTime=e.startTimestamp||ns(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[Fn]:e.origin||"manual",[Ms]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[Ms]}set op(e){this.setAttribute(Ms,e)}get origin(){return this._attributes[Fn]}set origin(e){this.setAttribute(Fn,e)}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?pv:$x}}startChild(e){const n=new _a({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n);const r=Fo(this);if(n.transaction=r,de&&r){const i=e&&e.op||"< unknown op >",s=Qe(n).description||"< unknown name >",o=r.spanContext().spanId,u=`[Tracing] Starting '${i}' span on transaction '${s}' (${o}).`;F.log(u),this._logMessage=u}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setAttribute(e,n){n===void 0?delete this._attributes[e]:this._attributes[e]=n}setAttributes(e){Object.keys(e).forEach(n=>this.setAttribute(n,e[n]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return nl(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status==="ok"}finish(e){return this.end(e)}end(e){if(this._endTime)return;const n=Fo(this);if(de&&n&&n.spanContext().spanId!==this._spanId){const r=this._logMessage;r&&F.log(r.replace("Starting","Finishing"))}this._endTime=ma(e)}toTraceparent(){return ga(this)}toContext(){return St({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return Qc(this)}getSpanJSON(){return St({data:this._getData(),description:this._name,op:this._attributes[Ms],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Fn],_metrics_summary:void 0,profile_id:this._attributes[oO],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:n}=this,r=Object.keys(e).length>0,i=Object.keys(n).length>0;if(!(!r&&!i))return r&&i?{...e,...n}:r?e:n}}class Iv extends _a{constructor(e,n){super(e),this._contexts={},this._hub=n||sn(),this._name=e.name||"",this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;const r=this._metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[_n]&&{source:this._attributes[_n]},...this._attributes[yr]&&{sampleRate:this._attributes[yr]}}}set metadata(e){this._metadata=e}setName(e,n="custom"){this._name=e,this.setAttribute(_n,n)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Tv(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){const n=ma(e),r=this._finishTransaction(n);if(r)return this._hub.captureEvent(r)}toContext(){const e=super.toContext();return St({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return $r(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||(de&&F.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this._sampled!==!0){de&&F.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}const r=this.spanRecorder?this.spanRecorder.spans.filter(l=>l!==this&&Qe(l).timestamp):[];if(this._trimEnd&&r.length>0){const l=r.map(d=>Qe(d).timestamp).filter(Boolean);this._endTime=l.reduce((d,f)=>d>f?d:f)}const{scope:i,isolationScope:s}=sO(this),{metadata:o}=this,{source:u}=o,a={contexts:{...this._contexts,trace:Qc(this)},spans:r,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:i,capturedSpanIsolationScope:s,...St({dynamicSamplingContext:$r(this)})},_metrics_summary:void 0,...u&&{transaction_info:{source:u}}};return Object.keys(this._measurements).length>0&&(de&&F.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),a.measurements=this._measurements),de&&F.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),a}}const uo={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},aO="finishReason",ir=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class uO extends Tv{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){if(e.spanContext().spanId!==this.transactionSpanId){const n=e.end;e.end=(...r)=>(this._popActivity(e.spanContext().spanId),n.apply(e,r)),Qe(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}}class cO extends Iv{constructor(e,n,r=uo.idleTimeout,i=uo.finalTimeout,s=uo.heartbeatInterval,o=!1,u=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=s,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=ir[4],this._autoFinishAllowed=!u,o&&(de&&F.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),n.getScope().setSpan(this)),u||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=ir[3],this.end())},this._finalTimeout)}end(e){const n=ma(e);if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setAttribute(aO,this._finishReason),this.spanRecorder){de&&F.log("[Tracing] finishing IdleTransaction",new Date(n*1e3).toISOString(),this.op);for(const r of this._beforeFinishCallbacks)r(this,n);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanContext().spanId===this.spanContext().spanId)return!0;Qe(r).timestamp||(r.setStatus("cancelled"),r.end(n),de&&F.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));const{start_timestamp:i,timestamp:s}=Qe(r),o=i&&i<n,u=(this._finalTimeout+this._idleTimeout)/1e3,a=s&&i&&s-i<u;if(de){const c=JSON.stringify(r,void 0,2);o?a||F.log("[Tracing] discarding Span since it finished after Transaction final timeout",c):F.log("[Tracing] discarding Span since it happened after Transaction was finished",c)}return o&&a}),de&&F.log("[Tracing] flushing IdleTransaction")}else de&&F.log("[Tracing] No active IdleTransaction");if(this._onScope){const r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new uO(n,r,this.spanContext().spanId,e),de&&F.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=ir[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(de&&F.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=ir[1],this.end(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),de&&F.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,de&&F.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(de&&F.log(`[Tracing] popActivity ${e}`),delete this.activities[e],de&&F.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=ns();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=ir[5],this.end(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(de&&F.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=ir[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){de&&F.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function wv(t,e,n){if(!Qr(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setAttribute(yr,Number(t.sampled)),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setAttribute(yr,Number(r))):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setAttribute(yr,Number(r))):(r=1,t.setAttribute(yr,r)),Cv(r)?r?(t.sampled=Math.random()<r,t.sampled?(de&&F.log(`[Tracing] starting ${t.op} transaction - ${Qe(t).description}`),t):(de&&F.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):(de&&F.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):(de&&F.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function Cv(t){return Vk(t)||!(typeof t=="number"||typeof t=="boolean")?(de&&F.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)}.`),!1):t<0||t>1?(de&&F.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function lO(){const e=this.getScope().getSpan();return e?{"sentry-trace":ga(e)}:{}}function dO(t,e){const n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=t.instrumenter||"sentry";i!==s&&(de&&F.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter.
The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let o=new Iv(t,this);return o=wv(o,r,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...e}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function Cf(t,e,n,r,i,s,o,u=!1){const a=t.getClient(),c=a&&a.getOptions()||{};let l=new cO(e,t,n,r,o,i,u);return l=wv(l,c,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),l.isRecording()&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",l),l}function Rv(){const t=Jn();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=dO),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=lO),Qx())}function fO(t,e,n){const r=Wn();r&&r.setMeasurement(t,e,n)}function hO(t,e){const n={sent_at:new Date().toISOString()};e&&(n.dsn=nx(e));const r=t.map(pO);return Dx(n,r)}function pO(t){return[{type:"span"},t]}const Y=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Qn(t){const e=oe([t,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]);return(oe([e,"optionalAccess",r=>r.instrumenter])||"sentry")!=="sentry"}class rl{static __initStatic(){this.id="Express"}constructor(e={}){this.name=rl.id,this._router=e.router||e.app,this._methods=(Array.isArray(e.methods)?e.methods:[]).concat("use")}setupOnce(e,n){if(!this._router){Y&&F.error("ExpressIntegration is missing an Express instance");return}if(Qn(n)){Y&&F.log("Express Integration is skipped because of instrumenter configuration.");return}_O(this._router,this._methods),vO(this._router)}}rl.__initStatic();function Rf(t,e){const n=t.length;switch(n){case 2:return function(r,i){const s=i.__sentry_transaction;if(s){const o=s.startChild({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"});i.once("finish",()=>{o.end()})}return t.call(this,r,i)};case 3:return function(r,i,s){const o=i.__sentry_transaction,u=oe([o,"optionalAccess",a=>a.startChild,"call",a=>a({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,i,function(...a){oe([u,"optionalAccess",c=>c.end,"call",c=>c()]),s.call(this,...a)})};case 4:return function(r,i,s,o){const u=s.__sentry_transaction,a=oe([u,"optionalAccess",c=>c.startChild,"call",c=>c({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,i,s,function(...c){oe([a,"optionalAccess",l=>l.end,"call",l=>l()]),o.call(this,...c)})};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}function gO(t,e){return t.map(n=>typeof n=="function"?Rf(n,e):Array.isArray(n)?n.map(r=>typeof r=="function"?Rf(r,e):r):n)}function mO(t,e){const n=t[e];return t[e]=function(...r){return n.call(this,...gO(r,e))},t}function _O(t,e=[]){e.forEach(n=>mO(t,n))}function vO(t){const e="settings"in t;e&&t._router===void 0&&t.lazyrouter&&t.lazyrouter();const n=e?t._router:t;if(!n){Y&&F.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),Y&&F.debug("Routing instrumentation is currently only supported in Express 4.");return}const r=Object.getPrototypeOf(n),i=r.process_params;r.process_params=function(o,u,a,c,l){a._reconstructedRoute||(a._reconstructedRoute="");const{layerRoutePath:d,isRegex:f,isArray:h,numExtraSegments:p}=SO(o);(d||f||h)&&(a._hasParameters=!0);let m;d?m=d:m=TO(a.originalUrl,a._reconstructedRoute,o.path)||"";const _=m.split("/").filter(y=>y.length>0&&(f||h||!y.includes("*"))).join("/");_&&_.length>0&&(a._reconstructedRoute+=`/${_}${f?"/":""}`);const g=Uo($o(a.originalUrl||""))+p,v=Uo(a._reconstructedRoute);if(g===v){a._hasParameters||a._reconstructedRoute!==a.originalUrl&&(a._reconstructedRoute=a.originalUrl?$o(a.originalUrl):a.originalUrl);const y=c.__sentry_transaction,w=y&&Qe(y).data||{};if(y&&w[_n]!=="custom"){const R=a._reconstructedRoute||"/",[E,O]=Tx(a,{path:!0,method:!0,customRoute:R});y.updateName(E),y.setAttribute(_n,O)}}return i.call(this,o,u,a,c,l)}}const yO=(t,e,n)=>{if(!t||!e||!n||Object.keys(n).length===0||!oe([n,"access",c=>c[0],"optionalAccess",c=>c.offset]))return;const r=n.sort((c,l)=>c.offset-l.offset),s=new RegExp(e,`${e.flags}d`).exec(t);if(!s||!s.indices)return;const[,...o]=s.indices;if(o.length!==r.length)return;let u=t,a=0;return o.forEach((c,l)=>{if(c){const[d,f]=c,h=u.substring(0,d-a),p=`:${r[l].name}`,m=u.substring(f-a);u=h+p+m,a=a+(f-d-p.length)}}),u};function SO(t){let e=oe([t,"access",o=>o.route,"optionalAccess",o=>o.path]);const n=ov(e),r=Array.isArray(e);if(!e){const[o]=Ie.process.versions.node.split(".").map(Number);o>=16&&(e=yO(t.path,t.regexp,t.keys))}if(!e)return{isRegex:n,isArray:r,numExtraSegments:0};const i=r?Math.max(bO(e)-Uo(t.path||""),0):0;return{layerRoutePath:EO(r,e),isRegex:n,isArray:r,numExtraSegments:i}}function bO(t){return t.reduce((e,n)=>e+Uo(n.toString()),0)}function EO(t,e){return t?e.map(n=>n.toString()).join(","):e&&e.toString()}function TO(t,e,n){const r=$o(t||""),i=oe([r,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c)]);let s=0;const o=oe([e,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c),"access",a=>a.length])||0;return oe([n,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>oe([i,"optionalAccess",l=>l[o+s]])===c?(s+=1,!0):!1),"access",a=>a.join,"call",a=>a("/")])}class il{static __initStatic(){this.id="Postgres"}constructor(e={}){this.name=il.id,this._usePgNative=!!e.usePgNative,this._module=e.module}loadDependency(){return this._module=this._module||zn("pg")}setupOnce(e,n){if(Qn(n)){Y&&F.log("Postgres Integration is skipped because of instrumenter configuration.");return}const r=this.loadDependency();if(!r){Y&&F.error("Postgres Integration was unable to require `pg` package.");return}const i=this._usePgNative?oe([r,"access",s=>s.native,"optionalAccess",s=>s.Client]):r.Client;if(!i){Y&&F.error("Postgres Integration was unable to access 'pg-native' bindings.");return}nt(i.prototype,"query",function(s){return function(o,u,a){const l=n().getScope().getSpan(),d={"db.system":"postgresql"};try{this.database&&(d["db.name"]=this.database),this.host&&(d["server.address"]=this.host),this.port&&(d["server.port"]=this.port),this.user&&(d["db.user"]=this.user)}catch{}const f=oe([l,"optionalAccess",p=>p.startChild,"call",p=>p({description:typeof o=="string"?o:o.text,op:"db",origin:"auto.db.postgres",data:d})]);if(typeof a=="function")return s.call(this,o,u,function(p,m){oe([f,"optionalAccess",_=>_.end,"call",_=>_()]),a(p,m)});if(typeof u=="function")return s.call(this,o,function(p,m){oe([f,"optionalAccess",_=>_.end,"call",_=>_()]),u(p,m)});const h=typeof u<"u"?s.call(this,o,u):s.call(this,o);return In(h)?h.then(p=>(oe([f,"optionalAccess",m=>m.end,"call",m=>m()]),p)):(oe([f,"optionalAccess",p=>p.end,"call",p=>p()]),h)}})}}il.__initStatic();class sl{static __initStatic(){this.id="Mysql"}constructor(){this.name=sl.id}loadDependency(){return this._module=this._module||zn("mysql/lib/Connection.js")}setupOnce(e,n){if(Qn(n)){Y&&F.log("Mysql Integration is skipped because of instrumenter configuration.");return}const r=this.loadDependency();if(!r){Y&&F.error("Mysql Integration was unable to require `mysql` package.");return}let i;try{r.prototype.connect=new Proxy(r.prototype.connect,{apply(u,a,c){return i||(i=a.config),u.apply(a,c)}})}catch{Y&&F.error("Mysql Integration was unable to instrument `mysql` config.")}function s(){return i?{"server.address":i.host,"server.port":i.port,"db.user":i.user}:{}}function o(u){if(!u)return;const a=s();Object.keys(a).forEach(c=>{u.setAttribute(c,a[c])}),u.end()}nt(r,"createQuery",function(u){return function(a,c,l){const f=n().getScope().getSpan(),h=oe([f,"optionalAccess",m=>m.startChild,"call",m=>m({description:typeof a=="string"?a:a.sql,op:"db",origin:"auto.db.mysql",data:{"db.system":"mysql"}})]);if(typeof l=="function")return u.call(this,a,c,function(m,_,g){o(h),l(m,_,g)});if(typeof c=="function")return u.call(this,a,function(m,_,g){o(h),c(m,_,g)});const p=u.call(this,a,c);return p.on("end",()=>{o(h)}),p}})}}sl.__initStatic();const IO=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],wO={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};function CO(t){return t&&typeof t=="object"&&t.once&&typeof t.once=="function"}class ol{static __initStatic(){this.id="Mongo"}constructor(e={}){this.name=ol.id,this._operations=Array.isArray(e.operations)?e.operations:IO,this._describeOperations="describeOperations"in e?e.describeOperations:!0,this._useMongoose=!!e.useMongoose}loadDependency(){const e=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||zn(e)}setupOnce(e,n){if(Qn(n)){Y&&F.log("Mongo Integration is skipped because of instrumenter configuration.");return}const r=this.loadDependency();if(!r){const i=this._useMongoose?"mongoose":"mongodb";Y&&F.error(`Mongo Integration was unable to require \`${i}\` package.`);return}this._instrumentOperations(r.Collection,this._operations,n)}_instrumentOperations(e,n,r){n.forEach(i=>this._patchOperation(e,i,r))}_patchOperation(e,n,r){if(!(n in e.prototype))return;const i=this._getSpanContextFromOperationArguments.bind(this);nt(e.prototype,n,function(s){return function(...o){const u=o[o.length-1],a=r(),c=a.getScope(),l=a.getClient(),d=c.getSpan(),f=oe([l,"optionalAccess",p=>p.getOptions,"call",p=>p(),"access",p=>p.sendDefaultPii]);if(typeof u!="function"||n==="mapReduce"&&o.length===2){const p=oe([d,"optionalAccess",_=>_.startChild,"call",_=>_(i(this,n,o,f))]),m=s.call(this,...o);if(In(m))return m.then(_=>(oe([p,"optionalAccess",g=>g.end,"call",g=>g()]),_));if(CO(m)){const _=m;try{_.once("close",()=>{oe([p,"optionalAccess",g=>g.end,"call",g=>g()])})}catch{oe([p,"optionalAccess",v=>v.end,"call",v=>v()])}return _}else return oe([p,"optionalAccess",_=>_.end,"call",_=>_()]),m}const h=oe([d,"optionalAccess",p=>p.startChild,"call",p=>p(i(this,n,o.slice(0,-1)))]);return s.call(this,...o.slice(0,-1),function(p,m){oe([h,"optionalAccess",_=>_.end,"call",_=>_()]),u(p,m)})}})}_getSpanContextFromOperationArguments(e,n,r,i=!1){const s={"db.system":"mongodb","db.name":e.dbName,"db.operation":n,"db.mongodb.collection":e.collectionName},o={op:"db",origin:"auto.db.mongo",description:n,data:s},u=wO[n],a=Array.isArray(this._describeOperations)?this._describeOperations.includes(n):this._describeOperations;if(!u||!a||!i)return o;try{if(n==="mapReduce"){const[c,l]=r;s[u[0]]=typeof c=="string"?c:c.name||"<anonymous>",s[u[1]]=typeof l=="string"?l:l.name||"<anonymous>"}else for(let c=0;c<u.length;c++)s[`db.mongodb.${u[c]}`]=JSON.stringify(r[c])}catch{}return o}}ol.__initStatic();function RO(t){return!!t&&!!t.$use}class al{static __initStatic(){this.id="Prisma"}constructor(e={}){if(this.name=al.id,RO(e.client)&&!e.client._sentryInstrumented){Po(e.client,"_sentryInstrumented",!0);const n={};try{const r=e.client._engineConfig;if(r){const{activeProvider:i,clientVersion:s}=r;i&&(n["db.system"]=i),s&&(n["db.prisma.version"]=s)}}catch{}e.client.$use((r,i)=>{if(Qn(sn))return i(r);const s=r.action,o=r.model;return nO({name:o?`${o} ${s}`:s,onlyIfParent:!0,op:"db.prisma",attributes:{[Fn]:"auto.db.prisma"},data:{...n,"db.operation":s}},()=>i(r))})}else Y&&F.warn("Unsupported Prisma client provided to PrismaIntegration. Provided client:",e.client)}setupOnce(){}}al.__initStatic();class ul{static __initStatic(){this.id="GraphQL"}constructor(){this.name=ul.id}loadDependency(){return this._module=this._module||zn("graphql/execution/execute.js")}setupOnce(e,n){if(Qn(n)){Y&&F.log("GraphQL Integration is skipped because of instrumenter configuration.");return}const r=this.loadDependency();if(!r){Y&&F.error("GraphQL Integration was unable to require graphql/execution package.");return}nt(r,"execute",function(i){return function(...s){const o=n().getScope(),u=o.getSpan(),a=oe([u,"optionalAccess",l=>l.startChild,"call",l=>l({description:"execute",op:"graphql.execute",origin:"auto.graphql.graphql"})]);oe([o,"optionalAccess",l=>l.setSpan,"call",l=>l(a)]);const c=i.call(this,...s);return In(c)?c.then(l=>(oe([a,"optionalAccess",d=>d.end,"call",d=>d()]),oe([o,"optionalAccess",d=>d.setSpan,"call",d=>d(u)]),l)):(oe([a,"optionalAccess",l=>l.end,"call",l=>l()]),oe([o,"optionalAccess",l=>l.setSpan,"call",l=>l(u)]),c)}})}}ul.__initStatic();class cl{static __initStatic(){this.id="Apollo"}constructor(e={useNestjs:!1}){this.name=cl.id,this._useNest=!!e.useNestjs}loadDependency(){return this._useNest?this._module=this._module||zn("@nestjs/graphql"):this._module=this._module||zn("apollo-server-core"),this._module}setupOnce(e,n){if(Qn(n)){Y&&F.log("Apollo Integration is skipped because of instrumenter configuration.");return}if(this._useNest){const r=this.loadDependency();if(!r){Y&&F.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package.");return}nt(r.GraphQLFactory.prototype,"mergeWithSchema",function(i){return function(...s){return nt(this.resolversExplorerService,"explore",function(o){return function(){const u=Pu(o.call(this));return kf(u,n)}}),i.call(this,...s)}})}else{const r=this.loadDependency();if(!r){Y&&F.error("Apollo Integration was unable to require apollo-server-core package.");return}nt(r.ApolloServerBase.prototype,"constructSchema",function(i){return function(){if(!this.config.resolvers)return Y&&(this.config.schema?(F.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),F.warn()):this.config.modules&&F.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),F.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),i.call(this);const s=Pu(this.config.resolvers);return this.config.resolvers=kf(s,n),i.call(this)}})}}}cl.__initStatic();function kf(t,e){return t.map(n=>(Object.keys(n).forEach(r=>{Object.keys(n[r]).forEach(i=>{typeof n[r][i]=="function"&&kO(n,r,i,e)})}),n))}function kO(t,e,n,r){nt(t[e],n,function(i){return function(...s){const u=r().getScope().getSpan(),a=oe([u,"optionalAccess",l=>l.startChild,"call",l=>l({description:`${e}.${n}`,op:"graphql.resolve",origin:"auto.graphql.apollo"})]),c=i.call(this,...s);return In(c)?c.then(l=>(oe([a,"optionalAccess",d=>d.end,"call",d=>d()]),l)):(oe([a,"optionalAccess",l=>l.end,"call",l=>l()]),c)}})}const ee=Ie;function xO(){ee.document?ee.document.addEventListener("visibilitychange",()=>{const t=Wn();if(ee.document.hidden&&t){const e="cancelled",{op:n,status:r}=Qe(t);Y&&F.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.end()}}):Y&&F.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const rs=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||r===void 0)&&(r=e.value,e.delta=i,t(e)))}},OO=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,AO=()=>{const t=ee.performance.timing,e=ee.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},va=()=>ee.__WEB_VITALS_POLYFILL__?ee.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||AO()):ee.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],ll=()=>{const t=va();return t&&t.activationStart||0},is=(t,e)=>{const n=va();let r="navigate";return n&&(ee.document&&ee.document.prerendering||ll()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:OO(),navigationType:r}},Zr=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(i=>{e(i.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},ss=(t,e)=>{const n=r=>{(r.type==="pagehide"||ee.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};ee.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))},DO=(t,e={})=>{const n=is("CLS",0);let r,i=0,s=[];const o=a=>{a.forEach(c=>{if(!c.hadRecentInput){const l=s[0],d=s[s.length-1];i&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-l.startTime<5e3?(i+=c.value,s.push(c)):(i=c.value,s=[c]),i>n.value&&(n.value=i,n.entries=s,r&&r())}})},u=Zr("layout-shift",o);if(u){r=rs(t,n,e.reportAllChanges);const a=()=>{o(u.takeRecords()),r(!0)};return ss(a),a}};let Bo=-1;const MO=()=>{ee.document&&ee.document.visibilityState&&(Bo=ee.document.visibilityState==="hidden"&&!ee.document.prerendering?0:1/0)},LO=()=>{ss(({timeStamp:t})=>{Bo=t},!0)},dl=()=>(Bo<0&&(MO(),LO()),{get firstHiddenTime(){return Bo}}),NO=t=>{const e=dl(),n=is("FID");let r;const i=u=>{u.startTime<e.firstHiddenTime&&(n.value=u.processingStart-u.startTime,n.entries.push(u),r(!0))},s=u=>{u.forEach(i)},o=Zr("first-input",s);r=rs(t,n),o&&ss(()=>{s(o.takeRecords()),o.disconnect()},!0)};let kv=0,za=1/0,Ls=0;const PO=t=>{t.forEach(e=>{e.interactionId&&(za=Math.min(za,e.interactionId),Ls=Math.max(Ls,e.interactionId),kv=Ls?(Ls-za)/7+1:0)})};let qu;const $O=()=>qu?kv:performance.interactionCount||0,UO=()=>{"interactionCount"in performance||qu||(qu=Zr("event",PO,{type:"event",buffered:!0,durationThreshold:0}))},xv=()=>$O(),xf=10,Yt=[],Wa={},Of=t=>{const e=Yt[Yt.length-1],n=Wa[t.interactionId];if(n||Yt.length<xf||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};Wa[r.id]=r,Yt.push(r)}Yt.sort((r,i)=>i.latency-r.latency),Yt.splice(xf).forEach(r=>{delete Wa[r.id]})}},FO=()=>{const t=Math.min(Yt.length-1,Math.floor(xv()/50));return Yt[t]},BO=(t,e)=>{e=e||{},UO();const n=is("INP");let r;const i=o=>{o.forEach(a=>{a.interactionId&&Of(a),a.entryType==="first-input"&&!Yt.some(l=>l.entries.some(d=>a.duration===d.duration&&a.startTime===d.startTime))&&Of(a)});const u=FO();u&&u.latency!==n.value&&(n.value=u.latency,n.entries=u.entries,r())},s=Zr("event",i,{durationThreshold:e.durationThreshold||40});r=rs(t,n,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),ss(()=>{i(s.takeRecords()),n.value<0&&xv()>0&&(n.value=0,n.entries=[]),r(!0)}))},Af={},HO=t=>{const e=dl(),n=is("LCP");let r;const i=o=>{const u=o[o.length-1];if(u){const a=Math.max(u.startTime-ll(),0);a<e.firstHiddenTime&&(n.value=a,n.entries=[u],r())}},s=Zr("largest-contentful-paint",i);if(s){r=rs(t,n);const o=()=>{Af[n.id]||(i(s.takeRecords()),s.disconnect(),Af[n.id]=!0,r(!0))};return["keydown","click"].forEach(u=>{ee.document&&addEventListener(u,o,{once:!0,capture:!0})}),ss(o,!0),o}},Gu=t=>{ee.document&&(ee.document.prerendering?addEventListener("prerenderingchange",()=>Gu(t),!0):ee.document.readyState!=="complete"?addEventListener("load",()=>Gu(t),!0):setTimeout(t,0))},jO=(t,e)=>{e=e||{};const n=is("TTFB"),r=rs(t,n,e.reportAllChanges);Gu(()=>{const i=va();if(i){if(n.value=Math.max(i.responseStart-ll(),0),n.value<0||n.value>performance.now())return;n.entries=[i],r(!0)}})},wi={},Ho={};let Ov,Av,Dv,Mv,Lv;function qO(t,e=!1){return os("cls",t,KO,Ov,e)}function GO(t,e=!1){return os("lcp",t,XO,Dv,e)}function zO(t){return os("ttfb",t,JO,Mv)}function WO(t){return os("fid",t,YO,Av)}function VO(t){return os("inp",t,QO,Lv)}function Ni(t,e){return Nv(t,e),Ho[t]||(ZO(t),Ho[t]=!0),Pv(t,e)}function ei(t,e){const n=wi[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(i){Y&&F.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${cv(r)}
Error:`,i)}}function KO(){return DO(t=>{ei("cls",{metric:t}),Ov=t},{reportAllChanges:!0})}function YO(){return NO(t=>{ei("fid",{metric:t}),Av=t})}function XO(){return HO(t=>{ei("lcp",{metric:t}),Dv=t})}function JO(){return jO(t=>{ei("ttfb",{metric:t}),Mv=t})}function QO(){return BO(t=>{ei("inp",{metric:t}),Lv=t})}function os(t,e,n,r,i=!1){Nv(t,e);let s;return Ho[t]||(s=n(),Ho[t]=!0),r&&e({metric:r}),Pv(t,e,i?s:void 0)}function ZO(t){const e={};t==="event"&&(e.durationThreshold=0),Zr(t,n=>{ei(t,{entries:n})},e)}function Nv(t,e){wi[t]=wi[t]||[],wi[t].push(e)}function Pv(t,e,n){return()=>{n&&n();const r=wi[t];if(!r)return;const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}function Va(t){return typeof t=="number"&&isFinite(t)}function Ur(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const eA=2147483647;function Fe(t){return t/1e3}function fl(){return ee&&ee.addEventListener&&ee.performance}let Df=0,ke={},At,Ci;function tA(){const t=fl();if(t&&pt){t.mark&&ee.performance.mark("sentry-tracing-init");const e=aA(),n=sA(),r=oA(),i=uA();return()=>{e(),n(),r(),i()}}return()=>{}}function nA(){Ni("longtask",({entries:t})=>{for(const e of t){const n=Wn();if(!n)return;const r=Fe(pt+e.startTime),i=Fe(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function rA(){Ni("event",({entries:t})=>{for(const e of t){const n=Wn();if(!n)return;if(e.name==="click"){const r=Fe(pt+e.startTime),i=Fe(e.duration),s={description:No(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i},o=Zk(e.target);o&&(s.attributes={"ui.component_name":o}),n.startChild(s)}}})}function iA(t,e){if(fl()&&pt){const r=cA(t,e);return()=>{r()}}return()=>{}}function sA(){return qO(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(Y&&F.log("[Measurements] Adding CLS"),ke.cls={value:t.value,unit:""},Ci=e)},!0)}function oA(){return GO(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(Y&&F.log("[Measurements] Adding LCP"),ke.lcp={value:t.value,unit:"millisecond"},At=e)},!0)}function aA(){return WO(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=Fe(pt),r=Fe(e.startTime);Y&&F.log("[Measurements] Adding FID"),ke.fid={value:t.value,unit:"millisecond"},ke["mark.fid"]={value:n+r,unit:"second"}})}function uA(){return zO(({metric:t})=>{t.entries[t.entries.length-1]&&(Y&&F.log("[Measurements] Adding TTFB"),ke.ttfb={value:t.value,unit:"millisecond"})})}const Mf={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 cA(t,e){return VO(({metric:n})=>{if(n.value===void 0)return;const r=n.entries.find(y=>y.duration===n.value&&Mf[y.name]!==void 0),i=Xr();if(!r||!i)return;const s=Mf[r.name],o=i.getOptions(),u=Fe(pt+r.startTime),a=Fe(n.value),c=r.interactionId!==void 0?t[r.interactionId]:void 0;if(c===void 0)return;const{routeName:l,parentContext:d,activeTransaction:f,user:h,replayId:p}=c,m=h!==void 0?h.email||h.id||h.ip_address:void 0,_=f!==void 0?f.getProfileId():void 0,g=new _a({startTimestamp:u,endTimestamp:u+a,op:`ui.interaction.${s}`,name:No(r.target),attributes:{release:o.release,environment:o.environment,transaction:l,...m!==void 0&&m!==""?{user:m}:{},..._!==void 0?{profile_id:_}:{},...p!==void 0?{replay_id:p}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),v=vA(d,o,e);if(v&&Math.random()<v){const y=g?hO([g],i.getDsn()):void 0,w=i&&i.getTransport();w&&y&&w.send(y).then(null,R=>{Y&&F.error("Error while sending interaction:",R)});return}})}function lA(t){const e=fl();if(!e||!ee.performance.getEntries||!pt)return;Y&&F.log("[Tracing] Adding & adjusting spans using Performance API");const n=Fe(pt),r=e.getEntries(),{op:i,start_timestamp:s}=Qe(t);if(r.slice(Df).forEach(o=>{const u=Fe(o.startTime),a=Fe(o.duration);if(!(t.op==="navigation"&&s&&n+u<s))switch(o.entryType){case"navigation":{fA(t,o,n);break}case"mark":case"paint":case"measure":{dA(t,o,u,a,n);const c=dl(),l=o.startTime<c.firstHiddenTime;o.name==="first-paint"&&l&&(Y&&F.log("[Measurements] Adding FP"),ke.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&l&&(Y&&F.log("[Measurements] Adding FCP"),ke.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{pA(t,o,o.name,u,a,n);break}}}),Df=Math.max(r.length-1,0),gA(t),i==="pageload"){_A(ke),["fcp","fp","lcp"].forEach(u=>{if(!ke[u]||!s||n>=s)return;const a=ke[u].value,c=n+Fe(a),l=Math.abs((c-s)*1e3),d=l-a;Y&&F.log(`[Measurements] Normalized ${u} from ${a} to ${l} (${d})`),ke[u].value=l});const o=ke["mark.fid"];o&&ke.fid&&(Ur(t,{description:"first input delay",endTimestamp:o.value+Fe(ke.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete ke["mark.fid"]),"fcp"in ke||delete ke.cls,Object.keys(ke).forEach(u=>{fO(u,ke[u].value,ke[u].unit)}),mA(t)}At=void 0,Ci=void 0,ke={}}function dA(t,e,n,r,i){const s=i+n,o=s+r;return Ur(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function fA(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ns(t,e,r,n)}),Ns(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Ns(t,e,"fetch",n,"cache","domainLookupStart"),Ns(t,e,"domainLookup",n,"DNS"),hA(t,e,n)}function Ns(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],u=e[`${n}Start`];!u||!o||Ur(t,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+Fe(u),endTimestamp:r+Fe(o)})}function hA(t,e,n){e.responseEnd&&(Ur(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+Fe(e.requestStart),endTimestamp:n+Fe(e.responseEnd)}),Ur(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+Fe(e.responseStart),endTimestamp:n+Fe(e.responseEnd)}))}function pA(t,e,n,r,i,s){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const o=ha(n),u={};Ka(u,e,"transferSize","http.response_transfer_size"),Ka(u,e,"encodedBodySize","http.response_content_length"),Ka(u,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(u["resource.render_blocking_status"]=e.renderBlockingStatus),o.protocol&&(u["url.scheme"]=o.protocol.split(":").pop()),o.host&&(u["server.address"]=o.host),u["url.same_origin"]=n.includes(ee.location.origin);const a=s+r,c=a+i;Ur(t,{description:n.replace(ee.location.origin,""),endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:u})}function gA(t){const e=ee.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),Va(n.rtt)&&(ke["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Va(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Va(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function mA(t){At&&(Y&&F.log("[Measurements] Adding LCP Data"),At.element&&t.setTag("lcp.element",No(At.element)),At.id&&t.setTag("lcp.id",At.id),At.url&&t.setTag("lcp.url",At.url.trim().slice(0,200)),t.setTag("lcp.size",At.size)),Ci&&Ci.sources&&(Y&&F.log("[Measurements] Adding CLS Data"),Ci.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,No(e.node))))}function Ka(t,e,n,r){const i=e[n];i!=null&&i<eA&&(t[r]=i)}function _A(t){const e=va();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(Y&&F.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function vA(t,e,n){if(!Qr(e))return!1;let r;return t!==void 0&&typeof e.tracesSampler=="function"?r=e.tracesSampler({transactionContext:t,name:t.name,parentSampled:t.parentSampled,attributes:{...t.data,...t.attributes},location:ee.location}):t!==void 0&&t.sampled!==void 0?r=t.sampled:typeof e.tracesSampleRate<"u"?r=e.tracesSampleRate:r=1,Cv(r)?r===!0?n:r===!1?0:r*n:(Y&&F.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}function yA(t,e,n,r,i="auto.http.browser"){if(!Qr()||!t.fetchData)return;const s=e(t.fetchData.url);if(t.endTimestamp&&s){const h=t.fetchData.__span;if(!h)return;const p=r[h];p&&(EA(p,t),delete r[h]);return}const o=Jr(),u=Xr(),{method:a,url:c}=t.fetchData,l=bA(c),d=l?ha(l).host:void 0,f=s?vv({name:`${a} ${c}`,onlyIfParent:!0,attributes:{url:c,type:"fetch","http.method":a,"http.url":l,"server.address":d,[Fn]:i},op:"http.client"}):void 0;if(f&&(t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f),n(t.fetchData.url)&&u){const h=t.args[0];t.args[1]=t.args[1]||{};const p=t.args[1];p.headers=SA(h,u,o,p,f)}return f}function SA(t,e,n,r,i){const s=i||n.getSpan(),o=tl(),{traceId:u,spanId:a,sampled:c,dsc:l}={...o.getPropagationContext(),...n.getPropagationContext()},d=s?ga(s):Jc(u,a,c),f=fv(l||(s?$r(s):el(u,e,n))),h=r.headers||(typeof Request<"u"&&pf(t,Request)?t.headers:void 0);if(h)if(typeof Headers<"u"&&pf(h,Headers)){const p=new Headers(h);return p.append("sentry-trace",d),f&&p.append(Fu,f),p}else if(Array.isArray(h)){const p=[...h,["sentry-trace",d]];return f&&p.push([Fu,f]),p}else{const p="baggage"in h?h.baggage:void 0,m=[];return Array.isArray(p)?m.push(...p):p&&m.push(p),f&&m.push(f),{...h,"sentry-trace":d,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":d,baggage:f}}function bA(t){try{return new URL(t).href}catch{return}}function EA(t,e){if(e.response){nl(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus("internal_error");t.end()}const zu=["localhost",/^\/(?!\/)/],Wu={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:zu,tracePropagationTargets:zu};function TA(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:Wu.traceFetch,traceXHR:Wu.traceXHR,...t},u=typeof s=="function"?s:l=>!0,a=l=>RA(l,r||i),c={};e&&ax(l=>{const d=yA(l,u,a,c);if(d){const f=$v(l.fetchData.url),h=f?ha(f).host:void 0;d.setAttributes({"http.url":f,"server.address":h})}o&&d&&Lf(d)}),n&&vx(l=>{const d=kA(l,u,a,c);o&&d&&Lf(d)})}function IA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Lf(t){const{url:e}=Qe(t).data||{};if(!e||typeof e!="string")return;const n=Ni("resource",({entries:r})=>{r.forEach(i=>{IA(i)&&i.name.endsWith(e)&&(CA(i).forEach(o=>t.setAttribute(...o)),setTimeout(n))})})}function wA(t){let e="unknown",n="unknown",r="";for(const 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 wt(t=0){return((pt||performance.timeOrigin)+t)/1e3}function CA(t){const{name:e,version:n}=wA(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),pt?[...r,["http.request.redirect_start",wt(t.redirectStart)],["http.request.fetch_start",wt(t.fetchStart)],["http.request.domain_lookup_start",wt(t.domainLookupStart)],["http.request.domain_lookup_end",wt(t.domainLookupEnd)],["http.request.connect_start",wt(t.connectStart)],["http.request.secure_connection_start",wt(t.secureConnectionStart)],["http.request.connection_end",wt(t.connectEnd)],["http.request.request_start",wt(t.requestStart)],["http.request.response_start",wt(t.responseStart)],["http.request.response_end",wt(t.responseEnd)]]:r}function RA(t,e){return Yk(t,e||zu)}function kA(t,e,n,r){const i=t.xhr,s=i&&i[gi];if(!Qr()||!i||i.__sentry_own_request__||!s)return;const o=e(s.url);if(t.endTimestamp&&o){const h=i.__sentry_xhr_span_id__;if(!h)return;const p=r[h];p&&s.status_code!==void 0&&(nl(p,s.status_code),p.end(),delete r[h]);return}const u=Jr(),a=tl(),c=$v(s.url),l=c?ha(c).host:void 0,d=o?vv({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":c,url:s.url,"server.address":l,[Fn]:"auto.http.browser"},op:"http.client"}):void 0;d&&(i.__sentry_xhr_span_id__=d.spanContext().spanId,r[i.__sentry_xhr_span_id__]=d);const f=Xr();if(i.setRequestHeader&&n(s.url)&&f){const{traceId:h,spanId:p,sampled:m,dsc:_}={...a.getPropagationContext(),...u.getPropagationContext()},g=d?ga(d):Jc(h,p,m),v=fv(_||(d?$r(d):el(h,f,u)));xA(i,g,v)}return d}function xA(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(Fu,n)}catch{}}function $v(t){try{return new URL(t,ee.location.origin).href}catch{return}}function OA(t,e=!0,n=!0){if(!ee||!ee.location){Y&&F.warn("Could not initialize routing instrumentation due to invalid location");return}let r=ee.location.href,i;e&&(i=t({name:ee.location.pathname,startTimestamp:pt?pt/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&gx(({to:s,from:o})=>{if(o===void 0&&r&&r.indexOf(s)!==-1){r=void 0;return}o!==s&&(r=void 0,i&&(Y&&F.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.end()),i=t({name:ee.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const AA="BrowserTracing",DA={...uo,markBackgroundTransactions:!0,routingInstrumentation:OA,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...Wu},Nf=10;let MA=class{constructor(e){this.name=AA,this._hasSetTracePropagationTargets=!1,Rv(),Y&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...DA,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=tA(),this._interactionIdToRouteNameMapping={},this.options.enableInp&&iA(this._interactionIdToRouteNameMapping,this.options.interactionsSampleRate),this.options.enableLongTask&&nA(),this.options._experiments.enableInteractions&&rA(),this._latestRoute={name:void 0,context:void 0}}setupOnce(e,n){this._getCurrentHub=n;const i=n().getClient(),s=i&&i.getOptions(),{routingInstrumentation:o,startTransactionOnLocationChange:u,startTransactionOnPageLoad:a,markBackgroundTransactions:c,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:h,_experiments:p}=this.options,m=s&&s.tracePropagationTargets,_=m||this.options.tracePropagationTargets;Y&&this._hasSetTracePropagationTargets&&m&&F.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),o(g=>{const v=this._createRouteTransaction(g);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(v,g,n),v},a,u),c&&xO(),p.enableInteractions&&this._registerInteractionListener(),this.options.enableInp&&this._registerInpInteractionListener(),TA({traceFetch:l,traceXHR:d,tracePropagationTargets:_,shouldCreateSpanForRequest:f,enableHTTPTimings:h})}_createRouteTransaction(e){if(!this._getCurrentHub){Y&&F.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const n=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=this.options,u=e.op==="pageload";let a;if(u){const h=u?Pf("sentry-trace"):"",p=u?Pf("baggage"):void 0,{traceId:m,dsc:_,parentSpanId:g,sampled:v}=Ax(h,p);a={traceId:m,parentSpanId:g,parentSampled:v,...e,metadata:{...e.metadata,dynamicSamplingContext:_},trimEnd:!0}}else a={trimEnd:!0,...e};const c=typeof r=="function"?r(a):a,l=c===void 0?{...a,sampled:!1}:c;l.metadata=l.name!==a.name?{...l.metadata,source:"custom"}:l.metadata,this._latestRoute.name=l.name,this._latestRoute.context=l,l.sampled===!1&&Y&&F.log(`[Tracing] Will not send ${l.op} transaction because of beforeNavigate.`),Y&&F.log(`[Tracing] Starting ${l.op} transaction on scope`);const{location:d}=ee,f=Cf(n,l,i,s,!0,{location:d},o,u);return u&&ee.document&&(ee.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(ee.document.readyState)&&f.sendAutoFinishSignal()}),["interactive","complete"].includes(ee.document.readyState)&&f.sendAutoFinishSignal()),f.registerBeforeFinishCallback(h=>{this._collectWebVitals(),lA(h)}),f}_registerInteractionListener(){let e;const n=()=>{const{idleTimeout:r,finalTimeout:i,heartbeatInterval:s}=this.options,o="ui.action.click",u=Wn();if(u&&u.op&&["navigation","pageload"].includes(u.op)){Y&&F.warn(`[Tracing] Did not create ${o} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.end(),e=void 0),!this._getCurrentHub){Y&&F.warn(`[Tracing] Did not create ${o} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRoute.name){Y&&F.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}const a=this._getCurrentHub(),{location:c}=ee,l={name:this._latestRoute.name,op:o,trimEnd:!0,data:{[_n]:this._latestRoute.context?LA(this._latestRoute.context):"url"}};e=Cf(a,l,r,i,!0,{location:c},s)};["click"].forEach(r=>{ee.document&&addEventListener(r,n,{once:!1,capture:!0})})}_registerInpInteractionListener(){const e=({entries:n})=>{const r=Xr(),i=r!==void 0&&r.getIntegrationByName!==void 0?r.getIntegrationByName("Replay"):void 0,s=i!==void 0?i.getReplayId():void 0,o=Wn(),u=Jr(),a=u!==void 0?u.getUser():void 0;n.forEach(c=>{if(NA(c)){const l=c.interactionId;if(l===void 0)return;const d=this._interactionIdToRouteNameMapping[l],f=c.duration,h=c.startTime,p=Object.keys(this._interactionIdToRouteNameMapping),m=p.length>0?p.reduce((_,g)=>this._interactionIdToRouteNameMapping[_].duration<this._interactionIdToRouteNameMapping[g].duration?_:g):void 0;if(c.entryType==="first-input"&&p.map(g=>this._interactionIdToRouteNameMapping[g]).some(g=>g.duration===f&&g.startTime===h)||!l)return;if(d)d.duration=Math.max(d.duration,f);else if(p.length<Nf||m===void 0||f>this._interactionIdToRouteNameMapping[m].duration){const _=this._latestRoute.name,g=this._latestRoute.context;_&&g&&(m&&Object.keys(this._interactionIdToRouteNameMapping).length>=Nf&&delete this._interactionIdToRouteNameMapping[m],this._interactionIdToRouteNameMapping[l]={routeName:_,duration:f,parentContext:g,user:a,activeTransaction:o,replayId:s,startTime:h})}}})};Ni("event",e),Ni("first-input",e)}};function Pf(t){const e=Qk(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function LA(t){const e=t.attributes&&t.attributes[_n],n=t.data&&t.data[_n],r=t.metadata&&t.metadata.source;return e||n||r}function NA(t){return"duration"in t}function PA(){const t=Jn();if(!t.__SENTRY__)return;const e={mongodb(){const r=Un(module,"./node/integrations/mongo");return new r.Mongo},mongoose(){const r=Un(module,"./node/integrations/mongo");return new r.Mongo},mysql(){const r=Un(module,"./node/integrations/mysql");return new r.Mysql},pg(){const r=Un(module,"./node/integrations/postgres");return new r.Postgres}},n=Object.keys(e).filter(r=>!!zn(r)).map(r=>{try{return e[r]()}catch{return}}).filter(r=>r);n.length>0&&(t.__SENTRY__.integrations=[...t.__SENTRY__.integrations||[],...n])}function $A(){Rv(),Ex()&&PA()}const UA=MA,KM={BrowserTracing:UA};(typeof __SENTRY_TRACING__>"u"||__SENTRY_TRACING__)&&$A();var ui={},Ft={},Bt={},$f;function hl(){if($f)return Bt;$f=1;var t=Bt&&Bt.__extends||function(){var r=function(i,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var a in u)Object.prototype.hasOwnProperty.call(u,a)&&(o[a]=u[a])},r(i,s)};return function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");r(i,s);function o(){this.constructor=i}i.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)}}();Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.StatsigInvalidArgumentError=Bt.StatsigUninitializedError=void 0;var e=function(r){t(i,r);function i(s){var o=r.call(this,s??"Call and wait for initialize() to finish first.")||this;return Object.setPrototypeOf(o,i.prototype),o}return i}(Error);Bt.StatsigUninitializedError=e;var n=function(r){t(i,r);function i(s){var o=r.call(this,s)||this;return Object.setPrototypeOf(o,i.prototype),o}return i}(Error);return Bt.StatsigInvalidArgumentError=n,Bt}var at={},Ps={},Uf;function pl(){if(Uf)return Ps;Uf=1,Object.defineProperty(Ps,"__esModule",{value:!0});var t=function(){function e(n,r,i,s,o,u,a,c,l,d){o===void 0&&(o=[]),u===void 0&&(u=""),a===void 0&&(a=null),c===void 0&&(c=null),l===void 0&&(l=null),d===void 0&&(d=null),this.onDefaultValueFallback=null,this.name=n,this.value=JSON.parse(JSON.stringify(r??{})),this.ruleID=i??"",this.secondaryExposures=o,this.allocatedExperimentName=u,this.evaluationDetails=s,this.onDefaultValueFallback=a,this.groupName=c,this.idType=l,this.isExperimentActive=d}return e.prototype.get=function(n,r,i){var s,o,u=this.getValue(n,r);if(u==null)return r;var a=Array.isArray(r)?"array":typeof r,c=Array.isArray(u)?"array":typeof u;return i?i(u)?u:((s=this.onDefaultValueFallback)===null||s===void 0||s.call(this,this,n,a,c),r):r==null||a===c?u:((o=this.onDefaultValueFallback)===null||o===void 0||o.call(this,this,n,a,c),r)},e.prototype.getValue=function(n,r){return n==null?this.value:(r==null&&(r=null),this.value[n]==null?r:this.value[n])},e.prototype.getRuleID=function(){return this.ruleID},e.prototype.getGroupName=function(){return this.groupName},e.prototype.getIDType=function(){return this.idType},e.prototype.getName=function(){return this.name},e.prototype.getEvaluationDetails=function(){return this.evaluationDetails},e.prototype._getSecondaryExposures=function(){return this.secondaryExposures},e.prototype._getAllocatedExperimentName=function(){return this.allocatedExperimentName},e.prototype.getIsExperimentActive=function(){return this.isExperimentActive},e}();return Ps.default=t,Ps}var Ht={},on={},On={},Ff;function Uv(){if(Ff)return On;Ff=1,Object.defineProperty(On,"__esModule",{value:!0}),On.difference=On.now=void 0;function t(n){return n===void 0&&(n={withPrecision:!1}),typeof performance>"u"||!performance?Date.now():n.withPrecision?performance.now():performance.now()|0}On.now=t;function e(n){return t()-n}return On.difference=e,On}var Bf;function ya(){if(Bf)return on;Bf=1;var t=on&&on.__assign||function(){return t=Object.assign||function(i){for(var s,o=1,u=arguments.length;o<u;o++){s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},t.apply(this,arguments)};Object.defineProperty(on,"__esModule",{value:!0}),on.DiagnosticsImpl=void 0;var e=Uv(),n=function(){function i(s){var o=this,u,a,c;this.mark={overall:this.selectAction("overall"),intialize:this.selectStep("initialize"),bootstrap:this.selectStep("bootstrap"),api_call:function(l){switch(l){case"getConfig":return o.selectAction("get_config");case"getExperiment":return o.selectAction("get_experiment");case"checkGate":return o.selectAction("check_gate");case"getLayer":return o.selectAction("get_layer")}return null}},this.context="initialize",this.defaultMaxMarkers=30,this.maxMarkers={initialize:this.defaultMaxMarkers,config_sync:this.defaultMaxMarkers,event_logging:this.defaultMaxMarkers,api_call:this.defaultMaxMarkers},this.markers=(u=s.markers)!==null&&u!==void 0?u:{initialize:[],config_sync:[],event_logging:[],api_call:[]},this.disabled=(c=(a=s.options)===null||a===void 0?void 0:a.getDisableDiagnosticsLogging())!==null&&c!==void 0?c:!1}return i.prototype.setContext=function(s){this.context=s},i.prototype.selectAction=function(s,o){var u=this;return{start:function(a,c){return u.addMarker(t({key:s,step:o,action:"start",timestamp:(0,e.now)({withPrecision:!0})},a??{}),c)},end:function(a,c){return u.addMarker(t({key:s,step:o,action:"end",timestamp:(0,e.now)({withPrecision:!0})},a??{}),c)}}},i.prototype.selectStep=function(s){return{process:this.selectAction(s,"process"),networkRequest:this.selectAction(s,"network_request")}},i.prototype.addMarker=function(s,o){var u;if(this.disabled)return!1;var a=o??this.context;return this.maxMarkers[a]!==void 0&&this.markers[a].length>=((u=this.maxMarkers[a])!==null&&u!==void 0?u:this.defaultMaxMarkers)?!1:(this.markers[a].push(s),!0)},i.prototype.getMarkers=function(s){return this.markers[s]},i.prototype.setMaxMarkers=function(s,o){this.maxMarkers[s]=o},i.prototype.getMarkerCount=function(s){return this.markers[s].length},i.prototype.clearContext=function(s){this.markers[s]=[]},i}();on.DiagnosticsImpl=n;var r=function(){function i(){}return i.initialize=function(s){this.instance=new n(s),this.mark=this.instance.mark,this.disabled=this.instance.disabled,this.getMarkers=this.instance.getMarkers.bind(this.instance),this.getMarkerCount=this.instance.getMarkerCount.bind(this.instance),this.setMaxMarkers=this.instance.setMaxMarkers.bind(this.instance),this.setContext=this.instance.setContext.bind(this.instance),this.clearContext=this.instance.clearContext.bind(this.instance)},i.formatError=function(s){if(s&&typeof s=="object")return{code:this.safeGetField(s,"code"),name:this.safeGetField(s,"name"),message:this.safeGetField(s,"message")}},i.safeGetField=function(s,o){if(o in s)return s[o]},i}();return on.default=r,on}var $s={},Hf;function FA(){if(Hf)return $s;Hf=1,Object.defineProperty($s,"__esModule",{value:!0});function t(n){var r=n??Error("[Statsig] Error was empty"),i=r instanceof Error,s=i?r.name:"No Name",o=i?r.message:void 0,u=i?r.stack:e(r);return{name:s,message:o,trace:u}}$s.default=t;function e(n){try{return JSON.stringify(n)}catch{return"[Statsig] Failed to get string for error."}}return $s}var jf;function BA(){return jf||(jf=1,function(t){var e=Ht&&Ht.__awaiter||function(l,d,f,h){function p(m){return m instanceof f?m:new f(function(_){_(m)})}return new(f||(f=Promise))(function(m,_){function g(w){try{y(h.next(w))}catch(R){_(R)}}function v(w){try{y(h.throw(w))}catch(R){_(R)}}function y(w){w.done?m(w.value):p(w.value).then(g,v)}y((h=h.apply(l,d||[])).next())})},n=Ht&&Ht.__generator||function(l,d){var f={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},h,p,m,_;return _={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function g(y){return function(w){return v([y,w])}}function v(y){if(h)throw new TypeError("Generator is already executing.");for(;f;)try{if(h=1,p&&(m=y[0]&2?p.return:y[0]?p.throw||((m=p.return)&&m.call(p),0):p.next)&&!(m=m.call(p,y[1])).done)return m;switch(p=0,m&&(y=[y[0]&2,m.value]),y[0]){case 0:case 1:m=y;break;case 4:return f.label++,{value:y[1],done:!1};case 5:f.label++,p=y[1],y=[0];continue;case 7:y=f.ops.pop(),f.trys.pop();continue;default:if(m=f.trys,!(m=m.length>0&&m[m.length-1])&&(y[0]===6||y[0]===2)){f=0;continue}if(y[0]===3&&(!m||y[1]>m[0]&&y[1]<m[3])){f.label=y[1];break}if(y[0]===6&&f.label<m[1]){f.label=m[1],m=y;break}if(m&&f.label<m[2]){f.label=m[2],f.ops.push(y);break}m[2]&&f.ops.pop(),f.trys.pop();continue}y=d.call(l,f)}catch(w){y=[6,w],p=0}finally{h=m=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},r=Ht&&Ht.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExceptionEndpoint=void 0;var i=hl(),s=r(ya()),o=r(FA());t.ExceptionEndpoint="https://statsigapi.net/v1/sdk_exception";var u=30,a=1e4,c=function(){function l(d){this.sdkKey=d,this.seen=new Set;var f=Math.floor(Math.random()*a);this.setupDiagnostics(f===0?u:0)}return l.prototype.setStatsigMetadata=function(d){this.statsigMetadata=d},l.prototype.swallow=function(d,f,h){h===void 0&&(h={}),this.capture(d,f,function(){},h)},l.prototype.capture=function(d,f,h,p){var m=this,_=p===void 0?{}:p,g=_.getExtraData,v=_.configName,y=null;try{y=this.beginMarker(d);var w=f(),R=!0;return w instanceof Promise?w.catch(function(E){return R=!1,m.onCaught(d,E,h,g)}).then(function(E){return m.endMarker(d,R,y),E}):(this.endMarker(d,!0,y,v),w)}catch(E){return this.endMarker(d,!1,y,v),this.onCaught(d,E,h,g)}},l.prototype.logError=function(d,f,h){var p=this;(function(){return e(p,void 0,void 0,function(){var m,_,g,v,y,w,R,E;return n(this,function(O){switch(O.label){case 0:return O.trys.push([0,4,,5]),typeof h!="function"?[3,2]:[4,h()];case 1:return _=O.sent(),[3,3];case 2:_=null,O.label=3;case 3:return m=_,g=(0,o.default)(f),v=g.name,y=g.trace,this.seen.has(v)?[2]:(this.seen.add(v),w=(E=this.statsigMetadata)!==null&&E!==void 0?E:{},R=JSON.stringify({tag:d,exception:v,info:y,statsigMetadata:w,extra:m??{}}),[2,fetch(t.ExceptionEndpoint,{method:"POST",headers:{"STATSIG-API-KEY":this.sdkKey,"STATSIG-SDK-TYPE":String(w.sdkType),"STATSIG-SDK-VERSION":String(w.sdkVersion),"Content-Type":"application/json; charset=UTF-8"},body:R})]);case 4:return O.sent(),[3,5];case 5:return[2]}})})})().catch(function(){})},l.prototype.setupDiagnostics=function(d){s.default.setMaxMarkers("api_call",d)},l.prototype.beginMarker=function(d){var f=s.default.mark.api_call(d);if(!f)return null;var h=s.default.getMarkerCount("api_call"),p=d+"_"+h,m=f.start({markerID:p},"api_call");return m?p:null},l.prototype.endMarker=function(d,f,h,p){var m=s.default.mark.api_call(d);!h||!m||m.end({markerID:h,success:f,configName:p},"api_call")},l.prototype.onCaught=function(d,f,h,p){if(f instanceof i.StatsigUninitializedError||f instanceof i.StatsigInvalidArgumentError)throw f;return console.error("[Statsig] An unexpected exception occurred.",f),this.logError(d,f,p),h()},l}();t.default=c}(Ht)),Ht}var Us={},qf;function gl(){if(qf)return Us;qf=1,Object.defineProperty(Us,"__esModule",{value:!0});var t=function(){function e(n,r,i,s,o,u,a,c,l,d){o===void 0&&(o=null),u===void 0&&(u=[]),a===void 0&&(a=[]),c===void 0&&(c=""),l===void 0&&(l=[]),d===void 0&&(d=null),this.logParameterFunction=o,this.name=n,this.value=JSON.parse(JSON.stringify(r??{})),this.ruleID=i??"",this.evaluationDetails=s,this.secondaryExposures=u,this.undelegatedSecondaryExposures=a,this.allocatedExperimentName=c,this.explicitParameters=l,this.groupName=d}return e._create=function(n,r,i,s,o,u,a,c,l,d){return o===void 0&&(o=null),u===void 0&&(u=[]),a===void 0&&(a=[]),c===void 0&&(c=""),l===void 0&&(l=[]),d===void 0&&(d=null),new e(n,r,i,s,o,u,a,c,l,d)},e.prototype.get=function(n,r,i){var s=this,o=this.value[n];if(o==null)return r;var u=function(){return s.logLayerParameterExposure(n),o};return i?i(o)?u():r:r==null||typeof o==typeof r&&Array.isArray(r)===Array.isArray(o)?u():r},e.prototype.getValue=function(n,r){r==null&&(r=null);var i=this.value[n];return i!=null&&this.logLayerParameterExposure(n),i??r},e.prototype.getRuleID=function(){return this.ruleID},e.prototype.getGroupName=function(){return this.groupName},e.prototype.getName=function(){return this.name},e.prototype.getEvaluationDetails=function(){return this.evaluationDetails},e.prototype._getSecondaryExposures=function(){return this.secondaryExposures},e.prototype._getUndelegatedSecondaryExposures=function(){return this.undelegatedSecondaryExposures},e.prototype._getAllocatedExperimentName=function(){return this.allocatedExperimentName},e.prototype._getExplicitParameters=function(){return this.explicitParameters},e.prototype._getEvaluationDetails=function(){return this.evaluationDetails},e.prototype.logLayerParameterExposure=function(n){var r;(r=this.logParameterFunction)===null||r===void 0||r.call(this,this,n)},e}();return Us.default=t,Us}var sr={},Gf;function Fv(){if(Gf)return sr;Gf=1;var t=sr&&sr.__assign||function(){return t=Object.assign||function(n){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},t.apply(this,arguments)};Object.defineProperty(sr,"__esModule",{value:!0});var e=function(){function n(r){this.user=null,this.value=null,this.metadata=null,this.eventName=r,this.statsigMetadata={},this.time=Date.now()}return n.prototype.getName=function(){return this.eventName},n.prototype.setValue=function(r){this.value=r},n.prototype.setMetadata=function(r){this.metadata=r},n.prototype.addStatsigMetadata=function(r,i){this.statsigMetadata[r]=i},n.prototype.setUser=function(r){this.user=t({},r),delete this.user.privateAttributes},n.prototype.setSecondaryExposures=function(r){r===void 0&&(r=[]),this.secondaryExposures=r},n.prototype.toJsonObject=function(){var r;return{eventName:this.eventName,user:this.user,value:this.value,metadata:this.metadata,time:this.time,statsigMetadata:this.statsigMetadata,secondaryExposures:(r=this.secondaryExposures)!==null&&r!==void 0?r:void 0}},n}();return sr.default=e,sr}var Ct={};const HA=ep(cy);var We={},zf;function Sa(){return zf||(zf=1,Object.defineProperty(We,"__esModule",{value:!0}),We.STORAGE_PREFIX=We.LOCAL_STORAGE_KEYS=We.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY=We.STATSIG_STABLE_ID_KEY=We.INTERNAL_STORE_KEY=We.STICKY_DEVICE_EXPERIMENTS_KEY=We.OVERRIDES_STORE_KEY=void 0,We.OVERRIDES_STORE_KEY="STATSIG_LOCAL_STORAGE_INTERNAL_STORE_OVERRIDES_V3",We.STICKY_DEVICE_EXPERIMENTS_KEY="STATSIG_LOCAL_STORAGE_STICKY_DEVICE_EXPERIMENTS",We.INTERNAL_STORE_KEY="STATSIG_LOCAL_STORAGE_INTERNAL_STORE_V4",We.STATSIG_STABLE_ID_KEY="STATSIG_LOCAL_STORAGE_STABLE_ID",We.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY="STATSIG_LOCAL_STORAGE_LOGGING_REQUEST",We.LOCAL_STORAGE_KEYS={STATSIG_LOCAL_STORAGE_STABLE_ID:!0,STATSIG_LOCAL_STORAGE_INTERNAL_STORE_V4:!0,STATSIG_LOCAL_STORAGE_STICKY_DEVICE_EXPERIMENTS:!0,STATSIG_LOCAL_STORAGE_INTERNAL_STORE_OVERRIDES_V3:!0,STATSIG_LOCAL_STORAGE_LOGGING_REQUEST:!0},We.STORAGE_PREFIX="STATSIG_LOCAL_STORAGE"),We}var Fs={},Wf;function as(){if(Wf)return Fs;Wf=1,Object.defineProperty(Fs,"__esModule",{value:!0});var t=function(){function e(){}return e.getItemAsync=function(n){var r;return e.asyncStorage?(r=e.asyncStorage.getItem(n))!==null&&r!==void 0?r:null:Promise.resolve(null)},e.setItemAsync=function(n,r){return e.asyncStorage?e.asyncStorage.setItem(n,r):Promise.resolve()},e.removeItemAsync=function(n){return e.asyncStorage?e.asyncStorage.removeItem(n):Promise.resolve()},e}();return Fs.default=t,Fs}var Bs={},Vf;function ba(){if(Vf)return Bs;Vf=1,Object.defineProperty(Bs,"__esModule",{value:!0});var t=Sa(),e=function(){function n(){}return n.getItem=function(r){var i;try{if(this.isStorageAccessible())return window.localStorage.getItem(r)}catch{}return(i=this.fallbackSessionCache[r])!==null&&i!==void 0?i:null},n.setItem=function(r,i){try{if(this.isStorageAccessible()){window.localStorage.setItem(r,i);return}}catch{}this.fallbackSessionCache[r]=i},n.removeItem=function(r){try{if(this.isStorageAccessible()){window.localStorage.removeItem(r);return}}catch{}delete this.fallbackSessionCache[r]},n.cleanup=function(){try{if(this.isStorageAccessible(!0))for(var r in window.localStorage)typeof window.localStorage[r]=="string"&&r!=null&&(!this.disabled&&r in t.LOCAL_STORAGE_KEYS||!this.disabled&&r.substring(0,t.STORAGE_PREFIX.length)!==t.STORAGE_PREFIX||window.localStorage.removeItem(r))}catch{}},n.isStorageAccessible=function(r){r===void 0&&(r=!1),this.canAccessStorageAccessible==null&&(this.canAccessStorageAccessible=typeof Storage<"u"&&typeof window<"u"&&window!=null&&window.localStorage!=null);var i=this.canAccessStorageAccessible;return(r||!this.disabled)&&i},n.disabled=!1,n.fallbackSessionCache={},n.canAccessStorageAccessible=null,n}();return Bs.default=e,Bs}var ci={},Kf;function jA(){return Kf||(Kf=1,Object.defineProperty(ci,"__esModule",{value:!0}),ci.version=void 0,ci.version="4.42.0"),ci}var Yf;function qA(){if(Yf)return Ct;Yf=1;var t=Ct&&Ct.__awaiter||function(c,l,d,f){function h(p){return p instanceof d?p:new d(function(m){m(p)})}return new(d||(d=Promise))(function(p,m){function _(y){try{v(f.next(y))}catch(w){m(w)}}function g(y){try{v(f.throw(y))}catch(w){m(w)}}function v(y){y.done?p(y.value):h(y.value).then(_,g)}v((f=f.apply(c,l||[])).next())})},e=Ct&&Ct.__generator||function(c,l){var d={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},f,h,p,m;return m={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function _(v){return function(y){return g([v,y])}}function g(v){if(f)throw new TypeError("Generator is already executing.");for(;d;)try{if(f=1,h&&(p=v[0]&2?h.return:v[0]?h.throw||((p=h.return)&&p.call(h),0):h.next)&&!(p=p.call(h,v[1])).done)return p;switch(h=0,p&&(v=[v[0]&2,p.value]),v[0]){case 0:case 1:p=v;break;case 4:return d.label++,{value:v[1],done:!1};case 5:d.label++,h=v[1],v=[0];continue;case 7:v=d.ops.pop(),d.trys.pop();continue;default:if(p=d.trys,!(p=p.length>0&&p[p.length-1])&&(v[0]===6||v[0]===2)){d=0;continue}if(v[0]===3&&(!p||v[1]>p[0]&&v[1]<p[3])){d.label=v[1];break}if(v[0]===6&&d.label<p[1]){d.label=p[1],p=v;break}if(p&&d.label<p[2]){d.label=p[2],d.ops.push(v);break}p[2]&&d.ops.pop(),d.trys.pop();continue}v=l.call(c,d)}catch(y){v=[6,y],h=0}finally{f=p=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},n=Ct&&Ct.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Ct,"__esModule",{value:!0});var r=HA,i=Sa(),s=n(as()),o=n(ba()),u=jA(),a=function(){function c(l,d,f){var h;this.platform=null,this.nativeModules=null,this.sdkType="js-client",this.reactNativeUUID=f,this.user=l,this.sdkVersion=u.version,this.statsigMetadata={sdkType:this.sdkType,sdkVersion:this.sdkVersion};var p=d;s.default.asyncStorage||(p=(h=p??o.default.getItem(i.STATSIG_STABLE_ID_KEY))!==null&&h!==void 0?h:this.getUUID()),p&&(this.statsigMetadata.stableID=p)}return c.prototype.saveStableID=function(){this.statsigMetadata.stableID!=null&&o.default.setItem(i.STATSIG_STABLE_ID_KEY,this.statsigMetadata.stableID)},c.prototype.initAsync=function(){return t(this,void 0,void 0,function(){var l;return e(this,function(d){switch(d.label){case 0:return l=this.statsigMetadata.stableID,l?[3,2]:[4,s.default.getItemAsync(i.STATSIG_STABLE_ID_KEY)];case 1:l=d.sent(),l=l??this.getUUID(),d.label=2;case 2:return s.default.setItemAsync(i.STATSIG_STABLE_ID_KEY,l).catch(function(){}),this.statsigMetadata.stableID=l,[2,this]}})})},c.prototype.getSDKType=function(){return this.sdkType},c.prototype.getSDKVersion=function(){return this.sdkVersion},c.prototype.getStatsigMetadata=function(){return this.statsigMetadata.sdkType=this.sdkType,this.statsigMetadata.sdkVersion=this.sdkVersion,this.statsigMetadata},c.prototype.getUser=function(){return this.user},c.prototype.updateUser=function(l){this.user=l},c.prototype.setSDKPackageInfo=function(l){this.sdkType=l.sdkType,this.sdkVersion=l.sdkVersion},c.prototype.setPlatform=function(l){this.platform=l,this.updateMetadataFromNativeModules()},c.prototype.setNativeModules=function(l){this.nativeModules=l,this.updateMetadataFromNativeModules()},c.prototype.updateMetadataFromNativeModules=function(){var l,d,f,h,p,m,_;this.platform==null||this.nativeModules==null||(((l=this.platform.OS)===null||l===void 0?void 0:l.toLocaleLowerCase())==="android"?this.statsigMetadata.locale=(d=this.nativeModules.I18nManager)===null||d===void 0?void 0:d.localeIdentifier:((f=this.platform.OS)===null||f===void 0?void 0:f.toLocaleLowerCase())==="ios"&&(this.statsigMetadata.locale=((p=(h=this.nativeModules.SettingsManager)===null||h===void 0?void 0:h.settings)===null||p===void 0?void 0:p.AppleLocale)||((_=(m=this.nativeModules.SettingsManager)===null||m===void 0?void 0:m.settings)===null||_===void 0?void 0:_.AppleLanguages[0])))},c.prototype.getUUID=function(){var l,d;return(d=(l=this.reactNativeUUID)===null||l===void 0?void 0:l.v4())!==null&&d!==void 0?d:(0,r.v4)()},c.prototype.setRNDeviceInfo=function(l){var d,f,h,p,m;this.statsigMetadata.appVersion=(d=l.getVersion())!==null&&d!==void 0?d:"",this.statsigMetadata.systemVersion=(f=l.getSystemVersion())!==null&&f!==void 0?f:"",this.statsigMetadata.systemName=(h=l.getSystemName())!==null&&h!==void 0?h:"",this.statsigMetadata.deviceModelName=(p=l.getModel())!==null&&p!==void 0?p:"",this.statsigMetadata.deviceModel=(m=l.getDeviceId())!==null&&m!==void 0?m:""},c.prototype.setExpoConstants=function(l){var d,f;this.statsigMetadata.appVersion=(f=(d=l.nativeAppVersion)!==null&&d!==void 0?d:l.nativeBuildVersion)!==null&&f!==void 0?f:""},c.prototype.setExpoDevice=function(l){var d,f,h,p;this.statsigMetadata.systemVersion=(d=l.osVersion)!==null&&d!==void 0?d:"",this.statsigMetadata.systemName=(f=l.osName)!==null&&f!==void 0?f:"",this.statsigMetadata.deviceModelName=(h=l.modelName)!==null&&h!==void 0?h:"",this.statsigMetadata.deviceModel=(p=l.modelId)!==null&&p!==void 0?p:""},c}();return Ct.default=a,Ct}var Rt={},jt={},Hs={},Xf;function Bv(){if(Xf)return Hs;Xf=1,Object.defineProperty(Hs,"__esModule",{value:!0});var t=function(){function e(){}return e.encodeInitializeCall=!0,e}();return Hs.default=t,Hs}var Jf;function Hv(){return Jf||(Jf=1,function(t){var e=jt&&jt.__awaiter||function(c,l,d,f){function h(p){return p instanceof d?p:new d(function(m){m(p)})}return new(d||(d=Promise))(function(p,m){function _(y){try{v(f.next(y))}catch(w){m(w)}}function g(y){try{v(f.throw(y))}catch(w){m(w)}}function v(y){y.done?p(y.value):h(y.value).then(_,g)}v((f=f.apply(c,l||[])).next())})},n=jt&&jt.__generator||function(c,l){var d={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},f,h,p,m;return m={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function _(v){return function(y){return g([v,y])}}function g(v){if(f)throw new TypeError("Generator is already executing.");for(;d;)try{if(f=1,h&&(p=v[0]&2?h.return:v[0]?h.throw||((p=h.return)&&p.call(h),0):h.next)&&!(p=p.call(h,v[1])).done)return p;switch(h=0,p&&(v=[v[0]&2,p.value]),v[0]){case 0:case 1:p=v;break;case 4:return d.label++,{value:v[1],done:!1};case 5:d.label++,h=v[1],v=[0];continue;case 7:v=d.ops.pop(),d.trys.pop();continue;default:if(p=d.trys,!(p=p.length>0&&p[p.length-1])&&(v[0]===6||v[0]===2)){d=0;continue}if(v[0]===3&&(!p||v[1]>p[0]&&v[1]<p[3])){d.label=v[1];break}if(v[0]===6&&d.label<p[1]){d.label=p[1],p=v;break}if(p&&d.label<p[2]){d.label=p[2],d.ops.push(v);break}p[2]&&d.ops.pop(),d.trys.pop();continue}v=l.call(c,d)}catch(y){v=[6,y],h=0}finally{f=p=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},r=jt&&jt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEndpoint=void 0;var i=r(Bv()),s=r(ya()),o;(function(c){c.Initialize="initialize",c.Rgstr="rgstr",c.LogEventBeacon="log_event_beacon"})(o=t.StatsigEndpoint||(t.StatsigEndpoint={}));var u=204,a=function(){function c(l){this.retryCodes={408:!0,500:!0,502:!0,503:!0,504:!0,522:!0,524:!0,599:!0},this.canUseKeepalive=!1,this.sdkInternal=l,this.leakyBucket={},this.init()}return c.prototype.init=function(){if(!this.sdkInternal.getOptions().getDisableNetworkKeepalive())try{this.canUseKeepalive="keepalive"in new Request("")}catch{this.canUseKeepalive=!1}},c.prototype.fetchValues=function(l){var d=l.user,f=l.sinceTime,h=l.timeout,p=l.useDeltas,m=l.prefetchUsers,_=l.previousDerivedFields,g=l.hadBadDeltaChecksum,v=l.badChecksum,y={user:d,prefetchUsers:m,statsigMetadata:this.sdkInternal.getStatsigMetadata(),sinceTime:f??void 0,canProcessDeltas:p,hash:"djb2",previousDerivedFields:_,hadBadDeltaChecksum:g,badChecksum:v};return this.postWithTimeout(o.Initialize,y,{timeout:h,retries:3,diagnostics:s.default.mark.intialize.networkRequest})},c.prototype.postWithTimeout=function(l,d,f){var h=this,p=f??{},m=p.timeout,_=m===void 0?0:m,g=p.retries,v=g===void 0?0:g,y=p.backoff,w=y===void 0?1e3:y,R=p.diagnostics,E=R===void 0?null:R,O=!1,T=null,S=null,b=[],C=function(N){return function(M){return O&&S?M(S):b.push(M),N}};_!=0&&(T=new Promise(function(N,M){setTimeout(function(){O=!0,M(new Error("The initialization timeout of "+_+"ms has been hit before the network request has completed."))},_)}));var k,I=this.postToEndpoint(l,d,{retryOptions:{retryLimit:v,backoff:w},diagnostics:E}).then(function(N){if(k=N,!k.ok)return Promise.reject(new Error("Request to "+l+" failed with status "+k.status));if(typeof k.data!="object"){var M=new Error("Request to "+l+" received invalid response type. Expected 'object' but got '"+typeof k.data+"'");return h.sdkInternal.getErrorBoundary().logError("postWithTimeoutInvalidRes",M,function(){return e(h,void 0,void 0,function(){return n(this,function($){return[2,this.getErrorData(l,d,v,w,k)]})})}),Promise.reject(M)}var L=k.data;return h.sdkInternal.getErrorBoundary().capture("postWithTimeout",function(){return e(h,void 0,void 0,function(){return n(this,function($){return S=L,O&&(b.forEach(function(U){return U(L)}),b=[]),[2,Promise.resolve(L)]})})},function(){return Promise.resolve({})},{getExtraData:function(){return e(h,void 0,void 0,function(){return n(this,function($){return[2,this.getErrorData(l,d,v,w,k)]})})}})}).catch(function(N){return Promise.reject(N)}),D=T?Promise.race([I,T]):I;return D.eventually=C(D),D},c.prototype.sendLogBeacon=function(l){var d=this.sdkInternal.getOptions();if(d.getLocalModeEnabled())return!0;var f=new URL(d.getEventLoggingApi()+o.LogEventBeacon);f.searchParams.append("k",this.sdkInternal.getSDKKey()),l.clientTime=Date.now()+"";var h=null;try{h=JSON.stringify(l)}catch{return!1}return navigator.sendBeacon(f.toString(),h)},c.prototype.postToEndpoint=function(l,d,f){var h;return e(this,void 0,void 0,function(){var p,m,_,g,v,y,w,R,E,O,T,S,b,C,k,I,D,N,M,L,$,U,x=this;return n(this,function(P){if(p=f??{},m=p.useKeepalive,_=m===void 0?!1:m,g=p.diagnostics,v=g===void 0?null:g,y=(h=f?.retryOptions)!==null&&h!==void 0?h:{},w=y.retryLimit,R=w===void 0?0:w,E=y.attempt,O=E===void 0?1:E,T=y.backoff,S=T===void 0?1e3:T,b=this.sdkInternal.getOptions(),b.getLocalModeEnabled())return[2,Promise.reject("no network requests in localMode")];if(typeof fetch!="function")return[2,Promise.reject("fetch is not defined")];if(typeof window>"u"&&!b.getIgnoreWindowUndefined())return[2,Promise.reject("window is not defined")];if(C=[o.Initialize].includes(l)?b.getApi():b.getEventLoggingApi(),k=C+l,I=this.leakyBucket[k],I!=null&&I>=30)return[2,Promise.reject(new Error("Request failed because you are making the same request too frequently."))];if(I==null?this.leakyBucket[k]=1:this.leakyBucket[k]=I+1,D=l===o.Initialize&&i.default.encodeInitializeCall&&typeof window<"u"&&typeof window?.btoa=="function",N=JSON.stringify(d),D)try{M=window.btoa(N).split("").reverse().join(""),N=M}catch{D=!1}return L={method:"POST",body:N,headers:{"Content-type":"application/json; charset=UTF-8","STATSIG-API-KEY":this.sdkInternal.getSDKKey(),"STATSIG-CLIENT-TIME":Date.now()+"","STATSIG-SDK-TYPE":this.sdkInternal.getSDKType(),"STATSIG-SDK-VERSION":this.sdkInternal.getSDKVersion(),"STATSIG-ENCODED":D?"1":"0"}},this.canUseKeepalive&&_&&(L.keepalive=!0),v?.start({attempt:O}),U=!0,[2,fetch(k,L).then(function(B){return e(x,void 0,void 0,function(){var H,W,X;return n(this,function(se){switch(se.label){case 0:return $=B,$.ok?(H=$,$.status!==u?[3,1]:(H.data={has_updates:!1,is_no_content:!0},[3,3])):[3,4];case 1:return[4,$.text()];case 2:W=se.sent(),H.data=JSON.parse(W),se.label=3;case 3:return v?.end(this.getDiagnosticsData($,O)),[2,Promise.resolve(H)];case 4:return this.retryCodes[$.status]||(U=!1),[4,$.text()];case 5:return X=se.sent(),[2,Promise.reject(new Error($.status+": "+X))]}})})}).catch(function(B){return v?.end(x.getDiagnosticsData($,O,B)),O<R&&U?new Promise(function(H,W){setTimeout(function(){x.leakyBucket[k]=Math.max(x.leakyBucket[k]-1,0),x.postToEndpoint(l,d,{retryOptions:{retryLimit:R,attempt:O+1,backoff:S*2},useKeepalive:_,diagnostics:v}).then(H).catch(W)},S)}):Promise.reject(B)}).finally(function(){x.leakyBucket[k]=Math.max(x.leakyBucket[k]-1,0)})]})})},c.prototype.supportsKeepalive=function(){return this.canUseKeepalive},c.prototype.getDiagnosticsData=function(l,d,f){var h,p;return{success:l?.ok===!0,statusCode:l?.status,sdkRegion:(h=l?.headers)===null||h===void 0?void 0:h.get("x-statsig-region"),isDelta:((p=l?.data)===null||p===void 0?void 0:p.is_delta)===!0,attempt:d,error:s.default.formatError(f)}},c.prototype.getErrorData=function(l,d,f,h,p){var m;return e(this,void 0,void 0,function(){var _;return n(this,function(g){try{return _={},((m=p.headers)!==null&&m!==void 0?m:[]).forEach(function(v,y){_[y]=v}),[2,{responseInfo:{headers:_,status:p.status,statusText:p.statusText,type:p.type,url:p.url,redirected:p.redirected,bodySnippet:p.data?JSON.stringify(p.data).slice(0,500):null},requestInfo:{endpointName:l,bodySnippet:JSON.stringify(d).slice(0,500),retries:f,backoff:h}}]}catch{return[2,{statusText:"statsig::failed to extract extra data"}]}return[2]})})},c}();t.default=a}(jt)),jt}var Qf;function GA(){if(Qf)return Rt;Qf=1;var t=Rt&&Rt.__awaiter||function(C,k,I,D){function N(M){return M instanceof I?M:new I(function(L){L(M)})}return new(I||(I=Promise))(function(M,L){function $(P){try{x(D.next(P))}catch(B){L(B)}}function U(P){try{x(D.throw(P))}catch(B){L(B)}}function x(P){P.done?M(P.value):N(P.value).then($,U)}x((D=D.apply(C,k||[])).next())})},e=Rt&&Rt.__generator||function(C,k){var I={label:0,sent:function(){if(M[0]&1)throw M[1];return M[1]},trys:[],ops:[]},D,N,M,L;return L={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function $(x){return function(P){return U([x,P])}}function U(x){if(D)throw new TypeError("Generator is already executing.");for(;I;)try{if(D=1,N&&(M=x[0]&2?N.return:x[0]?N.throw||((M=N.return)&&M.call(N),0):N.next)&&!(M=M.call(N,x[1])).done)return M;switch(N=0,M&&(x=[x[0]&2,M.value]),x[0]){case 0:case 1:M=x;break;case 4:return I.label++,{value:x[1],done:!1};case 5:I.label++,N=x[1],x=[0];continue;case 7:x=I.ops.pop(),I.trys.pop();continue;default:if(M=I.trys,!(M=M.length>0&&M[M.length-1])&&(x[0]===6||x[0]===2)){I=0;continue}if(x[0]===3&&(!M||x[1]>M[0]&&x[1]<M[3])){I.label=x[1];break}if(x[0]===6&&I.label<M[1]){I.label=M[1],M=x;break}if(M&&I.label<M[2]){I.label=M[2],I.ops.push(x);break}M[2]&&I.ops.pop(),I.trys.pop();continue}x=k.call(C,I)}catch(P){x=[6,P],N=0}finally{D=M=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}},n=Rt&&Rt.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(Rt,"__esModule",{value:!0});var r=n(Fv()),i=Hv(),s=Sa(),o=n(ya()),u=n(as()),a=n(ba()),c="statsig::",l=c+"config_exposure",d=c+"layer_exposure",f=c+"gate_exposure",h=c+"log_event_failed",p=c+"app_error",m=c+"app_metrics::page_load_time",_=c+"app_metrics::dom_interactive_time",g=c+"app_metrics::scroll_depth",v=c+"app_metrics::time_on_page_ms",y=c+"diagnostics",w=c+"default_value_type_mismatch",R=5*24*60*60*1e3,E=100,O=1e3,T=1024*O,S=10,b=function(){function C(k){this.failedLogEventCount=0,this.sdkInternal=k,this.queue=[],this.flushInterval=null,this.loggedErrors=new Set,this.failedLogEvents=[],this.exposureDedupeKeys={},this.failedLogEventCount=0,this.init()}return C.prototype.init=function(){var k=this;typeof window<"u"&&typeof window.addEventListener=="function"&&(window.addEventListener("blur",function(){return k.flush(!0)}),window.addEventListener("beforeunload",function(){return k.flush(!0)}),window.addEventListener("load",function(){setTimeout(function(){return k.flush()},100),setTimeout(function(){return k.flush()},1e3)})),typeof document<"u"&&typeof document.addEventListener=="function"&&document.addEventListener("visibilitychange",function(){k.flush(document.visibilityState!=="visible")}),!(!this.sdkInternal.getOptions().getIgnoreWindowUndefined()&&(typeof window>"u"||window==null))&&(this.sdkInternal.getOptions().getLocalModeEnabled()||(this.flushInterval=setInterval(function(){k.flush()},this.sdkInternal.getOptions().getLoggingIntervalMillis()),setTimeout(function(){return k.flush()},100),setTimeout(function(){return k.flush()},1e3)))},C.prototype.log=function(k){if(!this.sdkInternal.getOptions().isAllLoggingDisabled()){try{if(!this.sdkInternal.getOptions().getDisableCurrentPageLogging()&&typeof window<"u"&&window!=null&&typeof window.location=="object"&&typeof window.location.href=="string"){var I=window.location.href.split(/[?#]/);I?.length>0&&k.addStatsigMetadata("currentPage",I[0])}}catch{}this.queue.push(k.toJsonObject()),this.queue.length>=this.sdkInternal.getOptions().getLoggingBufferMaxSize()&&this.flush()}},C.prototype.resetDedupeKeys=function(){this.exposureDedupeKeys={}},C.prototype.shouldLogExposure=function(k){var I=this.exposureDedupeKeys[k],D=Date.now();return I==null?(this.exposureDedupeKeys[k]=D,!0):I>=D-600*1e3?!1:(this.exposureDedupeKeys[k]=D,!0)},C.prototype.logGateExposure=function(k,I,D,N,M,L,$){var U=I+String(D)+N+L.reason;if(this.shouldLogExposure(U)){var x={gate:I,gateValue:String(D),ruleID:N,reason:L.reason,time:L.time};$&&(x.isManualExposure="true");var P=new r.default(f);P.setUser(k),P.setMetadata(x),P.setSecondaryExposures(M),this.log(P)}},C.prototype.logConfigExposure=function(k,I,D,N,M,L){var $=I+D+M.reason;if(this.shouldLogExposure($)){var U={config:I,ruleID:D,reason:M.reason,time:M.time};L&&(U.isManualExposure="true");var x=new r.default(l);x.setUser(k),x.setMetadata(U),x.setSecondaryExposures(N),this.log(x)}},C.prototype.logLayerExposure=function(k,I,D,N,M,L,$,U,x){var P=[I,D,M,L,String($),U.reason].join("|");if(this.shouldLogExposure(P)){var B={config:I,ruleID:D,allocatedExperiment:M,parameterName:L,isExplicitParameter:String($),reason:U.reason,time:U.time};x&&(B.isManualExposure="true");var H=new r.default(d);H.setUser(k),H.setMetadata(B),H.setSecondaryExposures(N),this.log(H)}},C.prototype.logConfigDefaultValueFallback=function(k,I,D){this.logGenericEvent(w,k,I,D),this.loggedErrors.add(I),this.sdkInternal.getConsoleLogger().error(I)},C.prototype.logAppError=function(k,I,D){var N=I.substring(0,128);this.loggedErrors.has(N)||this.loggedErrors.size>S||(this.logGenericEvent(p,k,N,D),this.loggedErrors.add(N))},C.prototype.logDiagnostics=function(k,I){if(!o.default.disabled){var D=o.default.getMarkers(I);o.default.clearContext(I);var N=this.makeDiagnosticsEvent(k,{markers:D,context:I});this.log(N)}},C.prototype.logAppMetrics=function(k){var I=this,D;if(typeof((D=window?.performance)===null||D===void 0?void 0:D.getEntriesByType)=="function"){var N=window.performance.getEntriesByType("navigation");if(!(!N||N.length<1)){var M=N[0],L={url:M.name};if(M instanceof PerformanceNavigationTiming&&(this.logGenericEvent(m,k,M.duration,L),this.logGenericEvent(_,k,M.domInteractive-M.startTime,L)),typeof window?.addEventListener=="function"&&document?.body){var $=0;window.addEventListener("scroll",function(){var U=document.body.scrollHeight||1,x=Math.min(100,Math.round((window.scrollY+window.innerHeight)/U*100));x>$&&($=x)}),window.addEventListener("beforeunload",function(){I.logGenericEvent(g,k,$,L),I.logGenericEvent(v,k,window.performance.now(),L)})}}}},C.prototype.logGenericEvent=function(k,I,D,N){var M=new r.default(k);return M.setUser(I),M.setValue(D),M.setMetadata(N),this.log(M),M},C.prototype.shutdown=function(){this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.flush(!0)},C.prototype.flush=function(k){var I=this;if(k===void 0&&(k=!1),this.addErrorBoundaryDiagnostics(),this.queue.length!==0){var D=this.queue;if(this.queue=[],k&&!this.sdkInternal.getNetwork().supportsKeepalive()&&typeof navigator<"u"&&navigator?.sendBeacon!=null){var N=this.sdkInternal.getNetwork().sendLogBeacon({events:D,statsigMetadata:this.sdkInternal.getStatsigMetadata()});N||(this.queue=D.concat(this.queue),this.queue.length>0&&(this.addFailedRequest({events:this.queue,statsigMetadata:this.sdkInternal.getStatsigMetadata(),time:Date.now()}),this.queue=[]),this.saveFailedRequests());return}this.sdkInternal.getNetwork().postToEndpoint(i.StatsigEndpoint.Rgstr,{events:D,statsigMetadata:this.sdkInternal.getStatsigMetadata()},{retryOptions:{retryLimit:3,backoff:1e3},useKeepalive:k}).then(function(M){if(!M.ok)throw M}).catch(function(M){typeof M.text=="function"?M.text().then(function(L){I.sdkInternal.getErrorBoundary().logError(h,M,function(){return t(I,void 0,void 0,function(){return e(this,function($){return[2,{eventCount:D.length,error:L}]})})})}):I.sdkInternal.getErrorBoundary().logError(h,M,function(){return t(I,void 0,void 0,function(){return e(this,function(L){return[2,{eventCount:D.length,error:M.message}]})})}),I.newFailedRequest(h,D)}).finally(function(){return t(I,void 0,void 0,function(){return e(this,function(M){return k&&(this.queue.length>0&&(this.addFailedRequest({events:this.queue,statsigMetadata:this.sdkInternal.getStatsigMetadata(),time:Date.now()}),this.queue=[]),this.saveFailedRequests()),[2]})})})}},C.prototype.saveFailedRequests=function(){var k=this;if(this.failedLogEvents.length>0){var I=JSON.stringify(this.failedLogEvents);if(I.length>T){this.clearLocalStorageRequests();return}if(u.default.asyncStorage){u.default.setItemAsync(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY,I).catch(function(D){return k.sdkInternal.getErrorBoundary().logError("saveFailedRequests",D)});return}a.default.setItem(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY,I)}},C.prototype.sendSavedRequests=function(){return t(this,void 0,void 0,function(){var k,I,D,N,M,L,$,U,x=this;return e(this,function(P){switch(P.label){case 0:return I=!1,u.default.asyncStorage?[4,u.default.getItemAsync(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY)]:[3,2];case 1:return k=P.sent(),[3,3];case 2:k=a.default.getItem(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY),P.label=3;case 3:if(k==null)return this.clearLocalStorageRequests(),[2];k.length>T&&(I=!0),D=[];try{for(D=JSON.parse(k),N=function(B){B!=null&&B.events&&Array.isArray(B.events)&&M.sdkInternal.getNetwork().postToEndpoint(i.StatsigEndpoint.Rgstr,B).then(function(H){if(!H.ok)throw Error(H.status+"")}).catch(function(){I||x.addFailedRequest(B)})},M=this,L=0,$=D;L<$.length;L++)U=$[L],N(U)}catch(B){this.sdkInternal.getErrorBoundary().logError("sendSavedRequests",B)}finally{this.clearLocalStorageRequests()}return[2]}})})},C.prototype.addFailedRequest=function(k){if(!(k.time<Date.now()-R)&&!(this.failedLogEvents.length>E)){var I=k.events.length;this.failedLogEventCount+I>O||(this.failedLogEvents.push(k),this.failedLogEventCount+=I)}},C.prototype.clearLocalStorageRequests=function(){var k=this;u.default.asyncStorage?u.default.removeItemAsync(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY).catch(function(I){return k.sdkInternal.getErrorBoundary().logError("clearLocalStorageRequests",I)}):a.default.removeItem(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY)},C.prototype.newFailedRequest=function(k,I){this.loggedErrors.has(k)||(this.loggedErrors.add(k),this.failedLogEvents.push({events:I,statsigMetadata:this.sdkInternal.getStatsigMetadata(),time:Date.now()}),this.saveFailedRequests())},C.prototype.makeDiagnosticsEvent=function(k,I){var D=new r.default(y);return D.setUser(k),D.setMetadata(I),D},C.prototype.addErrorBoundaryDiagnostics=function(){if(o.default.getMarkerCount("api_call")!==0){var k=this.makeDiagnosticsEvent(this.sdkInternal.getCurrentUser(),{context:"api_call",markers:o.default.getMarkers("api_call")});this.queue.push(k),o.default.clearContext("api_call")}},C}();return Rt.default=b,Rt}var Ya={},Zf;function jv(){return Zf||(Zf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=t.INIT_TIMEOUT_DEFAULT_MS=void 0;var e="https://featuregates.org/v1/",n="https://events.statsigapi.net/v1/";t.INIT_TIMEOUT_DEFAULT_MS=3e3;var r;(function(s){s[s.NONE=0]="NONE",s[s.INFO=1]="INFO",s[s.DEBUG=2]="DEBUG"})(r=t.LogLevel||(t.LogLevel={}));var i=function(){function s(o){var u,a,c,l,d,f,h,p,m,_,g,v,y,w,R,E,O,T,S,b,C,k,I;o==null&&(o={});var D=(u=o.api)!==null&&u!==void 0?u:e;this.api=D.endsWith("/")?D:D+"/",this.disableCurrentPageLogging=(a=o.disableCurrentPageLogging)!==null&&a!==void 0?a:!1,this.environment=(c=o.environment)!==null&&c!==void 0?c:null,this.loggingIntervalMillis=this.normalizeNumberInput(o.loggingIntervalMillis,{default:1e4,min:1e3,max:6e4}),this.loggingBufferMaxSize=this.normalizeNumberInput(o.loggingBufferMaxSize,{default:100,min:2,max:500}),this.disableNetworkKeepalive=(l=o.disableNetworkKeepalive)!==null&&l!==void 0?l:!1,this.overrideStableID=(d=o.overrideStableID)!==null&&d!==void 0?d:null,this.localMode=(f=o.localMode)!==null&&f!==void 0?f:!1,this.initTimeoutMs=o.initTimeoutMs&&o.initTimeoutMs>=0?o.initTimeoutMs:t.INIT_TIMEOUT_DEFAULT_MS,this.disableErrorLogging=(h=o.disableErrorLogging)!==null&&h!==void 0?h:!1,this.disableAutoMetricsLogging=(p=o.disableAutoMetricsLogging)!==null&&p!==void 0?p:!1,this.initializeValues=(m=o.initializeValues)!==null&&m!==void 0?m:null;var N=(g=(_=o.eventLoggingApi)!==null&&_!==void 0?_:o.api)!==null&&g!==void 0?g:n;this.eventLoggingApi=N.endsWith("/")?N:N+"/",this.prefetchUsers=(v=o.prefetchUsers)!==null&&v!==void 0?v:[],this.disableLocalStorage=(y=o.disableLocalStorage)!==null&&y!==void 0?y:!1,this.initCompletionCallback=(w=o.initCompletionCallback)!==null&&w!==void 0?w:null,this.updateCompletionCallback=(R=o.updateUserCompletionCallback)!==null&&R!==void 0?R:null,this.disableDiagnosticsLogging=(E=o.disableDiagnosticsLogging)!==null&&E!==void 0?E:!1,this.logLevel=(O=o?.logLevel)!==null&&O!==void 0?O:r.NONE,this.ignoreWindowUndefined=(T=o?.ignoreWindowUndefined)!==null&&T!==void 0?T:!1,this.fetchMode=(S=o.fetchMode)!==null&&S!==void 0?S:"network-only",this.disableLocalOverrides=(b=o?.disableLocalOverrides)!==null&&b!==void 0?b:!1,this.gateEvaluationCallback=(C=o?.gateEvaluationCallback)!==null&&C!==void 0?C:null,this.userPersistentStorage=(k=o?.userPersistentStorage)!==null&&k!==void 0?k:null,this.disableAllLogging=(I=o.disableAllLogging)!==null&&I!==void 0?I:!1}return s.prototype.getApi=function(){return this.api},s.prototype.getEnvironment=function(){return this.environment},s.prototype.getDisableCurrentPageLogging=function(){return this.disableCurrentPageLogging},s.prototype.getLoggingIntervalMillis=function(){return this.loggingIntervalMillis},s.prototype.getLoggingBufferMaxSize=function(){return this.loggingBufferMaxSize},s.prototype.getDisableNetworkKeepalive=function(){return this.disableNetworkKeepalive},s.prototype.getOverrideStableID=function(){return this.overrideStableID},s.prototype.getLocalModeEnabled=function(){return this.localMode},s.prototype.getInitTimeoutMs=function(){return this.initTimeoutMs},s.prototype.getDisableErrorLogging=function(){return this.disableErrorLogging},s.prototype.getDisableAutoMetricsLogging=function(){return this.disableAutoMetricsLogging},s.prototype.getInitializeValues=function(){return this.initializeValues},s.prototype.getEventLoggingApi=function(){return this.eventLoggingApi},s.prototype.getPrefetchUsers=function(){return this.prefetchUsers},s.prototype.getDisableLocalStorage=function(){return this.disableLocalStorage},s.prototype.getInitCompletionCallback=function(){return this.initCompletionCallback},s.prototype.getUpdateUserCompletionCallback=function(){return this.updateCompletionCallback},s.prototype.getDisableDiagnosticsLogging=function(){return this.disableDiagnosticsLogging},s.prototype.getLogLevel=function(){return this.logLevel},s.prototype.getIgnoreWindowUndefined=function(){return this.ignoreWindowUndefined},s.prototype.getFetchMode=function(){return this.fetchMode},s.prototype.getDisableLocalOverrides=function(){return this.disableLocalOverrides},s.prototype.getGateEvaluationCallback=function(){return this.gateEvaluationCallback},s.prototype.getUserPersistentStorage=function(){return this.userPersistentStorage},s.prototype.isAllLoggingDisabled=function(){return this.disableAllLogging},s.prototype.reenableAllLogging=function(){this.disableAllLogging=!1},s.prototype.normalizeNumberInput=function(o,u){return o==null?u.default:Math.max(Math.min(o,u.max),u.min)},s}();t.default=i}(Ya)),Ya}var ut={},or={},qt={},Ve={},Xa={},eh;function zA(){return eh||(eh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Base64=void 0,t.Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_encodeBinary:function(e){for(var n="",r,i,s,o,u,a,c,l=0;l<e.length;)r=e.charCodeAt(l++),i=e.charCodeAt(l++),s=e.charCodeAt(l++),o=r>>2,u=(r&3)<<4|i>>4,a=(i&15)<<2|s>>6,c=s&63,isNaN(i)?a=c=64:isNaN(s)&&(c=64),n=n+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)+this._keyStr.charAt(c);return n},encodeArrayBuffer:function(e){for(var n="",r=new Uint8Array(e),i=r.byteLength,s=0;s<i;s++)n+=String.fromCharCode(r[s]);return t.Base64._encodeBinary(n)}}}(Xa)),Xa}var Ja={exports:{}};const WA={},VA=Object.freeze(Object.defineProperty({__proto__:null,default:WA},Symbol.toStringTag,{value:"Module"})),th=ep(VA);/**
* [js-sha256]{@link https://github.com/emn178/js-sha256}
*
* @version 0.10.1
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2023
* @license MIT
*/var nh;function KA(){return nh||(nh=1,function(t){(function(){var e="input is invalid type",n=typeof window=="object",r=n?window:{};r.JS_SHA256_NO_WINDOW&&(n=!1);var i=!n&&typeof self=="object",s=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?r=dy:i&&(r=self);var o=!r.JS_SHA256_NO_COMMON_JS&&!0&&t.exports,u=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",a="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],l=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],h=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(E){return Object.prototype.toString.call(E)==="[object Array]"}),u&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(E){return typeof E=="object"&&E.buffer&&E.buffer.constructor===ArrayBuffer});var p=function(E,O){return function(T){return new y(O,!0).update(T)[E]()}},m=function(E){var O=p("hex",E);s&&(O=_(O,E)),O.create=function(){return new y(E)},O.update=function(b){return O.create().update(b)};for(var T=0;T<f.length;++T){var S=f[T];O[S]=p(S,E)}return O},_=function(E,O){var T=th,S=th.Buffer,b=O?"sha224":"sha256",C;S.from&&!r.JS_SHA256_NO_BUFFER_FROM?C=S.from:C=function(I){return new S(I)};var k=function(I){if(typeof I=="string")return T.createHash(b).update(I,"utf8").digest("hex");if(I==null)throw new Error(e);return I.constructor===ArrayBuffer&&(I=new Uint8Array(I)),Array.isArray(I)||ArrayBuffer.isView(I)||I.constructor===S?T.createHash(b).update(C(I)).digest("hex"):E(I)};return k},g=function(E,O){return function(T,S){return new w(T,O,!0).update(S)[E]()}},v=function(E){var O=g("hex",E);O.create=function(b){return new w(b,E)},O.update=function(b,C){return O.create(b).update(C)};for(var T=0;T<f.length;++T){var S=f[T];O[S]=g(S,E)}return O};function y(E,O){O?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=E}y.prototype.update=function(E){if(!this.finalized){var O,T=typeof E;if(T!=="string"){if(T==="object"){if(E===null)throw new Error(e);if(u&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!u||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);O=!0}for(var S,b=0,C,k=E.length,I=this.blocks;b<k;){if(this.hashed&&(this.hashed=!1,I[0]=this.block,I[16]=I[1]=I[2]=I[3]=I[4]=I[5]=I[6]=I[7]=I[8]=I[9]=I[10]=I[11]=I[12]=I[13]=I[14]=I[15]=0),O)for(C=this.start;b<k&&C<64;++b)I[C>>2]|=E[b]<<l[C++&3];else for(C=this.start;b<k&&C<64;++b)S=E.charCodeAt(b),S<128?I[C>>2]|=S<<l[C++&3]:S<2048?(I[C>>2]|=(192|S>>6)<<l[C++&3],I[C>>2]|=(128|S&63)<<l[C++&3]):S<55296||S>=57344?(I[C>>2]|=(224|S>>12)<<l[C++&3],I[C>>2]|=(128|S>>6&63)<<l[C++&3],I[C>>2]|=(128|S&63)<<l[C++&3]):(S=65536+((S&1023)<<10|E.charCodeAt(++b)&1023),I[C>>2]|=(240|S>>18)<<l[C++&3],I[C>>2]|=(128|S>>12&63)<<l[C++&3],I[C>>2]|=(128|S>>6&63)<<l[C++&3],I[C>>2]|=(128|S&63)<<l[C++&3]);this.lastByteIndex=C,this.bytes+=C-this.start,C>=64?(this.block=I[16],this.start=C-64,this.hash(),this.hashed=!0):this.start=C}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var E=this.blocks,O=this.lastByteIndex;E[16]=this.block,E[O>>2]|=c[O&3],this.block=E[16],O>=56&&(this.hashed||this.hash(),E[0]=this.block,E[16]=E[1]=E[2]=E[3]=E[4]=E[5]=E[6]=E[7]=E[8]=E[9]=E[10]=E[11]=E[12]=E[13]=E[14]=E[15]=0),E[14]=this.hBytes<<3|this.bytes>>>29,E[15]=this.bytes<<3,this.hash()}},y.prototype.hash=function(){var E=this.h0,O=this.h1,T=this.h2,S=this.h3,b=this.h4,C=this.h5,k=this.h6,I=this.h7,D=this.blocks,N,M,L,$,U,x,P,B,H,W,X;for(N=16;N<64;++N)U=D[N-15],M=(U>>>7|U<<25)^(U>>>18|U<<14)^U>>>3,U=D[N-2],L=(U>>>17|U<<15)^(U>>>19|U<<13)^U>>>10,D[N]=D[N-16]+M+D[N-7]+L<<0;for(X=O&T,N=0;N<64;N+=4)this.first?(this.is224?(B=300032,U=D[0]-1413257819,I=U-150054599<<0,S=U+24177077<<0):(B=704751109,U=D[0]-210244248,I=U-1521486534<<0,S=U+143694565<<0),this.first=!1):(M=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),L=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),B=E&O,$=B^E&T^X,P=b&C^~b&k,U=I+L+P+d[N]+D[N],x=M+$,I=S+U<<0,S=U+x<<0),M=(S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),L=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),H=S&E,$=H^S&O^B,P=I&b^~I&C,U=k+L+P+d[N+1]+D[N+1],x=M+$,k=T+U<<0,T=U+x<<0,M=(T>>>2|T<<30)^(T>>>13|T<<19)^(T>>>22|T<<10),L=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),W=T&S,$=W^T&E^H,P=k&I^~k&b,U=C+L+P+d[N+2]+D[N+2],x=M+$,C=O+U<<0,O=U+x<<0,M=(O>>>2|O<<30)^(O>>>13|O<<19)^(O>>>22|O<<10),L=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),X=O&T,$=X^O&S^W,P=C&k^~C&I,U=b+L+P+d[N+3]+D[N+3],x=M+$,b=E+U<<0,E=U+x<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+E<<0,this.h1=this.h1+O<<0,this.h2=this.h2+T<<0,this.h3=this.h3+S<<0,this.h4=this.h4+b<<0,this.h5=this.h5+C<<0,this.h6=this.h6+k<<0,this.h7=this.h7+I<<0},y.prototype.hex=function(){this.finalize();var E=this.h0,O=this.h1,T=this.h2,S=this.h3,b=this.h4,C=this.h5,k=this.h6,I=this.h7,D=a[E>>28&15]+a[E>>24&15]+a[E>>20&15]+a[E>>16&15]+a[E>>12&15]+a[E>>8&15]+a[E>>4&15]+a[E&15]+a[O>>28&15]+a[O>>24&15]+a[O>>20&15]+a[O>>16&15]+a[O>>12&15]+a[O>>8&15]+a[O>>4&15]+a[O&15]+a[T>>28&15]+a[T>>24&15]+a[T>>20&15]+a[T>>16&15]+a[T>>12&15]+a[T>>8&15]+a[T>>4&15]+a[T&15]+a[S>>28&15]+a[S>>24&15]+a[S>>20&15]+a[S>>16&15]+a[S>>12&15]+a[S>>8&15]+a[S>>4&15]+a[S&15]+a[b>>28&15]+a[b>>24&15]+a[b>>20&15]+a[b>>16&15]+a[b>>12&15]+a[b>>8&15]+a[b>>4&15]+a[b&15]+a[C>>28&15]+a[C>>24&15]+a[C>>20&15]+a[C>>16&15]+a[C>>12&15]+a[C>>8&15]+a[C>>4&15]+a[C&15]+a[k>>28&15]+a[k>>24&15]+a[k>>20&15]+a[k>>16&15]+a[k>>12&15]+a[k>>8&15]+a[k>>4&15]+a[k&15];return this.is224||(D+=a[I>>28&15]+a[I>>24&15]+a[I>>20&15]+a[I>>16&15]+a[I>>12&15]+a[I>>8&15]+a[I>>4&15]+a[I&15]),D},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var E=this.h0,O=this.h1,T=this.h2,S=this.h3,b=this.h4,C=this.h5,k=this.h6,I=this.h7,D=[E>>24&255,E>>16&255,E>>8&255,E&255,O>>24&255,O>>16&255,O>>8&255,O&255,T>>24&255,T>>16&255,T>>8&255,T&255,S>>24&255,S>>16&255,S>>8&255,S&255,b>>24&255,b>>16&255,b>>8&255,b&255,C>>24&255,C>>16&255,C>>8&255,C&255,k>>24&255,k>>16&255,k>>8&255,k&255];return this.is224||D.push(I>>24&255,I>>16&255,I>>8&255,I&255),D},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var E=new ArrayBuffer(this.is224?28:32),O=new DataView(E);return O.setUint32(0,this.h0),O.setUint32(4,this.h1),O.setUint32(8,this.h2),O.setUint32(12,this.h3),O.setUint32(16,this.h4),O.setUint32(20,this.h5),O.setUint32(24,this.h6),this.is224||O.setUint32(28,this.h7),E};function w(E,O,T){var S,b=typeof E;if(b==="string"){var C=[],k=E.length,I=0,D;for(S=0;S<k;++S)D=E.charCodeAt(S),D<128?C[I++]=D:D<2048?(C[I++]=192|D>>6,C[I++]=128|D&63):D<55296||D>=57344?(C[I++]=224|D>>12,C[I++]=128|D>>6&63,C[I++]=128|D&63):(D=65536+((D&1023)<<10|E.charCodeAt(++S)&1023),C[I++]=240|D>>18,C[I++]=128|D>>12&63,C[I++]=128|D>>6&63,C[I++]=128|D&63);E=C}else if(b==="object"){if(E===null)throw new Error(e);if(u&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!u||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);E.length>64&&(E=new y(O,!0).update(E).array());var N=[],M=[];for(S=0;S<64;++S){var L=E[S]||0;N[S]=92^L,M[S]=54^L}y.call(this,O,T),this.update(M),this.oKeyPad=N,this.inner=!0,this.sharedMemory=T}w.prototype=new y,w.prototype.finalize=function(){if(y.prototype.finalize.call(this),this.inner){this.inner=!1;var E=this.array();y.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(E),y.prototype.finalize.call(this)}};var R=m();R.sha256=R,R.sha224=m(!0),R.sha256.hmac=v(),R.sha224.hmac=v(!0),o?t.exports=R:(r.sha256=R.sha256,r.sha224=R.sha224)})()}(Ja)),Ja.exports}var rh;function ml(){if(rh)return Ve;rh=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.getUserCacheKey=Ve.getSortedObject=Ve.djb2HashForObject=Ve.sha256Hash=Ve.djb2Hash=Ve.memoizedUserCacheKeyHash=Ve.fasthash=void 0;var t=zA(),e=KA(),n={};function r(l){for(var d=0,f=0;f<l.length;f++){var h=l.charCodeAt(f);d=(d<<5)-d+h,d=d&d}return d}Ve.fasthash=r;function i(l){var d=n[l];if(d)return d;var f=String(r(l));return n[l]=f,f}Ve.memoizedUserCacheKeyHash=i;function s(l){return String(r(l)>>>0)}Ve.djb2Hash=s;function o(l){var d=n[l];if(d)return d;var f=e.sha256.create().update(l).arrayBuffer(),h=t.Base64.encodeArrayBuffer(f);return n[l]=h,h}Ve.sha256Hash=o;function u(l){return s(JSON.stringify(a(l)))}Ve.djb2HashForObject=u;function a(l){if(l==null)return null;var d=Object.keys(l).sort(),f={};return d.forEach(function(h){var p=l[h];p instanceof Object&&(p=a(p)),f[h]=p}),f}Ve.getSortedObject=a;function c(l,d){var f,h=["userID:"+String((f=d?.userID)!==null&&f!==void 0?f:"")],p=d?.customIDs;if(p!=null)for(var m=0,_=Object.entries(p);m<_.length;m++){var g=_[m],v=g[0],y=g[1];h.push(v+":"+y)}var w=i(h.join(";"));h.splice(1,0,"stableID:"+l);var R=i(h.join(";"));return{v1:R,v2:w}}return Ve.getUserCacheKey=c,Ve}var ih;function YA(){if(ih)return qt;ih=1;var t=qt&&qt.__assign||function(){return t=Object.assign||function(i){for(var s,o=1,u=arguments.length;o<u;o++){s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},t.apply(this,arguments)},e=qt&&qt.__rest||function(i,s){var o={};for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&s.indexOf(u)<0&&(o[u]=i[u]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,u=Object.getOwnPropertySymbols(i);a<u.length;a++)s.indexOf(u[a])<0&&Object.prototype.propertyIsEnumerable.call(i,u[a])&&(o[u[a]]=i[u[a]]);return o};Object.defineProperty(qt,"__esModule",{value:!0}),qt.getUserHashWithoutStableID=void 0;var n=ml();function r(i){var s=i.customIDs,o=e(i,["customIDs"]),u=t({},s);return delete u.stableID,(0,n.djb2HashForObject)(t(t({},o),{customIDs:u}))}return qt.getUserHashWithoutStableID=r,qt}var Qa={},sh;function Pi(){return sh||(sh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EvaluationReason=void 0,function(e){e.Network="Network",e.Bootstrap="Bootstrap",e.InvalidBootstrap="InvalidBootstrap",e.Cache="Cache",e.Prefetch="Prefetch",e.Sticky="Sticky",e.LocalOverride="LocalOverride",e.Unrecognized="Unrecognized",e.Uninitialized="Uninitialized",e.Error="Error",e.NetworkNotModified="NetworkNotModified",e.BootstrapStableIDMismatch="BootstrapStableIDMismatch"}(t.EvaluationReason||(t.EvaluationReason={}))}(Qa)),Qa}var oh;function XA(){if(oh)return or;oh=1;var t=or&&or.__assign||function(){return t=Object.assign||function(i){for(var s,o=1,u=arguments.length;o<u;o++){s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},t.apply(this,arguments)};Object.defineProperty(or,"__esModule",{value:!0});var e=YA(),n=Pi(),r=function(){function i(){}return i.getEvaluationReasonForBootstrap=function(s,o,u){var a=!0,c=!1;try{var l=o.evaluated_keys;if(l&&typeof l=="object"){var d=this.copyObject(l),f=s==null?null:this.copyObject(s);a=a&&i.validate(d,f)&&i.validate(f,d);var h=l.customIDs;u!=h?.stableID&&(c=!0)}var p=o.user_hash;p&&typeof p=="string"&&s!=null&&(a=a&&p===(0,e.getUserHashWithoutStableID)(s))}catch{}return a?c?n.EvaluationReason.BootstrapStableIDMismatch:n.EvaluationReason.Bootstrap:n.EvaluationReason.InvalidBootstrap},i.validate=function(s,o){if(s==null)return o==null;if(o==null)return!1;for(var u=0,a=Object.entries(s);u<a.length;u++){var c=a[u],l=c[0],d=c[1];if(l!=="stableID"){if(typeof d!=typeof o[l])return!1;if(typeof d=="string"){if(d!==o[l])return!1}else return typeof d=="object"?this.validate(d,o[l]):!1}}return!0},i.copyObject=function(s){if(s==null)return null;var o={};if(s?.userID&&(o.userID=s?.userID),s?.customIDs){var u=t({},s.customIDs);delete u.stableID,Object.keys(u).length!==0&&(o.customIDs=u)}return o},i}();return or.default=r,or}var ah;function JA(){if(ah)return ut;ah=1;var t=ut&&ut.__assign||function(){return t=Object.assign||function(m){for(var _,g=1,v=arguments.length;g<v;g++){_=arguments[g];for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&(m[y]=_[y])}return m},t.apply(this,arguments)},e=ut&&ut.__awaiter||function(m,_,g,v){function y(w){return w instanceof g?w:new g(function(R){R(w)})}return new(g||(g=Promise))(function(w,R){function E(S){try{T(v.next(S))}catch(b){R(b)}}function O(S){try{T(v.throw(S))}catch(b){R(b)}}function T(S){S.done?w(S.value):y(S.value).then(E,O)}T((v=v.apply(m,_||[])).next())})},n=ut&&ut.__generator||function(m,_){var g={label:0,sent:function(){if(w[0]&1)throw w[1];return w[1]},trys:[],ops:[]},v,y,w,R;return R={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function E(T){return function(S){return O([T,S])}}function O(T){if(v)throw new TypeError("Generator is already executing.");for(;g;)try{if(v=1,y&&(w=T[0]&2?y.return:T[0]?y.throw||((w=y.return)&&w.call(y),0):y.next)&&!(w=w.call(y,T[1])).done)return w;switch(y=0,w&&(T=[T[0]&2,w.value]),T[0]){case 0:case 1:w=T;break;case 4:return g.label++,{value:T[1],done:!1};case 5:g.label++,y=T[1],T=[0];continue;case 7:T=g.ops.pop(),g.trys.pop();continue;default:if(w=g.trys,!(w=w.length>0&&w[w.length-1])&&(T[0]===6||T[0]===2)){g=0;continue}if(T[0]===3&&(!w||T[1]>w[0]&&T[1]<w[3])){g.label=T[1];break}if(T[0]===6&&g.label<w[1]){g.label=w[1],w=T;break}if(w&&g.label<w[2]){g.label=w[2],g.ops.push(T);break}w[2]&&g.ops.pop(),g.trys.pop();continue}T=_.call(m,g)}catch(S){T=[6,S],y=0}finally{v=w=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},r=ut&&ut.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(ut,"__esModule",{value:!0});var i=r(pl()),s=r(gl()),o=r(XA()),u=Sa(),a=ml(),c=r(as()),l=r(ba()),d=Pi(),f=10,h=function(){function m(_,g){this.overrides={gates:{},configs:{},layers:{}},this.sdkInternal=_,this.userCacheKey=this.sdkInternal.getCurrentUserCacheKey(),this.values={},this.userValues={feature_gates:{},dynamic_configs:{},sticky_experiments:{},layer_configs:{},has_updates:!1,time:0,evaluation_time:0,derived_fields:{}},this.stickyDeviceExperiments={},this.loaded=!1,this.reason=d.EvaluationReason.Uninitialized,this.userPersistentStorageAdapter=this.sdkInternal.getOptions().getUserPersistentStorage(),this.userPersistentStorageData={experiments:{}},g?this.bootstrap(g):this.load()}return m.prototype.load=function(){this.loadFromLocalStorage(),this.partialLoadFromPersistentStorageAdapter()},m.prototype.loadAsync=function(){return e(this,void 0,void 0,function(){return n(this,function(_){switch(_.label){case 0:return[4,this.loadFromAsyncStorage()];case 1:return _.sent(),this.partialLoadFromPersistentStorageAdapter(),[2]}})})},m.prototype.updateUser=function(_){this.userCacheKey=this.sdkInternal.getCurrentUserCacheKey();var g=this.setUserValueFromCache(_);return this.partialLoadFromPersistentStorageAdapter(),g},m.prototype.loadFromAsyncStorage=function(){return e(this,void 0,void 0,function(){var _,g;return n(this,function(v){switch(v.label){case 0:return _=this.parseCachedValues,[4,c.default.getItemAsync(u.INTERNAL_STORE_KEY)];case 1:return g=[v.sent()],[4,c.default.getItemAsync(u.STICKY_DEVICE_EXPERIMENTS_KEY)];case 2:return _.apply(this,g.concat([v.sent()])),this.userCacheKey=this.sdkInternal.getCurrentUserCacheKey(),this.loaded=!0,[2]}})})},m.prototype.bootstrap=function(_){var g,v,y,w,R,E,O=this.sdkInternal.getCurrentUserCacheKey(),T=this.sdkInternal.getCurrentUser(),S=(y=(v=(g=T?.customIDs)===null||g===void 0?void 0:g.stableID)!==null&&v!==void 0?v:this.sdkInternal.getStatsigMetadata().stableID)!==null&&y!==void 0?y:null,b=o.default.getEvaluationReasonForBootstrap(T,_,S);this.loaded=!0;try{var C=_;this.userValues.feature_gates=(w=C.feature_gates)!==null&&w!==void 0?w:{},this.userValues.dynamic_configs=(R=C.dynamic_configs)!==null&&R!==void 0?R:{},this.userValues.layer_configs=(E=C.layer_configs)!==null&&E!==void 0?E:{},this.userValues.evaluation_time=Date.now(),this.userValues.time=Date.now(),this.userValues.hash_used=C.hash_used,this.values[O.v2]=this.userValues,this.reason=b,this.loadOverrides()}catch{return}},m.prototype.loadFromLocalStorage=function(){c.default.asyncStorage||(this.parseCachedValues(l.default.getItem(u.INTERNAL_STORE_KEY),l.default.getItem(u.STICKY_DEVICE_EXPERIMENTS_KEY)),this.loaded=!0)},m.prototype.partialLoadFromPersistentStorageAdapter=function(){var _;if(this.userPersistentStorageAdapter){var g=(_=this.userPersistentStorageAdapter.userIDType)!==null&&_!==void 0?_:"userID",v=this.sdkInternal.getCurrentUserUnitID(g);if(v){try{this.userPersistentStorageData=JSON.parse(this.userPersistentStorageAdapter.load(v+":"+g))}catch(y){console.warn("Failed to load from user persistent storage.",y)}this.userValues.sticky_experiments=this.userPersistentStorageData.experiments}}},m.prototype.saveStickyExperimentsToPersistentStorageAdapter=function(){var _;if(this.userPersistentStorageAdapter){var g=(_=this.userPersistentStorageAdapter.userIDType)!==null&&_!==void 0?_:"userID",v=this.sdkInternal.getCurrentUserUnitID(g);if(v){var y=t(t({},this.userPersistentStorageData),{experiments:this.userValues.sticky_experiments});try{this.userPersistentStorageAdapter.save(v+":"+g,JSON.stringify(y))}catch(w){console.warn("Failed to save user experiment values to persistent storage.",w)}}}},m.prototype.isLoaded=function(){return this.loaded},m.prototype.getLastUpdateTime=function(_){var g=(0,a.djb2HashForObject)(_);return this.userValues.user_hash==g?this.userValues.time:null},m.prototype.getPreviousDerivedFields=function(_){var g=(0,a.djb2HashForObject)(_);if(this.userValues.user_hash==g)return this.userValues.derived_fields},m.prototype.parseCachedValues=function(_,g){try{this.values=_?JSON.parse(_):this.values,this.setUserValueFromCache()}catch{this.removeFromStorage(u.INTERNAL_STORE_KEY)}try{var v=g?JSON.parse(g):null;v&&(this.stickyDeviceExperiments=v)}catch{this.removeFromStorage(u.STICKY_DEVICE_EXPERIMENTS_KEY)}this.loadOverrides()},m.prototype.getUserValues=function(_){var g;return(g=this.values[_.v2])!==null&&g!==void 0?g:this.values[_.v1]},m.prototype.setUserValueFromCache=function(_){var g;_===void 0&&(_=!1);var v=this.getUserValues(this.userCacheKey);return v==null?(this.resetUserValues(),this.reason=d.EvaluationReason.Uninitialized,null):(this.userValues=v,this.reason=_?d.EvaluationReason.Prefetch:d.EvaluationReason.Cache,(g=v.evaluation_time)!==null&&g!==void 0?g:0)},m.prototype.removeFromStorage=function(_){var g=this;c.default.removeItemAsync(_).catch(function(v){return g.sdkInternal.getErrorBoundary().logError("removeFromStorage",v)}),l.default.removeItem(_)},m.prototype.loadOverrides=function(){if(!this.sdkInternal.getOptions().getDisableLocalOverrides()){var _=l.default.getItem(u.OVERRIDES_STORE_KEY);if(_!=null)try{this.overrides=JSON.parse(_)}catch{l.default.removeItem(u.OVERRIDES_STORE_KEY)}}},m.prototype.setEvaluationReason=function(_){this.reason=_},m.prototype.save=function(_,g,v){return e(this,void 0,void 0,function(){var y,w,R,E;return n(this,function(O){switch(O.label){case 0:return y=(0,a.getUserCacheKey)(this.getStableID(),_),w=g,w.is_delta?[2,this.saveInitDeltas(_,g,!0,v)]:(this.mergeInitializeResponseIntoUserMap(w,this.values,y,_,function(T){return T},v),R=this.getUserValues(y),R&&y&&y.v2===this.userCacheKey.v2&&(this.userValues=R,this.reason=d.EvaluationReason.Network),E=this,[4,this.writeValuesToStorage(this.values)]);case 1:return E.values=O.sent(),[2]}})})},m.prototype.saveWithoutUpdatingClientState=function(_,g,v){return e(this,void 0,void 0,function(){var y,w,R;return n(this,function(E){switch(E.label){case 0:return y=(0,a.getUserCacheKey)(this.getStableID(),_),w=g,w.is_delta?[2,this.saveInitDeltas(_,g,!1,v)]:(R=JSON.parse(JSON.stringify(this.values)),this.mergeInitializeResponseIntoUserMap(w,R,y,_,function(O){return O},v),[4,this.writeValuesToStorage(R)]);case 1:return E.sent(),[2]}})})},m.prototype.saveInitDeltas=function(_,g,v,y){var w,R;return e(this,void 0,void 0,function(){var E,O,T,S,b,C,k,I,D,N,M,L=this;return n(this,function($){switch($.label){case 0:return E=(0,a.getUserCacheKey)(this.getStableID(),_),O=g,T=JSON.parse(JSON.stringify(this.values)),this.mergeInitializeResponseIntoUserMap(O,T,E,_,function(U,x){var P,B=(P=T[x])!==null&&P!==void 0?P:L.getDefaultUserCacheValues();return L.mergeUserCacheValues(B,U)},y),S=!1,b=void 0,C=!1,k=Object.keys((w=O.prefetched_user_values)!==null&&w!==void 0?w:{}),k.forEach(function(U){var x,P=T[U],B=(x=O.prefetched_user_values)===null||x===void 0?void 0:x[U];if(P&&B){p(B,P);var H=B.checksum,W=(0,a.djb2HashForObject)({feature_gates:T[U].feature_gates,dynamic_configs:T[U].dynamic_configs,layer_configs:T[U].layer_configs});H&&H!==W&&(S=!0,b=W),I.hash_used!==O.hash_used&&(C=!0)}}),I=(R=T[E.v2])!==null&&R!==void 0?R:T[E.v1],p(O,I),D=O.checksum,N=(0,a.djb2HashForObject)({feature_gates:I.feature_gates,dynamic_configs:I.dynamic_configs,layer_configs:I.layer_configs}),D&&D!==N&&(S=!0,b=N),I.hash_used!==O.hash_used&&(C=!0),S||C?(this.refetchAndSaveValues(_,y,void 0,b,S).catch(function(U){return L.sdkInternal.getErrorBoundary().logError("refetchAndSaveValues",U)}),[2]):v?(I&&E.v2===this.userCacheKey.v2&&(this.userValues=I,this.reason=d.EvaluationReason.Network),M=this,[4,this.writeValuesToStorage(T)]):[3,2];case 1:return M.values=$.sent(),[3,4];case 2:return[4,this.writeValuesToStorage(T)];case 3:$.sent(),$.label=4;case 4:return[2]}})})},m.prototype.refetchAndSaveValues=function(_,g,v,y,w){return v===void 0&&(v=this.sdkInternal.getOptions().getInitTimeoutMs()),e(this,void 0,void 0,function(){var R,E,O=this;return n(this,function(T){return R=this.getLastUpdateTime(_),E=this.getPreviousDerivedFields(_),[2,this.sdkInternal.getNetwork().fetchValues({user:_,sinceTime:R,timeout:v,useDeltas:!1,prefetchUsers:g,previousDerivedFields:E,hadBadDeltaChecksum:w,badChecksum:y}).then(function(S){S?.has_updates&&O.saveWithoutUpdatingClientState(_,S,g).catch(function(b){return O.sdkInternal.getErrorBoundary().logError("refetchAndSaveValues:then",b)})}).catch(function(S){return O.sdkInternal.getErrorBoundary().logError("refetchAndSaveValues",S)})]})})},m.prototype.getStableID=function(){return this.sdkInternal.getStableID()},m.prototype.mergeInitializeResponseIntoUserMap=function(_,g,v,y,w,R){if(_.prefetched_user_values)for(var E=Object.keys(_.prefetched_user_values),O=0,T=E;O<T.length;O++){var S=T[O],b=_.prefetched_user_values[S],C=w(this.convertAPIDataToCacheValues(b,S),S);if(_.has_updates&&_.time&&R){var k=(0,a.djb2HashForObject)(R[S]);C.user_hash=k}g[S]=C}if(v){var I=this.convertAPIDataToCacheValues(_,v.v2);if(_.has_updates&&_.time){var k=(0,a.djb2HashForObject)(y);I.user_hash=k}g[v.v2]=w(I,v.v2)}},m.prototype.getDefaultUserCacheValues=function(){return{feature_gates:{},layer_configs:{},dynamic_configs:{},sticky_experiments:{},time:0,evaluation_time:0,derived_fields:{}}},m.prototype.mergeUserCacheValues=function(_,g){return{feature_gates:t(t({},_.feature_gates),g.feature_gates),layer_configs:t(t({},_.layer_configs),g.layer_configs),dynamic_configs:t(t({},_.dynamic_configs),g.dynamic_configs),sticky_experiments:_.sticky_experiments,time:g.time,evaluation_time:g.evaluation_time,derived_fields:g.derived_fields,hash_used:g.hash_used,user_hash:g.user_hash}},m.prototype.writeValuesToStorage=function(_){return e(this,void 0,void 0,function(){var g;return n(this,function(v){switch(v.label){case 0:return _[this.userCacheKey.v2]&&delete _[this.userCacheKey.v1],g=Object.entries(_).sort(function(y,w){var R,E,O=y[1],T=w[1];return O==null?1:T==null?-1:((R=T?.evaluation_time)!==null&&R!==void 0?R:T?.time)-((E=O?.evaluation_time)!==null&&E!==void 0?E:O?.time)}).slice(0,f),_=Object.fromEntries(g),c.default.asyncStorage?[4,c.default.setItemAsync(u.INTERNAL_STORE_KEY,JSON.stringify(_))]:[3,2];case 1:return v.sent(),[3,3];case 2:l.default.setItem(u.INTERNAL_STORE_KEY,JSON.stringify(_)),v.label=3;case 3:return[2,_]}})})},m.prototype.checkGate=function(_,g){var v;g===void 0&&(g=!1);var y=this.getHashedSpecName(_),w={name:_,value:!1,rule_id:"",secondary_exposures:[]},R;if(!g&&this.overrides.gates[_]!=null)w={name:_,value:this.overrides.gates[_],rule_id:"override",secondary_exposures:[]},R=this.getEvaluationDetails(!1,d.EvaluationReason.LocalOverride);else{var E=(v=this.userValues)===null||v===void 0?void 0:v.feature_gates[y];E&&(w=E),R=this.getEvaluationDetails(E!=null)}return{evaluationDetails:R,gate:w}},m.prototype.getConfig=function(_,g){var v,y;g===void 0&&(g=!1);var w=this.getHashedSpecName(_),R,E;if(!g&&this.overrides.configs[_]!=null)E=this.getEvaluationDetails(!1,d.EvaluationReason.LocalOverride),R=new i.default(_,this.overrides.configs[_],"override",E,[],"",this.makeOnConfigDefaultValueFallback(this.sdkInternal.getCurrentUser()));else if(((v=this.userValues)===null||v===void 0?void 0:v.dynamic_configs[w])!=null){var O=(y=this.userValues)===null||y===void 0?void 0:y.dynamic_configs[w];E=this.getEvaluationDetails(!0),R=this.createDynamicConfig(_,O,E)}else E=this.getEvaluationDetails(!1),R=new i.default(_,{},"",E);return R},m.prototype.getExperiment=function(_,g,v){g===void 0&&(g=!1),v===void 0&&(v=!1);var y,w;if(!v&&this.overrides.configs[_]!=null)w=this.getEvaluationDetails(!1,d.EvaluationReason.LocalOverride),y=new i.default(_,this.overrides.configs[_],"override",w);else{var R=this.getLatestValue(_,"dynamic_configs");w=this.getEvaluationDetails(R!=null);var E=this.getPossiblyStickyValue(_,R,g,!1,w);y=this.createDynamicConfig(_,E,w)}return y},m.prototype.getLayer=function(_,g,v){var y,w,R,E;if(this.overrides.layers[g]!=null){var O=this.getEvaluationDetails(!1,d.EvaluationReason.LocalOverride);return s.default._create(g,(y=this.overrides.layers[g])!==null&&y!==void 0?y:{},"override",O,_)}var T=this.getLatestValue(g,"layer_configs"),S=this.getEvaluationDetails(T!=null),b=this.getPossiblyStickyValue(g,T,v,!0,S);return s.default._create(g,(w=b?.value)!==null&&w!==void 0?w:{},(R=b?.rule_id)!==null&&R!==void 0?R:"",S,_,b?.secondary_exposures,b?.undelegated_secondary_exposures,(E=b?.allocated_experiment_name)!==null&&E!==void 0?E:"",b?.explicit_parameters,b?.group_name)},m.prototype.overrideConfig=function(_,g){try{JSON.stringify(g)}catch(v){console.warn("Failed to stringify given config override. Dropping",v);return}this.overrides.configs[_]=g,this.saveOverrides()},m.prototype.overrideLayer=function(_,g){try{JSON.stringify(g)}catch(v){console.warn("Failed to stringify given layer override. Dropping",v);return}this.overrides.layers[_]=g,this.saveOverrides()},m.prototype.overrideGate=function(_,g){this.overrides.gates[_]=g,this.saveOverrides()},m.prototype.removeGateOverride=function(_){_==null?this.overrides.gates={}:delete this.overrides.gates[_],this.saveOverrides()},m.prototype.removeConfigOverride=function(_){_==null?this.overrides.configs={}:delete this.overrides.configs[_],this.saveOverrides()},m.prototype.removeLayerOverride=function(_){_==null?this.overrides.layers={}:delete this.overrides.layers[_],this.saveOverrides()},m.prototype.getAllOverrides=function(){return this.overrides},m.prototype.saveOverrides=function(){try{l.default.setItem(u.OVERRIDES_STORE_KEY,JSON.stringify(this.overrides))}catch{console.warn("Failed to persist gate/config overrides")}},m.prototype.getLatestValue=function(_,g){var v,y,w,R,E,O=this.getHashedSpecName(_);return(w=(y=(v=this.userValues)===null||v===void 0?void 0:v[g])===null||y===void 0?void 0:y[O])!==null&&w!==void 0?w:(E=(R=this.userValues)===null||R===void 0?void 0:R[g])===null||E===void 0?void 0:E[_]},m.prototype.getPossiblyStickyValue=function(_,g,v,y,w){var R,E=this.getHashedSpecName(_);if(!v)return this.removeStickyValue(E),g;var O=this.getStickyValue(E);if(!O)return this.attemptToSaveStickyValue(E,g),g;var T=null;return y?T=this.getLatestValue((R=O?.allocated_experiment_name)!==null&&R!==void 0?R:"","dynamic_configs"):T=g,T?.is_experiment_active==!0?(w.reason=d.EvaluationReason.Sticky,O):(g?.is_experiment_active==!0?this.attemptToSaveStickyValue(E,g):this.removeStickyValue(E),g)},m.prototype.createDynamicConfig=function(_,g,v){var y,w,R;return new i.default(_,(y=g?.value)!==null&&y!==void 0?y:{},(w=g?.rule_id)!==null&&w!==void 0?w:"",v,g?.secondary_exposures,(R=g?.allocated_experiment_name)!==null&&R!==void 0?R:"",this.makeOnConfigDefaultValueFallback(this.sdkInternal.getCurrentUser()),g?.group_name,g?.id_type,g?.is_experiment_active)},m.prototype.getStickyValue=function(_){var g,v;return(v=(g=this.userValues)===null||g===void 0?void 0:g.sticky_experiments[_])!==null&&v!==void 0?v:this.stickyDeviceExperiments[_]},m.prototype.attemptToSaveStickyValue=function(_,g){var v;!g||!g.is_user_in_experiment||!g.is_experiment_active||(g.is_device_based===!0?this.stickyDeviceExperiments[_]=g:!((v=this.userValues)===null||v===void 0)&&v.sticky_experiments&&(this.userValues.sticky_experiments[_]=g),this.saveStickyValuesToStorage())},m.prototype.removeStickyValue=function(_){var g,v,y,w;Object.keys((v=(g=this.userValues)===null||g===void 0?void 0:g.sticky_experiments)!==null&&v!==void 0?v:{}).length===0&&Object.keys((y=this.stickyDeviceExperiments)!==null&&y!==void 0?y:{}).length===0||((w=this.userValues)===null||w===void 0||delete w.sticky_experiments[_],delete this.stickyDeviceExperiments[_],this.saveStickyValuesToStorage())},m.prototype.saveStickyValuesToStorage=function(){this.userPersistentStorageAdapter?this.saveStickyExperimentsToPersistentStorageAdapter():(this.values[this.userCacheKey.v2]=this.userValues,this.setItemToStorage(u.INTERNAL_STORE_KEY,JSON.stringify(this.values)),this.setItemToStorage(u.STICKY_DEVICE_EXPERIMENTS_KEY,JSON.stringify(this.stickyDeviceExperiments)))},m.prototype.getGlobalEvaluationDetails=function(){var _,g;return{reason:(_=this.reason)!==null&&_!==void 0?_:d.EvaluationReason.Uninitialized,time:(g=this.userValues.evaluation_time)!==null&&g!==void 0?g:0}},m.prototype.getEvaluationDetails=function(_,g){var v;return _?{reason:this.reason,time:(v=this.userValues.evaluation_time)!==null&&v!==void 0?v:Date.now()}:{reason:g??(this.reason==d.EvaluationReason.Uninitialized?d.EvaluationReason.Uninitialized:d.EvaluationReason.Unrecognized),time:Date.now()}},m.prototype.resetUserValues=function(){this.userValues={feature_gates:{},dynamic_configs:{},sticky_experiments:{},layer_configs:{},time:0,evaluation_time:0,derived_fields:{}}},m.prototype.getHashedSpecName=function(_){switch(this.userValues.hash_used){case"djb2":return(0,a.djb2Hash)(_);case"none":return _;default:return(0,a.sha256Hash)(_)}},m.prototype.convertAPIDataToCacheValues=function(_,g){var v,y;return{feature_gates:_.feature_gates,layer_configs:_.layer_configs,dynamic_configs:_.dynamic_configs,sticky_experiments:(y=(v=this.values[g])===null||v===void 0?void 0:v.sticky_experiments)!==null&&y!==void 0?y:{},time:_.time==null||isNaN(_.time)?0:_.time,evaluation_time:Date.now(),hash_used:_.hash_used,derived_fields:_.derived_fields}},m.prototype.setItemToStorage=function(_,g){var v=this;c.default.asyncStorage?c.default.setItemAsync(_,g).catch(function(y){v.sdkInternal.getErrorBoundary().logError("setItemToStorage",y)}):l.default.setItem(_,g)},m.prototype.makeOnConfigDefaultValueFallback=function(_){var g=this;return function(v,y,w,R){g.isLoaded()&&g.sdkInternal.getLogger().logConfigDefaultValueFallback(_,"Parameter "+y+" is a value of type "+R+`.
Returning requested defaultValue type `+w,{name:v.getName(),ruleID:v.getRuleID(),parameter:y,defaultValueType:w,valueType:R})}},m}();ut.default=h;function p(m,_){var g,v,y;((g=m.deleted_configs)!==null&&g!==void 0?g:[]).forEach(function(w){delete _.dynamic_configs[w]}),((v=m.deleted_gates)!==null&&v!==void 0?v:[]).forEach(function(w){delete _.feature_gates[w]}),((y=m.deleted_layers)!==null&&y!==void 0?y:[]).forEach(function(w){delete _.layer_configs[w]})}return ut}var js={},uh;function QA(){if(uh)return js;uh=1,Object.defineProperty(js,"__esModule",{value:!0});var t=jv(),e=function(){function n(r){this.logLevel=r}return n.prototype.info=function(r){this.logLevel!==t.LogLevel.NONE&&console.log(r)},n.prototype.error=function(r){this.logLevel===t.LogLevel.DEBUG&&console.error(r)},n}();return js.default=e,js}var ch;function lh(){if(ch)return at;ch=1;var t=at&&at.__assign||function(){return t=Object.assign||function(T){for(var S,b=1,C=arguments.length;b<C;b++){S=arguments[b];for(var k in S)Object.prototype.hasOwnProperty.call(S,k)&&(T[k]=S[k])}return T},t.apply(this,arguments)},e=at&&at.__awaiter||function(T,S,b,C){function k(I){return I instanceof b?I:new b(function(D){D(I)})}return new(b||(b=Promise))(function(I,D){function N($){try{L(C.next($))}catch(U){D(U)}}function M($){try{L(C.throw($))}catch(U){D(U)}}function L($){$.done?I($.value):k($.value).then(N,M)}L((C=C.apply(T,S||[])).next())})},n=at&&at.__generator||function(T,S){var b={label:0,sent:function(){if(I[0]&1)throw I[1];return I[1]},trys:[],ops:[]},C,k,I,D;return D={next:N(0),throw:N(1),return:N(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function N(L){return function($){return M([L,$])}}function M(L){if(C)throw new TypeError("Generator is already executing.");for(;b;)try{if(C=1,k&&(I=L[0]&2?k.return:L[0]?k.throw||((I=k.return)&&I.call(k),0):k.next)&&!(I=I.call(k,L[1])).done)return I;switch(k=0,I&&(L=[L[0]&2,I.value]),L[0]){case 0:case 1:I=L;break;case 4:return b.label++,{value:L[1],done:!1};case 5:b.label++,k=L[1],L=[0];continue;case 7:L=b.ops.pop(),b.trys.pop();continue;default:if(I=b.trys,!(I=I.length>0&&I[I.length-1])&&(L[0]===6||L[0]===2)){b=0;continue}if(L[0]===3&&(!I||L[1]>I[0]&&L[1]<I[3])){b.label=L[1];break}if(L[0]===6&&b.label<I[1]){b.label=I[1],I=L;break}if(I&&b.label<I[2]){b.label=I[2],b.ops.push(L);break}I[2]&&b.ops.pop(),b.trys.pop();continue}L=S.call(T,b)}catch($){L=[6,$],k=0}finally{C=I=0}if(L[0]&5)throw L[1];return{value:L[0]?L[1]:void 0,done:!0}}},r=at&&at.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(at,"__esModule",{value:!0});var i=r(pl()),s=r(BA()),o=hl(),u=r(gl()),a=r(Fv()),c=r(qA()),l=r(GA()),d=r(Hv()),f=r(jv()),h=r(JA()),p=Pi(),m=ml(),_=r(as()),g=r(ba()),v=r(ya()),y=r(QA()),w=Uv(),R=64,E=2048,O=function(){function T(S,b,C){var k=this;if(this.appState=null,this.currentAppState=null,this.onCacheLoadedForReact=null,this.initCalled=!1,this.pendingInitPromise=null,this.optionalLoggingSetup=!1,this.prefetchedUsersByCacheKey={},this.logLayerParameterExposureForLayer=function(D,N,M){M===void 0&&(M=!1);var L="",$=D._getUndelegatedSecondaryExposures(),U=D._getExplicitParameters().includes(N);U&&(L=D._getAllocatedExperimentName(),$=D._getSecondaryExposures()),k.logger.logLayerExposure(k.getCurrentUser(),D.getName(),D.getRuleID(),$,L,N,U,D._getEvaluationDetails(),M)},C?.localMode!==!0&&(typeof S!="string"||!S.startsWith("client-")))throw new o.StatsigInvalidArgumentError("Invalid key provided. You must use a Client SDK Key from the Statsig console to initialize the sdk");if(this.startTime=(0,w.now)(),this.options=new f.default(C),this.logger=new l.default(this),v.default.initialize({options:this.options}),this.errorBoundary=new s.default(S),this.ready=!1,this.sdkKey=S,this.consoleLogger=new y.default(this.options.getLogLevel()),g.default.disabled=this.options.getDisableLocalStorage(),this.identity=new c.default(this.normalizeUser(b??null),this.options.getOverrideStableID(),T.reactNativeUUID),this.network=new d.default(this),this.store=new h.default(this,this.options.getInitializeValues()),this.errorBoundary.setStatsigMetadata(this.getStatsigMetadata()),this.options.getInitializeValues()!=null){var I=this.options.getInitCompletionCallback();this.ready=!0,this.initCalled=!0,setTimeout(function(){return k.delayedSetup()},20),this.handleOptionalLogging(),I&&I((0,w.now)()-this.startTime,!0,null)}}return T.prototype.getErrorBoundary=function(){return this.errorBoundary},T.prototype.getNetwork=function(){return this.network},T.prototype.getStore=function(){return this.store},T.prototype.getLogger=function(){return this.logger},T.prototype.getOptions=function(){return this.options},T.prototype.getSDKKey=function(){var S=this;return this.errorBoundary.capture("getSDKKey",function(){var b;return(b=S.sdkKey)!==null&&b!==void 0?b:""},function(){return""})},T.prototype.getCurrentUser=function(){var S=this;return this.errorBoundary.capture("getCurrentUser",function(){return S.identity.getUser()},function(){return null})},T.prototype.getCurrentUserCacheKey=function(){var S=this;return this.errorBoundary.capture("getCurrentUserCacheKey",function(){return(0,m.getUserCacheKey)(S.getStableID(),S.getCurrentUser())},function(){return{v1:"",v2:""}})},T.prototype.getCurrentUserUnitID=function(S){var b=this;return this.errorBoundary.capture("getCurrentUserUnitID",function(){return b.getUnitID(b.getCurrentUser(),S)},function(){return""})},T.prototype.getCurrentUserID=function(){var S=this;return this.errorBoundary.capture("getCurrentUserID",function(){return S.getUnitID(S.getCurrentUser(),"userid")},function(){return""})},T.prototype.getUnitID=function(S,b){var C,k,I;return S?b.toLowerCase()==="userid"?(k=(C=S.userID)===null||C===void 0?void 0:C.toString())!==null&&k!==void 0?k:null:S.customIDs?(I=S.customIDs[b])!==null&&I!==void 0?I:S.customIDs[b.toLowerCase()]:null:null},T.prototype.getStatsigMetadata=function(){var S=this;return this.errorBoundary.capture("getStatsigMetadata",function(){return S.identity.getStatsigMetadata()},function(){return{}})},T.prototype.getSDKType=function(){var S=this;return this.errorBoundary.capture("getSDKType",function(){return S.identity.getSDKType()},function(){return""})},T.prototype.getSDKVersion=function(){var S=this;return this.errorBoundary.capture("getSDKVersion",function(){return S.identity.getSDKVersion()},function(){return""})},T.prototype.getConsoleLogger=function(){return this.consoleLogger},T.prototype.delayedSetup=function(){var S=this;this.errorBoundary.swallow("delayedSetup",function(){S.options.getInitializeValues()!=null&&S.fireAndForgetPrefechUsers(),S.identity.saveStableID(),S.logger.sendSavedRequests().catch(function(b){return S.errorBoundary.logError("sendSavedRequests:delayedSetup",b)})})},T.prototype.setInitializeValues=function(S){var b=this;this.errorBoundary.capture("setInitializeValues",function(){b.store.bootstrap(S);var C=null;b.ready||(b.ready=!0,b.initCalled=!0,C=b.options.getInitCompletionCallback()),b.handleOptionalLogging(),b.logger.sendSavedRequests().catch(function(k){return b.errorBoundary.logError("sendSavedRequests:setInitializeValues",k)}),C&&C((0,w.now)()-b.startTime,!0,null)},function(){b.ready=!0,b.initCalled=!0;var C=b.options.getInitCompletionCallback();C&&C((0,w.now)()-b.startTime,!1,"Caught an exception during setInitializeValues")})},T.prototype.initializeAsync=function(){return e(this,void 0,void 0,function(){var S=this;return n(this,function(b){return[2,this.errorBoundary.capture("initializeAsync",function(){return e(S,void 0,void 0,function(){var C,k=this,I;return n(this,function(D){switch(D.label){case 0:return this.pendingInitPromise!=null?[2,this.pendingInitPromise]:this.ready?[2,Promise.resolve()]:(v.default.mark.overall.start({}),this.initCalled=!0,_.default.asyncStorage?[4,this.identity.initAsync()]:[3,3]);case 1:return D.sent(),[4,this.store.loadAsync()];case 2:D.sent(),D.label=3;case 3:return(I=this.onCacheLoadedForReact)===null||I===void 0||I.call(this),this.appState&&this.appState.addEventListener&&typeof this.appState.addEventListener=="function"&&(this.currentAppState=this.appState.currentState,this.appState.addEventListener("change",this.handleAppStateChange.bind(this))),this.options.getLocalModeEnabled()?[2,Promise.resolve()]:(C=this.identity.getUser(),this.pendingInitPromise=this.fetchAndSaveValues({user:C,prefetchUsers:this.options.getPrefetchUsers(),timeout:this.options.getInitTimeoutMs()}).then(function(){return v.default.mark.overall.end({success:!0,evaluationDetails:k.store.getGlobalEvaluationDetails()}),{success:!0,message:null}}).catch(function(N){var M;return k.errorBoundary.logError("initializeAsync:fetchAndSaveValues",N),v.default.mark.overall.end({success:!1,error:v.default.formatError(N),evaluationDetails:k.store.getGlobalEvaluationDetails()}),{success:!1,message:(M=N.message)!==null&&M!==void 0?M:null}}).then(function(N){var M=N.success,L=N.message,$=k.options.getInitCompletionCallback();$&&$((0,w.now)()-k.startTime,M,L)}).finally(function(){return e(k,void 0,void 0,function(){return n(this,function(N){return this.pendingInitPromise=null,this.ready=!0,this.delayedSetup(),this.logger.logDiagnostics(C,"initialize"),[2]})})}),this.handleOptionalLogging(),[2,this.pendingInitPromise])}})})},function(){return S.ready=!0,S.initCalled=!0,Promise.resolve()})]})})},T.prototype.prefetchUsers=function(S){return e(this,void 0,void 0,function(){var b=this;return n(this,function(C){return[2,this.errorBoundary.capture("prefetchUsers",function(){if(!(!S||S.length==0))return b.fetchAndSaveValues({user:null,prefetchUsers:S,timeout:0})},function(){return Promise.resolve()})]})})},T.prototype.getEvaluationDetails=function(){var S=this;return this.errorBoundary.capture("getEvaluationDetails",function(){return S.store.getGlobalEvaluationDetails()},function(){return{time:Date.now(),reason:p.EvaluationReason.Error}})},T.prototype.checkGate=function(S,b){var C=this;return b===void 0&&(b=!1),this.errorBoundary.capture("checkGate",function(){var k=C.checkGateImpl(S,b);C.logGateExposureImpl(S,k);var I=C.options.getGateEvaluationCallback();return I&&I(S,k.gate.value,{withExposureLoggingDisabled:!1}),k.gate.value===!0},function(){return!1},{configName:S})},T.prototype.checkGateWithExposureLoggingDisabled=function(S,b){var C=this;return b===void 0&&(b=!1),this.errorBoundary.capture("checkGateWithExposureLoggingDisabled",function(){var k=C.checkGateImpl(S,b),I=C.options.getGateEvaluationCallback();return I&&I(S,k.gate.value,{withExposureLoggingDisabled:!0}),k.gate.value===!0},function(){return!1})},T.prototype.logGateExposure=function(S){var b=this;this.errorBoundary.swallow("logGateExposure",function(){b.logGateExposureImpl(S)})},T.prototype.getConfig=function(S,b){var C=this;return b===void 0&&(b=!1),this.errorBoundary.capture("getConfig",function(){var k=C.getConfigImpl(S,b);return C.logConfigExposureImpl(S,k),k},function(){return C.getEmptyConfig(S)},{configName:S})},T.prototype.getConfigWithExposureLoggingDisabled=function(S,b){var C=this;return b===void 0&&(b=!1),this.errorBoundary.capture("getConfig",function(){return C.getConfigImpl(S,b)},function(){return C.getEmptyConfig(S)})},T.prototype.logConfigExposure=function(S){var b=this;this.errorBoundary.swallow("logConfigExposure",function(){b.logConfigExposureImpl(S)})},T.prototype.getExperiment=function(S,b,C){var k=this;return b===void 0&&(b=!1),C===void 0&&(C=!1),this.errorBoundary.capture("getExperiment",function(){var I=k.getExperimentImpl(S,b,C);return k.logExperimentExposureImpl(S,b,I),I},function(){return k.getEmptyConfig(S)},{configName:S})},T.prototype.getExperimentWithExposureLoggingDisabled=function(S,b,C){var k=this;return b===void 0&&(b=!1),C===void 0&&(C=!1),this.errorBoundary.capture("getExperimentWithExposureLoggingDisabled",function(){return k.getExperimentImpl(S,b,C)},function(){return k.getEmptyConfig(S)})},T.prototype.logExperimentExposure=function(S,b){var C=this;this.errorBoundary.swallow("logExperimentExposure",function(){C.logExperimentExposureImpl(S,b)})},T.prototype.getLayer=function(S,b){var C=this;return b===void 0&&(b=!1),this.errorBoundary.capture("getLayer",function(){return C.getLayerImpl(C.logLayerParameterExposureForLayer,S,b)},function(){return u.default._create(S,{},"",C.getEvalutionDetailsForError())},{configName:S})},T.prototype.getLayerWithExposureLoggingDisabled=function(S,b){var C=this;return b===void 0&&(b=!1),this.errorBoundary.capture("getLayerWithExposureLoggingDisabled",function(){return C.getLayerImpl(null,S,b)},function(){return u.default._create(S,{},"",C.getEvalutionDetailsForError())})},T.prototype.logLayerParameterExposure=function(S,b,C){var k=this;C===void 0&&(C=!1),this.errorBoundary.swallow("logLayerParameterExposure",function(){var I=k.getLayerImpl(null,S,C);k.logLayerParameterExposureForLayer(I,b,!0)})},T.prototype.logEvent=function(S,b,C){var k=this;b===void 0&&(b=null),C===void 0&&(C=null),this.errorBoundary.swallow("logEvent",function(){if(!k.logger||!k.sdkKey)throw new o.StatsigUninitializedError("Must initialize() before logging events.");if(typeof S!="string"||S.length===0){k.consoleLogger.error("Event not logged. No valid eventName passed.");return}k.shouldTrimParam(S,R)&&(k.consoleLogger.info("eventName is too long, trimming to "+R+" characters."),S=S.substring(0,R)),typeof b=="string"&&k.shouldTrimParam(b,R)&&(k.consoleLogger.info("value is too long, trimming to "+R+"."),b=b.substring(0,R)),k.shouldTrimParam(C,E)&&(k.consoleLogger.info("metadata is too big. Dropping the metadata."),C={error:"not logged due to size too large"});var I=new a.default(S);I.setValue(b),I.setMetadata(C),I.setUser(k.getCurrentUser()),k.logger.log(I)})},T.prototype.updateUserWithValues=function(S,b){var C=this,k;return this.errorBoundary.capture("updateUserWithValues",function(){var I=Date.now();if(!C.initializeCalled())throw new o.StatsigUninitializedError("Call initialize() first.");return k=function(D,N){var M=C.options.getUpdateUserCompletionCallback();M?.(Date.now()-I,D,N)},C.identity.updateUser(C.normalizeUser(S)),C.store.bootstrap(b),k(!0,null),!0},function(){return k?.(!1,"Failed to update user. An unexpected error occured."),!1})},T.prototype.updateUser=function(S){return e(this,void 0,void 0,function(){var b,C=this;return n(this,function(k){return[2,this.errorBoundary.capture("updateUser",function(){return e(C,void 0,void 0,function(){var I,D,N,M,L,$=this;return n(this,function(U){switch(U.label){case 0:if(I=Date.now(),!this.initializeCalled())throw new o.StatsigUninitializedError("Call initialize() first.");return b=function(x,P){var B=$.options.getUpdateUserCompletionCallback();B?.(Date.now()-I,x,P)},this.identity.updateUser(this.normalizeUser(S)),D=this.getCurrentUserCacheKey(),N=!!this.prefetchedUsersByCacheKey[D.v2],M=this.store.updateUser(N),v.default.clearContext("api_call"),this.logger.resetDedupeKeys(),M!=null&&(N||this.isCacheValidForFetchMode(M))?(b(!0,null),[2,Promise.resolve(!0)]):this.pendingInitPromise==null?[3,2]:[4,this.pendingInitPromise];case 1:U.sent(),U.label=2;case 2:return this.options.getLocalModeEnabled()?(b(!0,null),[2,Promise.resolve(!0)]):(L=this.identity.getUser(),this.pendingInitPromise=this.fetchAndSaveValues({user:L,prefetchUsers:[],timeout:void 0}).finally(function(){$.pendingInitPromise=null}),[2,this.pendingInitPromise.then(function(){return b(!0,null),Promise.resolve(!0)}).catch(function(x){return b(!1,"Failed to update user: "+x),Promise.resolve(!1)})])}})})},function(){return b?.(!1,"Failed to update user. An unexpected error occured."),Promise.resolve(!1)})]})})},T.prototype.shutdown=function(){var S=this;this.errorBoundary.swallow("shutdown",function(){S.logger.shutdown(),S.appState&&S.appState.removeEventListener&&typeof S.appState.removeEventListener=="function"&&S.appState.removeEventListener("change",S.handleAppStateChange.bind(S)),g.default.cleanup()})},T.prototype.overrideGate=function(S,b){var C=this;this.errorBoundary.swallow("overrideGate",function(){C.ensureStoreLoaded(),C.store.overrideGate(S,b)})},T.prototype.overrideConfig=function(S,b){var C=this;this.errorBoundary.swallow("overrideConfig",function(){C.ensureStoreLoaded(),C.store.overrideConfig(S,b)})},T.prototype.overrideLayer=function(S,b){var C=this;this.errorBoundary.swallow("overrideLayer",function(){C.ensureStoreLoaded(),C.store.overrideLayer(S,b)})},T.prototype.removeGateOverride=function(S){var b=this;this.errorBoundary.swallow("removeGateOverride",function(){b.ensureStoreLoaded(),b.store.removeGateOverride(S)})},T.prototype.removeConfigOverride=function(S){var b=this;this.errorBoundary.swallow("removeConfigOverride",function(){b.ensureStoreLoaded(),b.store.removeConfigOverride(S)})},T.prototype.removeLayerOverride=function(S){var b=this;this.errorBoundary.swallow("removeLayerOverride",function(){b.ensureStoreLoaded(),b.store.removeLayerOverride(S)})},T.prototype.removeOverride=function(S){var b=this;this.errorBoundary.swallow("removeOverride",function(){b.ensureStoreLoaded(),b.store.removeGateOverride(S)})},T.prototype.getOverrides=function(){var S=this;return this.errorBoundary.capture("getOverrides",function(){return S.ensureStoreLoaded(),S.store.getAllOverrides().gates},function(){return{}})},T.prototype.getAllOverrides=function(){var S=this;return this.errorBoundary.capture("getAllOverrides",function(){return S.ensureStoreLoaded(),S.store.getAllOverrides()},function(){return{gates:{},configs:{},layers:{}}})},T.prototype.getStableID=function(){var S=this;return this.errorBoundary.capture("getStableID",function(){return S.identity.getStatsigMetadata().stableID},function(){return""})},T.prototype.initializeCalled=function(){return this.initCalled},T.prototype.setSDKPackageInfo=function(S){S!=null&&(this.identity.setSDKPackageInfo(S),this.errorBoundary.setStatsigMetadata(this.getStatsigMetadata()))},T.setAsyncStorage=function(S){S!=null&&(_.default.asyncStorage=S)},T.prototype.setOnCacheLoadedReactCallback=function(S){this.onCacheLoadedForReact=S??null},T.setReactNativeUUID=function(S){S!=null&&(T.reactNativeUUID=S)},T.prototype.setAppState=function(S){S!=null&&(this.appState=S)},T.prototype.setNativeModules=function(S){S!=null&&this.identity.setNativeModules(S)},T.prototype.setPlatform=function(S){S!=null&&this.identity.setPlatform(S)},T.prototype.setRNDeviceInfo=function(S){S!=null&&this.identity.setRNDeviceInfo(S)},T.prototype.setExpoConstants=function(S){S!=null&&this.identity.setExpoConstants(S)},T.prototype.setExpoDevice=function(S){S!=null&&this.identity.setExpoDevice(S)},T.prototype.flushEvents=function(){this.logger.flush()},T.prototype.reenableAllLogging=function(){this.getOptions().reenableAllLogging()},T.prototype.isCacheValidForFetchMode=function(S){return this.options.getFetchMode()!=="cache-or-network"?!1:S>this.startTime},T.prototype.handleOptionalLogging=function(){var S=this,b=this.options.getDisableErrorLogging(),C=this.options.getDisableAutoMetricsLogging();if(!(b&&C)&&!(this.optionalLoggingSetup||typeof window>"u"||!window||!window.addEventListener)){var k=this.identity.getUser();if(b||window.addEventListener("error",function(D){var N,M=D.error;if(M!=null&&typeof M=="object")try{M=JSON.stringify(M)}catch{M="Failed to stringify Error"}S.logger.logAppError(k,(N=D.message)!==null&&N!==void 0?N:"",{filename:D.filename,lineno:D.lineno,colno:D.colno,error_obj:M})}),!C){if(typeof document>"u"||!document||typeof setTimeout>"u"||!setTimeout)return;var I=function(){setTimeout(function(){S.logger.logAppMetrics(k)},1e3)};document.readyState==="complete"?I():window.addEventListener("load",function(){return I()})}this.optionalLoggingSetup=!0}},T.prototype.handleAppStateChange=function(S){var b=this,C;this.currentAppState==="active"&&S.match(/inactive|background/)?this.logger.flush(!0):!((C=this.currentAppState)===null||C===void 0)&&C.match(/inactive|background/)&&S==="active"&&this.logger.sendSavedRequests().catch(function(k){return b.errorBoundary.logError("sendSavedRequests:handleAppStateChange",k)}),this.currentAppState=S},T.prototype.shouldTrimParam=function(S,b){return S==null?!1:typeof S=="string"?S.length>b:typeof S=="object"?JSON.stringify(S).length>b:typeof S=="number"?S.toString().length>b:!1},T.prototype.normalizePrefetchUsers=function(S){var b=this;return S==null?[]:S.map(function(C){return b.normalizeUser(C)})},T.prototype.normalizeUser=function(S){var b={};try{b=JSON.parse(JSON.stringify(S))}catch{throw new o.StatsigInvalidArgumentError("User object must be convertable to JSON string.")}return b=this.trimUserObjIfNeeded(b),this.options.getEnvironment()!=null&&(b.statsigEnvironment=this.options.getEnvironment()),b},T.prototype.trimUserObjIfNeeded=function(S){var b,C;return S==null?{}:(this.shouldTrimParam((b=S.userID)!==null&&b!==void 0?b:null,R)&&(this.consoleLogger.info("User ID is too large, trimming to "+R+"characters"),S.userID=(C=S.userID)===null||C===void 0?void 0:C.toString().substring(0,R)),this.shouldTrimParam(S,E)&&(S.custom={},this.shouldTrimParam(S,E)?(this.consoleLogger.info("User object is too large, only keeping the user ID."),S={userID:S.userID}):this.consoleLogger.info("User object is too large, dropping the custom property.")),S)},T.prototype.ensureStoreLoaded=function(){if(!this.store.isLoaded())throw new o.StatsigUninitializedError("Call and wait for initialize() to finish first.")},T.prototype.getEvalutionDetailsForError=function(){return{time:Date.now(),reason:p.EvaluationReason.Error}},T.prototype.fetchAndSaveValues=function(S){var b,C;return e(this,void 0,void 0,function(){var k,I,D,N,M,L,$=this;return n(this,function(U){return k=S.user,I=(b=S.prefetchUsers)!==null&&b!==void 0?b:[],D=(C=S.timeout)!==null&&C!==void 0?C:this.options.getInitTimeoutMs(),I.length>5&&this.consoleLogger.info("Cannot prefetch more than 5 users."),N=this.normalizePrefetchUsers(I).slice(0,5).reduce(function(x,P){return x[(0,m.getUserCacheKey)($.getStableID(),P).v2]=P,x},{}),M=null,I.length===0&&(M=this.store.getLastUpdateTime(k)),L=this.store.getPreviousDerivedFields(k),[2,this.network.fetchValues({user:k,sinceTime:M,timeout:D,useDeltas:M!=null,prefetchUsers:I.length>0?N:void 0,previousDerivedFields:L}).eventually(function(x){x?.has_updates&&$.store.saveWithoutUpdatingClientState(k,x,I.length>0?N:void 0).catch(function(P){return $.errorBoundary.logError("fetchAndSaveValues:eventually",P)})}).then(function(x){return e($,void 0,void 0,function(){var P=this;return n(this,function(B){return[2,this.errorBoundary.swallow("fetchAndSaveValues",function(){return e(P,void 0,void 0,function(){return n(this,function(H){switch(H.label){case 0:return v.default.mark.intialize.process.start({}),x?.has_updates?[4,this.store.save(k,x,I.length>0?N:void 0)]:[3,2];case 1:return H.sent(),[3,3];case 2:x?.is_no_content&&this.store.setEvaluationReason(p.EvaluationReason.NetworkNotModified),H.label=3;case 3:return this.prefetchedUsersByCacheKey=t(t({},this.prefetchedUsersByCacheKey),N),v.default.mark.intialize.process.end({success:!0}),[2]}})})})]})})})]})})},T.prototype.checkGateImpl=function(S,b){if(this.ensureStoreLoaded(),typeof S!="string"||S.length===0)throw new o.StatsigInvalidArgumentError("Must pass a valid string as the gateName.");return this.store.checkGate(S,b)},T.prototype.logGateExposureImpl=function(S,b){var C=!b,k=b??this.checkGateImpl(S,!1),I=k.gate;this.logger.logGateExposure(this.getCurrentUser(),S,I.value,I.rule_id,I.secondary_exposures,k.evaluationDetails,C)},T.prototype.getConfigImpl=function(S,b){if(this.ensureStoreLoaded(),typeof S!="string"||S.length===0)throw new o.StatsigInvalidArgumentError("Must pass a valid string as the configName.");return this.store.getConfig(S,b)},T.prototype.logConfigExposureImpl=function(S,b){var C=!b,k=b??this.getConfigImpl(S,!1);this.logger.logConfigExposure(this.getCurrentUser(),S,k.getRuleID(),k._getSecondaryExposures(),k.getEvaluationDetails(),C)},T.prototype.getExperimentImpl=function(S,b,C){if(this.ensureStoreLoaded(),typeof S!="string"||S.length===0)throw new o.StatsigInvalidArgumentError("Must pass a valid string as the experimentName.");return this.store.getExperiment(S,b,C)},T.prototype.logExperimentExposureImpl=function(S,b,C){var k=!C,I=C??this.getExperimentImpl(S,b,!1);this.logger.logConfigExposure(this.getCurrentUser(),S,I.getRuleID(),I._getSecondaryExposures(),I.getEvaluationDetails(),k)},T.prototype.getLayerImpl=function(S,b,C){if(this.ensureStoreLoaded(),typeof b!="string"||b.length===0)throw new o.StatsigInvalidArgumentError("Must pass a valid string as the layerName.");return this.store.getLayer(S,b,C)},T.prototype.getEmptyConfig=function(S){return new i.default(S,{},"",this.getEvalutionDetailsForError())},T.prototype.fireAndForgetPrefechUsers=function(){this.prefetchUsers(this.options.getPrefetchUsers()).catch(function(){})},T}();return at.default=O,at}var qs={},dh;function ZA(){if(dh)return qs;dh=1,Object.defineProperty(qs,"__esModule",{value:!0});function t(){Object.entries||(Object.entries=function(e){for(var n=Object.keys(e),r=n.length,i=new Array(r);r--;)i[r]=[n[r],e[n[r]]];return i})}return qs.default=t,qs}var Gs={},fh;function eD(){if(fh)return Gs;fh=1,Object.defineProperty(Gs,"__esModule",{value:!0});function t(){Object.fromEntries||(Object.fromEntries=function(e){for(var n={},r=0,i=e;r<i.length;r++){var s=i[r];if(Object(s)!==s)throw new TypeError("iterable for fromEntries should yield objects");var o=s[0],u=s[1];Object.defineProperty(n,o,{configurable:!0,enumerable:!0,writable:!0,value:u})}return n})}return Gs.default=t,Gs}var zs={},hh;function tD(){if(hh)return zs;hh=1,Object.defineProperty(zs,"__esModule",{value:!0});function t(){Promise.prototype.finally=Promise.prototype.finally||function(e){var n=function(r){return Promise.resolve(e()).then(r)};return this.then(function(r){return n(function(){return r})},function(r){return n(function(){return Promise.reject(r)})})}}return zs.default=t,zs}var ph;function us(){return ph||(ph=1,function(t){var e=Ft&&Ft.__awaiter||function(g,v,y,w){function R(E){return E instanceof y?E:new y(function(O){O(E)})}return new(y||(y=Promise))(function(E,O){function T(C){try{b(w.next(C))}catch(k){O(k)}}function S(C){try{b(w.throw(C))}catch(k){O(k)}}function b(C){C.done?E(C.value):R(C.value).then(T,S)}b((w=w.apply(g,v||[])).next())})},n=Ft&&Ft.__generator||function(g,v){var y={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},w,R,E,O;return O={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function T(b){return function(C){return S([b,C])}}function S(b){if(w)throw new TypeError("Generator is already executing.");for(;y;)try{if(w=1,R&&(E=b[0]&2?R.return:b[0]?R.throw||((E=R.return)&&E.call(R),0):R.next)&&!(E=E.call(R,b[1])).done)return E;switch(R=0,E&&(b=[b[0]&2,E.value]),b[0]){case 0:case 1:E=b;break;case 4:return y.label++,{value:b[1],done:!1};case 5:y.label++,R=b[1],b=[0];continue;case 7:b=y.ops.pop(),y.trys.pop();continue;default:if(E=y.trys,!(E=E.length>0&&E[E.length-1])&&(b[0]===6||b[0]===2)){y=0;continue}if(b[0]===3&&(!E||b[1]>E[0]&&b[1]<E[3])){y.label=b[1];break}if(b[0]===6&&y.label<E[1]){y.label=E[1],E=b;break}if(E&&y.label<E[2]){y.label=E[2],y.ops.push(b);break}E[2]&&y.ops.pop(),y.trys.pop();continue}b=v.call(g,y)}catch(C){b=[6,C],R=0}finally{w=E=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},r=Ft&&Ft.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigAsyncStorage=t.EvaluationReason=t.StatsigClient=t.Layer=t.DynamicConfig=void 0;var i=hl(),s=r(lh()),o=r(Bv()),u=r(ZA()),a=r(eD()),c=r(tD()),l=Pi(),d=pl();Object.defineProperty(t,"DynamicConfig",{enumerable:!0,get:function(){return r(d).default}});var f=gl();Object.defineProperty(t,"Layer",{enumerable:!0,get:function(){return r(f).default}});var h=lh();Object.defineProperty(t,"StatsigClient",{enumerable:!0,get:function(){return r(h).default}});var p=Pi();Object.defineProperty(t,"EvaluationReason",{enumerable:!0,get:function(){return p.EvaluationReason}});var m=as();Object.defineProperty(t,"StatsigAsyncStorage",{enumerable:!0,get:function(){return r(m).default}}),(0,u.default)(),(0,a.default)(),(0,c.default)();var _=function(){function g(){}return Object.defineProperty(g,"encodeIntializeCall",{get:function(){return o.default.encodeInitializeCall},set:function(v){o.default.encodeInitializeCall=v},enumerable:!1,configurable:!0}),g.initialize=function(v,y,w){var R;return e(this,void 0,void 0,function(){var E;return n(this,function(O){return E=(R=g.instance)!==null&&R!==void 0?R:new s.default(v,y,w),g.instance||(g.instance=E),[2,E.initializeAsync()]})})},g.prefetchUsers=function(v){return e(this,void 0,void 0,function(){return n(this,function(y){switch(y.label){case 0:return[4,g.getClientX().prefetchUsers(v)];case 1:return[2,y.sent()]}})})},g.setInitializeValues=function(v){g.getClientX().setInitializeValues(v)},g.checkGate=function(v,y){return y===void 0&&(y=!1),g.getClientX().checkGate(v,y)},g.checkGateWithExposureLoggingDisabled=function(v,y){return y===void 0&&(y=!1),g.getClientX().checkGateWithExposureLoggingDisabled(v,y)},g.manuallyLogGateExposure=function(v){g.getClientX().logGateExposure(v)},g.getConfig=function(v,y){return y===void 0&&(y=!1),g.getClientX().getConfig(v,y)},g.getConfigWithExposureLoggingDisabled=function(v,y){return y===void 0&&(y=!1),g.getClientX().getConfigWithExposureLoggingDisabled(v,y)},g.manuallyLogConfigExposure=function(v){g.getClientX().logConfigExposure(v)},g.getExperiment=function(v,y,w){return y===void 0&&(y=!1),w===void 0&&(w=!1),g.getClientX().getExperiment(v,y,w)},g.getExperimentWithExposureLoggingDisabled=function(v,y,w){return y===void 0&&(y=!1),w===void 0&&(w=!1),g.getClientX().getExperimentWithExposureLoggingDisabled(v,y,w)},g.manuallyLogExperimentExposure=function(v,y){y===void 0&&(y=!1),g.getClientX().logExperimentExposure(v,y)},g.getLayer=function(v,y){return y===void 0&&(y=!1),g.getClientX().getLayer(v,y)},g.getLayerWithExposureLoggingDisabled=function(v,y){return y===void 0&&(y=!1),g.getClientX().getLayerWithExposureLoggingDisabled(v,y)},g.manuallyLogLayerParameterExposure=function(v,y,w){w===void 0&&(w=!1),g.getClientX().logLayerParameterExposure(v,y,w)},g.logEvent=function(v,y,w){return y===void 0&&(y=null),w===void 0&&(w=null),g.getClientX().logEvent(v,y,w)},g.updateUser=function(v){return g.getClientX().updateUser(v)},g.updateUserWithValues=function(v,y){return g.getClientX().updateUserWithValues(v,y)},g.shutdown=function(){g.getClientX().shutdown(),g.instance=null},g.overrideGate=function(v,y){g.getClientX().overrideGate(v,y)},g.overrideConfig=function(v,y){g.getClientX().overrideConfig(v,y)},g.overrideLayer=function(v,y){g.getClientX().overrideLayer(v,y)},g.removeGateOverride=function(v){g.getClientX().removeGateOverride(v)},g.removeConfigOverride=function(v){g.getClientX().removeConfigOverride(v)},g.removeLayerOverride=function(v){g.getClientX().removeLayerOverride(v)},g.getAllOverrides=function(){return g.getClientX().getAllOverrides()},g.getStableID=function(){return g.getClientX().getStableID()},g.getEvaluationDetails=function(){var v,y;return(y=(v=g.instance)===null||v===void 0?void 0:v.getEvaluationDetails())!==null&&y!==void 0?y:{reason:l.EvaluationReason.Uninitialized,time:0}},g.removeOverride=function(v){g.getClientX().removeOverride(v)},g.getOverrides=function(){return g.getClientX().getOverrides()},g.initializeCalled=function(){return g.instance!=null&&g.instance.initializeCalled()},g.flushEvents=function(){g.getClientX().flushEvents()},g.reenableAllLogging=function(){g.getClientX().reenableAllLogging()},g.getClientX=function(){if(!g.instance)throw new i.StatsigUninitializedError;return g.instance},g.instance=null,g}();t.default=_}(Ft)),Ft}var kt={},li={},gh;function qv(){if(gh)return li;gh=1,Object.defineProperty(li,"__esModule",{value:!0}),li.staticImplements=void 0;function t(){return function(e){}}return li.staticImplements=t,li}var di={},mh;function Gv(){return mh||(mh=1,Object.defineProperty(di,"__esModule",{value:!0}),di.version=void 0,di.version="1.32.0"),di}var _h;function ti(){if(_h)return kt;_h=1;var t={},e=kt&&kt.__decorate||function(a,c,l,d){var f=arguments.length,h=f<3?c:d===null?d=Object.getOwnPropertyDescriptor(c,l):d,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(a,c,l,d);else for(var m=a.length-1;m>=0;m--)(p=a[m])&&(h=(f<3?p(h):f>3?p(c,l,h):p(c,l))||h);return f>3&&h&&Object.defineProperty(c,l,h),h},n=kt&&kt.__awaiter||function(a,c,l,d){function f(h){return h instanceof l?h:new l(function(p){p(h)})}return new(l||(l=Promise))(function(h,p){function m(v){try{g(d.next(v))}catch(y){p(y)}}function _(v){try{g(d.throw(v))}catch(y){p(y)}}function g(v){v.done?h(v.value):f(v.value).then(m,_)}g((d=d.apply(a,c||[])).next())})},r=kt&&kt.__generator||function(a,c){var l={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,f,h,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(g){return function(v){return _([g,v])}}function _(g){if(d)throw new TypeError("Generator is already executing.");for(;l;)try{if(d=1,f&&(h=g[0]&2?f.return:g[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,g[1])).done)return h;switch(f=0,h&&(g=[g[0]&2,h.value]),g[0]){case 0:case 1:h=g;break;case 4:return l.label++,{value:g[1],done:!1};case 5:l.label++,f=g[1],g=[0];continue;case 7:g=l.ops.pop(),l.trys.pop();continue;default:if(h=l.trys,!(h=h.length>0&&h[h.length-1])&&(g[0]===6||g[0]===2)){l=0;continue}if(g[0]===3&&(!h||g[1]>h[0]&&g[1]<h[3])){l.label=g[1];break}if(g[0]===6&&l.label<h[1]){l.label=h[1],h=g;break}if(h&&l.label<h[2]){l.label=h[2],l.ops.push(g);break}h[2]&&l.ops.pop(),l.trys.pop();continue}g=c.call(a,l)}catch(v){g=[6,v],f=0}finally{d=h=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}};Object.defineProperty(kt,"__esModule",{value:!0});var i=us(),s=qv(),o=Gv(),u=function(){function a(l,d,f){if(c.instance!=null&&c.canThrow())throw new Error("Cannot create another instance of the static Statsig class");c.instance=new i.StatsigClient(l,d,f)}c=a,a.initialize=function(l,d,f){return n(this,void 0,void 0,function(){return r(this,function(h){try{return c.instance||(c.instance=new i.StatsigClient(l,d,f),c.instance.setSDKPackageInfo(this.sdkPackageInfo),c.instance.setAppState(this.appState),c.instance.setNativeModules(this.nativeModules),c.instance.setPlatform(this.platform),c.instance.setRNDeviceInfo(this.deviceInfo),c.instance.setExpoConstants(this.expoConstants),c.instance.setExpoDevice(this.expoDevice),c.instance.setOnCacheLoadedReactCallback(this.onCacheLoadedCallback)),[2,c.instance.initializeAsync()]}catch(p){if(c.canThrow())throw p}return[2,Promise.resolve()]})})},a.bootstrap=function(l,d,f,h){if(c.instance!=null){c.setInitializeValues(d);return}h==null&&(h={}),h.initializeValues=d,c.instance=new i.StatsigClient(l,f,h),c.instance.setSDKPackageInfo({sdkType:"react-client",sdkVersion:o.version})},a.flushEvents=function(){return this.capture(function(){return c.getClientX().flushEvents()},void 0)},a.reenableAllLogging=function(){return this.capture(function(){return c.getClientX().reenableAllLogging()},void 0)},a.prefetchUsers=function(l){return n(this,void 0,void 0,function(){return r(this,function(d){return[2,this.capture(function(){return c.getClientX().prefetchUsers(l)},Promise.resolve())]})})},a.setInitializeValues=function(l){this.capture(function(){return c.getClientX().setInitializeValues(l)},void 0)},a.getCurrentUser=function(){return this.capture(function(){return c.getClientX().getCurrentUser()},null)},a.checkGate=function(l,d){return d===void 0&&(d=!1),this.capture(function(){return c.getClientX().checkGate(l,d)},!1)},a.checkGateWithExposureLoggingDisabled=function(l,d){return this.capture(function(){return c.getClientX().checkGateWithExposureLoggingDisabled(l,d?.ignoreOverrides)},!1)},a.manuallyLogGateExposure=function(l){this.capture(function(){return c.getClientX().logGateExposure(l)},void 0)},a.getConfig=function(l,d){return d===void 0&&(d=!1),this.capture(function(){return c.getClientX().getConfig(l,d)},new i.DynamicConfig(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.getConfigWithExposureLoggingDisabled=function(l,d){return this.capture(function(){return c.getClientX().getConfigWithExposureLoggingDisabled(l,d?.ignoreOverrides)},new i.DynamicConfig(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.manuallyLogConfigExposure=function(l){this.capture(function(){return c.getClientX().logConfigExposure(l)},void 0)},a.getExperiment=function(l,d,f){return d===void 0&&(d=!1),f===void 0&&(f=!1),this.capture(function(){return c.getClientX().getExperiment(l,d,f)},new i.DynamicConfig(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.getExperimentWithExposureLoggingDisabled=function(l,d){return this.capture(function(){return c.getClientX().getExperimentWithExposureLoggingDisabled(l,d?.keepDeviceValue,d?.ignoreOverrides)},new i.DynamicConfig(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.manuallyLogExperimentExposure=function(l,d){this.capture(function(){return c.getClientX().logExperimentExposure(l,d)},void 0)},a.getLayer=function(l,d){return d===void 0&&(d=!1),this.capture(function(){return c.getClientX().getLayer(l,d)},i.Layer._create(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.getLayerWithExposureLoggingDisabled=function(l,d){return this.capture(function(){return c.getClientX().getLayerWithExposureLoggingDisabled(l,d?.keepDeviceValue)},i.Layer._create(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.manuallyLogLayerParameterExposure=function(l,d,f){f===void 0&&(f=!1),this.capture(function(){return c.getClientX().logLayerParameterExposure(l,d,f)},void 0)},a.logEvent=function(l,d,f){d===void 0&&(d=null),f===void 0&&(f=null),this.capture(function(){return c.getClientX().logEvent(l,d,f)},void 0)},a.updateUser=function(l){return this.capture(function(){return c.getClientX().updateUser(l)},Promise.resolve(!1))},a.updateUserWithValues=function(l,d){return this.capture(function(){return c.getClientX().updateUserWithValues(l,d)},!1)},a.shutdown=function(){this.capture(function(){return c.getClientX().shutdown()},void 0),c.instance=void 0},a.overrideGate=function(l,d){this.capture(function(){var f;((f=c.getAllOverrides().gates)===null||f===void 0?void 0:f[l])!==d&&(c.getClientX().overrideGate(l,d),c.updateContext())},void 0)},a.overrideConfig=function(l,d){this.capture(function(){var f;((f=c.getAllOverrides().configs)===null||f===void 0?void 0:f[l])!==d&&(c.getClientX().overrideConfig(l,d),c.updateContext())},void 0)},a.overrideLayer=function(l,d){this.capture(function(){var f;((f=c.getAllOverrides().layers)===null||f===void 0?void 0:f[l])!==d&&(c.getClientX().overrideLayer(l,d),c.updateContext())},void 0)},a.removeGateOverride=function(l){this.capture(function(){c.getClientX().removeGateOverride(l),c.updateContext()},void 0)},a.removeConfigOverride=function(l){this.capture(function(){c.getClientX().removeConfigOverride(l),c.updateContext()},void 0)},a.removeLayerOverride=function(l){this.capture(function(){c.getClientX().removeLayerOverride(l),c.updateContext()},void 0)},a.getAllOverrides=function(){return this.capture(function(){return c.getClientX().getAllOverrides()},{gates:{},configs:{},layers:{}})},a.getEvaluationDetails=function(){var l,d;return(d=(l=c.instance)===null||l===void 0?void 0:l.getEvaluationDetails())!==null&&d!==void 0?d:{reason:i.EvaluationReason.Uninitialized,time:0}},a.getStableID=function(){return this.capture(function(){return c.getClientX().getStableID()},"")},a.initializeCalled=function(){return c.instance!=null&&c.instance.initializeCalled()},a.setSDKPackageInfo=function(l){c.sdkPackageInfo=l},a.setReactNativeUUID=function(l){l!=null&&i.StatsigClient.setReactNativeUUID(l)},a.setAsyncStorage=function(l){l!=null&&(i.StatsigAsyncStorage.asyncStorage=l)},a.setAppState=function(l){l!=null&&(c.appState=l)},a.setNativeModules=function(l){l!=null&&(c.nativeModules=l)},a.setPlatform=function(l){l!=null&&(c.platform=l)},a.setRNDeviceInfo=function(l){l!=null&&(c.deviceInfo=l)},a.setExpoConstants=function(l){l!=null&&(c.expoConstants=l)},a.setExpoDevice=function(l){l!=null&&(c.expoDevice=l)},a.setReactContextUpdater=function(l){c.reactContextUpdater=l},a.setOnCacheLoadedCallback=function(l){c.onCacheLoadedCallback=l},a.getClientX=function(){if(!c.instance)throw new Error("Call and wait for initialize() to finish first.");return c.instance},a.capture=function(l,d){try{return l()}catch(f){if(c.canThrow())throw f;return d}},a.updateContext=function(){c.reactContextUpdater!=null&&c.reactContextUpdater()},a.canThrow=function(){var l;return typeof process>"u"||typeof t>"u"||((l=process==null?void 0:t)===null||l===void 0?void 0:l.REACT_APP_STATSIG_SDK_MODE)!=="silent"};var c;return a.reactContextUpdater=null,a=c=e([(0,s.staticImplements)()],a),a}();return kt.default=u,kt}var ar={},vh;function Zn(){if(vh)return ar;vh=1;var t=ar&&ar.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ar,"__esModule",{value:!0});var e=t(En());return ar.default=e.default.createContext({initialized:!1,statsigPromise:null,userVersion:0,initStarted:!1,updateUser:function(){}}),ar}var ct={},yh;function nD(){if(yh)return ct;yh=1;var t=ct&&ct.__createBinding||(Object.create?function(f,h,p,m){m===void 0&&(m=p),Object.defineProperty(f,m,{enumerable:!0,get:function(){return h[p]}})}:function(f,h,p,m){m===void 0&&(m=p),f[m]=h[p]}),e=ct&&ct.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),n=ct&&ct.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var p in f)p!=="default"&&Object.prototype.hasOwnProperty.call(f,p)&&t(h,f,p);return e(h,f),h},r=ct&&ct.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(ct,"__esModule",{value:!0});var i=n(En()),s=r(Zn()),o=r(us()),u=r(ti()),a=Gv();function c(f){var h=(0,i.useRef)(null);return(0,i.useEffect)(function(){h.current=f},[f]),h.current}function l(f){var h=f.children,p=f.sdkKey,m=f.user,_=f.setUser,g=f.options,v=f.waitForCache,y=f.waitForInitialization,w=f.initializingComponent,R=f.mountKey,E=f.shutdownOnUnmount,O=E===void 0?!1:E,T=f._reactNativeDependencies,S=!!T,b=(0,i.useState)(!1),C=b[0],k=b[1],I=(0,i.useState)(!1),D=I[0],N=I[1],M=(0,i.useRef)(null),L=(0,i.useState)(0),$=L[0],U=L[1],x=(0,i.useRef)(new Promise(function(X){M.current=X})),P=(0,i.useMemo)(function(){return m},[JSON.stringify(m)]),B=c(R??null);(0,i.useEffect)(function(){if(u.default.initializeCalled()){x.current=new Promise(function(se){M.current=se});var X=R===void 0||B!==R;X&&(N(!1),k(!1)),u.default.updateUser(m).then(function(){M.current&&M.current(),U(function(se){return se+1}),X&&(N(!0),k(!0))});return}u.default.setSDKPackageInfo({sdkType:"react-client",sdkVersion:a.version}),S&&(u.default.setSDKPackageInfo(T.SDKPackageInfo),u.default.setAppState(T.AppState),u.default.setAsyncStorage(T.AsyncStorage),u.default.setNativeModules(T.NativeModules),u.default.setPlatform(T.Platform),u.default.setRNDeviceInfo(T.RNDevice),u.default.setReactNativeUUID(T.ReactNativeUUID),u.default.setExpoConstants(T.Constants),u.default.setExpoDevice(T.ExpoDevice)),u.default.setOnCacheLoadedCallback(function(){k(!0)}),u.default.initialize(p,P,g).then(function(){N(!0),M.current&&M.current()}),typeof window<"u"&&(window.__STATSIG_SDK__=u.default,window.__STATSIG_JS_SDK__=o.default,window.__STATSIG_RERENDER_OVERRIDE__=function(){U($+1)})},[P]),(0,i.useEffect)(function(){return u.default.setReactContextUpdater(function(){return U(function(X){return X+1})}),function(){O&&u.default.shutdown(),u.default.setReactContextUpdater(null)}},[]);var H=d(v===!0,y===!0,D,C,h,w),W=(0,i.useMemo)(function(){return{initialized:D,statsigPromise:x,userVersion:$,initStarted:u.default.initializeCalled(),updateUser:_??function(){}}},[D,x,$,u.default.initializeCalled(),_]);return i.default.createElement(s.default.Provider,{value:W},H)}ct.default=l;function d(f,h,p,m,_,g){return p||h!==!0&&f!==!0||f&&m||h&&p?_:(h||f)&&g!=null?g:null}return ct}var Ws={},it={},Sh;function wn(){if(Sh)return it;Sh=1;var t=it&&it.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(it,"__esModule",{value:!0}),it.useLayerImpl=it.useExperimentImpl=it.useConfigImpl=it.useGateImpl=void 0;var e=En(),n=us(),r=t(Zn()),i=t(ti());function s(c,l,d){d===void 0&&(d=!1);var f=(0,e.useContext)(r.default),h=f.initialized,p=f.userVersion,m=f.initStarted,_=(0,e.useMemo)(function(){return m?d?i.default.checkGateWithExposureLoggingDisabled(c,l):i.default.checkGate(c,l?.ignoreOverrides):!1},[h,m,c,p,l,d]);return{isLoading:!h,value:_}}it.useGateImpl=s;function o(c,l,d){d===void 0&&(d=!1);var f=(0,e.useContext)(r.default),h=f.initialized,p=f.initStarted,m=f.userVersion,_=(0,e.useMemo)(function(){return p?d?i.default.getConfigWithExposureLoggingDisabled(c,l):i.default.getConfig(c,l?.ignoreOverrides):new n.DynamicConfig(c,{},"",{time:Date.now(),reason:n.EvaluationReason.Uninitialized})},[h,p,c,m,l,d]);return{isLoading:!h,config:_}}it.useConfigImpl=o;function u(c,l,d){d===void 0&&(d=!1);var f=(0,e.useContext)(r.default),h=f.initialized,p=f.initStarted,m=f.userVersion,_=(0,e.useMemo)(function(){return p?d?i.default.getExperimentWithExposureLoggingDisabled(c,l):i.default.getExperiment(c,l?.keepDeviceValue,l?.ignoreOverrides):new n.DynamicConfig(c,{},"",{time:Date.now(),reason:n.EvaluationReason.Uninitialized})},[h,p,c,m,l,d]);return{isLoading:!h,config:_}}it.useExperimentImpl=u;function a(c,l,d){d===void 0&&(d=!1);var f=(0,e.useContext)(r.default),h=f.initialized,p=f.initStarted,m=f.userVersion,_=(0,e.useMemo)(function(){return p?d?i.default.getLayerWithExposureLoggingDisabled(c,l):i.default.getLayer(c,l?.keepDeviceValue):n.Layer._create(c,{},"",{time:Date.now(),reason:n.EvaluationReason.Uninitialized})},[h,p,c,m,l,d]);return{isLoading:!h,layer:_}}return it.useLayerImpl=a,it}var bh;function rD(){if(bh)return Ws;bh=1,Object.defineProperty(Ws,"__esModule",{value:!0});var t=wn();function e(n,r){return(0,t.useConfigImpl)(n,{ignoreOverrides:r})}return Ws.default=e,Ws}var Vs={},Eh;function iD(){if(Eh)return Vs;Eh=1,Object.defineProperty(Vs,"__esModule",{value:!0});var t=wn();function e(n,r,i){return r===void 0&&(r=!1),(0,t.useExperimentImpl)(n,{keepDeviceValue:r,ignoreOverrides:i})}return Vs.default=e,Vs}var Ks={},Th;function sD(){if(Th)return Ks;Th=1,Object.defineProperty(Ks,"__esModule",{value:!0});var t=wn();function e(n,r){return(0,t.useGateImpl)(n,{ignoreOverrides:r})}return Ks.default=e,Ks}var Ys={},Ih;function oD(){if(Ih)return Ys;Ih=1,Object.defineProperty(Ys,"__esModule",{value:!0});var t=wn();function e(n,r){return r===void 0&&(r=!1),(0,t.useLayerImpl)(n,{keepDeviceValue:r})}return Ys.default=e,Ys}var ur={},wh;function aD(){if(wh)return ur;wh=1;var t=ur&&ur.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ur,"__esModule",{value:!0});var e=En(),n=t(ti()),r=t(Zn());function i(s){var o=(0,e.useContext)(r.default).initStarted;(0,e.useEffect)(function(){!o||s.length==0||n.default.prefetchUsers(s).catch(function(){})},[o,s])}return ur.default=i,ur}var cr={},Ch;function uD(){if(Ch)return cr;Ch=1;var t=cr&&cr.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(cr,"__esModule",{value:!0});var e=En(),n=t(ti()),r=t(Zn());function i(s,o,u){var a=(0,e.useContext)(r.default).initStarted;(0,e.useEffect)(function(){a&&n.default.logEvent(s,o,u)},[a])}return cr.default=i,cr}var lt={},Rh;function cD(){if(Rh)return lt;Rh=1;var t=lt&<.__createBinding||(Object.create?function(c,l,d,f){f===void 0&&(f=d),Object.defineProperty(c,f,{enumerable:!0,get:function(){return l[d]}})}:function(c,l,d,f){f===void 0&&(f=d),c[f]=l[d]}),e=lt&<.__setModuleDefault||(Object.create?function(c,l){Object.defineProperty(c,"default",{enumerable:!0,value:l})}:function(c,l){c.default=l}),n=lt&<.__importStar||function(c){if(c&&c.__esModule)return c;var l={};if(c!=null)for(var d in c)d!=="default"&&Object.prototype.hasOwnProperty.call(c,d)&&t(l,c,d);return e(l,c),l},r=lt&<.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(lt,"__esModule",{value:!0});var i=n(En()),s=r(Zn()),o=r(us()),u=r(ti());function a(c){var l=c.children,d=c.sdkKey,f=c.user,h=c.options,p=c.initializeValues,m=c.setUser,_=c.shutdownOnUnmount,g=(0,i.useState)(0),v=g[0],y=g[1],w=(0,i.useState)(!0),R=w[0],E=w[1],O=(0,i.useRef)(!0),T=(0,i.useMemo)(function(){return f},[JSON.stringify(f)]);(0,i.useMemo)(function(){return u.default.bootstrap(d,p,T,h),p},[JSON.stringify(p)]),(0,i.useEffect)(function(){if(O.current){O.current=!1,typeof window<"u"&&(window.__STATSIG_SDK__=u.default,window.__STATSIG_JS_SDK__=o.default,window.__STATSIG_RERENDER_OVERRIDE__=function(){y(v+1)});return}E(!1),u.default.updateUser(f).then(function(){y(v+1),E(!0)})},[T]),(0,i.useEffect)(function(){return u.default.setReactContextUpdater(function(){return y(function(b){return b+1})}),function(){_&&u.default.shutdown(),u.default.setReactContextUpdater(null)}},[]);var S=(0,i.useMemo)(function(){return{initialized:R,statsigPromise:null,userVersion:v,initStarted:u.default.initializeCalled(),updateUser:m??function(){}}},[R,v,u.default.initializeCalled(),m]);return i.default.createElement(s.default.Provider,{value:S},l)}return lt.default=a,lt}var Xs={},kh;function lD(){if(kh)return Xs;kh=1,Object.defineProperty(Xs,"__esModule",{value:!0});var t=wn();function e(n,r){return(0,t.useConfigImpl)(n,r,!0)}return Xs.default=e,Xs}var Js={},xh;function dD(){if(xh)return Js;xh=1,Object.defineProperty(Js,"__esModule",{value:!0});var t=wn();function e(n,r){return(0,t.useGateImpl)(n,r,!0)}return Js.default=e,Js}var Qs={},Oh;function fD(){if(Oh)return Qs;Oh=1,Object.defineProperty(Qs,"__esModule",{value:!0});var t=wn();function e(n,r){return(0,t.useExperimentImpl)(n,r,!0)}return Qs.default=e,Qs}var Zs={},Ah;function hD(){if(Ah)return Zs;Ah=1,Object.defineProperty(Zs,"__esModule",{value:!0});var t=wn();function e(n,r){return(0,t.useLayerImpl)(n,r,!0)}return Zs.default=e,Zs}var lr={},Dh;function pD(){if(Dh)return lr;Dh=1;var t=lr&&lr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(lr,"__esModule",{value:!0});var e=En(),n=t(Zn());function r(){var i=(0,e.useContext)(n.default);return i.updateUser}return lr.default=r,lr}var Mh;function YM(){return Mh||(Mh=1,function(t){var e=ui&&ui.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSynchronousProvider=t.Layer=t.staticImplements=t.DynamicConfig=t.useUpdateUser=t.useStatsigLogEffect=t.useGateWithExposureLoggingDisabled=t.useGate=t.usePrefetchUsers=t.useLayerWithExposureLoggingDisabled=t.useLayer=t.useExperimentWithExposureLoggingDisabled=t.useExperiment=t.useConfigWithExposureLoggingDisabled=t.useConfig=t.StatsigProvider=t.StatsigContext=t.Statsig=void 0;var n=us();Object.defineProperty(t,"DynamicConfig",{enumerable:!0,get:function(){return n.DynamicConfig}}),Object.defineProperty(t,"Layer",{enumerable:!0,get:function(){return n.Layer}});var r=e(ti());t.Statsig=r.default;var i=e(Zn());t.StatsigContext=i.default;var s=e(nD());t.StatsigProvider=s.default;var o=qv();Object.defineProperty(t,"staticImplements",{enumerable:!0,get:function(){return o.staticImplements}});var u=e(rD());t.useConfig=u.default;var a=e(iD());t.useExperiment=a.default;var c=e(sD());t.useGate=c.default;var l=e(oD());t.useLayer=l.default;var d=e(aD());t.usePrefetchUsers=d.default;var f=e(uD());t.useStatsigLogEffect=f.default;var h=e(cD());t.StatsigSynchronousProvider=h.default;var p=e(lD());t.useConfigWithExposureLoggingDisabled=p.default;var m=e(dD());t.useGateWithExposureLoggingDisabled=m.default;var _=e(fD());t.useExperimentWithExposureLoggingDisabled=_.default;var g=e(hD());t.useLayerWithExposureLoggingDisabled=g.default;var v=e(pD());t.useUpdateUser=v.default}(ui)),ui}var zv=-1,_l=function(t){addEventListener("pageshow",function(e){e.persisted&&(zv=e.timeStamp,t(e))},!0)},Wv=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},vl=function(){var t=Wv();return t&&t.activationStart||0},jo=function(t,e){var n=Wv(),r="navigate";return zv>=0?r="back-forward-cache":n&&(document.prerendering||vl()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Vv=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver(function(i){Promise.resolve().then(function(){e(i.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},qo=function(t,e,n,r){var i,s;return function(o){e.value>=0&&(o||r)&&((s=e.value-(i||0))||i===void 0)&&(i=e.value,e.delta=s,e.rating=function(u,a){return u>a[1]?"poor":u>a[0]?"needs-improvement":"good"}(e.value,n),t(e))}},Kv=function(t){requestAnimationFrame(function(){return requestAnimationFrame(function(){return t()})})},Yv=function(t){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&t()})},Xv=function(t){var e=!1;return function(){e||(t(),e=!0)}},Sr=-1,Lh=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Go=function(t){document.visibilityState==="hidden"&&Sr>-1&&(Sr=t.type==="visibilitychange"?t.timeStamp:0,gD())},Nh=function(){addEventListener("visibilitychange",Go,!0),addEventListener("prerenderingchange",Go,!0)},gD=function(){removeEventListener("visibilitychange",Go,!0),removeEventListener("prerenderingchange",Go,!0)},Jv=function(){return Sr<0&&(Sr=Lh(),Nh(),_l(function(){setTimeout(function(){Sr=Lh(),Nh()},0)})),{get firstHiddenTime(){return Sr}}},Qv=function(t){document.prerendering?addEventListener("prerenderingchange",function(){return t()},!0):t()},Ph=[1800,3e3],XM=function(t,e){e=e||{},Qv(function(){var n,r=Jv(),i=jo("FCP"),s=Vv("paint",function(o){o.forEach(function(u){u.name==="first-contentful-paint"&&(s.disconnect(),u.startTime<r.firstHiddenTime&&(i.value=Math.max(u.startTime-vl(),0),i.entries.push(u),n(!0)))})});s&&(n=qo(t,i,Ph,e.reportAllChanges),_l(function(o){i=jo("FCP"),n=qo(t,i,Ph,e.reportAllChanges),Kv(function(){i.value=performance.now()-o.timeStamp,n(!0)})}))})},mD=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=Xv(t),document.visibilityState==="hidden"?t():(n=e(t),Yv(t)),n},$h=[2500,4e3],Za={},JM=function(t,e){e=e||{},Qv(function(){var n,r=Jv(),i=jo("LCP"),s=function(a){e.reportAllChanges||(a=a.slice(-1)),a.forEach(function(c){c.startTime<r.firstHiddenTime&&(i.value=Math.max(c.startTime-vl(),0),i.entries=[c],n())})},o=Vv("largest-contentful-paint",s);if(o){n=qo(t,i,$h,e.reportAllChanges);var u=Xv(function(){Za[i.id]||(s(o.takeRecords()),o.disconnect(),Za[i.id]=!0,n(!0))});["keydown","click"].forEach(function(a){addEventListener(a,function(){return mD(u)},!0)}),Yv(u),_l(function(a){i=jo("LCP"),n=qo(t,i,$h,e.reportAllChanges),Kv(function(){i.value=performance.now()-a.timeStamp,Za[i.id]=!0,n(!0)})})}})},Be=function(){return Be=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Be.apply(this,arguments)};function _D(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function je(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function u(l){try{c(r.next(l))}catch(d){o(d)}}function a(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(u,a)}c((r=r.apply(t,[])).next())})}function qe(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(l){return a([c,l])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(l){c=[6,l],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Fr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function dt(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function zt(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Je;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(Je||(Je={}));var Mn;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE="$revenue"})(Mn||(Mn={}));var Br;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(Br||(Br={}));var _t;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(_t||(_t={}));var Jt;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(Jt||(Jt={}));var zo;(function(t){t.US="US",t.EU="EU"})(zo||(zo={}));var Ne;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(Ne||(Ne={}));var Wo;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(Wo||(Wo={}));var Uh="-",yl="AMP",vD="".concat(yl,"_unsent"),Zv="https://api2.amplitude.com/2/httpapi",yD="https://api.eu.amplitude.com/2/httpapi",SD="https://api2.amplitude.com/batch",bD="https://api.eu.amplitude.com/batch",ED=1e3,Vu=function(t){if(Object.keys(t).length>ED)return!1;for(var e in t){var n=t[e];if(!ey(e,n))return!1}return!0},ey=function(t,e){var n,r;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var s=Fr(e),o=s.next();!o.done;o=s.next()){var u=o.value;if(Array.isArray(u))return!1;if(typeof u=="object")i=i&&Vu(u);else if(!["number","string"].includes(typeof u))return!1;if(!i)return!1}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}else{if(e==null)return!1;if(typeof e=="object")return Vu(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0},Vo=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return Be({},this._properties)},t.prototype.set=function(e,n){return this._safeSet(Je.SET,e,n),this},t.prototype.setOnce=function(e,n){return this._safeSet(Je.SET_ONCE,e,n),this},t.prototype.append=function(e,n){return this._safeSet(Je.APPEND,e,n),this},t.prototype.prepend=function(e,n){return this._safeSet(Je.PREPEND,e,n),this},t.prototype.postInsert=function(e,n){return this._safeSet(Je.POSTINSERT,e,n),this},t.prototype.preInsert=function(e,n){return this._safeSet(Je.PREINSERT,e,n),this},t.prototype.remove=function(e,n){return this._safeSet(Je.REMOVE,e,n),this},t.prototype.add=function(e,n){return this._safeSet(Je.ADD,e,n),this},t.prototype.unset=function(e){return this._safeSet(Je.UNSET,e,Uh),this},t.prototype.clearAll=function(){return this._properties={},this._properties[Je.CLEAR_ALL]=Uh,this},t.prototype._safeSet=function(e,n,r){if(this._validate(e,n,r)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[n]=r,this._propertySet.add(n),!0}return!1},t.prototype._validate=function(e,n,r){return this._properties[Je.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:e===Je.ADD?typeof r=="number":e!==Je.UNSET&&e!==Je.REMOVE?ey(n,r):!0},t}(),TD=function(t,e,n){var r=typeof t=="string"?{event_type:t}:t;return Be(Be(Be({},r),n),e&&{event_properties:e})},ty=function(t,e){var n=Be(Be({},e),{event_type:Br.IDENTIFY,user_properties:t.getUserProperties()});return n},ID=function(t,e,n,r){var i,s=Be(Be({},r),{event_type:Br.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[t]=e,i)});return s},wD=function(t,e,n){var r,i=new Vo;i.set(t,e);var s=Be(Be({},n),{event_type:Br.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[t]=e,r)});return s},CD=function(t,e){return Be(Be({},e),{event_type:Br.REVENUE,event_properties:t.getEventProperties()})},Ri=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Ne.Unknown),{event:t,code:e,message:n}},RD=function(){function t(){this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(e,n){return je(this,void 0,void 0,function(){return qe(this,function(r){switch(r.label){case 0:return[4,e.setup(n)];case 1:return r.sent(),this.plugins.push(e),[2]}})})},t.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex(function(n){return n.name===e}),1),Promise.resolve()},t.prototype.reset=function(){this.applying=!1,this.plugins=[]},t.prototype.push=function(e){var n=this;return new Promise(function(r){n.queue.push([e,r]),n.scheduleApply(0)})},t.prototype.scheduleApply=function(e){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},e))},t.prototype.apply=function(e){return je(this,void 0,void 0,function(){var n,r,i,s,o,u,a,h,c,l,d,f,h,p,m,_,g,v,y,w;return qe(this,function(R){switch(R.label){case 0:if(!e)return[2];n=dt(e,1),r=n[0],i=dt(e,2),s=i[1],o=this.plugins.filter(function(E){return E.type===Jt.BEFORE}),R.label=1;case 1:R.trys.push([1,6,7,8]),u=Fr(o),a=u.next(),R.label=2;case 2:return a.done?[3,5]:(h=a.value,[4,h.execute(Be({},r))]);case 3:r=R.sent(),R.label=4;case 4:return a=u.next(),[3,2];case 5:return[3,8];case 6:return c=R.sent(),g={error:c},[3,8];case 7:try{a&&!a.done&&(v=u.return)&&v.call(u)}finally{if(g)throw g.error}return[7];case 8:l=this.plugins.filter(function(E){return E.type===Jt.ENRICHMENT}),R.label=9;case 9:R.trys.push([9,14,15,16]),d=Fr(l),f=d.next(),R.label=10;case 10:return f.done?[3,13]:(h=f.value,[4,h.execute(Be({},r))]);case 11:r=R.sent(),R.label=12;case 12:return f=d.next(),[3,10];case 13:return[3,16];case 14:return p=R.sent(),y={error:p},[3,16];case 15:try{f&&!f.done&&(w=d.return)&&w.call(d)}finally{if(y)throw y.error}return[7];case 16:return m=this.plugins.filter(function(E){return E.type===Jt.DESTINATION}),_=m.map(function(E){var O=Be({},r);return E.execute(O).catch(function(T){return Ri(O,0,String(T))})}),Promise.all(_).then(function(E){var O=dt(E,1),T=O[0];s(T)}),[2]}})})},t.prototype.flush=function(){return je(this,void 0,void 0,function(){var e,n,r,i=this;return qe(this,function(s){switch(s.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(o){return i.apply(o)}))];case 1:return s.sent(),n=this.plugins.filter(function(o){return o.type===Jt.DESTINATION}),r=n.map(function(o){return o.flush&&o.flush()}),[4,Promise.all(r)];case 2:return s.sent(),[2]}})})},t}(),kD="Event tracked successfully",xD="Unexpected error occurred",OD="Event rejected due to exceeded retry count",AD="Event skipped due to optOut config",DD="Event rejected due to missing API key",MD="Invalid API key",LD="Client not initialized",ND=function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new RD,this.name=e}return t.prototype._init=function(e){return je(this,void 0,void 0,function(){return qe(this,function(n){switch(n.label){case 0:return this.config=e,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return n.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(e){return je(this,void 0,void 0,function(){var n,r,i,s,o,u,a;return qe(this,function(c){switch(c.label){case 0:n=this[e],this[e]=[],c.label=1;case 1:c.trys.push([1,6,7,8]),r=Fr(n),i=r.next(),c.label=2;case 2:return i.done?[3,5]:(s=i.value,[4,s()]);case 3:c.sent(),c.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return o=c.sent(),u={error:o},[3,8];case 7:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(u)throw u.error}return[7];case 8:return[2]}})})},t.prototype.track=function(e,n,r){var i=TD(e,n,r);return this.dispatch(i)},t.prototype.identify=function(e,n){var r=ty(e,n);return this.dispatch(r)},t.prototype.groupIdentify=function(e,n,r,i){var s=ID(e,n,r,i);return this.dispatch(s)},t.prototype.setGroup=function(e,n,r){var i=wD(e,n,r);return this.dispatch(i)},t.prototype.revenue=function(e,n){var r=CD(e,n);return this.dispatch(r)},t.prototype.add=function(e){return je(this,void 0,void 0,function(){return qe(this,function(n){return this.config?[2,this.timeline.register(e,this.config)]:(this.q.push(this.add.bind(this,e)),[2])})})},t.prototype.remove=function(e){return je(this,void 0,void 0,function(){return qe(this,function(n){return this.config?[2,this.timeline.deregister(e)]:(this.q.push(this.remove.bind(this,e)),[2])})})},t.prototype.dispatchWithCallback=function(e,n){if(!this.config)return n(Ri(e,0,LD));this.process(e).then(n)},t.prototype.dispatch=function(e){return je(this,void 0,void 0,function(){var n=this;return qe(this,function(r){return this.config?[2,this.process(e)]:[2,new Promise(function(i){n.dispatchQ.push(n.dispatchWithCallback.bind(n,e,i))})]})})},t.prototype.process=function(e){return je(this,void 0,void 0,function(){var i,n,r,i;return qe(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.config.optOut?[2,Ri(e,0,AD)]:[4,this.timeline.push(e)];case 1:return i=s.sent(),i.code===200?this.config.loggerProvider.log(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return n=s.sent(),r=String(n),this.config.loggerProvider.error(r),i=Ri(e,0,r),[2,i];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.config){this.q.push(this.setOptOut.bind(this,!!e));return}this.config.optOut=!!e},t.prototype.flush=function(){return this.timeline.flush()},t}(),PD=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setEventProperties=function(e){return Vu(e)&&(this.properties=e),this},t.prototype.getEventProperties=function(){var e=this.properties?Be({},this.properties):{};return e[Mn.REVENUE_PRODUCT_ID]=this.productId,e[Mn.REVENUE_QUANTITY]=this.quantity,e[Mn.REVENUE_PRICE]=this.price,e[Mn.REVENUE_TYPE]=this.revenueType,e[Mn.REVENUE]=this.revenue,e},t}(),$D=function(t,e){var n=Math.max(e,1);return t.reduce(function(r,i,s){var o=Math.floor(s/n);return r[o]||(r[o]=[]),r[o].push(i),r},[])},eo="Amplitude Logger ",UD=function(){function t(){this.logLevel=_t.None}return t.prototype.disable=function(){this.logLevel=_t.None},t.prototype.enable=function(e){e===void 0&&(e=_t.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<_t.Verbose||console.log("".concat(eo,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<_t.Warn||console.warn("".concat(eo,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<_t.Error||console.error("".concat(eo,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<_t.Debug||console.log("".concat(eo,"[Debug]: ").concat(e.join(" ")))},t}(),co=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:_t.Warn,loggerProvider:new UD,optOut:!1,serverUrl:Zv,serverZone:zo.US,useBatch:!1}},FD=function(){function t(e){var n,r,i;this._optOut=!1;var s=co();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis||s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=(r=e.optOut)!==null&&r!==void 0?r:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(i=e.useBatch)!==null&&i!==void 0?i:s.useBatch,this.loggerProvider.enable(this.logLevel);var o=ny(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),t}(),BD=function(t,e){return t===zo.EU?e?bD:yD:e?SD:Zv},ny=function(t,e,n){if(t===void 0&&(t=""),e===void 0&&(e=co().serverZone),n===void 0&&(n=co().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=["US","EU"].includes(e)?e:co().serverZone;return{serverZone:r,serverUrl:BD(r,n)}},HD=function(){function t(){this.name="amplitude",this.type=Jt.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(e){var n;return je(this,void 0,void 0,function(){var r,i=this;return qe(this,function(s){switch(s.label){case 0:return this.config=e,this.storageKey="".concat(vD,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=s.sent(),this.saveEvents(),r&&r.length>0&&Promise.all(r.map(function(o){return i.execute(o)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(e){var n=this;return new Promise(function(r){var i={event:e,attempts:0,callback:function(s){return r(s)},timeout:0};n.addToQueue(i)})},t.prototype.addToQueue=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.filter(function(s){return s.attempts<e.config.flushMaxRetries?(s.attempts+=1,!0):(e.fulfillRequest([s],500,OD),!1)});i.forEach(function(s){if(e.queue=e.queue.concat(s),s.timeout===0){e.schedule(e.config.flushIntervalMillis);return}setTimeout(function(){s.timeout=0,e.schedule(0)},s.timeout)}),this.saveEvents()},t.prototype.schedule=function(e){var n=this;this.scheduled||(this.scheduled=setTimeout(function(){n.flush(!0).then(function(){n.queue.length>0&&n.schedule(e)})},e))},t.prototype.flush=function(e){return e===void 0&&(e=!1),je(this,void 0,void 0,function(){var n,r,i,s=this;return qe(this,function(o){switch(o.label){case 0:return n=[],r=[],this.queue.forEach(function(u){return u.timeout===0?n.push(u):r.push(u)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),i=$D(n,this.config.flushQueueSize),[4,Promise.all(i.map(function(u){return s.send(u,e)}))];case 1:return o.sent(),[2]}})})},t.prototype.send=function(e,n){return n===void 0&&(n=!0),je(this,void 0,void 0,function(){var r,i,s,o,u;return qe(this,function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,DD)];r={api_key:this.config.apiKey,events:e.map(function(c){var l=c.event;l.extra;var d=_D(l,["extra"]);return d}),options:{min_id_length:this.config.minIdLength}},a.label=1;case 1:return a.trys.push([1,3,,4]),i=ny(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:if(s=a.sent(),s===null)return this.fulfillRequest(e,0,xD),[2];if(!n){if("body"in s){o="";try{o=JSON.stringify(s.body,null,2)}catch{}this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(o))}else this.fulfillRequest(e,s.statusCode,s.status);return[2]}return this.handleReponse(s,e),[3,4];case 3:return u=a.sent(),this.fulfillRequest(e,0,String(u)),[3,4];case 4:return[2]}})})},t.prototype.handleReponse=function(e,n){var r=e.status;switch(r){case Ne.Success:this.handleSuccessResponse(e,n);break;case Ne.Invalid:this.handleInvalidResponse(e,n);break;case Ne.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,n);break;case Ne.RateLimit:this.handleRateLimitResponse(e,n);break;default:this.handleOtherReponse(n)}},t.prototype.handleSuccessResponse=function(e,n){this.fulfillRequest(n,e.statusCode,kD)},t.prototype.handleInvalidResponse=function(e,n){var r=this;if(e.body.missingField||e.body.error.startsWith(MD)){this.fulfillRequest(n,e.statusCode,e.body.error);return}var i=zt(zt(zt(zt([],dt(Object.values(e.body.eventsWithInvalidFields)),!1),dt(Object.values(e.body.eventsWithMissingFields)),!1),dt(Object.values(e.body.eventsWithInvalidIdLengths)),!1),dt(e.body.silencedEvents),!1).flat(),s=new Set(i),o=n.filter(function(u,a){if(s.has(a)){r.fulfillRequest([u],e.statusCode,e.body.error);return}return!0});this.addToQueue.apply(this,zt([],dt(o),!1))},t.prototype.handlePayloadTooLargeResponse=function(e,n){if(n.length===1){this.fulfillRequest(n,e.statusCode,e.body.error);return}this.config.flushQueueSize/=2,this.addToQueue.apply(this,zt([],dt(n),!1))},t.prototype.handleRateLimitResponse=function(e,n){var r=this,i=Object.keys(e.body.exceededDailyQuotaUsers),s=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,u=new Set(i),a=new Set(s),c=new Set(o),l=n.filter(function(d,f){if(d.event.user_id&&u.has(d.event.user_id)||d.event.device_id&&a.has(d.event.device_id)){r.fulfillRequest([d],e.statusCode,e.body.error);return}return c.has(f)&&(d.timeout=r.throttleTimeout),!0});this.addToQueue.apply(this,zt([],dt(l),!1))},t.prototype.handleOtherReponse=function(e){var n=this;this.addToQueue.apply(this,zt([],dt(e.map(function(r){return r.timeout=r.attempts*n.retryTimeout,r})),!1))},t.prototype.fulfillRequest=function(e,n,r){this.saveEvents(),e.forEach(function(i){return i.callback(Ri(i.event,n,r))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map(function(n){return n.event}));this.config.storageProvider.set(this.storageKey,e)}},t}(),xt=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return{promise:t.apply(void 0,zt([],dt(e),!1))}}},jD=function(t){var e=new Error().stack||"";return e.split(`
`).slice(2+t).map(function(n){return n.trim()})},De=function(t){return function(){var e=Be({},t.config),n=e.loggerProvider,r=e.logLevel;return{logger:n,logLevel:r}}},qD=function(t,e){var n,r;e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,"");try{for(var i=Fr(e.split(".")),s=i.next();!s.done;s=i.next()){var o=s.value;if(o in t)t=t[o];else return}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},Me=function(t,e){return function(){var n,r,i={};try{for(var s=Fr(e),o=s.next();!o.done;o=s.next()){var u=o.value;i[u]=qD(t,u)}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i}},Le=function(t,e,n,r,i){return i===void 0&&(i=null),function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var u=n(),a=u.logger,c=u.logLevel;if(c&&c<_t.Debug||!c||!a)return t.apply(i,s);var l={type:"invoke public method",name:e,args:s,stacktrace:jD(1),time:{start:new Date().toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=t.apply(i,s);return d&&d.promise?d.promise.then(function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),a.debug(JSON.stringify(l,null,2))}):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),a.debug(JSON.stringify(l,null,2))),d}},Ea=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Ea)},ry=function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return je(this,void 0,void 0,function(){return qe(this,function(e){return[2,!0]})})},t.prototype.get=function(e){return je(this,void 0,void 0,function(){return qe(this,function(n){return[2,this.memoryStorage.get(e)]})})},t.prototype.getRaw=function(e){return je(this,void 0,void 0,function(){var n;return qe(this,function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return n=r.sent(),[2,n?JSON.stringify(n):void 0]}})})},t.prototype.set=function(e,n){return je(this,void 0,void 0,function(){return qe(this,function(r){return this.memoryStorage.set(e,n),[2]})})},t.prototype.remove=function(e){return je(this,void 0,void 0,function(){return qe(this,function(n){return this.memoryStorage.delete(e),[2]})})},t.prototype.reset=function(){return je(this,void 0,void 0,function(){return qe(this,function(e){return this.memoryStorage.clear(),[2]})})},t}(),Sl=function(){function t(){}return t.prototype.send=function(e,n){return Promise.resolve(null)},t.prototype.buildResponse=function(e){var n,r,i,s,o,u,a,c,l,d,f,h,p,m,_,g,v,y,w,R,E,O;if(typeof e!="object")return null;var T=e.code||0,S=this.buildStatus(T);switch(S){case Ne.Success:return{status:S,statusCode:T,body:{eventsIngested:(n=e.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=e.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(i=e.server_upload_time)!==null&&i!==void 0?i:0}};case Ne.Invalid:return{status:S,statusCode:T,body:{error:(s=e.error)!==null&&s!==void 0?s:"",missingField:(o=e.missing_field)!==null&&o!==void 0?o:"",eventsWithInvalidFields:(u=e.events_with_invalid_fields)!==null&&u!==void 0?u:{},eventsWithMissingFields:(a=e.events_with_missing_fields)!==null&&a!==void 0?a:{},eventsWithInvalidIdLengths:(c=e.events_with_invalid_id_lengths)!==null&&c!==void 0?c:{},epsThreshold:(l=e.eps_threshold)!==null&&l!==void 0?l:0,exceededDailyQuotaDevices:(d=e.exceeded_daily_quota_devices)!==null&&d!==void 0?d:{},silencedDevices:(f=e.silenced_devices)!==null&&f!==void 0?f:[],silencedEvents:(h=e.silenced_events)!==null&&h!==void 0?h:[],throttledDevices:(p=e.throttled_devices)!==null&&p!==void 0?p:{},throttledEvents:(m=e.throttled_events)!==null&&m!==void 0?m:[]}};case Ne.PayloadTooLarge:return{status:S,statusCode:T,body:{error:(_=e.error)!==null&&_!==void 0?_:""}};case Ne.RateLimit:return{status:S,statusCode:T,body:{error:(g=e.error)!==null&&g!==void 0?g:"",epsThreshold:(v=e.eps_threshold)!==null&&v!==void 0?v:0,throttledDevices:(y=e.throttled_devices)!==null&&y!==void 0?y:{},throttledUsers:(w=e.throttled_users)!==null&&w!==void 0?w:{},exceededDailyQuotaDevices:(R=e.exceeded_daily_quota_devices)!==null&&R!==void 0?R:{},exceededDailyQuotaUsers:(E=e.exceeded_daily_quota_users)!==null&&E!==void 0?E:{},throttledEvents:(O=e.throttled_events)!==null&&O!==void 0?O:[]}};case Ne.Timeout:default:return{status:S,statusCode:T}}},t.prototype.buildStatus=function(e){return e>=200&&e<300?Ne.Success:e===429?Ne.RateLimit:e===413?Ne.PayloadTooLarge:e===408?Ne.Timeout:e>=400&&e<500?Ne.Invalid:e>=500?Ne.Failed:Ne.Unknown},t}(),Ku=function(t,e){return Ku=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Ku(t,e)};function Ta(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ku(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var me=function(){return me=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},me.apply(this,arguments)};function Ke(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function u(l){try{c(r.next(l))}catch(d){o(d)}}function a(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(u,a)}c((r=r.apply(t,[])).next())})}function Ye(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(l){return a([c,l])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(l){c=[6,l],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function GD(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function zD(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}var Yu=function(t,e){return Yu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Yu(t,e)};function WD(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Yu(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var bt=function(){return bt=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},bt.apply(this,arguments)};function Fh(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function ft(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function u(l){try{c(r.next(l))}catch(d){o(d)}}function a(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(u,a)}c((r=r.apply(t,[])).next())})}function ht(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(l){return a([c,l])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(l){c=[6,l],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function VD(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}var Lt=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},Xu=function(){var t,e=Lt();if(!(!((t=e?.location)===null||t===void 0)&&t.search))return{};var n=e.location.search.substring(1).split("&").filter(Boolean),r=n.reduce(function(i,s){var o=s.split("=",2),u=Bh(o[0]),a=Bh(o[1]);return a&&(i[u]=a),i},{});return r},Bh=function(t){t===void 0&&(t="");try{return decodeURIComponent(t)}catch{return""}},KD="utm_campaign",YD="utm_content",XD="utm_id",JD="utm_medium",QD="utm_source",ZD="utm_term",Hh="dclid",jh="fbclid",qh="gbraid",Gh="gclid",zh="ko_click_id",Wh="msclkid",Vh="ttclid",Kh="twclid",Yh="wbraid",eM="EMPTY",iy={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},tM="MKTG",nM=function(){function t(){}return t.prototype.parse=function(){return ft(this,void 0,void 0,function(){return ht(this,function(e){return[2,bt(bt(bt(bt({},iy),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var e=Xu(),n=e[KD],r=e[YD],i=e[XD],s=e[JD],o=e[QD],u=e[ZD];return{utm_campaign:n,utm_content:r,utm_id:i,utm_medium:s,utm_source:o,utm_term:u}},t.prototype.getReferrer=function(){var e,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(e=r.referrer)===null||e===void 0?void 0:e.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},t.prototype.getClickIds=function(){var e,n=Xu();return e={},e[Hh]=n[Hh],e[jh]=n[jh],e[qh]=n[qh],e[Gh]=n[Gh],e[zh]=n[zh],e[Wh]=n[Wh],e[Vh]=n[Vh],e[Kh]=n[Kh],e[Yh]=n[Yh],e},t}(),bl=function(t,e,n){return e===void 0&&(e=""),n===void 0&&(n=10),[yl,e,t.substring(0,n)].filter(Boolean).join("_")},rM=function(t){return"".concat(yl.toLowerCase(),"_").concat(t.substring(0,6))},iM=function(){function t(e,n){var r,i;this.storage=n.storage,this.storageKey=bl(e,tM),this.parser=new nM,this.track=n.track,this.onNewCampaign=n.onNewCampaign,this.disabled=!!n.disabled,this.trackNewCampaigns=!!n.trackNewCampaigns,this.trackPageViews=!!n.trackPageViews,this.excludeReferrers=(r=n.excludeReferrers)!==null&&r!==void 0?r:[],typeof location<"u"&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=(i=n.initialEmptyValue)!==null&&i!==void 0?i:eM}return t.prototype.isNewCampaign=function(e,n,r){r===void 0&&(r=!1),e.referrer;var i=e.referring_domain,s=Fh(e,["referrer","referring_domain"]),o=n||{};o.referrer;var u=o.referring_domain,a=Fh(o,["referrer","referring_domain"]);if(e.referring_domain&&this.excludeReferrers.includes(e.referring_domain))return!1;var c=JSON.stringify(s)!==JSON.stringify(a),l=r?Xh(i||"")!==Xh(u||""):i!==u;return!n||c||l},t.prototype.saveCampaignToStorage=function(e){return ft(this,void 0,void 0,function(){return ht(this,function(n){switch(n.label){case 0:return[4,this.storage.set(this.storageKey,e)];case 1:return n.sent(),[2]}})})},t.prototype.getCampaignFromStorage=function(){return ft(this,void 0,void 0,function(){return ht(this,function(e){switch(e.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,e.sent()]}})})},t.prototype.createCampaignEvent=function(e){var n=this,r=bt(bt({},iy),e),i=Object.entries(r).reduce(function(o,u){var a=VD(u,2),c=a[0],l=a[1];return o.setOnce("initial_".concat(c),l||n.initialEmptyValue),l?o.set(c,l):o.unset(c)},new Vo),s={event_type:"Page View",event_properties:{page_title:typeof document<"u"&&document.title||"",page_location:typeof location<"u"&&location.href||"",page_path:typeof location<"u"&&location.pathname||""}};return bt(bt({},ty(i)),this.trackPageViews&&s)},t.prototype.send=function(e){return ft(this,void 0,void 0,function(){var n,r;return ht(this,function(i){switch(i.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return n=i.sent(),[4,this.getCampaignFromStorage()];case 2:if(r=i.sent(),!e){if(!this.trackNewCampaigns||!this.isNewCampaign(n,r))return[2];this.onNewCampaign(n)}return[4,this.track(this.createCampaignEvent(n))];case 3:return i.sent(),[4,this.saveCampaignToStorage(n)];case 4:return i.sent(),[2]}})})},t}(),Xh=function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")},Ko=function(){function t(e){this.options=bt({},e)}return t.prototype.isEnabled=function(){return ft(this,void 0,void 0,function(){var e,n,r,i;return ht(this,function(s){switch(s.label){case 0:if(!Lt())return[2,!1];e=String(Date.now()),n=new t(this.options),r="AMP_TEST",s.label=1;case 1:return s.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return s.sent(),[4,n.get(r)];case 3:return i=s.sent(),[2,i===e];case 4:return s.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return s.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return ft(this,void 0,void 0,function(){var n;return ht(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:if(n=r.sent(),!n)return[2,void 0];try{try{n=decodeURIComponent(atob(n))}catch{}return[2,JSON.parse(n)]}catch{return[2,void 0]}return[2]}})})},t.prototype.getRaw=function(e){var n;return ft(this,void 0,void 0,function(){var r,i,s;return ht(this,function(o){return r=Lt(),i=(n=r?.document.cookie.split("; "))!==null&&n!==void 0?n:[],s=i.find(function(u){return u.indexOf(e+"=")===0}),s?[2,s.substring(e.length+1)]:[2,void 0]})})},t.prototype.set=function(e,n){var r;return ft(this,void 0,void 0,function(){var i,s,o,u,a,c;return ht(this,function(l){try{i=(r=this.options.expirationDays)!==null&&r!==void 0?r:0,s=n!==null?i:-1,o=void 0,s&&(u=new Date,u.setTime(u.getTime()+s*24*60*60*1e3),o=u),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(n)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),c=Lt(),c&&(c.document.cookie=a)}catch{}return[2]})})},t.prototype.remove=function(e){return ft(this,void 0,void 0,function(){return ht(this,function(n){switch(n.label){case 0:return[4,this.set(e,null)];case 1:return n.sent(),[2]}})})},t.prototype.reset=function(){return ft(this,void 0,void 0,function(){return ht(this,function(e){return[2]})})},t}(),sM=function(t){WD(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(n,r){return ft(this,void 0,void 0,function(){var i,s,o;return ht(this,function(u){switch(u.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(r),method:"POST"},[4,fetch(n,i)];case 1:return s=u.sent(),[4,s.json()];case 2:return o=u.sent(),[2,this.buildResponse(o)]}})})},e}(Sl),mi={exports:{}},oM=mi.exports,Jh;function aM(){return Jh||(Jh=1,function(t,e){(function(n,r){var i="0.7.31",s="",o="?",u="function",a="undefined",c="object",l="string",d="major",f="model",h="name",p="type",m="vendor",_="version",g="architecture",v="console",y="mobile",w="tablet",R="smarttv",E="wearable",O="embedded",T=275,S="Amazon",b="Apple",C="ASUS",k="BlackBerry",I="Browser",D="Chrome",N="Edge",M="Firefox",L="Google",$="Huawei",U="LG",x="Microsoft",P="Motorola",B="Opera",H="Samsung",W="Sony",X="Xiaomi",se="Zebra",_e="Facebook",ye=function(G,j){var Q={};for(var we in G)j[we]&&j[we].length%2===0?Q[we]=j[we].concat(G[we]):Q[we]=G[we];return Q},Oe=function(G){for(var j={},Q=0;Q<G.length;Q++)j[G[Q].toUpperCase()]=G[Q];return j},ni=function(G,j){return typeof G===l?Cn(j).indexOf(Cn(G))!==-1:!1},Cn=function(G){return G.toLowerCase()},Ia=function(G){return typeof G===l?G.replace(/[^\d\.]/g,s).split(".")[0]:r},gt=function(G,j){if(typeof G===l)return G=G.replace(/^\s\s*/,s).replace(/\s\s*$/,s),typeof j===a?G:G.substring(0,T)},rt=function(G,j){for(var Q=0,we,ae,fs,Ee,ri,Tt;Q<j.length&&!ri;){var Tl=j[Q],Il=j[Q+1];for(we=ae=0;we<Tl.length&&!ri;)if(ri=Tl[we++].exec(G),ri)for(fs=0;fs<Il.length;fs++)Tt=ri[++ae],Ee=Il[fs],typeof Ee===c&&Ee.length>0?Ee.length===2?typeof Ee[1]==u?this[Ee[0]]=Ee[1].call(this,Tt):this[Ee[0]]=Ee[1]:Ee.length===3?typeof Ee[1]===u&&!(Ee[1].exec&&Ee[1].test)?this[Ee[0]]=Tt?Ee[1].call(this,Tt,Ee[2]):r:this[Ee[0]]=Tt?Tt.replace(Ee[1],Ee[2]):r:Ee.length===4&&(this[Ee[0]]=Tt?Ee[3].call(this,Tt.replace(Ee[1],Ee[2])):r):this[Ee]=Tt||r;Q+=2}},Rn=function(G,j){for(var Q in j)if(typeof j[Q]===c&&j[Q].length>0){for(var we=0;we<j[Q].length;we++)if(ni(j[Q][we],G))return Q===o?r:Q}else if(ni(j[Q],G))return Q===o?r:Q;return G},ds={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},kn={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},er={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[_,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[_,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,_],[/opios[\/ ]+([\w\.]+)/i],[_,[h,B+" Mini"]],[/\bopr\/([\w\.]+)/i],[_,[h,B]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[h,_],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[_,[h,"UC"+I]],[/\bqbcore\/([\w\.]+)/i],[_,[h,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[_,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[_,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[_,[h,"IE"]],[/yabrowser\/([\w\.]+)/i],[_,[h,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+I],_],[/\bfocus\/([\w\.]+)/i],[_,[h,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[_,[h,B+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[_,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[_,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[_,[h,B+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[_,[h,"MIUI "+I]],[/fxios\/([-\w\.]+)/i],[_,[h,M]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+I]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+I],_],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],_],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[h,_],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,_e],_],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[h,_],[/\bgsa\/([\w\.]+) .*safari\//i],[_,[h,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[_,[h,D+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,D+" WebView"],_],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[_,[h,"Android "+I]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,_],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[_,[h,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[_,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[_,Rn,ds]],[/(webkit|khtml)\/([\w\.]+)/i],[h,_],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],_],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[_,[h,M+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[h,_]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,Cn]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,s,Cn]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,Cn]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[m,H],[p,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[m,H],[p,y]],[/((ipod|iphone)\d+,\d+)/i],[f,[m,b],[p,y]],[/(ipad\d+,\d+)/i],[f,[m,b],[p,w]],[/\((ip(?:hone|od)[\w ]*);/i],[f,[m,b],[p,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[m,b],[p,w]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[m,$],[p,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[m,$],[p,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[m,X],[p,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[m,X],[p,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[m,"OPPO"],[p,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[m,"Vivo"],[p,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[m,"Realme"],[p,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[m,P],[p,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[m,P],[p,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[m,U],[p,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[m,U],[p,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[m,"Lenovo"],[p,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[m,"Nokia"],[p,y]],[/(pixel c)\b/i],[f,[m,L],[p,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[m,L],[p,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[m,W],[p,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[m,W],[p,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[m,"OnePlus"],[p,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[m,S],[p,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[m,S],[p,y]],[/(playbook);[-\w\),; ]+(rim)/i],[f,m,[p,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[m,k],[p,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[m,C],[p,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[m,C],[p,y]],[/(nexus 9)/i],[f,[m,"HTC"],[p,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[f,/_/g," "],[p,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[m,"Acer"],[p,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[m,"Meizu"],[p,y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[m,"Sharp"],[p,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[m,f,[p,y]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[m,f,[p,w]],[/(surface duo)/i],[f,[m,x],[p,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[m,"Fairphone"],[p,y]],[/(u304aa)/i],[f,[m,"AT&T"],[p,y]],[/\bsie-(\w*)/i],[f,[m,"Siemens"],[p,y]],[/\b(rct\w+) b/i],[f,[m,"RCA"],[p,w]],[/\b(venue[\d ]{2,7}) b/i],[f,[m,"Dell"],[p,w]],[/\b(q(?:mv|ta)\w+) b/i],[f,[m,"Verizon"],[p,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[m,"Barnes & Noble"],[p,w]],[/\b(tm\d{3}\w+) b/i],[f,[m,"NuVision"],[p,w]],[/\b(k88) b/i],[f,[m,"ZTE"],[p,w]],[/\b(nx\d{3}j) b/i],[f,[m,"ZTE"],[p,y]],[/\b(gen\d{3}) b.+49h/i],[f,[m,"Swiss"],[p,y]],[/\b(zur\d{3}) b/i],[f,[m,"Swiss"],[p,w]],[/\b((zeki)?tb.*\b) b/i],[f,[m,"Zeki"],[p,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],f,[p,w]],[/\b(ns-?\w{0,9}) b/i],[f,[m,"Insignia"],[p,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[m,"NextBook"],[p,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],f,[p,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],f,[p,y]],[/\b(ph-1) /i],[f,[m,"Essential"],[p,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[m,"Envizen"],[p,w]],[/\b(trio[-\w\. ]+) b/i],[f,[m,"MachSpeed"],[p,w]],[/\btu_(1491) b/i],[f,[m,"Rotor"],[p,w]],[/(shield[\w ]+) b/i],[f,[m,"Nvidia"],[p,w]],[/(sprint) (\w+)/i],[m,f,[p,y]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[m,x],[p,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[m,se],[p,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[m,se],[p,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,f,[p,v]],[/droid.+; (shield) bui/i],[f,[m,"Nvidia"],[p,v]],[/(playstation [345portablevi]+)/i],[f,[m,W],[p,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[m,x],[p,v]],[/smart-tv.+(samsung)/i],[m,[p,R]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[m,H],[p,R]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,U],[p,R]],[/(apple) ?tv/i],[m,[f,b+" TV"],[p,R]],[/crkey/i],[[f,D+"cast"],[m,L],[p,R]],[/droid.+aft(\w)( bui|\))/i],[f,[m,S],[p,R]],[/\(dtv[\);].+(aquos)/i],[f,[m,"Sharp"],[p,R]],[/(bravia[\w- ]+) bui/i],[f,[m,W],[p,R]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[m,gt],[f,gt],[p,R]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,R]],[/((pebble))app/i],[m,f,[p,E]],[/droid.+; (glass) \d/i],[f,[m,L],[p,E]],[/droid.+; (wt63?0{2,3})\)/i],[f,[m,se],[p,E]],[/(quest( 2)?)/i],[f,[m,_e],[p,E]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[p,O]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[p,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[p,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,w]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[p,y]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[_,[h,N+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[_,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[h,_],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[_,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,_],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[h,[_,Rn,kn]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,"Windows"],[_,Rn,kn]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[_,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,"Mac OS"],[_,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[_,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,_],[/\(bb(10);/i],[_,[h,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[_,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[_,[h,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[_,[h,"webOS"]],[/crkey\/([\d\.]+)/i],[_,[h,D+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[h,"Chromium OS"],_],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,_],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],_],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[h,_]]},J=function(G,j){if(typeof G===c&&(j=G,G=r),!(this instanceof J))return new J(G,j).getResult();var Q=G||(typeof n!==a&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:s),we=j?ye(er,j):er;return this.getBrowser=function(){var ae={};return ae[h]=r,ae[_]=r,rt.call(ae,Q,we.browser),ae.major=Ia(ae.version),ae},this.getCPU=function(){var ae={};return ae[g]=r,rt.call(ae,Q,we.cpu),ae},this.getDevice=function(){var ae={};return ae[m]=r,ae[f]=r,ae[p]=r,rt.call(ae,Q,we.device),ae},this.getEngine=function(){var ae={};return ae[h]=r,ae[_]=r,rt.call(ae,Q,we.engine),ae},this.getOS=function(){var ae={};return ae[h]=r,ae[_]=r,rt.call(ae,Q,we.os),ae},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Q},this.setUA=function(ae){return Q=typeof ae===l&&ae.length>T?gt(ae,T):ae,this},this.setUA(Q),this};J.VERSION=i,J.BROWSER=Oe([h,_,d]),J.CPU=Oe([g]),J.DEVICE=Oe([f,m,p,v,y,R,w,E,O]),J.ENGINE=J.OS=Oe([h,_]),t.exports&&(e=t.exports=J),e.UAParser=J;var He=typeof n!==a&&(n.jQuery||n.Zepto);if(He&&!He.ua){var re=new J;He.ua=re.getResult(),He.ua.get=function(){return re.getUA()},He.ua.set=function(G){re.setUA(G);var j=re.getResult();for(var Q in j)He.ua[Q]=j[Q]}}})(typeof window=="object"?window:oM)}(mi,mi.exports)),mi.exports}var sy=aM();const uM=Ju(sy);var cM=function(){function t(){this.ua=new sy.UAParser(typeof navigator<"u"?navigator.userAgent:null).getResult()}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:fM(),platform:"Web",os:lM(this.ua),deviceModel:dM(this.ua)}},t}(),lM=function(t){var e,n;return[(e=t.browser)===null||e===void 0?void 0:e.name,(n=t.browser)===null||n===void 0?void 0:n.major].filter(function(r){return r!=null}).join(" ")},dM=function(t){var e;return(e=t.os)===null||e===void 0?void 0:e.name},fM=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},hM=function(){function t(){this.queue=[]}return t.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},t.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(n){e(n)}),this.queue=[])},t}();/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var fn=function(){return fn=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},fn.apply(this,arguments)},lo=function(t,e){var n=["string","number","boolean","undefined"],r=typeof t,i=typeof e;if(r!==i)return!1;for(var s=0,o=n;s<o.length;s++){var u=o[s];if(u===r)return t===e}if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;var a=Array.isArray(t),c=Array.isArray(e);if(a!==c)return!1;if(a&&c){for(var l=0;l<t.length;l++)if(!lo(t[l],e[l]))return!1}else{var d=Object.keys(t).sort(),f=Object.keys(e).sort();if(!lo(d,f))return!1;var h=!0;return Object.keys(t).forEach(function(p){lo(t[p],e[p])||(h=!1)}),h}return!0},pM="$set",gM="$unset",mM="$clearAll";Object.entries||(Object.entries=function(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 _M=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var e=this,n=fn({},this.identity.userProperties),r=fn(fn({},this.identity),{userProperties:n});return{setUserId:function(i){return r.userId=i,this},setDeviceId:function(i){return r.deviceId=i,this},setUserProperties:function(i){return r.userProperties=i,this},updateUserProperties:function(i){for(var s=r.userProperties||{},o=0,u=Object.entries(i);o<u.length;o++){var a=u[o],c=a[0],l=a[1];switch(c){case pM:for(var d=0,f=Object.entries(l);d<f.length;d++){var h=f[d],p=h[0],m=h[1];s[p]=m}break;case gM:for(var _=0,g=Object.keys(l);_<g.length;_++){var p=g[_];delete s[p]}break;case mM:s={};break}}return r.userProperties=s,this},commit:function(){return e.setIdentity(r),this}}},t.prototype.getIdentity=function(){return fn({},this.identity)},t.prototype.setIdentity=function(e){var n=fn({},this.identity);this.identity=fn({},e),lo(n,this.identity)||this.listeners.forEach(function(r){r(e)})},t.prototype.addIdentityListener=function(e){this.listeners.add(e)},t.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},t}(),fi=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,vM=function(){function t(){this.identityStore=new _M,this.eventBridge=new hM,this.applicationContextProvider=new cM}return t.getInstance=function(e){return fi.analyticsConnectorInstances||(fi.analyticsConnectorInstances={}),fi.analyticsConnectorInstances[e]||(fi.analyticsConnectorInstances[e]=new t),fi.analyticsConnectorInstances[e]},t}(),oy=function(){return vM.getInstance("$default_instance")},yM=function(){function t(){this.name="identity",this.type=Jt.BEFORE,this.identityStore=oy().identityStore}return t.prototype.execute=function(e){return ft(this,void 0,void 0,function(){var n;return ht(this,function(r){return n=e.user_properties,n&&this.identityStore.editIdentity().updateUserProperties(n).commit(),[2,e]})})},t.prototype.setup=function(e){return Promise.resolve(void 0)},t}(),SM=function(){var t,e,n,r;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(r=(n=(e=(t=navigator.languages)===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:navigator.language)!==null&&n!==void 0?n:i)!==null&&r!==void 0?r:""},eu=function(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.name,s=r.args,o=r.resolve,u=t&&t[i];if(typeof u=="function"){var a=u.apply(t,s);typeof o=="function"&&o(a?.promise)}}return t},tu=function(t){var e=t;return e&&e._q!==void 0},bM="1.8.0",EM="Web",TM="$remote",IM=function(){function t(){this.name="context",this.type=Jt.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat(bM);var e;typeof navigator<"u"&&(e=navigator.userAgent),this.uaResult=new uM(e).getResult()}return t.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},t.prototype.execute=function(e){return Ke(this,void 0,void 0,function(){var n,r,i,s,o,u;return Ye(this,function(a){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),n=new Date().getTime(),r=this.uaResult.browser.name,i=this.uaResult.browser.version,s=this.uaResult.device.model||this.uaResult.os.name,o=this.uaResult.device.vendor,u=me(me(me(me(me(me(me(me(me(me(me(me({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:EM}),this.config.trackingOptions.osName&&{os_name:r}),this.config.trackingOptions.osVersion&&{os_version:i}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:o}),this.config.trackingOptions.deviceModel&&{device_model:s}),this.config.trackingOptions.language&&{language:SM()}),this.config.trackingOptions.ipAddress&&{ip:TM}),{insert_id:Ea(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:this.eventId++,library:this.library}),[2,u]})})},t.prototype.isSessionValid=function(){var e=this.config.lastEventTime||Date.now(),n=Date.now()-e;return n<this.config.sessionTimeout},t}(),El=function(){function t(){}return t.prototype.isEnabled=function(){return Ke(this,void 0,void 0,function(){var e,n,r,i;return Ye(this,function(s){switch(s.label){case 0:if(!Lt())return[2,!1];e=String(Date.now()),n=new t,r="AMP_TEST",s.label=1;case 1:return s.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return s.sent(),[4,n.get(r)];case 3:return i=s.sent(),[2,i===e];case 4:return s.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return s.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return Ke(this,void 0,void 0,function(){var n;return Ye(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return n=r.sent(),n?[2,JSON.parse(n)]:[2,void 0];case 2:return r.sent(),[2,void 0];case 3:return[2]}})})},t.prototype.getRaw=function(e){var n;return Ke(this,void 0,void 0,function(){return Ye(this,function(r){return[2,((n=Lt())===null||n===void 0?void 0:n.localStorage.getItem(e))||void 0]})})},t.prototype.set=function(e,n){var r;return Ke(this,void 0,void 0,function(){return Ye(this,function(i){try{(r=Lt())===null||r===void 0||r.localStorage.setItem(e,JSON.stringify(n))}catch{}return[2]})})},t.prototype.remove=function(e){var n;return Ke(this,void 0,void 0,function(){return Ye(this,function(r){try{(n=Lt())===null||n===void 0||n.localStorage.removeItem(e)}catch{}return[2]})})},t.prototype.reset=function(){var e;return Ke(this,void 0,void 0,function(){return Ye(this,function(n){try{(e=Lt())===null||e===void 0||e.localStorage.clear()}catch{}return[2]})})},t}(),wM=function(t){Ta(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={done:4},n}return e.prototype.send=function(n,r){return Ke(this,void 0,void 0,function(){var i=this;return Ye(this,function(s){return[2,new Promise(function(o,u){typeof XMLHttpRequest>"u"&&u(new Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",n,!0),a.onreadystatechange=function(){if(a.readyState===i.state.done)try{var c=a.responseText,l=JSON.parse(c),d=i.buildResponse(l);o(d)}catch(f){u(f)}},a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Accept","*/*"),a.send(JSON.stringify(r))})]})})},e}(Sl),CM=function(t){Ta(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(n,r){return Ke(this,void 0,void 0,function(){var i=this;return Ye(this,function(s){return[2,new Promise(function(o,u){var a=Lt();if(!a?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var c=JSON.stringify(r),l=a.navigator.sendBeacon(n,JSON.stringify(r));return o(l?i.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:c.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(d){u(d)}})]})})},e}(Sl),cs=function(){var t=new ry,e={deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0};return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,cookieUpgrade:!0,disableCookies:!1,domain:"",sessionTimeout:30*60*1e3,trackingOptions:e,transportProvider:new sM}},Qh=function(t){Ta(e,t);function e(n,r){var i=this,s,o,u,a,c,l,d,f,h,p=cs();return i=t.call(this,me(me({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30,transportProvider:p.transportProvider},r),{apiKey:n}))||this,i._optOut=!1,i.cookieStorage=(s=r?.cookieStorage)!==null&&s!==void 0?s:p.cookieStorage,i.deviceId=r?.deviceId,i.lastEventTime=r?.lastEventTime,i.optOut=!!r?.optOut,i.sessionId=r?.sessionId,i.userId=r?.userId,i.appVersion=r?.appVersion,i.attribution=r?.attribution,i.cookieExpiration=(o=r?.cookieExpiration)!==null&&o!==void 0?o:p.cookieExpiration,i.cookieSameSite=(u=r?.cookieSameSite)!==null&&u!==void 0?u:p.cookieSameSite,i.cookieSecure=(a=r?.cookieSecure)!==null&&a!==void 0?a:p.cookieSecure,i.cookieUpgrade=(c=r?.cookieUpgrade)!==null&&c!==void 0?c:p.cookieUpgrade,i.disableCookies=(l=r?.disableCookies)!==null&&l!==void 0?l:p.disableCookies,i.domain=(d=r?.domain)!==null&&d!==void 0?d:p.domain,i.partnerId=r?.partnerId,i.sessionTimeout=(f=r?.sessionTimeout)!==null&&f!==void 0?f:p.sessionTimeout,i.trackingOptions=(h=r?.trackingOptions)!==null&&h!==void 0?h:p.trackingOptions,i}return Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._deviceId},set:function(n){this._deviceId!==n&&(this._deviceId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},set:function(n){this._userId!==n&&(this._userId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._sessionId},set:function(n){this._sessionId!==n&&(this._sessionId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(n){this._optOut!==n&&(this._optOut=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(n){this._lastEventTime!==n&&(this._lastEventTime=n,this.updateStorage())},enumerable:!1,configurable:!0}),e.prototype.updateStorage=function(){var n,r={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime};(n=this.cookieStorage)===null||n===void 0||n.set(bl(this.apiKey),r)},e}(FD),RM=function(t,e){return Ke(void 0,void 0,void 0,function(){var n,r,i,s,o,u,a,c,l,d,f,h,p,m,_,g,v,y,w,R,E,O,T,S;return Ye(this,function(b){switch(b.label){case 0:return n=cs(),(g=e?.domain)!==null&&g!==void 0?(i=g,[3,3]):[3,1];case 1:return[4,OM()];case 2:i=b.sent(),b.label=3;case 3:return r=i,[4,kM(me(me({},e),{domain:r}))];case 4:return s=b.sent(),[4,s.get(bl(t))];case 5:return o=b.sent(),u=Xu(),a=(w=(y=(v=e?.deviceId)!==null&&v!==void 0?v:u.deviceId)!==null&&y!==void 0?y:o?.deviceId)!==null&&w!==void 0?w:Ea(),c=(R=e?.lastEventTime)!==null&&R!==void 0?R:o?.lastEventTime,l=(E=e?.optOut)!==null&&E!==void 0?E:!!o?.optOut,d=(O=e?.sessionId)!==null&&O!==void 0?O:o?.sessionId,f=(T=e?.userId)!==null&&T!==void 0?T:o?.userId,h=Qh.bind,p=[void 0,t],m=[me({},e)],_={cookieStorage:s,deviceId:a,domain:r,lastEventTime:c,optOut:l,sessionId:d},[4,xM(e)];case 6:return[2,new(h.apply(Qh,p.concat([me.apply(void 0,m.concat([(_.storageProvider=b.sent(),_.trackingOptions=me(me({},n.trackingOptions),e?.trackingOptions),_.transportProvider=(S=e?.transportProvider)!==null&&S!==void 0?S:uy(e?.transport),_.userId=f,_)]))])))]}})})},kM=function(t,e){return e===void 0&&(e=cs()),Ke(void 0,void 0,void 0,function(){var n,r,i;return Ye(this,function(s){switch(s.label){case 0:return n=me(me({},e),t),r=t?.cookieStorage,i=!r,i?[3,2]:[4,r.isEnabled()];case 1:i=!s.sent(),s.label=2;case 2:return i?[2,ay(n)]:[2,r]}})})},ay=function(t){return Ke(void 0,void 0,void 0,function(){var e,n;return Ye(this,function(r){switch(r.label){case 0:return e=new Ko({domain:t.domain,expirationDays:t.cookieExpiration,sameSite:t.cookieSameSite,secure:t.cookieSecure}),n=t.disableCookies,n?[3,2]:[4,e.isEnabled()];case 1:n=!r.sent(),r.label=2;case 2:return n?(e=new El,[4,e.isEnabled()]):[3,4];case 3:r.sent()||(e=new ry),r.label=4;case 4:return[2,e]}})})},xM=function(t){return Ke(void 0,void 0,void 0,function(){var e,n,r,i,s,o,u,a;return Ye(this,function(c){switch(c.label){case 0:if(e=t&&Object.prototype.hasOwnProperty.call(t,"storageProvider"),!(!e||t.storageProvider))return[3,9];c.label=1;case 1:c.trys.push([1,7,8,9]),n=GD([t?.storageProvider,new El]),r=n.next(),c.label=2;case 2:return r.done?[3,6]:(i=r.value,s=i,s?[4,i.isEnabled()]:[3,4]);case 3:s=c.sent(),c.label=4;case 4:if(s)return[2,i];c.label=5;case 5:return r=n.next(),[3,2];case 6:return[3,9];case 7:return o=c.sent(),u={error:o},[3,9];case 8:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(u)throw u.error}return[7];case 9:return[2,void 0]}})})},uy=function(t){return t===Wo.XHR?new wM:t===Wo.SendBeacon?new CM:cs().transportProvider},OM=function(t){return Ke(void 0,void 0,void 0,function(){var e,n,r,i,s,s,o,u,a,c;return Ye(this,function(l){switch(l.label){case 0:return[4,new Ko().isEnabled()];case 1:if(!l.sent()||typeof location>"u")return[2,""];for(e=location.hostname,n=e.split("."),r=[],i="AMP_TLDTEST",s=n.length-2;s>=0;--s)r.push(n.slice(s).join("."));s=0,l.label=2;case 2:return s<r.length?(o=r[s],u={domain:"."+o},a=new Ko(u),[4,a.set(i,1)]):[3,7];case 3:return l.sent(),[4,a.get(i)];case 4:return c=l.sent(),c?[4,a.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+o];case 6:return s++,[3,2];case 7:return[2,""]}})})},AM=function(t,e){return Ke(void 0,void 0,void 0,function(){var n,r,i,s,o,u,a,c,l,d;return Ye(this,function(f){switch(f.label){case 0:return n=new Ko,[4,n.isEnabled()];case 1:return(!f.sent()||e?.disableCookies)&&(n=new El),[4,n.isEnabled()];case 2:return f.sent()?(r=rM(t),[4,n.getRaw(r)]):[2,{optOut:!1}];case 3:return i=f.sent(),i?((d=e?.cookieUpgrade)!==null&&d!==void 0?d:cs().cookieUpgrade)?[4,n.remove(r)]:[3,5]:[2,{optOut:!1}];case 4:f.sent(),f.label=5;case 5:return s=zD(i.split("."),5),o=s[0],u=s[1],a=s[2],c=s[3],l=s[4],[2,{deviceId:o,userId:DM(u),sessionId:Zh(c),lastEventTime:Zh(l),optOut:!!a}]}})})},Zh=function(t){var e=parseInt(t,32);if(!isNaN(e))return e},DM=function(t){if(!(!atob||!escape||!t))try{return decodeURIComponent(escape(atob(t)))}catch{return}},MM=function(t){Ta(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(n,r,i){var s,o,u;return n===void 0&&(n=""),Ke(this,void 0,void 0,function(){var a,c,l,d,f=this;return Ye(this,function(h){switch(h.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,AM(n,i)]);case 1:return a=h.sent(),[4,RM(n,me(me({},i),{deviceId:(s=a.deviceId)!==null&&s!==void 0?s:i?.deviceId,sessionId:(o=a.sessionId)!==null&&o!==void 0?o:i?.sessionId,optOut:(u=i?.optOut)!==null&&u!==void 0?u:a.optOut,lastEventTime:a.lastEventTime,userId:r??a.userId}))];case 2:return c=h.sent(),[4,t.prototype._init.call(this,c)];case 3:return h.sent(),l=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),l=!0),d=oy(),d.eventBridge.setEventReceiver(function(p){f.track(p.eventType,p.eventProperties)}),d.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new IM)];case 4:return h.sent(),[4,this.add(new yM)];case 5:return h.sent(),[4,this.add(new HD)];case 6:return h.sent(),this.initializing=!1,[4,this.runAttributionStrategy(c.attribution,l)];case 7:return h.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return h.sent(),[2]}})})},e.prototype.runAttributionStrategy=function(n,r){return r===void 0&&(r=!1),Ke(this,void 0,void 0,function(){var i,s,o,u;return Ye(this,function(a){switch(a.label){case 0:return i=this.track.bind(this),s=this.setSessionId.bind(this,Date.now()),[4,ay(this.config)];case 1:return o=a.sent(),u=new iM(this.config.apiKey,me(me({},n),{storage:o,track:i,onNewCampaign:s})),[4,u.send(r)];case 2:return a.sent(),[2]}})})},e.prototype.getUserId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.userId},e.prototype.setUserId=function(n){if(!this.config){this.q.push(this.setUserId.bind(this,n));return}this.config.userId=n},e.prototype.getDeviceId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.deviceId},e.prototype.setDeviceId=function(n){if(!this.config){this.q.push(this.setDeviceId.bind(this,n));return}this.config.deviceId=n},e.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(Ea())},e.prototype.getSessionId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.sessionId},e.prototype.setSessionId=function(n){if(!this.config){this.q.push(this.setSessionId.bind(this,n));return}this.config.sessionId=n,this.config.lastEventTime=void 0},e.prototype.setTransport=function(n){if(!this.config){this.q.push(this.setTransport.bind(this,n));return}this.config.transportProvider=uy(n)},e.prototype.identify=function(n,r){if(tu(n)){var i=n._q;n._q=[],n=eu(new Vo,i)}return r?.user_id&&this.setUserId(r.user_id),r?.device_id&&this.setDeviceId(r.device_id),t.prototype.identify.call(this,n,r)},e.prototype.groupIdentify=function(n,r,i,s){if(tu(i)){var o=i._q;i._q=[],i=eu(new Vo,o)}return t.prototype.groupIdentify.call(this,n,r,i,s)},e.prototype.revenue=function(n,r){if(tu(n)){var i=n._q;n._q=[],n=eu(new PD,i)}return t.prototype.revenue.call(this,n,r)},e}(ND),LM=function(){var t=new MM;return{init:Le(xt(t.init.bind(t)),"init",De(t),Me(t,["config"])),add:Le(xt(t.add.bind(t)),"add",De(t),Me(t,["config.apiKey","timeline.plugins"])),remove:Le(xt(t.remove.bind(t)),"remove",De(t),Me(t,["config.apiKey","timeline.plugins"])),track:Le(xt(t.track.bind(t)),"track",De(t),Me(t,["config.apiKey","timeline.queue.length"])),logEvent:Le(xt(t.logEvent.bind(t)),"logEvent",De(t),Me(t,["config.apiKey","timeline.queue.length"])),identify:Le(xt(t.identify.bind(t)),"identify",De(t),Me(t,["config.apiKey","timeline.queue.length"])),groupIdentify:Le(xt(t.groupIdentify.bind(t)),"groupIdentify",De(t),Me(t,["config.apiKey","timeline.queue.length"])),setGroup:Le(xt(t.setGroup.bind(t)),"setGroup",De(t),Me(t,["config.apiKey","timeline.queue.length"])),revenue:Le(xt(t.revenue.bind(t)),"revenue",De(t),Me(t,["config.apiKey","timeline.queue.length"])),flush:Le(xt(t.flush.bind(t)),"flush",De(t),Me(t,["config.apiKey","timeline.queue.length"])),getUserId:Le(t.getUserId.bind(t),"getUserId",De(t),Me(t,["config","config.userId"])),setUserId:Le(t.setUserId.bind(t),"setUserId",De(t),Me(t,["config","config.userId"])),getDeviceId:Le(t.getDeviceId.bind(t),"getDeviceId",De(t),Me(t,["config","config.deviceId"])),setDeviceId:Le(t.setDeviceId.bind(t),"setDeviceId",De(t),Me(t,["config","config.deviceId"])),reset:Le(t.reset.bind(t),"reset",De(t),Me(t,["config","config.userId","config.deviceId"])),getSessionId:Le(t.getSessionId.bind(t),"getSessionId",De(t),Me(t,["config"])),setSessionId:Le(t.setSessionId.bind(t),"setSessionId",De(t),Me(t,["config"])),setOptOut:Le(t.setOptOut.bind(t),"setOptOut",De(t),Me(t,["config"])),setTransport:Le(t.setTransport.bind(t),"setTransport",De(t),Me(t,["config"]))}};const ls=LM();var QM=ls.identify,ZM=ls.init,eL=ls.reset,tL=ls.setUserId,nL=ls.track;export{JM as G,Vo as I,PM as R,XM as S,ki as a,En as b,dy as c,ep as d,GM as e,qM as f,Ju as g,YM as h,ZM as i,QM as j,eL as k,hy as l,Hi as m,Hk as n,KS as o,_o as p,ge as q,Uk as r,tL as s,nL as t,th as u,zM as v,Tn as w,KM as x,FC as y,WM as z};