@error-reporting/browser 0.0.0-stage → 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/README.md +31 -2
- package/dist/error-reporting.js +20 -0
- package/index.d.ts +6 -0
- package/package.json +15 -4
- package/src/index.js +31 -0
package/README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @error-reporting/browser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
原生 JavaScript 网页的异常上报 SDK。自动捕获未处理的 JavaScript 异常和 Promise rejection,也支持手动补报。
|
|
4
|
+
|
|
5
|
+
在异常工作台创建项目,填入网页实际的 Origin,并在「接入配置」复制 web DSN。HTTPS 网页应使用 HTTPS DSN。
|
|
6
|
+
|
|
7
|
+
## npm
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @error-reporting/browser
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { init, captureException } from '@error-reporting/browser'
|
|
15
|
+
|
|
16
|
+
init({ dsn: '粘贴 web DSN', environment: 'production' })
|
|
17
|
+
captureException(new Error('上报接入测试'))
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 普通 HTML
|
|
21
|
+
|
|
22
|
+
从 npm 包中复制 `dist/error-reporting.js` 到静态站点,再在业务脚本之前加载。也可以从 npm CDN 引用固定版本。
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/@error-reporting/browser@0.1.0/dist/error-reporting.js"></script>
|
|
26
|
+
<script>
|
|
27
|
+
ErrorReporting.init({ dsn: '粘贴 web DSN', environment: 'production' });
|
|
28
|
+
ErrorReporting.captureException(new Error('上报接入测试'));
|
|
29
|
+
</script>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
初始化一次即可,生产页面移除测试异常。若需等待发送队列,可调用 `flush(timeout)`,超时返回 `false`。
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";var ErrorReporting=(()=>{var Kt=Object.defineProperty;var Na=Object.getOwnPropertyDescriptor;var Ca=Object.getOwnPropertyNames;var La=Object.prototype.hasOwnProperty;var Pa=(e,t)=>{for(var i in t)Kt(e,i,{get:t[i],enumerable:!0})},Da=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ca(t))!La.call(e,n)&&n!==i&&Kt(e,n,{get:()=>t[n],enumerable:!(r=Na(t,n))||r.enumerable});return e};var Ma=e=>Da(Kt({},"__esModule",{value:!0}),e);var wc={};Pa(wc,{captureException:()=>Ac,flush:()=>Oc,init:()=>Ic});var u=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var b=globalThis;var se="11.17.0";function K(){return ee(b),b}function ee(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||"11.17.0",t[se]=t["11.17.0"]||{}}function de(e,t,i=b){let r=i.__SENTRY__=i.__SENTRY__||{},n=r[se]=r["11.17.0"]||{};return n[e]||(n[e]=t())}var Fe=["debug","info","warn","error","log","assert","trace"],Ua="Sentry Logger ",we={};function C(e){if(!("console"in b))return e();let t=b.console,i={},r=Object.keys(we);r.forEach(n=>{let s=we[n];i[n]=t[n],t[n]=s});try{return e()}finally{r.forEach(n=>{t[n]=i[n]})}}function qa(){Vt().enabled=!0}function Ba(){Vt().enabled=!1}function Sr(){return Vt().enabled}function Ga(...e){Wt("log",...e)}function Fa(...e){Wt("warn",...e)}function Ha(...e){Wt("error",...e)}function Wt(e,...t){u&&Sr()&&C(()=>{b.console[e](`${Ua}[${e}]:`,...t)})}function Vt(){return u?de("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var d={enable:qa,disable:Ba,isEnabled:Sr,log:Ga,warn:Fa,error:Ha};var kr=/\(error: (.*)\)/,Er=/captureMessage|captureException/;function gt(...e){let t=e.sort((i,r)=>i[0]-r[0]).map(i=>i[1]);return(i,r=0,n=0)=>{let s=[],a=i.split(`
|
|
2
|
+
`);for(let o=r;o<a.length;o++){let l=a[o];l.length>1024&&(l=l.slice(0,1024));let p=kr.test(l)?l.replace(kr,"$1"):l;if(!p.includes("Error: ")){for(let c of t){let g=c(p);if(g){s.push(g);break}}if(s.length>=50+n)break}}return Tr(s.slice(n))}}function $t(e){return Array.isArray(e)?gt(...e):e}function Tr(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(mt(t).function||"")&&t.pop(),t.reverse(),Er.test(mt(t).function||"")&&(t.pop(),Er.test(mt(t).function||"")&&t.pop()),t.slice(0,50).map(i=>({...i,filename:i.filename||mt(t).filename,function:i.function||"?"}))}function mt(e){return e[e.length-1]||{}}var Qt="<anonymous>";function G(e){try{return!e||typeof e!="function"?Qt:e.name||Qt}catch{return Qt}}function bt(e){let t=e.exception;if(t){let i=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&i.push(...r.stacktrace.frames)}),i}catch{return}}}var He={},Ir={};function L(e,t){return He[e]=He[e]||[],He[e].push(t),()=>{let i=He[e];if(i){let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}}function P(e,t){if(!Ir[e]){Ir[e]=!0;try{t()}catch(i){u&&d.error(`Error while instrumenting ${e}`,i)}}}function E(e,t){let i=e&&He[e];if(i)for(let r of i)try{r(t)}catch(n){u&&d.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${G(r)}
|
|
5
|
+
Error:`,n)}}var Jt=null;function Xt(e){let t="error";L(t,e),P(t,za)}function za(){Jt=b.onerror,b.onerror=function(e,t,i,r,n){return E("error",{column:r,error:n,line:i,msg:e,url:t}),Jt?Jt.apply(this,arguments):!1},b.onerror.__SENTRY_INSTRUMENTED__=!0}var Zt=null;function ei(e){let t="unhandledrejection";L(t,e),P(t,Ya)}function Ya(){Zt=b.onunhandledrejection,b.onunhandledrejection=function(e){return E("unhandledrejection",e),Zt?Zt.apply(this,arguments):!0},b.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Ar=Object.prototype.toString;function x(e){switch(Ar.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return _t(e,Error)}}function xe(e,t){return Ar.call(e)===`[object ${t}]`}function ze(e){return xe(e,"ErrorEvent")}function yt(e){return xe(e,"DOMError")}function ti(e){return xe(e,"DOMException")}function D(e){return xe(e,"String")}function ue(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function q(e){return e===null||ue(e)||typeof e!="object"&&typeof e!="function"}function z(e){return xe(e,"Object")}function ae(e){return typeof e=="object"&&e!==null}function me(e){return typeof Event<"u"&&_t(e,Event)}function ii(e){return xe(e,"RegExp")}function W(e){return!!(e?.then&&typeof e.then=="function")}function _t(e,t){try{return e instanceof t}catch{return!1}}function ri(e){return typeof Request<"u"&&_t(e,Request)}function T(e,t,i){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let n=i(r);typeof n=="function"&&ft(n,r);try{e[t]=n}catch{u&&d.log(`Failed to replace method "${String(t)}" in object`,e)}}function U(e,t,i){try{Object.defineProperty(e,t,{value:i,writable:!0,configurable:!0})}catch{u&&d.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function ft(e,t){try{e.prototype=t.prototype=t.prototype||{},U(e,"__sentry_original__",t)}catch{}}function ge(e){return e.__sentry_original__}function ht(e){if(x(e))return{message:e.message,name:e.name,stack:e.stack,...Or(e)};if(me(e)){let{type:t,target:i,currentTarget:r,detail:n}=e;return{type:t,target:i,currentTarget:r,...n?{detail:n}:{},...Or(e)}}return e}function Or(e){return ae(e)?Object.fromEntries(Object.entries(e)):{}}function ni(e){let t=Object.keys(ht(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Re;function be(e){if(Re!==void 0)return Re?Re(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),i=b;return t in i&&typeof i[t]=="function"?(Re=i[t],Re(e)):(Re=null,e())}function Ne(){return be(()=>Math.random())}function Y(){return be(()=>Date.now())}var ja=Symbol.for("sentry.skipNormalization"),Ka=Symbol.for("sentry.overrideNormalizationDepth");function wr(e){return!!e[ja]}function xr(e){let t=e[Ka];return typeof t=="number"?t:void 0}var si;function oi(e){si=e}function F(e,t=100,i=1/0){try{return ai("",e,t,i)}catch(r){return{ERROR:`**non-serializable** (${Rr(r)})`}}}function Rr(e){try{return String(e)}catch{return"unknown error"}}function Ye(e,t=3,i=102400){let r=F(e,t);return Qa(r)>i?Ye(e,t-1,i):r}function ai(e,t,i=1/0,r=1/0,n=$a()){let[s,a]=n;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let o=je(e,t);if(!o.startsWith("[object "))return o;if(wr(t))return t;let l=xr(t),p=l!==void 0?l:i;if(p===0)return o.replace("object ","");if(s(t))return"[Circular ~]";let c=t;if(c&&typeof c.toJSON=="function")try{return ai("",c.toJSON(),p-1,r,n)}catch{}let g=Array.isArray(t)?[]:{},m=0,f=ht(t);for(let k in f){if(!Object.prototype.hasOwnProperty.call(f,k))continue;if(m>=r){g[k]="[MaxProperties ~]";break}let j=f[k];g[k]=ai(k,j,p-1,r,n),m++}return a(t),g}function je(e,t){try{if(si){let i=si(t);if(i)return i}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${G(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${Wa(t)}]`}catch(i){return`**non-serializable** (${Rr(i)})`}}function Wa(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function Va(e){return~-encodeURI(e).split(/%..|./).length}function Qa(e){return Va(JSON.stringify(e))}function $a(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function i(r){e.delete(r)}return[t,i]}function Nr(e,t="[unserializable]"){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return typeof t=="function"?t(e):t}}function Ke(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Cr(e,t){if(!Array.isArray(e))return"";let i=[];for(let r=0;r<e.length;r++){let n=e[r];q(n)?i.push(String(n)):n instanceof Error?i.push(n.message?`${n.name}: ${n.message}`:n.name):i.push(je(void 0,n))}return i.join(t)}function Ce(e,t,i=!1){return D(e)?ii(t)?t.test(e):D(t)?i?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function ye(e,t=[],i=!1){for(let r of t)if(Ce(e,r,i))return!0;return!1}function Ja(){let e=b;return e.crypto||e.msCrypto}var li;function Xa(){return Ne()*16}function I(e=Ja()){try{if(e?.randomUUID)return be(()=>e.randomUUID()).replace(/-/g,"")}catch{}return li||(li="10000000100040008000100000000000"),li.replace(/[018]/g,t=>(t^(Xa()&15)>>t/4).toString(16))}function Lr(e){return e.exception?.values?.[0]}function V(e){let{message:t,event_id:i}=e;if(t)return t;let r=Lr(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||i||"<unknown>":i||"<unknown>"}function Le(e,t,i){let r=e.exception=e.exception||{},n=r.values=r.values||[],s=n[0]=n[0]||{};s.value||(s.value=t||""),s.type||(s.type=i||"Error")}function te(e,t){let i=Lr(e);i&&Dr(i,t)}function Pr(e,t){let i=e.exception?.values,r=i?.find(n=>n.mechanism?.exception_id===0)??i?.[0];r&&Dr(r,t)}function Dr(e,t){let i={type:"generic",handled:!0},r=e.mechanism;e.mechanism={...i,...r,...t},t&&"data"in t&&(e.mechanism.data={...r?.data,...t.data})}function vt(e){if(Mr(e))return!0;try{U(e,"__sentry_captured__",!0)}catch{}return!1}function Mr(e){try{return e.__sentry_captured__}catch{}}var qr=1e3,Za=1e3,eo=100;function Q(){return Y()/qr}var Pe=[];function to(){let{performance:e}=b;if(!e?.now||!e.timeOrigin)return e?.now&&(Pe=[{from:0,origin:Y()-be(()=>e.now())}]),Q;let t=e.timeOrigin;Pe=[{from:0,origin:t}];let i=!0,r=0;return()=>be(()=>{let n=e.now(),s=Date.now();return Math.abs(t+n-s)>Za&&(t=s-n,i?Pe=[{from:0,origin:t}]:(Pe.push({from:r,origin:t}),Pe.length>eo&&Pe.splice(1,1))),i=!1,r=n,(t+n)/qr})}var Ur;function R(){return(Ur??(Ur=to()))()}function Br(e){let t=R(),i={sid:I(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>io(i)};return e&&ie(i,e),i}function ie(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||R(),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:I()),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 i=e.timestamp-e.started;e.duration=i>=0?i: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 Gr(e,t){let i={};t?i={status:t}:e.status==="ok"&&(i={status:"exited"}),ie(e,i)}function io(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 oe(e,t,i=2){if(!t||typeof t!="object"||i<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=oe(r[n],t[n],i-1));return r}function Fr(){return I()}function St(){return I().substring(16)}var ro=100,B=class pi{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},U(this,"refs",{}),this._propagationContext={traceId:Fr(),sampleRand:Ne()}}clone(){let t=new pi;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,t.refs={...this.refs},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&&ie(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,i){return this.setTags({[t]:i})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,i){return this.setAttributes({[t]:i})}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,i){return this._extra={...this._extra,[t]:i},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,i){return i===null?delete this._contexts[t]:this._contexts[t]=i,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 i=typeof t=="function"?t(this):t,{tags:r,attributes:n,extra:s,user:a,contexts:o,level:l,fingerprint:p=[],propagationContext:c,conversationId:g}=(i instanceof pi?i.getScopeData():z(i)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...n},this._extra={...this._extra,...s},this._contexts={...this._contexts,...o},a&&Object.keys(a).length&&(this._user=a),l&&(this._level=l),p.length&&(this._fingerprint=p),c&&(this._propagationContext=c),g&&(this._conversationId=g),this}addBreadcrumb(t,i){let r=typeof i=="number"?i:ro;if(r<=0)return this;let n={timestamp:Q(),...t,message:t.message?Ke(t.message,2048):t.message};return this._breadcrumbs.push(n),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r)),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,conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=oe(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,i){let r=i?.event_id||I();if(!this._client)return u&&d.warn("No client configured on scope - will not capture exception!"),r;let n=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:n,...i,event_id:r},this),r}captureMessage(t,i,r){let n=r?.event_id||I();if(!this._client)return u&&d.warn("No client configured on scope - will not capture message!"),n;let s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,i,{originalException:t,syntheticException:s,...r,event_id:n},this),n}captureEvent(t,i){let r=t.event_id||i?.event_id||I();return this._client?(this._client.captureEvent(t,{...i,event_id:r},this),r):(u&&d.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 Hr(){return de("defaultCurrentScope",()=>new B)}function zr(){return de("defaultIsolationScope",()=>new B)}var ci="__SENTRY_SUPPRESS_TRACING__";var Yr=e=>e instanceof Promise&&!e[jr],jr=Symbol("chained PromiseLike"),Kr=(e,t,i)=>{let r=e.then(n=>(t(n),n),n=>{throw i(n),n});return Yr(r)&&Yr(e)?r:no(e,r)},no=(e,t)=>{if(!t)return e;let i=!1;for(let r in e){if(r in t)continue;i=!0;let n=e[r];typeof n=="function"?Object.defineProperty(t,r,{value:(...s)=>n.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=n}return i&&Object.assign(t,{[jr]:!0}),t};var so=class{constructor(e,t){let i;e?i=e:i=new B;let r;t?r=t:r=new B,this._stack=[{scope:i}],this._isolationScope=r}withScope(e){let t=this._pushScope(),i;try{i=e(t)}catch(r){throw this._popScope(),r}return W(i)?Kr(i,()=>this._popScope(),()=>this._popScope()):(this._popScope(),i)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function De(){let e=K(),t=ee(e);return t.stack=t.stack||new so(Hr(),zr())}function Vr(e){return De().withScope(e)}function ao(e,t){let i=De();return i.withScope(()=>(i.getStackTop().scope=e,t(e)))}function Wr(e){return De().withScope(()=>e(De().getIsolationScope()))}function Qr(){return{suppressTracing:oo,withIsolationScope:Wr,withScope:Vr,withSetScope:ao,withSetIsolationScope:(e,t)=>Wr(t),getCurrentScope:()=>De().getScope(),getIsolationScope:()=>De().getIsolationScope()}}function oo(e){return Vr(t=>{t.setSDKProcessingMetadata({[ci]:!0});let i=e();return t.setSDKProcessingMetadata({[ci]:void 0}),i})}function Me(e){let t=ee(e);return t.acs?t.acs:Qr()}function lo(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function po(e,t){let{value:i,unit:r}=lo(e)?e:{value:e,unit:void 0},n=co(i),s=r&&typeof r=="string"?{unit:r}:{};if(n)return{...n,...s};if(!t||t==="skip-undefined"&&i===void 0)return;let a="";try{a=JSON.stringify(i)??""}catch{}return{value:a,type:"string",...s}}function di(e,t=!1){let i={};for(let[r,n]of Object.entries(e??{})){let s=po(n,t);s&&(i[r]=s)}return i}function co(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}}function kt(){return ee(K()).externalPropagationContextProvider?.()}function O(){let e=K();return Me(e).getCurrentScope()}function M(){let e=K();return Me(e).getIsolationScope()}function We(){return de("globalScope",()=>new B)}function Ve(...e){let t=K(),i=Me(t);if(e.length===2){let[r,n]=e;return r?i.withSetScope(r,n):i.withScope(n)}return i.withScope(e[0])}function _(){return O().getClient()}function Qe(e){let t=kt();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:i,parentSpanId:r,propagationSpanId:n}=e.getPropagationContext(),s={trace_id:i,span_id:n||St()};return r&&(s.parent_span_id=r),s}var $r=["ok","deadline_exceeded","unauthenticated","permission_denied","not_found","resource_exhausted","invalid_argument","unimplemented","unavailable","internal_error","unknown_error","cancelled","already_exists","failed_precondition","aborted","out_of_range","data_loss"];var Jr="culture.calendar";var Xr="culture.locale",Zr="culture.timezone";var en="gen_ai.conversation.id";var tn="http.request.header";var ui="sentry.exclusive_time";var rn="sentry.is_localhost";var Et="sentry.op",nn="sentry.origin";var mi="sentry.profile_id";var gi="sentry.segment.name.source";var sn="url.full";var an="user_agent.original";function on(e){return e!=="ok"&&$r.includes(e)}function Tt(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var mo="_sentryScope",go="_sentryIsolationScope";function $e(e){let t=e;return{scope:t[mo],isolationScope:Tt(t[go])}}function pn(e){let t=bo(e);if(!t)return;let i=Object.entries(t).reduce((r,[n,s])=>{if(n.startsWith("sentry-")){let a=n.slice(7);r[a]=s}return r},{});if(Object.keys(i).length>0)return i}function bo(e){if(!(!e||!D(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,i)=>{let r=ln(i);return Object.entries(r).forEach(([n,s])=>{t[n]=s}),t},{}):ln(e)}function ln(e){return e.split(",").map(t=>{let i=t.indexOf("=");return i===-1?[]:[t.slice(0,i),t.slice(i+1)].map(r=>{try{return decodeURIComponent(r.trim())}catch{return}})}).reduce((t,[i,r])=>(i&&r&&(t[i]=r),t),{})}var yo=/^o(\d+)\./,_o=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function fo(e){return e==="http"||e==="https"}function re(e,t=!1){let{host:i,path:r,pass:n,port:s,projectId:a,protocol:o,publicKey:l}=e;return`${o}://${l}${t&&n?`:${n}`:""}@${i}${s?`:${s}`:""}/${r&&`${r}/`}${a}`}function cn(e){let t=_o.exec(e);if(!t){C(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[i,r,n="",s="",a="",o=""]=t.slice(1),l="",p=o,c=p.split("/");if(c.length>1&&(l=c.slice(0,-1).join("/"),p=c.pop()),p){let g=p.match(/^\d+/);g&&(p=g[0])}return dn({host:s,pass:n,path:l,projectId:p,port:a,protocol:i,publicKey:r})}function dn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ho(e){if(!u)return!0;let{port:t,projectId:i,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(n=>e[n]?!1:(d.error(`Invalid Sentry Dsn: ${n} missing`),!0))?!1:i.match(/^\d+$/)?fo(r)?t&&isNaN(parseInt(t,10))?(d.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(d.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(d.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),!1)}function vo(e){return e.match(yo)?.[1]}function un(e){let t=e.getOptions(),{host:i}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):i&&(r=vo(i)),r}function _e(e){let t=typeof e=="string"?cn(e):dn(e);if(!(!t||!ho(t)))return t}function mn(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 So="span";function gn(e){return Tt(e.refs[So])}function _n(e){let{spanId:t,traceId:i,isRemote:r}=e.spanContext(),n=r?t:ne(e).parent_span_id,s=$e(e).scope;return{parent_span_id:n,span_id:r?s?.getPropagationContext().propagationSpanId||St():t,trace_id:i}}function Eo(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:i,traceFlags:r,...n},attributes:s})=>({span_id:t,trace_id:i,sampled:r===1,attributes:s,...n}))}function bn(e){return typeof e=="number"?yn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?yn(e.getTime()):R()}function yn(e){return e>9999999999?e/1e3:e}function ne(e){if(Ao(e))return e.getStaticSpanJSON();let{spanId:t,traceId:i}=e.spanContext();if(Io(e)){let{attributes:r,startTime:n,name:s,endTime:a,status:o,links:l}=e;return{span_id:t,trace_id:i,data:r,description:s,parent_span_id:To(e),start_timestamp:bn(n),timestamp:bn(a)||void 0,status:Oo(o),op:r[Et],origin:r[nn],links:Eo(l)}}return{span_id:t,trace_id:i,start_timestamp:0,status:"ok",data:{}}}function To(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function fn(e){return{...e,end_timestamp:e.end_timestamp??e.start_timestamp,attributes:di(e.attributes),links:e.links?.map(t=>({...t,attributes:di(t.attributes)}))}}function Io(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Ao(e){return typeof e.getSpanJSON=="function"}function hn(e){let{traceFlags:t}=e.spanContext();return t===1}function Oo(e){return!e||e.code===0||e.code===1?"ok":e.message&&on(e.message)?e.message:"internal_error"}var wo="_sentryRootSpan";var It=xo;function xo(e){return e[wo]||e}function vn(e){let t=K(),i=Me(t);return i.getActiveSpan?i.getActiveSpan(e):gn(e||O())}function bi(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||_()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Sn(e){d.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yi(e,t){if(!t?.length)return!1;for(let i of t){if(No(i)){if(e.description&&Ce(e.description,i))return u&&Sn(e),!0;continue}let r=!!i.attributes&&Object.keys(i.attributes).length>0;if(!i.name&&!i.op&&!r)continue;let n=i.name?e.description&&Ce(e.description,i.name):!0,s=i.op?e.op&&Ce(e.op,i.op):!0,a=i.attributes?Object.entries(i.attributes).every(([o,l])=>Ro(e.attributes?.[o],l)):!0;if(n&&s&&a)return u&&Sn(e),!0}return!1}function Ro(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?Ce(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,r)=>i===t[r]):e===t}function kn(e,t){let i=t.parent_span_id,r=t.span_id;if(i)for(let n of e)n.parent_span_id===r&&(n.parent_span_id=i)}function No(e){return typeof e=="string"||e instanceof RegExp}var _i=[];function Co(e){let t={};return e.forEach(i=>{let{name:r}=i,n=t[r];n&&!n.isDefaultInstance&&i.isDefaultInstance||(t[r]=i)}),Object.values(t)}function fi(e){let t=e.defaultIntegrations||[],i=e.integrations;t.forEach(n=>{n.isDefaultInstance=!0});let r;if(Array.isArray(i))r=[...t,...i];else if(typeof i=="function"){let n=i(t);r=Array.isArray(n)?n:[n]}else r=t;return Co(r)}function En(e,t){let i={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&vi(e,r,i)}),i}function hi(e,t){for(let i of t)i?.afterAllSetup&&i.afterAllSetup(e)}function vi(e,t,i){if(i[t.name]){u&&d.log(`Integration skipped because it was already installed: ${t.name}`);return}if(i[t.name]=t,!_i.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),_i.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",(n,s)=>r(n,s,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),n=Object.assign((s,a)=>r(s,a,e),{id:t.name});e.addEventProcessor(n)}["processSpan","processSegmentSpan"].forEach(r=>{let n=t[r];typeof n=="function"&&e.on(r,s=>n.call(t,s,e))}),u&&d.log(`Integration installed: ${t.name}`)}function S(e){return(...t)=>{let i=z(t[0])?{...t[0]}:t[0],r=e(...t);return r._options=i,r}}var Tn="production";var Lo=Symbol.for("sentry.nonRecordingSpan");function In(e){return!!e&&e[Lo]===!0}var Po="_frozenDsc";function An(e,t){let i=t.getOptions(),{publicKey:r}=t.getDsn()||{},n={environment:i.environment||"production",release:i.release,public_key:r,trace_id:e,org_id:un(t)};return t.emit("createDsc",n),n}function Si(e,t){if(kt())return;let i=t.getPropagationContext();return i.dsc||An(i.traceId,e)}function On(e){let t=_();if(!t)return{};let i=It(e),r=ne(i),n=r.data,s=i.spanContext().traceState,a=s?.get("sentry.sample_rate")??n["sentry.sample_rate"]??n["sentry.previous_trace_sample_rate"];function o(h){return(typeof a=="number"||typeof a=="string")&&(h.sample_rate=`${a}`),h}let l=i[Po];if(l)return o(l);let p=In(i),c=p&&i.dropReason==="ignored";if(p&&(!bi(t.getOptions())||c)){let h=$e(i).scope,N=h&&Si(t,h);if(N){let A={...N};return c&&(A.sampled="false"),o(A)}}let g=s?.get("sentry.dsc"),m=g&&pn(g);if(m)return o(m);let f=An(e.spanContext().traceId,t),k=n[gi],j=r.description;if(k!=="url"&&j&&(f.transaction=j),bi()){let h=$e(i).scope?.getPropagationContext(),N=hn(i);f.sampled=String(N),f.sample_rand=s?.get("sentry.sample_rand")??h?.sampleRand.toString(),a==null&&typeof h?.sampled=="boolean"&&(f.sample_rate=N?"1":"0")}return o(f),t.emit("createDsc",f,i),f}function xn(e,t){let{fingerprint:i,breadcrumbs:r,sdkProcessingMetadata:n}=t;Do(e,t),qo(e,i),Mo(e,r),Uo(e,n)}function wn(e,t){let{extra:i,tags:r,attributes:n,user:s,contexts:a,level:o,sdkProcessingMetadata:l,breadcrumbs:p,fingerprint:c,eventProcessors:g,attachments:m,propagationContext:f,transactionName:k}=t;Je(e,"extra",i),Je(e,"tags",r),Je(e,"attributes",n),Je(e,"user",s),Je(e,"contexts",a),e.sdkProcessingMetadata=oe(e.sdkProcessingMetadata,l,2),o&&(e.level=o),k&&(e.transactionName=k),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),c.length&&(e.fingerprint=[...e.fingerprint,...c]),g.length&&(e.eventProcessors=[...e.eventProcessors,...g]),m.length&&(e.attachments=[...e.attachments,...m]),e.propagationContext={...e.propagationContext,...f}}function Je(e,t,i){e[t]=oe(e[t],i,1)}function At(e,t){let i=We().getScopeData();return e&&wn(i,e.getScopeData()),t&&wn(i,t.getScopeData()),i}function Do(e,t){let{extra:i,tags:r,user:n,contexts:s,level:a,transactionName:o}=t;Object.keys(i).length&&(e.extra={...i,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(n).length&&(e.user={...n,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),a&&(e.level=a),o&&e.type!=="transaction"&&(e.transaction=o)}function Mo(e,t){let i=[...e.breadcrumbs||[],...t];e.breadcrumbs=i.length?i:void 0}function Uo(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Rn(e,t){e.contexts={trace:_n(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:On(t),...e.sdkProcessingMetadata};let i=It(t),r=ne(i).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function qo(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function $(e,t,i){let r;try{r=t()}catch(n){return Nn(e,n,i)}return W(r)?r.then(void 0,n=>Nn(e,n,i)):r}function Nn(e,t,i){return u&&d.error(e,t),i(t)}function ki(e){return!!e&&typeof e=="function"&&"_static"in e&&!!e._static}function Ei(e,t){return $(u?"The `beforeSendSpan` callback threw an error, sending the span unmodified:":"",()=>t(e),()=>e)||e}function Cn(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,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...e.data},links:e.links};return fn(t)}function Xe(e,t){let i=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,n])=>{n!=null&&!(r in i)&&(i[r]=n)})}function Ln(e){return e.getOptions().traceLifecycle==="stream"}function Pn(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}function fe(e,t=[]){return[e,t]}function Ii(e,t){let[i,r]=e;return[i,[...r,t]]}function Ot(e,t){let i=e[1];for(let r of i){let n=r[0].type;if(t(r,n))return!0}return!1}function Dn(e,t){return Ot(e,(i,r)=>t.includes(r))}function Ti(e){let t=ee(b);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Mn(e){let[t,i]=e,r=JSON.stringify(t);function n(s){typeof r=="string"?r=typeof s=="string"?r+s:[Ti(r),s]:r.push(typeof s=="string"?Ti(s):s)}for(let s of i){let[a,o]=s;if(n(`
|
|
6
|
+
${JSON.stringify(a)}
|
|
7
|
+
`),typeof o=="string"||o instanceof Uint8Array)n(o);else{let l;try{l=JSON.stringify(o)}catch{l=JSON.stringify(F(o))}n(l)}}return typeof r=="string"?r:Bo(r)}function Bo(e){let t=e.reduce((n,s)=>n+s.length,0),i=new Uint8Array(t),r=0;for(let n of e)i.set(n,r),r+=n.length;return i}function Un(e){let t=typeof e.data=="string"?Ti(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var qn={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",metric:"trace_metric"};function Go(e){return e in qn}function Ai(e){return Go(e)?qn[e]:e}function Oi(e){if(!e?.sdk)return;let{name:t,version:i}=e.sdk;return{name:t,version:i}}function Bn(e,t,i,r){let n=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(Y()).toISOString(),...t&&{sdk:t},...!!i&&r&&{dsn:re(r)},...n&&{trace:n}}}function Ze(e){return e==="replay_event"?"replay":e||"error"}function wi(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function xi(){return"npm"}function Gn(){return!wi()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function wt(){return typeof window<"u"&&(!Gn()||Fo())}function Fo(){return b.process?.type==="renderer"}function Fn(e,t){let i=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,ingest_settings:wt()?{infer_ip:i,infer_user_agent:i}:void 0,items:e}]}var Ho=new WeakMap;function zo(e){return q(e)?void 0:e}function Hn(e,t,i){let r=zo(t.originalException),n=r&&Ho.get(r);if(!n)return;let s=e.contexts?.trace;(s?.trace_id??(i&&Qe(i).trace_id))===n.trace_id&&(e.contexts={...e.contexts,trace:{...s,...n}})}function Yo(e,t){if(!t)return e;let i=e.sdk||{};return e.sdk={...i,name:i.name||t.name,version:i.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 zn(e,t,i,r){let n=Oi(i),s={sent_at:new Date(Y()).toISOString(),...n&&{sdk:n},...!!r&&t&&{dsn:re(t)}},a="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return fe(s,[a])}function Yn(e,t,i,r){let n=Oi(i),s=e.type&&e.type!=="replay_event"?e.type:"event";Yo(e,i?.sdk);let a=Bn(e,n,r,t);return delete e.sdkProcessingMetadata,fe(a,[[{type:s},e]])}var xt="[Filtered]",Ri=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"];function jo(e,t){return t.some(i=>e.includes(i))}function Ni(e,t,i){if(t===!1)return!0;let r=e.toLowerCase();if(jo(r,i!=null?[...Ri,...i]:Ri))return!0;if(t===!0)return!1;let n=("deny"in t?t.deny:t.allow).some(s=>r.includes(s.toLowerCase()));return"deny"in t?n:!n}function Ue(e,t,i){if(t===!1)return{};let r={};for(let n of Object.keys(e))r[n]=Ni(n,t,i)?xt:e[n];return r}var Ci=0,jn=1,Kn=2;function J(e){return new Pi(t=>{t(e)})}function he(e){return new Pi((t,i)=>{i(e)})}var Pi=class Li{constructor(t){this._state=Ci,this._handlers=[],this._runExecutor(t)}then(t,i){return new Li((r,n)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(a){n(a)}},s=>{if(!i)n(s);else try{r(i(s))}catch(a){n(a)}}]),this._executeHandlers()})}catch(t){return this.then(i=>i,t)}finally(t){return new Li((i,r)=>{let n,s;return this.then(a=>{s=!1,n=a,t&&t()},a=>{s=!0,n=a,t&&t()}).then(()=>{if(s){r(n);return}i(n)})})}_executeHandlers(){if(this._state===Ci)return;let t=this._handlers.slice();this._handlers=[],t.forEach(i=>{i[0]||(this._state===jn&&i[1](this._value),this._state===Kn&&i[2](this._value),i[0]=!0)})}_runExecutor(t){let i=(s,a)=>{if(this._state===Ci){if(W(a)){a.then(r,n);return}this._state=s,this._value=a,this._executeHandlers()}},r=s=>{i(jn,s)},n=s=>{i(Kn,s)};try{t(r,n)}catch(s){n(s)}}};function Wn(e,t,i,r=0,n){try{let s=Di(t,i,e,r,n);return W(s)?s:J(s)}catch(s){return he(s)}}function Di(e,t,i,r,n){let s=i[r];if(!e||!s)return e;let a=`Event processor "${s.id||"?"}"`,o=!1,l=$(u?`${a} threw an error, dropping event:`:"",()=>s({...e},t),()=>(o=!0,null));return u&&l===null&&d.log(`${a} dropped event`),W(l)?l.then(p=>p?Di(p,t,i,r+1,n):(n?.(o?"callback_error":"event_processor"),null)):l?Di(l,t,i,r+1,n):(n?.(o?"callback_error":"event_processor"),null)}var ve,Vn,Qn,le;function $n(e){let t=b._sentryDebugIds,i=b._debugIds;if(!t&&!i)return{};let r=t?Object.keys(t):[],n=i?Object.keys(i):[];if(le&&r.length===Vn&&n.length===Qn)return le;Vn=r.length,Qn=n.length,le={},ve||(ve={});let s=(a,o)=>{for(let l of a){let p=o[l],c=ve?.[l];if(c&&le&&p)le[c[0]]=p,ve&&(ve[l]=[c[0],p]);else if(p){let g=e(l);for(let m=g.length-1;m>=0;m--){let f=g[m]?.filename;if(f&&le&&ve){le[f]=p,ve[l]=[f,p];break}}}}};return t&&s(r,t),i&&s(n,i),le}function et(e){return e.data?.__sentry__===!0}function Rt(e){let t=[];e.message&&t.push(e.message);try{let i=e.exception.values[e.exception.values.length-1];i?.value&&(t.push(i.value),i.type&&t.push(`${i.type}: ${i.value}`))}catch{}return t}function Jn(e,t,i,r,n,s){let{normalizeDepth:a=3,normalizeMaxBreadth:o=1e3}=e,l={...t,event_id:t.event_id||i.event_id||I(),timestamp:t.timestamp||Q()},p=i.integrations||e.integrations.map(A=>A.name);Ko(l,e),Qo(l,p),n&&n.emit("applyFrameMetadata",t),t.type===void 0&&Wo(l,e.stackParser);let c=Jo(r,i.captureContext);i.mechanism&&Pr(l,i.mechanism);let g=n?n.getEventProcessors():[],m=At(s,c),f=[...i.attachments||[],...m.attachments];f.length&&(i.attachments=f),xn(l,m);let k=vn(c);k&&Rn(l,k),Hn(l,i,c);let j=[...g,...m.eventProcessors],h=t.type==="transaction",N=t.spans?.length||0;return(et(i)?J(l):Wn(j,l,i,0,A=>{n&&(n.recordDroppedEvent(A,Ze(t.type)),h&&n.recordDroppedEvent(A,"span",1+N))})).then(A=>{if(!A)return null;if(h&&n){let vr=N-(A.spans?.length||0);vr>0&&n.recordDroppedEvent("event_processor","span",vr)}return Vo(A),typeof a=="number"&&a>0?$o(A,a,o):A})}function Ko(e,t){let{environment:i,release:r,dist:n,maxValueLength:s}=t;e.environment=e.environment||i||"production",!e.release&&r&&(e.release=r),!e.dist&&n&&(e.dist=n);let a=e.request;a?.url&&s&&(a.url=Ke(a.url,s)),s&&e.exception?.values?.forEach(o=>{o.value&&(o.value=Ke(o.value,s))})}function Wo(e,t){let i=$n(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(n=>{n.filename&&(n.debug_id=i[n.filename])})})}function Vo(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(n=>{n.debug_id&&(n.abs_path?t[n.abs_path]=n.debug_id:n.filename&&(t[n.filename]=n.debug_id),delete n.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let i=e.debug_meta.images;Object.entries(t).forEach(([r,n])=>{i.push({type:"sourcemap",code_file:r,debug_id:n})})}function Qo(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function $o(e,t,i){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(n=>({...n,...n.data&&{data:F(n.data,t,i)}}))},...e.user&&{user:F(e.user,t,i)},...e.contexts&&{contexts:F(e.contexts,t,i)},...e.extra&&{extra:F(e.extra,t,i)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=F(e.contexts.trace.data,t,i))),e.spans&&(r.spans=e.spans.map(n=>({...n,...n.data&&{data:F(n.data,t,i)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=F(e.contexts.flags,3,i)),r}function Jo(e,t){if(!t)return e;let i=e?e.clone():new B;return i.update(t),i}function Xn(e){if(e)return Xo(e)?{captureContext:e}:el(e)?{captureContext:e}:e}function Xo(e){return e instanceof B||typeof e=="function"}var Zo=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function el(e){return Object.keys(e).some(t=>Zo.includes(t))}function Se(e,t){return O().captureException(e,Xn(t))}function qe(e,t){return O().captureEvent(e,t)}async function tt(e){let t=_();return t?t.flush(e):(u&&d.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}function Be(e){let t=M(),{user:i}=At(t,O()),r=b.navigator?.userAgent;if(r){let a=_()?.getDataCollectionOptions().httpHeaders.request??!0;r=Ue({"User-Agent":r},a)["User-Agent"]}let n=Br({user:i,userAgent:r,...e}),s=t.getSession();return s?.status==="ok"&&ie(s,{status:"exited"}),it(),t.setSession(n),n}function it(){let e=M(),t=O().getSession()||e.getSession();t&&Gr(t),Zn(),e.setSession()}function Zn(){let e=M(),t=_(),i=e.getSession();i&&t&&t.captureSession(i)}function ke(e=!1){if(e){it();return}Zn()}function tl(e){let t=e.protocol?`${e.protocol}:`:"",i=e.port?`:${e.port}`:"";return`${t}//${e.host}${i}${e.path?`/${e.path}`:""}/api/`}function il(e){return`${tl(e)}${e.projectId}/envelope/`}function rl(e,t){let i={sentry_version:"7"};return e.publicKey&&(i.sentry_key=e.publicKey),t&&(i.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(i).toString()}function es(e,t,i){return t||`${il(e)}?${rl(e,i)}`}function ts(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||Ln(t))return;let i=[],r=[];for(let n of e.spans)n.op?.startsWith("gen_ai.")?i.push(Cn(n)):r.push(n);if(i.length!==0)return e.spans=r,Fn(i,t)}var Ge=Symbol.for("SentryBufferFullError");function Ee(e=100){let t=new Set;function i(){return t.size<e}function r(a){t.delete(a)}function n(a){if(!i())return he(Ge);let o=a();return t.add(o),o.then(()=>r(o),()=>r(o)),o}function s(a){if(!t.size)return J(!0);let o=Promise.allSettled(Array.from(t)).then(()=>!0);if(!a)return o;let l=[o,new Promise(p=>Pn(setTimeout(()=>p(!1),a)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:n,drain:s}}var nl=6e4;function sl(e,t=Y()){let i=parseInt(`${e}`,10);if(!isNaN(i))return i*1e3;let r=Date.parse(`${e}`);return isNaN(r)?nl:r-t}function al(e,t){return e[t]||e.all||0}function is(e,t,i=Y()){return al(e,t)>i}function rs(e,t,i=Y()){let r={...e};return ol(t,i,(n,s)=>{r[n]=Math.max(r[n]||0,s)}),r}function ol({statusCode:e,headers:t},i,r){let n=t?.["x-sentry-rate-limits"],s=t?.["retry-after"];if(n)for(let a of n.trim().split(",")){let[o,l,,,p]=a.split(":",5),c=parseInt(o,10),g=(isNaN(c)?60:c)*1e3;if(!l)r("all",i+g);else for(let m of l.split(";"))m==="metric_bucket"?(!p||p.split(";").includes("custom"))&&r(m,i+g):r(m,i+g)}else s?r("all",i+sl(s,i)):e===429&&r("all",i+6e4)}function rt(e,t,i=Ee(e.bufferSize||64)){let r={},n=o=>i.drain(o);function s(o,[l,p],c){let g=Ai(c);c==="transaction"&&e.recordDroppedEvent(o,"span",(p.spans?.length??0)+1),e.recordDroppedEvent(o,g,typeof l.item_count=="number"?l.item_count:1)}function a(o){let l=[];if(Ot(o,(m,f)=>{is(r,Ai(f))?s("ratelimit_backoff",m,f):l.push(m)}),l.length===0)return Promise.resolve({});let p=fe(o[0],l),c=m=>{if(Dn(p,["client_report"])){u&&d.warn(`Dropping client report. Will not send outcomes (reason: ${m}).`);return}Ot(p,(f,k)=>{s(m,f,k)})},g=()=>t({body:Mn(p)}).then(m=>m.statusCode===413?(u&&d.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),m):(u&&m.statusCode!==void 0&&(m.statusCode<200||m.statusCode>=300)&&d.warn(`Sentry responded with status code ${m.statusCode} to sent event.`),r=rs(r,m),m),m=>{throw c("network_error"),u&&d.error("Encountered error running transport request:",m),m});return i.add(g).then(m=>m,m=>{if(m===Ge)return u&&d.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw m})}return{send:a,flush:n}}function ns(e,t,i){let r=[{type:"client_report"},{timestamp:i||Q(),discarded_events:e}];return fe(t?{dsn:t}:{},[r])}function ss(e){let{trace_id:t,parent_span_id:i,span_id:r,status:n,origin:s,data:a,op:o,links:l}=e.contexts?.trace??{};return{data:a??{},description:e.transaction,op:o,parent_span_id:i,span_id:r??"",start_timestamp:e.start_timestamp??0,status:n??"ok",timestamp:e.timestamp,trace_id:t??"",origin:s,links:l,profile_id:a?.[mi],exclusive_time:a?.[ui],measurements:e.measurements,is_segment:!0}}function as(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,links:e.links,data:{...e.data,...e.profile_id&&{[mi]:e.profile_id},...e.exclusive_time&&{[ui]:e.exclusive_time}}}},measurements:e.measurements}}function os(e){e.traceLifecycle!=="stream"||!(e.beforeSendTransaction||e.ignoreTransactions?.length)||C(()=>{console.warn("[Sentry] `beforeSendTransaction` and `ignoreTransactions` are ignored with `traceLifecycle: 'stream'` (enabled by default). Use `beforeSendSpan` and `ignoreSpans` instead, or set `traceLifecycle: 'static'`.")})}var w={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},mcp:{inputs:!0,outputs:!0},databaseQueryData:!0,queues:!0,stackFrameVariables:!0,frameContextLines:5};function ll(e){return typeof e=="boolean"||"allow"in e||"deny"in e}function pl(e){return e===void 0?{...w.httpHeaders}:ll(e)?{request:e,response:e}:{request:e.request??w.httpHeaders.request,response:e.response??w.httpHeaders.response}}function ls(e){let t=e.dataCollection??{};return{userInfo:t.userInfo??w.userInfo,cookies:t.cookies??w.cookies,httpHeaders:pl(t.httpHeaders),httpBodies:t.httpBodies??w.httpBodies,urlQueryParams:t.urlQueryParams??w.urlQueryParams,graphQL:{document:t.graphQL?.document??w.graphQL.document,variables:t.graphQL?.variables??w.graphQL.variables},genAI:{inputs:t.genAI?.inputs??w.genAI.inputs,outputs:t.genAI?.outputs??w.genAI.outputs},mcp:{inputs:t.mcp?.inputs??w.mcp.inputs,outputs:t.mcp?.outputs??w.mcp.outputs},databaseQueryData:t.databaseQueryData??w.databaseQueryData,queues:t.queues??w.queues,stackFrameVariables:t.stackFrameVariables??w.stackFrameVariables,frameContextLines:t.frameContextLines??w.frameContextLines}}var ps="Not capturing exception because it's already been captured.",cs="Discarded session because of missing or non-string release",bs=Symbol.for("SentryInternalError"),ys=Symbol.for("SentryDoNotSendEventError"),_s=Symbol.for("SentryClosedClient");function qi(e){return _s in e}function ds(e){return{message:e,[bs]:!0}}function Mi(e){return{message:e,[ys]:!0}}function us(e){return Mi(`Discarding event because it's not included in the random sample (sampling rate = ${e})`)}function ms(e){return ae(e)&&bs in e}function gs(e){return ae(e)&&ys in e}var Bi=class{constructor(e){this._options={attachStacktrace:!0,...e,traceLifecycle:e.traceLifecycle==="static"?"static":"stream"},this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Ee(e.transportOptions?.bufferSize??64),this._dataCollection=ls(e),this._unhandledSessionStatus="crashed",this._attachStacktraceIsDefault=e.attachStacktrace===void 0,e.dsn?this._dsn=_e(e.dsn):u&&d.warn("No DSN provided, client will not send events.");let{beforeSendSpan:t,traceLifecycle:i}=this._options;if(u&&t&&ki(t)!==(i==="static")&&C(()=>{console.warn(`Ignoring \`beforeSendSpan\`: ${i==="static"?"wrap it with":"remove"} \`Sentry.withStaticSpan\` to use it with \`traceLifecycle: "${i}"\`.`)}),this._dsn){let r=es(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}}captureException(e,t,i){let r=I();if(vt(e))return u&&d.log(ps),r;let n={event_id:r,...t};return this._process(()=>this.eventFromException(e,n).then(s=>this._captureEvent(s,n,i)).then(s=>s),"error"),n.event_id}captureMessage(e,t,i,r){let n={event_id:I(),...i},s=ue(e)?e:String(e),a=q(e),o=a?this.eventFromMessage(s,t,n).then(l=>(l.exception&&this._attachStacktraceIsDefault&&(l.sdkProcessingMetadata={...l.sdkProcessingMetadata,hasDefaultSyntheticStacktrace:!0}),l)):this.eventFromException(e,n);return this._process(()=>o.then(l=>this._captureEvent(l,n,r)),a?"unknown":"error"),n.event_id}captureEvent(e,t,i){let r=I();if(t?.originalException&&vt(t.originalException))return u&&d.log(ps),r;let n={event_id:r,...t},s=e.sdkProcessingMetadata||{},a=s.capturedSpanScope,o=s.capturedSpanIsolationScope,l=Ze(e.type);return this._process(()=>this._captureEvent(e,n,a||i,o),l),n.event_id}captureSession(e){this.sendSession(e),ie(e,{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(e){let t=this._transport;if(this.emit("flush"),!t)return!0;let i=await this._isClientDoneProcessing(e),r=await t.flush(e);return i&&r}async close(e){Object.defineProperty(this,_s,{value:!0});let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&(this._setupIntegrations(),os(this._options))}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),vi(this,e,this._integrations),t||hi(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let i=ts(e,this),r=Yn(e,this._dsn,this._options._metadata,this._options.tunnel);if(!et(t))for(let n of t.attachments||[])r=Ii(r,Un(n));i&&(r=Ii(r,i)),this.sendEnvelope(r).then(n=>this.emit("afterSendEvent",e,n))}sendSession(e){let{release:t,environment:i=Tn}=this._options;if("aggregates"in e){let n=e.attrs||{};if(!n.release&&!t){u&&d.warn(cs);return}n.release=n.release||t,n.environment=n.environment||i,e.attrs=n}else{if(!e.release&&!t){u&&d.warn(cs);return}e.release=e.release||t,e.environment=e.environment||i}this.emit("beforeSendSession",e);let r=zn(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,i=1){if(this._options.sendClientReports){let r=`${e}:${t}`;u&&d.log(`Recording outcome: "${r}"${i>1?` (${i} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+i}}on(e,t){let i=this._hooks[e]=this._hooks[e]||new Set,r=(...n)=>t(...n);return i.add(r),()=>{i.delete(r)}}emit(e,...t){let i=this._hooks[e];i&&i.forEach(r=>r(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{let t=await this._transport.send(e);return this.emit("afterEnvelope",e),t}catch(t){return u&&d.error("Error while sending envelope:",t),{}}return u&&d.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=En(this,e),hi(this,e)}_updateSessionFromEvent(e,t){let i=t.level==="fatal",r=!1,n=t.exception?.values;if(n){r=!0,i=!1;for(let a of n)if(a.mechanism?.handled===!1){i=!0;break}}let s=e.status==="ok";(s&&e.errors===0||s&&i)&&(ie(e,{...i&&{status:this._unhandledSessionStatus},errors:e.errors||Number(r||i)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(i=>setTimeout(i,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,i,r){let n=this.getOptions(),s=this.getIntegrationNames();return!t.integrations&&s.length&&(t.integrations=s),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Jn(n,e,t,i,this,r).then(a=>(a===null||(this.emit("postprocessEvent",a,t),a.contexts={trace:{...a.contexts?.trace,...Qe(i)},...a.contexts},a.sdkProcessingMetadata={dynamicSamplingContext:Si(this,i),...a.sdkProcessingMetadata}),a))}_captureEvent(e,t={},i=O(),r=M()){return u&&Ui(e)&&d.log(`Captured error event \`${Rt(e)[0]||"<unknown>"}\``),this._processEvent(e,t,i,r).then(n=>n.event_id,n=>{u&&(gs(n)?d.log(n.message):ms(n)?d.warn(n.message):d.warn(n))})}_processEvent(e,t,i,r){let n=this.getOptions(),{sampleRate:s}=n,a=fs(e),o=Ui(e),l=`before send for type \`${e.type||"error"}\``,p="before_send",c=0,g=typeof s>"u"?void 0:mn(s),m=o&&typeof g=="number"&&Ne()>g,f=Ze(e.type),k=0,j=i.getSession()||r.getSession();return m&&j?.status!=="ok"?(this.recordDroppedEvent("sample_rate","error"),he(us(s))):this._prepareEvent(e,t,i,r).then(h=>{if(h===null)throw Mi("An event processor returned `null`, will not send event.");return k=h.spans?.length||0,et(t)?h:cl(n,h,t,N=>{p=N},N=>{c=N})}).then(h=>{if(c&&this.recordDroppedEvent("ignored","span",c),!z(h)||h===null)throw this.recordDroppedEvent(p,f),a&&this.recordDroppedEvent(p,"span",1+k-c),h!==null?ds(`${l} must return \`null\` or a valid event.`):Mi(`${p==="ignored"?"Transaction matched `ignoreSpans`":`${l} ${p==="callback_error"?"threw an error":"returned `null`"}`}, will not send event.`);if(o&&j&&this._updateSessionFromEvent(j,h),m)throw this.recordDroppedEvent("sample_rate","error"),us(s);if(a){let A=k-c-(h.spans?.length||0);A>0&&this.recordDroppedEvent("before_send","span",A)}let N=h.transaction_info;if(a&&N&&h.transaction!==e.transaction){let A="custom";h.transaction_info={...N,source:A}}return this.sendEvent(h,t),h}).then(null,h=>{throw gs(h)||ms(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),ds(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
8
|
+
Reason: ${h}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(i=>(this._numProcessing--,i),i=>(this._numProcessing--,i===Ge&&this.recordDroppedEvent("queue_overflow",t),i))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([t,i])=>{let[r,n]=t.split(":");return{reason:r,category:n,quantity:i}})}_flushOutcomes(){u&&d.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){u&&d.log("No outcomes to send");return}if(!this._dsn){u&&d.log("No dsn provided, will not send outcomes");return}u&&d.log("Sending outcomes:",e);let t=ns(e,this._options.tunnel&&re(this._dsn));this.sendEnvelope(t)}};function cl(e,t,i,r,n){let{beforeSend:s,ignoreSpans:a,beforeSendTransaction:o}=e,l=ki(e.beforeSendSpan)&&e.beforeSendSpan,p=t;if(Ui(p)&&s){let c=p;return $(u?"The `beforeSend` callback threw an error, dropping the event:":"",()=>s(c,i),()=>(r("callback_error"),null))}if(fs(p)){if(l||a){let c=ss(p);if(a?.length&&yi({description:c.description,op:c.op,attributes:c.data},a))return r("ignored"),null;if(l){let g=Ei(c,l);p=oe(t,as(g))}if(p.spans){let g=[],m=p.spans;for(let f of m){if(a?.length&&yi({description:f.description,op:f.op,attributes:f.data},a)){kn(m,f);continue}l?g.push(Ei(f,l)):g.push(f)}n(m.length-g.length),p.spans=g}}if(o)return $(u?"The `beforeSendTransaction` callback threw an error, dropping the event:":"",()=>o(p,i),()=>(r("callback_error"),null))}return p}function Ui(e){return e.type===void 0}function fs(e){return e.type==="transaction"}function Gi(e,t){t.debug===!0&&(u?d.enable():C(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),hs(),O().update(t.initialScope);let i=new e(t);return Nt(i),i.init(),i}function hs(){let e=_();e&&!qi(e)&&C(()=>{console.warn("[Sentry] `Sentry.init()` was called more than once. The new client replaces the active client, but the active client is not closed, so state from both can mix. Call `Sentry.init()` only once, or call `await Sentry.close()` before you call it again.")})}function Nt(e){O().setClient(e)}function Fi(e,t){let i=e.indexOf("="),r=i===-1?e:e.slice(0,i),n=new URLSearchParams(`${r}=`).keys().next().value;return n!==void 0&&Ni(n,t)?`${r}=${xt}`:e}function vs(e,t){if(!(!e||t===!1))return e.split("&").map(i=>Fi(i,t)).join("&")}function Ss(e,t){if(!e||t===!1)return;let i=e.indexOf("?");return`${i===-1?"":e.slice(0,i+1)}${(i===-1?e:e.slice(i+1)).split("&").map(r=>r.includes("=")?Fi(r,t):r).join("&")}`}function ks(e,t){let i=e.indexOf("#"),r=i===-1?e:e.slice(0,i),n=i===-1?void 0:e.slice(i+1),s=r.indexOf("?"),a=r;if(s!==-1){let l=vs(r.slice(s+1),t);a=`${r.slice(0,s)}${l?`?${l}`:""}`}let o=n===void 0?void 0:Ss(n,t);return o?`${a}#${o}`:a}function dl(e){return(e??_())?.getDataCollectionOptions().urlQueryParams??!0}function X(e,t){return e===void 0?void 0:ks(e,dl(t))}var ul="thismessage:/";function Hi(e){return"isRelative"in e}function Ct(e,t){let i=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(i?ul:void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;let n=new URL(e,r);return i?{isRelative:i,pathname:n.pathname,search:n.search,hash:n.hash}:n}catch{}}function nt(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let i=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:i,hash:r,relative:t[5]+i+r}}function zi(e,t=!0){if(e.startsWith("data:")){let i=e.match(/^data:([^;,]+)/),r=i?i[1]:"text/plain",n=e.includes(";base64,"),s=e.indexOf(","),a="";if(t&&s!==-1){let o=e.slice(s+1);a=o.length>10?`${o.slice(0,10)}... [truncated]`:o}return`data:${r}${n?",base64":""}${a?`,${a}`:""}`}return e}function Es(e){let t=2166136261;for(let i=0;i<e.length;i++)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Yi(e){let t=e?_e(e):_()?.getDsn();return t?`/${Es(re(t))}`:void 0}function ji(e){let t=(e?.startsWith("./")?e.slice(1):e??"").replace(/\/$/,"");return!t||t.startsWith("/")?t:`/${t}`}function Ki(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 Ts(e){return Array.from(new Set(e))}function Wi(e){if(e._metadata?.optionsSetByUser)return e;let{integrations:t}=e,i={...e._metadata,optionsSetByUser:Object.keys(e).filter(r=>r!=="_metadata").sort()};return Array.isArray(t)&&(i.integrationsSetByUser=Ts(t.map(r=>r.name))),{...e,_metadata:i,...typeof t=="function"&&{integrations:r=>{let n=new Set(r),s=t(r),a=Array.isArray(s)?s:[s],o=new Set,l=new Set;for(let c of a)o.add(c.name),!n.has(c)&&!c.isDefaultInstance&&l.add(c.name);let p=new Set;for(let c of n)o.has(c.name)||p.add(c.name);return i.integrationsSetByUser=Array.from(l),p.size&&(i.removedDefaultIntegrations=Array.from(p).sort()),a}}}}function Vi(e,t,i=[t],r="npm"){let n=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};n.name||(n.name=`sentry.javascript.${t}`,n.packages=i.map(s=>({name:`${r}:@sentry/${s}`,version:se})),n.version=se)}var Qi="sentry-release";var ml=100;function H(e,t){let i=_(),r=M();if(!i)return;let{beforeBreadcrumb:n=null,maxBreadcrumbs:s=ml}=i.getOptions();if(s<=0)return;let a={timestamp:Q(),...e},o=n?$(u?"The `beforeBreadcrumb` callback threw an error, dropping the breadcrumb:":"",()=>C(()=>n(a,t)),()=>null):a;o!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",o,t),r.addBreadcrumb(o,s))}var gl="FunctionToString",Is=new WeakMap,bl=(()=>({name:gl,setupOnce(){let e=Function.prototype.toString,t=Function.prototype.call.bind(e),i=Function.prototype.call.bind(Object.prototype.hasOwnProperty);try{Function.prototype.toString=function(){let r;try{Is.has(_())&&i(this,"__sentry_original__")&&(r=ge(this))}catch{}return t(r??this)}}catch{}},setup(e){Is.set(e,!0)}})),st=S(bl);var yl=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/Java exception was raised during method invocation$/,/Java object is gone$/],_l="EventFilters",at=S((e={})=>{let t;return{name:_l,setup(i){t=As(e,i.getOptions())},processEvent(i,r,n){return t||(t=As(e,n.getOptions())),fl(i,t)?null:i}}});function As(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:yl],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function fl(e,t){if(e.type){if(e.type==="transaction"&&vl(e,t.ignoreTransactions))return u&&d.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
9
|
+
Event: ${V(e)}`),!0}else{if(hl(e,t.ignoreErrors))return u&&d.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
10
|
+
Event: ${V(e)}`),!0;if(Tl(e))return u&&d.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
11
|
+
Event: ${V(e)}`),!0;if(Sl(e,t.denyUrls))return u&&d.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
12
|
+
Event: ${V(e)}.
|
|
13
|
+
Url: ${Lt(e)}`),!0;if(!kl(e,t.allowUrls))return u&&d.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
14
|
+
Event: ${V(e)}.
|
|
15
|
+
Url: ${Lt(e)}`),!0}return!1}function hl(e,t){return t?.length?Rt(e).some(i=>ye(i,t)):!1}function vl(e,t){if(!t?.length)return!1;let i=e.transaction;return i?ye(i,t):!1}function Sl(e,t){if(!t?.length)return!1;let i=Lt(e);return i?ye(i,t):!1}function kl(e,t){if(!t?.length)return!0;let i=Lt(e);return i?ye(i,t):!0}function El(e=[]){for(let t=e.length-1;t>=0;t--){let i=e[t];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}function Lt(e){try{let t=[...e.exception?.values??[]].reverse().find(i=>i.mechanism?.parent_id===void 0&&i.stacktrace?.frames?.length)?.stacktrace?.frames;return t?El(t):null}catch{return u&&d.error(`Cannot extract url for event ${V(e)}`),null}}function Tl(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Xi(e,t,i,r,n,s){if(!n.exception?.values||!s||!x(s.originalException))return;let a=n.exception.values.length>0?n.exception.values[n.exception.values.length-1]:void 0;a&&(n.exception.values=Pt(e,t,r,s.originalException,i,n.exception.values,a,0))}function Pt(e,t,i,r,n,s,a,o){if(s.length>=i+1)return s;let l=[...s];if(x(r[n])){$i(a,o,r);let p=e(t,r[n]),c=l.length;Ji(p,n,c,o),l=Pt(e,t,i,r[n],n,[p,...l],p,c)}return Os(r)&&r.errors.forEach((p,c)=>{if(l.length<i+1&&x(p)){$i(a,o,r);let g=e(t,p),m=l.length;Ji(g,`errors[${c}]`,m,o),l=Pt(e,t,i,p,n,[g,...l],g,m)}}),Il(r)&&["error","suppressed"].forEach(p=>{let c=r[p];if(l.length<i+1&&x(c)){$i(a,o,r);let g=e(t,c),m=l.length;Ji(g,p,m,o),l=Pt(e,t,i,c,n,[g,...l],g,m)}}),l}function Os(e){return Array.isArray(e.errors)}function Il(e){return"error"in e&&"suppressed"in e}function $i(e,t,i){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Os(i)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ji(e,t,i,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:i,parent_id:r}}function Al(e){return x(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Dt(e){let t=Ol(e.message);return Al(e)?`${t} (${e.__sentry_fetch_url_host__})`:t}function Ol(e){if(typeof e=="string")return e;if(e==null)return"";if(q(e))return String(e);if(z(e)||Array.isArray(e)){let t=Nr(e,"");if(t)return t}return je(void 0,e)}var Mt=new Set([]);function xs(e){let t="console",i=L(t,e);return P(t,wl),i}function Rs(e){for(let t of e)Mt.add(t);return()=>{for(let t of e)Mt.delete(t)}}var ws=new Set;function wl(){"console"in b&&Fe.forEach(function(e){ws.has(e)||!(e in b.console)||(ws.add(e),T(b.console,e,function(t){return we[e]=t,function(...i){let r=i[0],n=we[e],s=Mt.size&&typeof r=="string"&&ye(r,Mt);s||E("console",{args:i,level:e}),(!s||u&&d.isEnabled())&&n?.apply(b.console,i)}}))})}function Ns(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var xl="Dedupe",Rl=(()=>{let e;return{name:xl,processEvent(t){if(t.type)return t;try{if(Nl(t,e))return u&&d.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),ot=S(Rl);function Nl(e,t){return t?!!(Cl(e,t)||Ll(e,t)):!1}function Cl(e,t){let i=e.message,r=t.message;return!(!i&&!r||i&&!r||!i&&r||i!==r||!Ps(e,t)||!Ls(e,t))}function Ll(e,t){let i=Cs(t),r=Cs(e);return!(!i||!r||i.type!==r.type||i.value!==r.value||!Ps(e,t)||!Ls(e,t))}function Ls(e,t){let i=bt(e),r=bt(t);if(!i||!r)return!i&&!r;if(r.length!==i.length)return!1;for(let n=0;n<r.length;n++){let s=r[n],a=i[n];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function Ps(e,t){let i=e.fingerprint,r=t.fingerprint;if(!i||!r)return!i&&!r;try{return i.join("")===r.join("")}catch{return!1}}function Cs(e){return e.exception?.values?.[0]}var Pl="Console",lt=S((e={})=>{let t=new Set(e.levels||Fe);return{name:Pl,setup(i){let r=xs(({args:n,level:s})=>{_()!==i||!t.has(s)||Dl(s,n)});if(i.registerCleanup(r),e.filter){let n=Rs(e.filter);i.registerCleanup(n)}}}});function Dl(e,t){let i={category:"console",data:{arguments:t,logger:"console"},level:Ns(e),message:Ds(t)};if(e==="assert")if(t[0]===!1){let r=t.slice(1);i.message=r.length>0?`Assertion failed: ${Ds(r)}`:"Assertion failed",i.data.arguments=r}else return;H(i,{input:t,level:e})}function Ds(e){return"util"in b&&typeof b.util.format=="function"?b.util.format(...e):Cr(e," ")}var Ml="ConversationId",Ul=(()=>({name:Ml,setup(e){e.on("spanStart",t=>{let i=O().getScopeData(),r=M().getScopeData(),n=i.conversationId||r.conversationId;if(n){let{op:s,data:a,description:o}=ne(t);if(!s?.startsWith("gen_ai.")&&!a["ai.operationId"]&&!o?.startsWith("ai."))return;t.setAttribute(en,n)}})}})),Zi=S(Ul);var er=b;function ql(){if(!("fetch"in er))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function pt(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Ms(){if(typeof EdgeRuntime=="string")return!0;if(!ql())return!1;if(pt(er.fetch))return!0;let e=!1,t=er.document;if(t&&typeof t.createElement=="function")try{let i=t.createElement("iframe");i.hidden=!0,t.head.appendChild(i),i.contentWindow?.fetch&&(e=pt(i.contentWindow.fetch)),t.head.removeChild(i)}catch(i){u&&d.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return e}function tr(e){let t="fetch",i=L(t,e);return P(t,()=>Bl()),i}function Bl(e){wt()&&!Ms()||T(b,"fetch",function(t){return new Proxy(t,{apply(i,r,n){let s=new Error,{method:a,url:o}=Gl(n),l={args:n,fetchData:{method:a,url:o},startTimestamp:R()*1e3,virtualError:s,headers:Fl(n)};return e||E("fetch",{...l}),Reflect.apply(i,b,n).then(async p=>(e?e(p):E("fetch",{...l,endTimestamp:R()*1e3,response:p}),p),p=>{E("fetch",{...l,endTimestamp:R()*1e3,error:p}),x(p)&&p.stack===void 0&&(p.stack=s.stack,U(p,"framesToPop",1));let c=_()?.getOptions().enhanceFetchErrorMessages??"always";if(c!==!1&&x(p)&&p.name==="TypeError"&&(p.message==="Failed to fetch"||p.message==="Load failed"||p.message==="NetworkError when attempting to fetch resource."))try{let g=new URL(l.fetchData.url,b.location?.href).host;g&&(c==="always"?p.message=`${p.message} (${g})`:U(p,"__sentry_fetch_url_host__",g))}catch{}throw p})}})})}function Ut(e,t){return ae(e)&&!!e[t]}function Us(e){return typeof e=="string"?e:e?Ut(e,"url")?e.url:e.toString?e.toString():"":""}function Gl(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[i,r]=e;return{url:Us(i),method:Ut(r,"method")?String(r.method).toUpperCase():ri(i)&&Ut(i,"method")?String(i.method).toUpperCase():"GET"}}let t=e[0];return{url:Us(t),method:Ut(t,"method")?String(t.method).toUpperCase():"GET"}}function Fl(e){let[t,i]=e;try{if(typeof i=="object"&&i!==null&&"headers"in i&&i.headers)return new Headers(i.headers);if(ri(t))return new Headers(t.headers)}catch{}}function qt(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var ct=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var v=b;var Hl=80,Te={};try{typeof Node<"u"&&(Te.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element<"u"&&(Te.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,Te.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,Te.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,Te.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<"u"&&(Te.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function ce(e,t,i){let r=Te[t];if(r)try{return r.call(e,i)}catch{}let n=e[t];return typeof n=="function"?n.call(e,i):n}function dt(e,t={}){if(!e)return"<unknown>";try{let i=e,r=5,n=[],s=0,a=0,o=" > ",l=3,p,c=Array.isArray(t)?t:t.keyAttrs,g=Array.isArray(t)?void 0:t.maskAttributeFn,m=!Array.isArray(t)&&t.maxStringLength||Hl;for(;i&&s++<r&&(p=zl(i,c,g),!(p==="html"||s>1&&a+n.length*l+p.length>=m));)n.push(p),a+=p.length,i=ce(i,"parentNode");return n.reverse().join(o)}catch{return"<unknown>"}}function zl(e,t,i){let r=[],n=ce(e,"tagName");if(!n)return"";if(typeof HTMLElement<"u"&&e instanceof HTMLElement){let a=ce(e,"dataset");if(a){if(a.sentryComponent)return i?i("data-sentry-component",a.sentryComponent,e):a.sentryComponent;if(a.sentryElement)return i?i("data-sentry-element",a.sentryElement,e):a.sentryElement}}r.push(n.toLowerCase());let s=t?.length?t.filter(a=>ce(e,"getAttribute",a)).map(a=>[a,ce(e,"getAttribute",a)]):null;if(s?.length)s.forEach(([a,o])=>{r.push(`[${a}="${i&&o?i(a,o,e):o}"]`)});else{let a=ce(e,"id");a&&r.push(`#${i?i("id",a,e):a}`);let o=ce(e,"className");if(o&&D(o)){let l=(i?i("class",o,e):o).split(/\s+/);for(let p of l)r.push(`.${p}`)}}for(let a of["aria-label","type","name","title","alt"]){let o=ce(e,"getAttribute",a);o&&r.push(`[${a}="${i?i(a,o,e):o}"]`)}return r.join("")}function Yl(e,t,i){v.document&&v.addEventListener(e,t,i)}function jl(e,t,i){v.document&&v.removeEventListener(e,t,i)}var ir=e=>{let t=v.requestIdleCallback||v.setTimeout;if(v.document?.visibilityState==="hidden")e();else{let i=!1,r=()=>{i||(e(),i=!0)};Yl("visibilitychange",r,{once:!0,capture:!0}),t(()=>{r(),jl("visibilitychange",r,{capture:!0})})}};function rr(e,t=5){if(!b.HTMLElement)return null;let i=e;for(let r=0;r<t;r++){if(!i)return null;if(i instanceof HTMLElement){if(i.dataset.sentryComponent)return i.dataset.sentryComponent;if(i.dataset.sentryElement)return i.dataset.sentryElement}i=i.parentNode}return null}function Ie(){try{return v.document?.location.href??""}catch{return""}}var ta=new WeakMap;function nr(e,t=_()){if(!t){ct&&d.warn("Cannot set a route provider without a client.");return}ct&&ia(t)&&d.warn("A route provider is already registered for this client and will be replaced. Routes only the previous provider knows about will no longer resolve."),ta.set(t,e)}function ia(e=_()){return e&&ta.get(e)}var Kl=1e3,ra,sr,ar;function na(e){return typeof e=="boolean"?e:!!e?.capture}function or(e){L("dom",e),P("dom",Wl)}function Wl(){if(!v.document)return;let e=E.bind(null,"dom"),t=sa(e,!0);v.document.addEventListener("click",t,!1),v.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(i=>{let r=v[i]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(T(r,"addEventListener",function(n){return function(s,a,o){if((s==="click"||s=="keypress")&&a)try{let l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},p=l[s]=l[s]||{captureListeners:new WeakSet,bubbleListeners:new WeakSet,listenerCount:0},c=na(o);if(!p.handler){let m=sa(e);p.handler=m,p.capture=c,n.call(this,s,m,p.capture)}let g=p[c?"captureListeners":"bubbleListeners"];g.has(a)||(typeof o=="object"&&(o?.once||o?.signal)?p.sticky=!0:(g.add(a),p.listenerCount++))}catch{}return n.call(this,s,a,o)}}),T(r,"removeEventListener",function(n){return function(s,a,o){if((s==="click"||s=="keypress")&&a)try{let l=this.__sentry_instrumentation_handlers__||{},p=l[s];p?.[na(o)?"captureListeners":"bubbleListeners"].delete(a)&&(!--p.listenerCount&&!p.sticky&&(n.call(this,s,p.handler,p.capture),p.handler=void 0,delete l[s]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return n.call(this,s,a,o)}}))})}function Vl(e){if(e.type!==sr)return!1;try{if(!e.target||e.target._sentryId!==ar)return!1}catch{}return!0}function Ql(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function sa(e,t=!1){return i=>{if(!i||i._sentryCaptured)return;let r=$l(i);if(Ql(i.type,r))return;U(i,"_sentryCaptured",!0),r&&!r._sentryId&&U(r,"_sentryId",I());let n=i.type==="keypress"?"input":i.type;Vl(i)||(e({event:i,name:n,global:t}),sr=i.type,ar=r?r._sentryId:void 0),clearTimeout(ra),ra=v.setTimeout(()=>{ar=void 0,sr=void 0},Kl)}}function $l(e){try{return e.target}catch{return null}}var Bt;function Jl(){return"history"in v&&!!v.history}function ut(e){let t="history";L(t,e),P(t,Xl)}function Xl(){if(v.addEventListener("popstate",()=>{let t=v.location.href,i=Bt;Bt=t,i!==t&&E("history",{from:i,to:t})}),!Jl())return;function e(t){return function(...i){let r=i.length>2?i[2]:void 0;if(r){let n=Bt,s=Zl(String(r));if(Bt=s,n===s)return t.apply(this,i);E("history",{from:n,to:s})}return t.apply(this,i)}}T(v.history,"pushState",e),T(v.history,"replaceState",e)}function Zl(e){try{return new URL(e,v.location.origin).toString()}catch{return e}}var Gt={};function lr(e){let t=Gt[e];if(t)return t;let i=v[e];if(pt(i))return Gt[e]=i.bind(v);let r=v.document;if(r&&typeof r.createElement=="function")try{let n=r.createElement("iframe");n.hidden=!0,r.head.appendChild(n);let s=n.contentWindow;s?.[e]&&(i=s[e]),r.head.removeChild(n)}catch(n){ct&&d.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,n)}return i&&(Gt[e]=i.bind(v))}function pr(e){Gt[e]=void 0}var Ae="__sentry_xhr_v3__";function cr(e){L("xhr",e),P("xhr",ep)}function ep(){if(!v.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,i,r){let n=new Error,s=R()*1e3,a=D(r[0])?r[0].toUpperCase():void 0,o=tp(r[1]);if(!a||o===void 0)return t.apply(i,r);i[Ae]={method:a,url:o,request_headers:{}},a==="POST"&&o.match(/sentry_key/)&&(i.__sentry_own_request__=!0);let l=()=>{let p=i[Ae];if(p&&i.readyState===4){try{p.status_code=i.status}catch{}let c={endTimestamp:R()*1e3,startTimestamp:s,xhr:i,virtualError:n};E("xhr",c),n=void 0,i.removeEventListener("readystatechange",l)}};return"onreadystatechange"in i&&typeof i.onreadystatechange=="function"?i.onreadystatechange=new Proxy(i.onreadystatechange,{apply(p,c,g){return l(),p.apply(c,g)}}):i.addEventListener("readystatechange",l),i.setRequestHeader=new Proxy(i.setRequestHeader,{apply(p,c,g){let[m,f]=g,k=c[Ae];return k&&D(m)&&D(f)&&(k.request_headers[m.toLowerCase()]=f),p.apply(c,g)}}),t.apply(i,r)}}),e.send=new Proxy(e.send,{apply(t,i,r){let n=i[Ae];if(!n)return t.apply(i,r);r[0]!==void 0&&(n.body=r[0]);let s={startTimestamp:R()*1e3,xhr:i};return E("xhr",s),t.apply(i,r)}})}function tp(e){if(D(e))return e;try{return e.toString()}catch{}}function dr(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var y=b,ur=0,aa=[];function mr(e){if(ur>0)return!0;let t=e?aa.findIndex(i=>ip(i,e)):-1;return t===-1?!1:(aa.splice(t,1),!0)}function ip(e,t){return e.msg===t.msg&&e.url===t.url&&e.line===t.line&&e.column===t.column}function rp(){ur++,setTimeout(()=>{ur--})}function Oe(e,t={}){function i(n){return typeof n=="function"}if(!i(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){let n=e.__sentry_wrapped__;return typeof n=="function"?n:e}if(ge(e))return e}catch{return e}let r=function(...n){b._sentryWrappedDepth=(b._sentryWrappedDepth||0)+1;try{let s=n.map(a=>Oe(a,t));return e.apply(this,s)}catch(s){throw rp(),Ve(a=>{a.addEventProcessor(o=>(t.mechanism&&(Le(o,void 0,void 0),te(o,t.mechanism)),o.extra={...o.extra,arguments:n},o)),Se(s)}),s}finally{b._sentryWrappedDepth=(b._sentryWrappedDepth||0)-1}};try{for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}catch{}ft(r,e),U(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function gr(e){let t=Ie(),{referrer:i}=y.document||{},{userAgent:r}=y.navigator||{};return{url:t,headers:{...i&&{Referer:X(i,e)},...r&&{"User-Agent":r}}}}function Ft(e,t){let i=Ht(e,t),r={type:lp(t),value:pp(t)};return i.length&&(r.stacktrace={frames:i}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function np(e,t,i,r){let n=_()?.getOptions().normalizeDepth,s=up(t),a={__serialized__:Ye(t,n)};if(s)return{exception:{values:[Ft(e,s)]},extra:a};let o={exception:{values:[{type:me(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:cp(t,{isUnhandledRejection:r})}]},extra:a};if(i){let l=Ht(e,i);l.length&&(o.exception.values[0].stacktrace={frames:l})}return o}function br(e,t){return{exception:{values:[Ft(e,t)]}}}function Ht(e,t){let i=t.stacktrace||t.stack||"",r=ap(t),n=op(t);try{return e(i,r,n)}catch{}return[]}var sp=/Minified React error #\d+;/i;function ap(e){return e&&sp.test(e.message)?1:0}function op(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function oa(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function lp(e){let t=e?.name;return!t&&oa(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function pp(e){let t=e?.message;return oa(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Dt(t.error):Dt(e):"No error message"}function la(e,t,i,r){let n=zt(e,t,i?.syntheticException||void 0,r);return te(n),n.level="error",i?.event_id&&(n.event_id=i.event_id),J(n)}function pa(e,t,i="info",r,n){let s=yr(e,t,r?.syntheticException||void 0,n);return s.level=i,r?.event_id&&(s.event_id=r.event_id),J(s)}function zt(e,t,i,r,n){let s;if(ze(t)&&t.error)return br(e,t.error);if(yt(t)||ti(t)){let o=t;if("stack"in t){s=br(e,t);let l=s.exception?.values?.[0];if(r&&i&&l&&!l.stacktrace){let p=Ht(e,i);p.length&&(l.stacktrace={frames:p},te(s,{synthetic:!0}))}}else{let l=o.name||(yt(o)?"DOMError":"DOMException"),p=o.message?`${l}: ${o.message}`:l;s=yr(e,p,i,r),Le(s,p)}return s}if(x(t))return br(e,t);if(z(t)||me(t))return s=np(e,t,i,n),te(s,{synthetic:!0}),s;let a=String(t);return s=yr(e,a,i,r),Le(s,a,void 0),te(s,{synthetic:!0}),s}function yr(e,t,i,r){let n={};if(r&&i){let s=Ht(e,i);s.length&&(n.exception={values:[{value:t,stacktrace:{frames:s}}]}),te(n,{synthetic:!0})}if(ue(t)){let{__sentry_template_string__:s,__sentry_template_values__:a}=t;return n.logentry={message:s,params:a},n}return n.message=t,n}function cp(e,{isUnhandledRejection:t}){let i=ni(e),r=t?"promise rejection":"exception";return ze(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:me(e)?`Event \`${dp(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${i}`}function dp(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function up(e){return Object.values(e).find(x)}var Z=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Yt(e){let{tunnel:t,dsn:i,transportOptions:r}=e;if(!t)return{tunnel:t,transportOptions:r};if(typeof t=="string")return{tunnel:t,transportOptions:mp(t)?ca(r):r};let n=t===!0?{}:t,s=i&&_e(i),a=n.path??(s&&Yi(s));if(!a)return{tunnel:void 0,transportOptions:r};let o=`${ji(n.basePath)}${a}${n.trailingSlash?"/":""}`;return Z&&d.log(`Tunneling events to "${o}"`),{tunnel:o,transportOptions:ca(r)}}function ca(e){return{...e,headers:{"Content-Type":"application/x-sentry-envelope",...e?.headers}}}function mp(e){let t=Ct(e,y.location?.href);return t?Hi(t)||t.origin===y.location?.origin:!1}var da=class extends Bi{constructor(e){let t=gp({...e,...Yt(e)}),i=y.SENTRY_SDK_SOURCE||xi();Vi(t,"browser",["browser"],i),super(t),t.routeProvider&&nr(t.routeProvider,this),this._unhandledSessionStatus="unhandled";let{userInfo:r}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:r?"auto":"never",...t._metadata.sdk.settings});let{sendClientReports:n}=this._options,s=()=>{R()},a=[[y.document,"visibilitychange",()=>{s(),y.document.visibilityState==="hidden"&&(n&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}],[y.document,"freeze",s],[y.document,"resume",s],[y,"pagehide",s],[y,"pageshow",s]];a.forEach(([o,l,p])=>o?.addEventListener?.(l,p)),this.on("close",()=>a.forEach(([o,l,p])=>o?.removeEventListener?.(l,p))),r&&this.on("beforeSendSession",Ki)}eventFromException(e,t){return la(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",i){return pa(this._options.stackParser,e,t,i,this._options.attachStacktrace)}_prepareEvent(e,t,i,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,i,r)}};function gp(e){return{sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e,release:e.release??bp()}}function bp(){return typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:yp()??y.SENTRY_RELEASE?.id}function yp(){return y.document?.querySelector?.(`meta[name="${Qi}"]`)?.getAttribute("content")||void 0}var _p=40;function ua(e,t=lr("fetch")){let i=0,r=0;async function n(s){let a=s.body.length;i+=a,r++;let o={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:i<=6e4&&r<15,...e.fetchOptions};try{let l=await t(e.url,o);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw pr("fetch"),l}finally{i-=a,r--}}return rt(e,n,Ee(e.bufferSize||_p))}var fp=30;var hp=50;function _r(e,t,i,r){let n={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return i!==void 0&&(n.lineno=i),r!==void 0&&(n.colno=r),n}var vp=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Sp=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?![^(]*\) )(?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,kp=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ep=/at (.+?) ?\(data:(.+?),/,Tp=e=>{let t=e.match(Ep);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let i=vp.exec(e);if(i){let[,n,s,a]=i;return _r(n,"?",+s,+a)}let r=Sp.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=kp.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[n,s]=ga(r[1]||"?",r[2]);return _r(s,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Ip=[fp,Tp],Ap=/^\s*(.*?)(?:\(([^()]*)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Op=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wp=e=>{let t=Ap.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let n=Op.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}let i=t[3],r=t[1]||"?";return[r,i]=ga(r,i),_r(i,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},xp=[hp,wp];var Rp=[Ip,xp],ma=gt(...Rp),ga=(e,t)=>{let i=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return i||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var jt=1024,Np="Breadcrumbs",Cp=((e={})=>{let t={dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Np,setup(i){t.dom&&or(Pp(i,t.dom)),t.xhr&&cr(Dp(i)),t.fetch&&tr(Mp(i)),t.history&&ut(Up(i)),t.sentry&&i.on("beforeSendEvent",Lp(i))}}}),ba=S(Cp);function Lp(e){return function(i){_()===e&&H({category:`sentry.${i.type==="transaction"?"transaction":"event"}`,event_id:i.event_id,level:i.level,message:V(i)},{event:i})}}function Pp(e,t){return function(r){if(_()!==e)return;let n,s,a=typeof t=="object"?t.serializeAttribute:void 0,o=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;o&&o>jt&&(Z&&d.warn(`\`dom.maxStringLength\` cannot exceed ${jt}, but a value of ${o} was configured. Sentry will use ${jt} instead.`),o=jt),typeof a=="string"&&(a=[a]);try{let p=r.event,c=qp(p)?p.target:p;n=dt(c,{keyAttrs:a,maxStringLength:o}),s=rr(c)}catch{n="<unknown>"}if(n.length===0)return;let l={category:`ui.${r.name}`,message:n};s&&(l.data={"ui.component_name":s}),H(l,{event:r.event,name:r.name,global:r.global})}}function Dp(e){return function(i){if(_()!==e)return;let{startTimestamp:r,endTimestamp:n}=i,s=i.xhr[Ae];if(!r||!n||!s)return;let{method:a,url:o,status_code:l,body:p}=s,c={method:a,url:fr(o,e),status_code:l},g={xhr:i.xhr,input:p,startTimestamp:r,endTimestamp:n},m={category:"xhr",data:c,type:"http",level:qt(l)};e.emit("beforeOutgoingRequestBreadcrumb",m,g),H(m,g)}}function Mp(e){return function(i){if(_()!==e)return;let{startTimestamp:r,endTimestamp:n}=i;if(n&&!(i.fetchData.url.match(/sentry_key/)&&i.fetchData.method==="POST"))if(i.error){let s={data:i.error,input:i.args,startTimestamp:r,endTimestamp:n},a={category:"fetch",data:{...i.fetchData,url:fr(i.fetchData.url,e)},level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",a,s),H(a,s)}else{let s=i.response,a={...i.fetchData,url:fr(i.fetchData.url,e),status_code:s?.status},o={input:i.args,response:s,startTimestamp:r,endTimestamp:n},l={category:"fetch",data:a,type:"http",level:qt(a.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,o),H(l,o)}}}function Up(e){return function(i){if(_()!==e)return;let r=i.from,n=i.to,s=nt(y.location.href),a=r?nt(r):void 0,o=nt(n);a?.path||(a=s),s.protocol===o.protocol&&s.host===o.host&&(n=o.relative),s.protocol===a.protocol&&s.host===a.host&&(r=a.relative),H({category:"navigation",data:{from:X(r),to:X(n)}})}}function fr(e,t){let i=e===""?y.location?.href:void 0;return X(i?i.split("#")[0]??"":e,t)}function qp(e){return!!e&&!!e.target}var Bp="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(","),Gp="BrowserApiErrors",Fp=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Gp,setupOnce(){t.setTimeout&&T(y,"setTimeout",ya),t.setInterval&&T(y,"setInterval",ya),t.requestAnimationFrame&&T(y,"requestAnimationFrame",Hp),t.XMLHttpRequest&&"XMLHttpRequest"in y&&T(XMLHttpRequest.prototype,"send",zp);let i=t.eventTarget;i&&(Array.isArray(i)?i:Bp).forEach(r=>Yp(r,t))}}}),_a=S(Fp);function ya(e){return function(...t){let i=t[0];return t[0]=Oe(i,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${G(e)}`}}),e.apply(this,t)}}function Hp(e){return function(t){return e.apply(this,[Oe(t,{mechanism:{data:{handler:G(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function zp(e){return function(...t){let i=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in i&&typeof i[r]=="function"&&T(i,r,function(n){let s={mechanism:{data:{handler:G(n)},handled:!1,type:`auto.browser.browserapierrors.xhr.${r}`}},a=ge(n);return a&&(s.mechanism.data.handler=G(a)),Oe(n,s)})}),e.apply(this,t)}}function Yp(e,t){let i=y[e]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(T(i,"addEventListener",function(r){return function(n,s,a){try{jp(s)&&(s.handleEvent=Oe(s.handleEvent,{mechanism:{data:{handler:G(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Kp(this,n,s),r.apply(this,[n,Oe(s,{mechanism:{data:{handler:G(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),T(i,"removeEventListener",function(r){return function(n,s,a){try{if(Object.prototype.hasOwnProperty.call(s,"__sentry_wrapped__")){let o=s.__sentry_wrapped__;o&&r.call(this,n,o,a)}}catch{}return r.call(this,n,s,a)}}))}function jp(e){return typeof e.handleEvent=="function"}function Kp(e,t,i){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,i)}var fa=S((e={})=>{let t=e.lifecycle??"page";return{name:"BrowserSession",setupOnce(){if(typeof y.document>"u"){Z&&d.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Be({ignoreDuration:!0});let i=!1;ir(()=>{i||(ke(),i=!0)});let r=M(),n=r.getUser();r.addScopeListener(s=>{let a=s.getUser();(n?.id!==a?.id||n?.ip_address!==a?.ip_address)&&(n=a,i&&ke())}),t==="route"&&ut(({from:s,to:a})=>{s!==a&&(Be({ignoreDuration:!0}),ke(),i=!0)})}}});var Wp="CultureContext",Vp=(()=>({name:Wp,preprocessEvent(e){let t=ha();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=ha();t&&Xe(e,{[Xr]:t.locale,[Zr]:t.timezone,[Jr]:t.calendar})}})),va=S(Vp);function ha(){try{let e=y.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var Qp="GlobalHandlers",$p=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:Qp,setupOnce(){Error.stackTraceLimit=50},setup(i){t.onerror&&(Jp(i),Sa("onerror")),t.onunhandledrejection&&(Xp(i),Sa("onunhandledrejection"))}}}),ka=S($p);function Jp(e){Xt(t=>{let{stackParser:i,attachStacktrace:r}=Ea();if(_()!==e||mr(t))return;let{msg:n,url:s,line:a,column:o,error:l}=t,p=tc(zt(i,l||n,void 0,r,!1),s,a,o);p.level="error",qe(p,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function Xp(e){ei(t=>{let{stackParser:i,attachStacktrace:r}=Ea();if(_()!==e||mr())return;let n=Zp(t),s=q(n)?ec(n):zt(i,n,void 0,r,!0);s.level="error",qe(s,{originalException:n,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Zp(e){if(q(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 ec(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function tc(e,t,i,r){let n=e.exception=e.exception||{},s=n.values=n.values||[],a=s[0]=s[0]||{},o=a.stacktrace=a.stacktrace||{},l=o.frames=o.frames||[];return l.length===0&&l.push({colno:r,lineno:i,filename:ic(t)??Ie(),function:"?",in_app:!0}),e}function Sa(e){Z&&d.log(`Global Handler attached: ${e}`)}function Ea(){return _()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function ic(e){if(!(!D(e)||e.length===0))return e.startsWith("data:")?`<${zi(e,!1)}>`:e}var Ta=S(()=>({name:"HttpContext",preprocessEvent(e,t,i){if(!y.navigator&&!y.location&&!y.document)return;let{url:r,headers:n}=gr(i),s=i.getDataCollectionOptions().httpHeaders.request,a=Object.entries(e.request?.headers??{}).filter(([l])=>!(l in n)),o={...Ue(n,s),...Object.fromEntries(a)};e.request={url:X(r,i),...e.request,...Object.keys(o).length>0?{headers:o}:{headers:void 0}}},processSpan(e,t){if(!y.navigator&&!y.location&&!y.document)return;let i=gr(t),r=Ue(i.headers,t.getDataCollectionOptions().httpHeaders.request),n=r.Referer,{hostname:s,protocol:a}=y.location||{};Xe(e,{[an]:r["User-Agent"],[rn]:a==="file:"||s==="localhost"||s==="127.0.0.1"||s==="[::1]"||!!s?.endsWith(".localhost"),...e.is_segment&&{[sn]:e.attributes?.[Et]!=="http.client"?X(i.url):void 0,[`${tn}.referer`]:n?[n]:void 0}})}}));var rc="cause",nc=5,sc="LinkedErrors",ac=((e={})=>{let t=e.limit||nc,i=e.key||rc;return{name:sc,preprocessEvent(r,n,s){let a=s.getOptions();Xi(Ft,a.stackParser,i,t,r,n)}}}),Ia=S(ac);var oc=/^HTML(\w*)Element$/;function Aa(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(dr(e)){let t=lc(e);if(oc.test(t))return`[HTMLElement: ${dt(e)}]`}}function lc(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function Oa(){return pc()?(Z&&C(()=>{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 pc(){if(typeof y.window>"u")return!1;let e=y;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=Ie();return!(y===y.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function wa(e){return[at(),st(),Zi(),_a(),ba(),lt(),ka(),Ia(),ot(),Ta(),va(),fa()]}function hr(e={}){let t=Wi(e),i=!t.skipBrowserExtensionCheck&&Oa(),r=t.defaultIntegrations==null?wa(t):t.defaultIntegrations,n=fi({integrations:t.integrations,defaultIntegrations:r}),s={...t,...Yt(t),enabled:i?!1:t.enabled,stackParser:$t(t.stackParser||ma),integrations:n,transport:t.transport||ua};return oi(Aa),Gi(da,s)}function xa(e,t){let{dsn:i,environment:r,release:n,service:s,beforeReport:a}=e;if(!i?.trim())throw new Error("An error reporting DSN is required");return{dsn:i.trim(),environment:r,release:n,beforeSend(o){let l={event_id:o.event_id,environment:o.environment,release:o.release,exception:o.exception,message:o.message,tags:{...o.tags?.request_id?{request_id:o.tags.request_id}:{}}},p=a?a(l):l;return p?{...o,user:void 0,request:void 0,extra:void 0,contexts:void 0,breadcrumbs:void 0,exception:p.exception,message:p.message,tags:{...p.tags,runtime:t,...s?{service:s}:{}}}:null}}}var Ra=!1;function Ic(e){if(Ra)throw new Error("Browser error reporting is already initialized");hr(xa(e,"browser")),Ra=!0}function Ac(e,t={}){return Se(e,t.requestId?{tags:{request_id:t.requestId}}:void 0)}function Oc(e=2e3){return tt(e)}return Ma(wc);})();
|
|
16
|
+
/*! Bundled license information:
|
|
17
|
+
|
|
18
|
+
@sentry/core/build/esm/utils/env.js:
|
|
19
|
+
(*! __SENTRY_SDK_SOURCE__ *)
|
|
20
|
+
*/
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CaptureContext, Options } from '@error-reporting/core'
|
|
2
|
+
|
|
3
|
+
export type { CaptureContext, Options, ReportEvent } from '@error-reporting/core'
|
|
4
|
+
export function init(options: Options & { dsn: string }): void
|
|
5
|
+
export function captureException(error: unknown, context?: CaptureContext): string
|
|
6
|
+
export function flush(timeout?: number): Promise<boolean>
|
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@error-reporting/browser",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Framework-free Error Reporting Platform SDK for browsers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": { ".": { "types": "./index.d.ts", "default": "./src/index.js" } },
|
|
7
|
+
"unpkg": "./dist/error-reporting.js",
|
|
8
|
+
"jsdelivr": "./dist/error-reporting.js",
|
|
9
|
+
"files": ["src", "index.d.ts", "dist/error-reporting.js"],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"prepack": "esbuild src/index.js --bundle --minify --platform=browser --target=es2022 --format=iife --global-name=ErrorReporting --outfile=dist/error-reporting.js"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": { "@error-reporting/core": "0.1.0", "@sentry/browser": "^11.17.0" },
|
|
14
|
+
"devDependencies": { "esbuild": "^0.28.2" },
|
|
15
|
+
"publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
|
|
16
|
+
"repository": { "type": "git", "url": "git+https://gitee.com/qglove/error-reporting-platform.git", "directory": "packages/javascript/browser" }
|
|
17
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/browser'
|
|
2
|
+
import { createReportOptions } from '@error-reporting/core'
|
|
3
|
+
|
|
4
|
+
let initialized = false
|
|
5
|
+
|
|
6
|
+
/** 安装浏览器全局异常监听。
|
|
7
|
+
* @param {import('@error-reporting/core').Options & { dsn: string }} options 项目 DSN 和诊断配置。
|
|
8
|
+
*/
|
|
9
|
+
export function init(options) {
|
|
10
|
+
if (initialized) {
|
|
11
|
+
throw new Error('Browser error reporting is already initialized')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
Sentry.init(createReportOptions(options, 'browser'))
|
|
15
|
+
initialized = true
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** 补报业务代码已经捕获的异常。
|
|
19
|
+
* @param {unknown} error 原始异常或拒绝原因。
|
|
20
|
+
* @param {import('@error-reporting/core').CaptureContext} context 可选的业务请求编号。
|
|
21
|
+
*/
|
|
22
|
+
export function captureException(error, context = {}) {
|
|
23
|
+
return Sentry.captureException(error, context.requestId ? { tags: { request_id: context.requestId } } : undefined)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** 等待当前上报队列发送完毕。
|
|
27
|
+
* @param {number} timeout 等待毫秒数。
|
|
28
|
+
*/
|
|
29
|
+
export function flush(timeout = 2000) {
|
|
30
|
+
return Sentry.flush(timeout)
|
|
31
|
+
}
|