1var jg=Object.defineProperty,zg=Object.defineProperties;var qg=Object.getOwnPropertyDescriptors;var qo=Object.getOwnPropertySymbols;var Lu=Object.prototype.hasOwnProperty,Pu=Object.prototype.propertyIsEnumerable;var Ki=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var Ou=(e,t,n)=>t in e?jg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))Lu.call(t,n)&&Ou(e,n,t[n]);if(qo)for(var n of qo(t))Pu.call(t,n)&&Ou(e,n,t[n]);return e},v=(e,t)=>zg(e,qg(t));var vn=(e,t)=>{var n={};for(var r in e)Lu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qo)for(var r of qo(e))t.indexOf(r)<0&&Pu.call(e,r)&&(n[r]=e[r]);return n};var U=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{a(n.next(c))}catch(u){o(u)}},i=c=>{try{a(n.throw(c))}catch(u){o(u)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,i);a((n=n.apply(e,t)).next())}),Yt=function(e,t){this[0]=e,this[1]=t},Go=(e,t,n)=>{var r=(a,c,u,d)=>{try{var l=n[a](c),f=(c=l.value)instanceof Yt,p=l.done;Promise.resolve(f?c[0]:c).then(h=>f?r(a==="return"?a:"next",c[1]?{done:h.done,value:h.value}:h,u,d):u({value:h,done:p})).catch(h=>r("throw",h,u,d))}catch(h){d(h)}},o=(a,c,u,d)=>i[a]=l=>(c=new Promise((f,p,h)=>(h=()=>r(a,l,f,p),s?s.then(h):h())),d=()=>s===u&&(s=0),s=u=c.then(d,d),c),s,i={};return n=n.apply(e,t),i[Ki("asyncIterator")]=()=>i,o("next"),o("throw"),o("return"),i};var Vo=(e,t,n)=>(t=e[Ki("asyncIterator")])?t.call(e):(e=e[Ki("iterator")](),t={},n=(r,o)=>(o=e[r])&&(t[r]=s=>new Promise((i,a,c)=>(s=o.call(e,s),c=s.done,Promise.resolve(s.value).then(u=>i({value:u,done:c}),a)))),n("next"),n("return"),t);(function(){try{var e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};e.SENTRY_RELEASE={id:"8c3b9aa2b95acaad15d7da0cf7f36f5b8cfcd6d1"},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=(function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t})({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:playsmart-ai":!0})}catch(t){}})();const A=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,H=globalThis,nn="10.74.0";function Rt(){return xr(H),H}function xr(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||nn,t[nn]=t[nn]||{}}function Or(e,t,n=H){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[nn]=r[nn]||{};return o[e]||(o[e]=t())}const Sc=["debug","info","warn","error","log","assert","trace"],Gg="Sentry Logger ",Ms={};function qt(e){if(!("console"in H))return e();const t=H.console,n={},r=Object.keys(Ms);r.forEach(o=>{const s=Ms[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Vg(){Ec().enabled=!0}function Yg(){Ec().enabled=!1}function Mf(){return Ec().enabled}function Jg(...e){bc("log",...e)}function Kg(...e){bc("warn",...e)}function Xg(...e){bc("error",...e)}function bc(e,...t){A&&Mf()&&qt(()=>{H.console[e](`${Gg}[${e}]:`,...t)})}function Ec(){return A?Or("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const S={enable:Vg,disable:Yg,isEnabled:Mf,log:Jg,warn:Kg,error:Xg},Nf=50,vt="?",Du=/\(error: (.*)\)/,Fu=/captureMessage|captureException/;function xf(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],i=n.split(` 2`);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));const u=Du.test(c)?c.replace(Du,"$1"):c;if(!u.includes("Error: ")){for(const d of t){const l=d(u);if(l){s.push(l);break}}if(s.length>=Nf+o)break}}return Zg(s.slice(o))}}function Qg(e){return Array.isArray(e)?xf(...e):e}function Zg(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Yo(t).function||"")&&t.pop(),t.reverse(),Fu.test(Yo(t).function||"")&&(t.pop(),Fu.test(Yo(t).function||"")&&t.pop()),t.slice(0,Nf).map(n=>v(m({},n),{filename:n.filename||Yo(t).filename,function:n.function||vt}))}function Yo(e){return e[e.length-1]||{}}const Xi="<anonymous>";function Ut(e){try{return!e||typeof e!="function"?Xi:e.name||Xi}catch(t){return Xi}}function Na(e){const t=e.exception;if(t){const n=[];
2try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch(r){return}}}function e_(e){let t=e!=null&&e.startsWith("file://")?e.slice(7):e;return t!=null&&t.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}const Gr={},$u={};function hn(e,t){return Gr[e]=Gr[e]||[],Gr[e].push(t),()=>{const n=Gr[e];if(n){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function mn(e,t){if(!$u[e]){$u[e]=!0;try{t()}catch(n){A&&S.error(`Error while instrumenting ${e}`,n)}}}function tt(e,t){const n=e&&Gr[e];if(n)for(const r of n)try{r(t)}catch(o){A&&S.error(`Error while triggering instrumentation handler. 3Type: ${e} 4Name: ${Ut(r)} 5Error:`,o)}}let Qi=null;function Of(e){const t="error";hn(t,e),mn(t,t_)}function t_(){Qi=H.onerror,H.onerror=function(e,t,n,r,o){return tt("error",{column:r,error:o,line:n,msg:e,url:t}),Qi?Qi.apply(this,arguments):!1},H.onerror.__SENTRY_INSTRUMENTED__=!0}let Zi=null;function Lf(e){const t="unhandledrejection";hn(t,e),mn(t,n_)}function n_(){Zi=H.onunhandledrejection,H.onunhandledrejection=function(e){return tt("unhandledrejection",e),Zi?Zi.apply(this,arguments):!0},H.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Pf=Object.prototype.toString;function We(e){switch(Pf.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return li(e,Error)}}function Lr(e,t){return Pf.call(e)===`[object ${t}]`}function Df(e){return Lr(e,"ErrorEvent")}function Bu(e){return Lr(e,"DOMError")}function r_(e){return Lr(e,"DOMException")}function ft(e){return Lr(e,"String")}function ci(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Tt(e){return e===null||ci(e)||typeof e!="object"&&typeof e!="function"}function He(e){return Lr(e,"Object")}function nt(e){return typeof e=="object"&&e!==null}function ui(e){return typeof Event!="undefined"&&li(e,Event)}function o_(e){return Lr(e,"RegExp")}function Wn(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function li(e,t){try{return e instanceof t}catch(n){return!1}}function vc(e){return typeof Request!="undefined"&&li(e,Request)}function Oe(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const o=n(r);typeof o=="function"&&Ff(o,r);try{e[t]=o}catch(s){A&&S.log(`Failed to replace method "${t}" in object`,e)}}function xe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){A&&S.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Ff(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,xe(e,"__sentry_original__",t)}catch(n){}}function Tc(e){return e.__sentry_original__}function $f(e){if(We(e))return m({message:e.message,name:e.name,stack:e.stack},Uu(e));if(ui(e)){const{type:t,target:n,currentTarget:r,detail:o}=e;return m(m({type:t,target:n,currentTarget:r},o?{detail:o}:{}),Uu(e))}return e}function Uu(e){return nt(e)?Object.fromEntries(Object.entries(e)):{}}function s_(e){const t=Object.keys($f(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Xn;function So(e){if(Xn!==void 0)return Xn?Xn(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=H;return t in n&&typeof n[t]=="function"?(Xn=n[t],Xn(e)):(Xn=null,e())}function $t(){return So(()=>Math.random())}function Ct(){return So(()=>Date.now())}const Bf=Symbol.for("sentry.skipNormalization"),i_=Symbol.for("sentry.overrideNormalizationDepth");function a_(e){xe(e,Bf,!0)}function c_(e){return!!e[Bf]}function u_(e){const t=e[i_];return typeof t=="number"?t:void 0}let xa;function l_(e){xa=e}function Ce(e,t=100,n=1/0){try{return Oa("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Uf(e,t=3,n=100*1024){const r=Ce(e,t);return p_(r)>n?Uf(e,t-1,n):r}function Oa(e,t,n=1/0,r=1/0,o=h_()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=Hf(e,t);if(!a.startsWith("[object "))return a;if(c_(t))return t;const c=u_(t),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const d=t;if(d&&typeof d.toJSON=="function")try{const h=d.toJSON();return Oa("",h,u-1,r,o)}catch(h){}const l=Array.isArray(t)?[]:{};let f=0;const p=$f(t);for(const h in p){if(!Object.prototype.hasOwnProperty.call(p,h))continue;if(f>=r){l[h]="[MaxProperties ~]";break}const g=p[h];l[h]=Oa(h,g,u-1,r,o),f++}return i(t),l}function Hf(e,t){try{if(xa){const r=xa(t);if(r)return r}return typeof global!="undefined"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Ut(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${d_(t)}]`}catch(n){return`**non-serializable** (${n})`}}function d_(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function f_(e){return~-encodeURI(e).split(/%..|./).length}function p_(e){return f_(JSON.stringify(e))}function h_(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Ye(e,t="[unserializable]"){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch(n){return typeof t=="function"?t(e):t}}function oo(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ea(e,t){let n=e;const r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function Ns(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const o=e[r];Tt(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(Hf(void 0,o))}return n.join(t)}function Kr(e,t,n=!1){return ft(e)?o_(t)?t.test(e):ft(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function rt(e,t=[],n=!1){for(const r of t)if(Kr(e,r,n))return!0;return!1}function m_(){const e=H;return e.crypto||e.msCrypto}let ta;function g_(){return $t()*16}function Ae(e=m_()){try{if(e!=null&&e.randomUUID)return So(()=>e.randomUUID()).replace(/-/g,"")}catch(t){}return ta||(ta="10000000100040008000"+1e11),ta.replace(/[018]/g,t=>(t^(g_()&15)>>t/4).toString(16))}function Wf(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function wn(e){const{message:t,event_id:n}=e;if(t)return t;const r=Wf(e);return r?r.type&&r.value?`${r.type}: ${r.value}
5`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function La(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function bt(e,t){const n=Wf(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism=m(m(m({},r),o),t),t&&"data"in t){const s=m(m({},o==null?void 0:o.data),t.data);n.mechanism.data=s}}function __(e,t,n=5){if(t.lineno===void 0)return;const r=e.length,o=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,o-n),o).map(i=>ea(i,0));const s=Math.min(r-1,o);t.context_line=ea(e[s],t.colno||0),t.post_context=e.slice(Math.min(o+1,r),o+1+n).map(i=>ea(i,0))}function Hu(e){if(y_(e))return!0;try{xe(e,"__sentry_captured__",!0)}catch(t){}return!1}function y_(e){try{return e.__sentry_captured__}catch(t){}}const jf=1e3;function jn(){return Ct()/jf}function S_(){const{performance:e}=H;if(!(e!=null&&e.now)||!e.timeOrigin)return jn;const t=e.timeOrigin;return()=>(t+So(()=>e.now()))/jf}let Jo;function be(){return(Jo!=null?Jo:Jo=S_())()}let na=null;function b_(){var i;const{performance:e}=H;if(!(e!=null&&e.now))return;const t=3e5,n=So(()=>e.now()),r=Ct(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;const s=(i=e.timing)==null?void 0:i.navigationStart;return typeof s=="number"&&Math.abs(s+n-r)<t?s:r-n}function ke(){return na===null&&(na=b_()),na}function E_(e){const t=be(),n={sid:Ae(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>T_(n)};return e&&gr(n,e),n}function gr(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||be(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Ae()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function v_(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),gr(e,n)}function T_(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function bo(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r=m({},e);for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=bo(r[o],t[o],n-1));return r}function Ht(){return Ae()}function an(){return Ae().substring(16)}function zf(e){try{const t=H.WeakRef;if(typeof t=="function")return new t(e)}catch(t){}return e}function qf(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch(t){return}return e}}const Pa="_sentrySpan";function It(e,t){t?xe(e,Pa,zf(t)):delete e[Pa]}function _r(e){return qf(e[Pa])}const I_=100;class wt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ht(),sampleRand:$t()}}clone(){const t=new wt;return t._breadcrumbs=[...this._breadcrumbs],t._tags=m({},this._tags),t._attributes=m({},this._attributes),t._extra=m({},this._extra),t._contexts=m({},this._contexts),this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata=m({},this._sdkProcessingMetadata),t._propagationContext=m({},this._propagationContext),t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,It(t,_r(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&gr(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags=m(m({},this._tags),t),this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes=m(m({},this._attributes),t),this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra=m(m({},this._extra),t),this._notifyScopeListeners(),this}setExtra(t,n){return this._extra=v(m({},this._extra),{[t]:n}),this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof wt?n.getScopeData():He(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:u,fingerprint:d=[],propagationContext:l,conversationId:f}=r||{};return this._tags=m(m({},this._tags),o),this._attributes=m(m({},this._attributes),s),this._extra=m(m({},this._extra),i),this._contexts=m(m({},this._contexts),c),a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),d.length&&(this._fingerprint=d),l&&(this._propagationContext=l),f&&(this._conversationId=f),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,It(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ht(),sampleRand:$t()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var s;const r=typeof n=="number"?n:I_;if(r<=0)return this;const o=v(m({timestamp:jn()},t),{message:t.message?oo(t.message,2048):t.message});return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(s=this._client)==null||s.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_r(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=bo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||Ae();if(!this._client)return A&&S.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,v(m({originalException:t,syntheticException:o},n),{event_id:r}),this),r}captureMessage(t,n,r){var i;const o=(r==null?void 0:r.event_id)||Ae();if(!this._client)return A&&S.warn("No client configured on scope - will not capture message!"),o;const s=(i=r==null?void 0:r.syntheticException)!=null?i:new Error(t);return this._client.captureMessage(t,n,v(m({originalException:t,syntheticException:s},r),{event_id:o}),this),o}
5captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||Ae();return this._client?(this._client.captureEvent(t,v(m({},n),{event_id:r}),this),r):(A&&S.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function w_(){return Or("defaultCurrentScope",()=>new wt)}function k_(){return Or("defaultIsolationScope",()=>new wt)}const Wu=e=>e instanceof Promise&&!e[Gf],Gf=Symbol("chained PromiseLike"),Vf=(e,t,n)=>{const r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Wu(r)&&Wu(e)?r:R_(e,r)},R_=(e,t)=>{if(!t)return e;let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Gf]:!0}),t};class C_{constructor(t,n){let r;t?r=t:r=new wt;let o;n?o=n:o=new wt,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return Wn(r)?Vf(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function yr(){const e=Rt(),t=xr(e);return t.stack=t.stack||new C_(w_(),k_())}function A_(e){return yr().withScope(e)}function M_(e,t){const n=yr();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function ju(e){return yr().withScope(()=>e(yr().getIsolationScope()))}function N_(){return{withIsolationScope:ju,withScope:A_,withSetScope:M_,withSetIsolationScope:(e,t)=>ju(t),getCurrentScope:()=>yr().getScope(),getIsolationScope:()=>yr().getIsolationScope()}}function gn(e){const t=xr(e);return t.acs?t.acs:N_()}function x_(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function O_(e,t){var a;const{value:n,unit:r}=x_(e)?e:{value:e,unit:void 0},o=L_(n),s=r&&typeof r=="string"?{unit:r}:{};if(o)return m(m({},o),s);if(!t||t==="skip-undefined"&&n===void 0)return;let i="";try{i=(a=JSON.stringify(n))!=null?a:""}catch(c){}return m({value:i,type:"string"},s)}function Sr(e,t=!1){const n={};for(const[r,o]of Object.entries(e!=null?e:{})){const s=O_(o,t);s&&(n[r]=s)}return n}function zu(e){var n,r;if(!e)return 0;let t=0;for(const[o,s]of Object.entries(e)){t+=o.length*2,t+=s.type.length*2,t+=((r=(n=s.unit)==null?void 0:n.length)!=null?r:0)*2;const i=s.value;Array.isArray(i)?t+=qu(i[0])*i.length:Tt(i)?t+=qu(i):t+=100}return t}function qu(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function L_(e){if(Array.isArray(e))return{value:e,type:"array"};const t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}function Y(){const e=Rt();return gn(e).getCurrentScope()}function Se(){const e=Rt();return gn(e).getIsolationScope()}function Xr(){return Or("globalScope",()=>new wt)}function ot(...e){const t=Rt(),n=gn(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function zx(...e){const t=Rt(),n=gn(t);if(e.length===2){const[r,o]=e;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(e[0])}function x(){return Y().getClient()}function Yf(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||an()};return r&&(s.parent_span_id=r),s}const Ve="sentry.source",Ic="sentry.sample_rate",Jf="sentry.previous_trace_sample_rate",ve="sentry.op",ue="sentry.origin",P_="sentry.status.message",so="sentry.idle_span_finish_reason",Eo="sentry.measurement_unit",vo="sentry.measurement_value",D_="sentry.release",F_="sentry.environment",$_="sentry.sdk.integrations",B_="user.id",U_="user.email",H_="user.ip_address",W_="user.n
5ame",Da="sentry.custom_span_name",wc="sentry.profile_id",_n="sentry.exclusive_time",j_="http.request.method",z_="sentry.link.type",q_="gen_ai.conversation.id",Kf=0,To=1,ie=2;function G_(e){if(e<400&&e>=100)return{code:To};if(e>=400&&e<500)switch(e){case 401:return{code:ie,message:"unauthenticated"};case 403:return{code:ie,message:"permission_denied"};case 404:return{code:ie,message:"not_found"};case 409:return{code:ie,message:"already_exists"};case 413:return{code:ie,message:"failed_precondition"};case 429:return{code:ie,message:"resource_exhausted"};case 499:return{code:ie,message:"cancelled"};default:return{code:ie,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:ie,message:"unimplemented"};case 503:return{code:ie,message:"unavailable"};case 504:return{code:ie,message:"deadline_exceeded"};default:return{code:ie,message:"internal_error"}}return{code:ie,message:"internal_error"}}function xs(e,t){e.setAttribute("http.response.status_code",t);const n=G_(t);n.message!=="unknown_error"&&e.setStatus(n)}const Xf="_sentryScope",Qf="_sentryIsolationScope",V_=Symbol.for("sentry.otelSourceInference"),Y_=Symbol.for("sentry.otelSourceExplicitlySet"),J_=Symbol.for("sentry.tracerProviderSpan");function br(e,t,n){e&&(xe(e,Qf,zf(n)),xe(e,Xf,t))}function Mn(e){const t=e;return{scope:t[Xf],isolationScope:qf(t[Qf])}}function Gu(e){return e[V_]===!0}function K_(e){xe(e,Y_,!0)}function Vu(e){return e[J_]===!0}const Os="sentry-",X_=8192;function kc(e){const t=Q_(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(Os)){const i=o.slice(Os.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Zf(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${Os}${r}`]=o),n),{});return Z_(t)}function Q_(e){if(!(!e||!ft(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Yu(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):Yu(e)}function Yu(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch(i){return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function Z_(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${t},${s}`;return i.length>X_?(A&&S.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const ey=/^o(\d+)\./,ty=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function ny(e){return e==="http"||e==="https"}function At(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function ep(e){const t=ty.exec(e);if(!t){qt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return tp({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function tp(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ry(e){if(!A)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(S.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?ny(r)?t&&isNaN(parseInt(t,10))?(S.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(S.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(S.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function oy(e){const t=e.match(ey);return t==null?void 0:t[1]}function np(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=oy(n)),r}function rp(e){const t=typeof e=="string"?ep(e):tp(e);if(!(!t||!ry(t)))return t}function Ln(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const op=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function sy(e){if(!e)return;const t=e.match(op);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function sp(e,t){const n=sy(e),r=kc(t);if(!(n!=null&&n.traceId))return{traceId:Ht(),sampleRand:$t()};const o=iy(n,r);r&&(r.sample_rand=o.toString());const{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function ip(e=Ht(),t=an(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}
5function ap(e=Ht(),t=an(),n){return`00-${e}-${t}-${n?"01":"00"}`}function iy(e,t){const n=Ln(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=Ln(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?$t()*r:r+$t()*(1-r):$t()}function ay(e,t){const n=np(e);return t&&n&&t!==n?(S.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):(e.getOptions().strictTraceContinuation||!1)&&(t&&!n||!t&&n)?(S.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}const cp=0,di=1;let Ju=!1;function cy(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:c}=Q(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:o,status:i,origin:a,links:c}}function up(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:Q(e).parent_span_id,s=Mn(e).scope,i=r?(s==null?void 0:s.getPropagationContext().propagationSpanId)||an():t;return{parent_span_id:o,span_id:i,trace_id:n}}function uy(e){const{traceId:t,spanId:n}=e.spanContext(),r=Mt(e);return ip(t,n,r)}function ly(e){const{traceId:t,spanId:n}=e.spanContext(),r=Mt(e);return ap(t,n,r)}function lp(e){if(e&&e.length>0)return e.map(i=>{var a=i,{context:c}=a,u=c,{spanId:t,traceId:n,traceFlags:r}=u,o=vn(u,["spanId","traceId","traceFlags"]),{attributes:s}=a;return m({span_id:t,trace_id:n,sampled:r===di,attributes:s},o)})}function dp(e){if(e!=null&&e.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===di,attributes:o}))}function Bt(e){return typeof e=="number"?Ku(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Ku(e.getTime()):be()}function Ku(e){return e>9999999999?e/1e3:e}function Q(e){if(mp(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(hp(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:fp(e),start_timestamp:Bt(o),timestamp:Bt(i)||void 0,status:gp(a),op:r[ve],origin:r[ue],links:lp(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Ls(e){if(mp(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(hp(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:n,parent_span_id:fp(e),start_timestamp:Bt(o),end_timestamp:Bt(i),is_segment:e===Ps(e),status:Rc(a),attributes:_p(r,a),links:dp(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Ps(e)}}function fp(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function pp(e){var t;return v(m({},e),{attributes:Sr(e.attributes),links:(t=e.links)==null?void 0:t.map(n=>v(m({},n),{attributes:Sr(n.attributes)}))})}function hp(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function mp(e){return typeof e.getSpanJSON=="function"}function Mt(e){const{traceFlags:t}=e.spanContext();return t===di}function gp(e){if(!(!e||e.code===Kf))return e.code===To?"ok":e.message||"internal_error"}function Rc(e){return!e||e.code===To||e.code===Kf||e.message==="cancelled"?"ok":"error"}function _p(e,t){const n=Rc(t)==="error"?t==null?void 0:t.message:void 0;return m(m({},n&&{[P_]:n}),e)}const Nn="_sentryChildSpans",Fa="_sentryRootSpan";function ps(e,t){const n=e[Fa]||e;xe(t,Fa,n),Mt(e)&&(!e.isRecording()&&!n.isRecording()||(e[Nn]?e[Nn].add(t):xe(e,Nn,new Set([t]))))}function dy(e,t){e[Nn]&&e[Nn].delete(t)}function hs(e){const t=new Set;function n(r){if(!t.has(r)&&Mt(r)){t.add(r);const o=r[Nn]?Array.from(r[Nn]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}const Ie=Ps;function Ps(e){return e[Fa]||e}function we(){const e=Rt(),t=gn(e);return t.getActiveSpan?t.getActiveSpan():_r(Y())}function Ds(){Ju||(qt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Ju=!0)}function qx(e,t){e.updateName(t),e.setAttributes({[Ve]:"custom",[Da]:t})}let Xu=!1;function fy(){if(Xu)return;function e(){const t=we(),n=t&&Ie(t);if(n){const r="internal_error";A&&S.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:ie,message:r})}}Xu=!0,Of(e),Lf(e)}function Je(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=x())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Qu(e){S.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function io(e,t){if(!(t!=null&&t.length))return!1;for(const n of t){if(my(n)){if(e.description&&Kr(e.description,n))return A&&Qu(e),!0;continue}const r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;const o=n.name?e.description&&Kr(e.description,n.name):!0,s=n.op?e.op&&Kr(e.op,n.op):!0,i=n.attributes?Object.entries(n.attributes).every(([a,c])=>{var u;return py((u=e.attributes)==null?void 0:u[a],c)}):!0;if(o&&s&&i)return A&&Qu(e),!0}return!1}function py(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?
5Kr(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function hy(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function my(e){return typeof e=="string"||e instanceof RegExp}const yp=Symbol.for("sentry.nonRecordingSpan");class Pn{constructor(t={}){this._traceId=t.traceId||Ht(),this._spanId=t.spanId||an(),this.dropReason=t.dropReason,xe(this,yp,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:cp}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Er(e){return!!e&&e[yp]===!0}const Io="production",Sp="_frozenDsc";function Zu(e,t){xe(e,Sp,t)}function bp(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Io,release:n.release,public_key:r,trace_id:e,org_id:np(t)};return t.emit("createDsc",o),o}function fi(e,t){const n=t.getPropagationContext();return n.dsc||bp(n.traceId,e)}function _t(e){var _,y,b,w,I;const t=x();if(!t)return{};const n=Ie(e),r=Q(n),o=r.data,s=n.spanContext().traceState,i=(y=(_=s==null?void 0:s.get("sentry.sample_rate"))!=null?_:o[Ic])!=null?y:o[Jf];function a(O){return(typeof i=="number"||typeof i=="string")&&(O.sample_rate=`${i}`),O}const c=n[Sp];if(c)return a(c);const u=Er(n),d=u&&n.dropReason==="ignored";if(u&&(!Je(t.getOptions())||d)){const O=Mn(n).scope;if(O){const C=m({},fi(t,O));return d&&(C.sampled="false"),a(C)}}const l=s==null?void 0:s.get("sentry.dsc"),f=l&&kc(l);if(f)return a(f);const p=bp(e.spanContext().traceId,t),h=(b=o[Ve])!=null?b:o["sentry.segment.name.source"],g=r.description;return h!=="url"&&g&&(p.transaction=g),Je()&&(p.sampled=String(Mt(n)),p.sample_rand=(I=s==null?void 0:s.get("sentry.sample_rand"))!=null?I:(w=Mn(n).scope)==null?void 0:w.getPropagationContext().sampleRand.toString()),a(p),t.emit("createDsc",p,n),p}function Gx(e){const t=_t(e);return Zf(t)}function Vx(e){return xe(e,"_streamed",!0),e}function pi(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function st(e,t=[]){return[e,t]}function el(e,t){const[n,r]=e;return[n,[...r,t]]}function Dn(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function $a(e,t){return Dn(e,(n,r)=>t.includes(r))}function Fs(e){const t=xr(H);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function gy(e){const t=xr(H);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function $s(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Fs(r),s]:r.push(typeof s=="string"?Fs(s):s)}for(const s of n){const[i,a]=s;if(o(` 6${JSON.stringify(i)} 7`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch(u){c=JSON.stringify(Ce(a))}o(c)}}return typeof r=="string"?r:_y(r)}function _y(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function yy(e){let t=typeof e=="string"?Fs(e):e;function n(i){const a=t.subarray(0,i);return t=t.subarray(i+1),a}function r(){let i=t.indexOf(10);return i<0&&(i=t.length),JSON.parse(gy(n(i)))}const o=r(),s=[];for(;t.length;){const i=r(),a=typeof i.length=="number"?i.length:void 0;s.push([i,a?n(a):r()])}return[o,s]}function Sy(e){return[{type:"span"},e]}function by(e){const t=typeof e.data=="string"?Fs(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Ep={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Ey(e){return e in Ep}function tl(e){return Ey(e)?Ep[e]:e}function wo(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function vp(e,t,n,r){var s;const o=(s=e.sdkProcessingMetadata)==null?void 0:s.dynamicSamplingContext;return m(m(m({event_id:e.event_id,sent_at:new Date(Ct()).toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:At(r)}),o&&{trace:o})}function vy(e,t){var r,o,s,i;if(!t)return e;const n=e.sdk||{};return e.sdk=v(m({},n),{name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((o=e.sdk)==null?void 0:o.packages)||[],...t.packages||[]],settings:(s=e.sdk)!=null&&s.settings||t.settings?m(m({},(i=e.sdk)==null?void 0:i.settings),t.settings):void 0}),e}function Ty(e,t,n,r){const o=wo(n),s=m(m({sent_at:new Date(Ct()).toISOString()},o&&{sdk:o}),!!r&&t&&{dsn:At(t)}),i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return st(s,[i])}function Iy(e,t,n,r){const o=wo(n),s=e.type&&e.type!=="replay_event"?e.type:"event";vy(e,n==null?void 0:n.sdk);const i=vp(e,o,r,t);return delete e.sdkProcessingMetadata,st(i,[[{type:s},e]])}function wy(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=_t(e[0]),o=t==null?void 0:t.getDsn(),s=t==null?void 0:t.getOptions().tunnel,i=m(m({sent_at:new Date(Ct()).toISOString()},n(r)&&{trace:r}
7),!!s&&o&&{dsn:At(o)}),{beforeSendSpan:a,ignoreSpans:c}=(t==null?void 0:t.getOptions())||{},u=c!=null&&c.length?e.filter(p=>{const h=Q(p);return!io({description:h.description,op:h.op,attributes:h.data},c)}):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=a?p=>{const h=Q(p),g=pi(a)?h:a(h);return g||(Ds(),h)}:Q,f=[];for(const p of u){const h=l(p);h&&f.push(Sy(h))}return st(i,f)}function ky(e){if(!A)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=Q(e),{spanId:o}=e.spanContext(),s=Mt(e),i=Ie(e),a=i===e,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){const{op:d,description:l}=Q(i);u.push(`root ID: ${i.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}S.log(`${c} 8 ${u.join(` 9 `)}`)}function Ry(e){if(!A)return;const{description:t="< unknown name >",op:n="< unknown op >"}=Q(e),{spanId:r}=e.spanContext(),s=Ie(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;S.log(i)}function Tp(e,t,n,r=we()){const o=r&&Ie(r);o&&(A&&S.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[vo]:t,[Eo]:n}))}function nl(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[Eo],s=r[vo];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}function rl(){return xr(Rt()).segmentSpanCaptureStrategy}function it(e){return e.getOptions().traceLifecycle==="stream"}const ol=1e3;class hi{constructor(t={}){this._traceId=t.traceId||Ht(),this._spanId=t.spanId||an(),this._startTime=t.startTimestamp||be(),this._links=t.links,this._attributes={},this.setAttributes(m({[ue]:"manual",[ve]:t.op},t.attributes)),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._frozen?this:(this._links?this._links.push(t):this._links=[t],this)}addLinks(t){return this._frozen?this:(this._links?this._links.push(...t):this._links=t,this)}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?di:cp}}setAttribute(t,n){return this._frozen?this:(n===void 0?delete this._attributes[t]:this._attributes[t]=n,t===Ve&&n!==void 0&&Gu(this)&&K_(this),this)}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._frozen||(this._startTime=Bt(t))}setStatus(t){return this._frozen?this:(this._status=t,this)}updateName(t){return this._frozen?this:(this._name=t,Gu(this)||this.setAttribute(Ve,"custom"),this)}end(t){if(this._endTime){this._frozen=Vu(this);return}this._endTime=Bt(t),Ry(this),this._onSpanEnded(),this._frozen=Vu(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ve],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:gp(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ue],profile_id:this._attributes[wc],exclusive_time:this._attributes[_n],measurements:nl(this._events),is_segment:this._isStandaloneSpan&&Ie(this)===this||void 0,segment_id:this._isStandaloneSpan?Ie(this).spanContext().spanId:void 0,links:lp(this._links)}}getStreamedSpanJSON(){var t,n;return{name:(t=this._name)!=null?t:"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:(n=this._endTime)!=null?n:this._startTime,is_segment:this._isStandaloneSpan||this===Ie(this),status:Rc(this._status),attributes:_p(this._attributes,this._status),links:dp(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){if(this._frozen)return this;A&&S.log("[Tracing] Adding an event to span:",t);const o=sl(n)?n:r||be(),s=sl(n)?{}:n||{},i={name:t,time:Bt(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=x();t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this));const n=Ie(this),r=this._isStandaloneSpan||this===n;if(this._isStandaloneSpan){this._sampled?Ay(wy([this],t)):(A&&S.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}if(!r){const i=rl();if(i){const a=Mn(this).scope||Y();i.onChildSpanEnded(this,n,c=>this._convertSpanToTransaction(c),a)}return}if(t&&it(t)){t.emit("afterSegmentSpanEnd",this);return}const o=Mn(this).scope||Y(),s=rl();if(s)s.onSegmentSpanEnded(i=>this._convertSpanToTransaction(i),o);else{const i=this._convertSpanToTransaction();i&&o.captureEvent(i)}}_convertSpanToTransaction(t={}){var l,f,p,h;if(!il(Q(this)))return;this._name||(A&&S.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:n,isolationScope:r}=Mn(this),o=(l=n==null?void 0:n.getScopeData().sdkProcessingMetadata)==null?void 0:l.normalizedRequest;if(this._sampled!==!0)return;(f=t.onSpanCaptured)==null||f.call(t,this);const s=[];for(const g of hs(this)){if(g===this||Cy(g)||(p=t.isSpanAlreadyCaptured)!=null&&p.call(t,g))continue;const _=Q(g);il(_)&&((h=t.onSpanCaptured)==null||h.call(t,g),s.push(_))}const i=this._attributes[Ve];delete this._attributes[Da];let a=!1;
9s.forEach(g=>{var _;delete g.data[Da],(_=g.op)!=null&&_.startsWith("gen_ai.")&&(a=!0)});const c=m({contexts:{trace:cy(this)},spans:s.length>ol?s.sort((g,_)=>g.start_timestamp-_.start_timestamp).slice(0,ol):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:n,capturedSpanIsolationScope:r,dynamicSamplingContext:_t(this),hasGenAiSpans:a},request:o},i&&{transaction_info:{source:i}}),u=nl(this._events);return u&&Object.keys(u).length&&(A&&S.log("[Measurements] Adding measurements to transaction event",JSON.stringify(u,void 0,2)),c.measurements=u),c}}function sl(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function il(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Cy(e){return e instanceof hi&&e.isStandaloneSpan()}function Ay(e){const t=x();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function Cc(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return My(o,t,n,r)}function My(e,t,n,r){return Wn(e)?Vf(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function Ny(e,t,n){if(!Je(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler(v(m({},t),{inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a})),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate!="undefined"&&(o=e.tracesSampleRate,r=!0);const s=Ln(o);if(s===void 0)return A&&S.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return A&&S.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"}`),[!1,s,r];const i=n<s;return i||A&&S.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}const Ba="__SENTRY_SUPPRESS_TRACING__";function Gt(e,t){const n=zn();if(n.startSpan)return n.startSpan(e,t);const r=xc(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return ot(a,()=>Ip(s)(()=>{const u=Y(),d=Oc(u,s),l=x(),p=e.onlyIfParent&&!d?Mc(u,l):Nc({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!gi(p)||!d)&&It(u,p),Cc(()=>t(p),()=>{const{status:h}=Q(p);p.isRecording()&&(!h||h==="ok")&&p.setStatus({code:ie,message:"internal_error"})},()=>{p.end()})}))}function en(e,t){const n=zn();if(n.startSpanManual)return n.startSpanManual(e,t);const r=xc(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return ot(a,()=>Ip(s)(()=>{const u=Y(),d=Oc(u,s),f=e.onlyIfParent&&!d?Mc(u,x()):Nc({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!gi(f)||!d)&&It(u,f),Cc(()=>t(f,()=>f.end()),()=>{const{status:p}=Q(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:ie,message:"internal_error"})})}))}function yn(e){const t=zn();return t.startInactiveSpan?t.startInactiveSpan(e):xy(e)}function xy(e){const t=xc(e),{forceTransaction:n,parentSpan:r}=e;return(e.scope?s=>ot(e.scope,s):r!==void 0?s=>mi(r,s):s=>s())(()=>{const s=Y(),i=Oc(s,r),a=x();return e.onlyIfParent&&!i?Mc(s,a):Nc({parentSpan:i,spanArguments:t,forceTransaction:n,scope:s})})}const Yx=(e,t)=>{const n=Rt(),r=gn(n);if(r.continueTrace)return r.continueTrace(e,t);const{sentryTrace:o,baggage:s}=e,i=x(),a=kc(s);return i&&!ay(i,a==null?void 0:a.org_id)?Ly(t):ot(c=>{const u=sp(o,s);return c.setPropagationContext(u),It(c,void 0),t()})};function mi(e,t){const n=zn();return n.withActiveSpan?n.withActiveSpan(e,t):ot(r=>(It(r,e||void 0),t(r)))}function Oy(e){const t=zn();return t.suppressTracing?t.suppressTracing(e):ot(n=>{n.setSDKProcessingMetadata({[Ba]:!0});const r=e();return n.setSDKProcessingMetadata({[Ba]:void 0}),r})}function Ac(e=Y()){const t=zn();return t.isTracingSuppressed?t.isTracingSuppressed(e):e.getScopeData().sdkProcessingMetadata[Ba]===!0}function Ly(e){const t=zn();return t.startNewTrace?t.startNewTrace(e):ot(n=>(n.setPropagationContext({traceId:Ht(),sampleRand:$t()}
9),A&&S.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),mi(null,e)))}function Mc(e,t){t==null||t.recordDroppedEvent("no_parent_span","span");const n=new Pn({traceId:e.getPropagationContext().traceId});return br(n,e,Se()),n}function Nc({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){var a;const o=Se();if(!Je()){const c=r.getPropagationContext(),u=e?e.spanContext().traceId:c.traceId,d=new Pn({traceId:u});return e&&!n&&ps(e,d),br(d,r,o),d}const s=x();if(Dy(s,t)){Ac(r)||s==null||s.recordDroppedEvent("ignored","span");const c=new Pn({dropReason:"ignored",traceId:(a=e==null?void 0:e.spanContext().traceId)!=null?a:r.getPropagationContext().traceId});return e&&!n&&ps(e,c),br(c,r,o),c}let i;if(e&&!n)i=Py(e,r,t,o),ps(e,i);else if(e){const c=_t(e),{traceId:u,spanId:d}=e.spanContext(),l=Mt(e);i=al(m({traceId:u,parentSpanId:d},t),r,o,l),Zu(i,c)}else{const{traceId:c,dsc:u,parentSpanId:d,sampled:l}=r.getPropagationContext();i=al(m({traceId:c,parentSpanId:d},t),r,o,l),u&&Zu(i,u)}return ky(i),i}function xc(e){const t=e.experimental||{},n=m({isStandalone:t.standalone},e);if(e.startTime){const r=m({},n);return r.startTimestamp=Bt(e.startTime),delete r.startTime,r}return n}function zn(){const e=Rt();return gn(e)}function al(e,t,n,r){var _,y;const o=x(),s=(o==null?void 0:o.getOptions())||{},{name:i=""}=e,a={spanAttributes:m({},e.attributes),spanName:i,parentSampled:r};o==null||o.emit("beforeSampling",a,{decision:!1});const c=(_=a.parentSampled)!=null?_:r,u=a.spanAttributes,d=t.getPropagationContext(),l=Ac(t),[f,p,h]=l?[!1]:Ny(s,{name:i,parentSampled:c,attributes:u,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:Ln((y=d.dsc)==null?void 0:y.sample_rate)},d.sampleRand),g=new hi(v(m({},e),{attributes:m({[Ve]:"custom",[Ic]:p!==void 0&&h?p:void 0},u),sampled:f}));return!f&&o&&!l&&(A&&S.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),o.recordDroppedEvent("sample_rate",it(o)?"span":"transaction")),br(g,t,n),o&&o.emit("spanStart",g),g}function Py(e,t,n,r){const{spanId:o,traceId:s}=e.spanContext(),i=Ac(t),a=i?!1:Mt(e),c=a?new hi(v(m({},n),{parentSpanId:o,traceId:s,sampled:a})):new Pn({traceId:s});ps(e,c),br(c,t,r);const u=x();return u&&(it(u)&&Er(c)&&(Er(e)&&e.dropReason?(c.dropReason=e.dropReason,u.recordDroppedEvent(e.dropReason,"span")):i||(c.dropReason="sample_rate",u.recordDroppedEvent("sample_rate","span"))),u.emit("spanStart",c),n.endTimestamp&&(u.emit("spanEnd",c),u.emit("afterSpanEnd",c))),c}function Oc(e,t){if(t)return t;if(t===null)return;const n=_r(e);if(!n)return;const r=x();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Ie(n):n}function Ip(e){return e!==void 0?t=>mi(e,t):t=>t()}function Dy(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!it(e)||!(n!=null&&n.length)?!1:io({description:t.name||"",op:((r=t.attributes)==null?void 0:r[ve])||t.op,attributes:t.attributes},n)}function gi(e){return Er(e)&&e.dropReason==="ignored"}const ms={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Fy="heartbeatFailed",$y="idleTimeout",By="finalTimeout",Uy="externalFinish";function wp(e,t={}){const n=new Map;let r=!1,o,s,i=Uy,a=!t.disableAutoFinish;const c=[],{idleTimeout:u=ms.idleTimeout,finalTimeout:d=ms.finalTimeout,childSpanTimeout:l=ms.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:p=!0}=t,h=x(),g=Y();if(!h||!Je()){const k=new Pn({traceId:g.getPropagationContext().traceId});return br(k,g,Se()),k}const _=we(),y=Hy(e);y.end=new Proxy(y.end,{apply(k,T,P){if(f&&f(y),Er(T))return;const[M,...D]=P,G=M||be(),Z=Bt(G),V=hs(y).filter(se=>se!==y),$=Q(y);if(!V.length||!p)return F(Z),Reflect.apply(k,T,[Z,...D]);const N=h.getOptions().ignoreSpans,te=V==null?void 0:V.reduce((se,oe)=>{const ce=Q(oe);return!ce.timestamp||N&&io({description:ce.description,op:ce.op,attributes:ce.data},N)?se:se?Math.max(se,ce.timestamp):ce.timestamp},void 0),L=$.start_timestamp,J=Math.min(L?L+d/1e3:1/0,Math.max(L||-1/0,Math.min(Z,te||1/0)));return F(J),Reflect.apply(k,T,[J,...D])}});function b(){o&&(clearTimeout(o),o=void 0)}function w(){s&&(clearTimeout(s),s=void 0)}function I(k){b(),o=setTimeout(()=>{!r&&n.size===0&&a&&(i=$y,y.end(k))},u)}function O(k){w(),s=setTimeout(()=>{!r&&a&&(i=Fy,y.end(k))},l)}function C(k){b(),n.set(k,!0);const T=be();O(T+l/1e3)}function E(k){if(n.has(k)&&n.delete(k),n.size===0){const T=be();I(T+u/1e3),w()}}
9function F(k){r=!0,n.clear(),c.forEach(V=>V()),It(g,_);const T=Q(y),{start_timestamp:P}=T;if(!P)return;T.data[so]||y.setAttribute(so,i);const D=T.status;(!D||D==="unknown")&&y.setStatus({code:To}),S.log(`[Tracing] Idle span "${T.op}" finished`);const G=hs(y).filter(V=>V!==y);let Z=0;G.forEach(V=>{V.isRecording()&&(V.setStatus({code:ie,message:"cancelled"}),V.end(k),A&&S.log("[Tracing] Cancelling span since span ended early",JSON.stringify(V,void 0,2)));const $=Q(V),{timestamp:N=0,start_timestamp:te=0}=$,L=te<=k,J=(d+u)/1e3,se=N-te<=J;if(A){const oe=JSON.stringify(V,void 0,2);L?se||S.log("[Tracing] Discarding span since it finished after idle span final timeout",oe):S.log("[Tracing] Discarding span since it happened after idle span was finished",oe)}(!se||!L)&&(dy(y,V),Z++)}),Z>0&&y.setAttribute("sentry.idle_span_discarded_spans",Z)}return c.push(h.on("spanStart",k=>{if(r||k===y||Q(k).timestamp||k instanceof hi&&k.isStandaloneSpan())return;hs(y).includes(k)&&C(k.spanContext().spanId)})),c.push(h.on("spanEnd",k=>{r||E(k.spanContext().spanId)})),c.push(h.on("idleSpanEnableAutoFinish",k=>{k===y&&(a=!0,I(),n.size&&O())})),t.disableAutoFinish||I(),setTimeout(()=>{r||(y.setStatus({code:ie,message:"deadline_exceeded"}),i=By,y.end())},d),y}function Hy(e){const t=yn(e);return It(Y(),t),A&&S.log("[Tracing] Started span is an idle span"),t}function Wy(e,t,n){let r,o,s;const i=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,a=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function c(){return u(),r=e(),r}function u(){o!==void 0&&clearTimeout(o),s!==void 0&&clearTimeout(s),o=s=void 0}function d(){return o!==void 0||s!==void 0?c():r}function l(){return o&&clearTimeout(o),o=a(c,t),i&&s===void 0&&(s=a(c,i)),r}return l.cancel=u,l.flush=d,l}const jy=["addListener","on","once","prependListener","prependOnceListener","addEventListener"],zy=["removeListener","off","removeEventListener"],kp=Symbol("SentryScopeBoundListeners");let dr;function qy(e){return dr!==void 0&&(e===dr||e.listener===dr)}function Jx(e,t=Y()){const n=e;if(_i(n))return e;Lc(n);for(const r of jy)typeof n[r]=="function"&&(n[r]=Vy(n,n[r],t));for(const r of zy)typeof n[r]=="function"&&(n[r]=Yy(n,n[r]));return typeof n.removeAllListeners=="function"&&(n.removeAllListeners=Jy(n,n.removeAllListeners)),e}function Gy(e,t){return function(...n){return ot(t,()=>e.apply(this,n))}}function Rp(e){return typeof e=="function"}function Vy(e,t,n){return function(...r){const o=r[0],s=r[1],i=r.slice(2);if(!Rp(s)||qy(s))return t.apply(this,r);const a=_i(e)||Lc(e);let c=a.get(o);c||(c=new WeakMap,a.set(o,c));let u=c.get(s);u||(u=Gy(s,n),c.set(s,u));const d=dr;dr=u;try{return t.call(this,o,u,...i)}finally{dr=d}}}function Yy(e,t){return function(...n){var a,c;const r=n[0],o=n[1],s=n.slice(2),i=Rp(o)?(c=(a=_i(e))==null?void 0:a.get(r))==null?void 0:c.get(o):void 0;return i?t.call(this,r,i,...s):t.apply(this,n)}}function Jy(e,t){return function(...n){const r=_i(e);if(r)if(n.length===0)Lc(e);else{const o=n[0];r.delete(o)}return t.apply(this,n)}}function Lc(e){const t=new Map;return e[kp]=t,t}function _i(e){return e[kp]}function Ky(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;Xy(e,t),r&&eS(e,r),tS(e,n),Qy(e,o),Zy(e,s)}function cl(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:f,propagationContext:p,transactionName:h,span:g}=t;Wr(e,"extra",n),Wr(e,"tags",r),Wr(e,"attributes",o),Wr(e,"user",s),Wr(e,"contexts",i),e.sdkProcessingMetadata=bo(e.sdkProcessingMetadata,c,2),a&&(e.level=a),h&&(e.transactionName=h),g&&(e.span=g),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext=m(m({},e.propagationContext),p)}function Wr(e,t,n){e[t]=bo(e[t],n,1)}function ko(e,t){const n=Xr().getScopeData();return e&&cl(n,e.getScopeData()),t&&cl(n,t.getScopeData()),n}function Xy(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra=m(m({},n),e.extra)),Object.keys(r).length&&(e.tags=m(m({},r),e.tags)),Object.keys(o).length&&(e.user=m(m({},o),e.user)),Object.keys(s).length&&(e.contexts=m(m({},s),e.contexts)),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function Qy(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Zy(e,t){e.sdkProcessingMetadata=m(m({},e.sdkProcessingMetadata),t)}function eS(e,t){e.contexts=m({trace:up(t)},e.contexts),e.sdkProcessingMetadata=m({dynamicSamplingContext:_t(t)},e.sdkProcessingMetadata);const n=Ie(t),r=Q(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function tS(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function nS(e){const t={},{response:n,profile:r,cloud_resource:o,culture:s,state:i}=e;if(n&&(n.status_code!=null&&(t["http.response.status_code"]=n.status_code),n.body_size!=null&&(t["http.response.body.size"]=n.body_size)),r&&(r.profile_id&&(t["sentry.profile_id"]=r.profile_id),r.profiler_id&&(t["sentry.profiler_id"]=r.profiler_id)),o)for(const[u,d]of Object.entries(o))d!=null&&(t[u]=d);s&&(s.locale&&(t["culture.locale"]=s.locale),s.timezone&&(t["culture.timezone"]=s.timezone)),i!=null&&i.state&&typeof i.state.type=="string"&&(t["state.type"]=i.state.type);const a=e.angular;if(a){const u=a.version;(typeof u=="string"||typeof u=="number")&&(t["angular.version"]=u)}const c=e.react;if(c){const u=c.version;(typeof u=="string"||typeof u=="number")&&(t["react.version"]=u)}return t}const Cp="graphql.document",rS="http.request.header",Ap="http.url",oS="sentry.op",sS="sentry.sdk.name",iS="sentry.sdk.version",aS="sentry.segment.id",Pc="sentry.segment.name",cS="sentry.trace_lifecycle",Mp="sentry.transaction",qn="url.full",uS="url.path",lS="user_agent.original";function dS(e,t){var f;const n=Ls(e),r=Ps(e),o=Ls(r),{isolationScope:s,scope:i}=Mn(e),a=ko(s,i);hS(n,o,t,a);const c=e.kind;t.emit("preprocessSpan",n,{spanKind:c}),n.is_segment&&(fS(n,a),pS(n,t),t.emit("processSegmentSpan",n)),t.emit("processSpan",n);const{beforeSendSpan:u}=t.getOptions(),d=u&&pi(u)?mS(n,u):n,l=(f=d.attributes)==null?void 0:f[Ve];return n.is_segment&&l&&cn(d,{"sentry.segment.name.source":l}),v(m({},pp(d)),{_segmentSpan:r})}function fS(e,t){const n=nS(t.contexts);cn(e,n)}function cn(e,t){var r;const n=(r=e.attributes)!=null?r:e.attributes={};Object.entries(t).forEach(([o,s])=>{s!=null&&!(o in n)&&(n[o]=s)})}function pS(e,t){const n=t.getIntegrationNames();n.length&&cn(e,{[$_]:n})}function hS(e,t,n,r){var a,c,u,d,l,f;
9const o=n.getSdkMetadata(),{release:s,environment:i}=n.getOptions();cn(e,m({[cS]:"stream",[Pc]:t.name,[aS]:t.span_id,[sS]:(a=o==null?void 0:o.sdk)==null?void 0:a.name,[iS]:(c=o==null?void 0:o.sdk)==null?void 0:c.version,[D_]:s,[F_]:i||Io,[B_]:(u=r.user)==null?void 0:u.id,[U_]:(d=r.user)==null?void 0:d.email,[H_]:(l=r.user)==null?void 0:l.ip_address,[W_]:(f=r.user)==null?void 0:f.username},r.attributes))}function mS(e,t){const n=t(e);return n||(Ds(),e)}const ra=0,ul=1,ll=2;function Ro(e){return new ao(t=>{t(e)})}function Np(e){return new ao((t,n)=>{n(e)})}class ao{constructor(t){this._state=ra,this._handlers=[],this._runExecutor(t)}then(t,n){return new ao((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new ao((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===ra)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===ul&&n[1](this._value),this._state===ll&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===ra){if(Wn(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(ul,s)},o=s=>{n(ll,s)};try{t(r,o)}catch(s){o(s)}}}function gS(e,t,n,r=0){try{const o=Ua(t,n,e,r);return Wn(o)?o:Ro(o)}catch(o){return Np(o)}}function Ua(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o(m({},e),t);return A&&s===null&&S.log(`Event processor "${o.id||"?"}" dropped event`),Wn(s)?s.then(i=>Ua(i,t,n,r+1)):Ua(s,t,n,r+1)}let Lt,dl,fl,Jt;function xp(e){const t=H._sentryDebugIds,n=H._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Jt&&r.length===dl&&o.length===fl)return Jt;dl=r.length,fl=o.length,Jt={},Lt||(Lt={});const s=(i,a)=>{for(const c of i){const u=a[c],d=Lt==null?void 0:Lt[c];if(d&&Jt&&u)Jt[d[0]]=u,Lt&&(Lt[c]=[d[0],u]);else if(u){const l=e(c);for(let f=l.length-1;f>=0;f--){const p=l[f],h=p==null?void 0:p.filename;if(h&&Jt&&Lt){Jt[h]=u,Lt[c]=[h,u];break}}}}};return t&&s(r,t),n&&s(o,n),Jt}function _S(e,t){const n=xp(e);if(!n)return[];const r=[];for(const o of t){const s=e_(o);s&&n[s]&&r.push({type:"sourcemap",code_file:o,debug_id:n[s]})}return r}function Op(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c=v(m({},t),{event_id:t.event_id||n.event_id||Ae(),timestamp:t.timestamp||jn()}),u=n.integrations||e.integrations.map(y=>y.name);yS(c,e),ES(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&SS(c,e.stackParser);const d=TS(r,n.captureContext);n.mechanism&&bt(c,n.mechanism);const l=o?o.getEventProcessors():[],f=ko(s,d),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Ky(c,f);const h=[...l,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Ro(c):gS(h,c,n)).then(y=>(y&&bS(y),typeof i=="number"&&i>0?vS(y,i,a):y))}function yS(e,t){var a,c;const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||Io,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i!=null&&i.url&&s&&(i.url=oo(i.url,s)),s&&((c=(a=e.exception)==null?void 0:a.values)==null||c.forEach(u=>{u.value&&(u.value=oo(u.value,s))}))}function SS(e,t){var r,o;const n=xp(t);(o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(c=>{c.filename&&(c.debug_id=n[c.filename])})})}function bS(e){var r,o;const t={};if((o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(c=>{c.debug_id&&(c.abs_path?t[c.abs_path]=c.debug_id:c.filename&&(t[c.filename]=c.debug_id),delete c.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([s,i])=>{n.push({type:"sourcemap",code_file:s,debug_id:i})})}function ES(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}
9function vS(e,t,n){var o,s;if(!e)return null;const r=m(m(m(m(m({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>m(m({},i),i.data&&{data:Ce(i.data,t,n)}))}),e.user&&{user:Ce(e.user,t,n)}),e.contexts&&{contexts:Ce(e.contexts,t,n)}),e.extra&&{extra:Ce(e.extra,t,n)});return(o=e.contexts)!=null&&o.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ce(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>m(m({},i),i.data&&{data:Ce(i.data,t,n)}))),(s=e.contexts)!=null&&s.flags&&r.contexts&&(r.contexts.flags=Ce(e.contexts.flags,3,n)),r}function TS(e,t){if(!t)return e;const n=e?e.clone():new wt;return n.update(t),n}function IS(e){if(e)return wS(e)?{captureContext:e}:RS(e)?{captureContext:e}:e}function wS(e){return e instanceof wt||typeof e=="function"}const kS=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function RS(e){return Object.keys(e).some(t=>kS.includes(t))}function kt(e,t){return Y().captureException(e,IS(t))}function CS(e,t){const n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return Y().captureMessage(e,n,r)}function Co(e,t){return Y().captureEvent(e,t)}function AS(e,t){Se().setContext(e,t)}function Kx(e){Se().setExtras(e)}function Xx(e,t){Se().setExtra(e,t)}function Qx(e){Se().setTags(e)}function Zx(e,t){Se().setTag(e,t)}function eO(e){Se().setAttributes(e)}function tO(e,t){Se().setAttribute(e,t)}function nO(e){Se().setUser(e)}function rO(e){Se().setConversationId(e)}function MS(){return Se().lastEventId()}function oO(e){return U(this,null,function*(){const t=x();return t?t.flush(e):(A&&S.warn("Cannot flush events. No client defined."),Promise.resolve(!1))})}function sO(e){return U(this,null,function*(){const t=x();return t?t.close(e):(A&&S.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))})}function iO(){return!!x()}function NS(){const e=x();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function xS(e){Se().addEventProcessor(e)}function pl(e){const t=Se(),{user:n}=ko(t,Y()),{userAgent:r}=H.navigator||{},o=E_(m(m({user:n},r&&{userAgent:r}),e)),s=t.getSession();return(s==null?void 0:s.status)==="ok"&&gr(s,{status:"exited"}),Lp(),t.setSession(o),o}function Lp(){const e=Se(),n=Y().getSession()||e.getSession();n&&v_(n),Pp(),e.setSession()}function Pp(){const e=Se(),t=x(),n=e.getSession();n&&t&&t.captureSession(n)}function oa(e=!1){if(e){Lp();return}Pp()}function yi(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const OS="7";function Dp(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function LS(e){return`${Dp(e)}${e.projectId}/envelope/`}function PS(e,t){const n={sentry_version:OS};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Fp(e,t,n){return t||`${LS(e)}?${PS(e,n)}`}function DS(e,t){const n=rp(e);if(!n)return"";const r=`${Dp(n)}embed/error-page/`;let o=`dsn=${At(n)}`;for(const s in t)if(s!=="dsn"&&s!=="onClose")if(s==="user"){const i=t.user;if(!i)continue;i.name&&(o+=`&name=${encodeURIComponent(i.name)}`),i.email&&(o+=`&email=${encodeURIComponent(i.email)}`)}else o+=`&${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`;return`${r}?${o}`}const hl=[];function FS(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function $S(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return FS(r)}function BS(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&$p(e,r,n)}),n}function ml(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function $p(e,t,n){if(n[t.name]){A&&S.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!hl.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),hl.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{const o=t[r];typeof o=="function"&&e.on(r,s=>o.call(t,s,e))}),A&&S.log(`Integration installed: ${t.name}`)}function gl(e){const t=x();if(!t){A&&S.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}const US="sentry.timestamp.sequence";let sa=0,ia;function Bp(e){const t=Math.floor(e*1e3);ia!==void 0&&t!==ia&&(sa=0);const n=sa;return sa++,ia=t,{key:US,value:{value:n,type:"integer"}}}function Up(e,t){return t?ot(t,()=>{const n=we(),r=n?up(n):Yf(t);return[n?_t(n):fi(e,t),r]}):[void 0,void 0]}const HS={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function WS(){return typeof __SENTRY_BROWSER_BUNDLE__!="undefined"&&!!__SENTRY_BROWSER_BUNDLE__}function jS(){return"npm"}function zS(){return!WS()&&Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]"}function un(){return typeof window!="undefined"&&(!zS()||qS())}function qS(){const e=H.process;return(e==null?void 0:e.type)==="renderer"}function GS(e,t){const n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},v(m({version:2},un()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}}),{items:e})]}function VS(e,t,n,r,o){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=At(r)),st(s,[GS(e,o)])}const YS=100;function yt(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function JS(e,t){const n=Dc(),r=Wp(e);r===void 0?n.set(e,[t]):r.length>=YS?(Hp(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Bs(e,t=Y(),n=JS){var D,G,Z;const r=(D=t==null?void 0:t.getClient())!=null?D:x();if(!r){A&&S.warn("No client available to capture log.");return}const{release:o,environment:s,enableLogs:i=!0,beforeSendLog:a}=r.getOptions();if(!i){A&&S.warn("logging option not enabled, log will not be captured.");return}const[,c]=Up(r,t),u=m({},e.attributes),{user:{id:d,email:l,username:f},attributes:p={}}=ko(Se(),t);yt(u,"user.id",d,!1),yt(u,"user.email",l,!1),yt(u,"user.name",f,!1),yt(u,"sentry.release",o),yt(u,"sentry.environment",s);const{name:h,version:g}=(Z=(G=r.getSdkMetadata())==null?void 0:G.sdk)!=null?Z:{};yt(u,"sentry.sdk.name",h),yt(u,"sentry.sdk.version",g);const _=r.getIntegrationByName("Replay"),y=_==null?void 0:_.getReplayId(!0);yt(u,"sentry.replay_id",y),y&&(_==null?void 0:_.getRecordingMode())==="buffer"&&yt(u,"sentry._internal.replay_is_buffering",!0);const b=e.message;
9if(ci(b)){const{__sentry_template_string__:V,__sentry_template_values__:$=[]}=b;$!=null&&$.length&&(u["sentry.message.template"]=V),$.forEach((N,te)=>{u[`sentry.message.parameter.${te}`]=N})}const w=_r(t);yt(u,"sentry.trace.parent_span_id",w==null?void 0:w.spanContext().spanId);const I=v(m({},e),{attributes:u});r.emit("beforeCaptureLog",I);const O=a?qt(()=>a(I)):I;if(!O){r.recordDroppedEvent("before_send","log_item",1),A&&S.warn("beforeSendLog returned null, log will not be captured.");return}const{level:C,message:E,attributes:F={},severityNumber:k}=O,T=be(),P=Bp(T),M={timestamp:T,level:C,body:Ha(String(E)),trace_id:c==null?void 0:c.trace_id,severity_number:k!=null?k:HS[C],attributes:KS(v(m(m({},Sr(p)),Sr(F,!0)),{[P.key]:P.value}))};n(r,M),r.emit("afterCaptureLog",O)}function Hp(e,t){var s;const n=(s=t!=null?t:Wp(e))!=null?s:[];if(n.length===0)return;const r=e.getOptions(),o=VS(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Dc().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Wp(e){return Dc().get(e)}function Dc(){return Or("clientToLogBufferMap",()=>new WeakMap)}function KS(e){const t={};for(const[n,r]of Object.entries(e)){const o=Ha(n);r.type==="string"?t[o]=v(m({},r),{value:Ha(r.value)}):t[o]=r}return t}function Ha(e){const t=Object(e),n=t.isWellFormed,r=t.toWellFormed;return typeof n=="function"&&typeof r=="function"?n.call(e)?e:r.call(e):e}function XS(e,t){const n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},v(m({version:2},un()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}}),{items:e})]}function QS(e,t,n,r,o){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=At(r)),st(s,[XS(e,o)])}const ZS=1e3;function Pt(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function eb(e,t){const n=Fc(),r=zp(e);r===void 0?n.set(e,[t]):r.length>=ZS?(jp(e,r),n.set(e,[t])):n.set(e,[...r,t])}function tb(e,t,n){var d,l;const{release:r,environment:o}=t.getOptions(),s=m({},e.attributes);Pt(s,"user.id",n.id,!1),Pt(s,"user.email",n.email,!1),Pt(s,"user.name",n.username,!1),Pt(s,"sentry.release",r),Pt(s,"sentry.environment",o);const{name:i,version:a}=(l=(d=t.getSdkMetadata())==null?void 0:d.sdk)!=null?l:{};Pt(s,"sentry.sdk.name",i),Pt(s,"sentry.sdk.version",a);const c=t.getIntegrationByName("Replay"),u=c==null?void 0:c.getReplayId(!0);return Pt(s,"sentry.replay_id",u),u&&(c==null?void 0:c.getRecordingMode())==="buffer"&&Pt(s,"sentry._internal.replay_is_buffering",!0),v(m({},e),{attributes:s})}function nb(e,t,n,r){const[,o]=Up(t,n),s=_r(n),i=s?s.spanContext().traceId:o==null?void 0:o.trace_id,a=s?s.spanContext().spanId:void 0,c=be(),u=Bp(c);return{timestamp:c,trace_id:i!=null?i:"",span_id:a,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:v(m(m({},Sr(r)),Sr(e.attributes,"skip-undefined")),{[u.key]:u.value})}}function rb(e,t){var g,_,y,b;const n=(g=t==null?void 0:t.scope)!=null?g:Y(),r=(_=t==null?void 0:t.captureSerializedMetric)!=null?_:eb,o=(y=n==null?void 0:n.getClient())!=null?y:x();if(!o){A&&S.warn("No client available to capture metric.");return}const{_experiments:s,enableMetrics:i,beforeSendMetric:a}=o.getOptions();if(!((b=i!=null?i:s==null?void 0:s.enableMetrics)!=null?b:!0)){A&&S.warn("metrics option not enabled, metric will not be captured.");return}const{user:u,attributes:d}=ko(Se(),n),l=tb(e,o,u);
9o.emit("processMetric",l);const f=a||(s==null?void 0:s.beforeSendMetric),p=f?f(l):l;if(!p){A&&S.log("`beforeSendMetric` returned `null`, will not send metric.");return}const h=nb(p,o,n,d);A&&S.log("[Metric]",h),r(o,h),o.emit("afterCaptureMetric",p)}function jp(e,t){var s;const n=(s=t!=null?t:zp(e))!=null?s:[];if(n.length===0)return;const r=e.getOptions(),o=QS(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Fc().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function zp(e){return Fc().get(e)}function Fc(){return Or("clientToMetricBufferMap",()=>new WeakMap)}function ob(e){const t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:m({},e.data),links:e.links};return pp(t)}function sb(e,t){var s,i,a;if(e.type!=="transaction"||!((s=e.spans)!=null&&s.length)||!((i=e.sdkProcessingMetadata)!=null&&i.hasGenAiSpans)||t.getOptions().streamGenAiSpans===!1||it(t))return;const n=[],r=[];for(const c of e.spans)(a=c.op)!=null&&a.startsWith("gen_ai.")?n.push(ob(c)):r.push(c);if(n.length===0)return;e.spans=r;const o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},v(m({version:2},un()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}}),{items:n})]}const $c=Symbol.for("SentryBufferFullError");function Bc(e=100){const t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return Np($c);const a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return Ro(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const c=[a,new Promise(u=>yi(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}const ib=60*1e3;function qp(e,t=Ct()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?ib:r-t}function ab(e,t){return e[t]||e.all||0}function Gp(e,t,n=Ct()){return ab(e,t)>n}function Vp(e,{statusCode:t,headers:n},r=Ct()){const o=m({},e),s=n==null?void 0:n["x-sentry-rate-limits"],i=n==null?void 0:n["retry-after"];if(s)for(const a of s.trim().split(",")){const[c,u,,,d]=a.split(":",5),l=parseInt(c,10),f=(isNaN(l)?60:l)*1e3;if(!u)o.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[p]=r+f):o[p]=r+f}else i?o.all=r+qp(i,r):t===429&&(o.all=r+60*1e3);return o}const Yp=64;function cb(e,t,n=Bc(e.bufferSize||Yp)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(Dn(i,(l,f)=>{const p=tl(f);Gp(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):a.push(l)}),a.length===0)return Promise.resolve({});const c=st(i[0],a),u=l=>{if($a(c,["client_report"])){A&&S.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}Dn(c,(f,p)=>{e.recordDroppedEvent(l,tl(p))})},d=()=>t({body:$s(c)}).then(l=>l.statusCode===413?(A&&S.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(A&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&S.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Vp(r,l),l),l=>{throw u("network_error"),A&&S.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===$c)return A&&S.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:s,flush:o}}function ub(e,t,n){const r=[{type:"client_report"},{timestamp:jn(),discarded_events:e}];return st(t?{dsn:t}:{},[r])}function Jp(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch(n){}return t}function lb(e){var c,u,d;const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=(u=(c=e.contexts)==null?void 0:c.trace)!=null?u:{};return{data:i!=null?i:{},description:e.transaction,op:a,parent_span_id:n,span_id:r!=null?r:"",start_timestamp:(d=e.start_timestamp)!=null?d:0,status:o,timestamp:e.timestamp,trace_id:t!=null?t:"",origin:s,profile_id:i==null?void 0:i[wc],exclusive_time:i==null?void 0:i[_n],measurements:e.measurements,is_segment:!0}}function db(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:m(m(m({},e.data),e.profile_id&&{[wc]:e.profile_id}),e.exclusive_time&&{[_n]:e.exclusive_time})}},measurements:e.measurements}}const Vr="[Filtered]",Ko=["forwarded","-ip","remote-","via","-user"],_l=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],fb=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function pb(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0}
9,databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:Ko},httpHeaders:{request:{deny:Ko},response:{deny:Ko}},httpBodies:[],urlQueryParams:{deny:Ko},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7}}const hb={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function mb(e){var r,o,s,i,a,c,u,d,l,f,p,h,g,_,y,b,w,I,O,C,E;const t=e.dataCollection!=null?hb:pb(e.sendDefaultPii),n=(r=e.dataCollection)!=null?r:{};return{userInfo:(o=n.userInfo)!=null?o:t.userInfo,cookies:(s=n.cookies)!=null?s:t.cookies,httpHeaders:{request:(a=(i=n.httpHeaders)==null?void 0:i.request)!=null?a:t.httpHeaders.request,response:(u=(c=n.httpHeaders)==null?void 0:c.response)!=null?u:t.httpHeaders.response},httpBodies:(d=n.httpBodies)!=null?d:t.httpBodies,urlQueryParams:(f=(l=n.urlQueryParams)!=null?l:n.queryParams)!=null?f:t.urlQueryParams,graphQL:{document:(h=(p=n.graphQL)==null?void 0:p.document)!=null?h:t.graphQL.document,variables:(_=(g=n.graphQL)==null?void 0:g.variables)!=null?_:t.graphQL.variables},genAI:{inputs:(b=(y=n.genAI)==null?void 0:y.inputs)!=null?b:t.genAI.inputs,outputs:(I=(w=n.genAI)==null?void 0:w.outputs)!=null?I:t.genAI.outputs},databaseQueryData:(O=n.databaseQueryData)!=null?O:t.databaseQueryData,stackFrameVariables:(C=n.stackFrameVariables)!=null?C:t.stackFrame
9Variables,frameContextLines:(E=n.frameContextLines)!=null?E:t.frameContextLines}}const yl="Not capturing exception because it's already been captured.",Sl="Discarded session because of missing or non-string release",Kp=Symbol.for("SentryInternalError"),Xp=Symbol.for("SentryDoNotSendEventError"),gb=5e3;function gs(e){return{message:e,[Kp]:!0}}function aa(e){return{message:e,[Xp]:!0}}function bl(e){return nt(e)&&Kp in e}function El(e){return nt(e)&&Xp in e}function vl(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{var u;if(s+=r(c),s>=8e5)o(e);else if(!a){const d=(u=e.getOptions()._flushInterval)!=null?u:gb;d>0&&(a=!0,i=yi(setTimeout(()=>{o(e)},d)))}}),e.on("flush",()=>{o(e)})}class _b{constructor(t){var r,o,s,i,a,c,u,d;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Bc((o=(r=t.transportOptions)==null?void 0:r.bufferSize)!=null?o:Yp),this._dataCollection=mb(t),t.dsn?this._dsn=rp(t.dsn):A&&S.warn("No DSN provided, client will not send events."),this._dsn){const l=Fp(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport(v(m({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},t.transportOptions),{url:l}))}this._options.enableLogs=(a=(i=this._options.enableLogs)!=null?i:(s=this._options._experiments)==null?void 0:s.enableLogs)!=null?a:!0,this._options.enableLogs&&vl(this,"afterCaptureLog","flushLogs",Eb,Hp),((d=(u=this._options.enableMetrics)!=null?u:(c=this._options._experiments)==null?void 0:c.enableMetrics)==null||d)&&vl(this,"afterCaptureMetric","flushMetrics",bb,jp)}captureException(t,n,r){const o=Ae();if(Hu(t))return A&&S.log(yl),o;const s=m({event_id:o},n);return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){const s=m({event_id:Ae()},r),i=ci(t)?t:String(t),a=Tt(t),c=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>c.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=Ae();if(n!=null&&n.originalException&&Hu(n.originalException))return A&&S.log(yl),o;const s=m({event_id:o},n),i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=Tl(t.type);return this._process(()=>this._captureEvent(t,s,a||r,c),u),s.event_id}captureSession(t){this.sendSession(t),gr(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){return U(this,null,function*(){const n=this._transport;if(this.emit("flush"),!n)return!0;const r=yield this._isClientDoneProcessing(t),o=yield n.flush(t);return r&&o})}close(t){return U(this,null,function*(){const n=yield this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n})}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),$p(this,t,this._integrations),n||ml(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);const r=sb(t,this);let o=Iy(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])o=el(o,by(s));r&&(o=el(o,r)),this.sendEnvelope(o).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=Io}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){A&&S.warn(Sl);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){A&&S.warn(Sl);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=Ty(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;A&&S.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}
9sendEnvelope(t){return U(this,null,function*(){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return yield this._transport.send(t)}catch(n){return A&&S.error("Error while sending envelope:",n),{}}return A&&S.error("Transport disabled"),{}})}registerCleanup(t){}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=BS(this,t),ml(this,t)}_updateSessionFromEvent(t,n){var c,u;let r=n.level==="fatal",o=!1;const s=(c=n.exception)==null?void 0:c.values;if(s){o=!0,r=!1;for(const d of s)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(gr(t,v(m({},r&&{status:"crashed"}),{errors:t.errors||Number(o||r)})),this.captureSession(t))}_isClientDoneProcessing(t){return U(this,null,function*(){let n=0;for(;!t||n<t;){if(yield new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){const s=this.getOptions(),i=this.getIntegrationNames();return!n.integrations&&i.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Op(s,t,n,r,this,o).then(a=>{var u;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts=m({trace:m(m({},(u=a.contexts)==null?void 0:u.trace),Yf(r))},a.contexts);const c=fi(this,r);return a.sdkProcessingMetadata=m({dynamicSamplingContext:c},a.sdkProcessingMetadata),a})}_captureEvent(t,n={},r=Y(),o=Se()){return A&&Wa(t)&&S.log(`Captured error event \`${Jp(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{A&&(El(s)?S.log(s.message):bl(s)?S.warn(s.message):S.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=Qp(t),c=Wa(t),d=`before send for type \`${t.type||"error"}\``,l=typeof i=="undefined"?void 0:Ln(i),f=Tl(t.type);return this._prepareEvent(t,n,r,o).then(p=>{var _;if(p===null)throw this.recordDroppedEvent("event_processor",f),aa("An event processor returned `null`, will not send event.");if(((_=n.data)==null?void 0:_.__sentry__)===!0)return p;const g=Sb(this,s,p,n);return yb(g,d)}).then(p=>{var _;if(p===null){if(this.recordDroppedEvent("before_send",f),a){const b=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",b)}throw aa(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||o.getSession();if(c&&h&&this._updateSessionFromEvent(h,p),c&&typeof l=="number"&&$t()>l)throw this.recordDroppedEvent("sample_rate","error"),aa(`Discarding event because it's not included in the random sample (sampling rate = ${i})`);if(a){const y=((_=p.sdkProcessingMetadata)==null?void 0:_.spanCountBeforeProcessing)||0,b=p.spans?p.spans.length:0,w=y-b;w>0&&this.recordDroppedEvent("before_send","span",w)}const g=p.transaction_info;if(a&&g&&p.transaction!==t.transaction){const y="custom";p.transaction_info=v(m({},g),{source:y})}return this.sendEvent(p,n),p}).then(null,p=>{throw El(p)||bl(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),gs(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. 10Reason: ${p}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===$c&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){A&&S.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){A&&S.log("No outcomes to send");return}if(!this._dsn){A&&S.log("No dsn provided, will not send outcomes");return}A&&S.log("Sending outcomes:",t);const n=ub(t,this._options.tunnel&&At(this._dsn));this.sendEnvelope(n)}}function Tl(e){return e==="replay_event"?"replay":e||"error"}function yb(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Wn(e))return e.then(r=>{if(!He(r)&&r!==null)throw gs(n);return r},r=>{throw gs(`${t} rejected with ${r}`)});if(!He(e)&&e!==null)throw gs(n);return e}function Sb(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!pi(t.beforeSendSpan)&&t.beforeSendSpan;let c=n;if(Wa(c)&&o)return o(c,r);if(Qp(c)){if(a||i){const u=lb(c);if(i!=null&&i.length&&io({description:u.description,op:u.op,attributes:u.data},i))return null;if(a){const d=a(u);d?c=bo(n,db(d)):Ds()}if(c.spans){const d=[],l=c.spans;for(const p of l){if(i!=null&&i.length&&io({description:p.description,op:p.op,attributes:p.data},i)){hy(l,p);continue}if(a){const h=a(p);h?d.push(h):(Ds(),d.push(p))}else d.push(p)}const f=c.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),c.spans=d}}if(s){if(c.spans){const u=c.spans.length;c.sdkProcessingMetadata=v(m({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:u})}return s(c,r)}}return c}function Wa(e){return e.type===void 0}function Qp(e){return e.type==="transaction"}function bb(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Zp(e.attributes)}function Eb(e){let t=0;return e.message&&(t+=e.message.length*2),t+Zp(e.attributes)}function Zp(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Il(n[0]):Tt(n)?t+=Il(n):t+=100}),t}function Il(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function vb(e,t){t.debug===!0&&(A?S.enable():qt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Y().update(t.initialScope);const r=new e(t);return Tb(r),r.init(),r}function Tb(e){Y().setClient(e)}const ca=100,ua=5e3,Ib=36e5;function wb(e){function t(...n){A&&S.log("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const o=n.createStore(n);let s=ua,i;function a(l,f,p){return $a(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,f,p):!0}function c(l){i&&clearTimeout(i),i=yi(setTimeout(()=>U(null,null,function*(){i=void 0;const f=yield o.shift();f&&(t("Attempting to send previously queued event"),f[0].sent_at=new Date(Ct()).toISOString(),d(f,!0).catch(p=>{t("Failed to retry sending",p)}))}),l))}function u(){i||(c(s),s=Math.min(s*2,Ib))}function d(l,f=!1){return U(this,null,function*(){var p,h;if(!f&&$a(l,["replay_event","replay_recording"]))return yield o.push(l),c(ca),{};
10try{if(n.shouldSend&&(yield n.shouldSend(l))===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");const g=yield r.send(l);let _=ca;if(g){if((p=g.headers)!=null&&p["retry-after"])_=qp(g.headers["retry-after"]);else if((h=g.headers)!=null&&h["x-sentry-rate-limits"])_=6e4;else if((g.statusCode||0)>=400)return g}return c(_),s=ua,g}catch(g){if(yield a(l,g,s))return f?yield o.unshift(l):yield o.push(l),u(),t("Error sending. Event queued.",g),{};throw g}})}return n.flushAtStartup&&u(),{send:d,flush:l=>(l===void 0&&(s=ua,c(ca)),r.flush(l))}}}const la="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function eh(e,t){let n;return Dn(e,(r,o)=>(t.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function kb(e,t){return n=>{const r=e(n);return v(m({},r),{send:o=>U(null,null,function*(){const s=eh(o,["event","transaction","profile","replay_event"]);return s&&(s.release=t),r.send(o)})})}}function Rb(e,t){return st(t?v(m({},e[0]),{dsn:t}):e[0],e[1])}function aO(e,t){return n=>{const r=e(n),o=new Map,s=t||(u=>{var l;const d=u.getEvent();return(l=d==null?void 0:d.extra)!=null&&l[la]&&Array.isArray(d.extra[la])?d.extra[la]:[]});function i(u,d){const l=d?`${u}:${d}`:u;let f=o.get(l);if(!f){const p=ep(u);if(!p)return;const h=Fp(p,n.tunnel);f=d?kb(e,d)(v(m({},n),{url:h})):e(v(m({},n),{url:h})),o.set(l,f)}return[u,f]}function a(u){return U(this,null,function*(){function d(h){const g=h!=null&&h.length?h:["event"];return eh(u,g)}const l=s({envelope:u,getEvent:d}).map(h=>typeof h=="string"?i(h,void 0):i(h.dsn,h.release)).filter(h=>!!h),f=l.length?l:[["",r]];return(yield Promise.all(f.map(([h,g])=>g.send(Rb(u,h)))))[0]})}function c(u){return U(this,null,function*(){const d=[...o.values(),r];return(yield Promise.all(d.map(f=>f.flush(u)))).every(f=>f)})}return{send:a,flush:c}}}function da(e,t){return t.some(n=>e.includes(n))}function co(e,t,n){if(t===!1)return{};const r=n!=null?[..._l,...n]:_l,o={};if(t===!0){for(const i of Object.keys(e))o[i]=da(i.toLowerCase(),r)?Vr:e[i];return o}if("deny"in t){const i=t.deny.map(a=>a.toLowerCase());for(const a of Object.keys(e)){const c=a.toLowerCase(),u=da(c,r)||i.some(d=>c.includes(d));o[a]=u?Vr:e[a]}return o}const s=t.allow.map(i=>i.toLowerCase());for(const i of Object.keys(e)){const a=i.toLowerCase();if(da(a,r))o[i]=Vr;else{const c=s.some(u=>a.includes(u));o[i]=c?e[i]:Vr}}return o}function Cb(e){const t={};let n=0;for(;n<e.length;){const r=e.indexOf("=",n);if(r===-1)break;let o=e.indexOf(";",n);if(o===-1)o=e.length;else if(o<r){n=e.lastIndexOf(";",r-1)+1;continue}const s=e.slice(n,r).trim();if(t[s]===void 0){let i=e.slice(r+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{t[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch(a){t[s]=i}}n=o+1}return t}function ja(e,t){if(t===!1)return{};try{const n=Cb(e);return Object.keys(n).length===0?{}:co(n,t,fb)}catch(n){return Vr}}const Ab="thismessage:/";function Si(e){return"isRelative"in e}function uo(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Ab:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch(o){}}function th(e){if(Si(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function xn(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function nh(e){return e.split(/[?#]/,1)[0]}function pt(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&s!==-1){const a=e.slice(s+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return e}function rh(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return Nb(e,n)||Mb(e,r)}function Mb(e,t){return t?wl(e)===wl(t):!1}function Nb(e,t){const n=uo(e);return!n||Si(n)||!t?!1:xb(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function xb(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function wl(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Ob(e,...t){const n=new String(String.raw(e,...t));
10return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}const Lb=Ob;function Pb(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs=v(m({},e.attrs),{ip_address:"{{auto}}"})):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Db(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:nn})),o.version=nn)}function oh(e={}){const t=e.client||x();if(!NS()||!t)return{};const n=Rt(),r=gn(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||Y(),s=e.span||we(),i=Er(s)&&!Je(t.getOptions()),a=s&&!i?uy(s):Fb(o),c=s?_t(s):fi(t,o),u=Zf(c);if(!op.test(a))return S.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const l={"sentry-trace":a,baggage:u};return e.propagateTraceparent&&(l.traceparent=s&&!i?ly(s):$b(o)),l}function Fb(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ip(t,r,n)}function $b(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ap(t,r,n)}const Bb=100;function Wt(e,t){const n=x(),r=Se();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Bb}=n.getOptions();if(s<=0)return;const i=jn(),a=m({timestamp:i},e),c=o?qt(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,s))}const Ub="FunctionToString",kl=new WeakMap,Hb=(()=>({name:Ub,setupOnce(){const e=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=Tc(this);let r;try{kl.has(x())&&n!==void 0&&(r=n)}catch(o){}return e.apply(r!=null?r:this,t)}}catch(t){}},setup(e){kl.set(e,!0)}})),Wb=Hb,jb=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/Java exception was raised during method invocation$/,/Java object is gone$/],zb="EventFilters",qb=(e={})=>{let t;return{name:zb,setup(n){const r=n.getOptions();t=Rl(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=Rl(e,s)}return Vb(n,t)?null:n}}},Gb=((e={})=>v(m({},qb(e)),{name:"InboundFilters"}));function Rl(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:jb],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Vb(e,t){if(e.type){if(e.type==="transaction"&&Jb(e,t.ignoreTransactions))return A&&S.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. 11Event: ${wn(e)}`),!0}else{if(Yb(e,t.ignoreErrors))return A&&S.warn(`Event dropped due to being matched by \`ignoreErrors\` option. 12Event: ${wn(e)}`),!0;if(Zb(e))return A&&S.warn(`Event dropped due to not having an error message, error type or stacktrace. 13Event: ${wn(e)}`),!0;if(Kb(e,t.denyUrls))return A&&S.warn(`Event dropped due to being matched by \`denyUrls\` option. 14Event: ${wn(e)}. 15Url: ${Us(e)}`),!0;if(!Xb(e,t.allowUrls))return A&&S.warn(`Event dropped due to not being matched by \`allowUrls\` option. 16Event: ${wn(e)}. 17Url: ${Us(e)}`),!0}return!1}function Yb(e,t){return t!=null&&t.length?Jp(e).some(n=>rt(n,t)):!1}function Jb(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?rt(n,t):!1}function Kb(e,t){if(!(t!=null&&t.length))return!1;const n=Us(e);return n?rt(n,t):!1}function Xb(e,t){if(!(t!=null&&t.length))return!0;const n=Us(e);return n?rt(n,t):!0}function Qb(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Us(e){var t,n,r;try{const o=[...(n=(t=e.exception)==null?void 0:t.values)!=null?n:[]].reverse().find(i=>{var a,c,u;return((a=i.mechanism)==null?void 0:a.parent_id)===void 0&&((u=(c=i.stacktrace)==null?void 0:c.frames)==null?void 0:u.length)}),s=(r=o==null?void 0:o.stacktrace)==null?void 0:r.frames;return s?Qb(s):null}catch(o){return A&&S.error(`Cannot extract url for event ${wn(e)}`),null}}function Zb(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function eE(e,t,n,r,o,s){var a;if(!((a=o.exception)!=null&&a.values)||!s||!We(s.originalException))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=za(e,t,r,s.originalException,n,o.exception.values,i,0
17))}function za(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(We(r[o])){Cl(i,a,r);const u=e(t,r[o]),d=c.length;Al(u,o,d,a),c=za(e,t,n,r[o],o,[u,...c],u,d)}return sh(r)&&r.errors.forEach((u,d)=>{if(We(u)){Cl(i,a,r);const l=e(t,u),f=c.length;Al(l,`errors[${d}]`,f,a),c=za(e,t,n,u,o,[l,...c],l,f)}}),c}function sh(e){return Array.isArray(e.errors)}function Cl(e,t,n){e.mechanism=v(m(m({handled:!0,type:"auto.core.linked_errors"},sh(n)&&{is_exception_group:!0}),e.mechanism),{exception_id:t})}function Al(e,t,n,r){e.mechanism=v(m({handled:!0},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function tE(e){return We(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Ml(e){return tE(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}const ih=new Map,Nl=new Set;function nE(e){if(H._sentryModuleMetadata)for(const t of Object.keys(H._sentryModuleMetadata)){const n=H._sentryModuleMetadata[t];if(Nl.has(t))continue;Nl.add(t);const r=e(t);for(const o of r.reverse())if(o.filename){ih.set(o.filename,n);break}}}function rE(e,t){return nE(e),ih.get(t)}function ah(e,t){var n,r;(r=(n=t.exception)==null?void 0:n.values)==null||r.forEach(o=>{var s,i;(i=(s=o.stacktrace)==null?void 0:s.frames)==null||i.forEach(a=>{if(!a.filename||a.module_metadata)return;const c=rE(e,a.filename);c&&(a.module_metadata=c)})})}function ch(e){var t,n;(n=(t=e.exception)==null?void 0:t.values)==null||n.forEach(r=>{var o,s;(s=(o=r.stacktrace)==null?void 0:o.frames)==null||s.forEach(i=>{delete i.module_metadata})})}const cO=()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",t=>{Dn(t,(n,r)=>{if(r==="event"){const o=Array.isArray(n)?n[1]:void 0;o&&(ch(o),n[1]=o)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;const n=e.getOptions().stackParser;ah(n,t)})}}),xl=new Set([]);function Uc(e){const t="console",n=hn(t,e);return mn(t,oE),n}const Ol=new Set;function oE(){"console"in H&&Sc.forEach(function(e){Ol.has(e)||!(e in H.console)||(Ol.add(e),Oe(H.console,e,function(t){return Ms[e]=t,function(...n){const r=n[0],o=Ms[e],s=xl.size&&typeof r=="string"&&rt(r,xl);s||tt("console",{args:n,level:e}),(!s||A&&S.isEnabled())&&(o==null||o.apply(H.console,n))}}))})}function Hs(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const sE="CaptureConsole",iE=((e={})=>{var r;const t=e.levels||Sc,n=(r=e.handled)!=null?r:!0;return{name:sE,setup(o){"console"in H&&Uc(({args:s,level:i})=>{x()!==o||!t.includes(i)||aE(s,i,n)})}}}),uO=iE;function aE(e,t,n){const r=Hs(t),o=new Error,s={level:Hs(t),extra:{arguments:e}};ot(i=>{if(i.addEventProcessor(u=>(u.logger="console",bt(u,{handled:n,type:"auto.core.capture_console"}),u)),t==="assert"){if(!e[0]){const u=`Assertion failed: ${Ns(e.slice(1)," ")||"console.assert"}`;i.setExtra("arguments",e.slice(1)),i.captureMessage(u,r,{captureContext:s,syntheticException:o})}return}const a=e.find(u=>u instanceof Error);if(a){kt(a,s);return}const c=Ns(e," ");i.captureMessage(c,r,{captureContext:s,syntheticException:o})})}const cE="Dedupe",uE=(()=>{let e;return{name:cE,processEvent(t){if(t.type)return t;try{if(dE(t,e))return A&&S.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}return e=t}}}),lE=uE;function dE(e,t){return t?!!(fE(e,t)||pE(e,t)):!1}function fE(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!lh(e,t)||!uh(e,t))}function pE(e,t){const n=Ll(t),r=Ll(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!lh(e,t)||!uh(e,t))}function uh(e,t){let n=Na(e),r=Na(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const s=r[o],i=n[o];if(s.filename!==i.filename||s.lineno!==i.lineno||s.colno!==i.colno||s.function!==i.function)return!1}return!0}function lh(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch(o){return!1}}function Ll(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const hE="ExtraErrorData",mE=((e={})=>{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:hE,processEvent(r,o,s){const{maxValueLength:i}=s.getOptions();return gE(r,o,t,n,i)}}}),lO=mE;function gE(e,t={},n,r,o){if(!t.originalException||!We(t.originalException))return e;const s=t.originalException.name||t.originalException.constructor.name,i=dh(t.originalException,r,o);if(i){const a=m({},e.contexts),c=Ce(i,n);return He(c)&&(a_(c),a[s]=c),v(m({},e),{contexts:a})}return e}
17function dh(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(const s of Object.keys(e)){if(r.indexOf(s)!==-1)continue;const i=e[s];o[s]=We(i)||typeof i=="string"?n?oo(`${i}`,n):`${i}`:i}if(t&&e.cause!==void 0)if(We(e.cause)){const s=e.cause.name||e.cause.constructor.name;o.cause={[s]:dh(e.cause,!1,n)}}else o.cause=e.cause;if(typeof e.toJSON=="function"){const s=e.toJSON();for(const i of Object.keys(s)){const a=s[i];o[i]=We(a)?a.toString():a}}return o}catch(r){A&&S.error("Unable to extract extra data from the Error object:",r)}return null}function _E(e,t){let n=0;for(let r=e.length-1;r>=0;r--){const o=e[r];o==="."?e.splice(r,1):o===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}const yE=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function SE(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=yE.exec(t);return n?n.slice(1):[]}function Pl(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){const o=r>=0?e[r]:"/";o&&(t=`${o}/${t}`,n=o.charAt(0)==="/")}return t=_E(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Dl(e){let t=0;for(;t<e.length&&e[t]==="";t++);let n=e.length-1;for(;n>=0&&e[n]==="";n--);return t>n?[]:e.slice(t,n-t+1)}function bE(e,t){e=Pl(e).slice(1),t=Pl(t).slice(1);const n=Dl(e.split("/")),r=Dl(t.split("/")),o=Math.min(n.length,r.length);let s=o;for(let a=0;a<o;a++)if(n[a]!==r[a]){s=a;break}let i=[];for(let a=s;a<n.length;a++)i.push("..");return i=i.concat(r.slice(s)),i.join("/")}function EE(e,t){return SE(e)[2]||""}const vE="RewriteFrames",dO=(e={})=>{const t=e.root,n=e.prefix||"app:///",r="window"in H&&!!H.window,o=e.iteratee||TE({isBrowser:r,root:t,prefix:n});function s(a){try{return v(m({},a),{exception:v(m({},a.exception),{values:a.exception.values.map(c=>m(m({},c),c.stacktrace&&{stacktrace:i(c.stacktrace)}))})})}catch(c){return a}}function i(a){var c;return v(m({},a),{frames:(c=a==null?void 0:a.frames)==null?void 0:c.map(u=>o(u))})}return{name:vE,processEvent(a){let c=a;return a.exception&&Array.isArray(a.exception.values)&&(c=s(c)),c}}};function TE({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;const o=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),s=/^\//.test(r.filename);if(e){if(t){const i=r.filename;i.indexOf(t)===0&&(r.filename=i.replace(t,n))}}else if(o||s){const i=o?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=t?bE(t,i):EE(i);r.filename=`${n}${a}`}return r}}const IE=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],wE=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],kE={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},fh=["select","insert","upsert","update","delete"];function bi(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch(t){}}function Ei(e){try{return e.__SENTRY_INSTRUMENTED__}catch(t){return!1}}function ph(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function RE(e,t){return ph(e,t)!==void 0}function hh(e,t){var s;if(!e)return;if(typeof e.get=="function")return(s=e.get(t))!=null?s:void 0;const n=e,r=t.toLowerCase(),o=Object.keys(n).find(i=>i.toLowerCase()===r);return o!==void 0?n[o]:void 0}function CE(e,t={}){var n;switch(e){case"GET":return"select";case"POST":return(n=hh(t,"Prefer"))!=null&&n.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function AE(e,t){if(t===""||t==="*")return"select(*)";if(e==="select")return`select(${t})`;if(e==="or"||e.endsWith(".or"))return`${e}${t}`;const[n,...r]=t.split(".");let o;return n!=null&&n.startsWith("fts")?o="textSearch":n!=null&&n.startsWith("plfts")?o="textSearch[plain]":n!=null&&n.startsWith("phfts")?o="textSearch[phrase]":n!=null&&n.startsWith("wfts")?o="textSearch[websearch]":o=n&&kE[n]||"filter",`${o}(${e}, ${r.join(".")})`}function Fl(e,t=!1){return new Proxy(e,{apply(n,r,o){return Gt({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[ue]:"auto.db.supabase",[ve]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},s=>Reflect.apply(n,r,o).then(i=>(nt(i)&&"error"in i&&i.error?(s.setStatus({code:ie}),kt(i.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):s.setStatus({code:To}),s.end(),i)).catch(i=>{throw s.setStatus({code:ie}),s.end(),kt(i,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),i}).then(...o))}})}function ME(e){const t=e.auth;if(!(!t||Ei(e.auth))){for(const n of IE){const r=t[n];r&&typeof e.auth[n]=="function"&&(e.auth[n]=Fl(r))}for(const n of wE){const r=t.admin[n];r&&typeof e.auth.admin[n]=="function"&&(e.auth.admin[n]=Fl(r,!0))}bi(e.auth)}}function NE(e,t){Ei(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(n,r,o){const s=Reflect.apply(n,r,o),i=s.constructor;return OE(i,t),s}}),bi(e.prototype.from))}function xE(e,t){Ei(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(n,r,o){var I,O;const s=fh,i=r,a=CE(i.method,i.headers);if(!s.includes(a)||!((I=i==null?void 0:i.url)!=null&&I.pathname)||typeof i.url.pathname!="string")return Reflect.apply(n,r,o);const c=i.url.pathname.split("/"),u=c.length>0?c[c.length-1]:"",d=[];
17for(const[C,E]of i.url.searchParams.entries())d.push(AE(C,E));const l=Object.create(null);if(He(i.body))for(const[C,E]of Object.entries(i.body))l[C]=E;const f=x(),p=(O=t.sendOperationData)!=null?O:(f==null?void 0:f.getDataCollectionOptions().databaseQueryData)===!0,h=ph(i.body,l),g=a==="select"?"":`${a}${RE(i.body,l)?"(...) ":""}`,_=p?d.join(" "):d.length>0?"[redacted]":"",y=[g.trimEnd(),_].filter(Boolean).join(" "),b=y?`${y} from(${u})`:`from(${u})`,w={"db.table":u,"db.schema":i.schema,"db.url":i.url.origin,"db.sdk":hh(i.headers,"X-Client-Info"),"db.system":"postgresql","db.operation":a,[ue]:"auto.db.supabase",[ve]:"db"};return d.length&&p&&(w["db.query"]=d),h!==void 0&&p&&(w["db.body"]=h),Gt({name:b,attributes:w},C=>Reflect.apply(n,r,[]).then(E=>{if(C&&(E&&typeof E=="object"&&"status"in E&&xs(C,E.status||500),C.end()),E!=null&&E.error){const T=new Error(E.error.message);E.error.code&&(T.code=E.error.code),E.error.details&&(T.details=E.error.details);const P={};d.length&&p&&(P.query=d),h!==void 0&&p&&(P.body=h),kt(T,M=>(M.addEventProcessor(D=>(bt(D,{handled:!1,type:"auto.db.supabase.postgres"}),D)),M.setContext("supabase",P),M))}const F={type:"supabase",category:`db.${a}`,message:b},k={};return d.length&&p&&(k.query=d),h!==void 0&&p&&(k.body=h),Object.keys(k).length&&(F.data=k),Wt(F),E},E=>{throw C&&(xs(C,500),C.end()),E}).then(...o))}}),bi(e.prototype.then))}function OE(e,t){for(const n of fh)Ei(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(r,o,s){const i=Reflect.apply(r,o,s),a=i.constructor;return A&&S.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),xE(a,t),i}}),bi(e.prototype[n]))}const LE=(e,t={})=>{if(!e){A&&S.warn("Supabase integration was not installed because no Supabase client was provided.");return}const n=e.constructor===Function?e:e.constructor;NE(n,t),ME(e)},PE="Supabase",DE=((e,t)=>({setupOnce(){LE(e,t)},name:PE})),fO=e=>DE(e.supabaseClient,{sendOperationData:e.sendOperationData}),FE=10,$E="ZodErrors";function BE(e){return We(e)&&e.name==="ZodError"&&Array.isArray(e.issues)}function UE(e){return v(m({},e),{path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0})}function HE(e){return e.map(t=>typeof t=="number"?"<array>":t).join(".")}function WE(e){const t=new Set;for(const r of e.issues){const o=HE(r.path);o.length>0&&t.add(o)}const n=Array.from(t);if(n.length===0){let r="variable";if(e.issues.length>0){const o=e.issues[0];o!==void 0&&"expected"in o&&typeof o.expected=="string"&&(r=o.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${oo(n.join(", "),100)}`}function jE(e,t=!1,n,r){var o;if(!((o=n.exception)!=null&&o.values)||!r.originalException||!BE(r.originalException)||r.originalException.issues.length===0)return n;try{const i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(UE);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:i})})),v(m({},n),{exception:v(m({},n.exception),{values:[v(m({},n.exception.values[0]),{value:WE(r.originalException)}),...n.exception.values.slice(1)]}),extra:v(m({},n.extra),{"zoderror.issues":i.slice(0,e)})})}catch(s){return v(m({},n),{extra:v(m({},n.extra),{"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:s instanceof Error?`${s.name}: ${s.message} 18${s.stack}`:"unknown"}})})}}const zE=((e={})=>{var n;const t=(n=e.limit)!=null?n:FE;return{name:$E,processEvent(r,o){return jE(t,e.saveZodIssuesAsAttachment,r,o)}}}),pO=zE,hO=e=>({name:"ThirdPartyErrorsFilter",setup(t){t.on("beforeEnvelope",n=>{Dn(n,(r,o)=>{if(o==="event"){const s=Array.isArray(r)?r[1]:void 0;s&&(ch(s),r[1]=s)}})}),t.on("applyFrameMetadata",n=>{if(n.type)return;const r=t.getOptions().stackParser;ah(r,n)})},preprocessEvent(t){var n;e.ignoreSentryInternalFrames&&((n=H._sentryWrappedDepth)!=null?n:0)>0&&(t.sdkProcessingMetadata=v(m({},t.sdkProcessingMetadata),{insideSentryWrapped:!0}))},processEvent(t){var o,s,i;const n=e.ignoreSentryInternalFrames?((o=t.sdkProcessingMetadata)==null?void 0:o.insideSentryWrapped)===!0&&((i=(s=t.exception)==null?void 0:s.values)==null?void 0:i.length)===1:!1,r=GE(t,e.ignoreSentryInternalFrames,n);if(r){const a=e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(r[a](u=>!u.some(d=>e.filterKeys.includes(d)))){if(e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;t.tags=v(m({},t.tags),{third_party_code:!0})}}return t}});
18function qE(e,t,n){var r;if(t!==0)return!1;if(n&&VE(e)||e.function==="sentryWrapped")return!0;if(!e.context_line||!e.filename||!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(JE))return!1;if(e.pre_context){const o=e.pre_context.length;for(let s=0;s<o;s++)if((r=e.pre_context[s])!=null&&r.includes(YE))return!0}return!1}function GE(e,t,n){const r=Na(e);if(r)return r.filter((o,s)=>!o.filename||o.lineno==null&&o.colno==null&&o.instruction_addr==null?!1:!t||!qE(o,s,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(s=>s.startsWith($l)).map(s=>s.slice($l.length)):[])}function VE(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}const $l="_sentryBundlerPluginAppKey:",YE="Attempt to invoke user-land function",JE="fn.apply(this, wrappedArguments)",KE=100,XE=10,Xo="flag.evaluation.";function Pr(e){if(e.type)return e;const n=Y().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...r]}),e}function Fn(e,t,n=KE){const r=Y().getScopeData().contexts;r.flags||(r.flags={values:[]});const o=r.flags.values;QE(o,e,t,n)}function QE(e,t,n,r){if(typeof n!="boolean")return;if(e.length>r){A&&S.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}const o=e.findIndex(s=>s.flag===t);o!==-1&&e.splice(o,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function $n(e,t,n=XE){if(typeof t!="boolean")return;const r=we();if(!r)return;const o=Q(r).data;if(`${Xo}${e}`in o){r.setAttribute(`${Xo}${e}`,t);return}Object.keys(o).filter(i=>i.startsWith(Xo)).length<n&&r.setAttribute(`${Xo}${e}`,t)}const mO=()=>({name:"FeatureFlags",processEvent(e,t,n){return Pr(e)},addFeatureFlag(e,t){Fn(e,t),$n(e,t)}}),ZE=({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){const t=e.prototype;typeof t.isOn=="function"&&Oe(t,"isOn",Bl),typeof t.getFeatureValue=="function"&&Oe(t,"getFeatureValue",Bl)},processEvent(t,n,r){return Pr(t)}});function Bl(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"&&(Fn(n,r),$n(n,r)),r}}const ev="ConversationId",tv=(()=>({name:ev,setup(e){e.on("spanStart",t=>{const n=Y().getScopeData(),r=Se().getScopeData(),o=n.conversationId||r.conversationId;if(o){const{op:s,data:i,description:a}=Q(t);if(!(s!=null&&s.startsWith("gen_ai."))&&!i["ai.operationId"]&&!(a!=null&&a.startsWith("ai.")))return;t.setAttribute(q_,o)}})}})),nv=tv;function rv(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=Je()&&t(i);if(e.endTimestamp){const g=e.fetchData.__span;if(!g)return;const _=r[g];_&&(a&&(iv(_,e),ov(_,e,o)),delete r[g]);return}const{spanOrigin:c="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},d=x(),l=!!we(),f=l||!!d&&it(d),p=a&&f?yn(uv(i,s,c)):new Pn,h=gi(p)&&l?void 0:p;if(a&&!f&&(d==null||d.recordDroppedEvent("no_parent_span","span")),e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){const g=e.args[0],_=m({},e.args[1]||{}),y=sv(g,_,Je()&&f?h:void 0,u);y&&(e.args[1]=_,_.headers=y)}if(d){const g={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};d.emit("beforeOutgoingRequestSpan",p,g)}return p}function ov(e,t,n){var o;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(o=t.response)==null?void 0:o.headers,error:t.error})}function sv(e,t,n,r){const o=oh({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const c=t.headers||(vc(e)?e.headers:void 0);if(c)if(av(c)){const u=new Headers(c);if(u.get("sentry-trace")||u.set("sentry-trace",s),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),i){const d=u.get("baggage");d?Qo(d)||u.set("baggage",`${d},${i}`):u.set("baggage",i)}return u}else if(cv(c)){const u=[...c];u.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",s]),r&&a&&!u.find(l=>l[0]==="traceparent")&&u.push(["traceparent",a]);const d=c.find(l=>l[0]==="baggage"&&typeof l[1]=="string"&&Qo(l[1]));return i&&!d&&u.push(["baggage",i]),u}else{const u="sentry-trace"in c?c["sentry-trace"]:void 0,d="traceparent"in c?c.traceparent:void 0,l="baggage"in c?c.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(g=>Qo(g)):Qo(l));i&&!p&&f.push(i);const h=Object.assign({},c,m({"sentry-trace":u!=null?u:s},f.length>0&&{baggage:f.join(",")}));return r&&a&&!d&&(h.traceparent=a),h}else return m(m({"sentry-trace":s},i&&{baggage:i}),a&&{traceparent:a})}function iv(e,t){var n,r;if(t.response){xs(e,t.response.status);const o=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(o){const s=parseInt(o);s>0&&e.setAttribute("http.response_content_length",s)}}else t.error&&e.setStatus({code:ie,message:"internal_error"});e.end()}function Qo(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(Os))}function av(e){return typeof Headers!="undefined"&&li(e,Headers)}function cv(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function uv(e,t,n){if(e.startsWith("data:")){const s=pt(e);return{name:`${t} ${s}`,attributes:Ul(e,void 0,t,n)}}const r=uo(e),o=r?th(r):e;return{name:`${t} ${o}`,attributes:Ul(e,r,t,n)}}function Ul(e,t,n,r){const o={url:pt(e),type:"fetch","http.method":n,[ue]:r,[ve]:"http.client"};return t&&(Si(t)||(o[Ap]=pt(t.href),o[qn]=pt(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function lv(e,t={},n=Y()){const{message:r,name:o,email:s,url:i,source:a,associatedEventId:c,tags:u}=e,d={contexts:{feedback:{contact_email:s,name:o,message:r,url:i,source:a,associated_event_id:c}},type:"feedback",level:"info",tags:u},l=(n==null?void 0:n.getClient())||x();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function Dr(e,t,n,r,o){Bs({level:e,message:t,attributes:n,severityNumber:o},r)}function dv(e,t,{scope:n}={}){Dr("trace",e,t,n)}function fv(e,t,{scope:n}={}){Dr("debug",e,t,n)}function pv(e,t,{scope:n}={}){Dr("info",e,t,n)}function hv(e,t,{scope:n}={}){Dr("warn",e,t,n)}function mv(e,t,{scope:n}={}){Dr("error",e,t,n)}
18function gv(e,t,{scope:n}={}){Dr("fatal",e,t,n)}const gO=Object.freeze(Object.defineProperty({__proto__:null,debug:fv,error:mv,fatal:gv,fmt:Lb,info:pv,trace:dv,warn:hv},Symbol.toStringTag,{value:"Module"}));function Ws(e,t,n){return"util"in H&&typeof H.util.format=="function"?H.util.format(...e):_v(e,t,n)}function _v(e,t,n){return e.map(r=>Tt(r)?String(r):JSON.stringify(Ce(r,t,n))).join(" ")}function mh(e){return/%[sdifocO]/.test(e)}function gh(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((o,s)=>{n[`sentry.message.parameter.${s}`]=o}),n}const yv="ConsoleLogs",Hl={[ue]:"auto.log.console"},Sv=((e={})=>{const t=e.levels||Sc;return{name:yv,setup(n){const{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=n.getOptions();if(!r){A&&S.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}const i=Uc(({args:a,level:c})=>{if(x()!==n||!t.includes(c))return;const u=a[0],d=a.slice(1);if(c==="assert"){if(!u){const p=d.length>0?`Assertion failed: ${Ws(d,o,s)}`:"Assertion failed";Bs({level:"error",message:p,attributes:Hl})}return}const l=c==="log",f=m({},Hl);if(He(u)){Object.assign(f,Ce(u,o,s));const p=typeof a[1]=="string"?2:1;a.slice(p).forEach((g,_)=>{f[`sentry.message.parameter.${_}`]=Ce(g,o,s)})}else if(d.length>0&&typeof u=="string"&&!mh(u)){const h=gh(u,d);for(const[g,_]of Object.entries(h))f[g]=g.startsWith("sentry.message.parameter.")?Ce(_,o,s):_}Bs({level:l?"info":c,message:Ws(a,o,s),severityNumber:l?10:void 0,attributes:f})});n.registerCleanup(i)}}}),_O=Sv;function Hc(e,t,n,r){rb({type:e,name:t,value:n,unit:r==null?void 0:r.unit,attributes:r==null?void 0:r.attributes},{scope:r==null?void 0:r.scope})}function bv(e,t=1,n){Hc("counter",e,t,n)}function Ev(e,t,n){Hc("gauge",e,t,n)}function qa(e,t,n){Hc("distribution",e,t,n)}const yO=Object.freeze(Object.defineProperty({__proto__:null,count:bv,distribution:qa,gauge:Ev},Symbol.toStringTag,{value:"Module"})),vv=["trace","debug","info","warn","error","fatal"];function SO(e={}){var r;const t=new Set((r=e.levels)!=null?r:vv),n=e.client;return{log(o){const b=o,{type:s,level:i,message:a,args:c,tag:u,date:d}=b,l=vn(b,["type","level","message","args","tag","date"]),f=n||x();if(!f)return;const p=wv(s,i);if(!t.has(p))return;const{normalizeDepth:h=3,normalizeMaxBreadth:g=1e3}=f.getOptions(),_={};for(const[w,I]of Object.entries(l))_[w]=Ce(I,h,g);_["sentry.origin"]="auto.log.consola",u&&(_["consola.tag"]=u),s&&(_["consola.type"]=s),i!=null&&typeof i=="number"&&(_["consola.level"]=i);const y=Rv(kv(c,h,g),h,g);y!=null&&y.attributes&&Object.assign(_,y.attributes),Bs({level:p,message:(y==null?void 0:y.message)||a||c&&Ws(c,h,g)||"",attributes:_})}}}const Tv={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},Iv={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function wv(e,t){if(e==="verbose")return"debug";if(e==="silent")return"trace";if(e){const n=Tv[e];if(n)return n}if(typeof t=="number"){const n=Iv[t];if(n)return n}return"info"}function kv(e,t,n){if(!(e!=null&&e.length))return{message:""};const r=Ws(e,t,n),o=e[0];if(He(o)){const s=typeof e[1]=="string"?2:1,i=e.slice(s);return{message:r,attributes:o,messageParameters:i}}else{const s=e.slice(1),i=s.length>0&&typeof o=="string"&&!mh(o);return{message:r,messageTemplate:i?o:void 0,messageParameters:i?s:void 0}}}function Rv(e,t,n){const{message:r,attributes:o,messageTemplate:s,messageParameters:i}=e,a={};if(s&&i){const c=gh(s,i);for(const[u,d]of Object.entries(c))a[u]=u.startsWith("sentry.message.parameter.")?Ce(d,t,n):d}else i&&i.length>0&&i.forEach((c,u)=>{a[`sentry.message.parameter.${u}`]=Ce(c,t,n)});return{message:r,attributes:m(m({},Ce(o,t,n)),a)}}const Cv="gen_ai.prompt",Ao="gen_ai.system",Le="gen_ai.request.model",Wc="gen_ai.request.stream",vi="gen_ai.request.temperature",jc="gen_ai.request.max_tokens",Ti="gen_ai.request.frequency_penalty",zc="gen_ai.request.presence_penalty",Ii="gen_ai.request.top_p",_h="gen_ai.request.top_k",yh="gen_ai.request.encoding_format",Sh="gen_ai.request.dimensions",fr="gen_ai.response.finish_reasons",Fr="gen_ai.response.model",wi="gen_ai.response.id",Av="gen_ai.response.stop_reason",Bn="gen_ai.usage.input_tokens",Un="gen_ai.usage.output_tokens",ln="gen_ai.usage.total_tokens",ht="gen_ai.operation.name",Hn="sentry.sdk_meta.gen_ai.input.messages.original_length",$r="gen_ai.input.messages",Mo="gen_ai.system_instructions",Et="gen_ai.response.text",No="gen_ai.request.available_tools",Mv="gen_ai.response.streaming",rn="gen_ai.response.tool_calls",ki="gen_ai.agent.name",Nv="gen_ai.pipeline.name",qc="gen_ai.conversation.id",xv="gen_ai.usage.cache_creation_input_tokens",Ov="gen_ai.usage.cache_read_input_tokens",Lv="gen_ai.invoke_agent",Gc="gen_ai.embeddings.input",bh="gen_ai.embeddings",Wl="gen_ai.execute_tool",Eh="gen_ai.tool.name",Pv="gen_ai.tool.call.id",Dv="gen_ai.tool.type",vh="gen_ai.tool.input",Th="gen_ai.tool.output",Fv="gen_ai.tool.description";function pr(e){return!e||typeof e!="object"?!1:Bv(e)||wh(e)||$v(e)||kh(e)||Rh(e)||Uv(e)||Hv(e)||Wv(e)||jv(e)||zv(e)||qv(e)||Gv(e)}function $v(e){return"image_url"in e?typeof e.image_url=="string"?e.image_url.startsWith("data:"):Ih(e):!1}function Ih(e){return"image_url"in e&&!!e.image_url&&typeof e.image_url=="object"&&"url"in e.image_url&&typeof e.image_url.url=="string"&&e.image_url.url.startsWith("data:")}function Bv(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&pr(e.source)}function wh(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="str
18ing"}function kh(e){return"type"in e&&e.type==="input_audio"&&"input_audio"in e&&!!e.input_audio&&typeof e.input_audio=="object"&&"data"in e.input_audio&&typeof e.input_audio.data=="string"}function Rh(e){return"type"in e&&e.type==="file"&&"file"in e&&!!e.file&&typeof e.file=="object"&&"file_data"in e.file&&typeof e.file.file_data=="string"}function Uv(e){return"media_type"in e&&typeof e.media_type=="string"&&"data"in e}function Hv(e){return"type"in e&&e.type==="file"&&"mediaType"in e&&typeof e.mediaType=="string"&&"data"in e&&typeof e.data=="string"&&!e.data.startsWith("http://")&&!e.data.startsWith("https://")}function Wv(e){return"type"in e&&e.type==="image"&&"image"in e&&typeof e.image=="string"&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}function jv(e){return"type"in e&&(e.type==="blob"||e.type==="base64")}function zv(e){return"b64_json"in e}function qv(e){return"type"in e&&"result"in e&&e.type==="image_generation"}function Gv(e){return"uri"in e&&typeof e.uri=="string"&&e.uri.startsWith("data:")}const jr="[Blob substitute]",Vv=["image_url","data","content","b64_json","result","uri","image"];function Qr(e){const t=m({},e);pr(t.source)&&(t.source=Qr(t.source)),wh(e)&&(t.inlineData=v(m({},e.inlineData),{data:jr})),Ih(e)&&(t.image_url=v(m({},e.image_url),{url:jr})),kh(e)&&(t.input_audio=v(m({},e.input_audio),{data:jr})),Rh(e)&&(t.file=v(m({},e.file),{file_data:jr}));for(const n of Vv)typeof t[n]=="string"&&(t[n]=jr);return t}const Ch=2e4,js=e=>new TextEncoder().encode(e).length,Vc=e=>js(JSON.stringify(e));function Ri(e,t){if(js(e)<=t)return e;let n=0,r=e.length,o="";for(;n<=r;){const s=Math.floor((n+r)/2),i=e.slice(0,s);js(i)<=t?(o=i,n=s+1):r=s-1}return o}function Yv(e){return typeof e=="string"?e:"text"in e&&typeof e.text=="string"?e.text:""}function jl(e,t){return typeof e=="string"?t:v(m({},e),{text:t})}function Jv(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function Ah(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function Mh(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function Kv(e,t){const n=v(m({},e),{content:""}),r=Vc(n),o=t-r;if(o<=0)return[];const s=Ri(e.content,o);return[v(m({},e),{content:s})]}function Xv(e){return"parts"in e&&Array.isArray(e.parts)?{key:"parts",items:e.parts}:"content"in e&&Array.isArray(e.content)?{key:"content",items:e.content}:{key:null,items:[]}}function Qv(e,t){const{key:n,items:r}=Xv(e);if(n===null||r.length===0)return[];const o=r.map(c=>jl(c,"")),s=Vc(v(m({},e),{[n]:o}));let i=t-s;if(i<=0)return[];const a=[];for(const c of r){const u=Yv(c),d=js(u);if(d<=i)a.push(c),i-=d;else if(a.length===0){const l=Ri(u,i);l&&a.push(jl(c,l));break}else break}return a.length<=0?[]:[v(m({},e),{[n]:a})]}function Zv(e,t){if(!e)return[];if(typeof e=="string"){const n=Ri(e,t);return n?[n]:[]}return typeof e!="object"?[]:Jv(e)?Kv(e,t):Ah(e)||Mh(e)?Qv(e,t):[]}function Ga(e){return e.map(n=>{let r;return n&&typeof n=="object"&&(Ah(n)?r=v(m({},n),{content:Ga(n.content)}):"content"in n&&pr(n.content)&&(r=v(m({},n),{content:Qr(n.content)})),Mh(n)&&(r=v(m({},r!=null?r:n),{parts:Ga(n.parts)})),pr(r)?r=Qr(r):pr(n)&&(r=Qr(n))),r!=null?r:n})}function eT(e,t){if(!Array.isArray(e)||e.length===0)return e;const n=t-2,r=e[e.length-1],o=Ga([r]),s=o[0];return Vc(s)<=n?o:Zv(s,n)}function tT(e){return eT(e,Ch)}function nT(e){return Ri(e,Ch)}function Gn(e){var n,r,o,s,i;const t=(n=x())==null?void 0:n.getDataCollectionOptions().genAI;return v(m({},e),{recordInputs:(o=(r=e==null?void 0:e.recordInputs)!=null?r:t==null?void 0:t.inputs)!=null?o:!1,recordOutputs:(i=(s=e==null?void 0:e.recordOutputs)!=null?s:t==null?void 0:t.outputs)!=null?i:!1})}function jt(e){if(e!==void 0)return e;const t=x();return t?!it(t)&&t.getOptions().streamGenAiSpans===!1:!0}function Nh(e,t){return e?`${e}.${t}`:t}function rT(e,t,n,r,o){if(t!==void 0&&e.setAttributes({[Bn]:t}),n!==void 0&&e.setAttributes({[Un]:n}),t!==void 0||n!==void 0||r!==void 0||o!==void 0){const s=(t!=null?t:0)+(n!=null?n:0)+(r!=null?r:0)+(o!=null?o:0);e.setAttributes({[ln]:s})}}function Ci(e,t,n){var o,s,i,a;
18if(!e.isRecording())return;const r={[Mv]:!0};t.responseId&&(r[wi]=t.responseId),t.responseModel&&(r[Fr]=t.responseModel),t.promptTokens!==void 0&&(r[Bn]=t.promptTokens),t.completionTokens!==void 0&&(r[Un]=t.completionTokens),t.totalTokens!==void 0?r[ln]=t.totalTokens:(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[ln]=((o=t.promptTokens)!=null?o:0)+((s=t.completionTokens)!=null?s:0)+((i=t.cacheCreationInputTokens)!=null?i:0)+((a=t.cacheReadInputTokens)!=null?a:0)),t.finishReasons.length&&(r[fr]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[Et]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[rn]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function Br(e){if(typeof e=="string")return nT(e);try{return JSON.stringify(Array.isArray(e)?tT(e):e)}catch(t){return"[unserializable]"}}function xo(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};const t=e.findIndex(i=>i&&typeof i=="object"&&"role"in i&&i.role==="system");if(t===-1)return{systemInstructions:void 0,filteredMessages:e};const n=e[t],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:e};const o=JSON.stringify([{type:"text",content:r}]),s=[...e.slice(0,t),...e.slice(t+1)];return{systemInstructions:o,filteredMessages:s}}function oT(e,t){return U(this,null,function*(){const[n,r]=yield Promise.all([t,e]);return r&&typeof r=="object"&&"data"in r?v(m({},r),{data:n}):n})}function zs(e,t){return Wn(e)?new Proxy(e,{get(n,r){const s=r in Promise.prototype||r===Symbol.toStringTag?t:n,i=Reflect.get(s,r);return r==="withResponse"&&typeof i=="function"?function(){const c=i.call(n);return oT(c,t)}:typeof i=="function"?i.bind(s):i}}):t}const sT={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},iT=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],aT=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...iT];function cT(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function uT(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function lT(e,t,n){var s,i;if(!t||typeof t!="object")return;const r=t,o={};if(typeof r.id=="string"&&(o[wi]=r.id),typeof r.model=="string"&&(o[Fr]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[qc]=r.id),r.usage&&typeof r.usage=="object"){const a=r.usage,c=(s=a.prompt_tokens)!=null?s:a.input_tokens;typeof c=="number"&&(o[Bn]=c);const u=(i=a.completion_tokens)!=null?i:a.output_tokens;typeof u=="number"&&(o[Un]=u),typeof a.total_tokens=="number"&&(o[ln]=a.total_tokens)}if(Array.isArray(r.choices)){const a=r.choices,c=a.map(u=>u.finish_reason).filter(u=>typeof u=="string");if(c.length>0&&(o[fr]=JSON.stringify(c)),n){const u=a.map(l=>{const f=l.message;return(f==null?void 0:f.content)||""});o[Et]=JSON.stringify(u);const d=a.map(l=>{const f=l.message;return f==null?void 0:f.tool_calls}).filter(l=>Array.isArray(l)&&l.length>0).flat();d.length>0&&(o[rn]=JSON.stringify(d))}}if(typeof r.status=="string"&&(o[fr]||(o[fr]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[Et]&&(o[Et]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!o[rn])){const a=r.output.filter(c=>(c==null?void 0:c.type)==="function_call");a.length>0&&(o[rn]=JSON.stringify(a))}e.setAttributes(o)}function dT(e){if("conversation"in e&&typeof e.conversation=="string")return e.conversation;if("previous_response_id"in e&&typeof e.previous_response_id=="string")return e.previous_response_id}function fT(e){var r;const t={[Le]:(r=e.model)!=null?r:"unknown"};"temperature"in e&&(t[vi]=e.temperature),"top_p"in e&&(t[Ii]=e.top_p),"frequency_penalty"in e&&(t[Ti]=e.frequency_penalty),"presence_penalty"in e&&(t[zc]=e.presence_penalty),"stream"in e&&(t[Wc]=e.stream),"encoding_format"in e&&(t[yh]=e.encoding_format),"dimensions"in e&&(t[Sh]=e.dimensions);const n=dT(e);return n&&(t[qc]=n),t}function pT(e,t){for(const n of e){const r=n.index;if(!(r===void 0||!n.function))if(!(r in t.chatCompletionToolCalls))t.chatCompletionToolCalls[r]=v(m({},n),{function:{name:n.function.name,arguments:n.function.arguments||""}});else{const o=t.chatCompletionToolCalls[r];n.function.arguments&&(o!=null&&o.function)&&(o.function.arguments+=n.function.arguments)}}}function hT(e,t,n){var r,o,s,i,a;t.responseId=(r=e.id)!=null?r:t.responseId,t.responseModel=(o=e.model)!=null?o:t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(const c of(s=e.choices)!=null?s:[])n&&((i=c.delta)!=null&&i.content&&t.responseTexts.push(c.delta.content),(a=c.delta)!=null&&a.tool_calls&&pT(c.delta.tool_calls,t)),c.finish_reason&&t.finishReasons.push(c.finish_reason)}function mT(e,t,n,r){var s,i;if(!(e&&typeof e=="object")){t.eventTypes.push("unknown:non-object");return}if(e instanceof Error){r.setStatus({code:ie,message:"internal_error"}),kt(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in e))return;const o=e;if(!aT.includes(o.type)){t.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&t.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){t.responseTexts.push(o.delta);return}if("response"in o){const{response:a}=o;t.responseId=(s=a.id)!=null?s:t.responseId,t.responseModel=(i=a.model)!=null?i:t.responseModel,a.usage&&(t.promptTokens=a.usage.input_tokens,t.completionTokens=a.usage.output_tokens,t.totalTokens=a.usage.total_tokens),a.status&&t.finishReasons.push(a.status),n&&a.output_text&&t.responseTexts.push(a.output_text)}}function gT(e,t,n){return Go(this,null,function*(){const r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{try{for(var o=Vo(e),s,i,a;s=!(i=yield new Yt(o.next())).done;s=!1){const c=i.value;uT(c)?hT(c,r,n):cT(c)&&mT(c,r,n,t),yield c}}catch(i){a=[i]}finally{try{s&&(i=o.return)&&(yield new Yt(i.call(o)))}finally{if(a)throw a[0]}}}finally{const c=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];Ci(t,v(m({},r),{toolCalls:c}),n)}})}function _T(e){const t=Array.isArray(e.tools)?e.tools:[],r=e.web_search_options&&typeof e.web_search_options=="object"?[m({type:"web_search_options"},e.web_search_options)]:[],o=[...t,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(s){A&&S.error("Failed to serialize OpenAI tools:",s);return}}function yT(e,t){const n={[Ao]:"openai",[ht]:t,[ue]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const r=e[0],o=_T(r);o&&(n[No]=o),Object.assign(n,fT(r))}else n[Le]="unknown";return n}function zl(e,t,n,r){if(n==="embeddings"&&"input"in t){const a=t.input;
18if(a==null||typeof a=="string"&&a.length===0||Array.isArray(a)&&a.length===0)return;e.setAttribute(Gc,typeof a=="string"?a:JSON.stringify(a));return}const o="input"in t?t.input:"messages"in t?t.messages:void 0;if(!o||Array.isArray(o)&&o.length===0)return;const{systemInstructions:s,filteredMessages:i}=xo(o);s&&e.setAttribute(Mo,s),e.setAttribute($r,r?Br(i):Ye(i)),Array.isArray(i)?e.setAttribute(Hn,i.length):e.setAttribute(Hn,1)}function ST(e,t,n,r,o){return function(...i){const a=n.operation||"unknown",c=yT(i,a),u=c[Le]||"unknown",d=i[0],l=d&&typeof d=="object"&&d.stream===!0,f={name:`${a} ${u}`,op:`gen_ai.${a}`,attributes:c};if(l){let g;const _=en(f,y=>(g=e.apply(r,i),o.recordInputs&&d&&zl(y,d,a,jt(o.enableTruncation)),U(null,null,function*(){var b;try{const w=yield g;return gT(w,y,(b=o.recordOutputs)!=null?b:!1)}catch(w){throw y.setStatus({code:ie,message:"internal_error"}),y.end(),w}})));return zs(g,_)}let p;const h=Gt(f,g=>(p=e.apply(r,i),o.recordInputs&&d&&zl(g,d,a,jt(o.enableTruncation)),p.then(_=>(lT(g,_,o.recordOutputs),_))));return zs(p,h)}}function xh(e,t="",n){return new Proxy(e,{get(r,o){const s=r[o],i=Nh(t,String(o)),a=sT[i];return typeof s=="function"&&a?ST(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?xh(s,i,n):s}})}function bO(e,t){return xh(e,"",Gn(t))}const ql={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};function bT(e,t,n){if(Array.isArray(t)&&t.length===0)return;const{systemInstructions:r,filteredMessages:o}=xo(t);r&&e.setAttributes({[Mo]:r});const s=Array.isArray(o)?o.length:1;e.setAttributes({[$r]:n?Br(o):Ye(o),[Hn]:s})}const ET={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function Oh(e){return e&&ET[e]||"internal_error"}function vT(e,t){t.error&&(e.setStatus({code:ie,message:Oh(t.error.type)}),kt(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function TT(e){const{system:t,messages:n,input:r}=e,o=typeof t=="string"?[{role:"system",content:e.system}]:[],s=Array.isArray(r)?r:r!=null?[r]:void 0,i=Array.isArray(n)?n:n!=null?[n]:[],a=s!=null?s:i;return[...o,...a]}function IT(e,t){var n;return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:ie,message:Oh((n=e.error)==null?void 0:n.type)}),!0):!1}function wT(e,t){var n;if(e.type==="message_delta"&&(e.usage&&typeof e.usage.output_tokens=="number"&&(t.completionTokens=e.usage.output_tokens),(n=e.delta)!=null&&n.stop_reason&&t.finishReasons.push(e.delta.stop_reason)),e.message){const r=e.message;r.id&&(t.responseId=r.id),r.model&&(t.responseModel=r.model),r.usage&&(typeof r.usage.input_tokens=="number"&&(t.promptTokens=r.usage.input_tokens),typeof r.usage.cache_creation_input_tokens=="number"&&(t.cacheCreationInputTokens=r.usage.cache_creation_input_tokens),typeof r.usage.cache_read_input_tokens=="number"&&(t.cacheReadInputTokens=r.usage.cache_read_input_tokens))}}function kT(e,t){e.type!=="content_block_start"||typeof e.index!="number"||!e.content_block||(e.content_block.type==="tool_use"||e.content_block.type==="server_tool_use")&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function RT(e,t,n){if(!(e.type!=="content_block_delta"||!e.delta)){if(typeof e.index=="number"&&"partial_json"in e.delta&&typeof e.delta.partial_json=="string"){const r=t.activeToolBlocks[e.index];r&&r.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text=="string"&&t.responseTexts.push(e.delta.text)}}function CT(e,t){if(e.type!=="content_block_stop"||typeof e.index!="number")return;const n=t.activeToolBlocks[e.index];if(!n)return;const r=n.inputJsonParts.join("");let o;try{o=r?JSON.parse(r):{}}catch(s){o={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete t.activeToolBlocks[e.index]}function Lh(e,t,n,r){!(e&&typeof e=="object")||IT(e,r)||(wT(e,t),kT(e,t),RT(e,t,n),CT(e,t))}function AT(e,t,n){return Go(this,null,function*(){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{try{for(var o=Vo(e),s,i,a;s=!(i=yield new Yt(o.next())).done;s=!1){const c=i.value;Lh(c,r,n,t),yield c}}catch(i){a=[i]}finally{try{s&&(i=o.return)&&(yield new Yt(i.call(o)))}finally{if(a)throw a[0]}}}finally{Ci(t,r,n)}})}function MT(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",o=>{Lh(o,r,n,t)}),e.on("message",()=>{Ci(t,r,n)}),e.on("error",o=>{kt(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:ie,message:"internal_error"}),t.end())}),e}let _s=!1;const Gl=new WeakSet;function NT(e,t,n){var o;const r={[Ao]:"anthropic",[ht]:n,[ue]:"auto.ai.anthropic"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const s=e[0];s.tools&&Array.isArray(s.tools)&&(r[No]=JSON.stringify(s.tools)),r[Le]=(o=s.model)!=null?o:"unknown","temperature"in s&&(r[vi]=s.temperature),"top_p"in s&&
18(r[Ii]=s.top_p),"stream"in s&&(r[Wc]=s.stream),"top_k"in s&&(r[_h]=s.top_k),"frequency_penalty"in s&&(r[Ti]=s.frequency_penalty),"max_tokens"in s&&(r[jc]=s.max_tokens)}else t==="models.retrieve"||t==="models.get"?r[Le]=e[0]:r[Le]="unknown";return r}function Va(e,t,n){const r=TT(t);bT(e,r,n),"prompt"in t&&e.setAttributes({[Cv]:JSON.stringify(t.prompt)})}function xT(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[Et]:t.content.map(r=>r.text).filter(r=>!!r).join("")});const n=[];for(const r of t.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&e.setAttributes({[rn]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[Et]:t.completion}),"input_tokens"in t&&e.setAttributes({[Et]:JSON.stringify(t.input_tokens)})}function OT(e,t){"id"in t&&"model"in t&&(e.setAttributes({[wi]:t.id,[Fr]:t.model}),"usage"in t&&t.usage&&rT(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function LT(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){vT(e,t);return}n&&xT(e,t),OT(e,t)}}function Vl(e,t){throw t.isRecording()&&(t.setStatus({code:ie,message:"internal_error"}),t.end()),e}function PT(e,t,n,r,o,s,i,a,c,u){var f;const d=(f=r[Le])!=null?f:"unknown",l={name:`${o} ${d}`,op:`gen_ai.${o}`,attributes:r};if(c&&!u){let p;const h=en(l,g=>(p=e.apply(t,n),a.recordInputs&&i&&Va(g,i,jt(a.enableTruncation)),U(null,null,function*(){var _;try{const y=yield p;return AT(y,g,(_=a.recordOutputs)!=null?_:!1)}catch(y){return Vl(y,g)}})));return zs(p,h)}else return en(l,p=>{var h;try{a.recordInputs&&i&&Va(p,i,jt(a.enableTruncation)),_s=!0;const g=e.apply(t,n);return _s=!1,MT(g,p,(h=a.recordOutputs)!=null?h:!1)}catch(g){return _s=!1,Vl(g,p)}})}function DT(e,t,n,r,o){return new Proxy(e,{apply(s,i,a){var y;const c=i!==void 0?i:r,u=n.streaming===!0;if(!u&&_s)return s.apply(c,a);const d=n.operation||"unknown",l=NT(a,t,d),f=(y=l[Le])!=null?y:"unknown",p=typeof a[0]=="object"?a[0]:void 0,h=!!(p!=null&&p.stream);if(h||u)return PT(s,c,a,l,d,t,p,o,h,u);let g;const _=Gt({name:`${d} ${f}`,op:`gen_ai.${d}`,attributes:l},b=>(g=s.apply(c,a),o.recordInputs&&p&&Va(b,p,jt(o.enableTruncation)),g.then(w=>(LT(b,w,o.recordOutputs),w))));return zs(g,_)}})}function FT(e,t){for(const n of Object.keys(ql)){const r=n.split("."),o=r.pop();let s=e;for(const c of r)s=s==null?void 0:s[c];if(!s||typeof s[o]!="function")continue;const i=s[o];if(Gl.has(i))continue;const a=DT(i,n,ql[n],s,t);Gl.add(a),s[o]=a}return e}function EO(e,t){return FT(e,Gn(t))}const $T={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{proxyResultPath:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},BT="google_genai";function UT(e,t){var r;const n=e==null?void 0:e.promptFeedback;if(n!=null&&n.blockReason){const o=(r=n.blockReasonMessage)!=null?r:n.blockReason;return t.setStatus({code:ie,message:"internal_error"}),kt(`Content blocked: ${o}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function HT(e,t){typeof e.responseId=="string"&&(t.responseId=e.responseId),typeof e.modelVersion=="string"&&(t.responseModel=e.modelVersion);const n=e.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(t.totalTokens=n.totalTokenCount))}function WT(e,t,n){var r,o,s;Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(const i of(r=e.candidates)!=null?r:[]){i!=null&&i.finishReason&&!t.finishReasons.includes(i.finishReason)&&t.finishReasons.push(i.finishReason);for(const a of(s=(o=i==null?void 0:i.content)==null?void 0:o.parts)!=null?s:[])n&&a.text&&t.responseTexts.push(a.text),a.functionCall&&t.toolCalls.push({type:"function",id:a.functionCall.id,name:a.functionCall.name,arguments:a.functionCall.args})}}function jT(e,t,n,r){!e||UT(e,r)||(HT(e,t),WT(e,t,n))}function zT(e,t,n){return Go(this,null,function*(){const r={responseTexts:[],finishReasons:[],toolCalls:[]};try{try{for(var o=Vo(e),s,i,a;s=!(i=yield new Yt(o.next())).done;s=!1){const c=i.value;jT(c,r,n,t),yield c}}catch(i){a=[i]}finally{try{s&&(i=o.return)&&(yield new Yt(i.call(o)))}finally{if(a)throw a[0]}}}finally{Ci(t,r,n)}})}function Yr(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>Yr(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[v(m({},e),{role:t})]:[{role:t,content:e}]}function Yl(e,t){if("model"in e&&typeof e.model=="string")return e.model;if(t&&typeof t=="object"){const n=t;if("model"in n&&typeof n.model=="string")return n.model;
18if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function qT(e){const t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[vi]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[Ii]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[_h]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[jc]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[Ti]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[zc]=e.presencePenalty),t}function GT(e,t,n){const r={[Ao]:BT,[ht]:e,[ue]:"auto.ai.google_genai"};if(t){if(r[Le]=Yl(t,n),"config"in t&&typeof t.config=="object"&&t.config){const o=t.config;if(Object.assign(r,qT(o)),"tools"in o&&Array.isArray(o.tools)){const s=o.tools.flatMap(i=>i.functionDeclarations);r[No]=JSON.stringify(s)}}}else r[Le]=Yl({},n);return r}function Jl(e,t,n,r){if(n==="embeddings"){const s=t.contents;s!=null&&e.setAttribute(Gc,typeof s=="string"?s:JSON.stringify(s));return}const o=[];if("config"in t&&t.config&&typeof t.config=="object"&&"systemInstruction"in t.config&&t.config.systemInstruction&&o.push(...Yr(t.config.systemInstruction,"system")),"history"in t&&o.push(...Yr(t.history,"user")),"contents"in t&&o.push(...Yr(t.contents,"user")),"message"in t&&o.push(...Yr(t.message,"user")),Array.isArray(o)&&o.length){const{systemInstructions:s,filteredMessages:i}=xo(o);s&&e.setAttribute(Mo,s);const a=Array.isArray(i)?i.length:0;e.setAttributes({[Hn]:a,[$r]:r?Br(i):Ye(i)})}}function VT(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(Fr,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){const r=t.usageMetadata;typeof r.promptTokenCount=="number"&&e.setAttributes({[Bn]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&e.setAttributes({[Un]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&e.setAttributes({[ln]:r.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){const r=t.candidates.map(o=>{var s;return(s=o.content)!=null&&s.parts&&Array.isArray(o.content.parts)?o.content.parts.map(i=>typeof i.text=="string"?i.text:"").filter(i=>i.length>0).join(""):""}).filter(o=>o.length>0);r.length>0&&e.setAttributes({[Et]:r.join("")})}if(n&&t.functionCalls){const r=t.functionCalls;Array.isArray(r)&&r.length>0&&e.setAttributes({[rn]:JSON.stringify(r)})}}}function YT(e,t,n,r,o){const s=n.operation==="embeddings";return new Proxy(e,{apply(i,a,c){var p;const u=n.operation||"unknown",d=c[0],l=GT(u,d,r),f=(p=l[Le])!=null?p:"unknown";return n.streaming?en({name:`${u} ${f}`,op:`gen_ai.${u}`,attributes:l},h=>U(null,null,function*(){try{o.recordInputs&&d&&Jl(h,d,u,jt(o.enableTruncation));const g=yield i.apply(r,c);return zT(g,h,!!o.recordOutputs)}catch(g){throw h.setStatus({code:ie,message:"internal_error"}),h.end(),g}})):Gt({name:`${u} ${f}`,op:`gen_ai.${u}`,attributes:l},h=>(o.recordInputs&&d&&Jl(h,d,u,jt(o.enableTruncation)),Cc(()=>i.apply(r,c),()=>{},()=>{},g=>{s||VT(h,g,o.recordOutputs)})))}})}function Ya(e,t="",n){return new Proxy(e,{get:(r,o,s)=>{const i=Reflect.get(r,o,s),a=Nh(t,String(o)),c=$T[a];if(typeof i=="function"&&c){const u=c.operation?YT(i,a,c,r,n):i.bind(r);return c.proxyResultPath?function(...d){const l=u(...d);return l&&typeof l=="object"?Ya(l,c.proxyResultPath,n):l}:u}return typeof i=="function"?i.bind(r):i&&typeof i=="object"?Ya(i,a,n):i}})}function vO(e,t){return Ya(e,"",Gn(t))}const Yc="auto.ai.langchain",JT={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"},et=(e,t,n)=>{n!=null&&(e[t]=n)},ze=(e,t,n)=>{const r=Number(n);Number.isNaN(r)||(e[t]=r)};function Qn(e){if(Array.isArray(e))try{const t=e.map(n=>n&&typeof n=="object"&&pr(n)?Qr(n):n);return JSON.stringify(t)}catch(t){return String(e)}return Ye(e,String)}function zr(e){var n;const t=e.toLowerCase();return(n=JT[t])!=null?n:t}function Kl(e){return e.includes("System")?"system":e.includes("Human")?"user":e.includes("AI")||e.includes("Assistant")?"assistant":e.includes("Function")?"function":e.includes("Tool")?"tool":"user"}function Xl(e){if(!(!e||Array.isArray(e)))return e.invocation_params}
18function Jc(e){return e.map(t=>{var o,s;const n=t._getType;if(typeof n=="function"){const i=n.call(t);return{role:zr(i),content:Qn(t.content)}}if(t.lc===1&&t.kwargs){const i=t.id,a=Array.isArray(i)&&i.length>0?i[i.length-1]:"",c=typeof a=="string"?Kl(a):"user";return{role:zr(c),content:Qn((o=t.kwargs)==null?void 0:o.content)}}if(t.type){const i=String(t.type).toLowerCase();return{role:zr(i),content:Qn(t.content)}}if(t.role)return{role:zr(String(t.role)),content:Qn(t.content)};const r=(s=t.constructor)==null?void 0:s.name;return r&&r!=="Object"?{role:zr(Kl(r)),content:Qn(t.content)}:{role:"user",content:Qn(t.content)}})}function KT(e,t,n){var d,l,f,p,h;const r={},o="kwargs"in e?e.kwargs:void 0,s=(l=(d=t==null?void 0:t.temperature)!=null?d:n==null?void 0:n.ls_temperature)!=null?l:o==null?void 0:o.temperature;ze(r,vi,s);const i=(p=(f=t==null?void 0:t.max_tokens)!=null?f:n==null?void 0:n.ls_max_tokens)!=null?p:o==null?void 0:o.max_tokens;ze(r,jc,i);const a=(h=t==null?void 0:t.top_p)!=null?h:o==null?void 0:o.top_p;ze(r,Ii,a);const c=t==null?void 0:t.frequency_penalty;ze(r,Ti,c);const u=t==null?void 0:t.presence_penalty;return ze(r,zc,u),t&&"stream"in t&&et(r,Wc,!!t.stream),r}function Ph(e,t,n,r,o){return m({[Ao]:Ye(e!=null?e:"langchain",String),[ht]:"chat",[Le]:Ye(t,String),[ue]:Yc},KT(n,r,o))}function XT(e,t,n,r,o,s){var u,d;const i=s==null?void 0:s.ls_provider,a=(d=(u=o==null?void 0:o.model)!=null?u:s==null?void 0:s.ls_model_name)!=null?d:"unknown",c=Ph(i,a,e,o,s);if(n&&Array.isArray(t)&&t.length>0){et(c,Hn,t.length);const l=t.map(f=>({role:"user",content:f}));et(c,$r,r?Br(l):Ye(l))}return c}function QT(e,t,n,r,o,s){var u,d,l,f;
18const i=(d=s==null?void 0:s.ls_provider)!=null?d:(u=e.id)==null?void 0:u[2],a=(f=(l=o==null?void 0:o.model)!=null?l:s==null?void 0:s.ls_model_name)!=null?f:"unknown",c=Ph(i,a,e,o,s);if(n&&Array.isArray(t)&&t.length>0){const p=Jc(t.flat()),{systemInstructions:h,filteredMessages:g}=xo(p);h&&et(c,Mo,h);const _=Array.isArray(g)?g.length:0;et(c,Hn,_),et(c,$r,r?Br(g):Ye(g))}return c}function ZT(e,t){var o;const n=[],r=e.flat();for(const s of r){const i=s.message,a=i==null?void 0:i.tool_calls;if(Array.isArray(a)&&a.length>0)n.push(...a);else{const c=(o=s.message)==null?void 0:o.content;if(Array.isArray(c))for(const u of c){const d=u;d.type==="tool_use"&&n.push(d)}}}n.length>0&&et(t,rn,Ye(n,String))}function eI(e,t){if(!e)return;const n=e.tokenUsage,r=e.usage;if(n)ze(t,Bn,n.promptTokens),ze(t,Un,n.completionTokens),ze(t,ln,n.totalTokens);else if(r){ze(t,Bn,r.input_tokens),ze(t,Un,r.output_tokens);const o=Number(r.input_tokens),s=Number(r.output_tokens),i=(Number.isNaN(o)?0:o)+(Number.isNaN(s)?0:s);i>0&&ze(t,ln,i),r.cache_creation_input_tokens!==void 0&&ze(t,xv,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&ze(t,Ov,r.cache_read_input_tokens)}}function tI(e,t){var u,d,l,f,p,h,g,_;if(!e)return;const n={};if(Array.isArray(e.generations)){const y=e.generations.flat().map(b=>{var w,I;return(w=b.generationInfo)!=null&&w.finish_reason?b.generationInfo.finish_reason:(I=b.generation_info)!=null&&I.finish_reason?b.generation_info.finish_reason:null}).filter(b=>typeof b=="string");if(y.length>0&&et(n,fr,Ye(y,String)),ZT(e.generations,n),t){const b=e.generations.flat().map(w=>{var I,O;return(O=w.text)!=null?O:(I=w.message)==null?void 0:I.content}).filter(w=>typeof w=="string");b.length>0&&et(n,Et,Ye(b,String))}}eI(e.llmOutput,n);const r=e.llmOutput,o=(d=(u=e.generations)==null?void 0:u[0])==null?void 0:d[0],s=o==null?void 0:o.message,i=(p=(l=r==null?void 0:r.model_name)!=null?l:r==null?void 0:r.model)!=null?p:(f=s==null?void 0:s.response_metadata)==null?void 0:f.model_name;i&&et(n,Fr,i);const a=(h=r==null?void 0:r.id)!=null?h:s==null?void 0:s.id;a&&et(n,wi,a);const c=(_=r==null?void 0:r.stop_reason)!=null?_:(g=s==null?void 0:s.response_metadata)==null?void 0:g.finish_reason;return c&&et(n,Av,Ye(c,String)),n}function fa(e){const t={},n=e==null?void 0:e.lc_agent_name;return typeof n=="string"&&(t[ki]=n),t}function nI(e){var r,o,s;const t=(s=(r=e==null?void 0:e.invocation_params)==null?void 0:r.tools)!=null?s:(o=e==null?void 0:e.options)==null?void 0:o.tools;if(!Array.isArray(t)||t.length===0)return;const n=t.map(i=>{var c,u,d;const a=i.function;return{type:"function",name:(u=(c=i.name)!=null?c:a==null?void 0:a.name)!=null?u:"",description:(d=i.description)!=null?d:a==null?void 0:a.description}});return JSON.stringify(n)}function rI(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.addHandler=="function"&&typeof t.copy=="function"}function oI(e){return typeof e=="object"&&(e==null?void 0:e.name)==="SentryCallbackHandler"}function Ql(e){return e.some(oI)}function sI(e,t){var r;if(!e)return[t];if(rI(e)){if(Ql((r=e.handlers)!=null?r:[]))return e;const o=e.copy();return o.addHandler(t,!0),o}const n=Array.isArray(e)?e:[e];return Ql(n)?e:[...n,t]}function Dh(e={}){const{recordInputs:t,recordOutputs:n}=Gn(e),r=jt(e.enableTruncation),o=new Map,s=a=>{const c=o.get(a);c!=null&&c.isRecording()&&(c.end(),o.delete(a))},i={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(a,c,u,d,l,f,p,h){const g=Xl(f),_=XT(a,c,t,r,g,p),y=_[Le],b=_[ht];en({name:`${b} ${y}`,op:"gen_ai.chat",attributes:v(m(m({},fa(p)),_),{[ve]:"gen_ai.chat"})},w=>(o.set(u,w),w))},handleChatModelStart(a,c,u,d,l,f,p,h){const g=Xl(f),_=QT(a,c,t,r,g,p),y=nI(l);y&&(_[No]=y);const b=_[Le],w=_[ht];en({name:`${w} ${b}`,op:"gen_ai.chat",attributes:v(m(m({},fa(p)),_),{[ve]:"gen_ai.chat"})},I=>(o.set(u,I),I))},handleLLMEnd(a,c,u,d,l){const f=o.get(c);if(f!=null&&f.isRecording()){const p=tI(a,n);p&&f.setAttributes(p),s(c)}},handleLLMError(a,c){const u=o.get(c);u!=null&&u.isRecording()&&(u.setStatus({code:ie,message:"internal_error"}),s(c))},handleChainStart(a,c,u,d,l,f,p,h){if(f!=null&&f.__sentry_langgraph__)return;const g=h||a.name||"unknown_chain",_={[ue]:"auto.ai.langchain","langchain.chain.name":g};t&&(_["langchain.chain.inputs"]=JSON.stringify(c)),en({name:`chain ${g}`,op:"gen_ai.invoke_agent",attributes:v(m({},_),{[ve]:"gen_ai.invoke_agent"})},y=>(o.set(u,y),y))},handleChainEnd(a,c){const u=o.get(c);u!=null&&u.isRecording()&&(n&&u.setAttributes({"langchain.chain.outputs":JSON.stringify(a)}),s(c))},handleChainError(a,c){const u=o.get(c);u!=null&&u.isRecording()&&(u.setStatus({code:ie,message:"internal_error"}),s(c))},handleToolStart(a,c,u,d,l,f,p){if(f!=null&&f.__sentry_langgraph__)return;const h=p||a.name||"unknown_tool",g=v(m({},fa(f)),{[ue]:Yc,[ht]:"execute_tool",[Eh]:h});t&&(g[vh]=c),en({name:`execute_tool ${h}`,op:"gen_ai.execute_tool",attributes:v(m({},g),{[ve]:"gen_ai.execute_tool"})},_=>(o.set(u,_),_))},handleToolEnd(a,c){const u=o.get(c);if(u!=null&&u.isRecording()){if(n){const d=a,l=d&&typeof d=="object"&&"content"in d?d.content:a;u.setAttributes({[Th]:typeof l=="string"?l:JSON.stringify(l)})}s(c)}},handleToolError(a,c){const u=o.get(c);u!=null&&u.isRecording()&&(u.setStatus({code:ie,message:"internal_error"}),s(c))},copy(){return i}
18,toJSON(){return{lc:1,type:"not_implemented",id:i.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:i.lc_id}}};return i}function iI(e){var n,r;const t=(r=(n=e.constructor)==null?void 0:n.name)!=null?r:"";return t.includes("OpenAI")?"openai":t.includes("Google")?"google_genai":t.includes("Mistral")?"mistralai":t.includes("Vertex")?"google_vertexai":t.includes("Bedrock")?"aws_bedrock":t.includes("Ollama")?"ollama":t.includes("Cloudflare")?"cloudflare":t.includes("Cohere")?"cohere":"langchain"}function aI(e){var r;const t=e!=null?e:{},n={[ue]:Yc,[ve]:bh,[ht]:"embeddings",[Le]:(r=t.model)!=null?r:"unknown"};return n[Ao]=iI(t),"dimensions"in t&&(n[Sh]=t.dimensions),"encodingFormat"in t&&(n[yh]=t.encodingFormat),n}function cI(e,t,n={}){const{recordInputs:r}=Gn(n),o=aI(e),s=o[Le]||"unknown";return r&&t!=null&&(o[Gc]=typeof t=="string"?t:JSON.stringify(t)),{name:`embeddings ${s}`,op:bh,attributes:o}}function Zl(e,t={}){return new Proxy(e,{apply(n,r,o){return Gt(cI(r,o[0],t),()=>Reflect.apply(n,r,o))}})}function TO(e,t){const n=e;return typeof n.embedQuery=="function"&&(n.embedQuery=Zl(n.embedQuery,t)),typeof n.embedDocuments=="function"&&(n.embedDocuments=Zl(n.embedDocuments,t)),e}const Kc="auto.ai.langgraph";function uI(e){const t=e[0];if(typeof t!="object"||!t||!("llm"in t)||!t.llm||typeof t.llm!="object")return null;const n=t.llm;return typeof n.modelName!="string"&&typeof n.model!="string"?null:n}function lI(e){const t=e[0];return typeof t=="object"&&t&&"name"in t&&typeof t.name=="string"?t.name:null}function dI(e,t,n){const r="__sentry_tool_wrapped__";for(const o of e){if(!o||typeof o!="object")continue;const s=o,i=s.invoke;if(typeof i!="function"||Object.prototype.hasOwnProperty.call(s,r))continue;const a=typeof s.name=="string"?s.name:"unknown_tool",c=typeof s.description=="string"?s.description:void 0,u=new Proxy(i,{apply(d,l,f){var y,b;const p={[ue]:Kc,[ve]:Wl,[ht]:"execute_tool",[Eh]:a,[Dv]:"function"},h=f[1],g=(b=(y=h==null?void 0:h.metadata)==null?void 0:y.lc_agent_name)!=null?b:n;typeof g=="string"&&(p[ki]=g),c&&(p[Fv]=c);const _=f[0];if(typeof _=="object"&&_&&("id"in _&&typeof _.id=="string"&&(p[Pv]=_.id),t.recordInputs)){const w="args"in _&&typeof _.args=="object"?_.args:_;try{p[vh]=JSON.stringify(w)}catch(I){}}return Gt({op:Wl,name:`execute_tool ${a}`,attributes:p},w=>U(null,null,function*(){try{const I=yield Reflect.apply(d,l,f);if(t.recordOutputs)try{const O=I,C=O&&typeof O=="object"&&"content"in O?O.content:I;w.setAttribute(Th,typeof C=="string"?C:JSON.stringify(C))}catch(O){}return I}catch(I){throw w.setStatus({code:ie,message:"internal_error"}),I}}))}});s.invoke=u,Object.defineProperty(s,r,{value:!0,enumerable:!1})}return e}function fI(e){if(!e||e.length===0)return null;const t=[];for(const n of e)if(n&&typeof n=="object"){const r=n.tool_calls;r&&Array.isArray(r)&&t.push(...r)}return t.length>0?t:null}function pI(e){const t=e;let n=0,r=0,o=0;if(t.usage_metadata&&typeof t.usage_metadata=="object"){const s=t.usage_metadata;return typeof s.input_tokens=="number"&&(n=s.input_tokens),typeof s.output_tokens=="number"&&(r=s.output_tokens),typeof s.total_tokens=="number"&&(o=s.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(t.response_metadata&&typeof t.response_metadata=="object"){const s=t.response_metadata;if(s.tokenUsage&&typeof s.tokenUsage=="object"){const i=s.tokenUsage;typeof i.promptTokens=="number"&&(n=i.promptTokens),typeof i.completionTokens=="number"&&(r=i.completionTokens),typeof i.totalTokens=="number"&&(o=i.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function hI(e,t){const n=t;if(n.response_metadata&&typeof n.response_metadata=="object"){const r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&e.setAttribute(Fr,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&e.setAttribute(fr,[r.finish_reason])}}function mI(e){var n,r,o,s,i,a,c,u;if(!((s=(o=(r=(n=e.builder)==null?void 0:n.nodes)==null?void 0:r.tools)==null?void 0:o.runnable)!=null&&s.tools))return null;const t=(u=(c=(a=(i=e.builder)==null?void 0:i.nodes)==null?void 0:a.tools)==null?void 0:c.runnable)==null?void 0:u.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(d=>{var l,f,p;return{name:(l=d.lc_kwargs)==null?void 0:l.name,description:(f=d.lc_kwargs)==null?void 0:f.description,schema:(p=d.lc_kwargs)==null?void 0:p.schema}})}function gI(e,t,n){var f;const r=n,o=r==null?void 0:r.messages;if(!o||!Array.isArray(o))return;const s=(f=t==null?void 0:t.length)!=null?f:0,i=o.length>s?o.slice(s):[];if(i.length===0)return;const a=fI(i);a&&e.setAttribute(rn,JSON.stringify(a));const c=Jc(i);e.setAttribute(Et,JSON.stringify(c));let u=0,d=0,l=0;for(const p of i){const h=pI(p);u+=h.inputTokens,d+=h.outputTokens,l+=h.totalTokens,hI(e,p)}u>0&&e.setAttribute(Bn,u),d>0&&e.setAttribute(Un,d),l>0&&e.setAttribute(ln,l)}let Ja=!1;const qs="__sentry_patched__";function _I(e){const t={[ue]:Kc,[ve]:"gen_ai.create_agent",[ht]:"create_agent"};return{op:"gen_ai.create_agent",name:e?`create_agent ${e}`:"create_agent",attributes:t}}function yI(e,t){if(Object.prototype.hasOwnProperty.call(e,qs))return e;const n=Dh(t),r=new Proxy(e,{apply(o,s,i){return Ja?Reflect.apply(o,s,i):Gt(_I(),a=>{try{const c=Reflect.apply(o,s,i),u=i.length>0?i[0]:{};u!=null&&u.name&&typeof u.name=="string"&&(a.setAttribute(ki,u.name),a.updateName(`create_agent ${u.name}`));const d=c.invoke;return d&&typeof d=="function"&&(c.invoke=Fh(d.bind(c),c,u,t,void 0,n)),c}catch(c){throw a.setStatus({code:ie,message:"internal_error"}),c}})}});return Object.defineProperty(r,qs,{value:!0,enumerable:!1}),r}function Fh(e,t,n,r,o,s){return new Proxy(e,{apply(i,a,c){var d;const u=(d=o==null?void 0:o.modelName)!=null?d:o==null?void 0:o.model;return Gt({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[ue]:Kc,[ve]:Lv,[ht]:"invoke_agent"}},l=>U(null,null,function*(){var f,p,h,g;try{const _=n==null?void 0:n.name;_&&typeof _=="string"&&(l.setAttribute(Nv,_),l.setAttribute(ki,_),l.updateName(`invoke_agent ${_}`)),u&&l.setAttribute(Le,u);const y=c.length>1?c[1]:void 0,b=y==null?void 0:y.configurable,w=b==null?void 0:b.thread_id;if(w&&typeof w=="string"&&l.setAttribute(qc,w),s){const k=(f=c[1])!=null?f:{};c[1]=k;const T=(p=k.metadata)!=null?p:{};k.metadata=m(v(m({},T),{__sentry_langgraph__:!0}),typeof _=="string"?{lc_agent_name:_}:{}),k.callbacks=sI(k.callbacks,s)}const I=mI(t);I&&l.setAttribute(No,JSON.stringify(I));const O=r.recordInputs,C=r.recordOutputs,E=c.length>0?(g=(h=c[0])==null?void 0:h.messages)!=null?g:[]:[];if(E&&O){const k=Jc(E),{systemInstructions:T,filteredMessages:P}=xo(k);T&&l.setAttribute(Mo,T);const M=jt(r.enableTruncation),D=Array.isArray(P)?P.length:0;l.setAttributes({[$r]:M?Br(P):Ye(P),[Hn]:D})}const F=yield Reflect.apply(i,a,c);return C&&gI(l,E!=null?E:null,F),F}catch(_){throw l.setStatus({code:ie,message:"internal_error"}),_}}))}})}function IO(e,t){if(Object.prototype.hasOwnProperty.call(e,qs))return e;const n=Gn(t),r=Dh(n),o=new Proxy(e,{apply(s,i,a){const c=uI(a),u=lI(a),d=a[0];d&&Array.isArray(d.tools)&&d.tools.length>0&&dI(d.tools,n,u!=null?u:void 0),Ja=!0;let l;try{l=Reflect.apply(s,i,a)}finally{Ja=!1}const f=l.invoke;if(f&&typeof f=="function"){const p={};u&&(p.name=u),l.invoke=Fh(f.bind(l),l,p,n,c,r)}return l}});return Object.defineProperty(o,qs,{value:!0,enumerable:!1}),o}function SI(e,t){return e.compile=yI(e.compile,Gn(t)),e}const wO=SI;function bI(e,t,n){const r=n.getOptions(),o=n.getDsn(),s=r.tunnel,i=wo(r._metadata),a=m(m(m({sent_at:new Date(Ct()).toISOString()},EI(t)&&{trace:t}),i&&{sdk:i}
18),!!s&&o&&{dsn:At(o)}),c=n.getDataCollectionOptions().userInfo?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},v(m({version:2},un()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}}),{items:e})];return st(a,[u])}function EI(e){return!!e.trace_id&&!!e.public_key}function vI(e){let t=156;if(t+=e.name.length*2,t+=zu(e.attributes),e.links&&e.links.length>0){const n=e.links[0],r=n==null?void 0:n.attributes,o=100+(r?zu(r):0);t+=o*e.links.length}return t}const ed=1e3,TI=5e6;class II{constructor(t,n){this._traceBuckets=new Map,this._client=t;const{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:s}=n!=null?n:{};this._maxSpanLimit=r&&r>0&&r<=ed?r:ed,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:TI,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){const n=t.trace_id;let r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:yi(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=vI(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(A&&S.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){var c;const n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}const r=Array.from(n.spans),o=(c=r[0])==null?void 0:c._segmentSpan;if(!o){A&&S.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}const s=_t(o),i=r.map(u=>{const f=u,{_segmentSpan:d}=f;return vn(f,["_segmentSpan"])}),a=bI(i,s,this._client);A&&S.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,u=>{A&&S.error("Error while sending streamed span envelope:",u)}),this._removeTrace(t)}_removeTrace(t){const n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}}function $h(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const vr=H;function wI(){return"history"in vr&&!!vr.history}function kI(){if(!("fetch"in vr))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch(e){return!1}}function Ka(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Bh(){var n;if(typeof EdgeRuntime=="string")return!0;if(!kI())return!1;if(Ka(vr.fetch))return!0;let e=!1;const t=vr.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=Ka(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){A&&S.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function RI(){return"ReportingObserver"in vr}function Ai(e,t){const n="fetch",r=hn(n,e);return mn(n,()=>Uh(void 0,t)),r}function CI(e){const t="fetch-body-resolved",n=hn(t,e);return mn(t,()=>Uh(MI)),n}function Uh(e,t=!1){t&&!Bh()||Oe(H,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=NI(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:be()*1e3,virtualError:o,headers:xI(r)};return e||tt("fetch",m({},a)),n.apply(H,r).then(c=>U(null,null,function*(){return e?e(c):tt("fetch",v(m({},a),{endTimestamp:be()*1e3,response:c})),c}),c=>{var f;tt("fetch",v(m({},a),{endTimestamp:be()*1e3,error:c})),We(c)&&c.stack===void 0&&(c.stack=o.stack,xe(c,"framesToPop",1));const u=x(),d=(f=u==null?void 0:u.getOptions().enhanceFetchErrorMessages)!=null?f:"always";if(d!==!1&&We(c)&&c.name==="TypeError"&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{const h=new URL(a.fetchData.url).host;d==="always"?c.message=`${c.message} (${h})`:xe(c,"__sentry_fetch_url_host__",h)}catch(p){}throw c})}})}function AI(e,t){return U(this,null,function*(){if(e!=null&&e.body){const n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let s=!0;for(;s;){let i;try{i=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:a}=yield r.read();clearTimeout(i),a&&(t(),s=!1)}catch(a){s=!1}finally{clearTimeout(i)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}})}function MI(e){let t;try{t=e.clone()}catch(n){return}AI(t,()=>{tt("fetch-body-resolved",{endTimestamp:be()*1e3,response:e})})}function ys(e,t){return nt(e)&&!!e[t]}function td(e){return typeof e=="string"?e:e?ys(e,"url")?e.url:e.toString?e.toString():"":""}function NI(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:td(n),method:ys(r,"method")?String(r.method).toUpperCase():vc(n)&&ys(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:td(t),method:ys(t,"method")?String(t.method).toUpperCase():"GET"}}function xI(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(vc(t))return new Headers(t.headers)}catch(r){}}const Hh=H;function dn(){try{return Hh.document.location.href}catch(e){return""}}function Xc(e,t=5){if(!Hh.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}const dt=H,fe=dt.document,Jr=dt.navigator,Wh="Report a Bug",OI="Cancel",LI="Send Bug Report",PI="Confirm",DI="Report a Bug",FI="[email protected]",$I="Email",BI="What's the bug? What did you expect?",UI="Description",HI="Your Name",WI="Name",jI="Thank y
18ou for your report!",zI="(required)",qI="Add a screenshot",GI="Remove screenshot",VI="Highlight",YI="Hide",JI="Remove",jh="Unable to submit feedback with empty message",zh="No client setup, cannot send feedback.",qh="Unable to determine if Feedback was correctly sent.",Gh="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",Vh="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",KI="widget",XI="api",QI=5e3,ZI={ERROR_EMPTY_MESSAGE:jh,ERROR_NO_CLIENT:zh,ERROR_TIMEOUT:qh,ERROR_FORBIDDEN:Gh,ERROR_GENERIC:Vh};function Ss(e,t){var n;return(n=t==null?void 0:t[e])!=null?n:ZI[e]}function nd(e,t){return new Error(Ss(e,t))}const e0=(e,t={includeReplay:!0})=>{const n=t.errorMessages;if(!e.message)throw nd("ERROR_EMPTY_MESSAGE",n);const r=x();if(!r)throw nd("ERROR_NO_CLIENT",n);e.tags&&Object.keys(e.tags).length&&Y().setTags(e.tags);const o=lv(m({source:XI,url:dn()},e),t);return new Promise((s,i)=>{const a=setTimeout(()=>{c(),i(Ss("ERROR_TIMEOUT",n))},3e4),c=r.on("afterSendEvent",(u,d)=>{if(u.event_id===o)return clearTimeout(a),c(),d!=null&&d.statusCode&&d.statusCode>=200&&d.statusCode<300?s(o):(d==null?void 0:d.statusCode)===403?i(Ss("ERROR_FORBIDDEN",n)):i(Ss("ERROR_GENERIC",n))})})},bs=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__;function t0(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Jr.userAgent)||/Macintosh/i.test(Jr.userAgent)&&Jr.maxTouchPoints&&Jr.maxTouchPoints>1||!isSecureContext)}function Zo(e,t){return v(m(m({},e),t),{tags:m(m({},e.tags),t.tags),onFormOpen:()=>{var n,r;(n=t.onFormOpen)==null||n.call(t),(r=e.onFormOpen)==null||r.call(e)},onFormClose:()=>{var n,r;(n=t.onFormClose)==null||n.call(t),(r=e.onFormClose)==null||r.call(e)},onSubmitSuccess:(n,r)=>{var o,s;(o=t.onSubmitSuccess)==null||o.call(t,n,r),(s=e.onSubmitSuccess)==null||s.call(e,n,r)},onSubmitError:n=>{var r,o;(r=t.onSubmitError)==null||r.call(t,n),(o=e.onSubmitError)==null||o.call(e,n)},onFormSubmitted:()=>{var n,r;(n=t.onFormSubmitted)==null||n.call(t),(r=e.onFormSubmitted)==null||r.call(e)},themeDark:m(m({},e.themeDark),t.themeDark),themeLight:m(m({},e.themeLight),t.themeLight)})}function n0(e){const t=fe.createElement("style");return t.textContent=` 19.widget__actor { 20 position: fixed; 21 z-index: var(--z-index); 22 margin: var(--page-margin); 23 inset: var(--actor-inset); 24 25 display: flex; 26 align-items: center; 27 gap: 8px; 28 padding: 16px; 29 30 font-family: inherit; 31 font-size: var(--font-size); 32 font-weight: 600; 33 line-height: 1.14em; 34 text-decoration: none; 35 36 background: var(--actor-background, var(--background)); 37 border-radius: var(--actor-border-radius, 1.7em/50%); 38 border: var(--actor-border, var(--border));
39 box-shadow: var(--actor-box-shadow, var(--box-shadow)); 40 color: var(--actor-color, var(--foreground)); 41 fill: var(--actor-color, var(--foreground)); 42 cursor: pointer; 43 opacity: 1; 44 transition: transform 0.2s ease-in-out; 45 transform: translate(0, 0) scale(1); 46} 47.widget__actor[aria-hidden="true"] { 48 opacity: 0; 49 pointer-events: none; 50 visibility: hidden; 51 transform: translate(0, 16px) scale(0.98); 52} 53 54.widget__actor:hover { 55 background: var(--actor-hover-background, var(--background)); 56 filter: var(--interactive-filter); 57} 58 59.widget__actor svg { 60 width: 1.14em; 61 height: 1.14em; 62} 63 64@media (max-width: 600px) { 65 .widget__actor span { 66 display: none; 67 } 68} 69`,e&&t.setAttribute("nonce",e),t}function Ge(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const Zn=20,r0="http://www.w3.org/2000/svg";function o0(){const e=a=>dt.document.createElementNS(r0,a),t=Ge(e("svg"),{width:`${Zn}`,height:`${Zn}`,viewBox:`0 0 ${Zn} ${Zn}`,fill:"var(--actor-color, var(--foreground))"}),n=Ge(e("g"),{clipPath:"url(#clip0_57_80)"}),r=Ge(e("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"});t.appendChild(n).appendChild(r);const o=e("defs"),s=Ge(e("clipPath"),{id:"clip0_57_80"}),i=Ge(e("rect"),{width:`${Zn}`,height:`${Zn}`,fill:"white"});return s.appendChild(i),o.appendChild(s),t.appendChild(o).appendChild(s).appendChild(i),t}function s0({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const o=fe.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||Wh,o.appendChild(o0()),e){const i=fe.createElement("span");i.appendChild(fe.createTextNode(e)),o.appendChild(i)}const s=n0(r);return{el:o,appendToDom(){n.appendChild(s),n.appendChild(o)},removeFromDom(){o.remove(),s.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}const Yh="rgba(88, 74, 192, 1)",i0={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:Yh,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},rd={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackgroun
69d:Yh,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function od(e){return` 70 --foreground: ${e.foreground}; 71 --background: ${e.background}; 72 --accent-foreground: ${e.accentForeground}; 73 --accent-background: ${e.accentBackground}; 74 --success-color: ${e.successColor}; 75 --error-color: ${e.errorColor}; 76 --border: ${e.border}; 77 --box-shadow: ${e.boxShadow}; 78 --outline: ${e.outline}; 79 --interactive-filter: ${e.interactiveFilter}; 80 `}function sd({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const o=fe.createElement("style");return o.textContent=` 81:host { 82 --font-family: system-ui, 'Helvetica Neue', Arial, sans-serif; 83 --font-size: 14px; 84 --z-index: 100000; 85 86 --page-margin: 16px; 87 --inset: auto 0 0 auto; 88 --actor-inset: var(--inset); 89 90 font-family: var(--font-family); 91 font-size: var(--font-size); 92 93 ${e!=="system"?`color-scheme: only ${e};`:""} 94 95 ${od(e==="dark"?m(m({},rd),t):m(m({},i0),n))} 96} 97 98${e==="system"?` 99@media (prefers-color-scheme: dark) { 100 :host { 101 color-scheme: only dark; 102 103 ${od(m(m({},rd),t))} 104 } 105}`:""} 106`,r&&o.setAttribute("nonce",r),o}const Jh=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>(({id:o="sentry-feedback",autoInject:s=!0,showBranding:i=!0,isEmailRequired:a=!1,isNameRequired:c=!1,showEmail:u=!0,showName:d=!0,enableScreenshot:l=!0,useSentryUser:f={email:"email",name:"username"},tags:p,styleNonce:h,scriptNonce:g,colorScheme:_="system",themeLight:y={},themeDark:b={},addScreenshotButtonLabel:w=qI,cancelButtonLabel:I=OI,confirmButtonLabel:O=PI,emailLabel:C=$I,emailPlaceholder:E=FI,formTitle:F=DI,isRequiredLabel:k=zI,messageLabel:T=UI,messagePlaceholder:P=BI,nameLabel:M=WI,namePlaceholder:D=HI,removeScreenshotButtonLabel:G=GI,submitButtonLabel:Z=LI,successMessageText:V=jI,triggerLabel:$=Wh,triggerAriaLabel:N="",highlightToolText:te=VI,hideToolText:L=YI,removeHighlightText:J=JI,errorEmptyMessageText:se=jh,errorNoClientText:oe=zh,errorTimeoutText:ce=qh,errorForbiddenText:Pe=Gh,errorGenericText:at=Vh,onFormOpen:Nt,onFormClose:ct,onSubmitSuccess:Sn,onSubmitError:xt,onFormSubmitted:zo}={})=>{const Ot={id:o,autoInject:s,showBranding:i,isEmailRequired:a,isNameRequired:c,showEmail:u,showName:d,enableScreenshot:l,useSentryUser:f,tags:p,styleNonce:h,scriptNonce:g,colorScheme:_,themeDark:b,themeLight:y,triggerLabel:$,triggerAriaLabel:N,cancelButtonLabel:I,submitButtonLabel:Z,confirmButtonLabel:O,formTitle:F,emailLabel:C,emailPlaceholder:E,messageLabel:T,messagePlaceholder:P,nameLabel:M,namePlaceholder:D,successMessageText:V,isRequiredLabel:k,addScreenshotButtonLabel:w,removeScreenshotButtonLabel:G,highlightToolText:te,hideToolText:L,removeHighlightText:J,errorEmptyMessageText:se,errorNoClientText:oe,errorTimeoutText:ce,errorForbiddenText:Pe,errorGenericText:at,onFormClose:ct,onFormOpen:Nt,onSubmitError:xt,onSubmitSuccess:Sn,onFormSubmitted:zo};let Ke=null,$e=null,je=[];const Jn=X=>{if(!Ke){const W=fe.createElement("div");W.id=String(X.id),fe.body.appendChild(W),Ke=W.attachShadow({mode:"open"}),$e=sd(X),Ke.appendChild($e)}return Ke},Kn=X=>U(null,null,function*(){const W=X.enableScreenshot&&t0();let ye,de;try{ye=(t?t():yield e("feedbackModalIntegration",g))(),gl(ye)}catch(Ne){throw bs&&S.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const Ne=W?n?n():yield e("feedbackScreenshotIntegration",g):void 0;Ne&&(de=Ne(),gl(de))}catch(Ne){bs&&S.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const ee={ERROR_EMPTY_MESSAGE:X.errorEmptyMessageText,ERROR_NO_CLIENT:X.errorNoClientText,ERROR_TIMEOUT:X.errorTimeoutText,ERROR_FORBIDDEN:X.errorForbiddenText,ERROR_GENERIC:X.errorGenericText},Vt=(Ne,Wg)=>e0(Ne,v(m({includeReplay:!0},Wg),{errorMessages:ee})),ut=ye.createDialog({options:v(m({},X),{onFormClose:()=>{var Ne;ut==null||ut.close(),(Ne=X.onFormClose)==null||Ne.call(X)},onFormSubmitted:()=>{var Ne;ut==null||ut.close(),(Ne=X.onFormSubmitted)==null||Ne.call(X)}}),screenshotIntegration:de,sendFeedback:Vt,shadow:Jn(X)});return ut}),bn=(X,W={})=>{const ye=Zo(Ot,W),de=typeof X=="string"?fe.querySelector(X):typeof X.addEventListener=="function"?X:null;if(!de)throw bs&&S.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let ee=null;const Vt=()=>U(null,null,function*(){ee||(ee=yield Kn(v(m({},ye),{onFormSubmitted:()=>{var Ne;ee==null||ee.removeFromDom(),(Ne=ye.onFormSubmitted)==null||Ne.call(ye)}}))),ee.appendToDom(),ee.open()});de.addEventListener("click",Vt);const ut=()=>
106{je=je.filter(Ne=>Ne!==ut),ee==null||ee.removeFromDom(),ee=null,de.removeEventListener("click",Vt)};return je.push(ut),ut},En=(X={})=>{const W=Zo(Ot,X),ye=Jn(W),de=s0({triggerLabel:W.triggerLabel,triggerAriaLabel:W.triggerAriaLabel,shadow:ye,styleNonce:h});return bn(de.el,v(m({},W),{onFormOpen(){de.hide()},onFormClose(){de.show()},onFormSubmitted(){de.show()}})),de};return{name:"Feedback",setupOnce(){!un()||!Ot.autoInject||(fe.readyState==="loading"?fe.addEventListener("DOMContentLoaded",()=>En().appendToDom()):En().appendToDom())},attachTo:bn,createWidget(X={}){const W=En(Zo(Ot,X));return W.appendToDom(),W},createForm(){return U(this,arguments,function*(X={}){return Kn(Zo(Ot,X))})},setTheme(X){if(Ot.colorScheme=X,Ke){const W=sd(Ot);$e?Ke.replaceChild(W,$e):Ke.prepend(W),$e=W}},remove(){var X;Ke&&((X=Ke.parentElement)==null||X.remove(),Ke=null,$e=null),je.forEach(W=>W()),je=[]}}});function kO(){const e=x();return e==null?void 0:e.getIntegrationByName("Feedback")}var Mi,he,Kh,kn,id,Xh,Xa,lo={},Qc=[],a0=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Zc=Array.isArray;function tn(e,t){for(var n in t)e[n]=t[n];return e}function Qh(e){var t=e.parentNode;t&&t.removeChild(e)}function re(e,t,n){var r,o,s,i={};for(s in t)s=="key"?r=t[s]:s=="ref"?o=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?Mi.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return Es(e,i,r,o,null)}function Es(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o==null?++Kh:o,__i:-1,__u:0};return o==null&&he.vnode!=null&&he.vnode(s),s}function Oo(e){return e.children}function vs(e,t){this.props=e,this.context=t}function Tr(e,t){if(t==null)return e.__?Tr(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Tr(e):null}function c0(e,t,n){var r,o=e.__v,s=o.__e,i=e.__P;if(i)return(r=tn({},o)).__v=o.__v+1,he.vnode&&he.vnode(r),eu(i,r,o,e.__n,i.ownerSVGElement!==void 0,32&o.__u?[s]:null,t,s==null?Tr(o):s,!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=s&&Zh(r),r}function Zh(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Zh(e)}}function ad(e){(!e.__d&&(e.__d=!0)&&kn.push(e)&&!Gs.__r++||id!==he.debounceRendering)&&((id=he.debounceRendering)||Xh)(Gs)}function Gs(){var e,t,n,r=[],o=[];for(kn.sort(Xa);e=kn.shift();)e.__d&&(n=kn.length,t=c0(e,r,o)||t,n===0||kn.length>n?(Qa(r,t,o),o.length=r.length=0,t=void 0,kn.sort(Xa)):t&&he.__c&&he.__c(t,Qc));t&&Qa(r,t,o),Gs.__r=0}function em(e,t,n,r,o,s,i,a,c,u,d){var l,f,p,h,g,_=r&&r.__k||Qc,y=t.length;for(n.__d=c,u0(n,t,_),c=n.__d,l=0;l<y;l++)(p=n.__k[l])!=null&&typeof p!="boolean"&&typeof p!="function"&&(f=p.__i===-1?lo:_[p.__i]||lo,p.__i=l,eu(e,p,f,o,s,i,a,c,u,d),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&tu(f.ref,null,p),d.push(p.ref,p.__c||h,p)),g==null&&h!=null&&(g=h),65536&p.__u||f.__k===p.__k?c=tm(p,c,e):typeof p.type=="function"&&p.__d!==void 0?c=p.__d:h&&(c=h.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=g}function u0(e,t,n){var r,o,s,i,a,c=t.length,u=n.length,d=u,l=0;for(e.__k=[],r=0;r<c;r++)(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Es(null,o,null,null,o):Zc(o)?Es(Oo,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Es(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=l0(o,n,i=r+l,d),o.__i=a,s=null,a!==-1&&(d--,(s=n[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&l--,typeof o.type!="function"&&(o.__u|=65536)):a!==i&&(a===i+1?l++:a>i?d>c-i?l+=a-i:l--:l=a<i&&a==i-1?a-i:0,a!==r+l&&(o.__u|=65536))):(s=n[r])&&s.key==null&&s.__e&&(s.__e==e.__d&&(e.__d=Tr(s)),Za(s,s,!1),n[r]=null,d--);if(d)for(r=0;r<u;r++)(s=n[r])!=null&&(131072&s.__u)==0&&(s.__e==e.__d&&(e.__d=Tr(s)),Za(s,s))}function tm(e,t,n){var r,o;
vendor: 4,259 bytes, line 106
106if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=tm(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function l0(e,t,n,r){var o=e.key,s=e.type,i=n-1,a=n+1,c=t[n];if(c===null||c&&o==c.key&&s===c.type)return n;if(r>(c!=null&&(131072&c.__u)==0?1:0))for(;i>=0||a<t.length;){if(i>=0){if((c=t[i])&&(131072&c.__u)==0&&o==c.key&&s===c.type)return i;i--}if(a<t.length){if((c=t[a])&&(131072&c.__u)==0&&o==c.key&&s===c.type)return a;a++}}return-1}function cd(e,t,n){t[0]==="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||a0.test(t)?n:n+"px"}function es(e,t,n,r,o){var s;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||cd(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||cd(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")s=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,s?ld:ud,s)):e.removeEventListener(t,s?ld:ud,s);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n==null?"":n;break e}catch(i){}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function ud(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(he.event?he.event(e):e)}}function ld(e){if(this.l)return this.l[e.type+!0](he.event?he.event(e):e)}function eu(e,t,n,r,o,s,i,a,c,u){var d,l,f,p,h,g,_,y,b,w,I,O,C,E,F,k=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=t.__e=n.__e]),(d=he.__b)&&d(t);e:if(typeof k=="function")try{if(y=t.props,b=(d=k.contextType)&&r[d.__c],w=d?b?b.props.value:d.__:r,n.__c?_=(l=t.__c=n.__c).__=l.__E:("prototype"in k&&k.prototype.render?t.__c=l=new k(y,w):(t.__c=l=new vs(y,w),l.constructor=k,l.render=f0),b&&b.sub(l),l.props=y,l.state||(l.state={}),l.context=w,l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),k.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=tn({},l.__s)),tn(l.__s,k.getDerivedStateFromProps(y,l.__s))),p=l.props,h=l.state,l.__v=t,f)k.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(k.getDerivedStateFromProps==null&&y!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(y,w),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(y,l.__s,w)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=y,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(T){T&&(T.__=t)}),I=0;I<l._sb.length;I++)l.__h.push(l._sb[I]);l._sb=[],l.__h.length&&i.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(y,l.__s,w),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,h,g)})}if(l.context=w,l.props=y,l.__P=e,l.__e=!1,O=he.__r,C=0,"prototype"in k&&k.prototype.render){for(l.state=l.__s,l.__d=!1,O&&O(t),d=l.render(l.props,l.state,l.context),E=0;E<l._sb.length;E++)l.__h.push(l._sb[E]);l._sb=[]}else do l.__d=!1,O&&O(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++C<25);l.state=l.__s,l.getChildContext!=null&&(r=tn(tn({},r),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(g=l.getSnapshotBeforeUpdate(p,h)),em(e,Zc(F=d!=null&&d.type===Oo&&d.key==null?d.props.children:d)?F:[F],t,n,r,o,s,i,a,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&i.push(l),_&&(l.__E=l.__=null)}catch(T){t.__v=null,c||s!=null?(t.__e=a,t.__u|=c?160:32,s[s.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),he.__e(T,t,n)}else s==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=d0(n.__e,t,n,r,o,s,i,c,u);(d=he.diffed)&&d(t)}function Qa(e,t,n){for(var r=0;r<n.length;r++)tu(n[r],n[++r],n[++r]);he.__c&&he.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){he.__e(s,o.__v)}})}function d0(e,t,n,r,o,s,i,a,c){var u,d,l,f,p,h,g,_=n.props,y=t.props,b=t.type;if(b==="svg"&&(o=!0),s!=null){for(u=0;
vendor: 2,583 bytes, line 106
106u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!b&&(b?p.localName===b:p.nodeType===3)){e=p,s[u]=null;break}}if(e==null){if(b===null)return document.createTextNode(y);e=o?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,y.is&&y),s=null,a=!1}if(b===null)_===y||a&&e.data===y||(e.data=y);else{if(s=s&&Mi.call(e.childNodes),_=n.props||lo,!a&&s!=null)for(_={},u=0;u<e.attributes.length;u++)_[(p=e.attributes[u]).name]=p.value;for(u in _)p=_[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=p:u==="key"||u in y||es(e,u,null,p,o));for(u in y)p=y[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?h=p:u=="checked"?g=p:u==="key"||a&&typeof p!="function"||_[u]===p||es(e,u,p,_[u],o);if(d)a||l&&(d.__html===l.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(l&&(e.innerHTML=""),em(e,Zc(f)?f:[f],t,n,r,o&&b!=="foreignObject",s,i,s?s[0]:n.__k&&Tr(n,0),a,c),s!=null)for(u=s.length;u--;)s[u]!=null&&Qh(s[u]);a||(u="value",h!==void 0&&(h!==e[u]||b==="progress"&&!h||b==="option"&&h!==_[u])&&es(e,u,h,_[u],!1),u="checked",g!==void 0&&g!==e[u]&&es(e,u,g,_[u],!1))}return e}function tu(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){he.__e(r,n)}}function Za(e,t,n){var r,o;if(he.unmount&&he.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||tu(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){he.__e(s,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Za(r[o],t,n||typeof e.type!="function");n||e.__e==null||Qh(e.__e),e.__=e.__e=e.__d=void 0}function f0(e,t,n){return this.constructor(e,n)}function p0(e,t,n){var r,o,s,i;he.__&&he.__(e,t),o=(r=!1)?null:t.__k,s=[],i=[],eu(t,e=t.__k=re(Oo,null,[e]),o||lo,lo,t.ownerSVGElement!==void 0,o?null:t.firstChild?Mi.call(t.childNodes):null,s,o?o.__e:t.firstChild,r,i),e.__d=void 0,Qa(s,e,i)}Mi=Qc.slice,he={__e:function(e,t,n,r){for(var o,s,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(a){e=a}throw e}},Kh=0,vs.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=tn({},this.state),typeof e=="function"&&(e=e(tn({},n),this.props)),e&&tn(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ad(this))},vs.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ad(this))},vs.prototype.render=Oo,kn=[],Xh=typeof Promise=="function"?Promise.prototype.then.bind(Prom
106ise.resolve()):setTimeout,Xa=function(e,t){return e.__v.__b-t.__v.__b},Gs.__r=0;var zt,pe,pa,dd,Ir=0,nm=[],Ts=[],Ee=he,fd=Ee.__b,pd=Ee.__r,hd=Ee.diffed,md=Ee.__c,gd=Ee.unmount,_d=Ee.__;function Vn(e,t){Ee.__h&&Ee.__h(pe,e,Ir||t),Ir=0;var n=pe.__H||(pe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Ts}),n.__[e]}function Rn(e){return Ir=1,rm(sm,e)}function rm(e,t,n){var r=Vn(zt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):sm(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=pe,!pe.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!s||s.call(this,a,c,u);var l=!1;return d.forEach(function(f){if(f.__N){var p=f.__[0];f.__=f.__N,f.__N=void 0,p!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!s||s.call(this,a,c,u))};pe.u=!0;var s=pe.shouldComponentUpdate,i=pe.componentWillUpdate;pe.componentWillUpdate=function(a,c,u){if(this.__e){var d=s;s=void 0,o(a,c,u),s=d}i&&i.call(this,a,c,u)},pe.shouldComponentUpdate=o}return r.__N||r.__}function h0(e,t){var n=Vn(zt++,3);!Ee.__s&&nu(n.__H,t)&&(n.__=e,n.i=t,pe.__H.__h.push(n))}function om(e,t){var n=Vn(zt++,4);!Ee.__s&&nu(n.__H,t)&&(n.__=e,n.i=t,pe.__h.push(n))}function m0(e){return Ir=5,Lo(function(){return{current:e}},[])}function g0(e,t,n){Ir=6,om(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Lo(e,t){var n=Vn(zt++,7);return nu(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function hr(e,t){return Ir=8,Lo(function(){return e},t)}function _0(e){var t=pe.context[e.__c],n=Vn(zt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(pe)),t.props.value):e.__}function y0(e,t){Ee.useDebugValue&&Ee.useDebugValue(t?t(e):e)}function S0(e){var t=Vn(zt++,10),n=Rn();return t.__=e,pe.componentDidCatch||(pe.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function b0(){var e=Vn(zt++,11);if(!e.__){for(var t=pe.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function E0(){for(var e;e=nm.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Is),e.__H.__h.forEach(ec),e.__H.__h=[]}catch(t){e.__H.__h=[],Ee.__e(t,e.__v)}}Ee.__b=function(e){pe=null,fd&&fd(e)},Ee.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_d&&_d(e,t)},Ee.__r=function(e){pd&&pd(e),zt=0;var t=(pe=e.__c).__H;t&&(pa===pe?(t.__h=[],pe.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Ts,n.__N=n.i=void 0})):(t.__h.forEach(Is),t.__h.forEach(ec),t.__h=[],zt=0)),pa=pe},Ee.diffed=function(e){hd&&hd(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(nm.push(t)!==1&&dd===Ee.requestAnimationFrame||((dd=Ee.requestAnimationFrame)||v0)(E0)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Ts&&(n.__=n.__V),n.i=void 0,n.__V=Ts})),pa=pe=null},Ee.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Is),n.__h=n.__h.filter(function(r){return!r.__||ec(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Ee.__e(r,n.__v)}}),md&&md(e,t)},Ee.unmount=function(e){gd&&gd(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Is(r)}catch(o){t=o}}),n.__H=void 0,t&&Ee.__e(t,n.__v))};var yd=typeof requestAnimationFrame=="function";function v0(e){var t,n=function(){clearTimeout(r),yd&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);yd&&(t=requestAnimationFrame(n))}function Is(e){var t=pe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),pe=t}function ec(e){var t=pe;e.__c=e.__(),pe=t}function nu(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function sm(e,t){return typeof t=="function"?t(e):t}const T0=Object.defineProperty({__proto__:null,useCallback:hr,useContext:_0,useDebugValue:y0,useEffect:h0,useErrorBoundary:S0,useId:b0,useImperativeHandle:g0,useLayoutEffect:om,useMemo:Lo,useReducer:rm,useRef:m0,useState:Rn},Symbol.toStringTag,{value:"Module"}),I0="http://www.w3.org/2000/svg";function w0(){const e=r=>fe.createElementNS(I0,r),t=Ge(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Ge(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"});return t.appendChild(n),t}function k0({options:e}){const t=Lo(()=>({__html:w0().outerHTML}),[]);return re("h2",{class:"dialog__header"},re("span",{class:"dialog__title"},e.formTitle),e.showBranding?re("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function R0(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}function ha(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function C0({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:s,onSubmitError:i,showEmail
106:a,showName:c,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:h,emailPlaceholder:g,isEmailRequired:_,isNameRequired:y,messageLabel:b,messagePlaceholder:w,nameLabel:I,namePlaceholder:O,submitButtonLabel:C,isRequiredLabel:E}=e,[F,k]=Rn(!1),[T,P]=Rn(null),[M,D]=Rn(!1),G=u==null?void 0:u.input,[Z,V]=Rn(null),$=hr(L=>{V(L),D(!1)},[]),N=hr(L=>{const J=R0(L,{emailLabel:h,isEmailRequired:_,isNameRequired:y,messageLabel:b,nameLabel:I});return J.length>0?P(`Please enter in the following required fields: ${J.join(", ")}`):P(null),J.length===0},[h,_,y,b,I]),te=hr(L=>U(null,null,function*(){k(!0);try{if(L.preventDefault(),!(L.target instanceof HTMLFormElement))return;const J=new FormData(L.target),se=yield u&&M?u.value():void 0,oe={name:ha(J,"name"),email:ha(J,"email"),message:ha(J,"message"),attachments:se?[se]:void 0};if(!N(oe))return;try{const ce=yield o({name:oe.name,email:oe.email,message:oe.message,source:KI,tags:d},{attachments:oe.attachments});s(oe,ce)}catch(ce){bs&&S.error(ce);const Pe=ce instanceof Error?ce:new Error(String(ce));P(Pe.message),i(Pe)}}finally{k(!1)}}),[u&&M,s,i]);return re("form",{class:"form",onSubmit:te},G&&M?re(G,{onError:$}):null,re("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:F},re("div",{class:"form__top"},T?re("div",{class:"form__error-container"},T):null,c?re("label",{for:"name",class:"form__label"},re(ma,{label:I,isRequiredLabel:E,isRequired:y}),re("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:O,required:y,type:"text"})):re("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?re("label",{for:"email",class:"form__label"},re(ma,{label:h,isRequiredLabel:E,isRequired:_}),re("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:g,required:_,type:"email"})):re("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),re("label",{for:"message",class:"form__label"},re(ma,{label:b,isRequiredLabel:E,isRequired:!0}),re("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:w,required:!0,rows:5})),G?re("label",{for:"screenshot",class:"form__label"},re("button",{class:"btn btn--default",disabled:F,type:"button",onClick:()=>{V(null),D(L=>!L)}},M?f:l),Z?re("div",{class:"form__error-container"},Z.message):null):null),re("div",{class:"btn-group"},re("button",{class:"btn btn--primary",disabled:F,type:"submit"},C),re("button",{class:"btn btn--default",disabled:F,type:"button",onClick:r},p))))}function ma({label:e,isRequired:t,isRequiredLabel:n}){return re("span",{class:"form__label__text"},e,t&&re("span",{class:"form__label__text--required"},n))}const ts=16,Sd=17,A0="http://www.w3.org/2000/svg";function M0(){const e=c=>dt.document.createElementNS(A0,c),t=Ge(e("svg"),{width:`${ts}`,height:`${Sd}`,viewBox:`0 0 ${ts} ${Sd}`,fill:"inherit"}),n=Ge(e("g"),{clipPath:"url(#clip0_57_156)"}),r=Ge(e("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"}),o=Ge(e("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
10610.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"});t.appendChild(n).append(o,r);const s=e("defs"),i=Ge(e("clipPath"),{id:"clip0_57_156"}),a=Ge(e("rect"),{width:`${ts}`,height:`${ts}`,fill:"white",transform:"translate(0 0.5)"});return i.appendChild(a),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(a),t}function N0(r){var o=r,{open:e,onFormSubmitted:t}=o,n=vn(o,["open","onFormSubmitted"]);const s=n.options,i=Lo(()=>({__html:M0().outerHTML}),[]),[a,c]=Rn(null),u=hr(()=>{a&&(clearTimeout(a),c(null)),t()},[a]),d=hr((l,f)=>{n.onSubmitSuccess(l,f),c(setTimeout(()=>{t(),c(null)},QI))},[t]);return re(Oo,null,a?re("div",{class:"success__position",onClick:u},re("div",{class:"success__content"},s.successMessageText,re("span",{class:"success__icon",dangerouslySetInnerHTML:i}))):re("dialog",{class:"dialog",onClick:s.onFormClose,open:e},re("div",{class:"dialog__position"},re("div",{class:"dialog__content",onClick:l=>{l.stopPropagation()}},re(k0,{options:s}),re(C0,v(m({},n),{onSubmitSuccess:d}))))))}const x0=` 107.dialog { 108 position: fixed; 109 z-index: var(--z-index); 110 margin: 0; 111 inset: 0; 112 113 display: flex; 114 align-items: center; 115 justify-content: center; 116 padding: 0; 117 height: 100vh; 118 width: 100vw; 119 120 color: var(--dialog-color, var(--foreground)); 121 fill: var(--dialog-color, var(--foreground)); 122 line-height: 1.75em; 123 124 background-color: rgba(0, 0, 0, 0.05); 125 border: none; 126 inset: 0; 127 opacity: 1; 128 transition: opacity 0.2s ease-in-out; 129} 130 131.dialog__position { 132 position: fixed; 133 z-index: var(--z-index); 134 inset: var(--dialog-inset); 135 padding: var(--page-margin); 136 display: flex; 137 max-height: calc(100vh - (2 * var(--page-margin))); 138} 139@media (max-width: 600px) { 140 .dialog__position { 141 inset: var(--page-margin); 142 padding: 0; 143 } 144} 145 146.dialog__position:has(.editor) { 147 inset: var(--page-margin); 148 padding: 0; 149} 150 151.dialog:not([open]) { 152 opacity: 0; 153 pointer-events: none; 154 visibility: hidden; 155} 156.dialog:not([open]) .dialog__content { 157 transform: translate(0, -16px) scale(0.98); 158} 159 160.dialog__content { 161 display: flex; 162 flex-direction: column; 163 gap: 16px; 164 padding: var(--dialog-padding, 24px); 165 max-width: 100%; 166 width: 100%; 167 max-height: 100%; 168 overflow: auto; 169 170 background: var(--dialog-background, var(--background)); 171 border-radius: var(--dialog-border-radius, 20px); 172 border: var(--dialog-border, var(--border));
173 box-shadow: var(--dialog-box-shadow, var(--box-shadow)); 174 transform: translate(0, 0) scale(1); 175 transition: transform 0.2s ease-in-out; 176} 177 178`,O0=` 179.dialog__header { 180 display: flex; 181 gap: 4px; 182 justify-content: space-between; 183 font-weight: var(--dialog-header-weight, 600); 184 margin: 0; 185} 186.dialog__title { 187 align-self: center; 188 width: var(--form-width, 272px); 189} 190 191@media (max-width: 600px) { 192 .dialog__title { 193 width: auto; 194 } 195} 196 197.dialog__position:has(.editor) .dialog__title { 198 width: auto; 199} 200 201 202.brand-link { 203 display: inline-flex; 204} 205.brand-link:focus-visible { 206 outline: var(--outline); 207} 208`,L0=` 209.form { 210 display: flex; 211 overflow: auto; 212 flex-direction: row; 213 gap: 16px; 214 flex: 1 0; 215} 216 217.form fieldset { 218 border: none; 219 margin: 0; 220 padding: 0; 221} 222 223.form__right { 224 flex: 0 0 auto; 225 display: flex; 226 overflow: auto; 227 flex-direction: column; 228 justify-content: space-between; 229 gap: 20px; 230 width: var(--form-width, 100%); 231} 232 233.dialog__position:has(.editor) .form__right { 234 width: var(--form-width, 272px); 235} 236 237.form__top { 238 display: flex; 239 flex-direction: column; 240 gap: 8px; 241} 242 243.form__error-container { 244 color: var(--error-color); 245 fill: var(--error-color); 246} 247 248.form__label { 249 display: flex; 250 flex-direction: column; 251 gap: 4px; 252 margin: 0px; 253} 254 255.form__label__text { 256 display: flex; 257 gap: 4px; 258 align-items: center; 259} 260 261.form__label__text--required { 262 font-size: 0.85em; 263} 264 265.form__input { 266 font-family: inherit; 267 line-height: inherit; 268 background: transparent; 269 box-sizing: border-box; 270 border: var(--input-border, var(--border)); 271 border-radius: var(--input-border-radius, 6px); 272 color: var(--input-color, inherit); 273 fill: var(--input-color, inherit); 274 font-size: var(--input-font-size, inherit); 275 font-weight: var(--input-font-weight, 500); 276 padding: 6px 12px; 277} 278 279.form__input::placeholder { 280 opacity: 0.65; 281 color: var(--input-placeholder-color, inherit); 282 filter: var(--interactive-filter); 283} 284 285.form__input:focus-visible { 286 outline: var(--input-focus-outline, var(--outline)); 287} 288 289.form__input--textarea { 290 font-family: inherit; 291 resize: vertical; 292} 293 294.error { 295 color: var(--error-color); 296 fill: var(--error-color); 297} 298`,P0=` 299.btn-group { 300 display: grid; 301 gap: 8px; 302} 303 304.btn { 305 line-height: inherit; 306 border: var(--button-border, var(--border)); 307 border-radius: var(--button-border-radius, 6px); 308 cursor: pointer; 309 font-family: inherit; 310 font-size: var(--button-font-size, inherit); 311 font-weight: var(--button-font-weight, 600); 312 padding: var(--button-padding, 6px 16px); 313} 314.btn[disabled] { 315 opacity: 0.6; 316 pointer-events: none; 317} 318 319.btn--primary { 320 color: var(--button-primary-color, var(--accent-foreground)); 321 fill: var(--button-primary-color, var(--accent-foreground)); 322 background: var(--button-primary-background, var(--accent-background)); 323 border: var(--button-primary-border, var(--border)); 324 border-radius: var(--button-primary-border-radius, 6px); 325 font-weight: var(--button-primary-font-weight, 500); 326} 327.btn--primary:hover { 328 color: var(--button-primary-hover-color, var(--accent-foreground)); 329 fill: var(--button-primary-hover-color, var(--accent-foreground)); 330 background: var(--button-primary-hover-background, var(--accent-background)); 331 filter: var(--interactive-filter); 332} 333.btn--primary:focus-visible { 334 background: var(--button-primary-hover-background, var(--accent-background)); 335 filter: var(--interactive-filter); 336 outline: var(--button-primary-focus-outline, var(--outline)); 337} 338 339.btn--default { 340 color: var(--button-color, var(--foreground)); 341 fill: var(--button-color, var(--foreground)); 342 background: var(--button-background, var(--background)); 343 border: var(--button-border, var(--border)); 344 border-radius: var(--button-border-radius, 6px); 345 font-weight: var(--button-font-weight, 500); 346} 347.btn--default:hover { 348 color: var(--button-color, var(--foreground)); 349 fill: var(--button-color, var(--foreground)); 350 background: var(--button-hover-background, var(--background)); 351 filter: var(--interactive-filter); 352} 353.btn--default:focus-visible { 354 background: var(--button-hover-background, var(--background)); 355 filter: var(--interactive-filter); 356 outline: var(--button-focus-outline, var(--outline)); 357} 358`,D0=` 359.success__position { 360 position: fixed; 361 inset: var(--dialog-inset); 362 padding: var(--page-margin); 363 z-index: var(--z-index); 364} 365.success__content { 366 background: var(--success-background, var(--background)); 367 border: var(--success-border, var(--border)); 368 border-radius: var(--success-border-radius, 1.7em/50%);
369 box-shadow: var(--success-box-shadow, var(--box-shadow)); 370 font-weight: var(--success-font-weight, 600); 371 color: var(--success-color); 372 fill: var(--success-color); 373 padding: 12px 24px; 374 line-height: 1.75em; 375 376 display: grid; 377 align-items: center; 378 grid-auto-flow: column; 379 gap: 6px; 380 cursor: default; 381} 382 383.success__icon { 384 display: flex; 385} 386`;function F0(e){const t=fe.createElement("style");return t.textContent=` 387:host { 388 --dialog-inset: var(--inset); 389} 390 391${x0} 392${O0} 393${L0} 394${P0} 395${D0} 396`,e&&t.setAttribute("nonce",e),t}function $0(){const e=Y().getUser(),t=Se().getUser(),n=Xr().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const B0=(()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const o=r,s=e.useSentryUser,i=$0(),a=fe.createElement("div"),c=F0(e.styleNonce);let u="";const d={get el(){return a},appendToDom(){!o.contains(c)&&!o.contains(a)&&(o.appendChild(c),o.appendChild(a))},removeFromDom(){a.remove(),c.remove(),fe.body.style.overflow=u},open(){var p,h;f(!0),(p=e.onFormOpen)==null||p.call(e),(h=x())==null||h.emit("openFeedbackWidget"),u=fe.body.style.overflow,fe.body.style.overflow="hidden"},close(){f(!1),fe.body.style.overflow=u}},l=t==null?void 0:t.createInput({h:re,hooks:T0,dialog:d,options:e}),f=p=>{p0(re(N0,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(s&&(i==null?void 0:i[s.name])||""),defaultEmail:String(s&&(i==null?void 0:i[s.email])||""),onFormClose:()=>{var h;f(!1),(h=e.onFormClose)==null||h.call(e)},onSubmit:n,onSubmitSuccess:(h,g)=>{var _;f(!1),(_=e.onSubmitSuccess)==null||_.call(e,h,g)},onSubmitError:h=>{var g;(g=e.onSubmitError)==null||g.call(e,h)},onFormSubmitted:()=>{var h;(h=e.onFormSubmitted)==null||h.call(e)},open:p}),a)};return d}}));function U0({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),e("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),e("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}function H0(e){const t=fe.createElement("style"),n="#1A141F",r="#302735";return t.textContent=` 397.editor { 398 display: flex; 399 flex-grow: 1; 400 flex-direction: column; 401} 402 403.editor__image-container { 404 justify-items: center; 405 padding: 15px; 406 position: relative; 407 height: 100%; 408 border-radius: var(--menu-border-radius, 6px); 409 410 background-color: ${n}; 411 background-image: repeating-linear-gradient( 412 -145deg, 413 transparent, 414 transparent 8px, 415 ${n} 8px, 416 ${n} 11px 417 ), 418 repeating-linear-gradient( 419 -45deg, 420 transparent, 421 transparent 15px, 422 ${r} 15px, 423 ${r} 16px 424 ); 425} 426 427.editor__canvas-container { 428 width: 100%; 429 height: 100%; 430 position: relative; 431 display: flex; 432 align-items: center; 433 justify-content: center; 434} 435 436.editor__canvas-container > * { 437 object-fit: contain; 438 position: absolute; 439} 440 441.editor__tool-container { 442 padding-top: 8px; 443 display: flex; 444 justify-content: center; 445} 446 447.editor__tool-bar { 448 display: flex; 449 gap: 8px; 450} 451 452.editor__tool { 453 display: flex; 454 padding: 8px 12px; 455 justify-content: center; 456 align-items: center; 457 border: var(--button-border, var(--border)); 458 border-radius: var(--button-border-radius, 6px); 459 background: var(--button-background, var(--background)); 460 color: var(--button-color, var(--foreground)); 461} 462 463.editor__tool--active { 464 background: var(--button-primary-background, var(--accent-background)); 465 color: var(--button-primary-color, var(--accent-foreground)); 466} 467 468.editor__rect { 469 position: absolute; 470 z-index: 2; 471} 472 473.editor__rect button { 474 opacity: 0; 475 position: absolute; 476 top: -12px; 477 right: -12px; 478 cursor: pointer; 479 padding: 0; 480 z-index: 3; 481 border: none; 482 background: none; 483} 484 485.editor__rect:hover button { 486 opacity: 1; 487} 488`,e&&t.setAttribute("nonce",e),t}function W0({h:e}){return function({action:n,setAction:r,options:o}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},o.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},o.hideToolText)))}}function j0({hooks:e}){function t(){var o;const[n,r]=e.useState((o=dt.devicePixelRatio)!=null?o:1);return e.useEffect(()=>{const s=()=>{r(dt.devicePixelRatio)},i=matchMedia(`(resolution: ${dt.devicePixelRatio}dppx)`);
488return i.addEventListener("change",s),()=>{i.removeEventListener("change",s)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:s,onError:i}){const a=t();e.useEffect(()=>{U(null,null,function*(){r();const u=yield Jr.mediaDevices.getDisplayMedia({video:{width:dt.innerWidth*a,height:dt.innerHeight*a},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=fe.createElement("video");yield new Promise((l,f)=>{d.srcObject=u,d.onloadedmetadata=()=>{o(d,a),u.getTracks().forEach(p=>p.stop()),l()},d.play().catch(f)}),s()}).catch(i)},[])}}function z0(e,t,n){switch(e.type){case"highlight":{t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break}case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h);break}}function Xt(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function ga(e,t){Xt(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function _a(e,t,n){Xt(e,{alpha:!0},(r,o)=>{n.length&&(o.fillStyle="rgba(0, 0, 0, 0.25)",o.fillRect(0,0,r.width,r.height)),n.forEach(s=>{z0(s,o,t)})})}function q0({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){const s=j0({hooks:t}),i=W0({h:e}),a=U0({h:e}),c={__html:H0(o.styleNonce).innerText},u=r.el.style,d=({screenshot:l})=>{const[f,p]=t.useState("highlight"),[h,g]=t.useState([]),_=t.useRef(null),y=t.useRef(null),b=t.useRef(null),w=t.useRef(null),[I,O]=t.useState(1),C=t.useMemo(()=>{const M=fe.getElementById(o.id);if(!M)return"white";const D=getComputedStyle(M);return D.getPropertyValue("--button-primary-background")||D.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{const M=()=>{const D=_.current;D&&(Xt(l.canvas,{alpha:!1},G=>{const Z=Math.min(D.clientWidth/G.width,D.clientHeight/G.height);O(Z)}),(D.clientHeight===0||D.clientWidth===0)&&setTimeout(M,0))};return M(),dt.addEventListener("resize",M),()=>{dt.removeEventListener("resize",M)}},[l]);const E=t.useCallback((M,D)=>{Xt(M,{alpha:!0},(G,Z)=>{Z.scale(D,D),G.width=l.canvas.width,G.height=l.canvas.height})},[l]);t.useEffect(()=>{E(y.current,l.dpi),ga(y.current,l.canvas)},[l]),t.useEffect(()=>{E(b.current,l.dpi),Xt(b.current,{alpha:!0},(M,D)=>{D.clearRect(0,0,M.width,M.height)}),_a(b.current,C,h)},[h,C]),t.useEffect(()=>{E(n,l.dpi),ga(n,l.canvas),Xt(fe.createElement("canvas"),{alpha:!0},(M,D)=>{D.scale(l.dpi,l.dpi),M.width=l.canvas.width,M.height=l.canvas.height,_a(M,C,h),ga(n,M)})},[h,l,C]);const F=M=>{if(!f||!w.current)return;const D=w.current.getBoundingClientRect(),G={type:f,x:M.offsetX/I,y:M.offsetY/I},Z=(N,te)=>{const L=(te.clientX-D.x)/I,J=(te.clientY-D.y)/I;return{type:N.type,x:Math.min(N.x,L),y:Math.min(N.y,J),w:Math.abs(L-N.x),h:Math.abs(J-N.y)}},V=N=>{Xt(b.current,{alpha:!0},(te,L)=>{L.clearRect(0,0,te.width,te.height)}),_a(b.current,C,[...h,Z(G,N)])},$=N=>{const te=Z(G,N);te.w*I>=1&&te.h*I>=1&&g(L=>[...L,te]),fe.removeEventListener("mousemove",V),fe.removeEventListener("mouseup",$)};fe.addEventListener("mousemove",V),fe.addEventListener("mouseup",$)},k=t.useCallback(M=>D=>{D.preventDefault(),D.stopPropagation(),g(G=>{const Z=[...G];return Z.splice(M,1),Z})},[]),T={width:`${l.canvas.width*I}px`,height:`${l.canvas.height*I}px`},P=M=>{M.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:c}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:_},e("canvas",{ref:y,id:"background",style:T}),e("canvas",{ref:b,id:"foreground",style:T}),e("div",{ref:w,onMouseDown:F,style:T},h.map((M,D)=>e("div",{key:D,class:"editor__rect",style:{top:`${M.y*I}px`,left:`${M.x*I}px`,width:`${M.w*I}px`,height:`${M.h*I}px`}},e("button",{"aria-label":o.removeHighlightText,onClick:k(D),onMouseDown:P,onMouseUp:P,type:"button"},e(a,null))))))),e(i,{options:o,action:f,setAction:p}))};return function({onError:f}){const[p,h]=t.useState();return s({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((g,_)=>{Xt(fe.createElement("canvas"),{alpha:!1},(y,b)=>{b.scale(_,_),y.width=g.videoWidth,y.height=g.videoHeight,b.drawImage(g,0,0,y.width,y.height),h({canvas:y,dpi:_})}),n.width=g.videoWidth,n.height=g.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(g=>{u.display="block",f(g)}
488,[])}),p?e(d,{screenshot:p}):e("div",null)}}const G0=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const o=fe.createElement("canvas");return{input:q0({h:e,hooks:t,outputBuffer:o,dialog:n,options:r}),value:()=>U(null,null,function*(){const s=yield new Promise(i=>{o.toBlob(i,"image/png")});if(s)return{data:new Uint8Array(yield s.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}})}}})),B=H;let tc=0;function im(){return tc>0}function V0(){tc++,setTimeout(()=>{tc--})}function wr(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){const s=e.__sentry_wrapped__;return typeof s=="function"?s:e}if(Tc(e))return e}catch(o){return e}const r=function(...o){H._sentryWrappedDepth=(H._sentryWrappedDepth||0)+1;try{const s=o.map(i=>wr(i,t));return e.apply(this,s)}catch(s){throw V0(),ot(i=>{i.addEventProcessor(a=>(t.mechanism&&(La(a,void 0),bt(a,t.mechanism)),a.extra=v(m({},a.extra),{arguments:o}),a)),kt(s)}),s}finally{H._sentryWrappedDepth=(H._sentryWrappedDepth||0)-1}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch(o){}Ff(r,e),xe(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch(o){}return r}function Vs(){const e=dn(),{referrer:t}=B.document||{},{userAgent:n}=B.navigator||{},r=m(m({},t&&{Referer:t}),n&&{"User-Agent":n});return{url:e,headers:r}}const Y0=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentStateGraph","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],J0={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function K0(e){return J0[e]||e.replace("Integration","").toLowerCase()}const bd=B;function X0(e,t){return U(this,null,function*(){const n=Y0.includes(e)?K0(e):void 0,r=bd.Sentry=bd.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);const o=r[e];if(typeof o=="function"&&!("_isShim"in o))return o;const s=Q0(n),i=B.document.createElement("script");i.src=s,i.crossOrigin="anonymous",i.referrerPolicy="strict-origin",t&&i.setAttribute("nonce",t);const a=new Promise((l,f)=>{i.addEventListener("load",()=>l()),i.addEventListener("error",f)}),c=B.document.currentScript,u=B.document.body||B.document.head||(c==null?void 0:c.parentElement);if(u)u.appendChild(i);else throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{yield a}catch(l){throw new Error(`Error when loading integration: ${e}`)}const d=r[e];if(typeof d!="function")throw new Error(`Could not load integration: ${e}`);return d})}function Q0(e){var r;const t=x(),n=((r=t==null?void 0:t.getOptions())==null?void 0:r.cdnBaseUrl)||"https://browser.sentry-cdn.com";return new URL(`/${nn}/${e}.min.js`,n).toString()}const RO=Jh({lazyLoadIntegration:X0}),CO=Jh({getModalIntegration:()=>B0,getScreenshotIntegration:()=>G0});function ru(e,t){const n=Ni(e,t),r={type:rw(t),value:ow(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Z0(e,t,n,r){const o=x(),s=o==null?void 0:o.getOptions().normalizeDepth,i=uw(t),a={__serialized__:Uf(t,s)};if(i)return{exception:{values:[ru(e,i)]},extra:a};const c={exception:{values:[{type:ui(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:aw(t,{isUnhandledRejection:r})}]},extra:a};if(n){const u=Ni(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function ya(e,t){return{exception:{values:[ru(e,t)]}}}function Ni(e,t){const n=t.stacktrace||t.stack||"",r=tw(t),o=nw(t);try{return e(n,r,o)}catch(s){}return[]}const ew=/Minified React error #\d+;/i;function tw(e){return e&&ew.test(e.message)?1:0}function nw(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function am(e){return typeof WebAssembly!="undefined"&&typeof WebAssembly.Exception!="undefined"?e instanceof WebAssembly.Exception:!1}function rw(e){const t=e==null?void 0:e.name;return!t&&am(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function ow(e){const t=e==null?void 0:e.message;return am(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Ml(t.error):Ml(e):"No error message"}function sw(e,t,n,r){const o=(n==null?void 0:n.syntheticException)||void 0,s=xi(e,t,o,r);return bt(s),s.level="error",n!=null&&n.event_id&&(s.event_id=n.event_id),Ro(s)}function iw(e,t,n="info",r,o){const s=(r==null?void 0:r.syntheticException)||void 0,i=nc(e,t,s,o);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),Ro(i)}function xi(e,t,n,r,o){var i,a;let s;if(Df(t)&&t.error)return ya(e,t.error);if(Bu(t)||r_(t)){const c=t;if("stack"in t){s=ya(e,t);const u=(a=(i=s.exception)==null?void 0:i.values)==null?void 0:a[0];if(r&&n&&u&&!u.stacktrace){const d=Ni(e,n);d.length&&(u.stacktrace={frames:d},bt(s,{synthetic:!0}))}}else{const u=c.name||(Bu(c)?"DOMError":"DOMException"),d=c.message?`${u}: ${c.message}`:u;s=nc(e,d,n,r),La(s,d)}return"code"in c&&(s.tags=v(m({},s.tags),{"DOMException.code":`${c.code}`})),s}return We(t)?ya(e,t):He(t)||ui(t)?(s=Z0(e,t,n,o),bt(s,{synthetic:!0}),s):(s=nc(e,t,n,r),La(s,`${t}`),bt(s,{synthetic:!0}),s)}function nc(e,t,n,r){const o={};if(r&&n){const s=Ni(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),bt(o,{synthetic:!0})}
488if(ci(t)){const{__sentry_template_string__:s,__sentry_template_values__:i}=t;return o.logentry={message:s,params:i},o}return o.message=t,o}function aw(e,{isUnhandledRejection:t}){const n=s_(e),r=t?"promise rejection":"exception";return Df(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ui(e)?`Event \`${cw(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function cw(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(t){}}function uw(e){return Object.values(e).find(We)}class lw extends _b{constructor(t){var i;const n=dw(t),r=B.SENTRY_SDK_SOURCE||jS();Db(n,"browser",["browser"],r),super(n);const{userInfo:o}=this.getDataCollectionOptions();(i=n._metadata)!=null&&i.sdk&&(n._metadata.sdk.settings=m({infer_ip:o?"auto":"never"},n._metadata.sdk.settings));const{sendClientReports:s}=this._options;B.document&&B.document.addEventListener("visibilitychange",()=>{B.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),o&&this.on("beforeSendSession",Pb)}eventFromException(t,n){return sw(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return iw(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function dw(e){var t;return m({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=B.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},e)}const gt=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,q=H,fw=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Po=(e,t,n,r)=>{let o,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(o!=null?o:0),(s||o===void 0)&&(o=t.value,t.delta=s,t.rating=fw(t.value,n),e(t)))}},Do=(e=!0)=>{var n,r;const t=(r=(n=q.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ur=()=>{var t;const e=Do();return(t=e==null?void 0:e.activationStart)!=null?t:0};function on(e,t,n){q.document&&q.addEventListener(e,t,n)}function Ys(e,t,n){q.document&&q.removeEventListener(e,t,n)}let mr=-1;const cm=new Set,pw=()=>{var e,t;return((e=q.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=q.document)!=null&&t.prerendering)?0:1/0},ws=e=>{if(hw(e)&&mr>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of cm)t();isFinite(mr)||(mr=e.type==="visibilitychange"?e.timeStamp:0,Ys("prerenderingchange",ws,!0))}},Fo=()=>{var e;if(q.document&&mr<0){const t=Ur(),n=q.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime;mr=n!=null?n:pw(),on("visibilitychange",ws,!0),on("pagehide",ws,!0),on("prerenderingchange",ws,!0)}return{get firstHiddenTime(){return mr},onHidden(t){cm.add(t)}}};function hw(e){var t;return e.type==="pagehide"||((t=q.document)==null?void 0:t.visibilityState)==="hidden"}const mw=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,$o=(e,t=-1)=>{var s,i;const n=Do();let r="navigate";return n&&((s=q.document)!=null&&s.prerendering||Ur()>0?r="prerender":(i=q.document)!=null&&i.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:mw(),navigationType:r}},Sa=new WeakMap;function ou(e,t){try{return Sa.get(e)||Sa.set(e,new t),Sa.get(e)}catch(n){return new t}}class gw{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(t){var o;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(o=this._onAfterProcessingUnexpectedShift)==null||o.call(this,t)}}const Hr=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe(m({type:e,buffered:!0},n)),r}}catch(r){}},su=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Oi=e=>{var t;(t=q.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},_w=[1800,3e3],yw=(e,t={})=>{Oi(()=>{const n=Fo(),r=$o("FCP");let o;const i=Hr("paint",a=>{for(const c of a)c.name==="first-contentful-paint"&&(i.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-Ur(),0),r.entries.push(c),o(!0)))});i&&(o=Po(e,r,_w,t.reportAllChanges))})},Sw=[.1,.25],bw=(e,t={})=>{yw(su(()=>{var c;const n=$o("CLS",0);let r;const o=Fo(),s=ou(t,gw),i=u=>{for(const d of u)s._processEntry(d);s._sessionValue>
488n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=Hr("layout-shift",i);a&&(r=Po(e,n,Sw,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),(c=q==null?void 0:q.setTimeout)==null||c.call(q,r))}))};let um=0,ba=1/0,ns=0;const Ew=e=>{e.forEach(t=>{t.interactionId&&(ba=Math.min(ba,t.interactionId),ns=Math.max(ns,t.interactionId),um=ns?(ns-ba)/7+1:0)})};let rc;const lm=()=>rc?um:performance.interactionCount||0,vw=()=>{"interactionCount"in performance||rc||(rc=Hr("event",Ew,{type:"event",buffered:!0,durationThreshold:0}))},Ea=10;let dm=0;const Tw=()=>lm()-dm;class Iw{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){dm=lm(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(Tw()/50));return this._longestInteractionList[t]}_processEntry(t){var o,s;if((o=this._onBeforeProcessingEntry)==null||o.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<Ea||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((i,a)=>a._latency-i._latency),this._longestInteractionList.length>Ea){const i=this._longestInteractionList.splice(Ea);for(const a of i)this._longestInteractionMap.delete(a.id)}(s=this._onAfterProcessingINPCandidate)==null||s.call(this,r)}}}const iu=e=>{var n;const t=q.requestIdleCallback||q.setTimeout;((n=q.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=su(e),on("visibilitychange",e,{once:!0,capture:!0}),on("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Ys("visibilitychange",e,{capture:!0}),Ys("pagehide",e,{capture:!0})}))},ww=[200,500],kw=40,Rw=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Fo();Oi(()=>{var c;vw();const r=$o("INP");let o;const s=ou(t,Iw),i=u=>{iu(()=>{for(const l of u)s._processEntry(l);const d=s._estimateP98LongestInteraction();d&&d._latency!==r.value&&(r.value=d._latency,r.entries=d.entries,o())})},a=Hr("event",i,{durationThreshold:(c=t.durationThreshold)!=null?c:kw});o=Po(e,r,ww,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class Cw{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const Aw=[2500,4e3],Mw=(e,t={})=>{Oi(()=>{const n=Fo(),r=$o("LCP");let o;const s=ou(t,Cw),i=c=>{t.reportAllChanges||(c=c.slice(-1));for(const u of c)s._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-Ur(),0),r.entries=[u],o())},a=Hr("largest-contentful-paint",i);if(a){o=Po(e,r,Aw,t.reportAllChanges);const c=su(()=>{i(a.takeRecords()),a.disconnect(),o(!0)}),u=d=>{d.isTrusted&&(iu(c),Ys(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])on(d,u,{capture:!0})}})},Nw=[800,1800],oc=e=>{var t,n;(t=q.document)!=null&&t.prerendering?Oi(()=>oc(e)):((n=q.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>oc(e),!0):setTimeout(e)},xw=(e,t={})=>{const n=$o("TTFB"),r=Po(e,n,Nw,t.reportAllChanges);oc(()=>{const o=Do();o&&(n.value=Math.max(o.responseStart-Ur(),0),n.entries=[o],r(!0))})},Zr={},Js={};let fm,pm,hm,mm;function Li(e,t=!1){return Di("cls",e,Lw,fm,t)}function Pi(e,t=!1){return Di("lcp",e,Pw,pm,t)}function Ow(e){return Di("ttfb",e,Dw,hm)}function au(e){return Di("inp",e,Fw,mm)}function fn(e,t){return gm(e,t),Js[e]||($w(e),Js[e]=!0),_m(e,t)}function Bo(e,t){const n=Zr[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(o){gt&&S.error(`Error while triggering instrumentation handler. 489Type: ${e} 490Name: ${Ut(r)} 491Error:`,o)}}function Lw(){return bw(e=>{Bo("cls",{metric:e}),fm=e},{reportAllChanges:!0})}function Pw(){return Mw(e=>{Bo("lcp",{metric:e}),pm=e},{reportAllChanges:!0})}function Dw(){return xw(e=>{Bo("ttfb",{metric:e}),hm=e})}function Fw(){return Rw(e=>{Bo("inp",{metric:e}),mm=e})}function Di(e,t,n,r,o=!1){gm(e,t);let s;return Js[e]||(s=n(),Js[e]=!0),r&&t({metric:r}),_m(e,t,o?s:void 0)}function $w(e){const t={};e==="event"&&(t.durationThreshold=0),Hr(e,n=>{Bo(e,{entries:n})},t)}function gm(e,t){Zr[e]=Zr[e]||[],Zr[e].push(t)}function _m(e,t,n){return()=>{n&&n();const r=Zr[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function Bw(e){return"duration"in e}const Uw=80,In={};try{typeof Node!="undefined"&&(In.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element!="undefined"&&(In.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,In.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,In.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,In.getAttribute=Element.prototype.getAttribute),typeof HTMLElement!="undefined"&&(In.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch(e){}function Kt(e,t,n){const r=In[t];if(r)try{return r.call(e,n)}catch(s){}const o=e[t];return typeof o=="function"?o.call(e,n):o}function Me(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",c=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||Uw;for(;n&&s++<r&&(u=Hw(n,d),!(u==="html"||s>1&&i+o.length*c+u.length>=l));)o.push(u),i+=u.length,n=Kt(n,"parentNode");return o.reverse().join(a)}catch(n){return"<unknown>"}}function Hw(e,t){const n=[],r=Kt(e,"tagName");if(!r)return"";if(typeof HTMLElement!="undefined"&&e instanceof HTMLElement){const s=Kt(e,"dataset");if(s){if(s.sentryComponent)return s.sentryComponent;if(s.sentryElement)return s.sentryElement}}n.push(r.toLowerCase());const o=t!=null&&t.length?t.filter(s=>Kt(e,"getAttribute",s)).map(s=>[s,Kt(e,"getAttribute",s)]):null;
491if(o!=null&&o.length)o.forEach(s=>{n.push(`[${s[0]}="${s[1]}"]`)});else{const s=Kt(e,"id");s&&n.push(`#${s}`);const i=Kt(e,"className");if(i&&ft(i)){const a=i.split(/\s+/);for(const c of a)n.push(`.${c}`)}}for(const s of["aria-label","type","name","title","alt"]){const i=Kt(e,"getAttribute",s);i&&n.push(`[${s}="${i}"]`)}return n.join("")}const Ww=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=q.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};on("visibilitychange",t,{capture:!0,once:!0}),on("pagehide",t,{capture:!0,once:!0})};function va(e){return typeof e=="number"&&isFinite(e)}function pn(e,t,n,o){var r=vn(o,[]);const s=Q(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),mi(e,()=>{const i=yn(m({startTime:t},r));return i&&i.end(n),i})}function cu(e){var _;const t=x();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),l=Y(),f=l.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=l.getScopeData().contexts.profile.profile_id}catch(y){}const g=m({release:i,environment:a,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(_=q.navigator)==null?void 0:_.userAgent,"client.address":c?"{{auto}}":void 0},o);return yn({name:n,attributes:g,startTime:s,experimental:{standalone:!0}})}function Yn(){return q.addEventListener&&q.performance}function _e(e){return e/1e3}function jw(e){let t="unknown",n="unknown",r="";for(const o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function Fi(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch(t){return!1}}function $i(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}Ww(()=>{o("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,c)=>{c!=null&&c.isRedirect||(o("navigation"),s(),i())}),i=e.on("afterStartPageLoadSpan",a=>{n=a,i()})}function zw(e){let t=0,n;if(!Fi("layout-shift"))return;const r=Li(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);$i(e,(o,s)=>{qw(t,n,s,o),r()})}function qw(e,t,n,r){var u;gt&&S.log(`Sending CLS span (${e})`);const o=t?_e((ke()||0)+t.startTime):be(),s=Y().getScopeData().transactionName,i=t?Me((u=t.sources[0])==null?void 0:u.node):"Layout shift",a={[ue]:"auto.http.browser.cls",[ve]:"ui.webvital.cls",[_n]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,l)=>{a[`cls.source.${l+1}`]=Me(d.node)});const c=cu({name:i,transaction:s,attributes:a,startTime:o});c&&(c.addEvent("cls",{[Eo]:"",[vo]:e}),c.end(o))}const Gw=6e4;function Uo(e){return e!=null&&e>0&&e<=Gw}function Vw(e){let t=0,n;if(!Fi("largest-contentful-paint"))return;const r=Pi(({metric:o})=>{const s=o.entries[o.entries.length-1];!s||!Uo(o.value)||(t=o.value,n=s)},!0);$i(e,(o,s)=>{Yw(t,n,s,o),r()})}function Yw(e,t,n,r){if(!Uo(e))return;gt&&S.log(`Sending LCP span (${e})`);const o=_e((ke()||0)+((t==null?void 0:t.startTime)||0)),s=Y().getScopeData().transactionName,i=t?Me(t.element):"Largest contentful paint",a={[ue]:"auto.http.browser.lcp",[ve]:"ui.webvital.lcp",[_n]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Me(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const c=cu({name:i,transaction:s,attributes:a,startTime:o});c&&(c.addEvent("lcp",{[Eo]:"millisecond",[vo]:e}),c.end(o))}function Xe(e){return e&&((ke()||performance.timeOrigin)+e)/1e3}function ym(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:o}=jw(e.nextHopProtocol);t["network.protocol.version"]=o,t["network.protocol.name"]=r}return ke()||(n=Yn())!=null&&n.timeOrigin?Jw(v(m({},t),{"http.request.redirect_start":Xe(e.redirectStart),"http.request.redirect_end":Xe(e.redirectEnd),"http.request.worker_start":Xe(e.workerStart),"http.request.fetch_start":Xe(e.fetchStart),"http.request.domain_lookup_start":Xe(e.domainLookupStart),"http.request.domain_lookup_end":Xe(e.domainLookupEnd),"http.request.connect_start":Xe(e.connectStart),"http.request.secure_connection_start":Xe(e.secureConnectionStart),"http.request.connection_end":Xe(e.connectEnd),"http.request.request_start":Xe(e.requestStart),"http.request.response_start":Xe(e.responseStart),"http.request.response_end":Xe(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0})):t}function Jw(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Kw=2147483647;let Ed=0,Ue={},Be,sr;function Xw({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=Yn();if(r&&ke()){r.mark&&q.performance.mark("sentry-tracing-init");const o=t?Vw(n):t===!1?nk():void 0,s=e?zw(n):e===!1?tk():void 0,i=rk(),a=ok();return()=>{i(),a(),o==null||o(),s==null||s()}}return()=>{}}function Qw(){fn("longtask",({entries:e})=>{const t=we();if(!t)return;const{op:n,start_timestamp:r}=Q(t);for(const o of e){const s=_e(ke()+o.startTime),i=_e(o.duration);n==="navigation"&&r&&s<r||pn(t,s,s+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[ue]:"auto.ui.browser.metrics"}})}})}function Zw(){new PerformanceObserver(t=>{const n=we();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=_e(ke()+r.startTime),{start_timestamp:s,op:i}=Q(n);if(i==="navigation"&&s&&o<s)continue;const a=_e(r.duration),c={[ue]:"auto.ui.browser.metrics"}
491,u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;c["browser.script.invoker"]=d,c["browser.script.invoker_type"]=l,f&&(c["code.filepath"]=f),p&&(c["code.function"]=p),h!==-1&&(c["browser.script.source_char_position"]=h),pn(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function ek(){fn("event",({entries:e})=>{const t=we();if(t){for(const n of e)if(n.name==="click"){const r=_e(ke()+n.startTime),o=_e(n.duration),s={name:Me(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[ue]:"auto.ui.browser.metrics"}},i=Xc(n.target);i&&(s.attributes["ui.component_name"]=i),pn(t,r,r+o,s)}}})}function tk(){return Li(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Ue.cls={value:e.value,unit:""},sr=t)},!0)}function nk(){return Pi(({metric:e})=>{const t=e.entries[e.entries.length-1];!t||!Uo(e.value)||(Ue.lcp={value:e.value,unit:"millisecond"},Be=t)},!0)}function rk(){return Ow(({metric:e})=>{e.entries[e.entries.length-1]&&(Ue.ttfb={value:e.value,unit:"millisecond"})})}function ok(){return fn("paint",({entries:e})=>{const t=Fo();for(const n of e){const r=n.startTime<t.firstHiddenTime;n.name==="first-paint"&&r&&(Ue.fp={value:n.startTime,unit:"millisecond"}),n.name==="first-contentful-paint"&&r&&(Ue.fcp={value:n.startTime,unit:"millisecond"})}})}function sk(e,t){const n=Yn(),r=ke();if(!(n!=null&&n.getEntries)||!r)return;const{spanStreamingEnabled:o,ignorePerformanceApiSpans:s,ignoreResourceSpans:i}=t,a=_e(r),c=n.getEntries(),{op:u,start_timestamp:d}=Q(e);c.slice(Ed).forEach(l=>{const f=_e(l.startTime),p=_e(Math.max(0,l.duration));if(!(u==="navigation"&&d&&a+f<d))switch(l.entryType){case"navigation":{lk(e,l,a);break}case"mark":case"paint":case"measure":{ck(e,l,f,p,a,s);break}case"resource":{pk(e,l,l.name,f,p,a,i);break}}}),Ed=Math.max(c.length-1,0),hk(e,o)}function ik(e,t){var a;const n=ke();if(!((a=Yn())!=null&&a.getEntries)||!n){vd();return}const{spanStreamingEnabled:r,recordClsOnPageloadSpan:o,recordLcpOnPageloadSpan:s}=t,i=_e(n);if(Q(e).op==="pageload"){if(_k(Ue),r){const c=(u,d,l)=>{const f=l!=null?l:`browser.web_vital.${u}.value`;e.setAttribute(f,d),gt&&S.log("Setting web vital attribute",{[f]:d},"on pageload span")};["ttfb","fp","fcp"].forEach(u=>{Ue[u]&&c(u,Ue[u].value)}),Ue["ttfb.requestTime"]&&c("ttfb.requestTime",Ue["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else o||delete Ue.cls,s||delete Ue.lcp,Object.entries(Ue).forEach(([c,u])=>{Tp(c,u.value,u.unit,e)}),mk(e,t);e.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",i),e.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",Ur())}vd()}function vd(){Be=void 0,sr=void 0,Ue={}}function ak(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch(t){return}}function ck(e,t,n,r,o,s){if(ak(t)||["mark","measure"].includes(t.entryType)&&rt(t.name,s))return;const i=Do(!1),a=_e(i?i.requestStart:0),c=o+Math.max(n,a),u=o+n,d=u+r,l={[ue]:"auto.resource.browser.metrics"};c!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=c),uk(l,t),c<=d&&pn(e,c,d,{name:t.name,op:t.entryType,attributes:l})}function uk(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&Tt(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch(s){}return}if(Tt(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch(r){}}catch(n){}}function lk(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{rs(e,t,r,n)}),rs(e,t,"secureConnection",n,"TLS/SSL"),rs(e,t,"fetch",n,"cache"),rs(e,t,"domainLookup",n,"DNS"),fk(e,t,n)}function rs(e,t,n,r,o=n){const s=dk(n),i=t[s],a=t[`${n}Start`];!a||!i||pn(e,r+_e(a),r+_e(i),{op:`browser.${o}`,name:t.name,attributes:m({[ue]:"auto.ui.browser.metrics"},n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{})})}function dk(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}
491function fk(e,t,n){const r=n+_e(t.requestStart),o=n+_e(t.responseEnd),s=n+_e(t.responseStart);t.responseEnd&&(pn(e,r,o,{op:"browser.request",name:t.name,attributes:{[ue]:"auto.ui.browser.metrics"}}),pn(e,s,o,{op:"browser.response",name:t.name,attributes:{[ue]:"auto.ui.browser.metrics"}}))}function pk(e,t,n,r,o,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(i!=null&&i.includes(a))return;const c={[ue]:"auto.resource.browser.metrics"},u=xn(n);u.protocol&&(c["url.scheme"]=u.protocol.split(":").pop()),u.host&&(c["server.address"]=u.host),c["url.same_origin"]=n.includes(q.location.origin),c[qn]=n,gk(t,c,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d=m(m({},c),ym(t)),l=s+r,f=l+o;pn(e,l,f,{name:n.replace(q.location.origin,""),op:a,attributes:d})}function hk(e,t){const n=q.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),va(r.rtt)&&(t?e.setAttribute("network.connection.rtt",r.rtt):Q(e).op==="pageload"&&Tp("connection.rtt",r.rtt,"millisecond"))),va(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),va(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function mk(e,t){Be&&t.recordLcpOnPageloadSpan&&(Be.element&&e.setAttribute("lcp.element",Me(Be.element)),Be.id&&e.setAttribute("lcp.id",Be.id),Be.url&&e.setAttribute("lcp.url",Be.url.trim().slice(0,200)),Be.loadTime!=null&&e.setAttribute("lcp.loadTime",Be.loadTime),Be.renderTime!=null&&e.setAttribute("lcp.renderTime",Be.renderTime),e.setAttribute("lcp.size",Be.size)),sr!=null&&sr.sources&&t.recordClsOnPageloadSpan&&sr.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Me(n.node)))}function gk(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s<Kw||typeof s=="string")&&(t[o]=s)})}function _k(e){const t=Do(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const yk="ElementTiming",Sk=(()=>({name:yk,setup(){!Yn()||!ke()||fn("element",({entries:t})=>{for(const n of t){const r=n;if(!r.identifier)continue;const o=r.identifier,s=r.name,i=r.renderTime,a=r.loadTime,c={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":o};s&&(c["ui.element.paint_type"]=s),r.id&&(c["ui.element.id"]=r.id),r.element&&(c["ui.element.type"]=r.element.tagName.toLowerCase()),r.url&&(c["ui.element.url"]=r.url),r.naturalWidth&&(c["ui.element.width"]=r.naturalWidth),r.naturalHeight&&(c["ui.element.height"]=r.naturalHeight),i>0&&qa("ui.element.render_time",i,{unit:"millisecond",attributes:c}),a>0&&qa("ui.element.load_time",a,{unit:"millisecond",attributes:c})}})}})),AO=Sk,Ta=[],eo=new Map,er=new Map,Sm=60;function bk(){if(Yn()&&ke()){const t=Ek();return()=>{t()}}return()=>{}}const fo={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 Ek(){return au(vk)}const vk=({metric:e})=>{if(e.value==null)return;const t=_e(e.value);if(t>Sm)return;const n=e.entries.find(h=>h.duration===e.value&&fo[h.name]);if(!n)return;const{interactionId:r}=n,o=fo[n.name],s=_e(ke()+n.startTime),i=we(),a=i?Ie(i):void 0,c=r!=null?eo.get(r):void 0,u=(c==null?void 0:c.span)||a,d=u?Q(u).description:Y().getScopeData().transactionName,l=(c==null?void 0:c.elementName)||Me(n.target),f={[ue]:"auto.http.browser.inp",[ve]:`ui.interaction.${o}`,[_n]:n.duration},p=cu({name:l,transaction:d,attributes:f,startTime:s});p&&(p.addEvent("inp",{[Eo]:"millisecond",[vo]:e.value}),p.end(s+t))};function Tk(e){return e!=null?eo.get(e):void 0}function Ik(){const e=Object.keys(fo);un()&&e.forEach(o=>{q.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=Me(s),a=Math.round(o.timeStamp);if(er.set(a,i),er.size>50){const c=er.keys().next().value;c!==void 0&&er.delete(c)}}function n(o){const s=Math.round(o.startTime);let i=er.get(s);if(!i)for(let a=-5;a<=5;a++){const c=er.get(s+a);if(c){i=c;break}}return i||"<unknown>"}const r=({entries:o})=>{const s=we(),i=s&&Ie(s);o.forEach(a=>{if(!Bw(a))return;const c=a.interactionId;if(c==null||eo.has(c))return;const u=a.target?Me(a.target):n(a);if(Ta.length>10){const d=Ta.shift();
491eo.delete(d)}Ta.push(c),eo.set(c,{span:i,elementName:u})})};fn("event",r),fn("first-input",r)}function uu(e){var h,g;const{name:t,op:n,origin:r,metricName:o,value:s,attributes:i,parentSpan:a,reportEvent:c,startTime:u,endTime:d}=e,l=Y().getScopeData().transactionName,f=m({[ue]:r,[ve]:n,[_n]:0,[`browser.web_vital.${o}.value`]:s,[Mp]:l,[Pc]:l,"user_agent.original":(h=q.navigator)==null?void 0:h.userAgent},i);a&&((g=Ls(a).attributes)==null?void 0:g[ve])==="pageload"&&(f["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(f[`browser.web_vital.${o}.report_event`]=c);const p=yn({name:t,attributes:f,startTime:u,parentSpan:a});p&&p.end(d!=null?d:u)}function wk(e){let t=0,n;if(!Fi("largest-contentful-paint"))return;const r=Pi(({metric:o})=>{const s=o.entries[o.entries.length-1];!s||!Uo(o.value)||(t=o.value,n=s)},!0);$i(e,(o,s,i)=>{kk(t,n,i,o),r()})}function kk(e,t,n,r){if(!Uo(e))return;gt&&S.log(`Sending LCP span (${e})`);const o=ke()||0,s=_e(o),i=_e(o+((t==null?void 0:t.startTime)||0)),a=t?Me(t.element):"Largest contentful paint",c={};t!=null&&t.element&&(c["browser.web_vital.lcp.element"]=Me(t.element)),t!=null&&t.id&&(c["browser.web_vital.lcp.id"]=t.id),t!=null&&t.url&&(c["browser.web_vital.lcp.url"]=t.url),(t==null?void 0:t.loadTime)!=null&&(c["browser.web_vital.lcp.load_time"]=t.loadTime),(t==null?void 0:t.renderTime)!=null&&(c["browser.web_vital.lcp.render_time"]=t.renderTime),(t==null?void 0:t.size)!=null&&(c["browser.web_vital.lcp.size"]=t.size),uu({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:s,endTime:i})}function Rk(e){let t=0,n;if(!Fi("layout-shift"))return;const r=Li(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);$i(e,(o,s,i)=>{Ck(t,n,i,o),r()})}function Ck(e,t,n,r){var a;gt&&S.log(`Sending CLS span (${e})`);const o=t?_e((ke()||0)+t.startTime):be(),s=t?Me((a=t.sources[0])==null?void 0:a.node):"Layout shift",i={};t!=null&&t.sources&&t.sources.forEach((c,u)=>{i[`browser.web_vital.cls.source.${u+1}`]=Me(c.node)}),uu({name:s,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:i,parentSpan:n,reportEvent:r,startTime:o})}function Ak(){if(!Yn()||!ke())return;au(({metric:n})=>{if(n.value==null||_e(n.value)>Sm)return;const o=n.entries.find(s=>s.duration===n.value&&fo[s.name]);o&&Mk(n.value,o)})}function Mk(e,t){gt&&S.log(`Sending INP span (${e})`);const n=_e(ke()+t.startTime),r=_e(e),o=fo[t.name],s=Tk(t.interactionId),i=we(),a=i?Ie(i):void 0,c=(s==null?void 0:s.span)||a,u=c?Ls(c).name:Y().getScopeData().transactionName,d=(s==null?void 0:s.elementName)||Me(t.target);uu({name:d,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[_n]:t.duration,[Mp]:u,[Pc]:u},startTime:n,endTime:n+r,parentSpan:c})}const Nk=1e3;let Td,sc,ic;function bm(e){hn("dom",e),mn("dom",xk)}function xk(){if(!q.document)return;const e=tt.bind(null,"dom"),t=Id(e,!0);q.document.addEventListener("click",t,!1),q.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var s,i;const o=(s=q[n])==null?void 0:s.prototype;(i=o==null?void 0:o.hasOwnProperty)!=null&&i.call(o,"addEventListener")&&(Oe(o,"addEventListener",function(a){return function(c,u,d){if(c==="click"||c=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[c]=l[c]||{refCount:0};if(!f.handler){const p=Id(e);f.handler=p,a.call(this,c,p,d)}f.refCount++}catch(l){}return a.call(this,c,u,d)}}),Oe(o,"removeEventListener",function(a){return function(c,u,d){if(c==="click"||c=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},f=l[c];f&&(f.refCount--,f.refCount<=0&&(a.call(this,c,f.handler,d),f.handler=void 0,delete l[c]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch(l){}return a.call(this,c,u,d)}}))})}function Ok(e){if(e.type!==sc)return!1;try{if(!e.target||e.target._sentryId!==ic)return!1}catch(t){}return!0}function Lk(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Id(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Pk(n);if(Lk(n.type,r))return;xe(n,"_sentryCaptured",!0),r&&!r._sentryId&&xe(r,"_sentryId",Ae(
491));const o=n.type==="keypress"?"input":n.type;Ok(n)||(e({event:n,name:o,global:t}),sc=n.type,ic=r?r._sentryId:void 0),clearTimeout(Td),Td=q.setTimeout(()=>{ic=void 0,sc=void 0},Nk)}}function Pk(e){try{return e.target}catch(t){return null}}let os;function Bi(e){const t="history";hn(t,e),mn(t,Dk)}function Dk(){if(q.addEventListener("popstate",()=>{const t=q.location.href,n=os;if(os=t,n===t)return;tt("history",{from:n,to:t})}),!wI())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=os,s=Fk(String(r));if(os=s,o===s)return t.apply(this,n);tt("history",{from:o,to:s})}return t.apply(this,n)}}Oe(q.history,"pushState",e),Oe(q.history,"replaceState",e)}function Fk(e){try{return new URL(e,q.location.origin).toString()}catch(t){return e}}const ks={};function lu(e){const t=ks[e];if(t)return t;let n=q[e];if(Ka(n))return ks[e]=n.bind(q);const r=q.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s!=null&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){gt&&S.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(ks[e]=n.bind(q))}function $k(e){ks[e]=void 0}function Ho(...e){return lu("setTimeout")(...e)}const Ft="__sentry_xhr_v3__";function du(e){hn("xhr",e),mn("xhr",Bk)}function Bk(){if(!q.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=be()*1e3,i=ft(r[0])?r[0].toUpperCase():void 0,a=Uk(r[1]);if(!i||!a)return t.apply(n,r);n[Ft]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const u=n[Ft];if(u&&n.readyState===4){try{u.status_code=n.status}catch(l){}const d={endTimestamp:be()*1e3,startTimestamp:s,xhr:n,virtualError:o};tt("xhr",d),n.removeEventListener("readystatechange",c)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return c(),u.apply(d,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[Ft];return h&&ft(f)&&ft(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(d,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[Ft];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:be()*1e3,xhr:n};return tt("xhr",s),t.apply(n,r)}})}function Uk(e){if(ft(e))return e;try{return e.toString()}catch(t){}}const Hk=Symbol.for("sentry__originalRequestBody");function Em(e){return new URLSearchParams(e).toString()}function Ks(e,t=S){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Em(e)];if(!e)return[void 0]}catch(n){return gt&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return gt&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function fu(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const n=e[0][Hk];return n!==void 0?n:void 0}}function vm(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return gt&&S.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r 492`).reduce((n,r)=>{const[o,s]=r.split(": ");return s&&(n[o.toLowerCase()]=s),n},{}):{}}function Wk(e){if(typeof Element=="undefined")return!1;try{return e instanceof Element}catch(t){return!1}}function MO(e){try{return new URL(e,q.location.origin).toString()}catch(t){return e}}const jk=40;function Tm(e,t=lu("fetch")){let n=0,r=0;function o(s){return U(this,null,function*(){const i=s.body.length;n+=i,r++;const a=m({body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);try{const c=yield t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw $k("fetch"),c}finally{n-=i,r--}})}return cb(e,o,Bc(e.bufferSize||jk))}const R=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__;function zk(){const e=x();if(!e){R&&S.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){R&&S.warn("BrowserProfiling integration is not available");return}e.emit("startUIProfiler")}function qk(){const e=x();if(!e){R&&S.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){R&&S.warn("ProfilingIntegration is not available");return}e.emit("stopUIProfiler")}const NO={startProfiler:zk,stopProfiler:qk},Gk=10,Vk=20,Yk=30,Jk=40,Kk=50;function kr(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?vt:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const Xk=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Qk=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Zk=/\((\S*)(?::(\d+))(?::(\d+))\)/,eR=/at (.+?) ?\(data:(.+?),/,tR=e=>{var o;const t=e.match(eR);
492if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=Xk.exec(e);if(n){const[,s,i,a]=n;return kr(s,vt,+i,+a)}const r=Qk.exec(e);if(r){if(((o=r[2])==null?void 0:o.indexOf("eval"))===0){const c=Zk.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,a]=Im(r[1]||vt,r[2]);return kr(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},nR=[Yk,tR],rR=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,oR=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,sR=e=>{const t=rR.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=oR.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||vt;return[o,r]=Im(o,r),kr(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},iR=[Kk,sR],aR=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,cR=e=>{const t=aR.exec(e);return t?kr(t[2],t[1]||vt,+t[3],t[4]?+t[4]:void 0):void 0},xO=[Jk,cR],uR=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,lR=e=>{const t=uR.exec(e);return t?kr(t[2],t[3]||vt,+t[1]):void 0},OO=[Gk,lR],dR=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,fR=e=>{const t=dR.exec(e);return t?kr(t[5],t[3]||t[4]||vt,+t[1],+t[2]):void 0},LO=[Vk,fR],pR=[nR,iR],hR=xf(...pR),Im=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:vt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function PO(e,{metadata:t,tunnel:n,dsn:r}){const o=m(m({event_id:e.event_id,sent_at:new Date().toISOString()},(t==null?void 0:t.sdk)&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!n&&!!r&&{dsn:At(r)}),s=mR(e);return st(o,[s])}function mR(e){return[{type:"user_report"},e]}const ss=1024,gR="Breadcrumbs",_R=((e={})=>{const t=m({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:gR,setup(n){t.console&&Uc(ER(n)),t.dom&&bm(bR(n,t.dom)),t.xhr&&du(vR(n)),t.fetch&&Ai(TR(n)),t.history&&Bi(IR(n)),t.sentry&&n.on("beforeSendEvent",SR(n))}}}),yR=_R;function SR(e){return function(n){x()===e&&Wt({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:wn(n)},{event:n})}}function bR(e,t){return function(r){if(x()!==e)return;let o,s,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>ss&&(R&&S.warn(`\`dom.maxStringLength\` cannot exceed ${ss}, but a value of ${a} was configured. Sentry will use ${ss} instead.`),a=ss),typeof i=="string"&&(i=[i]);try{const u=r.event,d=wR(u)?u.target:u;o=Me(d,{keyAttrs:i,maxStringLength:a}),s=Xc(d)}catch(u){o="<unknown>"}if(o.length===0)return;const c={category:`ui.${r.name}`,message:o};s&&(c.data={"ui.component_name":s}),Wt(c,{event:r.event,name:r.name,global:r.global})}}function ER(e){return function(n){if(x()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Hs(n.level),message:Ns(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Ns(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Wt(r,{input:n.args,level:n.level})}}function vR(e){return function(n){if(x()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[Ft];if(!r||!o||!s)return;const{method:i,url:a,status_code:c,body:u}=s,d={method:i,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},f={category:"xhr",data:d,type:"http",level:$h(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),Wt(f,l)}}function TR(e){return function(n){if(x()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},i={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),Wt(i,s)}else{const s=n.response,i=v(m({},n.fetchData),{status_code:s==null?void 0:s.status}),a={input:n.args,response:s,startTimestamp:r,endTimestamp:o},c={category:"fetch",data:i,type:"http",level:$h(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),Wt(c,a)}}}function IR(e){return function(n){if(x()!==e)return;let r=n.from,o=n.to;const s=xn(B.location.href);let i=r?xn(r):void 0;const a=xn(o);i!=null&&i.path||(i=s),s.protocol===a.protocol&&s.host===a.host&&(o=a.relative),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),Wt({category:"navigation",data:{from:r,to:o}})}}function wR(e){return!!e&&!!e.target}const kR="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDB
492Request,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),RR="BrowserApiErrors",CR=((e={})=>{const t=m({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},e);return{name:RR,setupOnce(){t.setTimeout&&Oe(B,"setTimeout",wd),t.setInterval&&Oe(B,"setInterval",wd),t.requestAnimationFrame&&Oe(B,"requestAnimationFrame",MR),t.XMLHttpRequest&&"XMLHttpRequest"in B&&Oe(XMLHttpRequest.prototype,"send",NR);const n=t.eventTarget;n&&(Array.isArray(n)?n:kR).forEach(o=>xR(o,t))}}}),AR=CR;function wd(e){return function(...t){const n=t[0];return t[0]=wr(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Ut(e)}`}}),e.apply(this,t)}}function MR(e){return function(t){return e.apply(this,[wr(t,{mechanism:{data:{handler:Ut(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function NR(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Oe(n,o,function(s){const i={mechanism:{data:{handler:Ut(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=Tc(s);return a&&(i.mechanism.data.handler=Ut(a)),wr(s,i)})}),e.apply(this,t)}}function xR(e,t){var o,s;const r=(o=B[e])==null?void 0:o.prototype;(s=r==null?void 0:r.hasOwnProperty)!=null&&s.call(r,"addEventListener")&&(Oe(r,"addEventListener",function(i){return function(a,c,u){try{OR(c)&&(c.handleEvent=wr(c.handleEvent,{mechanism:{data:{handler:Ut(c),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch(d){}return t.unregisterOriginalCallbacks&&LR(this,a,c),i.apply(this,[a,wr(c,{mechanism:{data:{handler:Ut(c),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),Oe(r,"removeEventListener",function(i){return function(a,c,u){try{if(Object.prototype.hasOwnProperty.call(c,"__sentry_wrapped__")){const d=c.__sentry_wrapped__;d&&i.call(this,a,d,u)}}catch(d){}return i.call(this,a,c,u)}}))}function OR(e){return typeof e.handleEvent=="function"}function LR(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const PR=(e={})=>{var n;const t=(n=e.lifecycle)!=null?n:"route";return{name:"BrowserSession",setupOnce(){if(typeof B.document=="undefined"){R&&S.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}pl({ignoreDuration:!0});let r=!1;iu(()=>{r||(oa(),r=!0)});const o=Se();let s=o.getUser();o.addScopeListener(i=>{const a=i.getUser();((s==null?void 0:s.id)!==(a==null?void 0:a.id)||(s==null?void 0:s.ip_address)!==(a==null?void 0:a.ip_address))&&(s=a,r&&oa())}),t==="route"&&Bi(({from:i,to:a})=>{i!==a&&(pl({ignoreDuration:!0}),oa(),r=!0)})}}},DR="CultureContext",FR=(()=>({name:DR,preprocessEvent(e){var n;const t=kd();t&&(e.contexts=v(m({},e.contexts),{culture:m(m({},t),(n=e.contexts)==null?void 0:n.culture)}))},processSegmentSpan(e){const t=kd();t&&cn(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),$R=FR;function kd(){try{const e=B.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch(e){return}}const BR="GlobalHandlers",UR=((e={})=>{const t=m({onerror:!0,onunhandledrejection:!0},e);return{name:BR,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(WR(n),Rd("onerror")),t.onunhandledrejection&&(jR(n),Rd("onunhandledrejection"))}}}),HR=UR;function WR(e){Of(t=>{const{stackParser:n,attachStacktrace:r}=Rm();if(x()!==e||im())return;const{msg:o,url:s,line:i,column:a,error:c}=t,u=zR(xi(n,c||o,void 0,r,!1),s,i,a);u.level="error",Co(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function jR(e){Lf(t=>{const{stackParser:n,attachStacktrace:r}=Rm();if(x()!==e||im())return;const o=wm(t),s=Tt(o)?km(o):xi(n,o,void 0,r,!0);s.level="error",Co(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function wm(e){if(Tt(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(t){}return e}function km(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function zR(e,t,n,r){var u;const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[];
492return c.length===0&&c.push({colno:r,lineno:n,filename:(u=qR(t))!=null?u:dn(),function:vt,in_app:!0}),e}function Rd(e){R&&S.log(`Global Handler attached: ${e}`)}function Rm(){const e=x();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function qR(e){if(!(!ft(e)||e.length===0))return e.startsWith("data:")?`<${pt(e,!1)}>`:e}const GR=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!B.navigator&&!B.location&&!B.document)return;const t=Vs(),n=m(m({},t.headers),(r=e.request)==null?void 0:r.headers);e.request=v(m(m({},t),e.request),{headers:n})},processSpan(e){var n;if(!B.navigator&&!B.location&&!B.document)return;const t=Vs();cn(e,m({[lS]:t.headers["User-Agent"]},e.is_segment&&{[qn]:((n=e.attributes)==null?void 0:n[oS])!=="http.client"?t.url:void 0,[`${rS}.referer`]:t.headers.Referer}))}}),VR="cause",YR=5,JR="LinkedErrors",KR=((e={})=>{const t=e.limit||YR,n=e.key||VR;return{name:JR,preprocessEvent(r,o,s){const i=s.getOptions();eE(ru,i.stackParser,n,t,r,o)}}}),XR=KR,QR=/^HTML(\w*)Element$/;function ZR(e){if(typeof window!="undefined"&&e===window)return"[Window]";if(typeof document!="undefined"&&e===document)return"[Document]";if(Wk(e)){const t=eC(e);if(QR.test(t))return`[HTMLElement: ${Me(e)}]`}}function eC(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function tC(){return nC()?(R&&qt(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function nC(){var o;if(typeof B.window=="undefined")return!1;const e=B;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((o=t==null?void 0:t.runtime)!=null&&o.id))return!1;const n=dn();return!(B===B.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function rC(e){return[Gb(),Wb(),nv(),AR(),yR(),HR(),XR(),lE(),GR(),$R(),PR()]}function DO(e={}){const t=!e.skipBrowserExtensionCheck&&tC();let n=e.defaultIntegrations==null?rC():e.defaultIntegrations;const r=v(m({},e),{enabled:t?!1:e.enabled,stackParser:Qg(e.stackParser||hR),integrations:$S({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Tm});return l_(ZR),vb(lw,r)}function FO(){}function $O(e){e()}function BO(e={}){const t=B.document,n=(t==null?void 0:t.head)||(t==null?void 0:t.body);if(!n){R&&S.error("[showReportDialog] Global document not defined");return}const r=Y(),o=x(),s=o==null?void 0:o.getDsn();if(!s){R&&S.error("[showReportDialog] DSN not configured");return}const i=v(m({},e),{user:m(m({},r.getUser()),e.user),eventId:e.eventId||MS()}),a=B.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=DS(s,i);const{onLoad:c,onClose:u}=i;if(c&&(a.onload=c),u){const d=l=>{if(l.data==="__sentry_reportdialog_closed__")try{u()}finally{B.removeEventListener("message",d)}};B.addEventListener("message",d)}n.appendChild(a)}const oC=H,sC="ReportingObserver",Cd=new WeakMap,iC=((e={})=>{const t=e.types||["crash","deprecation","intervention"];function n(r){if(Cd.has(x()))for(const o of r)ot(s=>{s.setExtra("url",o.url);const i=`ReportingObserver [${o.type}]`;let a="No details available";if(o.body){const c={};for(const u in o.body)c[u]=o.body[u];if(s.setExtra("body",c),o.type==="crash"){const u=o.body;a=[u.crashId||"",u.reason||""].join(" ").trim()||a}else a=o.body.message||a}CS(`${i}: ${a}`)})}return{name:sC,setupOnce(){if(!RI())return;new oC.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){Cd.set(r,!0)}}}),UO=iC,aC="HttpClient",cC=((e={})=>{const t=m({failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/]},e);return{name:aC,setup(n){mC(n,t),gC(n,t)}}}),HO=cC;function uC(e,t,n,r,o){if(Cm(e,n.status,n.url)){const s=_C(t,r);let i,a,c,u;const d=Mm();if(d.requestHeaders!==!1&&(i=co(Ad(s.headers),d.requestHeaders)),d.responseHeaders!==!1&&(a=co(Ad(n.headers),d.responseHeaders)),d.cookies!==!1){const f=s.headers.get("Cookie")||void 0;if(f){const h=ja(f,d.cookies);typeof h=="object"&&(c=h)}const p=n.headers.get("Set-Cookie")||void 0;if(p){const h=ja(p,d.cookies);typeof h=="object"&&(u=h)}}const l=Am({url:s.url,method:s.method,status:n.status,requestHeaders:i,responseHeaders:a,requestCookies:c,responseCookies:u,error:o,type:"fetch"});Co(l)}}function lC(e,t,n,r,o){if(Cm(e,t.status,t.responseURL)){let s,i,a;const c=Mm();if(c.cookies!==!1)try{const d=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;if(d){const l=ja(d,c.cookies);typeof l=="object"&&(i=l)}}catch(d){}if(c.responseHeaders!==!1)try{a=co(fC(t),c.responseHeaders)}catch(d){}c.requestHeaders!==!1&&(s=co(r,c.requestHeaders));const u=Am({url:t.responseURL,method:n,status:t.status,requestHeaders:s,responseHeaders:a,responseCookies:i,error:o,type:"xhr"});Co(u)}}function dC(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function Ad(e){const t={};return e.forEach((n,r)=>{t[r]=n}),t}function fC(e){const t=e.getAllResponseHeaders();return t?t.split(`\r 493`).reduce((n,r)=>{const[o,s]=r.split(": ");return o&&s&&(n[o]=s),n},{}):{}}function pC(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function hC(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function mC(e,t){Bh()&&Ai(n=>{if(x()!==e)return;const{response:r,args:o,error:s,virtualError:i}=n,[a,c]=o;r&&uC(t,a,r,c,s||i)},!1)}function gC(e,t){"XMLHttpRequest"in H&&du(n=>{if(x()!==e)return;const{error:r,virtualError:o}=n,s=n.xhr,i=s[Ft];if(!i)return;const{method:a,request_headers:c}=i;
493try{lC(t,s,a,c,r||o)}catch(u){R&&S.warn("Error while extracting response event form XHR response",u)}})}function Cm(e,t,n){return hC(e.failedRequestStatusCodes,t)&&pC(e.failedRequestTargets,n)&&!rh(n,x())}function Am(e){const t=x(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,o=`HTTP Client Error with status code: ${e.status}`,s={message:o,exception:{values:[{type:"Error",value:o,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:dC(e.responseHeaders)}}};return bt(s,{type:`auto.http.client.${e.type}`,handled:!1}),s}function _C(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function Mm(){const e=x();if(!e)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};const t=e.getOptions();if(t.dataCollection==null){const o=!!t.sendDefaultPii;return{cookies:o,requestHeaders:o,responseHeaders:o}}const{cookies:n,httpHeaders:r}=e.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}const Ia=H,yC=7,SC="ContextLines",bC=((e={})=>({name:SC,processEvent(t,n,r){var s,i;const o=(i=(s=e.frameContextLines)!=null?s:r==null?void 0:r.getDataCollectionOptions().frameContextLines)!=null?i:yC;return EC(t,o)}})),WO=bC;function EC(e,t){var a;const n=Ia.document,r=Ia.location&&nh(Ia.location.href);if(!n||!r)return e;const o=(a=e.exception)==null?void 0:a.values;if(!(o!=null&&o.length))return e;const s=n.documentElement.innerHTML;if(!s)return e;const i=["<!DOCTYPE html>","<html>",...s.split(` 494`),"</html>"];return o.forEach(c=>{const u=c.stacktrace;u!=null&&u.frames&&(u.frames=u.frames.map(d=>vC(d,i,r,t)))}),e}function vC(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||__(t,e,r),e}const TC="GraphQLClient",IC=(e=>({name:TC,setup(t){wC(t,e),kC(t,e)}}));function wC(e,t){e.on("beforeOutgoingRequestSpan",(n,r)=>{const s=Q(n).data||{};if(!(s[ve]==="http.client"))return;const c=s[qn]||s["http.url"]||s.url,u=s[j_]||s["http.method"];if(!ft(c)||!ft(u))return;const{endpoints:d}=t,l=rt(c,d),f=xm(r);if(l&&f){const p=Om(f);if(p){const h=Nm(p);n.updateName(`${u} ${c} (${h})`),Ui(p)&&e.getDataCollectionOptions().graphQL.document===!0&&n.setAttribute(Cp,p.query),Hi(p)&&(n.setAttribute("graphql.persisted_query.hash.sha256",p.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",p.extensions.persistedQuery.version))}}})}function kC(e,t){e.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{const{category:o,type:s,data:i}=n;if(s==="http"&&(o==="fetch"||o==="xhr")){const d=i==null?void 0:i.url,{endpoints:l}=t,f=rt(d,l),p=xm(r);if(f&&i&&p){const h=Om(p);if(!i.graphql&&h){const g=Nm(h);i["graphql.operation"]=g,Ui(h)&&e.getDataCollectionOptions().graphQL.document===!0&&(i[Cp]=h.query),Hi(h)&&(i["graphql.persisted_query.hash.sha256"]=h.extensions.persistedQuery.sha256Hash,i["graphql.persisted_query.version"]=h.extensions.persistedQuery.version)}}}})}function Nm(e){if(Hi(e))return`persisted ${e.operationName}`;if(Ui(e)){const{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=RC(t);return r?`${o} ${r}`:`${o}`}return"unknown"}function xm(e){const t="xhr"in e;let n;if(t){const r=e.xhr[Ft];n=r&&Ks(r.body)[0]}else{const r=fu(e.input);n=Ks(r)[0]}return n}function RC(e){const t=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=e.match(t);if(r)return{operationType:r[1],operationName:r[2]};const o=e.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function Ui(e){return nt(e)&&typeof e.query=="string"}function Hi(e){return nt(e)&&typeof e.operationName=="string"&&nt(e.extensions)&&nt(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash=="string"&&typeof e.extensions.persistedQuery.version=="number"}function Om(e){try{const t=JSON.parse(e);return Ui(t)||Hi(t)?t:void 0}catch(t){return}}const jO=IC,zO=(e={})=>{const t=["script"];function n(r,o,s=0){var a;if(!r)return;const i="shadowRoot"in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(const c of i){if(!(c instanceof HTMLElement))continue;const u=Xc(c,1)||void 0,d=c.tagName.toLowerCase();if(t.includes(d))continue;const l=((a=e.onElement)==null?void 0:a.call(e,{element:c,componentName:u,tagName:d,depth:s}))||{};if(l==="skip")continue;if(l==="children"){n(c,o,s+1);continue}const{x:f,y:p,width:h,height:g}=c.getBoundingClientRect(),_=m({identifier:c.id||void 0,type:u||d,visible:!0,alpha:1,height:g,width:h,x:f,y:p},l),y=[];_.children=y,n(c,_.children,s+1),o.push(_)}}return{name:"ViewHierarchy",processEvent:(r,o)=>{var a,c;if(r.type!==void 0||((a=e.shouldAttach)==null?void 0:a.call(e,r,o))===!1)return r;const s={rendering_system:"DOM",positioning:"absolute",windows:[]};n(((c=e.rootElement)==null?void 0:c.call(e))||B.document.body,s.windows);const i={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(s)};return o.attachments=o.attachments||[],o.attachments.push(i),r}}},ge=H,pu="sentryReplaySession",CC="replay_event",hu="Unable to send Replay",AC=3e5,MC=9e5,NC=5e3,xC=5500,OC=6e4,LC=5e3,PC=3,Md=15e4,is=5e3,DC=3e3,FC=300,mu=2e7,$C=4999,BC=5e4,Nd=36e5;var UC=Object.defineProperty,HC=(e,t,n)=>t in e?UC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xd=(e,t,n)=>HC(e,typeof t!="symbol"?t+"":t,n),Re=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Re||{});
494function WC(e){return e.nodeType===e.ELEMENT_NODE}function to(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function no(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function jC(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function zC(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Xs(e){try{const t=e.rules||e.cssRules;return t?jC(Array.from(t,Lm).join("")):null}catch(t){return null}}function qC(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,o=r[n],s=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${s?" !important":""};`}return`${e.selectorText} { ${t} }`}function Lm(e){let t;if(VC(e))try{t=Xs(e.styleSheet)||zC(e)}catch(n){}else if(YC(e)){let n=e.cssText;const r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=qC(e)),r&&(n=GC(n)),r||o)return n}return t||e.cssText}function GC(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function VC(e){return"styleSheet"in e}function YC(e){return"selectorText"in e}let Pm=class{constructor(){xd(this,"idNodeMap",new Map),xd(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function JC(){return new Pm}function Wi({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function po({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Rr(e){return e.toLowerCase()}function ac(e){return e.toUpperCase()}const Od="__rrweb_original__";function KC(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){const s=t.getImageData,i=Od in s?s[Od]:s;if(new Uint32Array(i.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer).some(c=>c!==0))return!1}return!0}function gu(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Rr(t):null}function Qs(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function Dm(e,t){var s;let n;try{n=new URL(e,t!=null?t:window.location.href)}catch(i){return null}const r=/\.([0-9a-z]+)(?:$)/i,o=n.pathname.match(r);return(s=o==null?void 0:o[1])!=null?s:null}const Ld={};function Fm(e){const t=Ld[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch(o){}return Ld[e]=r.bind(window)}function cc(...e){return Fm("setTimeout")(...e)}function $m(...e){return Fm("clearTimeout")(...e)}function Bm(e){try{return e.contentDocument}catch(t){}}function XC(e){try{return e.contentWindow}catch(t){}}let QC=1;const ZC=new RegExp("[^a-z0-9-_:]"),ho=-2;function _u(){return QC++}function eA(e){if(e instanceof HTMLFormElement)return"form";const t=Rr(e.tagName);return ZC.test(t)?"div":t}function tA(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let tr,Pd;const nA=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,rA=/^(?:[a-z+]+:)?\/\//i,oA=/^www\..*/i,sA=/^(data:)([^,]*),(.*)/i;function iA(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;const s=o.indexOf(":");if(s===-1){r.push(o);continue}const i=o.slice(0,s).trim();t.has(i)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Zs(e,t){return(e||"").replace(nA,(n,r,o,s,i,a)=>{const c=o||i||a,u=r||s||"";if(!c)return n;if(rA.test(c)||oA.test(c))return`url(${u}${c}${u})`;if(sA.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${tA(t)+c}${u})`;const d=t.split("/"),l=c.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const aA=/^[^ \t\n\r\u000c]+/,cA=/^[, \t\n\r\u000c]+/;function uA(e,t){if(t.trim()==="")return t;let n=0;function r(s){let i;const a=s.exec(t.substring(n));return a?(i=a[0],n+=i.length,i):""}const o=[];for(;r(cA),!(n>=t.length);){let s=r(aA);if(s.slice(-1)===",")s=ir(e,s.substring(0,s.length-1)),o.push(s);else{let i="";s=ir(e,s);let a=!1;for(;;){const c=t.charAt(n);if(c===""){o.push((s+i).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,o.push((s+i).trim());break}else c==="("&&(a=!0);i+=c,n+=1}}}return o.join(", ")}const Dd=new WeakMap;function ir(e,t){return!t||t.trim()===""?t:ji(e,t)}function lA(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ji(e,t){let n=Dd.get(e);if(n||(n=e.createElement("a"),Dd.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Um(e,t,n,r,o,s,i){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return ir(e,r);if(n==="xlink:href"&&r[0]!=="#")return ir(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return ir(e,r);if(n==="srcset")return uA(e,r);if(n==="style"){let a=Zs(r,ji(e));return i&&i.size>0&&(a=iA(a,i)),a}else if(t==="object"&&n==="data")return ir(e,r);return typeof s=="function"?s(n,r,o):r}function Hm(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function dA(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){const s=e.classList[o];if(t.test(s))return!0}if(n)return e.matches(n)}catch(o){}return!1}function fA(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Cn(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Cn(e.parentNode,t,n,r+1)}function ar(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(fA(r,e))return!0}return!!(t&&r.matches(t))}catch(o){return!1}}}function Cr(e,t,n,r,o,s){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(i.tagName==="INPUT"){const u=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let a=-1,c=-1;if(s){if(c=Cn(i,ar(r,o)),c<0)return!0;a=Cn(i,ar(t,n),c>=0?c:1/0)}else{if(a=Cn(i,ar(t,n)),a<0)return!1;c=Cn(i,ar(r,o),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!s}catch(i){}return!!s}function pA(e,t,n){const r=XC(e);if(!r)return;let o=!1,s;try{s=r.document.readyState}catch(a){return}if(s!=="complete"){const a=cc(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{$m(a),o=!0,t()});return}const i="about:blank";if(r.location.href!==i||e.src===i||e.src==="")return cc(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function hA(e,t,n){let r=!1,o;try{o=e.sheet}catch(i){o=null}if(o)return;const s=cc(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{$m(s),r=!0,t()})}function mA(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:g,maskInputFn:_,dataURLOptions:y={}
494,inlineImages:b,recordCanvas:w,keepIframeSrcFn:I,newlyAddedElement:O=!1,ignoreCSSAttributes:C}=t,E=gA(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Re.Document,childNodes:[],compatMode:e.compatMode}:{type:Re.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Re.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:E};case e.ELEMENT_NODE:return yA(e,{doc:n,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:h,maskInputFn:_,dataURLOptions:y,inlineImages:b,recordCanvas:w,keepIframeSrcFn:I,newlyAddedElement:O,rootId:E,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:C});case e.TEXT_NODE:return _A(e,{doc:n,maskAllText:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:g,maskInputOptions:h,maskInputFn:_,rootId:E});case e.CDATA_SECTION_NODE:return{type:Re.CDATA,textContent:"",rootId:E};case e.COMMENT_NODE:return{type:Re.Comment,textContent:e.textContent||"",rootId:E};default:return!1}}function gA(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function _A(e,t){var y;const{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:s,unmaskTextSelector:i,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=l==="STYLE"?!0:void 0,h=l==="SCRIPT"?!0:void 0,g=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(y=e.parentNode.sheet)!=null&&y.cssRules&&(f=Xs(e.parentNode.sheet))}catch(b){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${b}`,e)}f=Zs(f,ji(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=Cr(e,r,s,o,i,n);if(!p&&!h&&!g&&f&&_&&(f=a?a(f,e.parentElement):f.replace(/[\S]/g,"*")),g&&f&&(c.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const b=Wi({type:null,tagName:l,maskInputOptions:c});f=po({isMasked:Cr(e,r,s,o,i,b),element:e,value:f,maskInputFn:u})}return{type:Re.Text,textContent:f||"",isStyle:p,rootId:d}}function yA(e,t){const{doc:n,blockClass:r,blockSelector:o,unblockSelector:s,inlineStylesheet:i,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:g,maskTextClass:_,unmaskTextClass:y,maskTextSelector:b,unmaskTextSelector:w,ignoreCSSAttributes:I}=t,O=dA(e,r,o,s),C=eA(e);let E={};const F=e.attributes.length;for(let T=0;T<F;T++){const P=e.attributes[T];P.name&&!Hm(C,P.name,P.value)&&(E[P.name]=Um(n,C,Rr(P.name),P.value,e,c,I))}if(C==="link"&&i){const T=Array.from(n.styleSheets).find(M=>M.href===e.href);let P=null;T&&(P=Xs(T)),P&&(E.rel=null,E.href=null,E.crossorigin=null,E._cssText=Zs(P,T.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const T=Xs(e.sheet);T&&(E._cssText=Zs(T,ji(n)))}if(C==="input"||C==="textarea"||C==="select"||C==="option"){const T=e,P=gu(T),M=Qs(T,ac(C),P),D=T.checked;if(P!=="submit"&&P!=="button"&&M){const G=Cr(T,_,b,y,w,Wi({type:P,tagName:ac(C),maskInputOptions:a}));E.value=po({isMasked:G,element:T,value:M,maskInputFn:u})}D&&(E.checked=D)}if(C==="option"&&(e.selected&&!a.select?E.selected=!0:delete E.selected),C==="canvas"&&f){if(e.__context==="2d")KC(e)||(E.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const T=e.toDataURL(d.type,d.quality),P=n.createElement("canvas");P.width=e.width,P.height=e.height;const M=P.toDataURL(d.type,d.quality);T!==M&&(E.rr_dataURL=T)}}if(C==="img"&&l){tr||(tr=n.createElement("canvas"),Pd=tr.getContext("2d"));const T=e,P=T.currentSrc||T.getAttribute("src")||"<unknown-src>",M=T.crossOrigin,D=()=>{T.removeEventListener("load",D);try{tr.width=T.naturalWidth,tr.height=T.naturalHeight,Pd.drawImage(T,0,0),E.rr_dataURL=tr.toDataURL(d.type,d.quality)}catch(G){if(T.crossOrigin!=="anonymous"){T.crossOrigin="anonymous",T.complete&&T.naturalWidth!==0?D():T.addEventListener("load",D);return}else console.warn(`Cannot inline img src=${P}! Error: ${G}`)}T.crossOrigin==="anonymous"&&(M?E.crossOrigin=M:T.removeAttribute("crossorigin"))};
494T.complete&&T.naturalWidth!==0?D():T.addEventListener("load",D)}if((C==="audio"||C==="video")&&(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop)),O){const{width:T,height:P}=e.getBoundingClientRect();E={class:E.class,rr_width:`${T}px`,rr_height:`${P}px`}}C==="iframe"&&!p(E.src)&&(!O&&!Bm(e)&&(E.rr_src=E.src),delete E.src);let k;try{customElements.get(C)&&(k=!0)}catch(T){}return{type:Re.Element,tagName:C,attributes:E,childNodes:[],isSVG:lA(e)||void 0,needBlock:O,rootId:g,isCustom:k}}function me(e){return e==null?"":e.toLowerCase()}function SA(e,t){if(t.comment&&e.type===Re.Comment)return!0;if(e.type===Re.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Dm(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(me(e.attributes.name).match(/^msapplication-tile(image|color)$/)||me(e.attributes.name)==="application-name"||me(e.attributes.rel)==="icon"||me(e.attributes.rel)==="apple-touch-icon"||me(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&me(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(me(e.attributes.property).match(/^(og|twitter|fb):/)||me(e.attributes.name).match(/^(og|twitter):/)||me(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(me(e.attributes.name)==="robots"||me(e.attributes.name)==="googlebot"||me(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(me(e.attributes.name)==="author"||me(e.attributes.name)==="generator"||me(e.attributes.name)==="framework"||me(e.attributes.name)==="publisher"||me(e.attributes.name)==="progid"||me(e.attributes.property).match(/^article:/)||me(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(me(e.attributes.name)==="google-site-verification"||me(e.attributes.name)==="yandex-verification"||me(e.attributes.name)==="csrf-token"||me(e.attributes.name)==="p:domain_verify"||me(e.attributes.name)==="verify-v1"||me(e.attributes.name)==="verification"||me(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function cr(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b,dataURLOptions:w={}
494,inlineImages:I=!1,recordCanvas:O=!1,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:F=5e3,onBlockedImageLoad:k,onStylesheetLoad:T,stylesheetLoadTimeout:P=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:D=!1,ignoreCSSAttributes:G}=t;let{preserveWhiteSpace:Z=!0}=t;const V=mA(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,dataURLOptions:w,inlineImages:I,recordCanvas:O,keepIframeSrcFn:M,newlyAddedElement:D,ignoreCSSAttributes:G});if(!V)return console.warn(e,"not serialized"),null;let $;r.hasNode(e)?$=r.getId(e):SA(V,b)||!Z&&V.type===Re.Text&&!V.isStyle&&!V.textContent.trim().length?$=ho:$=_u();const N=Object.assign(V,{id:$});if(r.add(e,N),$===ho)return null;C&&C(e);let te=!f;if(N.type===Re.Element){te=te&&!N.needBlock;const L=e.shadowRoot;L&&no(L)&&(N.isShadowHost=!0)}if((N.type===Re.Document||N.type===Re.Element)&&te){b.headWhitespace&&N.type===Re.Element&&N.tagName==="head"&&(Z=!1);const L={doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:I,recordCanvas:O,preserveWhiteSpace:Z,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:F,onBlockedImageLoad:k,onStylesheetLoad:T,stylesheetLoadTimeout:P,keepIframeSrcFn:M,ignoreCSSAttributes:G},J=e.childNodes?Array.from(e.childNodes):[];for(const se of J){const oe=cr(se,L);oe&&N.childNodes.push(oe)}if(WC(e)&&e.shadowRoot)for(const se of Array.from(e.shadowRoot.childNodes)){const oe=cr(se,L);oe&&(no(e.shadowRoot)&&(oe.isShadow=!0),N.childNodes.push(oe))}}if(e.parentNode&&to(e.parentNode)&&no(e.parentNode)&&(N.isShadow=!0),N.type===Re.Element&&N.tagName==="iframe"&&!N.needBlock&&pA(e,()=>{const L=Bm(e);if(L&&E){const J=cr(L,{doc:L,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:I,recordCanvas:O,preserveWhiteSpace:Z,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:F,onStylesheetLoad:T,stylesheetLoadTimeout:P,keepIframeSrcFn:M,ignoreCSSAttributes:G});J&&E(e,J)}},F),N.type===Re.Element&&N.tagName==="img"&&!e.complete&&N.needBlock){const L=e,J=()=>{if(L.isConnected&&!L.complete&&k)try{const se=L.getBoundingClientRect();se.width>0&&se.height>0&&k(L,N,se)}catch(se){}L.removeEventListener("load",J)};L.isConnected&&L.addEventListener("load",J)}return N.type===Re.Element&&N.tagName==="link"&&typeof N.attributes.rel=="string"&&(N.attributes.rel==="stylesheet"||N.attributes.rel==="preload"&&typeof N.attributes.href=="string"&&Dm(N.attributes.href)==="css")&&hA(e,()=>{if(T){const L=cr(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:I,recordCanvas:O,preserveWhiteSpace:Z,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:F,onStylesheetLoad:T,stylesheetLoadTimeout:P,keepIframeSrcFn:M,ignoreCSSAttributes:G});L&&T(e,L)}},P),N.type===Re.Element&&delete N.needBlock,N}function bA(e,t){const{mirror:n=new Pm,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:i=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOM:b=!1,dataURLOptions:w,preserveWhiteSpace:I,onSerialize:O,onIframeLoad:C,iframeLoadTimeout:E,onBlockedImageLoad:F,onStylesheetLoad:k,stylesheetLoadTimeout:T,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:M=new Set([])}=t||{};return cr(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,maskAllText:i,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!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}:h===!1?{}:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:b==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}
494:b===!1?{}:b,dataURLOptions:w,inlineImages:f,recordCanvas:p,preserveWhiteSpace:I,onSerialize:O,onIframeLoad:C,iframeLoadTimeout:E,onBlockedImageLoad:F,onStylesheetLoad:k,stylesheetLoadTimeout:T,keepIframeSrcFn:P,newlyAddedElement:!1,ignoreCSSAttributes:M})}function Fe(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const nr=`Please stop import mirror directly. Instead of that,\r 495now you can use replayer.getMirror() to access the mirror instance of a replayer,\r 496or you can use record.mirror to access the mirror instance during recording.`;let Fd={map:{},getId(){return console.error(nr),-1},getNode(){return console.error(nr),null},removeNodeFromMap(){console.error(nr)},has(){return console.error(nr),!1},reset(){console.error(nr)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Fd=new Proxy(Fd,{get(e,t,n){return t==="map"&&console.error(nr),Reflect.get(e,t,n)}}));function mo(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();!o&&n.leading===!1&&(o=i);const a=t-(i-o),c=this;a<=0||a>t?(r&&(RA(r),r=null),o=i,e.apply(c,s)):!r&&n.trailing!==!1&&(r=zi(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,s)},a))}}function Wm(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){zi(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>Wm(e,t,s||{},!0)}function yu(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(r){return()=>{}}}let ei=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ei=()=>new Date().getTime());function jm(e){var n,r,o,s,i,a;const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(t==null?void 0:t.documentElement.scrollLeft)||((r=(n=t==null?void 0:t.body)==null?void 0:n.parentElement)==null?void 0:r.scrollLeft)||((o=t==null?void 0:t.body)==null?void 0:o.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((i=(s=t==null?void 0:t.body)==null?void 0:s.parentElement)==null?void 0:i.scrollTop)||((a=t==null?void 0:t.body)==null?void 0:a.scrollTop)||0}}function zm(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qm(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Gm(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(t){return null}}function qe(e,t,n,r,o){if(!e)return!1;const s=Gm(e);if(!s)return!1;const i=ar(t,n);if(!o){const u=r&&s.matches(r);return i(s)&&!u}const a=Cn(s,i);let c=-1;return a<0?!1:(r&&(c=Cn(s,ar(null,r))),a>-1&&c<0?!0:a<c)}function EA(e,t){return t.getId(e)!==-1}function wa(e,t){return t.getId(e)===ho}function Vm(e,t){if(to(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Vm(e.parentNode,t):!0:!0}function uc(e){return!!e.changedTouches}function vA(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ym(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Jm(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function lc(e){return!!(e!=null&&e.shadowRoot)}class TA{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var n;return(n=this.styleIDMap.get(t))!=null?n:-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Km(e){var n,r;let t=null;return((r=(n=e.getRootNode)==null?void 0:n.call(e))==null?void 0:r.no
496deType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function IA(e){let t=e,n;for(;n=Km(t);)t=n;return t}function wA(e){const t=e.ownerDocument;if(!t)return!1;const n=IA(e);return t.contains(n)}function Xm(e){const t=e.ownerDocument;return t?t.contains(e)||wA(e):!1}const $d={};function Su(e){const t=$d[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch(o){}return $d[e]=r.bind(window)}function kA(...e){return Su("requestAnimationFrame")(...e)}function zi(...e){return Su("setTimeout")(...e)}function RA(...e){return Su("clearTimeout")(...e)}var ne=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ne||{}),K=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(K||{}),De=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(De||{}),Dt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Dt||{}),rr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(rr||{});let ro;function CA(e){ro=e}function AA(){ro=void 0}const ae=e=>ro?((...n)=>{try{return e(...n)}catch(r){if(ro&&ro(r)===!0)return()=>{};throw r}}):e;var Bd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",MA=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var as=0;as<Bd.length;as++)MA[Bd.charCodeAt(as)]=as;class Ud{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}function bu(e){try{return e.contentDocument}catch(t){}}function go(e){try{return e.contentWindow}catch(t){}}class NA{constructor(t){this.doc=t,this.unattachedDoc=null}parse(t){return this.parseWithConstructableStylesheet(t)||this.parseWithDetachedElement(t)}parseWithConstructableStylesheet(t){if(typeof CSSStyleSheet=="undefined"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{const n=new CSSStyleSheet;n.replaceSync(`x { ${t} }`);const r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch(n){return null}}parseWithDetachedElement(t){const n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",t),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}return this.unattachedDoc}}function Hd(e){return"__ln"in e}class xA{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=(n==null?void 0:n.next)||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Hd(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Hd(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.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(t){const n=t.__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),t.__ln&&delete t.__ln,this.length--)}}const Wd=(e,t)=>`${e}@${t}`;class OA{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=t=>
496{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new xA,o=c=>{let u=c,d=ho;for(;d===ho;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},s=c=>{if(!c.parentNode||!Xm(c))return;const u=to(c.parentNode)?this.mirror.getId(Km(c)):this.mirror.getId(c.parentNode),d=o(c);if(u===-1||d===-1)return r.addNode(c);const l=cr(c,{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=>{Ym(f,this.mirror)&&!qe(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Jm(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),lc(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{if(qe(f,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(f,p);const h=go(f);h&&this.canvasManager.addWindow(h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${g}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:d,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)jd(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!zd(this.droppedSet,c)&&!jd(this.removes,c,this.mirror)||zd(this.movedSet,c)?s(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const u=this.mirror.getId(i.value.parentNode),d=o(i.value);u!==-1&&d!==-1&&(c=i)}if(!c){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(l!==-1){c=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){c=d;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),s(c.value)}const a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:u}=c;if(typeof u.style=="string"){const d=JSON.stringify(c.styleDiff),l=JSON.stringify(c._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:u}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))},this.processMutation=t=>{if(!wa(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!qe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Cr(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Gm(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){const i=gu(n),a=n.tagName;o=Qs(n,a,i);const c=Wi({maskInputOptions:this.maskInputOptions,tagName:a,type:i}),u=Cr(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);o=po({isMasked:u,element:n,value:o,maskInputFn:this.maskInputFn})}if(qe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!bu(n))r="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Hm(n.tagName,r)&&(s.attributes[r]=Um(this.doc,Rr(n.tagName),Rr(r),o,n,this.maskAttributeFn),r==="style")){const i=t.oldValue?this.styleDeclarationParser.parse(t.oldValue):null;for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);c!==((i==null?void 0:i.getPropertyValue(a))||"")||u!==((i==null?void 0:i.getPropertyPriority(a)
496)||"")?u===""?s.styleDiff[a]=c:s.styleDiff[a]=[c,u]:s._unchangedStyles[a]=[c,u]}if(i)for(const a of Array.from(i))n.style.getPropertyValue(a)===""&&(s.styleDiff[a]=!1)}break}case"childList":{if(qe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=to(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);qe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||wa(n,this.mirror)||!EA(n,this.mirror)||(this.addedSet.has(n)?(dc(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Vm(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Wd(r,o)]?dc(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:to(t.target)&&no(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(wa(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Wd(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);qe(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),lc(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["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","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]}),this.styleDeclarationParser=new NA(this.doc)}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 dc(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>dc(e,r))}function jd(e,t,n){return e.length===0?!1:LA(e,t,n)}function LA(e,t,n){let r=t.parentNode;for(;r;){const o=n.getId(r);if(e.some(s=>s.id===o))return!0;r=r.parentNode}return!1}function zd(e,t){return e.size===0?!1:Qm(e,t)}function Qm(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Qm(e,n):!1}const ur=[];function Wo(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function Zm(e,t){var i,a;const n=new OA;ur.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const o=(a=(i=window==null?void 0:window.Zone)==null?void 0:i.__symbol__)==null?void 0:a.call(i,"MutationObserver");o&&window[o]&&(r=window[o]);const s=new r(ae(c=>{e.onMutation&&e.onMutation(c)===!1||n.processMutations.bind(n)(c)}));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function PA({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let i=[],a;const c=mo(ae(l=>{const f=Date.now()-a;e(i.map(p=>(p.timeOffset-=f,p)),l),i=[],a=null}),s),u=ae(mo(ae(l=>{const f=Wo(l),{clientX:p,clientY:h}=uc(l)?l.changedTouches[0]:l;a||(a=ei()),i.push({x:p,y:h,id:r.getId(f),timeOffset:ei()-a}),c(typeof DragEvent!="undefined"&&l instanceof DragEvent?K.Drag:l instanceof MouseEvent?K.MouseMove:K.TouchMove)}),o,{trailing:!1})),d=[Fe("mousemove",u,n),Fe("touchmove",u,n),Fe("drag",u,n)];return ae(()=>{d.forEach(l=>l())})}function DA({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,c=[];let u=null;const d=l=>f=>{const p=Wo(f);if(qe(p,r,o,s,!0))return;let h=null,g=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=Dt.Mouse;break;case"touch":h=Dt.Touch;break;case"pen":h=Dt.Pen;break}h===Dt.Touch?De[l]===De.MouseDown?g="TouchStart":De[l]===De.MouseUp&&(g="TouchEnd"):Dt.Pen}else uc(f)&&(h=Dt.Touch);h!==null?(u=h,(g.startsWith("Touch")&&h===Dt.Touch||g.startsWith("Mouse")&&h===Dt.Mouse)&&(h=null)):De[l]===De.Click&&(h=u,u=null);const _=uc(f)?f.changedTouches[0]:f;if(!_)return;const y=n.getId(p),{clientX:b,clientY:w}=_;ae(e)(m({type:De[g],id:y,x:b,y:w},h!==null&&{pointerType:h}))};return Object.keys(De).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEac
496h(l=>{let f=Rr(l);const p=d(l);if(window.PointerEvent)switch(De[l]){case De.MouseDown:case De.MouseUp:f=f.replace("mouse","pointer");break;case De.TouchStart:case De.TouchEnd:return}c.push(Fe(f,p,t))}),ae(()=>{c.forEach(l=>l())})}function eg({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){const a=ae(mo(ae(c=>{const u=Wo(c);if(!u||qe(u,r,o,s,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=jm(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),i.scroll||100));return Fe("scroll",a,t)}function FA({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const o=ae(mo(ae(()=>{const s=zm(),i=qm();(n!==s||r!==i)&&(e({width:Number(i),height:Number(s)}),n=s,r=i)}),200));return Fe("resize",o,t)}const $A=["INPUT","TEXTAREA","SELECT"],qd=new WeakMap;function BA({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,ignoreClass:i,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g}){function _(E){let F=Wo(E);const k=E.isTrusted,T=F&&ac(F.tagName);if(T==="OPTION"&&(F=F.parentElement),!F||!T||$A.indexOf(T)<0||qe(F,r,o,s,!0))return;const P=F;if(P.classList.contains(i)||a&&P.matches(a))return;const M=gu(F);let D=Qs(P,T,M),G=!1;const Z=Wi({maskInputOptions:c,tagName:T,type:M}),V=Cr(F,f,h,p,g,Z);(M==="radio"||M==="checkbox")&&(G=F.checked),D=po({isMasked:V,element:F,value:D,maskInputFn:u}),y(F,l?{text:D,isChecked:G,userTriggered:k}:{text:D,isChecked:G});const $=F.name;M==="radio"&&$&&G&&t.querySelectorAll(`input[type="radio"][name="${$}"]`).forEach(N=>{if(N!==F){const te=po({isMasked:V,element:N,value:Qs(N,T,M),maskInputFn:u});y(N,l?{text:te,isChecked:!G,userTriggered:!1}:{text:te,isChecked:!G})}})}function y(E,F){const k=qd.get(E);if(!k||k.text!==F.text||k.isChecked!==F.isChecked){qd.set(E,F);const T=n.getId(E);ae(e)(v(m({},F),{id:T}))}}const w=(d.input==="last"?["change"]:["input","change"]).map(E=>Fe(E,ae(_),t)),I=t.defaultView;if(!I)return()=>{w.forEach(E=>E())};const O=I.Object.getOwnPropertyDescriptor(I.HTMLInputElement.prototype,"value"),C=[[I.HTMLInputElement.prototype,"value"],[I.HTMLInputElement.prototype,"checked"],[I.HTMLSelectElement.prototype,"value"],[I.HTMLTextAreaElement.prototype,"value"],[I.HTMLSelectElement.prototype,"selectedIndex"],[I.HTMLOptionElement.prototype,"selected"]];return O&&O.set&&w.push(...C.map(E=>Wm(E[0],E[1],{set(){ae(_)({target:this,isTrusted:!1})}},!1,I))),ae(()=>{w.forEach(E=>E())})}function ti(e){const t=[];function n(r,o){if(cs("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||cs("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||cs("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||cs("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else if(r.parentStyleSheet){const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function Qt(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function UA({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:ae((d,l,f)=>{const[p,h]=f,{id:g,styleId:_}=Qt(l,t,n.styleMirror);return(g&&g!==-1||_&&_!==-1)&&e({id:g,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:ae((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Qt(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,removes:[{index:p}]}),d.apply(l,f)})});let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:ae((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Qt(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replace:p}),d.apply(l,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:ae((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Qt(l,t,n.styleMirror);
vendor: 6,560 bytes, line 496
496return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replaceSync:p}),d.apply(l,f)})}));const c={};us("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(us("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),us("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),us("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(c).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:ae((f,p,h)=>{const[g,_]=h,{id:y,styleId:b}=Qt(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||b&&b!==-1)&&e({id:y,styleId:b,adds:[{rule:g,index:[...ti(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:ae((f,p,h)=>{const[g]=h,{id:_,styleId:y}=Qt(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||y&&y!==-1)&&e({id:_,styleId:y,removes:[{index:[...ti(p),g]}]}),f.apply(p,h)})})}),ae(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function tg({mirror:e,stylesheetManager:t},n){var i,a,c;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const o=n.nodeName==="#document"?(i=n.defaultView)==null?void 0:i.Document:(c=(a=n.ownerDocument)==null?void 0:a.defaultView)==null?void 0:c.ShadowRoot,s=o!=null&&o.prototype?Object.getOwnPropertyDescriptor(o==null?void 0:o.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var u;return(u=s.get)==null?void 0:u.call(this)},set(u){var l;const d=(l=s.set)==null?void 0:l.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch(f){}return d}}),ae(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function HA({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:ae((a,c,u)=>{var g;const[d,l,f]=u;if(n.has(d))return s.apply(c,[d,l,f]);const{id:p,styleId:h}=Qt((g=c.parentRule)==null?void 0:g.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:ti(c.parentRule)}),a.apply(c,u)})});const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:ae((a,c,u)=>{var p;const[d]=u;if(n.has(d))return i.apply(c,[d]);const{id:l,styleId:f}=Qt((p=c.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:ti(c.parentRule)}),a.apply(c,u)})}),ae(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i})}function WA({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:s,doc:i}){const a=ae(u=>mo(ae(d=>{const l=Wo(d);if(!l||qe(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:g}=l;e({type:u,id:o.getId(l),currentTime:f,volume:p,muted:h,playbackRate:g})}),s.media||500)),c=[Fe("play",a(rr.Play),i),Fe("pause",a(rr.Pause),i),Fe("seeked",a(rr.Seeked),i),Fe("volumechange",a(rr.VolumeChange),i),Fe("ratechange",a(rr.RateChange),i)];return ae(()=>{c.forEach(u=>u())})}function jA({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(c,u,d){const l=new s(c,u,d);return o.set(l,{family:c,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const i=yu(t.fonts,"add",function(a){return function(c){return zi(ae(()=>{const u=o.get(c);u&&(e(u),o.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(i),ae(()=>{r.forEach(a=>a())})}function zA(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,selectionCb:i}=e;let a=!0;const c=ae(()=>{const u=t.getSelection();if(!u||a&&(u!=null&&u.isCollapsed))return;a=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:g,endContainer:_,endOffset:y}=p;qe(h,r,o,s,!0)||qe(_,r,o,s,!0)||d.push({start:n.getId(h),startOffset:g,end:n.getId(_),endOffset:y})}i({ranges:d})});return c(),Fe("selectionchange",c)}function qA({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:yu(n.customElements,"define",function(o){return function(s,i,a){try{t({define:{name:s}})}catch(c){}return o.apply(this,[s,i,a])}})}function GA(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Zm(e,e.doc));const o=PA(e),s=DA(e),i=eg(e),a=FA(e,{win:n}),c=BA(e),u=WA(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=UA(e,{win:n}),l=tg(e,e.doc),f=HA(e,{win:n}),e.collectFonts&&(p=jA(e)));const h=zA(e),g=qA(e),_=[];for(const y of e.plugins)_.push(y.observer(y.callback,n,y.options));return ae(()=>{ur.forEach(y=>y.reset()),r==null||r.disconnect(),o(),s(),i(),a(),c(),u(),d(),l(),f(),p(),h(),g(),_.forEach(y=>y())})}function cs(e){return typeof window[e]!="undefined"}function us(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class fc{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){const s=r||this.getIdToRemoteIdMap(t),i=o||this.getRemoteIdToIdMap(t);let a=s.get(n);return a||(a=this.generateIdFn(),s.set(n,a),i.set(a,n)),a}getIds(t,n){const r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(s=>this.getId(t,s,r,o))}getRemoteId(t,n,r){const o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const s=o.get(n);return s||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}
496class VA{constructor(){this.crossOriginIframeMirror=new fc(_u),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class YA{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new fc(_u),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new fc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0);const n=go(t);n&&this.crossOriginIframeMap.set(n,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var o,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((o=go(t))==null||o.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,t);const r=bu(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const o=this.crossOriginIframeMap.get(t.source);if(!o)return;const s=this.transformCrossOriginEvent(o,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case ne.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const o=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(n.data.node,o),{timestamp:n.timestamp,type:ne.IncrementalSnapshot,data:{source:K.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ne.Meta:case ne.Load:case ne.DomContentLoaded:return!1;case ne.Plugin:return n;case ne.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case ne.IncrementalSnapshot:switch(n.data.source){case K.Mutation:return n.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);const s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(o.node,s)}),n.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),n.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),n.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case K.Drag:case K.TouchMove:case K.MouseMove:return n.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case K.ViewportResize:return!1;case K.MediaInteraction:case K.MouseInteraction:case K.Scroll:case K.CanvasMutation:case K.Input:return this.replaceIds(n.data,t,["id"]),n;case K.StyleSheetRule:case K.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case K.Font:return n;case K.Selection:return n.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),n;case K.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(const s of o)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=t.getIds(r,n[s]):n[s]=t.getId(r,n[s]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==Re.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class JA{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class KA{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!no(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=Zm(v(m({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(eg(v(m({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),zi(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(tg({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=bu(t),r=go(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(yu(t.prototype,"attachShadow",function(o){return function(s){const i=o.call(this,s);return this.shadowRoot&&Xm(this)&&r.addShadowRoot(this.shadowRoot,n),i}}))}
496reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(n){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class XA{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new TA,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},o=[];for(const s of t){let i;this.styleMirror.has(s)?i=this.styleMirror.getId(s):(i=this.styleMirror.add(s),o.push({styleId:i,rules:Array.from(s.rules||CSSRule,(a,c)=>({rule:Lm(a),index:c}))})),r.styleIds.push(i)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class QA{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,kA(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let Te,ni;var Rf;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Rf=e.contentWindow)==null?void 0:Rf.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const lt=JC();function mt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,unblockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:g,maskInputOptions:_,slimDOMOptions:y,maskAttributeFn:b,maskInputFn:w,maskTextFn:I,maxCanvasSize:O=null,packFn:C,sampling:E={},dataURLOptions:F={},mousemoveWait:k,recordDOM:T=!0,recordCanvas:P=!1,recordCrossOriginIframes:M=!1,recordAfter:D=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:G=!1,collectFonts:Z=!1,inlineImages:V=!1,plugins:$,keepIframeSrcFn:N=()=>!1,ignoreCSSAttributes:te=new Set([]),errorHandler:L,onMutation:J,getCanvasManager:se}=e;CA(L);const oe=M?window.parent===window:!0;let ce=!1;if(!oe)try{window.parent.document&&(ce=!1)}catch(le){ce=!0}if(oe&&!t)throw new Error("emit function is required");if(!oe&&!ce)return()=>{};k!==void 0&&E.mousemove===void 0&&(E.mousemove=k),lt.reset();const Pe=g===!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?_:{},at=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};vA();let Nt,ct=0;const Sn=le=>{for(const X of $||[])X.eventProcessor&&(le=X.eventProcessor(le));return C&&!ce&&(le=C(le)),le};Te=(le,X)=>{var ye;const W=le;if(W.timestamp=ei(),(ye=ur[0])!=null&&ye.isFrozen()&&W.type!==ne.FullSnapshot&&!(W.type===ne.IncrementalSnapshot&&W.data.source===K.Mutation)&&ur.forEach(de=>de.unfreeze()),oe)t==null||t(Sn(W),X);else if(ce){const de={type:"rrweb",event:Sn(W),origin:window.location.origin,isCheckout:X};window.parent.postMessage(de,"*")}if(W.type===ne.FullSnapshot)Nt=W,ct=0;else if(W.type===ne.IncrementalSnapshot){if(W.data.source===K.Mutation&&W.data.isAttachIframe)return;ct++;const de=r&&ct>=r,ee=n&&Nt&&W.timestamp-Nt.timestamp>n;(de||ee)&&En(!0)}};const xt=le=>{Te({type:ne.IncrementalSnapshot,data:m({source:K.Mutation},le)})},zo=le=>Te({type:ne.IncrementalSnapshot,data:m({source:K.Scroll},le)}),Ot=le=>Te({type:ne.IncrementalSnapshot,data:m({source:K.CanvasMutation},le)}),Ke=le=>Te({type:ne.IncrementalSnapshot,data:m({source:K.AdoptedStyleSheet},le)}),$e=new XA({mutationCb:xt,adoptedStyleSheetCb:Ke}),je=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new VA:new YA({mirror:lt,mutationCb:xt,stylesheetManager:$e,recordCrossOriginIframes:M,wrappedEmit:Te});for(const le of $||[])le.getMirror&&le.getMirror({nodeMirror:lt,crossOriginIframeMirror:je.crossOriginIframeMirror,crossOriginIframeStyleMirror:je.crossOriginIframeStyleMirror});const Jn=new QA,Kn=e1(se,{mirror:lt,win:window,mutationCb:le=>Te({type:ne.IncrementalSnapshot,data:m({source:K.CanvasMutation},le)}),recordCanvas:P,blockClass:o,blockSelector:s,unblockSelector:i,maxCanvasSize:O,sampling:E.canvas,dataURLOptions:F,errorHandler:L}),bn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new JA:new KA({mutationCb:xt,scrollCb:zo,bypassOptions:{onMutation:J,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:Pe,dataURLOptions:F,maskAttributeFn:b,maskTextFn:I,maskInputFn:w,recordCanvas:P,inlineImages:V,sampling:E,slimDOMOptions:at,iframeManager:je,stylesheetManager:$e,canvasManager:Kn,keepIframeSrcFn:N,processedNodeManager:Jn,ignoreCSSAttributes:te},mirror:lt}),En=(le=!1)=>
496{if(!T)return;Te({type:ne.Meta,data:{href:window.location.href,width:qm(),height:zm()}},le),$e.reset(),bn.init(),ur.forEach(W=>W.lock());const X=bA(document,{mirror:lt,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:Pe,maskAttributeFn:b,maskInputFn:w,maskTextFn:I,slimDOM:at,dataURLOptions:F,recordCanvas:P,inlineImages:V,onSerialize:W=>{Ym(W,lt)&&je.addIframe(W),Jm(W,lt)&&$e.trackLinkElement(W),lc(W)&&bn.addShadowRoot(W.shadowRoot,document)},onIframeLoad:(W,ye)=>{je.attachIframe(W,ye);const de=go(W);de&&Kn.addWindow(de),bn.observeAttachShadow(W)},onStylesheetLoad:(W,ye)=>{$e.attachLinkElement(W,ye)},onBlockedImageLoad:(W,ye,{width:de,height:ee})=>{xt({adds:[],removes:[],texts:[],attributes:[{id:ye.id,attributes:{style:{width:`${de}px`,height:`${ee}px`}}}]})},keepIframeSrcFn:N,ignoreCSSAttributes:te});if(!X)return console.warn("Failed to snapshot the document");Te({type:ne.FullSnapshot,data:{node:X,initialOffset:jm(window)}}),ur.forEach(W=>W.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&$e.adoptStyleSheets(document.adoptedStyleSheets,lt.getId(document))};ni=En;try{const le=[],X=ye=>{var de;return ae(GA)({onMutation:J,mutationCb:xt,mousemoveCb:(ee,Vt)=>Te({type:ne.IncrementalSnapshot,data:{source:Vt,positions:ee}}),mouseInteractionCb:ee=>Te({type:ne.IncrementalSnapshot,data:m({source:K.MouseInteraction},ee)}),scrollCb:zo,viewportResizeCb:ee=>Te({type:ne.IncrementalSnapshot,data:m({source:K.ViewportResize},ee)}),inputCb:ee=>Te({type:ne.IncrementalSnapshot,data:m({source:K.Input},ee)}),mediaInteractionCb:ee=>Te({type:ne.IncrementalSnapshot,data:m({source:K.MediaInteraction},ee)}),styleSheetRuleCb:ee=>Te({type:ne.IncrementalSnapshot,data:m({source:K.StyleSheetRule},ee)}),styleDeclarationCb:ee=>Te({type:ne.IncrementalSnapshot,data:m({source:K.StyleDeclaration},ee)}),canvasMutationCb:Ot,fontCb:ee=>Te({type:ne.IncrementalSnapshot,data:m({source:K.Font},ee)}),selectionCb:ee=>{Te({type:ne.IncrementalSnapshot,data:m({source:K.Selection},ee)})},customElementCb:ee=>{Te({type:ne.IncrementalSnapshot,data:m({source:K.CustomElement},ee)})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:Pe,inlineStylesheet:h,sampling:E,recordDOM:T,recordCanvas:P,inlineImages:V,userTriggeredOnInput:G,collectFonts:Z,doc:ye,maskAttributeFn:b,maskInputFn:w,maskTextFn:I,keepIframeSrcFn:N,blockSelector:s,unblockSelector:i,slimDOMOptions:at,dataURLOptions:F,mirror:lt,iframeManager:je,stylesheetManager:$e,shadowDomManager:bn,processedNodeManager:Jn,canvasManager:Kn,ignoreCSSAttributes:te,plugins:((de=$==null?void 0:$.filter(ee=>ee.observer))==null?void 0:de.map(ee=>({observer:ee.observer,options:ee.options,callback:Vt=>Te({type:ne.Plugin,data:{plugin:ee.name,payload:Vt}})})))||[]},{})};je.addLoadListener(ye=>{try{le.push(X(ye.contentDocument))}catch(de){console.warn(de)}});const W=()=>{En(),le.push(X(document))};return document.readyState==="interactive"||document.readyState==="complete"?W():(le.push(Fe("DOMContentLoaded",()=>{Te({type:ne.DomContentLoaded,data:{}}),D==="DOMContentLoaded"&&W()})),le.push(Fe("load",()=>{Te({type:ne.Load,data:{}}),D==="load"&&W()},window))),()=>{le.forEach(ye=>ye()),Jn.destroy(),ni=void 0,AA()}}catch(le){console.warn(le)}}function ZA(e){if(!ni)throw new Error("please take full snapshot after start recording");ni(e)}mt.mirror=lt;mt.takeFullSnapshot=ZA;function e1(e,t){try{return e?e(t):new Ud}catch(n){return console.warn("Unable to initialize CanvasManager"),new Ud}}var Gd;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Gd||(Gd={}));const t1=3,n1=5;function Eu(e){return e>9999999999?e:e*1e3}function ka(e){return e>9999999999?e/1e3:e}function jo(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>
496(e.throttledAddEvent({type:ne.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Ce(t,10,1e3)}}),t.category==="console")))}const r1="button,a";function ng(e){return e.closest(r1)||e}function rg(e){const t=og(e);return!t||!(t instanceof Element)?t:ng(t)}function og(e){return o1(e)?e.target:e}function o1(e){return nt(e)&&"target"in e}let Zt;function s1(e){return Zt||(Zt=[],i1()),Zt.push(e),()=>{const t=Zt?Zt.indexOf(e):-1;t>-1&&Zt.splice(t,1)}}function i1(){Oe(ge,"open",function(e){return function(...t){if(Zt)try{Zt.forEach(n=>n())}catch(n){}return e.apply(ge,t)}})}const a1=new Set([K.Mutation,K.StyleSheetRule,K.StyleDeclaration,K.AdoptedStyleSheet,K.CanvasMutation,K.Selection,K.MediaInteraction]);function c1(e,t,n){e.handleClick(t,n)}class u1{constructor(t,n,r=jo){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=s1(()=>{this._lastMutation=Vd()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(d1(n,this._ignoreSelector)||!f1(t))return;const r={timestamp:ka(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=ka(t)}registerScroll(t=Date.now()){this._lastScroll=ka(t)}registerClick(t){const n=ng(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=Vd();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&&t.push(r)});for(const r of t){const o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,s=!r&&!o,{clickCount:i,clickBreadcrumb:a}=t;if(s){const c=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=c<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:v(m({},a.data),{url:ge.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:i||1})};this._addBreadcrumbEvent(n,d);return}if(i>1){const c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:v(m({},a.data),{url:ge.location.href,route:n.getCurrentRoute(),clickCount:i,metric:!0})};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Ho(()=>this._checkClicks(),1e3)}}const l1=["A","BUTTON","INPUT"];function d1(e,t){return!!(!l1.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function f1(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function Vd(){return Date.now()/1e3}function p1(e,t){try{if(!h1(t))return;const{source:n}=t.data;if(a1.has(n)&&e.registerMutation(t.timestamp),n===K.Scroll&&e.registerScroll(t.timestamp),m1(t)){const{type:r,id:o}=t.data,s=mt.mirror.getNode(o);s instanceof HTMLElement&&r===De.Click&&e.registerClick(s)}}catch(n){}}function h1(e){return e.type===t1}function m1(e){return e.data.source===K.MouseInteraction}function St(e){return m({timestamp:Date.now()/1e3,type:"default"},e)}var qi=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(qi||{});const g1=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function _1(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(g1.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const y1=e=>t=>{if(!e.isEnabled())return;const n=S1(t);if(!n)return;const r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&(o!=null&&o.target)&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shift
496Key&&c1(e.clickDetector,n,rg(t.event)),jo(e,n)};function sg(e,t){const n=mt.mirror.getId(e),r=n&&mt.mirror.getNode(n),o=r&&mt.mirror.getMeta(r),s=o&&E1(o)?o:null;return{message:t,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(i=>i.type===qi.Text&&i.textContent).filter(Boolean).map(i=>i.trim()).join(""),attributes:_1(s.attributes)}}:{}}}function S1(e){const{target:t,message:n}=b1(e);return St(m({category:`ui.${e.name}`},sg(t,n)))}function b1(e){const t=e.name==="click";let n,r=null;try{r=t?rg(e.event):og(e.event),n=Me(r,{maxStringLength:200})||"<unknown>"}catch(o){n="<unknown>"}return{target:r,message:n}}function E1(e){return e.type===qi.Element}function v1(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=T1(t);n&&jo(e,n)}function T1(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s,target:i}=e;if(!i||I1(i)||!s)return null;const a=t||r||o,c=s.length===1;if(!a&&c)return null;const u=Me(i,{maxStringLength:200})||"<unknown>",d=sg(i,u);return St({category:"ui.keyDown",message:u,data:v(m({},d.data),{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s})})}function I1(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const w1={resource:M1,paint:C1,navigation:A1};function Ra(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function k1(e){return e.map(R1).filter(Boolean)}function R1(e){const t=w1[e.entryType];return t?t(e):null}function Ar(e){return((ke()||ge.performance.timeOrigin)+e)/1e3}function C1(e){const{duration:t,entryType:n,name:r,startTime:o}=e,s=Ar(o);return{type:n,name:r,start:s,end:s+t,data:void 0}}function A1(e){const{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:s,encodedBodySize:i,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:g}=e;return o===0?null:{type:`${t}.${g}`,start:Ar(p),end:Ar(s),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:i,duration:o,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:d,loadEventEnd:l,domComplete:s,redirectCount:f}}}function M1(e){const{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:s,decodedBodySize:i,encodedBodySize:a,responseStatus:c,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Ar(s),end:Ar(o),name:r,data:{size:u,statusCode:c,decodedBodySize:i,encodedBodySize:a}}}function N1(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return vu(e,"largest-contentful-paint",n)}function x1(e){return e.sources!==void 0}function O1(e){const t=[],n=[];for(const r of e.entries)if(x1(r)){const o=[];for(const s of r.sources)if(s.node){n.push(s.node);const i=mt.mirror.getId(s.node);i&&o.push(i)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return vu(e,"cumulative-layout-shift",n,t)}function L1(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return vu(e,"interaction-to-next-paint",n)}function vu(e,t,n,r){const o=e.value,s=e.rating,i=Ar(o);return{type:"web-vital",name:t,start:i,end:i,data:{value:o,size:o,rating:s,nodeIds:n?n.map(a=>mt.mirror.getId(a)):void 0,attributions:r}}}function P1(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(o=>{r.push(fn(o,n))}),r.push(Pi(Ra(N1,e)),Li(Ra(O1,e)),au(Ra(L1,e))),()=>{r.forEach(o=>o())}}const j=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,D1='
vendor: 10,329 bytes, line 496
496var 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]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(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,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(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},_=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},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=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:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(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,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}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 s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),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=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+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(U,C,0),R=U;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[s[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=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(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;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=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,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];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(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[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=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),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(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[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-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,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 s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),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(s),32768),this.s.z=n.length-s+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.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!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,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.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)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}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.prototype.flush=function(){j.prototype.flush.call(this)},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(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}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(const r of t)n+=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});
496';function F1(){const e=new Blob([D1],{type:"text/javascript"});return URL.createObjectURL(e)}const Yd=["log","warn","error"],Rs="[Replay] ";function Ca(e,t="info"){Wt({category:"console",data:{logger:"replay"},level:t,message:`${Rs}${e}`},{level:t})}function $1(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return j?(Yd.forEach(r=>{n[r]=(...o)=>{S[r](Rs,...o),t&&Ca(o.join(""),Hs(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),S.error(Rs,r),e?kt(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Ca(r,"error")},n.infoTick=(...r)=>{S.log(Rs,...r),t&&setTimeout(()=>Ca(r[0]),0)}):Yd.forEach(r=>{n[r]=()=>{}}),n}const z=$1();class Tu extends Error{constructor(){super(`Event buffer exceeded maximum size of ${mu}.`)}}class ig extends Error{constructor(){super("Worker destroyed")}}class ag{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}addEvent(t){return U(this,null,function*(){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>mu)throw new Tu;this.events.push(t)})}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(const{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:Eu(t)}}class B1{constructor(t){this._onMessage=({data:n})=>{const r=n;if(typeof r.id!="number")return;const o=this._pending.get(r.id);if(!(!o||o.method!==r.method)){if(this._pending.delete(r.id),!r.success){j&&z.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():(j&&z.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{j&&z.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){j&&z.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new ig)),this._pending.clear(),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((o,s)=>{this._pending.set(r,{method:t,resolve:o,reject:s});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(i){this._pending.delete(r),s(i)}})}_getAndIncrementId(){return this._id++}}class U1{constructor(t){this._worker=new B1(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=Eu(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>mu?Promise.reject(new Tu):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{j&&z.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}_finishRequest(){return U(this,null,function*(){const t=yield this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t})}}class H1{constructor(t){this._fallback=new ag,this._compression=new U1(t),this._used=this._fallback,this._ensureWorkerIsLoadedProm
496ise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}finish(){return U(this,null,function*(){return yield this.ensureWorkerIsLoaded(),this._used.finish()})}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}_ensureWorkerIsLoaded(){return U(this,null,function*(){try{yield this._compression.ensureReady()}catch(t){j&&z.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}yield this._switchToCompressionWorker()})}_switchToCompressionWorker(){return U(this,null,function*(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(const s of t)o.push(this._compression.addEvent(s));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{yield Promise.all(o),this._fallback.clear()}catch(s){if(s instanceof ig)return;j&&z.exception(s,"Failed to add events when switching buffers.")}})}}function W1({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=j1(t);if(n)return n}return j&&z.log("Using simple buffer"),new ag}function j1(e){try{const t=e||z1();if(!t)return;j&&z.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new H1(n)}catch(t){j&&z.exception(t,"Failed to create compression worker")}}function z1(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__=="undefined"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?F1():""}function Iu(){try{return"sessionStorage"in ge&&!!ge.sessionStorage}catch(e){return!1}}function q1(e){G1(),e.session=void 0}function G1(){if(Iu())try{ge.sessionStorage.removeItem(pu)}catch(e){}}function cg(e){return e===void 0?!1:Math.random()<e}function Gi(e){if(Iu())try{ge.sessionStorage.setItem(pu,JSON.stringify(e))}catch(t){}}function ug(e){const t=Date.now(),n=e.id||Ae(),r=e.started||t,o=e.lastActivity||t,s=e.segmentId||0,i=e.sampled,a=e.previousSessionId,c=e.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:s,sampled:i,previousSessionId:a,dirty:c}}function V1(e,t){return cg(e)?"session":t?"buffer":!1}function Jd({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const o=V1(e,t),s=ug({sampled:o,previousSessionId:r});return n&&Gi(s),s}function Y1(){if(!Iu())return null;try{const e=ge.sessionStorage.getItem(pu);if(!e)return null;const t=JSON.parse(e);return j&&z.infoTick("Loading existing session"),ug(t)}catch(e){return null}}function pc(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function J1(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return pc(e.started,t,r)||pc(e.lastActivity,n,r)}function ri(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!J1(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Aa({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const o=r.stickySession&&Y1();return o?ri(o,{sessionIdleExpire:e,maxReplayDuration:t})?(j&&z.infoTick("Session in sessionStorage is expired, creating new one..."),Jd(r,{previousSessionId:o.id})):o:(j&&z.infoTick("Creating new session"),Jd(r,{previousSessionId:n}))}function K1(e){return e.type===ne.Custom}function wu(e,t,n){return dg(e,t)?(lg(e,t,n),!0):!1}function X1(e,t,n){return dg(e,t)?lg(e,t,n):Promise.resolve(null)}function lg(e,t,n){return U(this,null,function*(){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const o=e.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const s=e.getOptions(),i=Q1(t,s.beforeAddRecordingEvent);return i?yield r.addEvent(i):void 0}catch(s){if(!e.isEnabled())return e.handleException(s),null;const i=s&&s instanceof Tu,a=i?"eventBufferOverflow":"eventBufferError",c=x();if(c){const u=i?"buffer_overflow":"internal_sdk_error";c.recordDroppedEvent(u,"replay")}if(i&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(s),yield e.stop({reason:a})}})}
496function dg(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Eu(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(j&&z.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function Q1(e,t){try{if(typeof t=="function"&&K1(e))return t(e)}catch(n){return j&&z.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}const Kd=100;function fg(e,t,n){const r=e.getContext();t&&r.traceIds.size<Kd&&r.traceIds.add(t),n&&r.segmentNames.size<Kd&&r.segmentNames.add(n)}function Z1(e){return t=>{e.isEnabled()&&fg(e,t.trace_id,t.name||void 0)}}function ku(e){return!e.type}function hc(e){return e.type==="transaction"}function eM(e){return e.type==="replay_event"}function Xd(e){return e.type==="feedback"}function tM(e){return(t,n)=>{if(!e.isEnabled()||!ku(t)&&!hc(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(hc(t)){nM(e,t);return}rM(e,t)}}}function nM(e,t){var n,r;fg(e,(r=(n=t.contexts)==null?void 0:n.trace)==null?void 0:r.trace_id,t.transaction)}function rM(e,t){var o;const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!((o=t.tags)!=null&&o.replayId))return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||Ho(()=>U(null,null,function*(){try{yield e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}}))}function oM(e){return t=>{!e.isEnabled()||!ku(t)||sM(e,t)}}function sM(e,t){var r,o,s;const n=(s=(o=(r=t.exception)==null?void 0:r.values)==null?void 0:o[0])==null?void 0:s.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const i=St({category:"replay.hydrate-error",data:{url:dn()}});jo(e,i)}}function iM(e){const t=x();t&&t.on("beforeAddBreadcrumb",n=>aM(e,n))}function aM(e,t){if(!e.isEnabled()||!pg(t))return;const n=cM(t);n&&jo(e,n)}function cM(e){return!pg(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?uM(e):St(e)}function uM(e){var o;const t=(o=e.data)==null?void 0:o.arguments;if(!Array.isArray(t)||t.length===0)return St(e);let n=!1;const r=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>is?(n=!0,`${s.slice(0,is)}…`):s;if(typeof s=="object")try{const i=Ce(s,7);return JSON.stringify(i).length>is?(n=!0,`${JSON.stringify(i,null,2).slice(0,is)}…`):i}catch(i){}return s});return St(v(m({},e),{data:m(v(m({},e.data),{arguments:r}),n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{})}))}function pg(e){return!!e.category}function lM(e,t){var n,r,o;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((o=t.originalException)!=null&&o.__rrweb__)}function oi(){const e=Y().getPropagationContext().dsc;e&&delete e.replay_id;const t=we();if(t){const n=_t(t);delete n.replay_id}}function Qd(e){const t=Y().getPropagationContext().dsc;t&&(t.replay_id=e);const n=we();if(n){const r=_t(n);r.replay_id=e}}function dM(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:ne.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function fM(e,t){return e.recordingMode!=="buffer"||t.message===hu||!t.exception||t.type?!1:cg(e.getOptions().errorSampleRate)}function pM(e){return Object.assign((t,n)=>{var i;if(e.session&&ri(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&oi(),!e.isEnabled()||e.isPaused())return t;if(eM(t))return delete t.breadcrumbs,t;if(!ku(t)&&!hc(t)&&!Xd(t))return t;if(!e.checkAndHandleExpiredSession())return oi(),t;if(Xd(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),dM(e,t),t;if(lM(t,n)&&!e.getOptions()._experiments.captureExceptions)return j&&z.log("Ignoring error from rrweb internals",t),null;const o=fM(e,t);if((o||e.recordingMode==="session")&&(t.tags=v(m({},t.tags),{replayId:e.getSessionId()})),o&&e.recordingMode==="buffer"&&((i=e.session)==null?void 0:i.sampled)==="buffer"){const a=e.session;a.dirty=!0,e.getOptions().stickySession&&Gi(a)}return t},{id:"Replay"})}function Vi(e,t){return t.map(({type:n,start:r,end:o,name:s,data:i})=>{const a=e.throttledAddEvent({type:ne.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:o,data:i}}});
496return typeof a=="string"?Promise.resolve(null):a})}function hM(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function mM(e){return t=>{if(!e.isEnabled())return;const n=hM(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Vi(e,[n]),!1)))}}function gM(e,t){return j&&e.getOptions()._experiments.traceInternals?!1:rh(t,x())}function hg(e,t){e.isEnabled()&&t!==null&&(gM(e,t.name)||e.addUpdate(()=>(Vi(e,[t]),!0)))}function Yi(e){if(!e)return;const t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=Em(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch(n){}}function mg(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function si(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n=m({},e._meta),r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function gg(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:o,method:s,statusCode:i,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:s,statusCode:i,request:a,response:c}}}function _o(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function sn(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:o,warnings:s}=_M(n);return r.body=o,s!=null&&s.length&&(r._meta={warnings:s}),r}function mc(e,t){return Object.entries(e).reduce((n,[r,o])=>{const s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=o),n},{})}function _M(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Md,n=yM(e);if(t){const r=e.slice(0,Md);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch(r){}return{body:e}}function yM(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function ii(e,t){const n=SM(e);return rt(n,t)}function SM(e,t=ge.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(ge.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}function bM(e,t,n){return U(this,null,function*(){try{const r=yield vM(e,t,n),o=gg("resource.fetch",r);hg(n.replay,o)}catch(r){j&&z.exception(r,"Failed to capture fetch breadcrumb")}})}function EM(e,t){const{input:n,response:r}=t,o=n?fu(n):void 0,s=Yi(o),i=r?mg(r.headers.get("content-length")):void 0;s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function vM(e,t,n){return U(this,null,function*(){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r}=t,{url:i,method:a,status_code:c=0,request_body_size:u,response_body_size:d}=e.data,l=ii(i,n.networkDetailAllowUrls)&&!ii(i,n.networkDetailDenyUrls),f=l?TM(n,t.input,u):_o(u),p=yield IM(l,n,t.response,d);return{startTimestamp:o,endTimestamp:s,url:i,method:a,statusCode:c,request:f,response:p}})}function TM({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const o=n?RM(n,t):{};if(!e)return sn(o,r,void 0);const s=fu(n),[i,a]=Ks(s,z),c=sn(o,r,i);return a?si(c,a):c}function IM(s,i,a,c){return U(this,arguments,function*(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return _o(o);const u=r?_g(r.headers,n):{};if(!r||!t&&o!==void 0)return sn(u,o,void 0);const[d,l]=yield kM(r),f=wM(d,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:u});return l?si(f,l):f})}function wM(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{const s=e!=null&&e.length&&n===void 0?Yi(e):n;return r?t?sn(o,s,e):sn(o,s,void 0):_o(s)}catch(s){return j&&z.exception(s,"Failed to serialize response body"),sn(o,n,void 0)}}function kM(e){return U(this,null,function*(){const t=CM(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[yield AM(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(j&&z.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(j&&z.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}})}function _g(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}
496function RM(e,t){return e.length===1&&typeof e[0]!="string"?Zd(e[0],t):e.length===2?Zd(e[1],t):{}}function Zd(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?_g(n,t):Array.isArray(n)?{}:mc(n,t):{}}function CM(e){try{return e.clone()}catch(t){j&&z.exception(t,"Failed to clone response body")}}function AM(e){return new Promise((t,n)=>{const r=Ho(()=>n(new Error("Timeout while trying to read response body")),500);MM(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}function MM(e){return U(this,null,function*(){return yield e.text()})}function NM(e,t,n){return U(this,null,function*(){try{const r=OM(e,t,n),o=gg("resource.xhr",r);hg(n.replay,o)}catch(r){j&&z.exception(r,"Failed to capture xhr breadcrumb")}})}function xM(e,t){const{xhr:n,input:r}=t;if(!n)return;const o=Yi(r),s=n.getResponseHeader("content-length")?mg(n.getResponseHeader("content-length")):DM(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),s!==void 0&&(e.data.response_body_size=s)}function OM(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r,input:i,xhr:a}=t,{url:c,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!c)return null;if(!a||!ii(c,n.networkDetailAllowUrls)||ii(c,n.networkDetailDenyUrls)){const C=_o(l),E=_o(f);return{startTimestamp:o,endTimestamp:s,url:c,method:u,statusCode:d,request:C,response:E}}const p=a[Ft],h=p?mc(p.request_headers,n.networkRequestHeaders):{},g=mc(vm(a),n.networkResponseHeaders),[_,y]=n.networkCaptureBodies?Ks(i,z):[void 0],[b,w]=n.networkCaptureBodies?LM(a):[void 0],I=sn(h,l,_),O=sn(g,f,b);return{startTimestamp:o,endTimestamp:s,url:c,method:u,statusCode:d,request:y?si(I,y):I,response:w?si(O,w):O}}function LM(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return PM(e.response,e.responseType)}catch(n){t.push(n)}return j&&z.warn("Failed to get xhr response body",...t),[void 0]}function PM(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&nt(e))return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return j&&z.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return j&&z.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function DM(e,t){try{const n=t==="json"&&nt(e)?JSON.stringify(e):e;return Yi(n)}catch(n){return}}function FM(e){const t=x();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i};t&&t.on("beforeAddBreadcrumb",(c,u)=>$M(a,c,u))}catch(n){}}function $M(e,t,n){if(t.data)try{BM(t)&&HM(n)&&(xM(t,n),NM(t,n,e)),UM(t)&&WM(n)&&(EM(t,n),bM(t,n,e))}catch(r){j&&z.exception(r,"Error when enriching network breadcrumb")}}function BM(e){return e.category==="xhr"}function UM(e){return e.category==="fetch"}function HM(e){return e==null?void 0:e.xhr}function WM(e){return(e==null?void 0:e.input)!==void 0}function jM(e){const t=x();bm(y1(e)),Bi(mM(e)),iM(e),FM(e);const n=pM(e);xS(n),t&&(t.on("beforeSendEvent",oM(e)),t.on("afterSendEvent",tM(e)),t.on("createDsc",r=>{const o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("processSegmentSpan",Z1(e)),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",(r,o)=>U(null,null,function*(){var i;const s=e.getSessionId();o!=null&&o.includeReplay&&e.isEnabled()&&s&&((i=r.contexts)!=null&&i.feedback)&&(r.contexts.feedback.source==="api"&&(yield e.sendBufferedReplayOrFlush()),r.contexts.feedback.replay_id=s)})),t.on("openFeedbackWidget",()=>U(null,null,function*(){yield e.sendBufferedReplayOrFlush()})))}function zM(e){return U(this,null,function*(){try{return Promise.all(Vi(e,[qM(ge.performance.memory)]))}catch(t){return[]}})}function qM(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function GM(e,t,n){return Wy(e,t,v(m({},n),{setTimeoutImpl:Ho}))}const Qe=H.navigator;
496function VM(){var e,t;return/iPhone|iPad|iPod/i.test((e=Qe==null?void 0:Qe.userAgent)!=null?e:"")||/Macintosh/i.test((t=Qe==null?void 0:Qe.userAgent)!=null?t:"")&&(Qe!=null&&Qe.maxTouchPoints)&&(Qe==null?void 0:Qe.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function YM(e){let t=!1;return(n,r)=>{try{if(!e.checkAndHandleExpiredSession()){j&&z.warn("Received replay event after session expired.");return}const o=r||!t;t=!0,JM(n),e.clickDetector&&p1(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!wu(e,n,o))return!0;if(!o)return!1;const s=e.session;if(XM(e,o),e.recordingMode==="buffer"&&s&&e.eventBuffer&&!s.dirty){const i=e.eventBuffer.getEarliestTimestamp();i&&(j&&z.log(`Updating session start time to earliest event in buffer to ${new Date(i)}`),s.started=i,e.getOptions().stickySession&&Gi(s))}return s!=null&&s.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}catch(o){e.handleException(o)}}}function JM(e){const t=e.data;if(!(e.type!==ne.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==K.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(const n of t.attributes){const r=mt.mirror.getNode(n.id),o=r&&mt.mirror.getMeta(r);if((o==null?void 0:o.type)===qi.Element)for(const[s,i]of Object.entries(n.attributes))i===null?delete o.attributes[s]:o.attributes[s]=i}}function KM(e){const t=e.getOptions();return{type:ne.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function XM(e,t){var n;!t||((n=e.session)==null?void 0:n.segmentId)!==0||wu(e,KM(e),!1)}function QM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(t){return null}}function ZM(e,t,n,r){return st(vp(e,wo(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function eN({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)} 497`;if(typeof e=="string")n=`${r}${e}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+e.length),n.set(s),n.set(e,s.length)}return n}function tN(o){return U(this,arguments,function*({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const a=yield Op(e.getOptions(),r,i,t,e,Se());if(!a)return null;e.emit("postprocessEvent",a,i),a.platform=a.platform||"javascript";const c=e.getSdkMetadata(),{name:u,version:d,settings:l}=(c==null?void 0:c.sdk)||{};return a.sdk=v(m({},a.sdk),{name:u||"sentry.javascript.unknown",version:d||"0.0.0",settings:l}),a})}function nN(i){return U(this,arguments,function*({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:s}){const a=eN({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:u,traceIds:d,segmentNames:l,initialTimestamp:f}=r,p=x(),h=Y(),g=p==null?void 0:p.getTransport(),_=p==null?void 0:p.getDsn();if(!p||!g||!_||!s.sampled)return Promise.resolve({});const y={type:CC,replay_start_timestamp:f/1e3,timestamp:o/1e3,error_ids:u,trace_ids:d,segment_names:l,urls:c,replay_id:t,segment_id:n,replay_type:s.sampled},b=yield tN({scope:h,client:p,replayId:t,event:y});if(!b)return p.recordDroppedEvent("event_processor","replay"),j&&z.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete b.sdkProcessingMetadata;const w=ZM(b,a,_,p.getOptions().tunnel);let I;try{I=yield g.send(w)}catch(C){const E=new Error(hu);try{E.cause=C}catch(F){}throw E}const O=Vp({},I);if(Gp(O,"replay"))throw new Ru(O);if(typeof I.statusCode=="number"&&(I.statusCode<200||I.statusCode>=300))throw new yg(I.statusCode);return I})}
497class yg extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Ru extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class ef extends Error{constructor(){super("Session is too long, not sending replay")}}function Sg(n){return U(this,arguments,function*(e,t={count:0,interval:LC}){const{recordingData:r,onError:o}=e;if(r.length)try{return yield nN(e),!0}catch(s){if(s instanceof yg||s instanceof Ru)throw s;if(AS("Replays",{_retryCount:t.count}),o&&o(s),t.count>=PC){const i=new Error(`${hu} - max retries exceeded`);try{i.cause=s}catch(a){}throw i}return t.interval*=++t.count,new Promise((i,a)=>{Ho(()=>U(null,null,function*(){try{yield Sg(e,t),i(!0)}catch(c){a(c)}}),t.interval)})}})}const bg="__THROTTLED",rN="__SKIPPED";function oN(e,t,n){const r=new Map,o=a=>{const c=a-n;r.forEach((u,d)=>{d<c&&r.delete(d)})},s=()=>[...r.values()].reduce((a,c)=>a+c,0);let i=!1;return(...a)=>{const c=Math.floor(Date.now()/1e3);if(o(c),s()>=t){const d=i;return i=!0,d?rN:bg}i=!1;const u=r.get(c)||0;return r.set(c,u+1),e(...a)}}class sN{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:AC,sessionIdleExpire:MC},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=GM(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=oN((i,a)=>X1(this,i,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),s=r?{threshold:Math.min(DC,r),timeout:r,scrollTimeout:FC,ignoreSelector:o?o.join(","):""}:void 0;if(s&&(this.clickDetector=new u1(this,s)),j){const i=t._experiments;z.setConfig({captureExceptions:!!i.captureExceptions,traceInternals:!!i.traceInternals})}this._handleVisibilityChange=()=>{ge.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const i=St({category:"ui.blur"});this._doChangeToBackgroundTasks(i)},this._handleWindowFocus=()=>{const i=St({category:"ui.focus"});this._doChangeToForegroundTasks(i)},this._handleKeyboardEvent=i=>{v1(this,i)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){j&&z.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){j&&z.exception(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",j&&z.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){j&&z.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){j&&z.log("Buffering is in progress, call `flush()` to save the replay");return}j&&z.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Aa({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){j&&z.log("Buffering is in progress, call `flush()` to save the replay");return}j&&z.infoTick("Starting replay in buffer mode");const t=Aa({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=mt(m(v(m(v(m(m({},this._recordingOptions),this.recordingMode==="buffer"?{checkoutEveryNms:OC}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)}),{emit:YM(this)}),VM()),{onMutation:this._onMutationHandler.bind(this)}),t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}))}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}stop(){return U(this,arguments,function*({forceFlush:t=!1,reason:n}={}){var o,s,i;if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const r=n!=null?n:"manual";(s=x())==null||s.emit("replayEnd",{sessionId:(o=this.session)==null?void 0:o.id,reason:r});try{j&&z.log(`Stopping Replay triggered by ${r}`),oi(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&(yield this._flush({force:!0})),(i=this.eventBuffer)==null||i.destroy(),this.eventBuffer=null,q1(this)}catch(a){this.handleException(a)}})}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),j&&z.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),j&&z.log("Resuming replay"))}sendBufferedReplayOrFlush(){return U(this,arguments,function*({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();j&&z.log("Converting buffer to session"),yield this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),Qd(this.session.id)),this.startRecording())})}addUpdate(t){const n=t();this.recordingMode==="buffer"||!this._isEnabled||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(t){var n,r;if(!(t&&((n=this.session)==null?void 0:n.sampled)===!1))return(r=this.session)==null?void 0:r.id}
497checkAndHandleExpiredSession(){var t;if(this._lastActivity&&pc(this._lastActivity,this.timeouts.sessionIdlePause)&&((t=this.session)==null?void 0:t.sampled)==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${ge.location.pathname}${ge.location.hash}${ge.location.search}`,n=`${ge.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===bg){const o=St({category:"replay.throttled"});this.addUpdate(()=>!wu(this,{type:n1,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||we(),n=t&&Ie(t),o=(n&&Q(n).data||{})[Ve];if(!(!n||!o||!["route","custom"].includes(o)))return Q(n).description}_initializeRecording(){var t;this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=W1({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&((t=x())==null||t.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode})),this.startRecording(),this.recordingMode==="session"&&this.session&&Qd(this.session.id)}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=Aa({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return ri(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}_refreshSession(t){return U(this,null,function*(){this._isEnabled&&(yield this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))})}_addListeners(){try{ge.document.addEventListener("visibilitychange",this._handleVisibilityChange),ge.addEventListener("blur",this._handleWindowBlur),ge.addEventListener("focus",this._handleWindowFocus),ge.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(jM(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=P1(this)}_removeListeners(){try{ge.document.removeEventListener("visibilitychange",this._handleVisibilityChange),ge.removeEventListener("blur",this._handleWindowBlur),ge.removeEventListener("focus",this._handleWindowFocus),ge.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;if(ri(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){oi();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){j&&z.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:ne.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=k1(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(Vi(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;
497const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),t}_runFlush(){return U(this,null,function*(){var n;const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){j&&z.error("No session or eventBuffer found to flush.");return}if(yield this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(yield zM(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new ef;const o=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=yield this.eventBuffer.finish();yield Sg({replayId:t,recordingData:i,segmentId:s,eventContext:o,session:this.session,timestamp:r,onError:a=>this.handleException(a)})}catch(r){this.handleException(r),this.stop({reason:"sendError"});const o=x();if(o){let s;r instanceof Ru?s="ratelimit_backoff":r instanceof ef?s="invalid":s="send_error",o.recordDroppedEvent(s,"replay")}}})}_flush(){return U(this,arguments,function*({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){j&&z.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();const s=o<this._options.minReplayDuration,i=o>this._options.maxReplayDuration+5e3;if(s||i){j&&z.log(`Session duration (${Math.floor(o/1e3)}s) is too ${s?"short":"long"}, not sending replay.`),s&&this._debouncedFlush();return}const a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&j&&z.log("Flushing initial segment without checkout.");const c=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{yield this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,c&&this._debouncedFlush()}})}_maybeSaveSession(){this.session&&this._options.stickySession&&Gi(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(a=>{const c=QM(a.target),u=n.join(",");return c==null?void 0:c.matches(u)}))return!1;const r=t.length,o=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=o&&r>o;if(r>s||i){const a=St({category:"replay.mutations",data:{count:r,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function qr(e,t){return[...e,...t].join(",")}function iN({mask:e,unmask:t,block:n,unblock:r,ignore:o}){const s=["base","iframe[srcdoc]:not([src])"],i=qr(e,[".sentry-mask","[data-sentry-mask]"]),a=qr(t,[]);return{maskTextSelector:i,unmaskTextSelector:a,blockSelector:qr(n,[".sentry-block","[data-sentry-block]",...s]),unblockSelector:qr(r,[]),ignoreSelector:qr(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function aN({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:s}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return s;const i=n.includes(t),a=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return i||a?s.replace(/[\S]/g,"*"):s}const tf='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',cN=["content-length","content-type","accept"],uN=Symbol.for("sentry__originalRequestBody");let nf=!1,rf=!1;function lN(){if(typeof Request=="undefined"||rf)return;const e=Request;try{const t=function(n,r){const o=new e(n,r);return(r==null?void 0:r.body)!=null&&(o[uN]=r.body),o};t.prototype=e.prototype,H.Request=t,rf=!0}catch(t){}}const GO=(e=>new dN(e));class dN{constructor({flushMinDelay:t=NC,flushMaxDelay:n=xC,minReplayDuration:r=$C,maxReplayDuration:o=Nd,stickySession:s=!0,useCompression:i=!0,workerUrl:a,_experiments:c={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:y=[],networkCaptureBodies:b=!0,networkRequestHeaders:w=[],networkResponseHeaders:I=[],mask:O=[],maskAttributes:C=["title","placeholder","aria-label"],unmask:E=[],block:F=[],unblock:k=[],ignore:T=[],maskFn:P,beforeAddRecordingEvent:M,beforeErrorSampling:D,onError:G,attachRawBodyFromRequest:Z=!1}={}){this.name="Replay";const V=iN({mask:O,unmask:E,block:F,unblock:k,ignore:T});if(this._recordingOptions=v(m({maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:P,maskInputFn:P,maskAttributeFn:($,N,te)=>aN({maskAttributes:C,maskAllText:u,privacyOptions:V,key:$,value:N,el:te})},V),{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:$=>{try{$.__rrweb__=!0}catch(N){}},recordCrossOriginIframes:!!c.recordCrossOriginIframes}),this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,BC),maxReplayDuration:Math.min(o,Nd),stickySession:s,useCompression:i,workerUrl:a,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:g,networkDetailAllowUrls:_,networkDetailDenyUrls:y,networkCaptureBodies:b,networkRequestHeaders:of(w),networkResponseHeaders:of(I),beforeAddRecordingEvent:M,beforeErrorSampling:D,onError:G,attachRawBodyFromRequest:Z,_experiments:c},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${tf}`:tf,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&un())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return nf}set _isInitialized(t){nf=t}afterAllSetup(t){!un()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&lN(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}
497startBuffering(){this._replay&&this._replay.startBuffering()}stop(t){var n;return this._replay?this._replay.stop({forceFlush:(n=t==null?void 0:t.flush)!=null?n:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){var n;if((n=this._replay)!=null&&n.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){var t;if((t=this._replay)!=null&&t.isEnabled())return this._replay.recordingMode}processSpan(t){const n=this.getReplayId(!0);n&&(cn(t,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&cn(t,{"sentry._internal.replay_is_buffering":!0}))}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=fN(this._initialOptions,t);this._replay=new sN({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch(n){}}}function fN(e,t){const n=t.getOptions(),r=m({sessionSampleRate:0,errorSampleRate:0},e),o=Ln(n.replaysSessionSampleRate),s=Ln(n.replaysOnErrorSampleRate);return o==null&&s==null&&qt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),s!=null&&(r.errorSampleRate=s),r}function of(e){return[...cN,...e.map(t=>t.toLowerCase())]}function VO(){const e=x();return e==null?void 0:e.getIntegrationByName("Replay")}var pN=Object.defineProperty,hN=(e,t,n)=>t in e?pN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sf=(e,t,n)=>hN(e,typeof t!="symbol"?t+"":t,n);class mN{constructor(){sf(this,"idNodeMap",new Map),sf(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function gN(){return new mN}function _N(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function gc(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:gc(e.parentNode,t,n,r+1)}function af(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(_N(r,e))return!0}return!!(t&&r.matches(t))}catch(o){return!1}}}const or=`Please stop import mirror directly. Instead of that,\r 498now you can use replayer.getMirror() to access the mirror instance of a replayer,\r 499or you can use record.mirror to access the mirror instance during recording.`;let cf={map:{},getId(){return console.error(or),-1},getNode(){return console.error(or),null},removeNodeFromMap(){console.error(or)},has(){return console.error(or),!1},reset(){console.error(or)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(cf=new Proxy(cf,{get(e,t,n){return t==="map"&&console.error(or),Reflect.get(e,t,n)}}));function Cu(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){vg(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>Cu(e,t,s||{},!0)}function Au(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(r){return()=>{}}}Date.now().toString();function yN(e){if(!e)return null;
499try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(t){return null}}function Ji(e,t,n,r,o){if(!e)return!1;const s=yN(e);if(!s)return!1;const i=af(t,n),a=gc(s,i);let c=-1;return a<0?!1:(r&&(c=gc(s,af(null,r))),a>-1&&c<0?!0:a<c)}const uf={};function Eg(e){const t=uf[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch(o){}return uf[e]=r.bind(window)}function Tn(...e){return Eg("requestAnimationFrame")(...e)}function vg(...e){return Eg("setTimeout")(...e)}var Mr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Mr||{});let Cs;function SN(e){Cs=e}const Ma=e=>Cs?((...n)=>{try{return e(...n)}catch(r){if(Cs&&Cs(r)===!0)return()=>{};throw r}}):e;var lr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bN=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var ls=0;ls<lr.length;ls++)bN[lr.charCodeAt(ls)]=ls;var EN=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=lr[t[n]>>2],o+=lr[(t[n]&3)<<4|t[n+1]>>4],o+=lr[(t[n+1]&15)<<2|t[n+2]>>6],o+=lr[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const lf=new Map;function vN(e,t){let n=lf.get(e);return n||(n=new Map,lf.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const Tg=(e,t,n)=>{if(!e||!(wg(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=vN(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function As(e,t,n){if(e instanceof Array)return e.map(r=>As(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=EN(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[As(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[As(e.data,t,n),e.width,e.height]};if(wg(e,t)||typeof e=="object"){const r=e.constructor.name,o=Tg(e,t,n);return{rr_type:r,index:o}}}}return e}const Ig=(e,t,n)=>e.map(r=>As(r,t,n)),wg=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function TN(e,t,n,r,o){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const c=Au(t.CanvasRenderingContext2D.prototype,a,function(u){return function(...d){return Ji(this.canvas,n,r,o,!0)||vg(()=>{const l=Ig(d,t,this);e(this.canvas,{type:Mr["2D"],property:a,args:l})},0),u.apply(this,d)}});s.push(c)}catch(c){const u=Cu(t.CanvasRenderingContext2D.prototype,a,{set(d){e(this.canvas,{type:Mr["2D"],property:a,args:[d],setter:!0})}});s.push(u)}return()=>{s.forEach(a=>a())}}function IN(e){return e==="experimental-webgl"?"webgl":e}function df(e,t,n,r,o){const s=[];try{const i=Au(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...u){if(!Ji(this,t,n,r,!0)){const d=IN(c);if("__context"in this||(this.__context=d),o&&["webgl","webgl2"].includes(d))if(u[0]&&typeof u[0]=="object"){const l=u[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...u])}});s.push(i)}catch(i){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>
499{s.forEach(i=>i())}}function ff(e,t,n,r,o,s,i,a){const c=[],u=Object.getOwnPropertyNames(e);for(const d of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof e[d]!="function")continue;const l=Au(e,d,function(f){return function(...p){const h=f.apply(this,p);if(Tg(h,a,this),"tagName"in this.canvas&&!Ji(this.canvas,r,o,s,!0)){const g=Ig(p,a,this),_={type:t,property:d,args:g};n(this.canvas,_)}return h}});c.push(l)}catch(l){const f=Cu(e,d,{set(p){n(this.canvas,{type:t,property:d,args:[p],setter:!0})}});c.push(f)}return c}function wN(e,t,n,r,o,s){const i=[];return i.push(...ff(t.WebGLRenderingContext.prototype,Mr.WebGL,e,n,r,o,s,t)),typeof t.WebGL2RenderingContext!="undefined"&&i.push(...ff(t.WebGL2RenderingContext.prototype,Mr.WebGL2,e,n,r,o,s,t)),()=>{i.forEach(a=>a())}}const kN='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 RN(){const e=new Blob([kN]);return URL.createObjectURL(e)}class CN{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};const{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:s,errorHandler:i}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,i&&SN(i),(s&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&Ma(()=>{s&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),s&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){var t;this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(n=>{try{n()}catch(r){}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,(t=this.worker)==null||t.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(t){const{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:s,recordCanvas:i,enableManualSnapshot:a}=this.options;if(!this.windowsSet.has(t)){if(a){this.windowsSet.add(t),this.windows.push(new WeakRef(t));return}Ma(()=>{if(i&&n==="all"&&this.initCanvasMutationObserver(t,r,o,s),i&&typeof n=="number"){const c=df(t,r,o,s,!0);this.restoreHandlers.push(()=>{c()})}})(),this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(t,n){if(n!=null&&n.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,t);return}Tn(r=>this.takeSnapshot(r,!0,t))}initFPSWorker(){const t=new Worker(RN());return t.onmessage=n=>{const r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;const{base64:s,type:i,width:a,height:c}=r;this.mutationCb({id:o,type:Mr["2D"],commands:[{property:"clearRect",args:[0,0,a,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:i}]},0,0,a,c]}]})},t}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;const n=r=>{this.takeSnapshot(r,!1),t=Tn(n)};t=Tn(n),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,n,r,o){const s=df(t,n,r,o,!1),i=TN(this.processMutation.bind(this),t,n,r,o),a=wN(this.processMutation.bind(this),t,n,r,o,this.mirror);this.restoreHandlers.push(()=>{s(),i(),a()})}getCanvasElements(t,n,r){const o=[],s=i=>{i.querySelectorAll("canvas").forEach(a=>{Ji(a,t,n,r)||o.push(a)})};for(const i of this.windows){const a=i.deref();let c;try{c=a&&a.document}catch(u){}c&&s(c)}for(const i of this.shadowDoms){const a=i.deref();a&&s(a)}return o}takeSnapshot(t,n,r){const{sampling:o,blockClass:s,blockSelector:i,unblockSelector:a,dataURLOptions:c,maxCanvasSize:u}=this.options,l=1e3/(o==="all"?2:o||2);return this.lastSnapshotTime&&t-this.lastSnapshotTime<l?!1:(this.lastSnapshotTime=t,(r?[r]:this.getCanvasElements(s,i,a)).forEac
499h(h=>{var _;const g=this.mirror.getId(h);if(!(!this.mirror.hasNode(h)||!h.width||!h.height||this.snapshotInProgressMap.get(g))){if(this.snapshotInProgressMap.set(g,!0),!n&&["webgl","webgl2"].includes(h.__context)){const y=h.getContext(h.__context);((_=y==null?void 0:y.getContextAttributes())==null?void 0:_.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}createImageBitmap(h).then(y=>{var b;(b=this.worker)==null||b.postMessage({id:g,bitmap:y,width:h.width,height:h.height,dataURLOptions:c,maxCanvasSize:u},[y])}).catch(y=>{Ma(()=>{throw this.snapshotInProgressMap.delete(g),y})()})}}),!0)}startPendingCanvasMutationFlusher(){Tn(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,Tn(t)};Tn(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),Tn(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(i=>{const u=i,{type:a}=u;return vn(u,["type"])}),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}var Cf;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Cf=e.contentWindow)==null?void 0:Cf.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}gN();var pf;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(pf||(pf={}));const hf={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}}},AN="ReplayCanvas",ds=1280,MN=((e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,ds):ds,n?Math.min(n,ds):ds]};let o,s;const i=new Promise(c=>s=c);return{name:AN,getOptions(){const{quality:c,enableManualSnapshot:u,maxCanvasSize:d}=r;return m({enableManualSnapshot:u,recordCanvas:!0,getCanvasManager:l=>{const f=new CN(v(m({},l),{enableManualSnapshot:u,maxCanvasSize:d,errorHandler:p=>{try{typeof p=="object"&&(p.__rrweb__=!0)}catch(h){}}}));return o=f,s(f),f}},hf[c]||hf.medium)},snapshot(c,u){return U(this,null,function*(){(o||(yield i)).snapshot(c,u)})}}}),YO=MN;function NN(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function kg(e){try{return new URL(e,B.location.origin).href}catch(t){return}}function xN(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Rg(e){try{return new Headers(e)}catch(t){return}}const Cg={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function ON(e,t){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:s,tracePropagationTargets:i,onRequestSpanStart:a,onRequestSpanEnd:c}
499=m(m({},Cg),t),u=typeof o=="function"?o:p=>!0,d=p=>PN(p,i),l={},f=e.getOptions().propagateTraceparent;n&&Ai(p=>{const h=rv(p,u,d,l,{propagateTraceparent:f,onRequestSpanEnd:c});if(h){const g=kg(p.fetchData.url),_=g?xn(g).host:void 0,y=g?pt(g):void 0;h.setAttributes({[Ap]:y,[qn]:y,"server.address":_}),s&&mf(h,e),a==null||a(h,{headers:p.headers})}}),r&&du(p=>{var g;const h=DN(p,u,d,l,f,c);h&&(s&&mf(h,e),a==null||a(h,{headers:Rg((g=p.xhr.__sentry_xhr_v3__)==null?void 0:g.request_headers)}))})}const LN=300;function mf(e,t){const{url:n}=Q(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(it(t)){const s=e.end.bind(e);e.end=i=>{const a=i!=null?i:be();let c=!1;const u=()=>{c||(c=!0,setTimeout(o),s(a),clearTimeout(d))};r=u;const d=setTimeout(u,LN)}}const o=fn("resource",({entries:s})=>{s.forEach(i=>{xN(i)&&i.name.endsWith(n)&&(e.setAttributes(ym(i)),r())})})}function PN(e,t){const n=dn();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch(i){return!1}const s=r.origin===o;return t?rt(r.toString(),t)||s&&rt(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?rt(e,t):r}}function DN(e,t,n,r,o,s){const i=e.xhr,a=i==null?void 0:i[Ft];if(!i||i.__sentry_own_request__||!a)return;const{url:c,method:u}=a,d=Je()&&t(c);if(e.endTimestamp){const I=i.__sentry_xhr_span_id__;if(!I)return;const O=r[I];O&&(d&&a.status_code!==void 0&&(xs(O,a.status_code),O.end(),s==null||s(O,{headers:Rg(vm(i)),error:e.error})),delete r[I]);return}const l=kg(c),f=xn(l||c),p=l?pt(l):void 0,h=pt(nh(c)),g=x(),_=!!we(),y=_||!!g&&it(g),b=d&&y?yn({name:`${u} ${h}`,attributes:m(m({url:pt(c),type:"xhr","http.method":u,"http.url":p,[qn]:p,"server.address":f==null?void 0:f.host,[ue]:"auto.http.browser",[ve]:"http.client"},(f==null?void 0:f.search)&&{"http.query":f==null?void 0:f.search}),(f==null?void 0:f.hash)&&{"http.fragment":f==null?void 0:f.hash})}):new Pn,w=gi(b)&&_?void 0:b;return d&&!y&&(g==null||g.recordDroppedEvent("no_parent_span","span")),i.__sentry_xhr_span_id__=b.spanContext().spanId,r[i.__sentry_xhr_span_id__]=b,n(c)&&FN(i,Je()&&y?w:void 0,o),g&&g.emit("beforeOutgoingRequestSpan",b,e),b}function FN(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=oh({span:t,propagateTraceparent:n});r&&$N(e,r,o,s)}function $N(e,t,n,r){var s;const o=(s=e.__sentry_xhr_v3__)==null?void 0:s.request_headers;if(!(o!=null&&o["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(o!=null&&o.traceparent)&&e.setRequestHeader("traceparent",r),n){const i=o==null?void 0:o.baggage;(!i||!NN(i))&&e.setRequestHeader("baggage",n)}}catch(i){}}const gf=new WeakMap,_f=new WeakMap,BN=9e4,UN=["text/event-stream","application/x-ndjson","application/stream+json"],HN=()=>({name:"FetchStreamPerformance",setup(){CI(e=>{if(e.response){const t=gf.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);const n=_f.get(e.response);n&&clearTimeout(n)}}}),Ai(e=>{var t,n,r,o;if(e.endTimestamp&&e.response){const s=((t=e.response.headers)==null?void 0:t.get("content-type"))||"";if((n=e.response.headers)!=null&&n.get("content-length")||!UN.some(f=>s.startsWith(f)))return;const i=((r=e.fetchData)==null?void 0:r.url)||"",a=((o=e.fetchData)==null?void 0:o.method)||"GET",c=uo(i),u=i.startsWith("data:")?pt(i):c?th(c):i,d=yn({name:`${a} ${u}`,startTime:e.endTimestamp,attributes:{url:pt(i),"http.method":a,type:"fetch",[ve]:"http.client.stream",[ue]:"auto.http.browser.stream"}});gf.set(e.response,d);const l=setTimeout(()=>{d.isRecording()&&d.end()},BN);_f.set(e.response,l)}})}}),Ag="WebVitals",WN=(e={})=>{var n;const t=new Set((n=e.ignore)!=null?n:[]);return{name:Ag,setup(r){var l;const o=it(r),{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:i}=(l=e._experiments)!=null?l:{},a=o||t.has("cls")?void 0:s||!1,c=o||t.has("lcp")?void 0:i||!1,u=Xw({recordClsStandaloneSpans:a,recordLcpStandaloneSpans:c,client:r}),d=new WeakSet;r.on("afterStartPageLoadSpan",f=>{d.add(f)}),r.on("spanEnd",f=>{d.delete(f)&&(u(),ik(f,{recordClsOnPageloadSpan:a===!1,recordLcpOnPageloadSpan:c===!1,spanStreamingEnabled:o}))}),o?(t.has("lcp")||wk(r),t.has("cls")||Rk(r),t.has("inp")||Ak()):t.has("inp")||bk()},afterAllSetup(){t.has("inp")||Ik()}}};function jN(){B.document?B.document.addEventListener("visibilitychange",()=>{const e=we();if(!e)return;const t=Ie(e);if(B.document.hidden&&t){const n="cancelled",{op:r,status:o}=Q(t);R&&S.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:ie,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):R&&S.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const zN=3600,Mg="sentry_previous_trace",qN="sentry.previous_trace";function GN(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?JN():void 0;e.on("spanStart",i=>{if(Ie(i)!==i)return;const a=Y().getPropagationContext();o=VN(o,i,a),r&&YN(o)});let s=!0;n&&e.on("beforeSampling",i=>{if(!o)return;const a=Y(),c=a.getPropagationContext();if(s&&c.parentSpanId){s=!1;return}a.setPropagationContext(v(m({},c),{dsc:v(m({},c.dsc),{sample_rate:String(o.sampleRate),sampled:String(_c(o.spanContext))}),sampleRand:o.sampleRand})),i.parentSampled=_c(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes=v(m({},i.spanAttributes),{[Jf]:o.sampleRate})})}function VN(e,t,n){const r=Q(t);function o(){var a,c,u;try{const d=Number((u=(a=r.data)==null?void 0:a[Ic])!=null?u:(c=n.dsc)==null?void 0:c.sample_rate);return Number.isNaN(d)?0:d}catch(d){return 0}}const s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=zN&&(R&&S.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify(m({op:r.op},t.spanContext()))}\``),t.addLink({context:i,attributes:{[z_]:"previous_trace"}}),t.setAttribute(qN,`${i.traceId}-${i.spanId}-${_c(i)?1:0}`)),s)}function YN(e){try{B.sessionStorage.setItem(Mg,JSON.stringify(e))}catch(t){R&&S.warn("Could not store previous trace in sessionStorage",t)}}function JN(){var e;try{const t=(e=B.sessionStorage)==null?void 0:e.getItem(Mg);return JSON.parse(t)}catch(t){return}}function _c(e){return e.traceFlags===1}const KN="BrowserTracing",XN=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function QN(){const e=B.navigator;return e!=null&&e.userAgent?XN.test(e.userAgent):!1}const ZN=m(v(m({},ms),{instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroun
499dSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{}}),Cg),JO=((e={})=>{"enableElementTiming"in e&&qt(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=B.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:i,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:u,idleTimeout:d,finalTimeout:l,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:h,traceXHR:g,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:y,enableHTTPTimings:b,ignoreResourceSpans:w,ignorePerformanceApiSpans:I,instrumentPageLoad:O,instrumentNavigation:C,detectRedirects:E,linkPreviousTrace:F,consistentTraceSampling:k,enableReportPageLoaded:T,onRequestSpanStart:P,onRequestSpanEnd:M}=m(m({},ZN),e),D=QN();let G,Z;function V($,N,te=!0,L){const J=N.op==="pageload",se=N.name,oe=u?u(N):N,ce=uo(L||dn()),Pe=m(m(m({},(ce==null?void 0:ce.pathname)&&{[uS]:ce.pathname}),ce&&!Si(ce)&&{[qn]:ce.href}),oe.attributes);if(se!==oe.name&&(Pe[Ve]="custom"),oe.attributes=Pe,!te){const ct=jn();yn(v(m({},oe),{startTime:ct})).end(ct);return}t.name=oe.name,t.source=Pe[Ve];const at=wp(oe,{idleTimeout:d,finalTimeout:l,childSpanTimeout:f,disableAutoFinish:J,beforeSpanEnd:ct=>{sk(ct,{ignoreResourceSpans:w,ignorePerformanceApiSpans:I,spanStreamingEnabled:it($)}),bf($,void 0);const Sn=Y(),xt=Sn.getPropagationContext();Sn.setPropagationContext(v(m({},xt),{traceId:at.spanContext().traceId,sampled:Mt(at),dsc:_t(ct)})),J&&(Z=void 0)},trimIdleSpanEndTimestamp:!T});J&&T&&(Z=at),bf($,at);function Nt(){n&&["interactive","complete"].includes(n.readyState)&&($.emit("idleSpanEnableAutoFinish",at),n.removeEventListener("readystatechange",Nt))}J&&!T&&n&&(n.addEventListener("readystatechange",Nt),Nt())}return{name:KN,setup($){var te;if(D){R&&S.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(fy(),s&&H.PerformanceObserver&&((te=PerformanceObserver.supportedEntryTypes)!=null&&te.includes("long-animation-frame"))?Zw():o&&Qw(),i&&ek(),E&&n){const L=()=>{G=be()};addEventListener("click",L,{capture:!0}),addEventListener("keydown",L,{capture:!0,passive:!0})}function N(){const L=yo($);L&&!Q(L).timestamp&&(R&&S.log(`[Tracing] Finishing current active span with op: ${Q(L).op}`),L.setAttribute(so,"cancelled"),L.end())}$.on("startNavigationSpan",(L,J)=>{if(x()!==$)return;if(J!=null&&J.isRedirect){R&&S.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),V($,m({op:"navigation.redirect"},L),!1,J.url);return}G=void 0,N();const se=Y();se.setPropagationContext({traceId:Ht(),sampleRand:Math.random(),propagationSpanId:Je()?void 0:an()}),se.setSDKProcessingMetadata({normalizedRequest:void 0}),V($,v(m({op:"navigation"},L),{parentSpan:null,forceTransaction:!0}),!0,J==null?void 0:J.url)}),$.on("startPageLoadSpan",(L,J={})=>{if(x()!==$)return;N();const se=J.sentryTrace||yf("sentry-trace")||Sf("sentry-trace"),oe=J.baggage||yf("baggage")||Sf("baggage"),ce=sp(se,oe),Pe=Y();Pe.setPropagationContext(ce),Je()||(Pe.getPropagationContext().propagationSpanId=an()),Pe.setSDKProcessingMetadata({normalizedRequest:Vs()}),V($,m({op:"pageload"},L))}),$.on("endPageloadSpan",()=>{T&&Z&&(Z.setAttribute(so,"reportPageLoaded"),Z.end())})},afterAllSetup($){var te;if(D)return;$.addIntegration&&!((te=$.getIntegrationByName)!=null&&te.call($,Ag))&&$.addIntegration(WN({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c}}));let N=dn();if(F!=="off"&&GN($,{linkPreviousTrace:F,consistentTraceSampling:k}),B.location){if(O){const L=ke();ex($,{name:B.location.pathname,startTime:L?L/1e3:void 0,attributes:{[Ve]:"url",[ue]:"auto.pageload.browser"}})}C&&Bi(({to:L,from:J})=>{if(J===void 0&&(N==null?void 0:N.indexOf(L))!==-1){N=void 0;return}N=void 0;const se=uo(L),oe=yo($),ce=oe&&E&&rx(oe,G);tx($,{name:(se==null?void 0:se.pathname)||B.location.pathname,attributes:{[Ve]:"url",[ue]:"auto.navigation.browser"}},{url:L,isRedirect:ce})})}p&&jN(),i&&nx($,d,l,f,t),ON($,{traceFetch:h,traceXHR:g,tracePropagationTargets:$.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:y,enableHTTPTimings:b,onRequestSpanStart:P,onRequestSpanEnd:M}),_&&$.addIntegration(HN())}}});function ex(e,t,n){e.emit("startPageLoadSpan",t,n),Y().setTransactionName(t.name);const r=yo(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function tx(e,t,n){const{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o,url:r}),e.emit("startNavigationSpan",t,{isRedirect:o,url:r});const s=Y();return s.setTransactionName(t.name),r&&!o&&s.setSDKProcessingMetadata({normalizedRequest:v(m({},Vs()),{url:r})}),yo(e)}function yf(e){const t=B.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function Sf(e){var r,o,s;const t=(o=(r=B.performance)==null?void 0:r.getEntriesByType)==null?void 0:o.call(r,"navigation")[0],n=(s=t==null?void 0:t.serverTiming)==null?void 0:s.find(i=>i.name===e);return n==null?void 0:n.description}function nx(e,t,n,r,o){const s=B.document;let i;const a=()=>{const c="ui.action.click",u=yo(e);if(u){const d=Q(u).op;
499if(["navigation","pageload"].includes(d)){R&&S.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(so,"interactionInterrupted"),i.end(),i=void 0),!o.name){R&&S.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}i=wp({name:o.name,op:c,attributes:{[Ve]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const Ng="_sentry_idleSpan";function yo(e){return e[Ng]}function bf(e,t){xe(e,Ng,t)}const Ef=1.5;function rx(e,t){const n=Q(e),r=jn(),o=n.start_timestamp;return!(r-o>Ef||t&&r-t<=Ef)}function KO(e=x()){e==null||e.emit("endPageloadSpan")}function XO(e){const t=we();if(t===e)return;const n=Y();e.end=new Proxy(e.end,{apply(r,o,s){return It(n,t),Reflect.apply(r,o,s)}}),It(n,e)}const QO=()=>({name:"SpanStreaming",beforeSetup(e){const t=e.getOptions();t.traceLifecycle||(R&&S.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),t.traceLifecycle="stream")},setup(e){const t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!it(e)){r.traceLifecycle="static",R&&S.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}const o=r.beforeSendSpan;if(o&&!pi(o)){r.traceLifecycle="static",R&&S.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}const s=new II(e);e.on("afterSpanEnd",i=>{Mt(i)&&s.add(dS(i,e))}),e.on("afterSegmentSpanEnd",i=>{const a=i.spanContext().traceId;setTimeout(()=>{s.flush(a)},500)})}});function Nr(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function ox(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Nr(n);return o=>r.then(s=>o(s.transaction(t,"readwrite").objectStore(t)))}function Mu(e){return Nr(e.getAllKeys())}function sx(e,t,n){return e(r=>Mu(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),Nr(r.transaction)}))}function ix(e,t,n){return e(r=>Mu(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.min(...o,0)-1),Nr(r.transaction)}))}function ax(e){return e(t=>Mu(t).then(n=>{const r=n[0];if(r!=null)return Nr(t.get(r)).then(o=>(t.delete(r),Nr(t.transaction).then(()=>o)))}))}function cx(e){let t;function n(){return t==null&&(t=ox(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:r=>U(null,null,function*(){try{const o=$s(r);yield sx(n(),o,e.maxQueueSize||30)}catch(o){}}),unshift:r=>U(null,null,function*(){try{const o=$s(r);yield ix(n(),o,e.maxQueueSize||30)}catch(o){}}),shift:()=>U(null,null,function*(){try{const r=yield ax(n());if(r)return yy(r)}catch(r){}})}}function ux(e){return t=>{const n=e(v(m({},t),{createStore:cx}));return B.addEventListener("online",r=>U(null,null,function*(){yield n.flush()})),n}}function ZO(e=Tm){return ux(wb(e))}const vf=1e6,lx="window"in H&&H.window===H&&typeof importScripts=="undefined",On=String(0),Nu=lx?"main":"worker",Ze=B.navigator;let xg="",Og="",Lg="",yc=(Ze==null?void 0:Ze.userAgent)||"",Pg="";var Af;const dx=(Ze==null?void 0:Ze.language)||((Af=Ze==null?void 0:Ze.languages)==null?void 0:Af[0])||"";function fx(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const Tf=Ze==null?void 0:Ze.userAgentData;fx(Tf)&&Tf.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{var t;if(xg=e.platform||"",Lg=e.architecture||"",Pg=e.model||"",Og=e.platformVersion||"",(t=e.fullVersionList)!=null&&t.length){const n=e.fullVersionList[e.fullVersionList.length-1];yc=`${n.brand} ${n.version}`}}).catch(e=>{});function px(e){return!("thread_metadata"in e)}function hx(e){return px(e)?bx(e):e}function mx(e){var n,r;const t=(r=(n=e.contexts)==null?void 0:n.trace)==null?void 0:r.trace_id;return typeof t=="string"&&t.length!==32&&R&&S.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function gx(e,t,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 o=mx(r),s=hx(n),i=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:be()*1e3),a=typeof r.timestamp=="number"?r.timestamp*1e3:be()*1e3;return{event_id:e,timestamp:new Date(i).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Io,runtime:{name:"javascript",version:B.navigator.userAgent},os:{name:xg,version:Og,build_number:yc},device:{locale:dx,model:Pg,manufacturer:yc,architecture:Lg,is_emulator:!1},debug_meta:{images:Fg(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||Ae(),trace_id:o,active_thread_id:On,relative_start_ns:"0",relative_end_ns:((a-i)*1e6).toFixed(0)}]}}function _x(e,t,n){var i,a,c,u,d,l;if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=Sx(e),o=t.getOptions(),s=(a=(i=t.getSdkMetadata)==null?void 0:i.call(t))==null?void 0:a.sdk;return{chunk_id:Ae(),client_sdk:{name:(c=s==null?void 0:s.name)!=null?c:"sentry.javascript.browser",version:(u=s==null?void 0:s.version)!=null?u:"0.0.0"},profiler_id:n||Ae(),platform:"javascript",version:"2",release:(d=o.release)!=null?d:"",environment:(l=o.environment)!=null?l:"production",debug_meta:{images:Fg(e.resources)},profile:r}}function yx(e){try{if(!e||typeof e!="object")return{reason:"chunk is not an object"};const t=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};const n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}
499:!Array.isArray(n.stacks)||!n.stacks.length?{reason:"profile has no stacks"}:!Array.isArray(n.samples)||!n.samples.length?{reason:"profile has no samples"}:{valid:!0}:{reason:"missing profile data"}}catch(t){return{reason:`unknown validation error: ${t}`}}}function Sx(e){var a;const t=[];for(let c=0;c<e.frames.length;c++){const u=e.frames[c];u&&(t[c]={function:u.name,abs_path:typeof u.resourceId=="number"?e.resources[u.resourceId]:void 0,lineno:u.line,colno:u.column})}const n=[];for(let c=0;c<e.stacks.length;c++){const u=e.stacks[c];if(!u)continue;const d=[];let l=u;for(;l;)d.push(l.frameId),l=l.parentId===void 0?void 0:e.stacks[l.parentId];n[c]=d}const r=ke(),o=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,s=o-(r||o),i=[];for(let c=0;c<e.samples.length;c++){const u=e.samples[c];if(!u)continue;const d=(o+(u.timestamp-s))/1e3;i[c]={stack_id:(a=u.stackId)!=null?a:0,thread_id:On,timestamp:d}}return{frames:t,stacks:n,samples:i,thread_metadata:{[On]:{name:Nu}}}}function Dg(e){return Q(e).op==="pageload"}function bx(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[On]:{n
499ame:Nu}}},o=e.samples[0];if(!o)return r;const s=o.timestamp,i=ke(),a=typeof performance.timeOrigin=="number"?performance.timeOrigin:i||0,c=a-(i||a);return e.samples.forEach((u,d)=>{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[d]={elapsed_since_start_ns:((u.timestamp+c-s)*vf).toFixed(0),stack_id:t,thread_id:On};return}let l=e.stacks[u.stackId];const f=[];for(;l;){f.push(l.frameId);const h=e.frames[l.frameId];h&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:h.name,abs_path:typeof h.resourceId=="number"?e.resources[h.resourceId]:void 0,lineno:h.line,colno:h.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}const p={elapsed_since_start_ns:((u.timestamp+c-s)*vf).toFixed(0),stack_id:n,thread_id:On};r.stacks[n]=f,r.samples[d]=p,n++}),r}function Ex(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function vx(e){const t=[];return Dn(e,(n,r)=>{var o,s;if(r==="transaction")for(let i=1;i<n.length;i++){const a=n[i];(s=(o=a==null?void 0:a.contexts)==null?void 0:o.profile)!=null&&s.profile_id&&t.push(n[i])}}),t}function Fg(e){const t=x(),n=t==null?void 0:t.getOptions(),r=n==null?void 0:n.stackParser;return r?_S(r,e):[]}function $g(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(R&&S.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(R&&S.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function Tx(e){return e.samples.length<2?(R&&S.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(R&&S.log("[Profiling] Discarding profile because it contains no frames"),!1)}let xu=!1;const Bg=3e4;function Ix(e){return typeof e=="function"}function Ug(){const e=B.Profiler;if(!Ix(e)){R&&S.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(Bg/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch(r){R&&(S.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),S.log("[Profiling] Disabling profiling for current user session.")),xu=!0}}function If(e){if(xu)return R&&S.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return R&&S.log("[Profiling] Discarding profile because root span was not sampled."),!1;const t=x(),n=t==null?void 0:t.getOptions();if(!n)return R&&S.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return $g(r)?r?(r===!0?!0:Math.random()<r)?!0:(R&&S.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(R&&S.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(R&&S.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function wx(e){if(xu)return R&&S.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if(e.profileLifecycle!=="trace"&&e.profileLifecycle!=="manual")return R&&S.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;const t=e.profileSessionSampleRate;return $g(t)?t?Math.random()<=t:(R&&S.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(R&&S.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function fs(e){return typeof e.profilesSampleRate!="undefined"}function kx(e,t,n,r){return Tx(n)?gx(e,t,n,r):null}const An=new Map;function Rx(){return An.size}function Cx(e){const t=An.get(e);return t&&An.delete(e),t}function Ax(e,t){if(An.set(e,t),An.size>30){const n=An.keys().next().value;n!==void 0&&An.delete(n)}}const Hg=new WeakSet;function ai(e){e.setAttribute("thread.id",On),e.setAttribute("thread.name",Nu)}function wf(e){let t;Dg(e)&&(t=be()*1e3);const n=Ug();if(!n)return;R&&S.log(`[Profiling] started profiling span: ${Q(e).description}`);const r=Ae();let o=null;Y().setContext("profile",{profile_id:r,start_timestamp:t}),Hg.add(e),ai(e);function s(){return U(this,null,function*(){if(e&&n){if(o){R&&S.log("[Profiling] profile for:",Q(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(i&&(B.clearTimeout(i),i=void 0),R&&S.log(`[Profiling] stopped profiling of span: ${Q(e).description}`),!u){R&&S.log(`[Profiling] profiler returned null profile for: ${Q(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=u,Ax(r,u)}).catch(u=>{R&&S.log("[Profiling] error while stopping profiler:",u)})}})}let i=B.setTimeout(()=>{R&&S.log("[Profiling] max profile duration elapsed, stopping profiling for:",Q(e).description),s()},Bg);const a=e.end.bind(e);function c(){return e?(s().then(()=>{a()},()=>{a()}),e):a()}e.end=c}const Mx=6e4,Nx=3e5;class xx{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(t){const n=t.getOptions().profileLifecycle,r=wx(t.getOptions());R&&S.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||R&&S.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=Ae(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t),t.on("spanStart",o=>{this._isRunning&&ai(o)})}
499start(){if(this._lifecycleMode==="trace"){R&&S.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){R&&S.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){R&&S.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){R&&S.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){R&&S.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);const r=this._activeRootSpanIds.size;r===1&&(R&&S.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling()),this._isRunning&&ai(t)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,R&&S.log("[Profiling] Started profiling with profiler ID:",this._profilerId),Xr().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){R&&S.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{R&&S.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&Xr().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){R&&S.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==Ie(n))return;if(!n.isRecording()){R&&S.log("[Profiling] Discarding profile because root span was not sampled.");return}const r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);const o=this._activeRootSpanIds.size;o===1&&(R&&S.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),t.on("spanEnd",n=>{if(!this._sessionSampled)return;const r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);const o=this._activeRootSpanIds.size;R&&S.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(s=>{R&&S.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",s)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,Xr().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),Nx);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){var n;if(((n=this._profiler)==null?void 0:n.stopped)===!1)return;const t=Ug();if(!t){R&&S.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{R&&S.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},Mx))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(R&&S.log(`[Profiling] Reached 5-minute timeout for root span ${t}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(t),this._activeRootSpanIds.size===0&&this._endProfiling()))}_collectCurrentChunk(){return U(this,null,function*(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=yield t.stop(),r=_x(n,this._client,this._profilerId),o=yx(r);if("reason"in o){R&&S.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),R&&S.log("[Profiling] Collected browser profile chunk.")}catch(n){R&&S.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}})}_sendProfileChunk(t){var a;const n=this._client,r=wo((a=n.getSdkMetadata)==null?void 0:a.call(n)),o=n.getDsn(),s=n.getOptions().tunnel,i=st(m(m({event_id:Ae(),sent_at:new Date().toISOString()},r&&{sdk:r}
499),!!s&&o&&{dsn:At(o)}),[[{type:"profile_chunk",platform:"javascript"},t]]);n.sendEnvelope(i).then(null,c=>{R&&S.error("Error while sending profile chunk envelope:",c)})}}const Ox="BrowserProfiling",Lx=(()=>({name:Ox,setup(e){const t=e.getOptions(),n=new xx;if(!fs(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),fs(t)&&!t.profilesSampleRate){R&&S.log("[Profiling] Profiling disabled, no profiling options found.");return}const r=we(),o=r&&Ie(r);if(fs(t)&&t.profileSessionSampleRate!==void 0&&R&&S.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),fs(t))o&&Dg(o)&&If(o)&&wf(o),e.on("spanStart",s=>{const i=Ie(s);s===i?If(s)&&wf(s):Hg.has(i)&&ai(s)}),e.on("beforeEnvelope",s=>{var c,u;if(!Rx())return;const i=vx(s);if(!i.length)return;const a=[];for(const d of i){const l=d==null?void 0:d.contexts,f=(c=l==null?void 0:l.profile)==null?void 0:c.profile_id,p=(u=l==null?void 0:l.profile)==null?void 0:u.start_timestamp;if(typeof f!="string"){R&&S.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!f){R&&S.log("[Profiling] cannot find profile for a span without a profile context");continue}l!=null&&l.profile&&delete l.profile;const h=Cx(f);if(!h){R&&S.log(`[Profiling] Could not retrieve profile for span: ${f}`);continue}const g=kx(f,p,h,d);g&&a.push(g)}Ex(s,a)});else{const s=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),s==="manual")n.initialize(e);else if(s==="trace"){if(!Je(t)){R&&S.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),o&&n.notifyRootSpanActive(o),B.setTimeout(()=>{const i=we(),a=i&&Ie(i);a&&n.notifyRootSpanActive(a)},0)}}}})),eL=Lx,Px="SpotlightBrowser",Dx=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],Fx=((e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:Px,setup:()=>{R&&S.log("Using Sidecar URL",t)},beforeSetup(n){const r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...Dx]},afterAllSetup:n=>{$x(n,t)}}});function $x(e,t){const n=lu("fetch");let r=0;e.on("beforeEnvelope",o=>{if(r>3){S.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:$s(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(s=>{s.status>=200&&s.status<400&&(r=0)},s=>{r++,S.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",s)})})}const tL=Fx,nL=()=>({name:"LaunchDarkly",processEvent(e,t,n){return Pr(e)}});function rL(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{Fn(e,t.value),$n(e,t.value)}}}const oL=()=>({name:"OpenFeature",processEvent(e,t,n){return Pr(e)}});class sL{after(t,n){Fn(n.flagKey,n.value),$n(n.flagKey,n.value)}error(t,n,r){Fn(t.flagKey,t.defaultValue),$n(t.flagKey,t.defaultValue)}}const iL=({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){const t=e.prototype;Oe(t,"isEnabled",Bx)},processEvent(t,n,r){return Pr(t)}});function Bx(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"?(Fn(n,r),$n(n,r)):R&&S.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}const aL=(({growthbookClass:e})=>ZE({growthbookClass:e})),cL=({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",n=>{Fn(n.gate.name,n.gate.value),$n(n.gate.name,n.gate.value)})},processEvent(t,n,r){return Pr(t)}});function uL(){return U(this,null,function*(){const e=x();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";const r=e.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{yield Oy(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch(o){return"sentry-unreachable"}})}const Ux="WebWorker",lL=({worker:e})=>({name:Ux,setupOnce:()=>
499{(Array.isArray(e)?e:[e]).forEach(t=>kf(t))},addWorker:t=>kf(t)});function kf(e){e.addEventListener("message",t=>{if(Wx(t.data)){if(t.stopImmediatePropagation(),t.data._sentryDebugIds&&(R&&S.log("Sentry debugId web worker message received",t.data),B._sentryDebugIds=m(m({},t.data._sentryDebugIds),B._sentryDebugIds)),t.data._sentryModuleMetadata&&(R&&S.log("Sentry module metadata web worker message received",t.data),B._sentryModuleMetadata=m(m({},t.data._sentryModuleMetadata),B._sentryModuleMetadata)),t.data._sentryWasmImages){R&&S.log("Sentry WASM images web worker message received",t.data);const n=B._sentryWasmImages||[],r=t.data._sentryWasmImages.filter(o=>He(o)&&typeof o.code_file=="string"&&!n.some(s=>s.code_file===o.code_file));B._sentryWasmImages=[...n,...r]}t.data._sentryWorkerError&&(R&&S.log("Sentry worker rejection message received",t.data._sentryWorkerError),Hx(t.data._sentryWorkerError))}})}function Hx(e){const t=x();if(!t)return;const n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,o=e.reason,s=Tt(o)?km(o):xi(n,o,void 0,r,!0);s.level="error",e.filename&&(s.contexts=v(m({},s.contexts),{worker:{filename:e.filename}})),Co(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),R&&S.log("Captured worker unhandled rejection",o)}function dL({self:e}){var t,n;e.postMessage({_sentryMessage:!0,_sentryDebugIds:(t=e._sentryDebugIds)!=null?t:void 0,_sentryModuleMetadata:(n=e._sentryModuleMetadata)!=null?n:void 0}),e.addEventListener("unhandledrejection",r=>{var i;const s={reason:wm(r),filename:(i=e.location)==null?void 0:i.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:s}),R&&S.log("[Sentry Worker] Forwarding unhandled rejection to parent",s)}),R&&S.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function Wx(e){if(!He(e)||e._sentryMessage!==!0)return!1;const t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,r="_sentryWorkerError"in e,o="_sentryWasmImages"in e;return!(!t&&!n&&!r&&!o||t&&!(He(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(He(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!He(e._sentryWorkerError)||o&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(s=>He(s)&&typeof s.code_file=="string")))}export{lw as BrowserClient,la as MULTIPLEXED_TRANSPORT_EXTRA_KEY,sL as OpenFeatureIntegrationHook,nn as SDK_VERSION,ve as SEMANTIC_ATTRIBUTE_SENTRY_OP,ue as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,Ic as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,Ve as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,wt as Scope,B as WINDOW,Wt as addBreadcrumb,xS as addEventProcessor,gl as addIntegration,Jx as bindScopeToEmitter,yR as breadcrumbsIntegration,AR as browserApiErrorsIntegration,eL as browserProfilingIntegration,PR as browserSessionIntegration,JO as browserTracingIntegration,rL as buildLaunchDarklyFlagUsedHandler,uO as captureConsoleIntegration,Co as captureEvent,kt as captureException,lv as captureFeedback,CS as captureMessage,oa as captureSession,nR as chromeStackLineParser,sO as close,_O as consoleLoggingIntegration,WO as contextLinesIntegration,Yx as continueTrace,SO as createConsolaReporter,Dh as createLangChainCallbackHandler,cb as createTransport,PO as createUserFeedbackEnvelope,$R as cultureContextIntegration,lE as dedupeIntegration,Cg as defaultRequestInstrumentationOptions,pR as defaultStackLineParsers,hR as defaultStackParser,uL as diagnoseSdkConnectivity,AO as elementTimingIntegration,Lp as endSession,qb as eventFiltersIntegration,sw as eventFromException,iw as eventFromMessage,ru as exceptionFromError,lO as extraErrorDataIntegration,mO as featureFlagsIntegration,RO as feedbackAsyncIntegration,CO as feedbackIntegration,CO as feedbackSyncIntegration,HN as fetchStreamPerformanceIntegration,oO as flush,FO as forceLoad,Wb as functionToStringIntegration,iR as geckoStackLineParser,MO as getAbsoluteUrl,we as getActiveSpan,x as getClient,Y as getCurrentScope,rC as getDefaultIntegrations,kO as getFeedback,Xr as getGlobalScope,Se as getIsolationScope,VO as getReplay,Ie as getRootSpan,hs as getSpanDescendants,G_ as getSpanStatusFromHttpCode,oh as getTraceData,HR as globalHandlersIntegration,jO as graphqlClientIntegration,aL as growthbookIntegration,HO as httpClientIntegration,GR as httpContextIntegration,Gb as inbou
499ndFiltersIntegration,DO as init,EO as instrumentAnthropicAiClient,IO as instrumentCreateReactAgent,vO as instrumentGoogleGenAIClient,TO as instrumentLangChainEmbeddings,wO as instrumentLangGraph,bO as instrumentOpenAiClient,ON as instrumentOutgoingRequests,SI as instrumentStateGraph,LE as instrumentSupabaseClient,QN as isBotUserAgent,NS as isEnabled,iO as isInitialized,MS as lastEventId,nL as launchDarklyIntegration,X0 as lazyLoadIntegration,XR as linkedErrorsIntegration,gO as logger,ZO as makeBrowserOfflineTransport,Tm as makeFetchTransport,aO as makeMultiplexedTransport,yO as metrics,cO as moduleMetadataIntegration,ZR as normalizeStringifyValue,$O as onLoad,oL as openFeatureIntegration,OO as opera10StackLineParser,LO as opera11StackLineParser,Ob as parameterize,fy as registerSpanErrorInstrumentation,dL as registerWebWorker,YO as replayCanvasIntegration,GO as replayIntegration,KO as reportPageLoaded,UO as reportingObserverIntegration,dO as rewriteFramesIntegration,e0 as sendFeedback,XO as setActiveSpanInBrowser,tO as setAttribute,eO as setAttributes,AS as setContext,rO as setConversationId,Tb as setCurrentClient,Xx as setExtra,Kx as setExtras,xs as setHttpStatus,Tp as setMeasurement,Zx as setTag,Qx as setTags,nO as setUser,BO as showReportDialog,QO as spanStreamingIntegration,Gx as spanToBaggageHeader,Q as spanToJSON,uy as spanToTraceHeader,tL as spotlightBrowserIntegration,tx as startBrowserTracingNavigationSpan,ex as startBrowserTracingPageLoadSpan,yn as startInactiveSpan,Ly as startNewTrace,pl as startSession,Gt as startSpan,en as startSpanManual,cL as statsigIntegration,fO as supabaseIntegration,Oy as suppressTracing,hO as thirdPartyErrorFilterIntegration,NO as uiProfiler,iL as unleashIntegration,qx as updateSpanName,zO as viewHierarchyIntegration,WN as webVitalsIntegration,lL as webWorkerIntegration,xO as winjsStackLineParser,mi as withActiveSpan,zx as withIsolationScope,ot as withScope,Vx as withStreamedSpan,pO as zodErrorsIntegration};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.