@kubit-ai/sentry 0.1.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/LICENSE +17 -0
- package/README.md +132 -0
- package/dist/browser/kubit-sentry.global.js +505 -0
- package/dist/browser.d.ts +60 -0
- package/dist/browser.js +121 -0
- package/dist/browser.js.map +1 -0
- package/dist/config.d.ts +41 -0
- package/dist/config.js +34 -0
- package/dist/config.js.map +1 -0
- package/dist/exporter.d.ts +35 -0
- package/dist/exporter.js +94 -0
- package/dist/exporter.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/integration.d.ts +41 -0
- package/dist/integration.js +97 -0
- package/dist/integration.js.map +1 -0
- package/dist/sentryToOtel.d.ts +23 -0
- package/dist/sentryToOtel.js +316 -0
- package/dist/sentryToOtel.js.map +1 -0
- package/dist/session.d.ts +52 -0
- package/dist/session.js +125 -0
- package/dist/session.js.map +1 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
"use strict";var KubitSentry=(()=>{var $l=Object.defineProperty;var TI=Object.getOwnPropertyDescriptor;var yI=Object.getOwnPropertyNames;var II=Object.prototype.hasOwnProperty;var ba=(e,t)=>{for(var n in t)$l(e,n,{get:t[n],enumerable:!0})},bI=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of yI(t))!II.call(e,o)&&o!==n&&$l(e,o,{get:()=>t[o],enumerable:!(r=TI(t,o))||r.enumerable});return e};var AI=e=>bI($l({},"__esModule",{value:!0}),e);var gP={};ba(gP,{Sentry:()=>Bl,createRollingSession:()=>Gl,init:()=>mP,kubitSentryIntegration:()=>Hl,trackEvent:()=>_P});var Bl={};ba(Bl,{BrowserClient:()=>Ni,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>ri,OpenFeatureIntegrationHook:()=>Dl,SDK_VERSION:()=>It,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>q,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>$,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>bn,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>he,Scope:()=>it,WINDOW:()=>N,addBreadcrumb:()=>pt,addEventProcessor:()=>Zo,addIntegration:()=>ro,breadcrumbsIntegration:()=>Fu,browserApiErrorsIntegration:()=>Hu,browserProfilingIntegration:()=>nI,browserSessionIntegration:()=>Gu,browserTracingIntegration:()=>wl,buildLaunchDarklyFlagUsedHandler:()=>iI,captureConsoleIntegration:()=>qp,captureEvent:()=>qt,captureException:()=>J,captureFeedback:()=>ii,captureMessage:()=>Ko,captureSession:()=>Tr,chromeStackLineParser:()=>dd,close:()=>Ic,consoleLoggingIntegration:()=>nf,contextLinesIntegration:()=>zE,continueTrace:()=>lc,createConsolaReporter:()=>of,createLangChainCallbackHandler:()=>gi,createTransport:()=>Os,createUserFeedbackEnvelope:()=>xE,cultureContextIntegration:()=>$u,dedupeIntegration:()=>Bs,defaultRequestInstrumentationOptions:()=>ha,defaultStackLineParsers:()=>_d,defaultStackParser:()=>Du,diagnoseSdkConnectivity:()=>lI,elementTimingIntegration:()=>ed,endSession:()=>ei,eventFiltersIntegration:()=>Lc,eventFromException:()=>yu,eventFromMessage:()=>Iu,exceptionFromError:()=>vi,extraErrorDataIntegration:()=>Yp,featureFlagsIntegration:()=>Qp,feedbackAsyncIntegration:()=>JS,feedbackIntegration:()=>Bf,feedbackSyncIntegration:()=>Bf,fetchStreamPerformanceIntegration:()=>xl,flush:()=>yc,forceLoad:()=>PE,functionToStringIntegration:()=>Us,geckoStackLineParser:()=>md,getActiveSpan:()=>ee,getClient:()=>T,getCurrentScope:()=>w,getDefaultIntegrations:()=>Sd,getFeedback:()=>US,getGlobalScope:()=>zt,getIsolationScope:()=>se,getReplay:()=>sy,getRootSpan:()=>ne,getSpanDescendants:()=>Rn,getSpanStatusFromHttpCode:()=>Ja,getTraceData:()=>ao,globalHandlersIntegration:()=>Wu,graphqlClientIntegration:()=>KE,growthbookIntegration:()=>cI,httpClientIntegration:()=>GE,httpContextIntegration:()=>ju,inboundFiltersIntegration:()=>Ds,init:()=>Yu,instrumentAnthropicAiClient:()=>df,instrumentCreateReactAgent:()=>Sf,instrumentGoogleGenAIClient:()=>_f,instrumentLangChainEmbeddings:()=>Tf,instrumentLangGraph:()=>Ef,instrumentOpenAiClient:()=>lf,instrumentOutgoingRequests:()=>Cl,instrumentSupabaseClient:()=>Hc,isBotUserAgent:()=>Sm,isEnabled:()=>Qo,isInitialized:()=>bc,lastEventId:()=>Xo,launchDarklyIntegration:()=>oI,lazyLoadIntegration:()=>Eu,linkedErrorsIntegration:()=>zu,logger:()=>Wc,makeBrowserOfflineTransport:()=>By,makeFetchTransport:()=>Ui,makeMultiplexedTransport:()=>Dp,metrics:()=>Ar,moduleMetadataIntegration:()=>zp,normalizeStringifyValue:()=>qu,onLoad:()=>UE,openFeatureIntegration:()=>sI,opera10StackLineParser:()=>RE,opera11StackLineParser:()=>NE,parameterize:()=>Oc,registerSpanErrorInstrumentation:()=>Es,registerWebWorker:()=>dI,replayCanvasIntegration:()=>yy,replayIntegration:()=>iy,reportPageLoaded:()=>Py,reportingObserverIntegration:()=>FE,rewriteFramesIntegration:()=>Vp,sendFeedback:()=>kf,setActiveSpanInBrowser:()=>Uy,setContext:()=>Jo,setConversationId:()=>Tc,setCurrentClient:()=>wc,setExtra:()=>gc,setExtras:()=>_c,setHttpStatus:()=>vn,setMeasurement:()=>Qr,setTag:()=>Sc,setTags:()=>hc,setUser:()=>Ec,showReportDialog:()=>DE,spanStreamingIntegration:()=>Dy,spanToBaggageHeader:()=>ic,spanToJSON:()=>L,spanToTraceHeader:()=>$o,spotlightBrowserIntegration:()=>rI,startBrowserTracingNavigationSpan:()=>Tm,startBrowserTracingPageLoadSpan:()=>Em,startInactiveSpan:()=>Ke,startNewTrace:()=>vs,startSession:()=>no,startSpan:()=>Ue,startSpanManual:()=>ct,statsigIntegration:()=>uI,supabaseIntegration:()=>Kp,suppressTracing:()=>zo,thirdPartyErrorFilterIntegration:()=>Xp,uiProfiler:()=>AE,unleashIntegration:()=>aI,updateSpanName:()=>rc,viewHierarchyIntegration:()=>JE,webVitalsIntegration:()=>kl,webWorkerIntegration:()=>fI,winjsStackLineParser:()=>vE,withActiveSpan:()=>Jn,withIsolationScope:()=>cs,withScope:()=>We,withStreamedSpan:()=>up,zodErrorsIntegration:()=>Jp});var y=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var R=globalThis;var It="10.57.0";function mt(){return ur(R),R}function ur(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||It,t[It]=t[It]||{}}function an(e,t,n=R){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[It]=r[It]||{};return o[e]||(o[e]=t())}var lr=["debug","info","warn","error","log","assert","trace"],vI="Sentry Logger ",Wr={};function Ye(e){if(!("console"in R))return e();let t=R.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 RI(){jl().enabled=!0}function NI(){jl().enabled=!1}function wm(){return jl().enabled}function CI(...e){Wl("log",...e)}function xI(...e){Wl("warn",...e)}function kI(...e){Wl("error",...e)}function Wl(e,...t){y&&wm()&&Ye(()=>{R.console[e](`${vI}[${e}]:`,...t)})}function jl(){return y?an("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var _={enable:RI,disable:NI,isEnabled:wm,log:CI,warn:xI,error:kI};var Om=/\(error: (.*)\)/,Mm=/captureMessage|captureException/;function Qi(...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=Om.test(c)?c.replace(Om,"$1"):c;if(!u.includes("Error: ")){for(let p of t){let l=p(u);if(l){i.push(l);break}}if(i.length>=50+o)break}}return ql(i.slice(o))}}function va(e){return Array.isArray(e)?Qi(...e):e}function ql(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Aa(t).function||"")&&t.pop(),t.reverse(),Mm.test(Aa(t).function||"")&&(t.pop(),Mm.test(Aa(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||Aa(t).filename,function:n.function||"?"}))}function Aa(e){return e[e.length-1]||{}}var zl="<anonymous>";function _t(e){try{return!e||typeof e!="function"?zl:e.name||zl}catch{return zl}}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 Zi={},Pm={};function tt(e,t){return Zi[e]=Zi[e]||[],Zi[e].push(t),()=>{let n=Zi[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function nt(e,t){if(!Pm[e]){Pm[e]=!0;try{t()}catch(n){y&&_.error(`Error while instrumenting ${e}`,n)}}}function He(e,t){let n=e&&Zi[e];if(n)for(let r of n)try{r(t)}catch(o){y&&_.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${_t(r)}
|
|
5
|
+
Error:`,o)}}var Yl=null;function es(e){let t="error";tt(t,e),nt(t,wI)}function wI(){Yl=R.onerror,R.onerror=function(e,t,n,r,o){return He("error",{column:r,error:o,line:n,msg:e,url:t}),Yl?Yl.apply(this,arguments):!1},R.onerror.__SENTRY_INSTRUMENTED__=!0}var Vl=null;function ts(e){let t="unhandledrejection";tt(t,e),nt(t,OI)}function OI(){Vl=R.onunhandledrejection,R.onunhandledrejection=function(e){return He("unhandledrejection",e),Vl?Vl.apply(this,arguments):!0},R.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Um=Object.prototype.toString;function Ze(e){switch(Um.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return cn(e,Error)}}function Mo(e,t){return Um.call(e)===`[object ${t}]`}function Lo(e){return Mo(e,"ErrorEvent")}function ns(e){return Mo(e,"DOMError")}function Ra(e){return Mo(e,"DOMException")}function Ve(e){return Mo(e,"String")}function In(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ge(e){return e===null||In(e)||typeof e!="object"&&typeof e!="function"}function Me(e){return Mo(e,"Object")}function pr(e){return typeof Event<"u"&&cn(e,Event)}function Na(e){return Mo(e,"RegExp")}function gt(e){return!!(e?.then&&typeof e.then=="function")}function cn(e,t){try{return e instanceof t}catch{return!1}}function rs(e){return typeof Request<"u"&&cn(e,Request)}function Ee(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&os(o,r);try{e[t]=o}catch{y&&_.log(`Failed to replace method "${t}" in object`,e)}}function _e(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{y&&_.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function os(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,_e(e,"__sentry_original__",t)}catch{}}function fr(e){return e.__sentry_original__}function is(e){if(Ze(e))return{message:e.message,name:e.name,stack:e.stack,...Dm(e)};if(pr(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return{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 Ca(e){let t=Object.keys(is(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Po;function zr(e){if(Po!==void 0)return Po?Po(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=R;return t in n&&typeof n[t]=="function"?(Po=n[t],Po(e)):(Po=null,e())}function bt(){return zr(()=>Math.random())}function rt(){return zr(()=>Date.now())}var Bm=Symbol.for("sentry.skipNormalization"),MI=Symbol.for("sentry.overrideNormalizationDepth");function Fm(e){_e(e,Bm,!0)}function Hm(e){return!!e[Bm]}function Gm(e){let t=e[MI];return typeof t=="number"?t:void 0}var Kl;function xa(e){Kl=e}function Re(e,t=100,n=1/0){try{return Jl("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ss(e,t=3,n=100*1024){let r=Re(e,t);return UI(r)>n?ss(e,t-1,n):r}function Jl(e,t,n=1/0,r=1/0,o=DI()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=Xl(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 p=t;if(p&&typeof p.toJSON=="function")try{let m=p.toJSON();return Jl("",m,u-1,r,o)}catch{}let l=Array.isArray(t)?[]:{},d=0,f=is(t);for(let m in f){if(!Object.prototype.hasOwnProperty.call(f,m))continue;if(d>=r){l[m]="[MaxProperties ~]";break}let g=f[m];l[m]=Jl(m,g,u-1,r,o),d++}return s(t),l}function Xl(e,t){try{if(Kl){let r=Kl(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${_t(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${LI(t)}]`}catch(n){return`**non-serializable** (${n})`}}function LI(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function PI(e){return~-encodeURI(e).split(/%..|./).length}function UI(e){return PI(JSON.stringify(e))}function DI(){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 un(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Uo(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 dr(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];Ge(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(Xl(void 0,o))}return n.join(t)}function mr(e,t,n=!1){return Ve(e)?Na(t)?t.test(e):Ve(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function $e(e,t=[],n=!1){for(let r of t)if(mr(e,r,n))return!0;return!1}function BI(){let e=R;return e.crypto||e.msCrypto}var Ql;function FI(){return bt()*16}function de(e=BI()){try{if(e?.randomUUID)return zr(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Ql||(Ql="10000000100040008000"+1e11),Ql.replace(/[018]/g,t=>(t^(FI()&15)>>t/4).toString(16))}function $m(e){return e.exception?.values?.[0]}function ln(e){let{message:t,event_id:n}=e;if(t)return t;let r=$m(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function qr(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 Xe(e,t){let n=$m(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){let i={...o?.data,...t.data};n.mechanism.data=i}}function ka(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=>Uo(s,0));let i=Math.min(r-1,o);t.context_line=Uo(e[i],t.colno||0),t.post_context=e.slice(Math.min(o+1,r),o+1+n).map(s=>Uo(s,0))}function as(e){if(Zl(e))return!0;try{_e(e,"__sentry_captured__",!0)}catch{}return!1}function Zl(e){try{return e.__sentry_captured__}catch{}}var jm=1e3;function At(){return rt()/jm}function HI(){let{performance:e}=R;if(!e?.now||!e.timeOrigin)return At;let t=e.timeOrigin;return()=>(t+zr(()=>e.now()))/jm}var Wm;function Z(){return(Wm??(Wm=HI()))()}var ep=null;function GI(){let{performance:e}=R;if(!e?.now)return;let t=3e5,n=zr(()=>e.now()),r=rt(),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 le(){return ep===null&&(ep=GI()),ep}function zm(e){let t=Z(),n={sid:de(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>$I(n)};return e&&$n(n,e),n}function $n(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||Z(),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:de()),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 qm(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),$n(e,n)}function $I(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 _r(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=_r(r[o],t[o],n-1));return r}function et(){return de()}function ot(){return de().substring(16)}function wa(e){try{let t=R.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Oa(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var tp="_sentrySpan";function ht(e,t){t?_e(e,tp,wa(t)):delete e[tp]}function pn(e){return Oa(e[tp])}var WI=100,it=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:et(),sampleRand:bt()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...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={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,ht(t,pn(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&&$n(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={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...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={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...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:p=[],propagationContext:l,conversationId:d}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...i},this._extra={...this._extra,...s},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),p.length&&(this._fingerprint=p),l&&(this._propagationContext=l),d&&(this._conversationId=d),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,ht(this,void 0),this._attachments=[],this.setPropagationContext({traceId:et(),sampleRand:bt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:WI;if(r<=0)return this;let o={timestamp:At(),...t,message:t.message?un(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:pn(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=_r(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||de();if(!this._client)return y&&_.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){let o=r?.event_id||de();if(!this._client)return y&&_.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:o},this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||de();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(y&&_.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 Ym(){return an("defaultCurrentScope",()=>new it)}function Vm(){return an("defaultIsolationScope",()=>new it)}var Km=e=>e instanceof Promise&&!e[Jm],Jm=Symbol("chained PromiseLike"),Ma=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Km(r)&&Km(e)?r:jI(e,r)},jI=(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,{[Jm]:!0}),t};var np=class{constructor(t,n){let r;t?r=t:r=new it;let o;n?o=n:o=new it,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 gt(r)?Ma(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 Do(){let e=mt(),t=ur(e);return t.stack=t.stack||new np(Ym(),Vm())}function zI(e){return Do().withScope(e)}function qI(e,t){let n=Do();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Xm(e){return Do().withScope(()=>e(Do().getIsolationScope()))}function Qm(){return{withIsolationScope:Xm,withScope:zI,withSetScope:qI,withSetIsolationScope:(e,t)=>Xm(t),getCurrentScope:()=>Do().getScope(),getIsolationScope:()=>Do().getIsolationScope()}}function jt(e){let t=ur(e);return t.acs?t.acs:Qm()}function YI(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function VI(e,t){let{value:n,unit:r}=YI(e)?e:{value:e,unit:void 0},o=KI(n),i=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...i};if(!t||t==="skip-undefined"&&n===void 0)return;let s="";try{s=JSON.stringify(n)??""}catch{}return{value:s,type:"string",...i}}function Wn(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=VI(o,t);i&&(n[r]=i)}return n}function rp(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+=Zm(o[0])*o.length:Ge(o)?t+=Zm(o):t+=100}return t}function Zm(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function KI(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 e_;function op(){return e_?.()}function La(){return e_!==void 0}function w(){let e=mt();return jt(e).getCurrentScope()}function se(){let e=mt();return jt(e).getIsolationScope()}function zt(){return an("globalScope",()=>new it)}function We(...e){let t=mt(),n=jt(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function cs(...e){let t=mt(),n=jt(t);if(e.length===2){let[r,o]=e;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(e[0])}function T(){return w().getClient()}function Bo(e){let t=op();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||ot()};return o&&(s.parent_span_id=o),s}var he="sentry.source",bn="sentry.sample_rate",Fo="sentry.previous_trace_sample_rate",q="sentry.op",$="sentry.origin",jn="sentry.idle_span_finish_reason",fn="sentry.measurement_unit",dn="sentry.measurement_value",Pa="sentry.release",Ua="sentry.environment",Da="sentry.segment.name",Ba="sentry.segment.id",Fa="sentry.sdk.name",Ha="sentry.sdk.version",Ga="sentry.sdk.integrations",$a="user.id",Wa="user.email",ja="user.ip_address",za="user.name",An="sentry.custom_span_name",Yr="sentry.profile_id",st="sentry.exclusive_time";var qa="http.request.method",Ya="url.full",Va="sentry.link.type",Ka="gen_ai.conversation.id";function Ja(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 vn(e,t){e.setAttribute("http.response.status_code",t);let n=Ja(t);n.message!=="unknown_error"&&e.setStatus(n)}var t_="_sentryScope",n_="_sentryIsolationScope";function r_(e,t,n){e&&(_e(e,n_,wa(n)),_e(e,t_,t))}function zn(e){let t=e;return{scope:t[t_],isolationScope:Oa(t[n_])}}var us="sentry-";var JI=8192;function Ho(e){let t=XI(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(us)){let s=o.slice(us.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function Xa(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${us}${r}`]=o),n),{});return QI(t)}function XI(e){if(!(!e||!Ve(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=o_(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):o_(e)}function o_(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 QI(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>JI?(y&&_.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var ZI=/^o(\d+)\./,eb=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function tb(e){return e==="http"||e==="https"}function je(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 Qa(e){let t=eb.exec(e);if(!t){Ye(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",i="",s="",a=""]=t.slice(1),c="",u=a,p=u.split("/");if(p.length>1&&(c=p.slice(0,-1).join("/"),u=p.pop()),u){let l=u.match(/^\d+/);l&&(u=l[0])}return i_({host:i,pass:o,path:c,projectId:u,port:s,protocol:n,publicKey:r})}function i_(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function nb(e){if(!y)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(_.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?tb(r)?t&&isNaN(parseInt(t,10))?(_.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(_.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(_.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function rb(e){return e.match(ZI)?.[1]}function Za(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=rb(n)),r}function ls(e){let t=typeof e=="string"?Qa(e):i_(e);if(!(!t||!nb(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 ec=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function s_(e){if(!e)return;let t=e.match(ec);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 ps(e,t){let n=s_(e),r=Ho(t);if(!n?.traceId)return{traceId:et(),sampleRand:bt()};let o=ob(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 fs(e=et(),t=ot(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function ds(e=et(),t=ot(),n){return`00-${e}-${t}-${n?"01":"00"}`}function ob(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?bt()*r:r+bt()*(1-r):bt()}function ip(e,t){let n=Za(e);return t&&n&&t!==n?(_.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)?(_.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 tc=0,_s=1,a_=!1;function l_(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:c}=L(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:c}}function Go(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:L(e).parent_span_id,i=zn(e).scope,s=r?i?.getPropagationContext().propagationSpanId||ot():t;return{parent_span_id:o,span_id:s,trace_id:n}}function $o(e){let{traceId:t,spanId:n}=e.spanContext(),r=at(e);return fs(t,n,r)}function p_(e){let{traceId:t,spanId:n}=e.spanContext(),r=at(e);return ds(t,n,r)}function gs(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:i})=>({span_id:t,trace_id:n,sampled:r===_s,attributes:i,...o}))}function ap(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===_s,attributes:o}))}function vt(e){return typeof e=="number"?c_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?c_(e.getTime()):Z()}function c_(e){return e>9999999999?e/1e3:e}function L(e){if(m_(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(d_(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:f_(e),start_timestamp:vt(o),timestamp:vt(s)||void 0,status:hs(a),op:r[q],origin:r[$],links:gs(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function gr(e){if(m_(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(d_(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:f_(e),start_timestamp:vt(o),end_timestamp:vt(s),is_segment:e===Kr(e),status:cp(a),attributes:r,links:ap(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Kr(e)}}function f_(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function nc(e){return{...e,attributes:Wn(e.attributes),links:e.links?.map(t=>({...t,attributes:Wn(t.attributes)}))}}function d_(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function m_(e){return typeof e.getSpanJSON=="function"}function at(e){let{traceFlags:t}=e.spanContext();return t===_s}function hs(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function cp(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var Vr="_sentryChildSpans",sp="_sentryRootSpan";function Ss(e,t){let n=e[sp]||e;_e(t,sp,n),e[Vr]?e[Vr].add(t):_e(e,Vr,new Set([t]))}function __(e,t){e[Vr]&&e[Vr].delete(t)}function Rn(e){let t=new Set;function n(r){if(!t.has(r)&&at(r)){t.add(r);let o=r[Vr]?Array.from(r[Vr]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var ne=Kr;function Kr(e){return e[sp]||e}function ee(){let e=mt(),t=jt(e);return t.getActiveSpan?t.getActiveSpan():pn(w())}function Jr(){a_||(Ye(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),a_=!0)}function rc(e,t){e.updateName(t),e.setAttributes({[he]:"custom",[An]:t})}var g_=!1;function Es(){if(g_)return;function e(){let t=ee(),n=t&&ne(t);if(n){let r="internal_error";y&&_.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}g_=!0,es(e),ts(e)}function Be(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||T()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function h_(e){_.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(sb(n)){if(e.description&&mr(e.description,n))return y&&h_(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&&mr(e.description,n.name):!0,i=n.op?e.op&&mr(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,c])=>ib(e.attributes?.[a],c)):!0;if(o&&i&&s)return y&&h_(e),!0}return!1}function ib(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?mr(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function S_(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 sb(e){return typeof e=="string"||e instanceof RegExp}var Yn="production";var E_="_frozenDsc";function Wo(e,t){_e(e,E_,t)}function oc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Yn,release:n.release,public_key:r,trace_id:e,org_id:Za(t)};return t.emit("createDsc",o),o}function hr(e,t){let n=t.getPropagationContext();return n.dsc||oc(n.traceId,e)}function Ne(e){let t=T();if(!t)return{};let n=ne(e),r=L(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[bn]??o[Fo];function a(m){return(typeof s=="number"||typeof s=="string")&&(m.sample_rate=`${s}`),m}let c=n[E_];if(c)return a(c);let u=i?.get("sentry.dsc"),p=u&&Ho(u);if(p)return a(p);let l=oc(e.spanContext().traceId,t),d=o[he]??o["sentry.span.source"],f=r.description;return d!=="url"&&f&&(l.transaction=f),Be()&&(l.sampled=String(at(n)),l.sample_rand=i?.get("sentry.sample_rand")??zn(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function ic(e){let t=Ne(e);return Xa(t)}var ze=class{constructor(t={}){this._traceId=t.traceId||et(),this._spanId=t.spanId||ot(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:tc}}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 up(e){return _e(e,"_streamed",!0),e}function Vn(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function we(e,t=[]){return[e,t]}function Ts(e,t){let[n,r]=e;return[n,[...r,t]]}function Rt(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 Xr(e,t){return Rt(e,(n,r)=>t.includes(r))}function sc(e){let t=ur(R);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function ab(e){let t=ur(R);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function Kn(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(Re(a))}o(c)}}return typeof r=="string"?r:cb(r)}function cb(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(ab(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 T_={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 ub(e){return e in T_}function ys(e){return ub(e)?T_[e]:e}function mn(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function jo(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(rt()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:je(r)},...o&&{trace:o}}}function lb(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...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?{...e.sdk?.settings,...t.settings}:void 0},e}function y_(e,t,n,r){let o=mn(n),i={sent_at:new Date(rt()).toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:je(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return we(i,[s])}function I_(e,t,n,r){let o=mn(n),i=e.type&&e.type!=="replay_event"?e.type:"event";lb(e,n?.sdk);let s=jo(e,o,r,t);return delete e.sdkProcessingMetadata,we(s,[[{type:i},e]])}function b_(e,t){function n(f){return!!f.trace_id&&!!f.public_key}let r=Ne(e[0]),o=t?.getDsn(),i=t?.getOptions().tunnel,s={sent_at:new Date(rt()).toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:je(o)}},{beforeSendSpan:a,ignoreSpans:c}=t?.getOptions()||{},u=c?.length?e.filter(f=>{let m=L(f);return!qn({description:m.description,op:m.op,attributes:m.data},c)}):e,p=e.length-u.length;p&&t?.recordDroppedEvent("before_send","span",p);let l=a?f=>{let m=L(f),g=Vn(a)?m:a(m);return g||(Jr(),m)}:L,d=[];for(let f of u){let m=l(f);m&&d.push(cc(m))}return we(s,d)}function A_(e){if(!y)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=L(e),{spanId:o}=e.spanContext(),i=at(e),s=ne(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:p,description:l}=L(s);u.push(`root ID: ${s.spanContext().spanId}`),p&&u.push(`root op: ${p}`),l&&u.push(`root description: ${l}`)}_.log(`${c}
|
|
8
|
+
${u.join(`
|
|
9
|
+
`)}`)}function v_(e){if(!y)return;let{description:t="< unknown name >",op:n="< unknown op >"}=L(e),{spanId:r}=e.spanContext(),i=ne(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;_.log(s)}function Qr(e,t,n,r=ee()){let o=r&&ne(r);o&&(y&&_.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[dn]:t,[fn]:n}))}function Is(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[fn],i=r[dn];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function Pe(e){return e.getOptions().traceLifecycle==="stream"}var R_=1e3,Sr=class{constructor(t={}){this._traceId=t.traceId||et(),this._spanId=t.spanId||ot(),this._startTime=t.startTimestamp||Z(),this._links=t.links,this._attributes={},this.setAttributes({[$]:"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?_s:tc}}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=vt(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(he,"custom"),this}end(t){this._endTime||(this._endTime=vt(t),v_(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:hs(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[$],profile_id:this._attributes[Yr],exclusive_time:this._attributes[st],measurements:Is(this._events),is_segment:this._isStandaloneSpan&&ne(this)===this||void 0,segment_id:this._isStandaloneSpan?ne(this).spanContext().spanId:void 0,links:gs(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===ne(this),status:cp(this._status),attributes:this._attributes,links:ap(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){y&&_.log("[Tracing] Adding an event to span:",t);let o=N_(n)?n:r||Z(),i=N_(n)?{}:n||{},s={name:t,time:vt(o),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let t=T();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===ne(this)))return;if(this._isStandaloneSpan){this._sampled?fb(b_([this],t)):(y&&_.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Pe(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(zn(this).scope||w()).captureEvent(r)}_convertSpanToTransaction(){if(!C_(L(this)))return;this._name||(y&&_.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=zn(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=Rn(this).filter(l=>l!==this&&!pb(l)).map(l=>L(l)).filter(C_),s=this._attributes[he];delete this._attributes[An];let a=!1;i.forEach(l=>{delete l.data[An],l.op?.startsWith("gen_ai.")&&(a=!0)});let c={contexts:{trace:l_(this)},spans:i.length>R_?i.sort((l,d)=>l.start_timestamp-d.start_timestamp).slice(0,R_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:Ne(this),hasGenAiSpans:a},request:r,...s&&{transaction_info:{source:s}}},u=Is(this._events);return u&&Object.keys(u).length&&(y&&_.log("[Measurements] Adding measurements to transaction event",JSON.stringify(u,void 0,2)),c.measurements=u),c}};function N_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function C_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function pb(e){return e instanceof Sr&&e.isStandaloneSpan()}function fb(e){let t=T();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function bs(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(i){throw t(i),n(),i}return db(o,t,n,r)}function db(e,t,n,r){return gt(e)?Ma(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function x_(e,t,n){if(!Be(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...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 y&&_.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 y&&_.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||y&&_.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[s,i,r]}var As="__SENTRY_SUPPRESS_TRACING__";function Ue(e,t){let n=qo();if(n.startSpan)return n.startSpan(e,t);let r=pp(e),{forceTransaction:o,parentSpan:i,scope:s}=e,a=s?.clone();return We(a,()=>w_(i)(()=>{let u=w(),p=fp(u,i),l=T(),d=e.onlyIfParent&&!p,f=d?new ze:lp({parentSpan:p,spanArguments:r,forceTransaction:o,scope:u});return d&&l?.recordDroppedEvent("no_parent_span","span"),(!O_(f)||!p)&&ht(u,f),bs(()=>t(f),()=>{let{status:m}=L(f);f.isRecording()&&(!m||m==="ok")&&f.setStatus({code:2,message:"internal_error"})},()=>{f.end()})}))}function ct(e,t){let n=qo();if(n.startSpanManual)return n.startSpanManual(e,t);let r=pp(e),{forceTransaction:o,parentSpan:i,scope:s}=e,a=s?.clone();return We(a,()=>w_(i)(()=>{let u=w(),p=fp(u,i),l=e.onlyIfParent&&!p,d=l?new ze:lp({parentSpan:p,spanArguments:r,forceTransaction:o,scope:u});return l&&T()?.recordDroppedEvent("no_parent_span","span"),(!O_(d)||!p)&&ht(u,d),bs(()=>t(d,()=>d.end()),()=>{let{status:f}=L(d);d.isRecording()&&(!f||f==="ok")&&d.setStatus({code:2,message:"internal_error"})})}))}function Ke(e){let t=qo();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=pp(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>We(e.scope,s):o!==void 0?s=>Jn(o,s):s=>s())(()=>{let s=w(),a=fp(s,o),c=T();return e.onlyIfParent&&!a?(c?.recordDroppedEvent("no_parent_span","span"),new ze):lp({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}var lc=(e,t)=>{let n=mt(),r=jt(n);if(r.continueTrace)return r.continueTrace(e,t);let{sentryTrace:o,baggage:i}=e,s=T(),a=Ho(i);return s&&!ip(s,a?.org_id)?vs(t):We(c=>{let u=ps(o,i);return c.setPropagationContext(u),ht(c,void 0),t()})};function Jn(e,t){let n=qo();return n.withActiveSpan?n.withActiveSpan(e,t):We(r=>(ht(r,e||void 0),t(r)))}function zo(e){let t=qo();return t.suppressTracing?t.suppressTracing(e):We(n=>{n.setSDKProcessingMetadata({[As]:!0});let r=e();return n.setSDKProcessingMetadata({[As]:void 0}),r})}function vs(e){let t=qo();return t.startNewTrace?t.startNewTrace(e):We(n=>(n.setPropagationContext({traceId:et(),sampleRand:bt()}),y&&_.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),Jn(null,e)))}function lp({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Be()){let a=new ze;if(n||!e){let c={sampled:"false",sample_rate:"0",transaction:t.name,...Ne(a)};Wo(a,c)}return a}let o=T();if(_b(o,t))return dp(r)||o?.recordDroppedEvent("ignored","span"),new ze({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let i=se(),s;if(e&&!n)s=mb(e,r,t),Ss(e,s);else if(e){let a=Ne(e),{traceId:c,spanId:u}=e.spanContext(),p=at(e);s=k_({traceId:c,parentSpanId:u,...t},r,p),Wo(s,a)}else{let{traceId:a,dsc:c,parentSpanId:u,sampled:p}={...i.getPropagationContext(),...r.getPropagationContext()};s=k_({traceId:a,parentSpanId:u,...t},r,p),c&&Wo(s,c)}return A_(s),r_(s,r,i),s}function pp(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=vt(e.startTime),delete r.startTime,r}return n}function qo(){let e=mt();return jt(e)}function k_(e,t,n){let r=T(),o=r?.getOptions()||{},{name:i=""}=e,s={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r?.emit("beforeSampling",s,{decision:!1});let a=s.parentSampled??n,c=s.spanAttributes,u=t.getPropagationContext(),p=dp(t),[l,d,f]=p?[!1]:x_(o,{name:i,parentSampled:a,attributes:c,parentSampleRate:Ut(u.dsc?.sample_rate)},u.sampleRand),m=new Sr({...e,attributes:{[he]:"custom",[bn]:d!==void 0&&f?d:void 0,...c},sampled:l});return!l&&r&&!p&&(y&&_.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Pe(r)?"span":"transaction")),r&&r.emit("spanStart",m),m}function mb(e,t,n){let{spanId:r,traceId:o}=e.spanContext(),i=dp(t),s=i?!1:at(e),a=s?new Sr({...n,parentSpanId:r,traceId:o,sampled:s}):new ze({traceId:o});Ss(e,a);let c=T();return c&&(Pe(c)&&a instanceof ze&&(e instanceof ze&&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 fp(e,t){if(t)return t;if(t===null)return;let n=pn(e);if(!n)return;let r=T();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ne(n):n}function w_(e){return e!==void 0?t=>Jn(e,t):t=>t()}function _b(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Pe(e)||!n?.length?!1:qn({description:t.name||"",op:t.attributes?.[q]||t.op,attributes:t.attributes},n)}function O_(e){return e instanceof ze&&e.dropReason==="ignored"}function dp(e){return e.getScopeData().sdkProcessingMetadata[As]===!0}var Yo={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},gb="heartbeatFailed",hb="idleTimeout",Sb="finalTimeout",Eb="externalFinish";function pc(e,t={}){let n=new Map,r=!1,o,i=Eb,s=!t.disableAutoFinish,a=[],{idleTimeout:c=Yo.idleTimeout,finalTimeout:u=Yo.finalTimeout,childSpanTimeout:p=Yo.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:d=!0}=t,f=T();if(!f||!Be()){let E=new ze,C={sample_rate:"0",sampled:"false",...Ne(E)};return Wo(E,C),E}let m=w(),g=ee(),h=Tb(e);h.end=new Proxy(h.end,{apply(E,C,z){if(l&&l(h),C instanceof ze)return;let[A,...U]=z,k=A||Z(),D=vt(k),G=Rn(h).filter(B=>B!==h),oe=L(h);if(!G.length||!d)return P(D),Reflect.apply(E,C,[D,...U]);let ae=f.getOptions().ignoreSpans,W=G?.reduce((B,ie)=>{let ce=L(ie);return!ce.timestamp||ae&&qn({description:ce.description,op:ce.op,attributes:ce.data},ae)?B:B?Math.max(B,ce.timestamp):ce.timestamp},void 0),O=oe.start_timestamp,j=Math.min(O?O+u/1e3:1/0,Math.max(O||-1/0,Math.min(D,W||1/0)));return P(j),Reflect.apply(E,C,[j,...U])}});function S(){o&&(clearTimeout(o),o=void 0)}function I(E){S(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=hb,h.end(E))},c)}function x(E){o=setTimeout(()=>{!r&&s&&(i=gb,h.end(E))},p)}function v(E){S(),n.set(E,!0);let C=Z();x(C+p/1e3)}function M(E){if(n.has(E)&&n.delete(E),n.size===0){let C=Z();I(C+c/1e3)}}function P(E){r=!0,n.clear(),a.forEach(G=>G()),ht(m,g);let C=L(h),{start_timestamp:z}=C;if(!z)return;C.data[jn]||h.setAttribute(jn,i);let U=C.status;(!U||U==="unknown")&&h.setStatus({code:1}),_.log(`[Tracing] Idle span "${C.op}" finished`);let k=Rn(h).filter(G=>G!==h),D=0;k.forEach(G=>{G.isRecording()&&(G.setStatus({code:2,message:"cancelled"}),G.end(E),y&&_.log("[Tracing] Cancelling span since span ended early",JSON.stringify(G,void 0,2)));let oe=L(G),{timestamp:ae=0,start_timestamp:W=0}=oe,O=W<=E,j=(u+c)/1e3,B=ae-W<=j;if(y){let ie=JSON.stringify(G,void 0,2);O?B||_.log("[Tracing] Discarding span since it finished after idle span final timeout",ie):_.log("[Tracing] Discarding span since it happened after idle span was finished",ie)}(!B||!O)&&(__(h,G),D++)}),D>0&&h.setAttribute("sentry.idle_span_discarded_spans",D)}return a.push(f.on("spanStart",E=>{if(r||E===h||L(E).timestamp||E instanceof Sr&&E.isStandaloneSpan())return;Rn(h).includes(E)&&v(E.spanContext().spanId)})),a.push(f.on("spanEnd",E=>{r||M(E.spanContext().spanId)})),a.push(f.on("idleSpanEnableAutoFinish",E=>{E===h&&(s=!0,I(),n.size&&x())})),t.disableAutoFinish||I(),setTimeout(()=>{r||(h.setStatus({code:2,message:"deadline_exceeded"}),i=Sb,h.end())},u),h}function Tb(e){let t=Ke(e);return ht(w(),t),y&&_.log("[Tracing] Started span is an idle span"),t}function L_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;yb(e,t),r&&Ab(e,r),vb(e,n),Ib(e,o),bb(e,i)}function M_(e,t){let{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:p,eventProcessors:l,attachments:d,propagationContext:f,transactionName:m,span:g}=t;Rs(e,"extra",n),Rs(e,"tags",r),Rs(e,"attributes",o),Rs(e,"user",i),Rs(e,"contexts",s),e.sdkProcessingMetadata=_r(e.sdkProcessingMetadata,c,2),a&&(e.level=a),m&&(e.transactionName=m),g&&(e.span=g),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),p.length&&(e.fingerprint=[...e.fingerprint,...p]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...f}}function Rs(e,t,n){e[t]=_r(e[t],n,1)}function Nn(e,t){let n=zt().getScopeData();return e&&M_(n,e.getScopeData()),t&&M_(n,t.getScopeData()),n}function yb(e,t){let{extra:n,tags:r,user:o,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),s&&(e.level=s),a&&e.type!=="transaction"&&(e.transaction=a)}function Ib(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function bb(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Ab(e,t){e.contexts={trace:Go(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Ne(t),...e.sdkProcessingMetadata};let n=ne(t),r=L(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function vb(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 Rb="thismessage:/";function Zr(e){return"isRelative"in e}function Cn(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?Rb: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 Nt(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 Xn(e){return e.split(/[?#]/,1)[0]}function fc(e){let{protocol:t,host:n,path:r}=e,o=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${t?`${t}://`:""}${o}${r}`}function ut(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 P_(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,p]of Object.entries(o))p!=null&&(t[u]=p);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=gr(e),r=Kr(e),o=gr(r),{isolationScope:i,scope:s}=zn(e),a=Nn(i,s);xb(n,o,t,a);let c=e.kind;wb(n,c),n.is_segment&&(Nb(n,a),Cb(n,t),t.emit("processSegmentSpan",n)),t.emit("processSpan",n);let{beforeSendSpan:u}=t.getOptions(),p=u&&Vn(u)?kb(n,u):n,l=p.attributes?.[he];return l&&Fe(p,{"sentry.span.source":l}),{...nc(p),_segmentSpan:r}}function Nb(e,t){let n=P_(t.contexts);Fe(e,n)}function Fe(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function Cb(e,t){let n=t.getIntegrationNames();n.length&&Fe(e,{[Ga]:n})}function xb(e,t,n,r){let o=n.getSdkMetadata(),{release:i,environment:s}=n.getOptions();Fe(e,{[Pa]:i,[Ua]:s,[Da]:t.name,[Ba]:t.span_id,[Fa]:o?.sdk?.name,[Ha]:o?.sdk?.version,[$a]:r.user?.id,[Wa]:r.user?.email,[ja]:r.user?.ip_address,[za]:r.user?.username,...r.attributes})}function kb(e,t){let n=t(e);return n||(Jr(),e)}var mp=1,U_=2;function wb(e,t){let n=e.attributes;if(!n)return;let r=n["http.request.method"]||n["http.method"];if(r){Ob(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){Lb(e,n);return}if(n["rpc.service"]){Fe(e,{[q]:"rpc"});return}if(n["messaging.system"]){Fe(e,{[q]:"message"});return}let s=n["faas.trigger"];s&&Fe(e,{[q]:`${s}`})}function Ob(e,t,n,r){let o=["http"];n===U_?o.push("client"):n===mp&&o.push("server"),t["sentry.http.prefetch"]&&o.push("prefetch"),Fe(e,{[q]:o.join(".")});let i=t[An];if(typeof i=="string"){e.name=i;return}if(t[he]==="custom")return;let s=t["http.route"];if(typeof s=="string")e.name=`${r} ${s}`,Fe(e,{[he]:"route"});else{if(n===U_||n===mp){let a=Mb(t,n);a&&(e.name=`${r} ${a}`)}Fe(e,{[he]:"url"})}}function Mb(e,t){let n=e["http.url"]||e["url.full"],r=e["http.target"],o=typeof n=="string"?Nt(n):void 0,i=o?fc(o):void 0;if(t===mp&&typeof r=="string")return Xn(r);if(i)return i;if(typeof r=="string")return Xn(r)}function Lb(e,t){Fe(e,{[q]:"db"});let n=t[An];if(typeof n=="string"){e.name=n;return}if(t[he]==="custom")return;let r=t["db.statement"];r&&(e.name=`${r}`,Fe(e,{[he]:"task"}))}var _p=0,D_=1,B_=2;function xn(e){return new Ns(t=>{t(e)})}function eo(e){return new Ns((t,n)=>{n(e)})}var Ns=class e{constructor(t){this._state=_p,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===_p)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===D_&&n[1](this._value),this._state===B_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===_p){if(gt(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(D_,i)},o=i=>{n(B_,i)};try{t(r,o)}catch(i){o(i)}}};function F_(e,t,n,r=0){try{let o=gp(t,n,e,r);return gt(o)?o:xn(o)}catch(o){return eo(o)}}function gp(e,t,n,r){let o=n[r];if(!e||!o)return e;let i=o({...e},t);return y&&i===null&&_.log(`Event processor "${o.id||"?"}" dropped event`),gt(i)?i.then(s=>gp(s,t,n,r+1)):gp(i,t,n,r+1)}var to,H_,G_,Er;function mc(e){let t=R._sentryDebugIds,n=R._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Er&&r.length===H_&&o.length===G_)return Er;H_=r.length,G_=o.length,Er={},to||(to={});let i=(s,a)=>{for(let c of s){let u=a[c],p=to?.[c];if(p&&Er&&u)Er[p[0]]=u,to&&(to[c]=[p[0],u]);else if(u){let l=e(c);for(let d=l.length-1;d>=0;d--){let m=l[d]?.filename;if(m&&Er&&to){Er[m]=u,to[c]=[m,u];break}}}}};return t&&i(r,t),n&&i(o,n),Er}function hp(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 Cs(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||de(),timestamp:t.timestamp||At()},u=n.integrations||e.integrations.map(S=>S.name);Pb(c,e),Bb(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Ub(c,e.stackParser);let p=Hb(r,n.captureContext);n.mechanism&&Xe(c,n.mechanism);let l=o?o.getEventProcessors():[],d=Nn(i,p),f=[...n.attachments||[],...d.attachments];f.length&&(n.attachments=f),L_(c,d);let m=[...l,...d.eventProcessors];return(n.data&&n.data.__sentry__===!0?xn(c):F_(m,c,n)).then(S=>(S&&Db(S),typeof s=="number"&&s>0?Fb(S,s,a):S))}function Pb(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||Yn,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=un(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=un(a.value,i))})}function Ub(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 Db(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 Bb(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Fb(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Re(o.data,t,n)}}))},...e.user&&{user:Re(e.user,t,n)},...e.contexts&&{contexts:Re(e.contexts,t,n)},...e.extra&&{extra:Re(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Re(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Re(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Re(e.contexts.flags,3,n)),r}function Hb(e,t){if(!t)return e;let n=e?e.clone():new it;return n.update(t),n}function $_(e){if(e)return Gb(e)?{captureContext:e}:Wb(e)?{captureContext:e}:e}function Gb(e){return e instanceof it||typeof e=="function"}var $b=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Wb(e){return Object.keys(e).some(t=>$b.includes(t))}function J(e,t){return w().captureException(e,$_(t))}function Ko(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return w().captureMessage(e,n,r)}function qt(e,t){return w().captureEvent(e,t)}function Jo(e,t){se().setContext(e,t)}function _c(e){se().setExtras(e)}function gc(e,t){se().setExtra(e,t)}function hc(e){se().setTags(e)}function Sc(e,t){se().setTag(e,t)}function Ec(e){se().setUser(e)}function Tc(e){se().setConversationId(e)}function Xo(){return se().lastEventId()}async function yc(e){let t=T();return t?t.flush(e):(y&&_.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Ic(e){let t=T();return t?t.close(e):(y&&_.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function bc(){return!!T()}function Qo(){let e=T();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Zo(e){se().addEventProcessor(e)}function no(e){let t=se(),{user:n}=Nn(t,w()),{userAgent:r}=R.navigator||{},o=zm({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return i?.status==="ok"&&$n(i,{status:"exited"}),ei(),t.setSession(o),o}function ei(){let e=se(),n=w().getSession()||e.getSession();n&&qm(n),W_(),e.setSession()}function W_(){let e=se(),t=T(),n=e.getSession();n&&t&&t.captureSession(n)}function Tr(e=!1){if(e){ei();return}W_()}var j_="7";function z_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function jb(e){return`${z_(e)}${e.projectId}/envelope/`}function zb(e,t){let n={sentry_version:j_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function xs(e,t,n){return t||`${jb(e)}?${zb(e,n)}`}function Sp(e,t){let n=ls(e);if(!n)return"";let r=`${z_(n)}embed/error-page/`,o=`dsn=${je(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 Ac=[];function qb(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 vc(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 qb(r)}function q_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Tp(e,r,n)}),n}function Ep(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Tp(e,t,n){if(n[t.name]){y&&_.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Ac.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Ac.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))}),y&&_.log(`Integration installed: ${t.name}`)}function ro(e){let t=T();if(!t){y&&_.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}var Yb="sentry.timestamp.sequence",yp=0,Ip;function Rc(e){let t=Math.floor(e*1e3);Ip!==void 0&&t!==Ip&&(yp=0);let n=yp;return yp++,Ip=t,{key:Yb,value:{value:n,type:"integer"}}}function Nc(e,t){return t?We(t,()=>{let n=ee(),r=n?Go(n):Bo(t);return[n?Ne(n):hr(e,t),r]}):[void 0,void 0]}var Y_={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function bp(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Ap(){return"npm"}function V_(){return!bp()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function lt(){return typeof window<"u"&&(!V_()||Vb())}function Vb(){return R.process?.type==="renderer"}function Kb(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...lt()&&{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=je(r)),we(i,[Kb(e,o)])}var Jb=100;function kn(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function J_(e,t){let n=Rp(),r=X_(e);r===void 0?n.set(e,[t]):r.length>=Jb?(oo(e,r),n.set(e,[t])):n.set(e,[...r,t])}function yr(e,t=w(),n=J_){let r=t?.getClient()??T();if(!r){y&&_.warn("No client available to capture log.");return}let{release:o,environment:i,enableLogs:s=!1,beforeSendLog:a}=r.getOptions();if(!s){y&&_.warn("logging option not enabled, log will not be captured.");return}let[,c]=Nc(r,t),u={...e.attributes},{user:{id:p,email:l,username:d},attributes:f={}}=Nn(se(),t);kn(u,"user.id",p,!1),kn(u,"user.email",l,!1),kn(u,"user.name",d,!1),kn(u,"sentry.release",o),kn(u,"sentry.environment",i);let{name:m,version:g}=r.getSdkMetadata()?.sdk??{};kn(u,"sentry.sdk.name",m),kn(u,"sentry.sdk.version",g);let h=r.getIntegrationByName("Replay"),S=h?.getReplayId(!0);kn(u,"sentry.replay_id",S),S&&h?.getRecordingMode()==="buffer"&&kn(u,"sentry._internal.replay_is_buffering",!0);let I=e.message;if(In(I)){let{__sentry_template_string__:D,__sentry_template_values__:G=[]}=I;G?.length&&(u["sentry.message.template"]=D),G.forEach((oe,ae)=>{u[`sentry.message.parameter.${ae}`]=oe})}let x=pn(t);kn(u,"sentry.trace.parent_span_id",x?.spanContext().spanId);let v={...e,attributes:u};r.emit("beforeCaptureLog",v);let M=a?Ye(()=>a(v)):v;if(!M){r.recordDroppedEvent("before_send","log_item",1),y&&_.warn("beforeSendLog returned null, log will not be captured.");return}let{level:P,message:E,attributes:C={},severityNumber:z}=M,A=Z(),U=Rc(A),k={timestamp:A,level:P,body:vp(String(E)),trace_id:c?.trace_id,severity_number:z??Y_[P],attributes:Xb({...Wn(f),...Wn(C,!0),[U.key]:U.value})};n(r,k),r.emit("afterCaptureLog",M)}function oo(e,t){let n=t??X_(e)??[];if(n.length===0)return;let r=e.getOptions(),o=K_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Rp().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function X_(e){return Rp().get(e)}function Rp(){return an("clientToLogBufferMap",()=>new WeakMap)}function Xb(e){let t={};for(let[n,r]of Object.entries(e)){let o=vp(n);r.type==="string"?t[o]={...r,value:vp(r.value)}:t[o]=r}return t}function vp(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 Qb(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...lt()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Q_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=je(r)),we(i,[Qb(e,o)])}var Zb=1e3;function Qn(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function Z_(e,t){let n=Cp(),r=eg(e);r===void 0?n.set(e,[t]):r.length>=Zb?(ti(e,r),n.set(e,[t])):n.set(e,[...r,t])}function eA(e,t,n){let{release:r,environment:o}=t.getOptions(),i={...e.attributes};Qn(i,"user.id",n.id,!1),Qn(i,"user.email",n.email,!1),Qn(i,"user.name",n.username,!1),Qn(i,"sentry.release",r),Qn(i,"sentry.environment",o);let{name:s,version:a}=t.getSdkMetadata()?.sdk??{};Qn(i,"sentry.sdk.name",s),Qn(i,"sentry.sdk.version",a);let c=t.getIntegrationByName("Replay"),u=c?.getReplayId(!0);return Qn(i,"sentry.replay_id",u),u&&c?.getRecordingMode()==="buffer"&&Qn(i,"sentry._internal.replay_is_buffering",!0),{...e,attributes:i}}function tA(e,t,n,r){let[,o]=Nc(t,n),i=pn(n),s=i?i.spanContext().traceId:o?.trace_id,a=i?i.spanContext().spanId:void 0,c=Z(),u=Rc(c);return{timestamp:c,trace_id:s??"",span_id:a,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...Wn(r),...Wn(e.attributes,"skip-undefined"),[u.key]:u.value}}}function Np(e,t){let n=t?.scope??w(),r=t?.captureSerializedMetric??Z_,o=n?.getClient()??T();if(!o){y&&_.warn("No client available to capture metric.");return}let{_experiments:i,enableMetrics:s,beforeSendMetric:a}=o.getOptions();if(!(s??i?.enableMetrics??!0)){y&&_.warn("metrics option not enabled, metric will not be captured.");return}let{user:u,attributes:p}=Nn(se(),n),l=eA(e,o,u);o.emit("processMetric",l);let d=a||i?.beforeSendMetric,f=d?d(l):l;if(!f){y&&_.log("`beforeSendMetric` returned `null`, will not send metric.");return}let m=tA(f,o,n,p);y&&_.log("[Metric]",m),r(o,m),o.emit("afterCaptureMetric",f)}function ti(e,t){let n=t??eg(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Q_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Cp().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function eg(e){return Cp().get(e)}function Cp(){return an("clientToMetricBufferMap",()=>new WeakMap)}function tg(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:{...e.data},links:e.links};return nc(t)}function ng(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||Pe(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(tg(i)):r.push(i);if(n.length===0)return;e.spans=r;let o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...lt()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}function Ir(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var ni=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(ni);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return xn(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let c=[a,new Promise(u=>Ir(setTimeout(()=>u(!1),s)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:i}}var rg=60*1e3;function Cc(e,t=rt()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?rg:r-t}function og(e,t){return e[t]||e.all||0}function ks(e,t,n=rt()){return og(e,t)>n}function ws(e,{statusCode:t,headers:n},r=rt()){let o={...e},i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(let a of i.trim().split(",")){let[c,u,,,p]=a.split(":",5),l=parseInt(c,10),d=(isNaN(l)?60:l)*1e3;if(!u)o.all=r+d;else for(let f of u.split(";"))f==="metric_bucket"?(!p||p.split(";").includes("custom"))&&(o[f]=r+d):o[f]=r+d}else s?o.all=r+Cc(s,r):t===429&&(o.all=r+60*1e3);return o}var xp=64;function Os(e,t,n=io(e.bufferSize||xp)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(Rt(s,(l,d)=>{let f=ys(d);ks(r,f)?e.recordDroppedEvent("ratelimit_backoff",f):a.push(l)}),a.length===0)return Promise.resolve({});let c=we(s[0],a),u=l=>{if(Xr(c,["client_report"])){y&&_.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}Rt(c,(d,f)=>{e.recordDroppedEvent(l,ys(f))})},p=()=>t({body:Kn(c)}).then(l=>l.statusCode===413?(y&&_.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(y&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&_.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=ws(r,l),l),l=>{throw u("network_error"),y&&_.error("Encountered error running transport request:",l),l});return n.add(p).then(l=>l,l=>{if(l===ni)return y&&_.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:o}}function ig(e,t,n){let r=[{type:"client_report"},{timestamp:n||At(),discarded_events:e}];return we(t?{dsn:t}:{},[r])}function xc(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 sg(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?.[Yr],exclusive_time:s?.[st],measurements:e.measurements,is_segment:!0}}function ag(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:{...e.data,...e.profile_id&&{[Yr]:e.profile_id},...e.exclusive_time&&{[st]:e.exclusive_time}}}},measurements:e.measurements}}var so="[Filtered]",Ms=["forwarded","-ip","remote-","via","-user"],kp=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],cg=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function ug(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:7}:{userInfo:!1,cookies:{deny:Ms},httpHeaders:{request:{deny:Ms},response:{deny:Ms}},httpBodies:[],queryParams:{deny:Ms},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}var nA={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};function lg(e){let t=e.dataCollection!=null?nA:ug(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 pg="Not capturing exception because it's already been captured.",fg="Discarded session because of missing or non-string release",Sg=Symbol.for("SentryInternalError"),Eg=Symbol.for("SentryDoNotSendEventError"),rA=5e3;function kc(e){return{message:e,[Sg]:!0}}function wp(e){return{message:e,[Eg]:!0}}function dg(e){return!!e&&typeof e=="object"&&Sg in e}function mg(e){return!!e&&typeof e=="object"&&Eg in e}function _g(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??rA;u>0&&(a=!0,s=Ir(setTimeout(()=>{o(e)},u)))}}),e.on("flush",()=>{o(e)})}var Ls=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=io(t.transportOptions?.bufferSize??xp),this._dataCollection=lg(t),t.dsn?this._dsn=ls(t.dsn):y&&_.warn("No DSN provided, client will not send events."),this._dsn){let r=xs(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({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&&_g(this,"afterCaptureLog","flushLogs",aA,oo),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&_g(this,"afterCaptureMetric","flushMetrics",sA,ti)}captureException(t,n,r){let o=de();if(as(t))return y&&_.log(pg),o;let i={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={event_id:de(),...r},s=In(t)?t:String(t),a=Ge(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=de();if(n?.originalException&&as(n.originalException))return y&&_.log(pg),o;let i={event_id:o,...n},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,c=s.capturedSpanIsolationScope,u=gg(t.type);return this._process(()=>this._captureEvent(t,i,a||r,c),u),i.event_id}captureSession(t){this.sendSession(t),$n(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),Tp(this,t,this._integrations),n||Ep(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=ng(t,this),o=I_(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=Ts(o,uc(i));r&&(o=Ts(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=Yn}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){y&&_.warn(fg);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){y&&_.warn(fg);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=y_(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}`;y&&_.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 y&&_.error("Error while sending envelope:",n),{}}return y&&_.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=q_(this,t),Ep(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)&&($n(t,{...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),Cs(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Bo(r)},...a.contexts};let c=hr(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=w(),o=se()){return y&&Op(t)&&_.log(`Captured error event \`${xc(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{y&&(mg(i)?_.log(i.message):dg(i)?_.warn(i.message):_.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=Tg(t),c=Op(t),p=`before send for type \`${t.type||"error"}\``,l=typeof s>"u"?void 0:Ut(s);if(c&&typeof l=="number"&&bt()>l)return this.recordDroppedEvent("sample_rate","error"),eo(wp(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let d=gg(t.type);return this._prepareEvent(t,n,r,o).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",d),wp("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return f;let g=iA(this,i,f,n);return oA(g,p)}).then(f=>{if(f===null){if(this.recordDroppedEvent("before_send",d),a){let S=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",S)}throw wp(`${p} returned \`null\`, will not send event.`)}let m=r.getSession()||o.getSession();if(c&&m&&this._updateSessionFromEvent(m,f),a){let h=f.sdkProcessingMetadata?.spanCountBeforeProcessing||0,S=f.spans?f.spans.length:0,I=h-S;I>0&&this.recordDroppedEvent("before_send","span",I)}let g=f.transaction_info;if(a&&g&&f.transaction!==t.transaction){let h="custom";f.transaction_info={...g,source:h}}return this.sendEvent(f,n),f}).then(null,f=>{throw mg(f)||dg(f)?f:(this.captureException(f,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:f}),kc(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
10
|
+
Reason: ${f}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===ni&&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(){y&&_.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){y&&_.log("No outcomes to send");return}if(!this._dsn){y&&_.log("No dsn provided, will not send outcomes");return}y&&_.log("Sending outcomes:",t);let n=ig(t,this._options.tunnel&&je(this._dsn));this.sendEnvelope(n)}};function gg(e){return e==="replay_event"?"replay":e||"error"}function oA(e,t){let n=`${t} must return \`null\` or a valid event.`;if(gt(e))return e.then(r=>{if(!Me(r)&&r!==null)throw kc(n);return r},r=>{throw kc(`${t} rejected with ${r}`)});if(!Me(e)&&e!==null)throw kc(n);return e}function iA(e,t,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=!Vn(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(Op(c)&&o)return o(c,r);if(Tg(c)){if(a||s){let u=sg(c);if(s?.length&&qn({description:u.description,op:u.op,attributes:u.data},s))return null;if(a){let p=a(u);p?c=_r(n,ag(p)):Jr()}if(c.spans){let p=[],l=c.spans;for(let f of l){if(s?.length&&qn({description:f.description,op:f.op,attributes:f.data},s)){S_(l,f);continue}if(a){let m=a(f);m?p.push(m):(Jr(),p.push(f))}else p.push(f)}let d=c.spans.length-p.length;d&&e.recordDroppedEvent("before_send","span",d),c.spans=p}}if(i){if(c.spans){let u=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(c,r)}}return c}function Op(e){return e.type===void 0}function Tg(e){return e.type==="transaction"}function sA(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+yg(e.attributes)}function aA(e){let t=0;return e.message&&(t+=e.message.length*2),t+yg(e.attributes)}function yg(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*hg(n[0]):Ge(n)?t+=hg(n):t+=100}),t}function hg(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Mp(e,t){t.debug===!0&&(y?_.enable():Ye(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),w().update(t.initialScope);let r=new e(t);return wc(r),r.init(),r}function wc(e){w().setClient(e)}var Lp=100,Pp=5e3,cA=36e5;function Up(e){function t(...n){y&&_.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=Pp,s;function a(l,d,f){return Xr(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,d,f):!0}function c(l){s&&clearTimeout(s),s=Ir(setTimeout(async()=>{s=void 0;let d=await o.shift();d&&(t("Attempting to send previously queued event"),d[0].sent_at=new Date(rt()).toISOString(),p(d,!0).catch(f=>{t("Failed to retry sending",f)}))},l))}function u(){s||(c(i),i=Math.min(i*2,cA))}async function p(l,d=!1){if(!d&&Xr(l,["replay_event","replay_recording"]))return await o.push(l),c(Lp),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");let f=await r.send(l),m=Lp;if(f){if(f.headers?.["retry-after"])m=Cc(f.headers["retry-after"]);else if(f.headers?.["x-sentry-rate-limits"])m=6e4;else if((f.statusCode||0)>=400)return f}return c(m),i=Pp,f}catch(f){if(await a(l,f,i))return d?await o.unshift(l):await o.push(l),u(),t("Error sending. Event queued.",f),{};throw f}}return n.flushAtStartup&&u(),{send:p,flush:l=>(l===void 0&&(i=Pp,c(Lp)),r.flush(l))}}}var ri="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function Ig(e,t){let n;return Rt(e,(r,o)=>(t.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function uA(e,t){return n=>{let r=e(n);return{...r,send:async o=>{let i=Ig(o,["event","transaction","profile","replay_event"]);return i&&(i.release=t),r.send(o)}}}}function lA(e,t){return we(t?{...e[0],dsn:t}:e[0],e[1])}function Dp(e,t){return n=>{let r=e(n),o=new Map,i=t||(u=>{let p=u.getEvent();return p?.extra?.[ri]&&Array.isArray(p.extra[ri])?p.extra[ri]:[]});function s(u,p){let l=p?`${u}:${p}`:u,d=o.get(l);if(!d){let f=Qa(u);if(!f)return;let m=xs(f,n.tunnel);d=p?uA(e,p)({...n,url:m}):e({...n,url:m}),o.set(l,d)}return[u,d]}async function a(u){function p(m){let g=m?.length?m:["event"];return Ig(u,g)}let l=i({envelope:u,getEvent:p}).map(m=>typeof m=="string"?s(m,void 0):s(m.dsn,m.release)).filter(m=>!!m),d=l.length?l:[["",r]];return(await Promise.all(d.map(([m,g])=>g.send(lA(u,m)))))[0]}async function c(u){let p=[...o.values(),r];return(await Promise.all(p.map(d=>d.flush(u)))).every(d=>d)}return{send:a,flush:c}}}function Bp(e,t){return t.some(n=>e.includes(n))}function br(e,t,n){if(t===!1)return{};let r=n!=null?[...kp,...n]:kp,o={};if(t===!0){for(let s of Object.keys(e))o[s]=Bp(s.toLowerCase(),r)?so:e[s];return o}if("deny"in t){let s=t.deny.map(a=>a.toLowerCase());for(let a of Object.keys(e)){let c=a.toLowerCase(),u=Bp(c,r)||s.some(p=>c.includes(p));o[a]=u?so:e[a]}return o}let i=t.allow.map(s=>s.toLowerCase());for(let s of Object.keys(e)){let a=s.toLowerCase();if(Bp(a,r))o[s]=so;else{let c=i.some(u=>a.includes(u));o[s]=c?e[s]:so}}return o}function bg(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf("=",n);if(r===-1)break;let o=e.indexOf(";",n);if(o===-1)o=e.length;else if(o<r){n=e.lastIndexOf(";",r-1)+1;continue}let i=e.slice(n,r).trim();if(t[i]===void 0){let s=e.slice(r+1,o).trim();s.charCodeAt(0)===34&&(s=s.slice(1,-1));try{t[i]=s.indexOf("%")!==-1?decodeURIComponent(s):s}catch{t[i]=s}}n=o+1}return t}function Ps(e,t){if(t===!1)return{};try{let n=bg(e);return Object.keys(n).length===0?{}:br(n,t,cg)}catch{return so}}function oi(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return fA(e,n)||pA(e,r)}function pA(e,t){return t?Ag(e)===Ag(t):!1}function fA(e,t){let n=Cn(e);return!n||Zr(n)||!t?!1:dA(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function dA(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function Ag(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Oc(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 Fp=Oc;function Hp(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Gp(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:It})),o.version=It)}function ao(e={}){let t=e.client||T();if(!Qo()||!t)return{};let n=mt(),r=jt(n);if(r.getTraceData)return r.getTraceData(e);let o=e.scope||w(),i=e.span||ee();if(!i&&La())return{};let s=i?$o(i):mA(o),a=i?Ne(i):hr(t,o),c=Xa(a);if(!ec.test(s))return _.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let p={"sentry-trace":s,baggage:c};return e.propagateTraceparent&&(p.traceparent=i?p_(i):_A(o)),p}function mA(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return fs(t,r,n)}function _A(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ds(t,r,n)}function $p(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 p(){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=p,l}var gA=100;function pt(e,t){let n=T(),r=se();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=gA}=n.getOptions();if(i<=0)return;let a={timestamp:At(),...e},c=o?Ye(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,i))}var vg,hA="FunctionToString",Rg=new WeakMap,SA=(()=>({name:hA,setupOnce(){vg=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=fr(this),n=Rg.has(T())&&t!==void 0?t:this;return vg.apply(n,e)}}catch{}},setup(e){Rg.set(e,!0)}})),Us=SA;var EA=[/^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$/],TA="EventFilters",Lc=(e={})=>{let t;return{name:TA,setup(n){let r=n.getOptions();t=Ng(e,r)},processEvent(n,r,o){if(!t){let i=o.getOptions();t=Ng(e,i)}return yA(n,t)?null:n}}},Ds=((e={})=>({...Lc(e),name:"InboundFilters"}));function Ng(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:EA],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function yA(e,t){if(e.type){if(e.type==="transaction"&&bA(e,t.ignoreTransactions))return y&&_.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
11
|
+
Event: ${ln(e)}`),!0}else{if(IA(e,t.ignoreErrors))return y&&_.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
+
Event: ${ln(e)}`),!0;if(NA(e))return y&&_.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
+
Event: ${ln(e)}`),!0;if(AA(e,t.denyUrls))return y&&_.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
+
Event: ${ln(e)}.
|
|
15
|
+
Url: ${Mc(e)}`),!0;if(!vA(e,t.allowUrls))return y&&_.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
+
Event: ${ln(e)}.
|
|
17
|
+
Url: ${Mc(e)}`),!0}return!1}function IA(e,t){return t?.length?xc(e).some(n=>$e(n,t)):!1}function bA(e,t){if(!t?.length)return!1;let n=e.transaction;return n?$e(n,t):!1}function AA(e,t){if(!t?.length)return!1;let n=Mc(e);return n?$e(n,t):!1}function vA(e,t){if(!t?.length)return!0;let n=Mc(e);return n?$e(n,t):!0}function RA(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 Mc(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?RA(n):null}catch{return y&&_.error(`Cannot extract url for event ${ln(e)}`),null}}function NA(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function jp(e,t,n,r,o,i){if(!o.exception?.values||!i||!cn(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=Wp(e,t,r,i.originalException,n,o.exception.values,s,0))}function Wp(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let c=[...i];if(cn(r[o],Error)){Cg(s,a,r);let u=e(t,r[o]),p=c.length;xg(u,o,p,a),c=Wp(e,t,n,r[o],o,[u,...c],u,p)}return kg(r)&&r.errors.forEach((u,p)=>{if(cn(u,Error)){Cg(s,a,r);let l=e(t,u),d=c.length;xg(l,`errors[${p}]`,d,a),c=Wp(e,t,n,u,o,[l,...c],l,d)}}),c}function kg(e){return Array.isArray(e.errors)}function Cg(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...kg(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function xg(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function CA(e){return Ze(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Pc(e){return CA(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var Og=new Map,wg=new Set;function xA(e){if(R._sentryModuleMetadata)for(let t of Object.keys(R._sentryModuleMetadata)){let n=R._sentryModuleMetadata[t];if(wg.has(t))continue;wg.add(t);let r=e(t);for(let o of r.reverse())if(o.filename){Og.set(o.filename,n);break}}}function kA(e,t){return xA(e),Og.get(t)}function Uc(e,t){t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;let o=kA(e,r.filename);o&&(r.module_metadata=o)})})}function Dc(e){e.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}var zp=()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",t=>{Rt(t,(n,r)=>{if(r==="event"){let o=Array.isArray(n)?n[1]:void 0;o&&(Dc(o),n[1]=o)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;let n=e.getOptions().stackParser;Uc(n,t)})}});var Mg=new Set([]);function co(e){let t="console",n=tt(t,e);return nt(t,wA),n}function wA(){"console"in R&&lr.forEach(function(e){e in R.console&&Ee(R.console,e,function(t){return Wr[e]=t,function(...n){let r=n[0],o=Wr[e],i=Mg.size&&typeof r=="string"&&$e(r,Mg);i||He("console",{args:n,level:e}),(!i||y&&_.isEnabled())&&o?.apply(R.console,n)}})})}function Zn(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var OA="CaptureConsole",MA=((e={})=>{let t=e.levels||lr,n=e.handled??!0;return{name:OA,setup(r){"console"in R&&co(({args:o,level:i})=>{T()!==r||!t.includes(i)||LA(o,i,n)})}}}),qp=MA;function LA(e,t,n){let r=Zn(t),o=new Error,i={level:Zn(t),extra:{arguments:e}};We(s=>{if(s.addEventProcessor(u=>(u.logger="console",Xe(u,{handled:n,type:"auto.core.capture_console"}),u)),t==="assert"){if(!e[0]){let u=`Assertion failed: ${dr(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=dr(e," ");s.captureMessage(c,r,{captureContext:i,syntheticException:o})})}var PA="Dedupe",UA=(()=>{let e;return{name:PA,processEvent(t){if(t.type)return t;try{if(DA(t,e))return y&&_.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Bs=UA;function DA(e,t){return t?!!(BA(e,t)||FA(e,t)):!1}function BA(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Ug(e,t)||!Pg(e,t))}function FA(e,t){let n=Lg(t),r=Lg(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Ug(e,t)||!Pg(e,t))}function Pg(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 Ug(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 Lg(e){return e.exception?.values?.[0]}var HA="ExtraErrorData",GA=((e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:HA,processEvent(r,o,i){let{maxValueLength:s}=i.getOptions();return $A(r,o,t,n,s)}}}),Yp=GA;function $A(e,t={},n,r,o){if(!t.originalException||!Ze(t.originalException))return e;let i=t.originalException.name||t.originalException.constructor.name,s=Dg(t.originalException,r,o);if(s){let a={...e.contexts},c=Re(s,n);return Me(c)&&(Fm(c),a[i]=c),{...e,contexts:a}}return e}function Dg(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]=Ze(s)||typeof s=="string"?n?un(`${s}`,n):`${s}`:s}if(t&&e.cause!==void 0)if(Ze(e.cause)){let i=e.cause.name||e.cause.constructor.name;o.cause={[i]:Dg(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]=Ze(a)?a.toString():a}}return o}catch(r){y&&_.error("Unable to extract extra data from the Error object:",r)}return null}function WA(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 jA=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function zA(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=jA.exec(t);return n?n.slice(1):[]}function Bg(...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=WA(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Fg(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 Hg(e,t){e=Bg(e).slice(1),t=Bg(t).slice(1);let n=Fg(e.split("/")),r=Fg(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 Gg(e,t){let n=zA(e)[2]||"";return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var qA="RewriteFrames",Vp=(e={})=>{let t=e.root,n=e.prefix||"app:///",r="window"in R&&!!R.window,o=e.iteratee||YA({isBrowser:r,root:t,prefix:n});function i(a){try{return{...a,exception:{...a.exception,values:a.exception.values.map(c=>({...c,...c.stacktrace&&{stacktrace:s(c.stacktrace)}}))}}}catch{return a}}function s(a){return{...a,frames:a?.frames?.map(c=>o(c))}}return{name:qA,processEvent(a){let c=a;return a.exception&&Array.isArray(a.exception.values)&&(c=i(c)),c}}};function YA({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?Hg(t,s):Gg(s);r.filename=`${n}${a}`}return r}}var VA=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],KA=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],JA={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"},Wg=["select","insert","upsert","update","delete"];function Bc(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function Fc(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function jg(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function XA(e,t){return jg(e,t)!==void 0}function QA(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 ZA(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&&JA[n]||"filter",`${o}(${e}, ${r.join(".")})`}function $g(e,t=!1){return new Proxy(e,{apply(n,r,o){return Ue({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[$]:"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 ev(e){let t=e.auth;if(!(!t||Fc(e.auth))){for(let n of VA){let r=t[n];r&&typeof e.auth[n]=="function"&&(e.auth[n]=$g(r))}for(let n of KA){let r=t.admin[n];r&&typeof e.auth.admin[n]=="function"&&(e.auth.admin[n]=$g(r,!0))}Bc(e.auth)}}function tv(e,t){Fc(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 rv(s,t),i}}),Bc(e.prototype.from))}function nv(e,t){Fc(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(n,r,o){let i=Wg,s=r,a=QA(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]:"",p=[];for(let[v,M]of s.url.searchParams.entries())p.push(ZA(v,M));let l=Object.create(null);if(Me(s.body))for(let[v,M]of Object.entries(s.body))l[v]=M;let d=T(),f=t.sendOperationData??d?.getDataCollectionOptions().userInfo===!0,m=jg(s.body,l),g=a==="select"?"":`${a}${XA(s.body,l)?"(...) ":""}`,h=f?p.join(" "):p.length>0?"[redacted]":"",S=[g.trimEnd(),h].filter(Boolean).join(" "),I=S?`${S} from(${u})`:`from(${u})`,x={"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,[$]:"auto.db.supabase",[q]:"db"};return p.length&&f&&(x["db.query"]=p),m!==void 0&&f&&(x["db.body"]=m),Ue({name:I,attributes:x},v=>Reflect.apply(n,r,[]).then(M=>{if(v&&(M&&typeof M=="object"&&"status"in M&&vn(v,M.status||500),v.end()),M?.error){let C=new Error(M.error.message);M.error.code&&(C.code=M.error.code),M.error.details&&(C.details=M.error.details);let z={};p.length&&f&&(z.query=p),m!==void 0&&f&&(z.body=m),J(C,A=>(A.addEventProcessor(U=>(Xe(U,{handled:!1,type:"auto.db.supabase.postgres"}),U)),A.setContext("supabase",z),A))}let P={type:"supabase",category:`db.${a}`,message:I},E={};return p.length&&f&&(E.query=p),m!==void 0&&f&&(E.body=m),Object.keys(E).length&&(P.data=E),pt(P),M},M=>{throw v&&(vn(v,500),v.end()),M}).then(...o))}}),Bc(e.prototype.then))}function rv(e,t){for(let n of Wg)Fc(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 y&&_.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),nv(a,t),s}}),Bc(e.prototype[n]))}var Hc=(e,t={})=>{if(!e){y&&_.warn("Supabase integration was not installed because no Supabase client was provided.");return}let n=e.constructor===Function?e:e.constructor;tv(n,t),ev(e)},ov="Supabase",iv=((e,t)=>({setupOnce(){Hc(e,t)},name:ov})),Kp=e=>iv(e.supabaseClient,{sendOperationData:e.sendOperationData});var sv=10,av="ZodErrors";function cv(e){return Ze(e)&&e.name==="ZodError"&&Array.isArray(e.issues)}function uv(e){return{...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 lv(e){return e.map(t=>typeof t=="number"?"<array>":t).join(".")}function pv(e){let t=new Set;for(let r of e.issues){let o=lv(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: ${un(n.join(", "),100)}`}function fv(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!cv(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(uv);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:i})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:pv(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,e)}}}catch(o){return{...n,extra:{...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 dv=((e={})=>{let t=e.limit??sv;return{name:av,processEvent(n,r){return fv(t,e.saveZodIssuesAsAttachment,n,r)}}}),Jp=dv;var Xp=e=>({name:"ThirdPartyErrorsFilter",setup(t){t.on("beforeEnvelope",n=>{Rt(n,(r,o)=>{if(o==="event"){let i=Array.isArray(r)?r[1]:void 0;i&&(Dc(i),r[1]=i)}})}),t.on("applyFrameMetadata",n=>{if(n.type)return;let r=t.getOptions().stackParser;Uc(r,n)})},preprocessEvent(t){e.ignoreSentryInternalFrames&&(R._sentryWrappedDepth??0)>0&&(t.sdkProcessingMetadata={...t.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(t){let n=e.ignoreSentryInternalFrames?t.sdkProcessingMetadata?.insideSentryWrapped===!0&&t.exception?.values?.length===1:!1,r=_v(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={...t.tags,third_party_code:!0}}}return t}});function mv(e,t,n){if(t!==0)return!1;if(n&&gv(e)||e.function==="sentryWrapped")return!0;if(!e.context_line||!e.filename||!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(Sv))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(hv))return!0}return!1}function _v(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||!mv(o,i,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(i=>i.startsWith(zg)).map(i=>i.slice(zg.length)):[])}function gv(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}var zg="_sentryBundlerPluginAppKey:",hv="Attempt to invoke user-land function",Sv="fn.apply(this, wrappedArguments)";var qg=100,Yg=10,Gc="flag.evaluation.";function Dt(e){if(e.type)return e;let n=w().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...r]}),e}function Ct(e,t,n=qg){let r=w().getScopeData().contexts;r.flags||(r.flags={values:[]});let o=r.flags.values;Ev(o,e,t,n)}function Ev(e,t,n,r){if(typeof n!="boolean")return;if(e.length>r){y&&_.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 xt(e,t,n=Yg){if(typeof t!="boolean")return;let r=ee();if(!r)return;let o=L(r).data;if(`${Gc}${e}`in o){r.setAttribute(`${Gc}${e}`,t);return}Object.keys(o).filter(s=>s.startsWith(Gc)).length<n&&r.setAttribute(`${Gc}${e}`,t)}var Qp=()=>({name:"FeatureFlags",processEvent(e,t,n){return Dt(e)},addFeatureFlag(e,t){Ct(e,t),xt(e,t)}});var Zp=({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){let t=e.prototype;typeof t.isOn=="function"&&Ee(t,"isOn",Vg),typeof t.getFeatureValue=="function"&&Ee(t,"getFeatureValue",Vg)},processEvent(t,n,r){return Dt(t)}});function Vg(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"&&(Ct(n,r),xt(n,r)),r}}var Tv="ConversationId",yv=(()=>({name:Tv,setup(e){e.on("spanStart",t=>{let n=w().getScopeData(),r=se().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=L(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(Ka,o)}})}})),ef=yv;function tf(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=Be()&&t(s);if(e.endTimestamp){let m=e.fetchData.__span;if(!m)return;let g=r[m];g&&(a&&(bv(g,e),Iv(g,e,o)),delete r[m]);return}let{spanOrigin:c="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},p=T(),d=!!ee()||!!p&&Pe(p),f=a&&d?Ke(Rv(s,i,c)):new ze;if(a&&!d&&p?.recordDroppedEvent("no_parent_span","span"),e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(e.fetchData.url)){let m=e.args[0],g={...e.args[1]||{}},h=Jg(m,g,Be()&&d?f:void 0,u);h&&(e.args[1]=g,g.headers=h)}if(p){let m={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};p.emit("beforeOutgoingRequestSpan",f,m)}return f}function Iv(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Jg(e,t,n,r){let o=ao({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let c=t.headers||(rs(e)?e.headers:void 0);if(c)if(Av(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 p=u.get("baggage");p?$c(p)||u.set("baggage",`${p},${s}`):u.set("baggage",s)}return u}else if(vv(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 p=c.find(l=>l[0]==="baggage"&&typeof l[1]=="string"&&$c(l[1]));return s&&!p&&u.push(["baggage",s]),u}else{let u="sentry-trace"in c?c["sentry-trace"]:void 0,p="traceparent"in c?c.traceparent:void 0,l="baggage"in c?c.baggage:void 0,d=l?Array.isArray(l)?[...l]:[l]:[],f=l&&(Array.isArray(l)?l.find(g=>$c(g)):$c(l));s&&!f&&d.push(s);let m=Object.assign({},c,{"sentry-trace":u??i,baggage:d.length>0?d.join(","):void 0});return r&&a&&!p&&(m.traceparent=a),m}else return{...o}}function bv(e,t){if(t.response){vn(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 $c(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(us))}function Av(e){return typeof Headers<"u"&&cn(e,Headers)}function vv(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function Rv(e,t,n){if(e.startsWith("data:")){let i=ut(e);return{name:`${t} ${i}`,attributes:Kg(e,void 0,t,n)}}let r=Cn(e),o=r?Vo(r):e;return{name:`${t} ${o}`,attributes:Kg(e,r,t,n)}}function Kg(e,t,n,r){let o={url:ut(e),type:"fetch","http.method":n,[$]:r,[q]:"http.client"};return t&&(Zr(t)||(o["http.url"]=ut(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function ii(e,t={},n=w()){let{message:r,name:o,email:i,url:s,source:a,associatedEventId:c,tags:u}=e,p={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()||T();return l&&l.emit("beforeSendFeedback",p,t),n.captureEvent(p,t)}var Wc={};ba(Wc,{debug:()=>Cv,error:()=>wv,fatal:()=>Ov,fmt:()=>Fp,info:()=>xv,trace:()=>Nv,warn:()=>kv});function si(e,t,n,r,o){yr({level:e,message:t,attributes:n,severityNumber:o},r)}function Nv(e,t,{scope:n}={}){si("trace",e,t,n)}function Cv(e,t,{scope:n}={}){si("debug",e,t,n)}function xv(e,t,{scope:n}={}){si("info",e,t,n)}function kv(e,t,{scope:n}={}){si("warn",e,t,n)}function wv(e,t,{scope:n}={}){si("error",e,t,n)}function Ov(e,t,{scope:n}={}){si("fatal",e,t,n)}function ai(e,t,n){return"util"in R&&typeof R.util.format=="function"?R.util.format(...e):Mv(e,t,n)}function Mv(e,t,n){return e.map(r=>Ge(r)?String(r):JSON.stringify(Re(r,t,n))).join(" ")}function jc(e){return/%[sdifocO]/.test(e)}function zc(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 Lv="ConsoleLogs",Xg={[$]:"auto.log.console"},Pv=((e={})=>{let t=e.levels||lr;return{name:Lv,setup(n){let{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){y&&_.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let s=co(({args:a,level:c})=>{if(T()!==n||!t.includes(c))return;let u=a[0],p=a.slice(1);if(c==="assert"){if(!u){let m=p.length>0?`Assertion failed: ${ai(p,o,i)}`:"Assertion failed";yr({level:"error",message:m,attributes:Xg})}return}let l=c==="log",d=a.length>1&&typeof a[0]=="string"&&!jc(a[0]),f={...Xg,...d?zc(u,p):{}};yr({level:l?"info":c,message:ai(a,o,i),severityNumber:l?10:void 0,attributes:f})});n.registerCleanup(s)}}}),nf=Pv;var Ar={};ba(Ar,{count:()=>Uv,distribution:()=>Bv,gauge:()=>Dv});function rf(e,t,n,r){Np({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function Uv(e,t=1,n){rf("counter",e,t,n)}function Dv(e,t,n){rf("gauge",e,t,n)}function Bv(e,t,n){rf("distribution",e,t,n)}var Fv=["trace","debug","info","warn","error","fatal"];function of(e={}){let t=new Set(e.levels??Fv),n=e.client;return{log(r){let{type:o,level:i,message:s,args:a,tag:c,date:u,...p}=r,l=n||T();if(!l)return;let d=$v(o,i);if(!t.has(d))return;let{normalizeDepth:f=3,normalizeMaxBreadth:m=1e3}=l.getOptions(),g={};for(let[S,I]of Object.entries(p))g[S]=Re(I,f,m);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 h=jv(Wv(a,f,m),f,m);h?.attributes&&Object.assign(g,h.attributes),yr({level:d,message:h?.message||s||a&&ai(a,f,m)||"",attributes:g})}}}var Hv={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"},Gv={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function $v(e,t){if(e==="verbose")return"debug";if(e==="silent")return"trace";if(e){let n=Hv[e];if(n)return n}if(typeof t=="number"){let n=Gv[t];if(n)return n}return"info"}function Wv(e,t,n){if(!e?.length)return{message:""};let r=ai(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"&&!jc(o);return{message:r,messageTemplate:s?o:void 0,messageParameters:s?i:void 0}}}function jv(e,t,n){let{message:r,attributes:o,messageTemplate:i,messageParameters:s}=e,a={};if(i&&s){let c=zc(i,s);for(let[u,p]of Object.entries(c))a[u]=u.startsWith("sentry.message.parameter.")?Re(p,t,n):p}else s&&s.length>0&&s.forEach((c,u)=>{a[`sentry.message.parameter.${u}`]=Re(c,t,n)});return{message:r,attributes:{...Re(o,t,n),...a}}}var Qg="gen_ai.prompt",wn="gen_ai.system",Ce="gen_ai.request.model",ci="gen_ai.request.stream",vr="gen_ai.request.temperature",ui="gen_ai.request.max_tokens",Rr="gen_ai.request.frequency_penalty",li="gen_ai.request.presence_penalty",Nr="gen_ai.request.top_p",qc="gen_ai.request.top_k",Yc="gen_ai.request.encoding_format",Vc="gen_ai.request.dimensions",On="gen_ai.response.finish_reasons",Yt="gen_ai.response.model",Cr="gen_ai.response.id",Zg="gen_ai.response.stop_reason",Vt="gen_ai.usage.input_tokens",Kt="gen_ai.usage.output_tokens",Bt="gen_ai.usage.total_tokens",Je="gen_ai.operation.name",Jt="sentry.sdk_meta.gen_ai.input.messages.original_length",_n="gen_ai.input.messages";var Mn="gen_ai.system_instructions",ft="gen_ai.response.text",Ln="gen_ai.request.available_tools",eh="gen_ai.response.streaming",kt="gen_ai.response.tool_calls",uo="gen_ai.agent.name",th="gen_ai.pipeline.name",Fs="gen_ai.conversation.id",nh="gen_ai.usage.cache_creation_input_tokens",rh="gen_ai.usage.cache_read_input_tokens";var oh="gen_ai.invoke_agent",pi="gen_ai.embeddings.input",sf="gen_ai.embeddings",af="gen_ai.execute_tool",Kc="gen_ai.tool.name",ih="gen_ai.tool.call.id",sh="gen_ai.tool.type",Jc="gen_ai.tool.input",Xc="gen_ai.tool.output",ah="gen_ai.tool.description";function xr(e){return!e||typeof e!="object"?!1:qv(e)||uh(e)||zv(e)||lh(e)||ph(e)||Yv(e)||Vv(e)||Kv(e)||Jv(e)||Xv(e)||Qv(e)||Zv(e)}function zv(e){return"image_url"in e?typeof e.image_url=="string"?e.image_url.startsWith("data:"):ch(e):!1}function ch(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 qv(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&xr(e.source)}function uh(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="string"}function lh(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 ph(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 Yv(e){return"media_type"in e&&typeof e.media_type=="string"&&"data"in e}function Vv(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 Kv(e){return"type"in e&&e.type==="image"&&"image"in e&&typeof e.image=="string"&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}function Jv(e){return"type"in e&&(e.type==="blob"||e.type==="base64")}function Xv(e){return"b64_json"in e}function Qv(e){return"type"in e&&"result"in e&&e.type==="image_generation"}function Zv(e){return"uri"in e&&typeof e.uri=="string"&&e.uri.startsWith("data:")}var Hs="[Blob substitute]",eR=["image_url","data","content","b64_json","result","uri","image"];function lo(e){let t={...e};xr(t.source)&&(t.source=lo(t.source)),uh(e)&&(t.inlineData={...e.inlineData,data:Hs}),ch(e)&&(t.image_url={...e.image_url,url:Hs}),lh(e)&&(t.input_audio={...e.input_audio,data:Hs}),ph(e)&&(t.file={...e.file,file_data:Hs});for(let n of eR)typeof t[n]=="string"&&(t[n]=Hs);return t}var dh=2e4,Qc=e=>new TextEncoder().encode(e).length,uf=e=>Qc(JSON.stringify(e));function Zc(e,t){if(Qc(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);Qc(s)<=t?(o=s,n=i+1):r=i-1}return o}function tR(e){return typeof e=="string"?e:"text"in e&&typeof e.text=="string"?e.text:""}function fh(e,t){return typeof e=="string"?t:{...e,text:t}}function nR(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function mh(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function _h(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function rR(e,t){let n={...e,content:""},r=uf(n),o=t-r;if(o<=0)return[];let i=Zc(e.content,o);return[{...e,content:i}]}function oR(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 iR(e,t){let{key:n,items:r}=oR(e);if(n===null||r.length===0)return[];let o=r.map(c=>fh(c,"")),i=uf({...e,[n]:o}),s=t-i;if(s<=0)return[];let a=[];for(let c of r){let u=tR(c),p=Qc(u);if(p<=s)a.push(c),s-=p;else if(a.length===0){let l=Zc(u,s);l&&a.push(fh(c,l));break}else break}return a.length<=0?[]:[{...e,[n]:a}]}function sR(e,t){if(!e)return[];if(typeof e=="string"){let n=Zc(e,t);return n?[n]:[]}return typeof e!="object"?[]:nR(e)?rR(e,t):mh(e)||_h(e)?iR(e,t):[]}function cf(e){return e.map(n=>{let r;return n&&typeof n=="object"&&(mh(n)?r={...n,content:cf(n.content)}:"content"in n&&xr(n.content)&&(r={...n,content:lo(n.content)}),_h(n)&&(r={...r??n,parts:cf(n.parts)}),xr(r)?r=lo(r):xr(n)&&(r=lo(n))),r??n})}function aR(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],o=cf([r]),i=o[0];return uf(i)<=n?o:sR(i,n)}function gh(e){return aR(e,dh)}function hh(e){return Zc(e,dh)}function Ft(e){let t=T()?.getDataCollectionOptions().genAI;return{...e,recordInputs:e?.recordInputs??t?.inputs??!1,recordOutputs:e?.recordOutputs??t?.outputs??!1}}function wt(e){let t=T();return e??!(t&&Pe(t))}function fi(e,t){return e?`${e}.${t}`:t}function Sh(e,t,n,r,o){if(t!==void 0&&e.setAttributes({[Vt]:t}),n!==void 0&&e.setAttributes({[Kt]: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 po(e,t,n){if(!e.isRecording())return;let r={[eh]:!0};t.responseId&&(r[Cr]=t.responseId),t.responseModel&&(r[Yt]=t.responseModel),t.promptTokens!==void 0&&(r[Vt]=t.promptTokens),t.completionTokens!==void 0&&(r[Kt]=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[On]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[ft]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[kt]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function gn(e){return typeof e=="string"?e:JSON.stringify(e)}function hn(e){if(typeof e=="string")return hh(e);if(Array.isArray(e)){let t=gh(e);return JSON.stringify(t)}return JSON.stringify(e)}function Pn(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 cR(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?{...i,data:o}:o}function di(e,t,n){return gt(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 cR(u,t,n)}:typeof a=="function"?a.bind(s):a}}):t}var Eh={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},uR=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],Th=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...uR];function yh(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function Ih(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function bh(e,t,n){if(!t||typeof t!="object")return;let r=t,o={};if(typeof r.id=="string"&&(o[Cr]=r.id),typeof r.model=="string"&&(o[Yt]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Fs]=r.id),r.usage&&typeof r.usage=="object"){let i=r.usage,s=i.prompt_tokens??i.input_tokens;typeof s=="number"&&(o[Vt]=s);let a=i.completion_tokens??i.output_tokens;typeof a=="number"&&(o[Kt]=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[On]=JSON.stringify(s)),n){let a=i.map(u=>u.message?.content||"");o[ft]=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[On]||(o[On]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[ft]&&(o[ft]=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 lR(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 Ah(e){let t={[Ce]:e.model??"unknown"};"temperature"in e&&(t[vr]=e.temperature),"top_p"in e&&(t[Nr]=e.top_p),"frequency_penalty"in e&&(t[Rr]=e.frequency_penalty),"presence_penalty"in e&&(t[li]=e.presence_penalty),"stream"in e&&(t[ci]=e.stream),"encoding_format"in e&&(t[Yc]=e.encoding_format),"dimensions"in e&&(t[Vc]=e.dimensions);let n=lR(e);return n&&(t[Fs]=n),t}function pR(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]={...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 fR(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&&pR(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function dR(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(!Th.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*vh(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)Ih(o)?fR(o,r,n):yh(o)&&dR(o,r,n,t),yield o}finally{let o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];po(t,{...r,toolCalls:o},n)}}function mR(e){let t=Array.isArray(e.tools)?e.tools:[],r=e.web_search_options&&typeof e.web_search_options=="object"?[{type:"web_search_options",...e.web_search_options}]:[],o=[...t,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(i){y&&_.error("Failed to serialize OpenAI tools:",i);return}}function _R(e,t){let n={[wn]:"openai",[Je]:t,[$]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let r=e[0],o=mR(r);o&&(n[Ln]=o),Object.assign(n,Ah(r))}else n[Ce]="unknown";return n}function Rh(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(pi,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}=Pn(o);i&&e.setAttribute(Mn,i),e.setAttribute(_n,r?hn(s):gn(s)),Array.isArray(s)?e.setAttribute(Jt,s.length):e.setAttribute(Jt,1)}function gR(e,t,n,r,o){return function(...s){let a=n.operation||"unknown",c=_R(s,a),u=c[Ce]||"unknown",p=s[0],l=p&&typeof p=="object"&&p.stream===!0,d={name:`${a} ${u}`,op:`gen_ai.${a}`,attributes:c};if(l){let g,h=ct(d,S=>(g=e.apply(r,s),o.recordInputs&&p&&Rh(S,p,a,wt(o.enableTruncation)),(async()=>{try{let I=await g;return vh(I,S,o.recordOutputs??!1)}catch(I){throw S.setStatus({code:2,message:"internal_error"}),J(I,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),S.end(),I}})()));return di(g,h,"auto.ai.openai")}let f,m=Ue(d,g=>(f=e.apply(r,s),o.recordInputs&&p&&Rh(g,p,a,wt(o.enableTruncation)),f.then(h=>(bh(g,h,o.recordOutputs),h),h=>{throw J(h,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),h})));return di(f,m,"auto.ai.openai")}}function Nh(e,t="",n){return new Proxy(e,{get(r,o){let i=r[o],s=fi(t,String(o)),a=Eh[s];return typeof i=="function"&&a?gR(i,s,a,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?Nh(i,s,n):i}})}function lf(e,t){return Nh(e,"",Ft(t))}var Ch={"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 xh(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:o}=Pn(t);r&&e.setAttributes({[Mn]:r});let i=Array.isArray(o)?o.length:1;e.setAttributes({[_n]:n?hn(o):gn(o),[Jt]:i})}var hR={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 pf(e){return e&&hR[e]||"internal_error"}function kh(e,t){t.error&&(e.setStatus({code:2,message:pf(t.error.type)}),J(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function wh(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 SR(e,t){return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:2,message:pf(e.error?.type)}),J(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function ER(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 TR(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 yR(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 IR(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 Oh(e,t,n,r){!(e&&typeof e=="object")||SR(e,r)||(ER(e,t),TR(e,t),yR(e,t,n),IR(e,t))}async function*Mh(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)Oh(o,r,n,t),yield o}finally{po(t,r,n)}}function Lh(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=>{Oh(o,r,n,t)}),e.on("message",()=>{po(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 bR(e,t,n){let r={[wn]:"anthropic",[Je]:n,[$]:"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[Ln]=JSON.stringify(o.tools)),r[Ce]=o.model??"unknown","temperature"in o&&(r[vr]=o.temperature),"top_p"in o&&(r[Nr]=o.top_p),"stream"in o&&(r[ci]=o.stream),"top_k"in o&&(r[qc]=o.top_k),"frequency_penalty"in o&&(r[Rr]=o.frequency_penalty),"max_tokens"in o&&(r[ui]=o.max_tokens)}else t==="models.retrieve"||t==="models.get"?r[Ce]=e[0]:r[Ce]="unknown";return r}function ff(e,t,n){let r=wh(t);xh(e,r,n),"prompt"in t&&e.setAttributes({[Qg]:JSON.stringify(t.prompt)})}function AR(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[ft]: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({[ft]:t.completion}),"input_tokens"in t&&e.setAttributes({[ft]:JSON.stringify(t.input_tokens)})}function vR(e,t){"id"in t&&"model"in t&&(e.setAttributes({[Cr]:t.id,[Yt]:t.model}),"usage"in t&&t.usage&&Sh(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function RR(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){kh(e,t);return}n&&AR(e,t),vR(e,t)}}function Ph(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 NR(e,t,n,r,o,i,s,a,c,u,p){let l=o[Ce]??"unknown",d={name:`${i} ${l}`,op:`gen_ai.${i}`,attributes:o};if(u&&!p){let f,m=ct(d,g=>(f=e.apply(n,r),c.recordInputs&&a&&ff(g,a,wt(c.enableTruncation)),(async()=>{try{let h=await f;return Mh(h,g,c.recordOutputs??!1)}catch(h){return Ph(h,g,s)}})()));return di(f,m,"auto.ai.anthropic")}else return ct(d,f=>{try{c.recordInputs&&a&&ff(f,a,wt(c.enableTruncation));let m=t.apply(n,r);return Lh(m,f,c.recordOutputs??!1)}catch(m){return Ph(m,f,s)}})}function CR(e,t,n,r,o){return new Proxy(e,{apply(i,s,a){let c=n.operation||"unknown",u=bR(a,t,c),p=u[Ce]??"unknown",l=typeof a[0]=="object"?a[0]:void 0,d=!!l?.stream,f=n.streaming===!0;if(d||f)return NR(e,i,r,a,u,c,t,l,o,d,f);let m,g=Ue({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},h=>(m=i.apply(r,a),o.recordInputs&&l&&ff(h,l,wt(o.enableTruncation)),m.then(S=>(RR(h,S,o.recordOutputs),S),S=>{throw J(S,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}}),S})));return di(m,g,"auto.ai.anthropic")}})}function Uh(e,t="",n){return new Proxy(e,{get(r,o){let i=r[o],s=fi(t,String(o)),a=Ch[s];return typeof i=="function"&&a?CR(i,s,a,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?Uh(i,s,n):i}})}function df(e,t){return Uh(e,"",Ft(t))}var Dh={"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}},Bh="google_genai";function xR(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 kR(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 wR(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 OR(e,t,n,r){!e||xR(e,r)||(kR(e,t),wR(e,t,n))}async function*Fh(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of e)OR(o,r,n,t),yield o}finally{po(t,r,n)}}function mi(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>mi(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[{...e,role:t}]:[{role:t,content:e}]}function Hh(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 MR(e){let t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[vr]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[Nr]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[qc]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[ui]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[Rr]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[li]=e.presencePenalty),t}function LR(e,t,n){let r={[wn]:Bh,[Je]:e,[$]:"auto.ai.google_genai"};if(t){if(r[Ce]=Hh(t,n),"config"in t&&typeof t.config=="object"&&t.config){let o=t.config;if(Object.assign(r,MR(o)),"tools"in o&&Array.isArray(o.tools)){let i=o.tools.flatMap(s=>s.functionDeclarations);r[Ln]=JSON.stringify(i)}}}else r[Ce]=Hh({},n);return r}function Gh(e,t,n,r){if(n){let i=t.contents;i!=null&&e.setAttribute(pi,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(...mi(t.config.systemInstruction,"system")),"history"in t&&o.push(...mi(t.history,"user")),"contents"in t&&o.push(...mi(t.contents,"user")),"message"in t&&o.push(...mi(t.message,"user")),Array.isArray(o)&&o.length){let{systemInstructions:i,filteredMessages:s}=Pn(o);i&&e.setAttribute(Mn,i);let a=Array.isArray(s)?s.length:0;e.setAttributes({[Jt]:a,[_n]:r?hn(s):gn(s)})}}function PR(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(Yt,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){let r=t.usageMetadata;typeof r.promptTokenCount=="number"&&e.setAttributes({[Vt]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&e.setAttributes({[Kt]: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({[ft]:r.join("")})}if(n&&t.functionCalls){let r=t.functionCalls;Array.isArray(r)&&r.length>0&&e.setAttributes({[kt]:JSON.stringify(r)})}}}function UR(e,t,n,r,o){let i=n.operation==="embeddings";return new Proxy(e,{apply(s,a,c){let u=n.operation||"unknown",p=c[0],l=LR(u,p,r),d=l[Ce]??"unknown";return n.streaming?ct({name:`${u} ${d}`,op:`gen_ai.${u}`,attributes:l},async f=>{try{o.recordInputs&&p&&Gh(f,p,i,wt(o.enableTruncation));let m=await s.apply(r,c);return Fh(m,f,!!o.recordOutputs)}catch(m){throw f.setStatus({code:2,message:"internal_error"}),J(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),f.end(),m}}):Ue({name:`${u} ${d}`,op:`gen_ai.${u}`,attributes:l},f=>(o.recordInputs&&p&&Gh(f,p,i,wt(o.enableTruncation)),bs(()=>s.apply(r,c),m=>{J(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},m=>{i||PR(f,m,o.recordOutputs)})))}})}function mf(e,t="",n){return new Proxy(e,{get:(r,o,i)=>{let s=Reflect.get(r,o,i),a=fi(t,String(o)),c=Dh[a];if(typeof s=="function"&&c){let u=c.operation?UR(s,a,c,r,n):s.bind(r);return c.proxyResultPath?function(...p){let l=u(...p);return l&&typeof l=="object"?mf(l,c.proxyResultPath,n):l}:u}return typeof s=="function"?s.bind(r):s&&typeof s=="object"?mf(s,a,n):s}})}function _f(e,t){return mf(e,"",Ft(t))}var er="auto.ai.langchain",$h={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var Xt=(e,t,n)=>{n!=null&&(e[t]=n)},Ht=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function fo(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function _i(e){if(Array.isArray(e))try{let t=e.map(n=>n&&typeof n=="object"&&xr(n)?lo(n):n);return JSON.stringify(t)}catch{return String(e)}return fo(e)}function Gs(e){let t=e.toLowerCase();return $h[t]??t}function Wh(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 gf(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function $s(e){return e.map(t=>{let n=t._getType;if(typeof n=="function"){let o=n.call(t);return{role:Gs(o),content:_i(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"?Wh(i):"user";return{role:Gs(s),content:_i(t.kwargs?.content)}}if(t.type){let o=String(t.type).toLowerCase();return{role:Gs(o),content:_i(t.content)}}if(t.role)return{role:Gs(String(t.role)),content:_i(t.content)};let r=t.constructor?.name;return r&&r!=="Object"?{role:Gs(Wh(r)),content:_i(t.content)}:{role:"user",content:_i(t.content)}})}function DR(e,t,n){let r={},o="kwargs"in e?e.kwargs:void 0,i=t?.temperature??n?.ls_temperature??o?.temperature;Ht(r,vr,i);let s=t?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Ht(r,ui,s);let a=t?.top_p??o?.top_p;Ht(r,Nr,a);let c=t?.frequency_penalty;Ht(r,Rr,c);let u=t?.presence_penalty;return Ht(r,li,u),t&&"stream"in t&&Xt(r,ci,!!t.stream),r}function zh(e,t,n,r,o){return{[wn]:fo(e??"langchain"),[Je]:"chat",[Ce]:fo(t),[$]:er,...DR(n,r,o)}}function qh(e,t,n,r,o,i){let s=i?.ls_provider,a=o?.model??i?.ls_model_name??"unknown",c=zh(s,a,e,o,i);if(n&&Array.isArray(t)&&t.length>0){Xt(c,Jt,t.length);let u=t.map(p=>({role:"user",content:p}));Xt(c,_n,r?hn(u):gn(u))}return c}function Yh(e,t,n,r,o,i){let s=i?.ls_provider??e.id?.[2],a=o?.model??i?.ls_model_name??"unknown",c=zh(s,a,e,o,i);if(n&&Array.isArray(t)&&t.length>0){let u=$s(t.flat()),{systemInstructions:p,filteredMessages:l}=Pn(u);p&&Xt(c,Mn,p);let d=Array.isArray(l)?l.length:0;Xt(c,Jt,d),Xt(c,_n,r?hn(l):gn(l))}return c}function BR(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&&Xt(t,kt,fo(n))}function FR(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)Ht(t,Vt,n.promptTokens),Ht(t,Kt,n.completionTokens),Ht(t,Bt,n.totalTokens);else if(r){Ht(t,Vt,r.input_tokens),Ht(t,Kt,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&&Ht(t,Bt,s),r.cache_creation_input_tokens!==void 0&&Ht(t,nh,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Ht(t,rh,r.cache_read_input_tokens)}}function Vh(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let u=e.generations.flat().map(p=>p.generationInfo?.finish_reason?p.generationInfo.finish_reason:p.generation_info?.finish_reason?p.generation_info.finish_reason:null).filter(p=>typeof p=="string");if(u.length>0&&Xt(n,On,fo(u)),BR(e.generations,n),t){let p=e.generations.flat().map(l=>l.text??l.message?.content).filter(l=>typeof l=="string");p.length>0&&Xt(n,ft,fo(p))}}FR(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&&Xt(n,Yt,s);let a=r?.id??i?.id;a&&Xt(n,Cr,a);let c=r?.stop_reason??i?.response_metadata?.finish_reason;return c&&Xt(n,Zg,fo(c)),n}function eu(e){let t={},n=e?.lc_agent_name;return typeof n=="string"&&(t[uo]=n),t}function Kh(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 HR(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.addHandler=="function"&&typeof t.copy=="function"}function GR(e){return typeof e=="object"&&e?.name==="SentryCallbackHandler"}function jh(e){return e.some(GR)}function Jh(e,t){if(!e)return[t];if(HR(e)){if(jh(e.handlers??[]))return e;let r=e.copy();return r.addHandler(t,!0),r}let n=Array.isArray(e)?e:[e];return jh(n)?e:[...n,t]}function gi(e={}){let{recordInputs:t,recordOutputs:n}=Ft(e),r=wt(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,p,l,d,f,m){let g=gf(d),h=qh(a,c,t,r,g,f),S=h[Ce],I=h[Je];ct({name:`${I} ${S}`,op:"gen_ai.chat",attributes:{...eu(f),...h,[q]:"gen_ai.chat"}},x=>(o.set(u,x),x))},handleChatModelStart(a,c,u,p,l,d,f,m){let g=gf(d),h=Yh(a,c,t,r,g,f),S=Kh(l);S&&(h[Ln]=S);let I=h[Ce],x=h[Je];ct({name:`${x} ${I}`,op:"gen_ai.chat",attributes:{...eu(f),...h,[q]:"gen_ai.chat"}},v=>(o.set(u,v),v))},handleLLMEnd(a,c,u,p,l){let d=o.get(c);if(d?.isRecording()){let f=Vh(a,n);f&&d.setAttributes(f),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:`${er}.llm_error_handler`}})},handleChainStart(a,c,u,p,l,d,f,m){if(d?.__sentry_langgraph__)return;let g=m||a.name||"unknown_chain",h={[$]:"auto.ai.langchain","langchain.chain.name":g};t&&(h["langchain.chain.inputs"]=JSON.stringify(c)),ct({name:`chain ${g}`,op:"gen_ai.invoke_agent",attributes:{...h,[q]:"gen_ai.invoke_agent"}},S=>(o.set(u,S),S))},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:`${er}.chain_error_handler`}})},handleToolStart(a,c,u,p,l,d,f){if(d?.__sentry_langgraph__)return;let m=f||a.name||"unknown_tool",g={...eu(d),[$]:er,[Je]:"execute_tool",[Kc]:m};t&&(g[Jc]=c),ct({name:`execute_tool ${m}`,op:"gen_ai.execute_tool",attributes:{...g,[q]:"gen_ai.execute_tool"}},h=>(o.set(u,h),h))},handleToolEnd(a,c){let u=o.get(c);if(u?.isRecording()){if(n){let p=a,l=p&&typeof p=="object"&&"content"in p?p.content:a;u.setAttributes({[Xc]: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:`${er}.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 Ws="auto.ai.langgraph";function Xh(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 Qh(e){let t=e[0];return typeof t=="object"&&t&&"name"in t&&typeof t.name=="string"?t.name:null}function Zh(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(p,l,d){let f={[$]:Ws,[q]:af,[Je]:"execute_tool",[Kc]:a,[sh]:"function"},g=d[1]?.metadata?.lc_agent_name??n;typeof g=="string"&&(f[uo]=g),c&&(f[ah]=c);let h=d[0];if(typeof h=="object"&&h&&("id"in h&&typeof h.id=="string"&&(f[ih]=h.id),t.recordInputs)){let S="args"in h&&typeof h.args=="object"?h.args:h;try{f[Jc]=JSON.stringify(S)}catch{}}return Ue({op:af,name:`execute_tool ${a}`,attributes:f},async S=>{try{let I=await Reflect.apply(p,l,d);if(t.recordOutputs)try{let x=I,v=x&&typeof x=="object"&&"content"in x?x.content:I;S.setAttribute(Xc,typeof v=="string"?v:JSON.stringify(v))}catch{}return I}catch(I){throw S.setStatus({code:2,message:"internal_error"}),J(I,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),I}})}});i.invoke=u,Object.defineProperty(i,r,{value:!0,enumerable:!1})}return e}function $R(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 WR(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 jR(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(Yt,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&e.setAttribute(On,[r.finish_reason])}}function eS(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 tS(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=$R(s);a&&e.setAttribute(kt,JSON.stringify(a));let c=$s(s);e.setAttribute(ft,JSON.stringify(c));let u=0,p=0,l=0;for(let d of s){let f=WR(d);u+=f.inputTokens,p+=f.outputTokens,l+=f.totalTokens,jR(e,d)}u>0&&e.setAttribute(Vt,u),p>0&&e.setAttribute(Kt,p),l>0&&e.setAttribute(Bt,l)}var hf=!1,tu="__sentry_patched__";function nS(e,t){if(Object.prototype.hasOwnProperty.call(e,tu))return e;let n=gi(t),r=new Proxy(e,{apply(o,i,s){return hf?Reflect.apply(o,i,s):Ue({op:"gen_ai.create_agent",name:"create_agent",attributes:{[$]:Ws,[q]:"gen_ai.create_agent",[Je]:"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(uo,u.name),a.updateName(`create_agent ${u.name}`));let p=c.invoke;return p&&typeof p=="function"&&(c.invoke=rS(p.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,tu,{value:!0,enumerable:!1}),r}function rS(e,t,n,r,o,i){return new Proxy(e,{apply(s,a,c){let u=o?.modelName??o?.model;return Ue({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[$]:Ws,[q]:oh,[Je]:"invoke_agent"}},async p=>{try{let l=n?.name;l&&typeof l=="string"&&(p.setAttribute(th,l),p.setAttribute(uo,l),p.updateName(`invoke_agent ${l}`)),u&&p.setAttribute(Ce,u);let m=(c.length>1?c[1]:void 0)?.configurable?.thread_id;if(m&&typeof m=="string"&&p.setAttribute(Fs,m),i){let v=c[1]??{};c[1]=v;let M=v.metadata??{};v.metadata={...M,__sentry_langgraph__:!0,...typeof l=="string"?{lc_agent_name:l}:{}},v.callbacks=Jh(v.callbacks,i)}let g=eS(t);g&&p.setAttribute(Ln,JSON.stringify(g));let h=r.recordInputs,S=r.recordOutputs,I=c.length>0?c[0]?.messages??[]:[];if(I&&h){let v=$s(I),{systemInstructions:M,filteredMessages:P}=Pn(v);M&&p.setAttribute(Mn,M);let E=wt(r.enableTruncation),C=Array.isArray(P)?P.length:0;p.setAttributes({[_n]:E?hn(P):gn(P),[Jt]:C})}let x=await Reflect.apply(s,a,c);return S&&tS(p,I??null,x),x}catch(l){throw p.setStatus({code:2,message:"internal_error"}),J(l,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),l}})}})}function Sf(e,t){if(Object.prototype.hasOwnProperty.call(e,tu))return e;let n=Ft(t),r=gi(n),o=new Proxy(e,{apply(i,s,a){let c=Xh(a),u=Qh(a),p=a[0];p&&Array.isArray(p.tools)&&p.tools.length>0&&Zh(p.tools,n,u??void 0),hf=!0;let l;try{l=Reflect.apply(i,s,a)}finally{hf=!1}let d=l.invoke;if(d&&typeof d=="function"){let f={};u&&(f.name=u),l.invoke=rS(d.bind(l),l,f,n,c,r)}return l}});return Object.defineProperty(o,tu,{value:!0,enumerable:!1}),o}function Ef(e,t){return e.compile=nS(e.compile,Ft(t)),e}function oS(e,t,n){let r=n.getOptions(),o=n.getDsn(),i=r.tunnel,s=mn(r._metadata),a={sent_at:new Date(rt()).toISOString(),...zR(t)&&{trace:t},...s&&{sdk:s},...!!i&&o&&{dsn:je(o)}},c=n.getDataCollectionOptions().userInfo?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...lt()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}];return we(a,[u])}function zR(e){return!!e.trace_id&&!!e.public_key}function iS(e){let t=156;if(t+=e.name.length*2,t+=rp(e.attributes),e.links&&e.links.length>0){let r=e.links[0]?.attributes,o=100+(r?rp(r):0);t+=o*e.links.length}return t}var sS=1e3,qR=5e6,js=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<=sS?r:sS,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=i&&i>0?i:qR,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:Ir(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=iS(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(y&&_.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){y&&_.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let i=Ne(o),s=r.map(c=>{let{_segmentSpan:u,...p}=c;return p}),a=oS(s,i,this._client);y&&_.log(`Sending span envelope for trace ${t} with ${s.length} spans`),this._client.sendEnvelope(a).then(null,c=>{y&&_.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 nu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var hi=R;function ru(){return"history"in hi&&!!hi.history}function YR(){if(!("fetch"in hi))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Si(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Ei(){if(typeof EdgeRuntime=="string")return!0;if(!YR())return!1;if(Si(hi.fetch))return!0;let e=!1,t=hi.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Si(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){y&&_.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function ou(){return"ReportingObserver"in hi}function Un(e,t){let n="fetch",r=tt(n,e);return nt(n,()=>cS(void 0,t)),r}function su(e){let t="fetch-body-resolved",n=tt(t,e);return nt(t,()=>cS(KR)),n}function cS(e,t=!1){t&&!Ei()||Ee(R,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=JR(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:Z()*1e3,virtualError:o,headers:XR(r)};return e||He("fetch",{...a}),n.apply(R,r).then(async c=>(e?e(c):He("fetch",{...a,endTimestamp:Z()*1e3,response:c}),c),c=>{He("fetch",{...a,endTimestamp:Z()*1e3,error:c}),Ze(c)&&c.stack===void 0&&(c.stack=o.stack,_e(c,"framesToPop",1));let p=T()?.getOptions().enhanceFetchErrorMessages??"always";if(p!==!1&&c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{let f=new URL(a.fetchData.url).host;p==="always"?c.message=`${c.message} (${f})`:_e(c,"__sentry_fetch_url_host__",f)}catch{}throw c})}})}async function VR(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 KR(e){let t;try{t=e.clone()}catch{return}VR(t,()=>{He("fetch-body-resolved",{endTimestamp:Z()*1e3,response:e})})}function iu(e,t){return!!e&&typeof e=="object"&&!!e[t]}function aS(e){return typeof e=="string"?e:e?iu(e,"url")?e.url:e.toString?e.toString():"":""}function JR(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:aS(n),method:iu(r,"method")?String(r.method).toUpperCase():rs(n)&&iu(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:aS(t),method:iu(t,"method")?String(t.method).toUpperCase():"GET"}}function XR(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(rs(t))return new Headers(t.headers)}catch{}}var uS=R;function dt(){try{return uS.document.location.href}catch{return""}}function kr(e,t=5){if(!uS.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 QR(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 ZR(e){let t=e??{},n={[$]:er,[q]:sf,[Je]:"embeddings",[Ce]:t.model??"unknown"};return n[wn]=QR(t),"dimensions"in t&&(n[Vc]=t.dimensions),"encodingFormat"in t&&(n[Yc]=t.encodingFormat),n}function lS(e,t={}){let{recordInputs:n}=Ft(t);return new Proxy(e,{apply(r,o,i){let s=ZR(o),a=s[Ce]||"unknown";if(n){let c=i[0];c!=null&&(s[pi]=typeof c=="string"?c:JSON.stringify(c))}return Ue({name:`embeddings ${a}`,op:sf,attributes:s},()=>Reflect.apply(r,o,i).then(void 0,c=>{throw J(c,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),c}))}})}function Tf(e,t){let n=e;return typeof n.embedQuery=="function"&&(n.embedQuery=lS(n.embedQuery,t)),typeof n.embedDocuments=="function"&&(n.embedDocuments=lS(n.embedDocuments,t)),e}var Sn=R,Te=Sn.document,zs=Sn.navigator,xS="Report a Bug",TN="Cancel",yN="Send Bug Report",IN="Confirm",bN="Report a Bug",AN="your.email@example.org",vN="Email",RN="What's the bug? What did you expect?",NN="Description",CN="Your Name",xN="Name",kN="Thank you for your report!",wN="(required)",ON="Add a screenshot",MN="Remove screenshot",LN="Highlight",PN="Hide",UN="Remove",kS="Unable to submit feedback with empty message",wS="No client setup, cannot send feedback.",OS="Unable to determine if Feedback was correctly sent.",MS="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",LS="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",DN="widget",BN="api",FN=5e3,HN={ERROR_EMPTY_MESSAGE:kS,ERROR_NO_CLIENT:wS,ERROR_TIMEOUT:OS,ERROR_FORBIDDEN:MS,ERROR_GENERIC:LS};function lu(e,t){return t?.[e]??HN[e]}function pS(e,t){return new Error(lu(e,t))}var kf=(e,t={includeReplay:!0})=>{let n=t.errorMessages;if(!e.message)throw pS("ERROR_EMPTY_MESSAGE",n);let r=T();if(!r)throw pS("ERROR_NO_CLIENT",n);e.tags&&Object.keys(e.tags).length&&w().setTags(e.tags);let o=ii({source:BN,url:dt(),...e},t);return new Promise((i,s)=>{let a=setTimeout(()=>{c(),s(lu("ERROR_TIMEOUT",n))},3e4),c=r.on("afterSendEvent",(u,p)=>{if(u.event_id===o)return clearTimeout(a),c(),p?.statusCode&&p.statusCode>=200&&p.statusCode<300?i(o):p?.statusCode===403?s(lu("ERROR_FORBIDDEN",n)):s(lu("ERROR_GENERIC",n))})})},pu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function GN(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(zs.userAgent)||/Macintosh/i.test(zs.userAgent)&&zs.maxTouchPoints&&zs.maxTouchPoints>1||!isSecureContext)}function au(e,t){return{...e,...t,tags:{...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:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function $N(e){let t=Te.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 Gt(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}var Ti=20,WN="http://www.w3.org/2000/svg";function jN(){let e=a=>Sn.document.createElementNS(WN,a),t=Gt(e("svg"),{width:`${Ti}`,height:`${Ti}`,viewBox:`0 0 ${Ti} ${Ti}`,fill:"var(--actor-color, var(--foreground))"}),n=Gt(e("g"),{clipPath:"url(#clip0_57_80)"}),r=Gt(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=Gt(e("clipPath"),{id:"clip0_57_80"}),s=Gt(e("rect"),{width:`${Ti}`,height:`${Ti}`,fill:"white"});return i.appendChild(s),o.appendChild(i),t.appendChild(o).appendChild(i).appendChild(s),t}function zN({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){let o=Te.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||xS,o.appendChild(jN()),e){let s=Te.createElement("span");s.appendChild(Te.createTextNode(e)),o.appendChild(s)}let i=$N(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 PS="rgba(88, 74, 192, 1)",qN={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:PS,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%)"},fS={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:PS,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 dS(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 mS({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){let o=Te.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
|
+
${dS(e==="dark"?{...fS,...t}:{...qN,...n})}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${e==="system"?`
|
|
99
|
+
@media (prefers-color-scheme: dark) {
|
|
100
|
+
:host {
|
|
101
|
+
color-scheme: only dark;
|
|
102
|
+
|
|
103
|
+
${dS({...fS,...t})}
|
|
104
|
+
}
|
|
105
|
+
}`:""}
|
|
106
|
+
`,r&&o.setAttribute("nonce",r),o}var hu=({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:p=!0,enableScreenshot:l=!0,useSentryUser:d={email:"email",name:"username"},tags:f,styleNonce:m,scriptNonce:g,colorScheme:h="system",themeLight:S={},themeDark:I={},addScreenshotButtonLabel:x=ON,cancelButtonLabel:v=TN,confirmButtonLabel:M=IN,emailLabel:P=vN,emailPlaceholder:E=AN,formTitle:C=bN,isRequiredLabel:z=wN,messageLabel:A=NN,messagePlaceholder:U=RN,nameLabel:k=xN,namePlaceholder:D=CN,removeScreenshotButtonLabel:G=MN,submitButtonLabel:oe=yN,successMessageText:ae=kN,triggerLabel:W=xS,triggerAriaLabel:O="",highlightToolText:j=LN,hideToolText:B=PN,removeHighlightText:ie=UN,errorEmptyMessageText:ce=kS,errorNoClientText:ge=wS,errorTimeoutText:ke=OS,errorForbiddenText:on=MS,errorGenericText:sn=LS,onFormOpen:cr,onFormClose:Dr,onSubmitSuccess:ya,onSubmitError:Br,onFormSubmitted:Ia}={})=>{let Gn={id:o,autoInject:i,showBranding:s,isEmailRequired:a,isNameRequired:c,showEmail:u,showName:p,enableScreenshot:l,useSentryUser:d,tags:f,styleNonce:m,scriptNonce:g,colorScheme:h,themeDark:I,themeLight:S,triggerLabel:W,triggerAriaLabel:O,cancelButtonLabel:v,submitButtonLabel:oe,confirmButtonLabel:M,formTitle:C,emailLabel:P,emailPlaceholder:E,messageLabel:A,messagePlaceholder:U,nameLabel:k,namePlaceholder:D,successMessageText:ae,isRequiredLabel:z,addScreenshotButtonLabel:x,removeScreenshotButtonLabel:G,highlightToolText:j,hideToolText:B,removeHighlightText:ie,errorEmptyMessageText:ce,errorNoClientText:ge,errorTimeoutText:ke,errorForbiddenText:on,errorGenericText:sn,onFormClose:Dr,onFormOpen:cr,onSubmitError:Br,onSubmitSuccess:ya,onFormSubmitted:Ia},Wt=null,yt=null,Pt=[],wo=H=>{if(!Wt){let pe=Te.createElement("div");pe.id=String(H.id),Te.body.appendChild(pe),Wt=pe.attachShadow({mode:"open"}),yt=mS(H),Wt.appendChild(yt)}return Wt},Oo=async H=>{let pe=H.enableScreenshot&&GN(),Q,fe;try{Q=(t?t():await e("feedbackModalIntegration",g))(),ro(Q)}catch{throw pu&&_.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=pe?n?n():await e("feedbackScreenshotIntegration",g):void 0;$r&&(fe=$r(),ro(fe))}catch{pu&&_.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}let X={ERROR_EMPTY_MESSAGE:H.errorEmptyMessageText,ERROR_NO_CLIENT:H.errorNoClientText,ERROR_TIMEOUT:H.errorTimeoutText,ERROR_FORBIDDEN:H.errorForbiddenText,ERROR_GENERIC:H.errorGenericText},yn=($r,EI)=>kf($r,{includeReplay:!0,...EI,errorMessages:X}),Gr=Q.createDialog({options:{...H,onFormClose:()=>{Gr?.close(),H.onFormClose?.()},onFormSubmitted:()=>{Gr?.close(),H.onFormSubmitted?.()}},screenshotIntegration:fe,sendFeedback:yn,shadow:wo(H)});return Gr},Fr=(H,pe={})=>{let Q=au(Gn,pe),fe=typeof H=="string"?Te.querySelector(H):typeof H.addEventListener=="function"?H:null;if(!fe)throw pu&&_.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let X=null,yn=async()=>{X||(X=await Oo({...Q,onFormSubmitted:()=>{X?.removeFromDom(),Q.onFormSubmitted?.()}})),X.appendToDom(),X.open()};fe.addEventListener("click",yn);let Gr=()=>{Pt=Pt.filter($r=>$r!==Gr),X?.removeFromDom(),X=null,fe.removeEventListener("click",yn)};return Pt.push(Gr),Gr},Hr=(H={})=>{let pe=au(Gn,H),Q=wo(pe),fe=zN({triggerLabel:pe.triggerLabel,triggerAriaLabel:pe.triggerAriaLabel,shadow:Q,styleNonce:m});return Fr(fe.el,{...pe,onFormOpen(){fe.hide()},onFormClose(){fe.show()},onFormSubmitted(){fe.show()}}),fe};return{name:"Feedback",setupOnce(){!lt()||!Gn.autoInject||(Te.readyState==="loading"?Te.addEventListener("DOMContentLoaded",()=>Hr().appendToDom()):Hr().appendToDom())},attachTo:Fr,createWidget(H={}){let pe=Hr(au(Gn,H));return pe.appendToDom(),pe},async createForm(H={}){return Oo(au(Gn,H))},setTheme(H){if(Gn.colorScheme=H,Wt){let pe=mS(Gn);yt?Wt.replaceChild(pe,yt):Wt.prepend(pe),yt=pe}},remove(){Wt&&(Wt.parentElement?.remove(),Wt=null,yt=null),Pt.forEach(H=>H()),Pt=[]}}});function US(){return T()?.getIntegrationByName("Feedback")}var Su,Ie,DS,mo,_S,BS,Rf,qs={},wf=[],YN=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Of=Array.isArray;function Or(e,t){for(var n in t)e[n]=t[n];return e}function FS(e){var t=e.parentNode;t&&t.removeChild(e)}function re(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 fu(e,s,r,o,null)}function fu(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??++DS,__i:-1,__u:0};return o==null&&Ie.vnode!=null&&Ie.vnode(i),i}function Ys(e){return e.children}function du(e,t){this.props=e,this.context=t}function Ii(e,t){if(t==null)return e.__?Ii(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"?Ii(e):null}function VN(e,t,n){var r,o=e.__v,i=o.__e,s=e.__P;if(s)return(r=Or({},o)).__v=o.__v+1,Ie.vnode&&Ie.vnode(r),Mf(s,r,o,e.__n,s.ownerSVGElement!==void 0,32&o.__u?[i]:null,t,i??Ii(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&HS(r),r}function HS(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 HS(e)}}function gS(e){(!e.__d&&(e.__d=!0)&&mo.push(e)&&!gu.__r++||_S!==Ie.debounceRendering)&&((_S=Ie.debounceRendering)||BS)(gu)}function gu(){var e,t,n,r=[],o=[];for(mo.sort(Rf);e=mo.shift();)e.__d&&(n=mo.length,t=VN(e,r,o)||t,n===0||mo.length>n?(Nf(r,t,o),o.length=r.length=0,t=void 0,mo.sort(Rf)):t&&Ie.__c&&Ie.__c(t,wf));t&&Nf(r,t,o),gu.__r=0}function GS(e,t,n,r,o,i,s,a,c,u,p){var l,d,f,m,g,h=r&&r.__k||wf,S=t.length;for(n.__d=c,KN(n,t,h),c=n.__d,l=0;l<S;l++)(f=n.__k[l])!=null&&typeof f!="boolean"&&typeof f!="function"&&(d=f.__i===-1?qs:h[f.__i]||qs,f.__i=l,Mf(e,f,d,o,i,s,a,c,u,p),m=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Lf(d.ref,null,f),p.push(f.ref,f.__c||m,f)),g==null&&m!=null&&(g=m),65536&f.__u||d.__k===f.__k?c=$S(f,c,e):typeof f.type=="function"&&f.__d!==void 0?c=f.__d:m&&(c=m.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=c,n.__e=g}function KN(e,t,n){var r,o,i,s,a,c=t.length,u=n.length,p=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?fu(null,o,null,null,o):Of(o)?fu(Ys,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?fu(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=JN(o,n,s=r+l,p),o.__i=a,i=null,a!==-1&&(p--,(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?p>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=Ii(i)),Cf(i,i,!1),n[r]=null,p--);if(p)for(r=0;r<u;r++)(i=n[r])!=null&&(131072&i.__u)==0&&(i.__e==e.__d&&(e.__d=Ii(i)),Cf(i,i))}function $S(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=$S(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 JN(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 hS(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||YN.test(t)?n:n+"px"}function cu(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||hS(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||hS(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?ES:SS,i)):e.removeEventListener(t,i?ES:SS,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 SS(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(Ie.event?Ie.event(e):e)}}function ES(e){if(this.l)return this.l[e.type+!0](Ie.event?Ie.event(e):e)}function Mf(e,t,n,r,o,i,s,a,c,u){var p,l,d,f,m,g,h,S,I,x,v,M,P,E,C,z=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[a=t.__e=n.__e]),(p=Ie.__b)&&p(t);e:if(typeof z=="function")try{if(S=t.props,I=(p=z.contextType)&&r[p.__c],x=p?I?I.props.value:p.__:r,n.__c?h=(l=t.__c=n.__c).__=l.__E:("prototype"in z&&z.prototype.render?t.__c=l=new z(S,x):(t.__c=l=new du(S,x),l.constructor=z,l.render=QN),I&&I.sub(l),l.props=S,l.state||(l.state={}),l.context=x,l.__n=r,d=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),z.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Or({},l.__s)),Or(l.__s,z.getDerivedStateFromProps(S,l.__s))),f=l.props,m=l.state,l.__v=t,d)z.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(z.getDerivedStateFromProps==null&&S!==f&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(S,x),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(S,l.__s,x)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=S,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(A){A&&(A.__=t)}),v=0;v<l._sb.length;v++)l.__h.push(l._sb[v]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(S,l.__s,x),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(f,m,g)})}if(l.context=x,l.props=S,l.__P=e,l.__e=!1,M=Ie.__r,P=0,"prototype"in z&&z.prototype.render){for(l.state=l.__s,l.__d=!1,M&&M(t),p=l.render(l.props,l.state,l.context),E=0;E<l._sb.length;E++)l.__h.push(l._sb[E]);l._sb=[]}else do l.__d=!1,M&&M(t),p=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++P<25);l.state=l.__s,l.getChildContext!=null&&(r=Or(Or({},r),l.getChildContext())),d||l.getSnapshotBeforeUpdate==null||(g=l.getSnapshotBeforeUpdate(f,m)),GS(e,Of(C=p!=null&&p.type===Ys&&p.key==null?p.props.children:p)?C:[C],t,n,r,o,i,s,a,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),h&&(l.__E=l.__=null)}catch(A){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),Ie.__e(A,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=XN(n.__e,t,n,r,o,i,s,c,u);(p=Ie.diffed)&&p(t)}function Nf(e,t,n){for(var r=0;r<n.length;r++)Lf(n[r],n[++r],n[++r]);Ie.__c&&Ie.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){Ie.__e(i,o.__v)}})}function XN(e,t,n,r,o,i,s,a,c){var u,p,l,d,f,m,g,h=n.props,S=t.props,I=t.type;if(I==="svg"&&(o=!0),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!I&&(I?f.localName===I:f.nodeType===3)){e=f,i[u]=null;break}}if(e==null){if(I===null)return document.createTextNode(S);e=o?document.createElementNS("http://www.w3.org/2000/svg",I):document.createElement(I,S.is&&S),i=null,a=!1}if(I===null)h===S||a&&e.data===S||(e.data=S);else{if(i=i&&Su.call(e.childNodes),h=n.props||qs,!a&&i!=null)for(h={},u=0;u<e.attributes.length;u++)h[(f=e.attributes[u]).name]=f.value;for(u in h)f=h[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=f:u==="key"||u in S||cu(e,u,null,f,o));for(u in S)f=S[u],u=="children"?d=f:u=="dangerouslySetInnerHTML"?p=f:u=="value"?m=f:u=="checked"?g=f:u==="key"||a&&typeof f!="function"||h[u]===f||cu(e,u,f,h[u],o);if(p)a||l&&(p.__html===l.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(l&&(e.innerHTML=""),GS(e,Of(d)?d:[d],t,n,r,o&&I!=="foreignObject",i,s,i?i[0]:n.__k&&Ii(n,0),a,c),i!=null)for(u=i.length;u--;)i[u]!=null&&FS(i[u]);a||(u="value",m!==void 0&&(m!==e[u]||I==="progress"&&!m||I==="option"&&m!==h[u])&&cu(e,u,m,h[u],!1),u="checked",g!==void 0&&g!==e[u]&&cu(e,u,g,h[u],!1))}return e}function Lf(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){Ie.__e(r,n)}}function Cf(e,t,n){var r,o;if(Ie.unmount&&Ie.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Lf(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){Ie.__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]&&Cf(r[o],t,n||typeof e.type!="function");n||e.__e==null||FS(e.__e),e.__=e.__e=e.__d=void 0}function QN(e,t,n){return this.constructor(e,n)}function ZN(e,t,n){var r,o,i,s;Ie.__&&Ie.__(e,t),o=(r=!1)?null:t.__k,i=[],s=[],Mf(t,e=t.__k=re(Ys,null,[e]),o||qs,qs,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,Nf(i,e,s)}Su=wf.slice,Ie={__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}},DS=0,du.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Or({},this.state),typeof e=="function"&&(e=e(Or({},n),this.props)),e&&Or(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),gS(this))},du.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),gS(this))},du.prototype.render=Ys,mo=[],BS=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Rf=function(e,t){return e.__v.__b-t.__v.__b},gu.__r=0;var tr,ye,yf,TS,bi=0,WS=[],mu=[],Le=Ie,yS=Le.__b,IS=Le.__r,bS=Le.diffed,AS=Le.__c,vS=Le.unmount,RS=Le.__;function go(e,t){Le.__h&&Le.__h(ye,e,bi||t),bi=0;var n=ye.__H||(ye.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:mu}),n.__[e]}function _o(e){return bi=1,jS(qS,e)}function jS(e,t,n){var r=go(tr++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):qS(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=ye,!ye.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(d){return!!d.__c});if(p.every(function(d){return!d.__N}))return!i||i.call(this,a,c,u);var l=!1;return p.forEach(function(d){if(d.__N){var f=d.__[0];d.__=d.__N,d.__N=void 0,f!==d.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!i||i.call(this,a,c,u))};ye.u=!0;var i=ye.shouldComponentUpdate,s=ye.componentWillUpdate;ye.componentWillUpdate=function(a,c,u){if(this.__e){var p=i;i=void 0,o(a,c,u),i=p}s&&s.call(this,a,c,u)},ye.shouldComponentUpdate=o}return r.__N||r.__}function eC(e,t){var n=go(tr++,3);!Le.__s&&Pf(n.__H,t)&&(n.__=e,n.i=t,ye.__H.__h.push(n))}function zS(e,t){var n=go(tr++,4);!Le.__s&&Pf(n.__H,t)&&(n.__=e,n.i=t,ye.__h.push(n))}function tC(e){return bi=5,Vs(function(){return{current:e}},[])}function nC(e,t,n){bi=6,zS(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 Vs(e,t){var n=go(tr++,7);return Pf(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function yi(e,t){return bi=8,Vs(function(){return e},t)}function rC(e){var t=ye.context[e.__c],n=go(tr++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(ye)),t.props.value):e.__}function oC(e,t){Le.useDebugValue&&Le.useDebugValue(t?t(e):e)}function iC(e){var t=go(tr++,10),n=_o();return t.__=e,ye.componentDidCatch||(ye.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function sC(){var e=go(tr++,11);if(!e.__){for(var t=ye.__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 aC(){for(var e;e=WS.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_u),e.__H.__h.forEach(xf),e.__H.__h=[]}catch(t){e.__H.__h=[],Le.__e(t,e.__v)}}Le.__b=function(e){ye=null,yS&&yS(e)},Le.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),RS&&RS(e,t)},Le.__r=function(e){IS&&IS(e),tr=0;var t=(ye=e.__c).__H;t&&(yf===ye?(t.__h=[],ye.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=mu,n.__N=n.i=void 0})):(t.__h.forEach(_u),t.__h.forEach(xf),t.__h=[],tr=0)),yf=ye},Le.diffed=function(e){bS&&bS(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(WS.push(t)!==1&&TS===Le.requestAnimationFrame||((TS=Le.requestAnimationFrame)||cC)(aC)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==mu&&(n.__=n.__V),n.i=void 0,n.__V=mu})),yf=ye=null},Le.__c=function(e,t){t.some(function(n){try{n.__h.forEach(_u),n.__h=n.__h.filter(function(r){return!r.__||xf(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Le.__e(r,n.__v)}}),AS&&AS(e,t)},Le.unmount=function(e){vS&&vS(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{_u(r)}catch(o){t=o}}),n.__H=void 0,t&&Le.__e(t,n.__v))};var NS=typeof requestAnimationFrame=="function";function cC(e){var t,n=function(){clearTimeout(r),NS&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);NS&&(t=requestAnimationFrame(n))}function _u(e){var t=ye,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ye=t}function xf(e){var t=ye;e.__c=e.__(),ye=t}function Pf(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function qS(e,t){return typeof t=="function"?t(e):t}var uC=Object.defineProperty({__proto__:null,useCallback:yi,useContext:rC,useDebugValue:oC,useEffect:eC,useErrorBoundary:iC,useId:sC,useImperativeHandle:nC,useLayoutEffect:zS,useMemo:Vs,useReducer:jS,useRef:tC,useState:_o},Symbol.toStringTag,{value:"Module"}),lC="http://www.w3.org/2000/svg";function pC(){let e=r=>Te.createElementNS(lC,r),t=Gt(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Gt(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 fC({options:e}){let t=Vs(()=>({__html:pC().outerHTML}),[]);return re("h2",{class:"dialog__header"},re("span",{class:"dialog__title"},e.formTitle),e.showBranding?re("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function dC(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 If(e,t){let n=e.get(t);return typeof n=="string"?n.trim():""}function mC({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:i,onSubmitError:s,showEmail:a,showName:c,screenshotInput:u}){let{tags:p,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:d,cancelButtonLabel:f,emailLabel:m,emailPlaceholder:g,isEmailRequired:h,isNameRequired:S,messageLabel:I,messagePlaceholder:x,nameLabel:v,namePlaceholder:M,submitButtonLabel:P,isRequiredLabel:E}=e,[C,z]=_o(!1),[A,U]=_o(null),[k,D]=_o(!1),G=u?.input,[oe,ae]=_o(null),W=yi(B=>{ae(B),D(!1)},[]),O=yi(B=>{let ie=dC(B,{emailLabel:m,isEmailRequired:h,isNameRequired:S,messageLabel:I,nameLabel:v});return ie.length>0?U(`Please enter in the following required fields: ${ie.join(", ")}`):U(null),ie.length===0},[m,h,S,I,v]),j=yi(async B=>{z(!0);try{if(B.preventDefault(),!(B.target instanceof HTMLFormElement))return;let ie=new FormData(B.target),ce=await(u&&k?u.value():void 0),ge={name:If(ie,"name"),email:If(ie,"email"),message:If(ie,"message"),attachments:ce?[ce]:void 0};if(!O(ge))return;try{let ke=await o({name:ge.name,email:ge.email,message:ge.message,source:DN,tags:p},{attachments:ge.attachments});i(ge,ke)}catch(ke){pu&&_.error(ke);let on=ke instanceof Error?ke:new Error(String(ke));U(on.message),s(on)}}finally{z(!1)}},[u&&k,i,s]);return re("form",{class:"form",onSubmit:j},G&&k?re(G,{onError:W}):null,re("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:C},re("div",{class:"form__top"},A?re("div",{class:"form__error-container"},A):null,c?re("label",{for:"name",class:"form__label"},re(bf,{label:v,isRequiredLabel:E,isRequired:S}),re("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:M,required:S,type:"text"})):re("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?re("label",{for:"email",class:"form__label"},re(bf,{label:m,isRequiredLabel:E,isRequired:h}),re("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:g,required:h,type:"email"})):re("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),re("label",{for:"message",class:"form__label"},re(bf,{label:I,isRequiredLabel:E,isRequired:!0}),re("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:x,required:!0,rows:5})),G?re("label",{for:"screenshot",class:"form__label"},re("button",{class:"btn btn--default",disabled:C,type:"button",onClick:()=>{ae(null),D(B=>!B)}},k?d:l),oe?re("div",{class:"form__error-container"},oe.message):null):null),re("div",{class:"btn-group"},re("button",{class:"btn btn--primary",disabled:C,type:"submit"},P),re("button",{class:"btn btn--default",disabled:C,type:"button",onClick:r},f))))}function bf({label:e,isRequired:t,isRequiredLabel:n}){return re("span",{class:"form__label__text"},e,t&&re("span",{class:"form__label__text--required"},n))}var uu=16,CS=17,_C="http://www.w3.org/2000/svg";function gC(){let e=c=>Sn.document.createElementNS(_C,c),t=Gt(e("svg"),{width:`${uu}`,height:`${CS}`,viewBox:`0 0 ${uu} ${CS}`,fill:"inherit"}),n=Gt(e("g"),{clipPath:"url(#clip0_57_156)"}),r=Gt(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=Gt(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=Gt(e("clipPath"),{id:"clip0_57_156"}),a=Gt(e("rect"),{width:`${uu}`,height:`${uu}`,fill:"white",transform:"translate(0 0.5)"});return s.appendChild(a),i.appendChild(s),t.appendChild(i).appendChild(s).appendChild(a),t}function hC({open:e,onFormSubmitted:t,...n}){let r=n.options,o=Vs(()=>({__html:gC().outerHTML}),[]),[i,s]=_o(null),a=yi(()=>{i&&(clearTimeout(i),s(null)),t()},[i]),c=yi((u,p)=>{n.onSubmitSuccess(u,p),s(setTimeout(()=>{t(),s(null)},FN))},[t]);return re(Ys,null,i?re("div",{class:"success__position",onClick:a},re("div",{class:"success__content"},r.successMessageText,re("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):re("dialog",{class:"dialog",onClick:r.onFormClose,open:e},re("div",{class:"dialog__position"},re("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()}},re(fC,{options:r}),re(mC,{...n,onSubmitSuccess:c})))))}var SC=`
|
|
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
|
+
`,EC=`
|
|
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
|
+
`,TC=`
|
|
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
|
+
`,yC=`
|
|
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
|
+
`,IC=`
|
|
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 bC(e){let t=Te.createElement("style");return t.textContent=`
|
|
387
|
+
:host {
|
|
388
|
+
--dialog-inset: var(--inset);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
${SC}
|
|
392
|
+
${EC}
|
|
393
|
+
${TC}
|
|
394
|
+
${yC}
|
|
395
|
+
${IC}
|
|
396
|
+
`,e&&t.setAttribute("nonce",e),t}function AC(){let e=w().getUser(),t=se().getUser(),n=zt().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}var YS=(()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{let o=r,i=e.useSentryUser,s=AC(),a=Te.createElement("div"),c=bC(e.styleNonce),u="",p={get el(){return a},appendToDom(){!o.contains(c)&&!o.contains(a)&&(o.appendChild(c),o.appendChild(a))},removeFromDom(){a.remove(),c.remove(),Te.body.style.overflow=u},open(){d(!0),e.onFormOpen?.(),T()?.emit("openFeedbackWidget"),u=Te.body.style.overflow,Te.body.style.overflow="hidden"},close(){d(!1),Te.body.style.overflow=u}},l=t?.createInput({h:re,hooks:uC,dialog:p,options:e}),d=f=>{ZN(re(hC,{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:()=>{d(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(m,g)=>{d(!1),e.onSubmitSuccess?.(m,g)},onSubmitError:m=>{e.onSubmitError?.(m)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:f}),a)};return p}}));function vC({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 RC(e){let t=Te.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 NC({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 CC({hooks:e}){function t(){let[n,r]=e.useState(Sn.devicePixelRatio??1);return e.useEffect(()=>{let o=()=>{r(Sn.devicePixelRatio)},i=matchMedia(`(resolution: ${Sn.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 zs.mediaDevices.getDisplayMedia({video:{width:Sn.innerWidth*a,height:Sn.innerHeight*a},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),p=Te.createElement("video");await new Promise((l,d)=>{p.srcObject=u,p.onloadedmetadata=()=>{o(p,a),u.getTracks().forEach(f=>f.stop()),l()},p.play().catch(d)}),i()})().catch(s)},[])}}function xC(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 wr(e,t,n){if(!e)return;let r=e.getContext("2d",t);r&&n(e,r)}function Af(e,t){wr(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function vf(e,t,n){wr(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=>{xC(i,o,t)})})}function kC({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){let i=CC({hooks:t}),s=NC({h:e}),a=vC({h:e}),c={__html:RC(o.styleNonce).innerText},u=r.el.style,p=({screenshot:l})=>{let[d,f]=t.useState("highlight"),[m,g]=t.useState([]),h=t.useRef(null),S=t.useRef(null),I=t.useRef(null),x=t.useRef(null),[v,M]=t.useState(1),P=t.useMemo(()=>{let k=Te.getElementById(o.id);if(!k)return"white";let D=getComputedStyle(k);return D.getPropertyValue("--button-primary-background")||D.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{let k=()=>{let D=h.current;D&&(wr(l.canvas,{alpha:!1},G=>{let oe=Math.min(D.clientWidth/G.width,D.clientHeight/G.height);M(oe)}),(D.clientHeight===0||D.clientWidth===0)&&setTimeout(k,0))};return k(),Sn.addEventListener("resize",k),()=>{Sn.removeEventListener("resize",k)}},[l]);let E=t.useCallback((k,D)=>{wr(k,{alpha:!0},(G,oe)=>{oe.scale(D,D),G.width=l.canvas.width,G.height=l.canvas.height})},[l]);t.useEffect(()=>{E(S.current,l.dpi),Af(S.current,l.canvas)},[l]),t.useEffect(()=>{E(I.current,l.dpi),wr(I.current,{alpha:!0},(k,D)=>{D.clearRect(0,0,k.width,k.height)}),vf(I.current,P,m)},[m,P]),t.useEffect(()=>{E(n,l.dpi),Af(n,l.canvas),wr(Te.createElement("canvas"),{alpha:!0},(k,D)=>{D.scale(l.dpi,l.dpi),k.width=l.canvas.width,k.height=l.canvas.height,vf(k,P,m),Af(n,k)})},[m,l,P]);let C=k=>{if(!d||!x.current)return;let D=x.current.getBoundingClientRect(),G={type:d,x:k.offsetX/v,y:k.offsetY/v},oe=(O,j)=>{let B=(j.clientX-D.x)/v,ie=(j.clientY-D.y)/v;return{type:O.type,x:Math.min(O.x,B),y:Math.min(O.y,ie),w:Math.abs(B-O.x),h:Math.abs(ie-O.y)}},ae=O=>{wr(I.current,{alpha:!0},(j,B)=>{B.clearRect(0,0,j.width,j.height)}),vf(I.current,P,[...m,oe(G,O)])},W=O=>{let j=oe(G,O);j.w*v>=1&&j.h*v>=1&&g(B=>[...B,j]),Te.removeEventListener("mousemove",ae),Te.removeEventListener("mouseup",W)};Te.addEventListener("mousemove",ae),Te.addEventListener("mouseup",W)},z=t.useCallback(k=>D=>{D.preventDefault(),D.stopPropagation(),g(G=>{let oe=[...G];return oe.splice(k,1),oe})},[]),A={width:`${l.canvas.width*v}px`,height:`${l.canvas.height*v}px`},U=k=>{k.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:h},e("canvas",{ref:S,id:"background",style:A}),e("canvas",{ref:I,id:"foreground",style:A}),e("div",{ref:x,onMouseDown:C,style:A},m.map((k,D)=>e("div",{key:D,class:"editor__rect",style:{top:`${k.y*v}px`,left:`${k.x*v}px`,width:`${k.w*v}px`,height:`${k.h*v}px`}},e("button",{"aria-label":o.removeHighlightText,onClick:z(D),onMouseDown:U,onMouseUp:U,type:"button"},e(a,null))))))),e(s,{options:o,action:d,setAction:f}))};return function({onError:d}){let[f,m]=t.useState();return i({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((g,h)=>{wr(Te.createElement("canvas"),{alpha:!1},(S,I)=>{I.scale(h,h),S.width=g.videoWidth,S.height=g.videoHeight,I.drawImage(g,0,0,S.width,S.height),m({canvas:S,dpi:h})}),n.width=g.videoWidth,n.height=g.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(g=>{u.display="block",d(g)},[])}),f?e(p,{screenshot:f}):e("div",null)}}var VS=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{let o=Te.createElement("canvas");return{input:kC({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 N=R,Uf=0;function Df(){return Uf>0}function wC(){Uf++,setTimeout(()=>{Uf--})}function ho(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(fr(e))return e}catch{return e}let r=function(...o){R._sentryWrappedDepth=(R._sentryWrappedDepth||0)+1;try{let i=o.map(s=>ho(s,t));return e.apply(this,i)}catch(i){throw wC(),We(s=>{s.addEventProcessor(a=>(t.mechanism&&(qr(a,void 0,void 0),Xe(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),J(i)}),i}finally{R._sentryWrappedDepth=(R._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}os(r,e),_e(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Ai(){let e=dt(),{referrer:t}=N.document||{},{userAgent:n}=N.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}var OC=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],MC={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function LC(e){return MC[e]||e.replace("Integration","").toLowerCase()}var KS=N;async function Eu(e,t){let n=OC.includes(e)?LC(e):void 0,r=KS.Sentry=KS.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=PC(n),s=N.document.createElement("script");s.src=i,s.crossOrigin="anonymous",s.referrerPolicy="strict-origin",t&&s.setAttribute("nonce",t);let a=new Promise((l,d)=>{s.addEventListener("load",()=>l()),s.addEventListener("error",d)}),c=N.document.currentScript,u=N.document.body||N.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 p=r[e];if(typeof p!="function")throw new Error(`Could not load integration: ${e}`);return p}function PC(e){let n=T()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${It}/${e}.min.js`,n).toString()}var JS=hu({lazyLoadIntegration:Eu});var Bf=hu({getModalIntegration:()=>YS,getScreenshotIntegration:()=>VS});function vi(e,t){let n=Tu(e,t),r={type:HC(t),value:GC(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function UC(e,t,n,r){let i=T()?.getOptions().normalizeDepth,s=jC(t),a={__serialized__:ss(t,i)};if(s)return{exception:{values:[vi(e,s)]},extra:a};let c={exception:{values:[{type:pr(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:$C(t,{isUnhandledRejection:r})}]},extra:a};if(n){let u=Tu(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function Ff(e,t){return{exception:{values:[vi(e,t)]}}}function Tu(e,t){let n=t.stacktrace||t.stack||"",r=BC(t),o=FC(t);try{return e(n,r,o)}catch{}return[]}var DC=/Minified React error #\d+;/i;function BC(e){return e&&DC.test(e.message)?1:0}function FC(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function XS(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function HC(e){let t=e?.name;return!t&&XS(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function GC(e){let t=e?.message;return XS(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Pc(t.error):Pc(e):"No error message"}function yu(e,t,n,r){let o=n?.syntheticException||void 0,i=Ri(e,t,o,r);return Xe(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),xn(i)}function Iu(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=Hf(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),xn(s)}function Ri(e,t,n,r,o){let i;if(Lo(t)&&t.error)return Ff(e,t.error);if(ns(t)||Ra(t)){let s=t;if("stack"in t){i=Ff(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let c=Tu(e,n);c.length&&(a.stacktrace={frames:c},Xe(i,{synthetic:!0}))}}else{let a=s.name||(ns(s)?"DOMError":"DOMException"),c=s.message?`${a}: ${s.message}`:a;i=Hf(e,c,n,r),qr(i,c)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return Ze(t)?Ff(e,t):Me(t)||pr(t)?(i=UC(e,t,n,o),Xe(i,{synthetic:!0}),i):(i=Hf(e,t,n,r),qr(i,`${t}`,void 0),Xe(i,{synthetic:!0}),i)}function Hf(e,t,n,r){let o={};if(r&&n){let i=Tu(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Xe(o,{synthetic:!0})}if(In(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 $C(e,{isUnhandledRejection:t}){let n=Ca(e),r=t?"promise rejection":"exception";return Lo(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:pr(e)?`Event \`${WC(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function WC(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function jC(e){return Object.values(e).find(t=>t instanceof Error)}var Ni=class extends Ls{constructor(t){let n=zC(t),r=N.SENTRY_SDK_SOURCE||Ap();Gp(n,"browser",["browser"],r),super(n);let{userInfo:o}=this.getDataCollectionOptions();n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:o?"auto":"never",...n._metadata.sdk.settings});let{sendClientReports:i,enableLogs:s,_experiments:a,enableMetrics:c}=this._options,u=c??a?.enableMetrics??!0;N.document&&(i||s||u)&&N.document.addEventListener("visibilitychange",()=>{N.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&oo(this),u&&ti(this))}),o&&this.on("beforeSendSession",Hp)}eventFromException(t,n){return yu(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Iu(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 zC(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:N.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Qe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var F=R;var qC=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Dn=(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=qC(t.value,n),e(t)))}};var nr=(e=!0)=>{let t=F.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var Zt=()=>nr()?.activationStart??0;function en(e,t,n){F.document&&F.addEventListener(e,t,n)}function So(e,t,n){F.document&&F.removeEventListener(e,t,n)}var Ci=-1,QS=new Set,YC=()=>F.document?.visibilityState==="hidden"&&!F.document?.prerendering?0:1/0,bu=e=>{if(VC(e)&&Ci>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of QS)t();isFinite(Ci)||(Ci=e.type==="visibilitychange"?e.timeStamp:0,So("prerenderingchange",bu,!0))}},Bn=()=>{if(F.document&&Ci<0){let e=Zt();Ci=(F.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??YC(),en("visibilitychange",bu,!0),en("pagehide",bu,!0),en("prerenderingchange",bu,!0)}return{get firstHiddenTime(){return Ci},onHidden(e){QS.add(e)}}};function VC(e){return e.type==="pagehide"||F.document?.visibilityState==="hidden"}var ZS=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var Fn=(e,t=-1)=>{let n=nr(),r="navigate";return n&&(F.document?.prerendering||Zt()>0?r="prerender":F.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:ZS(),navigationType:r}};var Gf=new WeakMap;function xi(e,t){try{return Gf.get(e)||Gf.set(e,new t),Gf.get(e)}catch{return new t}}var Au=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 tn=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}};var ki=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var Mr=e=>{F.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var KC=[1800,3e3],eE=(e,t={})=>{Mr(()=>{let n=Bn(),r=Fn("FCP"),o,s=tn("paint",a=>{for(let c of a)c.name==="first-contentful-paint"&&(s.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-Zt(),0),r.entries.push(c),o(!0)))});s&&(o=Dn(e,r,KC,t.reportAllChanges))})};var JC=[.1,.25],tE=(e,t={})=>{eE(ki(()=>{let n=Fn("CLS",0),r,o=Bn(),i=xi(t,Au),s=c=>{for(let u of c)i._processEntry(u);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=tn("layout-shift",s);a&&(r=Dn(e,n,JC,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),F?.setTimeout?.(r))}))};var nE=0,$f=1/0,vu=0,XC=e=>{e.forEach(t=>{t.interactionId&&($f=Math.min($f,t.interactionId),vu=Math.max(vu,t.interactionId),nE=vu?(vu-$f)/7+1:0)})},Wf,jf=()=>Wf?nE:performance.interactionCount||0,rE=()=>{"interactionCount"in performance||Wf||(Wf=tn("event",XC,{type:"event",buffered:!0,durationThreshold:0}))};var zf=10,oE=0,QC=()=>jf()-oE,Ru=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){oE=jf(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(QC()/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<zf||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>zf){let o=this._longestInteractionList.splice(zf);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var Nu=e=>{let t=F.requestIdleCallback||F.setTimeout;F.document?.visibilityState==="hidden"?e():(e=ki(e),en("visibilitychange",e,{once:!0,capture:!0}),en("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),So("visibilitychange",e,{capture:!0}),So("pagehide",e,{capture:!0})}))};var ZC=[200,500],ex=40,iE=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=Bn();Mr(()=>{rE();let r=Fn("INP"),o,i=xi(t,Ru),s=c=>{Nu(()=>{for(let p of c)i._processEntry(p);let u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=tn("event",s,{durationThreshold:t.durationThreshold??ex});o=Dn(e,r,ZC,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var Cu=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var tx=[2500,4e3],sE=(e,t={})=>{Mr(()=>{let n=Bn(),r=Fn("LCP"),o,i=xi(t,Cu),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-Zt(),0),r.entries=[u],o())},a=tn("largest-contentful-paint",s);if(a){o=Dn(e,r,tx,t.reportAllChanges);let c=ki(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),u=p=>{p.isTrusted&&(Nu(c),So(p.type,u,{capture:!0}))};for(let p of["keydown","click","visibilitychange"])en(p,u,{capture:!0})}})};var nx=[800,1800],qf=e=>{F.document?.prerendering?Mr(()=>qf(e)):F.document?.readyState!=="complete"?addEventListener("load",()=>qf(e),!0):setTimeout(e)},aE=(e,t={})=>{let n=Fn("TTFB"),r=Dn(e,n,nx,t.reportAllChanges);qf(()=>{let o=nr();o&&(n.value=Math.max(o.responseStart-Zt(),0),n.entries=[o],r(!0))})};var Ks={},xu={},cE,uE,lE,pE;function rr(e,t=!1){return ku("cls",e,rx,cE,t)}function or(e,t=!1){return ku("lcp",e,ox,uE,t)}function Yf(e){return ku("ttfb",e,ix,lE)}function Eo(e){return ku("inp",e,sx,pE)}function Ot(e,t){return fE(e,t),xu[e]||(ax(e),xu[e]=!0),dE(e,t)}function Js(e,t){let n=Ks[e];if(n?.length)for(let r of n)try{r(t)}catch(o){Qe&&_.error(`Error while triggering instrumentation handler.
|
|
489
|
+
Type: ${e}
|
|
490
|
+
Name: ${_t(r)}
|
|
491
|
+
Error:`,o)}}function rx(){return tE(e=>{Js("cls",{metric:e}),cE=e},{reportAllChanges:!0})}function ox(){return sE(e=>{Js("lcp",{metric:e}),uE=e},{reportAllChanges:!0})}function ix(){return aE(e=>{Js("ttfb",{metric:e}),lE=e})}function sx(){return iE(e=>{Js("inp",{metric:e}),pE=e})}function ku(e,t,n,r,o=!1){fE(e,t);let i;return xu[e]||(i=n(),xu[e]=!0),r&&t({metric:r}),dE(e,t,o?i:void 0)}function ax(e){let t={};e==="event"&&(t.durationThreshold=0),tn(e,n=>{Js(e,{entries:n})},t)}function fE(e,t){Ks[e]=Ks[e]||[],Ks[e].push(t)}function dE(e,t,n){return()=>{n&&n();let r=Ks[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function mE(e){return"duration"in e}var cx=80;function Se(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],i=0,s=0,a=" > ",c=a.length,u,p=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||cx;for(;n&&i++<r&&(u=ux(n,p),!(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 ux(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&&Ve(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 _E=e=>{let t=n=>{(n.type==="pagehide"||F.document?.visibilityState==="hidden")&&e(n)};en("visibilitychange",t,{capture:!0,once:!0}),en("pagehide",t,{capture:!0,once:!0})};function wu(e){return typeof e=="number"&&isFinite(e)}function ir(e,t,n,{...r}){let o=L(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Jn(e,()=>{let i=Ke({startTime:t,...r});return i&&i.end(n),i})}function wi(e){let t=T();if(!t)return;let{name:n,transaction:r,attributes:o,startTime:i}=e,{release:s,environment:a}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),p=t.getIntegrationByName("Replay")?.getReplayId(),l=w(),d=l.getUser(),f=d!==void 0?d.email||d.id||d.ip_address:void 0,m;try{m=l.getScopeData().contexts.profile.profile_id}catch{}let g={release:s,environment:a,user:f||void 0,profile_id:m||void 0,replay_id:p||void 0,transaction:r,"user_agent.original":F.navigator?.userAgent,"client.address":c?"{{auto}}":void 0,...o};return Ke({name:n,attributes:g,startTime:i,experimental:{standalone:!0}})}function nn(){return F.addEventListener&&F.performance}function me(e){return e/1e3}function gE(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 To(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function yo(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}_E(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function hE(e){let t=0,n;if(!To("layout-shift"))return;let r=rr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);yo(e,(o,i)=>{lx(t,n,i,o),r()})}function lx(e,t,n,r){Qe&&_.log(`Sending CLS span (${e})`);let o=t?me((le()||0)+t.startTime):Z(),i=w().getScopeData().transactionName,s=t?Se(t.sources[0]?.node):"Layout shift",a={[$]:"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,p)=>{a[`cls.source.${p+1}`]=Se(u.node)});let c=wi({name:s,transaction:i,attributes:a,startTime:o});c&&(c.addEvent("cls",{[fn]:"",[dn]:e}),c.end(o))}var px=6e4;function Io(e){return e!=null&&e>0&&e<=px}function SE(e){let t=0,n;if(!To("largest-contentful-paint"))return;let r=or(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Io(o.value)||(t=o.value,n=i)},!0);yo(e,(o,i)=>{fx(t,n,i,o),r()})}function fx(e,t,n,r){if(!Io(e))return;Qe&&_.log(`Sending LCP span (${e})`);let o=me((le()||0)+(t?.startTime||0)),i=w().getScopeData().transactionName,s=t?Se(t.element):"Largest contentful paint",a={[$]:"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"]=Se(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=wi({name:s,transaction:i,attributes:a,startTime:o});c&&(c.addEvent("lcp",{[fn]:"millisecond",[dn]:e}),c.end(o))}function rn(e){return e&&((le()||performance.timeOrigin)+e)/1e3}function Xs(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=gE(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return le()||nn()?.timeOrigin?dx({...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 dx(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var mx=2147483647,EE=0,Lt={},Mt,Mu;function Vf({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=nn();if(r&&le()){r.mark&&F.performance.mark("sentry-tracing-init");let o=t?SE(n):t===!1?gx():void 0,i=e?hE(n):e===!1?_x():void 0,s=hx(),a=Sx();return()=>{s(),a(),o?.(),i?.()}}return()=>{}}function Kf(){Ot("longtask",({entries:e})=>{let t=ee();if(!t)return;let{op:n,start_timestamp:r}=L(t);for(let o of e){let i=me(le()+o.startTime),s=me(o.duration);n==="navigation"&&r&&i<r||ir(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[$]:"auto.ui.browser.metrics"}})}})}function Jf(){new PerformanceObserver(t=>{let n=ee();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=me(le()+r.startTime),{start_timestamp:i,op:s}=L(n);if(s==="navigation"&&i&&o<i)continue;let a=me(r.duration),c={[$]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:p,invokerType:l,sourceURL:d,sourceFunctionName:f,sourceCharPosition:m}=u;c["browser.script.invoker"]=p,c["browser.script.invoker_type"]=l,d&&(c["code.filepath"]=d),f&&(c["code.function"]=f),m!==-1&&(c["browser.script.source_char_position"]=m),ir(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function Xf(){Ot("event",({entries:e})=>{let t=ee();if(t){for(let n of e)if(n.name==="click"){let r=me(le()+n.startTime),o=me(n.duration),i={name:Se(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[$]:"auto.ui.browser.metrics"}},s=kr(n.target);s&&(i.attributes["ui.component_name"]=s),ir(t,r,r+o,i)}}})}function _x(){return rr(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(Lt.cls={value:e.value,unit:""},Mu=t)},!0)}function gx(){return or(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Io(e.value)||(Lt.lcp={value:e.value,unit:"millisecond"},Mt=t)},!0)}function hx(){return Yf(({metric:e})=>{e.entries[e.entries.length-1]&&(Lt.ttfb={value:e.value,unit:"millisecond"})})}function Sx(){return Ot("paint",({entries:e})=>{let t=Bn();for(let n of e){let r=n.startTime<t.firstHiddenTime;n.name==="first-paint"&&r&&(Lt.fp={value:n.startTime,unit:"millisecond"}),n.name==="first-contentful-paint"&&r&&(Lt.fcp={value:n.startTime,unit:"millisecond"})}})}function Qf(e,t){let n=nn(),r=le();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s}=t,a=me(r),c=n.getEntries(),{op:u,start_timestamp:p}=L(e);c.slice(EE).forEach(l=>{let d=me(l.startTime),f=me(Math.max(0,l.duration));if(!(u==="navigation"&&p&&a+d<p))switch(l.entryType){case"navigation":{Ix(e,l,a);break}case"mark":case"paint":case"measure":{Tx(e,l,d,f,a,i);break}case"resource":{vx(e,l,l.name,d,f,a,s);break}}}),EE=Math.max(c.length-1,0),Rx(e,o)}function Zf(e,t){let n=le();if(!nn()?.getEntries||!n){TE();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:o,recordLcpOnPageloadSpan:i}=t,s=me(n);if(L(e).op==="pageload"){if(xx(Lt),r){let a=(c,u,p)=>{let l=p??`browser.web_vital.${c}.value`;e.setAttribute(l,u),Qe&&_.log("Setting web vital attribute",{[l]:u},"on pageload span")};["ttfb","fp","fcp"].forEach(c=>{Lt[c]&&a(c,Lt[c].value)}),Lt["ttfb.requestTime"]&&a("ttfb.requestTime",Lt["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else o||delete Lt.cls,i||delete Lt.lcp,Object.entries(Lt).forEach(([a,c])=>{Qr(a,c.value,c.unit,e)}),Nx(e,t);e.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",s),e.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",Zt())}TE()}function TE(){Mt=void 0,Mu=void 0,Lt={}}function Ex(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function Tx(e,t,n,r,o,i){if(Ex(t)||["mark","measure"].includes(t.entryType)&&$e(t.name,i))return;let s=nr(!1),a=me(s?s.requestStart:0),c=o+Math.max(n,a),u=o+n,p=u+r,l={[$]:"auto.resource.browser.metrics"};c!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=c),yx(l,t),c<=p&&ir(e,c,p,{name:t.name,op:t.entryType,attributes:l})}function yx(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&Ge(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(Ge(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Ix(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ou(e,t,r,n)}),Ou(e,t,"secureConnection",n,"TLS/SSL"),Ou(e,t,"fetch",n,"cache"),Ou(e,t,"domainLookup",n,"DNS"),Ax(e,t,n)}function Ou(e,t,n,r,o=n){let i=bx(n),s=t[i],a=t[`${n}Start`];!a||!s||ir(e,r+me(a),r+me(s),{op:`browser.${o}`,name:t.name,attributes:{[$]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function bx(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Ax(e,t,n){let r=n+me(t.requestStart),o=n+me(t.responseEnd),i=n+me(t.responseStart);t.responseEnd&&(ir(e,r,o,{op:"browser.request",name:t.name,attributes:{[$]:"auto.ui.browser.metrics"}}),ir(e,i,o,{op:"browser.response",name:t.name,attributes:{[$]:"auto.ui.browser.metrics"}}))}function vx(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={[$]:"auto.resource.browser.metrics"},u=Nt(n);u.protocol&&(c["url.scheme"]=u.protocol.split(":").pop()),u.host&&(c["server.address"]=u.host),c["url.same_origin"]=n.includes(F.location.origin),Cx(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 p={...c,...Xs(t)},l=i+r,d=l+o;ir(e,l,d,{name:n.replace(F.location.origin,""),op:a,attributes:p})}function Rx(e,t){let n=F.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),wu(r.rtt)&&(t?e.setAttribute("network.connection.rtt",r.rtt):L(e).op==="pageload"&&Qr("connection.rtt",r.rtt,"millisecond"))),wu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),wu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function Nx(e,t){Mt&&t.recordLcpOnPageloadSpan&&(Mt.element&&e.setAttribute("lcp.element",Se(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)),Mu?.sources&&t.recordClsOnPageloadSpan&&Mu.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Se(n.node)))}function Cx(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<mx||typeof i=="string")&&(t[o]=i)})}function xx(e){let t=nr(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var kx="ElementTiming",wx=(()=>({name:kx,setup(){!nn()||!le()||Ot("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&&Ar.distribution("ui.element.render_time",s,{unit:"millisecond",attributes:c}),a>0&&Ar.distribution("ui.element.load_time",a,{unit:"millisecond",attributes:c})}})}})),ed=wx;var td=[],Qs=new Map,Oi=new Map,nd=60;function rd(){if(nn()&&le()){let t=Ox();return()=>{t()}}return()=>{}}var Mi={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 Ox(){return Eo(Mx)}var Mx=({metric:e})=>{if(e.value==null)return;let t=me(e.value);if(t>nd)return;let n=e.entries.find(m=>m.duration===e.value&&Mi[m.name]);if(!n)return;let{interactionId:r}=n,o=Mi[n.name],i=me(le()+n.startTime),s=ee(),a=s?ne(s):void 0,c=r!=null?Qs.get(r):void 0,u=c?.span||a,p=u?L(u).description:w().getScopeData().transactionName,l=c?.elementName||Se(n.target),d={[$]:"auto.http.browser.inp",[q]:`ui.interaction.${o}`,[st]:n.duration},f=wi({name:l,transaction:p,attributes:d,startTime:i});f&&(f.addEvent("inp",{[fn]:"millisecond",[dn]:e.value}),f.end(i+t))};function yE(e){return e!=null?Qs.get(e):void 0}function od(){let e=Object.keys(Mi);lt()&&e.forEach(o=>{F.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Se(i),a=Math.round(o.timeStamp);if(Oi.set(a,s),Oi.size>50){let c=Oi.keys().next().value;c!==void 0&&Oi.delete(c)}}function n(o){let i=Math.round(o.startTime),s=Oi.get(i);if(!s)for(let a=-5;a<=5;a++){let c=Oi.get(i+a);if(c){s=c;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=ee(),s=i&&ne(i);o.forEach(a=>{if(!mE(a))return;let c=a.interactionId;if(c==null||Qs.has(c))return;let u=a.target?Se(a.target):n(a);if(td.length>10){let p=td.shift();Qs.delete(p)}td.push(c),Qs.set(c,{span:s,elementName:u})})};Ot("event",r),Ot("first-input",r)}function id(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:c,startTime:u,endTime:p}=e,l=w().getScopeData().transactionName,d={[$]:r,[q]:n,[st]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":l,"user_agent.original":F.navigator?.userAgent,...s};a&&gr(a).attributes?.[q]==="pageload"&&(d["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(d[`browser.web_vital.${o}.report_event`]=c);let f=Ke({name:t,attributes:d,startTime:u,parentSpan:a});f&&f.end(p??u)}function sd(e){let t=0,n;if(!To("largest-contentful-paint"))return;let r=or(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Io(o.value)||(t=o.value,n=i)},!0);yo(e,(o,i,s)=>{Lx(t,n,s,o),r()})}function Lx(e,t,n,r){if(!Io(e))return;Qe&&_.log(`Sending LCP span (${e})`);let o=le()||0,i=me(o),s=me(o+(t?.startTime||0)),a=t?Se(t.element):"Largest contentful paint",c={};t?.element&&(c["browser.web_vital.lcp.element"]=Se(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),id({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 ad(e){let t=0,n;if(!To("layout-shift"))return;let r=rr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);yo(e,(o,i,s)=>{Px(t,n,s,o),r()})}function Px(e,t,n,r){Qe&&_.log(`Sending CLS span (${e})`);let o=t?me((le()||0)+t.startTime):Z(),i=t?Se(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,c)=>{s[`browser.web_vital.cls.source.${c+1}`]=Se(a.node)}),id({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function cd(){if(!nn()||!le())return;Eo(({metric:n})=>{if(n.value==null||me(n.value)>nd)return;let o=n.entries.find(i=>i.duration===n.value&&Mi[i.name]);o&&Ux(n.value,o)})}function Ux(e,t){Qe&&_.log(`Sending INP span (${e})`);let n=me(le()+t.startTime),r=me(e),o=Mi[t.name],i=yE(t.interactionId),s=ee(),a=s?ne(s):void 0,c=i?.span||a,u=c?gr(c).name:w().getScopeData().transactionName,p=i?.elementName||Se(t.target);id({name:p,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 Dx=1e3,IE,ud,ld;function Zs(e){tt("dom",e),nt("dom",Bx)}function Bx(){if(!F.document)return;let e=He.bind(null,"dom"),t=bE(e,!0);F.document.addEventListener("click",t,!1),F.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=F[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(Ee(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__||{},p=u[s]=u[s]||{refCount:0};if(!p.handler){let l=bE(e);p.handler=l,i.call(this,s,l,c)}p.refCount++}catch{}return i.call(this,s,a,c)}}),Ee(o,"removeEventListener",function(i){return function(s,a,c){if(s==="click"||s=="keypress")try{let u=this.__sentry_instrumentation_handlers__||{},p=u[s];p&&(p.refCount--,p.refCount<=0&&(i.call(this,s,p.handler,c),p.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 Fx(e){if(e.type!==ud)return!1;try{if(!e.target||e.target._sentryId!==ld)return!1}catch{}return!0}function Hx(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function bE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=Gx(n);if(Hx(n.type,r))return;_e(n,"_sentryCaptured",!0),r&&!r._sentryId&&_e(r,"_sentryId",de());let o=n.type==="keypress"?"input":n.type;Fx(n)||(e({event:n,name:o,global:t}),ud=n.type,ld=r?r._sentryId:void 0),clearTimeout(IE),IE=F.setTimeout(()=>{ld=void 0,ud=void 0},Dx)}}function Gx(e){try{return e.target}catch{return null}}var Lu;function sr(e){let t="history";tt(t,e),nt(t,$x)}function $x(){if(F.addEventListener("popstate",()=>{let t=F.location.href,n=Lu;if(Lu=t,n===t)return;He("history",{from:n,to:t})}),!ru())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=Lu,i=Wx(String(r));if(Lu=i,o===i)return t.apply(this,n);He("history",{from:o,to:i})}return t.apply(this,n)}}Ee(F.history,"pushState",e),Ee(F.history,"replaceState",e)}function Wx(e){try{return new URL(e,F.location.origin).toString()}catch{return e}}var Pu={};function Li(e){let t=Pu[e];if(t)return t;let n=F[e];if(Si(n))return Pu[e]=n.bind(F);let r=F.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){Qe&&_.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Pu[e]=n.bind(F))}function pd(e){Pu[e]=void 0}function bo(...e){return Li("setTimeout")(...e)}var St="__sentry_xhr_v3__";function Ao(e){tt("xhr",e),nt("xhr",jx)}function jx(){if(!F.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=Z()*1e3,s=Ve(r[0])?r[0].toUpperCase():void 0,a=zx(r[1]);if(!s||!a)return t.apply(n,r);n[St]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let c=()=>{let u=n[St];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}let p={endTimestamp:Z()*1e3,startTimestamp:i,xhr:n,virtualError:o};He("xhr",p)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,p,l){return c(),u.apply(p,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,p,l){let[d,f]=l,m=p[St];return m&&Ve(d)&&Ve(f)&&(m.request_headers[d.toLowerCase()]=f),u.apply(p,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[St];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:Z()*1e3,xhr:n};return He("xhr",i),t.apply(n,r)}})}function zx(e){if(Ve(e))return e;try{return e.toString()}catch{}}var qx=Symbol.for("sentry__originalRequestBody");function Uu(e){return new URLSearchParams(e).toString()}function vo(e,t=_){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Uu(e)];if(!e)return[void 0]}catch(n){return Qe&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Qe&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Pi(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][qx];return n!==void 0?n:void 0}}function ea(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Qe&&_.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 fd(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var Yx=40;function Ui(e,t=Li("fetch")){let n=0,r=0;async function o(i){let s=i.body.length;n+=s,r++;let a={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 pd("fetch"),c}finally{n-=s,r--}}return Os(e,o,io(e.bufferSize||Yx))}var b=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Vx(){let e=T();if(!e){b&&_.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){b&&_.warn("BrowserProfiling integration is not available");return}e.emit("startUIProfiler")}function Kx(){let e=T();if(!e){b&&_.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){b&&_.warn("ProfilingIntegration is not available");return}e.emit("stopUIProfiler")}var AE={startProfiler:Vx,stopProfiler:Kx};var Jx=10,Xx=20,Qx=30,Zx=40,e0=50;function Di(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 t0=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,n0=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,r0=/\((\S*)(?::(\d+))(?::(\d+))\)/,o0=/at (.+?) ?\(data:(.+?),/,i0=e=>{let t=e.match(o0);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=t0.exec(e);if(n){let[,o,i,s]=n;return Di(o,"?",+i,+s)}let r=n0.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=r0.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=CE(r[1]||"?",r[2]);return Di(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},dd=[Qx,i0],s0=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,a0=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c0=e=>{let t=s0.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=a0.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]=CE(o,r),Di(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},md=[e0,c0],u0=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,l0=e=>{let t=u0.exec(e);return t?Di(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0},vE=[Zx,l0],p0=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,f0=e=>{let t=p0.exec(e);return t?Di(t[2],t[3]||"?",+t[1]):void 0},RE=[Jx,f0],d0=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,m0=e=>{let t=d0.exec(e);return t?Di(t[5],t[3]||t[4]||"?",+t[1],+t[2]):void 0},NE=[Xx,m0],_d=[dd,md],Du=Qi(..._d),CE=(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 xE(e,{metadata:t,tunnel:n,dsn:r}){let o={event_id:e.event_id,sent_at:new Date().toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:je(r)}},i=_0(e);return we(o,[i])}function _0(e){return[{type:"user_report"},e]}var Bu=1024,g0="Breadcrumbs",h0=((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:g0,setup(n){t.console&&co(T0(n)),t.dom&&Zs(E0(n,t.dom)),t.xhr&&Ao(y0(n)),t.fetch&&Un(I0(n)),t.history&&sr(b0(n)),t.sentry&&n.on("beforeSendEvent",S0(n))}}}),Fu=h0;function S0(e){return function(n){T()===e&&pt({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:ln(n)},{event:n})}}function E0(e,t){return function(r){if(T()!==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>Bu&&(b&&_.warn(`\`dom.maxStringLength\` cannot exceed ${Bu}, but a value of ${a} was configured. Sentry will use ${Bu} instead.`),a=Bu),typeof s=="string"&&(s=[s]);try{let u=r.event,p=A0(u)?u.target:u;o=Se(p,{keyAttrs:s,maxStringLength:a}),i=kr(p)}catch{o="<unknown>"}if(o.length===0)return;let c={category:`ui.${r.name}`,message:o};i&&(c.data={"ui.component_name":i}),pt(c,{event:r.event,name:r.name,global:r.global})}}function T0(e){return function(n){if(T()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Zn(n.level),message:dr(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${dr(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;pt(r,{input:n.args,level:n.level})}}function y0(e){return function(n){if(T()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[St];if(!r||!o||!i)return;let{method:s,url:a,status_code:c,body:u}=i,p={method:s,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},d={category:"xhr",data:p,type:"http",level:nu(c)};e.emit("beforeOutgoingRequestBreadcrumb",d,l),pt(d,l)}}function I0(e){return function(n){if(T()!==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),pt(s,i)}else{let i=n.response,s={...n.fetchData,status_code:i?.status},a={input:n.args,response:i,startTimestamp:r,endTimestamp:o},c={category:"fetch",data:s,type:"http",level:nu(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),pt(c,a)}}}function b0(e){return function(n){if(T()!==e)return;let r=n.from,o=n.to,i=Nt(N.location.href),s=r?Nt(r):void 0,a=Nt(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),pt({category:"navigation",data:{from:r,to:o}})}}function A0(e){return!!e&&!!e.target}var v0="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(","),R0="BrowserApiErrors",N0=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:R0,setupOnce(){t.setTimeout&&Ee(N,"setTimeout",kE),t.setInterval&&Ee(N,"setInterval",kE),t.requestAnimationFrame&&Ee(N,"requestAnimationFrame",C0),t.XMLHttpRequest&&"XMLHttpRequest"in N&&Ee(XMLHttpRequest.prototype,"send",x0);let n=t.eventTarget;n&&(Array.isArray(n)?n:v0).forEach(o=>k0(o,t))}}}),Hu=N0;function kE(e){return function(...t){let n=t[0];return t[0]=ho(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${_t(e)}`}}),e.apply(this,t)}}function C0(e){return function(t){return e.apply(this,[ho(t,{mechanism:{data:{handler:_t(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function x0(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Ee(n,o,function(i){let s={mechanism:{data:{handler:_t(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=fr(i);return a&&(s.mechanism.data.handler=_t(a)),ho(i,s)})}),e.apply(this,t)}}function k0(e,t){let r=N[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ee(r,"addEventListener",function(o){return function(i,s,a){try{w0(s)&&(s.handleEvent=ho(s.handleEvent,{mechanism:{data:{handler:_t(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&O0(this,i,s),o.apply(this,[i,ho(s,{mechanism:{data:{handler:_t(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Ee(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 w0(e){return typeof e.handleEvent=="function"}function O0(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var Gu=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof N.document>"u"){b&&_.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}no({ignoreDuration:!0}),Tr();let n=se(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(Tr(),r=i)}),t==="route"&&sr(({from:o,to:i})=>{o!==i&&(no({ignoreDuration:!0}),Tr())})}}};var M0="CultureContext",L0=(()=>({name:M0,preprocessEvent(e){let t=wE();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=wE();t&&Fe(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),$u=L0;function wE(){try{let e=N.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var P0="GlobalHandlers",U0=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:P0,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(D0(n),OE("onerror")),t.onunhandledrejection&&(B0(n),OE("onunhandledrejection"))}}}),Wu=U0;function D0(e){es(t=>{let{stackParser:n,attachStacktrace:r}=ME();if(T()!==e||Df())return;let{msg:o,url:i,line:s,column:a,error:c}=t,u=F0(Ri(n,c||o,void 0,r,!1),i,s,a);u.level="error",qt(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function B0(e){ts(t=>{let{stackParser:n,attachStacktrace:r}=ME();if(T()!==e||Df())return;let o=gd(t),i=Ge(o)?hd(o):Ri(n,o,void 0,r,!0);i.level="error",qt(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function gd(e){if(Ge(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 hd(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function F0(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:H0(t)??dt(),function:"?",in_app:!0}),e}function OE(e){b&&_.log(`Global Handler attached: ${e}`)}function ME(){return T()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function H0(e){if(!(!Ve(e)||e.length===0))return e.startsWith("data:")?`<${ut(e,!1)}>`:e}var ju=()=>({name:"HttpContext",preprocessEvent(e){if(!N.navigator&&!N.location&&!N.document)return;let t=Ai(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!N.navigator&&!N.location&&!N.document)return;let t=Ai();Fe(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}});var G0="cause",$0=5,W0="LinkedErrors",j0=((e={})=>{let t=e.limit||$0,n=e.key||G0;return{name:W0,preprocessEvent(r,o,i){let s=i.getOptions();jp(vi,s.stackParser,n,t,r,o)}}}),zu=j0;var z0=/^HTML(\w*)Element$/;function qu(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(fd(e)){let t=q0(e);if(z0.test(t))return`[HTMLElement: ${Se(e)}]`}}function q0(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function LE(){return Y0()?(b&&Ye(()=>{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 Y0(){if(typeof N.window>"u")return!1;let e=N;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=dt();return!(N===N.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function Sd(e){return[Ds(),Us(),ef(),Hu(),Fu(),Wu(),zu(),Bs(),ju(),$u(),Gu()]}function Yu(e={}){let t=!e.skipBrowserExtensionCheck&&LE(),n=e.defaultIntegrations==null?Sd():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:va(e.stackParser||Du),integrations:vc({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Ui};return xa(qu),Mp(Ni,r)}function PE(){}function UE(e){e()}function DE(e={}){let t=N.document,n=t?.head||t?.body;if(!n){b&&_.error("[showReportDialog] Global document not defined");return}let r=w(),i=T()?.getDsn();if(!i){b&&_.error("[showReportDialog] DSN not configured");return}let s={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||Xo()},a=N.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=Sp(i,s);let{onLoad:c,onClose:u}=s;if(c&&(a.onload=c),u){let p=l=>{if(l.data==="__sentry_reportdialog_closed__")try{u()}finally{N.removeEventListener("message",p)}};N.addEventListener("message",p)}n.appendChild(a)}var V0=R,K0="ReportingObserver",BE=new WeakMap,J0=((e={})=>{let t=e.types||["crash","deprecation","intervention"];function n(r){if(BE.has(T()))for(let o of r)We(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}Ko(`${s}: ${a}`)})}return{name:K0,setupOnce(){if(!ou())return;new V0.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){BE.set(r,!0)}}}),FE=J0;var X0="HttpClient",Q0=((e={})=>{let t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:X0,setup(n){ik(n,t),sk(n,t)}}}),GE=Q0;function Z0(e,t,n,r,o){if($E(e,n.status,n.url)){let i=ak(t,r),s,a,c,u,p=jE();if(p.requestHeaders!==!1&&(s=br(HE(i.headers),p.requestHeaders)),p.responseHeaders!==!1&&(a=br(HE(n.headers),p.responseHeaders)),p.cookies!==!1){let d=i.headers.get("Cookie")||void 0;if(d){let m=Ps(d,p.cookies);typeof m=="object"&&(c=m)}let f=n.headers.get("Set-Cookie")||void 0;if(f){let m=Ps(f,p.cookies);typeof m=="object"&&(u=m)}}let l=WE({url:i.url,method:i.method,status:n.status,requestHeaders:s,responseHeaders:a,requestCookies:c,responseCookies:u,error:o,type:"fetch"});qt(l)}}function ek(e,t,n,r,o){if($E(e,t.status,t.responseURL)){let i,s,a,c=jE();if(c.cookies!==!1)try{let p=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;if(p){let l=Ps(p,c.cookies);typeof l=="object"&&(s=l)}}catch{}if(c.responseHeaders!==!1)try{a=br(nk(t),c.responseHeaders)}catch{}c.requestHeaders!==!1&&(i=br(r,c.requestHeaders));let u=WE({url:t.responseURL,method:n,status:t.status,requestHeaders:i,responseHeaders:a,responseCookies:s,error:o,type:"xhr"});qt(u)}}function tk(e){if(e){let t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function HE(e){let t={};return e.forEach((n,r)=>{t[r]=n}),t}function nk(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 rk(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function ok(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function ik(e,t){Ei()&&Un(n=>{if(T()!==e)return;let{response:r,args:o,error:i,virtualError:s}=n,[a,c]=o;r&&Z0(t,a,r,c,i||s)},!1)}function sk(e,t){"XMLHttpRequest"in R&&Ao(n=>{if(T()!==e)return;let{error:r,virtualError:o}=n,i=n.xhr,s=i[St];if(!s)return;let{method:a,request_headers:c}=s;try{ek(t,i,a,c,r||o)}catch(u){b&&_.warn("Error while extracting response event form XHR response",u)}})}function $E(e,t,n){return ok(e.failedRequestStatusCodes,t)&&rk(e.failedRequestTargets,n)&&!oi(n,T())}function WE(e){let t=T(),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:tk(e.responseHeaders)}}};return Xe(i,{type:`auto.http.client.${e.type}`,handled:!1}),i}function ak(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function jE(){let e=T();if(!e)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};let t=e.getOptions();if(t.dataCollection==null){let o=!!t.sendDefaultPii;return{cookies:o,requestHeaders:o,responseHeaders:o}}let{cookies:n,httpHeaders:r}=e.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}var Ed=R,ck=7,uk="ContextLines",lk=((e={})=>({name:uk,processEvent(t,n,r){let o=e.frameContextLines??r?.getDataCollectionOptions().frameContextLines??ck;return pk(t,o)}})),zE=lk;function pk(e,t){let n=Ed.document,r=Ed.location&&Xn(Ed.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=>fk(u,s,r,t)))}),e}function fk(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||ka(t,e,r),e}var dk="GraphQLClient",mk=(e=>({name:dk,setup(t){_k(t,e),gk(t,e)}}));function _k(e,t){e.on("beforeOutgoingRequestSpan",(n,r)=>{let i=L(n).data||{};if(!(i[q]==="http.client"))return;let c=i[Ya]||i["http.url"]||i.url,u=i[qa]||i["http.method"];if(!Ve(c)||!Ve(u))return;let{endpoints:p}=t,l=$e(c,p),d=YE(r);if(l&&d){let f=VE(d);if(f){let m=qE(f);n.updateName(`${u} ${c} (${m})`),Ku(f)&&n.setAttribute("graphql.document",f.query),Ju(f)&&(n.setAttribute("graphql.persisted_query.hash.sha256",f.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",f.extensions.persistedQuery.version))}}})}function gk(e,t){e.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{let{category:o,type:i,data:s}=n;if(i==="http"&&(o==="fetch"||o==="xhr")){let p=s?.url,{endpoints:l}=t,d=$e(p,l),f=YE(r);if(d&&s&&f){let m=VE(f);if(!s.graphql&&m){let g=qE(m);s["graphql.operation"]=g,Ku(m)&&(s["graphql.document"]=m.query),Ju(m)&&(s["graphql.persisted_query.hash.sha256"]=m.extensions.persistedQuery.sha256Hash,s["graphql.persisted_query.version"]=m.extensions.persistedQuery.version)}}}})}function qE(e){if(Ju(e))return`persisted ${e.operationName}`;if(Ku(e)){let{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=hk(t);return r?`${o} ${r}`:`${o}`}return"unknown"}function YE(e){let t="xhr"in e,n;if(t){let r=e.xhr[St];n=r&&vo(r.body)[0]}else{let r=Pi(e.input);n=vo(r)[0]}return n}function hk(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 Vu(e){return typeof e=="object"&&e!==null}function Ku(e){return Vu(e)&&typeof e.query=="string"}function Ju(e){return Vu(e)&&typeof e.operationName=="string"&&Vu(e.extensions)&&Vu(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash=="string"&&typeof e.extensions.persistedQuery.version=="number"}function VE(e){try{let t=JSON.parse(e);return Ku(t)||Ju(t)?t:void 0}catch{return}}var KE=mk;var JE=(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 p=e.onElement?.({element:a,componentName:c,tagName:u,depth:i})||{};if(p==="skip")continue;if(p==="children"){n(a,o,i+1);continue}let{x:l,y:d,width:f,height:m}=a.getBoundingClientRect(),g={identifier:a.id||void 0,type:c||u,visible:!0,alpha:1,height:m,width:f,x:l,y:d,...p},h=[];g.children=h,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?.()||N.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 ve=R,Kd="sentryReplaySession",Sk="replay_event",Jd="Unable to send Replay",Ek=3e5,Tk=9e5,yk=5e3,Ik=5500,bk=6e4,Ak=5e3,vk=3,XE=15e4,Xu=5e3,Rk=3e3,Nk=300,Xd=2e7,Ck=4999,xk=5e4,QE=36e5,kk=Object.defineProperty,wk=(e,t,n)=>t in e?kk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZE=(e,t,n)=>wk(e,typeof t!="symbol"?t+"":t,n),qe=(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))(qe||{});function Ok(e){return e.nodeType===e.ELEMENT_NODE}function ra(e){return e?.host?.shadowRoot===e}function oa(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Mk(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 Lk(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 nl(e){try{let t=e.rules||e.cssRules;return t?Mk(Array.from(t,bT).join("")):null}catch{return null}}function Pk(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 bT(e){let t;if(Dk(e))try{t=nl(e.styleSheet)||Lk(e)}catch{}else if(Bk(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=Pk(e)),r&&(n=Uk(n)),r||o)return n}return t||e.cssText}function Uk(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Dk(e){return"styleSheet"in e}function Bk(e){return"selectorText"in e}var rl=class{constructor(){ZE(this,"idNodeMap",new Map),ZE(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 Fk(){return new rl}function hl({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 sa({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function zi(e){return e.toLowerCase()}function vd(e){return e.toUpperCase()}var eT="__rrweb_original__";function Hk(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=eT in i?i[eT]: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 Qd(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?zi(t):null}function ol(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function AT(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 tT={};function vT(e){let t=tT[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 tT[e]=r.bind(window)}function Rd(...e){return vT("setTimeout")(...e)}function RT(...e){return vT("clearTimeout")(...e)}function NT(e){try{return e.contentDocument}catch{}}function Gk(e){try{return e.contentWindow}catch{}}var $k=1,Wk=new RegExp("[^a-z0-9-_:]"),aa=-2;function Zd(){return $k++}function jk(e){if(e instanceof HTMLFormElement)return"form";let t=zi(e.tagName);return Wk.test(t)?"div":t}function zk(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Bi,nT,qk=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Yk=/^(?:[a-z+]+:)?\/\//i,Vk=/^www\..*/i,Kk=/^(data:)([^,]*),(.*)/i;function Jk(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 il(e,t){return(e||"").replace(qk,(n,r,o,i,s,a)=>{let c=o||s||a,u=r||i||"";if(!c)return n;if(Yk.test(c)||Vk.test(c))return`url(${u}${c}${u})`;if(Kk.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${zk(t)+c}${u})`;let p=t.split("/"),l=c.split("/");p.pop();for(let d of l)d!=="."&&(d===".."?p.pop():p.push(d));return`url(${u}${p.join("/")}${u})`})}var Xk=/^[^ \t\n\r\u000c]+/,Qk=/^[, \t\n\r\u000c]+/;function Zk(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(Qk),!(n>=t.length);){let i=r(Xk);if(i.slice(-1)===",")i=Gi(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=Gi(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 rT=new WeakMap;function Gi(e,t){return!t||t.trim()===""?t:Sl(e,t)}function ew(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Sl(e,t){let n=rT.get(e);if(n||(n=e.createElement("a"),rT.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function CT(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Gi(e,r);if(n==="xlink:href"&&r[0]!=="#")return Gi(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Gi(e,r);if(n==="srcset")return Zk(e,r);if(n==="style"){let a=il(r,Sl(e));return s&&s.size>0&&(a=Jk(a,s)),a}else if(t==="object"&&n==="data")return Gi(e,r);return typeof i=="function"?i(n,r,o):r}function xT(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function tw(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 nw(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function Ro(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Ro(e.parentNode,t,n,r+1)}function $i(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(nw(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function qi(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=Ro(s,$i(r,o)),c<0)return!0;a=Ro(s,$i(t,n),c>=0?c:1/0)}else{if(a=Ro(s,$i(t,n)),a<0)return!1;c=Ro(s,$i(r,o),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!i}catch{}return!!i}function rw(e,t,n){let r=Gk(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=Rd(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{RT(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return Rd(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function ow(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=Rd(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{RT(i),r=!0,t()})}function iw(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:p,maskTextSelector:l,unmaskTextSelector:d,inlineStylesheet:f,maskInputOptions:m={},maskTextFn:g,maskInputFn:h,dataURLOptions:S={},inlineImages:I,recordCanvas:x,keepIframeSrcFn:v,newlyAddedElement:M=!1,ignoreCSSAttributes:P}=t,E=sw(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:qe.Document,childNodes:[],compatMode:e.compatMode}:{type:qe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:qe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:E};case e.ELEMENT_NODE:return cw(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:f,maskAttributeFn:c,maskInputOptions:m,maskInputFn:h,dataURLOptions:S,inlineImages:I,recordCanvas:x,keepIframeSrcFn:v,newlyAddedElement:M,rootId:E,maskTextClass:u,unmaskTextClass:p,maskTextSelector:l,unmaskTextSelector:d,ignoreCSSAttributes:P});case e.TEXT_NODE:return aw(e,{doc:n,maskAllText:a,maskTextClass:u,unmaskTextClass:p,maskTextSelector:l,unmaskTextSelector:d,maskTextFn:g,maskInputOptions:m,maskInputFn:h,rootId:E});case e.CDATA_SECTION_NODE:return{type:qe.CDATA,textContent:"",rootId:E};case e.COMMENT_NODE:return{type:qe.Comment,textContent:e.textContent||"",rootId:E};default:return!1}}function sw(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function aw(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:p}=t,l=e.parentNode&&e.parentNode.tagName,d=e.textContent,f=l==="STYLE"?!0:void 0,m=l==="SCRIPT"?!0:void 0,g=l==="TEXTAREA"?!0:void 0;if(f&&d){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(d=nl(e.parentNode.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,e)}d=il(d,Sl(t.doc))}m&&(d="SCRIPT_PLACEHOLDER");let h=qi(e,r,i,o,s,n);if(!f&&!m&&!g&&d&&h&&(d=a?a(d,e.parentElement):d.replace(/[\S]/g,"*")),g&&d&&(c.textarea||h)&&(d=u?u(d,e.parentNode):d.replace(/[\S]/g,"*")),l==="OPTION"&&d){let S=hl({type:null,tagName:l,maskInputOptions:c});d=sa({isMasked:qi(e,r,i,o,s,S),element:e,value:d,maskInputFn:u})}return{type:qe.Text,textContent:d||"",isStyle:f,rootId:p}}function cw(e,t){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:s,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:l,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m=!1,rootId:g,maskTextClass:h,unmaskTextClass:S,maskTextSelector:I,unmaskTextSelector:x,ignoreCSSAttributes:v}=t,M=tw(e,r,o,i),P=jk(e),E={},C=e.attributes.length;for(let A=0;A<C;A++){let U=e.attributes[A];U.name&&!xT(P,U.name,U.value)&&(E[U.name]=CT(n,P,zi(U.name),U.value,e,c,v))}if(P==="link"&&s){let A=Array.from(n.styleSheets).find(k=>k.href===e.href),U=null;A&&(U=nl(A)),U&&(E.rel=null,E.href=null,E.crossorigin=null,E._cssText=il(U,A.href))}if(P==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let A=nl(e.sheet);A&&(E._cssText=il(A,Sl(n)))}if(P==="input"||P==="textarea"||P==="select"||P==="option"){let A=e,U=Qd(A),k=ol(A,vd(P),U),D=A.checked;if(U!=="submit"&&U!=="button"&&k){let G=qi(A,h,I,S,x,hl({type:U,tagName:vd(P),maskInputOptions:a}));E.value=sa({isMasked:G,element:A,value:k,maskInputFn:u})}D&&(E.checked=D)}if(P==="option"&&(e.selected&&!a.select?E.selected=!0:delete E.selected),P==="canvas"&&d){if(e.__context==="2d")Hk(e)||(E.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){let A=e.toDataURL(p.type,p.quality),U=n.createElement("canvas");U.width=e.width,U.height=e.height;let k=U.toDataURL(p.type,p.quality);A!==k&&(E.rr_dataURL=A)}}if(P==="img"&&l){Bi||(Bi=n.createElement("canvas"),nT=Bi.getContext("2d"));let A=e,U=A.currentSrc||A.getAttribute("src")||"<unknown-src>",k=A.crossOrigin,D=()=>{A.removeEventListener("load",D);try{Bi.width=A.naturalWidth,Bi.height=A.naturalHeight,nT.drawImage(A,0,0),E.rr_dataURL=Bi.toDataURL(p.type,p.quality)}catch(G){if(A.crossOrigin!=="anonymous"){A.crossOrigin="anonymous",A.complete&&A.naturalWidth!==0?D():A.addEventListener("load",D);return}else console.warn(`Cannot inline img src=${U}! Error: ${G}`)}A.crossOrigin==="anonymous"&&(k?E.crossOrigin=k:A.removeAttribute("crossorigin"))};A.complete&&A.naturalWidth!==0?D():A.addEventListener("load",D)}if((P==="audio"||P==="video")&&(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop)),M){let{width:A,height:U}=e.getBoundingClientRect();E={class:E.class,rr_width:`${A}px`,rr_height:`${U}px`}}P==="iframe"&&!f(E.src)&&(!M&&!NT(e)&&(E.rr_src=E.src),delete E.src);let z;try{customElements.get(P)&&(z=!0)}catch{}return{type:qe.Element,tagName:P,attributes:E,childNodes:[],isSVG:ew(e)||void 0,needBlock:M,rootId:g,isCustom:z}}function Ae(e){return e==null?"":e.toLowerCase()}function uw(e,t){if(t.comment&&e.type===qe.Comment)return!0;if(e.type===qe.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"&&AT(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Ae(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Ae(e.attributes.name)==="application-name"||Ae(e.attributes.rel)==="icon"||Ae(e.attributes.rel)==="apple-touch-icon"||Ae(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Ae(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ae(e.attributes.property).match(/^(og|twitter|fb):/)||Ae(e.attributes.name).match(/^(og|twitter):/)||Ae(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Ae(e.attributes.name)==="robots"||Ae(e.attributes.name)==="googlebot"||Ae(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Ae(e.attributes.name)==="author"||Ae(e.attributes.name)==="generator"||Ae(e.attributes.name)==="framework"||Ae(e.attributes.name)==="publisher"||Ae(e.attributes.name)==="progid"||Ae(e.attributes.property).match(/^article:/)||Ae(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Ae(e.attributes.name)==="google-site-verification"||Ae(e.attributes.name)==="yandex-verification"||Ae(e.attributes.name)==="csrf-token"||Ae(e.attributes.name)==="p:domain_verify"||Ae(e.attributes.name)==="verify-v1"||Ae(e.attributes.name)==="verification"||Ae(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Wi(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:l,skipChild:d=!1,inlineStylesheet:f=!0,maskInputOptions:m={},maskAttributeFn:g,maskTextFn:h,maskInputFn:S,slimDOMOptions:I,dataURLOptions:x={},inlineImages:v=!1,recordCanvas:M=!1,onSerialize:P,onIframeLoad:E,iframeLoadTimeout:C=5e3,onBlockedImageLoad:z,onStylesheetLoad:A,stylesheetLoadTimeout:U=5e3,keepIframeSrcFn:k=()=>!1,newlyAddedElement:D=!1,ignoreCSSAttributes:G}=t,{preserveWhiteSpace:oe=!0}=t,ae=iw(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:c,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:l,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:g,maskTextFn:h,maskInputFn:S,dataURLOptions:x,inlineImages:v,recordCanvas:M,keepIframeSrcFn:k,newlyAddedElement:D,ignoreCSSAttributes:G});if(!ae)return console.warn(e,"not serialized"),null;let W;r.hasNode(e)?W=r.getId(e):uw(ae,I)||!oe&&ae.type===qe.Text&&!ae.isStyle&&!ae.textContent.trim().length?W=aa:W=Zd();let O=Object.assign(ae,{id:W});if(r.add(e,O),W===aa)return null;P&&P(e);let j=!d;if(O.type===qe.Element){j=j&&!O.needBlock;let B=e.shadowRoot;B&&oa(B)&&(O.isShadowHost=!0)}if((O.type===qe.Document||O.type===qe.Element)&&j){I.headWhitespace&&O.type===qe.Element&&O.tagName==="head"&&(oe=!1);let B={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:c,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:l,skipChild:d,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:g,maskTextFn:h,maskInputFn:S,slimDOMOptions:I,dataURLOptions:x,inlineImages:v,recordCanvas:M,preserveWhiteSpace:oe,onSerialize:P,onIframeLoad:E,iframeLoadTimeout:C,onBlockedImageLoad:z,onStylesheetLoad:A,stylesheetLoadTimeout:U,keepIframeSrcFn:k,ignoreCSSAttributes:G},ie=e.childNodes?Array.from(e.childNodes):[];for(let ce of ie){let ge=Wi(ce,B);ge&&O.childNodes.push(ge)}if(Ok(e)&&e.shadowRoot)for(let ce of Array.from(e.shadowRoot.childNodes)){let ge=Wi(ce,B);ge&&(oa(e.shadowRoot)&&(ge.isShadow=!0),O.childNodes.push(ge))}}if(e.parentNode&&ra(e.parentNode)&&oa(e.parentNode)&&(O.isShadow=!0),O.type===qe.Element&&O.tagName==="iframe"&&!O.needBlock&&rw(e,()=>{let B=NT(e);if(B&&E){let ie=Wi(B,{doc:B,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:g,maskTextFn:h,maskInputFn:S,slimDOMOptions:I,dataURLOptions:x,inlineImages:v,recordCanvas:M,preserveWhiteSpace:oe,onSerialize:P,onIframeLoad:E,iframeLoadTimeout:C,onStylesheetLoad:A,stylesheetLoadTimeout:U,keepIframeSrcFn:k,ignoreCSSAttributes:G});ie&&E(e,ie)}},C),O.type===qe.Element&&O.tagName==="img"&&!e.complete&&O.needBlock){let B=e,ie=()=>{if(B.isConnected&&!B.complete&&z)try{let ce=B.getBoundingClientRect();ce.width>0&&ce.height>0&&z(B,O,ce)}catch{}B.removeEventListener("load",ie)};B.isConnected&&B.addEventListener("load",ie)}return O.type===qe.Element&&O.tagName==="link"&&typeof O.attributes.rel=="string"&&(O.attributes.rel==="stylesheet"||O.attributes.rel==="preload"&&typeof O.attributes.href=="string"&&AT(O.attributes.href)==="css")&&ow(e,()=>{if(A){let B=Wi(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:g,maskTextFn:h,maskInputFn:S,slimDOMOptions:I,dataURLOptions:x,inlineImages:v,recordCanvas:M,preserveWhiteSpace:oe,onSerialize:P,onIframeLoad:E,iframeLoadTimeout:C,onStylesheetLoad:A,stylesheetLoadTimeout:U,keepIframeSrcFn:k,ignoreCSSAttributes:G});B&&A(e,B)}},U),O.type===qe.Element&&delete O.needBlock,O}function lw(e,t){let{mirror:n=new rl,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:i=null,maskAllText:s=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:p=null,inlineStylesheet:l=!0,inlineImages:d=!1,recordCanvas:f=!1,maskAllInputs:m=!1,maskAttributeFn:g,maskTextFn:h,maskInputFn:S,slimDOM:I=!1,dataURLOptions:x,preserveWhiteSpace:v,onSerialize:M,onIframeLoad:P,iframeLoadTimeout:E,onBlockedImageLoad:C,onStylesheetLoad:z,stylesheetLoadTimeout:A,keepIframeSrcFn:U=()=>!1,ignoreCSSAttributes:k=new Set([])}=t||{};return Wi(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:s,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:p,skipChild:!1,inlineStylesheet:l,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:g,maskTextFn:h,maskInputFn:S,slimDOMOptions:I===!0||I==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:I==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:I===!1?{}:I,dataURLOptions:x,inlineImages:d,recordCanvas:f,preserveWhiteSpace:v,onSerialize:M,onIframeLoad:P,iframeLoadTimeout:E,onBlockedImageLoad:C,onStylesheetLoad:z,stylesheetLoadTimeout:A,keepIframeSrcFn:U,newlyAddedElement:!1,ignoreCSSAttributes:k})}function Tt(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Fi=`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.`,oT={map:{},getId(){return console.error(Fi),-1},getNode(){return console.error(Fi),null},removeNodeFromMap(){console.error(Fi)},has(){return console.error(Fi),!1},reset(){console.error(Fi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(oT=new Proxy(oT,{get(e,t,n){return t==="map"&&console.error(Fi),Reflect.get(e,t,n)}}));function ca(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&&(gw(r),r=null),o=s,e.apply(c,i)):!r&&n.trailing!==!1&&(r=El(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},a))}}function kT(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){El(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>kT(e,t,i||{},!0)}function em(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 sl=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(sl=()=>new Date().getTime());function wT(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 OT(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function MT(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function LT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function $t(e,t,n,r,o){if(!e)return!1;let i=LT(e);if(!i)return!1;let s=$i(t,n);if(!o){let u=r&&i.matches(r);return s(i)&&!u}let a=Ro(i,s),c=-1;return a<0?!1:(r&&(c=Ro(i,$i(null,r))),a>-1&&c<0?!0:a<c)}function pw(e,t){return t.getId(e)!==-1}function Td(e,t){return t.getId(e)===aa}function PT(e,t){if(ra(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?PT(e.parentNode,t):!0:!0}function Nd(e){return!!e.changedTouches}function fw(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 UT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function DT(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Cd(e){return!!e?.shadowRoot}var xd=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 BT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function dw(e){let t=e,n;for(;n=BT(t);)t=n;return t}function mw(e){let t=e.ownerDocument;if(!t)return!1;let n=dw(e);return t.contains(n)}function FT(e){let t=e.ownerDocument;return t?t.contains(e)||mw(e):!1}var iT={};function tm(e){let t=iT[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 iT[e]=r.bind(window)}function _w(...e){return tm("requestAnimationFrame")(...e)}function El(...e){return tm("setTimeout")(...e)}function gw(...e){return tm("clearTimeout")(...e)}var te=(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))(te||{}),K=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(K||{}),Et=(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))(Et||{}),ar=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ar||{}),Hi=(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))(Hi||{}),ia;function hw(e){ia=e}function Sw(){ia=void 0}var ue=e=>ia?((...n)=>{try{return e(...n)}catch(r){if(ia&&ia(r)===!0)return()=>{};throw r}}):e,sT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ew=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(ta=0;ta<sT.length;ta++)Ew[sT.charCodeAt(ta)]=ta;var ta,al=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function nm(e){try{return e.contentDocument}catch{}}function ua(e){try{return e.contentWindow}catch{}}var kd=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 aT(e){return"__ln"in e}var wd=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&&aT(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&&aT(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--)}},cT=(e,t)=>`${e}@${t}`,Od=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 wd,o=c=>{let u=c,p=aa;for(;p===aa;)u=u&&u.nextSibling,p=u&&this.mirror.getId(u);return p},i=c=>{if(!c.parentNode||!FT(c))return;let u=ra(c.parentNode)?this.mirror.getId(BT(c)):this.mirror.getId(c.parentNode),p=o(c);if(u===-1||p===-1)return r.addNode(c);let l=Wi(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:d=>{UT(d,this.mirror)&&!$t(d,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(d),DT(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),Cd(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(d,f)=>{if($t(d,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(d,f);let m=ua(d);m&&this.canvasManager.addWindow(m),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,f)=>{this.stylesheetManager.attachLinkElement(d,f)},onBlockedImageLoad:(d,f,{width:m,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:f.id,attributes:{style:{width:`${m}px`,height:`${g}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:p,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let c of this.movedSet)uT(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||i(c);for(let c of this.addedSet)!lT(this.droppedSet,c)&&!uT(this.removes,c,this.mirror)||lT(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),p=o(s.value);u!==-1&&p!==-1&&(c=s)}if(!c){let u=r.tail;for(;u;){let p=u;if(u=u.previous,p){let l=this.mirror.getId(p.value.parentNode);if(o(p.value)===-1)continue;if(l!==-1){c=p;break}else{let f=p.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=f.parentNode.host;if(this.mirror.getId(m)!==-1){c=p;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 p=JSON.stringify(c.styleDiff),l=JSON.stringify(c._unchangedStyles);p.length<u.style.length&&(p+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(!Td(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!$t(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:qi(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,LT(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=Qd(n),a=n.tagName;o=ol(n,a,s);let c=hl({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),u=qi(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);o=sa({isMasked:u,element:n,value:o,maskInputFn:this.maskInputFn})}if($t(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(!nm(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"),!xT(n.tagName,r)&&(i.attributes[r]=CT(this.doc,zi(n.tagName),zi(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($t(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=ra(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);$t(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Td(n,this.mirror)||!pw(n,this.mirror)||(this.addedSet.has(n)?(Md(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||PT(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[cT(r,o)]?Md(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ra(t.target)&&oa(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(Td(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[cT(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);$t(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Cd(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 kd(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 Md(e,t){e.delete(t),t.childNodes?.forEach(n=>Md(e,n))}function uT(e,t,n){return e.length===0?!1:Tw(e,t,n)}function Tw(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 lT(e,t){return e.size===0?!1:HT(e,t)}function HT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:HT(e,n):!1}var ji=[];function ma(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 GT(e,t){let n=new Od;ji.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(ue(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 yw({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=ca(ue(l=>{let d=Date.now()-a;e(s.map(f=>(f.timeOffset-=d,f)),l),s=[],a=null}),i),u=ue(ca(ue(l=>{let d=ma(l),{clientX:f,clientY:m}=Nd(l)?l.changedTouches[0]:l;a||(a=sl()),s.push({x:f,y:m,id:r.getId(d),timeOffset:sl()-a}),c(typeof DragEvent<"u"&&l instanceof DragEvent?K.Drag:l instanceof MouseEvent?K.MouseMove:K.TouchMove)}),o,{trailing:!1})),p=[Tt("mousemove",u,n),Tt("touchmove",u,n),Tt("drag",u,n)];return ue(()=>{p.forEach(l=>l())})}function Iw({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,p=l=>d=>{let f=ma(d);if($t(f,r,o,i,!0))return;let m=null,g=l;if("pointerType"in d){switch(d.pointerType){case"mouse":m=ar.Mouse;break;case"touch":m=ar.Touch;break;case"pen":m=ar.Pen;break}m===ar.Touch?Et[l]===Et.MouseDown?g="TouchStart":Et[l]===Et.MouseUp&&(g="TouchEnd"):ar.Pen}else Nd(d)&&(m=ar.Touch);m!==null?(u=m,(g.startsWith("Touch")&&m===ar.Touch||g.startsWith("Mouse")&&m===ar.Mouse)&&(m=null)):Et[l]===Et.Click&&(m=u,u=null);let h=Nd(d)?d.changedTouches[0]:d;if(!h)return;let S=n.getId(f),{clientX:I,clientY:x}=h;ue(e)({type:Et[g],id:S,x:I,y:x,...m!==null&&{pointerType:m}})};return Object.keys(Et).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let d=zi(l),f=p(l);if(window.PointerEvent)switch(Et[l]){case Et.MouseDown:case Et.MouseUp:d=d.replace("mouse","pointer");break;case Et.TouchStart:case Et.TouchEnd:return}c.push(Tt(d,f,t))}),ue(()=>{c.forEach(l=>l())})}function $T({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=ue(ca(ue(c=>{let u=ma(c);if(!u||$t(u,r,o,i,!0))return;let p=n.getId(u);if(u===t&&t.defaultView){let l=wT(t.defaultView);e({id:p,x:l.left,y:l.top})}else e({id:p,x:u.scrollLeft,y:u.scrollTop})}),s.scroll||100));return Tt("scroll",a,t)}function bw({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=ue(ca(ue(()=>{let i=OT(),s=MT();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return Tt("resize",o,t)}var Aw=["INPUT","TEXTAREA","SELECT"],pT=new WeakMap;function vw({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:p,userTriggeredOnInput:l,maskTextClass:d,unmaskTextClass:f,maskTextSelector:m,unmaskTextSelector:g}){function h(E){let C=ma(E),z=E.isTrusted,A=C&&vd(C.tagName);if(A==="OPTION"&&(C=C.parentElement),!C||!A||Aw.indexOf(A)<0||$t(C,r,o,i,!0))return;let U=C;if(U.classList.contains(s)||a&&U.matches(a))return;let k=Qd(C),D=ol(U,A,k),G=!1,oe=hl({maskInputOptions:c,tagName:A,type:k}),ae=qi(C,d,m,f,g,oe);(k==="radio"||k==="checkbox")&&(G=C.checked),D=sa({isMasked:ae,element:C,value:D,maskInputFn:u}),S(C,l?{text:D,isChecked:G,userTriggered:z}:{text:D,isChecked:G});let W=C.name;k==="radio"&&W&&G&&t.querySelectorAll(`input[type="radio"][name="${W}"]`).forEach(O=>{if(O!==C){let j=sa({isMasked:ae,element:O,value:ol(O,A,k),maskInputFn:u});S(O,l?{text:j,isChecked:!G,userTriggered:!1}:{text:j,isChecked:!G})}})}function S(E,C){let z=pT.get(E);if(!z||z.text!==C.text||z.isChecked!==C.isChecked){pT.set(E,C);let A=n.getId(E);ue(e)({...C,id:A})}}let x=(p.input==="last"?["change"]:["input","change"]).map(E=>Tt(E,ue(h),t)),v=t.defaultView;if(!v)return()=>{x.forEach(E=>E())};let M=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),P=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return M&&M.set&&x.push(...P.map(E=>kT(E[0],E[1],{set(){ue(h)({target:this,isTrusted:!1})}},!1,v))),ue(()=>{x.forEach(E=>E())})}function cl(e){let t=[];function n(r,o){if(Qu("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Qu("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Qu("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Qu("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 Lr(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Rw({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:ue((p,l,d)=>{let[f,m]=d,{id:g,styleId:h}=Lr(l,t,n.styleMirror);return(g&&g!==-1||h&&h!==-1)&&e({id:g,styleId:h,adds:[{rule:f,index:m}]}),p.apply(l,d)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ue((p,l,d)=>{let[f]=d,{id:m,styleId:g}=Lr(l,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,removes:[{index:f}]}),p.apply(l,d)})});let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:ue((p,l,d)=>{let[f]=d,{id:m,styleId:g}=Lr(l,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,replace:f}),p.apply(l,d)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:ue((p,l,d)=>{let[f]=d,{id:m,styleId:g}=Lr(l,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,replaceSync:f}),p.apply(l,d)})}));let c={};Zu("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Zu("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Zu("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Zu("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(c).forEach(([p,l])=>{u[p]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[p].insertRule,{apply:ue((d,f,m)=>{let[g,h]=m,{id:S,styleId:I}=Lr(f.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||I&&I!==-1)&&e({id:S,styleId:I,adds:[{rule:g,index:[...cl(f),h||0]}]}),d.apply(f,m)})}),l.prototype.deleteRule=new Proxy(u[p].deleteRule,{apply:ue((d,f,m)=>{let[g]=m,{id:h,styleId:S}=Lr(f.parentStyleSheet,t,n.styleMirror);return(h&&h!==-1||S&&S!==-1)&&e({id:h,styleId:S,removes:[{index:[...cl(f),g]}]}),d.apply(f,m)})})}),ue(()=>{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(([p,l])=>{l.prototype.insertRule=u[p].insertRule,l.prototype.deleteRule=u[p].deleteRule})})}function WT({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}}),ue(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Nw({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:ue((a,c,u)=>{let[p,l,d]=u;if(n.has(p))return i.apply(c,[p,l,d]);let{id:f,styleId:m}=Lr(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,set:{property:p,value:l,priority:d},index:cl(c.parentRule)}),a.apply(c,u)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:ue((a,c,u)=>{let[p]=u;if(n.has(p))return s.apply(c,[p]);let{id:l,styleId:d}=Lr(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||d&&d!==-1)&&e({id:l,styleId:d,remove:{property:p},index:cl(c.parentRule)}),a.apply(c,u)})}),ue(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function Cw({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:s}){let a=ue(u=>ca(ue(p=>{let l=ma(p);if(!l||$t(l,t,n,r,!0))return;let{currentTime:d,volume:f,muted:m,playbackRate:g}=l;e({type:u,id:o.getId(l),currentTime:d,volume:f,muted:m,playbackRate:g})}),i.media||500)),c=[Tt("play",a(Hi.Play),s),Tt("pause",a(Hi.Pause),s),Tt("seeked",a(Hi.Seeked),s),Tt("volumechange",a(Hi.VolumeChange),s),Tt("ratechange",a(Hi.RateChange),s)];return ue(()=>{c.forEach(u=>u())})}function xw({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(c,u,p){let l=new i(c,u,p);return o.set(l,{family:c,buffer:typeof u!="string",descriptors:p,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};let s=em(t.fonts,"add",function(a){return function(c){return El(ue(()=>{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),ue(()=>{r.forEach(a=>a())})}function kw(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,c=ue(()=>{let u=t.getSelection();if(!u||a&&u?.isCollapsed)return;a=u.isCollapsed||!1;let p=[],l=u.rangeCount||0;for(let d=0;d<l;d++){let f=u.getRangeAt(d),{startContainer:m,startOffset:g,endContainer:h,endOffset:S}=f;$t(m,r,o,i,!0)||$t(h,r,o,i,!0)||p.push({start:n.getId(m),startOffset:g,end:n.getId(h),endOffset:S})}s({ranges:p})});return c(),Tt("selectionchange",c)}function ww({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:em(n.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{}return o.apply(this,[i,s,a])}})}function Ow(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=GT(e,e.doc));let o=yw(e),i=Iw(e),s=$T(e),a=bw(e,{win:n}),c=vw(e),u=Cw(e),p=()=>{},l=()=>{},d=()=>{},f=()=>{};e.recordDOM&&(p=Rw(e,{win:n}),l=WT(e,e.doc),d=Nw(e,{win:n}),e.collectFonts&&(f=xw(e)));let m=kw(e),g=ww(e),h=[];for(let S of e.plugins)h.push(S.observer(S.callback,n,S.options));return ue(()=>{ji.forEach(S=>S.reset()),r?.disconnect(),o(),i(),s(),a(),c(),u(),p(),l(),d(),f(),m(),g(),h.forEach(S=>S())})}function Qu(e){return typeof window[e]<"u"}function Zu(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var la=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}},Ld=class{constructor(){this.crossOriginIframeMirror=new la(Zd),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Pd=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new la(Zd),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new la(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=ua(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&&ua(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=nm(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 te.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:te.IncrementalSnapshot,data:{source:K.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case te.Meta:case te.Load:case te.DomContentLoaded:return!1;case te.Plugin:return n;case te.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case te.IncrementalSnapshot:switch(n.data.source){case K.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 K.Drag:case K.TouchMove:case K.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case K.ViewportResize:return!1;case K.MediaInteraction:case K.MouseInteraction:case K.Scroll:case K.CanvasMutation:case K.Input:return this.replaceIds(n.data,t,["id"]),n;case K.StyleSheetRule:case K.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case K.Font:return n;case K.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case K.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!==qe.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},Ud=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Dd=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(!oa(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=GT({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push($T({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),El(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(WT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=nm(t),r=ua(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(em(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&FT(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()}},Bd=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new xd,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:bT(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){}},Fd=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,_w(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},De,ul;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 En=Fk();function Tn(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:p="rr-mask",unmaskTextClass:l=null,maskTextSelector:d=null,unmaskTextSelector:f=null,inlineStylesheet:m=!0,maskAllInputs:g,maskInputOptions:h,slimDOMOptions:S,maskAttributeFn:I,maskInputFn:x,maskTextFn:v,maxCanvasSize:M=null,packFn:P,sampling:E={},dataURLOptions:C={},mousemoveWait:z,recordDOM:A=!0,recordCanvas:U=!1,recordCrossOriginIframes:k=!1,recordAfter:D=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:G=!1,collectFonts:oe=!1,inlineImages:ae=!1,plugins:W,keepIframeSrcFn:O=()=>!1,ignoreCSSAttributes:j=new Set([]),errorHandler:B,onMutation:ie,getCanvasManager:ce}=e;hw(B);let ge=k?window.parent===window:!0,ke=!1;if(!ge)try{window.parent.document&&(ke=!1)}catch{ke=!0}if(ge&&!t)throw new Error("emit function is required");if(!ge&&!ke)return()=>{};z!==void 0&&E.mousemove===void 0&&(E.mousemove=z),En.reset();let on=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}:h!==void 0?h:{},sn=S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:S==="all",headMetaDescKeywords:S==="all"}:S||{};fw();let cr,Dr=0,ya=H=>{for(let pe of W||[])pe.eventProcessor&&(H=pe.eventProcessor(H));return P&&!ke&&(H=P(H)),H};De=(H,pe)=>{let Q=H;if(Q.timestamp=sl(),ji[0]?.isFrozen()&&Q.type!==te.FullSnapshot&&!(Q.type===te.IncrementalSnapshot&&Q.data.source===K.Mutation)&&ji.forEach(fe=>fe.unfreeze()),ge)t?.(ya(Q),pe);else if(ke){let fe={type:"rrweb",event:ya(Q),origin:window.location.origin,isCheckout:pe};window.parent.postMessage(fe,"*")}if(Q.type===te.FullSnapshot)cr=Q,Dr=0;else if(Q.type===te.IncrementalSnapshot){if(Q.data.source===K.Mutation&&Q.data.isAttachIframe)return;Dr++;let fe=r&&Dr>=r,X=n&&cr&&Q.timestamp-cr.timestamp>n;(fe||X)&&Hr(!0)}};let Br=H=>{De({type:te.IncrementalSnapshot,data:{source:K.Mutation,...H}})},Ia=H=>De({type:te.IncrementalSnapshot,data:{source:K.Scroll,...H}}),Gn=H=>De({type:te.IncrementalSnapshot,data:{source:K.CanvasMutation,...H}}),Wt=H=>De({type:te.IncrementalSnapshot,data:{source:K.AdoptedStyleSheet,...H}}),yt=new Bd({mutationCb:Br,adoptedStyleSheetCb:Wt}),Pt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Ld:new Pd({mirror:En,mutationCb:Br,stylesheetManager:yt,recordCrossOriginIframes:k,wrappedEmit:De});for(let H of W||[])H.getMirror&&H.getMirror({nodeMirror:En,crossOriginIframeMirror:Pt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Pt.crossOriginIframeStyleMirror});let wo=new Fd,Oo=Lw(ce,{mirror:En,win:window,mutationCb:H=>De({type:te.IncrementalSnapshot,data:{source:K.CanvasMutation,...H}}),recordCanvas:U,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:M,sampling:E.canvas,dataURLOptions:C,errorHandler:B}),Fr=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Ud:new Dd({mutationCb:Br,scrollCb:Ia,bypassOptions:{onMutation:ie,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:u,maskTextClass:p,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:m,maskInputOptions:on,dataURLOptions:C,maskAttributeFn:I,maskTextFn:v,maskInputFn:x,recordCanvas:U,inlineImages:ae,sampling:E,slimDOMOptions:sn,iframeManager:Pt,stylesheetManager:yt,canvasManager:Oo,keepIframeSrcFn:O,processedNodeManager:wo,ignoreCSSAttributes:j},mirror:En}),Hr=(H=!1)=>{if(!A)return;De({type:te.Meta,data:{href:window.location.href,width:MT(),height:OT()}},H),yt.reset(),Fr.init(),ji.forEach(Q=>Q.lock());let pe=lw(document,{mirror:En,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:u,maskTextClass:p,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:m,maskAllInputs:on,maskAttributeFn:I,maskInputFn:x,maskTextFn:v,slimDOM:sn,dataURLOptions:C,recordCanvas:U,inlineImages:ae,onSerialize:Q=>{UT(Q,En)&&Pt.addIframe(Q),DT(Q,En)&&yt.trackLinkElement(Q),Cd(Q)&&Fr.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,fe)=>{Pt.attachIframe(Q,fe);let X=ua(Q);X&&Oo.addWindow(X),Fr.observeAttachShadow(Q)},onStylesheetLoad:(Q,fe)=>{yt.attachLinkElement(Q,fe)},onBlockedImageLoad:(Q,fe,{width:X,height:yn})=>{Br({adds:[],removes:[],texts:[],attributes:[{id:fe.id,attributes:{style:{width:`${X}px`,height:`${yn}px`}}}]})},keepIframeSrcFn:O,ignoreCSSAttributes:j});if(!pe)return console.warn("Failed to snapshot the document");De({type:te.FullSnapshot,data:{node:pe,initialOffset:wT(window)}}),ji.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&yt.adoptStyleSheets(document.adoptedStyleSheets,En.getId(document))};ul=Hr;try{let H=[],pe=fe=>ue(Ow)({onMutation:ie,mutationCb:Br,mousemoveCb:(X,yn)=>De({type:te.IncrementalSnapshot,data:{source:yn,positions:X}}),mouseInteractionCb:X=>De({type:te.IncrementalSnapshot,data:{source:K.MouseInteraction,...X}}),scrollCb:Ia,viewportResizeCb:X=>De({type:te.IncrementalSnapshot,data:{source:K.ViewportResize,...X}}),inputCb:X=>De({type:te.IncrementalSnapshot,data:{source:K.Input,...X}}),mediaInteractionCb:X=>De({type:te.IncrementalSnapshot,data:{source:K.MediaInteraction,...X}}),styleSheetRuleCb:X=>De({type:te.IncrementalSnapshot,data:{source:K.StyleSheetRule,...X}}),styleDeclarationCb:X=>De({type:te.IncrementalSnapshot,data:{source:K.StyleDeclaration,...X}}),canvasMutationCb:Gn,fontCb:X=>De({type:te.IncrementalSnapshot,data:{source:K.Font,...X}}),selectionCb:X=>{De({type:te.IncrementalSnapshot,data:{source:K.Selection,...X}})},customElementCb:X=>{De({type:te.IncrementalSnapshot,data:{source:K.CustomElement,...X}})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:p,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,maskInputOptions:on,inlineStylesheet:m,sampling:E,recordDOM:A,recordCanvas:U,inlineImages:ae,userTriggeredOnInput:G,collectFonts:oe,doc:fe,maskAttributeFn:I,maskInputFn:x,maskTextFn:v,keepIframeSrcFn:O,blockSelector:i,unblockSelector:s,slimDOMOptions:sn,dataURLOptions:C,mirror:En,iframeManager:Pt,stylesheetManager:yt,shadowDomManager:Fr,processedNodeManager:wo,canvasManager:Oo,ignoreCSSAttributes:j,plugins:W?.filter(X=>X.observer)?.map(X=>({observer:X.observer,options:X.options,callback:yn=>De({type:te.Plugin,data:{plugin:X.name,payload:yn}})}))||[]},{});Pt.addLoadListener(fe=>{try{H.push(pe(fe.contentDocument))}catch(X){console.warn(X)}});let Q=()=>{Hr(),H.push(pe(document))};return document.readyState==="interactive"||document.readyState==="complete"?Q():(H.push(Tt("DOMContentLoaded",()=>{De({type:te.DomContentLoaded,data:{}}),D==="DOMContentLoaded"&&Q()})),H.push(Tt("load",()=>{De({type:te.Load,data:{}}),D==="load"&&Q()},window))),()=>{H.forEach(fe=>fe()),wo.destroy(),ul=void 0,Sw()}}catch(H){console.warn(H)}}function Mw(e){if(!ul)throw new Error("please take full snapshot after start recording");ul(e)}Tn.mirror=En;Tn.takeFullSnapshot=Mw;function Lw(e,t){try{return e?e(t):new al}catch{return console.warn("Unable to initialize CanvasManager"),new al}}var fT;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(fT||(fT={}));var Pw=3,Uw=5;function rm(e){return e>9999999999?e:e*1e3}function yd(e){return e>9999999999?e/1e3:e}function _a(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:te.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Re(t,10,1e3)}}),t.category==="console")))}var Dw="button,a";function jT(e){return e.closest(Dw)||e}function zT(e){let t=qT(e);return!t||!(t instanceof Element)?t:jT(t)}function qT(e){return Bw(e)?e.target:e}function Bw(e){return typeof e=="object"&&!!e&&"target"in e}var Pr;function Fw(e){return Pr||(Pr=[],Hw()),Pr.push(e),()=>{let t=Pr?Pr.indexOf(e):-1;t>-1&&Pr.splice(t,1)}}function Hw(){Ee(ve,"open",function(e){return function(...t){if(Pr)try{Pr.forEach(n=>n())}catch{}return e.apply(ve,t)}})}var Gw=new Set([K.Mutation,K.StyleSheetRule,K.StyleDeclaration,K.AdoptedStyleSheet,K.CanvasMutation,K.Selection,K.MediaInteraction]);function $w(e,t,n){e.handleClick(t,n)}var Hd=class{constructor(t,n,r=_a){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=Fw(()=>{this._lastMutation=dT()});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(jw(n,this._ignoreSelector)||!zw(t))return;let r={timestamp:yd(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=yd(t)}registerScroll(t=Date.now()){this._lastScroll=yd(t)}registerClick(t){let n=jT(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=dT();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",p={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:ve.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:s||1}};this._addBreadcrumbEvent(n,p);return}if(s>1){let c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:ve.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=bo(()=>this._checkClicks(),1e3)}},Ww=["A","BUTTON","INPUT"];function jw(e,t){return!!(!Ww.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 zw(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function dT(){return Date.now()/1e3}function qw(e,t){try{if(!Yw(t))return;let{source:n}=t.data;if(Gw.has(n)&&e.registerMutation(t.timestamp),n===K.Scroll&&e.registerScroll(t.timestamp),Vw(t)){let{type:r,id:o}=t.data,i=Tn.mirror.getNode(o);i instanceof HTMLElement&&r===Et.Click&&e.registerClick(i)}}catch{}}function Yw(e){return e.type===Pw}function Vw(e){return e.data.source===K.MouseInteraction}function Hn(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Tl=(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))(Tl||{}),Kw=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Jw(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(Kw.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var Xw=e=>t=>{if(!e.isEnabled())return;let n=Qw(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&&$w(e.clickDetector,n,zT(t.event)),_a(e,n)};function YT(e,t){let n=Tn.mirror.getId(e),r=n&&Tn.mirror.getNode(n),o=r&&Tn.mirror.getMeta(r),i=o&&eO(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===Tl.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:Jw(i.attributes)}}:{}}}function Qw(e){let{target:t,message:n}=Zw(e);return Hn({category:`ui.${e.name}`,...YT(t,n)})}function Zw(e){let t=e.name==="click",n,r=null;try{r=t?zT(e.event):qT(e.event),n=Se(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function eO(e){return e.type===Tl.Element}function tO(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=nO(t);n&&_a(e,n)}function nO(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||rO(s)||!i)return null;let a=t||r||o,c=i.length===1;if(!a&&c)return null;let u=Se(s,{maxStringLength:200})||"<unknown>",p=YT(s,u);return Hn({category:"ui.keyDown",message:u,data:{...p.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function rO(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var oO={resource:uO,paint:aO,navigation:cO};function Id(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function iO(e){return e.map(sO).filter(Boolean)}function sO(e){let t=oO[e.entryType];return t?t(e):null}function Yi(e){return((le()||ve.performance.timeOrigin)+e)/1e3}function aO(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=Yi(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function cO(e){let{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:p,loadEventEnd:l,redirectCount:d,startTime:f,transferSize:m,type:g}=e;return o===0?null:{type:`${t}.${g}`,start:Yi(f),end:Yi(i),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:s,duration:o,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:p,loadEventEnd:l,domComplete:i,redirectCount:d}}}function uO(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:Yi(i),end:Yi(o),name:r,data:{size:u,statusCode:c,decodedBodySize:s,encodedBodySize:a}}}function lO(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return om(e,"largest-contentful-paint",n)}function pO(e){return e.sources!==void 0}function fO(e){let t=[],n=[];for(let r of e.entries)if(pO(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=Tn.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return om(e,"cumulative-layout-shift",n,t)}function dO(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return om(e,"interaction-to-next-paint",n)}function om(e,t,n,r){let o=e.value,i=e.rating,s=Yi(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>Tn.mirror.getId(a)):void 0,attributions:r}}}function mO(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(Ot(o,n))}),r.push(or(Id(lO,e)),rr(Id(fO,e)),Eo(Id(dO,e))),()=>{r.forEach(o=>o())}}var Y=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_O='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 gO(){let e=new Blob([_O]);return URL.createObjectURL(e)}var mT=["log","warn","error"],tl="[Replay] ";function bd(e,t="info"){pt({category:"console",data:{logger:"replay"},level:t,message:`${tl}${e}`},{level:t})}function hO(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return Y?(mT.forEach(r=>{n[r]=(...o)=>{_[r](tl,...o),t&&bd(o.join(""),Zn(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),_.error(tl,r),e?J(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&bd(r,"error")},n.infoTick=(...r)=>{_.log(tl,...r),t&&setTimeout(()=>bd(r[0]),0)}):mT.forEach(r=>{n[r]=()=>{}}),n}var V=hO(),pa=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Xd}.`)}},ll=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>Xd)throw new pa;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:rm(t)}},Gd=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){Y&&V.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():(Y&&V.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{Y&&V.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(){Y&&V.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++}},$d=class{constructor(t){this._worker=new Gd(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=rm(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Xd?Promise.reject(new pa):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{Y&&V.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}},Wd=class{constructor(t){this._fallback=new ll,this._compression=new $d(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){Y&&V.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){Y&&V.exception(i,"Failed to add events when switching buffers.")}}};function SO({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=EO(t);if(n)return n}return Y&&V.log("Using simple buffer"),new ll}function EO(e){try{let t=e||TO();if(!t)return;Y&&V.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new Wd(n)}catch(t){Y&&V.exception(t,"Failed to create compression worker")}}function TO(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?gO():""}function im(){try{return"sessionStorage"in ve&&!!ve.sessionStorage}catch{return!1}}function yO(e){IO(),e.session=void 0}function IO(){if(im())try{ve.sessionStorage.removeItem(Kd)}catch{}}function VT(e){return e===void 0?!1:Math.random()<e}function yl(e){if(im())try{ve.sessionStorage.setItem(Kd,JSON.stringify(e))}catch{}}function KT(e){let t=Date.now(),n=e.id||de(),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 bO(e,t){return VT(e)?"session":t?"buffer":!1}function _T({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=bO(e,t),i=KT({sampled:o,previousSessionId:r});return n&&yl(i),i}function AO(){if(!im())return null;try{let e=ve.sessionStorage.getItem(Kd);if(!e)return null;let t=JSON.parse(e);return Y&&V.infoTick("Loading existing session"),KT(t)}catch{return null}}function jd(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function vO(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return jd(e.started,t,r)||jd(e.lastActivity,n,r)}function pl(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!vO(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Ad({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&AO();return o?pl(o,{sessionIdleExpire:e,maxReplayDuration:t})?(Y&&V.infoTick("Session in sessionStorage is expired, creating new one..."),_T(r,{previousSessionId:o.id})):o:(Y&&V.infoTick("Creating new session"),_T(r,{previousSessionId:n}))}function RO(e){return e.type===te.Custom}function sm(e,t,n){return XT(e,t)?(JT(e,t,n),!0):!1}function NO(e,t,n){return XT(e,t)?JT(e,t,n):Promise.resolve(null)}async function JT(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=CO(t,i.beforeAddRecordingEvent);return s?await r.addEvent(s):void 0}catch(i){let s=i&&i instanceof pa,a=s?"eventBufferOverflow":"eventBufferError",c=T();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 XT(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=rm(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Y&&V.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function CO(e,t){try{if(typeof t=="function"&&RO(e))return t(e)}catch(n){return Y&&V.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function am(e){return!e.type}function zd(e){return e.type==="transaction"}function xO(e){return e.type==="replay_event"}function gT(e){return e.type==="feedback"}function kO(e){return(t,n)=>{if(!e.isEnabled()||!am(t)&&!zd(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(zd(t)){wO(e,t);return}OO(e,t)}}}function wO(e,t){let n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function OO(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)||bo(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function MO(e){return t=>{!e.isEnabled()||!am(t)||LO(e,t)}}function LO(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:dt()}});_a(e,r)}}function PO(e){let t=T();t&&t.on("beforeAddBreadcrumb",n=>UO(e,n))}function UO(e,t){if(!e.isEnabled()||!QT(t))return;let n=DO(t);n&&_a(e,n)}function DO(e){return!QT(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?BO(e):Hn(e)}function BO(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>Xu?(n=!0,`${o.slice(0,Xu)}\u2026`):o;if(typeof o=="object")try{let i=Re(o,7);return JSON.stringify(i).length>Xu?(n=!0,`${JSON.stringify(i,null,2).slice(0,Xu)}\u2026`):i}catch{}return o});return Hn({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function QT(e){return!!e.category}function FO(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function fl(){let e=w().getPropagationContext().dsc;e&&delete e.replay_id;let t=ee();if(t){let n=Ne(t);delete n.replay_id}}function hT(e){let t=w().getPropagationContext().dsc;t&&(t.replay_id=e);let n=ee();if(n){let r=Ne(n);r.replay_id=e}}function HO(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:te.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 GO(e,t){return e.recordingMode!=="buffer"||t.message===Jd||!t.exception||t.type?!1:VT(e.getOptions().errorSampleRate)}function $O(e){return Object.assign((t,n)=>{if(e.session&&pl(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&fl(),!e.isEnabled()||e.isPaused())return t;if(xO(t))return delete t.breadcrumbs,t;if(!am(t)&&!zd(t)&&!gT(t))return t;if(!e.checkAndHandleExpiredSession())return fl(),t;if(gT(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),HO(e,t),t;if(FO(t,n)&&!e.getOptions()._experiments.captureExceptions)return Y&&V.log("Ignoring error from rrweb internals",t),null;let o=GO(e,t);if((o||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){let s=e.session;s.dirty=!0,e.getOptions().stickySession&&yl(s)}return t},{id:"Replay"})}function Il(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:te.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 WO(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 jO(e){return t=>{if(!e.isEnabled())return;let n=WO(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Il(e,[n]),!1)))}}function zO(e,t){return Y&&e.getOptions()._experiments.traceInternals?!1:oi(t,T())}function ZT(e,t){e.isEnabled()&&t!==null&&(zO(e,t.name)||e.addUpdate(()=>(Il(e,[t]),!0)))}function bl(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=Uu(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function ey(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function dl(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function ty(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 fa(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function Ur(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}=qO(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function qd(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 qO(e){if(!e||typeof e!="string")return{body:e};let t=e.length>XE,n=YO(e);if(t){let r=e.slice(0,XE);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 YO(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function ml(e,t){let n=VO(e);return $e(n,t)}function VO(e,t=ve.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(ve.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 KO(e,t,n){try{let r=await XO(e,t,n),o=ty("resource.fetch",r);ZT(n.replay,o)}catch(r){Y&&V.exception(r,"Failed to capture fetch breadcrumb")}}function JO(e,t){let{input:n,response:r}=t,o=n?Pi(n):void 0,i=bl(o),s=r?ey(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:p}=e.data,l=ml(s,n.networkDetailAllowUrls)&&!ml(s,n.networkDetailDenyUrls),d=l?QO(n,t.input,u):fa(u),f=await ZO(l,n,t.response,p);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:c,request:d,response:f}}function QO({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?nM(n,t):{};if(!e)return Ur(o,r,void 0);let i=Pi(n),[s,a]=vo(i,V),c=Ur(o,r,s);return a?dl(c,a):c}async function ZO(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return fa(o);let i=r?ny(r.headers,n):{};if(!r||!t&&o!==void 0)return Ur(i,o,void 0);let[s,a]=await tM(r),c=eM(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?dl(c,a):c}function eM(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?bl(e):n;return r?t?Ur(o,i,e):Ur(o,i,void 0):fa(i)}catch(i){return Y&&V.exception(i,"Failed to serialize response body"),Ur(o,n,void 0)}}async function tM(e){let t=rM(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await oM(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(Y&&V.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Y&&V.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function ny(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function nM(e,t){return e.length===1&&typeof e[0]!="string"?ST(e[0],t):e.length===2?ST(e[1],t):{}}function ST(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?ny(n,t):Array.isArray(n)?{}:qd(n,t):{}}function rM(e){try{return e.clone()}catch(t){Y&&V.exception(t,"Failed to clone response body")}}function oM(e){return new Promise((t,n)=>{let r=bo(()=>n(new Error("Timeout while trying to read response body")),500);iM(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function iM(e){return await e.text()}async function sM(e,t,n){try{let r=cM(e,t,n),o=ty("resource.xhr",r);ZT(n.replay,o)}catch(r){Y&&V.exception(r,"Failed to capture xhr breadcrumb")}}function aM(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=bl(r),i=n.getResponseHeader("content-length")?ey(n.getResponseHeader("content-length")):pM(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function cM(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r,input:s,xhr:a}=t,{url:c,method:u,status_code:p=0,request_body_size:l,response_body_size:d}=e.data;if(!c)return null;if(!a||!ml(c,n.networkDetailAllowUrls)||ml(c,n.networkDetailDenyUrls)){let P=fa(l),E=fa(d);return{startTimestamp:o,endTimestamp:i,url:c,method:u,statusCode:p,request:P,response:E}}let f=a[St],m=f?qd(f.request_headers,n.networkRequestHeaders):{},g=qd(ea(a),n.networkResponseHeaders),[h,S]=n.networkCaptureBodies?vo(s,V):[void 0],[I,x]=n.networkCaptureBodies?uM(a):[void 0],v=Ur(m,l,h),M=Ur(g,d,I);return{startTimestamp:o,endTimestamp:i,url:c,method:u,statusCode:p,request:S?dl(v,S):v,response:x?dl(M,x):M}}function uM(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return lM(e.response,e.responseType)}catch(n){t.push(n)}return Y&&V.warn("Failed to get xhr response body",...t),[void 0]}function lM(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 Y&&V.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Y&&V.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function pM(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return bl(n)}catch{return}}function fM(e){let t=T();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)=>dM(a,c,u))}catch{}}function dM(e,t,n){if(t.data)try{mM(t)&&gM(n)&&(aM(t,n),sM(t,n,e)),_M(t)&&hM(n)&&(JO(t,n),KO(t,n,e))}catch(r){Y&&V.exception(r,"Error when enriching network breadcrumb")}}function mM(e){return e.category==="xhr"}function _M(e){return e.category==="fetch"}function gM(e){return e?.xhr}function hM(e){return e?.input!==void 0}function SM(e){let t=T();Zs(Xw(e)),sr(jO(e)),PO(e),fM(e);let n=$O(e);Zo(n),t&&(t.on("beforeSendEvent",MO(e)),t.on("afterSendEvent",kO(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 EM(e){try{return Promise.all(Il(e,[TM(ve.performance.memory)]))}catch{return[]}}function TM(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 yM(e,t,n){return $p(e,t,{...n,setTimeoutImpl:bo})}var el=R.navigator;function IM(){return/iPhone|iPad|iPod/i.test(el?.userAgent??"")||/Macintosh/i.test(el?.userAgent??"")&&el?.maxTouchPoints&&el?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function bM(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){Y&&V.warn("Received replay event after session expired.");return}let o=r||!t;t=!0,AM(n),e.clickDetector&&qw(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!sm(e,n,o))return!0;if(!o)return!1;let i=e.session;if(RM(e,o),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){let s=e.eventBuffer.getEarliestTimestamp();s&&(Y&&V.log(`Updating session start time to earliest event in buffer to ${new Date(s)}`),i.started=s,e.getOptions().stickySession&&yl(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function AM(e){let t=e.data;if(!(e.type!==te.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==K.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=Tn.mirror.getNode(n.id),o=r&&Tn.mirror.getMeta(r);if(o?.type===Tl.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function vM(e){let t=e.getOptions();return{type:te.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 RM(e,t){!t||e.session?.segmentId!==0||sm(e,vM(e),!1)}function NM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function CM(e,t,n,r){return we(jo(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 xM({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 kM({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 Cs(e.getOptions(),r,i,t,e,se());if(!s)return null;e.emit("postprocessEvent",s,i),s.platform=s.platform||"javascript";let a=e.getSdkMetadata(),{name:c,version:u,settings:p}=a?.sdk||{};return s.sdk={...s.sdk,name:c||"sentry.javascript.unknown",version:u||"0.0.0",settings:p},s}async function wM({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=xM({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:p}=r,l=T(),d=w(),f=l?.getTransport(),m=l?.getDsn();if(!l||!f||!m||!i.sampled)return Promise.resolve({});let g={type:Sk,replay_start_timestamp:p/1e3,timestamp:o/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:i.sampled},h=await kM({scope:d,client:l,replayId:t,event:g});if(!h)return l.recordDroppedEvent("event_processor","replay"),Y&&V.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete h.sdkProcessingMetadata;let S=CM(h,s,m,l.getOptions().tunnel),I;try{I=await f.send(S)}catch(v){let M=new Error(Jd);try{M.cause=v}catch{}throw M}let x=ws({},I);if(ks(x,"replay"))throw new da(x);if(typeof I.statusCode=="number"&&(I.statusCode<200||I.statusCode>=300))throw new _l(I.statusCode);return I}var _l=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},da=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},gl=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function ry(e,t={count:0,interval:Ak}){let{recordingData:n,onError:r}=e;if(n.length)try{return await wM(e),!0}catch(o){if(o instanceof _l||o instanceof da)throw o;if(Jo("Replays",{_retryCount:t.count}),r&&r(o),t.count>=vk){let i=new Error(`${Jd} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{bo(async()=>{try{await ry(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var oy="__THROTTLED",OM="__SKIPPED";function MM(e,t,n){let r=new Map,o=a=>{let c=a-n;r.forEach((u,p)=>{p<c&&r.delete(p)})},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 p=s;return s=!0,p?OM:oy}s=!1;let u=r.get(c)||0;return r.set(c,u+1),e(...a)}}var Yd=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Ek,sessionIdleExpire:Tk},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=yM(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=MM((s,a)=>NO(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(Rk,r),timeout:r,scrollTimeout:Nk,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new Hd(this,i)),Y){let s=t._experiments;V.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{ve.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=>{tO(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){Y&&V.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){Y&&V.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",Y&&V.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){Y&&V.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){Y&&V.log("Buffering is in progress, call `flush()` to save the replay");return}Y&&V.infoTick("Starting replay in session mode"),this._updateUserActivity();let t=Ad({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){Y&&V.log("Buffering is in progress, call `flush()` to save the replay");return}Y&&V.infoTick("Starting replay in buffer mode");let t=Ad({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=Tn({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:bk}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:bM(this),...IM(),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";T()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{Y&&V.log(`Stopping Replay triggered by ${r}`),fl(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,yO(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Y&&V.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Y&&V.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();Y&&V.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(),hT(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&&jd(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${ve.location.pathname}${ve.location.hash}${ve.location.search}`,n=`${ve.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===oy){let o=Hn({category:"replay.throttled"});this.addUpdate(()=>!sm(this,{type:Uw,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||ee(),n=t&&ne(t),o=(n&&L(n).data||{})[he];if(!(!n||!o||!["route","custom"].includes(o)))return L(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=SO({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&T()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&hT(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=Ad({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 pl(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{ve.document.addEventListener("visibilitychange",this._handleVisibilityChange),ve.addEventListener("blur",this._handleWindowBlur),ve.addEventListener("focus",this._handleWindowFocus),ve.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(SM(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=mO(this)}_removeListeners(){try{ve.document.removeEventListener("visibilitychange",this._handleVisibilityChange),ve.removeEventListener("blur",this._handleWindowBlur),ve.removeEventListener("focus",this._handleWindowFocus),ve.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(pl(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){fl();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Y&&V.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:te.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=iO(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(Il(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){Y&&V.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await EM(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new gl;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await ry({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=T();if(r){let o;n instanceof da?o="ratelimit_backoff":n instanceof gl?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){Y&&V.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){Y&&V.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&&Y&&V.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&&yl(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let c=NM(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 na(e,t){return[...e,...t].join(",")}function LM({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=na(e,[".sentry-mask","[data-sentry-mask]"]),a=na(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:na(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:na(r,[]),ignoreSelector:na(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function PM({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 ET='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',UM=["content-length","content-type","accept"],DM=Symbol.for("sentry__originalRequestBody"),TT=!1,yT=!1;function BM(){if(typeof Request>"u"||yT)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[DM]=r.body),o};t.prototype=e.prototype,R.Request=t,yT=!0}catch{}}var iy=(e=>new Vd(e)),Vd=class{constructor({flushMinDelay:t=yk,flushMaxDelay:n=Ik,minReplayDuration:r=Ck,maxReplayDuration:o=QE,stickySession:i=!0,useCompression:s=!0,workerUrl:a,_experiments:c={},maskAllText:u=!0,maskAllInputs:p=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:d=750,mutationLimit:f=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:h=[],networkDetailDenyUrls:S=[],networkCaptureBodies:I=!0,networkRequestHeaders:x=[],networkResponseHeaders:v=[],mask:M=[],maskAttributes:P=["title","placeholder","aria-label"],unmask:E=[],block:C=[],unblock:z=[],ignore:A=[],maskFn:U,beforeAddRecordingEvent:k,beforeErrorSampling:D,onError:G,attachRawBodyFromRequest:oe=!1}={}){this.name="Replay";let ae=LM({mask:M,unmask:E,block:C,unblock:z,ignore:A});if(this._recordingOptions={maskAllInputs:p,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:U,maskInputFn:U,maskAttributeFn:(W,O,j)=>PM({maskAttributes:P,maskAllText:u,privacyOptions:ae,key:W,value:O,el:j}),...ae,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:W=>{try{W.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!c.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,xk),maxReplayDuration:Math.min(o,QE),stickySession:i,useCompression:s,workerUrl:a,blockAllMedia:l,maskAllInputs:p,maskAllText:u,mutationBreadcrumbLimit:d,mutationLimit:f,slowClickTimeout:m,slowClickIgnoreSelectors:g,networkDetailAllowUrls:h,networkDetailDenyUrls:S,networkCaptureBodies:I,networkRequestHeaders:IT(x),networkResponseHeaders:IT(v),beforeAddRecordingEvent:k,beforeErrorSampling:D,onError:G,attachRawBodyFromRequest:oe,_experiments:c},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${ET}`:ET,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&<())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return TT}set _isInitialized(t){TT=t}afterAllSetup(t){!lt()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&BM(),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&&(Fe(t,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&Fe(t,{"sentry._internal.replay_is_buffering":!0}))}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=FM(this._initialOptions,t);this._replay=new Yd({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function FM(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=Ut(n.replaysSessionSampleRate),i=Ut(n.replaysOnErrorSampleRate);return o==null&&i==null&&Ye(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function IT(e){return[...UM,...e.map(t=>t.toLowerCase())]}function sy(){return T()?.getIntegrationByName("Replay")}var HM=Object.defineProperty,GM=(e,t,n)=>t in e?HM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ay=(e,t,n)=>GM(e,typeof t!="symbol"?t+"":t,n),um=class{constructor(){ay(this,"idNodeMap",new Map),ay(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 $M(){return new um}function WM(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function lm(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:lm(e.parentNode,t,n,r+1)}function cy(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(WM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}var Vi=`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.`,uy={map:{},getId(){return console.error(Vi),-1},getNode(){return console.error(Vi),null},removeNodeFromMap(){console.error(Vi)},has(){return console.error(Vi),!1},reset(){console.error(Vi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(uy=new Proxy(uy,{get(e,t,n){return t==="map"&&console.error(Vi),Reflect.get(e,t,n)}}));function fm(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){hy(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>fm(e,t,i||{},!0)}function dm(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 jM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Nl(e,t,n,r,o){if(!e)return!1;let i=jM(e);if(!i)return!1;let s=cy(t,n);if(!o){let u=r&&i.matches(r);return s(i)&&!u}let a=lm(i,s),c=-1;return a<0?!1:(r&&(c=lm(i,cy(null,r))),a>-1&&c<0?!0:a<c)}var ly={};function gy(e){let t=ly[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 ly[e]=r.bind(window)}function No(...e){return gy("requestAnimationFrame")(...e)}function hy(...e){return gy("setTimeout")(...e)}var Ji=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ji||{}),vl;function zM(e){vl=e}var cm=e=>vl?((...n)=>{try{return e(...n)}catch(r){if(vl&&vl(r)===!0)return()=>{};throw r}}):e,Ki="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qM=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(ga=0;ga<Ki.length;ga++)qM[Ki.charCodeAt(ga)]=ga;var ga,YM=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=Ki[t[n]>>2],o+=Ki[(t[n]&3)<<4|t[n+1]>>4],o+=Ki[(t[n+1]&15)<<2|t[n+2]>>6],o+=Ki[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},py=new Map;function VM(e,t){let n=py.get(e);return n||(n=new Map,py.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Sy=(e,t,n)=>{if(!e||!(Ty(e,t)||typeof e=="object"))return;let r=e.constructor.name,o=VM(n,r),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function Rl(e,t,n){if(e instanceof Array)return e.map(r=>Rl(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=YM(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Rl(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:[Rl(e.data,t,n),e.width,e.height]};if(Ty(e,t)||typeof e=="object"){let r=e.constructor.name,o=Sy(e,t,n);return{rr_type:r,index:o}}}}return e}var Ey=(e,t,n)=>e.map(r=>Rl(r,t,n)),Ty=(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 KM(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=dm(t.CanvasRenderingContext2D.prototype,a,function(u){return function(...p){return Nl(this.canvas,n,r,o,!0)||hy(()=>{let l=Ey(p,t,this);e(this.canvas,{type:Ji["2D"],property:a,args:l})},0),u.apply(this,p)}});i.push(c)}catch{let c=fm(t.CanvasRenderingContext2D.prototype,a,{set(u){e(this.canvas,{type:Ji["2D"],property:a,args:[u],setter:!0})}});i.push(c)}return()=>{i.forEach(a=>a())}}function JM(e){return e==="experimental-webgl"?"webgl":e}function fy(e,t,n,r,o){let i=[];try{let s=dm(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...u){if(!Nl(this,t,n,r,!0)){let p=JM(c);if("__context"in this||(this.__context=p),o&&["webgl","webgl2"].includes(p))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 dy(e,t,n,r,o,i,s,a){let c=[],u=Object.getOwnPropertyNames(e);for(let p of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(p))try{if(typeof e[p]!="function")continue;let l=dm(e,p,function(d){return function(...f){let m=d.apply(this,f);if(Sy(m,a,this),"tagName"in this.canvas&&!Nl(this.canvas,r,o,i,!0)){let g=Ey(f,a,this),h={type:t,property:p,args:g};n(this.canvas,h)}return m}});c.push(l)}catch{let l=fm(e,p,{set(d){n(this.canvas,{type:t,property:p,args:[d],setter:!0})}});c.push(l)}return c}function XM(e,t,n,r,o,i){let s=[];return s.push(...dy(t.WebGLRenderingContext.prototype,Ji.WebGL,e,n,r,o,i,t)),typeof t.WebGL2RenderingContext<"u"&&s.push(...dy(t.WebGL2RenderingContext.prototype,Ji.WebGL2,e,n,r,o,i,t)),()=>{s.forEach(a=>a())}}var QM='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 ZM(){let e=new Blob([QM]);return URL.createObjectURL(e)}var pm=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&&zM(s),(i&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&cm(()=>{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}cm(()=>{if(s&&n==="all"&&this.initCanvasMutationObserver(t,r,o,i),s&&typeof n=="number"){let c=fy(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}No(r=>this.takeSnapshot(r,!0,t))}initFPSWorker(){let t=new Worker(ZM());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:Ji["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=No(n)};t=No(n),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,n,r,o){let i=fy(t,n,r,o,!1),s=KM(this.processMutation.bind(this),t,n,r,o),a=XM(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=>{Nl(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(m=>{let g=this.mirror.getId(m);if(!(!this.mirror.hasNode(m)||!m.width||!m.height||this.snapshotInProgressMap.get(g))){if(this.snapshotInProgressMap.set(g,!0),!n&&["webgl","webgl2"].includes(m.__context)){let h=m.getContext(m.__context);h?.getContextAttributes()?.preserveDrawingBuffer===!1&&h.clear(h.COLOR_BUFFER_BIT)}createImageBitmap(m).then(h=>{this.worker?.postMessage({id:g,bitmap:h,width:m.width,height:m.height,dataURLOptions:c,maxCanvasSize:u},[h])}).catch(h=>{cm(()=>{throw this.snapshotInProgressMap.delete(g),h})()})}}),!0)}startPendingCanvasMutationFlusher(){No(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,No(t)};No(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),No(()=>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{type:a,...c}=s;return c}),{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)}$M();var my;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(my||(my={}));var _y={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}}},eL="ReplayCanvas",Al=1280,tL=((e={})=>{let[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,Al):Al,n?Math.min(n,Al):Al]},o,i,s=new Promise(a=>i=a);return{name:eL,getOptions(){let{quality:a,enableManualSnapshot:c,maxCanvasSize:u}=r;return{enableManualSnapshot:c,recordCanvas:!0,getCanvasManager:p=>{let l=new pm({...p,enableManualSnapshot:c,maxCanvasSize:u,errorHandler:d=>{try{typeof d=="object"&&(d.__rrweb__=!0)}catch{}}});return o=l,i(l),l},..._y[a]||_y.medium}},async snapshot(a,c){(o||await s).snapshot(a,c)}}}),yy=tL;function Iy(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function mm(e){try{return new URL(e,N.location.origin).href}catch{return}}function by(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function _m(e){try{return new Headers(e)}catch{return}}var ha={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Cl(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:c}={...ha,...t},u=typeof o=="function"?o:f=>!0,p=f=>rL(f,s),l={},d=e.getOptions().propagateTraceparent;n&&Un(f=>{let m=tf(f,u,p,l,{propagateTraceparent:d,onRequestSpanEnd:c});if(m){let g=mm(f.fetchData.url),h=g?Nt(g).host:void 0;m.setAttributes({"http.url":g?ut(g):void 0,"server.address":h}),i&&Ay(m,e),a?.(m,{headers:f.headers})}}),r&&Ao(f=>{let m=oL(f,u,p,l,d,c);m&&(i&&Ay(m,e),a?.(m,{headers:_m(f.xhr.__sentry_xhr_v3__?.request_headers)}))})}var nL=300;function Ay(e,t){let{url:n}=L(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(Pe(t)){let i=e.end.bind(e);e.end=s=>{let a=s??Z(),c=!1,u=()=>{c||(c=!0,setTimeout(o),i(a),clearTimeout(p))};r=u;let p=setTimeout(u,nL)}}let o=Ot("resource",({entries:i})=>{i.forEach(s=>{by(s)&&s.name.endsWith(n)&&(e.setAttributes(Xs(s)),r())})})}function rL(e,t){let n=dt();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?$e(r.toString(),t)||i&&$e(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?$e(e,t):r}}function oL(e,t,n,r,o,i){let s=e.xhr,a=s?.[St];if(!s||s.__sentry_own_request__||!a)return;let{url:c,method:u}=a,p=Be()&&t(c);if(e.endTimestamp){let I=s.__sentry_xhr_span_id__;if(!I)return;let x=r[I];x&&(p&&a.status_code!==void 0&&(vn(x,a.status_code),x.end(),i?.(x,{headers:_m(ea(s)),error:e.error})),delete r[I]);return}let l=mm(c),d=l?Nt(l):Nt(c),f=ut(Xn(c)),m=T(),h=!!ee()||!!m&&Pe(m),S=p&&h?Ke({name:`${u} ${f}`,attributes:{url:ut(c),type:"xhr","http.method":u,"http.url":l?ut(l):void 0,"server.address":d?.host,[$]:"auto.http.browser",[q]:"http.client",...d?.search&&{"http.query":d?.search},...d?.hash&&{"http.fragment":d?.hash}}}):new ze;return p&&!h&&m?.recordDroppedEvent("no_parent_span","span"),s.__sentry_xhr_span_id__=S.spanContext().spanId,r[s.__sentry_xhr_span_id__]=S,n(c)&&iL(s,Be()&&h?S:void 0,o),m&&m.emit("beforeOutgoingRequestSpan",S,e),S}function iL(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=ao({span:t,propagateTraceparent:n});r&&sL(e,r,o,i)}function sL(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 vy=new WeakMap,Ry=new WeakMap,aL=9e4,cL=["text/event-stream","application/x-ndjson","application/stream+json"],xl=()=>({name:"FetchStreamPerformance",setup(){su(e=>{if(e.response){let t=vy.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=Ry.get(e.response);n&&clearTimeout(n)}}}),Un(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!cL.some(c=>t.startsWith(c)))return;let n=e.fetchData?.url||"",r=e.fetchData?.method||"GET",o=Cn(n),i=n.startsWith("data:")?ut(n):o?Vo(o):n,s=Ke({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:ut(n),"http.method":r,type:"fetch",[q]:"http.client.stream",[$]:"auto.http.browser.stream"}});vy.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},aL);Ry.set(e.response,a)}})}});var gm="WebVitals",kl=(e={})=>{let t=new Set(e.ignore??[]);return{name:gm,setup(n){let r=Pe(n),{enableStandaloneClsSpans:o,enableStandaloneLcpSpans:i}=e._experiments??{},s=r||t.has("cls")?void 0:o||!1,a=r||t.has("lcp")?void 0:i||!1,c=Vf({recordClsStandaloneSpans:s,recordLcpStandaloneSpans:a,client:n}),u=new WeakSet;n.on("afterStartPageLoadSpan",p=>{u.add(p)}),n.on("spanEnd",p=>{u.delete(p)&&(c(),Zf(p,{recordClsOnPageloadSpan:s===!1,recordLcpOnPageloadSpan:a===!1,spanStreamingEnabled:r}))}),r?(t.has("lcp")||sd(n),t.has("cls")||ad(n),t.has("inp")||cd()):t.has("inp")||rd()},afterAllSetup(){t.has("inp")||od()}}};function Ny(){N.document?N.document.addEventListener("visibilitychange",()=>{let e=ee();if(!e)return;let t=ne(e);if(N.document.hidden&&t){let n="cancelled",{op:r,status:o}=L(t);b&&_.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()}}):b&&_.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var uL=3600,Cy="sentry_previous_trace",lL="sentry.previous_trace";function xy(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?dL():void 0;e.on("spanStart",s=>{if(ne(s)!==s)return;let a=w().getPropagationContext();o=pL(o,s,a),r&&fL(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=w(),c=a.getPropagationContext();if(i&&c.parentSpanId){i=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(o.sampleRate),sampled:String(hm(o.spanContext))},sampleRand:o.sampleRand}),s.parentSampled=hm(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes={...s.spanAttributes,[Fo]:o.sampleRate}})}function pL(e,t,n){let r=L(t);function o(){try{let a=Number(r.data?.[bn]??n.dsc?.sample_rate);return Number.isNaN(a)?0:a}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<=uL&&(b&&_.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:s,attributes:{[Va]:"previous_trace"}}),t.setAttribute(lL,`${s.traceId}-${s.spanId}-${hm(s)?1:0}`)),i)}function fL(e){try{N.sessionStorage.setItem(Cy,JSON.stringify(e))}catch(t){b&&_.warn("Could not store previous trace in sessionStorage",t)}}function dL(){try{let e=N.sessionStorage?.getItem(Cy);return JSON.parse(e)}catch{return}}function hm(e){return e.traceFlags===1}var mL="BrowserTracing",_L=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Sm(){let e=N.navigator;return e?.userAgent?_L.test(e.userAgent):!1}var gL={...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:{},...ha},wl=((e={})=>{"enableElementTiming"in e&&Ye(()=>{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=N.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:s,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:u,idleTimeout:p,finalTimeout:l,childSpanTimeout:d,markBackgroundSpan:f,traceFetch:m,traceXHR:g,trackFetchStreamPerformance:h,shouldCreateSpanForRequest:S,enableHTTPTimings:I,ignoreResourceSpans:x,ignorePerformanceApiSpans:v,instrumentPageLoad:M,instrumentNavigation:P,detectRedirects:E,linkPreviousTrace:C,consistentTraceSampling:z,enableReportPageLoaded:A,onRequestSpanStart:U,onRequestSpanEnd:k}={...gL,...e},D=Sm(),G,oe;function ae(W,O,j=!0){let B=O.op==="pageload",ie=O.name,ce=u?u(O):O,ge=ce.attributes||{};if(ie!==ce.name&&(ge[he]="custom",ce.attributes=ge),!j){let sn=At();Ke({...ce,startTime:sn}).end(sn);return}t.name=ce.name,t.source=ge[he];let ke=pc(ce,{idleTimeout:p,finalTimeout:l,childSpanTimeout:d,disableAutoFinish:B,beforeSpanEnd:sn=>{Qf(sn,{ignoreResourceSpans:x,ignorePerformanceApiSpans:v,spanStreamingEnabled:Pe(W)}),Oy(W,void 0);let cr=w(),Dr=cr.getPropagationContext();cr.setPropagationContext({...Dr,traceId:ke.spanContext().traceId,sampled:at(ke),dsc:Ne(sn)}),B&&(oe=void 0)},trimIdleSpanEndTimestamp:!A});B&&A&&(oe=ke),Oy(W,ke);function on(){n&&["interactive","complete"].includes(n.readyState)&&W.emit("idleSpanEnableAutoFinish",ke)}B&&!A&&n&&(n.addEventListener("readystatechange",()=>{on()}),on())}return{name:mL,setup(W){if(D){b&&_.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(Es(),i&&R.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Jf():o&&Kf(),s&&Xf(),E&&n){let j=()=>{G=Z()};addEventListener("click",j,{capture:!0}),addEventListener("keydown",j,{capture:!0,passive:!0})}function O(){let j=Sa(W);j&&!L(j).timestamp&&(b&&_.log(`[Tracing] Finishing current active span with op: ${L(j).op}`),j.setAttribute(jn,"cancelled"),j.end())}W.on("startNavigationSpan",(j,B)=>{if(T()!==W)return;if(B?.isRedirect){b&&_.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ae(W,{op:"navigation.redirect",...j},!1);return}G=void 0,O(),se().setPropagationContext({traceId:et(),sampleRand:Math.random(),propagationSpanId:Be()?void 0:ot()});let ie=w();ie.setPropagationContext({traceId:et(),sampleRand:Math.random(),propagationSpanId:Be()?void 0:ot()}),ie.setSDKProcessingMetadata({normalizedRequest:void 0}),ae(W,{op:"navigation",...j,parentSpan:null,forceTransaction:!0})}),W.on("startPageLoadSpan",(j,B={})=>{if(T()!==W)return;O();let ie=B.sentryTrace||ky("sentry-trace")||wy("sentry-trace"),ce=B.baggage||ky("baggage")||wy("baggage"),ge=ps(ie,ce),ke=w();ke.setPropagationContext(ge),Be()||(ke.getPropagationContext().propagationSpanId=ot()),ke.setSDKProcessingMetadata({normalizedRequest:Ai()}),ae(W,{op:"pageload",...j})}),W.on("endPageloadSpan",()=>{A&&oe&&(oe.setAttribute(jn,"reportPageLoaded"),oe.end())})},afterAllSetup(W){if(D)return;W.addIntegration&&!W.getIntegrationByName?.(gm)&&W.addIntegration(kl({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c}}));let O=dt();if(C!=="off"&&xy(W,{linkPreviousTrace:C,consistentTraceSampling:z}),N.location){if(M){let j=le();Em(W,{name:N.location.pathname,startTime:j?j/1e3:void 0,attributes:{[he]:"url",[$]:"auto.pageload.browser"}})}P&&sr(({to:j,from:B})=>{if(B===void 0&&O?.indexOf(j)!==-1){O=void 0;return}O=void 0;let ie=Cn(j),ce=Sa(W),ge=ce&&E&&SL(ce,G);Tm(W,{name:ie?.pathname||N.location.pathname,attributes:{[he]:"url",[$]:"auto.navigation.browser"}},{url:j,isRedirect:ge})})}f&&Ny(),s&&hL(W,p,l,d,t),Cl(W,{traceFetch:m,traceXHR:g,tracePropagationTargets:W.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:S,enableHTTPTimings:I,onRequestSpanStart:U,onRequestSpanEnd:k}),h&&W.addIntegration(xl())}}});function Em(e,t,n){e.emit("startPageLoadSpan",t,n),w().setTransactionName(t.name);let r=Sa(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Tm(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=w();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...Ai(),url:r}}),Sa(e)}function ky(e){return N.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function wy(e){return N.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function hL(e,t,n,r,o){let i=N.document,s,a=()=>{let c="ui.action.click",u=Sa(e);if(u){let p=L(u).op;if(["navigation","pageload"].includes(p)){b&&_.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(jn,"interactionInterrupted"),s.end(),s=void 0),!o.name){b&&_.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}s=pc({name:o.name,op:c,attributes:{[he]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var Ly="_sentry_idleSpan";function Sa(e){return e[Ly]}function Oy(e,t){_e(e,Ly,t)}var My=1.5;function SL(e,t){let n=L(e),r=At(),o=n.start_timestamp;return!(r-o>My||t&&r-t<=My)}function Py(e=T()){e?.emit("endPageloadSpan")}function Uy(e){let t=ee();if(t===e)return;let n=w();e.end=new Proxy(e.end,{apply(r,o,i){return ht(n,t),Reflect.apply(r,o,i)}}),ht(n,e)}var Dy=()=>({name:"SpanStreaming",beforeSetup(e){let t=e.getOptions();t.traceLifecycle||(b&&_.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(!Pe(e)){r.traceLifecycle="static",b&&_.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Vn(o)){r.traceLifecycle="static",b&&_.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let i=new js(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 Xi(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function EL(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=Xi(n);return o=>r.then(i=>o(i.transaction(t,"readwrite").objectStore(t)))}function ym(e){return Xi(e.getAllKeys())}function TL(e,t,n){return e(r=>ym(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),Xi(r.transaction)}))}function yL(e,t,n){return e(r=>ym(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.min(...o,0)-1),Xi(r.transaction)}))}function IL(e){return e(t=>ym(t).then(n=>{let r=n[0];if(r!=null)return Xi(t.get(r)).then(o=>(t.delete(r),Xi(t.transaction).then(()=>o)))}))}function bL(e){let t;function n(){return t==null&&(t=EL(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{let o=Kn(r);await TL(n(),o,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{let o=Kn(r);await yL(n(),o,e.maxQueueSize||30)}catch{}},shift:async()=>{try{let r=await IL(n());if(r)return ac(r)}catch{}}}}function AL(e){return t=>{let n=e({...t,createStore:bL});return N.addEventListener("online",async r=>{await n.flush()}),n}}function By(e=Ui){return AL(Up(e))}var Fy=1e6,vL="window"in R&&R.window===R&&typeof importScripts>"u",xo=String(0),bm=vL?"main":"worker",Ol=N.navigator,Gy="",$y="",Wy="",Im=Ol?.userAgent||"",jy="",RL=Ol?.language||Ol?.languages?.[0]||"";function NL(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}var Hy=Ol?.userAgentData;NL(Hy)&&Hy.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(Gy=e.platform||"",Wy=e.architecture||"",jy=e.model||"",$y=e.platformVersion||"",e.fullVersionList?.length){let t=e.fullVersionList[e.fullVersionList.length-1];Im=`${t.brand} ${t.version}`}}).catch(e=>{});function CL(e){return!("thread_metadata"in e)}function xL(e){return CL(e)?ML(e):e}function kL(e){let t=e.contexts?.trace?.trace_id;return typeof t=="string"&&t.length!==32&&b&&_.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function wL(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=kL(r),i=xL(n),s=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Z()*1e3),a=typeof r.timestamp=="number"?r.timestamp*1e3:Z()*1e3;return{event_id:e,timestamp:new Date(s).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Yn,runtime:{name:"javascript",version:N.navigator.userAgent},os:{name:Gy,version:$y,build_number:Im},device:{locale:RL,model:jy,manufacturer:Im,architecture:Wy,is_emulator:!1},debug_meta:{images:Ky(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||de(),trace_id:o,active_thread_id:xo,relative_start_ns:"0",relative_end_ns:((a-s)*1e6).toFixed(0)}]}}function zy(e,t,n){if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);let r=OL(e),o=t.getOptions(),i=t.getSdkMetadata?.()?.sdk;return{chunk_id:de(),client_sdk:{name:i?.name??"sentry.javascript.browser",version:i?.version??"0.0.0"},profiler_id:n||de(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:Ky(e.resources)},profile:r}}function qy(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 OL(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=[],p=c;for(;p;)u.push(p.frameId),p=p.parentId===void 0?void 0:e.stacks[p.parentId];n[a]=u}let r=le(),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:xo,timestamp:u}}return{frames:t,stacks:n,samples:s,thread_metadata:{[xo]:{name:bm}}}}function Ml(e){return L(e).op==="pageload"}function ML(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[xo]:{name:bm}}},o=e.samples[0];if(!o)return r;let i=o.timestamp,s=le(),a=typeof performance.timeOrigin=="number"?performance.timeOrigin:s||0,c=a-(s||a);return e.samples.forEach((u,p)=>{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[p]={elapsed_since_start_ns:((u.timestamp+c-i)*Fy).toFixed(0),stack_id:t,thread_id:xo};return}let l=e.stacks[u.stackId],d=[];for(;l;){d.push(l.frameId);let m=e.frames[l.frameId];m&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:m.name,abs_path:typeof m.resourceId=="number"?e.resources[m.resourceId]:void 0,lineno:m.line,colno:m.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}let f={elapsed_since_start_ns:((u.timestamp+c-i)*Fy).toFixed(0),stack_id:n,thread_id:xo};r.stacks[n]=d,r.samples[p]=f,n++}),r}function Yy(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:"profile"},n]);return e}function Vy(e){let t=[];return Rt(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 Ky(e){let r=T()?.getOptions()?.stackParser;return r?hp(r,e):[]}function Jy(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(b&&_.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?(b&&_.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function LL(e){return e.samples.length<2?(b&&_.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(b&&_.log("[Profiling] Discarding profile because it contains no frames"),!1)}var Am=!1,vm=3e4;function PL(e){return typeof e=="function"}function Ll(){let e=N.Profiler;if(!PL(e)){b&&_.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}let t=10,n=Math.floor(vm/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{b&&(_.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),_.log("[Profiling] Disabling profiling for current user session.")),Am=!0}}function Rm(e){if(Am)return b&&_.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return b&&_.log("[Profiling] Discarding profile because root span was not sampled."),!1;let n=T()?.getOptions();if(!n)return b&&_.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return Jy(r)?r?(r===!0?!0:Math.random()<r)?!0:(b&&_.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(b&&_.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(b&&_.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function Xy(e){if(Am)return b&&_.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 b&&_.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let t=e.profileSessionSampleRate;return Jy(t)?t?Math.random()<=t:(b&&_.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(b&&_.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function Ea(e){return typeof e.profilesSampleRate<"u"}function Qy(e,t,n,r){return LL(n)?wL(e,t,n,r):null}var Co=new Map;function Zy(){return Co.size}function eI(e){let t=Co.get(e);return t&&Co.delete(e),t}function tI(e,t){if(Co.set(e,t),Co.size>30){let n=Co.keys().next().value;n!==void 0&&Co.delete(n)}}var Pl=new WeakSet;function ko(e){e.setAttribute("thread.id",xo),e.setAttribute("thread.name",bm)}function Nm(e){let t;Ml(e)&&(t=Z()*1e3);let n=Ll();if(!n)return;b&&_.log(`[Profiling] started profiling span: ${L(e).description}`);let r=de(),o=null;w().setContext("profile",{profile_id:r,start_timestamp:t}),Pl.add(e),ko(e);async function i(){if(e&&n){if(o){b&&_.log("[Profiling] profile for:",L(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(s&&(N.clearTimeout(s),s=void 0),b&&_.log(`[Profiling] stopped profiling of span: ${L(e).description}`),!u){b&&_.log(`[Profiling] profiler returned null profile for: ${L(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=u,tI(r,u)}).catch(u=>{b&&_.log("[Profiling] error while stopping profiler:",u)})}}let s=N.setTimeout(()=>{b&&_.log("[Profiling] max profile duration elapsed, stopping profiling for:",L(e).description),i()},vm),a=e.end.bind(e);function c(){return e?(i().then(()=>{a()},()=>{a()}),e):a()}e.end=c}var UL=6e4,DL=3e5,Ul=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=Xy(t.getOptions());b&&_.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||b&&_.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=de(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t),t.on("spanStart",o=>{this._isRunning&&ko(o)})}start(){if(this._lifecycleMode==="trace"){b&&_.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){b&&_.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){b&&_.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){b&&_.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){b&&_.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&&(b&&_.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling()),this._isRunning&&ko(t)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,b&&_.log("[Profiling] Started profiling with profiler ID:",this._profilerId),zt().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){b&&_.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=>{b&&_.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&zt().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){b&&_.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==ne(n))return;if(!n.isRecording()){b&&_.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&&(b&&_.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;b&&_.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=>{b&&_.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,zt().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);let n=setTimeout(()=>this._onRootSpanTimeout(t),DL);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let t=Ll();if(!t){b&&_.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{b&&_.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},UL))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(b&&_.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=zy(n,this._client,this._profilerId),o=qy(r);if("reason"in o){b&&_.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),b&&_.log("[Profiling] Collected browser profile chunk.")}catch(n){b&&_.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=we({event_id:de(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&o&&{dsn:je(o)}},[[{type:"profile_chunk",platform:"javascript"},t]]);n.sendEnvelope(s).then(null,a=>{b&&_.error("Error while sending profile chunk envelope:",a)})}};var BL="BrowserProfiling",FL=(()=>({name:BL,setup(e){let t=e.getOptions(),n=new Ul;if(!Ea(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),Ea(t)&&!t.profilesSampleRate){b&&_.log("[Profiling] Profiling disabled, no profiling options found.");return}let r=ee(),o=r&&ne(r);if(Ea(t)&&t.profileSessionSampleRate!==void 0&&b&&_.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),Ea(t))o&&Ml(o)&&Rm(o)&&Nm(o),e.on("spanStart",i=>{let s=ne(i);i===s?Rm(i)&&Nm(i):Pl.has(s)&&ko(i)}),e.on("beforeEnvelope",i=>{if(!Zy())return;let s=Vy(i);if(!s.length)return;let a=[];for(let c of s){let u=c?.contexts,p=u?.profile?.profile_id,l=u?.profile?.start_timestamp;if(typeof p!="string"){b&&_.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!p){b&&_.log("[Profiling] cannot find profile for a span without a profile context");continue}u?.profile&&delete u.profile;let d=eI(p);if(!d){b&&_.log(`[Profiling] Could not retrieve profile for span: ${p}`);continue}let f=Qy(p,l,d,c);f&&a.push(f)}Yy(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(!Be(t)){b&&_.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),N.setTimeout(()=>{let s=ee(),a=s&&ne(s);a&&n.notifyRootSpanActive(a)},0)}}}})),nI=FL;var HL="SpotlightBrowser",GL=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],$L=((e={})=>{let t=e.sidecarUrl||"http://localhost:8969/stream";return{name:HL,setup:()=>{b&&_.log("Using Sidecar URL",t)},beforeSetup(n){let r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...GL]},afterAllSetup:n=>{WL(n,t)}}});function WL(e,t){let n=Li("fetch"),r=0;e.on("beforeEnvelope",o=>{if(r>3){_.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:Kn(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,_.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}var rI=$L;var oI=()=>({name:"LaunchDarkly",processEvent(e,t,n){return Dt(e)}});function iI(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{Ct(e,t.value),xt(e,t.value)}}}var sI=()=>({name:"OpenFeature",processEvent(e,t,n){return Dt(e)}}),Dl=class{after(t,n){Ct(n.flagKey,n.value),xt(n.flagKey,n.value)}error(t,n,r){Ct(t.flagKey,t.defaultValue),xt(t.flagKey,t.defaultValue)}};var aI=({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){let t=e.prototype;Ee(t,"isEnabled",jL)},processEvent(t,n,r){return Dt(t)}});function jL(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"?(Ct(n,r),xt(n,r)):b&&_.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var cI=(({growthbookClass:e})=>Zp({growthbookClass:e}));var uI=({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",n=>{Ct(n.gate.name,n.gate.value),xt(n.gate.name,n.gate.value)})},processEvent(t,n,r){return Dt(t)}});async function lI(){let e=T();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 zo(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}var zL="WebWorker",fI=({worker:e})=>({name:zL,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(t=>pI(t))},addWorker:t=>pI(t)});function pI(e){e.addEventListener("message",t=>{if(YL(t.data)){if(t.stopImmediatePropagation(),t.data._sentryDebugIds&&(b&&_.log("Sentry debugId web worker message received",t.data),N._sentryDebugIds={...t.data._sentryDebugIds,...N._sentryDebugIds}),t.data._sentryModuleMetadata&&(b&&_.log("Sentry module metadata web worker message received",t.data),N._sentryModuleMetadata={...t.data._sentryModuleMetadata,...N._sentryModuleMetadata}),t.data._sentryWasmImages){b&&_.log("Sentry WASM images web worker message received",t.data);let n=N._sentryWasmImages||[],r=t.data._sentryWasmImages.filter(o=>Me(o)&&typeof o.code_file=="string"&&!n.some(i=>i.code_file===o.code_file));N._sentryWasmImages=[...n,...r]}t.data._sentryWorkerError&&(b&&_.log("Sentry worker rejection message received",t.data._sentryWorkerError),qL(t.data._sentryWorkerError))}})}function qL(e){let t=T();if(!t)return;let n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,o=e.reason,i=Ge(o)?hd(o):Ri(n,o,void 0,r,!0);i.level="error",e.filename&&(i.contexts={...i.contexts,worker:{filename:e.filename}}),qt(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),b&&_.log("Captured worker unhandled rejection",o)}function dI({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener("unhandledrejection",t=>{let r={reason:gd(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),b&&_.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),b&&_.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function YL(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 VL="https://otel.kubit.ai/v1/traces",Cm=e=>typeof process<"u"&&process.env?process.env[e]:void 0,KL=e=>{if(e!==void 0)return typeof e=="function"?e:()=>e},mI=(e={})=>({apiKey:e.apiKey??Cm("KUBIT_OTEL_API_KEY")??"",endpoint:e.endpoint??Cm("KUBIT_OTEL_ENDPOINT")??VL,serviceName:e.serviceName??Cm("KUBIT_SERVICE_NAME"),serviceVersion:e.serviceVersion,debug:e.debug??!1,getSessionId:KL(e.sessionId)});var _I=async(e,t)=>{let n;try{let o=JSON.stringify(e),i={method:"POST",headers:{"Content-Type":"application/json","x-api-key":t.apiKey},body:o};typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"&&(i.signal=AbortSignal.timeout(1e4)),typeof document<"u"&&o.length<6e4&&(i.keepalive=!0),n=await fetch(t.endpoint,i)}catch(o){return{ok:!1,status:0,message:o instanceof Error?o.message:"unknown network error"}}if(n.ok){let o=null;try{o=await n.json()}catch{return{ok:!0,status:n.status}}let i=o?.partial_success?.rejected_spans,s=typeof i=="string"?Number(i):i;return typeof s=="number"&&s>0?{ok:!0,status:n.status,rejectedSpans:s,message:o?.partial_success?.error_message}:{ok:!0,status:n.status}}let r=`HTTP ${n.status}`;try{let o=await n.text();o.length>0&&(r=o.length>200?`${o.slice(0,200)}\u2026`:o)}catch{}return{ok:!1,status:n.status,message:r}};var JL="kubit.sentry",XL="0.1.0";var QL=new Set(["cancelled","unknown","unknown_error","invalid_argument","deadline_exceeded","not_found","already_exists","permission_denied","resource_exhausted","failed_precondition","aborted","out_of_range","unimplemented","internal_error","unavailable","data_loss","unauthenticated"]),gI=e=>e==="ok"?1:e!==void 0&&QL.has(e)?2:0,Ta=e=>{if(typeof e!="number"||!Number.isFinite(e)||e<0)return"0";let t=Math.floor(e),n=Math.round((e-t)*1e9);return n>=1e9&&(t+=1,n=0),t===0?n.toString():`${t}${n.toString().padStart(9,"0")}`},xm=e=>{if(typeof e=="string")return{stringValue:e};if(typeof e=="boolean")return{boolValue:e};if(typeof e=="number")return Number.isInteger(e)?{intValue:Math.trunc(e).toString()}:{doubleValue:e};if(Array.isArray(e))return{arrayValue:{values:e.map(xm).filter(n=>n!==null)}};if(e==null)return null;if(typeof e=="object"){let t=[];for(let[n,r]of Object.entries(e)){let o=xm(r);o!==null&&t.push({key:n,value:o})}return{kvlistValue:{values:t}}}try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:"[uncoercible]"}}},Fl=e=>{if(!e)return[];let t=[];for(let[n,r]of Object.entries(e)){let o=xm(r);o!==null&&t.push({key:n,value:o})}return t},xe=(e,t)=>typeof t=="string"&&t.length>0?[{key:e,value:{stringValue:t}}]:[],ZL=(e,t)=>{let n=e.contexts?.browser,r=e.contexts?.os,o=e.contexts?.device;return[...xe("service.name",t.serviceName??"sentry-app"),...xe("service.version",t.serviceVersion??e.release),...xe("deployment.environment",e.environment),...xe("telemetry.sdk.name",e.sdk?.name),...xe("telemetry.sdk.version",e.sdk?.version),...xe("telemetry.sdk.language",e.platform),...xe("browser.name",n?.name),...xe("browser.version",n?.version),...xe("os.name",r?.name),...xe("os.version",r?.version),...xe("device.model.name",o?.model),...xe("device.manufacturer",o?.brand),...xe("device.model.identifier",o?.family)]},eP=e=>{if(typeof e=="string")return e.length>0?e:void 0;if(typeof e=="number"||typeof e=="bigint")return String(e)},tP=(e,t)=>[...xe("session.id",t),...xe("user.id",eP(e.user?.id)),...xe("user.name",e.user?.username),...xe("user.email",e.user?.email)],nP=(e,t)=>t.length===0?e:e.map(n=>({...n,attributes:[...n.attributes,...t]})),km=(e,t,n,r)=>({resourceSpans:[{resource:{attributes:ZL(t,n)},scopeSpans:[{scope:{name:JL,version:XL},spans:nP(e,tP(t,r))}]}]}),rP=(e,t,n)=>{let r=e.contexts?.trace,o=[];r?.trace_id&&r.span_id&&o.push({traceId:r.trace_id,spanId:r.span_id,parentSpanId:r.parent_span_id,name:e.transaction??r.op??"transaction",kind:1,startTimeUnixNano:Ta(e.start_timestamp),endTimeUnixNano:Ta(e.timestamp),attributes:[...Fl(r.data),...xe("sentry.op",r.op),...xe("sentry.source",e.transaction_info?.source)],status:{code:gI(r.status)}});for(let i of e.spans??[])o.push({traceId:i.trace_id,spanId:i.span_id,parentSpanId:i.parent_span_id,name:i.description??i.op??"span",kind:1,startTimeUnixNano:Ta(i.start_timestamp),endTimeUnixNano:Ta(i.timestamp),attributes:[...Fl(i.data),...xe("sentry.op",i.op)],status:{code:gI(i.status)}});return km(o,e,t,n)},oP=e=>e.map(t=>` at ${t.function??"<anonymous>"} (${t.filename??"?"}:${t.lineno??0}:${t.colno??0})`).join(`
|
|
500
|
+
`),iP=(e,t,n)=>{let r=e.contexts?.trace,o=r?.trace_id??e.event_id;if(!o)return km([],e,t,n);let i=e.event_id?.slice(0,16)??o.slice(0,16),s=r?.span_id,a=Ta(e.timestamp),c=e.exception?.values??[],u=c.length>0?c[c.length-1]:void 0,p=c.map(d=>{let f=[...xe("exception.type",d.type),...xe("exception.message",d.value)],m=d.stacktrace?.frames;return m&&m.length>0&&f.push({key:"exception.stacktrace",value:{stringValue:oP(m)}}),d.mechanism?.handled!==void 0&&f.push({key:"exception.escaped",value:{boolValue:!d.mechanism?.handled}}),{timeUnixNano:a,name:"exception",attributes:f}}),l={traceId:o,spanId:i,parentSpanId:s,name:e.transaction??u?.type??"error",kind:1,startTimeUnixNano:a,endTimeUnixNano:a,attributes:[...Fl(e.tags),...Fl(e.extra),...xe("sentry.level",e.level),...xe("exception.type",u?.type),...xe("exception.message",u?.value)],events:p,status:{code:2,message:u?.value}};return km([l],e,t,n)},sP=e=>e.type==="transaction",hI=(e,t,n)=>sP(e)?rP(e,t,n):iP(e,t,n);var aP="KubitSentry",cP=(e,t)=>{if(!t.apiKey||e.type!==void 0&&e.type!=="transaction")return;let n=t.getSessionId?.(),r;try{r=hI(e,t,n)}catch{return}(r.resourceSpans[0]?.scopeSpans[0]?.spans.length??0)!==0&&_I(r,t).then(o=>{if(!t.debug)return;let i=r.resourceSpans[0]?.scopeSpans[0]?.spans??[],s=i.map(a=>a.name);o.ok?console.info(`[kubit-sentry] sent ${i.length} span(s) \u2192 ${t.endpoint} [${o.status}]`,s):console.warn(`[kubit-sentry] export failed: ${o.status} ${o.message??""}`,s)}).catch(()=>{})},Hl=(e={})=>{let t=mI(e);return{name:aP,setup(n){n.on("afterSendEvent",r=>{cP(r,t)})}}};var uP="kubit-session",lP=()=>{try{if(typeof localStorage<"u")return localStorage}catch{}return null},pP=()=>{try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`sess-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},fP=e=>{try{let t=typeof e=="function"?e():e;return typeof t=="string"?t:""}catch{return""}},dP=(e,t,n)=>e!==null&&e.id.length>0&&t-e.start<n,Gl=(e={})=>{let t=e.windowMs??18e5,n=e.storageKey??uP,r=e.generateId??pP,o=e.now??(()=>Date.now()),i=e.storage===void 0?lP():e.storage,s=null,a=()=>{if(s)return s;if(!i)return null;try{let u=i.getItem(n);if(!u)return null;let p=JSON.parse(u);if(p&&typeof p.id=="string"&&typeof p.start=="number")return{id:p.id,start:p.start}}catch{}return null},c=u=>{if(s=u,!!i)try{i.setItem(n,JSON.stringify(u))}catch{}};return()=>{let u=o(),p=a();if(dP(p,u,t))return s=p,p.id;let l=p===null&&e.initialId!==void 0?fP(e.initialId):"",d=l.length>0?l:r();return c({id:d,start:u}),d}};var SI=!1,mP=(e={})=>{let{dsn:t,environment:n,release:r,tracesSampleRate:o=1,apiKey:i,endpoint:s,serviceName:a,serviceVersion:c,debug:u,sessionId:p}=e;return Yu({dsn:t,environment:n,release:r,tracesSampleRate:o,integrations:[wl(),Hl({apiKey:i,endpoint:s,serviceName:a,serviceVersion:c??r,debug:u,sessionId:p??Gl()})]}),SI=!0,Bl},_P=(e,t={})=>{if(!SI){console.warn("[kubit-sentry] trackEvent called before init()");return}Ue({name:e,op:"ui.action",forceTransaction:!0,attributes:t},()=>{})};return AI(gP);})();
|
|
501
|
+
/*! Bundled license information:
|
|
502
|
+
|
|
503
|
+
@sentry/core/build/esm/utils/env.js:
|
|
504
|
+
(*! __SENTRY_SDK_SOURCE__ *)
|
|
505
|
+
*/
|