@skill-map/cli 0.67.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/tutorial/sm-tutorial/SKILL.md +16 -8
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/agents-hub/providers/agent-skills/en/agents-hub.md +2 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/agents-hub/providers/agent-skills/es/agents-hub.md +2 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/content-editor-style/providers/agent-skills/en/content-editor-style.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/content-editor-style/providers/agent-skills/es/content-editor-style.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/providers/agent-skills/en/todo-bullet-guideline.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/providers/agent-skills/en/todo-bullet-guideline2.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/providers/agent-skills/en/todo-bullet-skill.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/providers/agent-skills/es/todo-bullet-guideline.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/providers/agent-skills/es/todo-bullet-guideline2.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/providers/agent-skills/es/todo-bullet-skill.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/manifest.json +9 -1
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/harness/providers/agent-skills/en/__PROVIDER__/skills/publish/SKILL.md +15 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/harness/providers/agent-skills/es/__PROVIDER__/skills/publish/SKILL.md +16 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/harness/providers/codex/en/__PROVIDER__/skills/publish/SKILL.md +15 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/harness/providers/codex/es/__PROVIDER__/skills/publish/SKILL.md +16 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/providers/agent-skills/en/__PROVIDER__/skills/master-agent/SKILL.md +13 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/providers/agent-skills/es/__PROVIDER__/skills/master-agent/SKILL.md +14 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/providers/codex/en/.codex/agents/master-agent.toml +10 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/providers/codex/es/.codex/agents/master-agent.toml +10 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/providers/agent-skills/en/AGENTS.md +7 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/providers/agent-skills/en/__PROVIDER__/skills/content-editor/SKILL.md +20 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/providers/agent-skills/es/AGENTS.md +7 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/providers/agent-skills/es/__PROVIDER__/skills/content-editor/SKILL.md +20 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/providers/agent-skills/shared/CLAUDE.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/providers/codex/en/.codex/agents/content-editor.toml +19 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/providers/codex/es/.codex/agents/content-editor.toml +19 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/providers/codex/en/.codex/agents/demo-agent.toml +13 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/providers/codex/en/__PROVIDER__/skills/demo-command/SKILL.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/providers/codex/es/.codex/agents/demo-agent.toml +13 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/providers/codex/es/__PROVIDER__/skills/demo-command/SKILL.md +12 -0
- package/dist/cli/tutorial/sm-tutorial/references/_core.md +101 -48
- package/dist/cli/tutorial/sm-tutorial/references/_manifest.json +174 -0
- package/dist/cli/tutorial/sm-tutorial/references/_manifest.yml +90 -0
- package/dist/cli/tutorial/sm-tutorial/references/part-basic-connect.md +166 -0
- package/dist/cli/tutorial/sm-tutorial/references/part-basic-daily.md +267 -0
- package/dist/cli/tutorial/sm-tutorial/references/part-basic-fundamentals.md +350 -0
- package/dist/cli/tutorial/sm-tutorial/references/part-basic-kickoff.md +140 -0
- package/dist/cli/tutorial/sm-tutorial/references/part-connect-harness.md +6 -4
- package/dist/cli/tutorial/sm-tutorial/references/part-daily-loop.md +21 -26
- package/dist/cli/tutorial/sm-tutorial/references/part-fundamentals.md +10 -5
- package/dist/cli/tutorial/sm-tutorial/references/part-mcp.md +3 -6
- package/dist/cli/tutorial/sm-tutorial/references/part-project-kickoff.md +29 -14
- package/dist/cli/tutorial/sm-tutorial/references/part-settings.md +17 -13
- package/dist/cli/tutorial/sm-tutorial/scripts/fixtures.js +85 -22
- package/dist/cli/tutorial/sm-tutorial/scripts/lib/paths.js +74 -4
- package/dist/cli/tutorial/sm-tutorial/scripts/state.js +22 -6
- package/dist/cli.js +400 -160
- package/dist/conformance/index.js +42 -2
- package/dist/index.js +43 -30
- package/dist/kernel/index.d.ts +28 -5
- package/dist/kernel/index.js +43 -30
- package/dist/ui/chunk-3ANNEMV4.js +499 -0
- package/dist/ui/chunk-3GDWM5VM.js +2 -0
- package/dist/ui/{chunk-5BJGO7GH.js → chunk-3U4QZKU2.js} +4 -4
- package/dist/ui/chunk-3ZAHOYQ7.js +1 -0
- package/dist/ui/chunk-4F53HBGG.js +1845 -0
- package/dist/ui/{chunk-56CBK7LB.js → chunk-6FGV5O5J.js} +1 -1
- package/dist/ui/chunk-7WMT2LX4.js +1 -0
- package/dist/ui/chunk-BJUBDHJR.js +3 -0
- package/dist/ui/{chunk-276RLZR4.js → chunk-BSIR3ADF.js} +14 -14
- package/dist/ui/{chunk-FC22ZJQZ.js → chunk-CG25RHMO.js} +1 -1
- package/dist/ui/chunk-EFSC6SOL.js +3 -0
- package/dist/ui/chunk-EJVWTBMV.js +4 -0
- package/dist/ui/chunk-EZI3BXQN.js +1 -0
- package/dist/ui/{chunk-JZ2YF7EL.js → chunk-GUPPOK7U.js} +8 -8
- package/dist/ui/{chunk-CJURGJTN.js → chunk-HLALESGR.js} +1 -1
- package/dist/ui/chunk-I3I4KHR5.js +2 -0
- package/dist/ui/{chunk-BOVJVOLH.js → chunk-I6ED2OW7.js} +1 -1
- package/dist/ui/chunk-JKPG5PO7.js +375 -0
- package/dist/ui/chunk-KHDWXSGR.js +1 -0
- package/dist/ui/{chunk-HEK4PH5A.js → chunk-KMHXNOFZ.js} +1 -1
- package/dist/ui/chunk-KWT7E2RJ.js +16 -0
- package/dist/ui/{chunk-WHZVGOS3.js → chunk-MQSU6EFZ.js} +1 -1
- package/dist/ui/{chunk-43S72FTV.js → chunk-OGEE252A.js} +1 -1
- package/dist/ui/{chunk-J4J42HJ4.js → chunk-PU5OP5RN.js} +1 -1
- package/dist/ui/{chunk-UTRZTB6V.js → chunk-QVG7J2MP.js} +1 -1
- package/dist/ui/chunk-TQBXK5JN.js +1 -0
- package/dist/ui/chunk-Z7SOKILO.js +2 -0
- package/dist/ui/{chunk-WCABR6TI.js → chunk-ZRJ5ZCFR.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/ui/main-ZYRIR6DB.js +4 -0
- package/dist/ui/styles-VEGETYWD.css +1 -0
- package/package.json +17 -18
- package/dist/ui/chunk-34ZZDYNQ.js +0 -1
- package/dist/ui/chunk-444BFYGR.js +0 -3
- package/dist/ui/chunk-44VNNUSQ.js +0 -2
- package/dist/ui/chunk-4SG4352Z.js +0 -7
- package/dist/ui/chunk-5ITZXW3A.js +0 -1
- package/dist/ui/chunk-7ANZW2OI.js +0 -499
- package/dist/ui/chunk-BJ6X6WBO.js +0 -4
- package/dist/ui/chunk-CZSLV6YD.js +0 -1
- package/dist/ui/chunk-DLYJHLJX.js +0 -2
- package/dist/ui/chunk-LGFABCIA.js +0 -16
- package/dist/ui/chunk-LPDD2DHE.js +0 -369
- package/dist/ui/chunk-P3SNMV4X.js +0 -2
- package/dist/ui/chunk-S4S5ZMXJ.js +0 -3
- package/dist/ui/chunk-VHEFRMK3.js +0 -1
- package/dist/ui/chunk-X6TRIDBI.js +0 -1845
- package/dist/ui/main-V77F2KZX.js +0 -4
- package/dist/ui/styles-I4ULXD3V.css +0 -1
- /package/dist/ui/{chunk-Y2Z26SRI.js → chunk-5RNLC6V4.js} +0 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import{a as Em,b as Tm,c as ym,d as Im,e as bm,i as Am}from"./chunk-KHDWXSGR.js";import{c as Sm}from"./chunk-Z7SOKILO.js";import"./chunk-7WMT2LX4.js";import{$a as hm,F as Ma,G as Tl,K as yl,L as dm,O as Il,Sa as _m,_a as gm,a as pm,ma as mm,u as Oa}from"./chunk-EJVWTBMV.js";import{a as p,b as E,d as zt,f as fm}from"./chunk-ZRJ5ZCFR.js";var A=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var C=globalThis;var Lt="10.61.0";function lt(){return fr(C),C}function fr(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Lt,t[Lt]=t[Lt]||{}}function an(e,t,n=C){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[Lt]=r[Lt]||{};return o[e]||(o[e]=t())}var pr=["debug","info","warn","error","log","assert","trace"],fI="Sentry Logger ",qr={};function Ge(e){if(!("console"in C))return e();let t=C.console,n={},r=Object.keys(qr);r.forEach(o=>{let i=qr[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function pI(){Al().enabled=!0}function dI(){Al().enabled=!1}function vm(){return Al().enabled}function mI(...e){bl("log",...e)}function _I(...e){bl("warn",...e)}function gI(...e){bl("error",...e)}function bl(e,...t){A&&vm()&&Ge(()=>{C.console[e](`${fI}[${e}]:`,...t)})}function Al(){return A?an("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var g={enable:pI,disable:dI,isEnabled:vm,log:mI,warn:_I,error:gI};var Rm=/\(error: (.*)\)/,Nm=/captureMessage|captureException/;function Qi(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let i=[],s=n.split(`
|
|
2
|
+
`);for(let a=r;a<s.length;a++){let c=s[a];c.length>1024&&(c=c.slice(0,1024));let u=Rm.test(c)?c.replace(Rm,"$1"):c;if(!u.includes("Error: ")){for(let f of t){let l=f(u);if(l){i.push(l);break}}if(i.length>=50+o)break}}return Rl(i.slice(o))}}function Pa(e){return Array.isArray(e)?Qi(...e):e}function Rl(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(La(t).function||"")&&t.pop(),t.reverse(),Nm.test(La(t).function||"")&&(t.pop(),Nm.test(La(t).function||"")&&t.pop()),t.slice(0,50).map(n=>E(p({},n),{filename:n.filename||La(t).filename,function:n.function||"?"}))}function La(e){return e[e.length-1]||{}}var vl="<anonymous>";function ft(e){try{return!e||typeof e!="function"?vl:e.name||vl}catch{return vl}}function Yr(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Cm(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var Zi={},xm={};function tt(e,t){return Zi[e]=Zi[e]||[],Zi[e].push(t),()=>{let n=Zi[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function nt(e,t){if(!xm[e]){xm[e]=!0;try{t()}catch(n){A&&g.error(`Error while instrumenting ${e}`,n)}}}function We(e,t){let n=e&&Zi[e];if(n)for(let r of n)try{r(t)}catch(o){A&&g.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${ft(r)}
|
|
5
|
+
Error:`,o)}}var Nl=null;function es(e){let t="error";tt(t,e),nt(t,hI)}function hI(){Nl=C.onerror,C.onerror=function(e,t,n,r,o){return We("error",{column:r,error:o,line:n,msg:e,url:t}),Nl?Nl.apply(this,arguments):!1},C.onerror.__SENTRY_INSTRUMENTED__=!0}var Cl=null;function ts(e){let t="unhandledrejection";tt(t,e),nt(t,SI)}function SI(){Cl=C.onunhandledrejection,C.onunhandledrejection=function(e){return We("unhandledrejection",e),Cl?Cl.apply(this,arguments):!0},C.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var wm=Object.prototype.toString;function Ze(e){switch(wm.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return cn(e,Error)}}function Ho(e,t){return wm.call(e)===`[object ${t}]`}function Go(e){return Ho(e,"ErrorEvent")}function ns(e){return Ho(e,"DOMError")}function Ua(e){return Ho(e,"DOMException")}function Pe(e){return Ho(e,"String")}function Rn(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function je(e){return e===null||Rn(e)||typeof e!="object"&&typeof e!="function"}function xe(e){return Ho(e,"Object")}function dr(e){return typeof Event<"u"&&cn(e,Event)}function Da(e){return Ho(e,"RegExp")}function pt(e){return!!(e?.then&&typeof e.then=="function")}function cn(e,t){try{return e instanceof t}catch{return!1}}function rs(e){return typeof Request<"u"&&cn(e,Request)}function ye(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&os(o,r);try{e[t]=o}catch{A&&g.log(`Failed to replace method "${t}" in object`,e)}}function _e(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{A&&g.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function os(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,_e(e,"__sentry_original__",t)}catch{}}function mr(e){return e.__sentry_original__}function is(e){if(Ze(e))return p({message:e.message,name:e.name,stack:e.stack},km(e));if(dr(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return p(p({type:t,target:n,currentTarget:r},o?{detail:o}:{}),km(e))}return e}function km(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Ba(e){let t=Object.keys(is(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}function Fa(e){try{let t=C.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Ha(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var xl="_sentrySpan";function dt(e,t){t?_e(e,xl,Fa(t)):delete e[xl]}function un(e){return Ha(e[xl])}var $o;function Vr(e){if($o!==void 0)return $o?$o(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=C;return t in n&&typeof n[t]=="function"?($o=n[t],$o(e)):($o=null,e())}function yt(){return Vr(()=>Math.random())}function rt(){return Vr(()=>Date.now())}var Om=Symbol.for("sentry.skipNormalization"),EI=Symbol.for("sentry.overrideNormalizationDepth");function Mm(e){_e(e,Om,!0)}function Lm(e){return!!e[Om]}function Pm(e){let t=e[EI];return typeof t=="number"?t:void 0}var wl;function Ga(e){wl=e}function Se(e,t=100,n=1/0){try{return kl("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ss(e,t=3,n=100*1024){let r=Se(e,t);return II(r)>n?ss(e,t-1,n):r}function kl(e,t,n=1/0,r=1/0,o=bI()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=Ol(e,t);if(!a.startsWith("[object "))return a;if(Lm(t))return t;let c=Pm(t),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(i(t))return"[Circular ~]";let f=t;if(f&&typeof f.toJSON=="function")try{let _=f.toJSON();return kl("",_,u-1,r,o)}catch{}let l=Array.isArray(t)?[]:{},m=0,d=is(t);for(let _ in d){if(!Object.prototype.hasOwnProperty.call(d,_))continue;if(m>=r){l[_]="[MaxProperties ~]";break}let h=d[_];l[_]=kl(_,h,u-1,r,o),m++}return s(t),l}function Ol(e,t){try{if(wl){let r=wl(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${ft(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${TI(t)}]`}catch(n){return`**non-serializable** (${n})`}}function TI(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function yI(e){return~-encodeURI(e).split(/%..|./).length}function II(e){return yI(JSON.stringify(e))}function bI(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function ln(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Wo(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function _r(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];je(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(Ol(void 0,o))}return n.join(t)}function gr(e,t,n=!1){return Pe(e)?Da(t)?t.test(e):Pe(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function ze(e,t=[],n=!1){for(let r of t)if(gr(e,r,n))return!0;return!1}function AI(){let e=C;return e.crypto||e.msCrypto}var Ml;function vI(){return yt()*16}function ge(e=AI()){try{if(e?.randomUUID)return Vr(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Ml||(Ml="10000000100040008000"+1e11),Ml.replace(/[018]/g,t=>(t^(vI()&15)>>t/4).toString(16))}function Um(e){return e.exception?.values?.[0]}function fn(e){let{message:t,event_id:n}=e;if(t)return t;let r=Um(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Kr(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function Je(e,t){let n=Um(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism=p(p(p({},r),o),t),t&&"data"in t){let i=p(p({},o?.data),t.data);n.mechanism.data=i}}function $a(e,t,n=5){if(t.lineno===void 0)return;let r=e.length,o=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,o-n),o).map(s=>Wo(s,0));let i=Math.min(r-1,o);t.context_line=Wo(e[i],t.colno||0),t.post_context=e.slice(Math.min(o+1,r),o+1+n).map(s=>Wo(s,0))}function as(e){if(Ll(e))return!0;try{_e(e,"__sentry_captured__",!0)}catch{}return!1}function Ll(e){try{return e.__sentry_captured__}catch{}}var Bm=1e3;function It(){return rt()/Bm}function RI(){let{performance:e}=C;if(!e?.now||!e.timeOrigin)return It;let t=e.timeOrigin;return()=>(t+Vr(()=>e.now()))/Bm}var Dm;function ne(){return(Dm??(Dm=RI()))()}var Pl=null;function NI(){let{performance:e}=C;if(!e?.now)return;let t=3e5,n=Vr(()=>e.now()),r=rt(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;let i=e.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<t?i:r-n}function pe(){return Pl===null&&(Pl=NI()),Pl}function Fm(e){let t=ne(),n={sid:ge(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>CI(n)};return e&&jn(n,e),n}function jn(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||ne(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:ge()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Hm(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),jn(e,n)}function CI(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 hr(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r=p({},e);for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=hr(r[o],t[o],n-1));return r}function et(){return ge()}function ot(){return ge().substring(16)}var xI=100,mt=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:et(),sampleRand:yt()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags=p({},this._tags),t._attributes=p({},this._attributes),t._extra=p({},this._extra),t._contexts=p({},this._contexts),this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata=p({},this._sdkProcessingMetadata),t._propagationContext=p({},this._propagationContext),t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,dt(t,un(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&jn(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags=p(p({},this._tags),t),this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes=p(p({},this._attributes),t),this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra=p(p({},this._extra),t),this._notifyScopeListeners(),this}setExtra(t,n){return this._extra=E(p({},this._extra),{[t]:n}),this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():xe(n)?t:void 0,{tags:o,attributes:i,extra:s,user:a,contexts:c,level:u,fingerprint:f=[],propagationContext:l,conversationId:m}=r||{};return this._tags=p(p({},this._tags),o),this._attributes=p(p({},this._attributes),i),this._extra=p(p({},this._extra),s),this._contexts=p(p({},this._contexts),c),a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),f.length&&(this._fingerprint=f),l&&(this._propagationContext=l),m&&(this._conversationId=m),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,dt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:et(),sampleRand:yt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:xI;if(r<=0)return this;let o=E(p({timestamp:It()},t),{message:t.message?ln(t.message,2048):t.message});return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:un(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=hr(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||ge();if(!this._client)return A&&g.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,E(p({originalException:t,syntheticException:o},n),{event_id:r}),this),r}captureMessage(t,n,r){let o=r?.event_id||ge();if(!this._client)return A&&g.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,E(p({originalException:t,syntheticException:i},r),{event_id:o}),this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||ge();return this._client?(this._client.captureEvent(t,E(p({},n),{event_id:r}),this),r):(A&&g.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 Gm(){return an("defaultCurrentScope",()=>new mt)}function $m(){return an("defaultIsolationScope",()=>new mt)}var Wm=e=>e instanceof Promise&&!e[jm],jm=Symbol("chained PromiseLike"),Wa=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Wm(r)&&Wm(e)?r:wI(e,r)},wI=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...i)=>o.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[jm]:!0}),t};var Ul=class{constructor(t,n){let r;t?r=t:r=new mt;let o;n?o=n:o=new mt,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return pt(r)?Wa(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function jo(){let e=lt(),t=fr(e);return t.stack=t.stack||new Ul(Gm(),$m())}function kI(e){return jo().withScope(e)}function OI(e,t){let n=jo();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function zm(e){return jo().withScope(()=>e(jo().getIsolationScope()))}function qm(){return{withIsolationScope:zm,withScope:kI,withSetScope:OI,withSetIsolationScope:(e,t)=>zm(t),getCurrentScope:()=>jo().getScope(),getIsolationScope:()=>jo().getIsolationScope()}}function qt(e){let t=fr(e);return t.acs?t.acs:qm()}function MI(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function LI(e,t){let{value:n,unit:r}=MI(e)?e:{value:e,unit:void 0},o=PI(n),i=r&&typeof r=="string"?{unit:r}:{};if(o)return p(p({},o),i);if(!t||t==="skip-undefined"&&n===void 0)return;let s="";try{s=JSON.stringify(n)??""}catch{}return p({value:s,type:"string"},i)}function zn(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=LI(o,t);i&&(n[r]=i)}return n}function Dl(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let o=r.value;Array.isArray(o)?t+=Ym(o[0])*o.length:je(o)?t+=Ym(o):t+=100}return t}function Ym(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function PI(e){if(Array.isArray(e))return{value:e,type:"array"};let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var Vm;function Bl(){return Vm?.()}function ja(){return Vm!==void 0}function w(){let e=lt();return qt(e).getCurrentScope()}function re(){let e=lt();return qt(e).getIsolationScope()}function pn(){return an("globalScope",()=>new mt)}function $e(...e){let t=lt(),n=qt(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function za(...e){let t=lt(),n=qt(t);if(e.length===2){let[r,o]=e;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(e[0])}function I(){return w().getClient()}function zo(e){let t=Bl();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=n,s={trace_id:r,span_id:i||ot()};return o&&(s.parent_span_id=o),s}var Ie="sentry.source",qn="sentry.sample_rate",qo="sentry.previous_trace_sample_rate",Z="sentry.op",G="sentry.origin",Yn="sentry.idle_span_finish_reason",dn="sentry.measurement_unit",mn="sentry.measurement_value",qa="sentry.release",Ya="sentry.environment",Va="sentry.segment.name",Ka="sentry.segment.id",Ja="sentry.sdk.name",Xa="sentry.sdk.version",Qa="sentry.sdk.integrations",Za="user.id",ec="user.email",tc="user.ip_address",nc="user.name",Jr="sentry.custom_span_name",Xr="sentry.profile_id",it="sentry.exclusive_time";var rc="http.request.method",oc="url.full",ic="sentry.link.type",sc="gen_ai.conversation.id";function Fl(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}function Vn(e,t){e.setAttribute("http.response.status_code",t);let n=Fl(t);n.message!=="unknown_error"&&e.setStatus(n)}var Km="_sentryScope",Jm="_sentryIsolationScope",UI=Symbol.for("sentry.otelSourceInference");function Sr(e,t,n){e&&(_e(e,Jm,Fa(n)),_e(e,Km,t))}function Nn(e){let t=e;return{scope:t[Km],isolationScope:Ha(t[Jm])}}function Xm(e){return e[UI]===!0}var cs="sentry-";var DI=8192;function Yo(e){let t=BI(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(cs)){let s=o.slice(cs.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function ac(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${cs}${r}`]=o),n),{});return FI(t)}function BI(e){if(!(!e||!Pe(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=Qm(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):Qm(e)}function Qm(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function FI(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,s=o===0?i:`${t},${i}`;return s.length>DI?(A&&g.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var HI=/^o(\d+)\./,GI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function $I(e){return e==="http"||e==="https"}function qe(e,t=!1){let{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${s}`}function cc(e){let t=GI.exec(e);if(!t){Ge(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",i="",s="",a=""]=t.slice(1),c="",u=a,f=u.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),u=f.pop()),u){let l=u.match(/^\d+/);l&&(u=l[0])}return Zm({host:i,pass:o,path:c,projectId:u,port:s,protocol:n,publicKey:r})}function Zm(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function WI(e){if(!A)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(g.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?$I(r)?t&&isNaN(parseInt(t,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function jI(e){return e.match(HI)?.[1]}function uc(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=jI(n)),r}function us(e){let t=typeof e=="string"?cc(e):Zm(e);if(!(!t||!WI(t)))return t}function Pt(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 lc=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function e_(e){if(!e)return;let t=e.match(lc);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function ls(e,t){let n=e_(e),r=Yo(t);if(!n?.traceId)return{traceId:et(),sampleRand:yt()};let o=zI(n,r);r&&(r.sample_rand=o.toString());let{traceId:i,parentSpanId:s,parentSampled:a}=n;return{traceId:i,parentSpanId:s,sampled:a,dsc:r||{},sampleRand:o}}function fs(e=et(),t=ot(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function ps(e=et(),t=ot(),n){return`00-${e}-${t}-${n?"01":"00"}`}function zI(e,t){let n=Pt(t?.sample_rand);if(n!==void 0)return n;let r=Pt(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?yt()*r:r+yt()*(1-r):yt()}function Hl(e,t){let n=uc(e);return t&&n&&t!==n?(g.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):(e.getOptions().strictTraceContinuation||!1)&&(t&&!n||!t&&n)?(g.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}var fc=0,ms=1,t_=!1;function o_(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:c}=P(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:c}}function Vo(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:P(e).parent_span_id,i=Nn(e).scope,s=r?i?.getPropagationContext().propagationSpanId||ot():t;return{parent_span_id:o,span_id:s,trace_id:n}}function _s(e){let{traceId:t,spanId:n}=e.spanContext(),r=Xe(e);return fs(t,n,r)}function i_(e){let{traceId:t,spanId:n}=e.spanContext(),r=Xe(e);return ps(t,n,r)}function gs(e){if(e&&e.length>0)return e.map(s=>{var a=s,{context:c}=a,u=c,{spanId:t,traceId:n,traceFlags:r}=u,o=zt(u,["spanId","traceId","traceFlags"]),{attributes:i}=a;return p({span_id:t,trace_id:n,sampled:r===ms,attributes:i},o)})}function $l(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===ms,attributes:o}))}function bt(e){return typeof e=="number"?n_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?n_(e.getTime()):ne()}function n_(e){return e>9999999999?e/1e3:e}function P(e){if(c_(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(a_(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:s_(e),start_timestamp:bt(o),timestamp:bt(s)||void 0,status:hs(a),op:r[Z],origin:r[G],links:gs(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Er(e){if(c_(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(a_(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:c}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:s_(e),start_timestamp:bt(o),end_timestamp:bt(s),is_segment:e===Zr(e),status:Wl(a),attributes:r,links:$l(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Zr(e)}}function s_(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function pc(e){return E(p({},e),{attributes:zn(e.attributes),links:e.links?.map(t=>E(p({},t),{attributes:zn(t.attributes)}))})}function a_(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function c_(e){return typeof e.getSpanJSON=="function"}function Xe(e){let{traceFlags:t}=e.spanContext();return t===ms}function hs(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function Wl(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var Qr="_sentryChildSpans",Gl="_sentryRootSpan";function Ko(e,t){let n=e[Gl]||e;_e(t,Gl,n),e[Qr]?e[Qr].add(t):_e(e,Qr,new Set([t]))}function u_(e,t){e[Qr]&&e[Qr].delete(t)}function Kn(e){let t=new Set;function n(r){if(!t.has(r)&&Xe(r)){t.add(r);let o=r[Qr]?Array.from(r[Qr]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var oe=Zr;function Zr(e){return e[Gl]||e}function te(){let e=lt(),t=qt(e);return t.getActiveSpan?t.getActiveSpan():un(w())}function eo(){t_||(Ge(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),t_=!0)}function jl(e,t){e.updateName(t),e.setAttributes({[Ie]:"custom",[Jr]:t})}var l_=!1;function dc(){if(l_)return;function e(){let t=te(),n=t&&oe(t);if(n){let r="internal_error";A&&g.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}l_=!0,es(e),ts(e)}function Oe(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||I()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function f_(e){g.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Jn(e,t){if(!t?.length)return!1;for(let n of t){if(YI(n)){if(e.description&&gr(e.description,n))return A&&f_(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?e.description&&gr(e.description,n.name):!0,i=n.op?e.op&&gr(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,c])=>qI(e.attributes?.[a],c)):!0;if(o&&i&&s)return A&&f_(e),!0}return!1}function qI(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?gr(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function p_(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function YI(e){return typeof e=="string"||e instanceof RegExp}var d_=Symbol.for("sentry.nonRecordingSpan"),At=class{constructor(t={}){this._traceId=t.traceId||et(),this._spanId=t.spanId||ot(),this.dropReason=t.dropReason,_e(this,d_,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:fc}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}};function Cn(e){return!!e&&e[d_]===!0}var _n="production";var m_="_frozenDsc";function zl(e,t){_e(e,m_,t)}function mc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||_n,release:n.release,public_key:r,trace_id:e,org_id:uc(t)};return t.emit("createDsc",o),o}function Xn(e,t){let n=t.getPropagationContext();return n.dsc||mc(n.traceId,e)}function Be(e){let t=I();if(!t)return{};let n=oe(e),r=P(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[qn]??o[qo];function a(_){return(typeof s=="number"||typeof s=="string")&&(_.sample_rate=`${s}`),_}let c=n[m_];if(c)return a(c);if(Cn(n)&&!Oe(t.getOptions())){let _=Nn(n).scope;if(_)return a(p({},Xn(t,_)))}let u=i?.get("sentry.dsc"),f=u&&Yo(u);if(f)return a(f);let l=mc(e.spanContext().traceId,t),m=o[Ie]??o["sentry.span.source"],d=r.description;return m!=="url"&&d&&(l.transaction=d),Oe()&&(l.sampled=String(Xe(n)),l.sample_rand=i?.get("sentry.sample_rand")??Nn(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function ql(e){let t=Be(e);return ac(t)}function __(e){return _e(e,"_streamed",!0),e}function Qn(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Me(e,t=[]){return[e,t]}function Ss(e,t){let[n,r]=e;return[n,[...r,t]]}function vt(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function to(e,t){return vt(e,(n,r)=>t.includes(r))}function _c(e){let t=fr(C);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function VI(e){let t=fr(C);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function Zn(e){let[t,n]=e,r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[_c(r),i]:r.push(typeof i=="string"?_c(i):i)}for(let i of n){let[s,a]=i;if(o(`
|
|
6
|
+
${JSON.stringify(s)}
|
|
7
|
+
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(Se(a))}o(c)}}return typeof r=="string"?r:KI(r)}function KI(e){let t=e.reduce((o,i)=>o+i.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function gc(e){let t=typeof e=="string"?_c(e):e;function n(s){let a=t.subarray(0,s);return t=t.subarray(s+1),a}function r(){let s=t.indexOf(10);return s<0&&(s=t.length),JSON.parse(VI(n(s)))}let o=r(),i=[];for(;t.length;){let s=r(),a=typeof s.length=="number"?s.length:void 0;i.push([s,a?n(a):r()])}return[o,i]}function hc(e){return[{type:"span"},e]}function Sc(e){let t=typeof e.data=="string"?_c(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var g_={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function JI(e){return e in g_}function Es(e){return JI(e)?g_[e]:e}function gn(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Jo(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return p(p(p({event_id:e.event_id,sent_at:new Date(rt()).toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:qe(r)}),o&&{trace:o})}function XI(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk=E(p({},n),{name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?p(p({},e.sdk?.settings),t.settings):void 0}),e}function h_(e,t,n,r){let o=gn(n),i=p(p({sent_at:new Date(rt()).toISOString()},o&&{sdk:o}),!!r&&t&&{dsn:qe(t)}),s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Me(i,[s])}function S_(e,t,n,r){let o=gn(n),i=e.type&&e.type!=="replay_event"?e.type:"event";XI(e,n?.sdk);let s=Jo(e,o,r,t);return delete e.sdkProcessingMetadata,Me(s,[[{type:i},e]])}function E_(e,t){function n(d){return!!d.trace_id&&!!d.public_key}let r=Be(e[0]),o=t?.getDsn(),i=t?.getOptions().tunnel,s=p(p({sent_at:new Date(rt()).toISOString()},n(r)&&{trace:r}),!!i&&o&&{dsn:qe(o)}),{beforeSendSpan:a,ignoreSpans:c}=t?.getOptions()||{},u=c?.length?e.filter(d=>{let _=P(d);return!Jn({description:_.description,op:_.op,attributes:_.data},c)}):e,f=e.length-u.length;f&&t?.recordDroppedEvent("before_send","span",f);let l=a?d=>{let _=P(d),h=Qn(a)?_:a(_);return h||(eo(),_)}:P,m=[];for(let d of u){let _=l(d);_&&m.push(hc(_))}return Me(s,m)}function T_(e){if(!A)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=P(e),{spanId:o}=e.spanContext(),i=Xe(e),s=oe(e),a=s===e,c=`[Tracing] Starting ${i?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){let{op:f,description:l}=P(s);u.push(`root ID: ${s.spanContext().spanId}`),f&&u.push(`root op: ${f}`),l&&u.push(`root description: ${l}`)}g.log(`${c}
|
|
8
|
+
${u.join(`
|
|
9
|
+
`)}`)}function y_(e){if(!A)return;let{description:t="< unknown name >",op:n="< unknown op >"}=P(e),{spanId:r}=e.spanContext(),i=oe(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;g.log(s)}function Xo(e,t,n,r=te()){let o=r&&oe(r);o&&(A&&g.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[mn]:t,[dn]:n}))}function Ts(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[dn],i=r[mn];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function Fe(e){return e.getOptions().traceLifecycle==="stream"}var I_=1e3,Tr=class{constructor(t={}){this._traceId=t.traceId||et(),this._spanId=t.spanId||ot(),this._startTime=t.startTimestamp||ne(),this._links=t.links,this._attributes={},this.setAttributes(p({[G]:"manual",[Z]:t.op},t.attributes)),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){let{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?ms:fc}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=bt(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,Xm(this)||this.setAttribute(Ie,"custom"),this}end(t){this._endTime||(this._endTime=bt(t),y_(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Z],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:hs(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[G],profile_id:this._attributes[Xr],exclusive_time:this._attributes[it],measurements:Ts(this._events),is_segment:this._isStandaloneSpan&&oe(this)===this||void 0,segment_id:this._isStandaloneSpan?oe(this).spanContext().spanId:void 0,links:gs(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===oe(this),status:Wl(this._status),attributes:this._attributes,links:$l(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){A&&g.log("[Tracing] Adding an event to span:",t);let o=b_(n)?n:r||ne(),i=b_(n)?{}:n||{},s={name:t,time:bt(o),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let t=I();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===oe(this)))return;if(this._isStandaloneSpan){this._sampled?ZI(E_([this],t)):(A&&g.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Fe(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(Nn(this).scope||w()).captureEvent(r)}_convertSpanToTransaction(){if(!A_(P(this)))return;this._name||(A&&g.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=Nn(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=Kn(this).filter(l=>l!==this&&!QI(l)).map(l=>P(l)).filter(A_),s=this._attributes[Ie];delete this._attributes[Jr];let a=!1;i.forEach(l=>{delete l.data[Jr],l.op?.startsWith("gen_ai.")&&(a=!0)});let c=p({contexts:{trace:o_(this)},spans:i.length>I_?i.sort((l,m)=>l.start_timestamp-m.start_timestamp).slice(0,I_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:Be(this),hasGenAiSpans:a},request:r},s&&{transaction_info:{source:s}}),u=Ts(this._events);return u&&Object.keys(u).length&&(A&&g.log("[Measurements] Adding measurements to transaction event",JSON.stringify(u,void 0,2)),c.measurements=u),c}};function b_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function A_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function QI(e){return e instanceof Tr&&e.isStandaloneSpan()}function ZI(e){let t=I();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function ys(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(i){throw t(i),n(),i}return eb(o,t,n,r)}function eb(e,t,n,r){return pt(e)?Wa(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function v_(e,t,n){if(!Oe(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler(E(p({},t),{inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a})),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);let i=Pt(o);if(i===void 0)return A&&g.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!i)return A&&g.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];let s=n<i;return s||A&&g.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[s,i,r]}var Is="__SENTRY_SUPPRESS_TRACING__";function Ve(e,t){let n=Qo();if(n.startSpan)return n.startSpan(e,t);let r=Jl(e),{forceTransaction:o,parentSpan:i,scope:s}=e,a=s?.clone();return $e(a,()=>N_(i)(()=>{let u=w(),f=Xl(u,i),l=I(),d=e.onlyIfParent&&!f?Vl(u,l):Kl({parentSpan:f,spanArguments:r,forceTransaction:o,scope:u});return(!C_(d)||!f)&&dt(u,d),ys(()=>t(d),()=>{let{status:_}=P(d);d.isRecording()&&(!_||_==="ok")&&d.setStatus({code:2,message:"internal_error"})},()=>{d.end()})}))}function _t(e,t){let n=Qo();if(n.startSpanManual)return n.startSpanManual(e,t);let r=Jl(e),{forceTransaction:o,parentSpan:i,scope:s}=e,a=s?.clone();return $e(a,()=>N_(i)(()=>{let u=w(),f=Xl(u,i),m=e.onlyIfParent&&!f?Vl(u,I()):Kl({parentSpan:f,spanArguments:r,forceTransaction:o,scope:u});return(!C_(m)||!f)&&dt(u,m),ys(()=>t(m,()=>m.end()),()=>{let{status:d}=P(m);m.isRecording()&&(!d||d==="ok")&&m.setStatus({code:2,message:"internal_error"})})}))}function Ue(e){let t=Qo();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=Jl(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>$e(e.scope,s):o!==void 0?s=>yr(o,s):s=>s())(()=>{let s=w(),a=Xl(s,o),c=I();return e.onlyIfParent&&!a?Vl(s,c):Kl({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}var Yl=(e,t)=>{let n=lt(),r=qt(n);if(r.continueTrace)return r.continueTrace(e,t);let{sentryTrace:o,baggage:i}=e,s=I(),a=Yo(i);return s&&!Hl(s,a?.org_id)?Ec(t):$e(c=>{let u=ls(o,i);return c.setPropagationContext(u),dt(c,void 0),t()})};function yr(e,t){let n=Qo();return n.withActiveSpan?n.withActiveSpan(e,t):$e(r=>(dt(r,e||void 0),t(r)))}function bs(e){let t=Qo();return t.suppressTracing?t.suppressTracing(e):$e(n=>{n.setSDKProcessingMetadata({[Is]:!0});let r=e();return n.setSDKProcessingMetadata({[Is]:void 0}),r})}function Ec(e){let t=Qo();return t.startNewTrace?t.startNewTrace(e):$e(n=>(n.setPropagationContext({traceId:et(),sampleRand:yt()}),A&&g.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),yr(null,e)))}function Vl(e,t){t?.recordDroppedEvent("no_parent_span","span");let n=new At({traceId:e.getPropagationContext().traceId});return Sr(n,e,re()),n}function Kl({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){let o=re();if(!Oe()){let a=p(p({},o.getPropagationContext()),r.getPropagationContext()),c=e?e.spanContext().traceId:a.traceId,u=new At({traceId:c});return e&&!n&&Ko(e,u),Sr(u,r,o),u}let i=I();if(nb(i,t)){Ql(r)||i?.recordDroppedEvent("ignored","span");let a=new At({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});return Sr(a,r,o),a}let s;if(e&&!n)s=tb(e,r,t,o),Ko(e,s);else if(e){let a=Be(e),{traceId:c,spanId:u}=e.spanContext(),f=Xe(e);s=R_(p({traceId:c,parentSpanId:u},t),r,o,f),zl(s,a)}else{let{traceId:a,dsc:c,parentSpanId:u,sampled:f}=p(p({},o.getPropagationContext()),r.getPropagationContext());s=R_(p({traceId:a,parentSpanId:u},t),r,o,f),c&&zl(s,c)}return T_(s),s}function Jl(e){let t=e.experimental||{},n=p({isStandalone:t.standalone},e);if(e.startTime){let r=p({},n);return r.startTimestamp=bt(e.startTime),delete r.startTime,r}return n}function Qo(){let e=lt();return qt(e)}function R_(e,t,n,r){let o=I(),i=o?.getOptions()||{},{name:s=""}=e,a={spanAttributes:p({},e.attributes),spanName:s,parentSampled:r};o?.emit("beforeSampling",a,{decision:!1});let c=a.parentSampled??r,u=a.spanAttributes,f=t.getPropagationContext(),l=Ql(t),[m,d,_]=l?[!1]:v_(i,{name:s,parentSampled:c,attributes:u,parentSampleRate:Pt(f.dsc?.sample_rate)},f.sampleRand),h=new Tr(E(p({},e),{attributes:p({[Ie]:"custom",[qn]:d!==void 0&&_?d:void 0},u),sampled:m}));return!m&&o&&!l&&(A&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),o.recordDroppedEvent("sample_rate",Fe(o)?"span":"transaction")),Sr(h,t,n),o&&o.emit("spanStart",h),h}function tb(e,t,n,r){let{spanId:o,traceId:i}=e.spanContext(),s=Ql(t),a=s?!1:Xe(e),c=a?new Tr(E(p({},n),{parentSpanId:o,traceId:i,sampled:a})):new At({traceId:i});Ko(e,c),Sr(c,t,r);let u=I();return u&&(Fe(u)&&Cn(c)&&(Cn(e)&&e.dropReason?(c.dropReason=e.dropReason,u.recordDroppedEvent(e.dropReason,"span")):s||(c.dropReason="sample_rate",u.recordDroppedEvent("sample_rate","span"))),u.emit("spanStart",c),n.endTimestamp&&(u.emit("spanEnd",c),u.emit("afterSpanEnd",c))),c}function Xl(e,t){if(t)return t;if(t===null)return;let n=un(e);if(!n)return;let r=I();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?oe(n):n}function N_(e){return e!==void 0?t=>yr(e,t):t=>t()}function nb(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Fe(e)||!n?.length?!1:Jn({description:t.name||"",op:t.attributes?.[Z]||t.op,attributes:t.attributes},n)}function C_(e){return Cn(e)&&e.dropReason==="ignored"}function Ql(e){return e.getScopeData().sdkProcessingMetadata[Is]===!0}var Zo={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},rb="heartbeatFailed",ob="idleTimeout",ib="finalTimeout",sb="externalFinish";function Tc(e,t={}){let n=new Map,r=!1,o,i=sb,s=!t.disableAutoFinish,a=[],{idleTimeout:c=Zo.idleTimeout,finalTimeout:u=Zo.finalTimeout,childSpanTimeout:f=Zo.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:m=!0}=t,d=I(),_=w();if(!d||!Oe()){let y=new At({traceId:_.getPropagationContext().traceId});return Sr(y,_,re()),y}let h=te(),S=ab(e);S.end=new Proxy(S.end,{apply(y,O,Y){if(l&&l(S),Cn(O))return;let[N,...B]=Y,M=N||ne(),F=bt(M),j=Kn(S).filter(H=>H!==S),ae=P(S);if(!j.length||!m)return D(F),Reflect.apply(y,O,[F,...B]);let ue=d.getOptions().ignoreSpans,z=j?.reduce((H,ce)=>{let le=P(ce);return!le.timestamp||ue&&Jn({description:le.description,op:le.op,attributes:le.data},ue)?H:H?Math.max(H,le.timestamp):le.timestamp},void 0),L=ae.start_timestamp,q=Math.min(L?L+u/1e3:1/0,Math.max(L||-1/0,Math.min(F,z||1/0)));return D(q),Reflect.apply(y,O,[q,...B])}});function T(){o&&(clearTimeout(o),o=void 0)}function b(y){T(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=ob,S.end(y))},c)}function k(y){o=setTimeout(()=>{!r&&s&&(i=rb,S.end(y))},f)}function R(y){T(),n.set(y,!0);let O=ne();k(O+f/1e3)}function U(y){if(n.has(y)&&n.delete(y),n.size===0){let O=ne();b(O+c/1e3)}}function D(y){r=!0,n.clear(),a.forEach(j=>j()),dt(_,h);let O=P(S),{start_timestamp:Y}=O;if(!Y)return;O.data[Yn]||S.setAttribute(Yn,i);let B=O.status;(!B||B==="unknown")&&S.setStatus({code:1}),g.log(`[Tracing] Idle span "${O.op}" finished`);let M=Kn(S).filter(j=>j!==S),F=0;M.forEach(j=>{j.isRecording()&&(j.setStatus({code:2,message:"cancelled"}),j.end(y),A&&g.log("[Tracing] Cancelling span since span ended early",JSON.stringify(j,void 0,2)));let ae=P(j),{timestamp:ue=0,start_timestamp:z=0}=ae,L=z<=y,q=(u+c)/1e3,H=ue-z<=q;if(A){let ce=JSON.stringify(j,void 0,2);L?H||g.log("[Tracing] Discarding span since it finished after idle span final timeout",ce):g.log("[Tracing] Discarding span since it happened after idle span was finished",ce)}(!H||!L)&&(u_(S,j),F++)}),F>0&&S.setAttribute("sentry.idle_span_discarded_spans",F)}return a.push(d.on("spanStart",y=>{if(r||y===S||P(y).timestamp||y instanceof Tr&&y.isStandaloneSpan())return;Kn(S).includes(y)&&R(y.spanContext().spanId)})),a.push(d.on("spanEnd",y=>{r||U(y.spanContext().spanId)})),a.push(d.on("idleSpanEnableAutoFinish",y=>{y===S&&(s=!0,b(),n.size&&k())})),t.disableAutoFinish||b(),setTimeout(()=>{r||(S.setStatus({code:2,message:"deadline_exceeded"}),i=ib,S.end())},u),S}function ab(e){let t=Ue(e);return dt(w(),t),A&&g.log("[Tracing] Started span is an idle span"),t}var cb=["addListener","on","once","prependListener","prependOnceListener","addEventListener"],ub=["removeListener","off","removeEventListener"],x_=Symbol("SentryScopeBoundListeners"),ei;function lb(e){return ei!==void 0&&(e===ei||e.listener===ei)}function w_(e,t=w()){let n=e;if(yc(n))return e;Zl(n);for(let r of cb)typeof n[r]=="function"&&(n[r]=pb(n,n[r],t));for(let r of ub)typeof n[r]=="function"&&(n[r]=db(n,n[r]));return typeof n.removeAllListeners=="function"&&(n.removeAllListeners=mb(n,n.removeAllListeners)),e}function fb(e,t){return function(...n){return $e(t,()=>e.apply(this,n))}}function k_(e){return typeof e=="function"}function pb(e,t,n){return function(...r){let o=r[0],i=r[1],s=r.slice(2);if(!k_(i)||lb(i))return t.apply(this,r);let a=yc(e)||Zl(e),c=a.get(o);c||(c=new WeakMap,a.set(o,c));let u=c.get(i);u||(u=fb(i,n),c.set(i,u));let f=ei;ei=u;try{return t.call(this,o,u,...s)}finally{ei=f}}}function db(e,t){return function(...n){let r=n[0],o=n[1],i=n.slice(2),s=k_(o)?yc(e)?.get(r)?.get(o):void 0;return s?t.call(this,r,s,...i):t.apply(this,n)}}function mb(e,t){return function(...n){let r=yc(e);if(r)if(n.length===0)Zl(e);else{let o=n[0];r.delete(o)}return t.apply(this,n)}}function Zl(e){let t=new Map;return e[x_]=t,t}function yc(e){return e[x_]}function M_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;_b(e,t),r&&Sb(e,r),Eb(e,n),gb(e,o),hb(e,i)}function O_(e,t){let{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:f,eventProcessors:l,attachments:m,propagationContext:d,transactionName:_,span:h}=t;As(e,"extra",n),As(e,"tags",r),As(e,"attributes",o),As(e,"user",i),As(e,"contexts",s),e.sdkProcessingMetadata=hr(e.sdkProcessingMetadata,c,2),a&&(e.level=a),_&&(e.transactionName=_),h&&(e.span=h),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),f.length&&(e.fingerprint=[...e.fingerprint,...f]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),m.length&&(e.attachments=[...e.attachments,...m]),e.propagationContext=p(p({},e.propagationContext),d)}function As(e,t,n){e[t]=hr(e[t],n,1)}function xn(e,t){let n=pn().getScopeData();return e&&O_(n,e.getScopeData()),t&&O_(n,t.getScopeData()),n}function _b(e,t){let{extra:n,tags:r,user:o,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra=p(p({},n),e.extra)),Object.keys(r).length&&(e.tags=p(p({},r),e.tags)),Object.keys(o).length&&(e.user=p(p({},o),e.user)),Object.keys(i).length&&(e.contexts=p(p({},i),e.contexts)),s&&(e.level=s),a&&e.type!=="transaction"&&(e.transaction=a)}function gb(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function hb(e,t){e.sdkProcessingMetadata=p(p({},e.sdkProcessingMetadata),t)}function Sb(e,t){e.contexts=p({trace:Vo(t)},e.contexts),e.sdkProcessingMetadata=p({dynamicSamplingContext:Be(t)},e.sdkProcessingMetadata);let n=oe(t),r=P(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Eb(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 L_(e){let t={},{response:n,profile:r,cloud_resource:o,culture:i,state:s}=e;if(n&&(n.status_code!=null&&(t["http.response.status_code"]=n.status_code),n.body_size!=null&&(t["http.response.body.size"]=n.body_size)),r&&(r.profile_id&&(t["sentry.profile_id"]=r.profile_id),r.profiler_id&&(t["sentry.profiler_id"]=r.profiler_id)),o)for(let[u,f]of Object.entries(o))f!=null&&(t[u]=f);i&&(i.locale&&(t["culture.locale"]=i.locale),i.timezone&&(t["culture.timezone"]=i.timezone)),s?.state&&typeof s.state.type=="string"&&(t["state.type"]=s.state.type);let a=e.angular;if(a){let u=a.version;(typeof u=="string"||typeof u=="number")&&(t["angular.version"]=u)}let c=e.react;if(c){let u=c.version;(typeof u=="string"||typeof u=="number")&&(t["react.version"]=u)}return t}function Ic(e,t){let n=Er(e),r=Zr(e),o=Er(r),{isolationScope:i,scope:s}=Nn(e),a=xn(i,s);Ib(n,o,t,a);let c=e.kind;t.emit("preprocessSpan",n,{spanKind:c}),n.is_segment&&(Tb(n,a),yb(n,t),t.emit("processSegmentSpan",n)),t.emit("processSpan",n);let{beforeSendSpan:u}=t.getOptions(),f=u&&Qn(u)?bb(n,u):n,l=f.attributes?.[Ie];return l&&Ut(f,{"sentry.span.source":l}),E(p({},pc(f)),{_segmentSpan:r})}function Tb(e,t){let n=L_(t.contexts);Ut(e,n)}function Ut(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function yb(e,t){let n=t.getIntegrationNames();n.length&&Ut(e,{[Qa]:n})}function Ib(e,t,n,r){let o=n.getSdkMetadata(),{release:i,environment:s}=n.getOptions();Ut(e,p({[qa]:i,[Ya]:s||_n,[Va]:t.name,[Ka]:t.span_id,[Ja]:o?.sdk?.name,[Xa]:o?.sdk?.version,[Za]:r.user?.id,[ec]:r.user?.email,[tc]:r.user?.ip_address,[nc]:r.user?.username},r.attributes))}function bb(e,t){let n=t(e);return n||(eo(),e)}var ef=0,P_=1,U_=2;function wn(e){return new vs(t=>{t(e)})}function no(e){return new vs((t,n)=>{n(e)})}var vs=class e{constructor(t){this._state=ef,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(s){o(s)}},i=>{if(!n)o(i);else try{r(n(i))}catch(s){o(s)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,i;return this.then(s=>{i=!1,o=s,t&&t()},s=>{i=!0,o=s,t&&t()}).then(()=>{if(i){r(o);return}n(o)})})}_executeHandlers(){if(this._state===ef)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===P_&&n[1](this._value),this._state===U_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===ef){if(pt(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(P_,i)},o=i=>{n(U_,i)};try{t(r,o)}catch(i){o(i)}}};function D_(e,t,n,r=0){try{let o=tf(t,n,e,r);return pt(o)?o:wn(o)}catch(o){return no(o)}}function tf(e,t,n,r){let o=n[r];if(!e||!o)return e;let i=o(p({},e),t);return A&&i===null&&g.log(`Event processor "${o.id||"?"}" dropped event`),pt(i)?i.then(s=>tf(s,t,n,r+1)):tf(i,t,n,r+1)}var ro,B_,F_,Ir;function bc(e){let t=C._sentryDebugIds,n=C._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Ir&&r.length===B_&&o.length===F_)return Ir;B_=r.length,F_=o.length,Ir={},ro||(ro={});let i=(s,a)=>{for(let c of s){let u=a[c],f=ro?.[c];if(f&&Ir&&u)Ir[f[0]]=u,ro&&(ro[c]=[f[0],u]);else if(u){let l=e(c);for(let m=l.length-1;m>=0;m--){let _=l[m]?.filename;if(_&&Ir&&ro){Ir[_]=u,ro[c]=[_,u];break}}}}};return t&&i(r,t),n&&i(o,n),Ir}function nf(e,t){let n=bc(e);if(!n)return[];let r=[];for(let o of t){let i=Cm(o);i&&n[i]&&r.push({type:"sourcemap",code_file:o,debug_id:n[i]})}return r}function Rs(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,c=E(p({},t),{event_id:t.event_id||n.event_id||ge(),timestamp:t.timestamp||It()}),u=n.integrations||e.integrations.map(T=>T.name);Ab(c,e),Nb(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&vb(c,e.stackParser);let f=xb(r,n.captureContext);n.mechanism&&Je(c,n.mechanism);let l=o?o.getEventProcessors():[],m=xn(i,f),d=[...n.attachments||[],...m.attachments];d.length&&(n.attachments=d),M_(c,m);let _=[...l,...m.eventProcessors];return(n.data&&n.data.__sentry__===!0?wn(c):D_(_,c,n)).then(T=>(T&&Rb(T),typeof s=="number"&&s>0?Cb(T,s,a):T))}function Ab(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||_n,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=ln(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=ln(a.value,i))})}function vb(e,t){let n=bc(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Rb(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Nb(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Cb(e,t,n){if(!e)return null;let r=p(p(p(p(p({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>p(p({},o),o.data&&{data:Se(o.data,t,n)}))}),e.user&&{user:Se(e.user,t,n)}),e.contexts&&{contexts:Se(e.contexts,t,n)}),e.extra&&{extra:Se(e.extra,t,n)});return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Se(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>p(p({},o),o.data&&{data:Se(o.data,t,n)}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Se(e.contexts.flags,3,n)),r}function xb(e,t){if(!t)return e;let n=e?e.clone():new mt;return n.update(t),n}function H_(e){if(e)return wb(e)?{captureContext:e}:Ob(e)?{captureContext:e}:e}function wb(e){return e instanceof mt||typeof e=="function"}var kb=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Ob(e){return Object.keys(e).some(t=>kb.includes(t))}function J(e,t){return w().captureException(e,H_(t))}function Ns(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return w().captureMessage(e,n,r)}function hn(e,t){return w().captureEvent(e,t)}function oo(e,t){re().setContext(e,t)}function rf(e){re().setExtras(e)}function of(e,t){re().setExtra(e,t)}function sf(e){re().setTags(e)}function af(e,t){re().setTag(e,t)}function cf(e){re().setAttributes(e)}function uf(e,t){re().setAttribute(e,t)}function lf(e){re().setUser(e)}function ff(e){re().setConversationId(e)}function Cs(){return re().lastEventId()}async function pf(e){let t=I();return t?t.flush(e):(A&&g.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function df(e){let t=I();return t?t.close(e):(A&&g.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function mf(){return!!I()}function xs(){let e=I();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function ws(e){re().addEventProcessor(e)}function ti(e){let t=re(),{user:n}=xn(t,w()),{userAgent:r}=C.navigator||{},o=Fm(p(p({user:n},r&&{userAgent:r}),e)),i=t.getSession();return i?.status==="ok"&&jn(i,{status:"exited"}),ks(),t.setSession(o),o}function ks(){let e=re(),n=w().getSession()||e.getSession();n&&Hm(n),G_(),e.setSession()}function G_(){let e=re(),t=I(),n=e.getSession();n&&t&&t.captureSession(n)}function io(e=!1){if(e){ks();return}G_()}var $_="7";function W_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Mb(e){return`${W_(e)}${e.projectId}/envelope/`}function Lb(e,t){let n={sentry_version:$_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Os(e,t,n){return t||`${Mb(e)}?${Lb(e,n)}`}function _f(e,t){let n=us(e);if(!n)return"";let r=`${W_(n)}embed/error-page/`,o=`dsn=${qe(n)}`;for(let i in t)if(i!=="dsn"&&i!=="onClose")if(i==="user"){let s=t.user;if(!s)continue;s.name&&(o+=`&name=${encodeURIComponent(s.name)}`),s.email&&(o+=`&email=${encodeURIComponent(s.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${r}?${o}`}var Ac=[];function Pb(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function vc(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return Pb(r)}function j_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&hf(e,r,n)}),n}function gf(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function hf(e,t,n){if(n[t.name]){A&&g.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Ac.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Ac.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,i)=>r(o,i,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((i,s)=>r(i,s,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,i=>o.call(t,i,e))}),A&&g.log(`Integration installed: ${t.name}`)}function ni(e){let t=I();if(!t){A&&g.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}var Ub="sentry.timestamp.sequence",Sf=0,Ef;function Rc(e){let t=Math.floor(e*1e3);Ef!==void 0&&t!==Ef&&(Sf=0);let n=Sf;return Sf++,Ef=t,{key:Ub,value:{value:n,type:"integer"}}}function Nc(e,t){return t?$e(t,()=>{let n=te(),r=n?Vo(n):zo(t);return[n?Be(n):Xn(e,t),r]}):[void 0,void 0]}var z_={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function Tf(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function yf(){return"npm"}function q_(){return!Tf()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function st(){return typeof window<"u"&&(!q_()||Db())}function Db(){return C.process?.type==="renderer"}function Bb(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},E(p({version:2},st()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}}),{items:e})]}function Y_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=qe(r)),Me(i,[Bb(e,o)])}var Fb=100;function kn(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function V_(e,t){let n=bf(),r=K_(e);r===void 0?n.set(e,[t]):r.length>=Fb?(so(e,r),n.set(e,[t])):n.set(e,[...r,t])}function br(e,t=w(),n=V_){let r=t?.getClient()??I();if(!r){A&&g.warn("No client available to capture log.");return}let{release:o,environment:i,enableLogs:s=!1,beforeSendLog:a}=r.getOptions();if(!s){A&&g.warn("logging option not enabled, log will not be captured.");return}let[,c]=Nc(r,t),u=p({},e.attributes),{user:{id:f,email:l,username:m},attributes:d={}}=xn(re(),t);kn(u,"user.id",f,!1),kn(u,"user.email",l,!1),kn(u,"user.name",m,!1),kn(u,"sentry.release",o),kn(u,"sentry.environment",i);let{name:_,version:h}=r.getSdkMetadata()?.sdk??{};kn(u,"sentry.sdk.name",_),kn(u,"sentry.sdk.version",h);let S=r.getIntegrationByName("Replay"),T=S?.getReplayId(!0);kn(u,"sentry.replay_id",T),T&&S?.getRecordingMode()==="buffer"&&kn(u,"sentry._internal.replay_is_buffering",!0);let b=e.message;if(Rn(b)){let{__sentry_template_string__:F,__sentry_template_values__:j=[]}=b;j?.length&&(u["sentry.message.template"]=F),j.forEach((ae,ue)=>{u[`sentry.message.parameter.${ue}`]=ae})}let k=un(t);kn(u,"sentry.trace.parent_span_id",k?.spanContext().spanId);let R=E(p({},e),{attributes:u});r.emit("beforeCaptureLog",R);let U=a?Ge(()=>a(R)):R;if(!U){r.recordDroppedEvent("before_send","log_item",1),A&&g.warn("beforeSendLog returned null, log will not be captured.");return}let{level:D,message:y,attributes:O={},severityNumber:Y}=U,N=ne(),B=Rc(N),M={timestamp:N,level:D,body:If(String(y)),trace_id:c?.trace_id,severity_number:Y??z_[D],attributes:Hb(E(p(p({},zn(d)),zn(O,!0)),{[B.key]:B.value}))};n(r,M),r.emit("afterCaptureLog",U)}function so(e,t){let n=t??K_(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Y_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);bf().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function K_(e){return bf().get(e)}function bf(){return an("clientToLogBufferMap",()=>new WeakMap)}function Hb(e){let t={};for(let[n,r]of Object.entries(e)){let o=If(n);r.type==="string"?t[o]=E(p({},r),{value:If(r.value)}):t[o]=r}return t}function If(e){let t=Object(e),n=t.isWellFormed,r=t.toWellFormed;return typeof n=="function"&&typeof r=="function"?n.call(e)?e:r.call(e):e}function Gb(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},E(p({version:2},st()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}}),{items:e})]}function J_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=qe(r)),Me(i,[Gb(e,o)])}var $b=1e3;function er(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function X_(e,t){let n=vf(),r=Q_(e);r===void 0?n.set(e,[t]):r.length>=$b?(ri(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Wb(e,t,n){let{release:r,environment:o}=t.getOptions(),i=p({},e.attributes);er(i,"user.id",n.id,!1),er(i,"user.email",n.email,!1),er(i,"user.name",n.username,!1),er(i,"sentry.release",r),er(i,"sentry.environment",o);let{name:s,version:a}=t.getSdkMetadata()?.sdk??{};er(i,"sentry.sdk.name",s),er(i,"sentry.sdk.version",a);let c=t.getIntegrationByName("Replay"),u=c?.getReplayId(!0);return er(i,"sentry.replay_id",u),u&&c?.getRecordingMode()==="buffer"&&er(i,"sentry._internal.replay_is_buffering",!0),E(p({},e),{attributes:i})}function jb(e,t,n,r){let[,o]=Nc(t,n),i=un(n),s=i?i.spanContext().traceId:o?.trace_id,a=i?i.spanContext().spanId:void 0,c=ne(),u=Rc(c);return{timestamp:c,trace_id:s??"",span_id:a,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:E(p(p({},zn(r)),zn(e.attributes,"skip-undefined")),{[u.key]:u.value})}}function Af(e,t){let n=t?.scope??w(),r=t?.captureSerializedMetric??X_,o=n?.getClient()??I();if(!o){A&&g.warn("No client available to capture metric.");return}let{_experiments:i,enableMetrics:s,beforeSendMetric:a}=o.getOptions();if(!(s??i?.enableMetrics??!0)){A&&g.warn("metrics option not enabled, metric will not be captured.");return}let{user:u,attributes:f}=xn(re(),n),l=Wb(e,o,u);o.emit("processMetric",l);let m=a||i?.beforeSendMetric,d=m?m(l):l;if(!d){A&&g.log("`beforeSendMetric` returned `null`, will not send metric.");return}let _=jb(d,o,n,f);A&&g.log("[Metric]",_),r(o,_),o.emit("afterCaptureMetric",d)}function ri(e,t){let n=t??Q_(e)??[];if(n.length===0)return;let r=e.getOptions(),o=J_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);vf().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function Q_(e){return vf().get(e)}function vf(){return an("clientToMetricBufferMap",()=>new WeakMap)}function Z_(e){let t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:p({},e.data),links:e.links};return pc(t)}function eg(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||t.getOptions().streamGenAiSpans===!1||Fe(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(Z_(i)):r.push(i);if(n.length===0)return;e.spans=r;let o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},E(p({version:2},st()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}}),{items:n})]}function Ar(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var oi=Symbol.for("SentryBufferFullError");function ao(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function o(s){if(!n())return no(oi);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return wn(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let c=[a,new Promise(u=>Ar(setTimeout(()=>u(!1),s)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:i}}var tg=60*1e3;function Cc(e,t=rt()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?tg:r-t}function ng(e,t){return e[t]||e.all||0}function Ms(e,t,n=rt()){return ng(e,t)>n}function Ls(e,{statusCode:t,headers:n},r=rt()){let o=p({},e),i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(let a of i.trim().split(",")){let[c,u,,,f]=a.split(":",5),l=parseInt(c,10),m=(isNaN(l)?60:l)*1e3;if(!u)o.all=r+m;else for(let d of u.split(";"))d==="metric_bucket"?(!f||f.split(";").includes("custom"))&&(o[d]=r+m):o[d]=r+m}else s?o.all=r+Cc(s,r):t===429&&(o.all=r+60*1e3);return o}var Rf=64;function xc(e,t,n=ao(e.bufferSize||Rf)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(vt(s,(l,m)=>{let d=Es(m);Ms(r,d)?e.recordDroppedEvent("ratelimit_backoff",d):a.push(l)}),a.length===0)return Promise.resolve({});let c=Me(s[0],a),u=l=>{if(to(c,["client_report"])){A&&g.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}vt(c,(m,d)=>{e.recordDroppedEvent(l,Es(d))})},f=()=>t({body:Zn(c)}).then(l=>l.statusCode===413?(A&&g.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(A&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&g.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Ls(r,l),l),l=>{throw u("network_error"),A&&g.error("Encountered error running transport request:",l),l});return n.add(f).then(l=>l,l=>{if(l===oi)return A&&g.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:o}}function rg(e,t,n){let r=[{type:"client_report"},{timestamp:n||It(),discarded_events:e}];return Me(t?{dsn:t}:{},[r])}function wc(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function og(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:i,data:s,op:a}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:s?.[Xr],exclusive_time:s?.[it],measurements:e.measurements,is_segment:!0}}function ig(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:p(p(p({},e.data),e.profile_id&&{[Xr]:e.profile_id}),e.exclusive_time&&{[it]:e.exclusive_time})}},measurements:e.measurements}}var co="[Filtered]",Ps=["forwarded","-ip","remote-","via","-user"],Nf=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],sg=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function ag(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:Ps},httpHeaders:{request:{deny:Ps},response:{deny:Ps}},httpBodies:[],queryParams:{deny:Ps},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}var zb={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function cg(e){let t=e.dataCollection!=null?zb:ag(e.sendDefaultPii),n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,queryParams:n.queryParams??t.queryParams,genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var ug="Not capturing exception because it's already been captured.",lg="Discarded session because of missing or non-string release",gg=Symbol.for("SentryInternalError"),hg=Symbol.for("SentryDoNotSendEventError"),qb=5e3;function kc(e){return{message:e,[gg]:!0}}function Cf(e){return{message:e,[hg]:!0}}function fg(e){return!!e&&typeof e=="object"&&gg in e}function pg(e){return!!e&&typeof e=="object"&&hg in e}function dg(e,t,n,r,o){let i=0,s,a=!1;e.on(n,()=>{i=0,clearTimeout(s),a=!1}),e.on(t,c=>{if(i+=r(c),i>=8e5)o(e);else if(!a){let u=e.getOptions()._flushInterval??qb;u>0&&(a=!0,s=Ar(setTimeout(()=>{o(e)},u)))}}),e.on("flush",()=>{o(e)})}var Us=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ao(t.transportOptions?.bufferSize??Rf),this._dataCollection=cg(t),t.dsn?this._dsn=us(t.dsn):A&&g.warn("No DSN provided, client will not send events."),this._dsn){let r=Os(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport(E(p({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},t.transportOptions),{url:r}))}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&dg(this,"afterCaptureLog","flushLogs",Jb,so),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&dg(this,"afterCaptureMetric","flushMetrics",Kb,ri)}captureException(t,n,r){let o=ge();if(as(t))return A&&g.log(ug),o;let i=p({event_id:o},n);return this._process(()=>this.eventFromException(t,i).then(s=>this._captureEvent(s,i,r)).then(s=>s),"error"),i.event_id}captureMessage(t,n,r,o){let i=p({event_id:ge()},r),s=Rn(t)?t:String(t),a=je(t),c=a?this.eventFromMessage(s,n,i):this.eventFromException(t,i);return this._process(()=>c.then(u=>this._captureEvent(u,i,o)),a?"unknown":"error"),i.event_id}captureEvent(t,n,r){let o=ge();if(n?.originalException&&as(n.originalException))return A&&g.log(ug),o;let i=p({event_id:o},n),s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,c=s.capturedSpanIsolationScope,u=mg(t.type);return this._process(()=>this._captureEvent(t,i,a||r,c),u),i.event_id}captureSession(t){this.sendSession(t),jn(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){so(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),hf(this,t,this._integrations),n||gf(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=eg(t,this),o=S_(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=Ss(o,Sc(i));r&&(o=Ss(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=_n}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){A&&g.warn(lg);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){A&&g.warn(lg);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=h_(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;A&&g.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...i)=>n(...i);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return A&&g.error("Error while sending envelope:",n),{}}return A&&g.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=j_(this,t),gf(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,i=n.exception?.values;if(i){o=!0,r=!1;for(let c of i)if(c.mechanism?.handled===!1){r=!0;break}}let s=t.status==="ok";(s&&t.errors===0||s&&r)&&(jn(t,E(p({},r&&{status:"crashed"}),{errors:t.errors||Number(o||r)})),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){let i=this.getOptions(),s=this.getIntegrationNames();return!n.integrations&&s.length&&(n.integrations=s),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Rs(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts=p({trace:p(p({},a.contexts?.trace),zo(r))},a.contexts);let c=Xn(this,r);return a.sdkProcessingMetadata=p({dynamicSamplingContext:c},a.sdkProcessingMetadata),a})}_captureEvent(t,n={},r=w(),o=re()){return A&&xf(t)&&g.log(`Captured error event \`${wc(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{A&&(pg(i)?g.log(i.message):fg(i)?g.warn(i.message):g.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=Sg(t),c=xf(t),f=`before send for type \`${t.type||"error"}\``,l=typeof s>"u"?void 0:Pt(s);if(c&&typeof l=="number"&&yt()>l)return this.recordDroppedEvent("sample_rate","error"),no(Cf(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let m=mg(t.type);return this._prepareEvent(t,n,r,o).then(d=>{if(d===null)throw this.recordDroppedEvent("event_processor",m),Cf("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return d;let h=Vb(this,i,d,n);return Yb(h,f)}).then(d=>{if(d===null){if(this.recordDroppedEvent("before_send",m),a){let T=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",T)}throw Cf(`${f} returned \`null\`, will not send event.`)}let _=r.getSession()||o.getSession();if(c&&_&&this._updateSessionFromEvent(_,d),a){let S=d.sdkProcessingMetadata?.spanCountBeforeProcessing||0,T=d.spans?d.spans.length:0,b=S-T;b>0&&this.recordDroppedEvent("before_send","span",b)}let h=d.transaction_info;if(a&&h&&d.transaction!==t.transaction){let S="custom";d.transaction_info=E(p({},h),{source:S})}return this.sendEvent(d,n),d}).then(null,d=>{throw pg(d)||fg(d)?d:(this.captureException(d,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:d}),kc(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
10
|
+
Reason: ${d}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===oi&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){A&&g.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){A&&g.log("No outcomes to send");return}if(!this._dsn){A&&g.log("No dsn provided, will not send outcomes");return}A&&g.log("Sending outcomes:",t);let n=rg(t,this._options.tunnel&&qe(this._dsn));this.sendEnvelope(n)}};function mg(e){return e==="replay_event"?"replay":e||"error"}function Yb(e,t){let n=`${t} must return \`null\` or a valid event.`;if(pt(e))return e.then(r=>{if(!xe(r)&&r!==null)throw kc(n);return r},r=>{throw kc(`${t} rejected with ${r}`)});if(!xe(e)&&e!==null)throw kc(n);return e}function Vb(e,t,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=!Qn(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(xf(c)&&o)return o(c,r);if(Sg(c)){if(a||s){let u=og(c);if(s?.length&&Jn({description:u.description,op:u.op,attributes:u.data},s))return null;if(a){let f=a(u);f?c=hr(n,ig(f)):eo()}if(c.spans){let f=[],l=c.spans;for(let d of l){if(s?.length&&Jn({description:d.description,op:d.op,attributes:d.data},s)){p_(l,d);continue}if(a){let _=a(d);_?f.push(_):(eo(),f.push(d))}else f.push(d)}let m=c.spans.length-f.length;m&&e.recordDroppedEvent("before_send","span",m),c.spans=f}}if(i){if(c.spans){let u=c.spans.length;c.sdkProcessingMetadata=E(p({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:u})}return i(c,r)}}return c}function xf(e){return e.type===void 0}function Sg(e){return e.type==="transaction"}function Kb(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Eg(e.attributes)}function Jb(e){let t=0;return e.message&&(t+=e.message.length*2),t+Eg(e.attributes)}function Eg(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*_g(n[0]):je(n)?t+=_g(n):t+=100}),t}function _g(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function wf(e,t){t.debug===!0&&(A?g.enable():Ge(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),w().update(t.initialScope);let r=new e(t);return kf(r),r.init(),r}function kf(e){w().setClient(e)}var Of=100,Mf=5e3,Xb=36e5;function Lf(e){function t(...n){A&&g.log("[Offline]:",...n)}return n=>{let r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");let o=n.createStore(n),i=Mf,s;function a(l,m,d){return to(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,m,d):!0}function c(l){s&&clearTimeout(s),s=Ar(setTimeout(async()=>{s=void 0;let m=await o.shift();m&&(t("Attempting to send previously queued event"),m[0].sent_at=new Date(rt()).toISOString(),f(m,!0).catch(d=>{t("Failed to retry sending",d)}))},l))}function u(){s||(c(i),i=Math.min(i*2,Xb))}async function f(l,m=!1){if(!m&&to(l,["replay_event","replay_recording"]))return await o.push(l),c(Of),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");let d=await r.send(l),_=Of;if(d){if(d.headers?.["retry-after"])_=Cc(d.headers["retry-after"]);else if(d.headers?.["x-sentry-rate-limits"])_=6e4;else if((d.statusCode||0)>=400)return d}return c(_),i=Mf,d}catch(d){if(await a(l,d,i))return m?await o.unshift(l):await o.push(l),u(),t("Error sending. Event queued.",d),{};throw d}}return n.flushAtStartup&&u(),{send:f,flush:l=>(l===void 0&&(i=Mf,c(Of)),r.flush(l))}}}var Ds="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function Tg(e,t){let n;return vt(e,(r,o)=>(t.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function Qb(e,t){return n=>{let r=e(n);return E(p({},r),{send:async o=>{let i=Tg(o,["event","transaction","profile","replay_event"]);return i&&(i.release=t),r.send(o)}})}}function Zb(e,t){return Me(t?E(p({},e[0]),{dsn:t}):e[0],e[1])}function yg(e,t){return n=>{let r=e(n),o=new Map,i=t||(u=>{let f=u.getEvent();return f?.extra?.[Ds]&&Array.isArray(f.extra[Ds])?f.extra[Ds]:[]});function s(u,f){let l=f?`${u}:${f}`:u,m=o.get(l);if(!m){let d=cc(u);if(!d)return;let _=Os(d,n.tunnel);m=f?Qb(e,f)(E(p({},n),{url:_})):e(E(p({},n),{url:_})),o.set(l,m)}return[u,m]}async function a(u){function f(_){let h=_?.length?_:["event"];return Tg(u,h)}let l=i({envelope:u,getEvent:f}).map(_=>typeof _=="string"?s(_,void 0):s(_.dsn,_.release)).filter(_=>!!_),m=l.length?l:[["",r]];return(await Promise.all(m.map(([_,h])=>h.send(Zb(u,_)))))[0]}async function c(u){let f=[...o.values(),r];return(await Promise.all(f.map(m=>m.flush(u)))).every(m=>m)}return{send:a,flush:c}}}function Pf(e,t){return t.some(n=>e.includes(n))}function vr(e,t,n){if(t===!1)return{};let r=n!=null?[...Nf,...n]:Nf,o={};if(t===!0){for(let s of Object.keys(e))o[s]=Pf(s.toLowerCase(),r)?co:e[s];return o}if("deny"in t){let s=t.deny.map(a=>a.toLowerCase());for(let a of Object.keys(e)){let c=a.toLowerCase(),u=Pf(c,r)||s.some(f=>c.includes(f));o[a]=u?co:e[a]}return o}let i=t.allow.map(s=>s.toLowerCase());for(let s of Object.keys(e)){let a=s.toLowerCase();if(Pf(a,r))o[s]=co;else{let c=i.some(u=>a.includes(u));o[s]=c?e[s]:co}}return o}function Ig(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf("=",n);if(r===-1)break;let o=e.indexOf(";",n);if(o===-1)o=e.length;else if(o<r){n=e.lastIndexOf(";",r-1)+1;continue}let i=e.slice(n,r).trim();if(t[i]===void 0){let s=e.slice(r+1,o).trim();s.charCodeAt(0)===34&&(s=s.slice(1,-1));try{t[i]=s.indexOf("%")!==-1?decodeURIComponent(s):s}catch{t[i]=s}}n=o+1}return t}function Bs(e,t){if(t===!1)return{};try{let n=Ig(e);return Object.keys(n).length===0?{}:vr(n,t,sg)}catch{return co}}var eA="thismessage:/";function uo(e){return"isRelative"in e}function On(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?eA:void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;let o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function ii(e){if(uo(e))return e.pathname;let t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Yt(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Rr(e){return e.split(/[?#]/,1)[0]}function at(e,t=!0){if(e.startsWith("data:")){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),i=e.indexOf(","),s="";if(t&&i!==-1){let a=e.slice(i+1);s=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${s?`,${s}`:""}`}return e}function si(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return nA(e,n)||tA(e,r)}function tA(e,t){return t?bg(e)===bg(t):!1}function nA(e,t){let n=On(e);return!n||uo(n)||!t?!1:rA(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function rA(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function bg(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Uf(e,...t){let n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}var Df=Uf;function Bf(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs=E(p({},e.attrs),{ip_address:"{{auto}}"})):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function ai(e,t,n=[t],r="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:Lt})),o.version=Lt)}function ci(e={}){let t=e.client||I();if(!xs()||!t)return{};let n=lt(),r=qt(n);if(r.getTraceData)return r.getTraceData(e);let o=e.scope||w(),i=e.span||te(),s=Cn(i)&&!Oe(t.getOptions());if(!i&&ja())return{};let a=i&&!s?_s(i):oA(o),c=i?Be(i):Xn(t,o),u=ac(c);if(!lc.test(a))return g.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let l={"sentry-trace":a,baggage:u};return e.propagateTraceparent&&(l.traceparent=i&&!s?i_(i):iA(o)),l}function oA(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return fs(t,r,n)}function iA(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ps(t,r,n)}function Ff(e,t,n){let r,o,i,s=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function c(){return u(),r=e(),r}function u(){o!==void 0&&clearTimeout(o),i!==void 0&&clearTimeout(i),o=i=void 0}function f(){return o!==void 0||i!==void 0?c():r}function l(){return o&&clearTimeout(o),o=a(c,t),s&&i===void 0&&(i=a(c,s)),r}return l.cancel=u,l.flush=f,l}var sA=100;function gt(e,t){let n=I(),r=re();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=sA}=n.getOptions();if(i<=0)return;let s=It(),a=p({timestamp:s},e),c=o?Ge(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,i))}var Ag,aA="FunctionToString",vg=new WeakMap,cA=()=>({name:aA,setupOnce(){Ag=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=mr(this),n=vg.has(I())&&t!==void 0?t:this;return Ag.apply(n,e)}}catch{}},setup(e){vg.set(e,!0)}}),lo=cA;var uA=[/^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$/],lA="EventFilters",Mc=(e={})=>{let t;return{name:lA,setup(n){let r=n.getOptions();t=Rg(e,r)},processEvent(n,r,o){if(!t){let i=o.getOptions();t=Rg(e,i)}return fA(n,t)?null:n}}},fo=(e={})=>E(p({},Mc(e)),{name:"InboundFilters"});function Rg(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:uA],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function fA(e,t){if(e.type){if(e.type==="transaction"&&dA(e,t.ignoreTransactions))return A&&g.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
11
|
+
Event: ${fn(e)}`),!0}else{if(pA(e,t.ignoreErrors))return A&&g.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
+
Event: ${fn(e)}`),!0;if(hA(e))return A&&g.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
+
Event: ${fn(e)}`),!0;if(mA(e,t.denyUrls))return A&&g.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
+
Event: ${fn(e)}.
|
|
15
|
+
Url: ${Oc(e)}`),!0;if(!_A(e,t.allowUrls))return A&&g.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
+
Event: ${fn(e)}.
|
|
17
|
+
Url: ${Oc(e)}`),!0}return!1}function pA(e,t){return t?.length?wc(e).some(n=>ze(n,t)):!1}function dA(e,t){if(!t?.length)return!1;let n=e.transaction;return n?ze(n,t):!1}function mA(e,t){if(!t?.length)return!1;let n=Oc(e);return n?ze(n,t):!1}function _A(e,t){if(!t?.length)return!0;let n=Oc(e);return n?ze(n,t):!0}function gA(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Oc(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?gA(n):null}catch{return A&&g.error(`Cannot extract url for event ${fn(e)}`),null}}function hA(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Gf(e,t,n,r,o,i){if(!o.exception?.values||!i||!cn(i.originalException,Error))return;let s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=Hf(e,t,r,i.originalException,n,o.exception.values,s,0))}function Hf(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let c=[...i];if(cn(r[o],Error)){Ng(s,a,r);let u=e(t,r[o]),f=c.length;Cg(u,o,f,a),c=Hf(e,t,n,r[o],o,[u,...c],u,f)}return xg(r)&&r.errors.forEach((u,f)=>{if(cn(u,Error)){Ng(s,a,r);let l=e(t,u),m=c.length;Cg(l,`errors[${f}]`,m,a),c=Hf(e,t,n,u,o,[l,...c],l,m)}}),c}function xg(e){return Array.isArray(e.errors)}function Ng(e,t,n){e.mechanism=E(p(p({handled:!0,type:"auto.core.linked_errors"},xg(n)&&{is_exception_group:!0}),e.mechanism),{exception_id:t})}function Cg(e,t,n,r){e.mechanism=E(p({handled:!0},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function SA(e){return Ze(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Lc(e){return SA(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var kg=new Map,wg=new Set;function EA(e){if(C._sentryModuleMetadata)for(let t of Object.keys(C._sentryModuleMetadata)){let n=C._sentryModuleMetadata[t];if(wg.has(t))continue;wg.add(t);let r=e(t);for(let o of r.reverse())if(o.filename){kg.set(o.filename,n);break}}}function TA(e,t){return EA(e),kg.get(t)}function Pc(e,t){t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;let o=TA(e,r.filename);o&&(r.module_metadata=o)})})}function Uc(e){e.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}var Og=()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",t=>{vt(t,(n,r)=>{if(r==="event"){let o=Array.isArray(n)?n[1]:void 0;o&&(Uc(o),n[1]=o)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;let n=e.getOptions().stackParser;Pc(n,t)})}});var Mg=new Set([]);function po(e){let t="console",n=tt(t,e);return nt(t,yA),n}function yA(){"console"in C&&pr.forEach(function(e){e in C.console&&ye(C.console,e,function(t){return qr[e]=t,function(...n){let r=n[0],o=qr[e],i=Mg.size&&typeof r=="string"&&ze(r,Mg);i||We("console",{args:n,level:e}),(!i||A&&g.isEnabled())&&o?.apply(C.console,n)}})})}function tr(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var IA="CaptureConsole",bA=(e={})=>{let t=e.levels||pr,n=e.handled??!0;return{name:IA,setup(r){"console"in C&&po(({args:o,level:i})=>{I()!==r||!t.includes(i)||AA(o,i,n)})}}},Lg=bA;function AA(e,t,n){let r=tr(t),o=new Error,i={level:tr(t),extra:{arguments:e}};$e(s=>{if(s.addEventProcessor(u=>(u.logger="console",Je(u,{handled:n,type:"auto.core.capture_console"}),u)),t==="assert"){if(!e[0]){let u=`Assertion failed: ${_r(e.slice(1)," ")||"console.assert"}`;s.setExtra("arguments",e.slice(1)),s.captureMessage(u,r,{captureContext:i,syntheticException:o})}return}let a=e.find(u=>u instanceof Error);if(a){J(a,i);return}let c=_r(e," ");s.captureMessage(c,r,{captureContext:i,syntheticException:o})})}var vA="Dedupe",RA=()=>{let e;return{name:vA,processEvent(t){if(t.type)return t;try{if(NA(t,e))return A&&g.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},mo=RA;function NA(e,t){return t?!!(CA(e,t)||xA(e,t)):!1}function CA(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Dg(e,t)||!Ug(e,t))}function xA(e,t){let n=Pg(t),r=Pg(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Dg(e,t)||!Ug(e,t))}function Ug(e,t){let n=Yr(e),r=Yr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){let i=r[o],s=n[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0}function Dg(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Pg(e){return e.exception?.values?.[0]}var wA="ExtraErrorData",kA=(e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:wA,processEvent(r,o,i){let{maxValueLength:s}=i.getOptions();return OA(r,o,t,n,s)}}},Bg=kA;function OA(e,t={},n,r,o){if(!t.originalException||!Ze(t.originalException))return e;let i=t.originalException.name||t.originalException.constructor.name,s=Fg(t.originalException,r,o);if(s){let a=p({},e.contexts),c=Se(s,n);return xe(c)&&(Mm(c),a[i]=c),E(p({},e),{contexts:a})}return e}function Fg(e,t,n){try{let r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(let i of Object.keys(e)){if(r.indexOf(i)!==-1)continue;let s=e[i];o[i]=Ze(s)||typeof s=="string"?n?ln(`${s}`,n):`${s}`:s}if(t&&e.cause!==void 0)if(Ze(e.cause)){let i=e.cause.name||e.cause.constructor.name;o.cause={[i]:Fg(e.cause,!1,n)}}else o.cause=e.cause;if(typeof e.toJSON=="function"){let i=e.toJSON();for(let s of Object.keys(i)){let a=i[s];o[s]=Ze(a)?a.toString():a}}return o}catch(r){A&&g.error("Unable to extract extra data from the Error object:",r)}return null}function MA(e,t){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r];o==="."?e.splice(r,1):o===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var LA=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function PA(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=LA.exec(t);return n?n.slice(1):[]}function Hg(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let o=r>=0?e[r]:"/";o&&(t=`${o}/${t}`,n=o.charAt(0)==="/")}return t=MA(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Gg(e){let t=0;for(;t<e.length&&e[t]==="";t++);let n=e.length-1;for(;n>=0&&e[n]==="";n--);return t>n?[]:e.slice(t,n-t+1)}function $g(e,t){e=Hg(e).slice(1),t=Hg(t).slice(1);let n=Gg(e.split("/")),r=Gg(t.split("/")),o=Math.min(n.length,r.length),i=o;for(let a=0;a<o;a++)if(n[a]!==r[a]){i=a;break}let s=[];for(let a=i;a<n.length;a++)s.push("..");return s=s.concat(r.slice(i)),s.join("/")}function Wg(e,t){let n=PA(e)[2]||"";return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var UA="RewriteFrames",jg=(e={})=>{let t=e.root,n=e.prefix||"app:///",r="window"in C&&!!C.window,o=e.iteratee||DA({isBrowser:r,root:t,prefix:n});function i(a){try{return E(p({},a),{exception:E(p({},a.exception),{values:a.exception.values.map(c=>p(p({},c),c.stacktrace&&{stacktrace:s(c.stacktrace)}))})})}catch{return a}}function s(a){return E(p({},a),{frames:a?.frames?.map(c=>o(c))})}return{name:UA,processEvent(a){let c=a;return a.exception&&Array.isArray(a.exception.values)&&(c=i(c)),c}}};function DA({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let o=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),i=/^\//.test(r.filename);if(e){if(t){let s=r.filename;s.indexOf(t)===0&&(r.filename=s.replace(t,n))}}else if(o||i){let s=o?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=t?$g(t,s):Wg(s);r.filename=`${n}${a}`}return r}}var BA=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],FA=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],HA={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},qg=["select","insert","upsert","update","delete"];function Dc(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function Bc(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function Yg(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function GA(e,t){return Yg(e,t)!==void 0}function $A(e,t={}){switch(e){case"GET":return"select";case"POST":return t.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function WA(e,t){if(t===""||t==="*")return"select(*)";if(e==="select")return`select(${t})`;if(e==="or"||e.endsWith(".or"))return`${e}${t}`;let[n,...r]=t.split("."),o;return n?.startsWith("fts")?o="textSearch":n?.startsWith("plfts")?o="textSearch[plain]":n?.startsWith("phfts")?o="textSearch[phrase]":n?.startsWith("wfts")?o="textSearch[websearch]":o=n&&HA[n]||"filter",`${o}(${e}, ${r.join(".")})`}function zg(e,t=!1){return new Proxy(e,{apply(n,r,o){return Ve({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[G]:"auto.db.supabase",[Z]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},i=>Reflect.apply(n,r,o).then(s=>(s&&typeof s=="object"&&"error"in s&&s.error?(i.setStatus({code:2}),J(s.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):i.setStatus({code:1}),i.end(),s)).catch(s=>{throw i.setStatus({code:2}),i.end(),J(s,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),s}).then(...o))}})}function jA(e){let t=e.auth;if(!(!t||Bc(e.auth))){for(let n of BA){let r=t[n];r&&typeof e.auth[n]=="function"&&(e.auth[n]=zg(r))}for(let n of FA){let r=t.admin[n];r&&typeof e.auth.admin[n]=="function"&&(e.auth.admin[n]=zg(r,!0))}Dc(e.auth)}}function zA(e,t){Bc(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(n,r,o){let i=Reflect.apply(n,r,o),s=i.constructor;return YA(s,t),i}}),Dc(e.prototype.from))}function qA(e,t){Bc(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(n,r,o){let i=qg,s=r,a=$A(s.method,s.headers);if(!i.includes(a)||!s?.url?.pathname||typeof s.url.pathname!="string")return Reflect.apply(n,r,o);let c=s.url.pathname.split("/"),u=c.length>0?c[c.length-1]:"",f=[];for(let[R,U]of s.url.searchParams.entries())f.push(WA(R,U));let l=Object.create(null);if(xe(s.body))for(let[R,U]of Object.entries(s.body))l[R]=U;let m=I(),d=t.sendOperationData??m?.getDataCollectionOptions().userInfo===!0,_=Yg(s.body,l),h=a==="select"?"":`${a}${GA(s.body,l)?"(...) ":""}`,S=d?f.join(" "):f.length>0?"[redacted]":"",T=[h.trimEnd(),S].filter(Boolean).join(" "),b=T?`${T} from(${u})`:`from(${u})`,k={"db.table":u,"db.schema":s.schema,"db.url":s.url.origin,"db.sdk":s.headers["X-Client-Info"],"db.system":"postgresql","db.operation":a,[G]:"auto.db.supabase",[Z]:"db"};return f.length&&d&&(k["db.query"]=f),_!==void 0&&d&&(k["db.body"]=_),Ve({name:b,attributes:k},R=>Reflect.apply(n,r,[]).then(U=>{if(R&&(U&&typeof U=="object"&&"status"in U&&Vn(R,U.status||500),R.end()),U?.error){let O=new Error(U.error.message);U.error.code&&(O.code=U.error.code),U.error.details&&(O.details=U.error.details);let Y={};f.length&&d&&(Y.query=f),_!==void 0&&d&&(Y.body=_),J(O,N=>(N.addEventProcessor(B=>(Je(B,{handled:!1,type:"auto.db.supabase.postgres"}),B)),N.setContext("supabase",Y),N))}let D={type:"supabase",category:`db.${a}`,message:b},y={};return f.length&&d&&(y.query=f),_!==void 0&&d&&(y.body=_),Object.keys(y).length&&(D.data=y),gt(D),U},U=>{throw R&&(Vn(R,500),R.end()),U}).then(...o))}}),Dc(e.prototype.then))}function YA(e,t){for(let n of qg)Bc(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(r,o,i){let s=Reflect.apply(r,o,i),a=s.constructor;return A&&g.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),qA(a,t),s}}),Dc(e.prototype[n]))}var $f=(e,t={})=>{if(!e){A&&g.warn("Supabase integration was not installed because no Supabase client was provided.");return}let n=e.constructor===Function?e:e.constructor;zA(n,t),jA(e)},VA="Supabase",KA=(e,t)=>({setupOnce(){$f(e,t)},name:VA}),Vg=e=>KA(e.supabaseClient,{sendOperationData:e.sendOperationData});var JA=10,XA="ZodErrors";function QA(e){return Ze(e)&&e.name==="ZodError"&&Array.isArray(e.issues)}function ZA(e){return E(p({},e),{path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0})}function ev(e){return e.map(t=>typeof t=="number"?"<array>":t).join(".")}function tv(e){let t=new Set;for(let r of e.issues){let o=ev(r.path);o.length>0&&t.add(o)}let n=Array.from(t);if(n.length===0){let r="variable";if(e.issues.length>0){let o=e.issues[0];o!==void 0&&"expected"in o&&typeof o.expected=="string"&&(r=o.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${ln(n.join(", "),100)}`}function nv(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!QA(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(ZA);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:i})})),E(p({},n),{exception:E(p({},n.exception),{values:[E(p({},n.exception.values[0]),{value:tv(r.originalException)}),...n.exception.values.slice(1)]}),extra:E(p({},n.extra),{"zoderror.issues":i.slice(0,e)})})}catch(o){return E(p({},n),{extra:E(p({},n.extra),{"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:o instanceof Error?`${o.name}: ${o.message}
|
|
18
|
+
${o.stack}`:"unknown"}})})}}var rv=(e={})=>{let t=e.limit??JA;return{name:XA,processEvent(n,r){return nv(t,e.saveZodIssuesAsAttachment,n,r)}}},Kg=rv;var Xg=e=>({name:"ThirdPartyErrorsFilter",setup(t){t.on("beforeEnvelope",n=>{vt(n,(r,o)=>{if(o==="event"){let i=Array.isArray(r)?r[1]:void 0;i&&(Uc(i),r[1]=i)}})}),t.on("applyFrameMetadata",n=>{if(n.type)return;let r=t.getOptions().stackParser;Pc(r,n)})},preprocessEvent(t){e.ignoreSentryInternalFrames&&(C._sentryWrappedDepth??0)>0&&(t.sdkProcessingMetadata=E(p({},t.sdkProcessingMetadata),{insideSentryWrapped:!0}))},processEvent(t){let n=e.ignoreSentryInternalFrames?t.sdkProcessingMetadata?.insideSentryWrapped===!0&&t.exception?.values?.length===1:!1,r=iv(t,e.ignoreSentryInternalFrames,n);if(r){let o=e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(r[o](s=>!s.some(a=>e.filterKeys.includes(a)))){if(e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;t.tags=E(p({},t.tags),{third_party_code:!0})}}return t}});function ov(e,t,n){if(t!==0)return!1;if(n&&sv(e)||e.function==="sentryWrapped")return!0;if(!e.context_line||!e.filename||!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(cv))return!1;if(e.pre_context){let r=e.pre_context.length;for(let o=0;o<r;o++)if(e.pre_context[o]?.includes(av))return!0}return!1}function iv(e,t,n){let r=Yr(e);if(r)return r.filter((o,i)=>!o.filename||o.lineno==null&&o.colno==null&&o.instruction_addr==null?!1:!t||!ov(o,i,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(i=>i.startsWith(Jg)).map(i=>i.slice(Jg.length)):[])}function sv(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}var Jg="_sentryBundlerPluginAppKey:",av="Attempt to invoke user-land function",cv="fn.apply(this, wrappedArguments)";var Qg=100,Zg=10,Fc="flag.evaluation.";function Dt(e){if(e.type)return e;let n=w().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...r]}),e}function Rt(e,t,n=Qg){let r=w().getScopeData().contexts;r.flags||(r.flags={values:[]});let o=r.flags.values;uv(o,e,t,n)}function uv(e,t,n,r){if(typeof n!="boolean")return;if(e.length>r){A&&g.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let o=e.findIndex(i=>i.flag===t);o!==-1&&e.splice(o,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function Nt(e,t,n=Zg){if(typeof t!="boolean")return;let r=te();if(!r)return;let o=P(r).data;if(`${Fc}${e}`in o){r.setAttribute(`${Fc}${e}`,t);return}Object.keys(o).filter(s=>s.startsWith(Fc)).length<n&&r.setAttribute(`${Fc}${e}`,t)}var eh=()=>({name:"FeatureFlags",processEvent(e,t,n){return Dt(e)},addFeatureFlag(e,t){Rt(e,t),Nt(e,t)}});var Wf=({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){let t=e.prototype;typeof t.isOn=="function"&&ye(t,"isOn",th),typeof t.getFeatureValue=="function"&&ye(t,"getFeatureValue",th)},processEvent(t,n,r){return Dt(t)}});function th(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"&&(Rt(n,r),Nt(n,r)),r}}var lv="ConversationId",fv=()=>({name:lv,setup(e){e.on("spanStart",t=>{let n=w().getScopeData(),r=re().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=P(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(sc,o)}})}}),ui=fv;function jf(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=Oe()&&t(s);if(e.endTimestamp){let _=e.fetchData.__span;if(!_)return;let h=r[_];h&&(a&&(dv(h,e),pv(h,e,o)),delete r[_]);return}let{spanOrigin:c="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},f=I(),m=!!te()||!!f&&Fe(f),d=a&&m?Ue(gv(s,i,c)):new At;if(a&&!m&&f?.recordDroppedEvent("no_parent_span","span"),e.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d,n(e.fetchData.url)){let _=e.args[0],h=p({},e.args[1]||{}),S=rh(_,h,Oe()&&m?d:void 0,u);S&&(e.args[1]=h,h.headers=S)}if(f){let _={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",d,_)}return d}function pv(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function rh(e,t,n,r){let o=ci({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let c=t.headers||(rs(e)?e.headers:void 0);if(c)if(mv(c)){let u=new Headers(c);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),s){let f=u.get("baggage");f?Hc(f)||u.set("baggage",`${f},${s}`):u.set("baggage",s)}return u}else if(_v(c)){let u=[...c];u.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&a&&!u.find(l=>l[0]==="traceparent")&&u.push(["traceparent",a]);let f=c.find(l=>l[0]==="baggage"&&typeof l[1]=="string"&&Hc(l[1]));return s&&!f&&u.push(["baggage",s]),u}else{let u="sentry-trace"in c?c["sentry-trace"]:void 0,f="traceparent"in c?c.traceparent:void 0,l="baggage"in c?c.baggage:void 0,m=l?Array.isArray(l)?[...l]:[l]:[],d=l&&(Array.isArray(l)?l.find(h=>Hc(h)):Hc(l));s&&!d&&m.push(s);let _=Object.assign({},c,{"sentry-trace":u??i,baggage:m.length>0?m.join(","):void 0});return r&&a&&!f&&(_.traceparent=a),_}else return p({},o)}function dv(e,t){if(t.response){Vn(e,t.response.status);let n=t.response?.headers?.get("content-length");if(n){let r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:2,message:"internal_error"});e.end()}function Hc(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(cs))}function mv(e){return typeof Headers<"u"&&cn(e,Headers)}function _v(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function gv(e,t,n){if(e.startsWith("data:")){let i=at(e);return{name:`${t} ${i}`,attributes:nh(e,void 0,t,n)}}let r=On(e),o=r?ii(r):e;return{name:`${t} ${o}`,attributes:nh(e,r,t,n)}}function nh(e,t,n,r){let o={url:at(e),type:"fetch","http.method":n,[G]:r,[Z]:"http.client"};return t&&(uo(t)||(o["http.url"]=at(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function Fs(e,t={},n=w()){let{message:r,name:o,email:i,url:s,source:a,associatedEventId:c,tags:u}=e,f={contexts:{feedback:{contact_email:i,name:o,message:r,url:s,source:a,associated_event_id:c}},type:"feedback",level:"info",tags:u},l=n?.getClient()||I();return l&&l.emit("beforeSendFeedback",f,t),n.captureEvent(f,t)}var zf={};fm(zf,{debug:()=>Sv,error:()=>yv,fatal:()=>Iv,fmt:()=>Df,info:()=>Ev,trace:()=>hv,warn:()=>Tv});function li(e,t,n,r,o){br({level:e,message:t,attributes:n,severityNumber:o},r)}function hv(e,t,{scope:n}={}){li("trace",e,t,n)}function Sv(e,t,{scope:n}={}){li("debug",e,t,n)}function Ev(e,t,{scope:n}={}){li("info",e,t,n)}function Tv(e,t,{scope:n}={}){li("warn",e,t,n)}function yv(e,t,{scope:n}={}){li("error",e,t,n)}function Iv(e,t,{scope:n}={}){li("fatal",e,t,n)}function fi(e,t,n){return"util"in C&&typeof C.util.format=="function"?C.util.format(...e):bv(e,t,n)}function bv(e,t,n){return e.map(r=>je(r)?String(r):JSON.stringify(Se(r,t,n))).join(" ")}function Gc(e){return/%[sdifocO]/.test(e)}function $c(e,t){let n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((o,i)=>{n[`sentry.message.parameter.${i}`]=o}),n}var Av="ConsoleLogs",oh={[G]:"auto.log.console"},vv=(e={})=>{let t=e.levels||pr;return{name:Av,setup(n){let{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){A&&g.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let s=po(({args:a,level:c})=>{if(I()!==n||!t.includes(c))return;let u=a[0],f=a.slice(1);if(c==="assert"){if(!u){let d=f.length>0?`Assertion failed: ${fi(f,o,i)}`:"Assertion failed";br({level:"error",message:d,attributes:oh})}return}let l=c==="log",m=p({},oh);if(xe(u)){Object.assign(m,Se(u,o,i));let d=typeof a[1]=="string"?2:1;a.slice(d).forEach((h,S)=>{m[`sentry.message.parameter.${S}`]=Se(h,o,i)})}else if(f.length>0&&typeof u=="string"&&!Gc(u)){let _=$c(u,f);for(let[h,S]of Object.entries(_))m[h]=h.startsWith("sentry.message.parameter.")?Se(S,o,i):S}br({level:l?"info":c,message:fi(a,o,i),severityNumber:l?10:void 0,attributes:m})});n.registerCleanup(s)}}},ih=vv;var _o={};fm(_o,{count:()=>Rv,distribution:()=>Cv,gauge:()=>Nv});function qf(e,t,n,r){Af({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function Rv(e,t=1,n){qf("counter",e,t,n)}function Nv(e,t,n){qf("gauge",e,t,n)}function Cv(e,t,n){qf("distribution",e,t,n)}var xv=["trace","debug","info","warn","error","fatal"];function sh(e={}){let t=new Set(e.levels??xv),n=e.client;return{log(r){let T=r,{type:o,level:i,message:s,args:a,tag:c,date:u}=T,f=zt(T,["type","level","message","args","tag","date"]),l=n||I();if(!l)return;let m=Ov(o,i);if(!t.has(m))return;let{normalizeDepth:d=3,normalizeMaxBreadth:_=1e3}=l.getOptions(),h={};for(let[b,k]of Object.entries(f))h[b]=Se(k,d,_);h["sentry.origin"]="auto.log.consola",c&&(h["consola.tag"]=c),o&&(h["consola.type"]=o),i!=null&&typeof i=="number"&&(h["consola.level"]=i);let S=Lv(Mv(a,d,_),d,_);S?.attributes&&Object.assign(h,S.attributes),br({level:m,message:S?.message||s||a&&fi(a,d,_)||"",attributes:h})}}}var wv={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},kv={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function Ov(e,t){if(e==="verbose")return"debug";if(e==="silent")return"trace";if(e){let n=wv[e];if(n)return n}if(typeof t=="number"){let n=kv[t];if(n)return n}return"info"}function Mv(e,t,n){if(!e?.length)return{message:""};let r=fi(e,t,n),o=e[0];if(xe(o)){let i=typeof e[1]=="string"?2:1,s=e.slice(i);return{message:r,attributes:o,messageParameters:s}}else{let i=e.slice(1),s=i.length>0&&typeof o=="string"&&!Gc(o);return{message:r,messageTemplate:s?o:void 0,messageParameters:s?i:void 0}}}function Lv(e,t,n){let{message:r,attributes:o,messageTemplate:i,messageParameters:s}=e,a={};if(i&&s){let c=$c(i,s);for(let[u,f]of Object.entries(c))a[u]=u.startsWith("sentry.message.parameter.")?Se(f,t,n):f}else s&&s.length>0&&s.forEach((c,u)=>{a[`sentry.message.parameter.${u}`]=Se(c,t,n)});return{message:r,attributes:p(p({},Se(o,t,n)),a)}}var ah="gen_ai.prompt",Mn="gen_ai.system",we="gen_ai.request.model",pi="gen_ai.request.stream",Nr="gen_ai.request.temperature",di="gen_ai.request.max_tokens",Cr="gen_ai.request.frequency_penalty",mi="gen_ai.request.presence_penalty",xr="gen_ai.request.top_p",Wc="gen_ai.request.top_k",jc="gen_ai.request.encoding_format",zc="gen_ai.request.dimensions",Ln="gen_ai.response.finish_reasons",Vt="gen_ai.response.model",wr="gen_ai.response.id",ch="gen_ai.response.stop_reason",Kt="gen_ai.usage.input_tokens",Jt="gen_ai.usage.output_tokens",Bt="gen_ai.usage.total_tokens",Ke="gen_ai.operation.name",Xt="sentry.sdk_meta.gen_ai.input.messages.original_length",Sn="gen_ai.input.messages";var Pn="gen_ai.system_instructions",ct="gen_ai.response.text",Un="gen_ai.request.available_tools",uh="gen_ai.response.streaming",Ct="gen_ai.response.tool_calls",go="gen_ai.agent.name",lh="gen_ai.pipeline.name",Hs="gen_ai.conversation.id",fh="gen_ai.usage.cache_creation_input_tokens",ph="gen_ai.usage.cache_read_input_tokens";var dh="gen_ai.invoke_agent",_i="gen_ai.embeddings.input",Yf="gen_ai.embeddings",Vf="gen_ai.execute_tool",qc="gen_ai.tool.name",mh="gen_ai.tool.call.id",_h="gen_ai.tool.type",Yc="gen_ai.tool.input",Vc="gen_ai.tool.output",gh="gen_ai.tool.description";function kr(e){return!e||typeof e!="object"?!1:Uv(e)||Sh(e)||Pv(e)||Eh(e)||Th(e)||Dv(e)||Bv(e)||Fv(e)||Hv(e)||Gv(e)||$v(e)||Wv(e)}function Pv(e){return"image_url"in e?typeof e.image_url=="string"?e.image_url.startsWith("data:"):hh(e):!1}function hh(e){return"image_url"in e&&!!e.image_url&&typeof e.image_url=="object"&&"url"in e.image_url&&typeof e.image_url.url=="string"&&e.image_url.url.startsWith("data:")}function Uv(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&kr(e.source)}function Sh(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="string"}function Eh(e){return"type"in e&&e.type==="input_audio"&&"input_audio"in e&&!!e.input_audio&&typeof e.input_audio=="object"&&"data"in e.input_audio&&typeof e.input_audio.data=="string"}function Th(e){return"type"in e&&e.type==="file"&&"file"in e&&!!e.file&&typeof e.file=="object"&&"file_data"in e.file&&typeof e.file.file_data=="string"}function Dv(e){return"media_type"in e&&typeof e.media_type=="string"&&"data"in e}function Bv(e){return"type"in e&&e.type==="file"&&"mediaType"in e&&typeof e.mediaType=="string"&&"data"in e&&typeof e.data=="string"&&!e.data.startsWith("http://")&&!e.data.startsWith("https://")}function Fv(e){return"type"in e&&e.type==="image"&&"image"in e&&typeof e.image=="string"&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}function Hv(e){return"type"in e&&(e.type==="blob"||e.type==="base64")}function Gv(e){return"b64_json"in e}function $v(e){return"type"in e&&"result"in e&&e.type==="image_generation"}function Wv(e){return"uri"in e&&typeof e.uri=="string"&&e.uri.startsWith("data:")}var Gs="[Blob substitute]",jv=["image_url","data","content","b64_json","result","uri","image"];function ho(e){let t=p({},e);kr(t.source)&&(t.source=ho(t.source)),Sh(e)&&(t.inlineData=E(p({},e.inlineData),{data:Gs})),hh(e)&&(t.image_url=E(p({},e.image_url),{url:Gs})),Eh(e)&&(t.input_audio=E(p({},e.input_audio),{data:Gs})),Th(e)&&(t.file=E(p({},e.file),{file_data:Gs}));for(let n of jv)typeof t[n]=="string"&&(t[n]=Gs);return t}var Ih=2e4,Kc=e=>new TextEncoder().encode(e).length,Jf=e=>Kc(JSON.stringify(e));function Jc(e,t){if(Kc(e)<=t)return e;let n=0,r=e.length,o="";for(;n<=r;){let i=Math.floor((n+r)/2),s=e.slice(0,i);Kc(s)<=t?(o=s,n=i+1):r=i-1}return o}function zv(e){return typeof e=="string"?e:"text"in e&&typeof e.text=="string"?e.text:""}function yh(e,t){return typeof e=="string"?t:E(p({},e),{text:t})}function qv(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function bh(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function Ah(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function Yv(e,t){let n=E(p({},e),{content:""}),r=Jf(n),o=t-r;if(o<=0)return[];let i=Jc(e.content,o);return[E(p({},e),{content:i})]}function Vv(e){return"parts"in e&&Array.isArray(e.parts)?{key:"parts",items:e.parts}:"content"in e&&Array.isArray(e.content)?{key:"content",items:e.content}:{key:null,items:[]}}function Kv(e,t){let{key:n,items:r}=Vv(e);if(n===null||r.length===0)return[];let o=r.map(c=>yh(c,"")),i=Jf(E(p({},e),{[n]:o})),s=t-i;if(s<=0)return[];let a=[];for(let c of r){let u=zv(c),f=Kc(u);if(f<=s)a.push(c),s-=f;else if(a.length===0){let l=Jc(u,s);l&&a.push(yh(c,l));break}else break}return a.length<=0?[]:[E(p({},e),{[n]:a})]}function Jv(e,t){if(!e)return[];if(typeof e=="string"){let n=Jc(e,t);return n?[n]:[]}return typeof e!="object"?[]:qv(e)?Yv(e,t):bh(e)||Ah(e)?Kv(e,t):[]}function Kf(e){return e.map(n=>{let r;return n&&typeof n=="object"&&(bh(n)?r=E(p({},n),{content:Kf(n.content)}):"content"in n&&kr(n.content)&&(r=E(p({},n),{content:ho(n.content)})),Ah(n)&&(r=E(p({},r??n),{parts:Kf(n.parts)})),kr(r)?r=ho(r):kr(n)&&(r=ho(n))),r??n})}function Xv(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],o=Kf([r]),i=o[0];return Jf(i)<=n?o:Jv(i,n)}function vh(e){return Xv(e,Ih)}function Rh(e){return Jc(e,Ih)}function Ft(e){let t=I()?.getDataCollectionOptions().genAI;return E(p({},e),{recordInputs:e?.recordInputs??t?.inputs??!1,recordOutputs:e?.recordOutputs??t?.outputs??!1})}function xt(e){if(e!==void 0)return e;let t=I();return t?!Fe(t)&&t.getOptions().streamGenAiSpans===!1:!0}function gi(e,t){return e?`${e}.${t}`:t}function Nh(e,t,n,r,o){if(t!==void 0&&e.setAttributes({[Kt]:t}),n!==void 0&&e.setAttributes({[Jt]:n}),t!==void 0||n!==void 0||r!==void 0||o!==void 0){let i=(t??0)+(n??0)+(r??0)+(o??0);e.setAttributes({[Bt]:i})}}function So(e,t,n){if(!e.isRecording())return;let r={[uh]:!0};t.responseId&&(r[wr]=t.responseId),t.responseModel&&(r[Vt]=t.responseModel),t.promptTokens!==void 0&&(r[Kt]=t.promptTokens),t.completionTokens!==void 0&&(r[Jt]=t.completionTokens),t.totalTokens!==void 0?r[Bt]=t.totalTokens:(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[Bt]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)),t.finishReasons.length&&(r[Ln]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[ct]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[Ct]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function En(e){return typeof e=="string"?e:JSON.stringify(e)}function Tn(e){if(typeof e=="string")return Rh(e);if(Array.isArray(e)){let t=vh(e);return JSON.stringify(t)}return JSON.stringify(e)}function Dn(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(s=>s&&typeof s=="object"&&"role"in s&&s.role==="system");if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:e};let o=JSON.stringify([{type:"text",content:r}]),i=[...e.slice(0,t),...e.slice(t+1)];return{systemInstructions:o,filteredMessages:i}}async function Qv(e,t,n){let r=e.catch(s=>{throw J(s,{mechanism:{handled:!1,type:n}}),s}),o=await t,i=await r;return i&&typeof i=="object"&&"data"in i?E(p({},i),{data:o}):o}function hi(e,t,n){return pt(e)?new Proxy(e,{get(r,o){let s=o in Promise.prototype||o===Symbol.toStringTag?t:r,a=Reflect.get(s,o);return o==="withResponse"&&typeof a=="function"?function(){let u=a.call(r);return Qv(u,t,n)}:typeof a=="function"?a.bind(s):a}}):t}var Ch={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},Zv=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],xh=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...Zv];function wh(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function kh(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function Oh(e,t,n){if(!t||typeof t!="object")return;let r=t,o={};if(typeof r.id=="string"&&(o[wr]=r.id),typeof r.model=="string"&&(o[Vt]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Hs]=r.id),r.usage&&typeof r.usage=="object"){let i=r.usage,s=i.prompt_tokens??i.input_tokens;typeof s=="number"&&(o[Kt]=s);let a=i.completion_tokens??i.output_tokens;typeof a=="number"&&(o[Jt]=a),typeof i.total_tokens=="number"&&(o[Bt]=i.total_tokens)}if(Array.isArray(r.choices)){let i=r.choices,s=i.map(a=>a.finish_reason).filter(a=>typeof a=="string");if(s.length>0&&(o[Ln]=JSON.stringify(s)),n){let a=i.map(u=>u.message?.content||"");o[ct]=JSON.stringify(a);let c=i.map(u=>u.message?.tool_calls).filter(u=>Array.isArray(u)&&u.length>0).flat();c.length>0&&(o[Ct]=JSON.stringify(c))}}if(typeof r.status=="string"&&(o[Ln]||(o[Ln]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[ct]&&(o[ct]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!o[Ct])){let i=r.output.filter(s=>s?.type==="function_call");i.length>0&&(o[Ct]=JSON.stringify(i))}e.setAttributes(o)}function eR(e){if("conversation"in e&&typeof e.conversation=="string")return e.conversation;if("previous_response_id"in e&&typeof e.previous_response_id=="string")return e.previous_response_id}function Mh(e){let t={[we]:e.model??"unknown"};"temperature"in e&&(t[Nr]=e.temperature),"top_p"in e&&(t[xr]=e.top_p),"frequency_penalty"in e&&(t[Cr]=e.frequency_penalty),"presence_penalty"in e&&(t[mi]=e.presence_penalty),"stream"in e&&(t[pi]=e.stream),"encoding_format"in e&&(t[jc]=e.encoding_format),"dimensions"in e&&(t[zc]=e.dimensions);let n=eR(e);return n&&(t[Hs]=n),t}function tR(e,t){for(let n of e){let r=n.index;if(!(r===void 0||!n.function))if(!(r in t.chatCompletionToolCalls))t.chatCompletionToolCalls[r]=E(p({},n),{function:{name:n.function.name,arguments:n.function.arguments||""}});else{let o=t.chatCompletionToolCalls[r];n.function.arguments&&o?.function&&(o.function.arguments+=n.function.arguments)}}}function nR(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&tR(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function rR(e,t,n,r){if(!(e&&typeof e=="object")){t.eventTypes.push("unknown:non-object");return}if(e instanceof Error){r.setStatus({code:2,message:"internal_error"}),J(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in e))return;let o=e;if(!xh.includes(o.type)){t.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&t.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){t.responseTexts.push(o.delta);return}if("response"in o){let{response:i}=o;t.responseId=i.id??t.responseId,t.responseModel=i.model??t.responseModel,i.usage&&(t.promptTokens=i.usage.input_tokens,t.completionTokens=i.usage.output_tokens,t.totalTokens=i.usage.total_tokens),i.status&&t.finishReasons.push(i.status),n&&i.output_text&&t.responseTexts.push(i.output_text)}}async function*Lh(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let o of e)kh(o)?nR(o,r,n):wh(o)&&rR(o,r,n,t),yield o}finally{let o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];So(t,E(p({},r),{toolCalls:o}),n)}}function oR(e){let t=Array.isArray(e.tools)?e.tools:[],r=e.web_search_options&&typeof e.web_search_options=="object"?[p({type:"web_search_options"},e.web_search_options)]:[],o=[...t,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(i){A&&g.error("Failed to serialize OpenAI tools:",i);return}}function iR(e,t){let n={[Mn]:"openai",[Ke]:t,[G]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let r=e[0],o=oR(r);o&&(n[Un]=o),Object.assign(n,Mh(r))}else n[we]="unknown";return n}function Ph(e,t,n,r){if(n==="embeddings"&&"input"in t){let a=t.input;if(a==null||typeof a=="string"&&a.length===0||Array.isArray(a)&&a.length===0)return;e.setAttribute(_i,typeof a=="string"?a:JSON.stringify(a));return}let o="input"in t?t.input:"messages"in t?t.messages:void 0;if(!o||Array.isArray(o)&&o.length===0)return;let{systemInstructions:i,filteredMessages:s}=Dn(o);i&&e.setAttribute(Pn,i),e.setAttribute(Sn,r?Tn(s):En(s)),Array.isArray(s)?e.setAttribute(Xt,s.length):e.setAttribute(Xt,1)}function sR(e,t,n,r,o){return function(...s){let a=n.operation||"unknown",c=iR(s,a),u=c[we]||"unknown",f=s[0],l=f&&typeof f=="object"&&f.stream===!0,m={name:`${a} ${u}`,op:`gen_ai.${a}`,attributes:c};if(l){let h,S=_t(m,T=>(h=e.apply(r,s),o.recordInputs&&f&&Ph(T,f,a,xt(o.enableTruncation)),(async()=>{try{let b=await h;return Lh(b,T,o.recordOutputs??!1)}catch(b){throw T.setStatus({code:2,message:"internal_error"}),J(b,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),T.end(),b}})()));return hi(h,S,"auto.ai.openai")}let d,_=Ve(m,h=>(d=e.apply(r,s),o.recordInputs&&f&&Ph(h,f,a,xt(o.enableTruncation)),d.then(S=>(Oh(h,S,o.recordOutputs),S),S=>{throw J(S,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),S})));return hi(d,_,"auto.ai.openai")}}function Uh(e,t="",n){return new Proxy(e,{get(r,o){let i=r[o],s=gi(t,String(o)),a=Ch[s];return typeof i=="function"&&a?sR(i,s,a,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?Uh(i,s,n):i}})}function Dh(e,t){return Uh(e,"",Ft(t))}var Bh={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};function Fh(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:o}=Dn(t);r&&e.setAttributes({[Pn]:r});let i=Array.isArray(o)?o.length:1;e.setAttributes({[Sn]:n?Tn(o):En(o),[Xt]:i})}var aR={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function Xf(e){return e&&aR[e]||"internal_error"}function Hh(e,t){t.error&&(e.setStatus({code:2,message:Xf(t.error.type)}),J(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function Gh(e){let{system:t,messages:n,input:r}=e,o=typeof t=="string"?[{role:"system",content:e.system}]:[],i=Array.isArray(r)?r:r!=null?[r]:void 0,s=Array.isArray(n)?n:n!=null?[n]:[],a=i??s;return[...o,...a]}function cR(e,t){return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:2,message:Xf(e.error?.type)}),J(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function uR(e,t){if(e.type==="message_delta"&&e.usage&&"output_tokens"in e.usage&&typeof e.usage.output_tokens=="number"&&(t.completionTokens=e.usage.output_tokens),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function lR(e,t){e.type!=="content_block_start"||typeof e.index!="number"||!e.content_block||(e.content_block.type==="tool_use"||e.content_block.type==="server_tool_use")&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function fR(e,t,n){if(!(e.type!=="content_block_delta"||!e.delta)){if(typeof e.index=="number"&&"partial_json"in e.delta&&typeof e.delta.partial_json=="string"){let r=t.activeToolBlocks[e.index];r&&r.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text=="string"&&t.responseTexts.push(e.delta.text)}}function pR(e,t){if(e.type!=="content_block_stop"||typeof e.index!="number")return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(""),o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete t.activeToolBlocks[e.index]}function $h(e,t,n,r){!(e&&typeof e=="object")||cR(e,r)||(uR(e,t),lR(e,t),fR(e,t,n),pR(e,t))}async function*Wh(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let o of e)$h(o,r,n,t),yield o}finally{So(t,r,n)}}function jh(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",o=>{$h(o,r,n,t)}),e.on("message",()=>{So(t,r,n)}),e.on("error",o=>{J(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:2,message:"internal_error"}),t.end())}),e}function dR(e,t,n){let r={[Mn]:"anthropic",[Ke]:n,[G]:"auto.ai.anthropic"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let o=e[0];o.tools&&Array.isArray(o.tools)&&(r[Un]=JSON.stringify(o.tools)),r[we]=o.model??"unknown","temperature"in o&&(r[Nr]=o.temperature),"top_p"in o&&(r[xr]=o.top_p),"stream"in o&&(r[pi]=o.stream),"top_k"in o&&(r[Wc]=o.top_k),"frequency_penalty"in o&&(r[Cr]=o.frequency_penalty),"max_tokens"in o&&(r[di]=o.max_tokens)}else t==="models.retrieve"||t==="models.get"?r[we]=e[0]:r[we]="unknown";return r}function Qf(e,t,n){let r=Gh(t);Fh(e,r,n),"prompt"in t&&e.setAttributes({[ah]:JSON.stringify(t.prompt)})}function mR(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[ct]:t.content.map(r=>r.text).filter(r=>!!r).join("")});let n=[];for(let r of t.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&e.setAttributes({[Ct]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[ct]:t.completion}),"input_tokens"in t&&e.setAttributes({[ct]:JSON.stringify(t.input_tokens)})}function _R(e,t){"id"in t&&"model"in t&&(e.setAttributes({[wr]:t.id,[Vt]:t.model}),"usage"in t&&t.usage&&Nh(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function gR(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){Hh(e,t);return}n&&mR(e,t),_R(e,t)}}function zh(e,t,n){throw J(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:2,message:"internal_error"}),t.end()),e}function hR(e,t,n,r,o,i,s,a,c,u,f){let l=o[we]??"unknown",m={name:`${i} ${l}`,op:`gen_ai.${i}`,attributes:o};if(u&&!f){let d,_=_t(m,h=>(d=e.apply(n,r),c.recordInputs&&a&&Qf(h,a,xt(c.enableTruncation)),(async()=>{try{let S=await d;return Wh(S,h,c.recordOutputs??!1)}catch(S){return zh(S,h,s)}})()));return hi(d,_,"auto.ai.anthropic")}else return _t(m,d=>{try{c.recordInputs&&a&&Qf(d,a,xt(c.enableTruncation));let _=t.apply(n,r);return jh(_,d,c.recordOutputs??!1)}catch(_){return zh(_,d,s)}})}function SR(e,t,n,r,o){return new Proxy(e,{apply(i,s,a){let c=n.operation||"unknown",u=dR(a,t,c),f=u[we]??"unknown",l=typeof a[0]=="object"?a[0]:void 0,m=!!l?.stream,d=n.streaming===!0;if(m||d)return hR(e,i,r,a,u,c,t,l,o,m,d);let _,h=Ve({name:`${c} ${f}`,op:`gen_ai.${c}`,attributes:u},S=>(_=i.apply(r,a),o.recordInputs&&l&&Qf(S,l,xt(o.enableTruncation)),_.then(T=>(gR(S,T,o.recordOutputs),T),T=>{throw J(T,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}}),T})));return hi(_,h,"auto.ai.anthropic")}})}function qh(e,t="",n){return new Proxy(e,{get(r,o){let i=r[o],s=gi(t,String(o)),a=Bh[s];return typeof i=="function"&&a?SR(i,s,a,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?qh(i,s,n):i}})}function Yh(e,t){return qh(e,"",Ft(t))}var Vh={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{proxyResultPath:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},Kh="google_genai";function ER(e,t){let n=e?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:"internal_error"}),J(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function TR(e,t){typeof e.responseId=="string"&&(t.responseId=e.responseId),typeof e.modelVersion=="string"&&(t.responseModel=e.modelVersion);let n=e.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(t.totalTokens=n.totalTokenCount))}function yR(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let o of r?.content?.parts??[])n&&o.text&&t.responseTexts.push(o.text),o.functionCall&&t.toolCalls.push({type:"function",id:o.functionCall.id,name:o.functionCall.name,arguments:o.functionCall.args})}}function IR(e,t,n,r){!e||ER(e,r)||(TR(e,t),yR(e,t,n))}async function*Jh(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of e)IR(o,r,n,t),yield o}finally{So(t,r,n)}}function Si(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>Si(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[E(p({},e),{role:t})]:[{role:t,content:e}]}function Xh(e,t){if("model"in e&&typeof e.model=="string")return e.model;if(t&&typeof t=="object"){let n=t;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function bR(e){let t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[Nr]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[xr]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[Wc]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[di]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[Cr]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[mi]=e.presencePenalty),t}function AR(e,t,n){let r={[Mn]:Kh,[Ke]:e,[G]:"auto.ai.google_genai"};if(t){if(r[we]=Xh(t,n),"config"in t&&typeof t.config=="object"&&t.config){let o=t.config;if(Object.assign(r,bR(o)),"tools"in o&&Array.isArray(o.tools)){let i=o.tools.flatMap(s=>s.functionDeclarations);r[Un]=JSON.stringify(i)}}}else r[we]=Xh({},n);return r}function Qh(e,t,n,r){if(n){let i=t.contents;i!=null&&e.setAttribute(_i,typeof i=="string"?i:JSON.stringify(i));return}let o=[];if("config"in t&&t.config&&typeof t.config=="object"&&"systemInstruction"in t.config&&t.config.systemInstruction&&o.push(...Si(t.config.systemInstruction,"system")),"history"in t&&o.push(...Si(t.history,"user")),"contents"in t&&o.push(...Si(t.contents,"user")),"message"in t&&o.push(...Si(t.message,"user")),Array.isArray(o)&&o.length){let{systemInstructions:i,filteredMessages:s}=Dn(o);i&&e.setAttribute(Pn,i);let a=Array.isArray(s)?s.length:0;e.setAttributes({[Xt]:a,[Sn]:r?Tn(s):En(s)})}}function vR(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(Vt,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){let r=t.usageMetadata;typeof r.promptTokenCount=="number"&&e.setAttributes({[Kt]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&e.setAttributes({[Jt]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&e.setAttributes({[Bt]:r.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let r=t.candidates.map(o=>o.content?.parts&&Array.isArray(o.content.parts)?o.content.parts.map(i=>typeof i.text=="string"?i.text:"").filter(i=>i.length>0).join(""):"").filter(o=>o.length>0);r.length>0&&e.setAttributes({[ct]:r.join("")})}if(n&&t.functionCalls){let r=t.functionCalls;Array.isArray(r)&&r.length>0&&e.setAttributes({[Ct]:JSON.stringify(r)})}}}function RR(e,t,n,r,o){let i=n.operation==="embeddings";return new Proxy(e,{apply(s,a,c){let u=n.operation||"unknown",f=c[0],l=AR(u,f,r),m=l[we]??"unknown";return n.streaming?_t({name:`${u} ${m}`,op:`gen_ai.${u}`,attributes:l},async d=>{try{o.recordInputs&&f&&Qh(d,f,i,xt(o.enableTruncation));let _=await s.apply(r,c);return Jh(_,d,!!o.recordOutputs)}catch(_){throw d.setStatus({code:2,message:"internal_error"}),J(_,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),d.end(),_}}):Ve({name:`${u} ${m}`,op:`gen_ai.${u}`,attributes:l},d=>(o.recordInputs&&f&&Qh(d,f,i,xt(o.enableTruncation)),ys(()=>s.apply(r,c),_=>{J(_,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},_=>{i||vR(d,_,o.recordOutputs)})))}})}function Zf(e,t="",n){return new Proxy(e,{get:(r,o,i)=>{let s=Reflect.get(r,o,i),a=gi(t,String(o)),c=Vh[a];if(typeof s=="function"&&c){let u=c.operation?RR(s,a,c,r,n):s.bind(r);return c.proxyResultPath?function(...f){let l=u(...f);return l&&typeof l=="object"?Zf(l,c.proxyResultPath,n):l}:u}return typeof s=="function"?s.bind(r):s&&typeof s=="object"?Zf(s,a,n):s}})}function Zh(e,t){return Zf(e,"",Ft(t))}var nr="auto.ai.langchain",eS={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var Qt=(e,t,n)=>{n!=null&&(e[t]=n)},Ht=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function Eo(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Ei(e){if(Array.isArray(e))try{let t=e.map(n=>n&&typeof n=="object"&&kr(n)?ho(n):n);return JSON.stringify(t)}catch{return String(e)}return Eo(e)}function $s(e){let t=e.toLowerCase();return eS[t]??t}function tS(e){return e.includes("System")?"system":e.includes("Human")?"user":e.includes("AI")||e.includes("Assistant")?"assistant":e.includes("Function")?"function":e.includes("Tool")?"tool":"user"}function ep(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function Ws(e){return e.map(t=>{let n=t._getType;if(typeof n=="function"){let o=n.call(t);return{role:$s(o),content:Ei(t.content)}}if(t.lc===1&&t.kwargs){let o=t.id,i=Array.isArray(o)&&o.length>0?o[o.length-1]:"",s=typeof i=="string"?tS(i):"user";return{role:$s(s),content:Ei(t.kwargs?.content)}}if(t.type){let o=String(t.type).toLowerCase();return{role:$s(o),content:Ei(t.content)}}if(t.role)return{role:$s(String(t.role)),content:Ei(t.content)};let r=t.constructor?.name;return r&&r!=="Object"?{role:$s(tS(r)),content:Ei(t.content)}:{role:"user",content:Ei(t.content)}})}function NR(e,t,n){let r={},o="kwargs"in e?e.kwargs:void 0,i=t?.temperature??n?.ls_temperature??o?.temperature;Ht(r,Nr,i);let s=t?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Ht(r,di,s);let a=t?.top_p??o?.top_p;Ht(r,xr,a);let c=t?.frequency_penalty;Ht(r,Cr,c);let u=t?.presence_penalty;return Ht(r,mi,u),t&&"stream"in t&&Qt(r,pi,!!t.stream),r}function rS(e,t,n,r,o){return p({[Mn]:Eo(e??"langchain"),[Ke]:"chat",[we]:Eo(t),[G]:nr},NR(n,r,o))}function oS(e,t,n,r,o,i){let s=i?.ls_provider,a=o?.model??i?.ls_model_name??"unknown",c=rS(s,a,e,o,i);if(n&&Array.isArray(t)&&t.length>0){Qt(c,Xt,t.length);let u=t.map(f=>({role:"user",content:f}));Qt(c,Sn,r?Tn(u):En(u))}return c}function iS(e,t,n,r,o,i){let s=i?.ls_provider??e.id?.[2],a=o?.model??i?.ls_model_name??"unknown",c=rS(s,a,e,o,i);if(n&&Array.isArray(t)&&t.length>0){let u=Ws(t.flat()),{systemInstructions:f,filteredMessages:l}=Dn(u);f&&Qt(c,Pn,f);let m=Array.isArray(l)?l.length:0;Qt(c,Xt,m),Qt(c,Sn,r?Tn(l):En(l))}return c}function CR(e,t){let n=[],r=e.flat();for(let o of r){let s=o.message?.tool_calls;if(Array.isArray(s)&&s.length>0)n.push(...s);else{let a=o.message?.content;if(Array.isArray(a))for(let c of a){let u=c;u.type==="tool_use"&&n.push(u)}}}n.length>0&&Qt(t,Ct,Eo(n))}function xR(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)Ht(t,Kt,n.promptTokens),Ht(t,Jt,n.completionTokens),Ht(t,Bt,n.totalTokens);else if(r){Ht(t,Kt,r.input_tokens),Ht(t,Jt,r.output_tokens);let o=Number(r.input_tokens),i=Number(r.output_tokens),s=(Number.isNaN(o)?0:o)+(Number.isNaN(i)?0:i);s>0&&Ht(t,Bt,s),r.cache_creation_input_tokens!==void 0&&Ht(t,fh,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Ht(t,ph,r.cache_read_input_tokens)}}function sS(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let u=e.generations.flat().map(f=>f.generationInfo?.finish_reason?f.generationInfo.finish_reason:f.generation_info?.finish_reason?f.generation_info.finish_reason:null).filter(f=>typeof f=="string");if(u.length>0&&Qt(n,Ln,Eo(u)),CR(e.generations,n),t){let f=e.generations.flat().map(l=>l.text??l.message?.content).filter(l=>typeof l=="string");f.length>0&&Qt(n,ct,Eo(f))}}xR(e.llmOutput,n);let r=e.llmOutput,i=e.generations?.[0]?.[0]?.message,s=r?.model_name??r?.model??i?.response_metadata?.model_name;s&&Qt(n,Vt,s);let a=r?.id??i?.id;a&&Qt(n,wr,a);let c=r?.stop_reason??i?.response_metadata?.finish_reason;return c&&Qt(n,ch,Eo(c)),n}function Xc(e){let t={},n=e?.lc_agent_name;return typeof n=="string"&&(t[go]=n),t}function aS(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(r=>{let o=r.function;return{type:"function",name:r.name??o?.name??"",description:r.description??o?.description}});return JSON.stringify(n)}function wR(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.addHandler=="function"&&typeof t.copy=="function"}function kR(e){return typeof e=="object"&&e?.name==="SentryCallbackHandler"}function nS(e){return e.some(kR)}function cS(e,t){if(!e)return[t];if(wR(e)){if(nS(e.handlers??[]))return e;let r=e.copy();return r.addHandler(t,!0),r}let n=Array.isArray(e)?e:[e];return nS(n)?e:[...n,t]}function js(e={}){let{recordInputs:t,recordOutputs:n}=Ft(e),r=xt(e.enableTruncation),o=new Map,i=a=>{let c=o.get(a);c?.isRecording()&&(c.end(),o.delete(a))},s={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(a,c,u,f,l,m,d,_){let h=ep(m),S=oS(a,c,t,r,h,d),T=S[we],b=S[Ke];_t({name:`${b} ${T}`,op:"gen_ai.chat",attributes:E(p(p({},Xc(d)),S),{[Z]:"gen_ai.chat"})},k=>(o.set(u,k),k))},handleChatModelStart(a,c,u,f,l,m,d,_){let h=ep(m),S=iS(a,c,t,r,h,d),T=aS(l);T&&(S[Un]=T);let b=S[we],k=S[Ke];_t({name:`${k} ${b}`,op:"gen_ai.chat",attributes:E(p(p({},Xc(d)),S),{[Z]:"gen_ai.chat"})},R=>(o.set(u,R),R))},handleLLMEnd(a,c,u,f,l){let m=o.get(c);if(m?.isRecording()){let d=sS(a,n);d&&m.setAttributes(d),i(c)}},handleLLMError(a,c){let u=o.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),J(a,{mechanism:{handled:!1,type:`${nr}.llm_error_handler`}})},handleChainStart(a,c,u,f,l,m,d,_){if(m?.__sentry_langgraph__)return;let h=_||a.name||"unknown_chain",S={[G]:"auto.ai.langchain","langchain.chain.name":h};t&&(S["langchain.chain.inputs"]=JSON.stringify(c)),_t({name:`chain ${h}`,op:"gen_ai.invoke_agent",attributes:E(p({},S),{[Z]:"gen_ai.invoke_agent"})},T=>(o.set(u,T),T))},handleChainEnd(a,c){let u=o.get(c);u?.isRecording()&&(n&&u.setAttributes({"langchain.chain.outputs":JSON.stringify(a)}),i(c))},handleChainError(a,c){let u=o.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),J(a,{mechanism:{handled:!1,type:`${nr}.chain_error_handler`}})},handleToolStart(a,c,u,f,l,m,d){if(m?.__sentry_langgraph__)return;let _=d||a.name||"unknown_tool",h=E(p({},Xc(m)),{[G]:nr,[Ke]:"execute_tool",[qc]:_});t&&(h[Yc]=c),_t({name:`execute_tool ${_}`,op:"gen_ai.execute_tool",attributes:E(p({},h),{[Z]:"gen_ai.execute_tool"})},S=>(o.set(u,S),S))},handleToolEnd(a,c){let u=o.get(c);if(u?.isRecording()){if(n){let f=a,l=f&&typeof f=="object"&&"content"in f?f.content:a;u.setAttributes({[Vc]:typeof l=="string"?l:JSON.stringify(l)})}i(c)}},handleToolError(a,c){let u=o.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),J(a,{mechanism:{handled:!1,type:`${nr}.tool_error_handler`}})},copy(){return s},toJSON(){return{lc:1,type:"not_implemented",id:s.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:s.lc_id}}};return s}var zs="auto.ai.langgraph";function uS(e){let t=e[0];if(typeof t!="object"||!t||!("llm"in t)||!t.llm||typeof t.llm!="object")return null;let n=t.llm;return typeof n.modelName!="string"&&typeof n.model!="string"?null:n}function lS(e){let t=e[0];return typeof t=="object"&&t&&"name"in t&&typeof t.name=="string"?t.name:null}function fS(e,t,n){let r="__sentry_tool_wrapped__";for(let o of e){if(!o||typeof o!="object")continue;let i=o,s=i.invoke;if(typeof s!="function"||Object.prototype.hasOwnProperty.call(i,r))continue;let a=typeof i.name=="string"?i.name:"unknown_tool",c=typeof i.description=="string"?i.description:void 0,u=new Proxy(s,{apply(f,l,m){let d={[G]:zs,[Z]:Vf,[Ke]:"execute_tool",[qc]:a,[_h]:"function"},h=m[1]?.metadata?.lc_agent_name??n;typeof h=="string"&&(d[go]=h),c&&(d[gh]=c);let S=m[0];if(typeof S=="object"&&S&&("id"in S&&typeof S.id=="string"&&(d[mh]=S.id),t.recordInputs)){let T="args"in S&&typeof S.args=="object"?S.args:S;try{d[Yc]=JSON.stringify(T)}catch{}}return Ve({op:Vf,name:`execute_tool ${a}`,attributes:d},async T=>{try{let b=await Reflect.apply(f,l,m);if(t.recordOutputs)try{let k=b,R=k&&typeof k=="object"&&"content"in k?k.content:b;T.setAttribute(Vc,typeof R=="string"?R:JSON.stringify(R))}catch{}return b}catch(b){throw T.setStatus({code:2,message:"internal_error"}),J(b,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),b}})}});i.invoke=u,Object.defineProperty(i,r,{value:!0,enumerable:!1})}return e}function OR(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n=="object"){let r=n.tool_calls;r&&Array.isArray(r)&&t.push(...r)}return t.length>0?t:null}function MR(e){let t=e,n=0,r=0,o=0;if(t.usage_metadata&&typeof t.usage_metadata=="object"){let i=t.usage_metadata;return typeof i.input_tokens=="number"&&(n=i.input_tokens),typeof i.output_tokens=="number"&&(r=i.output_tokens),typeof i.total_tokens=="number"&&(o=i.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(t.response_metadata&&typeof t.response_metadata=="object"){let i=t.response_metadata;if(i.tokenUsage&&typeof i.tokenUsage=="object"){let s=i.tokenUsage;typeof s.promptTokens=="number"&&(n=s.promptTokens),typeof s.completionTokens=="number"&&(r=s.completionTokens),typeof s.totalTokens=="number"&&(o=s.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function LR(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata=="object"){let r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&e.setAttribute(Vt,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&e.setAttribute(Ln,[r.finish_reason])}}function pS(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function dS(e,t,n){let o=n?.messages;if(!o||!Array.isArray(o))return;let i=t?.length??0,s=o.length>i?o.slice(i):[];if(s.length===0)return;let a=OR(s);a&&e.setAttribute(Ct,JSON.stringify(a));let c=Ws(s);e.setAttribute(ct,JSON.stringify(c));let u=0,f=0,l=0;for(let m of s){let d=MR(m);u+=d.inputTokens,f+=d.outputTokens,l+=d.totalTokens,LR(e,m)}u>0&&e.setAttribute(Kt,u),f>0&&e.setAttribute(Jt,f),l>0&&e.setAttribute(Bt,l)}var tp=!1,Qc="__sentry_patched__";function mS(e,t){if(Object.prototype.hasOwnProperty.call(e,Qc))return e;let n=js(t),r=new Proxy(e,{apply(o,i,s){return tp?Reflect.apply(o,i,s):Ve({op:"gen_ai.create_agent",name:"create_agent",attributes:{[G]:zs,[Z]:"gen_ai.create_agent",[Ke]:"create_agent"}},a=>{try{let c=Reflect.apply(o,i,s),u=s.length>0?s[0]:{};u?.name&&typeof u.name=="string"&&(a.setAttribute(go,u.name),a.updateName(`create_agent ${u.name}`));let f=c.invoke;return f&&typeof f=="function"&&(c.invoke=_S(f.bind(c),c,u,t,void 0,n)),c}catch(c){throw a.setStatus({code:2,message:"internal_error"}),J(c,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),c}})}});return Object.defineProperty(r,Qc,{value:!0,enumerable:!1}),r}function _S(e,t,n,r,o,i){return new Proxy(e,{apply(s,a,c){let u=o?.modelName??o?.model;return Ve({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[G]:zs,[Z]:dh,[Ke]:"invoke_agent"}},async f=>{try{let l=n?.name;l&&typeof l=="string"&&(f.setAttribute(lh,l),f.setAttribute(go,l),f.updateName(`invoke_agent ${l}`)),u&&f.setAttribute(we,u);let _=(c.length>1?c[1]:void 0)?.configurable?.thread_id;if(_&&typeof _=="string"&&f.setAttribute(Hs,_),i){let R=c[1]??{};c[1]=R;let U=R.metadata??{};R.metadata=p(E(p({},U),{__sentry_langgraph__:!0}),typeof l=="string"?{lc_agent_name:l}:{}),R.callbacks=cS(R.callbacks,i)}let h=pS(t);h&&f.setAttribute(Un,JSON.stringify(h));let S=r.recordInputs,T=r.recordOutputs,b=c.length>0?c[0]?.messages??[]:[];if(b&&S){let R=Ws(b),{systemInstructions:U,filteredMessages:D}=Dn(R);U&&f.setAttribute(Pn,U);let y=xt(r.enableTruncation),O=Array.isArray(D)?D.length:0;f.setAttributes({[Sn]:y?Tn(D):En(D),[Xt]:O})}let k=await Reflect.apply(s,a,c);return T&&dS(f,b??null,k),k}catch(l){throw f.setStatus({code:2,message:"internal_error"}),J(l,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),l}})}})}function gS(e,t){if(Object.prototype.hasOwnProperty.call(e,Qc))return e;let n=Ft(t),r=js(n),o=new Proxy(e,{apply(i,s,a){let c=uS(a),u=lS(a),f=a[0];f&&Array.isArray(f.tools)&&f.tools.length>0&&fS(f.tools,n,u??void 0),tp=!0;let l;try{l=Reflect.apply(i,s,a)}finally{tp=!1}let m=l.invoke;if(m&&typeof m=="function"){let d={};u&&(d.name=u),l.invoke=_S(m.bind(l),l,d,n,c,r)}return l}});return Object.defineProperty(o,Qc,{value:!0,enumerable:!1}),o}function hS(e,t){return e.compile=mS(e.compile,Ft(t)),e}function SS(e,t,n){let r=n.getOptions(),o=n.getDsn(),i=r.tunnel,s=gn(r._metadata),a=p(p(p({sent_at:new Date(rt()).toISOString()},PR(t)&&{trace:t}),s&&{sdk:s}),!!i&&o&&{dsn:qe(o)}),c=n.getDataCollectionOptions().userInfo?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},E(p({version:2},st()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}}),{items:e})];return Me(a,[u])}function PR(e){return!!e.trace_id&&!!e.public_key}function ES(e){let t=156;if(t+=e.name.length*2,t+=Dl(e.attributes),e.links&&e.links.length>0){let r=e.links[0]?.attributes,o=100+(r?Dl(r):0);t+=o*e.links.length}return t}var TS=1e3,UR=5e6,qs=class{constructor(t,n){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:i}=n??{};this._maxSpanLimit=r&&r>0&&r<=TS?r:TS,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=i&&i>0?i:UR,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(s=>{clearTimeout(s.timeout)}),this._traceBuckets.clear()})}add(t){let n=t.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:Ar(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=ES(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(A&&g.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){let n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}let r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){A&&g.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let i=Be(o),s=r.map(c=>{let l=c,{_segmentSpan:u}=l;return zt(l,["_segmentSpan"])}),a=SS(s,i,this._client);A&&g.log(`Sending span envelope for trace ${t} with ${s.length} spans`),this._client.sendEnvelope(a).then(null,c=>{A&&g.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}};function Zc(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var Ti=C;function eu(){return"history"in Ti&&!!Ti.history}function DR(){if(!("fetch"in Ti))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function yi(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Ii(){if(typeof EdgeRuntime=="string")return!0;if(!DR())return!1;if(yi(Ti.fetch))return!0;let e=!1,t=Ti.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=yi(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){A&&g.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function tu(){return"ReportingObserver"in Ti}function Bn(e,t){let n="fetch",r=tt(n,e);return nt(n,()=>IS(void 0,t)),r}function ru(e){let t="fetch-body-resolved",n=tt(t,e);return nt(t,()=>IS(FR)),n}function IS(e,t=!1){t&&!Ii()||ye(C,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=HR(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:ne()*1e3,virtualError:o,headers:GR(r)};return e||We("fetch",p({},a)),n.apply(C,r).then(async c=>(e?e(c):We("fetch",E(p({},a),{endTimestamp:ne()*1e3,response:c})),c),c=>{We("fetch",E(p({},a),{endTimestamp:ne()*1e3,error:c})),Ze(c)&&c.stack===void 0&&(c.stack=o.stack,_e(c,"framesToPop",1));let f=I()?.getOptions().enhanceFetchErrorMessages??"always";if(f!==!1&&c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{let d=new URL(a.fetchData.url).host;f==="always"?c.message=`${c.message} (${d})`:_e(c,"__sentry_fetch_url_host__",d)}catch{}throw c})}})}async function BR(e,t){if(e?.body){let n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),i=!0;for(;i;){let s;try{s=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:a}=await r.read();clearTimeout(s),a&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(s)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function FR(e){let t;try{t=e.clone()}catch{return}BR(t,()=>{We("fetch-body-resolved",{endTimestamp:ne()*1e3,response:e})})}function nu(e,t){return!!e&&typeof e=="object"&&!!e[t]}function yS(e){return typeof e=="string"?e:e?nu(e,"url")?e.url:e.toString?e.toString():"":""}function HR(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:yS(n),method:nu(r,"method")?String(r.method).toUpperCase():rs(n)&&nu(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:yS(t),method:nu(t,"method")?String(t.method).toUpperCase():"GET"}}function GR(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(rs(t))return new Headers(t.headers)}catch{}}var bS=C;function ut(){try{return bS.document.location.href}catch{return""}}function Or(e,t=5){if(!bS.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function $R(e){let t=e.constructor?.name??"";return t.includes("OpenAI")?"openai":t.includes("Google")?"google_genai":t.includes("Mistral")?"mistralai":t.includes("Vertex")?"google_vertexai":t.includes("Bedrock")?"aws_bedrock":t.includes("Ollama")?"ollama":t.includes("Cloudflare")?"cloudflare":t.includes("Cohere")?"cohere":"langchain"}function WR(e){let t=e??{},n={[G]:nr,[Z]:Yf,[Ke]:"embeddings",[we]:t.model??"unknown"};return n[Mn]=$R(t),"dimensions"in t&&(n[zc]=t.dimensions),"encodingFormat"in t&&(n[jc]=t.encodingFormat),n}function AS(e,t={}){let{recordInputs:n}=Ft(t);return new Proxy(e,{apply(r,o,i){let s=WR(o),a=s[we]||"unknown";if(n){let c=i[0];c!=null&&(s[_i]=typeof c=="string"?c:JSON.stringify(c))}return Ve({name:`embeddings ${a}`,op:Yf,attributes:s},()=>Reflect.apply(r,o,i).then(void 0,c=>{throw J(c,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),c}))}})}function vS(e,t){let n=e;return typeof n.embedQuery=="function"&&(n.embedQuery=AS(n.embedQuery,t)),typeof n.embedDocuments=="function"&&(n.embedDocuments=AS(n.embedDocuments,t)),e}var yn=C,be=yn.document,Ys=yn.navigator,jS="Report a Bug",fN="Cancel",pN="Send Bug Report",dN="Confirm",mN="Report a Bug",_N="your.email@example.org",gN="Email",hN="What's the bug? What did you expect?",SN="Description",EN="Your Name",TN="Name",yN="Thank you for your report!",IN="(required)",bN="Add a screenshot",AN="Remove screenshot",vN="Highlight",RN="Hide",NN="Remove",zS="Unable to submit feedback with empty message",qS="No client setup, cannot send feedback.",YS="Unable to determine if Feedback was correctly sent.",VS="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",KS="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",CN="widget",xN="api",wN=5e3,kN={ERROR_EMPTY_MESSAGE:zS,ERROR_NO_CLIENT:qS,ERROR_TIMEOUT:YS,ERROR_FORBIDDEN:VS,ERROR_GENERIC:KS};function au(e,t){return t?.[e]??kN[e]}function RS(e,t){return new Error(au(e,t))}var JS=(e,t={includeReplay:!0})=>{let n=t.errorMessages;if(!e.message)throw RS("ERROR_EMPTY_MESSAGE",n);let r=I();if(!r)throw RS("ERROR_NO_CLIENT",n);e.tags&&Object.keys(e.tags).length&&w().setTags(e.tags);let o=Fs(p({source:xN,url:ut()},e),t);return new Promise((i,s)=>{let a=setTimeout(()=>{c(),s(au("ERROR_TIMEOUT",n))},3e4),c=r.on("afterSendEvent",(u,f)=>{if(u.event_id===o)return clearTimeout(a),c(),f?.statusCode&&f.statusCode>=200&&f.statusCode<300?i(o):f?.statusCode===403?s(au("ERROR_FORBIDDEN",n)):s(au("ERROR_GENERIC",n))})})},cu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function ON(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Ys.userAgent)||/Macintosh/i.test(Ys.userAgent)&&Ys.maxTouchPoints&&Ys.maxTouchPoints>1||!isSecureContext)}function ou(e,t){return E(p(p({},e),t),{tags:p(p({},e.tags),t.tags),onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:p(p({},e.themeDark),t.themeDark),themeLight:p(p({},e.themeLight),t.themeLight)})}function MN(e){let t=be.createElement("style");return t.textContent=`
|
|
19
|
+
.widget__actor {
|
|
20
|
+
position: fixed;
|
|
21
|
+
z-index: var(--z-index);
|
|
22
|
+
margin: var(--page-margin);
|
|
23
|
+
inset: var(--actor-inset);
|
|
24
|
+
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
padding: 16px;
|
|
29
|
+
|
|
30
|
+
font-family: inherit;
|
|
31
|
+
font-size: var(--font-size);
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
line-height: 1.14em;
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
|
|
36
|
+
background: var(--actor-background, var(--background));
|
|
37
|
+
border-radius: var(--actor-border-radius, 1.7em/50%);
|
|
38
|
+
border: var(--actor-border, var(--border));
|
|
39
|
+
box-shadow: var(--actor-box-shadow, var(--box-shadow));
|
|
40
|
+
color: var(--actor-color, var(--foreground));
|
|
41
|
+
fill: var(--actor-color, var(--foreground));
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
opacity: 1;
|
|
44
|
+
transition: transform 0.2s ease-in-out;
|
|
45
|
+
transform: translate(0, 0) scale(1);
|
|
46
|
+
}
|
|
47
|
+
.widget__actor[aria-hidden="true"] {
|
|
48
|
+
opacity: 0;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
visibility: hidden;
|
|
51
|
+
transform: translate(0, 16px) scale(0.98);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.widget__actor:hover {
|
|
55
|
+
background: var(--actor-hover-background, var(--background));
|
|
56
|
+
filter: var(--interactive-filter);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.widget__actor svg {
|
|
60
|
+
width: 1.14em;
|
|
61
|
+
height: 1.14em;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@media (max-width: 600px) {
|
|
65
|
+
.widget__actor span {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`,e&&t.setAttribute("nonce",e),t}function Gt(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}var bi=20,LN="http://www.w3.org/2000/svg";function PN(){let e=a=>yn.document.createElementNS(LN,a),t=Gt(e("svg"),{width:`${bi}`,height:`${bi}`,viewBox:`0 0 ${bi} ${bi}`,fill:"var(--actor-color, var(--foreground))"}),n=Gt(e("g"),{clipPath:"url(#clip0_57_80)"}),r=Gt(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);let o=e("defs"),i=Gt(e("clipPath"),{id:"clip0_57_80"}),s=Gt(e("rect"),{width:`${bi}`,height:`${bi}`,fill:"white"});return i.appendChild(s),o.appendChild(i),t.appendChild(o).appendChild(i).appendChild(s),t}function UN({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){let o=be.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||jS,o.appendChild(PN()),e){let s=be.createElement("span");s.appendChild(be.createTextNode(e)),o.appendChild(s)}let i=MN(r);return{el:o,appendToDom(){n.appendChild(i),n.appendChild(o)},removeFromDom(){o.remove(),i.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}var XS="rgba(88, 74, 192, 1)",DN={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:XS,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},NS={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:XS,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function CS(e){return`
|
|
70
|
+
--foreground: ${e.foreground};
|
|
71
|
+
--background: ${e.background};
|
|
72
|
+
--accent-foreground: ${e.accentForeground};
|
|
73
|
+
--accent-background: ${e.accentBackground};
|
|
74
|
+
--success-color: ${e.successColor};
|
|
75
|
+
--error-color: ${e.errorColor};
|
|
76
|
+
--border: ${e.border};
|
|
77
|
+
--box-shadow: ${e.boxShadow};
|
|
78
|
+
--outline: ${e.outline};
|
|
79
|
+
--interactive-filter: ${e.interactiveFilter};
|
|
80
|
+
`}function xS({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){let o=be.createElement("style");return o.textContent=`
|
|
81
|
+
:host {
|
|
82
|
+
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
|
|
83
|
+
--font-size: 14px;
|
|
84
|
+
--z-index: 100000;
|
|
85
|
+
|
|
86
|
+
--page-margin: 16px;
|
|
87
|
+
--inset: auto 0 0 auto;
|
|
88
|
+
--actor-inset: var(--inset);
|
|
89
|
+
|
|
90
|
+
font-family: var(--font-family);
|
|
91
|
+
font-size: var(--font-size);
|
|
92
|
+
|
|
93
|
+
${e!=="system"?`color-scheme: only ${e};`:""}
|
|
94
|
+
|
|
95
|
+
${CS(e==="dark"?p(p({},NS),t):p(p({},DN),n))}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${e==="system"?`
|
|
99
|
+
@media (prefers-color-scheme: dark) {
|
|
100
|
+
:host {
|
|
101
|
+
color-scheme: only dark;
|
|
102
|
+
|
|
103
|
+
${CS(p(p({},NS),t))}
|
|
104
|
+
}
|
|
105
|
+
}`:""}
|
|
106
|
+
`,r&&o.setAttribute("nonce",r),o}var mu=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:o="sentry-feedback",autoInject:i=!0,showBranding:s=!0,isEmailRequired:a=!1,isNameRequired:c=!1,showEmail:u=!0,showName:f=!0,enableScreenshot:l=!0,useSentryUser:m={email:"email",name:"username"},tags:d,styleNonce:_,scriptNonce:h,colorScheme:S="system",themeLight:T={},themeDark:b={},addScreenshotButtonLabel:k=bN,cancelButtonLabel:R=fN,confirmButtonLabel:U=dN,emailLabel:D=gN,emailPlaceholder:y=_N,formTitle:O=mN,isRequiredLabel:Y=IN,messageLabel:N=SN,messagePlaceholder:B=hN,nameLabel:M=TN,namePlaceholder:F=EN,removeScreenshotButtonLabel:j=AN,submitButtonLabel:ae=pN,successMessageText:ue=yN,triggerLabel:z=jS,triggerAriaLabel:L="",highlightToolText:q=vN,hideToolText:H=RN,removeHighlightText:ce=NN,errorEmptyMessageText:le=zS,errorNoClientText:Ee=qS,errorTimeoutText:ke=YS,errorForbiddenText:Wt=VS,errorGenericText:sn=KS,onFormOpen:lr,onFormClose:Hr,onSubmitSuccess:wa,onSubmitError:Gr,onFormSubmitted:ka}={})=>{let Wn={id:o,autoInject:i,showBranding:s,isEmailRequired:a,isNameRequired:c,showEmail:u,showName:f,enableScreenshot:l,useSentryUser:m,tags:d,styleNonce:_,scriptNonce:h,colorScheme:S,themeDark:b,themeLight:T,triggerLabel:z,triggerAriaLabel:L,cancelButtonLabel:R,submitButtonLabel:ae,confirmButtonLabel:U,formTitle:O,emailLabel:D,emailPlaceholder:y,messageLabel:N,messagePlaceholder:B,nameLabel:M,namePlaceholder:F,successMessageText:ue,isRequiredLabel:Y,addScreenshotButtonLabel:k,removeScreenshotButtonLabel:j,highlightToolText:q,hideToolText:H,removeHighlightText:ce,errorEmptyMessageText:le,errorNoClientText:Ee,errorTimeoutText:ke,errorForbiddenText:Wt,errorGenericText:sn,onFormClose:Hr,onFormOpen:lr,onSubmitError:Gr,onSubmitSuccess:wa,onFormSubmitted:ka},jt=null,Tt=null,Mt=[],Bo=W=>{if(!jt){let de=be.createElement("div");de.id=String(W.id),be.body.appendChild(de),jt=de.attachShadow({mode:"open"}),Tt=xS(W),jt.appendChild(Tt)}return jt},Fo=async W=>{let de=W.enableScreenshot&&ON(),ee,me;try{ee=(t?t():await e("feedbackModalIntegration",h))(),ni(ee)}catch{throw cu&&g.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{let zr=de?n?n():await e("feedbackScreenshotIntegration",h):void 0;zr&&(me=zr(),ni(me))}catch{cu&&g.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}let Q={ERROR_EMPTY_MESSAGE:W.errorEmptyMessageText,ERROR_NO_CLIENT:W.errorNoClientText,ERROR_TIMEOUT:W.errorTimeoutText,ERROR_FORBIDDEN:W.errorForbiddenText,ERROR_GENERIC:W.errorGenericText},vn=(zr,lI)=>JS(zr,E(p({includeReplay:!0},lI),{errorMessages:Q})),jr=ee.createDialog({options:E(p({},W),{onFormClose:()=>{jr?.close(),W.onFormClose?.()},onFormSubmitted:()=>{jr?.close(),W.onFormSubmitted?.()}}),screenshotIntegration:me,sendFeedback:vn,shadow:Bo(W)});return jr},$r=(W,de={})=>{let ee=ou(Wn,de),me=typeof W=="string"?be.querySelector(W):typeof W.addEventListener=="function"?W:null;if(!me)throw cu&&g.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let Q=null,vn=async()=>{Q||(Q=await Fo(E(p({},ee),{onFormSubmitted:()=>{Q?.removeFromDom(),ee.onFormSubmitted?.()}}))),Q.appendToDom(),Q.open()};me.addEventListener("click",vn);let jr=()=>{Mt=Mt.filter(zr=>zr!==jr),Q?.removeFromDom(),Q=null,me.removeEventListener("click",vn)};return Mt.push(jr),jr},Wr=(W={})=>{let de=ou(Wn,W),ee=Bo(de),me=UN({triggerLabel:de.triggerLabel,triggerAriaLabel:de.triggerAriaLabel,shadow:ee,styleNonce:_});return $r(me.el,E(p({},de),{onFormOpen(){me.hide()},onFormClose(){me.show()},onFormSubmitted(){me.show()}})),me};return{name:"Feedback",setupOnce(){!st()||!Wn.autoInject||(be.readyState==="loading"?be.addEventListener("DOMContentLoaded",()=>Wr().appendToDom()):Wr().appendToDom())},attachTo:$r,createWidget(W={}){let de=Wr(ou(Wn,W));return de.appendToDom(),de},async createForm(W={}){return Fo(ou(Wn,W))},setTheme(W){if(Wn.colorScheme=W,jt){let de=xS(Wn);Tt?jt.replaceChild(de,Tt):jt.prepend(de),Tt=de}},remove(){jt&&(jt.parentElement?.remove(),jt=null,Tt=null),Mt.forEach(W=>W()),Mt=[]}}};function BN(){return I()?.getIntegrationByName("Feedback")}var _u,ve,QS,To,wS,ZS,ap,Vs={},fp=[],FN=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pp=Array.isArray;function Lr(e,t){for(var n in t)e[n]=t[n];return e}function eE(e){var t=e.parentNode;t&&t.removeChild(e)}function se(e,t,n){var r,o,i,s={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?_u.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return uu(e,s,r,o,null)}function uu(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++QS,__i:-1,__u:0};return o==null&&ve.vnode!=null&&ve.vnode(i),i}function Ks(e){return e.children}function lu(e,t){this.props=e,this.context=t}function vi(e,t){if(t==null)return e.__?vi(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?vi(e):null}function HN(e,t,n){var r,o=e.__v,i=o.__e,s=e.__P;if(s)return(r=Lr({},o)).__v=o.__v+1,ve.vnode&&ve.vnode(r),dp(s,r,o,e.__n,s.ownerSVGElement!==void 0,32&o.__u?[i]:null,t,i??vi(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&tE(r),r}function tE(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return tE(e)}}function kS(e){(!e.__d&&(e.__d=!0)&&To.push(e)&&!du.__r++||wS!==ve.debounceRendering)&&((wS=ve.debounceRendering)||ZS)(du)}function du(){var e,t,n,r=[],o=[];for(To.sort(ap);e=To.shift();)e.__d&&(n=To.length,t=HN(e,r,o)||t,n===0||To.length>n?(cp(r,t,o),o.length=r.length=0,t=void 0,To.sort(ap)):t&&ve.__c&&ve.__c(t,fp));t&&cp(r,t,o),du.__r=0}function nE(e,t,n,r,o,i,s,a,c,u,f){var l,m,d,_,h,S=r&&r.__k||fp,T=t.length;for(n.__d=c,GN(n,t,S),c=n.__d,l=0;l<T;l++)(d=n.__k[l])!=null&&typeof d!="boolean"&&typeof d!="function"&&(m=d.__i===-1?Vs:S[d.__i]||Vs,d.__i=l,dp(e,d,m,o,i,s,a,c,u,f),_=d.__e,d.ref&&m.ref!=d.ref&&(m.ref&&mp(m.ref,null,d),f.push(d.ref,d.__c||_,d)),h==null&&_!=null&&(h=_),65536&d.__u||m.__k===d.__k?c=rE(d,c,e):typeof d.type=="function"&&d.__d!==void 0?c=d.__d:_&&(c=_.nextSibling),d.__d=void 0,d.__u&=-196609);n.__d=c,n.__e=h}function GN(e,t,n){var r,o,i,s,a,c=t.length,u=n.length,f=u,l=0;for(e.__k=[],r=0;r<c;r++)(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?uu(null,o,null,null,o):pp(o)?uu(Ks,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?uu(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=$N(o,n,s=r+l,f),o.__i=a,i=null,a!==-1&&(f--,(i=n[a])&&(i.__u|=131072)),i==null||i.__v===null?(a==-1&&l--,typeof o.type!="function"&&(o.__u|=65536)):a!==s&&(a===s+1?l++:a>s?f>c-s?l+=a-s:l--:l=a<s&&a==s-1?a-s:0,a!==r+l&&(o.__u|=65536))):(i=n[r])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=vi(i)),up(i,i,!1),n[r]=null,f--);if(f)for(r=0;r<u;r++)(i=n[r])!=null&&(131072&i.__u)==0&&(i.__e==e.__d&&(e.__d=vi(i)),up(i,i))}function rE(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=rE(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function $N(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,c=t[n];if(c===null||c&&o==c.key&&i===c.type)return n;if(r>(c!=null&&(131072&c.__u)==0?1:0))for(;s>=0||a<t.length;){if(s>=0){if((c=t[s])&&(131072&c.__u)==0&&o==c.key&&i===c.type)return s;s--}if(a<t.length){if((c=t[a])&&(131072&c.__u)==0&&o==c.key&&i===c.type)return a;a++}}return-1}function OS(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||FN.test(t)?n:n+"px"}function iu(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||OS(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||OS(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?LS:MS,i)):e.removeEventListener(t,i?LS:MS,i);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function MS(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ve.event?ve.event(e):e)}}function LS(e){if(this.l)return this.l[e.type+!0](ve.event?ve.event(e):e)}function dp(e,t,n,r,o,i,s,a,c,u){var f,l,m,d,_,h,S,T,b,k,R,U,D,y,O,Y=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[a=t.__e=n.__e]),(f=ve.__b)&&f(t);e:if(typeof Y=="function")try{if(T=t.props,b=(f=Y.contextType)&&r[f.__c],k=f?b?b.props.value:f.__:r,n.__c?S=(l=t.__c=n.__c).__=l.__E:("prototype"in Y&&Y.prototype.render?t.__c=l=new Y(T,k):(t.__c=l=new lu(T,k),l.constructor=Y,l.render=jN),b&&b.sub(l),l.props=T,l.state||(l.state={}),l.context=k,l.__n=r,m=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),Y.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Lr({},l.__s)),Lr(l.__s,Y.getDerivedStateFromProps(T,l.__s))),d=l.props,_=l.state,l.__v=t,m)Y.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(Y.getDerivedStateFromProps==null&&T!==d&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(T,k),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(T,l.__s,k)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=T,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(N){N&&(N.__=t)}),R=0;R<l._sb.length;R++)l.__h.push(l._sb[R]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(T,l.__s,k),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(d,_,h)})}if(l.context=k,l.props=T,l.__P=e,l.__e=!1,U=ve.__r,D=0,"prototype"in Y&&Y.prototype.render){for(l.state=l.__s,l.__d=!1,U&&U(t),f=l.render(l.props,l.state,l.context),y=0;y<l._sb.length;y++)l.__h.push(l._sb[y]);l._sb=[]}else do l.__d=!1,U&&U(t),f=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++D<25);l.state=l.__s,l.getChildContext!=null&&(r=Lr(Lr({},r),l.getChildContext())),m||l.getSnapshotBeforeUpdate==null||(h=l.getSnapshotBeforeUpdate(d,_)),nE(e,pp(O=f!=null&&f.type===Ks&&f.key==null?f.props.children:f)?O:[O],t,n,r,o,i,s,a,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),S&&(l.__E=l.__=null)}catch(N){t.__v=null,c||i!=null?(t.__e=a,t.__u|=c?160:32,i[i.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),ve.__e(N,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=WN(n.__e,t,n,r,o,i,s,c,u);(f=ve.diffed)&&f(t)}function cp(e,t,n){for(var r=0;r<n.length;r++)mp(n[r],n[++r],n[++r]);ve.__c&&ve.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){ve.__e(i,o.__v)}})}function WN(e,t,n,r,o,i,s,a,c){var u,f,l,m,d,_,h,S=n.props,T=t.props,b=t.type;if(b==="svg"&&(o=!0),i!=null){for(u=0;u<i.length;u++)if((d=i[u])&&"setAttribute"in d==!!b&&(b?d.localName===b:d.nodeType===3)){e=d,i[u]=null;break}}if(e==null){if(b===null)return document.createTextNode(T);e=o?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,T.is&&T),i=null,a=!1}if(b===null)S===T||a&&e.data===T||(e.data=T);else{if(i=i&&_u.call(e.childNodes),S=n.props||Vs,!a&&i!=null)for(S={},u=0;u<e.attributes.length;u++)S[(d=e.attributes[u]).name]=d.value;for(u in S)d=S[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=d:u==="key"||u in T||iu(e,u,null,d,o));for(u in T)d=T[u],u=="children"?m=d:u=="dangerouslySetInnerHTML"?f=d:u=="value"?_=d:u=="checked"?h=d:u==="key"||a&&typeof d!="function"||S[u]===d||iu(e,u,d,S[u],o);if(f)a||l&&(f.__html===l.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(l&&(e.innerHTML=""),nE(e,pp(m)?m:[m],t,n,r,o&&b!=="foreignObject",i,s,i?i[0]:n.__k&&vi(n,0),a,c),i!=null)for(u=i.length;u--;)i[u]!=null&&eE(i[u]);a||(u="value",_!==void 0&&(_!==e[u]||b==="progress"&&!_||b==="option"&&_!==S[u])&&iu(e,u,_,S[u],!1),u="checked",h!==void 0&&h!==e[u]&&iu(e,u,h,S[u],!1))}return e}function mp(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){ve.__e(r,n)}}function up(e,t,n){var r,o;if(ve.unmount&&ve.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||mp(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){ve.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&up(r[o],t,n||typeof e.type!="function");n||e.__e==null||eE(e.__e),e.__=e.__e=e.__d=void 0}function jN(e,t,n){return this.constructor(e,n)}function zN(e,t,n){var r,o,i,s;ve.__&&ve.__(e,t),o=(r=!1)?null:t.__k,i=[],s=[],dp(t,e=t.__k=se(Ks,null,[e]),o||Vs,Vs,t.ownerSVGElement!==void 0,o?null:t.firstChild?_u.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,s),e.__d=void 0,cp(i,e,s)}_u=fp.slice,ve={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},QS=0,lu.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Lr({},this.state),typeof e=="function"&&(e=e(Lr({},n),this.props)),e&&Lr(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),kS(this))},lu.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),kS(this))},lu.prototype.render=Ks,To=[],ZS=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ap=function(e,t){return e.__v.__b-t.__v.__b},du.__r=0;var rr,Ae,np,PS,Ri=0,oE=[],fu=[],De=ve,US=De.__b,DS=De.__r,BS=De.diffed,FS=De.__c,HS=De.unmount,GS=De.__;function Io(e,t){De.__h&&De.__h(Ae,e,Ri||t),Ri=0;var n=Ae.__H||(Ae.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:fu}),n.__[e]}function yo(e){return Ri=1,iE(aE,e)}function iE(e,t,n){var r=Io(rr++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):aE(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=Ae,!Ae.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(m){return!!m.__c});if(f.every(function(m){return!m.__N}))return!i||i.call(this,a,c,u);var l=!1;return f.forEach(function(m){if(m.__N){var d=m.__[0];m.__=m.__N,m.__N=void 0,d!==m.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!i||i.call(this,a,c,u))};Ae.u=!0;var i=Ae.shouldComponentUpdate,s=Ae.componentWillUpdate;Ae.componentWillUpdate=function(a,c,u){if(this.__e){var f=i;i=void 0,o(a,c,u),i=f}s&&s.call(this,a,c,u)},Ae.shouldComponentUpdate=o}return r.__N||r.__}function qN(e,t){var n=Io(rr++,3);!De.__s&&_p(n.__H,t)&&(n.__=e,n.i=t,Ae.__H.__h.push(n))}function sE(e,t){var n=Io(rr++,4);!De.__s&&_p(n.__H,t)&&(n.__=e,n.i=t,Ae.__h.push(n))}function YN(e){return Ri=5,Js(function(){return{current:e}},[])}function VN(e,t,n){Ri=6,sE(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Js(e,t){var n=Io(rr++,7);return _p(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Ai(e,t){return Ri=8,Js(function(){return e},t)}function KN(e){var t=Ae.context[e.__c],n=Io(rr++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(Ae)),t.props.value):e.__}function JN(e,t){De.useDebugValue&&De.useDebugValue(t?t(e):e)}function XN(e){var t=Io(rr++,10),n=yo();return t.__=e,Ae.componentDidCatch||(Ae.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function QN(){var e=Io(rr++,11);if(!e.__){for(var t=Ae.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function ZN(){for(var e;e=oE.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(pu),e.__H.__h.forEach(lp),e.__H.__h=[]}catch(t){e.__H.__h=[],De.__e(t,e.__v)}}De.__b=function(e){Ae=null,US&&US(e)},De.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),GS&&GS(e,t)},De.__r=function(e){DS&&DS(e),rr=0;var t=(Ae=e.__c).__H;t&&(np===Ae?(t.__h=[],Ae.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=fu,n.__N=n.i=void 0})):(t.__h.forEach(pu),t.__h.forEach(lp),t.__h=[],rr=0)),np=Ae},De.diffed=function(e){BS&&BS(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(oE.push(t)!==1&&PS===De.requestAnimationFrame||((PS=De.requestAnimationFrame)||eC)(ZN)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==fu&&(n.__=n.__V),n.i=void 0,n.__V=fu})),np=Ae=null},De.__c=function(e,t){t.some(function(n){try{n.__h.forEach(pu),n.__h=n.__h.filter(function(r){return!r.__||lp(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],De.__e(r,n.__v)}}),FS&&FS(e,t)},De.unmount=function(e){HS&&HS(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{pu(r)}catch(o){t=o}}),n.__H=void 0,t&&De.__e(t,n.__v))};var $S=typeof requestAnimationFrame=="function";function eC(e){var t,n=function(){clearTimeout(r),$S&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);$S&&(t=requestAnimationFrame(n))}function pu(e){var t=Ae,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Ae=t}function lp(e){var t=Ae;e.__c=e.__(),Ae=t}function _p(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function aE(e,t){return typeof t=="function"?t(e):t}var tC=Object.defineProperty({__proto__:null,useCallback:Ai,useContext:KN,useDebugValue:JN,useEffect:qN,useErrorBoundary:XN,useId:QN,useImperativeHandle:VN,useLayoutEffect:sE,useMemo:Js,useReducer:iE,useRef:YN,useState:yo},Symbol.toStringTag,{value:"Module"}),nC="http://www.w3.org/2000/svg";function rC(){let e=r=>be.createElementNS(nC,r),t=Gt(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Gt(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return t.appendChild(n),t}function oC({options:e}){let t=Js(()=>({__html:rC().outerHTML}),[]);return se("h2",{class:"dialog__header"},se("span",{class:"dialog__title"},e.formTitle),e.showBranding?se("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function iC(e,t){let n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}function rp(e,t){let n=e.get(t);return typeof n=="string"?n.trim():""}function sC({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:i,onSubmitError:s,showEmail:a,showName:c,screenshotInput:u}){let{tags:f,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:m,cancelButtonLabel:d,emailLabel:_,emailPlaceholder:h,isEmailRequired:S,isNameRequired:T,messageLabel:b,messagePlaceholder:k,nameLabel:R,namePlaceholder:U,submitButtonLabel:D,isRequiredLabel:y}=e,[O,Y]=yo(!1),[N,B]=yo(null),[M,F]=yo(!1),j=u?.input,[ae,ue]=yo(null),z=Ai(H=>{ue(H),F(!1)},[]),L=Ai(H=>{let ce=iC(H,{emailLabel:_,isEmailRequired:S,isNameRequired:T,messageLabel:b,nameLabel:R});return ce.length>0?B(`Please enter in the following required fields: ${ce.join(", ")}`):B(null),ce.length===0},[_,S,T,b,R]),q=Ai(async H=>{Y(!0);try{if(H.preventDefault(),!(H.target instanceof HTMLFormElement))return;let ce=new FormData(H.target),le=await(u&&M?u.value():void 0),Ee={name:rp(ce,"name"),email:rp(ce,"email"),message:rp(ce,"message"),attachments:le?[le]:void 0};if(!L(Ee))return;try{let ke=await o({name:Ee.name,email:Ee.email,message:Ee.message,source:CN,tags:f},{attachments:Ee.attachments});i(Ee,ke)}catch(ke){cu&&g.error(ke);let Wt=ke instanceof Error?ke:new Error(String(ke));B(Wt.message),s(Wt)}}finally{Y(!1)}},[u&&M,i,s]);return se("form",{class:"form",onSubmit:q},j&&M?se(j,{onError:z}):null,se("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:O},se("div",{class:"form__top"},N?se("div",{class:"form__error-container"},N):null,c?se("label",{for:"name",class:"form__label"},se(op,{label:R,isRequiredLabel:y,isRequired:T}),se("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:U,required:T,type:"text"})):se("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?se("label",{for:"email",class:"form__label"},se(op,{label:_,isRequiredLabel:y,isRequired:S}),se("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:h,required:S,type:"email"})):se("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),se("label",{for:"message",class:"form__label"},se(op,{label:b,isRequiredLabel:y,isRequired:!0}),se("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:k,required:!0,rows:5})),j?se("label",{for:"screenshot",class:"form__label"},se("button",{class:"btn btn--default",disabled:O,type:"button",onClick:()=>{ue(null),F(H=>!H)}},M?m:l),ae?se("div",{class:"form__error-container"},ae.message):null):null),se("div",{class:"btn-group"},se("button",{class:"btn btn--primary",disabled:O,type:"submit"},D),se("button",{class:"btn btn--default",disabled:O,type:"button",onClick:r},d))))}function op({label:e,isRequired:t,isRequiredLabel:n}){return se("span",{class:"form__label__text"},e,t&&se("span",{class:"form__label__text--required"},n))}var su=16,WS=17,aC="http://www.w3.org/2000/svg";function cC(){let e=c=>yn.document.createElementNS(aC,c),t=Gt(e("svg"),{width:`${su}`,height:`${WS}`,viewBox:`0 0 ${su} ${WS}`,fill:"inherit"}),n=Gt(e("g"),{clipPath:"url(#clip0_57_156)"}),r=Gt(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),o=Gt(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(o,r);let i=e("defs"),s=Gt(e("clipPath"),{id:"clip0_57_156"}),a=Gt(e("rect"),{width:`${su}`,height:`${su}`,fill:"white",transform:"translate(0 0.5)"});return s.appendChild(a),i.appendChild(s),t.appendChild(i).appendChild(s).appendChild(a),t}function uC(r){var o=r,{open:e,onFormSubmitted:t}=o,n=zt(o,["open","onFormSubmitted"]);let i=n.options,s=Js(()=>({__html:cC().outerHTML}),[]),[a,c]=yo(null),u=Ai(()=>{a&&(clearTimeout(a),c(null)),t()},[a]),f=Ai((l,m)=>{n.onSubmitSuccess(l,m),c(setTimeout(()=>{t(),c(null)},wN))},[t]);return se(Ks,null,a?se("div",{class:"success__position",onClick:u},se("div",{class:"success__content"},i.successMessageText,se("span",{class:"success__icon",dangerouslySetInnerHTML:s}))):se("dialog",{class:"dialog",onClick:i.onFormClose,open:e},se("div",{class:"dialog__position"},se("div",{class:"dialog__content",onClick:l=>{l.stopPropagation()}},se(oC,{options:i}),se(sC,E(p({},n),{onSubmitSuccess:f}))))))}var lC=`
|
|
107
|
+
.dialog {
|
|
108
|
+
position: fixed;
|
|
109
|
+
z-index: var(--z-index);
|
|
110
|
+
margin: 0;
|
|
111
|
+
inset: 0;
|
|
112
|
+
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
padding: 0;
|
|
117
|
+
height: 100vh;
|
|
118
|
+
width: 100vw;
|
|
119
|
+
|
|
120
|
+
color: var(--dialog-color, var(--foreground));
|
|
121
|
+
fill: var(--dialog-color, var(--foreground));
|
|
122
|
+
line-height: 1.75em;
|
|
123
|
+
|
|
124
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
125
|
+
border: none;
|
|
126
|
+
inset: 0;
|
|
127
|
+
opacity: 1;
|
|
128
|
+
transition: opacity 0.2s ease-in-out;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.dialog__position {
|
|
132
|
+
position: fixed;
|
|
133
|
+
z-index: var(--z-index);
|
|
134
|
+
inset: var(--dialog-inset);
|
|
135
|
+
padding: var(--page-margin);
|
|
136
|
+
display: flex;
|
|
137
|
+
max-height: calc(100vh - (2 * var(--page-margin)));
|
|
138
|
+
}
|
|
139
|
+
@media (max-width: 600px) {
|
|
140
|
+
.dialog__position {
|
|
141
|
+
inset: var(--page-margin);
|
|
142
|
+
padding: 0;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.dialog__position:has(.editor) {
|
|
147
|
+
inset: var(--page-margin);
|
|
148
|
+
padding: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.dialog:not([open]) {
|
|
152
|
+
opacity: 0;
|
|
153
|
+
pointer-events: none;
|
|
154
|
+
visibility: hidden;
|
|
155
|
+
}
|
|
156
|
+
.dialog:not([open]) .dialog__content {
|
|
157
|
+
transform: translate(0, -16px) scale(0.98);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.dialog__content {
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
gap: 16px;
|
|
164
|
+
padding: var(--dialog-padding, 24px);
|
|
165
|
+
max-width: 100%;
|
|
166
|
+
width: 100%;
|
|
167
|
+
max-height: 100%;
|
|
168
|
+
overflow: auto;
|
|
169
|
+
|
|
170
|
+
background: var(--dialog-background, var(--background));
|
|
171
|
+
border-radius: var(--dialog-border-radius, 20px);
|
|
172
|
+
border: var(--dialog-border, var(--border));
|
|
173
|
+
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
|
|
174
|
+
transform: translate(0, 0) scale(1);
|
|
175
|
+
transition: transform 0.2s ease-in-out;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
`,fC=`
|
|
179
|
+
.dialog__header {
|
|
180
|
+
display: flex;
|
|
181
|
+
gap: 4px;
|
|
182
|
+
justify-content: space-between;
|
|
183
|
+
font-weight: var(--dialog-header-weight, 600);
|
|
184
|
+
margin: 0;
|
|
185
|
+
}
|
|
186
|
+
.dialog__title {
|
|
187
|
+
align-self: center;
|
|
188
|
+
width: var(--form-width, 272px);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@media (max-width: 600px) {
|
|
192
|
+
.dialog__title {
|
|
193
|
+
width: auto;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.dialog__position:has(.editor) .dialog__title {
|
|
198
|
+
width: auto;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
.brand-link {
|
|
203
|
+
display: inline-flex;
|
|
204
|
+
}
|
|
205
|
+
.brand-link:focus-visible {
|
|
206
|
+
outline: var(--outline);
|
|
207
|
+
}
|
|
208
|
+
`,pC=`
|
|
209
|
+
.form {
|
|
210
|
+
display: flex;
|
|
211
|
+
overflow: auto;
|
|
212
|
+
flex-direction: row;
|
|
213
|
+
gap: 16px;
|
|
214
|
+
flex: 1 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.form fieldset {
|
|
218
|
+
border: none;
|
|
219
|
+
margin: 0;
|
|
220
|
+
padding: 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.form__right {
|
|
224
|
+
flex: 0 0 auto;
|
|
225
|
+
display: flex;
|
|
226
|
+
overflow: auto;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
justify-content: space-between;
|
|
229
|
+
gap: 20px;
|
|
230
|
+
width: var(--form-width, 100%);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.dialog__position:has(.editor) .form__right {
|
|
234
|
+
width: var(--form-width, 272px);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.form__top {
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
gap: 8px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.form__error-container {
|
|
244
|
+
color: var(--error-color);
|
|
245
|
+
fill: var(--error-color);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.form__label {
|
|
249
|
+
display: flex;
|
|
250
|
+
flex-direction: column;
|
|
251
|
+
gap: 4px;
|
|
252
|
+
margin: 0px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.form__label__text {
|
|
256
|
+
display: flex;
|
|
257
|
+
gap: 4px;
|
|
258
|
+
align-items: center;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.form__label__text--required {
|
|
262
|
+
font-size: 0.85em;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.form__input {
|
|
266
|
+
font-family: inherit;
|
|
267
|
+
line-height: inherit;
|
|
268
|
+
background: transparent;
|
|
269
|
+
box-sizing: border-box;
|
|
270
|
+
border: var(--input-border, var(--border));
|
|
271
|
+
border-radius: var(--input-border-radius, 6px);
|
|
272
|
+
color: var(--input-color, inherit);
|
|
273
|
+
fill: var(--input-color, inherit);
|
|
274
|
+
font-size: var(--input-font-size, inherit);
|
|
275
|
+
font-weight: var(--input-font-weight, 500);
|
|
276
|
+
padding: 6px 12px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.form__input::placeholder {
|
|
280
|
+
opacity: 0.65;
|
|
281
|
+
color: var(--input-placeholder-color, inherit);
|
|
282
|
+
filter: var(--interactive-filter);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.form__input:focus-visible {
|
|
286
|
+
outline: var(--input-focus-outline, var(--outline));
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.form__input--textarea {
|
|
290
|
+
font-family: inherit;
|
|
291
|
+
resize: vertical;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.error {
|
|
295
|
+
color: var(--error-color);
|
|
296
|
+
fill: var(--error-color);
|
|
297
|
+
}
|
|
298
|
+
`,dC=`
|
|
299
|
+
.btn-group {
|
|
300
|
+
display: grid;
|
|
301
|
+
gap: 8px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.btn {
|
|
305
|
+
line-height: inherit;
|
|
306
|
+
border: var(--button-border, var(--border));
|
|
307
|
+
border-radius: var(--button-border-radius, 6px);
|
|
308
|
+
cursor: pointer;
|
|
309
|
+
font-family: inherit;
|
|
310
|
+
font-size: var(--button-font-size, inherit);
|
|
311
|
+
font-weight: var(--button-font-weight, 600);
|
|
312
|
+
padding: var(--button-padding, 6px 16px);
|
|
313
|
+
}
|
|
314
|
+
.btn[disabled] {
|
|
315
|
+
opacity: 0.6;
|
|
316
|
+
pointer-events: none;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.btn--primary {
|
|
320
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
321
|
+
fill: var(--button-primary-color, var(--accent-foreground));
|
|
322
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
323
|
+
border: var(--button-primary-border, var(--border));
|
|
324
|
+
border-radius: var(--button-primary-border-radius, 6px);
|
|
325
|
+
font-weight: var(--button-primary-font-weight, 500);
|
|
326
|
+
}
|
|
327
|
+
.btn--primary:hover {
|
|
328
|
+
color: var(--button-primary-hover-color, var(--accent-foreground));
|
|
329
|
+
fill: var(--button-primary-hover-color, var(--accent-foreground));
|
|
330
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
331
|
+
filter: var(--interactive-filter);
|
|
332
|
+
}
|
|
333
|
+
.btn--primary:focus-visible {
|
|
334
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
335
|
+
filter: var(--interactive-filter);
|
|
336
|
+
outline: var(--button-primary-focus-outline, var(--outline));
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.btn--default {
|
|
340
|
+
color: var(--button-color, var(--foreground));
|
|
341
|
+
fill: var(--button-color, var(--foreground));
|
|
342
|
+
background: var(--button-background, var(--background));
|
|
343
|
+
border: var(--button-border, var(--border));
|
|
344
|
+
border-radius: var(--button-border-radius, 6px);
|
|
345
|
+
font-weight: var(--button-font-weight, 500);
|
|
346
|
+
}
|
|
347
|
+
.btn--default:hover {
|
|
348
|
+
color: var(--button-color, var(--foreground));
|
|
349
|
+
fill: var(--button-color, var(--foreground));
|
|
350
|
+
background: var(--button-hover-background, var(--background));
|
|
351
|
+
filter: var(--interactive-filter);
|
|
352
|
+
}
|
|
353
|
+
.btn--default:focus-visible {
|
|
354
|
+
background: var(--button-hover-background, var(--background));
|
|
355
|
+
filter: var(--interactive-filter);
|
|
356
|
+
outline: var(--button-focus-outline, var(--outline));
|
|
357
|
+
}
|
|
358
|
+
`,mC=`
|
|
359
|
+
.success__position {
|
|
360
|
+
position: fixed;
|
|
361
|
+
inset: var(--dialog-inset);
|
|
362
|
+
padding: var(--page-margin);
|
|
363
|
+
z-index: var(--z-index);
|
|
364
|
+
}
|
|
365
|
+
.success__content {
|
|
366
|
+
background: var(--success-background, var(--background));
|
|
367
|
+
border: var(--success-border, var(--border));
|
|
368
|
+
border-radius: var(--success-border-radius, 1.7em/50%);
|
|
369
|
+
box-shadow: var(--success-box-shadow, var(--box-shadow));
|
|
370
|
+
font-weight: var(--success-font-weight, 600);
|
|
371
|
+
color: var(--success-color);
|
|
372
|
+
fill: var(--success-color);
|
|
373
|
+
padding: 12px 24px;
|
|
374
|
+
line-height: 1.75em;
|
|
375
|
+
|
|
376
|
+
display: grid;
|
|
377
|
+
align-items: center;
|
|
378
|
+
grid-auto-flow: column;
|
|
379
|
+
gap: 6px;
|
|
380
|
+
cursor: default;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.success__icon {
|
|
384
|
+
display: flex;
|
|
385
|
+
}
|
|
386
|
+
`;function _C(e){let t=be.createElement("style");return t.textContent=`
|
|
387
|
+
:host {
|
|
388
|
+
--dialog-inset: var(--inset);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
${lC}
|
|
392
|
+
${fC}
|
|
393
|
+
${pC}
|
|
394
|
+
${dC}
|
|
395
|
+
${mC}
|
|
396
|
+
`,e&&t.setAttribute("nonce",e),t}function gC(){let e=w().getUser(),t=re().getUser(),n=pn().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}var cE=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{let o=r,i=e.useSentryUser,s=gC(),a=be.createElement("div"),c=_C(e.styleNonce),u="",f={get el(){return a},appendToDom(){!o.contains(c)&&!o.contains(a)&&(o.appendChild(c),o.appendChild(a))},removeFromDom(){a.remove(),c.remove(),be.body.style.overflow=u},open(){m(!0),e.onFormOpen?.(),I()?.emit("openFeedbackWidget"),u=be.body.style.overflow,be.body.style.overflow="hidden"},close(){m(!1),be.body.style.overflow=u}},l=t?.createInput({h:se,hooks:tC,dialog:f,options:e}),m=d=>{zN(se(uC,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(i&&s?.[i.name]||""),defaultEmail:String(i&&s?.[i.email]||""),onFormClose:()=>{m(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(_,h)=>{m(!1),e.onSubmitSuccess?.(_,h)},onSubmitError:_=>{e.onSubmitError?.(_)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:d}),a)};return f}});function hC({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),e("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),e("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}function SC(e){let t=be.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`
|
|
397
|
+
.editor {
|
|
398
|
+
display: flex;
|
|
399
|
+
flex-grow: 1;
|
|
400
|
+
flex-direction: column;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.editor__image-container {
|
|
404
|
+
justify-items: center;
|
|
405
|
+
padding: 15px;
|
|
406
|
+
position: relative;
|
|
407
|
+
height: 100%;
|
|
408
|
+
border-radius: var(--menu-border-radius, 6px);
|
|
409
|
+
|
|
410
|
+
background-color: ${n};
|
|
411
|
+
background-image: repeating-linear-gradient(
|
|
412
|
+
-145deg,
|
|
413
|
+
transparent,
|
|
414
|
+
transparent 8px,
|
|
415
|
+
${n} 8px,
|
|
416
|
+
${n} 11px
|
|
417
|
+
),
|
|
418
|
+
repeating-linear-gradient(
|
|
419
|
+
-45deg,
|
|
420
|
+
transparent,
|
|
421
|
+
transparent 15px,
|
|
422
|
+
${r} 15px,
|
|
423
|
+
${r} 16px
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.editor__canvas-container {
|
|
428
|
+
width: 100%;
|
|
429
|
+
height: 100%;
|
|
430
|
+
position: relative;
|
|
431
|
+
display: flex;
|
|
432
|
+
align-items: center;
|
|
433
|
+
justify-content: center;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.editor__canvas-container > * {
|
|
437
|
+
object-fit: contain;
|
|
438
|
+
position: absolute;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.editor__tool-container {
|
|
442
|
+
padding-top: 8px;
|
|
443
|
+
display: flex;
|
|
444
|
+
justify-content: center;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.editor__tool-bar {
|
|
448
|
+
display: flex;
|
|
449
|
+
gap: 8px;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.editor__tool {
|
|
453
|
+
display: flex;
|
|
454
|
+
padding: 8px 12px;
|
|
455
|
+
justify-content: center;
|
|
456
|
+
align-items: center;
|
|
457
|
+
border: var(--button-border, var(--border));
|
|
458
|
+
border-radius: var(--button-border-radius, 6px);
|
|
459
|
+
background: var(--button-background, var(--background));
|
|
460
|
+
color: var(--button-color, var(--foreground));
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.editor__tool--active {
|
|
464
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
465
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.editor__rect {
|
|
469
|
+
position: absolute;
|
|
470
|
+
z-index: 2;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.editor__rect button {
|
|
474
|
+
opacity: 0;
|
|
475
|
+
position: absolute;
|
|
476
|
+
top: -12px;
|
|
477
|
+
right: -12px;
|
|
478
|
+
cursor: pointer;
|
|
479
|
+
padding: 0;
|
|
480
|
+
z-index: 3;
|
|
481
|
+
border: none;
|
|
482
|
+
background: none;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.editor__rect:hover button {
|
|
486
|
+
opacity: 1;
|
|
487
|
+
}
|
|
488
|
+
`,e&&t.setAttribute("nonce",e),t}function EC({h:e}){return function({action:n,setAction:r,options:o}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},o.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},o.hideToolText)))}}function TC({hooks:e}){function t(){let[n,r]=e.useState(yn.devicePixelRatio??1);return e.useEffect(()=>{let o=()=>{r(yn.devicePixelRatio)},i=matchMedia(`(resolution: ${yn.devicePixelRatio}dppx)`);return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:i,onError:s}){let a=t();e.useEffect(()=>{(async()=>{r();let u=await Ys.mediaDevices.getDisplayMedia({video:{width:yn.innerWidth*a,height:yn.innerHeight*a},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),f=be.createElement("video");await new Promise((l,m)=>{f.srcObject=u,f.onloadedmetadata=()=>{o(f,a),u.getTracks().forEach(d=>d.stop()),l()},f.play().catch(m)}),i()})().catch(s)},[])}}function yC(e,t,n){switch(e.type){case"highlight":{t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break}case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h);break}}function Mr(e,t,n){if(!e)return;let r=e.getContext("2d",t);r&&n(e,r)}function ip(e,t){Mr(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function sp(e,t,n){Mr(e,{alpha:!0},(r,o)=>{n.length&&(o.fillStyle="rgba(0, 0, 0, 0.25)",o.fillRect(0,0,r.width,r.height)),n.forEach(i=>{yC(i,o,t)})})}function IC({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){let i=TC({hooks:t}),s=EC({h:e}),a=hC({h:e}),c={__html:SC(o.styleNonce).innerText},u=r.el.style,f=({screenshot:l})=>{let[m,d]=t.useState("highlight"),[_,h]=t.useState([]),S=t.useRef(null),T=t.useRef(null),b=t.useRef(null),k=t.useRef(null),[R,U]=t.useState(1),D=t.useMemo(()=>{let M=be.getElementById(o.id);if(!M)return"white";let F=getComputedStyle(M);return F.getPropertyValue("--button-primary-background")||F.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{let M=()=>{let F=S.current;F&&(Mr(l.canvas,{alpha:!1},j=>{let ae=Math.min(F.clientWidth/j.width,F.clientHeight/j.height);U(ae)}),(F.clientHeight===0||F.clientWidth===0)&&setTimeout(M,0))};return M(),yn.addEventListener("resize",M),()=>{yn.removeEventListener("resize",M)}},[l]);let y=t.useCallback((M,F)=>{Mr(M,{alpha:!0},(j,ae)=>{ae.scale(F,F),j.width=l.canvas.width,j.height=l.canvas.height})},[l]);t.useEffect(()=>{y(T.current,l.dpi),ip(T.current,l.canvas)},[l]),t.useEffect(()=>{y(b.current,l.dpi),Mr(b.current,{alpha:!0},(M,F)=>{F.clearRect(0,0,M.width,M.height)}),sp(b.current,D,_)},[_,D]),t.useEffect(()=>{y(n,l.dpi),ip(n,l.canvas),Mr(be.createElement("canvas"),{alpha:!0},(M,F)=>{F.scale(l.dpi,l.dpi),M.width=l.canvas.width,M.height=l.canvas.height,sp(M,D,_),ip(n,M)})},[_,l,D]);let O=M=>{if(!m||!k.current)return;let F=k.current.getBoundingClientRect(),j={type:m,x:M.offsetX/R,y:M.offsetY/R},ae=(L,q)=>{let H=(q.clientX-F.x)/R,ce=(q.clientY-F.y)/R;return{type:L.type,x:Math.min(L.x,H),y:Math.min(L.y,ce),w:Math.abs(H-L.x),h:Math.abs(ce-L.y)}},ue=L=>{Mr(b.current,{alpha:!0},(q,H)=>{H.clearRect(0,0,q.width,q.height)}),sp(b.current,D,[..._,ae(j,L)])},z=L=>{let q=ae(j,L);q.w*R>=1&&q.h*R>=1&&h(H=>[...H,q]),be.removeEventListener("mousemove",ue),be.removeEventListener("mouseup",z)};be.addEventListener("mousemove",ue),be.addEventListener("mouseup",z)},Y=t.useCallback(M=>F=>{F.preventDefault(),F.stopPropagation(),h(j=>{let ae=[...j];return ae.splice(M,1),ae})},[]),N={width:`${l.canvas.width*R}px`,height:`${l.canvas.height*R}px`},B=M=>{M.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:c}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:S},e("canvas",{ref:T,id:"background",style:N}),e("canvas",{ref:b,id:"foreground",style:N}),e("div",{ref:k,onMouseDown:O,style:N},_.map((M,F)=>e("div",{key:F,class:"editor__rect",style:{top:`${M.y*R}px`,left:`${M.x*R}px`,width:`${M.w*R}px`,height:`${M.h*R}px`}},e("button",{"aria-label":o.removeHighlightText,onClick:Y(F),onMouseDown:B,onMouseUp:B,type:"button"},e(a,null))))))),e(s,{options:o,action:m,setAction:d}))};return function({onError:m}){let[d,_]=t.useState();return i({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((h,S)=>{Mr(be.createElement("canvas"),{alpha:!1},(T,b)=>{b.scale(S,S),T.width=h.videoWidth,T.height=h.videoHeight,b.drawImage(h,0,0,T.width,T.height),_({canvas:T,dpi:S})}),n.width=h.videoWidth,n.height=h.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(h=>{u.display="block",m(h)},[])}),d?e(f,{screenshot:d}):e("div",null)}}var uE=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{let o=be.createElement("canvas");return{input:IC({h:e,hooks:t,outputBuffer:o,dialog:n,options:r}),value:async()=>{let i=await new Promise(s=>{o.toBlob(s,"image/png")});if(i)return{data:new Uint8Array(await i.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}});var x=C,gp=0;function hp(){return gp>0}function bC(){gp++,setTimeout(()=>{gp--})}function bo(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){let i=e.__sentry_wrapped__;return typeof i=="function"?i:e}if(mr(e))return e}catch{return e}let r=function(...o){C._sentryWrappedDepth=(C._sentryWrappedDepth||0)+1;try{let i=o.map(s=>bo(s,t));return e.apply(this,i)}catch(i){throw bC(),$e(s=>{s.addEventProcessor(a=>(t.mechanism&&(Kr(a,void 0,void 0),Je(a,t.mechanism)),a.extra=E(p({},a.extra),{arguments:o}),a)),J(i)}),i}finally{C._sentryWrappedDepth=(C._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}os(r,e),_e(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Ni(){let e=ut(),{referrer:t}=x.document||{},{userAgent:n}=x.navigator||{},r=p(p({},t&&{Referer:t}),n&&{"User-Agent":n});return{url:e,headers:r}}var AC=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],vC={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function RC(e){return vC[e]||e.replace("Integration","").toLowerCase()}var lE=x;async function Sp(e,t){let n=AC.includes(e)?RC(e):void 0,r=lE.Sentry=lE.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);let o=r[e];if(typeof o=="function"&&!("_isShim"in o))return o;let i=NC(n),s=x.document.createElement("script");s.src=i,s.crossOrigin="anonymous",s.referrerPolicy="strict-origin",t&&s.setAttribute("nonce",t);let a=new Promise((l,m)=>{s.addEventListener("load",()=>l()),s.addEventListener("error",m)}),c=x.document.currentScript,u=x.document.body||x.document.head||c?.parentElement;if(u)u.appendChild(s);else throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await a}catch{throw new Error(`Error when loading integration: ${e}`)}let f=r[e];if(typeof f!="function")throw new Error(`Could not load integration: ${e}`);return f}function NC(e){let n=I()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${Lt}/${e}.min.js`,n).toString()}var CC=mu({lazyLoadIntegration:Sp});var fE=mu({getModalIntegration:()=>cE,getScreenshotIntegration:()=>uE});function Xs(e,t){let n=gu(e,t),r={type:MC(t),value:LC(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function xC(e,t,n,r){let i=I()?.getOptions().normalizeDepth,s=DC(t),a={__serialized__:ss(t,i)};if(s)return{exception:{values:[Xs(e,s)]},extra:a};let c={exception:{values:[{type:dr(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:PC(t,{isUnhandledRejection:r})}]},extra:a};if(n){let u=gu(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function Ep(e,t){return{exception:{values:[Xs(e,t)]}}}function gu(e,t){let n=t.stacktrace||t.stack||"",r=kC(t),o=OC(t);try{return e(n,r,o)}catch{}return[]}var wC=/Minified React error #\d+;/i;function kC(e){return e&&wC.test(e.message)?1:0}function OC(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function pE(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function MC(e){let t=e?.name;return!t&&pE(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function LC(e){let t=e?.message;return pE(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Lc(t.error):Lc(e):"No error message"}function yp(e,t,n,r){let o=n?.syntheticException||void 0,i=Ci(e,t,o,r);return Je(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),wn(i)}function Ip(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=Tp(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),wn(s)}function Ci(e,t,n,r,o){let i;if(Go(t)&&t.error)return Ep(e,t.error);if(ns(t)||Ua(t)){let s=t;if("stack"in t){i=Ep(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let c=gu(e,n);c.length&&(a.stacktrace={frames:c},Je(i,{synthetic:!0}))}}else{let a=s.name||(ns(s)?"DOMError":"DOMException"),c=s.message?`${a}: ${s.message}`:a;i=Tp(e,c,n,r),Kr(i,c)}return"code"in s&&(i.tags=E(p({},i.tags),{"DOMException.code":`${s.code}`})),i}return Ze(t)?Ep(e,t):xe(t)||dr(t)?(i=xC(e,t,n,o),Je(i,{synthetic:!0}),i):(i=Tp(e,t,n,r),Kr(i,`${t}`,void 0),Je(i,{synthetic:!0}),i)}function Tp(e,t,n,r){let o={};if(r&&n){let i=gu(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Je(o,{synthetic:!0})}if(Rn(t)){let{__sentry_template_string__:i,__sentry_template_values__:s}=t;return o.logentry={message:i,params:s},o}return o.message=t,o}function PC(e,{isUnhandledRejection:t}){let n=Ba(e),r=t?"promise rejection":"exception";return Go(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:dr(e)?`Event \`${UC(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function UC(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function DC(e){return Object.values(e).find(t=>t instanceof Error)}var Qs=class extends Us{constructor(t){let n=BC(t),r=x.SENTRY_SDK_SOURCE||yf();ai(n,"browser",["browser"],r),super(n);let{userInfo:o}=this.getDataCollectionOptions();n._metadata?.sdk&&(n._metadata.sdk.settings=p({infer_ip:o?"auto":"never"},n._metadata.sdk.settings));let{sendClientReports:i,enableLogs:s,_experiments:a,enableMetrics:c}=this._options,u=c??a?.enableMetrics??!0;x.document&&(i||s||u)&&x.document.addEventListener("visibilitychange",()=>{x.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&so(this),u&&ri(this))}),o&&this.on("beforeSendSession",Bf)}eventFromException(t,n){return yp(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Ip(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}};function BC(e){return p({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:x.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},e)}var Qe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var $=C;var FC=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Fn=(e,t,n,r)=>{let o,i;return s=>{t.value>=0&&(s||r)&&(i=t.value-(o??0),(i||o===void 0)&&(o=t.value,t.delta=i,t.rating=FC(t.value,n),e(t)))}};var or=(e=!0)=>{let t=$.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var en=()=>or()?.activationStart??0;function tn(e,t,n){$.document&&$.addEventListener(e,t,n)}function Ao(e,t,n){$.document&&$.removeEventListener(e,t,n)}var xi=-1,dE=new Set,HC=()=>$.document?.visibilityState==="hidden"&&!$.document?.prerendering?0:1/0,hu=e=>{if(GC(e)&&xi>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of dE)t();isFinite(xi)||(xi=e.type==="visibilitychange"?e.timeStamp:0,Ao("prerenderingchange",hu,!0))}},Hn=()=>{if($.document&&xi<0){let e=en();xi=($.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??HC(),tn("visibilitychange",hu,!0),tn("pagehide",hu,!0),tn("prerenderingchange",hu,!0)}return{get firstHiddenTime(){return xi},onHidden(e){dE.add(e)}}};function GC(e){return e.type==="pagehide"||$.document?.visibilityState==="hidden"}var mE=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var Gn=(e,t=-1)=>{let n=or(),r="navigate";return n&&($.document?.prerendering||en()>0?r="prerender":$.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:mE(),navigationType:r}};var bp=new WeakMap;function wi(e,t){try{return bp.get(e)||bp.set(e,new t),bp.get(e)}catch{return new t}}var Su=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;let n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}};var nn=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe(p({type:e,buffered:!0},n)),r}}catch{}};var ki=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var Pr=e=>{$.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var $C=[1800,3e3],_E=(e,t={})=>{Pr(()=>{let n=Hn(),r=Gn("FCP"),o,s=nn("paint",a=>{for(let c of a)c.name==="first-contentful-paint"&&(s.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-en(),0),r.entries.push(c),o(!0)))});s&&(o=Fn(e,r,$C,t.reportAllChanges))})};var WC=[.1,.25],gE=(e,t={})=>{_E(ki(()=>{let n=Gn("CLS",0),r,o=Hn(),i=wi(t,Su),s=c=>{for(let u of c)i._processEntry(u);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=nn("layout-shift",s);a&&(r=Fn(e,n,WC,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),$?.setTimeout?.(r))}))};var hE=0,Ap=1/0,Eu=0,jC=e=>{e.forEach(t=>{t.interactionId&&(Ap=Math.min(Ap,t.interactionId),Eu=Math.max(Eu,t.interactionId),hE=Eu?(Eu-Ap)/7+1:0)})},vp,Rp=()=>vp?hE:performance.interactionCount||0,SE=()=>{"interactionCount"in performance||vp||(vp=nn("event",jC,{type:"event",buffered:!0,durationThreshold:0}))};var Np=10,EE=0,zC=()=>Rp()-EE,Tu=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){EE=Rp(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(zC()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;let n=this._longestInteractionList.at(-1),r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<Np||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,i)=>i._latency-o._latency),this._longestInteractionList.length>Np){let o=this._longestInteractionList.splice(Np);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var yu=e=>{let t=$.requestIdleCallback||$.setTimeout;$.document?.visibilityState==="hidden"?e():(e=ki(e),tn("visibilitychange",e,{once:!0,capture:!0}),tn("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Ao("visibilitychange",e,{capture:!0}),Ao("pagehide",e,{capture:!0})}))};var qC=[200,500],YC=40,TE=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=Hn();Pr(()=>{SE();let r=Gn("INP"),o,i=wi(t,Tu),s=c=>{yu(()=>{for(let f of c)i._processEntry(f);let u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=nn("event",s,{durationThreshold:t.durationThreshold??YC});o=Fn(e,r,qC,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var Iu=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var VC=[2500,4e3],yE=(e,t={})=>{Pr(()=>{let n=Hn(),r=Gn("LCP"),o,i=wi(t,Iu),s=c=>{t.reportAllChanges||(c=c.slice(-1));for(let u of c)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-en(),0),r.entries=[u],o())},a=nn("largest-contentful-paint",s);if(a){o=Fn(e,r,VC,t.reportAllChanges);let c=ki(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),u=f=>{f.isTrusted&&(yu(c),Ao(f.type,u,{capture:!0}))};for(let f of["keydown","click","visibilitychange"])tn(f,u,{capture:!0})}})};var KC=[800,1800],Cp=e=>{$.document?.prerendering?Pr(()=>Cp(e)):$.document?.readyState!=="complete"?addEventListener("load",()=>Cp(e),!0):setTimeout(e)},IE=(e,t={})=>{let n=Gn("TTFB"),r=Fn(e,n,KC,t.reportAllChanges);Cp(()=>{let o=or();o&&(n.value=Math.max(o.responseStart-en(),0),n.entries=[o],r(!0))})};var Zs={},bu={},bE,AE,vE,RE;function ir(e,t=!1){return Au("cls",e,JC,bE,t)}function sr(e,t=!1){return Au("lcp",e,XC,AE,t)}function xp(e){return Au("ttfb",e,QC,vE)}function vo(e){return Au("inp",e,ZC,RE)}function wt(e,t){return NE(e,t),bu[e]||(ex(e),bu[e]=!0),CE(e,t)}function ea(e,t){let n=Zs[e];if(n?.length)for(let r of n)try{r(t)}catch(o){Qe&&g.error(`Error while triggering instrumentation handler.
|
|
489
|
+
Type: ${e}
|
|
490
|
+
Name: ${ft(r)}
|
|
491
|
+
Error:`,o)}}function JC(){return gE(e=>{ea("cls",{metric:e}),bE=e},{reportAllChanges:!0})}function XC(){return yE(e=>{ea("lcp",{metric:e}),AE=e},{reportAllChanges:!0})}function QC(){return IE(e=>{ea("ttfb",{metric:e}),vE=e})}function ZC(){return TE(e=>{ea("inp",{metric:e}),RE=e})}function Au(e,t,n,r,o=!1){NE(e,t);let i;return bu[e]||(i=n(),bu[e]=!0),r&&t({metric:r}),CE(e,t,o?i:void 0)}function ex(e){let t={};e==="event"&&(t.durationThreshold=0),nn(e,n=>{ea(e,{entries:n})},t)}function NE(e,t){Zs[e]=Zs[e]||[],Zs[e].push(t)}function CE(e,t,n){return()=>{n&&n();let r=Zs[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function xE(e){return"duration"in e}var tx=80,Ro={};try{typeof Node<"u"&&(Ro.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element<"u"&&(Ro.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,Ro.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,Ro.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,Ro.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<"u"&&(Ro.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function Ur(e,t,n){let r=Ro[t];if(r)try{return r.call(e,n)}catch{}let o=e[t];return typeof o=="function"?o.call(e,n):o}function Te(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],i=0,s=0,a=" > ",c=a.length,u,f=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||tx;for(;n&&i++<r&&(u=nx(n,f),!(u==="html"||i>1&&s+o.length*c+u.length>=l));)o.push(u),s+=u.length,n=Ur(n,"parentNode");return o.reverse().join(a)}catch{return"<unknown>"}}function nx(e,t){let n=[],r=Ur(e,"tagName");if(!r)return"";if(typeof HTMLElement<"u"&&e instanceof HTMLElement){let i=Ur(e,"dataset");if(i){if(i.sentryComponent)return i.sentryComponent;if(i.sentryElement)return i.sentryElement}}n.push(r.toLowerCase());let o=t?.length?t.filter(i=>Ur(e,"getAttribute",i)).map(i=>[i,Ur(e,"getAttribute",i)]):null;if(o?.length)o.forEach(i=>{n.push(`[${i[0]}="${i[1]}"]`)});else{let i=Ur(e,"id");i&&n.push(`#${i}`);let s=Ur(e,"className");if(s&&Pe(s)){let a=s.split(/\s+/);for(let c of a)n.push(`.${c}`)}}for(let i of["aria-label","type","name","title","alt"]){let s=Ur(e,"getAttribute",i);s&&n.push(`[${i}="${s}"]`)}return n.join("")}var wE=e=>{let t=n=>{(n.type==="pagehide"||$.document?.visibilityState==="hidden")&&e(n)};tn("visibilitychange",t,{capture:!0,once:!0}),tn("pagehide",t,{capture:!0,once:!0})};function vu(e){return typeof e=="number"&&isFinite(e)}function ar(e,t,n,o){var r=zt(o,[]);let i=P(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),yr(e,()=>{let s=Ue(p({startTime:t},r));return s&&s.end(n),s})}function Oi(e){let t=I();if(!t)return;let{name:n,transaction:r,attributes:o,startTime:i}=e,{release:s,environment:a}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),f=t.getIntegrationByName("Replay")?.getReplayId(),l=w(),m=l.getUser(),d=m!==void 0?m.email||m.id||m.ip_address:void 0,_;try{_=l.getScopeData().contexts.profile.profile_id}catch{}let h=p({release:s,environment:a,user:d||void 0,profile_id:_||void 0,replay_id:f||void 0,transaction:r,"user_agent.original":$.navigator?.userAgent,"client.address":c?"{{auto}}":void 0},o);return Ue({name:n,attributes:h,startTime:i,experimental:{standalone:!0}})}function rn(){return $.addEventListener&&$.performance}function he(e){return e/1e3}function kE(e){let t="unknown",n="unknown",r="";for(let o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function No(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Co(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}wE(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function OE(e){let t=0,n;if(!No("layout-shift"))return;let r=ir(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);Co(e,(o,i)=>{rx(t,n,i,o),r()})}function rx(e,t,n,r){Qe&&g.log(`Sending CLS span (${e})`);let o=t?he((pe()||0)+t.startTime):ne(),i=w().getScopeData().transactionName,s=t?Te(t.sources[0]?.node):"Layout shift",a={[G]:"auto.http.browser.cls",[Z]:"ui.webvital.cls",[it]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((u,f)=>{a[`cls.source.${f+1}`]=Te(u.node)});let c=Oi({name:s,transaction:i,attributes:a,startTime:o});c&&(c.addEvent("cls",{[dn]:"",[mn]:e}),c.end(o))}var ox=6e4;function xo(e){return e!=null&&e>0&&e<=ox}function ME(e){let t=0,n;if(!No("largest-contentful-paint"))return;let r=sr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!xo(o.value)||(t=o.value,n=i)},!0);Co(e,(o,i)=>{ix(t,n,i,o),r()})}function ix(e,t,n,r){if(!xo(e))return;Qe&&g.log(`Sending LCP span (${e})`);let o=he((pe()||0)+(t?.startTime||0)),i=w().getScopeData().transactionName,s=t?Te(t.element):"Largest contentful paint",a={[G]:"auto.http.browser.lcp",[Z]:"ui.webvital.lcp",[it]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Te(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));let c=Oi({name:s,transaction:i,attributes:a,startTime:o});c&&(c.addEvent("lcp",{[dn]:"millisecond",[mn]:e}),c.end(o))}function on(e){return e&&((pe()||performance.timeOrigin)+e)/1e3}function ta(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=kE(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return pe()||rn()?.timeOrigin?sx(E(p({},t),{"http.request.redirect_start":on(e.redirectStart),"http.request.redirect_end":on(e.redirectEnd),"http.request.worker_start":on(e.workerStart),"http.request.fetch_start":on(e.fetchStart),"http.request.domain_lookup_start":on(e.domainLookupStart),"http.request.domain_lookup_end":on(e.domainLookupEnd),"http.request.connect_start":on(e.connectStart),"http.request.secure_connection_start":on(e.secureConnectionStart),"http.request.connection_end":on(e.connectEnd),"http.request.request_start":on(e.requestStart),"http.request.response_start":on(e.responseStart),"http.request.response_end":on(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0})):t}function sx(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var ax=2147483647,LE=0,Ot={},kt,Nu;function wp({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=rn();if(r&&pe()){r.mark&&$.performance.mark("sentry-tracing-init");let o=t?ME(n):t===!1?ux():void 0,i=e?OE(n):e===!1?cx():void 0,s=lx(),a=fx();return()=>{s(),a(),o?.(),i?.()}}return()=>{}}function kp(){wt("longtask",({entries:e})=>{let t=te();if(!t)return;let{op:n,start_timestamp:r}=P(t);for(let o of e){let i=he(pe()+o.startTime),s=he(o.duration);n==="navigation"&&r&&i<r||ar(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[G]:"auto.ui.browser.metrics"}})}})}function Op(){new PerformanceObserver(t=>{let n=te();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=he(pe()+r.startTime),{start_timestamp:i,op:s}=P(n);if(s==="navigation"&&i&&o<i)continue;let a=he(r.duration),c={[G]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:f,invokerType:l,sourceURL:m,sourceFunctionName:d,sourceCharPosition:_}=u;c["browser.script.invoker"]=f,c["browser.script.invoker_type"]=l,m&&(c["code.filepath"]=m),d&&(c["code.function"]=d),_!==-1&&(c["browser.script.source_char_position"]=_),ar(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function Mp(){wt("event",({entries:e})=>{let t=te();if(t){for(let n of e)if(n.name==="click"){let r=he(pe()+n.startTime),o=he(n.duration),i={name:Te(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[G]:"auto.ui.browser.metrics"}},s=Or(n.target);s&&(i.attributes["ui.component_name"]=s),ar(t,r,r+o,i)}}})}function cx(){return ir(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(Ot.cls={value:e.value,unit:""},Nu=t)},!0)}function ux(){return sr(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!xo(e.value)||(Ot.lcp={value:e.value,unit:"millisecond"},kt=t)},!0)}function lx(){return xp(({metric:e})=>{e.entries[e.entries.length-1]&&(Ot.ttfb={value:e.value,unit:"millisecond"})})}function fx(){return wt("paint",({entries:e})=>{let t=Hn();for(let n of e){let r=n.startTime<t.firstHiddenTime;n.name==="first-paint"&&r&&(Ot.fp={value:n.startTime,unit:"millisecond"}),n.name==="first-contentful-paint"&&r&&(Ot.fcp={value:n.startTime,unit:"millisecond"})}})}function Lp(e,t){let n=rn(),r=pe();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s}=t,a=he(r),c=n.getEntries(),{op:u,start_timestamp:f}=P(e);c.slice(LE).forEach(l=>{let m=he(l.startTime),d=he(Math.max(0,l.duration));if(!(u==="navigation"&&f&&a+m<f))switch(l.entryType){case"navigation":{_x(e,l,a);break}case"mark":case"paint":case"measure":{dx(e,l,m,d,a,i);break}case"resource":{Sx(e,l,l.name,m,d,a,s);break}}}),LE=Math.max(c.length-1,0),Ex(e,o)}function Pp(e,t){let n=pe();if(!rn()?.getEntries||!n){PE();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:o,recordLcpOnPageloadSpan:i}=t,s=he(n);if(P(e).op==="pageload"){if(Ix(Ot),r){let a=(c,u,f)=>{let l=f??`browser.web_vital.${c}.value`;e.setAttribute(l,u),Qe&&g.log("Setting web vital attribute",{[l]:u},"on pageload span")};["ttfb","fp","fcp"].forEach(c=>{Ot[c]&&a(c,Ot[c].value)}),Ot["ttfb.requestTime"]&&a("ttfb.requestTime",Ot["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else o||delete Ot.cls,i||delete Ot.lcp,Object.entries(Ot).forEach(([a,c])=>{Xo(a,c.value,c.unit,e)}),Tx(e,t);e.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",s),e.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",en())}PE()}function PE(){kt=void 0,Nu=void 0,Ot={}}function px(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function dx(e,t,n,r,o,i){if(px(t)||["mark","measure"].includes(t.entryType)&&ze(t.name,i))return;let s=or(!1),a=he(s?s.requestStart:0),c=o+Math.max(n,a),u=o+n,f=u+r,l={[G]:"auto.resource.browser.metrics"};c!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=c),mx(l,t),c<=f&&ar(e,c,f,{name:t.name,op:t.entryType,attributes:l})}function mx(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&je(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(je(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function _x(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ru(e,t,r,n)}),Ru(e,t,"secureConnection",n,"TLS/SSL"),Ru(e,t,"fetch",n,"cache"),Ru(e,t,"domainLookup",n,"DNS"),hx(e,t,n)}function Ru(e,t,n,r,o=n){let i=gx(n),s=t[i],a=t[`${n}Start`];!a||!s||ar(e,r+he(a),r+he(s),{op:`browser.${o}`,name:t.name,attributes:p({[G]:"auto.ui.browser.metrics"},n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{})})}function gx(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function hx(e,t,n){let r=n+he(t.requestStart),o=n+he(t.responseEnd),i=n+he(t.responseStart);t.responseEnd&&(ar(e,r,o,{op:"browser.request",name:t.name,attributes:{[G]:"auto.ui.browser.metrics"}}),ar(e,i,o,{op:"browser.response",name:t.name,attributes:{[G]:"auto.ui.browser.metrics"}}))}function Sx(e,t,n,r,o,i,s){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(s?.includes(a))return;let c={[G]:"auto.resource.browser.metrics"},u=Yt(n);u.protocol&&(c["url.scheme"]=u.protocol.split(":").pop()),u.host&&(c["server.address"]=u.host),c["url.same_origin"]=n.includes($.location.origin),yx(t,c,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);let f=p(p({},c),ta(t)),l=i+r,m=l+o;ar(e,l,m,{name:n.replace($.location.origin,""),op:a,attributes:f})}function Ex(e,t){let n=$.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),vu(r.rtt)&&(t?e.setAttribute("network.connection.rtt",r.rtt):P(e).op==="pageload"&&Xo("connection.rtt",r.rtt,"millisecond"))),vu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),vu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function Tx(e,t){kt&&t.recordLcpOnPageloadSpan&&(kt.element&&e.setAttribute("lcp.element",Te(kt.element)),kt.id&&e.setAttribute("lcp.id",kt.id),kt.url&&e.setAttribute("lcp.url",kt.url.trim().slice(0,200)),kt.loadTime!=null&&e.setAttribute("lcp.loadTime",kt.loadTime),kt.renderTime!=null&&e.setAttribute("lcp.renderTime",kt.renderTime),e.setAttribute("lcp.size",kt.size)),Nu?.sources&&t.recordClsOnPageloadSpan&&Nu.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Te(n.node)))}function yx(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<ax||typeof i=="string")&&(t[o]=i)})}function Ix(e){let t=or(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var bx="ElementTiming",Ax=()=>({name:bx,setup(){!rn()||!pe()||wt("element",({entries:t})=>{for(let n of t){let r=n;if(!r.identifier)continue;let o=r.identifier,i=r.name,s=r.renderTime,a=r.loadTime,c={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":o};i&&(c["ui.element.paint_type"]=i),r.id&&(c["ui.element.id"]=r.id),r.element&&(c["ui.element.type"]=r.element.tagName.toLowerCase()),r.url&&(c["ui.element.url"]=r.url),r.naturalWidth&&(c["ui.element.width"]=r.naturalWidth),r.naturalHeight&&(c["ui.element.height"]=r.naturalHeight),s>0&&_o.distribution("ui.element.render_time",s,{unit:"millisecond",attributes:c}),a>0&&_o.distribution("ui.element.load_time",a,{unit:"millisecond",attributes:c})}})}}),UE=Ax;var Up=[],na=new Map,Mi=new Map,Dp=60;function Bp(){if(rn()&&pe()){let t=vx();return()=>{t()}}return()=>{}}var Li={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function vx(){return vo(Rx)}var Rx=({metric:e})=>{if(e.value==null)return;let t=he(e.value);if(t>Dp)return;let n=e.entries.find(_=>_.duration===e.value&&Li[_.name]);if(!n)return;let{interactionId:r}=n,o=Li[n.name],i=he(pe()+n.startTime),s=te(),a=s?oe(s):void 0,c=r!=null?na.get(r):void 0,u=c?.span||a,f=u?P(u).description:w().getScopeData().transactionName,l=c?.elementName||Te(n.target),m={[G]:"auto.http.browser.inp",[Z]:`ui.interaction.${o}`,[it]:n.duration},d=Oi({name:l,transaction:f,attributes:m,startTime:i});d&&(d.addEvent("inp",{[dn]:"millisecond",[mn]:e.value}),d.end(i+t))};function DE(e){return e!=null?na.get(e):void 0}function Fp(){let e=Object.keys(Li);st()&&e.forEach(o=>{$.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Te(i),a=Math.round(o.timeStamp);if(Mi.set(a,s),Mi.size>50){let c=Mi.keys().next().value;c!==void 0&&Mi.delete(c)}}function n(o){let i=Math.round(o.startTime),s=Mi.get(i);if(!s)for(let a=-5;a<=5;a++){let c=Mi.get(i+a);if(c){s=c;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=te(),s=i&&oe(i);o.forEach(a=>{if(!xE(a))return;let c=a.interactionId;if(c==null||na.has(c))return;let u=a.target?Te(a.target):n(a);if(Up.length>10){let f=Up.shift();na.delete(f)}Up.push(c),na.set(c,{span:s,elementName:u})})};wt("event",r),wt("first-input",r)}function Hp(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:c,startTime:u,endTime:f}=e,l=w().getScopeData().transactionName,m=p({[G]:r,[Z]:n,[it]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":l,"user_agent.original":$.navigator?.userAgent},s);a&&Er(a).attributes?.[Z]==="pageload"&&(m["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(m[`browser.web_vital.${o}.report_event`]=c);let d=Ue({name:t,attributes:m,startTime:u,parentSpan:a});d&&d.end(f??u)}function Gp(e){let t=0,n;if(!No("largest-contentful-paint"))return;let r=sr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!xo(o.value)||(t=o.value,n=i)},!0);Co(e,(o,i,s)=>{Nx(t,n,s,o),r()})}function Nx(e,t,n,r){if(!xo(e))return;Qe&&g.log(`Sending LCP span (${e})`);let o=pe()||0,i=he(o),s=he(o+(t?.startTime||0)),a=t?Te(t.element):"Largest contentful paint",c={};t?.element&&(c["browser.web_vital.lcp.element"]=Te(t.element)),t?.id&&(c["browser.web_vital.lcp.id"]=t.id),t?.url&&(c["browser.web_vital.lcp.url"]=t.url),t?.loadTime!=null&&(c["browser.web_vital.lcp.load_time"]=t.loadTime),t?.renderTime!=null&&(c["browser.web_vital.lcp.render_time"]=t.renderTime),t?.size!=null&&(c["browser.web_vital.lcp.size"]=t.size),Hp({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:i,endTime:s})}function $p(e){let t=0,n;if(!No("layout-shift"))return;let r=ir(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);Co(e,(o,i,s)=>{Cx(t,n,s,o),r()})}function Cx(e,t,n,r){Qe&&g.log(`Sending CLS span (${e})`);let o=t?he((pe()||0)+t.startTime):ne(),i=t?Te(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,c)=>{s[`browser.web_vital.cls.source.${c+1}`]=Te(a.node)}),Hp({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function Wp(){if(!rn()||!pe())return;vo(({metric:n})=>{if(n.value==null||he(n.value)>Dp)return;let o=n.entries.find(i=>i.duration===n.value&&Li[i.name]);o&&xx(n.value,o)})}function xx(e,t){Qe&&g.log(`Sending INP span (${e})`);let n=he(pe()+t.startTime),r=he(e),o=Li[t.name],i=DE(t.interactionId),s=te(),a=s?oe(s):void 0,c=i?.span||a,u=c?Er(c).name:w().getScopeData().transactionName,f=i?.elementName||Te(t.target);Hp({name:f,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[it]:t.duration,"sentry.transaction":u},startTime:n,endTime:n+r,parentSpan:c})}var wx=1e3,BE,jp,zp;function ra(e){tt("dom",e),nt("dom",kx)}function kx(){if(!$.document)return;let e=We.bind(null,"dom"),t=FE(e,!0);$.document.addEventListener("click",t,!1),$.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=$[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(ye(o,"addEventListener",function(i){return function(s,a,c){if(s==="click"||s=="keypress")try{let u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=u[s]=u[s]||{refCount:0};if(!f.handler){let l=FE(e);f.handler=l,i.call(this,s,l,c)}f.refCount++}catch{}return i.call(this,s,a,c)}}),ye(o,"removeEventListener",function(i){return function(s,a,c){if(s==="click"||s=="keypress")try{let u=this.__sentry_instrumentation_handlers__||{},f=u[s];f&&(f.refCount--,f.refCount<=0&&(i.call(this,s,f.handler,c),f.handler=void 0,delete u[s]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,c)}}))})}function Ox(e){if(e.type!==jp)return!1;try{if(!e.target||e.target._sentryId!==zp)return!1}catch{}return!0}function Mx(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function FE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=Lx(n);if(Mx(n.type,r))return;_e(n,"_sentryCaptured",!0),r&&!r._sentryId&&_e(r,"_sentryId",ge());let o=n.type==="keypress"?"input":n.type;Ox(n)||(e({event:n,name:o,global:t}),jp=n.type,zp=r?r._sentryId:void 0),clearTimeout(BE),BE=$.setTimeout(()=>{zp=void 0,jp=void 0},wx)}}function Lx(e){try{return e.target}catch{return null}}var Cu;function cr(e){let t="history";tt(t,e),nt(t,Px)}function Px(){if($.addEventListener("popstate",()=>{let t=$.location.href,n=Cu;if(Cu=t,n===t)return;We("history",{from:n,to:t})}),!eu())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=Cu,i=Ux(String(r));if(Cu=i,o===i)return t.apply(this,n);We("history",{from:o,to:i})}return t.apply(this,n)}}ye($.history,"pushState",e),ye($.history,"replaceState",e)}function Ux(e){try{return new URL(e,$.location.origin).toString()}catch{return e}}var xu={};function Pi(e){let t=xu[e];if(t)return t;let n=$[e];if(yi(n))return xu[e]=n.bind($);let r=$.document;if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let i=o.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(o)}catch(o){Qe&&g.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(xu[e]=n.bind($))}function qp(e){xu[e]=void 0}function wo(...e){return Pi("setTimeout")(...e)}var ht="__sentry_xhr_v3__";function ko(e){tt("xhr",e),nt("xhr",Dx)}function Dx(){if(!$.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=ne()*1e3,s=Pe(r[0])?r[0].toUpperCase():void 0,a=Bx(r[1]);if(!s||!a)return t.apply(n,r);n[ht]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let c=()=>{let u=n[ht];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}let f={endTimestamp:ne()*1e3,startTimestamp:i,xhr:n,virtualError:o};We("xhr",f)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,f,l){return c(),u.apply(f,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,f,l){let[m,d]=l,_=f[ht];return _&&Pe(m)&&Pe(d)&&(_.request_headers[m.toLowerCase()]=d),u.apply(f,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[ht];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:ne()*1e3,xhr:n};return We("xhr",i),t.apply(n,r)}})}function Bx(e){if(Pe(e))return e;try{return e.toString()}catch{}}var Fx=Symbol.for("sentry__originalRequestBody");function wu(e){return new URLSearchParams(e).toString()}function Oo(e,t=g){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[wu(e)];if(!e)return[void 0]}catch(n){return Qe&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Qe&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Ui(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){let n=e[0][Fx];return n!==void 0?n:void 0}}function oa(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Qe&&g.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
492
|
+
`).reduce((n,r)=>{let[o,i]=r.split(": ");return i&&(n[o.toLowerCase()]=i),n},{}):{}}function Yp(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var Hx=40;function ia(e,t=Pi("fetch")){let n=0,r=0;async function o(i){let s=i.body.length;n+=s,r++;let a=p({body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);try{let c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw qp("fetch"),c}finally{n-=s,r--}}return xc(e,o,ao(e.bufferSize||Hx))}var v=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Gx(){let e=I();if(!e){v&&g.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){v&&g.warn("BrowserProfiling integration is not available");return}e.emit("startUIProfiler")}function $x(){let e=I();if(!e){v&&g.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){v&&g.warn("ProfilingIntegration is not available");return}e.emit("stopUIProfiler")}var Wx={startProfiler:Gx,stopProfiler:$x};var jx=10,zx=20,qx=30,Yx=40,Vx=50;function Di(e,t,n,r){let o={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var Kx=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Jx=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Xx=/\((\S*)(?::(\d+))(?::(\d+))\)/,Qx=/at (.+?) ?\(data:(.+?),/,Zx=e=>{let t=e.match(Qx);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=Kx.exec(e);if(n){let[,o,i,s]=n;return Di(o,"?",+i,+s)}let r=Jx.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=Xx.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=WE(r[1]||"?",r[2]);return Di(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},HE=[qx,Zx],ew=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tw=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,nw=e=>{let t=ew.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=tw.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],o=t[1]||"?";return[o,r]=WE(o,r),Di(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},GE=[Vx,nw],rw=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,ow=e=>{let t=rw.exec(e);return t?Di(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0},iw=[Yx,ow],sw=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,aw=e=>{let t=sw.exec(e);return t?Di(t[2],t[3]||"?",+t[1]):void 0},cw=[jx,aw],uw=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,lw=e=>{let t=uw.exec(e);return t?Di(t[5],t[3]||t[4]||"?",+t[1],+t[2]):void 0},fw=[zx,lw],$E=[HE,GE],Vp=Qi(...$E),WE=(e,t)=>{let n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function pw(e,{metadata:t,tunnel:n,dsn:r}){let o=p(p({event_id:e.event_id,sent_at:new Date().toISOString()},t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!n&&!!r&&{dsn:qe(r)}),i=dw(e);return Me(o,[i])}function dw(e){return[{type:"user_report"},e]}var ku=1024,mw="Breadcrumbs",_w=(e={})=>{let t=p({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:mw,setup(n){t.console&&po(Sw(n)),t.dom&&ra(hw(n,t.dom)),t.xhr&&ko(Ew(n)),t.fetch&&Bn(Tw(n)),t.history&&cr(yw(n)),t.sentry&&n.on("beforeSendEvent",gw(n))}}},sa=_w;function gw(e){return function(n){I()===e&>({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:fn(n)},{event:n})}}function hw(e,t){return function(r){if(I()!==e)return;let o,i,s=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>ku&&(v&&g.warn(`\`dom.maxStringLength\` cannot exceed ${ku}, but a value of ${a} was configured. Sentry will use ${ku} instead.`),a=ku),typeof s=="string"&&(s=[s]);try{let u=r.event,f=Iw(u)?u.target:u;o=Te(f,{keyAttrs:s,maxStringLength:a}),i=Or(f)}catch{o="<unknown>"}if(o.length===0)return;let c={category:`ui.${r.name}`,message:o};i&&(c.data={"ui.component_name":i}),gt(c,{event:r.event,name:r.name,global:r.global})}}function Sw(e){return function(n){if(I()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:tr(n.level),message:_r(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${_r(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;gt(r,{input:n.args,level:n.level})}}function Ew(e){return function(n){if(I()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[ht];if(!r||!o||!i)return;let{method:s,url:a,status_code:c,body:u}=i,f={method:s,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},m={category:"xhr",data:f,type:"http",level:Zc(c)};e.emit("beforeOutgoingRequestBreadcrumb",m,l),gt(m,l)}}function Tw(e){return function(n){if(I()!==e)return;let{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){let i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},s={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",s,i),gt(s,i)}else{let i=n.response,s=E(p({},n.fetchData),{status_code:i?.status}),a={input:n.args,response:i,startTimestamp:r,endTimestamp:o},c={category:"fetch",data:s,type:"http",level:Zc(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),gt(c,a)}}}function yw(e){return function(n){if(I()!==e)return;let r=n.from,o=n.to,i=Yt(x.location.href),s=r?Yt(r):void 0,a=Yt(o);s?.path||(s=i),i.protocol===a.protocol&&i.host===a.host&&(o=a.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),gt({category:"navigation",data:{from:r,to:o}})}}function Iw(e){return!!e&&!!e.target}var bw="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(","),Aw="BrowserApiErrors",vw=(e={})=>{let t=p({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},e);return{name:Aw,setupOnce(){t.setTimeout&&ye(x,"setTimeout",jE),t.setInterval&&ye(x,"setInterval",jE),t.requestAnimationFrame&&ye(x,"requestAnimationFrame",Rw),t.XMLHttpRequest&&"XMLHttpRequest"in x&&ye(XMLHttpRequest.prototype,"send",Nw);let n=t.eventTarget;n&&(Array.isArray(n)?n:bw).forEach(o=>Cw(o,t))}}},Kp=vw;function jE(e){return function(...t){let n=t[0];return t[0]=bo(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ft(e)}`}}),e.apply(this,t)}}function Rw(e){return function(t){return e.apply(this,[bo(t,{mechanism:{data:{handler:ft(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Nw(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&ye(n,o,function(i){let s={mechanism:{data:{handler:ft(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=mr(i);return a&&(s.mechanism.data.handler=ft(a)),bo(i,s)})}),e.apply(this,t)}}function Cw(e,t){let r=x[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(ye(r,"addEventListener",function(o){return function(i,s,a){try{xw(s)&&(s.handleEvent=bo(s.handleEvent,{mechanism:{data:{handler:ft(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&ww(this,i,s),o.apply(this,[i,bo(s,{mechanism:{data:{handler:ft(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),ye(r,"removeEventListener",function(o){return function(i,s,a){try{if(Object.prototype.hasOwnProperty.call(s,"__sentry_wrapped__")){let c=s.__sentry_wrapped__;c&&o.call(this,i,c,a)}}catch{}return o.call(this,i,s,a)}}))}function xw(e){return typeof e.handleEvent=="function"}function ww(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var aa=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof x.document>"u"){v&&g.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}ti({ignoreDuration:!0}),io();let n=re(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(io(),r=i)}),t==="route"&&cr(({from:o,to:i})=>{o!==i&&(ti({ignoreDuration:!0}),io())})}}};var kw="CultureContext",Ow=()=>({name:kw,preprocessEvent(e){let t=zE();t&&(e.contexts=E(p({},e.contexts),{culture:p(p({},t),e.contexts?.culture)}))},processSegmentSpan(e){let t=zE();t&&Ut(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}}),ca=Ow;function zE(){try{let e=x.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var Mw="GlobalHandlers",Lw=(e={})=>{let t=p({onerror:!0,onunhandledrejection:!0},e);return{name:Mw,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(Pw(n),qE("onerror")),t.onunhandledrejection&&(Uw(n),qE("onunhandledrejection"))}}},ua=Lw;function Pw(e){es(t=>{let{stackParser:n,attachStacktrace:r}=YE();if(I()!==e||hp())return;let{msg:o,url:i,line:s,column:a,error:c}=t,u=Dw(Ci(n,c||o,void 0,r,!1),i,s,a);u.level="error",hn(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function Uw(e){ts(t=>{let{stackParser:n,attachStacktrace:r}=YE();if(I()!==e||hp())return;let o=Jp(t),i=je(o)?Xp(o):Ci(n,o,void 0,r,!0);i.level="error",hn(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Jp(e){if(je(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 Xp(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Dw(e,t,n,r){let o=e.exception=e.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:Bw(t)??ut(),function:"?",in_app:!0}),e}function qE(e){v&&g.log(`Global Handler attached: ${e}`)}function YE(){return I()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Bw(e){if(!(!Pe(e)||e.length===0))return e.startsWith("data:")?`<${at(e,!1)}>`:e}var la=()=>({name:"HttpContext",preprocessEvent(e){if(!x.navigator&&!x.location&&!x.document)return;let t=Ni(),n=p(p({},t.headers),e.request?.headers);e.request=E(p(p({},t),e.request),{headers:n})},processSegmentSpan(e){let t=e.attributes?.[Z];if(!x.navigator&&!x.location&&!x.document)return;let n=Ni();Ut(e,{"url.full":t!=="http.client"?n.url:void 0,"http.request.header.user_agent":n.headers["User-Agent"],"http.request.header.referer":n.headers.Referer})}});var Fw="cause",Hw=5,Gw="LinkedErrors",$w=(e={})=>{let t=e.limit||Hw,n=e.key||Fw;return{name:Gw,preprocessEvent(r,o,i){let s=i.getOptions();Gf(Xs,s.stackParser,n,t,r,o)}}},fa=$w;var Ww=/^HTML(\w*)Element$/;function Qp(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Yp(e)){let t=jw(e);if(Ww.test(t))return`[HTMLElement: ${Te(e)}]`}}function jw(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function VE(){return zw()?(v&&Ge(()=>{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 zw(){if(typeof x.window>"u")return!1;let e=x;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=ut();return!(x===x.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function KE(e){return[fo(),lo(),ui(),Kp(),sa(),ua(),fa(),mo(),la(),ca(),aa()]}function Zp(e={}){let t=!e.skipBrowserExtensionCheck&&VE(),n=e.defaultIntegrations==null?KE():e.defaultIntegrations,r=E(p({},e),{enabled:t?!1:e.enabled,stackParser:Pa(e.stackParser||Vp),integrations:vc({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||ia});return Ga(Qp),wf(Qs,r)}function qw(){}function Yw(e){e()}function Ou(e={}){let t=x.document,n=t?.head||t?.body;if(!n){v&&g.error("[showReportDialog] Global document not defined");return}let r=w(),i=I()?.getDsn();if(!i){v&&g.error("[showReportDialog] DSN not configured");return}let s=E(p({},e),{user:p(p({},r.getUser()),e.user),eventId:e.eventId||Cs()}),a=x.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=_f(i,s);let{onLoad:c,onClose:u}=s;if(c&&(a.onload=c),u){let f=l=>{if(l.data==="__sentry_reportdialog_closed__")try{u()}finally{x.removeEventListener("message",f)}};x.addEventListener("message",f)}n.appendChild(a)}var Vw=C,Kw="ReportingObserver",JE=new WeakMap,Jw=(e={})=>{let t=e.types||["crash","deprecation","intervention"];function n(r){if(JE.has(I()))for(let o of r)$e(i=>{i.setExtra("url",o.url);let s=`ReportingObserver [${o.type}]`,a="No details available";if(o.body){let c={};for(let u in o.body)c[u]=o.body[u];if(i.setExtra("body",c),o.type==="crash"){let u=o.body;a=[u.crashId||"",u.reason||""].join(" ").trim()||a}else a=o.body.message||a}Ns(`${s}: ${a}`)})}return{name:Kw,setupOnce(){if(!tu())return;new Vw.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){JE.set(r,!0)}}},Xw=Jw;var Qw="HttpClient",Zw=(e={})=>{let t=p({failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/]},e);return{name:Qw,setup(n){a0(n,t),c0(n,t)}}},e0=Zw;function t0(e,t,n,r,o){if(QE(e,n.status,n.url)){let i=u0(t,r),s,a,c,u,f=eT();if(f.requestHeaders!==!1&&(s=vr(XE(i.headers),f.requestHeaders)),f.responseHeaders!==!1&&(a=vr(XE(n.headers),f.responseHeaders)),f.cookies!==!1){let m=i.headers.get("Cookie")||void 0;if(m){let _=Bs(m,f.cookies);typeof _=="object"&&(c=_)}let d=n.headers.get("Set-Cookie")||void 0;if(d){let _=Bs(d,f.cookies);typeof _=="object"&&(u=_)}}let l=ZE({url:i.url,method:i.method,status:n.status,requestHeaders:s,responseHeaders:a,requestCookies:c,responseCookies:u,error:o,type:"fetch"});hn(l)}}function n0(e,t,n,r,o){if(QE(e,t.status,t.responseURL)){let i,s,a,c=eT();if(c.cookies!==!1)try{let f=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;if(f){let l=Bs(f,c.cookies);typeof l=="object"&&(s=l)}}catch{}if(c.responseHeaders!==!1)try{a=vr(o0(t),c.responseHeaders)}catch{}c.requestHeaders!==!1&&(i=vr(r,c.requestHeaders));let u=ZE({url:t.responseURL,method:n,status:t.status,requestHeaders:i,responseHeaders:a,responseCookies:s,error:o,type:"xhr"});hn(u)}}function r0(e){if(e){let t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function XE(e){let t={};return e.forEach((n,r)=>{t[r]=n}),t}function o0(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
|
|
493
|
+
`).reduce((n,r)=>{let[o,i]=r.split(": ");return o&&i&&(n[o]=i),n},{}):{}}function i0(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function s0(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function a0(e,t){Ii()&&Bn(n=>{if(I()!==e)return;let{response:r,args:o,error:i,virtualError:s}=n,[a,c]=o;r&&t0(t,a,r,c,i||s)},!1)}function c0(e,t){"XMLHttpRequest"in C&&ko(n=>{if(I()!==e)return;let{error:r,virtualError:o}=n,i=n.xhr,s=i[ht];if(!s)return;let{method:a,request_headers:c}=s;try{n0(t,i,a,c,r||o)}catch(u){v&&g.warn("Error while extracting response event form XHR response",u)}})}function QE(e,t,n){return s0(e.failedRequestStatusCodes,t)&&i0(e.failedRequestTargets,n)&&!si(n,I())}function ZE(e){let t=I(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,o=`HTTP Client Error with status code: ${e.status}`,i={message:o,exception:{values:[{type:"Error",value:o,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:r0(e.responseHeaders)}}};return Je(i,{type:`auto.http.client.${e.type}`,handled:!1}),i}function u0(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function eT(){let e=I();if(!e)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};let t=e.getOptions();if(t.dataCollection==null){let o=!!t.sendDefaultPii;return{cookies:o,requestHeaders:o,responseHeaders:o}}let{cookies:n,httpHeaders:r}=e.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}var ed=C,l0=7,f0="ContextLines",p0=(e={})=>({name:f0,processEvent(t,n,r){let o=e.frameContextLines??r?.getDataCollectionOptions().frameContextLines??l0;return m0(t,o)}}),d0=p0;function m0(e,t){let n=ed.document,r=ed.location&&Rr(ed.location.href);if(!n||!r)return e;let o=e.exception?.values;if(!o?.length)return e;let i=n.documentElement.innerHTML;if(!i)return e;let s=["<!DOCTYPE html>","<html>",...i.split(`
|
|
494
|
+
`),"</html>"];return o.forEach(a=>{let c=a.stacktrace;c?.frames&&(c.frames=c.frames.map(u=>_0(u,s,r,t)))}),e}function _0(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||$a(t,e,r),e}var g0="GraphQLClient",h0=e=>({name:g0,setup(t){S0(t,e),E0(t,e)}});function S0(e,t){e.on("beforeOutgoingRequestSpan",(n,r)=>{let i=P(n).data||{};if(!(i[Z]==="http.client"))return;let c=i[oc]||i["http.url"]||i.url,u=i[rc]||i["http.method"];if(!Pe(c)||!Pe(u))return;let{endpoints:f}=t,l=ze(c,f),m=nT(r);if(l&&m){let d=rT(m);if(d){let _=tT(d);n.updateName(`${u} ${c} (${_})`),Lu(d)&&n.setAttribute("graphql.document",d.query),Pu(d)&&(n.setAttribute("graphql.persisted_query.hash.sha256",d.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",d.extensions.persistedQuery.version))}}})}function E0(e,t){e.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{let{category:o,type:i,data:s}=n;if(i==="http"&&(o==="fetch"||o==="xhr")){let f=s?.url,{endpoints:l}=t,m=ze(f,l),d=nT(r);if(m&&s&&d){let _=rT(d);if(!s.graphql&&_){let h=tT(_);s["graphql.operation"]=h,Lu(_)&&(s["graphql.document"]=_.query),Pu(_)&&(s["graphql.persisted_query.hash.sha256"]=_.extensions.persistedQuery.sha256Hash,s["graphql.persisted_query.version"]=_.extensions.persistedQuery.version)}}}})}function tT(e){if(Pu(e))return`persisted ${e.operationName}`;if(Lu(e)){let{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=T0(t);return r?`${o} ${r}`:`${o}`}return"unknown"}function nT(e){let t="xhr"in e,n;if(t){let r=e.xhr[ht];n=r&&Oo(r.body)[0]}else{let r=Ui(e.input);n=Oo(r)[0]}return n}function T0(e){let t=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=e.match(t);if(r)return{operationType:r[1],operationName:r[2]};let o=e.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function Mu(e){return typeof e=="object"&&e!==null}function Lu(e){return Mu(e)&&typeof e.query=="string"}function Pu(e){return Mu(e)&&typeof e.operationName=="string"&&Mu(e.extensions)&&Mu(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash=="string"&&typeof e.extensions.persistedQuery.version=="number"}function rT(e){try{let t=JSON.parse(e);return Lu(t)||Pu(t)?t:void 0}catch{return}}var y0=h0;var I0=(e={})=>{let t=["script"];function n(r,o,i=0){if(!r)return;let s="shadowRoot"in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let a of s){if(!(a instanceof HTMLElement))continue;let c=Or(a,1)||void 0,u=a.tagName.toLowerCase();if(t.includes(u))continue;let f=e.onElement?.({element:a,componentName:c,tagName:u,depth:i})||{};if(f==="skip")continue;if(f==="children"){n(a,o,i+1);continue}let{x:l,y:m,width:d,height:_}=a.getBoundingClientRect(),h=p({identifier:a.id||void 0,type:c||u,visible:!0,alpha:1,height:_,width:d,x:l,y:m},f),S=[];h.children=S,n(a,h.children,i+1),o.push(h)}}return{name:"ViewHierarchy",processEvent:(r,o)=>{if(r.type!==void 0||e.shouldAttach?.(r,o)===!1)return r;let i={rendering_system:"DOM",positioning:"absolute",windows:[]};n(e.rootElement?.()||x.document.body,i.windows);let s={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(i)};return o.attachments=o.attachments||[],o.attachments.push(s),r}}};var Ce=C,wd="sentryReplaySession",b0="replay_event",kd="Unable to send Replay",A0=3e5,v0=9e5,R0=5e3,N0=5500,C0=6e4,x0=5e3,w0=3,oT=15e4,Uu=5e3,k0=3e3,O0=300,Od=2e7,M0=4999,L0=5e4,iT=36e5,P0=Object.defineProperty,U0=(e,t,n)=>t in e?P0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sT=(e,t,n)=>U0(e,typeof t!="symbol"?t+"":t,n),Ye=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ye||{});function D0(e){return e.nodeType===e.ELEMENT_NODE}function ma(e){return e?.host?.shadowRoot===e}function _a(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function B0(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function F0(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Gu(e){try{let t=e.rules||e.cssRules;return t?B0(Array.from(t,wT).join("")):null}catch{return null}}function H0(e){let t="";for(let n=0;n<e.style.length;n++){let r=e.style,o=r[n],i=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function wT(e){let t;if($0(e))try{t=Gu(e.styleSheet)||F0(e)}catch{}else if(W0(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=H0(e)),r&&(n=G0(n)),r||o)return n}return t||e.cssText}function G0(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function $0(e){return"styleSheet"in e}function W0(e){return"selectorText"in e}var $u=class{constructor(){sT(this,"idNodeMap",new Map),sT(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function j0(){return new $u}function nl({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function ha({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function zi(e){return e.toLowerCase()}function sd(e){return e.toUpperCase()}var aT="__rrweb_original__";function z0(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){let i=t.getImageData,s=aT in i?i[aT]:i;if(new Uint32Array(s.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer).some(c=>c!==0))return!1}return!0}function Md(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?zi(t):null}function Wu(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function kT(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}var cT={};function OT(e){let t=cT[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return cT[e]=r.bind(window)}function ad(...e){return OT("setTimeout")(...e)}function MT(...e){return OT("clearTimeout")(...e)}function LT(e){try{return e.contentDocument}catch{}}function q0(e){try{return e.contentWindow}catch{}}var Y0=1,V0=new RegExp("[^a-z0-9-_:]"),Sa=-2;function Ld(){return Y0++}function K0(e){if(e instanceof HTMLFormElement)return"form";let t=zi(e.tagName);return V0.test(t)?"div":t}function J0(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Bi,uT,X0=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Q0=/^(?:[a-z+]+:)?\/\//i,Z0=/^www\..*/i,ek=/^(data:)([^,]*),(.*)/i;function tk(e,t){if(!e||t.size===0)return e;try{let n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;let i=o.indexOf(":");if(i===-1){r.push(o);continue}let s=o.slice(0,i).trim();t.has(s)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function ju(e,t){return(e||"").replace(X0,(n,r,o,i,s,a)=>{let c=o||s||a,u=r||i||"";if(!c)return n;if(Q0.test(c)||Z0.test(c))return`url(${u}${c}${u})`;if(ek.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${J0(t)+c}${u})`;let f=t.split("/"),l=c.split("/");f.pop();for(let m of l)m!=="."&&(m===".."?f.pop():f.push(m));return`url(${u}${f.join("/")}${u})`})}var nk=/^[^ \t\n\r\u000c]+/,rk=/^[, \t\n\r\u000c]+/;function ok(e,t){if(t.trim()==="")return t;let n=0;function r(i){let s,a=i.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let o=[];for(;r(rk),!(n>=t.length);){let i=r(nk);if(i.slice(-1)===",")i=Gi(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=Gi(e,i);let a=!1;for(;;){let c=t.charAt(n);if(c===""){o.push((i+s).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,o.push((i+s).trim());break}else c==="("&&(a=!0);s+=c,n+=1}}}return o.join(", ")}var lT=new WeakMap;function Gi(e,t){return!t||t.trim()===""?t:rl(e,t)}function ik(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function rl(e,t){let n=lT.get(e);if(n||(n=e.createElement("a"),lT.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function PT(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Gi(e,r);if(n==="xlink:href"&&r[0]!=="#")return Gi(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Gi(e,r);if(n==="srcset")return ok(e,r);if(n==="style"){let a=ju(r,rl(e));return s&&s.size>0&&(a=tk(a,s)),a}else if(t==="object"&&n==="data")return Gi(e,r);return typeof i=="function"?i(n,r,o):r}function UT(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function sk(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function ak(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function Mo(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Mo(e.parentNode,t,n,r+1)}function $i(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(ak(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function qi(e,t,n,r,o,i){try{let s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(s===null)return!1;if(s.tagName==="INPUT"){let u=s.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let a=-1,c=-1;if(i){if(c=Mo(s,$i(r,o)),c<0)return!0;a=Mo(s,$i(t,n),c>=0?c:1/0)}else{if(a=Mo(s,$i(t,n)),a<0)return!1;c=Mo(s,$i(r,o),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!i}catch{}return!!i}function ck(e,t,n){let r=q0(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=ad(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{MT(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return ad(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function uk(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=ad(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{MT(i),r=!0,t()})}function lk(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:l,unmaskTextSelector:m,inlineStylesheet:d,maskInputOptions:_={},maskTextFn:h,maskInputFn:S,dataURLOptions:T={},inlineImages:b,recordCanvas:k,keepIframeSrcFn:R,newlyAddedElement:U=!1,ignoreCSSAttributes:D}=t,y=fk(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ye.Document,childNodes:[],compatMode:e.compatMode}:{type:Ye.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ye.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return dk(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:d,maskAttributeFn:c,maskInputOptions:_,maskInputFn:S,dataURLOptions:T,inlineImages:b,recordCanvas:k,keepIframeSrcFn:R,newlyAddedElement:U,rootId:y,maskTextClass:u,unmaskTextClass:f,maskTextSelector:l,unmaskTextSelector:m,ignoreCSSAttributes:D});case e.TEXT_NODE:return pk(e,{doc:n,maskAllText:a,maskTextClass:u,unmaskTextClass:f,maskTextSelector:l,unmaskTextSelector:m,maskTextFn:h,maskInputOptions:_,maskInputFn:S,rootId:y});case e.CDATA_SECTION_NODE:return{type:Ye.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Ye.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function fk(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function pk(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:f}=t,l=e.parentNode&&e.parentNode.tagName,m=e.textContent,d=l==="STYLE"?!0:void 0,_=l==="SCRIPT"?!0:void 0,h=l==="TEXTAREA"?!0:void 0;if(d&&m){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(m=Gu(e.parentNode.sheet))}catch(T){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${T}`,e)}m=ju(m,rl(t.doc))}_&&(m="SCRIPT_PLACEHOLDER");let S=qi(e,r,i,o,s,n);if(!d&&!_&&!h&&m&&S&&(m=a?a(m,e.parentElement):m.replace(/[\S]/g,"*")),h&&m&&(c.textarea||S)&&(m=u?u(m,e.parentNode):m.replace(/[\S]/g,"*")),l==="OPTION"&&m){let T=nl({type:null,tagName:l,maskInputOptions:c});m=ha({isMasked:qi(e,r,i,o,s,T),element:e,value:m,maskInputFn:u})}return{type:Ye.Text,textContent:m||"",isStyle:d,rootId:f}}function dk(e,t){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:s,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:f={},inlineImages:l,recordCanvas:m,keepIframeSrcFn:d,newlyAddedElement:_=!1,rootId:h,maskTextClass:S,unmaskTextClass:T,maskTextSelector:b,unmaskTextSelector:k,ignoreCSSAttributes:R}=t,U=sk(e,r,o,i),D=K0(e),y={},O=e.attributes.length;for(let N=0;N<O;N++){let B=e.attributes[N];B.name&&!UT(D,B.name,B.value)&&(y[B.name]=PT(n,D,zi(B.name),B.value,e,c,R))}if(D==="link"&&s){let N=Array.from(n.styleSheets).find(M=>M.href===e.href),B=null;N&&(B=Gu(N)),B&&(y.rel=null,y.href=null,y.crossorigin=null,y._cssText=ju(B,N.href))}if(D==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let N=Gu(e.sheet);N&&(y._cssText=ju(N,rl(n)))}if(D==="input"||D==="textarea"||D==="select"||D==="option"){let N=e,B=Md(N),M=Wu(N,sd(D),B),F=N.checked;if(B!=="submit"&&B!=="button"&&M){let j=qi(N,S,b,T,k,nl({type:B,tagName:sd(D),maskInputOptions:a}));y.value=ha({isMasked:j,element:N,value:M,maskInputFn:u})}F&&(y.checked=F)}if(D==="option"&&(e.selected&&!a.select?y.selected=!0:delete y.selected),D==="canvas"&&m){if(e.__context==="2d")z0(e)||(y.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){let N=e.toDataURL(f.type,f.quality),B=n.createElement("canvas");B.width=e.width,B.height=e.height;let M=B.toDataURL(f.type,f.quality);N!==M&&(y.rr_dataURL=N)}}if(D==="img"&&l){Bi||(Bi=n.createElement("canvas"),uT=Bi.getContext("2d"));let N=e,B=N.currentSrc||N.getAttribute("src")||"<unknown-src>",M=N.crossOrigin,F=()=>{N.removeEventListener("load",F);try{Bi.width=N.naturalWidth,Bi.height=N.naturalHeight,uT.drawImage(N,0,0),y.rr_dataURL=Bi.toDataURL(f.type,f.quality)}catch(j){if(N.crossOrigin!=="anonymous"){N.crossOrigin="anonymous",N.complete&&N.naturalWidth!==0?F():N.addEventListener("load",F);return}else console.warn(`Cannot inline img src=${B}! Error: ${j}`)}N.crossOrigin==="anonymous"&&(M?y.crossOrigin=M:N.removeAttribute("crossorigin"))};N.complete&&N.naturalWidth!==0?F():N.addEventListener("load",F)}if((D==="audio"||D==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),_||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),U){let{width:N,height:B}=e.getBoundingClientRect();y={class:y.class,rr_width:`${N}px`,rr_height:`${B}px`}}D==="iframe"&&!d(y.src)&&(!U&&!LT(e)&&(y.rr_src=y.src),delete y.src);let Y;try{customElements.get(D)&&(Y=!0)}catch{}return{type:Ye.Element,tagName:D,attributes:y,childNodes:[],isSVG:ik(e)||void 0,needBlock:U,rootId:h,isCustom:Y}}function Ne(e){return e==null?"":e.toLowerCase()}function mk(e,t){if(t.comment&&e.type===Ye.Comment)return!0;if(e.type===Ye.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&kT(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Ne(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Ne(e.attributes.name)==="application-name"||Ne(e.attributes.rel)==="icon"||Ne(e.attributes.rel)==="apple-touch-icon"||Ne(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Ne(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ne(e.attributes.property).match(/^(og|twitter|fb):/)||Ne(e.attributes.name).match(/^(og|twitter):/)||Ne(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Ne(e.attributes.name)==="robots"||Ne(e.attributes.name)==="googlebot"||Ne(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Ne(e.attributes.name)==="author"||Ne(e.attributes.name)==="generator"||Ne(e.attributes.name)==="framework"||Ne(e.attributes.name)==="publisher"||Ne(e.attributes.name)==="progid"||Ne(e.attributes.property).match(/^article:/)||Ne(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Ne(e.attributes.name)==="google-site-verification"||Ne(e.attributes.name)==="yandex-verification"||Ne(e.attributes.name)==="csrf-token"||Ne(e.attributes.name)==="p:domain_verify"||Ne(e.attributes.name)==="verify-v1"||Ne(e.attributes.name)==="verification"||Ne(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Wi(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,skipChild:m=!1,inlineStylesheet:d=!0,maskInputOptions:_={},maskAttributeFn:h,maskTextFn:S,maskInputFn:T,slimDOMOptions:b,dataURLOptions:k={},inlineImages:R=!1,recordCanvas:U=!1,onSerialize:D,onIframeLoad:y,iframeLoadTimeout:O=5e3,onBlockedImageLoad:Y,onStylesheetLoad:N,stylesheetLoadTimeout:B=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:F=!1,ignoreCSSAttributes:j}=t,{preserveWhiteSpace:ae=!0}=t,ue=lk(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,inlineStylesheet:d,maskInputOptions:_,maskAttributeFn:h,maskTextFn:S,maskInputFn:T,dataURLOptions:k,inlineImages:R,recordCanvas:U,keepIframeSrcFn:M,newlyAddedElement:F,ignoreCSSAttributes:j});if(!ue)return console.warn(e,"not serialized"),null;let z;r.hasNode(e)?z=r.getId(e):mk(ue,b)||!ae&&ue.type===Ye.Text&&!ue.isStyle&&!ue.textContent.trim().length?z=Sa:z=Ld();let L=Object.assign(ue,{id:z});if(r.add(e,L),z===Sa)return null;D&&D(e);let q=!m;if(L.type===Ye.Element){q=q&&!L.needBlock;let H=e.shadowRoot;H&&_a(H)&&(L.isShadowHost=!0)}if((L.type===Ye.Document||L.type===Ye.Element)&&q){b.headWhitespace&&L.type===Ye.Element&&L.tagName==="head"&&(ae=!1);let H={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,skipChild:m,inlineStylesheet:d,maskInputOptions:_,maskAttributeFn:h,maskTextFn:S,maskInputFn:T,slimDOMOptions:b,dataURLOptions:k,inlineImages:R,recordCanvas:U,preserveWhiteSpace:ae,onSerialize:D,onIframeLoad:y,iframeLoadTimeout:O,onBlockedImageLoad:Y,onStylesheetLoad:N,stylesheetLoadTimeout:B,keepIframeSrcFn:M,ignoreCSSAttributes:j},ce=e.childNodes?Array.from(e.childNodes):[];for(let le of ce){let Ee=Wi(le,H);Ee&&L.childNodes.push(Ee)}if(D0(e)&&e.shadowRoot)for(let le of Array.from(e.shadowRoot.childNodes)){let Ee=Wi(le,H);Ee&&(_a(e.shadowRoot)&&(Ee.isShadow=!0),L.childNodes.push(Ee))}}if(e.parentNode&&ma(e.parentNode)&&_a(e.parentNode)&&(L.isShadow=!0),L.type===Ye.Element&&L.tagName==="iframe"&&!L.needBlock&&ck(e,()=>{let H=LT(e);if(H&&y){let ce=Wi(H,{doc:H,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:_,maskAttributeFn:h,maskTextFn:S,maskInputFn:T,slimDOMOptions:b,dataURLOptions:k,inlineImages:R,recordCanvas:U,preserveWhiteSpace:ae,onSerialize:D,onIframeLoad:y,iframeLoadTimeout:O,onStylesheetLoad:N,stylesheetLoadTimeout:B,keepIframeSrcFn:M,ignoreCSSAttributes:j});ce&&y(e,ce)}},O),L.type===Ye.Element&&L.tagName==="img"&&!e.complete&&L.needBlock){let H=e,ce=()=>{if(H.isConnected&&!H.complete&&Y)try{let le=H.getBoundingClientRect();le.width>0&&le.height>0&&Y(H,L,le)}catch{}H.removeEventListener("load",ce)};H.isConnected&&H.addEventListener("load",ce)}return L.type===Ye.Element&&L.tagName==="link"&&typeof L.attributes.rel=="string"&&(L.attributes.rel==="stylesheet"||L.attributes.rel==="preload"&&typeof L.attributes.href=="string"&&kT(L.attributes.href)==="css")&&uk(e,()=>{if(N){let H=Wi(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:_,maskAttributeFn:h,maskTextFn:S,maskInputFn:T,slimDOMOptions:b,dataURLOptions:k,inlineImages:R,recordCanvas:U,preserveWhiteSpace:ae,onSerialize:D,onIframeLoad:y,iframeLoadTimeout:O,onStylesheetLoad:N,stylesheetLoadTimeout:B,keepIframeSrcFn:M,ignoreCSSAttributes:j});H&&N(e,H)}},B),L.type===Ye.Element&&delete L.needBlock,L}function _k(e,t){let{mirror:n=new $u,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:i=null,maskAllText:s=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:f=null,inlineStylesheet:l=!0,inlineImages:m=!1,recordCanvas:d=!1,maskAllInputs:_=!1,maskAttributeFn:h,maskTextFn:S,maskInputFn:T,slimDOM:b=!1,dataURLOptions:k,preserveWhiteSpace:R,onSerialize:U,onIframeLoad:D,iframeLoadTimeout:y,onBlockedImageLoad:O,onStylesheetLoad:Y,stylesheetLoadTimeout:N,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:M=new Set([])}=t||{};return Wi(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:s,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:l,maskInputOptions:_===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:_===!1?{}:_,maskAttributeFn:h,maskTextFn:S,maskInputFn:T,slimDOMOptions:b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:b==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:b===!1?{}:b,dataURLOptions:k,inlineImages:m,recordCanvas:d,preserveWhiteSpace:R,onSerialize:U,onIframeLoad:D,iframeLoadTimeout:y,onBlockedImageLoad:O,onStylesheetLoad:Y,stylesheetLoadTimeout:N,keepIframeSrcFn:B,newlyAddedElement:!1,ignoreCSSAttributes:M})}function Et(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Fi=`Please stop import mirror directly. Instead of that,\r
|
|
495
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
496
|
+
or you can use record.mirror to access the mirror instance during recording.`,fT={map:{},getId(){return console.error(Fi),-1},getNode(){return console.error(Fi),null},removeNodeFromMap(){console.error(Fi)},has(){return console.error(Fi),!1},reset(){console.error(Fi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(fT=new Proxy(fT,{get(e,t,n){return t==="map"&&console.error(Fi),Reflect.get(e,t,n)}}));function Ea(e,t,n={}){let r=null,o=0;return function(...i){let s=Date.now();!o&&n.leading===!1&&(o=s);let a=t-(s-o),c=this;a<=0||a>t?(r&&(yk(r),r=null),o=s,e.apply(c,i)):!r&&n.trailing!==!1&&(r=ol(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},a))}}function DT(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){ol(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>DT(e,t,i||{},!0)}function Pd(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var zu=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(zu=()=>new Date().getTime());function BT(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function FT(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function HT(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function GT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function $t(e,t,n,r,o){if(!e)return!1;let i=GT(e);if(!i)return!1;let s=$i(t,n);if(!o){let u=r&&i.matches(r);return s(i)&&!u}let a=Mo(i,s),c=-1;return a<0?!1:(r&&(c=Mo(i,$i(null,r))),a>-1&&c<0?!0:a<c)}function gk(e,t){return t.getId(e)!==-1}function td(e,t){return t.getId(e)===Sa}function $T(e,t){if(ma(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?$T(e.parentNode,t):!0:!0}function cd(e){return!!e.changedTouches}function hk(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function WT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function jT(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ud(e){return!!e?.shadowRoot}var ld=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function zT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Sk(e){let t=e,n;for(;n=zT(t);)t=n;return t}function Ek(e){let t=e.ownerDocument;if(!t)return!1;let n=Sk(e);return t.contains(n)}function qT(e){let t=e.ownerDocument;return t?t.contains(e)||Ek(e):!1}var pT={};function Ud(e){let t=pT[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return pT[e]=r.bind(window)}function Tk(...e){return Ud("requestAnimationFrame")(...e)}function ol(...e){return Ud("setTimeout")(...e)}function yk(...e){return Ud("clearTimeout")(...e)}var ie=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ie||{}),X=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(X||{}),St=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(St||{}),ur=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ur||{}),Hi=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Hi||{}),ga;function Ik(e){ga=e}function bk(){ga=void 0}var fe=e=>ga?(...n)=>{try{return e(...n)}catch(r){if(ga&&ga(r)===!0)return()=>{};throw r}}:e,dT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ak=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(pa=0;pa<dT.length;pa++)Ak[dT.charCodeAt(pa)]=pa;var pa,qu=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function Dd(e){try{return e.contentDocument}catch{}}function Ta(e){try{return e.contentWindow}catch{}}var fd=class{constructor(t){this.doc=t,this.unattachedDoc=null}parse(t){return this.parseWithConstructableStylesheet(t)||this.parseWithDetachedElement(t)}parseWithConstructableStylesheet(t){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{let n=new CSSStyleSheet;n.replaceSync(`x { ${t} }`);let r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(t){let n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",t),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function mT(e){return"__ln"in e}var pd=class{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&mT(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&mT(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},_T=(e,t)=>`${e}@${t}`,dd=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new pd,o=c=>{let u=c,f=Sa;for(;f===Sa;)u=u&&u.nextSibling,f=u&&this.mirror.getId(u);return f},i=c=>{if(!c.parentNode||!qT(c))return;let u=ma(c.parentNode)?this.mirror.getId(zT(c)):this.mirror.getId(c.parentNode),f=o(c);if(u===-1||f===-1)return r.addNode(c);let l=Wi(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{WT(m,this.mirror)&&!$t(m,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(m),jT(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),ud(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(m,d)=>{if($t(m,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(m,d);let _=Ta(m);_&&this.canvasManager.addWindow(_),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},onBlockedImageLoad:(m,d,{width:_,height:h})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:d.id,attributes:{style:{width:`${_}px`,height:`${h}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:f,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let c of this.movedSet)gT(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||i(c);for(let c of this.addedSet)!hT(this.droppedSet,c)&&!gT(this.removes,c,this.mirror)||hT(this.movedSet,c)?i(c):this.droppedSet.add(c);let s=null;for(;r.length;){let c=null;if(s){let u=this.mirror.getId(s.value.parentNode),f=o(s.value);u!==-1&&f!==-1&&(c=s)}if(!c){let u=r.tail;for(;u;){let f=u;if(u=u.previous,f){let l=this.mirror.getId(f.value.parentNode);if(o(f.value)===-1)continue;if(l!==-1){c=f;break}else{let d=f.value;if(d.parentNode&&d.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let _=d.parentNode.host;if(this.mirror.getId(_)!==-1){c=f;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}s=c.previous,r.removeNode(c.value),i(c.value)}let a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{let{attributes:u}=c;if(typeof u.style=="string"){let f=JSON.stringify(c.styleDiff),l=JSON.stringify(c._unchangedStyles);f.length<u.style.length&&(f+l).split("var(").length===u.style.split("var(").length&&(u.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:u}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!td(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!$t(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:qi(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,GT(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){let s=Md(n),a=n.tagName;o=Wu(n,a,s);let c=nl({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),u=qi(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);o=ha({isMasked:u,element:n,value:o,maskInputFn:this.maskInputFn})}if($t(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!Dd(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!UT(n.tagName,r)&&(i.attributes[r]=PT(this.doc,zi(n.tagName),zi(r),o,n,this.maskAttributeFn),r==="style")){let s=t.oldValue?this.styleDeclarationParser.parse(t.oldValue):null;for(let a of Array.from(n.style)){let c=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);c!==(s?.getPropertyValue(a)||"")||u!==(s?.getPropertyPriority(a)||"")?u===""?i.styleDiff[a]=c:i.styleDiff[a]=[c,u]:i._unchangedStyles[a]=[c,u]}if(s)for(let a of Array.from(s))n.style.getPropertyValue(a)===""&&(i.styleDiff[a]=!1)}break}case"childList":{if($t(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=ma(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);$t(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||td(n,this.mirror)||!gk(n,this.mirror)||(this.addedSet.has(n)?(md(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||$T(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[_T(r,o)]?md(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ma(t.target)&&_a(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(td(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[_T(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);$t(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),ud(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]}),this.styleDeclarationParser=new fd(this.doc)}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function md(e,t){e.delete(t),t.childNodes?.forEach(n=>md(e,n))}function gT(e,t,n){return e.length===0?!1:vk(e,t,n)}function vk(e,t,n){let r=t.parentNode;for(;r;){let o=n.getId(r);if(e.some(i=>i.id===o))return!0;r=r.parentNode}return!1}function hT(e,t){return e.size===0?!1:YT(e,t)}function YT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:YT(e,n):!1}var ji=[];function va(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function VT(e,t){let n=new dd;ji.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);let i=new r(fe(s=>{e.onMutation&&e.onMutation(s)===!1||n.processMutations.bind(n)(s)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Rk({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,c=Ea(fe(l=>{let m=Date.now()-a;e(s.map(d=>(d.timeOffset-=m,d)),l),s=[],a=null}),i),u=fe(Ea(fe(l=>{let m=va(l),{clientX:d,clientY:_}=cd(l)?l.changedTouches[0]:l;a||(a=zu()),s.push({x:d,y:_,id:r.getId(m),timeOffset:zu()-a}),c(typeof DragEvent<"u"&&l instanceof DragEvent?X.Drag:l instanceof MouseEvent?X.MouseMove:X.TouchMove)}),o,{trailing:!1})),f=[Et("mousemove",u,n),Et("touchmove",u,n),Et("drag",u,n)];return fe(()=>{f.forEach(l=>l())})}function Nk({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){if(s.mouseInteraction===!1)return()=>{};let a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,c=[],u=null,f=l=>m=>{let d=va(m);if($t(d,r,o,i,!0))return;let _=null,h=l;if("pointerType"in m){switch(m.pointerType){case"mouse":_=ur.Mouse;break;case"touch":_=ur.Touch;break;case"pen":_=ur.Pen;break}_===ur.Touch?St[l]===St.MouseDown?h="TouchStart":St[l]===St.MouseUp&&(h="TouchEnd"):ur.Pen}else cd(m)&&(_=ur.Touch);_!==null?(u=_,(h.startsWith("Touch")&&_===ur.Touch||h.startsWith("Mouse")&&_===ur.Mouse)&&(_=null)):St[l]===St.Click&&(_=u,u=null);let S=cd(m)?m.changedTouches[0]:m;if(!S)return;let T=n.getId(d),{clientX:b,clientY:k}=S;fe(e)(p({type:St[h],id:T,x:b,y:k},_!==null&&{pointerType:_}))};return Object.keys(St).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let m=zi(l),d=f(l);if(window.PointerEvent)switch(St[l]){case St.MouseDown:case St.MouseUp:m=m.replace("mouse","pointer");break;case St.TouchStart:case St.TouchEnd:return}c.push(Et(m,d,t))}),fe(()=>{c.forEach(l=>l())})}function KT({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=fe(Ea(fe(c=>{let u=va(c);if(!u||$t(u,r,o,i,!0))return;let f=n.getId(u);if(u===t&&t.defaultView){let l=BT(t.defaultView);e({id:f,x:l.left,y:l.top})}else e({id:f,x:u.scrollLeft,y:u.scrollTop})}),s.scroll||100));return Et("scroll",a,t)}function Ck({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=fe(Ea(fe(()=>{let i=FT(),s=HT();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return Et("resize",o,t)}var xk=["INPUT","TEXTAREA","SELECT"],ST=new WeakMap;function wk({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:f,userTriggeredOnInput:l,maskTextClass:m,unmaskTextClass:d,maskTextSelector:_,unmaskTextSelector:h}){function S(y){let O=va(y),Y=y.isTrusted,N=O&&sd(O.tagName);if(N==="OPTION"&&(O=O.parentElement),!O||!N||xk.indexOf(N)<0||$t(O,r,o,i,!0))return;let B=O;if(B.classList.contains(s)||a&&B.matches(a))return;let M=Md(O),F=Wu(B,N,M),j=!1,ae=nl({maskInputOptions:c,tagName:N,type:M}),ue=qi(O,m,_,d,h,ae);(M==="radio"||M==="checkbox")&&(j=O.checked),F=ha({isMasked:ue,element:O,value:F,maskInputFn:u}),T(O,l?{text:F,isChecked:j,userTriggered:Y}:{text:F,isChecked:j});let z=O.name;M==="radio"&&z&&j&&t.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(L=>{if(L!==O){let q=ha({isMasked:ue,element:L,value:Wu(L,N,M),maskInputFn:u});T(L,l?{text:q,isChecked:!j,userTriggered:!1}:{text:q,isChecked:!j})}})}function T(y,O){let Y=ST.get(y);if(!Y||Y.text!==O.text||Y.isChecked!==O.isChecked){ST.set(y,O);let N=n.getId(y);fe(e)(E(p({},O),{id:N}))}}let k=(f.input==="last"?["change"]:["input","change"]).map(y=>Et(y,fe(S),t)),R=t.defaultView;if(!R)return()=>{k.forEach(y=>y())};let U=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value"),D=[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]];return U&&U.set&&k.push(...D.map(y=>DT(y[0],y[1],{set(){fe(S)({target:this,isTrusted:!1})}},!1,R))),fe(()=>{k.forEach(y=>y())})}function Yu(e){let t=[];function n(r,o){if(Du("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Du("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Du("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Du("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function Dr(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function kk({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:fe((f,l,m)=>{let[d,_]=m,{id:h,styleId:S}=Dr(l,t,n.styleMirror);return(h&&h!==-1||S&&S!==-1)&&e({id:h,styleId:S,adds:[{rule:d,index:_}]}),f.apply(l,m)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:fe((f,l,m)=>{let[d]=m,{id:_,styleId:h}=Dr(l,t,n.styleMirror);return(_&&_!==-1||h&&h!==-1)&&e({id:_,styleId:h,removes:[{index:d}]}),f.apply(l,m)})});let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:fe((f,l,m)=>{let[d]=m,{id:_,styleId:h}=Dr(l,t,n.styleMirror);return(_&&_!==-1||h&&h!==-1)&&e({id:_,styleId:h,replace:d}),f.apply(l,m)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:fe((f,l,m)=>{let[d]=m,{id:_,styleId:h}=Dr(l,t,n.styleMirror);return(_&&_!==-1||h&&h!==-1)&&e({id:_,styleId:h,replaceSync:d}),f.apply(l,m)})}));let c={};Bu("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Bu("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Bu("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Bu("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(c).forEach(([f,l])=>{u[f]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[f].insertRule,{apply:fe((m,d,_)=>{let[h,S]=_,{id:T,styleId:b}=Dr(d.parentStyleSheet,t,n.styleMirror);return(T&&T!==-1||b&&b!==-1)&&e({id:T,styleId:b,adds:[{rule:h,index:[...Yu(d),S||0]}]}),m.apply(d,_)})}),l.prototype.deleteRule=new Proxy(u[f].deleteRule,{apply:fe((m,d,_)=>{let[h]=_,{id:S,styleId:T}=Dr(d.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||T&&T!==-1)&&e({id:S,styleId:T,removes:[{index:[...Yu(d),h]}]}),m.apply(d,_)})})}),fe(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([f,l])=>{l.prototype.insertRule=u[f].insertRule,l.prototype.deleteRule=u[f].deleteRule})})}function JT({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);let o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(s){let a=i.set?.call(this,s);if(r!==null&&r!==-1)try{t.adoptStyleSheets(s,r)}catch{}return a}}),fe(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Ok({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:fe((a,c,u)=>{let[f,l,m]=u;if(n.has(f))return i.apply(c,[f,l,m]);let{id:d,styleId:_}=Dr(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||_&&_!==-1)&&e({id:d,styleId:_,set:{property:f,value:l,priority:m},index:Yu(c.parentRule)}),a.apply(c,u)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:fe((a,c,u)=>{let[f]=u;if(n.has(f))return s.apply(c,[f]);let{id:l,styleId:m}=Dr(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||m&&m!==-1)&&e({id:l,styleId:m,remove:{property:f},index:Yu(c.parentRule)}),a.apply(c,u)})}),fe(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function Mk({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:s}){let a=fe(u=>Ea(fe(f=>{let l=va(f);if(!l||$t(l,t,n,r,!0))return;let{currentTime:m,volume:d,muted:_,playbackRate:h}=l;e({type:u,id:o.getId(l),currentTime:m,volume:d,muted:_,playbackRate:h})}),i.media||500)),c=[Et("play",a(Hi.Play),s),Et("pause",a(Hi.Pause),s),Et("seeked",a(Hi.Seeked),s),Et("volumechange",a(Hi.VolumeChange),s),Et("ratechange",a(Hi.RateChange),s)];return fe(()=>{c.forEach(u=>u())})}function Lk({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(c,u,f){let l=new i(c,u,f);return o.set(l,{family:c,buffer:typeof u!="string",descriptors:f,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};let s=Pd(t.fonts,"add",function(a){return function(c){return ol(fe(()=>{let u=o.get(c);u&&(e(u),o.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(s),fe(()=>{r.forEach(a=>a())})}function Pk(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,c=fe(()=>{let u=t.getSelection();if(!u||a&&u?.isCollapsed)return;a=u.isCollapsed||!1;let f=[],l=u.rangeCount||0;for(let m=0;m<l;m++){let d=u.getRangeAt(m),{startContainer:_,startOffset:h,endContainer:S,endOffset:T}=d;$t(_,r,o,i,!0)||$t(S,r,o,i,!0)||f.push({start:n.getId(_),startOffset:h,end:n.getId(S),endOffset:T})}s({ranges:f})});return c(),Et("selectionchange",c)}function Uk({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Pd(n.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{}return o.apply(this,[i,s,a])}})}function Dk(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=VT(e,e.doc));let o=Rk(e),i=Nk(e),s=KT(e),a=Ck(e,{win:n}),c=wk(e),u=Mk(e),f=()=>{},l=()=>{},m=()=>{},d=()=>{};e.recordDOM&&(f=kk(e,{win:n}),l=JT(e,e.doc),m=Ok(e,{win:n}),e.collectFonts&&(d=Lk(e)));let _=Pk(e),h=Uk(e),S=[];for(let T of e.plugins)S.push(T.observer(T.callback,n,T.options));return fe(()=>{ji.forEach(T=>T.reset()),r?.disconnect(),o(),i(),s(),a(),c(),u(),f(),l(),m(),d(),_(),h(),S.forEach(T=>T())})}function Du(e){return typeof window[e]<"u"}function Bu(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ya=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(n);return a||(a=this.generateIdFn(),i.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}},_d=class{constructor(){this.crossOriginIframeMirror=new ya(Ld),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},gd=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ya(Ld),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ya(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0);let n=Ta(t);n&&this.crossOriginIframeMap.set(n,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&Ta(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=Dd(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){let n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case ie.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:ie.IncrementalSnapshot,data:{source:X.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ie.Meta:case ie.Load:case ie.DomContentLoaded:return!1;case ie.Plugin:return n;case ie.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case ie.IncrementalSnapshot:switch(n.data.source){case X.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case X.Drag:case X.TouchMove:case X.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case X.ViewportResize:return!1;case X.MediaInteraction:case X.MouseInteraction:case X.Scroll:case X.CanvasMutation:case X.Input:return this.replaceIds(n.data,t,["id"]),n;case X.StyleSheetRule:case X.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case X.Font:return n;case X.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case X.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==Ye.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},hd=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Sd=class{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!_a(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=VT(E(p({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(KT(E(p({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),ol(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(JT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=Dd(t),r=Ta(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(Pd(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&qT(this)&&r.addShadowRoot(this.shadowRoot,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},Ed=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new ld,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,c)=>({rule:wT(a),index:c}))})),r.styleIds.push(s)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Td=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,Tk(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},He,Vu;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var In=j0();function bn(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,unblockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:f="rr-mask",unmaskTextClass:l=null,maskTextSelector:m=null,unmaskTextSelector:d=null,inlineStylesheet:_=!0,maskAllInputs:h,maskInputOptions:S,slimDOMOptions:T,maskAttributeFn:b,maskInputFn:k,maskTextFn:R,maxCanvasSize:U=null,packFn:D,sampling:y={},dataURLOptions:O={},mousemoveWait:Y,recordDOM:N=!0,recordCanvas:B=!1,recordCrossOriginIframes:M=!1,recordAfter:F=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:j=!1,collectFonts:ae=!1,inlineImages:ue=!1,plugins:z,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:q=new Set([]),errorHandler:H,onMutation:ce,getCanvasManager:le}=e;Ik(H);let Ee=M?window.parent===window:!0,ke=!1;if(!Ee)try{window.parent.document&&(ke=!1)}catch{ke=!0}if(Ee&&!t)throw new Error("emit function is required");if(!Ee&&!ke)return()=>{};Y!==void 0&&y.mousemove===void 0&&(y.mousemove=Y),In.reset();let Wt=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:S!==void 0?S:{},sn=T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:T==="all",headMetaDescKeywords:T==="all"}:T||{};hk();let lr,Hr=0,wa=W=>{for(let de of z||[])de.eventProcessor&&(W=de.eventProcessor(W));return D&&!ke&&(W=D(W)),W};He=(W,de)=>{let ee=W;if(ee.timestamp=zu(),ji[0]?.isFrozen()&&ee.type!==ie.FullSnapshot&&!(ee.type===ie.IncrementalSnapshot&&ee.data.source===X.Mutation)&&ji.forEach(me=>me.unfreeze()),Ee)t?.(wa(ee),de);else if(ke){let me={type:"rrweb",event:wa(ee),origin:window.location.origin,isCheckout:de};window.parent.postMessage(me,"*")}if(ee.type===ie.FullSnapshot)lr=ee,Hr=0;else if(ee.type===ie.IncrementalSnapshot){if(ee.data.source===X.Mutation&&ee.data.isAttachIframe)return;Hr++;let me=r&&Hr>=r,Q=n&&lr&&ee.timestamp-lr.timestamp>n;(me||Q)&&Wr(!0)}};let Gr=W=>{He({type:ie.IncrementalSnapshot,data:p({source:X.Mutation},W)})},ka=W=>He({type:ie.IncrementalSnapshot,data:p({source:X.Scroll},W)}),Wn=W=>He({type:ie.IncrementalSnapshot,data:p({source:X.CanvasMutation},W)}),jt=W=>He({type:ie.IncrementalSnapshot,data:p({source:X.AdoptedStyleSheet},W)}),Tt=new Ed({mutationCb:Gr,adoptedStyleSheetCb:jt}),Mt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new _d:new gd({mirror:In,mutationCb:Gr,stylesheetManager:Tt,recordCrossOriginIframes:M,wrappedEmit:He});for(let W of z||[])W.getMirror&&W.getMirror({nodeMirror:In,crossOriginIframeMirror:Mt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Mt.crossOriginIframeStyleMirror});let Bo=new Td,Fo=Fk(le,{mirror:In,win:window,mutationCb:W=>He({type:ie.IncrementalSnapshot,data:p({source:X.CanvasMutation},W)}),recordCanvas:B,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:U,sampling:y.canvas,dataURLOptions:O,errorHandler:H}),$r=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new hd:new Sd({mutationCb:Gr,scrollCb:ka,bypassOptions:{onMutation:ce,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:u,maskTextClass:f,unmaskTextClass:l,maskTextSelector:m,unmaskTextSelector:d,inlineStylesheet:_,maskInputOptions:Wt,dataURLOptions:O,maskAttributeFn:b,maskTextFn:R,maskInputFn:k,recordCanvas:B,inlineImages:ue,sampling:y,slimDOMOptions:sn,iframeManager:Mt,stylesheetManager:Tt,canvasManager:Fo,keepIframeSrcFn:L,processedNodeManager:Bo,ignoreCSSAttributes:q},mirror:In}),Wr=(W=!1)=>{if(!N)return;He({type:ie.Meta,data:{href:window.location.href,width:HT(),height:FT()}},W),Tt.reset(),$r.init(),ji.forEach(ee=>ee.lock());let de=_k(document,{mirror:In,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:u,maskTextClass:f,unmaskTextClass:l,maskTextSelector:m,unmaskTextSelector:d,inlineStylesheet:_,maskAllInputs:Wt,maskAttributeFn:b,maskInputFn:k,maskTextFn:R,slimDOM:sn,dataURLOptions:O,recordCanvas:B,inlineImages:ue,onSerialize:ee=>{WT(ee,In)&&Mt.addIframe(ee),jT(ee,In)&&Tt.trackLinkElement(ee),ud(ee)&&$r.addShadowRoot(ee.shadowRoot,document)},onIframeLoad:(ee,me)=>{Mt.attachIframe(ee,me);let Q=Ta(ee);Q&&Fo.addWindow(Q),$r.observeAttachShadow(ee)},onStylesheetLoad:(ee,me)=>{Tt.attachLinkElement(ee,me)},onBlockedImageLoad:(ee,me,{width:Q,height:vn})=>{Gr({adds:[],removes:[],texts:[],attributes:[{id:me.id,attributes:{style:{width:`${Q}px`,height:`${vn}px`}}}]})},keepIframeSrcFn:L,ignoreCSSAttributes:q});if(!de)return console.warn("Failed to snapshot the document");He({type:ie.FullSnapshot,data:{node:de,initialOffset:BT(window)}}),ji.forEach(ee=>ee.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Tt.adoptStyleSheets(document.adoptedStyleSheets,In.getId(document))};Vu=Wr;try{let W=[],de=me=>fe(Dk)({onMutation:ce,mutationCb:Gr,mousemoveCb:(Q,vn)=>He({type:ie.IncrementalSnapshot,data:{source:vn,positions:Q}}),mouseInteractionCb:Q=>He({type:ie.IncrementalSnapshot,data:p({source:X.MouseInteraction},Q)}),scrollCb:ka,viewportResizeCb:Q=>He({type:ie.IncrementalSnapshot,data:p({source:X.ViewportResize},Q)}),inputCb:Q=>He({type:ie.IncrementalSnapshot,data:p({source:X.Input},Q)}),mediaInteractionCb:Q=>He({type:ie.IncrementalSnapshot,data:p({source:X.MediaInteraction},Q)}),styleSheetRuleCb:Q=>He({type:ie.IncrementalSnapshot,data:p({source:X.StyleSheetRule},Q)}),styleDeclarationCb:Q=>He({type:ie.IncrementalSnapshot,data:p({source:X.StyleDeclaration},Q)}),canvasMutationCb:Wn,fontCb:Q=>He({type:ie.IncrementalSnapshot,data:p({source:X.Font},Q)}),selectionCb:Q=>{He({type:ie.IncrementalSnapshot,data:p({source:X.Selection},Q)})},customElementCb:Q=>{He({type:ie.IncrementalSnapshot,data:p({source:X.CustomElement},Q)})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:f,unmaskTextClass:l,maskTextSelector:m,unmaskTextSelector:d,maskInputOptions:Wt,inlineStylesheet:_,sampling:y,recordDOM:N,recordCanvas:B,inlineImages:ue,userTriggeredOnInput:j,collectFonts:ae,doc:me,maskAttributeFn:b,maskInputFn:k,maskTextFn:R,keepIframeSrcFn:L,blockSelector:i,unblockSelector:s,slimDOMOptions:sn,dataURLOptions:O,mirror:In,iframeManager:Mt,stylesheetManager:Tt,shadowDomManager:$r,processedNodeManager:Bo,canvasManager:Fo,ignoreCSSAttributes:q,plugins:z?.filter(Q=>Q.observer)?.map(Q=>({observer:Q.observer,options:Q.options,callback:vn=>He({type:ie.Plugin,data:{plugin:Q.name,payload:vn}})}))||[]},{});Mt.addLoadListener(me=>{try{W.push(de(me.contentDocument))}catch(Q){console.warn(Q)}});let ee=()=>{Wr(),W.push(de(document))};return document.readyState==="interactive"||document.readyState==="complete"?ee():(W.push(Et("DOMContentLoaded",()=>{He({type:ie.DomContentLoaded,data:{}}),F==="DOMContentLoaded"&&ee()})),W.push(Et("load",()=>{He({type:ie.Load,data:{}}),F==="load"&&ee()},window))),()=>{W.forEach(me=>me()),Bo.destroy(),Vu=void 0,bk()}}catch(W){console.warn(W)}}function Bk(e){if(!Vu)throw new Error("please take full snapshot after start recording");Vu(e)}bn.mirror=In;bn.takeFullSnapshot=Bk;function Fk(e,t){try{return e?e(t):new qu}catch{return console.warn("Unable to initialize CanvasManager"),new qu}}var ET;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ET||(ET={}));var Hk=3,Gk=5;function Bd(e){return e>9999999999?e:e*1e3}function nd(e){return e>9999999999?e/1e3:e}function Ra(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:ie.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Se(t,10,1e3)}}),t.category==="console")))}var $k="button,a";function XT(e){return e.closest($k)||e}function QT(e){let t=ZT(e);return!t||!(t instanceof Element)?t:XT(t)}function ZT(e){return Wk(e)?e.target:e}function Wk(e){return typeof e=="object"&&!!e&&"target"in e}var Br;function jk(e){return Br||(Br=[],zk()),Br.push(e),()=>{let t=Br?Br.indexOf(e):-1;t>-1&&Br.splice(t,1)}}function zk(){ye(Ce,"open",function(e){return function(...t){if(Br)try{Br.forEach(n=>n())}catch{}return e.apply(Ce,t)}})}var qk=new Set([X.Mutation,X.StyleSheetRule,X.StyleDeclaration,X.AdoptedStyleSheet,X.CanvasMutation,X.Selection,X.MediaInteraction]);function Yk(e,t,n){e.handleClick(t,n)}var yd=class{constructor(t,n,r=Ra){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){let t=jk(()=>{this._lastMutation=TT()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(Kk(n,this._ignoreSelector)||!Jk(t))return;let r={timestamp:nd(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=nd(t)}registerScroll(t=Date.now()){this._lastScroll=nd(t)}registerClick(t){let n=XT(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){let t=[],n=TT();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(let r of t){let o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){let n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!o,{clickCount:s,clickBreadcrumb:a}=t;if(i){let c=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=c<this._timeout*1e3?"mutation":"timeout",f={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:E(p({},a.data),{url:Ce.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:s||1})};this._addBreadcrumbEvent(n,f);return}if(s>1){let c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:E(p({},a.data),{url:Ce.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0})};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=wo(()=>this._checkClicks(),1e3)}},Vk=["A","BUTTON","INPUT"];function Kk(e,t){return!!(!Vk.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function Jk(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function TT(){return Date.now()/1e3}function Xk(e,t){try{if(!Qk(t))return;let{source:n}=t.data;if(qk.has(n)&&e.registerMutation(t.timestamp),n===X.Scroll&&e.registerScroll(t.timestamp),Zk(t)){let{type:r,id:o}=t.data,i=bn.mirror.getNode(o);i instanceof HTMLElement&&r===St.Click&&e.registerClick(i)}}catch{}}function Qk(e){return e.type===Hk}function Zk(e){return e.data.source===X.MouseInteraction}function $n(e){return p({timestamp:Date.now()/1e3,type:"default"},e)}var il=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(il||{}),eO=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function tO(e){let t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(let n in e)if(eO.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var nO=e=>t=>{if(!e.isEnabled())return;let n=rO(t);if(!n)return;let r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&Yk(e.clickDetector,n,QT(t.event)),Ra(e,n)};function ey(e,t){let n=bn.mirror.getId(e),r=n&&bn.mirror.getNode(n),o=r&&bn.mirror.getMeta(r),i=o&&iO(o)?o:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(s=>s.type===il.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:tO(i.attributes)}}:{}}}function rO(e){let{target:t,message:n}=oO(e);return $n(p({category:`ui.${e.name}`},ey(t,n)))}function oO(e){let t=e.name==="click",n,r=null;try{r=t?QT(e.event):ZT(e.event),n=Te(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function iO(e){return e.type===il.Element}function sO(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=aO(t);n&&Ra(e,n)}function aO(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||cO(s)||!i)return null;let a=t||r||o,c=i.length===1;if(!a&&c)return null;let u=Te(s,{maxStringLength:200})||"<unknown>",f=ey(s,u);return $n({category:"ui.keyDown",message:u,data:E(p({},f.data),{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i})})}function cO(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var uO={resource:mO,paint:pO,navigation:dO};function rd(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function lO(e){return e.map(fO).filter(Boolean)}function fO(e){let t=uO[e.entryType];return t?t(e):null}function Yi(e){return((pe()||Ce.performance.timeOrigin)+e)/1e3}function pO(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=Yi(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function dO(e){let{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:f,loadEventEnd:l,redirectCount:m,startTime:d,transferSize:_,type:h}=e;return o===0?null:{type:`${t}.${h}`,start:Yi(d),end:Yi(i),name:n,data:{size:_,decodedBodySize:r,encodedBodySize:s,duration:o,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:f,loadEventEnd:l,domComplete:i,redirectCount:m}}}function mO(e){let{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:i,decodedBodySize:s,encodedBodySize:a,responseStatus:c,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Yi(i),end:Yi(o),name:r,data:{size:u,statusCode:c,decodedBodySize:s,encodedBodySize:a}}}function _O(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return Fd(e,"largest-contentful-paint",n)}function gO(e){return e.sources!==void 0}function hO(e){let t=[],n=[];for(let r of e.entries)if(gO(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=bn.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return Fd(e,"cumulative-layout-shift",n,t)}function SO(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return Fd(e,"interaction-to-next-paint",n)}function Fd(e,t,n,r){let o=e.value,i=e.rating,s=Yi(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>bn.mirror.getId(a)):void 0,attributions:r}}}function EO(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}let r=[];return["navigation","paint","resource"].forEach(o=>{r.push(wt(o,n))}),r.push(sr(rd(_O,e)),ir(rd(hO,e)),vo(rd(SO,e))),()=>{r.forEach(o=>o())}}var V=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,TO='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function yO(){let e=new Blob([TO]);return URL.createObjectURL(e)}var yT=["log","warn","error"],Hu="[Replay] ";function od(e,t="info"){gt({category:"console",data:{logger:"replay"},level:t,message:`${Hu}${e}`},{level:t})}function IO(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return V?(yT.forEach(r=>{n[r]=(...o)=>{g[r](Hu,...o),t&&od(o.join(""),tr(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),g.error(Hu,r),e?J(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&od(r,"error")},n.infoTick=(...r)=>{g.log(Hu,...r),t&&setTimeout(()=>od(r[0]),0)}):yT.forEach(r=>{n[r]=()=>{}}),n}var K=IO(),Ia=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Od}.`)}},Ku=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){let n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>Od)throw new Ia;this.events.push(t)}finish(){return new Promise(t=>{let n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(let{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:Bd(t)}},Id=class{constructor(t){this._onMessage=({data:n})=>{let r=n;if(typeof r.id!="number")return;let o=this._pending.get(r.id);if(!(!o||o.method!==r.method)){if(this._pending.delete(r.id),!r.success){V&&K.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():(V&&K.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{V&&K.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){V&&K.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(t,n){let r=this._getAndIncrementId();return new Promise((o,i)=>{this._pending.set(r,{method:t,resolve:o,reject:i});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(s){this._pending.delete(r),i(s)}})}_getAndIncrementId(){return this._id++}},bd=class{constructor(t){this._worker=new Id(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){let n=Bd(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Od?Promise.reject(new Ia):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{V&&K.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){let t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}},Ad=class{constructor(t){this._fallback=new Ku,this._compression=new bd(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){V&&K.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(let i of t)o.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(i){V&&K.exception(i,"Failed to add events when switching buffers.")}}};function bO({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=AO(t);if(n)return n}return V&&K.log("Using simple buffer"),new Ku}function AO(e){try{let t=e||vO();if(!t)return;V&&K.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new Ad(n)}catch(t){V&&K.exception(t,"Failed to create compression worker")}}function vO(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?yO():""}function Hd(){try{return"sessionStorage"in Ce&&!!Ce.sessionStorage}catch{return!1}}function RO(e){NO(),e.session=void 0}function NO(){if(Hd())try{Ce.sessionStorage.removeItem(wd)}catch{}}function ty(e){return e===void 0?!1:Math.random()<e}function sl(e){if(Hd())try{Ce.sessionStorage.setItem(wd,JSON.stringify(e))}catch{}}function ny(e){let t=Date.now(),n=e.id||ge(),r=e.started||t,o=e.lastActivity||t,i=e.segmentId||0,s=e.sampled,a=e.previousSessionId,c=e.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:i,sampled:s,previousSessionId:a,dirty:c}}function CO(e,t){return ty(e)?"session":t?"buffer":!1}function IT({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=CO(e,t),i=ny({sampled:o,previousSessionId:r});return n&&sl(i),i}function xO(){if(!Hd())return null;try{let e=Ce.sessionStorage.getItem(wd);if(!e)return null;let t=JSON.parse(e);return V&&K.infoTick("Loading existing session"),ny(t)}catch{return null}}function vd(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function wO(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return vd(e.started,t,r)||vd(e.lastActivity,n,r)}function Ju(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!wO(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function id({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&xO();return o?Ju(o,{sessionIdleExpire:e,maxReplayDuration:t})?(V&&K.infoTick("Session in sessionStorage is expired, creating new one..."),IT(r,{previousSessionId:o.id})):o:(V&&K.infoTick("Creating new session"),IT(r,{previousSessionId:n}))}function kO(e){return e.type===ie.Custom}function Gd(e,t,n){return oy(e,t)?(ry(e,t,n),!0):!1}function OO(e,t,n){return oy(e,t)?ry(e,t,n):Promise.resolve(null)}async function ry(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let o=e.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let i=e.getOptions(),s=MO(t,i.beforeAddRecordingEvent);return s?await r.addEvent(s):void 0}catch(i){let s=i&&i instanceof Ia,a=s?"eventBufferOverflow":"eventBufferError",c=I();if(c){let u=s?"buffer_overflow":"internal_sdk_error";c.recordDroppedEvent(u,"replay")}if(s&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:a})}}function oy(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=Bd(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(V&&K.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function MO(e,t){try{if(typeof t=="function"&&kO(e))return t(e)}catch(n){return V&&K.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}var LO=100;function iy(e,t){let n=e.getContext();n.traceIds.size<LO&&n.traceIds.add(t)}function PO(e){return t=>{if(!e.isEnabled()||!Xe(t))return;let n=t.spanContext().traceId;n&&iy(e,n)}}function $d(e){return!e.type}function Rd(e){return e.type==="transaction"}function UO(e){return e.type==="replay_event"}function bT(e){return e.type==="feedback"}function DO(e){return(t,n)=>{if(!e.isEnabled()||!$d(t)&&!Rd(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(Rd(t)){BO(e,t);return}FO(e,t)}}}function BO(e,t){let n=t.contexts?.trace?.trace_id;n&&iy(e,n)}function FO(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||wo(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function HO(e){return t=>{!e.isEnabled()||!$d(t)||GO(e,t)}}function GO(e,t){let n=t.exception?.values?.[0]?.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){let r=$n({category:"replay.hydrate-error",data:{url:ut()}});Ra(e,r)}}function $O(e){let t=I();t&&t.on("beforeAddBreadcrumb",n=>WO(e,n))}function WO(e,t){if(!e.isEnabled()||!sy(t))return;let n=jO(t);n&&Ra(e,n)}function jO(e){return!sy(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?zO(e):$n(e)}function zO(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return $n(e);let n=!1,r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Uu?(n=!0,`${o.slice(0,Uu)}\u2026`):o;if(typeof o=="object")try{let i=Se(o,7);return JSON.stringify(i).length>Uu?(n=!0,`${JSON.stringify(i,null,2).slice(0,Uu)}\u2026`):i}catch{}return o});return $n(E(p({},e),{data:p(E(p({},e.data),{arguments:r}),n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{})}))}function sy(e){return!!e.category}function qO(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Xu(){let e=w().getPropagationContext().dsc;e&&delete e.replay_id;let t=te();if(t){let n=Be(t);delete n.replay_id}}function AT(e){let t=w().getPropagationContext().dsc;t&&(t.replay_id=e);let n=te();if(n){let r=Be(n);r.replay_id=e}}function YO(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:ie.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function VO(e,t){return e.recordingMode!=="buffer"||t.message===kd||!t.exception||t.type?!1:ty(e.getOptions().errorSampleRate)}function KO(e){return Object.assign((t,n)=>{if(e.session&&Ju(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Xu(),!e.isEnabled()||e.isPaused())return t;if(UO(t))return delete t.breadcrumbs,t;if(!$d(t)&&!Rd(t)&&!bT(t))return t;if(!e.checkAndHandleExpiredSession())return Xu(),t;if(bT(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),YO(e,t),t;if(qO(t,n)&&!e.getOptions()._experiments.captureExceptions)return V&&K.log("Ignoring error from rrweb internals",t),null;let o=VO(e,t);if((o||e.recordingMode==="session")&&(t.tags=E(p({},t.tags),{replayId:e.getSessionId()})),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){let s=e.session;s.dirty=!0,e.getOptions().stickySession&&sl(s)}return t},{id:"Replay"})}function al(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:ie.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:o,data:s}}});return typeof a=="string"?Promise.resolve(null):a})}function JO(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function XO(e){return t=>{if(!e.isEnabled())return;let n=JO(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(al(e,[n]),!1)))}}function QO(e,t){return V&&e.getOptions()._experiments.traceInternals?!1:si(t,I())}function ay(e,t){e.isEnabled()&&t!==null&&(QO(e,t.name)||e.addUpdate(()=>(al(e,[t]),!0)))}function cl(e){if(!e)return;let t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=wu(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function cy(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Qu(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n=p({},e._meta),r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function uy(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:o,method:i,statusCode:s,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:i,statusCode:s,request:a,response:c}}}function ba(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function Fr(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:o,warnings:i}=ZO(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function Nd(e,t){return Object.entries(e).reduce((n,[r,o])=>{let i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=o),n},{})}function ZO(e){if(!e||typeof e!="string")return{body:e};let t=e.length>oT,n=eM(e);if(t){let r=e.slice(0,oT);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function eM(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Zu(e,t){let n=tM(e);return ze(n,t)}function tM(e,t=Ce.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Ce.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function nM(e,t,n){try{let r=await oM(e,t,n),o=uy("resource.fetch",r);ay(n.replay,o)}catch(r){V&&K.exception(r,"Failed to capture fetch breadcrumb")}}function rM(e,t){let{input:n,response:r}=t,o=n?Ui(n):void 0,i=cl(o),s=r?cy(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),s!==void 0&&(e.data.response_body_size=s)}async function oM(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r}=t,{url:s,method:a,status_code:c=0,request_body_size:u,response_body_size:f}=e.data,l=Zu(s,n.networkDetailAllowUrls)&&!Zu(s,n.networkDetailDenyUrls),m=l?iM(n,t.input,u):ba(u),d=await sM(l,n,t.response,f);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:c,request:m,response:d}}function iM({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?uM(n,t):{};if(!e)return Fr(o,r,void 0);let i=Ui(n),[s,a]=Oo(i,K),c=Fr(o,r,s);return a?Qu(c,a):c}async function sM(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return ba(o);let i=r?ly(r.headers,n):{};if(!r||!t&&o!==void 0)return Fr(i,o,void 0);let[s,a]=await cM(r),c=aM(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?Qu(c,a):c}function aM(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?cl(e):n;return r?t?Fr(o,i,e):Fr(o,i,void 0):ba(i)}catch(i){return V&&K.exception(i,"Failed to serialize response body"),Fr(o,n,void 0)}}async function cM(e){let t=lM(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await fM(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(V&&K.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(V&&K.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function ly(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function uM(e,t){return e.length===1&&typeof e[0]!="string"?vT(e[0],t):e.length===2?vT(e[1],t):{}}function vT(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?ly(n,t):Array.isArray(n)?{}:Nd(n,t):{}}function lM(e){try{return e.clone()}catch(t){V&&K.exception(t,"Failed to clone response body")}}function fM(e){return new Promise((t,n)=>{let r=wo(()=>n(new Error("Timeout while trying to read response body")),500);pM(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function pM(e){return await e.text()}async function dM(e,t,n){try{let r=_M(e,t,n),o=uy("resource.xhr",r);ay(n.replay,o)}catch(r){V&&K.exception(r,"Failed to capture xhr breadcrumb")}}function mM(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=cl(r),i=n.getResponseHeader("content-length")?cy(n.getResponseHeader("content-length")):SM(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function _M(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r,input:s,xhr:a}=t,{url:c,method:u,status_code:f=0,request_body_size:l,response_body_size:m}=e.data;if(!c)return null;if(!a||!Zu(c,n.networkDetailAllowUrls)||Zu(c,n.networkDetailDenyUrls)){let D=ba(l),y=ba(m);return{startTimestamp:o,endTimestamp:i,url:c,method:u,statusCode:f,request:D,response:y}}let d=a[ht],_=d?Nd(d.request_headers,n.networkRequestHeaders):{},h=Nd(oa(a),n.networkResponseHeaders),[S,T]=n.networkCaptureBodies?Oo(s,K):[void 0],[b,k]=n.networkCaptureBodies?gM(a):[void 0],R=Fr(_,l,S),U=Fr(h,m,b);return{startTimestamp:o,endTimestamp:i,url:c,method:u,statusCode:f,request:T?Qu(R,T):R,response:k?Qu(U,k):U}}function gM(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return hM(e.response,e.responseType)}catch(n){t.push(n)}return V&&K.warn("Failed to get xhr response body",...t),[void 0]}function hM(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return V&&K.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return V&&K.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function SM(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return cl(n)}catch{return}}function EM(e){let t=I();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s};t&&t.on("beforeAddBreadcrumb",(c,u)=>TM(a,c,u))}catch{}}function TM(e,t,n){if(t.data)try{yM(t)&&bM(n)&&(mM(t,n),dM(t,n,e)),IM(t)&&AM(n)&&(rM(t,n),nM(t,n,e))}catch(r){V&&K.exception(r,"Error when enriching network breadcrumb")}}function yM(e){return e.category==="xhr"}function IM(e){return e.category==="fetch"}function bM(e){return e?.xhr}function AM(e){return e?.input!==void 0}function vM(e){let t=I();ra(nO(e)),cr(XO(e)),$O(e),EM(e);let n=KO(e);ws(n),t&&(t.on("beforeSendEvent",HO(e)),t.on("afterSendEvent",DO(e)),t.on("createDsc",r=>{let o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("afterSegmentSpanEnd",PO(e)),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{let i=e.getSessionId();o?.includeReplay&&e.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function RM(e){try{return Promise.all(al(e,[NM(Ce.performance.memory)]))}catch{return[]}}function NM(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function CM(e,t,n){return Ff(e,t,E(p({},n),{setTimeoutImpl:wo}))}var Fu=C.navigator;function xM(){return/iPhone|iPad|iPod/i.test(Fu?.userAgent??"")||/Macintosh/i.test(Fu?.userAgent??"")&&Fu?.maxTouchPoints&&Fu?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function wM(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){V&&K.warn("Received replay event after session expired.");return}let o=r||!t;t=!0,kM(n),e.clickDetector&&Xk(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!Gd(e,n,o))return!0;if(!o)return!1;let i=e.session;if(MM(e,o),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){let s=e.eventBuffer.getEarliestTimestamp();s&&(V&&K.log(`Updating session start time to earliest event in buffer to ${new Date(s)}`),i.started=s,e.getOptions().stickySession&&sl(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function kM(e){let t=e.data;if(!(e.type!==ie.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==X.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=bn.mirror.getNode(n.id),o=r&&bn.mirror.getMeta(r);if(o?.type===il.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function OM(e){let t=e.getOptions();return{type:ie.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function MM(e,t){!t||e.session?.segmentId!==0||Gd(e,OM(e),!1)}function LM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function PM(e,t,n,r){return Me(Jo(e,gn(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function UM({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
497
|
+
`;if(typeof e=="string")n=`${r}${e}`;else{let i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function DM({client:e,scope:t,replayId:n,event:r}){let o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:o};e.emit("preprocessEvent",r,i);let s=await Rs(e.getOptions(),r,i,t,e,re());if(!s)return null;e.emit("postprocessEvent",s,i),s.platform=s.platform||"javascript";let a=e.getSdkMetadata(),{name:c,version:u,settings:f}=a?.sdk||{};return s.sdk=E(p({},s.sdk),{name:c||"sentry.javascript.unknown",version:u||"0.0.0",settings:f}),s}async function BM({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=UM({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:f}=r,l=I(),m=w(),d=l?.getTransport(),_=l?.getDsn();if(!l||!d||!_||!i.sampled)return Promise.resolve({});let h={type:b0,replay_start_timestamp:f/1e3,timestamp:o/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:i.sampled},S=await DM({scope:m,client:l,replayId:t,event:h});if(!S)return l.recordDroppedEvent("event_processor","replay"),V&&K.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete S.sdkProcessingMetadata;let T=PM(S,s,_,l.getOptions().tunnel),b;try{b=await d.send(T)}catch(R){let U=new Error(kd);try{U.cause=R}catch{}throw U}let k=Ls({},b);if(Ms(k,"replay"))throw new Aa(k);if(typeof b.statusCode=="number"&&(b.statusCode<200||b.statusCode>=300))throw new el(b.statusCode);return b}var el=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},Aa=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},tl=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function fy(e,t={count:0,interval:x0}){let{recordingData:n,onError:r}=e;if(n.length)try{return await BM(e),!0}catch(o){if(o instanceof el||o instanceof Aa)throw o;if(oo("Replays",{_retryCount:t.count}),r&&r(o),t.count>=w0){let i=new Error(`${kd} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{wo(async()=>{try{await fy(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var py="__THROTTLED",FM="__SKIPPED";function HM(e,t,n){let r=new Map,o=a=>{let c=a-n;r.forEach((u,f)=>{f<c&&r.delete(f)})},i=()=>[...r.values()].reduce((a,c)=>a+c,0),s=!1;return(...a)=>{let c=Math.floor(Date.now()/1e3);if(o(c),i()>=t){let f=s;return s=!0,f?FM:py}s=!1;let u=r.get(c)||0;return r.set(c,u+1),e(...a)}}var Cd=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:A0,sessionIdleExpire:v0},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=CM(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=HM((s,a)=>OO(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(k0,r),timeout:r,scrollTimeout:O0,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new yd(this,i)),V){let s=t._experiments;K.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{Ce.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let s=$n({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{let s=$n({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{sO(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){V&&K.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){let{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){V&&K.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",V&&K.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){V&&K.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){V&&K.log("Buffering is in progress, call `flush()` to save the replay");return}V&&K.infoTick("Starting replay in session mode"),this._updateUserActivity();let t=id({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){V&&K.log("Buffering is in progress, call `flush()` to save the replay");return}V&&K.infoTick("Starting replay in buffer mode");let t=id({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{let t=this._canvas;this._stopRecording=bn(p(E(p(E(p(p({},this._recordingOptions),this.recordingMode==="buffer"?{checkoutEveryNms:C0}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)}),{emit:wM(this)}),xM()),{onMutation:this._onMutationHandler.bind(this)}),t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}))}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";let r=n??"manual";I()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{V&&K.log(`Stopping Replay triggered by ${r}`),Xu(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,RO(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),V&&K.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),V&&K.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();V&&K.log("Converting buffer to session"),await this.flushImmediate();let r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),AT(this.session.id)),this.startRecording())}addUpdate(t){let n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&vd(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${Ce.location.pathname}${Ce.location.hash}${Ce.location.search}`,n=`${Ce.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){let r=this._throttledAddEvent(t,n);if(r===py){let o=$n({category:"replay.throttled"});this.addUpdate(()=>!Gd(this,{type:Gk,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||te(),n=t&&oe(t),o=(n&&P(n).data||{})[Ie];if(!(!n||!o||!["route","custom"].includes(o)))return P(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=bO({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&I()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&AT(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=id({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;let t=this.session;return Ju(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))}_addListeners(){try{Ce.document.addEventListener("visibilitychange",this._handleVisibilityChange),Ce.addEventListener("blur",this._handleWindowBlur),Ce.addEventListener("focus",this._handleWindowFocus),Ce.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(vM(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=EO(this)}_removeListeners(){try{Ce.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Ce.removeEventListener("blur",this._handleWindowBlur),Ce.removeEventListener("focus",this._handleWindowFocus),Ce.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;if(Ju(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Xu();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){V&&K.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:ie.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=lO(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(al(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;let r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){let t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){let t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){V&&K.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await RM(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new tl;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await fy({replayId:t,recordingData:i,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:s=>this.handleException(s)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});let r=I();if(r){let o;n instanceof Aa?o="ratelimit_backoff":n instanceof tl?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){V&&K.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;let n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();let i=o<this._options.minReplayDuration,s=o>this._options.maxReplayDuration+5e3;if(i||s){V&&K.log(`Session duration (${Math.floor(o/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&V&&K.log("Flushing initial segment without checkout.");let c=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,c&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&sl(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let c=LM(a.target),u=n.join(",");return c?.matches(u)}))return!1;let r=t.length,o=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=o&&r>o;if(r>i||s){let a=$n({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function da(e,t){return[...e,...t].join(",")}function GM({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=da(e,[".sentry-mask","[data-sentry-mask]"]),a=da(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:da(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:da(r,[]),ignoreSelector:da(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function $M({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:i}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return i;let s=n.includes(t),a=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return s||a?i.replace(/[\S]/g,"*"):i}var RT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',WM=["content-length","content-type","accept"],jM=Symbol.for("sentry__originalRequestBody"),NT=!1,CT=!1;function zM(){if(typeof Request>"u"||CT)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[jM]=r.body),o};t.prototype=e.prototype,C.Request=t,CT=!0}catch{}}var qM=e=>new xd(e),xd=class{constructor({flushMinDelay:t=R0,flushMaxDelay:n=N0,minReplayDuration:r=M0,maxReplayDuration:o=iT,stickySession:i=!0,useCompression:s=!0,workerUrl:a,_experiments:c={},maskAllText:u=!0,maskAllInputs:f=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:m=750,mutationLimit:d=1e4,slowClickTimeout:_=7e3,slowClickIgnoreSelectors:h=[],networkDetailAllowUrls:S=[],networkDetailDenyUrls:T=[],networkCaptureBodies:b=!0,networkRequestHeaders:k=[],networkResponseHeaders:R=[],mask:U=[],maskAttributes:D=["title","placeholder","aria-label"],unmask:y=[],block:O=[],unblock:Y=[],ignore:N=[],maskFn:B,beforeAddRecordingEvent:M,beforeErrorSampling:F,onError:j,attachRawBodyFromRequest:ae=!1}={}){this.name="Replay";let ue=GM({mask:U,unmask:y,block:O,unblock:Y,ignore:N});if(this._recordingOptions=E(p({maskAllInputs:f,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:B,maskInputFn:B,maskAttributeFn:(z,L,q)=>$M({maskAttributes:D,maskAllText:u,privacyOptions:ue,key:z,value:L,el:q})},ue),{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:z=>{try{z.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!c.recordCrossOriginIframes}),this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,L0),maxReplayDuration:Math.min(o,iT),stickySession:i,useCompression:s,workerUrl:a,blockAllMedia:l,maskAllInputs:f,maskAllText:u,mutationBreadcrumbLimit:m,mutationLimit:d,slowClickTimeout:_,slowClickIgnoreSelectors:h,networkDetailAllowUrls:S,networkDetailDenyUrls:T,networkCaptureBodies:b,networkRequestHeaders:xT(k),networkResponseHeaders:xT(R),beforeAddRecordingEvent:M,beforeErrorSampling:F,onError:j,attachRawBodyFromRequest:ae,_experiments:c},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${RT}`:RT,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&st())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return NT}set _isInitialized(t){NT=t}afterAllSetup(t){!st()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&zM(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(t){let n=this.getReplayId(!0);n&&(Ut(t,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&Ut(t,{"sentry._internal.replay_is_buffering":!0}))}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=YM(this._initialOptions,t);this._replay=new Cd({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function YM(e,t){let n=t.getOptions(),r=p({sessionSampleRate:0,errorSampleRate:0},e),o=Pt(n.replaysSessionSampleRate),i=Pt(n.replaysOnErrorSampleRate);return o==null&&i==null&&Ge(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function xT(e){return[...WM,...e.map(t=>t.toLowerCase())]}function VM(){return I()?.getIntegrationByName("Replay")}var KM=Object.defineProperty,JM=(e,t,n)=>t in e?KM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dy=(e,t,n)=>JM(e,typeof t!="symbol"?t+"":t,n),jd=class{constructor(){dy(this,"idNodeMap",new Map),dy(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function XM(){return new jd}function QM(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function zd(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:zd(e.parentNode,t,n,r+1)}function my(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(QM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}var Vi=`Please stop import mirror directly. Instead of that,\r
|
|
498
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
499
|
+
or you can use record.mirror to access the mirror instance during recording.`,_y={map:{},getId(){return console.error(Vi),-1},getNode(){return console.error(Vi),null},removeNodeFromMap(){console.error(Vi)},has(){return console.error(Vi),!1},reset(){console.error(Vi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(_y=new Proxy(_y,{get(e,t,n){return t==="map"&&console.error(Vi),Reflect.get(e,t,n)}}));function Yd(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){by(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>Yd(e,t,i||{},!0)}function Vd(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function ZM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function pl(e,t,n,r,o){if(!e)return!1;let i=ZM(e);if(!i)return!1;let s=my(t,n);if(!o){let u=r&&i.matches(r);return s(i)&&!u}let a=zd(i,s),c=-1;return a<0?!1:(r&&(c=zd(i,my(null,r))),a>-1&&c<0?!0:a<c)}var gy={};function Iy(e){let t=gy[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return gy[e]=r.bind(window)}function Lo(...e){return Iy("requestAnimationFrame")(...e)}function by(...e){return Iy("setTimeout")(...e)}var Ji=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ji||{}),ll;function eL(e){ll=e}var Wd=e=>ll?(...n)=>{try{return e(...n)}catch(r){if(ll&&ll(r)===!0)return()=>{};throw r}}:e,Ki="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tL=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Na=0;Na<Ki.length;Na++)tL[Ki.charCodeAt(Na)]=Na;var Na,nL=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=Ki[t[n]>>2],o+=Ki[(t[n]&3)<<4|t[n+1]>>4],o+=Ki[(t[n+1]&15)<<2|t[n+2]>>6],o+=Ki[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},hy=new Map;function rL(e,t){let n=hy.get(e);return n||(n=new Map,hy.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Ay=(e,t,n)=>{if(!e||!(Ry(e,t)||typeof e=="object"))return;let r=e.constructor.name,o=rL(n,r),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function fl(e,t,n){if(e instanceof Array)return e.map(r=>fl(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let r=e.constructor.name,o=nL(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[fl(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){let r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[fl(e.data,t,n),e.width,e.height]};if(Ry(e,t)||typeof e=="object"){let r=e.constructor.name,o=Ay(e,t,n);return{rr_type:r,index:o}}}}return e}var vy=(e,t,n)=>e.map(r=>fl(r,t,n)),Ry=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function oL(e,t,n,r,o){let i=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of s)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=Vd(t.CanvasRenderingContext2D.prototype,a,function(u){return function(...f){return pl(this.canvas,n,r,o,!0)||by(()=>{let l=vy(f,t,this);e(this.canvas,{type:Ji["2D"],property:a,args:l})},0),u.apply(this,f)}});i.push(c)}catch{let c=Yd(t.CanvasRenderingContext2D.prototype,a,{set(u){e(this.canvas,{type:Ji["2D"],property:a,args:[u],setter:!0})}});i.push(c)}return()=>{i.forEach(a=>a())}}function iL(e){return e==="experimental-webgl"?"webgl":e}function Sy(e,t,n,r,o){let i=[];try{let s=Vd(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...u){if(!pl(this,t,n,r,!0)){let f=iL(c);if("__context"in this||(this.__context=f),o&&["webgl","webgl2"].includes(f))if(u[0]&&typeof u[0]=="object"){let l=u[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...u])}});i.push(s)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(s=>s())}}function Ey(e,t,n,r,o,i,s,a){let c=[],u=Object.getOwnPropertyNames(e);for(let f of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(f))try{if(typeof e[f]!="function")continue;let l=Vd(e,f,function(m){return function(...d){let _=m.apply(this,d);if(Ay(_,a,this),"tagName"in this.canvas&&!pl(this.canvas,r,o,i,!0)){let h=vy(d,a,this),S={type:t,property:f,args:h};n(this.canvas,S)}return _}});c.push(l)}catch{let l=Yd(e,f,{set(m){n(this.canvas,{type:t,property:f,args:[m],setter:!0})}});c.push(l)}return c}function sL(e,t,n,r,o,i){let s=[];return s.push(...Ey(t.WebGLRenderingContext.prototype,Ji.WebGL,e,n,r,o,i,t)),typeof t.WebGL2RenderingContext<"u"&&s.push(...Ey(t.WebGL2RenderingContext.prototype,Ji.WebGL2,e,n,r,o,i,t)),()=>{s.forEach(a=>a())}}var aL='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function cL(){let e=new Blob([aL]);return URL.createObjectURL(e)}var qd=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};let{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:i,errorHandler:s}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,s&&eL(s),(i&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&Wd(()=>{i&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(t){let{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:i,recordCanvas:s,enableManualSnapshot:a}=this.options;if(!this.windowsSet.has(t)){if(a){this.windowsSet.add(t),this.windows.push(new WeakRef(t));return}Wd(()=>{if(s&&n==="all"&&this.initCanvasMutationObserver(t,r,o,i),s&&typeof n=="number"){let c=Sy(t,r,o,i,!0);this.restoreHandlers.push(()=>{c()})}})(),this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(t,n){if(n?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,t);return}Lo(r=>this.takeSnapshot(r,!0,t))}initFPSWorker(){let t=new Worker(cL());return t.onmessage=n=>{let r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;let{base64:i,type:s,width:a,height:c}=r;this.mutationCb({id:o,type:Ji["2D"],commands:[{property:"clearRect",args:[0,0,a,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:s}]},0,0,a,c]}]})},t}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;let n=r=>{this.takeSnapshot(r,!1),t=Lo(n)};t=Lo(n),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,n,r,o){let i=Sy(t,n,r,o,!1),s=oL(this.processMutation.bind(this),t,n,r,o),a=sL(this.processMutation.bind(this),t,n,r,o,this.mirror);this.restoreHandlers.push(()=>{i(),s(),a()})}getCanvasElements(t,n,r){let o=[],i=s=>{s.querySelectorAll("canvas").forEach(a=>{pl(a,t,n,r,!0)||o.push(a)})};for(let s of this.windows){let a=s.deref(),c;try{c=a&&a.document}catch{}c&&i(c)}for(let s of this.shadowDoms){let a=s.deref();a&&i(a)}return o}takeSnapshot(t,n,r){let{sampling:o,blockClass:i,blockSelector:s,unblockSelector:a,dataURLOptions:c,maxCanvasSize:u}=this.options,l=1e3/(o==="all"?2:o||2);return this.lastSnapshotTime&&t-this.lastSnapshotTime<l?!1:(this.lastSnapshotTime=t,(r?[r]:this.getCanvasElements(i,s,a)).forEach(_=>{let h=this.mirror.getId(_);if(!(!this.mirror.hasNode(_)||!_.width||!_.height||this.snapshotInProgressMap.get(h))){if(this.snapshotInProgressMap.set(h,!0),!n&&["webgl","webgl2"].includes(_.__context)){let S=_.getContext(_.__context);S?.getContextAttributes()?.preserveDrawingBuffer===!1&&S.clear(S.COLOR_BUFFER_BIT)}createImageBitmap(_).then(S=>{this.worker?.postMessage({id:h,bitmap:S,width:_.width,height:_.height,dataURLOptions:c,maxCanvasSize:u},[S])}).catch(S=>{Wd(()=>{throw this.snapshotInProgressMap.delete(h),S})()})}}),!0)}startPendingCanvasMutationFlusher(){Lo(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=n=>{this.rafStamps.latestId=n,Lo(t)};Lo(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),Lo(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;let o=r.map(s=>{let u=s,{type:a}=u;return zt(u,["type"])}),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}};try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}XM();var Ty;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ty||(Ty={}));var yy={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},uL="ReplayCanvas",ul=1280,lL=(e={})=>{let[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,ul):ul,n?Math.min(n,ul):ul]},o,i,s=new Promise(a=>i=a);return{name:uL,getOptions(){let{quality:a,enableManualSnapshot:c,maxCanvasSize:u}=r;return p({enableManualSnapshot:c,recordCanvas:!0,getCanvasManager:f=>{let l=new qd(E(p({},f),{enableManualSnapshot:c,maxCanvasSize:u,errorHandler:m=>{try{typeof m=="object"&&(m.__rrweb__=!0)}catch{}}}));return o=l,i(l),l}},yy[a]||yy.medium)},async snapshot(a,c){(o||await s).snapshot(a,c)}}},fL=lL;function Ny(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Kd(e){try{return new URL(e,x.location.origin).href}catch{return}}function Cy(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Jd(e){try{return new Headers(e)}catch{return}}var dl={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Xd(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:c}=p(p({},dl),t),u=typeof o=="function"?o:d=>!0,f=d=>dL(d,s),l={},m=e.getOptions().propagateTraceparent;n&&Bn(d=>{let _=jf(d,u,f,l,{propagateTraceparent:m,onRequestSpanEnd:c});if(_){let h=Kd(d.fetchData.url),S=h?Yt(h).host:void 0,T=h?at(h):void 0;_.setAttributes({"http.url":T,"url.full":T,"server.address":S}),i&&xy(_,e),a?.(_,{headers:d.headers})}}),r&&ko(d=>{let _=mL(d,u,f,l,m,c);_&&(i&&xy(_,e),a?.(_,{headers:Jd(d.xhr.__sentry_xhr_v3__?.request_headers)}))})}var pL=300;function xy(e,t){let{url:n}=P(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(Fe(t)){let i=e.end.bind(e);e.end=s=>{let a=s??ne(),c=!1,u=()=>{c||(c=!0,setTimeout(o),i(a),clearTimeout(f))};r=u;let f=setTimeout(u,pL)}}let o=wt("resource",({entries:i})=>{i.forEach(s=>{Cy(s)&&s.name.endsWith(n)&&(e.setAttributes(ta(s)),r())})})}function dL(e,t){let n=ut();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}let i=r.origin===o;return t?ze(r.toString(),t)||i&&ze(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?ze(e,t):r}}function mL(e,t,n,r,o,i){let s=e.xhr,a=s?.[ht];if(!s||s.__sentry_own_request__||!a)return;let{url:c,method:u}=a,f=Oe()&&t(c);if(e.endTimestamp){let k=s.__sentry_xhr_span_id__;if(!k)return;let R=r[k];R&&(f&&a.status_code!==void 0&&(Vn(R,a.status_code),R.end(),i?.(R,{headers:Jd(oa(s)),error:e.error})),delete r[k]);return}let l=Kd(c),m=l?Yt(l):Yt(c),d=l?at(l):void 0,_=at(Rr(c)),h=I(),T=!!te()||!!h&&Fe(h),b=f&&T?Ue({name:`${u} ${_}`,attributes:p(p({url:at(c),type:"xhr","http.method":u,"http.url":d,"url.full":d,"server.address":m?.host,[G]:"auto.http.browser",[Z]:"http.client"},m?.search&&{"http.query":m?.search}),m?.hash&&{"http.fragment":m?.hash})}):new At;return f&&!T&&h?.recordDroppedEvent("no_parent_span","span"),s.__sentry_xhr_span_id__=b.spanContext().spanId,r[s.__sentry_xhr_span_id__]=b,n(c)&&_L(s,Oe()&&T?b:void 0,o),h&&h.emit("beforeOutgoingRequestSpan",b,e),b}function _L(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=ci({span:t,propagateTraceparent:n});r&&gL(e,r,o,i)}function gL(e,t,n,r){let o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!o?.traceparent&&e.setRequestHeader("traceparent",r),n){let i=o?.baggage;(!i||!Ny(i))&&e.setRequestHeader("baggage",n)}}catch{}}var wy=new WeakMap,ky=new WeakMap,hL=9e4,SL=["text/event-stream","application/x-ndjson","application/stream+json"],Qd=()=>({name:"FetchStreamPerformance",setup(){ru(e=>{if(e.response){let t=wy.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=ky.get(e.response);n&&clearTimeout(n)}}}),Bn(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!SL.some(c=>t.startsWith(c)))return;let n=e.fetchData?.url||"",r=e.fetchData?.method||"GET",o=On(n),i=n.startsWith("data:")?at(n):o?ii(o):n,s=Ue({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:at(n),"http.method":r,type:"fetch",[Z]:"http.client.stream",[G]:"auto.http.browser.stream"}});wy.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},hL);ky.set(e.response,a)}})}});var Zd="WebVitals",em=(e={})=>{let t=new Set(e.ignore??[]);return{name:Zd,setup(n){let r=Fe(n),{enableStandaloneClsSpans:o,enableStandaloneLcpSpans:i}=e._experiments??{},s=r||t.has("cls")?void 0:o||!1,a=r||t.has("lcp")?void 0:i||!1,c=wp({recordClsStandaloneSpans:s,recordLcpStandaloneSpans:a,client:n}),u=new WeakSet;n.on("afterStartPageLoadSpan",f=>{u.add(f)}),n.on("spanEnd",f=>{u.delete(f)&&(c(),Pp(f,{recordClsOnPageloadSpan:s===!1,recordLcpOnPageloadSpan:a===!1,spanStreamingEnabled:r}))}),r?(t.has("lcp")||Gp(n),t.has("cls")||$p(n),t.has("inp")||Wp()):t.has("inp")||Bp()},afterAllSetup(){t.has("inp")||Fp()}}};function Oy(){x.document?x.document.addEventListener("visibilitychange",()=>{let e=te();if(!e)return;let t=oe(e);if(x.document.hidden&&t){let n="cancelled",{op:r,status:o}=P(t);v&&g.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:2,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):v&&g.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var EL=3600,My="sentry_previous_trace",TL="sentry.previous_trace";function Ly(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?bL():void 0;e.on("spanStart",s=>{if(oe(s)!==s)return;let a=w().getPropagationContext();o=yL(o,s,a),r&&IL(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=w(),c=a.getPropagationContext();if(i&&c.parentSpanId){i=!1;return}a.setPropagationContext(E(p({},c),{dsc:E(p({},c.dsc),{sample_rate:String(o.sampleRate),sampled:String(tm(o.spanContext))}),sampleRand:o.sampleRand})),s.parentSampled=tm(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes=E(p({},s.spanAttributes),{[qo]:o.sampleRate})})}function yL(e,t,n){let r=P(t);function o(){try{let a=Number(r.data?.[qn]??n.dsc?.sample_rate);return Number.isNaN(a)?0:a}catch{return 0}}let i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return i;let s=e.spanContext;return s.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=EL&&(v&&g.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify(p({op:r.op},t.spanContext()))}\``),t.addLink({context:s,attributes:{[ic]:"previous_trace"}}),t.setAttribute(TL,`${s.traceId}-${s.spanId}-${tm(s)?1:0}`)),i)}function IL(e){try{x.sessionStorage.setItem(My,JSON.stringify(e))}catch(t){v&&g.warn("Could not store previous trace in sessionStorage",t)}}function bL(){try{let e=x.sessionStorage?.getItem(My);return JSON.parse(e)}catch{return}}function tm(e){return e.traceFlags===1}var AL="BrowserTracing",vL=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Fy(){let e=x.navigator;return e?.userAgent?vL.test(e.userAgent):!1}var RL=p(E(p({},Zo),{instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{}}),dl),nm=(e={})=>{"enableElementTiming"in e&&Ge(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=x.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:s,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:u,idleTimeout:f,finalTimeout:l,childSpanTimeout:m,markBackgroundSpan:d,traceFetch:_,traceXHR:h,trackFetchStreamPerformance:S,shouldCreateSpanForRequest:T,enableHTTPTimings:b,ignoreResourceSpans:k,ignorePerformanceApiSpans:R,instrumentPageLoad:U,instrumentNavigation:D,detectRedirects:y,linkPreviousTrace:O,consistentTraceSampling:Y,enableReportPageLoaded:N,onRequestSpanStart:B,onRequestSpanEnd:M}=p(p({},RL),e),F=Fy(),j,ae;function ue(z,L,q=!0){let H=L.op==="pageload",ce=L.name,le=u?u(L):L,Ee=le.attributes||{};if(ce!==le.name&&(Ee[Ie]="custom",le.attributes=Ee),!q){let sn=It();Ue(E(p({},le),{startTime:sn})).end(sn);return}t.name=le.name,t.source=Ee[Ie];let ke=Tc(le,{idleTimeout:f,finalTimeout:l,childSpanTimeout:m,disableAutoFinish:H,beforeSpanEnd:sn=>{Lp(sn,{ignoreResourceSpans:k,ignorePerformanceApiSpans:R,spanStreamingEnabled:Fe(z)}),Dy(z,void 0);let lr=w(),Hr=lr.getPropagationContext();lr.setPropagationContext(E(p({},Hr),{traceId:ke.spanContext().traceId,sampled:Xe(ke),dsc:Be(sn)})),H&&(ae=void 0)},trimIdleSpanEndTimestamp:!N});H&&N&&(ae=ke),Dy(z,ke);function Wt(){n&&["interactive","complete"].includes(n.readyState)&&(z.emit("idleSpanEnableAutoFinish",ke),n.removeEventListener("readystatechange",Wt))}H&&!N&&n&&(n.addEventListener("readystatechange",Wt),Wt())}return{name:AL,setup(z){if(F){v&&g.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(dc(),i&&C.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Op():o&&kp(),s&&Mp(),y&&n){let q=()=>{j=ne()};addEventListener("click",q,{capture:!0}),addEventListener("keydown",q,{capture:!0,passive:!0})}function L(){let q=Ca(z);q&&!P(q).timestamp&&(v&&g.log(`[Tracing] Finishing current active span with op: ${P(q).op}`),q.setAttribute(Yn,"cancelled"),q.end())}z.on("startNavigationSpan",(q,H)=>{if(I()!==z)return;if(H?.isRedirect){v&&g.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ue(z,p({op:"navigation.redirect"},q),!1);return}j=void 0,L(),re().setPropagationContext({traceId:et(),sampleRand:Math.random(),propagationSpanId:Oe()?void 0:ot()});let ce=w();ce.setPropagationContext({traceId:et(),sampleRand:Math.random(),propagationSpanId:Oe()?void 0:ot()}),ce.setSDKProcessingMetadata({normalizedRequest:void 0}),ue(z,E(p({op:"navigation"},q),{parentSpan:null,forceTransaction:!0}))}),z.on("startPageLoadSpan",(q,H={})=>{if(I()!==z)return;L();let ce=H.sentryTrace||Py("sentry-trace")||Uy("sentry-trace"),le=H.baggage||Py("baggage")||Uy("baggage"),Ee=ls(ce,le),ke=w();ke.setPropagationContext(Ee),Oe()||(ke.getPropagationContext().propagationSpanId=ot()),ke.setSDKProcessingMetadata({normalizedRequest:Ni()}),ue(z,p({op:"pageload"},q))}),z.on("endPageloadSpan",()=>{N&&ae&&(ae.setAttribute(Yn,"reportPageLoaded"),ae.end())})},afterAllSetup(z){if(F)return;z.addIntegration&&!z.getIntegrationByName?.(Zd)&&z.addIntegration(em({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c}}));let L=ut();if(O!=="off"&&Ly(z,{linkPreviousTrace:O,consistentTraceSampling:Y}),x.location){if(U){let q=pe();Hy(z,{name:x.location.pathname,startTime:q?q/1e3:void 0,attributes:{[Ie]:"url",[G]:"auto.pageload.browser"}})}D&&cr(({to:q,from:H})=>{if(H===void 0&&L?.indexOf(q)!==-1){L=void 0;return}L=void 0;let ce=On(q),le=Ca(z),Ee=le&&y&&CL(le,j);ml(z,{name:ce?.pathname||x.location.pathname,attributes:{[Ie]:"url",[G]:"auto.navigation.browser"}},{url:q,isRedirect:Ee})})}d&&Oy(),s&&NL(z,f,l,m,t),Xd(z,{traceFetch:_,traceXHR:h,tracePropagationTargets:z.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:T,enableHTTPTimings:b,onRequestSpanStart:B,onRequestSpanEnd:M}),S&&z.addIntegration(Qd())}}};function Hy(e,t,n){e.emit("startPageLoadSpan",t,n),w().setTransactionName(t.name);let r=Ca(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function ml(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=w();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:E(p({},Ni()),{url:r})}),Ca(e)}function Py(e){return x.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function Uy(e){return x.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function NL(e,t,n,r,o){let i=x.document,s,a=()=>{let c="ui.action.click",u=Ca(e);if(u){let f=P(u).op;if(["navigation","pageload"].includes(f)){v&&g.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(Yn,"interactionInterrupted"),s.end(),s=void 0),!o.name){v&&g.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}s=Tc({name:o.name,op:c,attributes:{[Ie]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var Gy="_sentry_idleSpan";function Ca(e){return e[Gy]}function Dy(e,t){_e(e,Gy,t)}var By=1.5;function CL(e,t){let n=P(e),r=It(),o=n.start_timestamp;return!(r-o>By||t&&r-t<=By)}function xL(e=I()){e?.emit("endPageloadSpan")}function wL(e){let t=te();if(t===e)return;let n=w();e.end=new Proxy(e.end,{apply(r,o,i){return dt(n,t),Reflect.apply(r,o,i)}}),dt(n,e)}var kL=()=>({name:"SpanStreaming",beforeSetup(e){let t=e.getOptions();t.traceLifecycle||(v&&g.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),t.traceLifecycle="stream")},setup(e){let t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!Fe(e)){r.traceLifecycle="static",v&&g.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Qn(o)){r.traceLifecycle="static",v&&g.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let i=new qs(e);e.on("afterSpanEnd",s=>{Xe(s)&&i.add(Ic(s,e))}),e.on("afterSegmentSpanEnd",s=>{let a=s.spanContext().traceId;setTimeout(()=>{i.flush(a)},500)})}});function Xi(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function OL(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=Xi(n);return o=>r.then(i=>o(i.transaction(t,"readwrite").objectStore(t)))}function rm(e){return Xi(e.getAllKeys())}function ML(e,t,n){return e(r=>rm(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),Xi(r.transaction)}))}function LL(e,t,n){return e(r=>rm(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.min(...o,0)-1),Xi(r.transaction)}))}function PL(e){return e(t=>rm(t).then(n=>{let r=n[0];if(r!=null)return Xi(t.get(r)).then(o=>(t.delete(r),Xi(t.transaction).then(()=>o)))}))}function UL(e){let t;function n(){return t==null&&(t=OL(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{let o=Zn(r);await ML(n(),o,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{let o=Zn(r);await LL(n(),o,e.maxQueueSize||30)}catch{}},shift:async()=>{try{let r=await PL(n());if(r)return gc(r)}catch{}}}}function DL(e){return t=>{let n=e(E(p({},t),{createStore:UL}));return x.addEventListener("online",async r=>{await n.flush()}),n}}function BL(e=ia){return DL(Lf(e))}var $y=1e6,FL="window"in C&&C.window===C&&typeof importScripts>"u",Uo=String(0),im=FL?"main":"worker",_l=x.navigator,jy="",zy="",qy="",om=_l?.userAgent||"",Yy="",HL=_l?.language||_l?.languages?.[0]||"";function GL(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}var Wy=_l?.userAgentData;GL(Wy)&&Wy.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(jy=e.platform||"",qy=e.architecture||"",Yy=e.model||"",zy=e.platformVersion||"",e.fullVersionList?.length){let t=e.fullVersionList[e.fullVersionList.length-1];om=`${t.brand} ${t.version}`}}).catch(e=>{});function $L(e){return!("thread_metadata"in e)}function WL(e){return $L(e)?YL(e):e}function jL(e){let t=e.contexts?.trace?.trace_id;return typeof t=="string"&&t.length!==32&&v&&g.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function zL(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let o=jL(r),i=WL(n),s=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:ne()*1e3),a=typeof r.timestamp=="number"?r.timestamp*1e3:ne()*1e3;return{event_id:e,timestamp:new Date(s).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||_n,runtime:{name:"javascript",version:x.navigator.userAgent},os:{name:jy,version:zy,build_number:om},device:{locale:HL,model:Yy,manufacturer:om,architecture:qy,is_emulator:!1},debug_meta:{images:Qy(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||ge(),trace_id:o,active_thread_id:Uo,relative_start_ns:"0",relative_end_ns:((a-s)*1e6).toFixed(0)}]}}function Vy(e,t,n){if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);let r=qL(e),o=t.getOptions(),i=t.getSdkMetadata?.()?.sdk;return{chunk_id:ge(),client_sdk:{name:i?.name??"sentry.javascript.browser",version:i?.version??"0.0.0"},profiler_id:n||ge(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:Qy(e.resources)},profile:r}}function Ky(e){try{if(!e||typeof e!="object")return{reason:"chunk is not an object"};let t=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};let n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:"profile has no stacks"}:!Array.isArray(n.samples)||!n.samples.length?{reason:"profile has no samples"}:{valid:!0}:{reason:"missing profile data"}}catch(t){return{reason:`unknown validation error: ${t}`}}}function qL(e){let t=[];for(let a=0;a<e.frames.length;a++){let c=e.frames[a];c&&(t[a]={function:c.name,abs_path:typeof c.resourceId=="number"?e.resources[c.resourceId]:void 0,lineno:c.line,colno:c.column})}let n=[];for(let a=0;a<e.stacks.length;a++){let c=e.stacks[a];if(!c)continue;let u=[],f=c;for(;f;)u.push(f.frameId),f=f.parentId===void 0?void 0:e.stacks[f.parentId];n[a]=u}let r=pe(),o=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=o-(r||o),s=[];for(let a=0;a<e.samples.length;a++){let c=e.samples[a];if(!c)continue;let u=(o+(c.timestamp-i))/1e3;s[a]={stack_id:c.stackId??0,thread_id:Uo,timestamp:u}}return{frames:t,stacks:n,samples:s,thread_metadata:{[Uo]:{name:im}}}}function gl(e){return P(e).op==="pageload"}function YL(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[Uo]:{name:im}}},o=e.samples[0];if(!o)return r;let i=o.timestamp,s=pe(),a=typeof performance.timeOrigin=="number"?performance.timeOrigin:s||0,c=a-(s||a);return e.samples.forEach((u,f)=>{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[f]={elapsed_since_start_ns:((u.timestamp+c-i)*$y).toFixed(0),stack_id:t,thread_id:Uo};return}let l=e.stacks[u.stackId],m=[];for(;l;){m.push(l.frameId);let _=e.frames[l.frameId];_&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:_.name,abs_path:typeof _.resourceId=="number"?e.resources[_.resourceId]:void 0,lineno:_.line,colno:_.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}let d={elapsed_since_start_ns:((u.timestamp+c-i)*$y).toFixed(0),stack_id:n,thread_id:Uo};r.stacks[n]=m,r.samples[f]=d,n++}),r}function Jy(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:"profile"},n]);return e}function Xy(e){let t=[];return vt(e,(n,r)=>{if(r==="transaction")for(let o=1;o<n.length;o++)n[o]?.contexts?.profile?.profile_id&&t.push(n[o])}),t}function Qy(e){let r=I()?.getOptions()?.stackParser;return r?nf(r,e):[]}function Zy(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(v&&g.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(v&&g.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function VL(e){return e.samples.length<2?(v&&g.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(v&&g.log("[Profiling] Discarding profile because it contains no frames"),!1)}var sm=!1,am=3e4;function KL(e){return typeof e=="function"}function hl(){let e=x.Profiler;if(!KL(e)){v&&g.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}let t=10,n=Math.floor(am/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{v&&(g.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),g.log("[Profiling] Disabling profiling for current user session.")),sm=!0}}function cm(e){if(sm)return v&&g.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return v&&g.log("[Profiling] Discarding profile because root span was not sampled."),!1;let n=I()?.getOptions();if(!n)return v&&g.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return Zy(r)?r?(r===!0?!0:Math.random()<r)?!0:(v&&g.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(v&&g.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(v&&g.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function eI(e){if(sm)return v&&g.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if(e.profileLifecycle!=="trace"&&e.profileLifecycle!=="manual")return v&&g.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let t=e.profileSessionSampleRate;return Zy(t)?t?Math.random()<=t:(v&&g.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(v&&g.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function xa(e){return typeof e.profilesSampleRate<"u"}function tI(e,t,n,r){return VL(n)?zL(e,t,n,r):null}var Po=new Map;function nI(){return Po.size}function rI(e){let t=Po.get(e);return t&&Po.delete(e),t}function oI(e,t){if(Po.set(e,t),Po.size>30){let n=Po.keys().next().value;n!==void 0&&Po.delete(n)}}var Sl=new WeakSet;function Do(e){e.setAttribute("thread.id",Uo),e.setAttribute("thread.name",im)}function um(e){let t;gl(e)&&(t=ne()*1e3);let n=hl();if(!n)return;v&&g.log(`[Profiling] started profiling span: ${P(e).description}`);let r=ge(),o=null;w().setContext("profile",{profile_id:r,start_timestamp:t}),Sl.add(e),Do(e);async function i(){if(e&&n){if(o){v&&g.log("[Profiling] profile for:",P(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(s&&(x.clearTimeout(s),s=void 0),v&&g.log(`[Profiling] stopped profiling of span: ${P(e).description}`),!u){v&&g.log(`[Profiling] profiler returned null profile for: ${P(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=u,oI(r,u)}).catch(u=>{v&&g.log("[Profiling] error while stopping profiler:",u)})}}let s=x.setTimeout(()=>{v&&g.log("[Profiling] max profile duration elapsed, stopping profiling for:",P(e).description),i()},am),a=e.end.bind(e);function c(){return e?(i().then(()=>{a()},()=>{a()}),e):a()}e.end=c}var JL=6e4,XL=3e5,El=class{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(t){let n=t.getOptions().profileLifecycle,r=eI(t.getOptions());v&&g.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||v&&g.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=ge(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t),t.on("spanStart",o=>{this._isRunning&&Do(o)})}start(){if(this._lifecycleMode==="trace"){v&&g.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){v&&g.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){v&&g.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){v&&g.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){v&&g.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;let n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);let r=this._activeRootSpanIds.size;r===1&&(v&&g.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling()),this._isRunning&&Do(t)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,v&&g.log("[Profiling] Started profiling with profiler ID:",this._profilerId),pn().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){v&&g.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{v&&g.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&pn().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){v&&g.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==oe(n))return;if(!n.isRecording()){v&&g.log("[Profiling] Discarding profile because root span was not sampled.");return}let r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);let o=this._activeRootSpanIds.size;o===1&&(v&&g.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),t.on("spanEnd",n=>{if(!this._sessionSampled)return;let r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);let o=this._activeRootSpanIds.size;v&&g.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(i=>{v&&g.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,pn().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);let n=setTimeout(()=>this._onRootSpanTimeout(t),XL);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let t=hl();if(!t){v&&g.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{v&&g.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},JL))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(v&&g.log(`[Profiling] Reached 5-minute timeout for root span ${t}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(t),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){let t=this._profiler;if(this._profiler=void 0,!!t)try{let n=await t.stop(),r=Vy(n,this._client,this._profilerId),o=Ky(r);if("reason"in o){v&&g.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),v&&g.log("[Profiling] Collected browser profile chunk.")}catch(n){v&&g.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){let n=this._client,r=gn(n.getSdkMetadata?.()),o=n.getDsn(),i=n.getOptions().tunnel,s=Me(p(p({event_id:ge(),sent_at:new Date().toISOString()},r&&{sdk:r}),!!i&&o&&{dsn:qe(o)}),[[{type:"profile_chunk",platform:"javascript"},t]]);n.sendEnvelope(s).then(null,a=>{v&&g.error("Error while sending profile chunk envelope:",a)})}};var QL="BrowserProfiling",ZL=()=>({name:QL,setup(e){let t=e.getOptions(),n=new El;if(!xa(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),xa(t)&&!t.profilesSampleRate){v&&g.log("[Profiling] Profiling disabled, no profiling options found.");return}let r=te(),o=r&&oe(r);if(xa(t)&&t.profileSessionSampleRate!==void 0&&v&&g.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),xa(t))o&&gl(o)&&cm(o)&&um(o),e.on("spanStart",i=>{let s=oe(i);i===s?cm(i)&&um(i):Sl.has(s)&&Do(i)}),e.on("beforeEnvelope",i=>{if(!nI())return;let s=Xy(i);if(!s.length)return;let a=[];for(let c of s){let u=c?.contexts,f=u?.profile?.profile_id,l=u?.profile?.start_timestamp;if(typeof f!="string"){v&&g.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!f){v&&g.log("[Profiling] cannot find profile for a span without a profile context");continue}u?.profile&&delete u.profile;let m=rI(f);if(!m){v&&g.log(`[Profiling] Could not retrieve profile for span: ${f}`);continue}let d=tI(f,l,m,c);d&&a.push(d)}Jy(i,a)});else{let i=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),i==="manual")n.initialize(e);else if(i==="trace"){if(!Oe(t)){v&&g.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),o&&n.notifyRootSpanActive(o),x.setTimeout(()=>{let s=te(),a=s&&oe(s);a&&n.notifyRootSpanActive(a)},0)}}}}),eP=ZL;var tP="SpotlightBrowser",nP=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],rP=(e={})=>{let t=e.sidecarUrl||"http://localhost:8969/stream";return{name:tP,setup:()=>{v&&g.log("Using Sidecar URL",t)},beforeSetup(n){let r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...nP]},afterAllSetup:n=>{oP(n,t)}}};function oP(e,t){let n=Pi("fetch"),r=0;e.on("beforeEnvelope",o=>{if(r>3){g.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:Zn(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,g.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}var iP=rP;var sP=()=>({name:"LaunchDarkly",processEvent(e,t,n){return Dt(e)}});function aP(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{Rt(e,t.value),Nt(e,t.value)}}}var cP=()=>({name:"OpenFeature",processEvent(e,t,n){return Dt(e)}}),lm=class{after(t,n){Rt(n.flagKey,n.value),Nt(n.flagKey,n.value)}error(t,n,r){Rt(t.flagKey,t.defaultValue),Nt(t.flagKey,t.defaultValue)}};var uP=({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){let t=e.prototype;ye(t,"isEnabled",lP)},processEvent(t,n,r){return Dt(t)}});function lP(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"?(Rt(n,r),Nt(n,r)):v&&g.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var fP=({growthbookClass:e})=>Wf({growthbookClass:e});var pP=({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",n=>{Rt(n.gate.name,n.gate.value),Nt(n.gate.name,n.gate.value)})},processEvent(t,n,r){return Dt(t)}});async function dP(){let e=I();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";let r=e.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{await bs(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}var mP="WebWorker",_P=({worker:e})=>({name:mP,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(t=>iI(t))},addWorker:t=>iI(t)});function iI(e){e.addEventListener("message",t=>{if(SP(t.data)){if(t.stopImmediatePropagation(),t.data._sentryDebugIds&&(v&&g.log("Sentry debugId web worker message received",t.data),x._sentryDebugIds=p(p({},t.data._sentryDebugIds),x._sentryDebugIds)),t.data._sentryModuleMetadata&&(v&&g.log("Sentry module metadata web worker message received",t.data),x._sentryModuleMetadata=p(p({},t.data._sentryModuleMetadata),x._sentryModuleMetadata)),t.data._sentryWasmImages){v&&g.log("Sentry WASM images web worker message received",t.data);let n=x._sentryWasmImages||[],r=t.data._sentryWasmImages.filter(o=>xe(o)&&typeof o.code_file=="string"&&!n.some(i=>i.code_file===o.code_file));x._sentryWasmImages=[...n,...r]}t.data._sentryWorkerError&&(v&&g.log("Sentry worker rejection message received",t.data._sentryWorkerError),gP(t.data._sentryWorkerError))}})}function gP(e){let t=I();if(!t)return;let n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,o=e.reason,i=je(o)?Xp(o):Ci(n,o,void 0,r,!0);i.level="error",e.filename&&(i.contexts=E(p({},i.contexts),{worker:{filename:e.filename}})),hn(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),v&&g.log("Captured worker unhandled rejection",o)}function hP({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener("unhandledrejection",t=>{let r={reason:Jp(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),v&&g.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),v&&g.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function SP(e){if(!xe(e)||e._sentryMessage!==!0)return!1;let t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,r="_sentryWorkerError"in e,o="_sentryWasmImages"in e;return!(!t&&!n&&!r&&!o||t&&!(xe(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(xe(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!xe(e._sentryWorkerError)||o&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(i=>xe(i)&&typeof i.code_file=="string")))}var sI=typeof __SENTRY_DEBUG__>"u"?!0:__SENTRY_DEBUG__;function TP(e={}){return[fo(),lo(),ui(),sa(),ua(),fa(),mo(),la(),ca(),aa()]}function lX(e){let t=p({defaultIntegrations:TP()},e);return ai(t,"angular"),yP(),Zp(t)}function yP(){let t=Tl?.major&&parseInt(Tl.major,10);t&&(t<14&&sI&&g.warn(`This Sentry SDK does not officially support Angular ${t}.`,"This SDK only supports Angular 14 and above.","If you're using lower Angular versions, check the Angular Version Compatibility table in our docs: https://docs.sentry.io/platforms/javascript/guides/angular/#angular-version-compatibility.","Otherwise, please consider upgrading your Angular version."),oo("angular",{version:t}))}var IP=typeof Zone<"u"&&Zone.root?.run;function An(e){return IP?Zone.root.run(e):e()}function bP(e){return e?.ngOriginalError?e.ngOriginalError:e}function AP(e){return aI(e.error)?e.error:typeof ErrorEvent<"u"&&e.error instanceof ErrorEvent&&e.error.message?e.error.message:typeof e.error=="string"?`Server returned code ${e.status} with body "${e.error}"`:e.message}function aI(e){if(e instanceof Error)return!0;if(e===null||typeof e!="object")return!1;let t=e;return Pe(t.name)&&Pe(t.message)&&(t.stack===void 0||Pe(t.stack))}var vP=(()=>{class e{constructor(n){this._options=p({logErrors:!0},n)}ngOnDestroy(){this._removeAfterSendEventListener&&this._removeAfterSendEventListener()}handleError(n){let r=this._extractError(n)||"Handled unknown error",o=An(()=>J(r,{mechanism:{type:"auto.function.angular.error_handler",handled:!1}}));if(this._options.logErrors&&Ge(()=>console.error(r)),this._options.showDialog){let i=I();i&&!this._removeAfterSendEventListener?this._removeAfterSendEventListener=i.on("afterSendEvent",s=>{!s.type&&s.event_id&&An(()=>{Ou(E(p({},this._options.dialogOptions),{eventId:s.event_id}))})}):i||An(()=>{Ou(E(p({},this._options.dialogOptions),{eventId:o}))})}}_extractError(n){if(this._options.extractor){let r=this._defaultExtractor.bind(this);return this._options.extractor(n,r)}return this._defaultExtractor(n)}_defaultExtractor(n){let r=bP(n);return r instanceof Sm?AP(r):typeof r=="string"||aI(r)?r:null}}return e.\u0275fac=function(n){return new(n||e)(Il("errorHandlerOptions"))},e.\u0275prov=yl({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function fX(e){return new vP(e)}var RP="ui.angular.routing",cI="ui.angular.init",NP="ui.angular",uI;function pX(e={}){return e.instrumentNavigation!==!1&&(uI=!0),nm(E(p({},e),{instrumentNavigation:!1}))}function CP(e,t){let n=t&&P(t).data||{};t&&n[Ie]==="url"&&(t.updateName(e),t.setAttribute(Ie,"route"),t.setAttribute(G,`auto.${P(t).op}.angular`))}var dX=(()=>{class e{constructor(n){this._router=n,this.navStart$=this._router.events.pipe(Oa(r=>r instanceof Em),Ma(r=>{if(!uI){sI&&g.error("Angular integration has tracing enabled, but Tracing integration is not configured");return}this._routingSpan&&(this._routingSpan.end(),this._routingSpan=null);let o=I(),i=Rr(r.url);if(o){this._isPageloadOngoing()?this._pageloadOngoing=!1:An(()=>{ml(o,{name:i,attributes:{[G]:"auto.navigation.angular",[Ie]:"url"}})}),this._routingSpan=An(()=>Ue({name:`${r.url}`,op:RP,attributes:p({[G]:"auto.ui.angular",[Ie]:"url",url:i},r.navigationTrigger&&{navigationTrigger:r.navigationTrigger})}))||null;return}})),this.resEnd$=this._router.events.pipe(Oa(r=>r instanceof bm),Ma(r=>{let o=xP(r.state.root);o&&w().setTransactionName(o);let i=te(),s=i&&oe(i);CP(o,s)})),this.navEnd$=this._router.events.pipe(Oa(r=>r instanceof Tm||r instanceof ym||r instanceof Im),Ma(()=>{this._routingSpan&&(An(()=>{this._routingSpan.end()}),this._routingSpan=null)})),this._routingSpan=null,this._pageloadOngoing=!0,this._subscription=new pm,this._subscription.add(this.navStart$.subscribe()),this._subscription.add(this.resEnd$.subscribe()),this._subscription.add(this.navEnd$.subscribe())}ngOnDestroy(){this._subscription.unsubscribe()}_isPageloadOngoing(){if(!this._pageloadOngoing)return!1;let n=te();if(!n)return this._pageloadOngoing=!1,!1;let r=oe(n);return this._pageloadOngoing=P(r).op==="pageload",this._pageloadOngoing}}return e.\u0275fac=function(n){return new(n||e)(Il(Am))},e.\u0275prov=yl({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),mX=(()=>{class e{constructor(n){this._host=n}ngOnInit(){this.componentName||(this.componentName=this._host.nativeElement.tagName.toLowerCase()),te()&&(this._tracingSpan=An(()=>Ue({name:`<${this.componentName}>`,op:cI,attributes:{[G]:"auto.ui.angular.trace_directive"}})))}ngAfterViewInit(){let n=this._tracingSpan;n&&An(()=>n.end())}}return e.\u0275fac=function(n){return new(n||e)(_m(mm))},e.\u0275dir=hm({type:e,selectors:[["","trace",""]],inputs:{componentName:[0,"trace","componentName"]},standalone:!1}),e})(),_X=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=gm({type:e}),e.\u0275inj=dm({}),e})();function gX(e){let t;return n=>{let r=n.prototype.ngOnInit;n.prototype.ngOnInit=function(...i){if(t=An(()=>Ue({onlyIfParent:!0,name:`<${e?.name||"unnamed"}>`,op:cI,attributes:{[G]:"auto.ui.angular.trace_class_decorator"}})),r)return r.apply(this,i)};let o=n.prototype.ngAfterViewInit;n.prototype.ngAfterViewInit=function(...i){if(t&&An(()=>t.end()),o)return o.apply(this,i)}}}function hX(e){return(t,n,r)=>{let o=r.value;return r.value=function(...i){let s=ne();if(An(()=>{Ue({onlyIfParent:!0,name:`<${e?.name?e.name:"unnamed"}>`,op:`${NP}.${String(n)}`,startTime:s,attributes:{[G]:"auto.ui.angular.trace_method_decorator"}}).end(s)}),o)return o.apply(this,i)},r}}function xP(e){let t=[],n=e?.firstChild;for(;n;){let o=n?.routeConfig&&n.routeConfig.path;if(o==null)break;t.push(o),n=n.firstChild}let r=t.filter(o=>o).join("/");return r?`/${r}/`:"/"}export{Qs as BrowserClient,Ds as MULTIPLEXED_TRANSPORT_EXTRA_KEY,lm as OpenFeatureIntegrationHook,Lt as SDK_VERSION,Z as SEMANTIC_ATTRIBUTE_SENTRY_OP,G as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,qn as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,Ie as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,mt as Scope,vP as SentryErrorHandler,gX as TraceClass,mX as TraceDirective,hX as TraceMethod,_X as TraceModule,dX as TraceService,x as WINDOW,gt as addBreadcrumb,ws as addEventProcessor,ni as addIntegration,w_ as bindScopeToEmitter,sa as breadcrumbsIntegration,Kp as browserApiErrorsIntegration,eP as browserProfilingIntegration,aa as browserSessionIntegration,pX as browserTracingIntegration,aP as buildLaunchDarklyFlagUsedHandler,Lg as captureConsoleIntegration,hn as captureEvent,J as captureException,Fs as captureFeedback,Ns as captureMessage,io as captureSession,HE as chromeStackLineParser,df as close,ih as consoleLoggingIntegration,d0 as contextLinesIntegration,Yl as continueTrace,sh as createConsolaReporter,fX as createErrorHandler,js as createLangChainCallbackHandler,xc as createTransport,pw as createUserFeedbackEnvelope,ca as cultureContextIntegration,mo as dedupeIntegration,dl as defaultRequestInstrumentationOptions,$E as defaultStackLineParsers,Vp as defaultStackParser,dP as diagnoseSdkConnectivity,UE as elementTimingIntegration,ks as endSession,Mc as eventFiltersIntegration,yp as eventFromException,Ip as eventFromMessage,Xs as exceptionFromError,Bg as extraErrorDataIntegration,eh as featureFlagsIntegration,CC as feedbackAsyncIntegration,fE as feedbackIntegration,fE as feedbackSyncIntegration,Qd as fetchStreamPerformanceIntegration,pf as flush,qw as forceLoad,lo as functionToStringIntegration,GE as geckoStackLineParser,te as getActiveSpan,I as getClient,w as getCurrentScope,TP as getDefaultIntegrations,BN as getFeedback,pn as getGlobalScope,re as getIsolationScope,VM as getReplay,oe as getRootSpan,Kn as getSpanDescendants,Fl as getSpanStatusFromHttpCode,ci as getTraceData,ua as globalHandlersIntegration,y0 as graphqlClientIntegration,fP as growthbookIntegration,e0 as httpClientIntegration,la as httpContextIntegration,fo as inboundFiltersIntegration,lX as init,Yh as instrumentAnthropicAiClient,gS as instrumentCreateReactAgent,Zh as instrumentGoogleGenAIClient,vS as instrumentLangChainEmbeddings,hS as instrumentLangGraph,Dh as instrumentOpenAiClient,Xd as instrumentOutgoingRequests,$f as instrumentSupabaseClient,Fy as isBotUserAgent,xs as isEnabled,mf as isInitialized,Cs as lastEventId,sP as launchDarklyIntegration,Sp as lazyLoadIntegration,fa as linkedErrorsIntegration,zf as logger,BL as makeBrowserOfflineTransport,ia as makeFetchTransport,yg as makeMultiplexedTransport,_o as metrics,Og as moduleMetadataIntegration,Qp as normalizeStringifyValue,Yw as onLoad,cP as openFeatureIntegration,cw as opera10StackLineParser,fw as opera11StackLineParser,Uf as parameterize,dc as registerSpanErrorInstrumentation,hP as registerWebWorker,fL as replayCanvasIntegration,qM as replayIntegration,xL as reportPageLoaded,Xw as reportingObserverIntegration,jg as rewriteFramesIntegration,JS as sendFeedback,wL as setActiveSpanInBrowser,uf as setAttribute,cf as setAttributes,oo as setContext,ff as setConversationId,kf as setCurrentClient,of as setExtra,rf as setExtras,Vn as setHttpStatus,Xo as setMeasurement,af as setTag,sf as setTags,lf as setUser,Ou as showReportDialog,kL as spanStreamingIntegration,ql as spanToBaggageHeader,P as spanToJSON,_s as spanToTraceHeader,iP as spotlightBrowserIntegration,ml as startBrowserTracingNavigationSpan,Hy as startBrowserTracingPageLoadSpan,Ue as startInactiveSpan,Ec as startNewTrace,ti as startSession,Ve as startSpan,_t as startSpanManual,pP as statsigIntegration,Vg as supabaseIntegration,bs as suppressTracing,Xg as thirdPartyErrorFilterIntegration,Wx as uiProfiler,uP as unleashIntegration,jl as updateSpanName,I0 as viewHierarchyIntegration,em as webVitalsIntegration,_P as webWorkerIntegration,iw as winjsStackLineParser,yr as withActiveSpan,za as withIsolationScope,$e as withScope,__ as withStreamedSpan,Kg as zodErrorsIntegration};
|