@skill-map/cli 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/tutorial/sm-master/SKILL.md +7 -9
- package/dist/cli/tutorial/sm-master/references/fixture-templates.md +1 -1
- package/dist/cli/tutorial/sm-master/references/tour-plugins.md +10 -9
- package/dist/cli/tutorial/sm-master/references/tour-settings.md +4 -4
- package/dist/cli/tutorial/sm-tutorial/SKILL.md +263 -369
- package/dist/cli.js +945 -256
- package/dist/cli.js.map +1 -1
- package/dist/index.js +21 -15
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.d.ts +43 -6
- package/dist/kernel/index.js +21 -15
- package/dist/kernel/index.js.map +1 -1
- package/dist/ui/chunk-27WQPOXP.js +1 -0
- package/dist/ui/{chunk-DZBSELHN.js → chunk-43S72FTV.js} +1 -1
- package/dist/ui/chunk-555ST76V.js +1 -0
- package/dist/ui/{chunk-JPYAASHN.js → chunk-5AD5ZV4I.js} +3 -3
- package/dist/ui/{chunk-CFJBTDAA.js → chunk-5ITZXW3A.js} +1 -1
- package/dist/ui/chunk-A7PRWMQD.js +1021 -0
- package/dist/ui/chunk-CBI77N5U.js +123 -0
- package/dist/ui/chunk-F7I6KMHX.js +1 -0
- package/dist/ui/{chunk-77J7XU3Y.js → chunk-I5AX4U2N.js} +28 -28
- package/dist/ui/chunk-IUZRAD7S.js +1 -0
- package/dist/ui/{chunk-XOHD5XWA.js → chunk-IYM26L3O.js} +1 -1
- package/dist/ui/{chunk-SBCO7ZSP.js → chunk-LGFABCIA.js} +1 -1
- package/dist/ui/{chunk-IUDL3NDH.js → chunk-MFLFIA7C.js} +1 -1
- package/dist/ui/chunk-MS6B7344.js +315 -0
- package/dist/ui/chunk-P3SNMV4X.js +2 -0
- package/dist/ui/chunk-PZQHB7GS.js +4 -0
- package/dist/ui/chunk-QDUSFOBE.js +1 -0
- package/dist/ui/{chunk-YCR3XCIW.js → chunk-QNTAOR2L.js} +5 -5
- package/dist/ui/{chunk-CR3AANNX.js → chunk-S4S5ZMXJ.js} +1 -1
- package/dist/ui/{chunk-5WJRN3LD.js → chunk-T3IVIRRJ.js} +1 -1
- package/dist/ui/{chunk-HP375T2O.js → chunk-VGPYYAVI.js} +1 -1
- package/dist/ui/chunk-X227ITGS.js +499 -0
- package/dist/ui/index.html +1 -1
- package/dist/ui/main-ERCTR2PR.js +3 -0
- package/package.json +10 -9
- package/dist/ui/chunk-2IF446BS.js +0 -1
- package/dist/ui/chunk-DIKPNZUZ.js +0 -315
- package/dist/ui/chunk-KGCJINI6.js +0 -1
- package/dist/ui/chunk-PPE3P2JD.js +0 -1
- package/dist/ui/chunk-UOCACZLI.js +0 -123
- package/dist/ui/chunk-YL6SWAFJ.js +0 -1024
- package/dist/ui/main-VHFB7Q2D.js +0 -3
- /package/dist/ui/{chunk-C2YUQODZ.js → chunk-4SG4352Z.js} +0 -0
- /package/dist/ui/{chunk-VB56BUGO.js → chunk-WCABR6TI.js} +0 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import{a as tm,b as nm,c as rm,d as om,e as im,i as sm}from"./chunk-555ST76V.js";import{b as em}from"./chunk-VGPYYAVI.js";import{G as Ra,H as fl,L as pl,M as Kd,P as dl,Qa as Xd,Va as Qd,Wa as Zd,a as Vd,na as Jd,v as va}from"./chunk-PZQHB7GS.js";import{a as p,b as E,d as qt,f as Yd}from"./chunk-WCABR6TI.js";var b=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var C=globalThis;var Pt="10.55.0";function pt(){return pr(C),C}function pr(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Pt,t[Pt]=t[Pt]||{}}function sn(e,t,n=C){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[Pt]=r[Pt]||{};return o[e]||(o[e]=t())}var dr=["debug","info","warn","error","log","assert","trace"],Wy="Sentry Logger ",Wr={};function Fe(e){if(!("console"in C))return e();let t=C.console,n={},r=Object.keys(Wr);r.forEach(o=>{let i=Wr[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function jy(){_l().enabled=!0}function zy(){_l().enabled=!1}function am(){return _l().enabled}function qy(...e){ml("log",...e)}function Yy(...e){ml("warn",...e)}function Vy(...e){ml("error",...e)}function ml(e,...t){b&&am()&&Fe(()=>{C.console[e](`${Wy}[${e}]:`,...t)})}function _l(){return b?sn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var h={enable:jy,disable:zy,isEnabled:am,log:qy,warn:Yy,error:Vy};var cm=/\(error: (.*)\)/,um=/captureMessage|captureException/;function zi(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let i=[],s=n.split(`
|
|
2
|
+
`);for(let a=r;a<s.length;a++){let c=s[a];c.length>1024&&(c=c.slice(0,1024));let u=cm.test(c)?c.replace(cm,"$1"):c;if(!u.includes("Error: ")){for(let f of t){let l=f(u);if(l){i.push(l);break}}if(i.length>=50+o)break}}return gl(i.slice(o))}}function Ca(e){return Array.isArray(e)?zi(...e):e}function gl(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Na(t).function||"")&&t.pop(),t.reverse(),um.test(Na(t).function||"")&&(t.pop(),um.test(Na(t).function||"")&&t.pop()),t.slice(0,50).map(n=>E(p({},n),{filename:n.filename||Na(t).filename,function:n.function||"?"}))}function Na(e){return e[e.length-1]||{}}var hl="<anonymous>";function dt(e){try{return!e||typeof e!="function"?hl:e.name||hl}catch{return hl}}function jr(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function lm(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var qi={},fm={};function rt(e,t){return qi[e]=qi[e]||[],qi[e].push(t),()=>{let n=qi[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function ot(e,t){if(!fm[e]){fm[e]=!0;try{t()}catch(n){b&&h.error(`Error while instrumenting ${e}`,n)}}}function $e(e,t){let n=e&&qi[e];if(n)for(let r of n)try{r(t)}catch(o){b&&h.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${dt(r)}
|
|
5
|
+
Error:`,o)}}var Sl=null;function Yi(e){let t="error";rt(t,e),ot(t,Ky)}function Ky(){Sl=C.onerror,C.onerror=function(e,t,n,r,o){return $e("error",{column:r,error:o,line:n,msg:e,url:t}),Sl?Sl.apply(this,arguments):!1},C.onerror.__SENTRY_INSTRUMENTED__=!0}var El=null;function Vi(e){let t="unhandledrejection";rt(t,e),ot(t,Jy)}function Jy(){El=C.onunhandledrejection,C.onunhandledrejection=function(e){return $e("unhandledrejection",e),El?El.apply(this,arguments):!0},C.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var pm=Object.prototype.toString;function et(e){switch(pm.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return an(e,Error)}}function Po(e,t){return pm.call(e)===`[object ${t}]`}function Uo(e){return Po(e,"ErrorEvent")}function Ki(e){return Po(e,"DOMError")}function xa(e){return Po(e,"DOMException")}function Oe(e){return Po(e,"String")}function Rn(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function We(e){return e===null||Rn(e)||typeof e!="object"&&typeof e!="function"}function Me(e){return Po(e,"Object")}function mr(e){return typeof Event<"u"&&an(e,Event)}function wa(e){return Po(e,"RegExp")}function mt(e){return!!(e?.then&&typeof e.then=="function")}function an(e,t){try{return e instanceof t}catch{return!1}}function Ji(e){return typeof Request<"u"&&an(e,Request)}function ye(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Xi(o,r);try{e[t]=o}catch{b&&h.log(`Failed to replace method "${t}" in object`,e)}}function Ee(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{b&&h.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Xi(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,Ee(e,"__sentry_original__",t)}catch{}}function _r(e){return e.__sentry_original__}function Qi(e){if(et(e))return p({message:e.message,name:e.name,stack:e.stack},dm(e));if(mr(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return p(p({type:t,target:n,currentTarget:r},o?{detail:o}:{}),dm(e))}return e}function dm(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function ka(e){let t=Object.keys(Qi(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Do;function zr(e){if(Do!==void 0)return Do?Do(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=C;return t in n&&typeof n[t]=="function"?(Do=n[t],Do(e)):(Do=null,e())}function At(){return zr(()=>Math.random())}function qr(){return zr(()=>Date.now())}var mm=Symbol.for("sentry.skipNormalization"),Xy=Symbol.for("sentry.overrideNormalizationDepth");function _m(e){Ee(e,mm,!0)}function hm(e){return!!e[mm]}function gm(e){let t=e[Xy];return typeof t=="number"?t:void 0}var Tl;function Oa(e){Tl=e}function Ce(e,t=100,n=1/0){try{return yl("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Zi(e,t=3,n=100*1024){let r=Ce(e,t);return eI(r)>n?Zi(e,t-1,n):r}function yl(e,t,n=1/0,r=1/0,o=tI()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=Il(e,t);if(!a.startsWith("[object "))return a;if(hm(t))return t;let c=gm(t),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(i(t))return"[Circular ~]";let f=t;if(f&&typeof f.toJSON=="function")try{let _=f.toJSON();return yl("",_,u-1,r,o)}catch{}let l=Array.isArray(t)?[]:{},m=0,d=Qi(t);for(let _ in d){if(!Object.prototype.hasOwnProperty.call(d,_))continue;if(m>=r){l[_]="[MaxProperties ~]";break}let g=d[_];l[_]=yl(_,g,u-1,r,o),m++}return s(t),l}function Il(e,t){try{if(Tl){let r=Tl(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${dt(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${Qy(t)}]`}catch(n){return`**non-serializable** (${n})`}}function Qy(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function Zy(e){return~-encodeURI(e).split(/%..|./).length}function eI(e){return Zy(JSON.stringify(e))}function tI(){let 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 cn(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Bo(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function hr(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];We(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(Il(void 0,o))}return n.join(t)}function gr(e,t,n=!1){return Oe(e)?wa(t)?t.test(e):Oe(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function je(e,t=[],n=!1){for(let r of t)if(gr(e,r,n))return!0;return!1}function nI(){let e=C;return e.crypto||e.msCrypto}var bl;function rI(){return At()*16}function ge(e=nI()){try{if(e?.randomUUID)return zr(()=>e.randomUUID()).replace(/-/g,"")}catch{}return bl||(bl="10000000100040008000"+1e11),bl.replace(/[018]/g,t=>(t^(rI()&15)>>t/4).toString(16))}function Sm(e){return e.exception?.values?.[0]}function un(e){let{message:t,event_id:n}=e;if(t)return t;let r=Sm(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Yr(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function Qe(e,t){let n=Sm(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism=p(p(p({},r),o),t),t&&"data"in t){let i=p(p({},o?.data),t.data);n.mechanism.data=i}}function Ma(e,t,n=5){if(t.lineno===void 0)return;let 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(s=>Bo(s,0));let i=Math.min(r-1,o);t.context_line=Bo(e[i],t.colno||0),t.post_context=e.slice(Math.min(o+1,r),o+1+n).map(s=>Bo(s,0))}function es(e){if(Al(e))return!0;try{Ee(e,"__sentry_captured__",!0)}catch{}return!1}function Al(e){try{return e.__sentry_captured__}catch{}}var Tm=1e3;function vt(){return qr()/Tm}function oI(){let{performance:e}=C;if(!e?.now||!e.timeOrigin)return vt;let t=e.timeOrigin;return()=>(t+zr(()=>e.now()))/Tm}var Em;function ne(){return(Em??(Em=oI()))()}var vl=null;function iI(){let{performance:e}=C;if(!e?.now)return;let t=3e5,n=zr(()=>e.now()),r=qr(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;let i=e.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<t?i:r-n}function pe(){return vl===null&&(vl=iI()),vl}function ym(e){let t=ne(),n={sid:ge(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>sI(n)};return e&&zn(n,e),n}function zn(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||ne(),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:ge()),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{let 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 Im(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),zn(e,n)}function sI(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 Sr(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r=p({},e);for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Sr(r[o],t[o],n-1));return r}function tt(){return ge()}function it(){return ge().substring(16)}var Rl="_sentrySpan";function _t(e,t){t?Ee(e,Rl,t):delete e[Rl]}function ln(e){return e[Rl]}var aI=100,ht=class e{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:tt(),sampleRand:At()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags=p({},this._tags),t._attributes=p({},this._attributes),t._extra=p({},this._extra),t._contexts=p({},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=p({},this._sdkProcessingMetadata),t._propagationContext=p({},this._propagationContext),t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,_t(t,ln(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&&zn(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=p(p({},this._tags),t),this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes=p(p({},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=p(p({},this._extra),t),this._notifyScopeListeners(),this}setExtra(t,n){return this._extra=E(p({},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;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():Me(n)?t:void 0,{tags:o,attributes:i,extra:s,user:a,contexts:c,level:u,fingerprint:f=[],propagationContext:l,conversationId:m}=r||{};return this._tags=p(p({},this._tags),o),this._attributes=p(p({},this._attributes),i),this._extra=p(p({},this._extra),s),this._contexts=p(p({},this._contexts),c),a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),f.length&&(this._fingerprint=f),l&&(this._propagationContext=l),m&&(this._conversationId=m),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,_t(this,void 0),this._attachments=[],this.setPropagationContext({traceId:tt(),sampleRand:At()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:aI;if(r<=0)return this;let o=E(p({timestamp:vt()},t),{message:t.message?cn(t.message,2048):t.message});return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.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:ln(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Sr(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||ge();if(!this._client)return b&&h.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,E(p({originalException:t,syntheticException:o},n),{event_id:r}),this),r}captureMessage(t,n,r){let o=r?.event_id||ge();if(!this._client)return b&&h.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,E(p({originalException:t,syntheticException:i},r),{event_id:o}),this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||ge();return this._client?(this._client.captureEvent(t,E(p({},n),{event_id:r}),this),r):(b&&h.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 bm(){return sn("defaultCurrentScope",()=>new ht)}function Am(){return sn("defaultIsolationScope",()=>new ht)}var vm=e=>e instanceof Promise&&!e[Rm],Rm=Symbol("chained PromiseLike"),La=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return vm(r)&&vm(e)?r:cI(e,r)},cI=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...i)=>o.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Rm]:!0}),t};var Nl=class{constructor(t,n){let r;t?r=t:r=new ht;let o;n?o=n:o=new ht,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return mt(r)?La(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(){let 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 Fo(){let e=pt(),t=pr(e);return t.stack=t.stack||new Nl(bm(),Am())}function uI(e){return Fo().withScope(e)}function lI(e,t){let n=Fo();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Nm(e){return Fo().withScope(()=>e(Fo().getIsolationScope()))}function Cm(){return{withIsolationScope:Nm,withScope:uI,withSetScope:lI,withSetIsolationScope:(e,t)=>Nm(t),getCurrentScope:()=>Fo().getScope(),getIsolationScope:()=>Fo().getIsolationScope()}}function Yt(e){let t=pr(e);return t.acs?t.acs:Cm()}function fI(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function pI(e,t){let{value:n,unit:r}=fI(e)?e:{value:e,unit:void 0},o=dI(n),i=r&&typeof r=="string"?{unit:r}:{};if(o)return p(p({},o),i);if(!t||t==="skip-undefined"&&n===void 0)return;let s="";try{s=JSON.stringify(n)??""}catch{}return p({value:s,type:"string"},i)}function qn(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=pI(o,t);i&&(n[r]=i)}return n}function Cl(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let o=r.value;Array.isArray(o)?t+=xm(o[0])*o.length:We(o)?t+=xm(o):t+=100}return t}function xm(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function dI(e){if(Array.isArray(e))return{value:e,type:"array"};let 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}}var wm;function xl(){return wm?.()}function Pa(){return wm!==void 0}function M(){let e=pt();return Yt(e).getCurrentScope()}function ce(){let e=pt();return Yt(e).getIsolationScope()}function fn(){return sn("globalScope",()=>new ht)}function Ke(...e){let t=pt(),n=Yt(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function Ua(...e){let t=pt(),n=Yt(t);if(e.length===2){let[r,o]=e;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(e[0])}function I(){return M().getClient()}function Go(e){let t=xl();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=n,s={trace_id:r,span_id:i||it()};return o&&(s.parent_span_id=o),s}var de="sentry.source",Yn="sentry.sample_rate",Ho="sentry.previous_trace_sample_rate",q="sentry.op",H="sentry.origin",Vn="sentry.idle_span_finish_reason",pn="sentry.measurement_unit",dn="sentry.measurement_value",Da="sentry.release",Ba="sentry.environment",Fa="sentry.segment.name",Ga="sentry.segment.id",Ha="sentry.sdk.name",$a="sentry.sdk.version",Wa="sentry.sdk.integrations",ja="user.id",za="user.email",qa="user.ip_address",Ya="user.name",Nn="sentry.custom_span_name",Vr="sentry.profile_id",st="sentry.exclusive_time";var Va="http.request.method",Ka="url.full",Ja="sentry.link.type",Xa="gen_ai.conversation.id";function wl(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}function Kn(e,t){e.setAttribute("http.response.status_code",t);let n=wl(t);n.message!=="unknown_error"&&e.setStatus(n)}function km(e){try{let t=C.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Om(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var Mm="_sentryScope",Lm="_sentryIsolationScope";function Pm(e,t,n){e&&(Ee(e,Lm,km(n)),Ee(e,Mm,t))}function Jn(e){let t=e;return{scope:t[Mm],isolationScope:Om(t[Lm])}}var ts="sentry-";var mI=8192;function $o(e){let t=_I(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(ts)){let s=o.slice(ts.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function Qa(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${ts}${r}`]=o),n),{});return hI(t)}function _I(e){if(!(!e||!Oe(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=Um(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):Um(e)}function Um(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function hI(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,s=o===0?i:`${t},${i}`;return s.length>mI?(b&&h.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var gI=/^o(\d+)\./,SI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function EI(e){return e==="http"||e==="https"}function ze(e,t=!1){let{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${s}`}function Za(e){let t=SI.exec(e);if(!t){Fe(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",i="",s="",a=""]=t.slice(1),c="",u=a,f=u.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),u=f.pop()),u){let l=u.match(/^\d+/);l&&(u=l[0])}return Dm({host:i,pass:o,path:c,projectId:u,port:s,protocol:n,publicKey:r})}function Dm(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function TI(e){if(!b)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(h.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?EI(r)?t&&isNaN(parseInt(t,10))?(h.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function yI(e){return e.match(gI)?.[1]}function ec(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=yI(n)),r}function ns(e){let t=typeof e=="string"?Za(e):Dm(e);if(!(!t||!TI(t)))return t}function Ut(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var tc=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Bm(e){if(!e)return;let t=e.match(tc);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 rs(e,t){let n=Bm(e),r=$o(t);if(!n?.traceId)return{traceId:tt(),sampleRand:At()};let o=II(n,r);r&&(r.sample_rand=o.toString());let{traceId:i,parentSpanId:s,parentSampled:a}=n;return{traceId:i,parentSpanId:s,sampled:a,dsc:r||{},sampleRand:o}}function os(e=tt(),t=it(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function is(e=tt(),t=it(),n){return`00-${e}-${t}-${n?"01":"00"}`}function II(e,t){let n=Ut(t?.sample_rand);if(n!==void 0)return n;let r=Ut(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?At()*r:r+At()*(1-r):At()}function kl(e,t){let n=ec(e);return t&&n&&t!==n?(h.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)?(h.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}var nc=0,as=1,Fm=!1;function $m(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:c}=P(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:c}}function Wo(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:P(e).parent_span_id,i=Jn(e).scope,s=r?i?.getPropagationContext().propagationSpanId||it():t;return{parent_span_id:o,span_id:s,trace_id:n}}function cs(e){let{traceId:t,spanId:n}=e.spanContext(),r=at(e);return os(t,n,r)}function Wm(e){let{traceId:t,spanId:n}=e.spanContext(),r=at(e);return is(t,n,r)}function us(e){if(e&&e.length>0)return e.map(s=>{var a=s,{context:c}=a,u=c,{spanId:t,traceId:n,traceFlags:r}=u,o=qt(u,["spanId","traceId","traceFlags"]),{attributes:i}=a;return p({span_id:t,trace_id:n,sampled:r===as,attributes:i},o)})}function Ml(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===as,attributes:o}))}function Rt(e){return typeof e=="number"?Gm(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Gm(e.getTime()):ne()}function Gm(e){return e>9999999999?e/1e3:e}function P(e){if(qm(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(zm(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:jm(e),start_timestamp:Rt(o),timestamp:Rt(s)||void 0,status:ls(a),op:r[q],origin:r[H],links:us(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Er(e){if(qm(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(zm(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:c}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:jm(e),start_timestamp:Rt(o),end_timestamp:Rt(s),is_segment:e===Jr(e),status:Ll(a),attributes:r,links:Ml(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Jr(e)}}function jm(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function rc(e){return E(p({},e),{attributes:qn(e.attributes),links:e.links?.map(t=>E(p({},t),{attributes:qn(t.attributes)}))})}function zm(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function qm(e){return typeof e.getSpanJSON=="function"}function at(e){let{traceFlags:t}=e.spanContext();return t===as}function ls(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function Ll(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var Kr="_sentryChildSpans",Ol="_sentryRootSpan";function fs(e,t){let n=e[Ol]||e;Ee(t,Ol,n),e[Kr]?e[Kr].add(t):Ee(e,Kr,new Set([t]))}function Ym(e,t){e[Kr]&&e[Kr].delete(t)}function Xn(e){let t=new Set;function n(r){if(!t.has(r)&&at(r)){t.add(r);let o=r[Kr]?Array.from(r[Kr]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var re=Jr;function Jr(e){return e[Ol]||e}function te(){let e=pt(),t=Yt(e);return t.getActiveSpan?t.getActiveSpan():ln(M())}function Xr(){Fm||(Fe(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Fm=!0)}function Pl(e,t){e.updateName(t),e.setAttributes({[de]:"custom",[Nn]:t})}var Vm=!1;function oc(){if(Vm)return;function e(){let t=te(),n=t&&re(t);if(n){let r="internal_error";b&&h.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}Vm=!0,Yi(e),Vi(e)}function Ge(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||I()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Km(e){h.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Qn(e,t){if(!t?.length)return!1;for(let n of t){if(AI(n)){if(e.description&&gr(e.description,n))return b&&Km(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?e.description&&gr(e.description,n.name):!0,i=n.op?e.op&&gr(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,c])=>bI(e.attributes?.[a],c)):!0;if(o&&i&&s)return b&&Km(e),!0}return!1}function bI(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?gr(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function Jm(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function AI(e){return typeof e=="string"||e instanceof RegExp}var Zn="production";var Xm="_frozenDsc";function jo(e,t){Ee(e,Xm,t)}function ic(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Zn,release:n.release,public_key:r,trace_id:e,org_id:ec(t)};return t.emit("createDsc",o),o}function Tr(e,t){let n=t.getPropagationContext();return n.dsc||ic(n.traceId,e)}function xe(e){let t=I();if(!t)return{};let n=re(e),r=P(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[Yn]??o[Ho];function a(_){return(typeof s=="number"||typeof s=="string")&&(_.sample_rate=`${s}`),_}let c=n[Xm];if(c)return a(c);let u=i?.get("sentry.dsc"),f=u&&$o(u);if(f)return a(f);let l=ic(e.spanContext().traceId,t),m=o[de]??o["sentry.span.source"],d=r.description;return m!=="url"&&d&&(l.transaction=d),Ge()&&(l.sampled=String(at(n)),l.sample_rand=i?.get("sentry.sample_rand")??Jn(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function Ul(e){let t=xe(e);return Qa(t)}var qe=class{constructor(t={}){this._traceId=t.traceId||tt(),this._spanId=t.spanId||it(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:nc}}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 Qm(e){return Ee(e,"_streamed",!0),e}function er(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function ke(e,t=[]){return[e,t]}function ps(e,t){let[n,r]=e;return[n,[...r,t]]}function Nt(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function Qr(e,t){return Nt(e,(n,r)=>t.includes(r))}function sc(e){let t=pr(C);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function vI(e){let t=pr(C);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function tr(e){let[t,n]=e,r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[sc(r),i]:r.push(typeof i=="string"?sc(i):i)}for(let i of n){let[s,a]=i;if(o(`
|
|
6
|
+
${JSON.stringify(s)}
|
|
7
|
+
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(Ce(a))}o(c)}}return typeof r=="string"?r:RI(r)}function RI(e){let t=e.reduce((o,i)=>o+i.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function ac(e){let t=typeof e=="string"?sc(e):e;function n(s){let a=t.subarray(0,s);return t=t.subarray(s+1),a}function r(){let s=t.indexOf(10);return s<0&&(s=t.length),JSON.parse(vI(n(s)))}let o=r(),i=[];for(;t.length;){let s=r(),a=typeof s.length=="number"?s.length:void 0;i.push([s,a?n(a):r()])}return[o,i]}function cc(e){return[{type:"span"},e]}function uc(e){let t=typeof e.data=="string"?sc(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Zm={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 NI(e){return e in Zm}function ds(e){return NI(e)?Zm[e]:e}function mn(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function zo(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return p(p(p({event_id:e.event_id,sent_at:new Date().toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:ze(r)}),o&&{trace:o})}function CI(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk=E(p({},n),{name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?p(p({},e.sdk?.settings),t.settings):void 0}),e}function e_(e,t,n,r){let o=mn(n),i=p(p({sent_at:new Date().toISOString()},o&&{sdk:o}),!!r&&t&&{dsn:ze(t)}),s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ke(i,[s])}function t_(e,t,n,r){let o=mn(n),i=e.type&&e.type!=="replay_event"?e.type:"event";CI(e,n?.sdk);let s=zo(e,o,r,t);return delete e.sdkProcessingMetadata,ke(s,[[{type:i},e]])}function n_(e,t){function n(d){return!!d.trace_id&&!!d.public_key}let r=xe(e[0]),o=t?.getDsn(),i=t?.getOptions().tunnel,s=p(p({sent_at:new Date().toISOString()},n(r)&&{trace:r}),!!i&&o&&{dsn:ze(o)}),{beforeSendSpan:a,ignoreSpans:c}=t?.getOptions()||{},u=c?.length?e.filter(d=>{let _=P(d);return!Qn({description:_.description,op:_.op,attributes:_.data},c)}):e,f=e.length-u.length;f&&t?.recordDroppedEvent("before_send","span",f);let l=a?d=>{let _=P(d),g=er(a)?_:a(_);return g||(Xr(),_)}:P,m=[];for(let d of u){let _=l(d);_&&m.push(cc(_))}return ke(s,m)}function r_(e){if(!b)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=P(e),{spanId:o}=e.spanContext(),i=at(e),s=re(e),a=s===e,c=`[Tracing] Starting ${i?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){let{op:f,description:l}=P(s);u.push(`root ID: ${s.spanContext().spanId}`),f&&u.push(`root op: ${f}`),l&&u.push(`root description: ${l}`)}h.log(`${c}
|
|
8
|
+
${u.join(`
|
|
9
|
+
`)}`)}function o_(e){if(!b)return;let{description:t="< unknown name >",op:n="< unknown op >"}=P(e),{spanId:r}=e.spanContext(),i=re(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;h.log(s)}function ms(e,t,n,r=te()){let o=r&&re(r);o&&(b&&h.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[dn]:t,[pn]:n}))}function _s(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[pn],i=r[dn];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function He(e){return e.getOptions().traceLifecycle==="stream"}var i_=1e3,yr=class{constructor(t={}){this._traceId=t.traceId||tt(),this._spanId=t.spanId||it(),this._startTime=t.startTimestamp||ne(),this._links=t.links,this._attributes={},this.setAttributes(p({[H]:"manual",[q]: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._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){let{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?as:nc}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=Rt(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(de,"custom"),this}end(t){this._endTime||(this._endTime=Rt(t),o_(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[q],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:ls(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[H],profile_id:this._attributes[Vr],exclusive_time:this._attributes[st],measurements:_s(this._events),is_segment:this._isStandaloneSpan&&re(this)===this||void 0,segment_id:this._isStandaloneSpan?re(this).spanContext().spanId:void 0,links:us(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===re(this),status:Ll(this._status),attributes:this._attributes,links:Ml(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){b&&h.log("[Tracing] Adding an event to span:",t);let o=s_(n)?n:r||ne(),i=s_(n)?{}:n||{},s={name:t,time:Rt(o),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let t=I();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===re(this)))return;if(this._isStandaloneSpan){this._sampled?wI(n_([this],t)):(b&&h.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&He(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(Jn(this).scope||M()).captureEvent(r)}_convertSpanToTransaction(){if(!a_(P(this)))return;this._name||(b&&h.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=Jn(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=Xn(this).filter(l=>l!==this&&!xI(l)).map(l=>P(l)).filter(a_),s=this._attributes[de];delete this._attributes[Nn];let a=!1;i.forEach(l=>{delete l.data[Nn],l.op?.startsWith("gen_ai.")&&(a=!0)});let c=p({contexts:{trace:$m(this)},spans:i.length>i_?i.sort((l,m)=>l.start_timestamp-m.start_timestamp).slice(0,i_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:xe(this),hasGenAiSpans:a},request:r},s&&{transaction_info:{source:s}}),u=_s(this._events);return u&&Object.keys(u).length&&(b&&h.log("[Measurements] Adding measurements to transaction event",JSON.stringify(u,void 0,2)),c.measurements=u),c}};function s_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function a_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function xI(e){return e instanceof yr&&e.isStandaloneSpan()}function wI(e){let t=I();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function hs(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(i){throw t(i),n(),i}return kI(o,t,n,r)}function kI(e,t,n,r){return mt(e)?La(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function c_(e,t,n){if(!Ge(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler(E(p({},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<"u"&&(o=e.tracesSampleRate,r=!0);let i=Ut(o);if(i===void 0)return b&&h.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(!i)return b&&h.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,i,r];let s=n<i;return s||b&&h.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[s,i,r]}var gs="__SENTRY_SUPPRESS_TRACING__";function Je(e,t){let n=qo();if(n.startSpan)return n.startSpan(e,t);let r=Fl(e),{forceTransaction:o,parentSpan:i,scope:s}=e,a=s?.clone();return Ke(a,()=>l_(i)(()=>{let u=M(),f=Gl(u,i),l=I(),m=e.onlyIfParent&&!f,d=m?new qe:Bl({parentSpan:f,spanArguments:r,forceTransaction:o,scope:u});return m&&l?.recordDroppedEvent("no_parent_span","span"),(!f_(d)||!f)&&_t(u,d),hs(()=>t(d),()=>{let{status:_}=P(d);d.isRecording()&&(!_||_==="ok")&&d.setStatus({code:2,message:"internal_error"})},()=>{d.end()})}))}function gt(e,t){let n=qo();if(n.startSpanManual)return n.startSpanManual(e,t);let r=Fl(e),{forceTransaction:o,parentSpan:i,scope:s}=e,a=s?.clone();return Ke(a,()=>l_(i)(()=>{let u=M(),f=Gl(u,i),l=e.onlyIfParent&&!f,m=l?new qe:Bl({parentSpan:f,spanArguments:r,forceTransaction:o,scope:u});return l&&I()?.recordDroppedEvent("no_parent_span","span"),(!f_(m)||!f)&&_t(u,m),hs(()=>t(m,()=>m.end()),()=>{let{status:d}=P(m);m.isRecording()&&(!d||d==="ok")&&m.setStatus({code:2,message:"internal_error"})})}))}function Le(e){let t=qo();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=Fl(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>Ke(e.scope,s):o!==void 0?s=>Ir(o,s):s=>s())(()=>{let s=M(),a=Gl(s,o),c=I();return e.onlyIfParent&&!a?(c?.recordDroppedEvent("no_parent_span","span"),new qe):Bl({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}var Dl=(e,t)=>{let n=pt(),r=Yt(n);if(r.continueTrace)return r.continueTrace(e,t);let{sentryTrace:o,baggage:i}=e,s=I(),a=$o(i);return s&&!kl(s,a?.org_id)?lc(t):Ke(c=>{let u=rs(o,i);return c.setPropagationContext(u),_t(c,void 0),t()})};function Ir(e,t){let n=qo();return n.withActiveSpan?n.withActiveSpan(e,t):Ke(r=>(_t(r,e||void 0),t(r)))}function Ss(e){let t=qo();return t.suppressTracing?t.suppressTracing(e):Ke(n=>{n.setSDKProcessingMetadata({[gs]:!0});let r=e();return n.setSDKProcessingMetadata({[gs]:void 0}),r})}function lc(e){let t=qo();return t.startNewTrace?t.startNewTrace(e):Ke(n=>(n.setPropagationContext({traceId:tt(),sampleRand:At()}),b&&h.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),Ir(null,e)))}function Bl({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ge()){let a=new qe;if(n||!e){let c=p({sampled:"false",sample_rate:"0",transaction:t.name},xe(a));jo(a,c)}return a}let o=I();if(MI(o,t))return Hl(r)||o?.recordDroppedEvent("ignored","span"),new qe({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let i=ce(),s;if(e&&!n)s=OI(e,r,t),fs(e,s);else if(e){let a=xe(e),{traceId:c,spanId:u}=e.spanContext(),f=at(e);s=u_(p({traceId:c,parentSpanId:u},t),r,f),jo(s,a)}else{let{traceId:a,dsc:c,parentSpanId:u,sampled:f}=p(p({},i.getPropagationContext()),r.getPropagationContext());s=u_(p({traceId:a,parentSpanId:u},t),r,f),c&&jo(s,c)}return r_(s),Pm(s,r,i),s}function Fl(e){let t=e.experimental||{},n=p({isStandalone:t.standalone},e);if(e.startTime){let r=p({},n);return r.startTimestamp=Rt(e.startTime),delete r.startTime,r}return n}function qo(){let e=pt();return Yt(e)}function u_(e,t,n){let r=I(),o=r?.getOptions()||{},{name:i=""}=e,s={spanAttributes:p({},e.attributes),spanName:i,parentSampled:n};r?.emit("beforeSampling",s,{decision:!1});let a=s.parentSampled??n,c=s.spanAttributes,u=t.getPropagationContext(),f=Hl(t),[l,m,d]=f?[!1]:c_(o,{name:i,parentSampled:a,attributes:c,parentSampleRate:Ut(u.dsc?.sample_rate)},u.sampleRand),_=new yr(E(p({},e),{attributes:p({[de]:"custom",[Yn]:m!==void 0&&d?m:void 0},c),sampled:l}));return!l&&r&&!f&&(b&&h.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",He(r)?"span":"transaction")),r&&r.emit("spanStart",_),_}function OI(e,t,n){let{spanId:r,traceId:o}=e.spanContext(),i=Hl(t),s=i?!1:at(e),a=s?new yr(E(p({},n),{parentSpanId:r,traceId:o,sampled:s})):new qe({traceId:o});fs(e,a);let c=I();return c&&(He(c)&&a instanceof qe&&(e instanceof qe&&e.dropReason?(a.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,"span")):i||(a.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",a),n.endTimestamp&&(c.emit("spanEnd",a),c.emit("afterSpanEnd",a))),a}function Gl(e,t){if(t)return t;if(t===null)return;let n=ln(e);if(!n)return;let r=I();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?re(n):n}function l_(e){return e!==void 0?t=>Ir(e,t):t=>t()}function MI(e,t){let n=e?.getOptions().ignoreSpans;return!e||!He(e)||!n?.length?!1:Qn({description:t.name||"",op:t.attributes?.[q]||t.op,attributes:t.attributes},n)}function f_(e){return e instanceof qe&&e.dropReason==="ignored"}function Hl(e){return e.getScopeData().sdkProcessingMetadata[gs]===!0}var Yo={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},LI="heartbeatFailed",PI="idleTimeout",UI="finalTimeout",DI="externalFinish";function fc(e,t={}){let n=new Map,r=!1,o,i=DI,s=!t.disableAutoFinish,a=[],{idleTimeout:c=Yo.idleTimeout,finalTimeout:u=Yo.finalTimeout,childSpanTimeout:f=Yo.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:m=!0}=t,d=I();if(!d||!Ge()){let y=new qe,O=p({sample_rate:"0",sampled:"false"},xe(y));return jo(y,O),y}let _=M(),g=te(),S=BI(e);S.end=new Proxy(S.end,{apply(y,O,z){if(l&&l(S),O instanceof qe)return;let[R,...B]=z,L=R||ne(),F=Rt(L),j=Xn(S).filter(G=>G!==S),ae=P(S);if(!j.length||!m)return D(F),Reflect.apply(y,O,[F,...B]);let se=d.getOptions().ignoreSpans,fe=j?.reduce((G,Y)=>{let me=P(Y);return!me.timestamp||se&&Qn({description:me.description,op:me.op,attributes:me.data},se)?G:G?Math.max(G,me.timestamp):me.timestamp},void 0),x=ae.start_timestamp,Q=Math.min(x?x+u/1e3:1/0,Math.max(x||-1/0,Math.min(F,fe||1/0)));return D(Q),Reflect.apply(y,O,[Q,...B])}});function T(){o&&(clearTimeout(o),o=void 0)}function A(y){T(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=PI,S.end(y))},c)}function k(y){o=setTimeout(()=>{!r&&s&&(i=LI,S.end(y))},f)}function N(y){T(),n.set(y,!0);let O=ne();k(O+f/1e3)}function U(y){if(n.has(y)&&n.delete(y),n.size===0){let O=ne();A(O+c/1e3)}}function D(y){r=!0,n.clear(),a.forEach(j=>j()),_t(_,g);let O=P(S),{start_timestamp:z}=O;if(!z)return;O.data[Vn]||S.setAttribute(Vn,i);let B=O.status;(!B||B==="unknown")&&S.setStatus({code:1}),h.log(`[Tracing] Idle span "${O.op}" finished`);let L=Xn(S).filter(j=>j!==S),F=0;L.forEach(j=>{j.isRecording()&&(j.setStatus({code:2,message:"cancelled"}),j.end(y),b&&h.log("[Tracing] Cancelling span since span ended early",JSON.stringify(j,void 0,2)));let ae=P(j),{timestamp:se=0,start_timestamp:fe=0}=ae,x=fe<=y,Q=(u+c)/1e3,G=se-fe<=Q;if(b){let Y=JSON.stringify(j,void 0,2);x?G||h.log("[Tracing] Discarding span since it finished after idle span final timeout",Y):h.log("[Tracing] Discarding span since it happened after idle span was finished",Y)}(!G||!x)&&(Ym(S,j),F++)}),F>0&&S.setAttribute("sentry.idle_span_discarded_spans",F)}return a.push(d.on("spanStart",y=>{if(r||y===S||P(y).timestamp||y instanceof yr&&y.isStandaloneSpan())return;Xn(S).includes(y)&&N(y.spanContext().spanId)})),a.push(d.on("spanEnd",y=>{r||U(y.spanContext().spanId)})),a.push(d.on("idleSpanEnableAutoFinish",y=>{y===S&&(s=!0,A(),n.size&&k())})),t.disableAutoFinish||A(),setTimeout(()=>{r||(S.setStatus({code:2,message:"deadline_exceeded"}),i=UI,S.end())},u),S}function BI(e){let t=Le(e);return _t(M(),t),b&&h.log("[Tracing] Started span is an idle span"),t}function d_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;FI(e,t),r&&$I(e,r),WI(e,n),GI(e,o),HI(e,i)}function p_(e,t){let{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:f,eventProcessors:l,attachments:m,propagationContext:d,transactionName:_,span:g}=t;Es(e,"extra",n),Es(e,"tags",r),Es(e,"attributes",o),Es(e,"user",i),Es(e,"contexts",s),e.sdkProcessingMetadata=Sr(e.sdkProcessingMetadata,c,2),a&&(e.level=a),_&&(e.transactionName=_),g&&(e.span=g),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),f.length&&(e.fingerprint=[...e.fingerprint,...f]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),m.length&&(e.attachments=[...e.attachments,...m]),e.propagationContext=p(p({},e.propagationContext),d)}function Es(e,t,n){e[t]=Sr(e[t],n,1)}function Cn(e,t){let n=fn().getScopeData();return e&&p_(n,e.getScopeData()),t&&p_(n,t.getScopeData()),n}function FI(e,t){let{extra:n,tags:r,user:o,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra=p(p({},n),e.extra)),Object.keys(r).length&&(e.tags=p(p({},r),e.tags)),Object.keys(o).length&&(e.user=p(p({},o),e.user)),Object.keys(i).length&&(e.contexts=p(p({},i),e.contexts)),s&&(e.level=s),a&&e.type!=="transaction"&&(e.transaction=a)}function GI(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function HI(e,t){e.sdkProcessingMetadata=p(p({},e.sdkProcessingMetadata),t)}function $I(e,t){e.contexts=p({trace:Wo(t)},e.contexts),e.sdkProcessingMetadata=p({dynamicSamplingContext:xe(t)},e.sdkProcessingMetadata);let n=re(t),r=P(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function WI(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}var jI="thismessage:/";function Zr(e){return"isRelative"in e}function xn(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?jI:void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;let o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function Vo(e){if(Zr(e))return e.pathname;let 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 Ct(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let 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 _n(e){return e.split(/[?#]/,1)[0]}function pc(e){let{protocol:t,host:n,path:r}=e,o=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${t?`${t}://`:""}${o}${r}`}function ct(e,t=!0){if(e.startsWith("data:")){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),i=e.indexOf(","),s="";if(t&&i!==-1){let a=e.slice(i+1);s=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${s?`,${s}`:""}`}return e}function m_(e){let t={},{response:n,profile:r,cloud_resource:o,culture:i,state:s}=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(let[u,f]of Object.entries(o))f!=null&&(t[u]=f);i&&(i.locale&&(t["culture.locale"]=i.locale),i.timezone&&(t["culture.timezone"]=i.timezone)),s?.state&&typeof s.state.type=="string"&&(t["state.type"]=s.state.type);let a=e.angular;if(a){let u=a.version;(typeof u=="string"||typeof u=="number")&&(t["angular.version"]=u)}let c=e.react;if(c){let u=c.version;(typeof u=="string"||typeof u=="number")&&(t["react.version"]=u)}return t}function dc(e,t){let n=Er(e),r=Jr(e),o=Er(r),{isolationScope:i,scope:s}=Jn(e),a=Cn(i,s);YI(n,o,t,a);let c=e.kind;KI(n,c),n.is_segment&&(zI(n,a),qI(n,t),t.emit("processSegmentSpan",n)),t.emit("processSpan",n);let{beforeSendSpan:u}=t.getOptions(),f=u&&er(u)?VI(n,u):n,l=f.attributes?.[de];return l&&Ye(f,{"sentry.span.source":l}),E(p({},rc(f)),{_segmentSpan:r})}function zI(e,t){let n=m_(t.contexts);Ye(e,n)}function Ye(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function qI(e,t){let n=t.getIntegrationNames();n.length&&Ye(e,{[Wa]:n})}function YI(e,t,n,r){let o=n.getSdkMetadata(),{release:i,environment:s}=n.getOptions();Ye(e,p({[Da]:i,[Ba]:s,[Fa]:t.name,[Ga]:t.span_id,[Ha]:o?.sdk?.name,[$a]:o?.sdk?.version,[ja]:r.user?.id,[za]:r.user?.email,[qa]:r.user?.ip_address,[Ya]:r.user?.username},r.attributes))}function VI(e,t){let n=t(e);return n||(Xr(),e)}var $l=1,__=2;function KI(e,t){let n=e.attributes;if(!n)return;let r=n["http.request.method"]||n["http.method"];if(r){JI(e,n,t,r);return}let o=n["db.system.name"]||n["db.system"],i=typeof n[q]=="string"&&`${n[q]}`.startsWith("cache.");if(o&&!i){QI(e,n);return}if(n["rpc.service"]){Ye(e,{[q]:"rpc"});return}if(n["messaging.system"]){Ye(e,{[q]:"message"});return}let s=n["faas.trigger"];s&&Ye(e,{[q]:`${s}`})}function JI(e,t,n,r){let o=["http"];n===__?o.push("client"):n===$l&&o.push("server"),t["sentry.http.prefetch"]&&o.push("prefetch"),Ye(e,{[q]:o.join(".")});let i=t[Nn];if(typeof i=="string"){e.name=i;return}if(t[de]==="custom")return;let s=t["http.route"];if(typeof s=="string")e.name=`${r} ${s}`,Ye(e,{[de]:"route"});else{if(n===__||n===$l){let a=XI(t,n);a&&(e.name=`${r} ${a}`)}Ye(e,{[de]:"url"})}}function XI(e,t){let n=e["http.url"]||e["url.full"],r=e["http.target"],o=typeof n=="string"?Ct(n):void 0,i=o?pc(o):void 0;if(t===$l&&typeof r=="string")return _n(r);if(i)return i;if(typeof r=="string")return _n(r)}function QI(e,t){Ye(e,{[q]:"db"});let n=t[Nn];if(typeof n=="string"){e.name=n;return}if(t[de]==="custom")return;let r=t["db.statement"];r&&(e.name=`${r}`,Ye(e,{[de]:"task"}))}var Wl=0,h_=1,g_=2;function wn(e){return new Ts(t=>{t(e)})}function eo(e){return new Ts((t,n)=>{n(e)})}var Ts=class e{constructor(t){this._state=Wl,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(s){o(s)}},i=>{if(!n)o(i);else try{r(n(i))}catch(s){o(s)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,i;return this.then(s=>{i=!1,o=s,t&&t()},s=>{i=!0,o=s,t&&t()}).then(()=>{if(i){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Wl)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===h_&&n[1](this._value),this._state===g_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===Wl){if(mt(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(h_,i)},o=i=>{n(g_,i)};try{t(r,o)}catch(i){o(i)}}};function S_(e,t,n,r=0){try{let o=jl(t,n,e,r);return mt(o)?o:wn(o)}catch(o){return eo(o)}}function jl(e,t,n,r){let o=n[r];if(!e||!o)return e;let i=o(p({},e),t);return b&&i===null&&h.log(`Event processor "${o.id||"?"}" dropped event`),mt(i)?i.then(s=>jl(s,t,n,r+1)):jl(i,t,n,r+1)}var to,E_,T_,br;function mc(e){let t=C._sentryDebugIds,n=C._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(br&&r.length===E_&&o.length===T_)return br;E_=r.length,T_=o.length,br={},to||(to={});let i=(s,a)=>{for(let c of s){let u=a[c],f=to?.[c];if(f&&br&&u)br[f[0]]=u,to&&(to[c]=[f[0],u]);else if(u){let l=e(c);for(let m=l.length-1;m>=0;m--){let _=l[m]?.filename;if(_&&br&&to){br[_]=u,to[c]=[_,u];break}}}}};return t&&i(r,t),n&&i(o,n),br}function zl(e,t){let n=mc(e);if(!n)return[];let r=[];for(let o of t){let i=lm(o);i&&n[i]&&r.push({type:"sourcemap",code_file:o,debug_id:n[i]})}return r}function ys(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,c=E(p({},t),{event_id:t.event_id||n.event_id||ge(),timestamp:t.timestamp||vt()}),u=n.integrations||e.integrations.map(T=>T.name);ZI(c,e),nb(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&eb(c,e.stackParser);let f=ob(r,n.captureContext);n.mechanism&&Qe(c,n.mechanism);let l=o?o.getEventProcessors():[],m=Cn(i,f),d=[...n.attachments||[],...m.attachments];d.length&&(n.attachments=d),d_(c,m);let _=[...l,...m.eventProcessors];return(n.data&&n.data.__sentry__===!0?wn(c):S_(_,c,n)).then(T=>(T&&tb(T),typeof s=="number"&&s>0?rb(T,s,a):T))}function ZI(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||Zn,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=cn(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=cn(a.value,i))})}function eb(e,t){let n=mc(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function tb(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function nb(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function rb(e,t,n){if(!e)return null;let r=p(p(p(p(p({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>p(p({},o),o.data&&{data:Ce(o.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 e.contexts?.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(o=>p(p({},o),o.data&&{data:Ce(o.data,t,n)}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Ce(e.contexts.flags,3,n)),r}function ob(e,t){if(!t)return e;let n=e?e.clone():new ht;return n.update(t),n}function y_(e){if(e)return ib(e)?{captureContext:e}:ab(e)?{captureContext:e}:e}function ib(e){return e instanceof ht||typeof e=="function"}var sb=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function ab(e){return Object.keys(e).some(t=>sb.includes(t))}function J(e,t){return M().captureException(e,y_(t))}function Is(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return M().captureMessage(e,n,r)}function hn(e,t){return M().captureEvent(e,t)}function no(e,t){ce().setContext(e,t)}function ql(e){ce().setExtras(e)}function Yl(e,t){ce().setExtra(e,t)}function Vl(e){ce().setTags(e)}function Kl(e,t){ce().setTag(e,t)}function Jl(e){ce().setUser(e)}function Xl(e){ce().setConversationId(e)}function bs(){return ce().lastEventId()}async function Ql(e){let t=I();return t?t.flush(e):(b&&h.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Zl(e){let t=I();return t?t.close(e):(b&&h.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function ef(){return!!I()}function As(){let e=I();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function vs(e){ce().addEventProcessor(e)}function Ko(e){let t=ce(),{user:n}=Cn(t,M()),{userAgent:r}=C.navigator||{},o=ym(p(p({user:n},r&&{userAgent:r}),e)),i=t.getSession();return i?.status==="ok"&&zn(i,{status:"exited"}),Rs(),t.setSession(o),o}function Rs(){let e=ce(),n=M().getSession()||e.getSession();n&&Im(n),I_(),e.setSession()}function I_(){let e=ce(),t=I(),n=e.getSession();n&&t&&t.captureSession(n)}function ro(e=!1){if(e){Rs();return}I_()}var b_="7";function A_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function cb(e){return`${A_(e)}${e.projectId}/envelope/`}function ub(e,t){let n={sentry_version:b_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Ns(e,t,n){return t||`${cb(e)}?${ub(e,n)}`}function tf(e,t){let n=ns(e);if(!n)return"";let r=`${A_(n)}embed/error-page/`,o=`dsn=${ze(n)}`;for(let i in t)if(i!=="dsn"&&i!=="onClose")if(i==="user"){let s=t.user;if(!s)continue;s.name&&(o+=`&name=${encodeURIComponent(s.name)}`),s.email&&(o+=`&email=${encodeURIComponent(s.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${r}?${o}`}var _c=[];function lb(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function hc(e){let 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"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return lb(r)}function v_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&rf(e,r,n)}),n}function nf(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function rf(e,t,n){if(n[t.name]){b&&h.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!_c.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),_c.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,i)=>r(o,i,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((i,s)=>r(i,s,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,i=>o.call(t,i,e))}),b&&h.log(`Integration installed: ${t.name}`)}function Jo(e){let t=I();if(!t){b&&h.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}var fb="sentry.timestamp.sequence",of=0,sf;function gc(e){let t=Math.floor(e*1e3);sf!==void 0&&t!==sf&&(of=0);let n=of;return of++,sf=t,{key:fb,value:{value:n,type:"integer"}}}function Sc(e,t){return t?Ke(t,()=>{let n=te(),r=n?Wo(n):Go(t);return[n?xe(n):Tr(e,t),r]}):[void 0,void 0]}var R_={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function af(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function cf(){return"npm"}function N_(){return!af()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function ut(){return typeof window<"u"&&(!N_()||pb())}function pb(){return C.process?.type==="renderer"}function db(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},E(p({version:2},ut()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}}),{items:e})]}function C_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=ze(r)),ke(i,[db(e,o)])}var mb=100;function kn(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function x_(e,t){let n=lf(),r=w_(e);r===void 0?n.set(e,[t]):r.length>=mb?(oo(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Ar(e,t=M(),n=x_){let r=t?.getClient()??I();if(!r){b&&h.warn("No client available to capture log.");return}let{release:o,environment:i,enableLogs:s=!1,beforeSendLog:a}=r.getOptions();if(!s){b&&h.warn("logging option not enabled, log will not be captured.");return}let[,c]=Sc(r,t),u=p({},e.attributes),{user:{id:f,email:l,username:m},attributes:d={}}=Cn(ce(),t);kn(u,"user.id",f,!1),kn(u,"user.email",l,!1),kn(u,"user.name",m,!1),kn(u,"sentry.release",o),kn(u,"sentry.environment",i);let{name:_,version:g}=r.getSdkMetadata()?.sdk??{};kn(u,"sentry.sdk.name",_),kn(u,"sentry.sdk.version",g);let S=r.getIntegrationByName("Replay"),T=S?.getReplayId(!0);kn(u,"sentry.replay_id",T),T&&S?.getRecordingMode()==="buffer"&&kn(u,"sentry._internal.replay_is_buffering",!0);let A=e.message;if(Rn(A)){let{__sentry_template_string__:F,__sentry_template_values__:j=[]}=A;j?.length&&(u["sentry.message.template"]=F),j.forEach((ae,se)=>{u[`sentry.message.parameter.${se}`]=ae})}let k=ln(t);kn(u,"sentry.trace.parent_span_id",k?.spanContext().spanId);let N=E(p({},e),{attributes:u});r.emit("beforeCaptureLog",N);let U=a?Fe(()=>a(N)):N;if(!U){r.recordDroppedEvent("before_send","log_item",1),b&&h.warn("beforeSendLog returned null, log will not be captured.");return}let{level:D,message:y,attributes:O={},severityNumber:z}=U,R=ne(),B=gc(R),L={timestamp:R,level:D,body:uf(String(y)),trace_id:c?.trace_id,severity_number:z??R_[D],attributes:_b(E(p(p({},qn(d)),qn(O,!0)),{[B.key]:B.value}))};n(r,L),r.emit("afterCaptureLog",U)}function oo(e,t){let n=t??w_(e)??[];if(n.length===0)return;let r=e.getOptions(),o=C_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);lf().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function w_(e){return lf().get(e)}function lf(){return sn("clientToLogBufferMap",()=>new WeakMap)}function _b(e){let t={};for(let[n,r]of Object.entries(e)){let o=uf(n);r.type==="string"?t[o]=E(p({},r),{value:uf(r.value)}):t[o]=r}return t}function uf(e){let 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 hb(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},E(p({version:2},ut()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}}),{items:e})]}function k_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=ze(r)),ke(i,[hb(e,o)])}var gb=1e3;function nr(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function O_(e,t){let n=pf(),r=M_(e);r===void 0?n.set(e,[t]):r.length>=gb?(Xo(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Sb(e,t,n){let{release:r,environment:o}=t.getOptions(),i=p({},e.attributes);nr(i,"user.id",n.id,!1),nr(i,"user.email",n.email,!1),nr(i,"user.name",n.username,!1),nr(i,"sentry.release",r),nr(i,"sentry.environment",o);let{name:s,version:a}=t.getSdkMetadata()?.sdk??{};nr(i,"sentry.sdk.name",s),nr(i,"sentry.sdk.version",a);let c=t.getIntegrationByName("Replay"),u=c?.getReplayId(!0);return nr(i,"sentry.replay_id",u),u&&c?.getRecordingMode()==="buffer"&&nr(i,"sentry._internal.replay_is_buffering",!0),E(p({},e),{attributes:i})}function Eb(e,t,n,r){let[,o]=Sc(t,n),i=ln(n),s=i?i.spanContext().traceId:o?.trace_id,a=i?i.spanContext().spanId:void 0,c=ne(),u=gc(c);return{timestamp:c,trace_id:s??"",span_id:a,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:E(p(p({},qn(r)),qn(e.attributes,"skip-undefined")),{[u.key]:u.value})}}function ff(e,t){let n=t?.scope??M(),r=t?.captureSerializedMetric??O_,o=n?.getClient()??I();if(!o){b&&h.warn("No client available to capture metric.");return}let{_experiments:i,enableMetrics:s,beforeSendMetric:a}=o.getOptions();if(!(s??i?.enableMetrics??!0)){b&&h.warn("metrics option not enabled, metric will not be captured.");return}let{user:u,attributes:f}=Cn(ce(),n),l=Sb(e,o,u);o.emit("processMetric",l);let m=a||i?.beforeSendMetric,d=m?m(l):l;if(!d){b&&h.log("`beforeSendMetric` returned `null`, will not send metric.");return}let _=Eb(d,o,n,f);b&&h.log("[Metric]",_),r(o,_),o.emit("afterCaptureMetric",d)}function Xo(e,t){let n=t??M_(e)??[];if(n.length===0)return;let r=e.getOptions(),o=k_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);pf().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function M_(e){return pf().get(e)}function pf(){return sn("clientToMetricBufferMap",()=>new WeakMap)}function L_(e){let 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:p({},e.data),links:e.links};return rc(t)}function P_(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||He(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(L_(i)):r.push(i);if(n.length===0)return;e.spans=r;let o=t.getOptions().sendDefaultPii?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},E(p({version:2},ut()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}}),{items:n})]}function vr(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var Qo=Symbol.for("SentryBufferFullError");function io(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function o(s){if(!n())return eo(Qo);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return wn(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let c=[a,new Promise(u=>vr(setTimeout(()=>u(!1),s)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:i}}var U_=60*1e3;function Ec(e,t=qr()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?U_:r-t}function D_(e,t){return e[t]||e.all||0}function Cs(e,t,n=qr()){return D_(e,t)>n}function xs(e,{statusCode:t,headers:n},r=qr()){let o=p({},e),i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(let a of i.trim().split(",")){let[c,u,,,f]=a.split(":",5),l=parseInt(c,10),m=(isNaN(l)?60:l)*1e3;if(!u)o.all=r+m;else for(let d of u.split(";"))d==="metric_bucket"?(!f||f.split(";").includes("custom"))&&(o[d]=r+m):o[d]=r+m}else s?o.all=r+Ec(s,r):t===429&&(o.all=r+60*1e3);return o}var df=64;function Tc(e,t,n=io(e.bufferSize||df)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(Nt(s,(l,m)=>{let d=ds(m);Cs(r,d)?e.recordDroppedEvent("ratelimit_backoff",d):a.push(l)}),a.length===0)return Promise.resolve({});let c=ke(s[0],a),u=l=>{if(Qr(c,["client_report"])){b&&h.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}Nt(c,(m,d)=>{e.recordDroppedEvent(l,ds(d))})},f=()=>t({body:tr(c)}).then(l=>l.statusCode===413?(b&&h.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(b&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&h.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=xs(r,l),l),l=>{throw u("network_error"),b&&h.error("Encountered error running transport request:",l),l});return n.add(f).then(l=>l,l=>{if(l===Qo)return b&&h.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:o}}function B_(e,t,n){let r=[{type:"client_report"},{timestamp:n||vt(),discarded_events:e}];return ke(t?{dsn:t}:{},[r])}function yc(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function F_(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:i,data:s,op:a}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:s?.[Vr],exclusive_time:s?.[st],measurements:e.measurements,is_segment:!0}}function G_(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:p(p(p({},e.data),e.profile_id&&{[Vr]:e.profile_id}),e.exclusive_time&&{[st]:e.exclusive_time})}},measurements:e.measurements}}var ws=["forwarded","-ip","remote-","via","-user"];function H_(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5}:{userInfo:!1,cookies:{deny:ws},httpHeaders:{request:{deny:ws},response:{deny:ws}},httpBodies:[],queryParams:{deny:ws},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:5}}var Tb={userInfo:!1,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function $_(e){let t=e.dataCollection!=null?Tb:H_(e.sendDefaultPii),n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,queryParams:n.queryParams??t.queryParams,genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var W_="Not capturing exception because it's already been captured.",j_="Discarded session because of missing or non-string release",J_=Symbol.for("SentryInternalError"),X_=Symbol.for("SentryDoNotSendEventError"),yb=5e3;function Ic(e){return{message:e,[J_]:!0}}function mf(e){return{message:e,[X_]:!0}}function z_(e){return!!e&&typeof e=="object"&&J_ in e}function q_(e){return!!e&&typeof e=="object"&&X_ in e}function Y_(e,t,n,r,o){let i=0,s,a=!1;e.on(n,()=>{i=0,clearTimeout(s),a=!1}),e.on(t,c=>{if(i+=r(c),i>=8e5)o(e);else if(!a){let u=e.getOptions()._flushInterval??yb;u>0&&(a=!0,s=vr(setTimeout(()=>{o(e)},u)))}}),e.on("flush",()=>{o(e)})}var ks=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=io(t.transportOptions?.bufferSize??df),this._dataCollection=$_(t),t.dsn?this._dsn=ns(t.dsn):b&&h.warn("No DSN provided, client will not send events."),this._dsn){let r=Ns(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport(E(p({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},t.transportOptions),{url:r}))}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Y_(this,"afterCaptureLog","flushLogs",vb,oo),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Y_(this,"afterCaptureMetric","flushMetrics",Ab,Xo)}captureException(t,n,r){let o=ge();if(es(t))return b&&h.log(W_),o;let i=p({event_id:o},n);return this._process(()=>this.eventFromException(t,i).then(s=>this._captureEvent(s,i,r)).then(s=>s),"error"),i.event_id}captureMessage(t,n,r,o){let i=p({event_id:ge()},r),s=Rn(t)?t:String(t),a=We(t),c=a?this.eventFromMessage(s,n,i):this.eventFromException(t,i);return this._process(()=>c.then(u=>this._captureEvent(u,i,o)),a?"unknown":"error"),i.event_id}captureEvent(t,n,r){let o=ge();if(n?.originalException&&es(n.originalException))return b&&h.log(W_),o;let i=p({event_id:o},n),s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,c=s.capturedSpanIsolationScope,u=V_(t.type);return this._process(()=>this._captureEvent(t,i,a||r,c),u),i.event_id}captureSession(t){this.sendSession(t),zn(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){oo(this);let n=await 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){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),rf(this,t,this._integrations),n||nf(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=P_(t,this),o=t_(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=ps(o,uc(i));r&&(o=ps(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=Zn}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){b&&h.warn(j_);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){b&&h.warn(j_);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=e_(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;b&&h.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...i)=>n(...i);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return b&&h.error("Error while sending envelope:",n),{}}return b&&h.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=v_(this,t),nf(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,i=n.exception?.values;if(i){o=!0,r=!1;for(let c of i)if(c.mechanism?.handled===!1){r=!0;break}}let s=t.status==="ok";(s&&t.errors===0||s&&r)&&(zn(t,E(p({},r&&{status:"crashed"}),{errors:t.errors||Number(o||r)})),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await 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){let i=this.getOptions(),s=this.getIntegrationNames();return!n.integrations&&s.length&&(n.integrations=s),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),ys(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts=p({trace:p(p({},a.contexts?.trace),Go(r))},a.contexts);let c=Tr(this,r);return a.sdkProcessingMetadata=p({dynamicSamplingContext:c},a.sdkProcessingMetadata),a})}_captureEvent(t,n={},r=M(),o=ce()){return b&&_f(t)&&h.log(`Captured error event \`${yc(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{b&&(q_(i)?h.log(i.message):z_(i)?h.warn(i.message):h.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=Q_(t),c=_f(t),f=`before send for type \`${t.type||"error"}\``,l=typeof s>"u"?void 0:Ut(s);if(c&&typeof l=="number"&&At()>l)return this.recordDroppedEvent("sample_rate","error"),eo(mf(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let m=V_(t.type);return this._prepareEvent(t,n,r,o).then(d=>{if(d===null)throw this.recordDroppedEvent("event_processor",m),mf("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return d;let g=bb(this,i,d,n);return Ib(g,f)}).then(d=>{if(d===null){if(this.recordDroppedEvent("before_send",m),a){let T=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",T)}throw mf(`${f} returned \`null\`, will not send event.`)}let _=r.getSession()||o.getSession();if(c&&_&&this._updateSessionFromEvent(_,d),a){let S=d.sdkProcessingMetadata?.spanCountBeforeProcessing||0,T=d.spans?d.spans.length:0,A=S-T;A>0&&this.recordDroppedEvent("before_send","span",A)}let g=d.transaction_info;if(a&&g&&d.transaction!==t.transaction){let S="custom";d.transaction_info=E(p({},g),{source:S})}return this.sendEvent(d,n),d}).then(null,d=>{throw q_(d)||z_(d)?d:(this.captureException(d,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:d}),Ic(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
10
|
+
Reason: ${d}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Qo&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){b&&h.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){b&&h.log("No outcomes to send");return}if(!this._dsn){b&&h.log("No dsn provided, will not send outcomes");return}b&&h.log("Sending outcomes:",t);let n=B_(t,this._options.tunnel&&ze(this._dsn));this.sendEnvelope(n)}};function V_(e){return e==="replay_event"?"replay":e||"error"}function Ib(e,t){let n=`${t} must return \`null\` or a valid event.`;if(mt(e))return e.then(r=>{if(!Me(r)&&r!==null)throw Ic(n);return r},r=>{throw Ic(`${t} rejected with ${r}`)});if(!Me(e)&&e!==null)throw Ic(n);return e}function bb(e,t,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=!er(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(_f(c)&&o)return o(c,r);if(Q_(c)){if(a||s){let u=F_(c);if(s?.length&&Qn({description:u.description,op:u.op,attributes:u.data},s))return null;if(a){let f=a(u);f?c=Sr(n,G_(f)):Xr()}if(c.spans){let f=[],l=c.spans;for(let d of l){if(s?.length&&Qn({description:d.description,op:d.op,attributes:d.data},s)){Jm(l,d);continue}if(a){let _=a(d);_?f.push(_):(Xr(),f.push(d))}else f.push(d)}let m=c.spans.length-f.length;m&&e.recordDroppedEvent("before_send","span",m),c.spans=f}}if(i){if(c.spans){let u=c.spans.length;c.sdkProcessingMetadata=E(p({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:u})}return i(c,r)}}return c}function _f(e){return e.type===void 0}function Q_(e){return e.type==="transaction"}function Ab(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Z_(e.attributes)}function vb(e){let t=0;return e.message&&(t+=e.message.length*2),t+Z_(e.attributes)}function Z_(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*K_(n[0]):We(n)?t+=K_(n):t+=100}),t}function K_(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function hf(e,t){t.debug===!0&&(b?h.enable():Fe(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),M().update(t.initialScope);let r=new e(t);return gf(r),r.init(),r}function gf(e){M().setClient(e)}var Sf=100,Ef=5e3,Rb=36e5;function Tf(e){function t(...n){b&&h.log("[Offline]:",...n)}return n=>{let r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");let o=n.createStore(n),i=Ef,s;function a(l,m,d){return Qr(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,m,d):!0}function c(l){s&&clearTimeout(s),s=vr(setTimeout(async()=>{s=void 0;let m=await o.shift();m&&(t("Attempting to send previously queued event"),m[0].sent_at=new Date().toISOString(),f(m,!0).catch(d=>{t("Failed to retry sending",d)}))},l))}function u(){s||(c(i),i=Math.min(i*2,Rb))}async function f(l,m=!1){if(!m&&Qr(l,["replay_event","replay_recording"]))return await o.push(l),c(Sf),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");let d=await r.send(l),_=Sf;if(d){if(d.headers?.["retry-after"])_=Ec(d.headers["retry-after"]);else if(d.headers?.["x-sentry-rate-limits"])_=6e4;else if((d.statusCode||0)>=400)return d}return c(_),i=Ef,d}catch(d){if(await a(l,d,i))return m?await o.unshift(l):await o.push(l),u(),t("Error sending. Event queued.",d),{};throw d}}return n.flushAtStartup&&u(),{send:f,flush:l=>(l===void 0&&(i=Ef,c(Sf)),r.flush(l))}}}var Os="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function eh(e,t){let n;return Nt(e,(r,o)=>(t.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function Nb(e,t){return n=>{let r=e(n);return E(p({},r),{send:async o=>{let i=eh(o,["event","transaction","profile","replay_event"]);return i&&(i.release=t),r.send(o)}})}}function Cb(e,t){return ke(t?E(p({},e[0]),{dsn:t}):e[0],e[1])}function th(e,t){return n=>{let r=e(n),o=new Map,i=t||(u=>{let f=u.getEvent();return f?.extra?.[Os]&&Array.isArray(f.extra[Os])?f.extra[Os]:[]});function s(u,f){let l=f?`${u}:${f}`:u,m=o.get(l);if(!m){let d=Za(u);if(!d)return;let _=Ns(d,n.tunnel);m=f?Nb(e,f)(E(p({},n),{url:_})):e(E(p({},n),{url:_})),o.set(l,m)}return[u,m]}async function a(u){function f(_){let g=_?.length?_:["event"];return eh(u,g)}let l=i({envelope:u,getEvent:f}).map(_=>typeof _=="string"?s(_,void 0):s(_.dsn,_.release)).filter(_=>!!_),m=l.length?l:[["",r]];return(await Promise.all(m.map(([_,g])=>g.send(Cb(u,_)))))[0]}async function c(u){let f=[...o.values(),r];return(await Promise.all(f.map(m=>m.flush(u)))).every(m=>m)}return{send:a,flush:c}}}function Zo(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return wb(e,n)||xb(e,r)}function xb(e,t){return t?nh(e)===nh(t):!1}function wb(e,t){let n=xn(e);return!n||Zr(n)||!t?!1:kb(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function kb(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function nh(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function yf(e,...t){let n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}var If=yf;function bf(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs=E(p({},e.attrs),{ip_address:"{{auto}}"})):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function ei(e,t,n=[t],r="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:Pt})),o.version=Pt)}function ti(e={}){let t=e.client||I();if(!As()||!t)return{};let n=pt(),r=Yt(n);if(r.getTraceData)return r.getTraceData(e);let o=e.scope||M(),i=e.span||te();if(!i&&Pa())return{};let s=i?cs(i):Ob(o),a=i?xe(i):Tr(t,o),c=Qa(a);if(!tc.test(s))return h.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let f={"sentry-trace":s,baggage:c};return e.propagateTraceparent&&(f.traceparent=i?Wm(i):Mb(o)),f}function Ob(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return os(t,r,n)}function Mb(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return is(t,r,n)}function Af(e,t,n){let r,o,i,s=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function c(){return u(),r=e(),r}function u(){o!==void 0&&clearTimeout(o),i!==void 0&&clearTimeout(i),o=i=void 0}function f(){return o!==void 0||i!==void 0?c():r}function l(){return o&&clearTimeout(o),o=a(c,t),s&&i===void 0&&(i=a(c,s)),r}return l.cancel=u,l.flush=f,l}var Lb=100;function St(e,t){let n=I(),r=ce();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Lb}=n.getOptions();if(i<=0)return;let s=vt(),a=p({timestamp:s},e),c=o?Fe(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,i))}var rh,Pb="FunctionToString",oh=new WeakMap,Ub=()=>({name:Pb,setupOnce(){rh=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=_r(this),n=oh.has(I())&&t!==void 0?t:this;return rh.apply(n,e)}}catch{}},setup(e){oh.set(e,!0)}}),so=Ub;var Db=[/^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$/],Bb="EventFilters",Ac=(e={})=>{let t;return{name:Bb,setup(n){let r=n.getOptions();t=ih(e,r)},processEvent(n,r,o){if(!t){let i=o.getOptions();t=ih(e,i)}return Fb(n,t)?null:n}}},ao=(e={})=>E(p({},Ac(e)),{name:"InboundFilters"});function ih(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Db],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Fb(e,t){if(e.type){if(e.type==="transaction"&&Hb(e,t.ignoreTransactions))return b&&h.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
11
|
+
Event: ${un(e)}`),!0}else{if(Gb(e,t.ignoreErrors))return b&&h.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
+
Event: ${un(e)}`),!0;if(zb(e))return b&&h.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
+
Event: ${un(e)}`),!0;if($b(e,t.denyUrls))return b&&h.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
+
Event: ${un(e)}.
|
|
15
|
+
Url: ${bc(e)}`),!0;if(!Wb(e,t.allowUrls))return b&&h.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
+
Event: ${un(e)}.
|
|
17
|
+
Url: ${bc(e)}`),!0}return!1}function Gb(e,t){return t?.length?yc(e).some(n=>je(n,t)):!1}function Hb(e,t){if(!t?.length)return!1;let n=e.transaction;return n?je(n,t):!1}function $b(e,t){if(!t?.length)return!1;let n=bc(e);return n?je(n,t):!1}function Wb(e,t){if(!t?.length)return!0;let n=bc(e);return n?je(n,t):!0}function jb(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function bc(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?jb(n):null}catch{return b&&h.error(`Cannot extract url for event ${un(e)}`),null}}function zb(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Rf(e,t,n,r,o,i){if(!o.exception?.values||!i||!an(i.originalException,Error))return;let s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=vf(e,t,r,i.originalException,n,o.exception.values,s,0))}function vf(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let c=[...i];if(an(r[o],Error)){sh(s,a,r);let u=e(t,r[o]),f=c.length;ah(u,o,f,a),c=vf(e,t,n,r[o],o,[u,...c],u,f)}return ch(r)&&r.errors.forEach((u,f)=>{if(an(u,Error)){sh(s,a,r);let l=e(t,u),m=c.length;ah(l,`errors[${f}]`,m,a),c=vf(e,t,n,u,o,[l,...c],l,m)}}),c}function ch(e){return Array.isArray(e.errors)}function sh(e,t,n){e.mechanism=E(p(p({handled:!0,type:"auto.core.linked_errors"},ch(n)&&{is_exception_group:!0}),e.mechanism),{exception_id:t})}function ah(e,t,n,r){e.mechanism=E(p({handled:!0},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function qb(e){return et(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function vc(e){return qb(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var lh=new Map,uh=new Set;function Yb(e){if(C._sentryModuleMetadata)for(let t of Object.keys(C._sentryModuleMetadata)){let n=C._sentryModuleMetadata[t];if(uh.has(t))continue;uh.add(t);let r=e(t);for(let o of r.reverse())if(o.filename){lh.set(o.filename,n);break}}}function Vb(e,t){return Yb(e),lh.get(t)}function Rc(e,t){t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;let o=Vb(e,r.filename);o&&(r.module_metadata=o)})})}function Nc(e){e.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}var fh=()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",t=>{Nt(t,(n,r)=>{if(r==="event"){let o=Array.isArray(n)?n[1]:void 0;o&&(Nc(o),n[1]=o)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;let n=e.getOptions().stackParser;Rc(n,t)})}});var ph=new Set([]);function co(e){let t="console",n=rt(t,e);return ot(t,Kb),n}function Kb(){"console"in C&&dr.forEach(function(e){e in C.console&&ye(C.console,e,function(t){return Wr[e]=t,function(...n){let r=n[0],o=Wr[e],i=ph.size&&typeof r=="string"&&je(r,ph);i||$e("console",{args:n,level:e}),(!i||b&&h.isEnabled())&&o?.apply(C.console,n)}})})}function rr(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Jb="CaptureConsole",Xb=(e={})=>{let t=e.levels||dr,n=e.handled??!0;return{name:Jb,setup(r){"console"in C&&co(({args:o,level:i})=>{I()!==r||!t.includes(i)||Qb(o,i,n)})}}},dh=Xb;function Qb(e,t,n){let r=rr(t),o=new Error,i={level:rr(t),extra:{arguments:e}};Ke(s=>{if(s.addEventProcessor(u=>(u.logger="console",Qe(u,{handled:n,type:"auto.core.capture_console"}),u)),t==="assert"){if(!e[0]){let u=`Assertion failed: ${hr(e.slice(1)," ")||"console.assert"}`;s.setExtra("arguments",e.slice(1)),s.captureMessage(u,r,{captureContext:i,syntheticException:o})}return}let a=e.find(u=>u instanceof Error);if(a){J(a,i);return}let c=hr(e," ");s.captureMessage(c,r,{captureContext:i,syntheticException:o})})}var Zb="Dedupe",eA=()=>{let e;return{name:Zb,processEvent(t){if(t.type)return t;try{if(tA(t,e))return b&&h.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},uo=eA;function tA(e,t){return t?!!(nA(e,t)||rA(e,t)):!1}function nA(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!hh(e,t)||!_h(e,t))}function rA(e,t){let n=mh(t),r=mh(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!hh(e,t)||!_h(e,t))}function _h(e,t){let n=jr(e),r=jr(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++){let i=r[o],s=n[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0}function hh(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{return!1}}function mh(e){return e.exception?.values?.[0]}var oA="ExtraErrorData",iA=(e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:oA,processEvent(r,o,i){let{maxValueLength:s}=i.getOptions();return sA(r,o,t,n,s)}}},gh=iA;function sA(e,t={},n,r,o){if(!t.originalException||!et(t.originalException))return e;let i=t.originalException.name||t.originalException.constructor.name,s=Sh(t.originalException,r,o);if(s){let a=p({},e.contexts),c=Ce(s,n);return Me(c)&&(_m(c),a[i]=c),E(p({},e),{contexts:a})}return e}function Sh(e,t,n){try{let r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(let i of Object.keys(e)){if(r.indexOf(i)!==-1)continue;let s=e[i];o[i]=et(s)||typeof s=="string"?n?cn(`${s}`,n):`${s}`:s}if(t&&e.cause!==void 0)if(et(e.cause)){let i=e.cause.name||e.cause.constructor.name;o.cause={[i]:Sh(e.cause,!1,n)}}else o.cause=e.cause;if(typeof e.toJSON=="function"){let i=e.toJSON();for(let s of Object.keys(i)){let a=i[s];o[s]=et(a)?a.toString():a}}return o}catch(r){b&&h.error("Unable to extract extra data from the Error object:",r)}return null}function aA(e,t){let n=0;for(let r=e.length-1;r>=0;r--){let 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}var cA=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function uA(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=cA.exec(t);return n?n.slice(1):[]}function Eh(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let o=r>=0?e[r]:"/";o&&(t=`${o}/${t}`,n=o.charAt(0)==="/")}return t=aA(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Th(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 yh(e,t){e=Eh(e).slice(1),t=Eh(t).slice(1);let n=Th(e.split("/")),r=Th(t.split("/")),o=Math.min(n.length,r.length),i=o;for(let a=0;a<o;a++)if(n[a]!==r[a]){i=a;break}let s=[];for(let a=i;a<n.length;a++)s.push("..");return s=s.concat(r.slice(i)),s.join("/")}function Ih(e,t){let n=uA(e)[2]||"";return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var lA="RewriteFrames",bh=(e={})=>{let t=e.root,n=e.prefix||"app:///",r="window"in C&&!!C.window,o=e.iteratee||fA({isBrowser:r,root:t,prefix:n});function i(a){try{return E(p({},a),{exception:E(p({},a.exception),{values:a.exception.values.map(c=>p(p({},c),c.stacktrace&&{stacktrace:s(c.stacktrace)}))})})}catch{return a}}function s(a){return E(p({},a),{frames:a?.frames?.map(c=>o(c))})}return{name:lA,processEvent(a){let c=a;return a.exception&&Array.isArray(a.exception.values)&&(c=i(c)),c}}};function fA({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let o=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),i=/^\//.test(r.filename);if(e){if(t){let s=r.filename;s.indexOf(t)===0&&(r.filename=s.replace(t,n))}}else if(o||i){let s=o?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=t?yh(t,s):Ih(s);r.filename=`${n}${a}`}return r}}var pA=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],dA=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],mA={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"},vh=["select","insert","upsert","update","delete"];function Cc(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function xc(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function Rh(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function _A(e,t){return Rh(e,t)!==void 0}function hA(e,t={}){switch(e){case"GET":return"select";case"POST":return t.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function gA(e,t){if(t===""||t==="*")return"select(*)";if(e==="select")return`select(${t})`;if(e==="or"||e.endsWith(".or"))return`${e}${t}`;let[n,...r]=t.split("."),o;return n?.startsWith("fts")?o="textSearch":n?.startsWith("plfts")?o="textSearch[plain]":n?.startsWith("phfts")?o="textSearch[phrase]":n?.startsWith("wfts")?o="textSearch[websearch]":o=n&&mA[n]||"filter",`${o}(${e}, ${r.join(".")})`}function Ah(e,t=!1){return new Proxy(e,{apply(n,r,o){return Je({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[H]:"auto.db.supabase",[q]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},i=>Reflect.apply(n,r,o).then(s=>(s&&typeof s=="object"&&"error"in s&&s.error?(i.setStatus({code:2}),J(s.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):i.setStatus({code:1}),i.end(),s)).catch(s=>{throw i.setStatus({code:2}),i.end(),J(s,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),s}).then(...o))}})}function SA(e){let t=e.auth;if(!(!t||xc(e.auth))){for(let n of pA){let r=t[n];r&&typeof e.auth[n]=="function"&&(e.auth[n]=Ah(r))}for(let n of dA){let r=t.admin[n];r&&typeof e.auth.admin[n]=="function"&&(e.auth.admin[n]=Ah(r,!0))}Cc(e.auth)}}function EA(e,t){xc(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(n,r,o){let i=Reflect.apply(n,r,o),s=i.constructor;return yA(s,t),i}}),Cc(e.prototype.from))}function TA(e,t){xc(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(n,r,o){let i=vh,s=r,a=hA(s.method,s.headers);if(!i.includes(a)||!s?.url?.pathname||typeof s.url.pathname!="string")return Reflect.apply(n,r,o);let c=s.url.pathname.split("/"),u=c.length>0?c[c.length-1]:"",f=[];for(let[N,U]of s.url.searchParams.entries())f.push(gA(N,U));let l=Object.create(null);if(Me(s.body))for(let[N,U]of Object.entries(s.body))l[N]=U;let m=I(),d=t.sendOperationData??m?.getDataCollectionOptions().userInfo===!0,_=Rh(s.body,l),g=a==="select"?"":`${a}${_A(s.body,l)?"(...) ":""}`,S=d?f.join(" "):f.length>0?"[redacted]":"",T=[g.trimEnd(),S].filter(Boolean).join(" "),A=T?`${T} from(${u})`:`from(${u})`,k={"db.table":u,"db.schema":s.schema,"db.url":s.url.origin,"db.sdk":s.headers["X-Client-Info"],"db.system":"postgresql","db.operation":a,[H]:"auto.db.supabase",[q]:"db"};return f.length&&d&&(k["db.query"]=f),_!==void 0&&d&&(k["db.body"]=_),Je({name:A,attributes:k},N=>Reflect.apply(n,r,[]).then(U=>{if(N&&(U&&typeof U=="object"&&"status"in U&&Kn(N,U.status||500),N.end()),U?.error){let O=new Error(U.error.message);U.error.code&&(O.code=U.error.code),U.error.details&&(O.details=U.error.details);let z={};f.length&&d&&(z.query=f),_!==void 0&&d&&(z.body=_),J(O,R=>(R.addEventProcessor(B=>(Qe(B,{handled:!1,type:"auto.db.supabase.postgres"}),B)),R.setContext("supabase",z),R))}let D={type:"supabase",category:`db.${a}`,message:A},y={};return f.length&&d&&(y.query=f),_!==void 0&&d&&(y.body=_),Object.keys(y).length&&(D.data=y),St(D),U},U=>{throw N&&(Kn(N,500),N.end()),U}).then(...o))}}),Cc(e.prototype.then))}function yA(e,t){for(let n of vh)xc(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(r,o,i){let s=Reflect.apply(r,o,i),a=s.constructor;return b&&h.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),TA(a,t),s}}),Cc(e.prototype[n]))}var Nf=(e,t={})=>{if(!e){b&&h.warn("Supabase integration was not installed because no Supabase client was provided.");return}let n=e.constructor===Function?e:e.constructor;EA(n,t),SA(e)},IA="Supabase",bA=(e,t)=>({setupOnce(){Nf(e,t)},name:IA}),Nh=e=>bA(e.supabaseClient,{sendOperationData:e.sendOperationData});var AA=10,vA="ZodErrors";function RA(e){return et(e)&&e.name==="ZodError"&&Array.isArray(e.issues)}function NA(e){return E(p({},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 CA(e){return e.map(t=>typeof t=="number"?"<array>":t).join(".")}function xA(e){let t=new Set;for(let r of e.issues){let o=CA(r.path);o.length>0&&t.add(o)}let n=Array.from(t);if(n.length===0){let r="variable";if(e.issues.length>0){let 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: ${cn(n.join(", "),100)}`}function wA(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!RA(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(NA);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:i})})),E(p({},n),{exception:E(p({},n.exception),{values:[E(p({},n.exception.values[0]),{value:xA(r.originalException)}),...n.exception.values.slice(1)]}),extra:E(p({},n.extra),{"zoderror.issues":i.slice(0,e)})})}catch(o){return E(p({},n),{extra:E(p({},n.extra),{"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:o instanceof Error?`${o.name}: ${o.message}
|
|
18
|
+
${o.stack}`:"unknown"}})})}}var kA=(e={})=>{let t=e.limit??AA;return{name:vA,processEvent(n,r){return wA(t,e.saveZodIssuesAsAttachment,n,r)}}},Ch=kA;var wh=e=>({name:"ThirdPartyErrorsFilter",setup(t){t.on("beforeEnvelope",n=>{Nt(n,(r,o)=>{if(o==="event"){let i=Array.isArray(r)?r[1]:void 0;i&&(Nc(i),r[1]=i)}})}),t.on("applyFrameMetadata",n=>{if(n.type)return;let r=t.getOptions().stackParser;Rc(r,n)})},preprocessEvent(t){e.ignoreSentryInternalFrames&&(C._sentryWrappedDepth??0)>0&&(t.sdkProcessingMetadata=E(p({},t.sdkProcessingMetadata),{insideSentryWrapped:!0}))},processEvent(t){let n=e.ignoreSentryInternalFrames?t.sdkProcessingMetadata?.insideSentryWrapped===!0&&t.exception?.values?.length===1:!1,r=MA(t,e.ignoreSentryInternalFrames,n);if(r){let o=e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(r[o](s=>!s.some(a=>e.filterKeys.includes(a)))){if(e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;t.tags=E(p({},t.tags),{third_party_code:!0})}}return t}});function OA(e,t,n){if(t!==0)return!1;if(n&&LA(e)||e.function==="sentryWrapped")return!0;if(!e.context_line||!e.filename||!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(UA))return!1;if(e.pre_context){let r=e.pre_context.length;for(let o=0;o<r;o++)if(e.pre_context[o]?.includes(PA))return!0}return!1}function MA(e,t,n){let r=jr(e);if(r)return r.filter((o,i)=>!o.filename||o.lineno==null&&o.colno==null&&o.instruction_addr==null?!1:!t||!OA(o,i,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(i=>i.startsWith(xh)).map(i=>i.slice(xh.length)):[])}function LA(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}var xh="_sentryBundlerPluginAppKey:",PA="Attempt to invoke user-land function",UA="fn.apply(this, wrappedArguments)";var kh=100,Oh=10,wc="flag.evaluation.";function Dt(e){if(e.type)return e;let n=M().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...r]}),e}function xt(e,t,n=kh){let r=M().getScopeData().contexts;r.flags||(r.flags={values:[]});let o=r.flags.values;DA(o,e,t,n)}function DA(e,t,n,r){if(typeof n!="boolean")return;if(e.length>r){b&&h.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let o=e.findIndex(i=>i.flag===t);o!==-1&&e.splice(o,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function wt(e,t,n=Oh){if(typeof t!="boolean")return;let r=te();if(!r)return;let o=P(r).data;if(`${wc}${e}`in o){r.setAttribute(`${wc}${e}`,t);return}Object.keys(o).filter(s=>s.startsWith(wc)).length<n&&r.setAttribute(`${wc}${e}`,t)}var Mh=()=>({name:"FeatureFlags",processEvent(e,t,n){return Dt(e)},addFeatureFlag(e,t){xt(e,t),wt(e,t)}});var Cf=({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){let t=e.prototype;typeof t.isOn=="function"&&ye(t,"isOn",Lh),typeof t.getFeatureValue=="function"&&ye(t,"getFeatureValue",Lh)},processEvent(t,n,r){return Dt(t)}});function Lh(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"&&(xt(n,r),wt(n,r)),r}}var BA="ConversationId",FA=()=>({name:BA,setup(e){e.on("spanStart",t=>{let n=M().getScopeData(),r=ce().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=P(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(Xa,o)}})}}),ni=FA;function xf(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=Ge()&&t(s);if(e.endTimestamp){let _=e.fetchData.__span;if(!_)return;let g=r[_];g&&(a&&(HA(g,e),GA(g,e,o)),delete r[_]);return}let{spanOrigin:c="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},f=I(),m=!!te()||!!f&&He(f),d=a&&m?Le(jA(s,i,c)):new qe;if(a&&!m&&f?.recordDroppedEvent("no_parent_span","span"),e.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d,n(e.fetchData.url)){let _=e.args[0],g=p({},e.args[1]||{}),S=Uh(_,g,Ge()&&m?d:void 0,u);S&&(e.args[1]=g,g.headers=S)}if(f){let _={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",d,_)}return d}function GA(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Uh(e,t,n,r){let o=ti({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let c=t.headers||(Ji(e)?e.headers:void 0);if(c)if($A(c)){let u=new Headers(c);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),s){let f=u.get("baggage");f?kc(f)||u.set("baggage",`${f},${s}`):u.set("baggage",s)}return u}else if(WA(c)){let u=[...c];u.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&a&&!u.find(l=>l[0]==="traceparent")&&u.push(["traceparent",a]);let f=c.find(l=>l[0]==="baggage"&&typeof l[1]=="string"&&kc(l[1]));return s&&!f&&u.push(["baggage",s]),u}else{let u="sentry-trace"in c?c["sentry-trace"]:void 0,f="traceparent"in c?c.traceparent:void 0,l="baggage"in c?c.baggage:void 0,m=l?Array.isArray(l)?[...l]:[l]:[],d=l&&(Array.isArray(l)?l.find(g=>kc(g)):kc(l));s&&!d&&m.push(s);let _=Object.assign({},c,{"sentry-trace":u??i,baggage:m.length>0?m.join(","):void 0});return r&&a&&!f&&(_.traceparent=a),_}else return p({},o)}function HA(e,t){if(t.response){Kn(e,t.response.status);let n=t.response?.headers?.get("content-length");if(n){let r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:2,message:"internal_error"});e.end()}function kc(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(ts))}function $A(e){return typeof Headers<"u"&&an(e,Headers)}function WA(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function jA(e,t,n){if(e.startsWith("data:")){let i=ct(e);return{name:`${t} ${i}`,attributes:Ph(e,void 0,t,n)}}let r=xn(e),o=r?Vo(r):e;return{name:`${t} ${o}`,attributes:Ph(e,r,t,n)}}function Ph(e,t,n,r){let o={url:ct(e),type:"fetch","http.method":n,[H]:r,[q]:"http.client"};return t&&(Zr(t)||(o["http.url"]=ct(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function Ms(e,t={},n=M()){let{message:r,name:o,email:i,url:s,source:a,associatedEventId:c,tags:u}=e,f={contexts:{feedback:{contact_email:i,name:o,message:r,url:s,source:a,associated_event_id:c}},type:"feedback",level:"info",tags:u},l=n?.getClient()||I();return l&&l.emit("beforeSendFeedback",f,t),n.captureEvent(f,t)}var wf={};Yd(wf,{debug:()=>qA,error:()=>KA,fatal:()=>JA,fmt:()=>If,info:()=>YA,trace:()=>zA,warn:()=>VA});function ri(e,t,n,r,o){Ar({level:e,message:t,attributes:n,severityNumber:o},r)}function zA(e,t,{scope:n}={}){ri("trace",e,t,n)}function qA(e,t,{scope:n}={}){ri("debug",e,t,n)}function YA(e,t,{scope:n}={}){ri("info",e,t,n)}function VA(e,t,{scope:n}={}){ri("warn",e,t,n)}function KA(e,t,{scope:n}={}){ri("error",e,t,n)}function JA(e,t,{scope:n}={}){ri("fatal",e,t,n)}function oi(e,t,n){return"util"in C&&typeof C.util.format=="function"?C.util.format(...e):XA(e,t,n)}function XA(e,t,n){return e.map(r=>We(r)?String(r):JSON.stringify(Ce(r,t,n))).join(" ")}function Oc(e){return/%[sdifocO]/.test(e)}function Mc(e,t){let n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((o,i)=>{n[`sentry.message.parameter.${i}`]=o}),n}var QA="ConsoleLogs",Dh={[H]:"auto.log.console"},ZA=(e={})=>{let t=e.levels||dr;return{name:QA,setup(n){let{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){b&&h.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let s=co(({args:a,level:c})=>{if(I()!==n||!t.includes(c))return;let u=a[0],f=a.slice(1);if(c==="assert"){if(!u){let _=f.length>0?`Assertion failed: ${oi(f,o,i)}`:"Assertion failed";Ar({level:"error",message:_,attributes:Dh})}return}let l=c==="log",m=a.length>1&&typeof a[0]=="string"&&!Oc(a[0]),d=p(p({},Dh),m?Mc(u,f):{});Ar({level:l?"info":c,message:oi(a,o,i),severityNumber:l?10:void 0,attributes:d})});n.registerCleanup(s)}}},Bh=ZA;var lo={};Yd(lo,{count:()=>ev,distribution:()=>nv,gauge:()=>tv});function kf(e,t,n,r){ff({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function ev(e,t=1,n){kf("counter",e,t,n)}function tv(e,t,n){kf("gauge",e,t,n)}function nv(e,t,n){kf("distribution",e,t,n)}var rv=["trace","debug","info","warn","error","fatal"];function Fh(e={}){let t=new Set(e.levels??rv),n=e.client;return{log(r){let T=r,{type:o,level:i,message:s,args:a,tag:c,date:u}=T,f=qt(T,["type","level","message","args","tag","date"]),l=n||I();if(!l)return;let m=sv(o,i);if(!t.has(m))return;let{normalizeDepth:d=3,normalizeMaxBreadth:_=1e3}=l.getOptions(),g={};for(let[A,k]of Object.entries(f))g[A]=Ce(k,d,_);g["sentry.origin"]="auto.log.consola",c&&(g["consola.tag"]=c),o&&(g["consola.type"]=o),i!=null&&typeof i=="number"&&(g["consola.level"]=i);let S=cv(av(a,d,_),d,_);S?.attributes&&Object.assign(g,S.attributes),Ar({level:m,message:S?.message||s||a&&oi(a,d,_)||"",attributes:g})}}}var ov={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 sv(e,t){if(e==="verbose")return"debug";if(e==="silent")return"trace";if(e){let n=ov[e];if(n)return n}if(typeof t=="number"){let n=iv[t];if(n)return n}return"info"}function av(e,t,n){if(!e?.length)return{message:""};let r=oi(e,t,n),o=e[0];if(Me(o)){let i=typeof e[1]=="string"?2:1,s=e.slice(i);return{message:r,attributes:o,messageParameters:s}}else{let i=e.slice(1),s=i.length>0&&typeof o=="string"&&!Oc(o);return{message:r,messageTemplate:s?o:void 0,messageParameters:s?i:void 0}}}function cv(e,t,n){let{message:r,attributes:o,messageTemplate:i,messageParameters:s}=e,a={};if(i&&s){let c=Mc(i,s);for(let[u,f]of Object.entries(c))a[u]=u.startsWith("sentry.message.parameter.")?Ce(f,t,n):f}else s&&s.length>0&&s.forEach((c,u)=>{a[`sentry.message.parameter.${u}`]=Ce(c,t,n)});return{message:r,attributes:p(p({},Ce(o,t,n)),a)}}var Gh="gen_ai.prompt",On="gen_ai.system",we="gen_ai.request.model",ii="gen_ai.request.stream",Rr="gen_ai.request.temperature",si="gen_ai.request.max_tokens",Nr="gen_ai.request.frequency_penalty",ai="gen_ai.request.presence_penalty",Cr="gen_ai.request.top_p",Lc="gen_ai.request.top_k",Pc="gen_ai.request.encoding_format",Uc="gen_ai.request.dimensions",Mn="gen_ai.response.finish_reasons",Vt="gen_ai.response.model",xr="gen_ai.response.id",Hh="gen_ai.response.stop_reason",Kt="gen_ai.usage.input_tokens",Jt="gen_ai.usage.output_tokens",Bt="gen_ai.usage.total_tokens",Xe="gen_ai.operation.name",Xt="sentry.sdk_meta.gen_ai.input.messages.original_length",gn="gen_ai.input.messages";var Ln="gen_ai.system_instructions",lt="gen_ai.response.text",Pn="gen_ai.request.available_tools",$h="gen_ai.response.streaming",kt="gen_ai.response.tool_calls",fo="gen_ai.agent.name",Wh="gen_ai.pipeline.name",Ls="gen_ai.conversation.id",jh="gen_ai.usage.cache_creation_input_tokens",zh="gen_ai.usage.cache_read_input_tokens";var qh="gen_ai.invoke_agent",ci="gen_ai.embeddings.input",Of="gen_ai.embeddings",Mf="gen_ai.execute_tool",Dc="gen_ai.tool.name",Yh="gen_ai.tool.call.id",Vh="gen_ai.tool.type",Bc="gen_ai.tool.input",Fc="gen_ai.tool.output",Kh="gen_ai.tool.description";function wr(e){return!e||typeof e!="object"?!1:lv(e)||Xh(e)||uv(e)||Qh(e)||Zh(e)||fv(e)||pv(e)||dv(e)||mv(e)||_v(e)||hv(e)||gv(e)}function uv(e){return"image_url"in e?typeof e.image_url=="string"?e.image_url.startsWith("data:"):Jh(e):!1}function Jh(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 lv(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&wr(e.source)}function Xh(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="string"}function Qh(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 Zh(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 fv(e){return"media_type"in e&&typeof e.media_type=="string"&&"data"in e}function pv(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 dv(e){return"type"in e&&e.type==="image"&&"image"in e&&typeof e.image=="string"&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}function mv(e){return"type"in e&&(e.type==="blob"||e.type==="base64")}function _v(e){return"b64_json"in e}function hv(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:")}var Ps="[Blob substitute]",Sv=["image_url","data","content","b64_json","result","uri","image"];function po(e){let t=p({},e);wr(t.source)&&(t.source=po(t.source)),Xh(e)&&(t.inlineData=E(p({},e.inlineData),{data:Ps})),Jh(e)&&(t.image_url=E(p({},e.image_url),{url:Ps})),Qh(e)&&(t.input_audio=E(p({},e.input_audio),{data:Ps})),Zh(e)&&(t.file=E(p({},e.file),{file_data:Ps}));for(let n of Sv)typeof t[n]=="string"&&(t[n]=Ps);return t}var tg=2e4,Gc=e=>new TextEncoder().encode(e).length,Pf=e=>Gc(JSON.stringify(e));function Hc(e,t){if(Gc(e)<=t)return e;let n=0,r=e.length,o="";for(;n<=r;){let i=Math.floor((n+r)/2),s=e.slice(0,i);Gc(s)<=t?(o=s,n=i+1):r=i-1}return o}function Ev(e){return typeof e=="string"?e:"text"in e&&typeof e.text=="string"?e.text:""}function eg(e,t){return typeof e=="string"?t:E(p({},e),{text:t})}function Tv(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function ng(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function rg(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function yv(e,t){let n=E(p({},e),{content:""}),r=Pf(n),o=t-r;if(o<=0)return[];let i=Hc(e.content,o);return[E(p({},e),{content:i})]}function Iv(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 bv(e,t){let{key:n,items:r}=Iv(e);if(n===null||r.length===0)return[];let o=r.map(c=>eg(c,"")),i=Pf(E(p({},e),{[n]:o})),s=t-i;if(s<=0)return[];let a=[];for(let c of r){let u=Ev(c),f=Gc(u);if(f<=s)a.push(c),s-=f;else if(a.length===0){let l=Hc(u,s);l&&a.push(eg(c,l));break}else break}return a.length<=0?[]:[E(p({},e),{[n]:a})]}function Av(e,t){if(!e)return[];if(typeof e=="string"){let n=Hc(e,t);return n?[n]:[]}return typeof e!="object"?[]:Tv(e)?yv(e,t):ng(e)||rg(e)?bv(e,t):[]}function Lf(e){return e.map(n=>{let r;return n&&typeof n=="object"&&(ng(n)?r=E(p({},n),{content:Lf(n.content)}):"content"in n&&wr(n.content)&&(r=E(p({},n),{content:po(n.content)})),rg(n)&&(r=E(p({},r??n),{parts:Lf(n.parts)})),wr(r)?r=po(r):wr(n)&&(r=po(n))),r??n})}function vv(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],o=Lf([r]),i=o[0];return Pf(i)<=n?o:Av(i,n)}function og(e){return vv(e,tg)}function ig(e){return Hc(e,tg)}function Ft(e){let t=!!I()?.getOptions().sendDefaultPii;return E(p({},e),{recordInputs:e?.recordInputs??t,recordOutputs:e?.recordOutputs??t})}function Ot(e){let t=I();return e??!(t&&He(t))}function ui(e,t){return e?`${e}.${t}`:t}function sg(e,t,n,r,o){if(t!==void 0&&e.setAttributes({[Kt]:t}),n!==void 0&&e.setAttributes({[Jt]:n}),t!==void 0||n!==void 0||r!==void 0||o!==void 0){let i=(t??0)+(n??0)+(r??0)+(o??0);e.setAttributes({[Bt]:i})}}function mo(e,t,n){if(!e.isRecording())return;let r={[$h]:!0};t.responseId&&(r[xr]=t.responseId),t.responseModel&&(r[Vt]=t.responseModel),t.promptTokens!==void 0&&(r[Kt]=t.promptTokens),t.completionTokens!==void 0&&(r[Jt]=t.completionTokens),t.totalTokens!==void 0?r[Bt]=t.totalTokens:(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[Bt]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)),t.finishReasons.length&&(r[Mn]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[lt]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[kt]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function Sn(e){return typeof e=="string"?e:JSON.stringify(e)}function En(e){if(typeof e=="string")return ig(e);if(Array.isArray(e)){let t=og(e);return JSON.stringify(t)}return JSON.stringify(e)}function Un(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(s=>s&&typeof s=="object"&&"role"in s&&s.role==="system");if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let 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};let o=JSON.stringify([{type:"text",content:r}]),i=[...e.slice(0,t),...e.slice(t+1)];return{systemInstructions:o,filteredMessages:i}}async function Rv(e,t,n){let r=e.catch(s=>{throw J(s,{mechanism:{handled:!1,type:n}}),s}),o=await t,i=await r;return i&&typeof i=="object"&&"data"in i?E(p({},i),{data:o}):o}function li(e,t,n){return mt(e)?new Proxy(e,{get(r,o){let s=o in Promise.prototype||o===Symbol.toStringTag?t:r,a=Reflect.get(s,o);return o==="withResponse"&&typeof a=="function"?function(){let u=a.call(r);return Rv(u,t,n)}:typeof a=="function"?a.bind(s):a}}):t}var ag={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},Nv=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],cg=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...Nv];function ug(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function lg(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function fg(e,t,n){if(!t||typeof t!="object")return;let r=t,o={};if(typeof r.id=="string"&&(o[xr]=r.id),typeof r.model=="string"&&(o[Vt]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Ls]=r.id),r.usage&&typeof r.usage=="object"){let i=r.usage,s=i.prompt_tokens??i.input_tokens;typeof s=="number"&&(o[Kt]=s);let a=i.completion_tokens??i.output_tokens;typeof a=="number"&&(o[Jt]=a),typeof i.total_tokens=="number"&&(o[Bt]=i.total_tokens)}if(Array.isArray(r.choices)){let i=r.choices,s=i.map(a=>a.finish_reason).filter(a=>typeof a=="string");if(s.length>0&&(o[Mn]=JSON.stringify(s)),n){let a=i.map(u=>u.message?.content||"");o[lt]=JSON.stringify(a);let c=i.map(u=>u.message?.tool_calls).filter(u=>Array.isArray(u)&&u.length>0).flat();c.length>0&&(o[kt]=JSON.stringify(c))}}if(typeof r.status=="string"&&(o[Mn]||(o[Mn]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[lt]&&(o[lt]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!o[kt])){let i=r.output.filter(s=>s?.type==="function_call");i.length>0&&(o[kt]=JSON.stringify(i))}e.setAttributes(o)}function Cv(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 pg(e){let t={[we]:e.model??"unknown"};"temperature"in e&&(t[Rr]=e.temperature),"top_p"in e&&(t[Cr]=e.top_p),"frequency_penalty"in e&&(t[Nr]=e.frequency_penalty),"presence_penalty"in e&&(t[ai]=e.presence_penalty),"stream"in e&&(t[ii]=e.stream),"encoding_format"in e&&(t[Pc]=e.encoding_format),"dimensions"in e&&(t[Uc]=e.dimensions);let n=Cv(e);return n&&(t[Ls]=n),t}function xv(e,t){for(let n of e){let r=n.index;if(!(r===void 0||!n.function))if(!(r in t.chatCompletionToolCalls))t.chatCompletionToolCalls[r]=E(p({},n),{function:{name:n.function.name,arguments:n.function.arguments||""}});else{let o=t.chatCompletionToolCalls[r];n.function.arguments&&o?.function&&(o.function.arguments+=n.function.arguments)}}}function wv(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&xv(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function kv(e,t,n,r){if(!(e&&typeof e=="object")){t.eventTypes.push("unknown:non-object");return}if(e instanceof Error){r.setStatus({code:2,message:"internal_error"}),J(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in e))return;let o=e;if(!cg.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){let{response:i}=o;t.responseId=i.id??t.responseId,t.responseModel=i.model??t.responseModel,i.usage&&(t.promptTokens=i.usage.input_tokens,t.completionTokens=i.usage.output_tokens,t.totalTokens=i.usage.total_tokens),i.status&&t.finishReasons.push(i.status),n&&i.output_text&&t.responseTexts.push(i.output_text)}}async function*dg(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let o of e)lg(o)?wv(o,r,n):ug(o)&&kv(o,r,n,t),yield o}finally{let o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];mo(t,E(p({},r),{toolCalls:o}),n)}}function Ov(e){let t=Array.isArray(e.tools)?e.tools:[],r=e.web_search_options&&typeof e.web_search_options=="object"?[p({type:"web_search_options"},e.web_search_options)]:[],o=[...t,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(i){b&&h.error("Failed to serialize OpenAI tools:",i);return}}function Mv(e,t){let n={[On]:"openai",[Xe]:t,[H]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let r=e[0],o=Ov(r);o&&(n[Pn]=o),Object.assign(n,pg(r))}else n[we]="unknown";return n}function mg(e,t,n,r){if(n==="embeddings"&&"input"in t){let a=t.input;if(a==null||typeof a=="string"&&a.length===0||Array.isArray(a)&&a.length===0)return;e.setAttribute(ci,typeof a=="string"?a:JSON.stringify(a));return}let o="input"in t?t.input:"messages"in t?t.messages:void 0;if(!o||Array.isArray(o)&&o.length===0)return;let{systemInstructions:i,filteredMessages:s}=Un(o);i&&e.setAttribute(Ln,i),e.setAttribute(gn,r?En(s):Sn(s)),Array.isArray(s)?e.setAttribute(Xt,s.length):e.setAttribute(Xt,1)}function Lv(e,t,n,r,o){return function(...s){let a=n.operation||"unknown",c=Mv(s,a),u=c[we]||"unknown",f=s[0],l=f&&typeof f=="object"&&f.stream===!0,m={name:`${a} ${u}`,op:`gen_ai.${a}`,attributes:c};if(l){let g,S=gt(m,T=>(g=e.apply(r,s),o.recordInputs&&f&&mg(T,f,a,Ot(o.enableTruncation)),(async()=>{try{let A=await g;return dg(A,T,o.recordOutputs??!1)}catch(A){throw T.setStatus({code:2,message:"internal_error"}),J(A,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),T.end(),A}})()));return li(g,S,"auto.ai.openai")}let d,_=Je(m,g=>(d=e.apply(r,s),o.recordInputs&&f&&mg(g,f,a,Ot(o.enableTruncation)),d.then(S=>(fg(g,S,o.recordOutputs),S),S=>{throw J(S,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),S})));return li(d,_,"auto.ai.openai")}}function _g(e,t="",n){return new Proxy(e,{get(r,o){let i=r[o],s=ui(t,String(o)),a=ag[s];return typeof i=="function"&&a?Lv(i,s,a,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?_g(i,s,n):i}})}function hg(e,t){return _g(e,"",Ft(t))}var gg={"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 Sg(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:o}=Un(t);r&&e.setAttributes({[Ln]:r});let i=Array.isArray(o)?o.length:1;e.setAttributes({[gn]:n?En(o):Sn(o),[Xt]:i})}var Pv={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 Uf(e){return e&&Pv[e]||"internal_error"}function Eg(e,t){t.error&&(e.setStatus({code:2,message:Uf(t.error.type)}),J(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function Tg(e){let{system:t,messages:n,input:r}=e,o=typeof t=="string"?[{role:"system",content:e.system}]:[],i=Array.isArray(r)?r:r!=null?[r]:void 0,s=Array.isArray(n)?n:n!=null?[n]:[],a=i??s;return[...o,...a]}function Uv(e,t){return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:2,message:Uf(e.error?.type)}),J(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function Dv(e,t){if(e.type==="message_delta"&&e.usage&&"output_tokens"in e.usage&&typeof e.usage.output_tokens=="number"&&(t.completionTokens=e.usage.output_tokens),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function Bv(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 Fv(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"){let 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 Gv(e,t){if(e.type!=="content_block_stop"||typeof e.index!="number")return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(""),o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete t.activeToolBlocks[e.index]}function yg(e,t,n,r){!(e&&typeof e=="object")||Uv(e,r)||(Dv(e,t),Bv(e,t),Fv(e,t,n),Gv(e,t))}async function*Ig(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let o of e)yg(o,r,n,t),yield o}finally{mo(t,r,n)}}function bg(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",o=>{yg(o,r,n,t)}),e.on("message",()=>{mo(t,r,n)}),e.on("error",o=>{J(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:2,message:"internal_error"}),t.end())}),e}function Hv(e,t,n){let r={[On]:"anthropic",[Xe]:n,[H]:"auto.ai.anthropic"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let o=e[0];o.tools&&Array.isArray(o.tools)&&(r[Pn]=JSON.stringify(o.tools)),r[we]=o.model??"unknown","temperature"in o&&(r[Rr]=o.temperature),"top_p"in o&&(r[Cr]=o.top_p),"stream"in o&&(r[ii]=o.stream),"top_k"in o&&(r[Lc]=o.top_k),"frequency_penalty"in o&&(r[Nr]=o.frequency_penalty),"max_tokens"in o&&(r[si]=o.max_tokens)}else t==="models.retrieve"||t==="models.get"?r[we]=e[0]:r[we]="unknown";return r}function Df(e,t,n){let r=Tg(t);Sg(e,r,n),"prompt"in t&&e.setAttributes({[Gh]:JSON.stringify(t.prompt)})}function $v(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[lt]:t.content.map(r=>r.text).filter(r=>!!r).join("")});let n=[];for(let r of t.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&e.setAttributes({[kt]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[lt]:t.completion}),"input_tokens"in t&&e.setAttributes({[lt]:JSON.stringify(t.input_tokens)})}function Wv(e,t){"id"in t&&"model"in t&&(e.setAttributes({[xr]:t.id,[Vt]:t.model}),"usage"in t&&t.usage&&sg(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function jv(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){Eg(e,t);return}n&&$v(e,t),Wv(e,t)}}function Ag(e,t,n){throw J(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:2,message:"internal_error"}),t.end()),e}function zv(e,t,n,r,o,i,s,a,c,u,f){let l=o[we]??"unknown",m={name:`${i} ${l}`,op:`gen_ai.${i}`,attributes:o};if(u&&!f){let d,_=gt(m,g=>(d=e.apply(n,r),c.recordInputs&&a&&Df(g,a,Ot(c.enableTruncation)),(async()=>{try{let S=await d;return Ig(S,g,c.recordOutputs??!1)}catch(S){return Ag(S,g,s)}})()));return li(d,_,"auto.ai.anthropic")}else return gt(m,d=>{try{c.recordInputs&&a&&Df(d,a,Ot(c.enableTruncation));let _=t.apply(n,r);return bg(_,d,c.recordOutputs??!1)}catch(_){return Ag(_,d,s)}})}function qv(e,t,n,r,o){return new Proxy(e,{apply(i,s,a){let c=n.operation||"unknown",u=Hv(a,t,c),f=u[we]??"unknown",l=typeof a[0]=="object"?a[0]:void 0,m=!!l?.stream,d=n.streaming===!0;if(m||d)return zv(e,i,r,a,u,c,t,l,o,m,d);let _,g=Je({name:`${c} ${f}`,op:`gen_ai.${c}`,attributes:u},S=>(_=i.apply(r,a),o.recordInputs&&l&&Df(S,l,Ot(o.enableTruncation)),_.then(T=>(jv(S,T,o.recordOutputs),T),T=>{throw J(T,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}}),T})));return li(_,g,"auto.ai.anthropic")}})}function vg(e,t="",n){return new Proxy(e,{get(r,o){let i=r[o],s=ui(t,String(o)),a=gg[s];return typeof i=="function"&&a?qv(i,s,a,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?vg(i,s,n):i}})}function Rg(e,t){return vg(e,"",Ft(t))}var Ng={"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}},Cg="google_genai";function Yv(e,t){let n=e?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:"internal_error"}),J(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function Vv(e,t){typeof e.responseId=="string"&&(t.responseId=e.responseId),typeof e.modelVersion=="string"&&(t.responseModel=e.modelVersion);let 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 Kv(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let o of r?.content?.parts??[])n&&o.text&&t.responseTexts.push(o.text),o.functionCall&&t.toolCalls.push({type:"function",id:o.functionCall.id,name:o.functionCall.name,arguments:o.functionCall.args})}}function Jv(e,t,n,r){!e||Yv(e,r)||(Vv(e,t),Kv(e,t,n))}async function*xg(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of e)Jv(o,r,n,t),yield o}finally{mo(t,r,n)}}function fi(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>fi(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[E(p({},e),{role:t})]:[{role:t,content:e}]}function wg(e,t){if("model"in e&&typeof e.model=="string")return e.model;if(t&&typeof t=="object"){let n=t;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function Xv(e){let t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[Rr]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[Cr]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[Lc]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[si]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[Nr]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[ai]=e.presencePenalty),t}function Qv(e,t,n){let r={[On]:Cg,[Xe]:e,[H]:"auto.ai.google_genai"};if(t){if(r[we]=wg(t,n),"config"in t&&typeof t.config=="object"&&t.config){let o=t.config;if(Object.assign(r,Xv(o)),"tools"in o&&Array.isArray(o.tools)){let i=o.tools.flatMap(s=>s.functionDeclarations);r[Pn]=JSON.stringify(i)}}}else r[we]=wg({},n);return r}function kg(e,t,n,r){if(n){let i=t.contents;i!=null&&e.setAttribute(ci,typeof i=="string"?i:JSON.stringify(i));return}let o=[];if("config"in t&&t.config&&typeof t.config=="object"&&"systemInstruction"in t.config&&t.config.systemInstruction&&o.push(...fi(t.config.systemInstruction,"system")),"history"in t&&o.push(...fi(t.history,"user")),"contents"in t&&o.push(...fi(t.contents,"user")),"message"in t&&o.push(...fi(t.message,"user")),Array.isArray(o)&&o.length){let{systemInstructions:i,filteredMessages:s}=Un(o);i&&e.setAttribute(Ln,i);let a=Array.isArray(s)?s.length:0;e.setAttributes({[Xt]:a,[gn]:r?En(s):Sn(s)})}}function Zv(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(Vt,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){let r=t.usageMetadata;typeof r.promptTokenCount=="number"&&e.setAttributes({[Kt]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&e.setAttributes({[Jt]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&e.setAttributes({[Bt]:r.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let r=t.candidates.map(o=>o.content?.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({[lt]:r.join("")})}if(n&&t.functionCalls){let r=t.functionCalls;Array.isArray(r)&&r.length>0&&e.setAttributes({[kt]:JSON.stringify(r)})}}}function eR(e,t,n,r,o){let i=n.operation==="embeddings";return new Proxy(e,{apply(s,a,c){let u=n.operation||"unknown",f=c[0],l=Qv(u,f,r),m=l[we]??"unknown";return n.streaming?gt({name:`${u} ${m}`,op:`gen_ai.${u}`,attributes:l},async d=>{try{o.recordInputs&&f&&kg(d,f,i,Ot(o.enableTruncation));let _=await s.apply(r,c);return xg(_,d,!!o.recordOutputs)}catch(_){throw d.setStatus({code:2,message:"internal_error"}),J(_,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),d.end(),_}}):Je({name:`${u} ${m}`,op:`gen_ai.${u}`,attributes:l},d=>(o.recordInputs&&f&&kg(d,f,i,Ot(o.enableTruncation)),hs(()=>s.apply(r,c),_=>{J(_,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},_=>{i||Zv(d,_,o.recordOutputs)})))}})}function Bf(e,t="",n){return new Proxy(e,{get:(r,o,i)=>{let s=Reflect.get(r,o,i),a=ui(t,String(o)),c=Ng[a];if(typeof s=="function"&&c){let u=c.operation?eR(s,a,c,r,n):s.bind(r);return c.proxyResultPath?function(...f){let l=u(...f);return l&&typeof l=="object"?Bf(l,c.proxyResultPath,n):l}:u}return typeof s=="function"?s.bind(r):s&&typeof s=="object"?Bf(s,a,n):s}})}function Og(e,t){return Bf(e,"",Ft(t))}var or="auto.ai.langchain",Mg={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var Qt=(e,t,n)=>{n!=null&&(e[t]=n)},Gt=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function _o(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function pi(e){if(Array.isArray(e))try{let t=e.map(n=>n&&typeof n=="object"&&wr(n)?po(n):n);return JSON.stringify(t)}catch{return String(e)}return _o(e)}function Us(e){let t=e.toLowerCase();return Mg[t]??t}function Lg(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 Ff(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function Ds(e){return e.map(t=>{let n=t._getType;if(typeof n=="function"){let o=n.call(t);return{role:Us(o),content:pi(t.content)}}if(t.lc===1&&t.kwargs){let o=t.id,i=Array.isArray(o)&&o.length>0?o[o.length-1]:"",s=typeof i=="string"?Lg(i):"user";return{role:Us(s),content:pi(t.kwargs?.content)}}if(t.type){let o=String(t.type).toLowerCase();return{role:Us(o),content:pi(t.content)}}if(t.role)return{role:Us(String(t.role)),content:pi(t.content)};let r=t.constructor?.name;return r&&r!=="Object"?{role:Us(Lg(r)),content:pi(t.content)}:{role:"user",content:pi(t.content)}})}function tR(e,t,n){let r={},o="kwargs"in e?e.kwargs:void 0,i=t?.temperature??n?.ls_temperature??o?.temperature;Gt(r,Rr,i);let s=t?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Gt(r,si,s);let a=t?.top_p??o?.top_p;Gt(r,Cr,a);let c=t?.frequency_penalty;Gt(r,Nr,c);let u=t?.presence_penalty;return Gt(r,ai,u),t&&"stream"in t&&Qt(r,ii,!!t.stream),r}function Ug(e,t,n,r,o){return p({[On]:_o(e??"langchain"),[Xe]:"chat",[we]:_o(t),[H]:or},tR(n,r,o))}function Dg(e,t,n,r,o,i){let s=i?.ls_provider,a=o?.model??i?.ls_model_name??"unknown",c=Ug(s,a,e,o,i);if(n&&Array.isArray(t)&&t.length>0){Qt(c,Xt,t.length);let u=t.map(f=>({role:"user",content:f}));Qt(c,gn,r?En(u):Sn(u))}return c}function Bg(e,t,n,r,o,i){let s=i?.ls_provider??e.id?.[2],a=o?.model??i?.ls_model_name??"unknown",c=Ug(s,a,e,o,i);if(n&&Array.isArray(t)&&t.length>0){let u=Ds(t.flat()),{systemInstructions:f,filteredMessages:l}=Un(u);f&&Qt(c,Ln,f);let m=Array.isArray(l)?l.length:0;Qt(c,Xt,m),Qt(c,gn,r?En(l):Sn(l))}return c}function nR(e,t){let n=[],r=e.flat();for(let o of r){let s=o.message?.tool_calls;if(Array.isArray(s)&&s.length>0)n.push(...s);else{let a=o.message?.content;if(Array.isArray(a))for(let c of a){let u=c;u.type==="tool_use"&&n.push(u)}}}n.length>0&&Qt(t,kt,_o(n))}function rR(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)Gt(t,Kt,n.promptTokens),Gt(t,Jt,n.completionTokens),Gt(t,Bt,n.totalTokens);else if(r){Gt(t,Kt,r.input_tokens),Gt(t,Jt,r.output_tokens);let o=Number(r.input_tokens),i=Number(r.output_tokens),s=(Number.isNaN(o)?0:o)+(Number.isNaN(i)?0:i);s>0&&Gt(t,Bt,s),r.cache_creation_input_tokens!==void 0&&Gt(t,jh,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Gt(t,zh,r.cache_read_input_tokens)}}function Fg(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let u=e.generations.flat().map(f=>f.generationInfo?.finish_reason?f.generationInfo.finish_reason:f.generation_info?.finish_reason?f.generation_info.finish_reason:null).filter(f=>typeof f=="string");if(u.length>0&&Qt(n,Mn,_o(u)),nR(e.generations,n),t){let f=e.generations.flat().map(l=>l.text??l.message?.content).filter(l=>typeof l=="string");f.length>0&&Qt(n,lt,_o(f))}}rR(e.llmOutput,n);let r=e.llmOutput,i=e.generations?.[0]?.[0]?.message,s=r?.model_name??r?.model??i?.response_metadata?.model_name;s&&Qt(n,Vt,s);let a=r?.id??i?.id;a&&Qt(n,xr,a);let c=r?.stop_reason??i?.response_metadata?.finish_reason;return c&&Qt(n,Hh,_o(c)),n}function $c(e){let t={},n=e?.lc_agent_name;return typeof n=="string"&&(t[fo]=n),t}function Gg(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(r=>{let o=r.function;return{type:"function",name:r.name??o?.name??"",description:r.description??o?.description}});return JSON.stringify(n)}function oR(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.addHandler=="function"&&typeof t.copy=="function"}function iR(e){return typeof e=="object"&&e?.name==="SentryCallbackHandler"}function Pg(e){return e.some(iR)}function Hg(e,t){if(!e)return[t];if(oR(e)){if(Pg(e.handlers??[]))return e;let r=e.copy();return r.addHandler(t,!0),r}let n=Array.isArray(e)?e:[e];return Pg(n)?e:[...n,t]}function Bs(e={}){let{recordInputs:t,recordOutputs:n}=Ft(e),r=Ot(e.enableTruncation),o=new Map,i=a=>{let c=o.get(a);c?.isRecording()&&(c.end(),o.delete(a))},s={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,f,l,m,d,_){let g=Ff(m),S=Dg(a,c,t,r,g,d),T=S[we],A=S[Xe];gt({name:`${A} ${T}`,op:"gen_ai.chat",attributes:E(p(p({},$c(d)),S),{[q]:"gen_ai.chat"})},k=>(o.set(u,k),k))},handleChatModelStart(a,c,u,f,l,m,d,_){let g=Ff(m),S=Bg(a,c,t,r,g,d),T=Gg(l);T&&(S[Pn]=T);let A=S[we],k=S[Xe];gt({name:`${k} ${A}`,op:"gen_ai.chat",attributes:E(p(p({},$c(d)),S),{[q]:"gen_ai.chat"})},N=>(o.set(u,N),N))},handleLLMEnd(a,c,u,f,l){let m=o.get(c);if(m?.isRecording()){let d=Fg(a,n);d&&m.setAttributes(d),i(c)}},handleLLMError(a,c){let u=o.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),J(a,{mechanism:{handled:!1,type:`${or}.llm_error_handler`}})},handleChainStart(a,c,u,f,l,m,d,_){if(m?.__sentry_langgraph__)return;let g=_||a.name||"unknown_chain",S={[H]:"auto.ai.langchain","langchain.chain.name":g};t&&(S["langchain.chain.inputs"]=JSON.stringify(c)),gt({name:`chain ${g}`,op:"gen_ai.invoke_agent",attributes:E(p({},S),{[q]:"gen_ai.invoke_agent"})},T=>(o.set(u,T),T))},handleChainEnd(a,c){let u=o.get(c);u?.isRecording()&&(n&&u.setAttributes({"langchain.chain.outputs":JSON.stringify(a)}),i(c))},handleChainError(a,c){let u=o.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),J(a,{mechanism:{handled:!1,type:`${or}.chain_error_handler`}})},handleToolStart(a,c,u,f,l,m,d){if(m?.__sentry_langgraph__)return;let _=d||a.name||"unknown_tool",g=E(p({},$c(m)),{[H]:or,[Xe]:"execute_tool",[Dc]:_});t&&(g[Bc]=c),gt({name:`execute_tool ${_}`,op:"gen_ai.execute_tool",attributes:E(p({},g),{[q]:"gen_ai.execute_tool"})},S=>(o.set(u,S),S))},handleToolEnd(a,c){let u=o.get(c);if(u?.isRecording()){if(n){let f=a,l=f&&typeof f=="object"&&"content"in f?f.content:a;u.setAttributes({[Fc]:typeof l=="string"?l:JSON.stringify(l)})}i(c)}},handleToolError(a,c){let u=o.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),J(a,{mechanism:{handled:!1,type:`${or}.tool_error_handler`}})},copy(){return s},toJSON(){return{lc:1,type:"not_implemented",id:s.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:s.lc_id}}};return s}var Fs="auto.ai.langgraph";function $g(e){let t=e[0];if(typeof t!="object"||!t||!("llm"in t)||!t.llm||typeof t.llm!="object")return null;let n=t.llm;return typeof n.modelName!="string"&&typeof n.model!="string"?null:n}function Wg(e){let t=e[0];return typeof t=="object"&&t&&"name"in t&&typeof t.name=="string"?t.name:null}function jg(e,t,n){let r="__sentry_tool_wrapped__";for(let o of e){if(!o||typeof o!="object")continue;let i=o,s=i.invoke;if(typeof s!="function"||Object.prototype.hasOwnProperty.call(i,r))continue;let a=typeof i.name=="string"?i.name:"unknown_tool",c=typeof i.description=="string"?i.description:void 0,u=new Proxy(s,{apply(f,l,m){let d={[H]:Fs,[q]:Mf,[Xe]:"execute_tool",[Dc]:a,[Vh]:"function"},g=m[1]?.metadata?.lc_agent_name??n;typeof g=="string"&&(d[fo]=g),c&&(d[Kh]=c);let S=m[0];if(typeof S=="object"&&S&&("id"in S&&typeof S.id=="string"&&(d[Yh]=S.id),t.recordInputs)){let T="args"in S&&typeof S.args=="object"?S.args:S;try{d[Bc]=JSON.stringify(T)}catch{}}return Je({op:Mf,name:`execute_tool ${a}`,attributes:d},async T=>{try{let A=await Reflect.apply(f,l,m);if(t.recordOutputs)try{let k=A,N=k&&typeof k=="object"&&"content"in k?k.content:A;T.setAttribute(Fc,typeof N=="string"?N:JSON.stringify(N))}catch{}return A}catch(A){throw T.setStatus({code:2,message:"internal_error"}),J(A,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),A}})}});i.invoke=u,Object.defineProperty(i,r,{value:!0,enumerable:!1})}return e}function sR(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n=="object"){let r=n.tool_calls;r&&Array.isArray(r)&&t.push(...r)}return t.length>0?t:null}function aR(e){let t=e,n=0,r=0,o=0;if(t.usage_metadata&&typeof t.usage_metadata=="object"){let i=t.usage_metadata;return typeof i.input_tokens=="number"&&(n=i.input_tokens),typeof i.output_tokens=="number"&&(r=i.output_tokens),typeof i.total_tokens=="number"&&(o=i.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(t.response_metadata&&typeof t.response_metadata=="object"){let i=t.response_metadata;if(i.tokenUsage&&typeof i.tokenUsage=="object"){let s=i.tokenUsage;typeof s.promptTokens=="number"&&(n=s.promptTokens),typeof s.completionTokens=="number"&&(r=s.completionTokens),typeof s.totalTokens=="number"&&(o=s.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function cR(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata=="object"){let r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&e.setAttribute(Vt,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&e.setAttribute(Mn,[r.finish_reason])}}function zg(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function qg(e,t,n){let o=n?.messages;if(!o||!Array.isArray(o))return;let i=t?.length??0,s=o.length>i?o.slice(i):[];if(s.length===0)return;let a=sR(s);a&&e.setAttribute(kt,JSON.stringify(a));let c=Ds(s);e.setAttribute(lt,JSON.stringify(c));let u=0,f=0,l=0;for(let m of s){let d=aR(m);u+=d.inputTokens,f+=d.outputTokens,l+=d.totalTokens,cR(e,m)}u>0&&e.setAttribute(Kt,u),f>0&&e.setAttribute(Jt,f),l>0&&e.setAttribute(Bt,l)}var Gf=!1,Wc="__sentry_patched__";function Yg(e,t){if(Object.prototype.hasOwnProperty.call(e,Wc))return e;let n=Bs(t),r=new Proxy(e,{apply(o,i,s){return Gf?Reflect.apply(o,i,s):Je({op:"gen_ai.create_agent",name:"create_agent",attributes:{[H]:Fs,[q]:"gen_ai.create_agent",[Xe]:"create_agent"}},a=>{try{let c=Reflect.apply(o,i,s),u=s.length>0?s[0]:{};u?.name&&typeof u.name=="string"&&(a.setAttribute(fo,u.name),a.updateName(`create_agent ${u.name}`));let f=c.invoke;return f&&typeof f=="function"&&(c.invoke=Vg(f.bind(c),c,u,t,void 0,n)),c}catch(c){throw a.setStatus({code:2,message:"internal_error"}),J(c,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),c}})}});return Object.defineProperty(r,Wc,{value:!0,enumerable:!1}),r}function Vg(e,t,n,r,o,i){return new Proxy(e,{apply(s,a,c){let u=o?.modelName??o?.model;return Je({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[H]:Fs,[q]:qh,[Xe]:"invoke_agent"}},async f=>{try{let l=n?.name;l&&typeof l=="string"&&(f.setAttribute(Wh,l),f.setAttribute(fo,l),f.updateName(`invoke_agent ${l}`)),u&&f.setAttribute(we,u);let _=(c.length>1?c[1]:void 0)?.configurable?.thread_id;if(_&&typeof _=="string"&&f.setAttribute(Ls,_),i){let N=c[1]??{};c[1]=N;let U=N.metadata??{};N.metadata=p(E(p({},U),{__sentry_langgraph__:!0}),typeof l=="string"?{lc_agent_name:l}:{}),N.callbacks=Hg(N.callbacks,i)}let g=zg(t);g&&f.setAttribute(Pn,JSON.stringify(g));let S=r.recordInputs,T=r.recordOutputs,A=c.length>0?c[0]?.messages??[]:[];if(A&&S){let N=Ds(A),{systemInstructions:U,filteredMessages:D}=Un(N);U&&f.setAttribute(Ln,U);let y=Ot(r.enableTruncation),O=Array.isArray(D)?D.length:0;f.setAttributes({[gn]:y?En(D):Sn(D),[Xt]:O})}let k=await Reflect.apply(s,a,c);return T&&qg(f,A??null,k),k}catch(l){throw f.setStatus({code:2,message:"internal_error"}),J(l,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),l}})}})}function Kg(e,t){if(Object.prototype.hasOwnProperty.call(e,Wc))return e;let n=Ft(t),r=Bs(n),o=new Proxy(e,{apply(i,s,a){let c=$g(a),u=Wg(a),f=a[0];f&&Array.isArray(f.tools)&&f.tools.length>0&&jg(f.tools,n,u??void 0),Gf=!0;let l;try{l=Reflect.apply(i,s,a)}finally{Gf=!1}let m=l.invoke;if(m&&typeof m=="function"){let d={};u&&(d.name=u),l.invoke=Vg(m.bind(l),l,d,n,c,r)}return l}});return Object.defineProperty(o,Wc,{value:!0,enumerable:!1}),o}function Jg(e,t){return e.compile=Yg(e.compile,Ft(t)),e}function Xg(e,t,n){let r=n.getOptions(),o=n.getDsn(),i=r.tunnel,s=mn(r._metadata),a=p(p(p({sent_at:new Date().toISOString()},uR(t)&&{trace:t}),s&&{sdk:s}),!!i&&o&&{dsn:ze(o)}),c=n.getDataCollectionOptions().userInfo?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},E(p({version:2},ut()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}}),{items:e})];return ke(a,[u])}function uR(e){return!!e.trace_id&&!!e.public_key}function Qg(e){let t=156;if(t+=e.name.length*2,t+=Cl(e.attributes),e.links&&e.links.length>0){let r=e.links[0]?.attributes,o=100+(r?Cl(r):0);t+=o*e.links.length}return t}var Zg=1e3,lR=5e6,Gs=class{constructor(t,n){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:i}=n??{};this._maxSpanLimit=r&&r>0&&r<=Zg?r:Zg,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=i&&i>0?i:lR,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(s=>{clearTimeout(s.timeout)}),this._traceBuckets.clear()})}add(t){let n=t.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:vr(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=Qg(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(b&&h.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){let n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}let r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){b&&h.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let i=xe(o),s=r.map(c=>{let l=c,{_segmentSpan:u}=l;return qt(l,["_segmentSpan"])}),a=Xg(s,i,this._client);b&&h.log(`Sending span envelope for trace ${t} with ${s.length} spans`),this._client.sendEnvelope(a).then(null,c=>{b&&h.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}};function jc(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var di=C;function zc(){return"history"in di&&!!di.history}function fR(){if(!("fetch"in di))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function mi(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function _i(){if(typeof EdgeRuntime=="string")return!0;if(!fR())return!1;if(mi(di.fetch))return!0;let e=!1,t=di.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=mi(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){b&&h.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function qc(){return"ReportingObserver"in di}function Dn(e,t){let n="fetch",r=rt(n,e);return ot(n,()=>tS(void 0,t)),r}function Vc(e){let t="fetch-body-resolved",n=rt(t,e);return ot(t,()=>tS(dR)),n}function tS(e,t=!1){t&&!_i()||ye(C,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=mR(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:ne()*1e3,virtualError:o,headers:_R(r)};return e||$e("fetch",p({},a)),n.apply(C,r).then(async c=>(e?e(c):$e("fetch",E(p({},a),{endTimestamp:ne()*1e3,response:c})),c),c=>{$e("fetch",E(p({},a),{endTimestamp:ne()*1e3,error:c})),et(c)&&c.stack===void 0&&(c.stack=o.stack,Ee(c,"framesToPop",1));let f=I()?.getOptions().enhanceFetchErrorMessages??"always";if(f!==!1&&c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{let d=new URL(a.fetchData.url).host;f==="always"?c.message=`${c.message} (${d})`:Ee(c,"__sentry_fetch_url_host__",d)}catch{}throw c})}})}async function pR(e,t){if(e?.body){let n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),i=!0;for(;i;){let s;try{s=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:a}=await r.read();clearTimeout(s),a&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(s)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function dR(e){let t;try{t=e.clone()}catch{return}pR(t,()=>{$e("fetch-body-resolved",{endTimestamp:ne()*1e3,response:e})})}function Yc(e,t){return!!e&&typeof e=="object"&&!!e[t]}function eS(e){return typeof e=="string"?e:e?Yc(e,"url")?e.url:e.toString?e.toString():"":""}function mR(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:eS(n),method:Yc(r,"method")?String(r.method).toUpperCase():Ji(n)&&Yc(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:eS(t),method:Yc(t,"method")?String(t.method).toUpperCase():"GET"}}function _R(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Ji(t))return new Headers(t.headers)}catch{}}var nS=C;function ft(){try{return nS.document.location.href}catch{return""}}function kr(e,t=5){if(!nS.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}function hR(e){let t=e.constructor?.name??"";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 gR(e){let t=e??{},n={[H]:or,[q]:Of,[Xe]:"embeddings",[we]:t.model??"unknown"};return n[On]=hR(t),"dimensions"in t&&(n[Uc]=t.dimensions),"encodingFormat"in t&&(n[Pc]=t.encodingFormat),n}function rS(e,t={}){let{recordInputs:n}=Ft(t);return new Proxy(e,{apply(r,o,i){let s=gR(o),a=s[we]||"unknown";if(n){let c=i[0];c!=null&&(s[ci]=typeof c=="string"?c:JSON.stringify(c))}return Je({name:`embeddings ${a}`,op:Of,attributes:s},()=>Reflect.apply(r,o,i).then(void 0,c=>{throw J(c,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),c}))}})}function oS(e,t){let n=e;return typeof n.embedQuery=="function"&&(n.embedQuery=rS(n.embedQuery,t)),typeof n.embedDocuments=="function"&&(n.embedDocuments=rS(n.embedDocuments,t)),e}var Tn=C,Ie=Tn.document,Hs=Tn.navigator,bS="Report a Bug",BR="Cancel",FR="Send Bug Report",GR="Confirm",HR="Report a Bug",$R="your.email@example.org",WR="Email",jR="What's the bug? What did you expect?",zR="Description",qR="Your Name",YR="Name",VR="Thank you for your report!",KR="(required)",JR="Add a screenshot",XR="Remove screenshot",QR="Highlight",ZR="Hide",eN="Remove",AS="Unable to submit feedback with empty message",vS="No client setup, cannot send feedback.",RS="Unable to determine if Feedback was correctly sent.",NS="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",CS="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",tN="widget",nN="api",rN=5e3,oN={ERROR_EMPTY_MESSAGE:AS,ERROR_NO_CLIENT:vS,ERROR_TIMEOUT:RS,ERROR_FORBIDDEN:NS,ERROR_GENERIC:CS};function Qc(e,t){return t?.[e]??oN[e]}function iS(e,t){return new Error(Qc(e,t))}var xS=(e,t={includeReplay:!0})=>{let n=t.errorMessages;if(!e.message)throw iS("ERROR_EMPTY_MESSAGE",n);let r=I();if(!r)throw iS("ERROR_NO_CLIENT",n);e.tags&&Object.keys(e.tags).length&&M().setTags(e.tags);let o=Ms(p({source:nN,url:ft()},e),t);return new Promise((i,s)=>{let a=setTimeout(()=>{c(),s(Qc("ERROR_TIMEOUT",n))},3e4),c=r.on("afterSendEvent",(u,f)=>{if(u.event_id===o)return clearTimeout(a),c(),f?.statusCode&&f.statusCode>=200&&f.statusCode<300?i(o):f?.statusCode===403?s(Qc("ERROR_FORBIDDEN",n)):s(Qc("ERROR_GENERIC",n))})})},Zc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function iN(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Hs.userAgent)||/Macintosh/i.test(Hs.userAgent)&&Hs.maxTouchPoints&&Hs.maxTouchPoints>1||!isSecureContext)}function Kc(e,t){return E(p(p({},e),t),{tags:p(p({},e.tags),t.tags),onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:p(p({},e.themeDark),t.themeDark),themeLight:p(p({},e.themeLight),t.themeLight)})}function sN(e){let t=Ie.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 Ht(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}var hi=20,aN="http://www.w3.org/2000/svg";function cN(){let e=a=>Tn.document.createElementNS(aN,a),t=Ht(e("svg"),{width:`${hi}`,height:`${hi}`,viewBox:`0 0 ${hi} ${hi}`,fill:"var(--actor-color, var(--foreground))"}),n=Ht(e("g"),{clipPath:"url(#clip0_57_80)"}),r=Ht(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);let o=e("defs"),i=Ht(e("clipPath"),{id:"clip0_57_80"}),s=Ht(e("rect"),{width:`${hi}`,height:`${hi}`,fill:"white"});return i.appendChild(s),o.appendChild(i),t.appendChild(o).appendChild(i).appendChild(s),t}function uN({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){let o=Ie.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||bS,o.appendChild(cN()),e){let s=Ie.createElement("span");s.appendChild(Ie.createTextNode(e)),o.appendChild(s)}let i=sN(r);return{el:o,appendToDom(){n.appendChild(i),n.appendChild(o)},removeFromDom(){o.remove(),i.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}var wS="rgba(88, 74, 192, 1)",lN={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:wS,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%)"},sS={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:wS,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 aS(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 cS({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){let o=Ie.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
|
+
${aS(e==="dark"?p(p({},sS),t):p(p({},lN),n))}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${e==="system"?`
|
|
99
|
+
@media (prefers-color-scheme: dark) {
|
|
100
|
+
:host {
|
|
101
|
+
color-scheme: only dark;
|
|
102
|
+
|
|
103
|
+
${aS(p(p({},sS),t))}
|
|
104
|
+
}
|
|
105
|
+
}`:""}
|
|
106
|
+
`,r&&o.setAttribute("nonce",r),o}var iu=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:o="sentry-feedback",autoInject:i=!0,showBranding:s=!0,isEmailRequired:a=!1,isNameRequired:c=!1,showEmail:u=!0,showName:f=!0,enableScreenshot:l=!0,useSentryUser:m={email:"email",name:"username"},tags:d,styleNonce:_,scriptNonce:g,colorScheme:S="system",themeLight:T={},themeDark:A={},addScreenshotButtonLabel:k=JR,cancelButtonLabel:N=BR,confirmButtonLabel:U=GR,emailLabel:D=WR,emailPlaceholder:y=$R,formTitle:O=HR,isRequiredLabel:z=KR,messageLabel:R=zR,messagePlaceholder:B=jR,nameLabel:L=YR,namePlaceholder:F=qR,removeScreenshotButtonLabel:j=XR,submitButtonLabel:ae=FR,successMessageText:se=VR,triggerLabel:fe=bS,triggerAriaLabel:x="",highlightToolText:Q=QR,hideToolText:G=ZR,removeHighlightText:Y=eN,errorEmptyMessageText:me=AS,errorNoClientText:ue=vS,errorTimeoutText:De=RS,errorForbiddenText:nt=NS,errorGenericText:jt=CS,onFormOpen:on,onFormClose:$n,onSubmitSuccess:Br,onSubmitError:Wn,onFormSubmitted:Aa}={})=>{let jn={id:o,autoInject:i,showBranding:s,isEmailRequired:a,isNameRequired:c,showEmail:u,showName:f,enableScreenshot:l,useSentryUser:m,tags:d,styleNonce:_,scriptNonce:g,colorScheme:S,themeDark:A,themeLight:T,triggerLabel:fe,triggerAriaLabel:x,cancelButtonLabel:N,submitButtonLabel:ae,confirmButtonLabel:U,formTitle:O,emailLabel:D,emailPlaceholder:y,messageLabel:R,messagePlaceholder:B,nameLabel:L,namePlaceholder:F,successMessageText:se,isRequiredLabel:z,addScreenshotButtonLabel:k,removeScreenshotButtonLabel:j,highlightToolText:Q,hideToolText:G,removeHighlightText:Y,errorEmptyMessageText:me,errorNoClientText:ue,errorTimeoutText:De,errorForbiddenText:nt,errorGenericText:jt,onFormClose:$n,onFormOpen:on,onSubmitError:Wn,onSubmitSuccess:Br,onFormSubmitted:Aa},zt=null,bt=null,Lt=[],Mo=W=>{if(!zt){let _e=Ie.createElement("div");_e.id=String(W.id),Ie.body.appendChild(_e),zt=_e.attachShadow({mode:"open"}),bt=cS(W),zt.appendChild(bt)}return zt},Lo=async W=>{let _e=W.enableScreenshot&&iN(),ee,he;try{ee=(t?t():await e("feedbackModalIntegration",g))(),Jo(ee)}catch{throw Zc&&h.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{let $r=_e?n?n():await e("feedbackScreenshotIntegration",g):void 0;$r&&(he=$r(),Jo(he))}catch{Zc&&h.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}let Z={ERROR_EMPTY_MESSAGE:W.errorEmptyMessageText,ERROR_NO_CLIENT:W.errorNoClientText,ERROR_TIMEOUT:W.errorTimeoutText,ERROR_FORBIDDEN:W.errorForbiddenText,ERROR_GENERIC:W.errorGenericText},vn=($r,$y)=>xS($r,E(p({includeReplay:!0},$y),{errorMessages:Z})),Hr=ee.createDialog({options:E(p({},W),{onFormClose:()=>{Hr?.close(),W.onFormClose?.()},onFormSubmitted:()=>{Hr?.close(),W.onFormSubmitted?.()}}),screenshotIntegration:he,sendFeedback:vn,shadow:Mo(W)});return Hr},Fr=(W,_e={})=>{let ee=Kc(jn,_e),he=typeof W=="string"?Ie.querySelector(W):typeof W.addEventListener=="function"?W:null;if(!he)throw Zc&&h.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let Z=null,vn=async()=>{Z||(Z=await Lo(E(p({},ee),{onFormSubmitted:()=>{Z?.removeFromDom(),ee.onFormSubmitted?.()}}))),Z.appendToDom(),Z.open()};he.addEventListener("click",vn);let Hr=()=>{Lt=Lt.filter($r=>$r!==Hr),Z?.removeFromDom(),Z=null,he.removeEventListener("click",vn)};return Lt.push(Hr),Hr},Gr=(W={})=>{let _e=Kc(jn,W),ee=Mo(_e),he=uN({triggerLabel:_e.triggerLabel,triggerAriaLabel:_e.triggerAriaLabel,shadow:ee,styleNonce:_});return Fr(he.el,E(p({},_e),{onFormOpen(){he.hide()},onFormClose(){he.show()},onFormSubmitted(){he.show()}})),he};return{name:"Feedback",setupOnce(){!ut()||!jn.autoInject||(Ie.readyState==="loading"?Ie.addEventListener("DOMContentLoaded",()=>Gr().appendToDom()):Gr().appendToDom())},attachTo:Fr,createWidget(W={}){let _e=Gr(Kc(jn,W));return _e.appendToDom(),_e},async createForm(W={}){return Lo(Kc(jn,W))},setTheme(W){if(jn.colorScheme=W,zt){let _e=cS(jn);bt?zt.replaceChild(_e,bt):zt.prepend(_e),bt=_e}},remove(){zt&&(zt.parentElement?.remove(),zt=null,bt=null),Lt.forEach(W=>W()),Lt=[]}}};function fN(){return I()?.getIntegrationByName("Feedback")}var su,Ae,kS,ho,uS,OS,qf,$s={},Jf=[],pN=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xf=Array.isArray;function Mr(e,t){for(var n in t)e[n]=t[n];return e}function MS(e){var t=e.parentNode;t&&t.removeChild(e)}function ie(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?su.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return eu(e,s,r,o,null)}function eu(e,t,n,r,o){var i={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??++kS,__i:-1,__u:0};return o==null&&Ae.vnode!=null&&Ae.vnode(i),i}function Ws(e){return e.children}function tu(e,t){this.props=e,this.context=t}function Si(e,t){if(t==null)return e.__?Si(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"?Si(e):null}function dN(e,t,n){var r,o=e.__v,i=o.__e,s=e.__P;if(s)return(r=Mr({},o)).__v=o.__v+1,Ae.vnode&&Ae.vnode(r),Qf(s,r,o,e.__n,s.ownerSVGElement!==void 0,32&o.__u?[i]:null,t,i??Si(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&LS(r),r}function LS(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 LS(e)}}function lS(e){(!e.__d&&(e.__d=!0)&&ho.push(e)&&!ou.__r++||uS!==Ae.debounceRendering)&&((uS=Ae.debounceRendering)||OS)(ou)}function ou(){var e,t,n,r=[],o=[];for(ho.sort(qf);e=ho.shift();)e.__d&&(n=ho.length,t=dN(e,r,o)||t,n===0||ho.length>n?(Yf(r,t,o),o.length=r.length=0,t=void 0,ho.sort(qf)):t&&Ae.__c&&Ae.__c(t,Jf));t&&Yf(r,t,o),ou.__r=0}function PS(e,t,n,r,o,i,s,a,c,u,f){var l,m,d,_,g,S=r&&r.__k||Jf,T=t.length;for(n.__d=c,mN(n,t,S),c=n.__d,l=0;l<T;l++)(d=n.__k[l])!=null&&typeof d!="boolean"&&typeof d!="function"&&(m=d.__i===-1?$s:S[d.__i]||$s,d.__i=l,Qf(e,d,m,o,i,s,a,c,u,f),_=d.__e,d.ref&&m.ref!=d.ref&&(m.ref&&Zf(m.ref,null,d),f.push(d.ref,d.__c||_,d)),g==null&&_!=null&&(g=_),65536&d.__u||m.__k===d.__k?c=US(d,c,e):typeof d.type=="function"&&d.__d!==void 0?c=d.__d:_&&(c=_.nextSibling),d.__d=void 0,d.__u&=-196609);n.__d=c,n.__e=g}function mN(e,t,n){var r,o,i,s,a,c=t.length,u=n.length,f=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?eu(null,o,null,null,o):Xf(o)?eu(Ws,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?eu(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=_N(o,n,s=r+l,f),o.__i=a,i=null,a!==-1&&(f--,(i=n[a])&&(i.__u|=131072)),i==null||i.__v===null?(a==-1&&l--,typeof o.type!="function"&&(o.__u|=65536)):a!==s&&(a===s+1?l++:a>s?f>c-s?l+=a-s:l--:l=a<s&&a==s-1?a-s:0,a!==r+l&&(o.__u|=65536))):(i=n[r])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=Si(i)),Vf(i,i,!1),n[r]=null,f--);if(f)for(r=0;r<u;r++)(i=n[r])!=null&&(131072&i.__u)==0&&(i.__e==e.__d&&(e.__d=Si(i)),Vf(i,i))}function US(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=US(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 _N(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,c=t[n];if(c===null||c&&o==c.key&&i===c.type)return n;if(r>(c!=null&&(131072&c.__u)==0?1:0))for(;s>=0||a<t.length;){if(s>=0){if((c=t[s])&&(131072&c.__u)==0&&o==c.key&&i===c.type)return s;s--}if(a<t.length){if((c=t[a])&&(131072&c.__u)==0&&o==c.key&&i===c.type)return a;a++}}return-1}function fS(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||pN.test(t)?n:n+"px"}function Jc(e,t,n,r,o){var i;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||fS(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||fS(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=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+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?dS:pS,i)):e.removeEventListener(t,i?dS:pS,i);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??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function pS(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(Ae.event?Ae.event(e):e)}}function dS(e){if(this.l)return this.l[e.type+!0](Ae.event?Ae.event(e):e)}function Qf(e,t,n,r,o,i,s,a,c,u){var f,l,m,d,_,g,S,T,A,k,N,U,D,y,O,z=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[a=t.__e=n.__e]),(f=Ae.__b)&&f(t);e:if(typeof z=="function")try{if(T=t.props,A=(f=z.contextType)&&r[f.__c],k=f?A?A.props.value:f.__:r,n.__c?S=(l=t.__c=n.__c).__=l.__E:("prototype"in z&&z.prototype.render?t.__c=l=new z(T,k):(t.__c=l=new tu(T,k),l.constructor=z,l.render=gN),A&&A.sub(l),l.props=T,l.state||(l.state={}),l.context=k,l.__n=r,m=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),z.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Mr({},l.__s)),Mr(l.__s,z.getDerivedStateFromProps(T,l.__s))),d=l.props,_=l.state,l.__v=t,m)z.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(z.getDerivedStateFromProps==null&&T!==d&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(T,k),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(T,l.__s,k)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=T,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(R){R&&(R.__=t)}),N=0;N<l._sb.length;N++)l.__h.push(l._sb[N]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(T,l.__s,k),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(d,_,g)})}if(l.context=k,l.props=T,l.__P=e,l.__e=!1,U=Ae.__r,D=0,"prototype"in z&&z.prototype.render){for(l.state=l.__s,l.__d=!1,U&&U(t),f=l.render(l.props,l.state,l.context),y=0;y<l._sb.length;y++)l.__h.push(l._sb[y]);l._sb=[]}else do l.__d=!1,U&&U(t),f=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++D<25);l.state=l.__s,l.getChildContext!=null&&(r=Mr(Mr({},r),l.getChildContext())),m||l.getSnapshotBeforeUpdate==null||(g=l.getSnapshotBeforeUpdate(d,_)),PS(e,Xf(O=f!=null&&f.type===Ws&&f.key==null?f.props.children:f)?O:[O],t,n,r,o,i,s,a,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),S&&(l.__E=l.__=null)}catch(R){t.__v=null,c||i!=null?(t.__e=a,t.__u|=c?160:32,i[i.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Ae.__e(R,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=hN(n.__e,t,n,r,o,i,s,c,u);(f=Ae.diffed)&&f(t)}function Yf(e,t,n){for(var r=0;r<n.length;r++)Zf(n[r],n[++r],n[++r]);Ae.__c&&Ae.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){Ae.__e(i,o.__v)}})}function hN(e,t,n,r,o,i,s,a,c){var u,f,l,m,d,_,g,S=n.props,T=t.props,A=t.type;if(A==="svg"&&(o=!0),i!=null){for(u=0;u<i.length;u++)if((d=i[u])&&"setAttribute"in d==!!A&&(A?d.localName===A:d.nodeType===3)){e=d,i[u]=null;break}}if(e==null){if(A===null)return document.createTextNode(T);e=o?document.createElementNS("http://www.w3.org/2000/svg",A):document.createElement(A,T.is&&T),i=null,a=!1}if(A===null)S===T||a&&e.data===T||(e.data=T);else{if(i=i&&su.call(e.childNodes),S=n.props||$s,!a&&i!=null)for(S={},u=0;u<e.attributes.length;u++)S[(d=e.attributes[u]).name]=d.value;for(u in S)d=S[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=d:u==="key"||u in T||Jc(e,u,null,d,o));for(u in T)d=T[u],u=="children"?m=d:u=="dangerouslySetInnerHTML"?f=d:u=="value"?_=d:u=="checked"?g=d:u==="key"||a&&typeof d!="function"||S[u]===d||Jc(e,u,d,S[u],o);if(f)a||l&&(f.__html===l.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(l&&(e.innerHTML=""),PS(e,Xf(m)?m:[m],t,n,r,o&&A!=="foreignObject",i,s,i?i[0]:n.__k&&Si(n,0),a,c),i!=null)for(u=i.length;u--;)i[u]!=null&&MS(i[u]);a||(u="value",_!==void 0&&(_!==e[u]||A==="progress"&&!_||A==="option"&&_!==S[u])&&Jc(e,u,_,S[u],!1),u="checked",g!==void 0&&g!==e[u]&&Jc(e,u,g,S[u],!1))}return e}function Zf(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){Ae.__e(r,n)}}function Vf(e,t,n){var r,o;if(Ae.unmount&&Ae.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Zf(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){Ae.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Vf(r[o],t,n||typeof e.type!="function");n||e.__e==null||MS(e.__e),e.__=e.__e=e.__d=void 0}function gN(e,t,n){return this.constructor(e,n)}function SN(e,t,n){var r,o,i,s;Ae.__&&Ae.__(e,t),o=(r=!1)?null:t.__k,i=[],s=[],Qf(t,e=t.__k=ie(Ws,null,[e]),o||$s,$s,t.ownerSVGElement!==void 0,o?null:t.firstChild?su.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,s),e.__d=void 0,Yf(i,e,s)}su=Jf.slice,Ae={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},kS=0,tu.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Mr({},this.state),typeof e=="function"&&(e=e(Mr({},n),this.props)),e&&Mr(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),lS(this))},tu.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),lS(this))},tu.prototype.render=Ws,ho=[],OS=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,qf=function(e,t){return e.__v.__b-t.__v.__b},ou.__r=0;var ir,be,Hf,mS,Ei=0,DS=[],nu=[],Ue=Ae,_S=Ue.__b,hS=Ue.__r,gS=Ue.diffed,SS=Ue.__c,ES=Ue.unmount,TS=Ue.__;function So(e,t){Ue.__h&&Ue.__h(be,e,Ei||t),Ei=0;var n=be.__H||(be.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:nu}),n.__[e]}function go(e){return Ei=1,BS(GS,e)}function BS(e,t,n){var r=So(ir++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):GS(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=be,!be.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(m){return!!m.__c});if(f.every(function(m){return!m.__N}))return!i||i.call(this,a,c,u);var l=!1;return f.forEach(function(m){if(m.__N){var d=m.__[0];m.__=m.__N,m.__N=void 0,d!==m.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!i||i.call(this,a,c,u))};be.u=!0;var i=be.shouldComponentUpdate,s=be.componentWillUpdate;be.componentWillUpdate=function(a,c,u){if(this.__e){var f=i;i=void 0,o(a,c,u),i=f}s&&s.call(this,a,c,u)},be.shouldComponentUpdate=o}return r.__N||r.__}function EN(e,t){var n=So(ir++,3);!Ue.__s&&ep(n.__H,t)&&(n.__=e,n.i=t,be.__H.__h.push(n))}function FS(e,t){var n=So(ir++,4);!Ue.__s&&ep(n.__H,t)&&(n.__=e,n.i=t,be.__h.push(n))}function TN(e){return Ei=5,js(function(){return{current:e}},[])}function yN(e,t,n){Ei=6,FS(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 js(e,t){var n=So(ir++,7);return ep(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function gi(e,t){return Ei=8,js(function(){return e},t)}function IN(e){var t=be.context[e.__c],n=So(ir++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(be)),t.props.value):e.__}function bN(e,t){Ue.useDebugValue&&Ue.useDebugValue(t?t(e):e)}function AN(e){var t=So(ir++,10),n=go();return t.__=e,be.componentDidCatch||(be.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function vN(){var e=So(ir++,11);if(!e.__){for(var t=be.__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 RN(){for(var e;e=DS.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ru),e.__H.__h.forEach(Kf),e.__H.__h=[]}catch(t){e.__H.__h=[],Ue.__e(t,e.__v)}}Ue.__b=function(e){be=null,_S&&_S(e)},Ue.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),TS&&TS(e,t)},Ue.__r=function(e){hS&&hS(e),ir=0;var t=(be=e.__c).__H;t&&(Hf===be?(t.__h=[],be.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=nu,n.__N=n.i=void 0})):(t.__h.forEach(ru),t.__h.forEach(Kf),t.__h=[],ir=0)),Hf=be},Ue.diffed=function(e){gS&&gS(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(DS.push(t)!==1&&mS===Ue.requestAnimationFrame||((mS=Ue.requestAnimationFrame)||NN)(RN)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==nu&&(n.__=n.__V),n.i=void 0,n.__V=nu})),Hf=be=null},Ue.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ru),n.__h=n.__h.filter(function(r){return!r.__||Kf(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Ue.__e(r,n.__v)}}),SS&&SS(e,t)},Ue.unmount=function(e){ES&&ES(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ru(r)}catch(o){t=o}}),n.__H=void 0,t&&Ue.__e(t,n.__v))};var yS=typeof requestAnimationFrame=="function";function NN(e){var t,n=function(){clearTimeout(r),yS&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);yS&&(t=requestAnimationFrame(n))}function ru(e){var t=be,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),be=t}function Kf(e){var t=be;e.__c=e.__(),be=t}function ep(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function GS(e,t){return typeof t=="function"?t(e):t}var CN=Object.defineProperty({__proto__:null,useCallback:gi,useContext:IN,useDebugValue:bN,useEffect:EN,useErrorBoundary:AN,useId:vN,useImperativeHandle:yN,useLayoutEffect:FS,useMemo:js,useReducer:BS,useRef:TN,useState:go},Symbol.toStringTag,{value:"Module"}),xN="http://www.w3.org/2000/svg";function wN(){let e=r=>Ie.createElementNS(xN,r),t=Ht(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Ht(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 kN({options:e}){let t=js(()=>({__html:wN().outerHTML}),[]);return ie("h2",{class:"dialog__header"},ie("span",{class:"dialog__title"},e.formTitle),e.showBranding?ie("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function ON(e,t){let 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 $f(e,t){let n=e.get(t);return typeof n=="string"?n.trim():""}function MN({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:i,onSubmitError:s,showEmail:a,showName:c,screenshotInput:u}){let{tags:f,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:m,cancelButtonLabel:d,emailLabel:_,emailPlaceholder:g,isEmailRequired:S,isNameRequired:T,messageLabel:A,messagePlaceholder:k,nameLabel:N,namePlaceholder:U,submitButtonLabel:D,isRequiredLabel:y}=e,[O,z]=go(!1),[R,B]=go(null),[L,F]=go(!1),j=u?.input,[ae,se]=go(null),fe=gi(G=>{se(G),F(!1)},[]),x=gi(G=>{let Y=ON(G,{emailLabel:_,isEmailRequired:S,isNameRequired:T,messageLabel:A,nameLabel:N});return Y.length>0?B(`Please enter in the following required fields: ${Y.join(", ")}`):B(null),Y.length===0},[_,S,T,A,N]),Q=gi(async G=>{z(!0);try{if(G.preventDefault(),!(G.target instanceof HTMLFormElement))return;let Y=new FormData(G.target),me=await(u&&L?u.value():void 0),ue={name:$f(Y,"name"),email:$f(Y,"email"),message:$f(Y,"message"),attachments:me?[me]:void 0};if(!x(ue))return;try{let De=await o({name:ue.name,email:ue.email,message:ue.message,source:tN,tags:f},{attachments:ue.attachments});i(ue,De)}catch(De){Zc&&h.error(De);let nt=De instanceof Error?De:new Error(String(De));B(nt.message),s(nt)}}finally{z(!1)}},[u&&L,i,s]);return ie("form",{class:"form",onSubmit:Q},j&&L?ie(j,{onError:fe}):null,ie("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:O},ie("div",{class:"form__top"},R?ie("div",{class:"form__error-container"},R):null,c?ie("label",{for:"name",class:"form__label"},ie(Wf,{label:N,isRequiredLabel:y,isRequired:T}),ie("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:U,required:T,type:"text"})):ie("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?ie("label",{for:"email",class:"form__label"},ie(Wf,{label:_,isRequiredLabel:y,isRequired:S}),ie("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:g,required:S,type:"email"})):ie("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),ie("label",{for:"message",class:"form__label"},ie(Wf,{label:A,isRequiredLabel:y,isRequired:!0}),ie("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:k,required:!0,rows:5})),j?ie("label",{for:"screenshot",class:"form__label"},ie("button",{class:"btn btn--default",disabled:O,type:"button",onClick:()=>{se(null),F(G=>!G)}},L?m:l),ae?ie("div",{class:"form__error-container"},ae.message):null):null),ie("div",{class:"btn-group"},ie("button",{class:"btn btn--primary",disabled:O,type:"submit"},D),ie("button",{class:"btn btn--default",disabled:O,type:"button",onClick:r},d))))}function Wf({label:e,isRequired:t,isRequiredLabel:n}){return ie("span",{class:"form__label__text"},e,t&&ie("span",{class:"form__label__text--required"},n))}var Xc=16,IS=17,LN="http://www.w3.org/2000/svg";function PN(){let e=c=>Tn.document.createElementNS(LN,c),t=Ht(e("svg"),{width:`${Xc}`,height:`${IS}`,viewBox:`0 0 ${Xc} ${IS}`,fill:"inherit"}),n=Ht(e("g"),{clipPath:"url(#clip0_57_156)"}),r=Ht(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=Ht(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 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(o,r);let i=e("defs"),s=Ht(e("clipPath"),{id:"clip0_57_156"}),a=Ht(e("rect"),{width:`${Xc}`,height:`${Xc}`,fill:"white",transform:"translate(0 0.5)"});return s.appendChild(a),i.appendChild(s),t.appendChild(i).appendChild(s).appendChild(a),t}function UN(r){var o=r,{open:e,onFormSubmitted:t}=o,n=qt(o,["open","onFormSubmitted"]);let i=n.options,s=js(()=>({__html:PN().outerHTML}),[]),[a,c]=go(null),u=gi(()=>{a&&(clearTimeout(a),c(null)),t()},[a]),f=gi((l,m)=>{n.onSubmitSuccess(l,m),c(setTimeout(()=>{t(),c(null)},rN))},[t]);return ie(Ws,null,a?ie("div",{class:"success__position",onClick:u},ie("div",{class:"success__content"},i.successMessageText,ie("span",{class:"success__icon",dangerouslySetInnerHTML:s}))):ie("dialog",{class:"dialog",onClick:i.onFormClose,open:e},ie("div",{class:"dialog__position"},ie("div",{class:"dialog__content",onClick:l=>{l.stopPropagation()}},ie(kN,{options:i}),ie(MN,E(p({},n),{onSubmitSuccess:f}))))))}var DN=`
|
|
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
|
+
`,BN=`
|
|
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
|
+
`,FN=`
|
|
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
|
+
`,GN=`
|
|
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
|
+
`,HN=`
|
|
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 $N(e){let t=Ie.createElement("style");return t.textContent=`
|
|
387
|
+
:host {
|
|
388
|
+
--dialog-inset: var(--inset);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
${DN}
|
|
392
|
+
${BN}
|
|
393
|
+
${FN}
|
|
394
|
+
${GN}
|
|
395
|
+
${HN}
|
|
396
|
+
`,e&&t.setAttribute("nonce",e),t}function WN(){let e=M().getUser(),t=ce().getUser(),n=fn().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}var HS=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{let o=r,i=e.useSentryUser,s=WN(),a=Ie.createElement("div"),c=$N(e.styleNonce),u="",f={get el(){return a},appendToDom(){!o.contains(c)&&!o.contains(a)&&(o.appendChild(c),o.appendChild(a))},removeFromDom(){a.remove(),c.remove(),Ie.body.style.overflow=u},open(){m(!0),e.onFormOpen?.(),I()?.emit("openFeedbackWidget"),u=Ie.body.style.overflow,Ie.body.style.overflow="hidden"},close(){m(!1),Ie.body.style.overflow=u}},l=t?.createInput({h:ie,hooks:CN,dialog:f,options:e}),m=d=>{SN(ie(UN,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(i&&s?.[i.name]||""),defaultEmail:String(i&&s?.[i.email]||""),onFormClose:()=>{m(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(_,g)=>{m(!1),e.onSubmitSuccess?.(_,g)},onSubmitError:_=>{e.onSubmitError?.(_)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:d}),a)};return f}});function jN({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 zN(e){let t=Ie.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 qN({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 YN({hooks:e}){function t(){let[n,r]=e.useState(Tn.devicePixelRatio??1);return e.useEffect(()=>{let o=()=>{r(Tn.devicePixelRatio)},i=matchMedia(`(resolution: ${Tn.devicePixelRatio}dppx)`);return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:i,onError:s}){let a=t();e.useEffect(()=>{(async()=>{r();let u=await Hs.mediaDevices.getDisplayMedia({video:{width:Tn.innerWidth*a,height:Tn.innerHeight*a},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),f=Ie.createElement("video");await new Promise((l,m)=>{f.srcObject=u,f.onloadedmetadata=()=>{o(f,a),u.getTracks().forEach(d=>d.stop()),l()},f.play().catch(m)}),i()})().catch(s)},[])}}function VN(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 Or(e,t,n){if(!e)return;let r=e.getContext("2d",t);r&&n(e,r)}function jf(e,t){Or(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function zf(e,t,n){Or(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(i=>{VN(i,o,t)})})}function KN({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){let i=YN({hooks:t}),s=qN({h:e}),a=jN({h:e}),c={__html:zN(o.styleNonce).innerText},u=r.el.style,f=({screenshot:l})=>{let[m,d]=t.useState("highlight"),[_,g]=t.useState([]),S=t.useRef(null),T=t.useRef(null),A=t.useRef(null),k=t.useRef(null),[N,U]=t.useState(1),D=t.useMemo(()=>{let L=Ie.getElementById(o.id);if(!L)return"white";let F=getComputedStyle(L);return F.getPropertyValue("--button-primary-background")||F.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{let L=()=>{let F=S.current;F&&(Or(l.canvas,{alpha:!1},j=>{let ae=Math.min(F.clientWidth/j.width,F.clientHeight/j.height);U(ae)}),(F.clientHeight===0||F.clientWidth===0)&&setTimeout(L,0))};return L(),Tn.addEventListener("resize",L),()=>{Tn.removeEventListener("resize",L)}},[l]);let y=t.useCallback((L,F)=>{Or(L,{alpha:!0},(j,ae)=>{ae.scale(F,F),j.width=l.canvas.width,j.height=l.canvas.height})},[l]);t.useEffect(()=>{y(T.current,l.dpi),jf(T.current,l.canvas)},[l]),t.useEffect(()=>{y(A.current,l.dpi),Or(A.current,{alpha:!0},(L,F)=>{F.clearRect(0,0,L.width,L.height)}),zf(A.current,D,_)},[_,D]),t.useEffect(()=>{y(n,l.dpi),jf(n,l.canvas),Or(Ie.createElement("canvas"),{alpha:!0},(L,F)=>{F.scale(l.dpi,l.dpi),L.width=l.canvas.width,L.height=l.canvas.height,zf(L,D,_),jf(n,L)})},[_,l,D]);let O=L=>{if(!m||!k.current)return;let F=k.current.getBoundingClientRect(),j={type:m,x:L.offsetX/N,y:L.offsetY/N},ae=(x,Q)=>{let G=(Q.clientX-F.x)/N,Y=(Q.clientY-F.y)/N;return{type:x.type,x:Math.min(x.x,G),y:Math.min(x.y,Y),w:Math.abs(G-x.x),h:Math.abs(Y-x.y)}},se=x=>{Or(A.current,{alpha:!0},(Q,G)=>{G.clearRect(0,0,Q.width,Q.height)}),zf(A.current,D,[..._,ae(j,x)])},fe=x=>{let Q=ae(j,x);Q.w*N>=1&&Q.h*N>=1&&g(G=>[...G,Q]),Ie.removeEventListener("mousemove",se),Ie.removeEventListener("mouseup",fe)};Ie.addEventListener("mousemove",se),Ie.addEventListener("mouseup",fe)},z=t.useCallback(L=>F=>{F.preventDefault(),F.stopPropagation(),g(j=>{let ae=[...j];return ae.splice(L,1),ae})},[]),R={width:`${l.canvas.width*N}px`,height:`${l.canvas.height*N}px`},B=L=>{L.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:S},e("canvas",{ref:T,id:"background",style:R}),e("canvas",{ref:A,id:"foreground",style:R}),e("div",{ref:k,onMouseDown:O,style:R},_.map((L,F)=>e("div",{key:F,class:"editor__rect",style:{top:`${L.y*N}px`,left:`${L.x*N}px`,width:`${L.w*N}px`,height:`${L.h*N}px`}},e("button",{"aria-label":o.removeHighlightText,onClick:z(F),onMouseDown:B,onMouseUp:B,type:"button"},e(a,null))))))),e(s,{options:o,action:m,setAction:d}))};return function({onError:m}){let[d,_]=t.useState();return i({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((g,S)=>{Or(Ie.createElement("canvas"),{alpha:!1},(T,A)=>{A.scale(S,S),T.width=g.videoWidth,T.height=g.videoHeight,A.drawImage(g,0,0,T.width,T.height),_({canvas:T,dpi:S})}),n.width=g.videoWidth,n.height=g.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(g=>{u.display="block",m(g)},[])}),d?e(f,{screenshot:d}):e("div",null)}}var $S=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{let o=Ie.createElement("canvas");return{input:KN({h:e,hooks:t,outputBuffer:o,dialog:n,options:r}),value:async()=>{let i=await new Promise(s=>{o.toBlob(s,"image/png")});if(i)return{data:new Uint8Array(await i.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}});var w=C,tp=0;function np(){return tp>0}function JN(){tp++,setTimeout(()=>{tp--})}function Eo(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{let o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(_r(e))return e}catch{return e}let r=function(...o){C._sentryWrappedDepth=(C._sentryWrappedDepth||0)+1;try{let i=o.map(s=>Eo(s,t));return e.apply(this,i)}catch(i){throw JN(),Ke(s=>{s.addEventProcessor(a=>(t.mechanism&&(Yr(a,void 0,void 0),Qe(a,t.mechanism)),a.extra=E(p({},a.extra),{arguments:o}),a)),J(i)}),i}finally{C._sentryWrappedDepth=(C._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Xi(r,e),Ee(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Ti(){let e=ft(),{referrer:t}=w.document||{},{userAgent:n}=w.navigator||{},r=p(p({},t&&{Referer:t}),n&&{"User-Agent":n});return{url:e,headers:r}}var XN=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],QN={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function ZN(e){return QN[e]||e.replace("Integration","").toLowerCase()}var WS=w;async function rp(e,t){let n=XN.includes(e)?ZN(e):void 0,r=WS.Sentry=WS.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);let o=r[e];if(typeof o=="function"&&!("_isShim"in o))return o;let i=eC(n),s=w.document.createElement("script");s.src=i,s.crossOrigin="anonymous",s.referrerPolicy="strict-origin",t&&s.setAttribute("nonce",t);let a=new Promise((l,m)=>{s.addEventListener("load",()=>l()),s.addEventListener("error",m)}),c=w.document.currentScript,u=w.document.body||w.document.head||c?.parentElement;if(u)u.appendChild(s);else throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await a}catch{throw new Error(`Error when loading integration: ${e}`)}let f=r[e];if(typeof f!="function")throw new Error(`Could not load integration: ${e}`);return f}function eC(e){let n=I()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${Pt}/${e}.min.js`,n).toString()}var tC=iu({lazyLoadIntegration:rp});var jS=iu({getModalIntegration:()=>HS,getScreenshotIntegration:()=>$S});function zs(e,t){let n=au(e,t),r={type:sC(t),value:aC(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function nC(e,t,n,r){let i=I()?.getOptions().normalizeDepth,s=lC(t),a={__serialized__:Zi(t,i)};if(s)return{exception:{values:[zs(e,s)]},extra:a};let c={exception:{values:[{type:mr(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:cC(t,{isUnhandledRejection:r})}]},extra:a};if(n){let u=au(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function op(e,t){return{exception:{values:[zs(e,t)]}}}function au(e,t){let n=t.stacktrace||t.stack||"",r=oC(t),o=iC(t);try{return e(n,r,o)}catch{}return[]}var rC=/Minified React error #\d+;/i;function oC(e){return e&&rC.test(e.message)?1:0}function iC(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function zS(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function sC(e){let t=e?.name;return!t&&zS(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function aC(e){let t=e?.message;return zS(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?vc(t.error):vc(e):"No error message"}function sp(e,t,n,r){let o=n?.syntheticException||void 0,i=yi(e,t,o,r);return Qe(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),wn(i)}function ap(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=ip(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),wn(s)}function yi(e,t,n,r,o){let i;if(Uo(t)&&t.error)return op(e,t.error);if(Ki(t)||xa(t)){let s=t;if("stack"in t){i=op(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let c=au(e,n);c.length&&(a.stacktrace={frames:c},Qe(i,{synthetic:!0}))}}else{let a=s.name||(Ki(s)?"DOMError":"DOMException"),c=s.message?`${a}: ${s.message}`:a;i=ip(e,c,n,r),Yr(i,c)}return"code"in s&&(i.tags=E(p({},i.tags),{"DOMException.code":`${s.code}`})),i}return et(t)?op(e,t):Me(t)||mr(t)?(i=nC(e,t,n,o),Qe(i,{synthetic:!0}),i):(i=ip(e,t,n,r),Yr(i,`${t}`,void 0),Qe(i,{synthetic:!0}),i)}function ip(e,t,n,r){let o={};if(r&&n){let i=au(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Qe(o,{synthetic:!0})}if(Rn(t)){let{__sentry_template_string__:i,__sentry_template_values__:s}=t;return o.logentry={message:i,params:s},o}return o.message=t,o}function cC(e,{isUnhandledRejection:t}){let n=ka(e),r=t?"promise rejection":"exception";return Uo(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:mr(e)?`Event \`${uC(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function uC(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function lC(e){return Object.values(e).find(t=>t instanceof Error)}var qs=class extends ks{constructor(t){let n=fC(t),r=w.SENTRY_SDK_SOURCE||cf();ei(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings=p({infer_ip:n.sendDefaultPii?"auto":"never"},n._metadata.sdk.settings)),super(n);let{sendDefaultPii:o,sendClientReports:i,enableLogs:s,_experiments:a,enableMetrics:c}=this._options,u=c??a?.enableMetrics??!0;w.document&&(i||s||u)&&w.document.addEventListener("visibilitychange",()=>{w.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&oo(this),u&&Xo(this))}),o&&this.on("beforeSendSession",bf)}eventFromException(t,n){return sp(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return ap(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 fC(e){return p({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:w.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},e)}var Ze=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var $=C;var pC=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Bn=(e,t,n,r)=>{let o,i;return s=>{t.value>=0&&(s||r)&&(i=t.value-(o??0),(i||o===void 0)&&(o=t.value,t.delta=i,t.rating=pC(t.value,n),e(t)))}};var sr=(e=!0)=>{let t=$.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var en=()=>sr()?.activationStart??0;function tn(e,t,n){$.document&&$.addEventListener(e,t,n)}function To(e,t,n){$.document&&$.removeEventListener(e,t,n)}var Ii=-1,qS=new Set,dC=()=>$.document?.visibilityState==="hidden"&&!$.document?.prerendering?0:1/0,cu=e=>{if(mC(e)&&Ii>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of qS)t();isFinite(Ii)||(Ii=e.type==="visibilitychange"?e.timeStamp:0,To("prerenderingchange",cu,!0))}},Fn=()=>{if($.document&&Ii<0){let e=en();Ii=($.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??dC(),tn("visibilitychange",cu,!0),tn("pagehide",cu,!0),tn("prerenderingchange",cu,!0)}return{get firstHiddenTime(){return Ii},onHidden(e){qS.add(e)}}};function mC(e){return e.type==="pagehide"||$.document?.visibilityState==="hidden"}var YS=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var Gn=(e,t=-1)=>{let n=sr(),r="navigate";return n&&($.document?.prerendering||en()>0?r="prerender":$.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:YS(),navigationType:r}};var cp=new WeakMap;function bi(e,t){try{return cp.get(e)||cp.set(e,new t),cp.get(e)}catch{return new t}}var uu=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;let 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]),this._onAfterProcessingUnexpectedShift?.(t)}};var nn=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe(p({type:e,buffered:!0},n)),r}}catch{}};var Ai=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var Lr=e=>{$.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var _C=[1800,3e3],VS=(e,t={})=>{Lr(()=>{let n=Fn(),r=Gn("FCP"),o,s=nn("paint",a=>{for(let c of a)c.name==="first-contentful-paint"&&(s.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-en(),0),r.entries.push(c),o(!0)))});s&&(o=Bn(e,r,_C,t.reportAllChanges))})};var hC=[.1,.25],KS=(e,t={})=>{VS(Ai(()=>{let n=Gn("CLS",0),r,o=Fn(),i=bi(t,uu),s=c=>{for(let u of c)i._processEntry(u);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=nn("layout-shift",s);a&&(r=Bn(e,n,hC,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),$?.setTimeout?.(r))}))};var JS=0,up=1/0,lu=0,gC=e=>{e.forEach(t=>{t.interactionId&&(up=Math.min(up,t.interactionId),lu=Math.max(lu,t.interactionId),JS=lu?(lu-up)/7+1:0)})},lp,fp=()=>lp?JS:performance.interactionCount||0,XS=()=>{"interactionCount"in performance||lp||(lp=nn("event",gC,{type:"event",buffered:!0,durationThreshold:0}))};var pp=10,QS=0,SC=()=>fp()-QS,fu=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){QS=fp(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(SC()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;let n=this._longestInteractionList.at(-1),r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<pp||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((o,i)=>i._latency-o._latency),this._longestInteractionList.length>pp){let o=this._longestInteractionList.splice(pp);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var pu=e=>{let t=$.requestIdleCallback||$.setTimeout;$.document?.visibilityState==="hidden"?e():(e=Ai(e),tn("visibilitychange",e,{once:!0,capture:!0}),tn("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),To("visibilitychange",e,{capture:!0}),To("pagehide",e,{capture:!0})}))};var EC=[200,500],TC=40,ZS=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=Fn();Lr(()=>{XS();let r=Gn("INP"),o,i=bi(t,fu),s=c=>{pu(()=>{for(let f of c)i._processEntry(f);let u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=nn("event",s,{durationThreshold:t.durationThreshold??TC});o=Bn(e,r,EC,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var du=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var yC=[2500,4e3],eE=(e,t={})=>{Lr(()=>{let n=Fn(),r=Gn("LCP"),o,i=bi(t,du),s=c=>{t.reportAllChanges||(c=c.slice(-1));for(let u of c)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-en(),0),r.entries=[u],o())},a=nn("largest-contentful-paint",s);if(a){o=Bn(e,r,yC,t.reportAllChanges);let c=Ai(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),u=f=>{f.isTrusted&&(pu(c),To(f.type,u,{capture:!0}))};for(let f of["keydown","click","visibilitychange"])tn(f,u,{capture:!0})}})};var IC=[800,1800],dp=e=>{$.document?.prerendering?Lr(()=>dp(e)):$.document?.readyState!=="complete"?addEventListener("load",()=>dp(e),!0):setTimeout(e)},tE=(e,t={})=>{let n=Gn("TTFB"),r=Bn(e,n,IC,t.reportAllChanges);dp(()=>{let o=sr();o&&(n.value=Math.max(o.responseStart-en(),0),n.entries=[o],r(!0))})};var Ys={},mu={},nE,rE,oE,iE;function ar(e,t=!1){return _u("cls",e,bC,nE,t)}function cr(e,t=!1){return _u("lcp",e,AC,rE,t)}function mp(e){return _u("ttfb",e,vC,oE)}function yo(e){return _u("inp",e,RC,iE)}function $t(e,t){return sE(e,t),mu[e]||(NC(e),mu[e]=!0),aE(e,t)}function Vs(e,t){let n=Ys[e];if(n?.length)for(let r of n)try{r(t)}catch(o){Ze&&h.error(`Error while triggering instrumentation handler.
|
|
489
|
+
Type: ${e}
|
|
490
|
+
Name: ${dt(r)}
|
|
491
|
+
Error:`,o)}}function bC(){return KS(e=>{Vs("cls",{metric:e}),nE=e},{reportAllChanges:!0})}function AC(){return eE(e=>{Vs("lcp",{metric:e}),rE=e},{reportAllChanges:!0})}function vC(){return tE(e=>{Vs("ttfb",{metric:e}),oE=e})}function RC(){return ZS(e=>{Vs("inp",{metric:e}),iE=e})}function _u(e,t,n,r,o=!1){sE(e,t);let i;return mu[e]||(i=n(),mu[e]=!0),r&&t({metric:r}),aE(e,t,o?i:void 0)}function NC(e){let t={};e==="event"&&(t.durationThreshold=0),nn(e,n=>{Vs(e,{entries:n})},t)}function sE(e,t){Ys[e]=Ys[e]||[],Ys[e].push(t)}function aE(e,t,n){return()=>{n&&n();let r=Ys[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function cE(e){return"duration"in e}var CC=80;function Te(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],i=0,s=0,a=" > ",c=a.length,u,f=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||CC;for(;n&&i++<r&&(u=xC(n,f),!(u==="html"||i>1&&s+o.length*c+u.length>=l));)o.push(u),s+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function xC(e,t){let n=e,r=[];if(!n?.tagName)return"";if(typeof HTMLElement<"u"&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=t?.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(o?.length)o.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let i=n.className;if(i&&Oe(i)){let s=i.split(/\s+/);for(let a of s)r.push(`.${a}`)}}for(let i of["aria-label","type","name","title","alt"]){let s=n.getAttribute(i);s&&r.push(`[${i}="${s}"]`)}return r.join("")}var uE=e=>{let t=n=>{(n.type==="pagehide"||$.document?.visibilityState==="hidden")&&e(n)};tn("visibilitychange",t,{capture:!0,once:!0}),tn("pagehide",t,{capture:!0,once:!0})};function hu(e){return typeof e=="number"&&isFinite(e)}function ur(e,t,n,o){var r=qt(o,[]);let i=P(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Ir(e,()=>{let s=Le(p({startTime:t},r));return s&&s.end(n),s})}function vi(e){let t=I();if(!t)return;let{name:n,transaction:r,attributes:o,startTime:i}=e,{release:s,environment:a}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),f=t.getIntegrationByName("Replay")?.getReplayId(),l=M(),m=l.getUser(),d=m!==void 0?m.email||m.id||m.ip_address:void 0,_;try{_=l.getScopeData().contexts.profile.profile_id}catch{}let g=p({release:s,environment:a,user:d||void 0,profile_id:_||void 0,replay_id:f||void 0,transaction:r,"user_agent.original":$.navigator?.userAgent,"client.address":c?"{{auto}}":void 0},o);return Le({name:n,attributes:g,startTime:i,experimental:{standalone:!0}})}function yn(){return $.addEventListener&&$.performance}function Se(e){return e/1e3}function lE(e){let t="unknown",n="unknown",r="";for(let 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 Io(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function bo(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}uE(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function fE(e){let t=0,n;if(!Io("layout-shift"))return;let r=ar(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);bo(e,(o,i)=>{wC(t,n,i,o),r()})}function wC(e,t,n,r){Ze&&h.log(`Sending CLS span (${e})`);let o=t?Se((pe()||0)+t.startTime):ne(),i=M().getScopeData().transactionName,s=t?Te(t.sources[0]?.node):"Layout shift",a={[H]:"auto.http.browser.cls",[q]:"ui.webvital.cls",[st]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((u,f)=>{a[`cls.source.${f+1}`]=Te(u.node)});let c=vi({name:s,transaction:i,attributes:a,startTime:o});c&&(c.addEvent("cls",{[pn]:"",[dn]:e}),c.end(o))}var kC=6e4;function Ao(e){return e!=null&&e>0&&e<=kC}function pE(e){let t=0,n;if(!Io("largest-contentful-paint"))return;let r=cr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ao(o.value)||(t=o.value,n=i)},!0);bo(e,(o,i)=>{OC(t,n,i,o),r()})}function OC(e,t,n,r){if(!Ao(e))return;Ze&&h.log(`Sending LCP span (${e})`);let o=Se((pe()||0)+(t?.startTime||0)),i=M().getScopeData().transactionName,s=t?Te(t.element):"Largest contentful paint",a={[H]:"auto.http.browser.lcp",[q]:"ui.webvital.lcp",[st]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Te(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));let c=vi({name:s,transaction:i,attributes:a,startTime:o});c&&(c.addEvent("lcp",{[pn]:"millisecond",[dn]:e}),c.end(o))}function rn(e){return e&&((pe()||performance.timeOrigin)+e)/1e3}function Ks(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=lE(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return pe()||yn()?.timeOrigin?MC(E(p({},t),{"http.request.redirect_start":rn(e.redirectStart),"http.request.redirect_end":rn(e.redirectEnd),"http.request.worker_start":rn(e.workerStart),"http.request.fetch_start":rn(e.fetchStart),"http.request.domain_lookup_start":rn(e.domainLookupStart),"http.request.domain_lookup_end":rn(e.domainLookupEnd),"http.request.connect_start":rn(e.connectStart),"http.request.secure_connection_start":rn(e.secureConnectionStart),"http.request.connection_end":rn(e.connectEnd),"http.request.request_start":rn(e.requestStart),"http.request.response_start":rn(e.responseStart),"http.request.response_end":rn(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0})):t}function MC(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var LC=2147483647,dE=0,Et={},Mt,Su;function _p({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=yn();if(r&&pe()){r.mark&&$.performance.mark("sentry-tracing-init");let o=t?pE(n):t===!1?UC():void 0,i=e?fE(n):e===!1?PC():void 0,s=DC();return()=>{s(),o?.(),i?.()}}return()=>{}}function hp(){$t("longtask",({entries:e})=>{let t=te();if(!t)return;let{op:n,start_timestamp:r}=P(t);for(let o of e){let i=Se(pe()+o.startTime),s=Se(o.duration);n==="navigation"&&r&&i<r||ur(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[H]:"auto.ui.browser.metrics"}})}})}function gp(){new PerformanceObserver(t=>{let n=te();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=Se(pe()+r.startTime),{start_timestamp:i,op:s}=P(n);if(s==="navigation"&&i&&o<i)continue;let a=Se(r.duration),c={[H]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:f,invokerType:l,sourceURL:m,sourceFunctionName:d,sourceCharPosition:_}=u;c["browser.script.invoker"]=f,c["browser.script.invoker_type"]=l,m&&(c["code.filepath"]=m),d&&(c["code.function"]=d),_!==-1&&(c["browser.script.source_char_position"]=_),ur(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function Sp(){$t("event",({entries:e})=>{let t=te();if(t){for(let n of e)if(n.name==="click"){let r=Se(pe()+n.startTime),o=Se(n.duration),i={name:Te(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[H]:"auto.ui.browser.metrics"}},s=kr(n.target);s&&(i.attributes["ui.component_name"]=s),ur(t,r,r+o,i)}}})}function PC(){return ar(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(Et.cls={value:e.value,unit:""},Su=t)},!0)}function UC(){return cr(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Ao(e.value)||(Et.lcp={value:e.value,unit:"millisecond"},Mt=t)},!0)}function DC(){return mp(({metric:e})=>{e.entries[e.entries.length-1]&&(Et.ttfb={value:e.value,unit:"millisecond"})})}function Ep(e,t){let n=yn(),r=pe();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:c}=t,u=Se(r),f=n.getEntries(),{op:l,start_timestamp:m}=P(e);if(f.slice(dE).forEach(d=>{let _=Se(d.startTime),g=Se(Math.max(0,d.duration));if(!(l==="navigation"&&m&&u+_<m))switch(d.entryType){case"navigation":{HC(e,d,u);break}case"mark":case"paint":case"measure":{FC(e,d,_,g,u,i);let S=Fn(),T=d.startTime<S.firstHiddenTime;d.name==="first-paint"&&T&&(Et.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&T&&(Et.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{jC(e,d,d.name,_,g,u,s);break}}}),dE=Math.max(f.length-1,0),zC(e,o),l==="pageload"){if(VC(Et),o){let d=(_,g,S)=>{let T=S??`browser.web_vital.${_}.value`;e.setAttribute(T,g),Ze&&h.log("Setting web vital attribute",{[T]:g},"on pageload span")};["ttfb","fp","fcp"].forEach(_=>{Et[_]&&d(_,Et[_].value)}),Et["ttfb.requestTime"]&&d("ttfb.requestTime",Et["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete Et.cls,c||delete Et.lcp,Object.entries(Et).forEach(([d,_])=>{ms(d,_.value,_.unit)}),qC(e,t);e.setAttribute(o?"browser.performance.time_origin":"performance.timeOrigin",u),e.setAttribute(o?"browser.performance.navigation.activation_start":"performance.activationStart",en())}Mt=void 0,Su=void 0,Et={}}function BC(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function FC(e,t,n,r,o,i){if(BC(t)||["mark","measure"].includes(t.entryType)&&je(t.name,i))return;let s=sr(!1),a=Se(s?s.requestStart:0),c=o+Math.max(n,a),u=o+n,f=u+r,l={[H]:"auto.resource.browser.metrics"};c!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=c),GC(l,t),c<=f&&ur(e,c,f,{name:t.name,op:t.entryType,attributes:l})}function GC(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&We(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(We(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function HC(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{gu(e,t,r,n)}),gu(e,t,"secureConnection",n,"TLS/SSL"),gu(e,t,"fetch",n,"cache"),gu(e,t,"domainLookup",n,"DNS"),WC(e,t,n)}function gu(e,t,n,r,o=n){let i=$C(n),s=t[i],a=t[`${n}Start`];!a||!s||ur(e,r+Se(a),r+Se(s),{op:`browser.${o}`,name:t.name,attributes:p({[H]:"auto.ui.browser.metrics"},n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{})})}function $C(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function WC(e,t,n){let r=n+Se(t.requestStart),o=n+Se(t.responseEnd),i=n+Se(t.responseStart);t.responseEnd&&(ur(e,r,o,{op:"browser.request",name:t.name,attributes:{[H]:"auto.ui.browser.metrics"}}),ur(e,i,o,{op:"browser.response",name:t.name,attributes:{[H]:"auto.ui.browser.metrics"}}))}function jC(e,t,n,r,o,i,s){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(s?.includes(a))return;let c={[H]:"auto.resource.browser.metrics"},u=Ct(n);u.protocol&&(c["url.scheme"]=u.protocol.split(":").pop()),u.host&&(c["server.address"]=u.host),c["url.same_origin"]=n.includes($.location.origin),YC(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"]]);let f=p(p({},c),Ks(t)),l=i+r,m=l+o;ur(e,l,m,{name:n.replace($.location.origin,""),op:a,attributes:f})}function zC(e,t){let n=$.navigator;if(!n)return;let 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),hu(r.rtt)&&(Et["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),hu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),hu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function qC(e,t){Mt&&t.recordLcpOnPageloadSpan&&(Mt.element&&e.setAttribute("lcp.element",Te(Mt.element)),Mt.id&&e.setAttribute("lcp.id",Mt.id),Mt.url&&e.setAttribute("lcp.url",Mt.url.trim().slice(0,200)),Mt.loadTime!=null&&e.setAttribute("lcp.loadTime",Mt.loadTime),Mt.renderTime!=null&&e.setAttribute("lcp.renderTime",Mt.renderTime),e.setAttribute("lcp.size",Mt.size)),Su?.sources&&t.recordClsOnPageloadSpan&&Su.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Te(n.node)))}function YC(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<LC||typeof i=="string")&&(t[o]=i)})}function VC(e){let t=sr(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var KC="ElementTiming",JC=()=>({name:KC,setup(){!yn()||!pe()||$t("element",({entries:t})=>{for(let n of t){let r=n;if(!r.identifier)continue;let o=r.identifier,i=r.name,s=r.renderTime,a=r.loadTime,c={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":o};i&&(c["ui.element.paint_type"]=i),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),s>0&&lo.distribution("ui.element.render_time",s,{unit:"millisecond",attributes:c}),a>0&&lo.distribution("ui.element.load_time",a,{unit:"millisecond",attributes:c})}})}}),mE=JC;var Tp=[],Js=new Map,Ri=new Map,yp=60;function Ip(){if(yn()&&pe()){let t=XC();return()=>{t()}}return()=>{}}var Ni={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 XC(){return yo(QC)}var QC=({metric:e})=>{if(e.value==null)return;let t=Se(e.value);if(t>yp)return;let n=e.entries.find(_=>_.duration===e.value&&Ni[_.name]);if(!n)return;let{interactionId:r}=n,o=Ni[n.name],i=Se(pe()+n.startTime),s=te(),a=s?re(s):void 0,c=r!=null?Js.get(r):void 0,u=c?.span||a,f=u?P(u).description:M().getScopeData().transactionName,l=c?.elementName||Te(n.target),m={[H]:"auto.http.browser.inp",[q]:`ui.interaction.${o}`,[st]:n.duration},d=vi({name:l,transaction:f,attributes:m,startTime:i});d&&(d.addEvent("inp",{[pn]:"millisecond",[dn]:e.value}),d.end(i+t))};function _E(e){return e!=null?Js.get(e):void 0}function bp(){let e=Object.keys(Ni);ut()&&e.forEach(o=>{$.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Te(i),a=Math.round(o.timeStamp);if(Ri.set(a,s),Ri.size>50){let c=Ri.keys().next().value;c!==void 0&&Ri.delete(c)}}function n(o){let i=Math.round(o.startTime),s=Ri.get(i);if(!s)for(let a=-5;a<=5;a++){let c=Ri.get(i+a);if(c){s=c;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=te(),s=i&&re(i);o.forEach(a=>{if(!cE(a))return;let c=a.interactionId;if(c==null||Js.has(c))return;let u=a.target?Te(a.target):n(a);if(Tp.length>10){let f=Tp.shift();Js.delete(f)}Tp.push(c),Js.set(c,{span:s,elementName:u})})};$t("event",r),$t("first-input",r)}function Ap(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:c,startTime:u,endTime:f}=e,l=M().getScopeData().transactionName,m=p({[H]:r,[q]:n,[st]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":l,"user_agent.original":$.navigator?.userAgent},s);a&&Er(a).attributes?.[q]==="pageload"&&(m["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(m[`browser.web_vital.${o}.report_event`]=c);let d=Le({name:t,attributes:m,startTime:u,parentSpan:a});d&&d.end(f??u)}function vp(e){let t=0,n;if(!Io("largest-contentful-paint"))return;let r=cr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ao(o.value)||(t=o.value,n=i)},!0);bo(e,(o,i,s)=>{ZC(t,n,s,o),r()})}function ZC(e,t,n,r){if(!Ao(e))return;Ze&&h.log(`Sending LCP span (${e})`);let o=pe()||0,i=Se(o),s=Se(o+(t?.startTime||0)),a=t?Te(t.element):"Largest contentful paint",c={};t?.element&&(c["browser.web_vital.lcp.element"]=Te(t.element)),t?.id&&(c["browser.web_vital.lcp.id"]=t.id),t?.url&&(c["browser.web_vital.lcp.url"]=t.url),t?.loadTime!=null&&(c["browser.web_vital.lcp.load_time"]=t.loadTime),t?.renderTime!=null&&(c["browser.web_vital.lcp.render_time"]=t.renderTime),t?.size!=null&&(c["browser.web_vital.lcp.size"]=t.size),Ap({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:i,endTime:s})}function Rp(e){let t=0,n;if(!Io("layout-shift"))return;let r=ar(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);bo(e,(o,i,s)=>{ex(t,n,s,o),r()})}function ex(e,t,n,r){Ze&&h.log(`Sending CLS span (${e})`);let o=t?Se((pe()||0)+t.startTime):ne(),i=t?Te(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,c)=>{s[`browser.web_vital.cls.source.${c+1}`]=Te(a.node)}),Ap({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function Np(){if(!yn()||!pe())return;yo(({metric:n})=>{if(n.value==null||Se(n.value)>yp)return;let o=n.entries.find(i=>i.duration===n.value&&Ni[i.name]);o&&tx(n.value,o)})}function tx(e,t){Ze&&h.log(`Sending INP span (${e})`);let n=Se(pe()+t.startTime),r=Se(e),o=Ni[t.name],i=_E(t.interactionId),s=te(),a=s?re(s):void 0,c=i?.span||a,u=c?Er(c).name:M().getScopeData().transactionName,f=i?.elementName||Te(t.target);Ap({name:f,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[st]:t.duration,"sentry.transaction":u},startTime:n,endTime:n+r,parentSpan:c})}var nx=1e3,hE,Cp,xp;function Xs(e){rt("dom",e),ot("dom",rx)}function rx(){if(!$.document)return;let e=$e.bind(null,"dom"),t=gE(e,!0);$.document.addEventListener("click",t,!1),$.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=$[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(ye(o,"addEventListener",function(i){return function(s,a,c){if(s==="click"||s=="keypress")try{let u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=u[s]=u[s]||{refCount:0};if(!f.handler){let l=gE(e);f.handler=l,i.call(this,s,l,c)}f.refCount++}catch{}return i.call(this,s,a,c)}}),ye(o,"removeEventListener",function(i){return function(s,a,c){if(s==="click"||s=="keypress")try{let u=this.__sentry_instrumentation_handlers__||{},f=u[s];f&&(f.refCount--,f.refCount<=0&&(i.call(this,s,f.handler,c),f.handler=void 0,delete u[s]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,c)}}))})}function ox(e){if(e.type!==Cp)return!1;try{if(!e.target||e.target._sentryId!==xp)return!1}catch{}return!0}function ix(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function gE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=sx(n);if(ix(n.type,r))return;Ee(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ee(r,"_sentryId",ge());let o=n.type==="keypress"?"input":n.type;ox(n)||(e({event:n,name:o,global:t}),Cp=n.type,xp=r?r._sentryId:void 0),clearTimeout(hE),hE=$.setTimeout(()=>{xp=void 0,Cp=void 0},nx)}}function sx(e){try{return e.target}catch{return null}}var Eu;function lr(e){let t="history";rt(t,e),ot(t,ax)}function ax(){if($.addEventListener("popstate",()=>{let t=$.location.href,n=Eu;if(Eu=t,n===t)return;$e("history",{from:n,to:t})}),!zc())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=Eu,i=cx(String(r));if(Eu=i,o===i)return t.apply(this,n);$e("history",{from:o,to:i})}return t.apply(this,n)}}ye($.history,"pushState",e),ye($.history,"replaceState",e)}function cx(e){try{return new URL(e,$.location.origin).toString()}catch{return e}}var Tu={};function Ci(e){let t=Tu[e];if(t)return t;let n=$[e];if(mi(n))return Tu[e]=n.bind($);let r=$.document;if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let i=o.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(o)}catch(o){Ze&&h.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Tu[e]=n.bind($))}function wp(e){Tu[e]=void 0}function vo(...e){return Ci("setTimeout")(...e)}var Tt="__sentry_xhr_v3__";function Ro(e){rt("xhr",e),ot("xhr",ux)}function ux(){if(!$.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=ne()*1e3,s=Oe(r[0])?r[0].toUpperCase():void 0,a=lx(r[1]);if(!s||!a)return t.apply(n,r);n[Tt]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let c=()=>{let u=n[Tt];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}let f={endTimestamp:ne()*1e3,startTimestamp:i,xhr:n,virtualError:o};$e("xhr",f)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,f,l){return c(),u.apply(f,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,f,l){let[m,d]=l,_=f[Tt];return _&&Oe(m)&&Oe(d)&&(_.request_headers[m.toLowerCase()]=d),u.apply(f,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[Tt];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:ne()*1e3,xhr:n};return $e("xhr",i),t.apply(n,r)}})}function lx(e){if(Oe(e))return e;try{return e.toString()}catch{}}var fx=Symbol.for("sentry__originalRequestBody");function yu(e){return new URLSearchParams(e).toString()}function No(e,t=h){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[yu(e)];if(!e)return[void 0]}catch(n){return Ze&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Ze&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function xi(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){let n=e[0][fx];return n!==void 0?n:void 0}}function Qs(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Ze&&h.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
492
|
+
`).reduce((n,r)=>{let[o,i]=r.split(": ");return i&&(n[o.toLowerCase()]=i),n},{}):{}}function kp(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var px=40;function Zs(e,t=Ci("fetch")){let n=0,r=0;async function o(i){let s=i.body.length;n+=s,r++;let a=p({body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);try{let c=await 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 wp("fetch"),c}finally{n-=s,r--}}return Tc(e,o,io(e.bufferSize||px))}var v=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function dx(){let e=I();if(!e){v&&h.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){v&&h.warn("BrowserProfiling integration is not available");return}e.emit("startUIProfiler")}function mx(){let e=I();if(!e){v&&h.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){v&&h.warn("ProfilingIntegration is not available");return}e.emit("stopUIProfiler")}var _x={startProfiler:dx,stopProfiler:mx};var hx=10,gx=20,Sx=30,Ex=40,Tx=50;function wi(e,t,n,r){let o={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var yx=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ix=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bx=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ax=/at (.+?) ?\(data:(.+?),/,vx=e=>{let t=e.match(Ax);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=yx.exec(e);if(n){let[,o,i,s]=n;return wi(o,"?",+i,+s)}let r=Ix.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=bx.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=yE(r[1]||"?",r[2]);return wi(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},SE=[Sx,vx],Rx=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Nx=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cx=e=>{let t=Rx.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=Nx.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],o=t[1]||"?";return[o,r]=yE(o,r),wi(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},EE=[Tx,Cx],xx=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,wx=e=>{let t=xx.exec(e);return t?wi(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0},kx=[Ex,wx],Ox=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Mx=e=>{let t=Ox.exec(e);return t?wi(t[2],t[3]||"?",+t[1]):void 0},Lx=[hx,Mx],Px=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,Ux=e=>{let t=Px.exec(e);return t?wi(t[5],t[3]||t[4]||"?",+t[1],+t[2]):void 0},Dx=[gx,Ux],TE=[SE,EE],Op=zi(...TE),yE=(e,t)=>{let n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function Bx(e,{metadata:t,tunnel:n,dsn:r}){let o=p(p({event_id:e.event_id,sent_at:new Date().toISOString()},t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!n&&!!r&&{dsn:ze(r)}),i=Fx(e);return ke(o,[i])}function Fx(e){return[{type:"user_report"},e]}var Iu=1024,Gx="Breadcrumbs",Hx=(e={})=>{let t=p({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:Gx,setup(n){t.console&&co(jx(n)),t.dom&&Xs(Wx(n,t.dom)),t.xhr&&Ro(zx(n)),t.fetch&&Dn(qx(n)),t.history&&lr(Yx(n)),t.sentry&&n.on("beforeSendEvent",$x(n))}}},ea=Hx;function $x(e){return function(n){I()===e&&St({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:un(n)},{event:n})}}function Wx(e,t){return function(r){if(I()!==e)return;let o,i,s=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Iu&&(v&&h.warn(`\`dom.maxStringLength\` cannot exceed ${Iu}, but a value of ${a} was configured. Sentry will use ${Iu} instead.`),a=Iu),typeof s=="string"&&(s=[s]);try{let u=r.event,f=Vx(u)?u.target:u;o=Te(f,{keyAttrs:s,maxStringLength:a}),i=kr(f)}catch{o="<unknown>"}if(o.length===0)return;let c={category:`ui.${r.name}`,message:o};i&&(c.data={"ui.component_name":i}),St(c,{event:r.event,name:r.name,global:r.global})}}function jx(e){return function(n){if(I()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:rr(n.level),message:hr(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${hr(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;St(r,{input:n.args,level:n.level})}}function zx(e){return function(n){if(I()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[Tt];if(!r||!o||!i)return;let{method:s,url:a,status_code:c,body:u}=i,f={method:s,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},m={category:"xhr",data:f,type:"http",level:jc(c)};e.emit("beforeOutgoingRequestBreadcrumb",m,l),St(m,l)}}function qx(e){return function(n){if(I()!==e)return;let{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){let i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},s={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",s,i),St(s,i)}else{let i=n.response,s=E(p({},n.fetchData),{status_code:i?.status}),a={input:n.args,response:i,startTimestamp:r,endTimestamp:o},c={category:"fetch",data:s,type:"http",level:jc(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),St(c,a)}}}function Yx(e){return function(n){if(I()!==e)return;let r=n.from,o=n.to,i=Ct(w.location.href),s=r?Ct(r):void 0,a=Ct(o);s?.path||(s=i),i.protocol===a.protocol&&i.host===a.host&&(o=a.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),St({category:"navigation",data:{from:r,to:o}})}}function Vx(e){return!!e&&!!e.target}var Kx="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),Jx="BrowserApiErrors",Xx=(e={})=>{let t=p({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},e);return{name:Jx,setupOnce(){t.setTimeout&&ye(w,"setTimeout",IE),t.setInterval&&ye(w,"setInterval",IE),t.requestAnimationFrame&&ye(w,"requestAnimationFrame",Qx),t.XMLHttpRequest&&"XMLHttpRequest"in w&&ye(XMLHttpRequest.prototype,"send",Zx);let n=t.eventTarget;n&&(Array.isArray(n)?n:Kx).forEach(o=>e0(o,t))}}},Mp=Xx;function IE(e){return function(...t){let n=t[0];return t[0]=Eo(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${dt(e)}`}}),e.apply(this,t)}}function Qx(e){return function(t){return e.apply(this,[Eo(t,{mechanism:{data:{handler:dt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Zx(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&ye(n,o,function(i){let s={mechanism:{data:{handler:dt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=_r(i);return a&&(s.mechanism.data.handler=dt(a)),Eo(i,s)})}),e.apply(this,t)}}function e0(e,t){let r=w[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(ye(r,"addEventListener",function(o){return function(i,s,a){try{t0(s)&&(s.handleEvent=Eo(s.handleEvent,{mechanism:{data:{handler:dt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&n0(this,i,s),o.apply(this,[i,Eo(s,{mechanism:{data:{handler:dt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),ye(r,"removeEventListener",function(o){return function(i,s,a){try{let c=s.__sentry_wrapped__;c&&o.call(this,i,c,a)}catch{}return o.call(this,i,s,a)}}))}function t0(e){return typeof e.handleEvent=="function"}function n0(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var ta=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof w.document>"u"){v&&h.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Ko({ignoreDuration:!0}),ro();let n=ce(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(ro(),r=i)}),t==="route"&&lr(({from:o,to:i})=>{o!==i&&(Ko({ignoreDuration:!0}),ro())})}}};var r0="CultureContext",o0=()=>({name:r0,preprocessEvent(e){let t=bE();t&&(e.contexts=E(p({},e.contexts),{culture:p(p({},t),e.contexts?.culture)}))},processSegmentSpan(e){let t=bE();t&&Ye(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}}),na=o0;function bE(){try{let e=w.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var i0="GlobalHandlers",s0=(e={})=>{let t=p({onerror:!0,onunhandledrejection:!0},e);return{name:i0,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(a0(n),AE("onerror")),t.onunhandledrejection&&(c0(n),AE("onunhandledrejection"))}}},ra=s0;function a0(e){Yi(t=>{let{stackParser:n,attachStacktrace:r}=vE();if(I()!==e||np())return;let{msg:o,url:i,line:s,column:a,error:c}=t,u=u0(yi(n,c||o,void 0,r,!1),i,s,a);u.level="error",hn(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function c0(e){Vi(t=>{let{stackParser:n,attachStacktrace:r}=vE();if(I()!==e||np())return;let o=Lp(t),i=We(o)?Pp(o):yi(n,o,void 0,r,!0);i.level="error",hn(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Lp(e){if(We(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function Pp(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function u0(e,t,n,r){let o=e.exception=e.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:l0(t)??ft(),function:"?",in_app:!0}),e}function AE(e){v&&h.log(`Global Handler attached: ${e}`)}function vE(){return I()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function l0(e){if(!(!Oe(e)||e.length===0))return e.startsWith("data:")?`<${ct(e,!1)}>`:e}var oa=()=>({name:"HttpContext",preprocessEvent(e){if(!w.navigator&&!w.location&&!w.document)return;let t=Ti(),n=p(p({},t.headers),e.request?.headers);e.request=E(p(p({},t),e.request),{headers:n})},processSegmentSpan(e){if(!w.navigator&&!w.location&&!w.document)return;let t=Ti();Ye(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}});var f0="cause",p0=5,d0="LinkedErrors",m0=(e={})=>{let t=e.limit||p0,n=e.key||f0;return{name:d0,preprocessEvent(r,o,i){let s=i.getOptions();Rf(zs,s.stackParser,n,t,r,o)}}},ia=m0;var _0=/^HTML(\w*)Element$/;function Up(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(kp(e)){let t=h0(e);if(_0.test(t))return`[HTMLElement: ${Te(e)}]`}}function h0(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function RE(){return g0()?(v&&Fe(()=>{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 g0(){if(typeof w.window>"u")return!1;let e=w;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=ft();return!(w===w.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function NE(e){return[ao(),so(),ni(),Mp(),ea(),ra(),ia(),uo(),oa(),na(),ta()]}function Dp(e={}){let t=!e.skipBrowserExtensionCheck&&RE(),n=e.defaultIntegrations==null?NE():e.defaultIntegrations,r=E(p({},e),{enabled:t?!1:e.enabled,stackParser:Ca(e.stackParser||Op),integrations:hc({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Zs});return Oa(Up),hf(qs,r)}function S0(){}function E0(e){e()}function bu(e={}){let t=w.document,n=t?.head||t?.body;if(!n){v&&h.error("[showReportDialog] Global document not defined");return}let r=M(),i=I()?.getDsn();if(!i){v&&h.error("[showReportDialog] DSN not configured");return}let s=E(p({},e),{user:p(p({},r.getUser()),e.user),eventId:e.eventId||bs()}),a=w.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=tf(i,s);let{onLoad:c,onClose:u}=s;if(c&&(a.onload=c),u){let f=l=>{if(l.data==="__sentry_reportdialog_closed__")try{u()}finally{w.removeEventListener("message",f)}};w.addEventListener("message",f)}n.appendChild(a)}var T0=C,y0="ReportingObserver",CE=new WeakMap,I0=(e={})=>{let t=e.types||["crash","deprecation","intervention"];function n(r){if(CE.has(I()))for(let o of r)Ke(i=>{i.setExtra("url",o.url);let s=`ReportingObserver [${o.type}]`,a="No details available";if(o.body){let c={};for(let u in o.body)c[u]=o.body[u];if(i.setExtra("body",c),o.type==="crash"){let u=o.body;a=[u.crashId||"",u.reason||""].join(" ").trim()||a}else a=o.body.message||a}Is(`${s}: ${a}`)})}return{name:y0,setupOnce(){if(!qc())return;new T0.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){CE.set(r,!0)}}},b0=I0;var A0="HttpClient",v0=(e={})=>{let t=p({failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/]},e);return{name:A0,setup(n){L0(n,t),P0(n,t)}}},R0=v0;function N0(e,t,n,r,o){if(kE(e,n.status,n.url)){let i=U0(t,r),s,a,c,u;ME()&&([s,c]=xE("Cookie",i),[a,u]=xE("Set-Cookie",n));let f=OE({url:i.url,method:i.method,status:n.status,requestHeaders:s,responseHeaders:a,requestCookies:c,responseCookies:u,error:o,type:"fetch"});hn(f)}}function xE(e,t){let n=w0(t.headers),r;try{let o=n[e]||n[e.toLowerCase()]||void 0;o&&(r=wE(o))}catch{}return[n,r]}function C0(e,t,n,r,o){if(kE(e,t.status,t.responseURL)){let i,s,a;if(ME()){try{let u=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;u&&(s=wE(u))}catch{}try{a=k0(t)}catch{}i=r}let c=OE({url:t.responseURL,method:n,status:t.status,requestHeaders:i,responseHeaders:a,responseCookies:s,error:o,type:"xhr"});hn(c)}}function x0(e){if(e){let t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function wE(e){return e.split("; ").reduce((t,n)=>{let[r,o]=n.split("=");return r&&o&&(t[r]=o),t},{})}function w0(e){let t={};return e.forEach((n,r)=>{t[r]=n}),t}function k0(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
|
|
493
|
+
`).reduce((n,r)=>{let[o,i]=r.split(": ");return o&&i&&(n[o]=i),n},{}):{}}function O0(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function M0(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function L0(e,t){_i()&&Dn(n=>{if(I()!==e)return;let{response:r,args:o,error:i,virtualError:s}=n,[a,c]=o;r&&N0(t,a,r,c,i||s)},!1)}function P0(e,t){"XMLHttpRequest"in C&&Ro(n=>{if(I()!==e)return;let{error:r,virtualError:o}=n,i=n.xhr,s=i[Tt];if(!s)return;let{method:a,request_headers:c}=s;try{C0(t,i,a,c,r||o)}catch(u){v&&h.warn("Error while extracting response event form XHR response",u)}})}function kE(e,t,n){return M0(e.failedRequestStatusCodes,t)&&O0(e.failedRequestTargets,n)&&!Zo(n,I())}function OE(e){let t=I(),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}`,i={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:x0(e.responseHeaders)}}};return Qe(i,{type:`auto.http.client.${e.type}`,handled:!1}),i}function U0(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function ME(){let e=I();return e?!!e.getOptions().sendDefaultPii:!1}var Bp=C,D0=7,B0="ContextLines",F0=(e={})=>{let t=e.frameContextLines!=null?e.frameContextLines:D0;return{name:B0,processEvent(n){return H0(n,t)}}},G0=F0;function H0(e,t){let n=Bp.document,r=Bp.location&&_n(Bp.location.href);if(!n||!r)return e;let o=e.exception?.values;if(!o?.length)return e;let i=n.documentElement.innerHTML;if(!i)return e;let s=["<!DOCTYPE html>","<html>",...i.split(`
|
|
494
|
+
`),"</html>"];return o.forEach(a=>{let c=a.stacktrace;c?.frames&&(c.frames=c.frames.map(u=>$0(u,s,r,t)))}),e}function $0(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||Ma(t,e,r),e}var W0="GraphQLClient",j0=e=>({name:W0,setup(t){z0(t,e),q0(t,e)}});function z0(e,t){e.on("beforeOutgoingRequestSpan",(n,r)=>{let i=P(n).data||{};if(!(i[q]==="http.client"))return;let c=i[Ka]||i["http.url"]||i.url,u=i[Va]||i["http.method"];if(!Oe(c)||!Oe(u))return;let{endpoints:f}=t,l=je(c,f),m=PE(r);if(l&&m){let d=UE(m);if(d){let _=LE(d);n.updateName(`${u} ${c} (${_})`),vu(d)&&n.setAttribute("graphql.document",d.query),Ru(d)&&(n.setAttribute("graphql.persisted_query.hash.sha256",d.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",d.extensions.persistedQuery.version))}}})}function q0(e,t){e.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{let{category:o,type:i,data:s}=n;if(i==="http"&&(o==="fetch"||o==="xhr")){let f=s?.url,{endpoints:l}=t,m=je(f,l),d=PE(r);if(m&&s&&d){let _=UE(d);if(!s.graphql&&_){let g=LE(_);s["graphql.operation"]=g,vu(_)&&(s["graphql.document"]=_.query),Ru(_)&&(s["graphql.persisted_query.hash.sha256"]=_.extensions.persistedQuery.sha256Hash,s["graphql.persisted_query.version"]=_.extensions.persistedQuery.version)}}}})}function LE(e){if(Ru(e))return`persisted ${e.operationName}`;if(vu(e)){let{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=Y0(t);return r?`${o} ${r}`:`${o}`}return"unknown"}function PE(e){let t="xhr"in e,n;if(t){let r=e.xhr[Tt];n=r&&No(r.body)[0]}else{let r=xi(e.input);n=No(r)[0]}return n}function Y0(e){let 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]};let o=e.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function Au(e){return typeof e=="object"&&e!==null}function vu(e){return Au(e)&&typeof e.query=="string"}function Ru(e){return Au(e)&&typeof e.operationName=="string"&&Au(e.extensions)&&Au(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash=="string"&&typeof e.extensions.persistedQuery.version=="number"}function UE(e){try{let t=JSON.parse(e);return vu(t)||Ru(t)?t:void 0}catch{return}}var V0=j0;var K0=(e={})=>{let t=["script"];function n(r,o,i=0){if(!r)return;let s="shadowRoot"in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let a of s){if(!(a instanceof HTMLElement))continue;let c=kr(a,1)||void 0,u=a.tagName.toLowerCase();if(t.includes(u))continue;let f=e.onElement?.({element:a,componentName:c,tagName:u,depth:i})||{};if(f==="skip")continue;if(f==="children"){n(a,o,i+1);continue}let{x:l,y:m,width:d,height:_}=a.getBoundingClientRect(),g=p({identifier:a.id||void 0,type:c||u,visible:!0,alpha:1,height:_,width:d,x:l,y:m},f),S=[];g.children=S,n(a,g.children,i+1),o.push(g)}}return{name:"ViewHierarchy",processEvent:(r,o)=>{if(r.type!==void 0||e.shouldAttach?.(r,o)===!1)return r;let i={rendering_system:"DOM",positioning:"absolute",windows:[]};n(e.rootElement?.()||w.document.body,i.windows);let s={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(i)};return o.attachments=o.attachments||[],o.attachments.push(s),r}}};var Ne=C,md="sentryReplaySession",J0="replay_event",_d="Unable to send Replay",X0=3e5,Q0=9e5,Z0=5e3,ew=5500,tw=6e4,nw=5e3,rw=3,DE=15e4,Nu=5e3,ow=3e3,iw=300,hd=2e7,sw=4999,aw=5e4,BE=36e5,cw=Object.defineProperty,uw=(e,t,n)=>t in e?cw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FE=(e,t,n)=>uw(e,typeof t!="symbol"?t+"":t,n),Ve=(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))(Ve||{});function lw(e){return e.nodeType===e.ELEMENT_NODE}function ca(e){return e?.host?.shadowRoot===e}function ua(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function fw(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 pw(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let 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 Ou(e){try{let t=e.rules||e.cssRules;return t?fw(Array.from(t,uT).join("")):null}catch{return null}}function dw(e){let t="";for(let n=0;n<e.style.length;n++){let r=e.style,o=r[n],i=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function uT(e){let t;if(_w(e))try{t=Ou(e.styleSheet)||pw(e)}catch{}else if(hw(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=dw(e)),r&&(n=mw(n)),r||o)return n}return t||e.cssText}function mw(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function _w(e){return"styleSheet"in e}function hw(e){return"selectorText"in e}var Mu=class{constructor(){FE(this,"idNodeMap",new Map),FE(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-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){let 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){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let 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 gw(){return new Mu}function Yu({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 fa({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Bi(e){return e.toLowerCase()}function jp(e){return e.toUpperCase()}var GE="__rrweb_original__";function Sw(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){let i=t.getImageData,s=GE in i?i[GE]:i;if(new Uint32Array(s.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 gd(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Bi(t):null}function Lu(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function lT(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}var HE={};function fT(e){let t=HE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return HE[e]=r.bind(window)}function zp(...e){return fT("setTimeout")(...e)}function pT(...e){return fT("clearTimeout")(...e)}function dT(e){try{return e.contentDocument}catch{}}function Ew(e){try{return e.contentWindow}catch{}}var Tw=1,yw=new RegExp("[^a-z0-9-_:]"),pa=-2;function Sd(){return Tw++}function Iw(e){if(e instanceof HTMLFormElement)return"form";let t=Bi(e.tagName);return yw.test(t)?"div":t}function bw(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ki,$E,Aw=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,vw=/^(?:[a-z+]+:)?\/\//i,Rw=/^www\..*/i,Nw=/^(data:)([^,]*),(.*)/i;function Cw(e,t){if(!e||t.size===0)return e;try{let n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;let i=o.indexOf(":");if(i===-1){r.push(o);continue}let s=o.slice(0,i).trim();t.has(s)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Pu(e,t){return(e||"").replace(Aw,(n,r,o,i,s,a)=>{let c=o||s||a,u=r||i||"";if(!c)return n;if(vw.test(c)||Rw.test(c))return`url(${u}${c}${u})`;if(Nw.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${bw(t)+c}${u})`;let f=t.split("/"),l=c.split("/");f.pop();for(let m of l)m!=="."&&(m===".."?f.pop():f.push(m));return`url(${u}${f.join("/")}${u})`})}var xw=/^[^ \t\n\r\u000c]+/,ww=/^[, \t\n\r\u000c]+/;function kw(e,t){if(t.trim()==="")return t;let n=0;function r(i){let s,a=i.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let o=[];for(;r(ww),!(n>=t.length);){let i=r(xw);if(i.slice(-1)===",")i=Li(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=Li(e,i);let a=!1;for(;;){let c=t.charAt(n);if(c===""){o.push((i+s).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,o.push((i+s).trim());break}else c==="("&&(a=!0);s+=c,n+=1}}}return o.join(", ")}var WE=new WeakMap;function Li(e,t){return!t||t.trim()===""?t:Vu(e,t)}function Ow(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Vu(e,t){let n=WE.get(e);if(n||(n=e.createElement("a"),WE.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function mT(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Li(e,r);if(n==="xlink:href"&&r[0]!=="#")return Li(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Li(e,r);if(n==="srcset")return kw(e,r);if(n==="style"){let a=Pu(r,Vu(e));return s&&s.size>0&&(a=Cw(a,s)),a}else if(t==="object"&&n==="data")return Li(e,r);return typeof i=="function"?i(n,r,o):r}function _T(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function Mw(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--;){let i=e.classList[o];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function Lw(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function Co(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Co(e.parentNode,t,n,r+1)}function Pi(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(Lw(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Fi(e,t,n,r,o,i){try{let s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(s===null)return!1;if(s.tagName==="INPUT"){let u=s.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(i){if(c=Co(s,Pi(r,o)),c<0)return!0;a=Co(s,Pi(t,n),c>=0?c:1/0)}else{if(a=Co(s,Pi(t,n)),a<0)return!1;c=Co(s,Pi(r,o),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!i}catch{}return!!i}function Pw(e,t,n){let r=Ew(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=zp(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{pT(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return zp(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Uw(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=zp(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{pT(i),r=!0,t()})}function Dw(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:l,unmaskTextSelector:m,inlineStylesheet:d,maskInputOptions:_={},maskTextFn:g,maskInputFn:S,dataURLOptions:T={},inlineImages:A,recordCanvas:k,keepIframeSrcFn:N,newlyAddedElement:U=!1,ignoreCSSAttributes:D}=t,y=Bw(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ve.Document,childNodes:[],compatMode:e.compatMode}:{type:Ve.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ve.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return Gw(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:d,maskAttributeFn:c,maskInputOptions:_,maskInputFn:S,dataURLOptions:T,inlineImages:A,recordCanvas:k,keepIframeSrcFn:N,newlyAddedElement:U,rootId:y,maskTextClass:u,unmaskTextClass:f,maskTextSelector:l,unmaskTextSelector:m,ignoreCSSAttributes:D});case e.TEXT_NODE:return Fw(e,{doc:n,maskAllText:a,maskTextClass:u,unmaskTextClass:f,maskTextSelector:l,unmaskTextSelector:m,maskTextFn:g,maskInputOptions:_,maskInputFn:S,rootId:y});case e.CDATA_SECTION_NODE:return{type:Ve.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Ve.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function Bw(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function Fw(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:f}=t,l=e.parentNode&&e.parentNode.tagName,m=e.textContent,d=l==="STYLE"?!0:void 0,_=l==="SCRIPT"?!0:void 0,g=l==="TEXTAREA"?!0:void 0;if(d&&m){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(m=Ou(e.parentNode.sheet))}catch(T){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${T}`,e)}m=Pu(m,Vu(t.doc))}_&&(m="SCRIPT_PLACEHOLDER");let S=Fi(e,r,i,o,s,n);if(!d&&!_&&!g&&m&&S&&(m=a?a(m,e.parentElement):m.replace(/[\S]/g,"*")),g&&m&&(c.textarea||S)&&(m=u?u(m,e.parentNode):m.replace(/[\S]/g,"*")),l==="OPTION"&&m){let T=Yu({type:null,tagName:l,maskInputOptions:c});m=fa({isMasked:Fi(e,r,i,o,s,T),element:e,value:m,maskInputFn:u})}return{type:Ve.Text,textContent:m||"",isStyle:d,rootId:f}}function Gw(e,t){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:s,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:f={},inlineImages:l,recordCanvas:m,keepIframeSrcFn:d,newlyAddedElement:_=!1,rootId:g,maskTextClass:S,unmaskTextClass:T,maskTextSelector:A,unmaskTextSelector:k,ignoreCSSAttributes:N}=t,U=Mw(e,r,o,i),D=Iw(e),y={},O=e.attributes.length;for(let R=0;R<O;R++){let B=e.attributes[R];B.name&&!_T(D,B.name,B.value)&&(y[B.name]=mT(n,D,Bi(B.name),B.value,e,c,N))}if(D==="link"&&s){let R=Array.from(n.styleSheets).find(L=>L.href===e.href),B=null;R&&(B=Ou(R)),B&&(y.rel=null,y.href=null,y.crossorigin=null,y._cssText=Pu(B,R.href))}if(D==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let R=Ou(e.sheet);R&&(y._cssText=Pu(R,Vu(n)))}if(D==="input"||D==="textarea"||D==="select"||D==="option"){let R=e,B=gd(R),L=Lu(R,jp(D),B),F=R.checked;if(B!=="submit"&&B!=="button"&&L){let j=Fi(R,S,A,T,k,Yu({type:B,tagName:jp(D),maskInputOptions:a}));y.value=fa({isMasked:j,element:R,value:L,maskInputFn:u})}F&&(y.checked=F)}if(D==="option"&&(e.selected&&!a.select?y.selected=!0:delete y.selected),D==="canvas"&&m){if(e.__context==="2d")Sw(e)||(y.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){let R=e.toDataURL(f.type,f.quality),B=n.createElement("canvas");B.width=e.width,B.height=e.height;let L=B.toDataURL(f.type,f.quality);R!==L&&(y.rr_dataURL=R)}}if(D==="img"&&l){ki||(ki=n.createElement("canvas"),$E=ki.getContext("2d"));let R=e,B=R.currentSrc||R.getAttribute("src")||"<unknown-src>",L=R.crossOrigin,F=()=>{R.removeEventListener("load",F);try{ki.width=R.naturalWidth,ki.height=R.naturalHeight,$E.drawImage(R,0,0),y.rr_dataURL=ki.toDataURL(f.type,f.quality)}catch(j){if(R.crossOrigin!=="anonymous"){R.crossOrigin="anonymous",R.complete&&R.naturalWidth!==0?F():R.addEventListener("load",F);return}else console.warn(`Cannot inline img src=${B}! Error: ${j}`)}R.crossOrigin==="anonymous"&&(L?y.crossOrigin=L:R.removeAttribute("crossorigin"))};R.complete&&R.naturalWidth!==0?F():R.addEventListener("load",F)}if((D==="audio"||D==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),_||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),U){let{width:R,height:B}=e.getBoundingClientRect();y={class:y.class,rr_width:`${R}px`,rr_height:`${B}px`}}D==="iframe"&&!d(y.src)&&(!U&&!dT(e)&&(y.rr_src=y.src),delete y.src);let z;try{customElements.get(D)&&(z=!0)}catch{}return{type:Ve.Element,tagName:D,attributes:y,childNodes:[],isSVG:Ow(e)||void 0,needBlock:U,rootId:g,isCustom:z}}function Re(e){return e==null?"":e.toLowerCase()}function Hw(e,t){if(t.comment&&e.type===Ve.Comment)return!0;if(e.type===Ve.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"&&lT(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Re(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Re(e.attributes.name)==="application-name"||Re(e.attributes.rel)==="icon"||Re(e.attributes.rel)==="apple-touch-icon"||Re(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Re(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Re(e.attributes.property).match(/^(og|twitter|fb):/)||Re(e.attributes.name).match(/^(og|twitter):/)||Re(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Re(e.attributes.name)==="robots"||Re(e.attributes.name)==="googlebot"||Re(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Re(e.attributes.name)==="author"||Re(e.attributes.name)==="generator"||Re(e.attributes.name)==="framework"||Re(e.attributes.name)==="publisher"||Re(e.attributes.name)==="progid"||Re(e.attributes.property).match(/^article:/)||Re(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Re(e.attributes.name)==="google-site-verification"||Re(e.attributes.name)==="yandex-verification"||Re(e.attributes.name)==="csrf-token"||Re(e.attributes.name)==="p:domain_verify"||Re(e.attributes.name)==="verify-v1"||Re(e.attributes.name)==="verification"||Re(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ui(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,skipChild:m=!1,inlineStylesheet:d=!0,maskInputOptions:_={},maskAttributeFn:g,maskTextFn:S,maskInputFn:T,slimDOMOptions:A,dataURLOptions:k={},inlineImages:N=!1,recordCanvas:U=!1,onSerialize:D,onIframeLoad:y,iframeLoadTimeout:O=5e3,onBlockedImageLoad:z,onStylesheetLoad:R,stylesheetLoadTimeout:B=5e3,keepIframeSrcFn:L=()=>!1,newlyAddedElement:F=!1,ignoreCSSAttributes:j}=t,{preserveWhiteSpace:ae=!0}=t,se=Dw(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,inlineStylesheet:d,maskInputOptions:_,maskAttributeFn:g,maskTextFn:S,maskInputFn:T,dataURLOptions:k,inlineImages:N,recordCanvas:U,keepIframeSrcFn:L,newlyAddedElement:F,ignoreCSSAttributes:j});if(!se)return console.warn(e,"not serialized"),null;let fe;r.hasNode(e)?fe=r.getId(e):Hw(se,A)||!ae&&se.type===Ve.Text&&!se.isStyle&&!se.textContent.trim().length?fe=pa:fe=Sd();let x=Object.assign(se,{id:fe});if(r.add(e,x),fe===pa)return null;D&&D(e);let Q=!m;if(x.type===Ve.Element){Q=Q&&!x.needBlock;let G=e.shadowRoot;G&&ua(G)&&(x.isShadowHost=!0)}if((x.type===Ve.Document||x.type===Ve.Element)&&Q){A.headWhitespace&&x.type===Ve.Element&&x.tagName==="head"&&(ae=!1);let G={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,skipChild:m,inlineStylesheet:d,maskInputOptions:_,maskAttributeFn:g,maskTextFn:S,maskInputFn:T,slimDOMOptions:A,dataURLOptions:k,inlineImages:N,recordCanvas:U,preserveWhiteSpace:ae,onSerialize:D,onIframeLoad:y,iframeLoadTimeout:O,onBlockedImageLoad:z,onStylesheetLoad:R,stylesheetLoadTimeout:B,keepIframeSrcFn:L,ignoreCSSAttributes:j},Y=e.childNodes?Array.from(e.childNodes):[];for(let me of Y){let ue=Ui(me,G);ue&&x.childNodes.push(ue)}if(lw(e)&&e.shadowRoot)for(let me of Array.from(e.shadowRoot.childNodes)){let ue=Ui(me,G);ue&&(ua(e.shadowRoot)&&(ue.isShadow=!0),x.childNodes.push(ue))}}if(e.parentNode&&ca(e.parentNode)&&ua(e.parentNode)&&(x.isShadow=!0),x.type===Ve.Element&&x.tagName==="iframe"&&!x.needBlock&&Pw(e,()=>{let G=dT(e);if(G&&y){let Y=Ui(G,{doc:G,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:_,maskAttributeFn:g,maskTextFn:S,maskInputFn:T,slimDOMOptions:A,dataURLOptions:k,inlineImages:N,recordCanvas:U,preserveWhiteSpace:ae,onSerialize:D,onIframeLoad:y,iframeLoadTimeout:O,onStylesheetLoad:R,stylesheetLoadTimeout:B,keepIframeSrcFn:L,ignoreCSSAttributes:j});Y&&y(e,Y)}},O),x.type===Ve.Element&&x.tagName==="img"&&!e.complete&&x.needBlock){let G=e,Y=()=>{if(G.isConnected&&!G.complete&&z)try{let me=G.getBoundingClientRect();me.width>0&&me.height>0&&z(G,x,me)}catch{}G.removeEventListener("load",Y)};G.isConnected&&G.addEventListener("load",Y)}return x.type===Ve.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&lT(x.attributes.href)==="css")&&Uw(e,()=>{if(R){let G=Ui(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:_,maskAttributeFn:g,maskTextFn:S,maskInputFn:T,slimDOMOptions:A,dataURLOptions:k,inlineImages:N,recordCanvas:U,preserveWhiteSpace:ae,onSerialize:D,onIframeLoad:y,iframeLoadTimeout:O,onStylesheetLoad:R,stylesheetLoadTimeout:B,keepIframeSrcFn:L,ignoreCSSAttributes:j});G&&R(e,G)}},B),x.type===Ve.Element&&delete x.needBlock,x}function $w(e,t){let{mirror:n=new Mu,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:i=null,maskAllText:s=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:f=null,inlineStylesheet:l=!0,inlineImages:m=!1,recordCanvas:d=!1,maskAllInputs:_=!1,maskAttributeFn:g,maskTextFn:S,maskInputFn:T,slimDOM:A=!1,dataURLOptions:k,preserveWhiteSpace:N,onSerialize:U,onIframeLoad:D,iframeLoadTimeout:y,onBlockedImageLoad:O,onStylesheetLoad:z,stylesheetLoadTimeout:R,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:L=new Set([])}=t||{};return Ui(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:s,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:l,maskInputOptions:_===!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}:_===!1?{}:_,maskAttributeFn:g,maskTextFn:S,maskInputFn:T,slimDOMOptions:A===!0||A==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:A==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:A===!1?{}:A,dataURLOptions:k,inlineImages:m,recordCanvas:d,preserveWhiteSpace:N,onSerialize:U,onIframeLoad:D,iframeLoadTimeout:y,onBlockedImageLoad:O,onStylesheetLoad:z,stylesheetLoadTimeout:R,keepIframeSrcFn:B,newlyAddedElement:!1,ignoreCSSAttributes:L})}function It(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Oi=`Please stop import mirror directly. Instead of that,\r
|
|
495
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
496
|
+
or you can use record.mirror to access the mirror instance during recording.`,jE={map:{},getId(){return console.error(Oi),-1},getNode(){return console.error(Oi),null},removeNodeFromMap(){console.error(Oi)},has(){return console.error(Oi),!1},reset(){console.error(Oi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(jE=new Proxy(jE,{get(e,t,n){return t==="map"&&console.error(Oi),Reflect.get(e,t,n)}}));function da(e,t,n={}){let r=null,o=0;return function(...i){let s=Date.now();!o&&n.leading===!1&&(o=s);let a=t-(s-o),c=this;a<=0||a>t?(r&&(Vw(r),r=null),o=s,e.apply(c,i)):!r&&n.trailing!==!1&&(r=Ku(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},a))}}function hT(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){Ku(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>hT(e,t,i||{},!0)}function Ed(e,t,n){try{if(!(t in e))return()=>{};let 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{return()=>{}}}var Uu=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Uu=()=>new Date().getTime());function gT(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function ST(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ET(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function TT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Wt(e,t,n,r,o){if(!e)return!1;let i=TT(e);if(!i)return!1;let s=Pi(t,n);if(!o){let u=r&&i.matches(r);return s(i)&&!u}let a=Co(i,s),c=-1;return a<0?!1:(r&&(c=Co(i,Pi(null,r))),a>-1&&c<0?!0:a<c)}function Ww(e,t){return t.getId(e)!==-1}function Fp(e,t){return t.getId(e)===pa}function yT(e,t){if(ca(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?yT(e.parentNode,t):!0:!0}function qp(e){return!!e.changedTouches}function jw(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 IT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function bT(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Yp(e){return!!e?.shadowRoot}var Vp=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-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 AT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function zw(e){let t=e,n;for(;n=AT(t);)t=n;return t}function qw(e){let t=e.ownerDocument;if(!t)return!1;let n=zw(e);return t.contains(n)}function vT(e){let t=e.ownerDocument;return t?t.contains(e)||qw(e):!1}var zE={};function Td(e){let t=zE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return zE[e]=r.bind(window)}function Yw(...e){return Td("requestAnimationFrame")(...e)}function Ku(...e){return Td("setTimeout")(...e)}function Vw(...e){return Td("clearTimeout")(...e)}var oe=(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))(oe||{}),X=(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))(X||{}),yt=(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))(yt||{}),fr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(fr||{}),Mi=(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))(Mi||{}),la;function Kw(e){la=e}function Jw(){la=void 0}var le=e=>la?(...n)=>{try{return e(...n)}catch(r){if(la&&la(r)===!0)return()=>{};throw r}}:e,qE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xw=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(sa=0;sa<qE.length;sa++)Xw[qE.charCodeAt(sa)]=sa;var sa,Du=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function yd(e){try{return e.contentDocument}catch{}}function ma(e){try{return e.contentWindow}catch{}}var Kp=class{constructor(t){this.doc=t,this.unattachedDoc=null}parse(t){return this.parseWithConstructableStylesheet(t)||this.parseWithDetachedElement(t)}parseWithConstructableStylesheet(t){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{let n=new CSSStyleSheet;n.replaceSync(`x { ${t} }`);let r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(t){let n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",t),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function YE(e){return"__ln"in e}var Jp=class{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?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&YE(t.previousSibling)){let 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&&YE(t.nextSibling)&&t.nextSibling.__ln.previous){let 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){let 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--)}},VE=(e,t)=>`${e}@${t}`,Xp=class{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=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new Jp,o=c=>{let u=c,f=pa;for(;f===pa;)u=u&&u.nextSibling,f=u&&this.mirror.getId(u);return f},i=c=>{if(!c.parentNode||!vT(c))return;let u=ca(c.parentNode)?this.mirror.getId(AT(c)):this.mirror.getId(c.parentNode),f=o(c);if(u===-1||f===-1)return r.addNode(c);let l=Ui(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:m=>{IT(m,this.mirror)&&!Wt(m,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(m),bT(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Yp(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(m,d)=>{if(Wt(m,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(m,d);let _=ma(m);_&&this.canvasManager.addWindow(_),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},onBlockedImageLoad:(m,d,{width:_,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:d.id,attributes:{style:{width:`${_}px`,height:`${g}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:f,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let c of this.movedSet)KE(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||i(c);for(let c of this.addedSet)!JE(this.droppedSet,c)&&!KE(this.removes,c,this.mirror)||JE(this.movedSet,c)?i(c):this.droppedSet.add(c);let s=null;for(;r.length;){let c=null;if(s){let u=this.mirror.getId(s.value.parentNode),f=o(s.value);u!==-1&&f!==-1&&(c=s)}if(!c){let u=r.tail;for(;u;){let f=u;if(u=u.previous,f){let l=this.mirror.getId(f.value.parentNode);if(o(f.value)===-1)continue;if(l!==-1){c=f;break}else{let d=f.value;if(d.parentNode&&d.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let _=d.parentNode.host;if(this.mirror.getId(_)!==-1){c=f;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}s=c.previous,r.removeNode(c.value),i(c.value)}let 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=>{let{attributes:u}=c;if(typeof u.style=="string"){let f=JSON.stringify(c.styleDiff),l=JSON.stringify(c._unchangedStyles);f.length<u.style.length&&(f+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(!Fp(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!Wt(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Fi(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,TT(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){let s=gd(n),a=n.tagName;o=Lu(n,a,s);let c=Yu({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),u=Fi(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);o=fa({isMasked:u,element:n,value:o,maskInputFn:this.maskInputFn})}if(Wt(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!yd(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!_T(n.tagName,r)&&(i.attributes[r]=mT(this.doc,Bi(n.tagName),Bi(r),o,n,this.maskAttributeFn),r==="style")){let s=t.oldValue?this.styleDeclarationParser.parse(t.oldValue):null;for(let a of Array.from(n.style)){let c=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);c!==(s?.getPropertyValue(a)||"")||u!==(s?.getPropertyPriority(a)||"")?u===""?i.styleDiff[a]=c:i.styleDiff[a]=[c,u]:i._unchangedStyles[a]=[c,u]}if(s)for(let a of Array.from(s))n.style.getPropertyValue(a)===""&&(i.styleDiff[a]=!1)}break}case"childList":{if(Wt(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=ca(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Wt(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Fp(n,this.mirror)||!Ww(n,this.mirror)||(this.addedSet.has(n)?(Qp(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||yT(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[VE(r,o)]?Qp(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ca(t.target)&&ua(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(Fp(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[VE(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Wt(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Yp(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 Kp(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 Qp(e,t){e.delete(t),t.childNodes?.forEach(n=>Qp(e,n))}function KE(e,t,n){return e.length===0?!1:Qw(e,t,n)}function Qw(e,t,n){let r=t.parentNode;for(;r;){let o=n.getId(r);if(e.some(i=>i.id===o))return!0;r=r.parentNode}return!1}function JE(e,t){return e.size===0?!1:RT(e,t)}function RT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:RT(e,n):!1}var Di=[];function Ea(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function NT(e,t){let n=new Xp;Di.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);let i=new r(le(s=>{e.onMutation&&e.onMutation(s)===!1||n.processMutations.bind(n)(s)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Zw({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,c=da(le(l=>{let m=Date.now()-a;e(s.map(d=>(d.timeOffset-=m,d)),l),s=[],a=null}),i),u=le(da(le(l=>{let m=Ea(l),{clientX:d,clientY:_}=qp(l)?l.changedTouches[0]:l;a||(a=Uu()),s.push({x:d,y:_,id:r.getId(m),timeOffset:Uu()-a}),c(typeof DragEvent<"u"&&l instanceof DragEvent?X.Drag:l instanceof MouseEvent?X.MouseMove:X.TouchMove)}),o,{trailing:!1})),f=[It("mousemove",u,n),It("touchmove",u,n),It("drag",u,n)];return le(()=>{f.forEach(l=>l())})}function ek({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){if(s.mouseInteraction===!1)return()=>{};let a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,c=[],u=null,f=l=>m=>{let d=Ea(m);if(Wt(d,r,o,i,!0))return;let _=null,g=l;if("pointerType"in m){switch(m.pointerType){case"mouse":_=fr.Mouse;break;case"touch":_=fr.Touch;break;case"pen":_=fr.Pen;break}_===fr.Touch?yt[l]===yt.MouseDown?g="TouchStart":yt[l]===yt.MouseUp&&(g="TouchEnd"):fr.Pen}else qp(m)&&(_=fr.Touch);_!==null?(u=_,(g.startsWith("Touch")&&_===fr.Touch||g.startsWith("Mouse")&&_===fr.Mouse)&&(_=null)):yt[l]===yt.Click&&(_=u,u=null);let S=qp(m)?m.changedTouches[0]:m;if(!S)return;let T=n.getId(d),{clientX:A,clientY:k}=S;le(e)(p({type:yt[g],id:T,x:A,y:k},_!==null&&{pointerType:_}))};return Object.keys(yt).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let m=Bi(l),d=f(l);if(window.PointerEvent)switch(yt[l]){case yt.MouseDown:case yt.MouseUp:m=m.replace("mouse","pointer");break;case yt.TouchStart:case yt.TouchEnd:return}c.push(It(m,d,t))}),le(()=>{c.forEach(l=>l())})}function CT({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=le(da(le(c=>{let u=Ea(c);if(!u||Wt(u,r,o,i,!0))return;let f=n.getId(u);if(u===t&&t.defaultView){let l=gT(t.defaultView);e({id:f,x:l.left,y:l.top})}else e({id:f,x:u.scrollLeft,y:u.scrollTop})}),s.scroll||100));return It("scroll",a,t)}function tk({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=le(da(le(()=>{let i=ST(),s=ET();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return It("resize",o,t)}var nk=["INPUT","TEXTAREA","SELECT"],XE=new WeakMap;function rk({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:f,userTriggeredOnInput:l,maskTextClass:m,unmaskTextClass:d,maskTextSelector:_,unmaskTextSelector:g}){function S(y){let O=Ea(y),z=y.isTrusted,R=O&&jp(O.tagName);if(R==="OPTION"&&(O=O.parentElement),!O||!R||nk.indexOf(R)<0||Wt(O,r,o,i,!0))return;let B=O;if(B.classList.contains(s)||a&&B.matches(a))return;let L=gd(O),F=Lu(B,R,L),j=!1,ae=Yu({maskInputOptions:c,tagName:R,type:L}),se=Fi(O,m,_,d,g,ae);(L==="radio"||L==="checkbox")&&(j=O.checked),F=fa({isMasked:se,element:O,value:F,maskInputFn:u}),T(O,l?{text:F,isChecked:j,userTriggered:z}:{text:F,isChecked:j});let fe=O.name;L==="radio"&&fe&&j&&t.querySelectorAll(`input[type="radio"][name="${fe}"]`).forEach(x=>{if(x!==O){let Q=fa({isMasked:se,element:x,value:Lu(x,R,L),maskInputFn:u});T(x,l?{text:Q,isChecked:!j,userTriggered:!1}:{text:Q,isChecked:!j})}})}function T(y,O){let z=XE.get(y);if(!z||z.text!==O.text||z.isChecked!==O.isChecked){XE.set(y,O);let R=n.getId(y);le(e)(E(p({},O),{id:R}))}}let k=(f.input==="last"?["change"]:["input","change"]).map(y=>It(y,le(S),t)),N=t.defaultView;if(!N)return()=>{k.forEach(y=>y())};let U=N.Object.getOwnPropertyDescriptor(N.HTMLInputElement.prototype,"value"),D=[[N.HTMLInputElement.prototype,"value"],[N.HTMLInputElement.prototype,"checked"],[N.HTMLSelectElement.prototype,"value"],[N.HTMLTextAreaElement.prototype,"value"],[N.HTMLSelectElement.prototype,"selectedIndex"],[N.HTMLOptionElement.prototype,"selected"]];return U&&U.set&&k.push(...D.map(y=>hT(y[0],y[1],{set(){le(S)({target:this,isTrusted:!1})}},!1,N))),le(()=>{k.forEach(y=>y())})}function Bu(e){let t=[];function n(r,o){if(Cu("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Cu("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Cu("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Cu("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function Pr(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function ok({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:le((f,l,m)=>{let[d,_]=m,{id:g,styleId:S}=Pr(l,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:d,index:_}]}),f.apply(l,m)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:le((f,l,m)=>{let[d]=m,{id:_,styleId:g}=Pr(l,t,n.styleMirror);return(_&&_!==-1||g&&g!==-1)&&e({id:_,styleId:g,removes:[{index:d}]}),f.apply(l,m)})});let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:le((f,l,m)=>{let[d]=m,{id:_,styleId:g}=Pr(l,t,n.styleMirror);return(_&&_!==-1||g&&g!==-1)&&e({id:_,styleId:g,replace:d}),f.apply(l,m)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:le((f,l,m)=>{let[d]=m,{id:_,styleId:g}=Pr(l,t,n.styleMirror);return(_&&_!==-1||g&&g!==-1)&&e({id:_,styleId:g,replaceSync:d}),f.apply(l,m)})}));let c={};xu("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(xu("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),xu("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),xu("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(c).forEach(([f,l])=>{u[f]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[f].insertRule,{apply:le((m,d,_)=>{let[g,S]=_,{id:T,styleId:A}=Pr(d.parentStyleSheet,t,n.styleMirror);return(T&&T!==-1||A&&A!==-1)&&e({id:T,styleId:A,adds:[{rule:g,index:[...Bu(d),S||0]}]}),m.apply(d,_)})}),l.prototype.deleteRule=new Proxy(u[f].deleteRule,{apply:le((m,d,_)=>{let[g]=_,{id:S,styleId:T}=Pr(d.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||T&&T!==-1)&&e({id:S,styleId:T,removes:[{index:[...Bu(d),g]}]}),m.apply(d,_)})})}),le(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([f,l])=>{l.prototype.insertRule=u[f].insertRule,l.prototype.deleteRule=u[f].deleteRule})})}function xT({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);let o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(s){let a=i.set?.call(this,s);if(r!==null&&r!==-1)try{t.adoptStyleSheets(s,r)}catch{}return a}}),le(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function ik({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:le((a,c,u)=>{let[f,l,m]=u;if(n.has(f))return i.apply(c,[f,l,m]);let{id:d,styleId:_}=Pr(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||_&&_!==-1)&&e({id:d,styleId:_,set:{property:f,value:l,priority:m},index:Bu(c.parentRule)}),a.apply(c,u)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:le((a,c,u)=>{let[f]=u;if(n.has(f))return s.apply(c,[f]);let{id:l,styleId:m}=Pr(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||m&&m!==-1)&&e({id:l,styleId:m,remove:{property:f},index:Bu(c.parentRule)}),a.apply(c,u)})}),le(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function sk({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:s}){let a=le(u=>da(le(f=>{let l=Ea(f);if(!l||Wt(l,t,n,r,!0))return;let{currentTime:m,volume:d,muted:_,playbackRate:g}=l;e({type:u,id:o.getId(l),currentTime:m,volume:d,muted:_,playbackRate:g})}),i.media||500)),c=[It("play",a(Mi.Play),s),It("pause",a(Mi.Pause),s),It("seeked",a(Mi.Seeked),s),It("volumechange",a(Mi.VolumeChange),s),It("ratechange",a(Mi.RateChange),s)];return le(()=>{c.forEach(u=>u())})}function ak({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(c,u,f){let l=new i(c,u,f);return o.set(l,{family:c,buffer:typeof u!="string",descriptors:f,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};let s=Ed(t.fonts,"add",function(a){return function(c){return Ku(le(()=>{let u=o.get(c);u&&(e(u),o.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(s),le(()=>{r.forEach(a=>a())})}function ck(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,c=le(()=>{let u=t.getSelection();if(!u||a&&u?.isCollapsed)return;a=u.isCollapsed||!1;let f=[],l=u.rangeCount||0;for(let m=0;m<l;m++){let d=u.getRangeAt(m),{startContainer:_,startOffset:g,endContainer:S,endOffset:T}=d;Wt(_,r,o,i,!0)||Wt(S,r,o,i,!0)||f.push({start:n.getId(_),startOffset:g,end:n.getId(S),endOffset:T})}s({ranges:f})});return c(),It("selectionchange",c)}function uk({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Ed(n.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{}return o.apply(this,[i,s,a])}})}function lk(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=NT(e,e.doc));let o=Zw(e),i=ek(e),s=CT(e),a=tk(e,{win:n}),c=rk(e),u=sk(e),f=()=>{},l=()=>{},m=()=>{},d=()=>{};e.recordDOM&&(f=ok(e,{win:n}),l=xT(e,e.doc),m=ik(e,{win:n}),e.collectFonts&&(d=ak(e)));let _=ck(e),g=uk(e),S=[];for(let T of e.plugins)S.push(T.observer(T.callback,n,T.options));return le(()=>{Di.forEach(T=>T.reset()),r?.disconnect(),o(),i(),s(),a(),c(),u(),f(),l(),m(),d(),_(),g(),S.forEach(T=>T())})}function Cu(e){return typeof window[e]<"u"}function xu(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var _a=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(n);return a||(a=this.generateIdFn(),i.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let 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}},Zp=class{constructor(){this.crossOriginIframeMirror=new _a(Sd),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},ed=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new _a(Sd),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new _a(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);let n=ma(t);n&&this.crossOriginIframeMap.set(n,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&ma(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=yd(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){let n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case oe.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:oe.IncrementalSnapshot,data:{source:X.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case oe.Meta:case oe.Load:case oe.DomContentLoaded:return!1;case oe.Plugin:return n;case oe.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case oe.IncrementalSnapshot:switch(n.data.source){case X.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case X.Drag:case X.TouchMove:case X.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case X.ViewportResize:return!1;case X.MediaInteraction:case X.MouseInteraction:case X.Scroll:case X.CanvasMutation:case X.Input:return this.replaceIds(n.data,t,["id"]),n;case X.StyleSheetRule:case X.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case X.Font:return n;case X.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case X.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));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!==Ve.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},td=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},nd=class{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(!ua(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=NT(E(p({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(CT(E(p({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),Ku(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(xT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=yd(t),r=ma(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(Ed(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&vT(this)&&r.addShadowRoot(this.shadowRoot,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},rd=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Vp,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;let r={id:n,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,c)=>({rule:uT(a),index:c}))})),r.styleIds.push(s)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},od=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,Yw(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},Be,Fu;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var In=gw();function bn(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,unblockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:f="rr-mask",unmaskTextClass:l=null,maskTextSelector:m=null,unmaskTextSelector:d=null,inlineStylesheet:_=!0,maskAllInputs:g,maskInputOptions:S,slimDOMOptions:T,maskAttributeFn:A,maskInputFn:k,maskTextFn:N,maxCanvasSize:U=null,packFn:D,sampling:y={},dataURLOptions:O={},mousemoveWait:z,recordDOM:R=!0,recordCanvas:B=!1,recordCrossOriginIframes:L=!1,recordAfter:F=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:j=!1,collectFonts:ae=!1,inlineImages:se=!1,plugins:fe,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:Q=new Set([]),errorHandler:G,onMutation:Y,getCanvasManager:me}=e;Kw(G);let ue=L?window.parent===window:!0,De=!1;if(!ue)try{window.parent.document&&(De=!1)}catch{De=!0}if(ue&&!t)throw new Error("emit function is required");if(!ue&&!De)return()=>{};z!==void 0&&y.mousemove===void 0&&(y.mousemove=z),In.reset();let nt=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}:S!==void 0?S:{},jt=T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:T==="all",headMetaDescKeywords:T==="all"}:T||{};jw();let on,$n=0,Br=W=>{for(let _e of fe||[])_e.eventProcessor&&(W=_e.eventProcessor(W));return D&&!De&&(W=D(W)),W};Be=(W,_e)=>{let ee=W;if(ee.timestamp=Uu(),Di[0]?.isFrozen()&&ee.type!==oe.FullSnapshot&&!(ee.type===oe.IncrementalSnapshot&&ee.data.source===X.Mutation)&&Di.forEach(he=>he.unfreeze()),ue)t?.(Br(ee),_e);else if(De){let he={type:"rrweb",event:Br(ee),origin:window.location.origin,isCheckout:_e};window.parent.postMessage(he,"*")}if(ee.type===oe.FullSnapshot)on=ee,$n=0;else if(ee.type===oe.IncrementalSnapshot){if(ee.data.source===X.Mutation&&ee.data.isAttachIframe)return;$n++;let he=r&&$n>=r,Z=n&&on&&ee.timestamp-on.timestamp>n;(he||Z)&&Gr(!0)}};let Wn=W=>{Be({type:oe.IncrementalSnapshot,data:p({source:X.Mutation},W)})},Aa=W=>Be({type:oe.IncrementalSnapshot,data:p({source:X.Scroll},W)}),jn=W=>Be({type:oe.IncrementalSnapshot,data:p({source:X.CanvasMutation},W)}),zt=W=>Be({type:oe.IncrementalSnapshot,data:p({source:X.AdoptedStyleSheet},W)}),bt=new rd({mutationCb:Wn,adoptedStyleSheetCb:zt}),Lt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Zp:new ed({mirror:In,mutationCb:Wn,stylesheetManager:bt,recordCrossOriginIframes:L,wrappedEmit:Be});for(let W of fe||[])W.getMirror&&W.getMirror({nodeMirror:In,crossOriginIframeMirror:Lt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Lt.crossOriginIframeStyleMirror});let Mo=new od,Lo=pk(me,{mirror:In,win:window,mutationCb:W=>Be({type:oe.IncrementalSnapshot,data:p({source:X.CanvasMutation},W)}),recordCanvas:B,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:U,sampling:y.canvas,dataURLOptions:O,errorHandler:G}),Fr=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new td:new nd({mutationCb:Wn,scrollCb:Aa,bypassOptions:{onMutation:Y,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:u,maskTextClass:f,unmaskTextClass:l,maskTextSelector:m,unmaskTextSelector:d,inlineStylesheet:_,maskInputOptions:nt,dataURLOptions:O,maskAttributeFn:A,maskTextFn:N,maskInputFn:k,recordCanvas:B,inlineImages:se,sampling:y,slimDOMOptions:jt,iframeManager:Lt,stylesheetManager:bt,canvasManager:Lo,keepIframeSrcFn:x,processedNodeManager:Mo,ignoreCSSAttributes:Q},mirror:In}),Gr=(W=!1)=>{if(!R)return;Be({type:oe.Meta,data:{href:window.location.href,width:ET(),height:ST()}},W),bt.reset(),Fr.init(),Di.forEach(ee=>ee.lock());let _e=$w(document,{mirror:In,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:u,maskTextClass:f,unmaskTextClass:l,maskTextSelector:m,unmaskTextSelector:d,inlineStylesheet:_,maskAllInputs:nt,maskAttributeFn:A,maskInputFn:k,maskTextFn:N,slimDOM:jt,dataURLOptions:O,recordCanvas:B,inlineImages:se,onSerialize:ee=>{IT(ee,In)&&Lt.addIframe(ee),bT(ee,In)&&bt.trackLinkElement(ee),Yp(ee)&&Fr.addShadowRoot(ee.shadowRoot,document)},onIframeLoad:(ee,he)=>{Lt.attachIframe(ee,he);let Z=ma(ee);Z&&Lo.addWindow(Z),Fr.observeAttachShadow(ee)},onStylesheetLoad:(ee,he)=>{bt.attachLinkElement(ee,he)},onBlockedImageLoad:(ee,he,{width:Z,height:vn})=>{Wn({adds:[],removes:[],texts:[],attributes:[{id:he.id,attributes:{style:{width:`${Z}px`,height:`${vn}px`}}}]})},keepIframeSrcFn:x,ignoreCSSAttributes:Q});if(!_e)return console.warn("Failed to snapshot the document");Be({type:oe.FullSnapshot,data:{node:_e,initialOffset:gT(window)}}),Di.forEach(ee=>ee.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,In.getId(document))};Fu=Gr;try{let W=[],_e=he=>le(lk)({onMutation:Y,mutationCb:Wn,mousemoveCb:(Z,vn)=>Be({type:oe.IncrementalSnapshot,data:{source:vn,positions:Z}}),mouseInteractionCb:Z=>Be({type:oe.IncrementalSnapshot,data:p({source:X.MouseInteraction},Z)}),scrollCb:Aa,viewportResizeCb:Z=>Be({type:oe.IncrementalSnapshot,data:p({source:X.ViewportResize},Z)}),inputCb:Z=>Be({type:oe.IncrementalSnapshot,data:p({source:X.Input},Z)}),mediaInteractionCb:Z=>Be({type:oe.IncrementalSnapshot,data:p({source:X.MediaInteraction},Z)}),styleSheetRuleCb:Z=>Be({type:oe.IncrementalSnapshot,data:p({source:X.StyleSheetRule},Z)}),styleDeclarationCb:Z=>Be({type:oe.IncrementalSnapshot,data:p({source:X.StyleDeclaration},Z)}),canvasMutationCb:jn,fontCb:Z=>Be({type:oe.IncrementalSnapshot,data:p({source:X.Font},Z)}),selectionCb:Z=>{Be({type:oe.IncrementalSnapshot,data:p({source:X.Selection},Z)})},customElementCb:Z=>{Be({type:oe.IncrementalSnapshot,data:p({source:X.CustomElement},Z)})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:f,unmaskTextClass:l,maskTextSelector:m,unmaskTextSelector:d,maskInputOptions:nt,inlineStylesheet:_,sampling:y,recordDOM:R,recordCanvas:B,inlineImages:se,userTriggeredOnInput:j,collectFonts:ae,doc:he,maskAttributeFn:A,maskInputFn:k,maskTextFn:N,keepIframeSrcFn:x,blockSelector:i,unblockSelector:s,slimDOMOptions:jt,dataURLOptions:O,mirror:In,iframeManager:Lt,stylesheetManager:bt,shadowDomManager:Fr,processedNodeManager:Mo,canvasManager:Lo,ignoreCSSAttributes:Q,plugins:fe?.filter(Z=>Z.observer)?.map(Z=>({observer:Z.observer,options:Z.options,callback:vn=>Be({type:oe.Plugin,data:{plugin:Z.name,payload:vn}})}))||[]},{});Lt.addLoadListener(he=>{try{W.push(_e(he.contentDocument))}catch(Z){console.warn(Z)}});let ee=()=>{Gr(),W.push(_e(document))};return document.readyState==="interactive"||document.readyState==="complete"?ee():(W.push(It("DOMContentLoaded",()=>{Be({type:oe.DomContentLoaded,data:{}}),F==="DOMContentLoaded"&&ee()})),W.push(It("load",()=>{Be({type:oe.Load,data:{}}),F==="load"&&ee()},window))),()=>{W.forEach(he=>he()),Mo.destroy(),Fu=void 0,Jw()}}catch(W){console.warn(W)}}function fk(e){if(!Fu)throw new Error("please take full snapshot after start recording");Fu(e)}bn.mirror=In;bn.takeFullSnapshot=fk;function pk(e,t){try{return e?e(t):new Du}catch{return console.warn("Unable to initialize CanvasManager"),new Du}}var QE;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(QE||(QE={}));var dk=3,mk=5;function Id(e){return e>9999999999?e:e*1e3}function Gp(e){return e>9999999999?e/1e3:e}function Ta(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:oe.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Ce(t,10,1e3)}}),t.category==="console")))}var _k="button,a";function wT(e){return e.closest(_k)||e}function kT(e){let t=OT(e);return!t||!(t instanceof Element)?t:wT(t)}function OT(e){return hk(e)?e.target:e}function hk(e){return typeof e=="object"&&!!e&&"target"in e}var Ur;function gk(e){return Ur||(Ur=[],Sk()),Ur.push(e),()=>{let t=Ur?Ur.indexOf(e):-1;t>-1&&Ur.splice(t,1)}}function Sk(){ye(Ne,"open",function(e){return function(...t){if(Ur)try{Ur.forEach(n=>n())}catch{}return e.apply(Ne,t)}})}var Ek=new Set([X.Mutation,X.StyleSheetRule,X.StyleDeclaration,X.AdoptedStyleSheet,X.CanvasMutation,X.Selection,X.MediaInteraction]);function Tk(e,t,n){e.handleClick(t,n)}var id=class{constructor(t,n,r=Ta){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(){let t=gk(()=>{this._lastMutation=ZE()});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(Ik(n,this._ignoreSelector)||!bk(t))return;let r={timestamp:Gp(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=Gp(t)}registerScroll(t=Date.now()){this._lastScroll=Gp(t)}registerClick(t){let n=wT(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){let t=[],n=ZE();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(let r of t){let o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){let n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!o,{clickCount:s,clickBreadcrumb:a}=t;if(i){let c=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=c<this._timeout*1e3?"mutation":"timeout",f={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:E(p({},a.data),{url:Ne.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:s||1})};this._addBreadcrumbEvent(n,f);return}if(s>1){let c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:E(p({},a.data),{url:Ne.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0})};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=vo(()=>this._checkClicks(),1e3)}},yk=["A","BUTTON","INPUT"];function Ik(e,t){return!!(!yk.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 bk(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function ZE(){return Date.now()/1e3}function Ak(e,t){try{if(!vk(t))return;let{source:n}=t.data;if(Ek.has(n)&&e.registerMutation(t.timestamp),n===X.Scroll&&e.registerScroll(t.timestamp),Rk(t)){let{type:r,id:o}=t.data,i=bn.mirror.getNode(o);i instanceof HTMLElement&&r===yt.Click&&e.registerClick(i)}}catch{}}function vk(e){return e.type===dk}function Rk(e){return e.data.source===X.MouseInteraction}function Hn(e){return p({timestamp:Date.now()/1e3,type:"default"},e)}var Ju=(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))(Ju||{}),Nk=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Ck(e){let t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(let n in e)if(Nk.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var xk=e=>t=>{if(!e.isEnabled())return;let n=wk(t);if(!n)return;let r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&Tk(e.clickDetector,n,kT(t.event)),Ta(e,n)};function MT(e,t){let n=bn.mirror.getId(e),r=n&&bn.mirror.getNode(n),o=r&&bn.mirror.getMeta(r),i=o&&Ok(o)?o:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(s=>s.type===Ju.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:Ck(i.attributes)}}:{}}}function wk(e){let{target:t,message:n}=kk(e);return Hn(p({category:`ui.${e.name}`},MT(t,n)))}function kk(e){let t=e.name==="click",n,r=null;try{r=t?kT(e.event):OT(e.event),n=Te(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function Ok(e){return e.type===Ju.Element}function Mk(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=Lk(t);n&&Ta(e,n)}function Lk(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||Pk(s)||!i)return null;let a=t||r||o,c=i.length===1;if(!a&&c)return null;let u=Te(s,{maxStringLength:200})||"<unknown>",f=MT(s,u);return Hn({category:"ui.keyDown",message:u,data:E(p({},f.data),{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i})})}function Pk(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var Uk={resource:Hk,paint:Fk,navigation:Gk};function Hp(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function Dk(e){return e.map(Bk).filter(Boolean)}function Bk(e){let t=Uk[e.entryType];return t?t(e):null}function Gi(e){return((pe()||Ne.performance.timeOrigin)+e)/1e3}function Fk(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=Gi(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function Gk(e){let{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:f,loadEventEnd:l,redirectCount:m,startTime:d,transferSize:_,type:g}=e;return o===0?null:{type:`${t}.${g}`,start:Gi(d),end:Gi(i),name:n,data:{size:_,decodedBodySize:r,encodedBodySize:s,duration:o,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:f,loadEventEnd:l,domComplete:i,redirectCount:m}}}function Hk(e){let{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:i,decodedBodySize:s,encodedBodySize:a,responseStatus:c,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Gi(i),end:Gi(o),name:r,data:{size:u,statusCode:c,decodedBodySize:s,encodedBodySize:a}}}function $k(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return bd(e,"largest-contentful-paint",n)}function Wk(e){return e.sources!==void 0}function jk(e){let t=[],n=[];for(let r of e.entries)if(Wk(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=bn.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return bd(e,"cumulative-layout-shift",n,t)}function zk(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return bd(e,"interaction-to-next-paint",n)}function bd(e,t,n,r){let o=e.value,i=e.rating,s=Gi(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>bn.mirror.getId(a)):void 0,attributions:r}}}function qk(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}let r=[];return["navigation","paint","resource"].forEach(o=>{r.push($t(o,n))}),r.push(cr(Hp($k,e)),ar(Hp(jk,e)),yo(Hp(zk,e))),()=>{r.forEach(o=>o())}}var V=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Yk='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),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});';function Vk(){let e=new Blob([Yk]);return URL.createObjectURL(e)}var eT=["log","warn","error"],ku="[Replay] ";function $p(e,t="info"){St({category:"console",data:{logger:"replay"},level:t,message:`${ku}${e}`},{level:t})}function Kk(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return V?(eT.forEach(r=>{n[r]=(...o)=>{h[r](ku,...o),t&&$p(o.join(""),rr(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),h.error(ku,r),e?J(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&$p(r,"error")},n.infoTick=(...r)=>{h.log(ku,...r),t&&setTimeout(()=>$p(r[0]),0)}):eT.forEach(r=>{n[r]=()=>{}}),n}var K=Kk(),ha=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${hd}.`)}},Gu=class{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=[]}async addEvent(t){let n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>hd)throw new ha;this.events.push(t)}finish(){return new Promise(t=>{let n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(let{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:Id(t)}},sd=class{constructor(t){this._onMessage=({data:n})=>{let r=n;if(typeof r.id!="number")return;let o=this._pending.get(r.id);if(!(!o||o.method!==r.method)){if(this._pending.delete(r.id),!r.success){V&&K.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():(V&&K.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{V&&K.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(){V&&K.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(t,n){let r=this._getAndIncrementId();return new Promise((o,i)=>{this._pending.set(r,{method:t,resolve:o,reject:i});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(s){this._pending.delete(r),i(s)}})}_getAndIncrementId(){return this._id++}},ad=class{constructor(t){this._worker=new sd(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){let n=Id(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>hd?Promise.reject(new ha):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{V&&K.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){let t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}},cd=class{constructor(t){this._fallback=new Gu,this._compression=new ad(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=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)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){V&&K.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(let i of t)o.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(i){V&&K.exception(i,"Failed to add events when switching buffers.")}}};function Jk({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=Xk(t);if(n)return n}return V&&K.log("Using simple buffer"),new Gu}function Xk(e){try{let t=e||Qk();if(!t)return;V&&K.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new cd(n)}catch(t){V&&K.exception(t,"Failed to create compression worker")}}function Qk(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Vk():""}function Ad(){try{return"sessionStorage"in Ne&&!!Ne.sessionStorage}catch{return!1}}function Zk(e){eO(),e.session=void 0}function eO(){if(Ad())try{Ne.sessionStorage.removeItem(md)}catch{}}function LT(e){return e===void 0?!1:Math.random()<e}function Xu(e){if(Ad())try{Ne.sessionStorage.setItem(md,JSON.stringify(e))}catch{}}function PT(e){let t=Date.now(),n=e.id||ge(),r=e.started||t,o=e.lastActivity||t,i=e.segmentId||0,s=e.sampled,a=e.previousSessionId,c=e.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:i,sampled:s,previousSessionId:a,dirty:c}}function tO(e,t){return LT(e)?"session":t?"buffer":!1}function tT({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=tO(e,t),i=PT({sampled:o,previousSessionId:r});return n&&Xu(i),i}function nO(){if(!Ad())return null;try{let e=Ne.sessionStorage.getItem(md);if(!e)return null;let t=JSON.parse(e);return V&&K.infoTick("Loading existing session"),PT(t)}catch{return null}}function ud(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function rO(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return ud(e.started,t,r)||ud(e.lastActivity,n,r)}function Hu(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!rO(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Wp({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&nO();return o?Hu(o,{sessionIdleExpire:e,maxReplayDuration:t})?(V&&K.infoTick("Session in sessionStorage is expired, creating new one..."),tT(r,{previousSessionId:o.id})):o:(V&&K.infoTick("Creating new session"),tT(r,{previousSessionId:n}))}function oO(e){return e.type===oe.Custom}function vd(e,t,n){return DT(e,t)?(UT(e,t,n),!0):!1}function iO(e,t,n){return DT(e,t)?UT(e,t,n):Promise.resolve(null)}async function UT(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let o=e.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let i=e.getOptions(),s=sO(t,i.beforeAddRecordingEvent);return s?await r.addEvent(s):void 0}catch(i){let s=i&&i instanceof ha,a=s?"eventBufferOverflow":"eventBufferError",c=I();if(c){let u=s?"buffer_overflow":"internal_sdk_error";c.recordDroppedEvent(u,"replay")}if(s&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:a})}}function DT(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=Id(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(V&&K.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function sO(e,t){try{if(typeof t=="function"&&oO(e))return t(e)}catch(n){return V&&K.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Rd(e){return!e.type}function ld(e){return e.type==="transaction"}function aO(e){return e.type==="replay_event"}function nT(e){return e.type==="feedback"}function cO(e){return(t,n)=>{if(!e.isEnabled()||!Rd(t)&&!ld(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(ld(t)){uO(e,t);return}lO(e,t)}}}function uO(e,t){let n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function lO(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||vo(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function fO(e){return t=>{!e.isEnabled()||!Rd(t)||pO(e,t)}}function pO(e,t){let n=t.exception?.values?.[0]?.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))){let r=Hn({category:"replay.hydrate-error",data:{url:ft()}});Ta(e,r)}}function dO(e){let t=I();t&&t.on("beforeAddBreadcrumb",n=>mO(e,n))}function mO(e,t){if(!e.isEnabled()||!BT(t))return;let n=_O(t);n&&Ta(e,n)}function _O(e){return!BT(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?hO(e):Hn(e)}function hO(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return Hn(e);let n=!1,r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Nu?(n=!0,`${o.slice(0,Nu)}\u2026`):o;if(typeof o=="object")try{let i=Ce(o,7);return JSON.stringify(i).length>Nu?(n=!0,`${JSON.stringify(i,null,2).slice(0,Nu)}\u2026`):i}catch{}return o});return Hn(E(p({},e),{data:p(E(p({},e.data),{arguments:r}),n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{})}))}function BT(e){return!!e.category}function gO(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function $u(){let e=M().getPropagationContext().dsc;e&&delete e.replay_id;let t=te();if(t){let n=xe(t);delete n.replay_id}}function rT(e){let t=M().getPropagationContext().dsc;t&&(t.replay_id=e);let n=te();if(n){let r=xe(n);r.replay_id=e}}function SO(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:oe.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 EO(e,t){return e.recordingMode!=="buffer"||t.message===_d||!t.exception||t.type?!1:LT(e.getOptions().errorSampleRate)}function TO(e){return Object.assign((t,n)=>{if(e.session&&Hu(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&$u(),!e.isEnabled()||e.isPaused())return t;if(aO(t))return delete t.breadcrumbs,t;if(!Rd(t)&&!ld(t)&&!nT(t))return t;if(!e.checkAndHandleExpiredSession())return $u(),t;if(nT(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),SO(e,t),t;if(gO(t,n)&&!e.getOptions()._experiments.captureExceptions)return V&&K.log("Ignoring error from rrweb internals",t),null;let o=EO(e,t);if((o||e.recordingMode==="session")&&(t.tags=E(p({},t.tags),{replayId:e.getSessionId()})),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){let s=e.session;s.dirty=!0,e.getOptions().stickySession&&Xu(s)}return t},{id:"Replay"})}function Qu(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:oe.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:o,data:s}}});return typeof a=="string"?Promise.resolve(null):a})}function yO(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function IO(e){return t=>{if(!e.isEnabled())return;let n=yO(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Qu(e,[n]),!1)))}}function bO(e,t){return V&&e.getOptions()._experiments.traceInternals?!1:Zo(t,I())}function FT(e,t){e.isEnabled()&&t!==null&&(bO(e,t.name)||e.addUpdate(()=>(Qu(e,[t]),!0)))}function Zu(e){if(!e)return;let 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){let n=yu(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function GT(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Wu(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n=p({},e._meta),r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function HT(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:o,method:i,statusCode:s,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:i,statusCode:s,request:a,response:c}}}function ga(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function Dr(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:o,warnings:i}=AO(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function fd(e,t){return Object.entries(e).reduce((n,[r,o])=>{let i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=o),n},{})}function AO(e){if(!e||typeof e!="string")return{body:e};let t=e.length>DE,n=vO(e);if(t){let r=e.slice(0,DE);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function vO(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function ju(e,t){let n=RO(e);return je(n,t)}function RO(e,t=Ne.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Ne.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function NO(e,t,n){try{let r=await xO(e,t,n),o=HT("resource.fetch",r);FT(n.replay,o)}catch(r){V&&K.exception(r,"Failed to capture fetch breadcrumb")}}function CO(e,t){let{input:n,response:r}=t,o=n?xi(n):void 0,i=Zu(o),s=r?GT(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),s!==void 0&&(e.data.response_body_size=s)}async function xO(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r}=t,{url:s,method:a,status_code:c=0,request_body_size:u,response_body_size:f}=e.data,l=ju(s,n.networkDetailAllowUrls)&&!ju(s,n.networkDetailDenyUrls),m=l?wO(n,t.input,u):ga(u),d=await kO(l,n,t.response,f);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:c,request:m,response:d}}function wO({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?LO(n,t):{};if(!e)return Dr(o,r,void 0);let i=xi(n),[s,a]=No(i,K),c=Dr(o,r,s);return a?Wu(c,a):c}async function kO(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return ga(o);let i=r?$T(r.headers,n):{};if(!r||!t&&o!==void 0)return Dr(i,o,void 0);let[s,a]=await MO(r),c=OO(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?Wu(c,a):c}function OO(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?Zu(e):n;return r?t?Dr(o,i,e):Dr(o,i,void 0):ga(i)}catch(i){return V&&K.exception(i,"Failed to serialize response body"),Dr(o,n,void 0)}}async function MO(e){let t=PO(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await UO(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(V&&K.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(V&&K.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function $T(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function LO(e,t){return e.length===1&&typeof e[0]!="string"?oT(e[0],t):e.length===2?oT(e[1],t):{}}function oT(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?$T(n,t):Array.isArray(n)?{}:fd(n,t):{}}function PO(e){try{return e.clone()}catch(t){V&&K.exception(t,"Failed to clone response body")}}function UO(e){return new Promise((t,n)=>{let r=vo(()=>n(new Error("Timeout while trying to read response body")),500);DO(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function DO(e){return await e.text()}async function BO(e,t,n){try{let r=GO(e,t,n),o=HT("resource.xhr",r);FT(n.replay,o)}catch(r){V&&K.exception(r,"Failed to capture xhr breadcrumb")}}function FO(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=Zu(r),i=n.getResponseHeader("content-length")?GT(n.getResponseHeader("content-length")):WO(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function GO(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r,input:s,xhr:a}=t,{url:c,method:u,status_code:f=0,request_body_size:l,response_body_size:m}=e.data;if(!c)return null;if(!a||!ju(c,n.networkDetailAllowUrls)||ju(c,n.networkDetailDenyUrls)){let D=ga(l),y=ga(m);return{startTimestamp:o,endTimestamp:i,url:c,method:u,statusCode:f,request:D,response:y}}let d=a[Tt],_=d?fd(d.request_headers,n.networkRequestHeaders):{},g=fd(Qs(a),n.networkResponseHeaders),[S,T]=n.networkCaptureBodies?No(s,K):[void 0],[A,k]=n.networkCaptureBodies?HO(a):[void 0],N=Dr(_,l,S),U=Dr(g,m,A);return{startTimestamp:o,endTimestamp:i,url:c,method:u,statusCode:f,request:T?Wu(N,T):N,response:k?Wu(U,k):U}}function HO(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return $O(e.response,e.responseType)}catch(n){t.push(n)}return V&&K.warn("Failed to get xhr response body",...t),[void 0]}function $O(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return V&&K.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return V&&K.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function WO(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Zu(n)}catch{return}}function jO(e){let t=I();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s};t&&t.on("beforeAddBreadcrumb",(c,u)=>zO(a,c,u))}catch{}}function zO(e,t,n){if(t.data)try{qO(t)&&VO(n)&&(FO(t,n),BO(t,n,e)),YO(t)&&KO(n)&&(CO(t,n),NO(t,n,e))}catch(r){V&&K.exception(r,"Error when enriching network breadcrumb")}}function qO(e){return e.category==="xhr"}function YO(e){return e.category==="fetch"}function VO(e){return e?.xhr}function KO(e){return e?.input!==void 0}function JO(e){let t=I();Xs(xk(e)),lr(IO(e)),dO(e),jO(e);let n=TO(e);vs(n),t&&(t.on("beforeSendEvent",fO(e)),t.on("afterSendEvent",cO(e)),t.on("createDsc",r=>{let o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{let i=e.getSessionId();o?.includeReplay&&e.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function XO(e){try{return Promise.all(Qu(e,[QO(Ne.performance.memory)]))}catch{return[]}}function QO(e){let{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 ZO(e,t,n){return Af(e,t,E(p({},n),{setTimeoutImpl:vo}))}var wu=C.navigator;function eM(){return/iPhone|iPad|iPod/i.test(wu?.userAgent??"")||/Macintosh/i.test(wu?.userAgent??"")&&wu?.maxTouchPoints&&wu?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function tM(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){V&&K.warn("Received replay event after session expired.");return}let o=r||!t;t=!0,nM(n),e.clickDetector&&Ak(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!vd(e,n,o))return!0;if(!o)return!1;let i=e.session;if(oM(e,o),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){let s=e.eventBuffer.getEarliestTimestamp();s&&(V&&K.log(`Updating session start time to earliest event in buffer to ${new Date(s)}`),i.started=s,e.getOptions().stickySession&&Xu(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function nM(e){let t=e.data;if(!(e.type!==oe.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==X.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=bn.mirror.getNode(n.id),o=r&&bn.mirror.getMeta(r);if(o?.type===Ju.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function rM(e){let t=e.getOptions();return{type:oe.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 oM(e,t){!t||e.session?.segmentId!==0||vd(e,rM(e),!1)}function iM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function sM(e,t,n,r){return ke(zo(e,mn(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function aM({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
497
|
+
`;if(typeof e=="string")n=`${r}${e}`;else{let i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function cM({client:e,scope:t,replayId:n,event:r}){let o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:o};e.emit("preprocessEvent",r,i);let s=await ys(e.getOptions(),r,i,t,e,ce());if(!s)return null;e.emit("postprocessEvent",s,i),s.platform=s.platform||"javascript";let a=e.getSdkMetadata(),{name:c,version:u,settings:f}=a?.sdk||{};return s.sdk=E(p({},s.sdk),{name:c||"sentry.javascript.unknown",version:u||"0.0.0",settings:f}),s}async function uM({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=aM({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:f}=r,l=I(),m=M(),d=l?.getTransport(),_=l?.getDsn();if(!l||!d||!_||!i.sampled)return Promise.resolve({});let g={type:J0,replay_start_timestamp:f/1e3,timestamp:o/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:i.sampled},S=await cM({scope:m,client:l,replayId:t,event:g});if(!S)return l.recordDroppedEvent("event_processor","replay"),V&&K.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete S.sdkProcessingMetadata;let T=sM(S,s,_,l.getOptions().tunnel),A;try{A=await d.send(T)}catch(N){let U=new Error(_d);try{U.cause=N}catch{}throw U}let k=xs({},A);if(Cs(k,"replay"))throw new Sa(k);if(typeof A.statusCode=="number"&&(A.statusCode<200||A.statusCode>=300))throw new zu(A.statusCode);return A}var zu=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},Sa=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},qu=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function WT(e,t={count:0,interval:nw}){let{recordingData:n,onError:r}=e;if(n.length)try{return await uM(e),!0}catch(o){if(o instanceof zu||o instanceof Sa)throw o;if(no("Replays",{_retryCount:t.count}),r&&r(o),t.count>=rw){let i=new Error(`${_d} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{vo(async()=>{try{await WT(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var jT="__THROTTLED",lM="__SKIPPED";function fM(e,t,n){let r=new Map,o=a=>{let c=a-n;r.forEach((u,f)=>{f<c&&r.delete(f)})},i=()=>[...r.values()].reduce((a,c)=>a+c,0),s=!1;return(...a)=>{let c=Math.floor(Date.now()/1e3);if(o(c),i()>=t){let f=s;return s=!0,f?lM:jT}s=!1;let u=r.get(c)||0;return r.set(c,u+1),e(...a)}}var pd=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:X0,sessionIdleExpire:Q0},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=ZO(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=fM((s,a)=>iO(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(ow,r),timeout:r,scrollTimeout:iw,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new id(this,i)),V){let s=t._experiments;K.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{Ne.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let s=Hn({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{let s=Hn({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{Mk(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){V&&K.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){let{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){V&&K.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",V&&K.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){V&&K.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){V&&K.log("Buffering is in progress, call `flush()` to save the replay");return}V&&K.infoTick("Starting replay in session mode"),this._updateUserActivity();let t=Wp({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){V&&K.log("Buffering is in progress, call `flush()` to save the replay");return}V&&K.infoTick("Starting replay in buffer mode");let t=Wp({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{let t=this._canvas;this._stopRecording=bn(p(E(p(E(p(p({},this._recordingOptions),this.recordingMode==="buffer"?{checkoutEveryNms:tw}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)}),{emit:tM(this)}),eM()),{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}}async stop({forceFlush:t=!1,reason:n}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";let r=n??"manual";I()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{V&&K.log(`Stopping Replay triggered by ${r}`),$u(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Zk(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),V&&K.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),V&&K.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();V&&K.log("Converting buffer to session"),await this.flushImmediate();let 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(),rT(this.session.id)),this.startRecording())}addUpdate(t){let 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){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&ud(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${Ne.location.pathname}${Ne.location.hash}${Ne.location.search}`,n=`${Ne.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){let r=this._throttledAddEvent(t,n);if(r===jT){let o=Hn({category:"replay.throttled"});this.addUpdate(()=>!vd(this,{type:mk,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||te(),n=t&&re(t),o=(n&&P(n).data||{})[de];if(!(!n||!o||!["route","custom"].includes(o)))return P(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Jk({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&I()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&rT(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=Wp({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;let t=this.session;return Hu(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))}_addListeners(){try{Ne.document.addEventListener("visibilitychange",this._handleVisibilityChange),Ne.addEventListener("blur",this._handleWindowBlur),Ne.addEventListener("focus",this._handleWindowFocus),Ne.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(JO(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=qk(this)}_removeListeners(){try{Ne.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Ne.removeEventListener("blur",this._handleWindowBlur),Ne.removeEventListener("focus",this._handleWindowFocus),Ne.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(Hu(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){$u();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){V&&K.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:oe.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=Dk(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(Qu(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;let r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){let t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){let t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){V&&K.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await XO(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new qu;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await WT({replayId:t,recordingData:i,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:s=>this.handleException(s)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});let r=I();if(r){let o;n instanceof Sa?o="ratelimit_backoff":n instanceof qu?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){V&&K.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;let n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();let i=o<this._options.minReplayDuration,s=o>this._options.maxReplayDuration+5e3;if(i||s){V&&K.log(`Session duration (${Math.floor(o/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&V&&K.log("Flushing initial segment without checkout.");let c=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,c&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Xu(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let c=iM(a.target),u=n.join(",");return c?.matches(u)}))return!1;let r=t.length,o=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=o&&r>o;if(r>i||s){let a=Hn({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function aa(e,t){return[...e,...t].join(",")}function pM({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=aa(e,[".sentry-mask","[data-sentry-mask]"]),a=aa(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:aa(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:aa(r,[]),ignoreSelector:aa(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function dM({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:i}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return i;let s=n.includes(t),a=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return s||a?i.replace(/[\S]/g,"*"):i}var iT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',mM=["content-length","content-type","accept"],_M=Symbol.for("sentry__originalRequestBody"),sT=!1,aT=!1;function hM(){if(typeof Request>"u"||aT)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[_M]=r.body),o};t.prototype=e.prototype,C.Request=t,aT=!0}catch{}}var gM=e=>new dd(e),dd=class{constructor({flushMinDelay:t=Z0,flushMaxDelay:n=ew,minReplayDuration:r=sw,maxReplayDuration:o=BE,stickySession:i=!0,useCompression:s=!0,workerUrl:a,_experiments:c={},maskAllText:u=!0,maskAllInputs:f=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:m=750,mutationLimit:d=1e4,slowClickTimeout:_=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:S=[],networkDetailDenyUrls:T=[],networkCaptureBodies:A=!0,networkRequestHeaders:k=[],networkResponseHeaders:N=[],mask:U=[],maskAttributes:D=["title","placeholder","aria-label"],unmask:y=[],block:O=[],unblock:z=[],ignore:R=[],maskFn:B,beforeAddRecordingEvent:L,beforeErrorSampling:F,onError:j,attachRawBodyFromRequest:ae=!1}={}){this.name="Replay";let se=pM({mask:U,unmask:y,block:O,unblock:z,ignore:R});if(this._recordingOptions=E(p({maskAllInputs:f,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:B,maskInputFn:B,maskAttributeFn:(fe,x,Q)=>dM({maskAttributes:D,maskAllText:u,privacyOptions:se,key:fe,value:x,el:Q})},se),{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:fe=>{try{fe.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!c.recordCrossOriginIframes}),this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,aw),maxReplayDuration:Math.min(o,BE),stickySession:i,useCompression:s,workerUrl:a,blockAllMedia:l,maskAllInputs:f,maskAllText:u,mutationBreadcrumbLimit:m,mutationLimit:d,slowClickTimeout:_,slowClickIgnoreSelectors:g,networkDetailAllowUrls:S,networkDetailDenyUrls:T,networkCaptureBodies:A,networkRequestHeaders:cT(k),networkResponseHeaders:cT(N),beforeAddRecordingEvent:L,beforeErrorSampling:F,onError:j,attachRawBodyFromRequest:ae,_experiments:c},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${iT}`:iT,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&ut())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return sT}set _isInitialized(t){sT=t}afterAllSetup(t){!ut()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&hM(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush: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){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(t){let n=this.getReplayId(!0);n&&Ye(t,{"sentry.replay_id":n})}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=SM(this._initialOptions,t);this._replay=new pd({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function SM(e,t){let n=t.getOptions(),r=p({sessionSampleRate:0,errorSampleRate:0},e),o=Ut(n.replaysSessionSampleRate),i=Ut(n.replaysOnErrorSampleRate);return o==null&&i==null&&Fe(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function cT(e){return[...mM,...e.map(t=>t.toLowerCase())]}function EM(){return I()?.getIntegrationByName("Replay")}var TM=Object.defineProperty,yM=(e,t,n)=>t in e?TM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zT=(e,t,n)=>yM(e,typeof t!="symbol"?t+"":t,n),Cd=class{constructor(){zT(this,"idNodeMap",new Map),zT(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-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){let 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){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let 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 IM(){return new Cd}function bM(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function xd(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:xd(e.parentNode,t,n,r+1)}function qT(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(bM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}var Hi=`Please stop import mirror directly. Instead of that,\r
|
|
498
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
499
|
+
or you can use record.mirror to access the mirror instance during recording.`,YT={map:{},getId(){return console.error(Hi),-1},getNode(){return console.error(Hi),null},removeNodeFromMap(){console.error(Hi)},has(){return console.error(Hi),!1},reset(){console.error(Hi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(YT=new Proxy(YT,{get(e,t,n){return t==="map"&&console.error(Hi),Reflect.get(e,t,n)}}));function kd(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){ty(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>kd(e,t,i||{},!0)}function Od(e,t,n){try{if(!(t in e))return()=>{};let 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{return()=>{}}}Date.now().toString();function AM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function rl(e,t,n,r,o){if(!e)return!1;let i=AM(e);if(!i)return!1;let s=qT(t,n);if(!o){let u=r&&i.matches(r);return s(i)&&!u}let a=xd(i,s),c=-1;return a<0?!1:(r&&(c=xd(i,qT(null,r))),a>-1&&c<0?!0:a<c)}var VT={};function ey(e){let t=VT[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return VT[e]=r.bind(window)}function xo(...e){return ey("requestAnimationFrame")(...e)}function ty(...e){return ey("setTimeout")(...e)}var Wi=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Wi||{}),tl;function vM(e){tl=e}var Nd=e=>tl?(...n)=>{try{return e(...n)}catch(r){if(tl&&tl(r)===!0)return()=>{};throw r}}:e,$i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",RM=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(ya=0;ya<$i.length;ya++)RM[$i.charCodeAt(ya)]=ya;var ya,NM=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=$i[t[n]>>2],o+=$i[(t[n]&3)<<4|t[n+1]>>4],o+=$i[(t[n+1]&15)<<2|t[n+2]>>6],o+=$i[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},KT=new Map;function CM(e,t){let n=KT.get(e);return n||(n=new Map,KT.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var ny=(e,t,n)=>{if(!e||!(oy(e,t)||typeof e=="object"))return;let r=e.constructor.name,o=CM(n,r),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function nl(e,t,n){if(e instanceof Array)return e.map(r=>nl(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){let r=e.constructor.name,o=NM(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[nl(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[nl(e.data,t,n),e.width,e.height]};if(oy(e,t)||typeof e=="object"){let r=e.constructor.name,o=ny(e,t,n);return{rr_type:r,index:o}}}}return e}var ry=(e,t,n)=>e.map(r=>nl(r,t,n)),oy=(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 xM(e,t,n,r,o){let i=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of s)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=Od(t.CanvasRenderingContext2D.prototype,a,function(u){return function(...f){return rl(this.canvas,n,r,o,!0)||ty(()=>{let l=ry(f,t,this);e(this.canvas,{type:Wi["2D"],property:a,args:l})},0),u.apply(this,f)}});i.push(c)}catch{let c=kd(t.CanvasRenderingContext2D.prototype,a,{set(u){e(this.canvas,{type:Wi["2D"],property:a,args:[u],setter:!0})}});i.push(c)}return()=>{i.forEach(a=>a())}}function wM(e){return e==="experimental-webgl"?"webgl":e}function JT(e,t,n,r,o){let i=[];try{let s=Od(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...u){if(!rl(this,t,n,r,!0)){let f=wM(c);if("__context"in this||(this.__context=f),o&&["webgl","webgl2"].includes(f))if(u[0]&&typeof u[0]=="object"){let l=u[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...u])}});i.push(s)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(s=>s())}}function XT(e,t,n,r,o,i,s,a){let c=[],u=Object.getOwnPropertyNames(e);for(let f of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(f))try{if(typeof e[f]!="function")continue;let l=Od(e,f,function(m){return function(...d){let _=m.apply(this,d);if(ny(_,a,this),"tagName"in this.canvas&&!rl(this.canvas,r,o,i,!0)){let g=ry(d,a,this),S={type:t,property:f,args:g};n(this.canvas,S)}return _}});c.push(l)}catch{let l=kd(e,f,{set(m){n(this.canvas,{type:t,property:f,args:[m],setter:!0})}});c.push(l)}return c}function kM(e,t,n,r,o,i){let s=[];return s.push(...XT(t.WebGLRenderingContext.prototype,Wi.WebGL,e,n,r,o,i,t)),typeof t.WebGL2RenderingContext<"u"&&s.push(...XT(t.WebGL2RenderingContext.prototype,Wi.WebGL2,e,n,r,o,i,t)),()=>{s.forEach(a=>a())}}var OM='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 MM(){let e=new Blob([OM]);return URL.createObjectURL(e)}var wd=class{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)};let{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:i,errorHandler:s}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,s&&vM(s),(i&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&Nd(()=>{i&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.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){let{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:i,recordCanvas:s,enableManualSnapshot:a}=this.options;if(!this.windowsSet.has(t)){if(a){this.windowsSet.add(t),this.windows.push(new WeakRef(t));return}Nd(()=>{if(s&&n==="all"&&this.initCanvasMutationObserver(t,r,o,i),s&&typeof n=="number"){let c=JT(t,r,o,i,!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?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,t);return}xo(r=>this.takeSnapshot(r,!0,t))}initFPSWorker(){let t=new Worker(MM());return t.onmessage=n=>{let r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;let{base64:i,type:s,width:a,height:c}=r;this.mutationCb({id:o,type:Wi["2D"],commands:[{property:"clearRect",args:[0,0,a,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:s}]},0,0,a,c]}]})},t}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;let n=r=>{this.takeSnapshot(r,!1),t=xo(n)};t=xo(n),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,n,r,o){let i=JT(t,n,r,o,!1),s=xM(this.processMutation.bind(this),t,n,r,o),a=kM(this.processMutation.bind(this),t,n,r,o,this.mirror);this.restoreHandlers.push(()=>{i(),s(),a()})}getCanvasElements(t,n,r){let o=[],i=s=>{s.querySelectorAll("canvas").forEach(a=>{rl(a,t,n,r,!0)||o.push(a)})};for(let s of this.windows){let a=s.deref(),c;try{c=a&&a.document}catch{}c&&i(c)}for(let s of this.shadowDoms){let a=s.deref();a&&i(a)}return o}takeSnapshot(t,n,r){let{sampling:o,blockClass:i,blockSelector:s,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(i,s,a)).forEach(_=>{let g=this.mirror.getId(_);if(!(!this.mirror.hasNode(_)||!_.width||!_.height||this.snapshotInProgressMap.get(g))){if(this.snapshotInProgressMap.set(g,!0),!n&&["webgl","webgl2"].includes(_.__context)){let S=_.getContext(_.__context);S?.getContextAttributes()?.preserveDrawingBuffer===!1&&S.clear(S.COLOR_BUFFER_BIT)}createImageBitmap(_).then(S=>{this.worker?.postMessage({id:g,bitmap:S,width:_.width,height:_.height,dataURLOptions:c,maxCanvasSize:u},[S])}).catch(S=>{Nd(()=>{throw this.snapshotInProgressMap.delete(g),S})()})}}),!0)}startPendingCanvasMutationFlusher(){xo(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,xo(t)};xo(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),xo(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let o=r.map(s=>{let u=s,{type:a}=u;return qt(u,["type"])}),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}};try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}IM();var QT;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(QT||(QT={}));var ZT={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}}},LM="ReplayCanvas",el=1280,PM=(e={})=>{let[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,el):el,n?Math.min(n,el):el]},o,i,s=new Promise(a=>i=a);return{name:LM,getOptions(){let{quality:a,enableManualSnapshot:c,maxCanvasSize:u}=r;return p({enableManualSnapshot:c,recordCanvas:!0,getCanvasManager:f=>{let l=new wd(E(p({},f),{enableManualSnapshot:c,maxCanvasSize:u,errorHandler:m=>{try{typeof m=="object"&&(m.__rrweb__=!0)}catch{}}}));return o=l,i(l),l}},ZT[a]||ZT.medium)},async snapshot(a,c){(o||await s).snapshot(a,c)}}},UM=PM;function iy(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Md(e){try{return new URL(e,w.location.origin).href}catch{return}}function sy(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Ld(e){try{return new Headers(e)}catch{return}}var ol={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Pd(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:c}=p(p({},ol),t),u=typeof o=="function"?o:d=>!0,f=d=>BM(d,s),l={},m=e.getOptions().propagateTraceparent;n&&Dn(d=>{let _=xf(d,u,f,l,{propagateTraceparent:m,onRequestSpanEnd:c});if(_){let g=Md(d.fetchData.url),S=g?Ct(g).host:void 0;_.setAttributes({"http.url":g?ct(g):void 0,"server.address":S}),i&&ay(_,e),a?.(_,{headers:d.headers})}}),r&&Ro(d=>{let _=FM(d,u,f,l,m,c);_&&(i&&ay(_,e),a?.(_,{headers:Ld(d.xhr.__sentry_xhr_v3__?.request_headers)}))})}var DM=300;function ay(e,t){let{url:n}=P(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(He(t)){let i=e.end.bind(e);e.end=s=>{let a=s??ne(),c=!1,u=()=>{c||(c=!0,setTimeout(o),i(a),clearTimeout(f))};r=u;let f=setTimeout(u,DM)}}let o=$t("resource",({entries:i})=>{i.forEach(s=>{sy(s)&&s.name.endsWith(n)&&(e.setAttributes(Ks(s)),r())})})}function BM(e,t){let n=ft();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}let i=r.origin===o;return t?je(r.toString(),t)||i&&je(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?je(e,t):r}}function FM(e,t,n,r,o,i){let s=e.xhr,a=s?.[Tt];if(!s||s.__sentry_own_request__||!a)return;let{url:c,method:u}=a,f=Ge()&&t(c);if(e.endTimestamp){let A=s.__sentry_xhr_span_id__;if(!A)return;let k=r[A];k&&(f&&a.status_code!==void 0&&(Kn(k,a.status_code),k.end(),i?.(k,{headers:Ld(Qs(s)),error:e.error})),delete r[A]);return}let l=Md(c),m=l?Ct(l):Ct(c),d=ct(_n(c)),_=I(),S=!!te()||!!_&&He(_),T=f&&S?Le({name:`${u} ${d}`,attributes:p(p({url:ct(c),type:"xhr","http.method":u,"http.url":l?ct(l):void 0,"server.address":m?.host,[H]:"auto.http.browser",[q]:"http.client"},m?.search&&{"http.query":m?.search}),m?.hash&&{"http.fragment":m?.hash})}):new qe;return f&&!S&&_?.recordDroppedEvent("no_parent_span","span"),s.__sentry_xhr_span_id__=T.spanContext().spanId,r[s.__sentry_xhr_span_id__]=T,n(c)&&GM(s,Ge()&&S?T:void 0,o),_&&_.emit("beforeOutgoingRequestSpan",T,e),T}function GM(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=ti({span:t,propagateTraceparent:n});r&&HM(e,r,o,i)}function HM(e,t,n,r){let o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!o?.traceparent&&e.setRequestHeader("traceparent",r),n){let i=o?.baggage;(!i||!iy(i))&&e.setRequestHeader("baggage",n)}}catch{}}var cy=new WeakMap,uy=new WeakMap,$M=9e4,WM=["text/event-stream","application/x-ndjson","application/stream+json"],Ud=()=>({name:"FetchStreamPerformance",setup(){Vc(e=>{if(e.response){let t=cy.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=uy.get(e.response);n&&clearTimeout(n)}}}),Dn(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!WM.some(c=>t.startsWith(c)))return;let n=e.fetchData?.url||"",r=e.fetchData?.method||"GET",o=xn(n),i=n.startsWith("data:")?ct(n):o?Vo(o):n,s=Le({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:ct(n),"http.method":r,type:"fetch",[q]:"http.client.stream",[H]:"auto.http.browser.stream"}});cy.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},$M);uy.set(e.response,a)}})}});function ly(){w.document?w.document.addEventListener("visibilitychange",()=>{let e=te();if(!e)return;let t=re(e);if(w.document.hidden&&t){let n="cancelled",{op:r,status:o}=P(t);v&&h.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:2,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):v&&h.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var jM=3600,fy="sentry_previous_trace",zM="sentry.previous_trace";function py(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?VM():void 0;e.on("spanStart",s=>{if(re(s)!==s)return;let a=M().getPropagationContext();o=qM(o,s,a),r&&YM(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=M(),c=a.getPropagationContext();if(i&&c.parentSpanId){i=!1;return}a.setPropagationContext(E(p({},c),{dsc:E(p({},c.dsc),{sample_rate:String(o.sampleRate),sampled:String(Dd(o.spanContext))}),sampleRand:o.sampleRand})),s.parentSampled=Dd(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes=E(p({},s.spanAttributes),{[Ho]:o.sampleRate})})}function qM(e,t,n){let r=P(t);function o(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[Yn])}catch{return 0}}let i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return i;let s=e.spanContext;return s.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=jM&&(v&&h.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify(p({op:r.op},t.spanContext()))}\``),t.addLink({context:s,attributes:{[Ja]:"previous_trace"}}),t.setAttribute(zM,`${s.traceId}-${s.spanId}-${Dd(s)?1:0}`)),i)}function YM(e){try{w.sessionStorage.setItem(fy,JSON.stringify(e))}catch(t){v&&h.warn("Could not store previous trace in sessionStorage",t)}}function VM(){try{let e=w.sessionStorage?.getItem(fy);return JSON.parse(e)}catch{return}}function Dd(e){return e.traceFlags===1}var KM="BrowserTracing",JM=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function gy(){let e=w.navigator;return e?.userAgent?JM.test(e.userAgent):!1}var XM=p(E(p({},Yo),{instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{}}),ol),Bd=(e={})=>{"enableElementTiming"in e&&Fe(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=w.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:s,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:u,idleTimeout:f,finalTimeout:l,childSpanTimeout:m,markBackgroundSpan:d,traceFetch:_,traceXHR:g,trackFetchStreamPerformance:S,shouldCreateSpanForRequest:T,enableHTTPTimings:A,ignoreResourceSpans:k,ignorePerformanceApiSpans:N,instrumentPageLoad:U,instrumentNavigation:D,detectRedirects:y,linkPreviousTrace:O,consistentTraceSampling:z,enableReportPageLoaded:R,onRequestSpanStart:B,onRequestSpanEnd:L}=p(p({},XM),e),F=gy(),j,ae,se;function fe(x,Q,G=!0){let Y=Q.op==="pageload",me=Q.name,ue=u?u(Q):Q,De=ue.attributes||{};if(me!==ue.name&&(De[de]="custom",ue.attributes=De),!G){let on=vt();Le(E(p({},ue),{startTime:on})).end(on);return}t.name=ue.name,t.source=De[de];let nt=fc(ue,{idleTimeout:f,finalTimeout:l,childSpanTimeout:m,disableAutoFinish:Y,beforeSpanEnd:on=>{j?.();let $n=He(x);Ep(on,{recordClsOnPageloadSpan:!$n&&!a,recordLcpOnPageloadSpan:!$n&&!c,ignoreResourceSpans:k,ignorePerformanceApiSpans:N,spanStreamingEnabled:$n}),_y(x,void 0);let Br=M(),Wn=Br.getPropagationContext();Br.setPropagationContext(E(p({},Wn),{traceId:nt.spanContext().traceId,sampled:at(nt),dsc:xe(on)})),Y&&(se=void 0)},trimIdleSpanEndTimestamp:!R});Y&&R&&(se=nt),_y(x,nt);function jt(){n&&["interactive","complete"].includes(n.readyState)&&x.emit("idleSpanEnableAutoFinish",nt)}Y&&!R&&n&&(n.addEventListener("readystatechange",()=>{jt()}),jt())}return{name:KM,setup(x){if(F){v&&h.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}oc();let Q=He(x);if(j=_p({recordClsStandaloneSpans:Q?void 0:a||!1,recordLcpStandaloneSpans:Q?void 0:c||!1,client:x}),Q?(vp(x),Rp(x),r&&Np()):r&&Ip(),i&&C.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?gp():o&&hp(),s&&Sp(),y&&n){let Y=()=>{ae=ne()};addEventListener("click",Y,{capture:!0}),addEventListener("keydown",Y,{capture:!0,passive:!0})}function G(){let Y=Ia(x);Y&&!P(Y).timestamp&&(v&&h.log(`[Tracing] Finishing current active span with op: ${P(Y).op}`),Y.setAttribute(Vn,"cancelled"),Y.end())}x.on("startNavigationSpan",(Y,me)=>{if(I()!==x)return;if(me?.isRedirect){v&&h.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),fe(x,p({op:"navigation.redirect"},Y),!1);return}ae=void 0,G(),ce().setPropagationContext({traceId:tt(),sampleRand:Math.random(),propagationSpanId:Ge()?void 0:it()});let ue=M();ue.setPropagationContext({traceId:tt(),sampleRand:Math.random(),propagationSpanId:Ge()?void 0:it()}),ue.setSDKProcessingMetadata({normalizedRequest:void 0}),fe(x,E(p({op:"navigation"},Y),{parentSpan:null,forceTransaction:!0}))}),x.on("startPageLoadSpan",(Y,me={})=>{if(I()!==x)return;G();let ue=me.sentryTrace||dy("sentry-trace")||my("sentry-trace"),De=me.baggage||dy("baggage")||my("baggage"),nt=rs(ue,De),jt=M();jt.setPropagationContext(nt),Ge()||(jt.getPropagationContext().propagationSpanId=it()),jt.setSDKProcessingMetadata({normalizedRequest:Ti()}),fe(x,p({op:"pageload"},Y))}),x.on("endPageloadSpan",()=>{R&&se&&(se.setAttribute(Vn,"reportPageLoaded"),se.end())})},afterAllSetup(x){if(F)return;let Q=ft();if(O!=="off"&&py(x,{linkPreviousTrace:O,consistentTraceSampling:z}),w.location){if(U){let G=pe();Sy(x,{name:w.location.pathname,startTime:G?G/1e3:void 0,attributes:{[de]:"url",[H]:"auto.pageload.browser"}})}D&&lr(({to:G,from:Y})=>{if(Y===void 0&&Q?.indexOf(G)!==-1){Q=void 0;return}Q=void 0;let me=xn(G),ue=Ia(x),De=ue&&y&&ZM(ue,ae);il(x,{name:me?.pathname||w.location.pathname,attributes:{[de]:"url",[H]:"auto.navigation.browser"}},{url:G,isRedirect:De})})}d&&ly(),s&&QM(x,f,l,m,t),r&&bp(),Pd(x,{traceFetch:_,traceXHR:g,tracePropagationTargets:x.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:T,enableHTTPTimings:A,onRequestSpanStart:B,onRequestSpanEnd:L}),S&&x.addIntegration(Ud())}}};function Sy(e,t,n){e.emit("startPageLoadSpan",t,n),M().setTransactionName(t.name);let r=Ia(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function il(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=M();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:E(p({},Ti()),{url:r})}),Ia(e)}function dy(e){return w.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function my(e){return w.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function QM(e,t,n,r,o){let i=w.document,s,a=()=>{let c="ui.action.click",u=Ia(e);if(u){let f=P(u).op;if(["navigation","pageload"].includes(f)){v&&h.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(Vn,"interactionInterrupted"),s.end(),s=void 0),!o.name){v&&h.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}s=fc({name:o.name,op:c,attributes:{[de]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var Ey="_sentry_idleSpan";function Ia(e){return e[Ey]}function _y(e,t){Ee(e,Ey,t)}var hy=1.5;function ZM(e,t){let n=P(e),r=vt(),o=n.start_timestamp;return!(r-o>hy||t&&r-t<=hy)}function eL(e=I()){e?.emit("endPageloadSpan")}function tL(e){let t=te();if(t===e)return;let n=M();e.end=new Proxy(e.end,{apply(r,o,i){return _t(n,t),Reflect.apply(r,o,i)}}),_t(n,e)}var nL=()=>({name:"SpanStreaming",beforeSetup(e){let t=e.getOptions();t.traceLifecycle||(v&&h.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),t.traceLifecycle="stream")},setup(e){let t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!He(e)){r.traceLifecycle="static",v&&h.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!er(o)){r.traceLifecycle="static",v&&h.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let i=new Gs(e);e.on("afterSpanEnd",s=>{at(s)&&i.add(dc(s,e))}),e.on("afterSegmentSpanEnd",s=>{let a=s.spanContext().traceId;setTimeout(()=>{i.flush(a)},500)})}});function ji(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function rL(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=ji(n);return o=>r.then(i=>o(i.transaction(t,"readwrite").objectStore(t)))}function Fd(e){return ji(e.getAllKeys())}function oL(e,t,n){return e(r=>Fd(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),ji(r.transaction)}))}function iL(e,t,n){return e(r=>Fd(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.min(...o,0)-1),ji(r.transaction)}))}function sL(e){return e(t=>Fd(t).then(n=>{let r=n[0];if(r!=null)return ji(t.get(r)).then(o=>(t.delete(r),ji(t.transaction).then(()=>o)))}))}function aL(e){let t;function n(){return t==null&&(t=rL(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{let o=tr(r);await oL(n(),o,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{let o=tr(r);await iL(n(),o,e.maxQueueSize||30)}catch{}},shift:async()=>{try{let r=await sL(n());if(r)return ac(r)}catch{}}}}function cL(e){return t=>{let n=e(E(p({},t),{createStore:aL}));return w.addEventListener("online",async r=>{await n.flush()}),n}}function uL(e=Zs){return cL(Tf(e))}var Ty=1e6,lL="window"in C&&C.window===C&&typeof importScripts>"u",ko=String(0),Hd=lL?"main":"worker",sl=w.navigator,Iy="",by="",Ay="",Gd=sl?.userAgent||"",vy="",fL=sl?.language||sl?.languages?.[0]||"";function pL(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}var yy=sl?.userAgentData;pL(yy)&&yy.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(Iy=e.platform||"",Ay=e.architecture||"",vy=e.model||"",by=e.platformVersion||"",e.fullVersionList?.length){let t=e.fullVersionList[e.fullVersionList.length-1];Gd=`${t.brand} ${t.version}`}}).catch(e=>{});function dL(e){return!("thread_metadata"in e)}function mL(e){return dL(e)?SL(e):e}function _L(e){let t=e.contexts?.trace?.trace_id;return typeof t=="string"&&t.length!==32&&v&&h.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function hL(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.`);let o=_L(r),i=mL(n),s=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:ne()*1e3),a=typeof r.timestamp=="number"?r.timestamp*1e3:ne()*1e3;return{event_id:e,timestamp:new Date(s).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Zn,runtime:{name:"javascript",version:w.navigator.userAgent},os:{name:Iy,version:by,build_number:Gd},device:{locale:fL,model:vy,manufacturer:Gd,architecture:Ay,is_emulator:!1},debug_meta:{images:wy(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||ge(),trace_id:o,active_thread_id:ko,relative_start_ns:"0",relative_end_ns:((a-s)*1e6).toFixed(0)}]}}function Ry(e,t,n){if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);let r=gL(e),o=t.getOptions(),i=t.getSdkMetadata?.()?.sdk;return{chunk_id:ge(),client_sdk:{name:i?.name??"sentry.javascript.browser",version:i?.version??"0.0.0"},profiler_id:n||ge(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:wy(e.resources)},profile:r}}function Ny(e){try{if(!e||typeof e!="object")return{reason:"chunk is not an object"};let 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"};let n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}:!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 gL(e){let t=[];for(let a=0;a<e.frames.length;a++){let c=e.frames[a];c&&(t[a]={function:c.name,abs_path:typeof c.resourceId=="number"?e.resources[c.resourceId]:void 0,lineno:c.line,colno:c.column})}let n=[];for(let a=0;a<e.stacks.length;a++){let c=e.stacks[a];if(!c)continue;let u=[],f=c;for(;f;)u.push(f.frameId),f=f.parentId===void 0?void 0:e.stacks[f.parentId];n[a]=u}let r=pe(),o=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=o-(r||o),s=[];for(let a=0;a<e.samples.length;a++){let c=e.samples[a];if(!c)continue;let u=(o+(c.timestamp-i))/1e3;s[a]={stack_id:c.stackId??0,thread_id:ko,timestamp:u}}return{frames:t,stacks:n,samples:s,thread_metadata:{[ko]:{name:Hd}}}}function al(e){return P(e).op==="pageload"}function SL(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[ko]:{name:Hd}}},o=e.samples[0];if(!o)return r;let i=o.timestamp,s=pe(),a=typeof performance.timeOrigin=="number"?performance.timeOrigin:s||0,c=a-(s||a);return e.samples.forEach((u,f)=>{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[f]={elapsed_since_start_ns:((u.timestamp+c-i)*Ty).toFixed(0),stack_id:t,thread_id:ko};return}let l=e.stacks[u.stackId],m=[];for(;l;){m.push(l.frameId);let _=e.frames[l.frameId];_&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:_.name,abs_path:typeof _.resourceId=="number"?e.resources[_.resourceId]:void 0,lineno:_.line,colno:_.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}let d={elapsed_since_start_ns:((u.timestamp+c-i)*Ty).toFixed(0),stack_id:n,thread_id:ko};r.stacks[n]=m,r.samples[f]=d,n++}),r}function Cy(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:"profile"},n]);return e}function xy(e){let t=[];return Nt(e,(n,r)=>{if(r==="transaction")for(let o=1;o<n.length;o++)n[o]?.contexts?.profile?.profile_id&&t.push(n[o])}),t}function wy(e){let r=I()?.getOptions()?.stackParser;return r?zl(r,e):[]}function ky(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(v&&h.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?(v&&h.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function EL(e){return e.samples.length<2?(v&&h.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(v&&h.log("[Profiling] Discarding profile because it contains no frames"),!1)}var $d=!1,Wd=3e4;function TL(e){return typeof e=="function"}function cl(){let e=w.Profiler;if(!TL(e)){v&&h.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}let t=10,n=Math.floor(Wd/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{v&&(h.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),h.log("[Profiling] Disabling profiling for current user session.")),$d=!0}}function jd(e){if($d)return v&&h.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return v&&h.log("[Profiling] Discarding profile because root span was not sampled."),!1;let n=I()?.getOptions();if(!n)return v&&h.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return ky(r)?r?(r===!0?!0:Math.random()<r)?!0:(v&&h.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(v&&h.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(v&&h.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function Oy(e){if($d)return v&&h.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 v&&h.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let t=e.profileSessionSampleRate;return ky(t)?t?Math.random()<=t:(v&&h.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(v&&h.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function ba(e){return typeof e.profilesSampleRate<"u"}function My(e,t,n,r){return EL(n)?hL(e,t,n,r):null}var wo=new Map;function Ly(){return wo.size}function Py(e){let t=wo.get(e);return t&&wo.delete(e),t}function Uy(e,t){if(wo.set(e,t),wo.size>30){let n=wo.keys().next().value;n!==void 0&&wo.delete(n)}}var ul=new WeakSet;function Oo(e){e.setAttribute("thread.id",ko),e.setAttribute("thread.name",Hd)}function zd(e){let t;al(e)&&(t=ne()*1e3);let n=cl();if(!n)return;v&&h.log(`[Profiling] started profiling span: ${P(e).description}`);let r=ge(),o=null;M().setContext("profile",{profile_id:r,start_timestamp:t}),ul.add(e),Oo(e);async function i(){if(e&&n){if(o){v&&h.log("[Profiling] profile for:",P(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(s&&(w.clearTimeout(s),s=void 0),v&&h.log(`[Profiling] stopped profiling of span: ${P(e).description}`),!u){v&&h.log(`[Profiling] profiler returned null profile for: ${P(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=u,Uy(r,u)}).catch(u=>{v&&h.log("[Profiling] error while stopping profiler:",u)})}}let s=w.setTimeout(()=>{v&&h.log("[Profiling] max profile duration elapsed, stopping profiling for:",P(e).description),i()},Wd),a=e.end.bind(e);function c(){return e?(i().then(()=>{a()},()=>{a()}),e):a()}e.end=c}var yL=6e4,IL=3e5,ll=class{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){let n=t.getOptions().profileLifecycle,r=Oy(t.getOptions());v&&h.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||v&&h.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=ge(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t),t.on("spanStart",o=>{this._isRunning&&Oo(o)})}start(){if(this._lifecycleMode==="trace"){v&&h.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){v&&h.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){v&&h.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){v&&h.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){v&&h.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;let n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);let r=this._activeRootSpanIds.size;r===1&&(v&&h.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling()),this._isRunning&&Oo(t)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,v&&h.log("[Profiling] Started profiling with profiler ID:",this._profilerId),fn().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){v&&h.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=>{v&&h.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&fn().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){v&&h.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==re(n))return;if(!n.isRecording()){v&&h.log("[Profiling] Discarding profile because root span was not sampled.");return}let r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);let o=this._activeRootSpanIds.size;o===1&&(v&&h.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;let r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);let o=this._activeRootSpanIds.size;v&&h.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(i=>{v&&h.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,fn().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);let n=setTimeout(()=>this._onRootSpanTimeout(t),IL);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let t=cl();if(!t){v&&h.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{v&&h.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},yL))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(v&&h.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()))}async _collectCurrentChunk(){let t=this._profiler;if(this._profiler=void 0,!!t)try{let n=await t.stop(),r=Ry(n,this._client,this._profilerId),o=Ny(r);if("reason"in o){v&&h.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),v&&h.log("[Profiling] Collected browser profile chunk.")}catch(n){v&&h.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){let n=this._client,r=mn(n.getSdkMetadata?.()),o=n.getDsn(),i=n.getOptions().tunnel,s=ke(p(p({event_id:ge(),sent_at:new Date().toISOString()},r&&{sdk:r}),!!i&&o&&{dsn:ze(o)}),[[{type:"profile_chunk",platform:"javascript"},t]]);n.sendEnvelope(s).then(null,a=>{v&&h.error("Error while sending profile chunk envelope:",a)})}};var bL="BrowserProfiling",AL=()=>({name:bL,setup(e){let t=e.getOptions(),n=new ll;if(!ba(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),ba(t)&&!t.profilesSampleRate){v&&h.log("[Profiling] Profiling disabled, no profiling options found.");return}let r=te(),o=r&&re(r);if(ba(t)&&t.profileSessionSampleRate!==void 0&&v&&h.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),ba(t))o&&al(o)&&jd(o)&&zd(o),e.on("spanStart",i=>{let s=re(i);i===s?jd(i)&&zd(i):ul.has(s)&&Oo(i)}),e.on("beforeEnvelope",i=>{if(!Ly())return;let s=xy(i);if(!s.length)return;let a=[];for(let c of s){let u=c?.contexts,f=u?.profile?.profile_id,l=u?.profile?.start_timestamp;if(typeof f!="string"){v&&h.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!f){v&&h.log("[Profiling] cannot find profile for a span without a profile context");continue}u?.profile&&delete u.profile;let m=Py(f);if(!m){v&&h.log(`[Profiling] Could not retrieve profile for span: ${f}`);continue}let d=My(f,l,m,c);d&&a.push(d)}Cy(i,a)});else{let i=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),i==="manual")n.initialize(e);else if(i==="trace"){if(!Ge(t)){v&&h.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),w.setTimeout(()=>{let s=te(),a=s&&re(s);a&&n.notifyRootSpanActive(a)},0)}}}}),vL=AL;var RL="SpotlightBrowser",NL=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],CL=(e={})=>{let t=e.sidecarUrl||"http://localhost:8969/stream";return{name:RL,setup:()=>{v&&h.log("Using Sidecar URL",t)},beforeSetup(n){let r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...NL]},afterAllSetup:n=>{xL(n,t)}}};function xL(e,t){let n=Ci("fetch"),r=0;e.on("beforeEnvelope",o=>{if(r>3){h.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:tr(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,h.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}var wL=CL;var kL=()=>({name:"LaunchDarkly",processEvent(e,t,n){return Dt(e)}});function OL(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{xt(e,t.value),wt(e,t.value)}}}var ML=()=>({name:"OpenFeature",processEvent(e,t,n){return Dt(e)}}),qd=class{after(t,n){xt(n.flagKey,n.value),wt(n.flagKey,n.value)}error(t,n,r){xt(t.flagKey,t.defaultValue),wt(t.flagKey,t.defaultValue)}};var LL=({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){let t=e.prototype;ye(t,"isEnabled",PL)},processEvent(t,n,r){return Dt(t)}});function PL(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"?(xt(n,r),wt(n,r)):v&&h.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var UL=({growthbookClass:e})=>Cf({growthbookClass:e});var DL=({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",n=>{xt(n.gate.name,n.gate.value),wt(n.gate.name,n.gate.value)})},processEvent(t,n,r){return Dt(t)}});async function BL(){let e=I();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";let 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{await Ss(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}var FL="WebWorker",GL=({worker:e})=>({name:FL,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(t=>Dy(t))},addWorker:t=>Dy(t)});function Dy(e){e.addEventListener("message",t=>{if(WL(t.data)){if(t.stopImmediatePropagation(),t.data._sentryDebugIds&&(v&&h.log("Sentry debugId web worker message received",t.data),w._sentryDebugIds=p(p({},t.data._sentryDebugIds),w._sentryDebugIds)),t.data._sentryModuleMetadata&&(v&&h.log("Sentry module metadata web worker message received",t.data),w._sentryModuleMetadata=p(p({},t.data._sentryModuleMetadata),w._sentryModuleMetadata)),t.data._sentryWasmImages){v&&h.log("Sentry WASM images web worker message received",t.data);let n=w._sentryWasmImages||[],r=t.data._sentryWasmImages.filter(o=>Me(o)&&typeof o.code_file=="string"&&!n.some(i=>i.code_file===o.code_file));w._sentryWasmImages=[...n,...r]}t.data._sentryWorkerError&&(v&&h.log("Sentry worker rejection message received",t.data._sentryWorkerError),HL(t.data._sentryWorkerError))}})}function HL(e){let t=I();if(!t)return;let n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,o=e.reason,i=We(o)?Pp(o):yi(n,o,void 0,r,!0);i.level="error",e.filename&&(i.contexts=E(p({},i.contexts),{worker:{filename:e.filename}})),hn(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),v&&h.log("Captured worker unhandled rejection",o)}function $L({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener("unhandledrejection",t=>{let r={reason:Lp(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),v&&h.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),v&&h.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function WL(e){if(!Me(e)||e._sentryMessage!==!0)return!1;let t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,r="_sentryWorkerError"in e,o="_sentryWasmImages"in e;return!(!t&&!n&&!r&&!o||t&&!(Me(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(Me(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!Me(e._sentryWorkerError)||o&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(i=>Me(i)&&typeof i.code_file=="string")))}var By=typeof __SENTRY_DEBUG__>"u"?!0:__SENTRY_DEBUG__;function zL(e={}){return[ao(),so(),ni(),ea(),ra(),ia(),uo(),oa(),na(),ta()]}function aJ(e){let t=p({defaultIntegrations:zL()},e);return ei(t,"angular"),qL(),Dp(t)}function qL(){let t=fl?.major&&parseInt(fl.major,10);t&&(t<14&&By&&h.warn(`This Sentry SDK does not officially support Angular ${t}.`,"This SDK only supports Angular 14 and above.","If you're using lower Angular versions, check the Angular Version Compatibility table in our docs: https://docs.sentry.io/platforms/javascript/guides/angular/#angular-version-compatibility.","Otherwise, please consider upgrading your Angular version."),no("angular",{version:t}))}var YL=typeof Zone<"u"&&Zone.root?.run;function An(e){return YL?Zone.root.run(e):e()}function VL(e){return e?.ngOriginalError?e.ngOriginalError:e}function KL(e){return Fy(e.error)?e.error:typeof ErrorEvent<"u"&&e.error instanceof ErrorEvent&&e.error.message?e.error.message:typeof e.error=="string"?`Server returned code ${e.status} with body "${e.error}"`:e.message}function Fy(e){if(e instanceof Error)return!0;if(e===null||typeof e!="object")return!1;let t=e;return Oe(t.name)&&Oe(t.message)&&(t.stack===void 0||Oe(t.stack))}var JL=(()=>{class e{constructor(n){this._options=p({logErrors:!0},n)}ngOnDestroy(){this._removeAfterSendEventListener&&this._removeAfterSendEventListener()}handleError(n){let r=this._extractError(n)||"Handled unknown error",o=An(()=>J(r,{mechanism:{type:"auto.function.angular.error_handler",handled:!1}}));if(this._options.logErrors&&Fe(()=>console.error(r)),this._options.showDialog){let i=I();i&&!this._removeAfterSendEventListener?this._removeAfterSendEventListener=i.on("afterSendEvent",s=>{!s.type&&s.event_id&&An(()=>{bu(E(p({},this._options.dialogOptions),{eventId:s.event_id}))})}):i||An(()=>{bu(E(p({},this._options.dialogOptions),{eventId:o}))})}}_extractError(n){if(this._options.extractor){let r=this._defaultExtractor.bind(this);return this._options.extractor(n,r)}return this._defaultExtractor(n)}_defaultExtractor(n){let r=VL(n);return r instanceof em?KL(r):typeof r=="string"||Fy(r)?r:null}}return e.\u0275fac=function(n){return new(n||e)(dl("errorHandlerOptions"))},e.\u0275prov=pl({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function cJ(e){return new JL(e)}var XL="ui.angular.routing",Gy="ui.angular.init",QL="ui.angular",Hy;function uJ(e={}){return e.instrumentNavigation!==!1&&(Hy=!0),Bd(E(p({},e),{instrumentNavigation:!1}))}function ZL(e,t){let n=t&&P(t).data||{};t&&n[de]==="url"&&(t.updateName(e),t.setAttribute(de,"route"),t.setAttribute(H,`auto.${P(t).op}.angular`))}var lJ=(()=>{class e{constructor(n){this._router=n,this.navStart$=this._router.events.pipe(va(r=>r instanceof tm),Ra(r=>{if(!Hy){By&&h.error("Angular integration has tracing enabled, but Tracing integration is not configured");return}this._routingSpan&&(this._routingSpan.end(),this._routingSpan=null);let o=I(),i=_n(r.url);if(o){this._isPageloadOngoing()?this._pageloadOngoing=!1:An(()=>{il(o,{name:i,attributes:{[H]:"auto.navigation.angular",[de]:"url"}})}),this._routingSpan=An(()=>Le({name:`${r.url}`,op:XL,attributes:p({[H]:"auto.ui.angular",[de]:"url",url:i},r.navigationTrigger&&{navigationTrigger:r.navigationTrigger})}))||null;return}})),this.resEnd$=this._router.events.pipe(va(r=>r instanceof im),Ra(r=>{let o=eP(r.state.root);o&&M().setTransactionName(o);let i=te(),s=i&&re(i);ZL(o,s)})),this.navEnd$=this._router.events.pipe(va(r=>r instanceof nm||r instanceof rm||r instanceof om),Ra(()=>{this._routingSpan&&(An(()=>{this._routingSpan.end()}),this._routingSpan=null)})),this._routingSpan=null,this._pageloadOngoing=!0,this._subscription=new Vd,this._subscription.add(this.navStart$.subscribe()),this._subscription.add(this.resEnd$.subscribe()),this._subscription.add(this.navEnd$.subscribe())}ngOnDestroy(){this._subscription.unsubscribe()}_isPageloadOngoing(){if(!this._pageloadOngoing)return!1;let n=te();if(!n)return this._pageloadOngoing=!1,!1;let r=re(n);return this._pageloadOngoing=P(r).op==="pageload",this._pageloadOngoing}}return e.\u0275fac=function(n){return new(n||e)(dl(sm))},e.\u0275prov=pl({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),fJ=(()=>{class e{constructor(n){this._host=n}ngOnInit(){this.componentName||(this.componentName=this._host.nativeElement.tagName.toLowerCase()),te()&&(this._tracingSpan=An(()=>Le({name:`<${this.componentName}>`,op:Gy,attributes:{[H]:"auto.ui.angular.trace_directive"}})))}ngAfterViewInit(){let n=this._tracingSpan;n&&An(()=>n.end())}}return e.\u0275fac=function(n){return new(n||e)(Xd(Jd))},e.\u0275dir=Zd({type:e,selectors:[["","trace",""]],inputs:{componentName:[0,"trace","componentName"]},standalone:!1}),e})(),pJ=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=Qd({type:e}),e.\u0275inj=Kd({}),e})();function dJ(e){let t;return n=>{let r=n.prototype.ngOnInit;n.prototype.ngOnInit=function(...i){if(t=An(()=>Le({onlyIfParent:!0,name:`<${e?.name||"unnamed"}>`,op:Gy,attributes:{[H]:"auto.ui.angular.trace_class_decorator"}})),r)return r.apply(this,i)};let o=n.prototype.ngAfterViewInit;n.prototype.ngAfterViewInit=function(...i){if(t&&An(()=>t.end()),o)return o.apply(this,i)}}}function mJ(e){return(t,n,r)=>{let o=r.value;return r.value=function(...i){let s=ne();if(An(()=>{Le({onlyIfParent:!0,name:`<${e?.name?e.name:"unnamed"}>`,op:`${QL}.${String(n)}`,startTime:s,attributes:{[H]:"auto.ui.angular.trace_method_decorator"}}).end(s)}),o)return o.apply(this,i)},r}}function eP(e){let t=[],n=e?.firstChild;for(;n;){let o=n?.routeConfig&&n.routeConfig.path;if(o==null)break;t.push(o),n=n.firstChild}let r=t.filter(o=>o).join("/");return r?`/${r}/`:"/"}export{qs as BrowserClient,Os as MULTIPLEXED_TRANSPORT_EXTRA_KEY,qd as OpenFeatureIntegrationHook,Pt as SDK_VERSION,q as SEMANTIC_ATTRIBUTE_SENTRY_OP,H as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,Yn as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,de as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,ht as Scope,JL as SentryErrorHandler,dJ as TraceClass,fJ as TraceDirective,mJ as TraceMethod,pJ as TraceModule,lJ as TraceService,w as WINDOW,St as addBreadcrumb,vs as addEventProcessor,Jo as addIntegration,ea as breadcrumbsIntegration,Mp as browserApiErrorsIntegration,vL as browserProfilingIntegration,ta as browserSessionIntegration,uJ as browserTracingIntegration,OL as buildLaunchDarklyFlagUsedHandler,dh as captureConsoleIntegration,hn as captureEvent,J as captureException,Ms as captureFeedback,Is as captureMessage,ro as captureSession,SE as chromeStackLineParser,Zl as close,Bh as consoleLoggingIntegration,G0 as contextLinesIntegration,Dl as continueTrace,Fh as createConsolaReporter,cJ as createErrorHandler,Bs as createLangChainCallbackHandler,Tc as createTransport,Bx as createUserFeedbackEnvelope,na as cultureContextIntegration,uo as dedupeIntegration,ol as defaultRequestInstrumentationOptions,TE as defaultStackLineParsers,Op as defaultStackParser,BL as diagnoseSdkConnectivity,mE as elementTimingIntegration,Rs as endSession,Ac as eventFiltersIntegration,sp as eventFromException,ap as eventFromMessage,zs as exceptionFromError,gh as extraErrorDataIntegration,Mh as featureFlagsIntegration,tC as feedbackAsyncIntegration,jS as feedbackIntegration,jS as feedbackSyncIntegration,Ud as fetchStreamPerformanceIntegration,Ql as flush,S0 as forceLoad,so as functionToStringIntegration,EE as geckoStackLineParser,te as getActiveSpan,I as getClient,M as getCurrentScope,zL as getDefaultIntegrations,fN as getFeedback,fn as getGlobalScope,ce as getIsolationScope,EM as getReplay,re as getRootSpan,Xn as getSpanDescendants,wl as getSpanStatusFromHttpCode,ti as getTraceData,ra as globalHandlersIntegration,V0 as graphqlClientIntegration,UL as growthbookIntegration,R0 as httpClientIntegration,oa as httpContextIntegration,ao as inboundFiltersIntegration,aJ as init,Rg as instrumentAnthropicAiClient,Kg as instrumentCreateReactAgent,Og as instrumentGoogleGenAIClient,oS as instrumentLangChainEmbeddings,Jg as instrumentLangGraph,hg as instrumentOpenAiClient,Pd as instrumentOutgoingRequests,Nf as instrumentSupabaseClient,gy as isBotUserAgent,As as isEnabled,ef as isInitialized,bs as lastEventId,kL as launchDarklyIntegration,rp as lazyLoadIntegration,ia as linkedErrorsIntegration,wf as logger,uL as makeBrowserOfflineTransport,Zs as makeFetchTransport,th as makeMultiplexedTransport,lo as metrics,fh as moduleMetadataIntegration,Up as normalizeStringifyValue,E0 as onLoad,ML as openFeatureIntegration,Lx as opera10StackLineParser,Dx as opera11StackLineParser,yf as parameterize,oc as registerSpanErrorInstrumentation,$L as registerWebWorker,UM as replayCanvasIntegration,gM as replayIntegration,eL as reportPageLoaded,b0 as reportingObserverIntegration,bh as rewriteFramesIntegration,xS as sendFeedback,tL as setActiveSpanInBrowser,no as setContext,Xl as setConversationId,gf as setCurrentClient,Yl as setExtra,ql as setExtras,Kn as setHttpStatus,ms as setMeasurement,Kl as setTag,Vl as setTags,Jl as setUser,bu as showReportDialog,nL as spanStreamingIntegration,Ul as spanToBaggageHeader,P as spanToJSON,cs as spanToTraceHeader,wL as spotlightBrowserIntegration,il as startBrowserTracingNavigationSpan,Sy as startBrowserTracingPageLoadSpan,Le as startInactiveSpan,lc as startNewTrace,Ko as startSession,Je as startSpan,gt as startSpanManual,DL as statsigIntegration,Nh as supabaseIntegration,Ss as suppressTracing,wh as thirdPartyErrorFilterIntegration,_x as uiProfiler,LL as unleashIntegration,Pl as updateSpanName,K0 as viewHierarchyIntegration,GL as webWorkerIntegration,kx as winjsStackLineParser,Ir as withActiveSpan,Ua as withIsolationScope,Ke as withScope,Qm as withStreamedSpan,Ch as zodErrorsIntegration};
|