@okxweb3/a2a-openclaw 0.0.13 → 0.0.14
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/index.js +28 -28
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
var __importMetaUrl=require('url').pathToFileURL(__filename).href;
|
|
2
|
-
"use strict";var kh=Object.create;var Lr=Object.defineProperty;var xh=Object.getOwnPropertyDescriptor;var Ph=Object.getOwnPropertyNames;var Uh=Object.getPrototypeOf,Mh=Object.prototype.hasOwnProperty;var Te=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fd=(t,e)=>{for(var n in e)Lr(t,n,{get:e[n],enumerable:!0})},gd=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ph(e))!Mh.call(t,s)&&s!==n&&Lr(t,s,{get:()=>e[s],enumerable:!(r=xh(e,s))||r.enumerable});return t};var Lh=(t,e,n)=>(n=t!=null?kh(Uh(t)):{},gd(e||!t||!t.__esModule?Lr(n,"default",{value:t,enumerable:!0}):n,t)),qh=t=>gd(Lr({},"__esModule",{value:!0}),t);function Fh(t=new Date){return t.toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1})}function Hi(t){return[`[${Fh()}]`,...t]}function y(...t){console.log(...Hi(t))}function _d(...t){console.warn(...Hi(t))}function hd(...t){console.error(...Hi(t))}var ee=Te(()=>{"use strict"});function md(t){Yi=t}function Je(){if(!Yi)throw new Error("[xmtp] PluginRuntime not initialized \u2014 ensure setXmtpRuntime is called in register()");return Yi}var Yi,vn=Te(()=>{"use strict";Yi=null});var oe=g($=>{Object.defineProperty($,"__esModule",{value:!0});var Ed=Object.prototype.toString;function Gh(t){switch(Ed.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return qr(t,Error)}}function Bt(t,e){return Ed.call(t)===`[object ${e}]`}function Bh(t){return Bt(t,"ErrorEvent")}function $h(t){return Bt(t,"DOMError")}function jh(t){return Bt(t,"DOMException")}function Hh(t){return Bt(t,"String")}function Yh(t){return t===null||typeof t!="object"&&typeof t!="function"}function yd(t){return Bt(t,"Object")}function Kh(t){return typeof Event<"u"&&qr(t,Event)}function Wh(t){return typeof Element<"u"&&qr(t,Element)}function Vh(t){return Bt(t,"RegExp")}function zh(t){return!!(t&&t.then&&typeof t.then=="function")}function Xh(t){return yd(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Jh(t){return typeof t=="number"&&t!==t}function qr(t,e){try{return t instanceof e}catch{return!1}}function Qh(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}$.isDOMError=$h;$.isDOMException=jh;$.isElement=Wh;$.isError=Gh;$.isErrorEvent=Bh;$.isEvent=Kh;$.isInstanceOf=qr;$.isNaN=Jh;$.isPlainObject=yd;$.isPrimitive=Yh;$.isRegExp=Vh;$.isString=Hh;$.isSyntheticEvent=Xh;$.isThenable=zh;$.isVueViewModel=Qh});var Rn=g(ft=>{Object.defineProperty(ft,"__esModule",{value:!0});var Fr=oe();function Zh(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function em(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let s=Math.max(e-60,0);s<5&&(s=0);let i=Math.min(s+140,r);return i>r-5&&(i=r),i===r&&(s=Math.max(i-140,0)),n=n.slice(s,i),s>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function tm(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let s=t[r];try{Fr.isVueViewModel(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Sd(t,e,n=!1){return Fr.isString(t)?Fr.isRegExp(e)?e.test(t):Fr.isString(e)?n?t===e:t.includes(e):!1:!1}function nm(t,e=[],n=!1){return e.some(r=>Sd(t,r,n))}ft.isMatchingPattern=Sd;ft.safeJoin=tm;ft.snipLine=em;ft.stringMatchesSomePattern=nm;ft.truncate=Zh});var Id=g(Vi=>{Object.defineProperty(Vi,"__esModule",{value:!0});var Ki=oe(),rm=Rn();function sm(t,e,n=250,r,s,i,o){if(!i.exception||!i.exception.values||!o||!Ki.isInstanceOf(o.originalException,Error))return;let a=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;a&&(i.exception.values=im(Wi(t,e,s,o.originalException,r,i.exception.values,a,0),n))}function Wi(t,e,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(Ki.isInstanceOf(r[s],Error)){Td(o,a);let u=t(e,r[s]),d=c.length;bd(u,s,d,a),c=Wi(t,e,n,r[s],s,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Ki.isInstanceOf(u,Error)){Td(o,a);let l=t(e,u),p=c.length;bd(l,`errors[${d}]`,p,a),c=Wi(t,e,n,u,s,[l,...c],l,p)}}),c}function Td(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function bd(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function im(t,e){return t.map(n=>(n.value&&(n.value=rm.truncate(n.value,e)),n))}Vi.applyAggregateErrorsToEvent=sm});var Me=g(Cn=>{Object.defineProperty(Cn,"__esModule",{value:!0});function Gr(t){return t&&t.Math==Math?t:void 0}var zi=typeof globalThis=="object"&&Gr(globalThis)||typeof window=="object"&&Gr(window)||typeof self=="object"&&Gr(self)||typeof global=="object"&&Gr(global)||(function(){return this})()||{};function om(){return zi}function am(t,e,n){let r=n||zi,s=r.__SENTRY__=r.__SENTRY__||{};return s[t]||(s[t]=e())}Cn.GLOBAL_OBJ=zi;Cn.getGlobalObject=om;Cn.getGlobalSingleton=am});var Xi=g(Dn=>{Object.defineProperty(Dn,"__esModule",{value:!0});var cm=oe(),um=Me(),Br=um.getGlobalObject(),dm=80;function lm(t,e={}){try{let n=t,r=5,s=[],i=0,o=0,a=" > ",c=a.length,u,d=Array.isArray(e)?e:e.keyAttrs,l=!Array.isArray(e)&&e.maxStringLength||dm;for(;n&&i++<r&&(u=pm(n,d),!(u==="html"||i>1&&o+s.length*c+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function pm(t,e){let n=t,r=[],s,i,o,a,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());let u=e&&e.length?e.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(u&&u.length)u.forEach(l=>{r.push(`[${l[0]}="${l[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),s=n.className,s&&cm.isString(s))for(i=s.split(/\s+/),c=0;c<i.length;c++)r.push(`.${i[c]}`);let d=["aria-label","type","name","title","alt"];for(c=0;c<d.length;c++)o=d[c],a=n.getAttribute(o),a&&r.push(`[${o}="${a}"]`);return r.join("")}function fm(){try{return Br.document.location.href}catch{return""}}function gm(t){return Br.document&&Br.document.querySelector?Br.document.querySelector(t):null}Dn.getDomElement=gm;Dn.getLocationHref=fm;Dn.htmlTreeAsString=lm});var gt=g($t=>{Object.defineProperty($t,"__esModule",{value:!0});var Ji=Me(),_m="Sentry Logger ",Qi=["debug","info","warn","error","log","assert","trace"],Zi={};function Ad(t){if(!("console"in Ji.GLOBAL_OBJ))return t();let e=Ji.GLOBAL_OBJ.console,n={},r=Object.keys(Zi);r.forEach(s=>{let i=Zi[s];n[s]=e[s],e[s]=i});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function hm(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Qi.forEach(n=>{e[n]=(...r)=>{t&&Ad(()=>{Ji.GLOBAL_OBJ.console[n](`${_m}[${n}]:`,...r)})}}):Qi.forEach(n=>{e[n]=()=>{}}),e}var mm=hm();$t.CONSOLE_LEVELS=Qi;$t.consoleSandbox=Ad;$t.logger=mm;$t.originalConsoleMethods=Zi});var eo=g(On=>{Object.defineProperty(On,"__esModule",{value:!0});var $r=gt(),Em=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ym(t){return t==="http"||t==="https"}function Sm(t,e=!1){let{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function vd(t){let e=Em.exec(t);if(!e){console.error(`Invalid Sentry Dsn: ${t}`);return}let[n,r,s="",i,o="",a]=e.slice(1),c="",u=a,d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){let l=u.match(/^\d+/);l&&(u=l[0])}return Rd({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}function Rd(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Tm(t){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:($r.logger.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?ym(r)?e&&isNaN(parseInt(e,10))?($r.logger.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:($r.logger.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):($r.logger.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function bm(t){let e=typeof t=="string"?vd(t):Rd(t);if(!(!e||!Tm(e)))return e}On.dsnFromString=vd;On.dsnToString=Sm;On.makeDsn=bm});var ro=g(no=>{Object.defineProperty(no,"__esModule",{value:!0});var to=class extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}};no.SentryError=to});var Qe=g(ge=>{Object.defineProperty(ge,"__esModule",{value:!0});var Im=Xi(),jt=oe(),Am=gt(),Cd=Rn();function vm(t,e,n){if(!(e in t))return;let r=t[e],s=n(r);typeof s=="function"&&wd(s,r),t[e]=s}function Nd(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Am.logger.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function wd(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,Nd(t,"__sentry_original__",e)}catch{}}function Rm(t){return t.__sentry_original__}function Cm(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function kd(t){if(jt.isError(t))return{message:t.message,name:t.name,stack:t.stack,...Od(t)};if(jt.isEvent(t)){let e={type:t.type,target:Dd(t.target),currentTarget:Dd(t.currentTarget),...Od(t)};return typeof CustomEvent<"u"&&jt.isInstanceOf(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Dd(t){try{return jt.isElement(t)?Im.htmlTreeAsString(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Od(t){if(typeof t=="object"&&t!==null){let e={};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function Dm(t,e=40){let n=Object.keys(kd(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return Cd.truncate(n[0],e);for(let r=n.length;r>0;r--){let s=n.slice(0,r).join(", ");if(!(s.length>e))return r===n.length?s:Cd.truncate(s,e)}return""}function Om(t){return so(t,new Map)}function so(t,e){if(jt.isPlainObject(t)){let n=e.get(t);if(n!==void 0)return n;let r={};e.set(t,r);for(let s of Object.keys(t))typeof t[s]<"u"&&(r[s]=so(t[s],e));return r}if(Array.isArray(t)){let n=e.get(t);if(n!==void 0)return n;let r=[];return e.set(t,r),t.forEach(s=>{r.push(so(s,e))}),r}return t}function Nm(t){let e;switch(!0){case t==null:e=new String(t);break;case(typeof t=="symbol"||typeof t=="bigint"):e=Object(t);break;case jt.isPrimitive(t):e=new t.constructor(t);break;default:e=t;break}return e}ge.addNonEnumerableProperty=Nd;ge.convertToPlainObject=kd;ge.dropUndefinedKeys=Om;ge.extractExceptionKeysForMessage=Dm;ge.fill=vm;ge.getOriginalFunction=Rm;ge.markFunctionWrapped=wd;ge.objectify=Nm;ge.urlEncode=Cm});var Hr=g(jr=>{Object.defineProperty(jr,"__esModule",{value:!0});function xd(t,e=!1){return!(e||t&&!t.startsWith("/")&&!t.includes(":\\")&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&t!==void 0&&!t.includes("node_modules/")}function wm(t){let e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{let s=r.match(n);if(s){let i,o,a,c,u;if(s[1]){a=s[1];let p=a.lastIndexOf(".");if(a[p-1]==="."&&p--,p>0){i=a.slice(0,p),o=a.slice(p+1);let f=i.indexOf(".Module");f>0&&(a=a.slice(f+1),i=i.slice(0,f))}c=void 0}o&&(c=i,u=o),o==="<anonymous>"&&(u=void 0,a=void 0),a===void 0&&(u=u||"<anonymous>",a=c?`${c}.${u}`:u);let d=s[2]&&s[2].startsWith("file://")?s[2].slice(7):s[2],l=s[5]==="native";return!d&&s[5]&&!l&&(d=s[5]),{filename:d,module:t?t(d):void 0,function:a,lineno:parseInt(s[3],10)||void 0,colno:parseInt(s[4],10)||void 0,in_app:xd(d,l)}}if(r.match(e))return{filename:r}}}jr.filenameIsInApp=xd;jr.node=wm});var Nn=g(Ze=>{Object.defineProperty(Ze,"__esModule",{value:!0});var Md=Hr(),Ld=50,Pd=/\(error: (.*)\)/,Ud=/captureMessage|captureException/;function qd(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{let s=[],i=n.split(`
|
|
3
|
-
`);for(let o=r;o<i.length;o++){let a=i[o];if(a.length>1024)continue;let c=
|
|
2
|
+
"use strict";var Ph=Object.create;var Lr=Object.defineProperty;var xh=Object.getOwnPropertyDescriptor;var Uh=Object.getOwnPropertyNames;var Mh=Object.getPrototypeOf,Lh=Object.prototype.hasOwnProperty;var Te=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fd=(t,e)=>{for(var n in e)Lr(t,n,{get:e[n],enumerable:!0})},gd=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Uh(e))!Lh.call(t,s)&&s!==n&&Lr(t,s,{get:()=>e[s],enumerable:!(r=xh(e,s))||r.enumerable});return t};var qh=(t,e,n)=>(n=t!=null?Ph(Mh(t)):{},gd(e||!t||!t.__esModule?Lr(n,"default",{value:t,enumerable:!0}):n,t)),Fh=t=>gd(Lr({},"__esModule",{value:!0}),t);function Gh(t=new Date){return t.toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1})}function Hi(t){return[`[${Gh()}]`,...t]}function y(...t){console.log(...Hi(t))}function _d(...t){console.warn(...Hi(t))}function hd(...t){console.error(...Hi(t))}var ee=Te(()=>{"use strict"});function md(t){Yi=t}function Je(){if(!Yi)throw new Error("[xmtp] PluginRuntime not initialized \u2014 ensure setXmtpRuntime is called in register()");return Yi}var Yi,vn=Te(()=>{"use strict";Yi=null});var oe=g($=>{Object.defineProperty($,"__esModule",{value:!0});var Ed=Object.prototype.toString;function Bh(t){switch(Ed.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return qr(t,Error)}}function Bt(t,e){return Ed.call(t)===`[object ${e}]`}function $h(t){return Bt(t,"ErrorEvent")}function jh(t){return Bt(t,"DOMError")}function Hh(t){return Bt(t,"DOMException")}function Yh(t){return Bt(t,"String")}function Kh(t){return t===null||typeof t!="object"&&typeof t!="function"}function yd(t){return Bt(t,"Object")}function Wh(t){return typeof Event<"u"&&qr(t,Event)}function Vh(t){return typeof Element<"u"&&qr(t,Element)}function zh(t){return Bt(t,"RegExp")}function Xh(t){return!!(t&&t.then&&typeof t.then=="function")}function Jh(t){return yd(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Qh(t){return typeof t=="number"&&t!==t}function qr(t,e){try{return t instanceof e}catch{return!1}}function Zh(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}$.isDOMError=jh;$.isDOMException=Hh;$.isElement=Vh;$.isError=Bh;$.isErrorEvent=$h;$.isEvent=Wh;$.isInstanceOf=qr;$.isNaN=Qh;$.isPlainObject=yd;$.isPrimitive=Kh;$.isRegExp=zh;$.isString=Yh;$.isSyntheticEvent=Jh;$.isThenable=Xh;$.isVueViewModel=Zh});var Rn=g(ft=>{Object.defineProperty(ft,"__esModule",{value:!0});var Fr=oe();function em(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function tm(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let s=Math.max(e-60,0);s<5&&(s=0);let i=Math.min(s+140,r);return i>r-5&&(i=r),i===r&&(s=Math.max(i-140,0)),n=n.slice(s,i),s>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function nm(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let s=t[r];try{Fr.isVueViewModel(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Sd(t,e,n=!1){return Fr.isString(t)?Fr.isRegExp(e)?e.test(t):Fr.isString(e)?n?t===e:t.includes(e):!1:!1}function rm(t,e=[],n=!1){return e.some(r=>Sd(t,r,n))}ft.isMatchingPattern=Sd;ft.safeJoin=nm;ft.snipLine=tm;ft.stringMatchesSomePattern=rm;ft.truncate=em});var Id=g(Vi=>{Object.defineProperty(Vi,"__esModule",{value:!0});var Ki=oe(),sm=Rn();function im(t,e,n=250,r,s,i,o){if(!i.exception||!i.exception.values||!o||!Ki.isInstanceOf(o.originalException,Error))return;let a=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;a&&(i.exception.values=om(Wi(t,e,s,o.originalException,r,i.exception.values,a,0),n))}function Wi(t,e,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(Ki.isInstanceOf(r[s],Error)){Td(o,a);let u=t(e,r[s]),d=c.length;bd(u,s,d,a),c=Wi(t,e,n,r[s],s,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Ki.isInstanceOf(u,Error)){Td(o,a);let l=t(e,u),p=c.length;bd(l,`errors[${d}]`,p,a),c=Wi(t,e,n,u,s,[l,...c],l,p)}}),c}function Td(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function bd(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function om(t,e){return t.map(n=>(n.value&&(n.value=sm.truncate(n.value,e)),n))}Vi.applyAggregateErrorsToEvent=im});var Me=g(Cn=>{Object.defineProperty(Cn,"__esModule",{value:!0});function Gr(t){return t&&t.Math==Math?t:void 0}var zi=typeof globalThis=="object"&&Gr(globalThis)||typeof window=="object"&&Gr(window)||typeof self=="object"&&Gr(self)||typeof global=="object"&&Gr(global)||(function(){return this})()||{};function am(){return zi}function cm(t,e,n){let r=n||zi,s=r.__SENTRY__=r.__SENTRY__||{};return s[t]||(s[t]=e())}Cn.GLOBAL_OBJ=zi;Cn.getGlobalObject=am;Cn.getGlobalSingleton=cm});var Xi=g(Dn=>{Object.defineProperty(Dn,"__esModule",{value:!0});var um=oe(),dm=Me(),Br=dm.getGlobalObject(),lm=80;function pm(t,e={}){try{let n=t,r=5,s=[],i=0,o=0,a=" > ",c=a.length,u,d=Array.isArray(e)?e:e.keyAttrs,l=!Array.isArray(e)&&e.maxStringLength||lm;for(;n&&i++<r&&(u=fm(n,d),!(u==="html"||i>1&&o+s.length*c+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function fm(t,e){let n=t,r=[],s,i,o,a,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());let u=e&&e.length?e.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(u&&u.length)u.forEach(l=>{r.push(`[${l[0]}="${l[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),s=n.className,s&&um.isString(s))for(i=s.split(/\s+/),c=0;c<i.length;c++)r.push(`.${i[c]}`);let d=["aria-label","type","name","title","alt"];for(c=0;c<d.length;c++)o=d[c],a=n.getAttribute(o),a&&r.push(`[${o}="${a}"]`);return r.join("")}function gm(){try{return Br.document.location.href}catch{return""}}function _m(t){return Br.document&&Br.document.querySelector?Br.document.querySelector(t):null}Dn.getDomElement=_m;Dn.getLocationHref=gm;Dn.htmlTreeAsString=pm});var gt=g($t=>{Object.defineProperty($t,"__esModule",{value:!0});var Ji=Me(),hm="Sentry Logger ",Qi=["debug","info","warn","error","log","assert","trace"],Zi={};function Ad(t){if(!("console"in Ji.GLOBAL_OBJ))return t();let e=Ji.GLOBAL_OBJ.console,n={},r=Object.keys(Zi);r.forEach(s=>{let i=Zi[s];n[s]=e[s],e[s]=i});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function mm(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Qi.forEach(n=>{e[n]=(...r)=>{t&&Ad(()=>{Ji.GLOBAL_OBJ.console[n](`${hm}[${n}]:`,...r)})}}):Qi.forEach(n=>{e[n]=()=>{}}),e}var Em=mm();$t.CONSOLE_LEVELS=Qi;$t.consoleSandbox=Ad;$t.logger=Em;$t.originalConsoleMethods=Zi});var eo=g(On=>{Object.defineProperty(On,"__esModule",{value:!0});var $r=gt(),ym=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Sm(t){return t==="http"||t==="https"}function Tm(t,e=!1){let{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function vd(t){let e=ym.exec(t);if(!e){console.error(`Invalid Sentry Dsn: ${t}`);return}let[n,r,s="",i,o="",a]=e.slice(1),c="",u=a,d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){let l=u.match(/^\d+/);l&&(u=l[0])}return Rd({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}function Rd(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function bm(t){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:($r.logger.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?Sm(r)?e&&isNaN(parseInt(e,10))?($r.logger.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:($r.logger.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):($r.logger.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Im(t){let e=typeof t=="string"?vd(t):Rd(t);if(!(!e||!bm(e)))return e}On.dsnFromString=vd;On.dsnToString=Tm;On.makeDsn=Im});var ro=g(no=>{Object.defineProperty(no,"__esModule",{value:!0});var to=class extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}};no.SentryError=to});var Qe=g(ge=>{Object.defineProperty(ge,"__esModule",{value:!0});var Am=Xi(),jt=oe(),vm=gt(),Cd=Rn();function Rm(t,e,n){if(!(e in t))return;let r=t[e],s=n(r);typeof s=="function"&&wd(s,r),t[e]=s}function Nd(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&vm.logger.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function wd(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,Nd(t,"__sentry_original__",e)}catch{}}function Cm(t){return t.__sentry_original__}function Dm(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function kd(t){if(jt.isError(t))return{message:t.message,name:t.name,stack:t.stack,...Od(t)};if(jt.isEvent(t)){let e={type:t.type,target:Dd(t.target),currentTarget:Dd(t.currentTarget),...Od(t)};return typeof CustomEvent<"u"&&jt.isInstanceOf(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Dd(t){try{return jt.isElement(t)?Am.htmlTreeAsString(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Od(t){if(typeof t=="object"&&t!==null){let e={};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function Om(t,e=40){let n=Object.keys(kd(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return Cd.truncate(n[0],e);for(let r=n.length;r>0;r--){let s=n.slice(0,r).join(", ");if(!(s.length>e))return r===n.length?s:Cd.truncate(s,e)}return""}function Nm(t){return so(t,new Map)}function so(t,e){if(jt.isPlainObject(t)){let n=e.get(t);if(n!==void 0)return n;let r={};e.set(t,r);for(let s of Object.keys(t))typeof t[s]<"u"&&(r[s]=so(t[s],e));return r}if(Array.isArray(t)){let n=e.get(t);if(n!==void 0)return n;let r=[];return e.set(t,r),t.forEach(s=>{r.push(so(s,e))}),r}return t}function wm(t){let e;switch(!0){case t==null:e=new String(t);break;case(typeof t=="symbol"||typeof t=="bigint"):e=Object(t);break;case jt.isPrimitive(t):e=new t.constructor(t);break;default:e=t;break}return e}ge.addNonEnumerableProperty=Nd;ge.convertToPlainObject=kd;ge.dropUndefinedKeys=Nm;ge.extractExceptionKeysForMessage=Om;ge.fill=Rm;ge.getOriginalFunction=Cm;ge.markFunctionWrapped=wd;ge.objectify=wm;ge.urlEncode=Dm});var Hr=g(jr=>{Object.defineProperty(jr,"__esModule",{value:!0});function Pd(t,e=!1){return!(e||t&&!t.startsWith("/")&&!t.includes(":\\")&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&t!==void 0&&!t.includes("node_modules/")}function km(t){let e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{let s=r.match(n);if(s){let i,o,a,c,u;if(s[1]){a=s[1];let p=a.lastIndexOf(".");if(a[p-1]==="."&&p--,p>0){i=a.slice(0,p),o=a.slice(p+1);let f=i.indexOf(".Module");f>0&&(a=a.slice(f+1),i=i.slice(0,f))}c=void 0}o&&(c=i,u=o),o==="<anonymous>"&&(u=void 0,a=void 0),a===void 0&&(u=u||"<anonymous>",a=c?`${c}.${u}`:u);let d=s[2]&&s[2].startsWith("file://")?s[2].slice(7):s[2],l=s[5]==="native";return!d&&s[5]&&!l&&(d=s[5]),{filename:d,module:t?t(d):void 0,function:a,lineno:parseInt(s[3],10)||void 0,colno:parseInt(s[4],10)||void 0,in_app:Pd(d,l)}}if(r.match(e))return{filename:r}}}jr.filenameIsInApp=Pd;jr.node=km});var Nn=g(Ze=>{Object.defineProperty(Ze,"__esModule",{value:!0});var Md=Hr(),Ld=50,xd=/\(error: (.*)\)/,Ud=/captureMessage|captureException/;function qd(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{let s=[],i=n.split(`
|
|
3
|
+
`);for(let o=r;o<i.length;o++){let a=i[o];if(a.length>1024)continue;let c=xd.test(a)?a.replace(xd,"$1"):a;if(!c.match(/\S*Error: /)){for(let u of e){let d=u(c);if(d){s.push(d);break}}if(s.length>=Ld)break}}return Fd(s)}}function Pm(t){return Array.isArray(t)?qd(...t):t}function Fd(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),Ud.test(e[e.length-1].function||"")&&(e.pop(),Ud.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,Ld).map(n=>({...n,filename:n.filename||e[e.length-1].filename,function:n.function||"?"}))}var io="<anonymous>";function xm(t){try{return!t||typeof t!="function"?io:t.name||io}catch{return io}}function Um(t){return[90,Md.node(t)]}Ze.filenameIsInApp=Md.filenameIsInApp;Ze.createStackParser=qd;Ze.getFunctionName=xm;Ze.nodeStackLineParser=Um;Ze.stackParserFromStackParserOptions=Pm;Ze.stripSentryFramesAndReverse=Fd});var co=g(be=>{Object.defineProperty(be,"__esModule",{value:!0});var Mm=gt(),Lm=Me(),Yr=Lm.getGlobalObject();function qm(){try{return new ErrorEvent(""),!0}catch{return!1}}function Fm(){try{return new DOMError(""),!0}catch{return!1}}function Gm(){try{return new DOMException(""),!0}catch{return!1}}function ao(){if(!("fetch"in Yr))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function oo(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Bm(){if(!ao())return!1;if(oo(Yr.fetch))return!0;let t=!1,e=Yr.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=oo(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mm.logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function $m(){return"ReportingObserver"in Yr}function jm(){if(!ao())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch{return!1}}be.isNativeFetch=oo;be.supportsDOMError=Fm;be.supportsDOMException=Gm;be.supportsErrorEvent=qm;be.supportsFetch=ao;be.supportsNativeFetch=Bm;be.supportsReferrerPolicy=jm;be.supportsReportingObserver=$m});var lo=g(uo=>{Object.defineProperty(uo,"__esModule",{value:!0});var Hm=Me(),Kr=Hm.getGlobalObject();function Ym(){let t=Kr.chrome,e=t&&t.app&&t.app.runtime,n="history"in Kr&&!!Kr.history.pushState&&!!Kr.history.replaceState;return!e&&n}uo.supportsHistory=Ym});var Vd=g(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Gd=oe(),kn=gt(),_e=Qe(),Km=Nn(),Wm=co(),_t=Me(),Vm=lo(),q=_t.getGlobalObject(),wn="__sentry_xhr_v2__",ht={},Bd={};function zm(t){if(!Bd[t])switch(Bd[t]=!0,t){case"console":Qm();break;case"dom":Wd();break;case"xhr":Kd();break;case"fetch":Zm();break;case"history":eE();break;case"error":sE();break;case"unhandledrejection":iE();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&kn.logger.warn("unknown instrumentation type:",t);return}}function Xm(t,e){ht[t]=ht[t]||[],ht[t].push(e),zm(t)}function Jm(){Object.keys(ht).forEach(t=>{ht[t]=void 0})}function he(t,e){if(!(!t||!ht[t]))for(let n of ht[t]||[])try{n(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&kn.logger.error(`Error while triggering instrumentation handler.
|
|
4
4
|
Type: ${t}
|
|
5
|
-
Name: ${
|
|
6
|
-
Error:`,r)}}function Jm(){"console"in _t.GLOBAL_OBJ&&kn.CONSOLE_LEVELS.forEach(function(t){t in _t.GLOBAL_OBJ.console&&_e.fill(_t.GLOBAL_OBJ.console,t,function(e){return kn.originalConsoleMethods[t]=e,function(...n){he("console",{args:n,level:t});let r=kn.originalConsoleMethods[t];r&&r.apply(_t.GLOBAL_OBJ.console,n)}})})}function Qm(){Km.supportsNativeFetch()&&_e.fill(_t.GLOBAL_OBJ,"fetch",function(t){return function(...e){let{method:n,url:r}=Yd(e),s={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return he("fetch",{...s}),t.apply(_t.GLOBAL_OBJ,e).then(i=>(he("fetch",{...s,endTimestamp:Date.now(),response:i}),i),i=>{throw he("fetch",{...s,endTimestamp:Date.now(),error:i}),i})}})}function po(t,e){return!!t&&typeof t=="object"&&!!t[e]}function $d(t){return typeof t=="string"?t:t?po(t,"url")?t.url:t.toString?t.toString():"":""}function Yd(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:$d(n),method:po(r,"method")?String(r.method).toUpperCase():"GET"}}let e=t[0];return{url:$d(e),method:po(e,"method")?String(e.method).toUpperCase():"GET"}}function Kd(){if(!q.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;_e.fill(t,"open",function(e){return function(...n){let r=n[1],s=this[wn]={method:Gd.isString(n[0])?n[0].toUpperCase():n[0],url:n[1],request_headers:{}};Gd.isString(r)&&s.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let i=()=>{let o=this[wn];if(o&&this.readyState===4){try{o.status_code=this.status}catch{}he("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?_e.fill(this,"onreadystatechange",function(o){return function(...a){return i(),o.apply(this,a)}}):this.addEventListener("readystatechange",i),_e.fill(this,"setRequestHeader",function(o){return function(...a){let[c,u]=a,d=this[wn];return d&&(d.request_headers[c.toLowerCase()]=u),o.apply(this,a)}}),e.apply(this,n)}}),_e.fill(t,"send",function(e){return function(...n){let r=this[wn];return r&&n[0]!==void 0&&(r.body=n[0]),he("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),e.apply(this,n)}})}var Wr;function Zm(){if(!Wm.supportsHistory())return;let t=q.onpopstate;q.onpopstate=function(...n){let r=q.location.href,s=Wr;if(Wr=r,he("history",{from:s,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){let s=r.length>2?r[2]:void 0;if(s){let i=Wr,o=String(s);Wr=o,he("history",{from:i,to:o})}return n.apply(this,r)}}_e.fill(q.history,"pushState",e),_e.fill(q.history,"replaceState",e)}var eE=1e3,jd,Vr;function tE(t,e){if(t.type!==e.type)return!1;try{if(t.target!==e.target)return!1}catch{}return!0}function nE(t){if(t.type!=="keypress")return!1;try{let e=t.target;if(!e||!e.tagName)return!0;if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)return!1}catch{}return!0}function Hd(t,e=!1){return n=>{if(!n||n._sentryCaptured||nE(n))return;_e.addNonEnumerableProperty(n,"_sentryCaptured",!0);let r=n.type==="keypress"?"input":n.type;(Vr===void 0||!tE(Vr,n))&&(t({event:n,name:r,global:e}),Vr=n),clearTimeout(jd),jd=q.setTimeout(()=>{Vr=void 0},eE)}}function Wd(){if(!q.document)return;let t=he.bind(null,"dom"),e=Hd(t,!0);q.document.addEventListener("click",e,!1),q.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let r=q[n]&&q[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(_e.fill(r,"addEventListener",function(s){return function(i,o,a){if(i==="click"||i=="keypress")try{let c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){let l=Hd(t);d.handler=l,s.call(this,i,l,a)}d.refCount++}catch{}return s.call(this,i,o,a)}}),_e.fill(r,"removeEventListener",function(s){return function(i,o,a){if(i==="click"||i=="keypress")try{let c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(s.call(this,i,d.handler,a),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,o,a)}}))})}var zr=null;function rE(){zr=q.onerror,q.onerror=function(t,e,n,r,s){return he("error",{column:r,error:s,line:n,msg:t,url:e}),zr&&!zr.__SENTRY_LOADER__?zr.apply(this,arguments):!1},q.onerror.__SENTRY_INSTRUMENTED__=!0}var Xr=null;function sE(){Xr=q.onunhandledrejection,q.onunhandledrejection=function(t){return he("unhandledrejection",t),Xr&&!Xr.__SENTRY_LOADER__?Xr.apply(this,arguments):!0},q.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}et.SENTRY_XHR_DATA_KEY=wn;et.addInstrumentationHandler=zm;et.instrumentDOM=Wd;et.instrumentXHR=Kd;et.parseFetchArgs=Yd;et.resetInstrumentationHandlers=Xm});var go=g(fo=>{Object.defineProperty(fo,"__esModule",{value:!0});function iE(){let t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(s){if(t)return e.has(s)?!0:(e.add(s),!1);for(let i=0;i<e.length;i++)if(e[i]===s)return!0;return e.push(s),!1}function r(s){if(t)e.delete(s);else for(let i=0;i<e.length;i++)if(e[i]===s){e.splice(i,1);break}}return[n,r]}fo.memoBuilder=iE});var Jr=g(Ie=>{Object.defineProperty(Ie,"__esModule",{value:!0});var oE=Qe(),_o=Rn(),aE=Me();function cE(){let t=aE.GLOBAL_OBJ,e=t.crypto||t.msCrypto,n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>e.getRandomValues(new Uint8Array(1))[0])}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function zd(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function uE(t){let{message:e,event_id:n}=t;if(e)return e;let r=zd(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function dE(t,e,n){let r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function lE(t,e){let n=zd(t);if(!n)return;let r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...e},e&&"data"in e){let i={...s&&s.data,...e.data};n.mechanism.data=i}}var pE=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function fE(t){let e=t.match(pE)||[],n=parseInt(e[1],10),r=parseInt(e[2],10),s=parseInt(e[3],10);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(s)?void 0:s,prerelease:e[4]}}function gE(t,e,n=5){if(e.lineno===void 0)return;let r=t.length,s=Math.max(Math.min(r-1,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,s-n),s).map(i=>_o.snipLine(i,0)),e.context_line=_o.snipLine(t[Math.min(r-1,s)],e.colno||0),e.post_context=t.slice(Math.min(s+1,r),s+1+n).map(i=>_o.snipLine(i,0))}function _E(t){if(t&&t.__sentry_captured__)return!0;try{oE.addNonEnumerableProperty(t,"__sentry_captured__",!0)}catch{}return!1}function hE(t){return Array.isArray(t)?t:[t]}Ie.addContextToFrame=gE;Ie.addExceptionMechanism=lE;Ie.addExceptionTypeValue=dE;Ie.arrayify=hE;Ie.checkOrSetAlreadyCaught=_E;Ie.getEventDescription=uE;Ie.parseSemver=fE;Ie.uuid4=cE});var ho=g(Qr=>{Object.defineProperty(Qr,"__esModule",{value:!0});function mE(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function EE(){return"npm"}Qr.getSDKSource=EE;Qr.isBrowserBundle=mE});var mo=g((xn,es)=>{Object.defineProperty(xn,"__esModule",{value:!0});var yE=ho();function SE(){return!yE.isBrowserBundle()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Zr(t,e){return t.require(e)}function TE(t){let e;try{e=Zr(es,t)}catch{}try{let{cwd:n}=Zr(es,"process");e=Zr(es,`${n()}/node_modules/${t}`)}catch{}return e}xn.dynamicRequire=Zr;xn.isNodeEnv=SE;xn.loadModule=TE});var Un=g(Pn=>{Object.defineProperty(Pn,"__esModule",{value:!0});var Eo=oe(),bE=go(),IE=Qe(),AE=Nn();function Xd(t,e=100,n=1/0){try{return ts("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Jd(t,e=3,n=100*1024){let r=Xd(t,e);return DE(r)>n?Jd(t,e-1,n):r}function ts(t,e,n=1/0,r=1/0,s=bE.memoBuilder()){let[i,o]=s;if(e==null||["number","boolean","string"].includes(typeof e)&&!Eo.isNaN(e))return e;let a=vE(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(i(e))return"[Circular ~]";let u=e;if(u&&typeof u.toJSON=="function")try{let f=u.toJSON();return ts("",f,c-1,r,s)}catch{}let d=Array.isArray(e)?[]:{},l=0,p=IE.convertToPlainObject(e);for(let f in p){if(!Object.prototype.hasOwnProperty.call(p,f))continue;if(l>=r){d[f]="[MaxProperties ~]";break}let m=p[f];d[f]=ts(f,m,c-1,r,s),l++}return o(e),d}function vE(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Eo.isVueViewModel(e))return"[VueViewModel]";if(Eo.isSyntheticEvent(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${AE.getFunctionName(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=RE(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function RE(t){let e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function CE(t){return~-encodeURI(t).split(/%..|./).length}function DE(t){return CE(JSON.stringify(t))}Pn.normalize=Xd;Pn.normalizeToSize=Jd;Pn.walk=ts});var rl=g(Le=>{Object.defineProperty(Le,"__esModule",{value:!0});function Zd(t,e){let n=0;for(let r=t.length-1;r>=0;r--){let s=t[r];s==="."?t.splice(r,1):s===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var OE=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function el(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=OE.exec(e);return n?n.slice(1):[]}function yo(...t){let e="",n=!1;for(let r=t.length-1;r>=-1&&!n;r--){let s=r>=0?t[r]:"/";s&&(e=`${s}/${e}`,n=s.charAt(0)==="/")}return e=Zd(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function Qd(t){let e=0;for(;e<t.length&&t[e]==="";e++);let n=t.length-1;for(;n>=0&&t[n]==="";n--);return e>n?[]:t.slice(e,n-e+1)}function NE(t,e){t=yo(t).slice(1),e=yo(e).slice(1);let n=Qd(t.split("/")),r=Qd(e.split("/")),s=Math.min(n.length,r.length),i=s;for(let a=0;a<s;a++)if(n[a]!==r[a]){i=a;break}let o=[];for(let a=i;a<n.length;a++)o.push("..");return o=o.concat(r.slice(i)),o.join("/")}function tl(t){let e=nl(t),n=t.slice(-1)==="/",r=Zd(t.split("/").filter(s=>!!s),!e).join("/");return!r&&!e&&(r="."),r&&n&&(r+="/"),(e?"/":"")+r}function nl(t){return t.charAt(0)==="/"}function wE(...t){return tl(t.join("/"))}function kE(t){let e=el(t),n=e[0],r=e[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}function xE(t,e){let n=el(t)[2];return e&&n.slice(e.length*-1)===e&&(n=n.slice(0,n.length-e.length)),n}Le.basename=xE;Le.dirname=kE;Le.isAbsolute=nl;Le.join=wE;Le.normalizePath=tl;Le.relative=NE;Le.resolve=yo});var So=g(Ln=>{Object.defineProperty(Ln,"__esModule",{value:!0});var PE=oe(),qe;(function(t){t[t.PENDING=0]="PENDING";let n=1;t[t.RESOLVED=n]="RESOLVED";let r=2;t[t.REJECTED=r]="REJECTED"})(qe||(qe={}));function UE(t){return new Mn(e=>{e(t)})}function ME(t){return new Mn((e,n)=>{n(t)})}var Mn=class t{constructor(e){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),this._state=qe.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new t((r,s)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{if(i){r(s);return}n(s)})})}__init(){this._resolve=e=>{this._setResult(qe.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(qe.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===qe.PENDING){if(PE.isThenable(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===qe.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===qe.RESOLVED&&n[1](this._value),this._state===qe.REJECTED&&n[2](this._value),n[0]=!0)})}}};Ln.SyncPromise=Mn;Ln.rejectedSyncPromise=ME;Ln.resolvedSyncPromise=UE});var sl=g(bo=>{Object.defineProperty(bo,"__esModule",{value:!0});var LE=ro(),To=So();function qE(t){let e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]}function s(o){if(!n())return To.rejectedSyncPromise(new LE.SentryError("Not adding Promise because buffer limit was reached."));let a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function i(o){return new To.SyncPromise((a,c)=>{let u=e.length;if(!u)return a(!0);let d=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(l=>{To.resolvedSyncPromise(l).then(()=>{--u||(clearTimeout(d),a(!0))},c)})})}return{$:e,add:s,drain:i}}bo.makePromiseBuffer=qE});var Io=g(Ht=>{Object.defineProperty(Ht,"__esModule",{value:!0});function FE(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function GE(t){return t.split(/[\?#]/,1)[0]}function BE(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function $E(t){let{protocol:e,host:n,path:r}=t,s=n&&n.replace(/^.*@/,"[filtered]:[filtered]@").replace(":80","").replace(":443","")||"";return`${e?`${e}://`:""}${s}${r}`}Ht.getNumberOfUrlSegments=BE;Ht.getSanitizedUrlString=$E;Ht.parseUrl=FE;Ht.stripUrlQueryAndFragment=GE});var al=g(Yt=>{Object.defineProperty(Yt,"__esModule",{value:!0});var il=oe(),jE=Un(),HE=Io(),YE={ip:!1,request:!0,transaction:!0,user:!0},KE=["cookies","data","headers","method","query_string","url"],WE=["id","username","email"];function VE(t,e,n){t&&((!t.metadata.source||t.metadata.source==="url")&&t.setName(...ns(e,{path:!0,method:!0})),t.setData("url",e.originalUrl||e.url),e.baseUrl&&t.setData("baseUrl",e.baseUrl),t.setData("query",ol(e,n)))}function ns(t,e={}){let n=t.method&&t.method.toUpperCase(),r="",s="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,s="route"):(t.originalUrl||t.url)&&(r=HE.stripUrlQueryAndFragment(t.originalUrl||t.url||""));let i="";return e.method&&n&&(i+=n),e.method&&e.path&&(i+=" "),e.path&&r&&(i+=r),[i,s]}function zE(t,e){switch(e){case"path":return ns(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"<anonymous>";default:return ns(t,{path:!0,method:!0})[0]}}function XE(t,e){let n={};return(Array.isArray(e)?e:WE).forEach(s=>{t&&s in t&&(n[s]=t[s])}),n}function Ao(t,e){let{include:n=KE,deps:r}=e||{},s={},i=t.headers||{},o=t.method,a=t.hostname||t.host||i.host||"<no host>",c=t.protocol==="https"||t.socket&&t.socket.encrypted?"https":"http",u=t.originalUrl||t.url||"",d=`${c}://${a}${u}`;return n.forEach(l=>{switch(l){case"headers":{s.headers=i;break}case"method":{s.method=o;break}case"url":{s.url=d;break}case"cookies":{s.cookies=t.cookies||i.cookie&&r&&r.cookie&&r.cookie.parse(i.cookie)||{};break}case"query_string":{s.query_string=ol(t,r);break}case"data":{if(o==="GET"||o==="HEAD")break;t.body!==void 0&&(s.data=il.isString(t.body)?t.body:JSON.stringify(jE.normalize(t.body)));break}default:({}).hasOwnProperty.call(t,l)&&(s[l]=t[l])}}),s}function JE(t,e,n){let r={...YE,...n&&n.include};if(r.request){let s=Array.isArray(r.request)?Ao(e,{include:r.request,deps:n&&n.deps}):Ao(e,{deps:n&&n.deps});t.request={...t.request,...s}}if(r.user){let s=e.user&&il.isPlainObject(e.user)?XE(e.user,r.user):{};Object.keys(s).length&&(t.user={...t.user,...s})}if(r.ip){let s=e.ip||e.socket&&e.socket.remoteAddress;s&&(t.user={...t.user,ip_address:s})}return r.transaction&&!t.transaction&&(t.transaction=zE(e,r.transaction)),t}function ol(t,e){let n=t.originalUrl||t.url||"";if(n)return n.startsWith("/")&&(n=`http://dogs.are.great${n}`),t.query||typeof URL!==void 0&&new URL(n).search.replace("?","")||e&&e.url&&e.url.parse(n).query||void 0}Yt.addRequestDataToEvent=JE;Yt.addRequestDataToTransaction=VE;Yt.extractPathForTransaction=ns;Yt.extractRequestData=Ao});var dl=g(qn=>{Object.defineProperty(qn,"__esModule",{value:!0});var cl=["fatal","error","warning","log","info","debug"];function QE(t){return ul(t)}function ul(t){return t==="warn"?"warning":cl.includes(t)?t:"log"}qn.severityFromString=QE;qn.severityLevelFromString=ul;qn.validSeverityLevels=cl});var Ro=g((ae,_l)=>{Object.defineProperty(ae,"__esModule",{value:!0});var pl=mo(),ZE=Me(),fl=ZE.getGlobalObject(),vo={nowSeconds:()=>Date.now()/1e3};function ey(){let{performance:t}=fl;if(!t||!t.now)return;let e=Date.now()-t.now();return{now:()=>t.now(),timeOrigin:e}}function ty(){try{return pl.dynamicRequire(_l,"perf_hooks").performance}catch{return}}var rs=pl.isNodeEnv()?ty():ey(),ll=rs===void 0?vo:{nowSeconds:()=>(rs.timeOrigin+rs.now())/1e3},ny=vo.nowSeconds.bind(vo),gl=ll.nowSeconds.bind(ll),ry=gl,sy=rs!==void 0;ae._browserPerformanceTimeOriginMode=void 0;var iy=(()=>{let{performance:t}=fl;if(!t||!t.now){ae._browserPerformanceTimeOriginMode="none";return}let e=3600*1e3,n=t.now(),r=Date.now(),s=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,i=s<e,o=t.timing&&t.timing.navigationStart,c=typeof o=="number"?Math.abs(o+n-r):e,u=c<e;return i||u?s<=c?(ae._browserPerformanceTimeOriginMode="timeOrigin",t.timeOrigin):(ae._browserPerformanceTimeOriginMode="navigationStart",o):(ae._browserPerformanceTimeOriginMode="dateNow",r)})();ae.browserPerformanceTimeOrigin=iy;ae.dateTimestampInSeconds=ny;ae.timestampInSeconds=gl;ae.timestampWithMs=ry;ae.usingPerformanceAPI=sy});var Do=g(tt=>{Object.defineProperty(tt,"__esModule",{value:!0});var oy=oe(),ay=gt(),cy="baggage",Co="sentry-",ml=/^sentry-/,El=8192;function uy(t){if(!oy.isString(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,s)=>{let i=hl(s);return{...r,...i}},{});else{if(!t)return;e=hl(t)}let n=Object.entries(e).reduce((r,[s,i])=>{if(s.match(ml)){let o=s.slice(Co.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function dy(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,s])=>(s&&(n[`${Co}${r}`]=s),n),{});return ly(e)}function hl(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function ly(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],s)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${e},${i}`;return o.length>El?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ay.logger.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}tt.BAGGAGE_HEADER_NAME=cy;tt.MAX_BAGGAGE_STRING_LENGTH=El;tt.SENTRY_BAGGAGE_KEY_PREFIX=Co;tt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=ml;tt.baggageHeaderToDynamicSamplingContext=uy;tt.dynamicSamplingContextToSentryBaggageHeader=dy});var Tl=g(Kt=>{Object.defineProperty(Kt,"__esModule",{value:!0});var py=Do(),ss=Jr(),yl=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Sl(t){if(!t)return;let e=t.match(yl);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function fy(t,e){let n=Sl(t),r=py.baggageHeaderToDynamicSamplingContext(e),{traceId:s,parentSpanId:i,parentSampled:o}=n||{},a={traceId:s||ss.uuid4(),spanId:ss.uuid4().substring(16),sampled:o};return i&&(a.parentSpanId=i),r&&(a.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:a}}function gy(t=ss.uuid4(),e=ss.uuid4().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}Kt.TRACEPARENT_REGEXP=yl;Kt.extractTraceparentData=Sl;Kt.generateSentryTraceHeader=gy;Kt.tracingContextFromHeaders=fy});var No=g(ce=>{Object.defineProperty(ce,"__esModule",{value:!0});var _y=eo(),hy=Un(),bl=Qe();function my(t,e=[]){return[t,e]}function Ey(t,e){let[n,r]=t;return[n,[...r,e]]}function Il(t,e){let n=t[1];for(let r of n){let s=r[0].type;if(e(r,s))return!0}return!1}function yy(t,e){return Il(t,(n,r)=>e.includes(r))}function Oo(t,e){return(e||new TextEncoder).encode(t)}function Sy(t,e){let[n,r]=t,s=JSON.stringify(n);function i(o){typeof s=="string"?s=typeof o=="string"?s+o:[Oo(s,e),o]:s.push(typeof o=="string"?Oo(o,e):o)}for(let o of r){let[a,c]=o;if(i(`
|
|
5
|
+
Name: ${Km.getFunctionName(n)}
|
|
6
|
+
Error:`,r)}}function Qm(){"console"in _t.GLOBAL_OBJ&&kn.CONSOLE_LEVELS.forEach(function(t){t in _t.GLOBAL_OBJ.console&&_e.fill(_t.GLOBAL_OBJ.console,t,function(e){return kn.originalConsoleMethods[t]=e,function(...n){he("console",{args:n,level:t});let r=kn.originalConsoleMethods[t];r&&r.apply(_t.GLOBAL_OBJ.console,n)}})})}function Zm(){Wm.supportsNativeFetch()&&_e.fill(_t.GLOBAL_OBJ,"fetch",function(t){return function(...e){let{method:n,url:r}=Yd(e),s={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return he("fetch",{...s}),t.apply(_t.GLOBAL_OBJ,e).then(i=>(he("fetch",{...s,endTimestamp:Date.now(),response:i}),i),i=>{throw he("fetch",{...s,endTimestamp:Date.now(),error:i}),i})}})}function po(t,e){return!!t&&typeof t=="object"&&!!t[e]}function $d(t){return typeof t=="string"?t:t?po(t,"url")?t.url:t.toString?t.toString():"":""}function Yd(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:$d(n),method:po(r,"method")?String(r.method).toUpperCase():"GET"}}let e=t[0];return{url:$d(e),method:po(e,"method")?String(e.method).toUpperCase():"GET"}}function Kd(){if(!q.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;_e.fill(t,"open",function(e){return function(...n){let r=n[1],s=this[wn]={method:Gd.isString(n[0])?n[0].toUpperCase():n[0],url:n[1],request_headers:{}};Gd.isString(r)&&s.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let i=()=>{let o=this[wn];if(o&&this.readyState===4){try{o.status_code=this.status}catch{}he("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?_e.fill(this,"onreadystatechange",function(o){return function(...a){return i(),o.apply(this,a)}}):this.addEventListener("readystatechange",i),_e.fill(this,"setRequestHeader",function(o){return function(...a){let[c,u]=a,d=this[wn];return d&&(d.request_headers[c.toLowerCase()]=u),o.apply(this,a)}}),e.apply(this,n)}}),_e.fill(t,"send",function(e){return function(...n){let r=this[wn];return r&&n[0]!==void 0&&(r.body=n[0]),he("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),e.apply(this,n)}})}var Wr;function eE(){if(!Vm.supportsHistory())return;let t=q.onpopstate;q.onpopstate=function(...n){let r=q.location.href,s=Wr;if(Wr=r,he("history",{from:s,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){let s=r.length>2?r[2]:void 0;if(s){let i=Wr,o=String(s);Wr=o,he("history",{from:i,to:o})}return n.apply(this,r)}}_e.fill(q.history,"pushState",e),_e.fill(q.history,"replaceState",e)}var tE=1e3,jd,Vr;function nE(t,e){if(t.type!==e.type)return!1;try{if(t.target!==e.target)return!1}catch{}return!0}function rE(t){if(t.type!=="keypress")return!1;try{let e=t.target;if(!e||!e.tagName)return!0;if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)return!1}catch{}return!0}function Hd(t,e=!1){return n=>{if(!n||n._sentryCaptured||rE(n))return;_e.addNonEnumerableProperty(n,"_sentryCaptured",!0);let r=n.type==="keypress"?"input":n.type;(Vr===void 0||!nE(Vr,n))&&(t({event:n,name:r,global:e}),Vr=n),clearTimeout(jd),jd=q.setTimeout(()=>{Vr=void 0},tE)}}function Wd(){if(!q.document)return;let t=he.bind(null,"dom"),e=Hd(t,!0);q.document.addEventListener("click",e,!1),q.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let r=q[n]&&q[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(_e.fill(r,"addEventListener",function(s){return function(i,o,a){if(i==="click"||i=="keypress")try{let c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){let l=Hd(t);d.handler=l,s.call(this,i,l,a)}d.refCount++}catch{}return s.call(this,i,o,a)}}),_e.fill(r,"removeEventListener",function(s){return function(i,o,a){if(i==="click"||i=="keypress")try{let c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(s.call(this,i,d.handler,a),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,o,a)}}))})}var zr=null;function sE(){zr=q.onerror,q.onerror=function(t,e,n,r,s){return he("error",{column:r,error:s,line:n,msg:t,url:e}),zr&&!zr.__SENTRY_LOADER__?zr.apply(this,arguments):!1},q.onerror.__SENTRY_INSTRUMENTED__=!0}var Xr=null;function iE(){Xr=q.onunhandledrejection,q.onunhandledrejection=function(t){return he("unhandledrejection",t),Xr&&!Xr.__SENTRY_LOADER__?Xr.apply(this,arguments):!0},q.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}et.SENTRY_XHR_DATA_KEY=wn;et.addInstrumentationHandler=Xm;et.instrumentDOM=Wd;et.instrumentXHR=Kd;et.parseFetchArgs=Yd;et.resetInstrumentationHandlers=Jm});var go=g(fo=>{Object.defineProperty(fo,"__esModule",{value:!0});function oE(){let t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(s){if(t)return e.has(s)?!0:(e.add(s),!1);for(let i=0;i<e.length;i++)if(e[i]===s)return!0;return e.push(s),!1}function r(s){if(t)e.delete(s);else for(let i=0;i<e.length;i++)if(e[i]===s){e.splice(i,1);break}}return[n,r]}fo.memoBuilder=oE});var Jr=g(Ie=>{Object.defineProperty(Ie,"__esModule",{value:!0});var aE=Qe(),_o=Rn(),cE=Me();function uE(){let t=cE.GLOBAL_OBJ,e=t.crypto||t.msCrypto,n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>e.getRandomValues(new Uint8Array(1))[0])}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function zd(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function dE(t){let{message:e,event_id:n}=t;if(e)return e;let r=zd(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function lE(t,e,n){let r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function pE(t,e){let n=zd(t);if(!n)return;let r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...e},e&&"data"in e){let i={...s&&s.data,...e.data};n.mechanism.data=i}}var fE=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function gE(t){let e=t.match(fE)||[],n=parseInt(e[1],10),r=parseInt(e[2],10),s=parseInt(e[3],10);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(s)?void 0:s,prerelease:e[4]}}function _E(t,e,n=5){if(e.lineno===void 0)return;let r=t.length,s=Math.max(Math.min(r-1,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,s-n),s).map(i=>_o.snipLine(i,0)),e.context_line=_o.snipLine(t[Math.min(r-1,s)],e.colno||0),e.post_context=t.slice(Math.min(s+1,r),s+1+n).map(i=>_o.snipLine(i,0))}function hE(t){if(t&&t.__sentry_captured__)return!0;try{aE.addNonEnumerableProperty(t,"__sentry_captured__",!0)}catch{}return!1}function mE(t){return Array.isArray(t)?t:[t]}Ie.addContextToFrame=_E;Ie.addExceptionMechanism=pE;Ie.addExceptionTypeValue=lE;Ie.arrayify=mE;Ie.checkOrSetAlreadyCaught=hE;Ie.getEventDescription=dE;Ie.parseSemver=gE;Ie.uuid4=uE});var ho=g(Qr=>{Object.defineProperty(Qr,"__esModule",{value:!0});function EE(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function yE(){return"npm"}Qr.getSDKSource=yE;Qr.isBrowserBundle=EE});var mo=g((Pn,es)=>{Object.defineProperty(Pn,"__esModule",{value:!0});var SE=ho();function TE(){return!SE.isBrowserBundle()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Zr(t,e){return t.require(e)}function bE(t){let e;try{e=Zr(es,t)}catch{}try{let{cwd:n}=Zr(es,"process");e=Zr(es,`${n()}/node_modules/${t}`)}catch{}return e}Pn.dynamicRequire=Zr;Pn.isNodeEnv=TE;Pn.loadModule=bE});var Un=g(xn=>{Object.defineProperty(xn,"__esModule",{value:!0});var Eo=oe(),IE=go(),AE=Qe(),vE=Nn();function Xd(t,e=100,n=1/0){try{return ts("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Jd(t,e=3,n=100*1024){let r=Xd(t,e);return OE(r)>n?Jd(t,e-1,n):r}function ts(t,e,n=1/0,r=1/0,s=IE.memoBuilder()){let[i,o]=s;if(e==null||["number","boolean","string"].includes(typeof e)&&!Eo.isNaN(e))return e;let a=RE(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(i(e))return"[Circular ~]";let u=e;if(u&&typeof u.toJSON=="function")try{let f=u.toJSON();return ts("",f,c-1,r,s)}catch{}let d=Array.isArray(e)?[]:{},l=0,p=AE.convertToPlainObject(e);for(let f in p){if(!Object.prototype.hasOwnProperty.call(p,f))continue;if(l>=r){d[f]="[MaxProperties ~]";break}let m=p[f];d[f]=ts(f,m,c-1,r,s),l++}return o(e),d}function RE(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Eo.isVueViewModel(e))return"[VueViewModel]";if(Eo.isSyntheticEvent(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${vE.getFunctionName(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=CE(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function CE(t){let e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function DE(t){return~-encodeURI(t).split(/%..|./).length}function OE(t){return DE(JSON.stringify(t))}xn.normalize=Xd;xn.normalizeToSize=Jd;xn.walk=ts});var rl=g(Le=>{Object.defineProperty(Le,"__esModule",{value:!0});function Zd(t,e){let n=0;for(let r=t.length-1;r>=0;r--){let s=t[r];s==="."?t.splice(r,1):s===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var NE=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function el(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=NE.exec(e);return n?n.slice(1):[]}function yo(...t){let e="",n=!1;for(let r=t.length-1;r>=-1&&!n;r--){let s=r>=0?t[r]:"/";s&&(e=`${s}/${e}`,n=s.charAt(0)==="/")}return e=Zd(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function Qd(t){let e=0;for(;e<t.length&&t[e]==="";e++);let n=t.length-1;for(;n>=0&&t[n]==="";n--);return e>n?[]:t.slice(e,n-e+1)}function wE(t,e){t=yo(t).slice(1),e=yo(e).slice(1);let n=Qd(t.split("/")),r=Qd(e.split("/")),s=Math.min(n.length,r.length),i=s;for(let a=0;a<s;a++)if(n[a]!==r[a]){i=a;break}let o=[];for(let a=i;a<n.length;a++)o.push("..");return o=o.concat(r.slice(i)),o.join("/")}function tl(t){let e=nl(t),n=t.slice(-1)==="/",r=Zd(t.split("/").filter(s=>!!s),!e).join("/");return!r&&!e&&(r="."),r&&n&&(r+="/"),(e?"/":"")+r}function nl(t){return t.charAt(0)==="/"}function kE(...t){return tl(t.join("/"))}function PE(t){let e=el(t),n=e[0],r=e[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}function xE(t,e){let n=el(t)[2];return e&&n.slice(e.length*-1)===e&&(n=n.slice(0,n.length-e.length)),n}Le.basename=xE;Le.dirname=PE;Le.isAbsolute=nl;Le.join=kE;Le.normalizePath=tl;Le.relative=wE;Le.resolve=yo});var So=g(Ln=>{Object.defineProperty(Ln,"__esModule",{value:!0});var UE=oe(),qe;(function(t){t[t.PENDING=0]="PENDING";let n=1;t[t.RESOLVED=n]="RESOLVED";let r=2;t[t.REJECTED=r]="REJECTED"})(qe||(qe={}));function ME(t){return new Mn(e=>{e(t)})}function LE(t){return new Mn((e,n)=>{n(t)})}var Mn=class t{constructor(e){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),this._state=qe.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new t((r,s)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{if(i){r(s);return}n(s)})})}__init(){this._resolve=e=>{this._setResult(qe.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(qe.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===qe.PENDING){if(UE.isThenable(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===qe.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===qe.RESOLVED&&n[1](this._value),this._state===qe.REJECTED&&n[2](this._value),n[0]=!0)})}}};Ln.SyncPromise=Mn;Ln.rejectedSyncPromise=LE;Ln.resolvedSyncPromise=ME});var sl=g(bo=>{Object.defineProperty(bo,"__esModule",{value:!0});var qE=ro(),To=So();function FE(t){let e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]}function s(o){if(!n())return To.rejectedSyncPromise(new qE.SentryError("Not adding Promise because buffer limit was reached."));let a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function i(o){return new To.SyncPromise((a,c)=>{let u=e.length;if(!u)return a(!0);let d=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(l=>{To.resolvedSyncPromise(l).then(()=>{--u||(clearTimeout(d),a(!0))},c)})})}return{$:e,add:s,drain:i}}bo.makePromiseBuffer=FE});var Io=g(Ht=>{Object.defineProperty(Ht,"__esModule",{value:!0});function GE(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function BE(t){return t.split(/[\?#]/,1)[0]}function $E(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function jE(t){let{protocol:e,host:n,path:r}=t,s=n&&n.replace(/^.*@/,"[filtered]:[filtered]@").replace(":80","").replace(":443","")||"";return`${e?`${e}://`:""}${s}${r}`}Ht.getNumberOfUrlSegments=$E;Ht.getSanitizedUrlString=jE;Ht.parseUrl=GE;Ht.stripUrlQueryAndFragment=BE});var al=g(Yt=>{Object.defineProperty(Yt,"__esModule",{value:!0});var il=oe(),HE=Un(),YE=Io(),KE={ip:!1,request:!0,transaction:!0,user:!0},WE=["cookies","data","headers","method","query_string","url"],VE=["id","username","email"];function zE(t,e,n){t&&((!t.metadata.source||t.metadata.source==="url")&&t.setName(...ns(e,{path:!0,method:!0})),t.setData("url",e.originalUrl||e.url),e.baseUrl&&t.setData("baseUrl",e.baseUrl),t.setData("query",ol(e,n)))}function ns(t,e={}){let n=t.method&&t.method.toUpperCase(),r="",s="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,s="route"):(t.originalUrl||t.url)&&(r=YE.stripUrlQueryAndFragment(t.originalUrl||t.url||""));let i="";return e.method&&n&&(i+=n),e.method&&e.path&&(i+=" "),e.path&&r&&(i+=r),[i,s]}function XE(t,e){switch(e){case"path":return ns(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"<anonymous>";default:return ns(t,{path:!0,method:!0})[0]}}function JE(t,e){let n={};return(Array.isArray(e)?e:VE).forEach(s=>{t&&s in t&&(n[s]=t[s])}),n}function Ao(t,e){let{include:n=WE,deps:r}=e||{},s={},i=t.headers||{},o=t.method,a=t.hostname||t.host||i.host||"<no host>",c=t.protocol==="https"||t.socket&&t.socket.encrypted?"https":"http",u=t.originalUrl||t.url||"",d=`${c}://${a}${u}`;return n.forEach(l=>{switch(l){case"headers":{s.headers=i;break}case"method":{s.method=o;break}case"url":{s.url=d;break}case"cookies":{s.cookies=t.cookies||i.cookie&&r&&r.cookie&&r.cookie.parse(i.cookie)||{};break}case"query_string":{s.query_string=ol(t,r);break}case"data":{if(o==="GET"||o==="HEAD")break;t.body!==void 0&&(s.data=il.isString(t.body)?t.body:JSON.stringify(HE.normalize(t.body)));break}default:({}).hasOwnProperty.call(t,l)&&(s[l]=t[l])}}),s}function QE(t,e,n){let r={...KE,...n&&n.include};if(r.request){let s=Array.isArray(r.request)?Ao(e,{include:r.request,deps:n&&n.deps}):Ao(e,{deps:n&&n.deps});t.request={...t.request,...s}}if(r.user){let s=e.user&&il.isPlainObject(e.user)?JE(e.user,r.user):{};Object.keys(s).length&&(t.user={...t.user,...s})}if(r.ip){let s=e.ip||e.socket&&e.socket.remoteAddress;s&&(t.user={...t.user,ip_address:s})}return r.transaction&&!t.transaction&&(t.transaction=XE(e,r.transaction)),t}function ol(t,e){let n=t.originalUrl||t.url||"";if(n)return n.startsWith("/")&&(n=`http://dogs.are.great${n}`),t.query||typeof URL!==void 0&&new URL(n).search.replace("?","")||e&&e.url&&e.url.parse(n).query||void 0}Yt.addRequestDataToEvent=QE;Yt.addRequestDataToTransaction=zE;Yt.extractPathForTransaction=ns;Yt.extractRequestData=Ao});var dl=g(qn=>{Object.defineProperty(qn,"__esModule",{value:!0});var cl=["fatal","error","warning","log","info","debug"];function ZE(t){return ul(t)}function ul(t){return t==="warn"?"warning":cl.includes(t)?t:"log"}qn.severityFromString=ZE;qn.severityLevelFromString=ul;qn.validSeverityLevels=cl});var Ro=g((ae,_l)=>{Object.defineProperty(ae,"__esModule",{value:!0});var pl=mo(),ey=Me(),fl=ey.getGlobalObject(),vo={nowSeconds:()=>Date.now()/1e3};function ty(){let{performance:t}=fl;if(!t||!t.now)return;let e=Date.now()-t.now();return{now:()=>t.now(),timeOrigin:e}}function ny(){try{return pl.dynamicRequire(_l,"perf_hooks").performance}catch{return}}var rs=pl.isNodeEnv()?ny():ty(),ll=rs===void 0?vo:{nowSeconds:()=>(rs.timeOrigin+rs.now())/1e3},ry=vo.nowSeconds.bind(vo),gl=ll.nowSeconds.bind(ll),sy=gl,iy=rs!==void 0;ae._browserPerformanceTimeOriginMode=void 0;var oy=(()=>{let{performance:t}=fl;if(!t||!t.now){ae._browserPerformanceTimeOriginMode="none";return}let e=3600*1e3,n=t.now(),r=Date.now(),s=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,i=s<e,o=t.timing&&t.timing.navigationStart,c=typeof o=="number"?Math.abs(o+n-r):e,u=c<e;return i||u?s<=c?(ae._browserPerformanceTimeOriginMode="timeOrigin",t.timeOrigin):(ae._browserPerformanceTimeOriginMode="navigationStart",o):(ae._browserPerformanceTimeOriginMode="dateNow",r)})();ae.browserPerformanceTimeOrigin=oy;ae.dateTimestampInSeconds=ry;ae.timestampInSeconds=gl;ae.timestampWithMs=sy;ae.usingPerformanceAPI=iy});var Do=g(tt=>{Object.defineProperty(tt,"__esModule",{value:!0});var ay=oe(),cy=gt(),uy="baggage",Co="sentry-",ml=/^sentry-/,El=8192;function dy(t){if(!ay.isString(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,s)=>{let i=hl(s);return{...r,...i}},{});else{if(!t)return;e=hl(t)}let n=Object.entries(e).reduce((r,[s,i])=>{if(s.match(ml)){let o=s.slice(Co.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function ly(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,s])=>(s&&(n[`${Co}${r}`]=s),n),{});return py(e)}function hl(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function py(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],s)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${e},${i}`;return o.length>El?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&cy.logger.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}tt.BAGGAGE_HEADER_NAME=uy;tt.MAX_BAGGAGE_STRING_LENGTH=El;tt.SENTRY_BAGGAGE_KEY_PREFIX=Co;tt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=ml;tt.baggageHeaderToDynamicSamplingContext=dy;tt.dynamicSamplingContextToSentryBaggageHeader=ly});var Tl=g(Kt=>{Object.defineProperty(Kt,"__esModule",{value:!0});var fy=Do(),ss=Jr(),yl=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Sl(t){if(!t)return;let e=t.match(yl);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function gy(t,e){let n=Sl(t),r=fy.baggageHeaderToDynamicSamplingContext(e),{traceId:s,parentSpanId:i,parentSampled:o}=n||{},a={traceId:s||ss.uuid4(),spanId:ss.uuid4().substring(16),sampled:o};return i&&(a.parentSpanId=i),r&&(a.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:a}}function _y(t=ss.uuid4(),e=ss.uuid4().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}Kt.TRACEPARENT_REGEXP=yl;Kt.extractTraceparentData=Sl;Kt.generateSentryTraceHeader=_y;Kt.tracingContextFromHeaders=gy});var No=g(ce=>{Object.defineProperty(ce,"__esModule",{value:!0});var hy=eo(),my=Un(),bl=Qe();function Ey(t,e=[]){return[t,e]}function yy(t,e){let[n,r]=t;return[n,[...r,e]]}function Il(t,e){let n=t[1];for(let r of n){let s=r[0].type;if(e(r,s))return!0}return!1}function Sy(t,e){return Il(t,(n,r)=>e.includes(r))}function Oo(t,e){return(e||new TextEncoder).encode(t)}function Ty(t,e){let[n,r]=t,s=JSON.stringify(n);function i(o){typeof s=="string"?s=typeof o=="string"?s+o:[Oo(s,e),o]:s.push(typeof o=="string"?Oo(o,e):o)}for(let o of r){let[a,c]=o;if(i(`
|
|
7
7
|
${JSON.stringify(a)}
|
|
8
|
-
`),typeof c=="string"||c instanceof Uint8Array)i(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(hy.normalize(c))}i(u)}}return typeof s=="string"?s:Ty(s)}function Ty(t){let e=t.reduce((s,i)=>s+i.length,0),n=new Uint8Array(e),r=0;for(let s of t)n.set(s,r),r+=s.length;return n}function by(t,e,n){let r=typeof t=="string"?e.encode(t):t;function s(c){let u=r.subarray(0,c);return r=r.subarray(c+1),u}function i(){let c=r.indexOf(10);return c<0&&(c=r.length),JSON.parse(n.decode(s(c)))}let o=i(),a=[];for(;r.length;){let c=i(),u=typeof c.length=="number"?c.length:void 0;a.push([c,u?s(u):i()])}return[o,a]}function Iy(t,e){let n=typeof t.data=="string"?Oo(t.data,e):t.data;return[bl.dropUndefinedKeys({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}var Ay={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function vy(t){return Ay[t]}function Ry(t){if(!t||!t.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function Cy(t,e,n,r){let s=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:_y.dsnToString(r)},...s&&{trace:bl.dropUndefinedKeys({...s})}}}ce.addItemToEnvelope=Ey;ce.createAttachmentEnvelopeItem=Iy;ce.createEnvelope=my;ce.createEventEnvelopeHeaders=Cy;ce.envelopeContainsItemType=yy;ce.envelopeItemTypeToDataCategory=vy;ce.forEachEnvelopeItem=Il;ce.getSdkMetadataForEnvelopeHeader=Ry;ce.parseEnvelope=by;ce.serializeEnvelope=Sy});var Al=g(wo=>{Object.defineProperty(wo,"__esModule",{value:!0});var Dy=No(),Oy=Ro();function Ny(t,e,n){let r=[{type:"client_report"},{timestamp:n||Oy.dateTimestampInSeconds(),discarded_events:t}];return Dy.createEnvelope(e?{dsn:e}:{},[r])}wo.createClientReportEnvelope=Ny});var Dl=g(mt=>{Object.defineProperty(mt,"__esModule",{value:!0});var vl=60*1e3;function Rl(t,e=Date.now()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?vl:r-e}function Cl(t,e){return t[e]||t.all||0}function wy(t,e,n=Date.now()){return Cl(t,e)>n}function ky(t,{statusCode:e,headers:n},r=Date.now()){let s={...t},i=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(i)for(let a of i.trim().split(",")){let[c,u]=a.split(":",2),d=parseInt(c,10),l=(isNaN(d)?60:d)*1e3;if(!u)s.all=r+l;else for(let p of u.split(";"))s[p]=r+l}else o?s.all=r+Rl(o,r):e===429&&(s.all=r+60*1e3);return s}mt.DEFAULT_RETRY_AFTER=vl;mt.disabledUntil=Cl;mt.isRateLimited=wy;mt.parseRetryAfterHeader=Rl;mt.updateRateLimits=ky});var wl=g(ko=>{Object.defineProperty(ko,"__esModule",{value:!0});function Ol(t,e,n){let r=e.match(/([a-z_]+)\.(.*)/i);if(r===null)t[e]=n;else{let s=t[r[1]];Ol(s,r[2],n)}}function xy(t,e,n={}){return Array.isArray(e)?Nl(t,e,n):Py(t,e,n)}function Nl(t,e,n){let r=e.find(s=>s.name===t.name);if(r){for(let[s,i]of Object.entries(n))Ol(r,s,i);return e}return[...e,t]}function Py(t,e,n){return s=>{let i=e(s);return t.allowExclusionByUser&&!i.find(a=>a.name===t.name)?i:Nl(t,i,n)}}ko.addOrUpdateIntegration=xy});var kl=g(xo=>{Object.defineProperty(xo,"__esModule",{value:!0});function Uy(t){let e=[],n={};return{add(r,s){for(;e.length>=t;){let i=e.shift();i!==void 0&&delete n[i]}n[r]&&this.delete(r),e.push(r),n[r]=s},clear(){n={},e=[]},get(r){return n[r]},size(){return e.length},delete(r){if(!n[r])return!1;delete n[r];for(let s=0;s<e.length;s++)if(e[s]===r){e.splice(s,1);break}return!0}}}xo.makeFifoCache=Uy});var Ml=g(Wt=>{Object.defineProperty(Wt,"__esModule",{value:!0});var xl=oe(),Pl=Jr(),My=Un(),Ly=Qe();function Po(t,e){return t(e.stack||"",1)}function Ul(t,e){let n={type:e.name||e.constructor.name,value:e.message},r=Po(t,e);return r.length&&(n.stacktrace={frames:r}),n}function qy(t){if("name"in t&&typeof t.name=="string"){let e=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(e+=` with message '${t.message}'`),e}else return"message"in t&&typeof t.message=="string"?t.message:`Object captured as exception with keys: ${Ly.extractExceptionKeysForMessage(t)}`}function Fy(t,e,n,r){let s=n,o=r&&r.data&&r.data.mechanism||{handled:!0,type:"generic"};if(!xl.isError(n)){if(xl.isPlainObject(n)){let c=t(),u=c.getClient(),d=u&&u.getOptions().normalizeDepth;c.configureScope(p=>{p.setExtra("__serialized__",My.normalizeToSize(n,d))});let l=qy(n);s=r&&r.syntheticException||new Error(l),s.message=l}else s=r&&r.syntheticException||new Error(n),s.message=n;o.synthetic=!0}let a={exception:{values:[Ul(e,s)]}};return Pl.addExceptionTypeValue(a,void 0,void 0),Pl.addExceptionMechanism(a,o),{...a,event_id:r&&r.event_id}}function Gy(t,e,n="info",r,s){let i={event_id:r&&r.event_id,level:n,message:e};if(s&&r&&r.syntheticException){let o=Po(t,r.syntheticException);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]})}return i}Wt.eventFromMessage=Gy;Wt.eventFromUnknownInput=Fy;Wt.exceptionFromError=Ul;Wt.parseStackFrames=Po});var Ll=g(is=>{Object.defineProperty(is,"__esModule",{value:!0});var By=Qe(),$y=Nn(),jy=Hr();function Hy(t,e,n,r){let s=t(),i=!1,o=!0;return setInterval(()=>{let a=s.getTimeMs();i===!1&&a>e+n&&(i=!0,o&&r()),a<e+n&&(i=!1)},20),{poll:()=>{s.reset()},enabled:a=>{o=a}}}function Yy(t,e,n){let r=e?e.replace(/^file:\/\//,""):void 0,s=t.location.columnNumber?t.location.columnNumber+1:void 0,i=t.location.lineNumber?t.location.lineNumber+1:void 0;return By.dropUndefinedKeys({filename:r,module:n(r),function:t.functionName||"?",colno:s,lineno:i,in_app:r?jy.filenameIsInApp(r):void 0})}function Ky(t,e,n){let r=new Map;return s=>{if(s.method==="Debugger.scriptParsed")r.set(s.params.scriptId,s.params.url);else if(s.method==="Debugger.paused"){let i=[...s.params.callFrames];t("Debugger.resume"),t("Debugger.disable");let o=$y.stripSentryFramesAndReverse(i.map(a=>Yy(a,r.get(a.location.scriptId),e)));n(o)}}}is.createDebugPauseMessageHandler=Ky;is.watchdogTimer=Hy});var ql=g(Uo=>{Object.defineProperty(Uo,"__esModule",{value:!0});function Wy(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Uo.escapeStringForRegex=Wy});var T=g(_=>{Object.defineProperty(_,"__esModule",{value:!0});var Vy=Id(),Mo=Xi(),Lo=eo(),zy=ro(),qo=Me(),Vt=Vd(),V=oe(),os=gt(),Xy=go(),nt=Jr(),Fo=mo(),Go=Un(),Fe=Qe(),Et=rl(),Jy=sl(),as=al(),Bo=dl(),Fn=Nn(),Gn=Rn(),rt=co(),$o=So(),zt=Ro(),cs=Tl(),Fl=ho(),Ae=No(),Qy=Al(),Bn=Dl(),Xt=Do(),us=Io(),Zy=wl(),eS=kl(),ds=Ml(),Gl=Ll(),tS=Hr(),nS=ql(),rS=lo();_.applyAggregateErrorsToEvent=Vy.applyAggregateErrorsToEvent;_.getDomElement=Mo.getDomElement;_.getLocationHref=Mo.getLocationHref;_.htmlTreeAsString=Mo.htmlTreeAsString;_.dsnFromString=Lo.dsnFromString;_.dsnToString=Lo.dsnToString;_.makeDsn=Lo.makeDsn;_.SentryError=zy.SentryError;_.GLOBAL_OBJ=qo.GLOBAL_OBJ;_.getGlobalObject=qo.getGlobalObject;_.getGlobalSingleton=qo.getGlobalSingleton;_.SENTRY_XHR_DATA_KEY=Vt.SENTRY_XHR_DATA_KEY;_.addInstrumentationHandler=Vt.addInstrumentationHandler;_.instrumentDOM=Vt.instrumentDOM;_.instrumentXHR=Vt.instrumentXHR;_.parseFetchArgs=Vt.parseFetchArgs;_.resetInstrumentationHandlers=Vt.resetInstrumentationHandlers;_.isDOMError=V.isDOMError;_.isDOMException=V.isDOMException;_.isElement=V.isElement;_.isError=V.isError;_.isErrorEvent=V.isErrorEvent;_.isEvent=V.isEvent;_.isInstanceOf=V.isInstanceOf;_.isNaN=V.isNaN;_.isPlainObject=V.isPlainObject;_.isPrimitive=V.isPrimitive;_.isRegExp=V.isRegExp;_.isString=V.isString;_.isSyntheticEvent=V.isSyntheticEvent;_.isThenable=V.isThenable;_.isVueViewModel=V.isVueViewModel;_.CONSOLE_LEVELS=os.CONSOLE_LEVELS;_.consoleSandbox=os.consoleSandbox;_.logger=os.logger;_.originalConsoleMethods=os.originalConsoleMethods;_.memoBuilder=Xy.memoBuilder;_.addContextToFrame=nt.addContextToFrame;_.addExceptionMechanism=nt.addExceptionMechanism;_.addExceptionTypeValue=nt.addExceptionTypeValue;_.arrayify=nt.arrayify;_.checkOrSetAlreadyCaught=nt.checkOrSetAlreadyCaught;_.getEventDescription=nt.getEventDescription;_.parseSemver=nt.parseSemver;_.uuid4=nt.uuid4;_.dynamicRequire=Fo.dynamicRequire;_.isNodeEnv=Fo.isNodeEnv;_.loadModule=Fo.loadModule;_.normalize=Go.normalize;_.normalizeToSize=Go.normalizeToSize;_.walk=Go.walk;_.addNonEnumerableProperty=Fe.addNonEnumerableProperty;_.convertToPlainObject=Fe.convertToPlainObject;_.dropUndefinedKeys=Fe.dropUndefinedKeys;_.extractExceptionKeysForMessage=Fe.extractExceptionKeysForMessage;_.fill=Fe.fill;_.getOriginalFunction=Fe.getOriginalFunction;_.markFunctionWrapped=Fe.markFunctionWrapped;_.objectify=Fe.objectify;_.urlEncode=Fe.urlEncode;_.basename=Et.basename;_.dirname=Et.dirname;_.isAbsolute=Et.isAbsolute;_.join=Et.join;_.normalizePath=Et.normalizePath;_.relative=Et.relative;_.resolve=Et.resolve;_.makePromiseBuffer=Jy.makePromiseBuffer;_.addRequestDataToEvent=as.addRequestDataToEvent;_.addRequestDataToTransaction=as.addRequestDataToTransaction;_.extractPathForTransaction=as.extractPathForTransaction;_.extractRequestData=as.extractRequestData;_.severityFromString=Bo.severityFromString;_.severityLevelFromString=Bo.severityLevelFromString;_.validSeverityLevels=Bo.validSeverityLevels;_.createStackParser=Fn.createStackParser;_.getFunctionName=Fn.getFunctionName;_.nodeStackLineParser=Fn.nodeStackLineParser;_.stackParserFromStackParserOptions=Fn.stackParserFromStackParserOptions;_.stripSentryFramesAndReverse=Fn.stripSentryFramesAndReverse;_.isMatchingPattern=Gn.isMatchingPattern;_.safeJoin=Gn.safeJoin;_.snipLine=Gn.snipLine;_.stringMatchesSomePattern=Gn.stringMatchesSomePattern;_.truncate=Gn.truncate;_.isNativeFetch=rt.isNativeFetch;_.supportsDOMError=rt.supportsDOMError;_.supportsDOMException=rt.supportsDOMException;_.supportsErrorEvent=rt.supportsErrorEvent;_.supportsFetch=rt.supportsFetch;_.supportsNativeFetch=rt.supportsNativeFetch;_.supportsReferrerPolicy=rt.supportsReferrerPolicy;_.supportsReportingObserver=rt.supportsReportingObserver;_.SyncPromise=$o.SyncPromise;_.rejectedSyncPromise=$o.rejectedSyncPromise;_.resolvedSyncPromise=$o.resolvedSyncPromise;Object.defineProperty(_,"_browserPerformanceTimeOriginMode",{enumerable:!0,get:()=>zt._browserPerformanceTimeOriginMode});_.browserPerformanceTimeOrigin=zt.browserPerformanceTimeOrigin;_.dateTimestampInSeconds=zt.dateTimestampInSeconds;_.timestampInSeconds=zt.timestampInSeconds;_.timestampWithMs=zt.timestampWithMs;_.usingPerformanceAPI=zt.usingPerformanceAPI;_.TRACEPARENT_REGEXP=cs.TRACEPARENT_REGEXP;_.extractTraceparentData=cs.extractTraceparentData;_.generateSentryTraceHeader=cs.generateSentryTraceHeader;_.tracingContextFromHeaders=cs.tracingContextFromHeaders;_.getSDKSource=Fl.getSDKSource;_.isBrowserBundle=Fl.isBrowserBundle;_.addItemToEnvelope=Ae.addItemToEnvelope;_.createAttachmentEnvelopeItem=Ae.createAttachmentEnvelopeItem;_.createEnvelope=Ae.createEnvelope;_.createEventEnvelopeHeaders=Ae.createEventEnvelopeHeaders;_.envelopeContainsItemType=Ae.envelopeContainsItemType;_.envelopeItemTypeToDataCategory=Ae.envelopeItemTypeToDataCategory;_.forEachEnvelopeItem=Ae.forEachEnvelopeItem;_.getSdkMetadataForEnvelopeHeader=Ae.getSdkMetadataForEnvelopeHeader;_.parseEnvelope=Ae.parseEnvelope;_.serializeEnvelope=Ae.serializeEnvelope;_.createClientReportEnvelope=Qy.createClientReportEnvelope;_.DEFAULT_RETRY_AFTER=Bn.DEFAULT_RETRY_AFTER;_.disabledUntil=Bn.disabledUntil;_.isRateLimited=Bn.isRateLimited;_.parseRetryAfterHeader=Bn.parseRetryAfterHeader;_.updateRateLimits=Bn.updateRateLimits;_.BAGGAGE_HEADER_NAME=Xt.BAGGAGE_HEADER_NAME;_.MAX_BAGGAGE_STRING_LENGTH=Xt.MAX_BAGGAGE_STRING_LENGTH;_.SENTRY_BAGGAGE_KEY_PREFIX=Xt.SENTRY_BAGGAGE_KEY_PREFIX;_.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=Xt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX;_.baggageHeaderToDynamicSamplingContext=Xt.baggageHeaderToDynamicSamplingContext;_.dynamicSamplingContextToSentryBaggageHeader=Xt.dynamicSamplingContextToSentryBaggageHeader;_.getNumberOfUrlSegments=us.getNumberOfUrlSegments;_.getSanitizedUrlString=us.getSanitizedUrlString;_.parseUrl=us.parseUrl;_.stripUrlQueryAndFragment=us.stripUrlQueryAndFragment;_.addOrUpdateIntegration=Zy.addOrUpdateIntegration;_.makeFifoCache=eS.makeFifoCache;_.eventFromMessage=ds.eventFromMessage;_.eventFromUnknownInput=ds.eventFromUnknownInput;_.exceptionFromError=ds.exceptionFromError;_.parseStackFrames=ds.parseStackFrames;_.createDebugPauseMessageHandler=Gl.createDebugPauseMessageHandler;_.watchdogTimer=Gl.watchdogTimer;_.filenameIsInApp=tS.filenameIsInApp;_.escapeStringForRegex=nS.escapeStringForRegex;_.supportsHistory=rS.supportsHistory});var $n=g(jo=>{Object.defineProperty(jo,"__esModule",{value:!0});var sS="production";jo.DEFAULT_ENVIRONMENT=sS});var Hn=g(jn=>{Object.defineProperty(jn,"__esModule",{value:!0});var ls=T();function Bl(){return ls.getGlobalSingleton("globalEventProcessors",()=>[])}function iS(t){Bl().push(t)}function Ho(t,e,n,r=0){return new ls.SyncPromise((s,i)=>{let o=t[r];if(e===null||typeof o!="function")s(e);else{let a=o({...e},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&o.id&&a===null&&ls.logger.log(`Event processor "${o.id}" dropped event`),ls.isThenable(a)?a.then(c=>Ho(t,c,n,r+1).then(s)).then(null,i):Ho(t,a,n,r+1).then(s).then(null,i)}})}jn.addGlobalEventProcessor=iS;jn.getGlobalEventProcessors=Bl;jn.notifyEventProcessors=Ho});var Wn=g(Kn=>{Object.defineProperty(Kn,"__esModule",{value:!0});var Yn=T();function oS(t){let e=Yn.timestampInSeconds(),n={sid:Yn.uuid4(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>cS(n)};return t&&Yo(n,t),n}function Yo(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Yn.timestampInSeconds(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Yn.uuid4()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function aS(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Yo(t,n)}function cS(t){return Yn.dropUndefinedKeys({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}Kn.closeSession=aS;Kn.makeSession=oS;Kn.updateSession=Yo});var ps=g(Wo=>{Object.defineProperty(Wo,"__esModule",{value:!0});var Vn=T(),$l=Hn(),uS=Wn(),dS=100,Ko=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=jl()}static clone(e){let n=new t;return e&&(n._breadcrumbs=[...e._breadcrumbs],n._tags={...e._tags},n._extra={...e._extra},n._contexts={...e._contexts},n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=[...e._eventProcessors],n._requestSession=e._requestSession,n._attachments=[...e._attachments],n._sdkProcessingMetadata={...e._sdkProcessingMetadata},n._propagationContext={...e._propagationContext}),n}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&uS.updateSession(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){let n=e(this);return n instanceof t?n:this}return e instanceof t?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Vn.isPlainObject(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=jl(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:dS;if(r<=0)return this;let s={timestamp:Vn.dateTimestampInSeconds(),...e},i=this._breadcrumbs;return i.push(s),this._breadcrumbs=i.length>r?i.slice(-r):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,n={},r){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};let o=this._span.transaction;if(o){e.sdkProcessingMetadata={dynamicSamplingContext:o.getDynamicSamplingContext(),...e.sdkProcessingMetadata};let a=o.name;a&&(e.tags={transaction:a,...e.tags})}}this._applyFingerprint(e);let s=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...s];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},$l.notifyEventProcessors([...r||[],...$l.getGlobalEventProcessors(),...this._eventProcessors],e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Vn.arrayify(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function jl(){return{traceId:Vn.uuid4(),spanId:Vn.uuid4().substring(16)}}Wo.Scope=Ko});var le=g(de=>{Object.defineProperty(de,"__esModule",{value:!0});var ue=T(),lS=$n(),zo=ps(),Vo=Wn(),fs=4,pS=100,Jt=class{constructor(e,n=new zo.Scope,r=fs){this._version=r,this._stack=[{scope:n}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let n=this.getStackTop();n.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=zo.Scope.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let n=this.pushScope();try{e(n)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){let r=this._lastEventId=n&&n.event_id?n.event_id:ue.uuid4(),s=new Error("Sentry syntheticException");return this._withClient((i,o)=>{i.captureException(e,{originalException:e,syntheticException:s,...n,event_id:r},o)}),r}captureMessage(e,n,r){let s=this._lastEventId=r&&r.event_id?r.event_id:ue.uuid4(),i=new Error(e);return this._withClient((o,a)=>{o.captureMessage(e,n,{originalException:e,syntheticException:i,...r,event_id:s},a)}),s}captureEvent(e,n){let r=n&&n.event_id?n.event_id:ue.uuid4();return e.type||(this._lastEventId=r),this._withClient((s,i)=>{s.captureEvent(e,{...n,event_id:r},i)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){let{scope:r,client:s}=this.getStackTop();if(!s)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:o=pS}=s.getOptions&&s.getOptions()||{};if(o<=0)return;let c={timestamp:ue.dateTimestampInSeconds(),...e},u=i?ue.consoleSandbox(()=>i(c,n)):c;u!==null&&(s.emit&&s.emit("beforeAddBreadcrumb",u,n),r.addBreadcrumb(u,o))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n)}configureScope(e){let{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){let n=Xo(this);try{e(this)}finally{Xo(n)}}getIntegration(e){let n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ue.logger.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){let r=this._callExtensionMethod("startTransaction",e,n);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!r){let s=this.getClient();console.warn(s?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
8
|
+
`),typeof c=="string"||c instanceof Uint8Array)i(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(my.normalize(c))}i(u)}}return typeof s=="string"?s:by(s)}function by(t){let e=t.reduce((s,i)=>s+i.length,0),n=new Uint8Array(e),r=0;for(let s of t)n.set(s,r),r+=s.length;return n}function Iy(t,e,n){let r=typeof t=="string"?e.encode(t):t;function s(c){let u=r.subarray(0,c);return r=r.subarray(c+1),u}function i(){let c=r.indexOf(10);return c<0&&(c=r.length),JSON.parse(n.decode(s(c)))}let o=i(),a=[];for(;r.length;){let c=i(),u=typeof c.length=="number"?c.length:void 0;a.push([c,u?s(u):i()])}return[o,a]}function Ay(t,e){let n=typeof t.data=="string"?Oo(t.data,e):t.data;return[bl.dropUndefinedKeys({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}var vy={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function Ry(t){return vy[t]}function Cy(t){if(!t||!t.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function Dy(t,e,n,r){let s=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:hy.dsnToString(r)},...s&&{trace:bl.dropUndefinedKeys({...s})}}}ce.addItemToEnvelope=yy;ce.createAttachmentEnvelopeItem=Ay;ce.createEnvelope=Ey;ce.createEventEnvelopeHeaders=Dy;ce.envelopeContainsItemType=Sy;ce.envelopeItemTypeToDataCategory=Ry;ce.forEachEnvelopeItem=Il;ce.getSdkMetadataForEnvelopeHeader=Cy;ce.parseEnvelope=Iy;ce.serializeEnvelope=Ty});var Al=g(wo=>{Object.defineProperty(wo,"__esModule",{value:!0});var Oy=No(),Ny=Ro();function wy(t,e,n){let r=[{type:"client_report"},{timestamp:n||Ny.dateTimestampInSeconds(),discarded_events:t}];return Oy.createEnvelope(e?{dsn:e}:{},[r])}wo.createClientReportEnvelope=wy});var Dl=g(mt=>{Object.defineProperty(mt,"__esModule",{value:!0});var vl=60*1e3;function Rl(t,e=Date.now()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?vl:r-e}function Cl(t,e){return t[e]||t.all||0}function ky(t,e,n=Date.now()){return Cl(t,e)>n}function Py(t,{statusCode:e,headers:n},r=Date.now()){let s={...t},i=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(i)for(let a of i.trim().split(",")){let[c,u]=a.split(":",2),d=parseInt(c,10),l=(isNaN(d)?60:d)*1e3;if(!u)s.all=r+l;else for(let p of u.split(";"))s[p]=r+l}else o?s.all=r+Rl(o,r):e===429&&(s.all=r+60*1e3);return s}mt.DEFAULT_RETRY_AFTER=vl;mt.disabledUntil=Cl;mt.isRateLimited=ky;mt.parseRetryAfterHeader=Rl;mt.updateRateLimits=Py});var wl=g(ko=>{Object.defineProperty(ko,"__esModule",{value:!0});function Ol(t,e,n){let r=e.match(/([a-z_]+)\.(.*)/i);if(r===null)t[e]=n;else{let s=t[r[1]];Ol(s,r[2],n)}}function xy(t,e,n={}){return Array.isArray(e)?Nl(t,e,n):Uy(t,e,n)}function Nl(t,e,n){let r=e.find(s=>s.name===t.name);if(r){for(let[s,i]of Object.entries(n))Ol(r,s,i);return e}return[...e,t]}function Uy(t,e,n){return s=>{let i=e(s);return t.allowExclusionByUser&&!i.find(a=>a.name===t.name)?i:Nl(t,i,n)}}ko.addOrUpdateIntegration=xy});var kl=g(Po=>{Object.defineProperty(Po,"__esModule",{value:!0});function My(t){let e=[],n={};return{add(r,s){for(;e.length>=t;){let i=e.shift();i!==void 0&&delete n[i]}n[r]&&this.delete(r),e.push(r),n[r]=s},clear(){n={},e=[]},get(r){return n[r]},size(){return e.length},delete(r){if(!n[r])return!1;delete n[r];for(let s=0;s<e.length;s++)if(e[s]===r){e.splice(s,1);break}return!0}}}Po.makeFifoCache=My});var Ml=g(Wt=>{Object.defineProperty(Wt,"__esModule",{value:!0});var Pl=oe(),xl=Jr(),Ly=Un(),qy=Qe();function xo(t,e){return t(e.stack||"",1)}function Ul(t,e){let n={type:e.name||e.constructor.name,value:e.message},r=xo(t,e);return r.length&&(n.stacktrace={frames:r}),n}function Fy(t){if("name"in t&&typeof t.name=="string"){let e=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(e+=` with message '${t.message}'`),e}else return"message"in t&&typeof t.message=="string"?t.message:`Object captured as exception with keys: ${qy.extractExceptionKeysForMessage(t)}`}function Gy(t,e,n,r){let s=n,o=r&&r.data&&r.data.mechanism||{handled:!0,type:"generic"};if(!Pl.isError(n)){if(Pl.isPlainObject(n)){let c=t(),u=c.getClient(),d=u&&u.getOptions().normalizeDepth;c.configureScope(p=>{p.setExtra("__serialized__",Ly.normalizeToSize(n,d))});let l=Fy(n);s=r&&r.syntheticException||new Error(l),s.message=l}else s=r&&r.syntheticException||new Error(n),s.message=n;o.synthetic=!0}let a={exception:{values:[Ul(e,s)]}};return xl.addExceptionTypeValue(a,void 0,void 0),xl.addExceptionMechanism(a,o),{...a,event_id:r&&r.event_id}}function By(t,e,n="info",r,s){let i={event_id:r&&r.event_id,level:n,message:e};if(s&&r&&r.syntheticException){let o=xo(t,r.syntheticException);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]})}return i}Wt.eventFromMessage=By;Wt.eventFromUnknownInput=Gy;Wt.exceptionFromError=Ul;Wt.parseStackFrames=xo});var Ll=g(is=>{Object.defineProperty(is,"__esModule",{value:!0});var $y=Qe(),jy=Nn(),Hy=Hr();function Yy(t,e,n,r){let s=t(),i=!1,o=!0;return setInterval(()=>{let a=s.getTimeMs();i===!1&&a>e+n&&(i=!0,o&&r()),a<e+n&&(i=!1)},20),{poll:()=>{s.reset()},enabled:a=>{o=a}}}function Ky(t,e,n){let r=e?e.replace(/^file:\/\//,""):void 0,s=t.location.columnNumber?t.location.columnNumber+1:void 0,i=t.location.lineNumber?t.location.lineNumber+1:void 0;return $y.dropUndefinedKeys({filename:r,module:n(r),function:t.functionName||"?",colno:s,lineno:i,in_app:r?Hy.filenameIsInApp(r):void 0})}function Wy(t,e,n){let r=new Map;return s=>{if(s.method==="Debugger.scriptParsed")r.set(s.params.scriptId,s.params.url);else if(s.method==="Debugger.paused"){let i=[...s.params.callFrames];t("Debugger.resume"),t("Debugger.disable");let o=jy.stripSentryFramesAndReverse(i.map(a=>Ky(a,r.get(a.location.scriptId),e)));n(o)}}}is.createDebugPauseMessageHandler=Wy;is.watchdogTimer=Yy});var ql=g(Uo=>{Object.defineProperty(Uo,"__esModule",{value:!0});function Vy(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Uo.escapeStringForRegex=Vy});var T=g(_=>{Object.defineProperty(_,"__esModule",{value:!0});var zy=Id(),Mo=Xi(),Lo=eo(),Xy=ro(),qo=Me(),Vt=Vd(),V=oe(),os=gt(),Jy=go(),nt=Jr(),Fo=mo(),Go=Un(),Fe=Qe(),Et=rl(),Qy=sl(),as=al(),Bo=dl(),Fn=Nn(),Gn=Rn(),rt=co(),$o=So(),zt=Ro(),cs=Tl(),Fl=ho(),Ae=No(),Zy=Al(),Bn=Dl(),Xt=Do(),us=Io(),eS=wl(),tS=kl(),ds=Ml(),Gl=Ll(),nS=Hr(),rS=ql(),sS=lo();_.applyAggregateErrorsToEvent=zy.applyAggregateErrorsToEvent;_.getDomElement=Mo.getDomElement;_.getLocationHref=Mo.getLocationHref;_.htmlTreeAsString=Mo.htmlTreeAsString;_.dsnFromString=Lo.dsnFromString;_.dsnToString=Lo.dsnToString;_.makeDsn=Lo.makeDsn;_.SentryError=Xy.SentryError;_.GLOBAL_OBJ=qo.GLOBAL_OBJ;_.getGlobalObject=qo.getGlobalObject;_.getGlobalSingleton=qo.getGlobalSingleton;_.SENTRY_XHR_DATA_KEY=Vt.SENTRY_XHR_DATA_KEY;_.addInstrumentationHandler=Vt.addInstrumentationHandler;_.instrumentDOM=Vt.instrumentDOM;_.instrumentXHR=Vt.instrumentXHR;_.parseFetchArgs=Vt.parseFetchArgs;_.resetInstrumentationHandlers=Vt.resetInstrumentationHandlers;_.isDOMError=V.isDOMError;_.isDOMException=V.isDOMException;_.isElement=V.isElement;_.isError=V.isError;_.isErrorEvent=V.isErrorEvent;_.isEvent=V.isEvent;_.isInstanceOf=V.isInstanceOf;_.isNaN=V.isNaN;_.isPlainObject=V.isPlainObject;_.isPrimitive=V.isPrimitive;_.isRegExp=V.isRegExp;_.isString=V.isString;_.isSyntheticEvent=V.isSyntheticEvent;_.isThenable=V.isThenable;_.isVueViewModel=V.isVueViewModel;_.CONSOLE_LEVELS=os.CONSOLE_LEVELS;_.consoleSandbox=os.consoleSandbox;_.logger=os.logger;_.originalConsoleMethods=os.originalConsoleMethods;_.memoBuilder=Jy.memoBuilder;_.addContextToFrame=nt.addContextToFrame;_.addExceptionMechanism=nt.addExceptionMechanism;_.addExceptionTypeValue=nt.addExceptionTypeValue;_.arrayify=nt.arrayify;_.checkOrSetAlreadyCaught=nt.checkOrSetAlreadyCaught;_.getEventDescription=nt.getEventDescription;_.parseSemver=nt.parseSemver;_.uuid4=nt.uuid4;_.dynamicRequire=Fo.dynamicRequire;_.isNodeEnv=Fo.isNodeEnv;_.loadModule=Fo.loadModule;_.normalize=Go.normalize;_.normalizeToSize=Go.normalizeToSize;_.walk=Go.walk;_.addNonEnumerableProperty=Fe.addNonEnumerableProperty;_.convertToPlainObject=Fe.convertToPlainObject;_.dropUndefinedKeys=Fe.dropUndefinedKeys;_.extractExceptionKeysForMessage=Fe.extractExceptionKeysForMessage;_.fill=Fe.fill;_.getOriginalFunction=Fe.getOriginalFunction;_.markFunctionWrapped=Fe.markFunctionWrapped;_.objectify=Fe.objectify;_.urlEncode=Fe.urlEncode;_.basename=Et.basename;_.dirname=Et.dirname;_.isAbsolute=Et.isAbsolute;_.join=Et.join;_.normalizePath=Et.normalizePath;_.relative=Et.relative;_.resolve=Et.resolve;_.makePromiseBuffer=Qy.makePromiseBuffer;_.addRequestDataToEvent=as.addRequestDataToEvent;_.addRequestDataToTransaction=as.addRequestDataToTransaction;_.extractPathForTransaction=as.extractPathForTransaction;_.extractRequestData=as.extractRequestData;_.severityFromString=Bo.severityFromString;_.severityLevelFromString=Bo.severityLevelFromString;_.validSeverityLevels=Bo.validSeverityLevels;_.createStackParser=Fn.createStackParser;_.getFunctionName=Fn.getFunctionName;_.nodeStackLineParser=Fn.nodeStackLineParser;_.stackParserFromStackParserOptions=Fn.stackParserFromStackParserOptions;_.stripSentryFramesAndReverse=Fn.stripSentryFramesAndReverse;_.isMatchingPattern=Gn.isMatchingPattern;_.safeJoin=Gn.safeJoin;_.snipLine=Gn.snipLine;_.stringMatchesSomePattern=Gn.stringMatchesSomePattern;_.truncate=Gn.truncate;_.isNativeFetch=rt.isNativeFetch;_.supportsDOMError=rt.supportsDOMError;_.supportsDOMException=rt.supportsDOMException;_.supportsErrorEvent=rt.supportsErrorEvent;_.supportsFetch=rt.supportsFetch;_.supportsNativeFetch=rt.supportsNativeFetch;_.supportsReferrerPolicy=rt.supportsReferrerPolicy;_.supportsReportingObserver=rt.supportsReportingObserver;_.SyncPromise=$o.SyncPromise;_.rejectedSyncPromise=$o.rejectedSyncPromise;_.resolvedSyncPromise=$o.resolvedSyncPromise;Object.defineProperty(_,"_browserPerformanceTimeOriginMode",{enumerable:!0,get:()=>zt._browserPerformanceTimeOriginMode});_.browserPerformanceTimeOrigin=zt.browserPerformanceTimeOrigin;_.dateTimestampInSeconds=zt.dateTimestampInSeconds;_.timestampInSeconds=zt.timestampInSeconds;_.timestampWithMs=zt.timestampWithMs;_.usingPerformanceAPI=zt.usingPerformanceAPI;_.TRACEPARENT_REGEXP=cs.TRACEPARENT_REGEXP;_.extractTraceparentData=cs.extractTraceparentData;_.generateSentryTraceHeader=cs.generateSentryTraceHeader;_.tracingContextFromHeaders=cs.tracingContextFromHeaders;_.getSDKSource=Fl.getSDKSource;_.isBrowserBundle=Fl.isBrowserBundle;_.addItemToEnvelope=Ae.addItemToEnvelope;_.createAttachmentEnvelopeItem=Ae.createAttachmentEnvelopeItem;_.createEnvelope=Ae.createEnvelope;_.createEventEnvelopeHeaders=Ae.createEventEnvelopeHeaders;_.envelopeContainsItemType=Ae.envelopeContainsItemType;_.envelopeItemTypeToDataCategory=Ae.envelopeItemTypeToDataCategory;_.forEachEnvelopeItem=Ae.forEachEnvelopeItem;_.getSdkMetadataForEnvelopeHeader=Ae.getSdkMetadataForEnvelopeHeader;_.parseEnvelope=Ae.parseEnvelope;_.serializeEnvelope=Ae.serializeEnvelope;_.createClientReportEnvelope=Zy.createClientReportEnvelope;_.DEFAULT_RETRY_AFTER=Bn.DEFAULT_RETRY_AFTER;_.disabledUntil=Bn.disabledUntil;_.isRateLimited=Bn.isRateLimited;_.parseRetryAfterHeader=Bn.parseRetryAfterHeader;_.updateRateLimits=Bn.updateRateLimits;_.BAGGAGE_HEADER_NAME=Xt.BAGGAGE_HEADER_NAME;_.MAX_BAGGAGE_STRING_LENGTH=Xt.MAX_BAGGAGE_STRING_LENGTH;_.SENTRY_BAGGAGE_KEY_PREFIX=Xt.SENTRY_BAGGAGE_KEY_PREFIX;_.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=Xt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX;_.baggageHeaderToDynamicSamplingContext=Xt.baggageHeaderToDynamicSamplingContext;_.dynamicSamplingContextToSentryBaggageHeader=Xt.dynamicSamplingContextToSentryBaggageHeader;_.getNumberOfUrlSegments=us.getNumberOfUrlSegments;_.getSanitizedUrlString=us.getSanitizedUrlString;_.parseUrl=us.parseUrl;_.stripUrlQueryAndFragment=us.stripUrlQueryAndFragment;_.addOrUpdateIntegration=eS.addOrUpdateIntegration;_.makeFifoCache=tS.makeFifoCache;_.eventFromMessage=ds.eventFromMessage;_.eventFromUnknownInput=ds.eventFromUnknownInput;_.exceptionFromError=ds.exceptionFromError;_.parseStackFrames=ds.parseStackFrames;_.createDebugPauseMessageHandler=Gl.createDebugPauseMessageHandler;_.watchdogTimer=Gl.watchdogTimer;_.filenameIsInApp=nS.filenameIsInApp;_.escapeStringForRegex=rS.escapeStringForRegex;_.supportsHistory=sS.supportsHistory});var $n=g(jo=>{Object.defineProperty(jo,"__esModule",{value:!0});var iS="production";jo.DEFAULT_ENVIRONMENT=iS});var Hn=g(jn=>{Object.defineProperty(jn,"__esModule",{value:!0});var ls=T();function Bl(){return ls.getGlobalSingleton("globalEventProcessors",()=>[])}function oS(t){Bl().push(t)}function Ho(t,e,n,r=0){return new ls.SyncPromise((s,i)=>{let o=t[r];if(e===null||typeof o!="function")s(e);else{let a=o({...e},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&o.id&&a===null&&ls.logger.log(`Event processor "${o.id}" dropped event`),ls.isThenable(a)?a.then(c=>Ho(t,c,n,r+1).then(s)).then(null,i):Ho(t,a,n,r+1).then(s).then(null,i)}})}jn.addGlobalEventProcessor=oS;jn.getGlobalEventProcessors=Bl;jn.notifyEventProcessors=Ho});var Wn=g(Kn=>{Object.defineProperty(Kn,"__esModule",{value:!0});var Yn=T();function aS(t){let e=Yn.timestampInSeconds(),n={sid:Yn.uuid4(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>uS(n)};return t&&Yo(n,t),n}function Yo(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Yn.timestampInSeconds(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Yn.uuid4()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function cS(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Yo(t,n)}function uS(t){return Yn.dropUndefinedKeys({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}Kn.closeSession=cS;Kn.makeSession=aS;Kn.updateSession=Yo});var ps=g(Wo=>{Object.defineProperty(Wo,"__esModule",{value:!0});var Vn=T(),$l=Hn(),dS=Wn(),lS=100,Ko=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=jl()}static clone(e){let n=new t;return e&&(n._breadcrumbs=[...e._breadcrumbs],n._tags={...e._tags},n._extra={...e._extra},n._contexts={...e._contexts},n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=[...e._eventProcessors],n._requestSession=e._requestSession,n._attachments=[...e._attachments],n._sdkProcessingMetadata={...e._sdkProcessingMetadata},n._propagationContext={...e._propagationContext}),n}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&dS.updateSession(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){let n=e(this);return n instanceof t?n:this}return e instanceof t?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Vn.isPlainObject(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=jl(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:lS;if(r<=0)return this;let s={timestamp:Vn.dateTimestampInSeconds(),...e},i=this._breadcrumbs;return i.push(s),this._breadcrumbs=i.length>r?i.slice(-r):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,n={},r){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};let o=this._span.transaction;if(o){e.sdkProcessingMetadata={dynamicSamplingContext:o.getDynamicSamplingContext(),...e.sdkProcessingMetadata};let a=o.name;a&&(e.tags={transaction:a,...e.tags})}}this._applyFingerprint(e);let s=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...s];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},$l.notifyEventProcessors([...r||[],...$l.getGlobalEventProcessors(),...this._eventProcessors],e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Vn.arrayify(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function jl(){return{traceId:Vn.uuid4(),spanId:Vn.uuid4().substring(16)}}Wo.Scope=Ko});var le=g(de=>{Object.defineProperty(de,"__esModule",{value:!0});var ue=T(),pS=$n(),zo=ps(),Vo=Wn(),fs=4,fS=100,Jt=class{constructor(e,n=new zo.Scope,r=fs){this._version=r,this._stack=[{scope:n}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let n=this.getStackTop();n.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=zo.Scope.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let n=this.pushScope();try{e(n)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){let r=this._lastEventId=n&&n.event_id?n.event_id:ue.uuid4(),s=new Error("Sentry syntheticException");return this._withClient((i,o)=>{i.captureException(e,{originalException:e,syntheticException:s,...n,event_id:r},o)}),r}captureMessage(e,n,r){let s=this._lastEventId=r&&r.event_id?r.event_id:ue.uuid4(),i=new Error(e);return this._withClient((o,a)=>{o.captureMessage(e,n,{originalException:e,syntheticException:i,...r,event_id:s},a)}),s}captureEvent(e,n){let r=n&&n.event_id?n.event_id:ue.uuid4();return e.type||(this._lastEventId=r),this._withClient((s,i)=>{s.captureEvent(e,{...n,event_id:r},i)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){let{scope:r,client:s}=this.getStackTop();if(!s)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:o=fS}=s.getOptions&&s.getOptions()||{};if(o<=0)return;let c={timestamp:ue.dateTimestampInSeconds(),...e},u=i?ue.consoleSandbox(()=>i(c,n)):c;u!==null&&(s.emit&&s.emit("beforeAddBreadcrumb",u,n),r.addBreadcrumb(u,o))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n)}configureScope(e){let{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){let n=Xo(this);try{e(this)}finally{Xo(n)}}getIntegration(e){let n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ue.logger.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){let r=this._callExtensionMethod("startTransaction",e,n);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!r){let s=this.getClient();console.warn(s?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
9
9
|
Sentry.addTracingExtensions();
|
|
10
10
|
Sentry.init({...});
|
|
11
|
-
`:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let n=this.getStackTop().scope,r=n.getSession();r&&Vo.closeSession(r),this._sendSessionUpdate(),n.setSession()}startSession(e){let{scope:n,client:r}=this.getStackTop(),{release:s,environment:i=lS.DEFAULT_ENVIRONMENT}=r&&r.getOptions()||{},{userAgent:o}=ue.GLOBAL_OBJ.navigator||{},a=Vo.makeSession({release:s,environment:i,user:n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession&&n.getSession();return c&&c.status==="ok"&&Vo.updateSession(c,{status:"exited"}),this.endSession(),n.setSession(a),a}shouldSendDefaultPii(){let e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(e){let{scope:n,client:r}=this.getStackTop();r&&e(r,n)}_callExtensionMethod(e,...n){let s=yt().__SENTRY__;if(s&&s.extensions&&typeof s.extensions[e]=="function")return s.extensions[e].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ue.logger.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function yt(){return ue.GLOBAL_OBJ.__SENTRY__=ue.GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},ue.GLOBAL_OBJ}function Xo(t){let e=yt(),n=zn(e);return gs(e,t),n}function fS(){let t=yt();if(t.__SENTRY__&&t.__SENTRY__.acs){let e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Hl(t)}function Hl(t=yt()){return(!Yl(t)||zn(t).isOlderThan(fs))&&gs(t,new Jt),zn(t)}function gS(t,e=Hl()){if(!Yl(t)||zn(t).isOlderThan(fs)){let n=e.getStackTop();gs(t,new Jt(n.client,zo.Scope.clone(n.scope)))}}function _S(t){let e=yt();e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.acs=t}function hS(t,e={}){let n=yt();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function Yl(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function zn(t){return ue.getGlobalSingleton("hub",()=>new Jt,t)}function gs(t,e){if(!t)return!1;let n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}de.API_VERSION=fs;de.Hub=Jt;de.ensureHubOnCarrier=gS;de.getCurrentHub=fS;de.getHubFromCarrier=zn;de.getMainCarrier=yt;de.makeMain=Xo;de.runWithAsyncContext=hS;de.setAsyncContextStrategy=_S;de.setHubOnCarrier=gs});var _s=g(Qt=>{Object.defineProperty(Qt,"__esModule",{value:!0});var mS=le(),Jo=T();function ES(t){return(t||mS.getCurrentHub()).getScope().getTransaction()}Qt.TRACEPARENT_REGEXP=Jo.TRACEPARENT_REGEXP;Qt.extractTraceparentData=Jo.extractTraceparentData;Qt.stripUrlQueryAndFragment=Jo.stripUrlQueryAndFragment;Qt.getActiveTransaction=ES});var Wl=g(ea=>{Object.defineProperty(ea,"__esModule",{value:!0});var Qo=T(),yS=_s(),Kl=!1;function SS(){Kl||(Kl=!0,Qo.addInstrumentationHandler("error",Zo),Qo.addInstrumentationHandler("unhandledrejection",Zo))}function Zo(){let t=yS.getActiveTransaction();if(t){let e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qo.logger.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}Zo.tag="sentry_tracingErrorCallback";ea.registerErrorInstrumentation=SS});var hs=g(Xn=>{Object.defineProperty(Xn,"__esModule",{value:!0});var ve=T(),ta=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},na=class t{constructor(e={}){this.traceId=e.traceId||ve.uuid4(),this.spanId=e.spanId||ve.uuid4().substring(16),this.startTimestamp=e.startTimestamp||ve.timestampInSeconds(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){let n=new t({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&n.transaction){let r=e&&e.op||"< unknown op >",s=n.transaction.name||"< unknown name >",i=n.transaction.spanId,o=`[Tracing] Starting '${r}' span on transaction '${s}' (${i}).`;n.transaction.metadata.spanMetadata[n.spanId]={logMessage:o},ve.logger.log(o)}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);let n=Vl(e);return n!=="unknown_error"&&this.setStatus(n),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:n}=this.transaction.metadata.spanMetadata[this.spanId];n&&ve.logger.log(n.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:ve.timestampInSeconds()}toTraceparent(){return ve.generateSentryTraceHeader(this.traceId,this.spanId,this.sampled)}toContext(){return ve.dropUndefinedKeys({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return ve.dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return ve.dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}};function Vl(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}Xn.Span=na;Xn.SpanRecorder=ta;Xn.spanStatusfromHttpCode=Vl});var Jn=g(ra=>{Object.defineProperty(ra,"__esModule",{value:!0});var TS=T(),bS=$n();function IS(t,e,n){let r=e.getOptions(),{publicKey:s}=e.getDsn()||{},{segment:i}=n&&n.getUser()||{},o=TS.dropUndefinedKeys({environment:r.environment||bS.DEFAULT_ENVIRONMENT,release:r.release,user_segment:i,public_key:s,trace_id:t});return e.emit&&e.emit("createDsc",o),o}ra.getDynamicSamplingContextFromClient=IS});var ms=g(ia=>{Object.defineProperty(ia,"__esModule",{value:!0});var Qn=T(),zl=le(),AS=Jn(),Xl=hs(),sa=class extends Xl.Span{constructor(e,n){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=n||zl.getCurrentHub(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;let r=this.metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}setName(e,n="custom"){this._name=e,this.metadata.source=n}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Xl.SpanRecorder(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){let n=this._finishTransaction(e);if(n)return this._hub.captureEvent(n)}toContext(){let e=super.toContext();return Qn.dropUndefinedKeys({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||zl.getCurrentHub(),n=e.getClient();if(!n)return{};let r=e.getScope(),s=AS.getDynamicSamplingContextFromClient(this.traceId,n,r),i=this.metadata.sampleRate;i!==void 0&&(s.sample_rate=`${i}`);let o=this.metadata.source;return o&&o!=="url"&&(s.transaction=this.name),this.sampled!==void 0&&(s.sampled=String(this.sampled)),s}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}let r=this.spanRecorder?this.spanRecorder.spans.filter(a=>a!==this&&a.endTimestamp):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((a,c)=>a.endTimestamp&&c.endTimestamp?a.endTimestamp>c.endTimestamp?a:c:a).endTimestamp);let s=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...s,dynamicSamplingContext:this.getDynamicSamplingContext()},...s.source&&{transaction_info:{source:s.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),i}};ia.Transaction=sa});var aa=g(Zn=>{Object.defineProperty(Zn,"__esModule",{value:!0});var j=T(),vS=hs(),RS=ms(),Es={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},CS="finishReason",Zt=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],ys=class extends vS.SpanRecorder{constructor(e,n,r,s){super(s),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){e.spanId!==this.transactionSpanId&&(e.finish=n=>{e.endTimestamp=typeof n=="number"?n:j.timestampInSeconds(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},oa=class extends RS.Transaction{constructor(e,n,r=Es.idleTimeout,s=Es.finalTimeout,i=Es.heartbeatInterval,o=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=s,this._heartbeatInterval=i,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Zt[4],o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),n.configureScope(a=>a.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Zt[3],this.finish())},this._finalTimeout)}finish(e=j.timestampInSeconds()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(CS,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let n of this._beforeFinishCallbacks)n(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(n=>{if(n.spanId===this.spanId)return!0;n.endTimestamp||(n.endTimestamp=e,n.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(n,void 0,2)));let r=n.startTimestamp<e,s=(this._finalTimeout+this._idleTimeout)/1e3,i=n.endTimestamp-this.startTimestamp<s;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let o=JSON.stringify(n,void 0,2);r?i||j.logger.log("[Tracing] discarding Span since it finished after Transaction final timeout",o):j.logger.log("[Tracing] discarding Span since it happened after Transaction was finished",o)}return r&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] No active IdleTransaction");if(this._onScope){let n=this._idleHub.getScope();n.getTransaction()===this&&n.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let n=s=>{this._finished||this._pushActivity(s)},r=s=>{this._finished||this._popActivity(s)};this.spanRecorder=new ys(n,r,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Zt[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=Zt[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let n=j.timestampInSeconds();this._idleTimeoutCanceledPermanently?(this._finishReason=Zt[5],this.finish(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Zt[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};Zn.IdleTransaction=oa;Zn.IdleTransactionSpanRecorder=ys;Zn.TRACING_DEFAULTS=Es});var Ss=g(ca=>{Object.defineProperty(ca,"__esModule",{value:!0});var DS=le();function OS(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=DS.getCurrentHub().getClient(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}ca.hasTracingEnabled=OS});var Jl=g(ua=>{Object.defineProperty(ua,"__esModule",{value:!0});var St=T(),NS=Ss();function wS(t,e,n){if(!NS.hasTracingEnabled(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setMetadata({sampleRate:Number(r)})):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setMetadata({sampleRate:Number(r)})):(r=1,t.setMetadata({sampleRate:r})),kS(r)?r?(t.sampled=Math.random()<r,t.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.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"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function kS(t){return St.isNaN(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}ua.sampleTransaction=wS});var da=g(Ts=>{Object.defineProperty(Ts,"__esModule",{value:!0});var xS=T(),PS=le(),US=Wl(),MS=aa(),Ql=Jl(),LS=ms();function qS(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function FS(t,e){let n=this.getClient(),r=n&&n.getOptions()||{},s=r.instrumenter||"sentry",i=t.instrumenter||"sentry";s!==i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&xS.logger.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
|
|
12
|
-
The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`),t.sampled=!1);let o=new LS.Transaction(t,this);return o=Ql.sampleTransaction(o,r,{parentSampled:t.parentSampled,transactionContext:t,...e}),o.sampled&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function GS(t,e,n,r,s,i,o){let a=t.getClient(),c=a&&a.getOptions()||{},u=new MS.IdleTransaction(e,t,n,r,o,s);return u=Ql.sampleTransaction(u,c,{parentSampled:e.parentSampled,transactionContext:e,...i}),u.sampled&&u.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",u),u}function BS(){let t=PS.getMainCarrier();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=FS),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=qS),US.registerErrorInstrumentation())}Ts.addTracingExtensions=BS;Ts.startIdleTransaction=GS});var la=g(er=>{Object.defineProperty(er,"__esModule",{value:!0});er.SpanStatus=void 0;(function(t){t.Ok="ok";let n="deadline_exceeded";t.DeadlineExceeded=n;let r="unauthenticated";t.Unauthenticated=r;let s="permission_denied";t.PermissionDenied=s;let i="not_found";t.NotFound=i;let o="resource_exhausted";t.ResourceExhausted=o;let a="invalid_argument";t.InvalidArgument=a;let c="unimplemented";t.Unimplemented=c;let u="unavailable";t.Unavailable=u;let d="internal_error";t.InternalError=d;let l="unknown_error";t.UnknownError=l;let p="cancelled";t.Cancelled=p;let f="already_exists";t.AlreadyExists=f;let m="failed_precondition";t.FailedPrecondition=m;let E="aborted";t.Aborted=E;let b="out_of_range";t.OutOfRange=b;let v="data_loss";t.DataLoss=v})(er.SpanStatus||(er.SpanStatus={}))});var np=g(Ge=>{Object.defineProperty(Ge,"__esModule",{value:!0});var en=T(),tn=le(),Zl=Ss();function $S(t,e,n=()=>{}){let r=fa(t),s=tn.getCurrentHub(),i=s.getScope(),o=i.getSpan(),a=pa(s,o,r);i.setSpan(a);function c(){a&&a.finish(),s.getScope().setSpan(o)}let u;try{u=e(a)}catch(d){throw a&&a.setStatus("internal_error"),n(d),c(),d}return en.isThenable(u)?Promise.resolve(u).then(()=>{c()},d=>{a&&a.setStatus("internal_error"),n(d),c()}):c(),u}function ep(t,e){let n=fa(t),r=tn.getCurrentHub(),s=r.getScope(),i=s.getSpan(),o=pa(r,i,n);s.setSpan(o);function a(){o&&o.finish(),r.getScope().setSpan(i)}let c;try{c=e(o)}catch(u){throw o&&o.setStatus("internal_error"),a(),u}return en.isThenable(c)?Promise.resolve(c).then(()=>{a()},()=>{o&&o.setStatus("internal_error"),a()}):a(),c}var jS=ep;function HS(t,e){let n=fa(t),r=tn.getCurrentHub(),s=r.getScope(),i=s.getSpan(),o=pa(r,i,n);s.setSpan(o);function a(){o&&o.finish(),r.getScope().setSpan(i)}let c;try{c=e(o,a)}catch(u){throw o&&o.setStatus("internal_error"),u}return en.isThenable(c)&&Promise.resolve(c).then(void 0,()=>{o&&o.setStatus("internal_error")}),c}function YS(t){if(!Zl.hasTracingEnabled())return;let e={...t};e.name!==void 0&&e.description===void 0&&(e.description=e.name);let n=tn.getCurrentHub(),r=tp();return r?r.startChild(e):n.startTransaction(e)}function tp(){return tn.getCurrentHub().getScope().getSpan()}function KS({sentryTrace:t,baggage:e},n){let s=tn.getCurrentHub().getScope(),{traceparentData:i,dynamicSamplingContext:o,propagationContext:a}=en.tracingContextFromHeaders(t,e);s.setPropagationContext(a),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&i&&en.logger.log(`[Tracing] Continuing trace ${i.traceId}.`);let c={...i,metadata:en.dropUndefinedKeys({dynamicSamplingContext:i&&!o?{}:o})};return n(c)}function pa(t,e,n){if(Zl.hasTracingEnabled())return e?e.startChild(n):t.startTransaction(n)}function fa(t){let e={...t};return e.name!==void 0&&e.description===void 0&&(e.description=e.name),e}Ge.continueTrace=KS;Ge.getActiveSpan=tp;Ge.startActiveSpan=jS;Ge.startInactiveSpan=YS;Ge.startSpan=ep;Ge.startSpanManual=HS;Ge.trace=$S});var rp=g(ga=>{Object.defineProperty(ga,"__esModule",{value:!0});var WS=_s();function VS(t,e,n){let r=WS.getActiveTransaction();r&&r.setMeasurement(t,e,n)}ga.setMeasurement=VS});var sp=g(P=>{Object.defineProperty(P,"__esModule",{value:!0});var tr=T(),H=le();function zS(t,e){return H.getCurrentHub().captureException(t,{captureContext:e})}function XS(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return H.getCurrentHub().captureMessage(t,n,r)}function JS(t,e){return H.getCurrentHub().captureEvent(t,e)}function QS(t){H.getCurrentHub().configureScope(t)}function ZS(t){H.getCurrentHub().addBreadcrumb(t)}function eT(t,e){H.getCurrentHub().setContext(t,e)}function tT(t){H.getCurrentHub().setExtras(t)}function nT(t,e){H.getCurrentHub().setExtra(t,e)}function rT(t){H.getCurrentHub().setTags(t)}function sT(t,e){H.getCurrentHub().setTag(t,e)}function iT(t){H.getCurrentHub().setUser(t)}function oT(t){H.getCurrentHub().withScope(t)}function aT(t,e){return H.getCurrentHub().startTransaction({...t},e)}function cT(t,e){let n=H.getCurrentHub(),r=n.getScope(),s=n.getClient();if(!s)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot capture check-in. No client defined.");else if(!s.captureCheckIn)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot capture check-in. Client does not support sending check-ins.");else return s.captureCheckIn(t,e,r);return tr.uuid4()}async function uT(t){let e=H.getCurrentHub().getClient();return e?e.flush(t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function dT(t){let e=H.getCurrentHub().getClient();return e?e.close(t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function lT(){return H.getCurrentHub().lastEventId()}P.addBreadcrumb=ZS;P.captureCheckIn=cT;P.captureEvent=JS;P.captureException=zS;P.captureMessage=XS;P.close=dT;P.configureScope=QS;P.flush=uT;P.lastEventId=lT;P.setContext=eT;P.setExtra=nT;P.setExtras=tT;P.setTag=sT;P.setTags=rT;P.setUser=iT;P.startTransaction=aT;P.withScope=oT});var ma=g(ha=>{Object.defineProperty(ha,"__esModule",{value:!0});var pT=T(),fT=le(),_a=class{constructor(e,n){this._client=e,this.flushTimeout=60,this._pendingAggregates={},this._isEnabled=!0,this._intervalId=setInterval(()=>this.flush(),this.flushTimeout*1e3),this._sessionAttrs=n}flush(){let e=this.getSessionAggregates();e.aggregates.length!==0&&(this._pendingAggregates={},this._client.sendSession(e))}getSessionAggregates(){let e=Object.keys(this._pendingAggregates).map(r=>this._pendingAggregates[parseInt(r)]),n={attrs:this._sessionAttrs,aggregates:e};return pT.dropUndefinedKeys(n)}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;let e=fT.getCurrentHub().getScope(),n=e.getRequestSession();n&&n.status&&(this._incrementSessionStatusCount(n.status,new Date),e.setRequestSession(void 0))}_incrementSessionStatusCount(e,n){let r=new Date(n).setSeconds(0,0);this._pendingAggregates[r]=this._pendingAggregates[r]||{};let s=this._pendingAggregates[r];switch(s.started||(s.started=new Date(r).toISOString()),e){case"errored":return s.errored=(s.errored||0)+1,s.errored;case"ok":return s.exited=(s.exited||0)+1,s.exited;default:return s.crashed=(s.crashed||0)+1,s.crashed}}};ha.SessionFlusher=_a});var Is=g(bs=>{Object.defineProperty(bs,"__esModule",{value:!0});var Ea=T(),gT="7";function ip(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function _T(t){return`${ip(t)}${t.projectId}/envelope/`}function hT(t,e){return Ea.urlEncode({sentry_key:t.publicKey,sentry_version:gT,...e&&{sentry_client:`${e.name}/${e.version}`}})}function mT(t,e={}){let n=typeof e=="string"?e:e.tunnel,r=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return n||`${_T(t)}?${hT(t,r)}`}function ET(t,e){let n=Ea.makeDsn(t);if(!n)return"";let r=`${ip(n)}embed/error-page/`,s=`dsn=${Ea.dsnToString(n)}`;for(let i in e)if(i!=="dsn")if(i==="user"){let o=e.user;if(!o)continue;o.name&&(s+=`&name=${encodeURIComponent(o.name)}`),o.email&&(s+=`&email=${encodeURIComponent(o.email)}`)}else s+=`&${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`;return`${r}?${s}`}bs.getEnvelopeEndpointWithUrlEncodedAuth=mT;bs.getReportDialogEndpoint=ET});var op=g(As=>{Object.defineProperty(As,"__esModule",{value:!0});var nn=T();function yT(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function ST(t,e,n,r){let s=nn.getSdkMetadataForEnvelopeHeader(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:nn.dsnToString(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return nn.createEnvelope(i,[o])}function TT(t,e,n,r){let s=nn.getSdkMetadataForEnvelopeHeader(n),i=t.type&&t.type!=="replay_event"?t.type:"event";yT(t,n&&n.sdk);let o=nn.createEventEnvelopeHeaders(t,s,r,e);delete t.sdkProcessingMetadata;let a=[{type:i},t];return nn.createEnvelope(o,[a])}As.createEventEnvelope=TT;As.createSessionEnvelope=ST});var Ta=g(Tt=>{Object.defineProperty(Tt,"__esModule",{value:!0});var Sa=T(),bT=Hn(),ap=le(),ya=[];function IT(t){let e={};return t.forEach(n=>{let{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.keys(e).map(n=>e[n])}function AT(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=Sa.arrayify(n(e)):r=e;let s=IT(r),i=CT(s,o=>o.name==="Debug");if(i!==-1){let[o]=s.splice(i,1);s.push(o)}return s}function vT(t,e){let n={};return e.forEach(r=>{r&&cp(t,r,n)}),n}function cp(t,e,n){if(n[e.name]=e,ya.indexOf(e.name)===-1&&(e.setupOnce(bT.addGlobalEventProcessor,ap.getCurrentHub),ya.push(e.name)),t.on&&typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,i)=>r(s,i,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){let r=e.processEvent.bind(e),s=Object.assign((i,o)=>r(i,o,t),{id:e.name});t.addEventProcessor(s)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Sa.logger.log(`Integration installed: ${e.name}`)}function RT(t){let e=ap.getCurrentHub().getClient();if(!e||!e.addIntegration){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Sa.logger.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}function CT(t,e){for(let n=0;n<t.length;n++)if(e(t[n])===!0)return n;return-1}Tt.addIntegration=RT;Tt.getIntegrationsToSetup=AT;Tt.installedIntegrations=ya;Tt.setupIntegration=cp;Tt.setupIntegrations=vT});var ba=g(nr=>{Object.defineProperty(nr,"__esModule",{value:!0});var te=T(),DT=$n(),up=Hn(),OT=ps();function NT(t,e,n,r,s){let{normalizeDepth:i=3,normalizeMaxBreadth:o=1e3}=t,a={...e,event_id:e.event_id||n.event_id||te.uuid4(),timestamp:e.timestamp||te.dateTimestampInSeconds()},c=n.integrations||t.integrations.map(p=>p.name);wT(a,t),kT(a,c),e.type===void 0&&lp(a,t.stackParser);let u=r;n.captureContext&&(u=OT.Scope.clone(u).update(n.captureContext));let d=te.resolvedSyncPromise(a),l=s&&s.getEventProcessors?s.getEventProcessors():[];if(u){if(u.getAttachments){let p=[...n.attachments||[],...u.getAttachments()];p.length&&(n.attachments=p)}d=u.applyToEvent(a,n,l)}else d=up.notifyEventProcessors([...l,...up.getGlobalEventProcessors()],a,n);return d.then(p=>(p&&pp(p),typeof i=="number"&&i>0?xT(p,i,o):p))}function wT(t,e){let{environment:n,release:r,dist:s,maxValueLength:i=250}=e;"environment"in t||(t.environment="environment"in e?n:DT.DEFAULT_ENVIRONMENT),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&s!==void 0&&(t.dist=s),t.message&&(t.message=te.truncate(t.message,i));let o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=te.truncate(o.value,i));let a=t.request;a&&a.url&&(a.url=te.truncate(a.url,i))}var dp=new WeakMap;function lp(t,e){let n=te.GLOBAL_OBJ._sentryDebugIds;if(!n)return;let r,s=dp.get(e);s?r=s:(r=new Map,dp.set(e,r));let i=Object.keys(n).reduce((o,a)=>{let c,u=r.get(a);u?c=u:(c=e(a),r.set(a,c));for(let d=c.length-1;d>=0;d--){let l=c[d];if(l.filename){o[l.filename]=n[a];break}}return o},{});try{t.exception.values.forEach(o=>{o.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=i[a.filename])})})}catch{}}function pp(t){let e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?e[s.abs_path]=s.debug_id:s.filename&&(e[s.filename]=s.debug_id),delete s.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.keys(e).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:e[r]})})}function kT(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function xT(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(s=>({...s,...s.data&&{data:te.normalize(s.data,e,n)}}))},...t.user&&{user:te.normalize(t.user,e,n)},...t.contexts&&{contexts:te.normalize(t.contexts,e,n)},...t.extra&&{extra:te.normalize(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=te.normalize(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(s=>(s.data&&(s.data=te.normalize(s.data,e,n)),s))),r}nr.applyDebugIds=lp;nr.applyDebugMeta=pp;nr.prepareEvent=NT});var va=g(Aa=>{Object.defineProperty(Aa,"__esModule",{value:!0});var C=T(),PT=Is(),fp=op(),gp=Ta(),_p=Wn(),UT=Jn(),MT=ba(),hp="Not capturing exception because it's already been captured.",Ia=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=C.makeDsn(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.warn("No DSN provided, client will not send events."),this._dsn){let n=PT.getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(C.checkOrSetAlreadyCaught(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(hp);return}let s=n&&n.event_id;return this._process(this.eventFromException(e,n).then(i=>this._captureEvent(i,n,r)).then(i=>{s=i})),s}captureMessage(e,n,r,s){let i=r&&r.event_id,o=C.isPrimitive(e)?this.eventFromMessage(String(e),n,r):this.eventFromException(e,r);return this._process(o.then(a=>this._captureEvent(a,r,s)).then(a=>{i=a})),i}captureEvent(e,n,r){if(n&&n.originalException&&C.checkOrSetAlreadyCaught(n.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(hp);return}let s=n&&n.event_id;return this._process(this._captureEvent(e,n,r).then(i=>{s=i})),s}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),_p.updateSession(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?this._isClientDoneProcessing(e).then(r=>n.flush(e).then(s=>r&&s)):C.resolvedSyncPromise(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=gp.setupIntegrations(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){gp.setupIntegration(this,e,this._integrations)}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=fp.createEventEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])r=C.addItemToEnvelope(r,C.createAttachmentEnvelopeItem(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let s=this._sendEnvelope(r);s&&s.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let n=fp.createSessionEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){let s=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(`Adding outcome: "${s}"`),this._outcomes[s]=this._outcomes[s]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,s=!1,i=n.exception&&n.exception.values;if(i){s=!0;for(let c of i){let u=c.mechanism;if(u&&u.handled===!1){r=!0;break}}}let o=e.status==="ok";(o&&e.errors===0||o&&r)&&(_p.updateSession(e,{...r&&{status:"crashed"},errors:e.errors||Number(s||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new C.SyncPromise(n=>{let r=0,s=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=s,e&&r>=e&&(clearInterval(i),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",e,n),MT.prepareEvent(s,e,n,r,this).then(o=>{if(o===null)return o;let{propagationContext:a}=o.sdkProcessingMetadata||{};if(!(o.contexts&&o.contexts.trace)&&a){let{traceId:u,spanId:d,parentSpanId:l,dsc:p}=a;o.contexts={trace:{trace_id:u,span_id:d,parent_span_id:l},...o.contexts};let f=p||UT.getDynamicSamplingContextFromClient(u,this,r);o.sdkProcessingMetadata={dynamicSamplingContext:f,...o.sdkProcessingMetadata}}return o})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(s=>s.event_id,s=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=s;i.logLevel==="log"?C.logger.log(i.message):C.logger.warn(i)}})}_processEvent(e,n,r){let s=this.getOptions(),{sampleRate:i}=s,o=Ep(e),a=mp(e),c=e.type||"error",u=`before send for type \`${c}\``;if(a&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),C.rejectedSyncPromise(new C.SentryError(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let d=c==="replay_event"?"replay":c;return this._prepareEvent(e,n,r).then(l=>{if(l===null)throw this.recordDroppedEvent("event_processor",d,e),new C.SentryError("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return l;let f=qT(s,l,n);return LT(f,u)}).then(l=>{if(l===null)throw this.recordDroppedEvent("before_send",d,e),new C.SentryError(`${u} returned \`null\`, will not send event.`,"log");let p=r&&r.getSession();!o&&p&&this._updateSessionFromEvent(p,l);let f=l.transaction_info;if(o&&f&&l.transaction!==e.transaction){let m="custom";l.transaction_info={...f,source:m}}return this.sendEvent(l,n),l}).then(null,l=>{throw l instanceof C.SentryError?l:(this.captureException(l,{data:{__sentry__:!0},originalException:l}),new C.SentryError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
13
|
-
Reason: ${l}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.error("Error while sending event:",n)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{let[r,s]=n.split(":");return{reason:r,category:s,quantity:e[n]}})}};function LT(t,e){let n=`${e} must return \`null\` or a valid event.`;if(C.isThenable(t))return t.then(r=>{if(!C.isPlainObject(r)&&r!==null)throw new C.SentryError(n);return r},r=>{throw new C.SentryError(`${e} rejected with ${r}`)});if(!C.isPlainObject(t)&&t!==null)throw new C.SentryError(n);return t}function qT(t,e,n){let{beforeSend:r,beforeSendTransaction:s}=t;return mp(e)&&r?r(e,n):Ep(e)&&s?s(e,n):e}function mp(t){return t.type===void 0}function Ep(t){return t.type==="transaction"}Aa.BaseClient=Ia});var Da=g(Ca=>{Object.defineProperty(Ca,"__esModule",{value:!0});var Ra=T();function FT(t,e,n,r,s){let i={sent_at:new Date().toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&s&&(i.dsn=Ra.dsnToString(s)),e&&(i.trace=Ra.dropUndefinedKeys(e));let o=GT(t);return Ra.createEnvelope(i,[o])}function GT(t){return[{type:"check_in"},t]}Ca.createCheckInEnvelope=FT});var yp=g(Na=>{Object.defineProperty(Na,"__esModule",{value:!0});var Be=T(),BT=va(),$T=Da(),jT=le(),HT=ma(),YT=da(),KT=Jn();la();var Oa=class extends BT.BaseClient{constructor(e){YT.addTracingExtensions(),super(e)}eventFromException(e,n){return Be.resolvedSyncPromise(Be.eventFromUnknownInput(jT.getCurrentHub,this._options.stackParser,e,n))}eventFromMessage(e,n="info",r){return Be.resolvedSyncPromise(Be.eventFromMessage(this._options.stackParser,e,n,r,this._options.attachStacktrace))}captureException(e,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&r){let s=r.getRequestSession();s&&s.status==="ok"&&(s.status="errored")}return super.captureException(e,n,r)}captureEvent(e,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&r&&(e.type||"exception")==="exception"&&e.exception&&e.exception.values&&e.exception.values.length>0){let o=r.getRequestSession();o&&o.status==="ok"&&(o.status="errored")}return super.captureEvent(e,n,r)}close(e){return this._sessionFlusher&&this._sessionFlusher.close(),super.close(e)}initSessionFlusher(){let{release:e,environment:n}=this._options;e?this._sessionFlusher=new HT.SessionFlusher(this,{release:e,environment:n}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("Cannot initialise an instance of SessionFlusher if no release is provided!")}captureCheckIn(e,n,r){let s=e.status!=="in_progress"&&e.checkInId?e.checkInId:Be.uuid4();if(!this._isEnabled())return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("SDK not enabled, will not capture checkin."),s;let i=this.getOptions(),{release:o,environment:a,tunnel:c}=i,u={check_in_id:s,monitor_slug:e.monitorSlug,status:e.status,release:o,environment:a};e.status!=="in_progress"&&(u.duration=e.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone});let[d,l]=this._getTraceInfoFromScope(r);l&&(u.contexts={trace:l});let p=$T.createCheckInEnvelope(u,d,this.getSdkMetadata(),c,this.getDsn());return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.info("Sending checkin:",e.monitorSlug,e.status),this._sendEnvelope(p),s}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("Discarded request mode session because autoSessionTracking option was disabled")}_prepareEvent(e,n,r){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:(e.contexts||{}).runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,n,r)}_getTraceInfoFromScope(e){if(!e)return[void 0,void 0];let n=e.getSpan();if(n)return[n.transaction?n.transaction.getDynamicSamplingContext():void 0,n.getTraceContext()];let{traceId:r,spanId:s,parentSpanId:i,dsc:o}=e.getPropagationContext(),a={trace_id:r,span_id:s,parent_span_id:i};return o?[o,a]:[KT.getDynamicSamplingContextFromClient(r,this,e),a]}};Na.ServerRuntimeClient=Oa});var Sp=g(wa=>{Object.defineProperty(wa,"__esModule",{value:!0});var WT=T(),VT=le();function zT(t,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?WT.logger.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let n=VT.getCurrentHub();n.getScope().update(e.initialScope);let s=new t(e);n.bindClient(s)}wa.initAndBind=zT});var Ip=g(vs=>{Object.defineProperty(vs,"__esModule",{value:!0});var Q=T(),bp=30;function XT(t,e,n=Q.makePromiseBuffer(t.bufferSize||bp)){let r={},s=o=>n.drain(o);function i(o){let a=[];if(Q.forEachEnvelopeItem(o,(l,p)=>{let f=Q.envelopeItemTypeToDataCategory(p);if(Q.isRateLimited(r,f)){let m=Tp(l,p);t.recordDroppedEvent("ratelimit_backoff",f,m)}else a.push(l)}),a.length===0)return Q.resolvedSyncPromise();let c=Q.createEnvelope(o[0],a),u=l=>{Q.forEachEnvelopeItem(c,(p,f)=>{let m=Tp(p,f);t.recordDroppedEvent(l,Q.envelopeItemTypeToDataCategory(f),m)})},d=()=>e({body:Q.serializeEnvelope(c,t.textEncoder)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Q.logger.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Q.updateRateLimits(r,l),l),l=>{throw u("network_error"),l});return n.add(d).then(l=>l,l=>{if(l instanceof Q.SentryError)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Q.logger.error("Skipped sending event because buffer is full."),u("queue_overflow"),Q.resolvedSyncPromise();throw l})}return i.__sentry__baseTransport__=!0,{send:i,flush:s}}function Tp(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}vs.DEFAULT_TRANSPORT_BUFFER_SIZE=bp;vs.createTransport=XT});var vp=g(rr=>{Object.defineProperty(rr,"__esModule",{value:!0});var xa=T(),Ap=100,Pa=5e3,JT=36e5;function ka(t,e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&xa.logger.info(`[Offline]: ${t}`,e)}function QT(t){return e=>{let n=t(e),r=e.createStore?e.createStore(e):void 0,s=Pa,i;function o(d,l,p){return xa.envelopeContainsItemType(d,["replay_event","replay_recording","client_report"])?!1:e.shouldStore?e.shouldStore(d,l,p):!0}function a(d){r&&(i&&clearTimeout(i),i=setTimeout(async()=>{i=void 0;let l=await r.pop();l&&(ka("Attempting to send previously queued event"),u(l).catch(p=>{ka("Failed to retry sending",p)}))},d),typeof i!="number"&&i.unref&&i.unref())}function c(){i||(a(s),s=Math.min(s*2,JT))}async function u(d){try{let l=await n.send(d),p=Ap;if(l){if(l.headers&&l.headers["retry-after"])p=xa.parseRetryAfterHeader(l.headers["retry-after"]);else if((l.statusCode||0)>=400)return l}return a(p),s=Pa,l}catch(l){if(r&&await o(d,l,s))return await r.insert(d),c(),ka("Error sending. Event queued",l),{};throw l}}return e.flushAtStartup&&c(),{send:u,flush:d=>n.flush(d)}}}rr.MIN_DELAY=Ap;rr.START_DELAY=Pa;rr.makeOfflineTransport=QT});var Cp=g(Rs=>{Object.defineProperty(Rs,"__esModule",{value:!0});var Rp=T(),ZT=Is();function Ua(t,e){let n;return Rp.forEachEnvelopeItem(t,(r,s)=>(e.includes(s)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function eb(t,e){return n=>{let r=t(n);return{send:async s=>{let i=Ua(s,["event","transaction","profile","replay_event"]);return i&&(i.release=e),r.send(s)},flush:s=>r.flush(s)}}}function tb(t,e){return n=>{let r=t(n),s={};function i(c,u){let d=u?`${c}:${u}`:c;if(!s[d]){let l=Rp.dsnFromString(c);if(!l)return;let p=ZT.getEnvelopeEndpointWithUrlEncodedAuth(l);s[d]=u?eb(t,u)({...n,url:p}):t({...n,url:p})}return s[d]}async function o(c){function u(p){let f=p&&p.length?p:["event"];return Ua(c,f)}let d=e({envelope:c,getEvent:u}).map(p=>typeof p=="string"?i(p,void 0):i(p.dsn,p.release)).filter(p=>!!p);return d.length===0&&d.push(r),(await Promise.all(d.map(p=>p.send(c))))[0]}async function a(c){let u=[...Object.keys(s).map(l=>s[l]),r];return(await Promise.all(u.map(l=>l.flush(c)))).every(l=>l)}return{send:o,flush:a}}}Rs.eventFromEnvelope=Ua;Rs.makeMultiplexedTransport=tb});var Dp=g(Ma=>{Object.defineProperty(Ma,"__esModule",{value:!0});var nb="7.74.1";Ma.SDK_VERSION=nb});var qa=g(La=>{Object.defineProperty(La,"__esModule",{value:!0});var rb=T(),Op,Cs=class t{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=t.id}setupOnce(){Op=Function.prototype.toString;try{Function.prototype.toString=function(...e){let n=rb.getOriginalFunction(this)||this;return Op.apply(n,e)}}catch{}}};Cs.__initStatic();La.FunctionToString=Cs});var Fa=g(sr=>{Object.defineProperty(sr,"__esModule",{value:!0});var F=T(),sb=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ib=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Ds=class t{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=t.id,this._options=e}setupOnce(e,n){}processEvent(e,n,r){let s=r.getOptions(),i=Np(this._options,s);return wp(e,i)?null:e}};Ds.__initStatic();function Np(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:sb],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:ib],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function wp(t,e){return e.ignoreInternal&&lb(t)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being internal Sentry Error.
|
|
14
|
-
Event: ${F.getEventDescription(t)}`),!0):
|
|
15
|
-
Event: ${F.getEventDescription(t)}`),!0):
|
|
16
|
-
Event: ${F.getEventDescription(t)}`),!0):
|
|
11
|
+
`:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let n=this.getStackTop().scope,r=n.getSession();r&&Vo.closeSession(r),this._sendSessionUpdate(),n.setSession()}startSession(e){let{scope:n,client:r}=this.getStackTop(),{release:s,environment:i=pS.DEFAULT_ENVIRONMENT}=r&&r.getOptions()||{},{userAgent:o}=ue.GLOBAL_OBJ.navigator||{},a=Vo.makeSession({release:s,environment:i,user:n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession&&n.getSession();return c&&c.status==="ok"&&Vo.updateSession(c,{status:"exited"}),this.endSession(),n.setSession(a),a}shouldSendDefaultPii(){let e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(e){let{scope:n,client:r}=this.getStackTop();r&&e(r,n)}_callExtensionMethod(e,...n){let s=yt().__SENTRY__;if(s&&s.extensions&&typeof s.extensions[e]=="function")return s.extensions[e].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ue.logger.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function yt(){return ue.GLOBAL_OBJ.__SENTRY__=ue.GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},ue.GLOBAL_OBJ}function Xo(t){let e=yt(),n=zn(e);return gs(e,t),n}function gS(){let t=yt();if(t.__SENTRY__&&t.__SENTRY__.acs){let e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Hl(t)}function Hl(t=yt()){return(!Yl(t)||zn(t).isOlderThan(fs))&&gs(t,new Jt),zn(t)}function _S(t,e=Hl()){if(!Yl(t)||zn(t).isOlderThan(fs)){let n=e.getStackTop();gs(t,new Jt(n.client,zo.Scope.clone(n.scope)))}}function hS(t){let e=yt();e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.acs=t}function mS(t,e={}){let n=yt();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function Yl(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function zn(t){return ue.getGlobalSingleton("hub",()=>new Jt,t)}function gs(t,e){if(!t)return!1;let n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}de.API_VERSION=fs;de.Hub=Jt;de.ensureHubOnCarrier=_S;de.getCurrentHub=gS;de.getHubFromCarrier=zn;de.getMainCarrier=yt;de.makeMain=Xo;de.runWithAsyncContext=mS;de.setAsyncContextStrategy=hS;de.setHubOnCarrier=gs});var _s=g(Qt=>{Object.defineProperty(Qt,"__esModule",{value:!0});var ES=le(),Jo=T();function yS(t){return(t||ES.getCurrentHub()).getScope().getTransaction()}Qt.TRACEPARENT_REGEXP=Jo.TRACEPARENT_REGEXP;Qt.extractTraceparentData=Jo.extractTraceparentData;Qt.stripUrlQueryAndFragment=Jo.stripUrlQueryAndFragment;Qt.getActiveTransaction=yS});var Wl=g(ea=>{Object.defineProperty(ea,"__esModule",{value:!0});var Qo=T(),SS=_s(),Kl=!1;function TS(){Kl||(Kl=!0,Qo.addInstrumentationHandler("error",Zo),Qo.addInstrumentationHandler("unhandledrejection",Zo))}function Zo(){let t=SS.getActiveTransaction();if(t){let e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qo.logger.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}Zo.tag="sentry_tracingErrorCallback";ea.registerErrorInstrumentation=TS});var hs=g(Xn=>{Object.defineProperty(Xn,"__esModule",{value:!0});var ve=T(),ta=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},na=class t{constructor(e={}){this.traceId=e.traceId||ve.uuid4(),this.spanId=e.spanId||ve.uuid4().substring(16),this.startTimestamp=e.startTimestamp||ve.timestampInSeconds(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){let n=new t({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&n.transaction){let r=e&&e.op||"< unknown op >",s=n.transaction.name||"< unknown name >",i=n.transaction.spanId,o=`[Tracing] Starting '${r}' span on transaction '${s}' (${i}).`;n.transaction.metadata.spanMetadata[n.spanId]={logMessage:o},ve.logger.log(o)}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);let n=Vl(e);return n!=="unknown_error"&&this.setStatus(n),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:n}=this.transaction.metadata.spanMetadata[this.spanId];n&&ve.logger.log(n.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:ve.timestampInSeconds()}toTraceparent(){return ve.generateSentryTraceHeader(this.traceId,this.spanId,this.sampled)}toContext(){return ve.dropUndefinedKeys({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return ve.dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return ve.dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}};function Vl(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}Xn.Span=na;Xn.SpanRecorder=ta;Xn.spanStatusfromHttpCode=Vl});var Jn=g(ra=>{Object.defineProperty(ra,"__esModule",{value:!0});var bS=T(),IS=$n();function AS(t,e,n){let r=e.getOptions(),{publicKey:s}=e.getDsn()||{},{segment:i}=n&&n.getUser()||{},o=bS.dropUndefinedKeys({environment:r.environment||IS.DEFAULT_ENVIRONMENT,release:r.release,user_segment:i,public_key:s,trace_id:t});return e.emit&&e.emit("createDsc",o),o}ra.getDynamicSamplingContextFromClient=AS});var ms=g(ia=>{Object.defineProperty(ia,"__esModule",{value:!0});var Qn=T(),zl=le(),vS=Jn(),Xl=hs(),sa=class extends Xl.Span{constructor(e,n){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=n||zl.getCurrentHub(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;let r=this.metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}setName(e,n="custom"){this._name=e,this.metadata.source=n}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Xl.SpanRecorder(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){let n=this._finishTransaction(e);if(n)return this._hub.captureEvent(n)}toContext(){let e=super.toContext();return Qn.dropUndefinedKeys({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||zl.getCurrentHub(),n=e.getClient();if(!n)return{};let r=e.getScope(),s=vS.getDynamicSamplingContextFromClient(this.traceId,n,r),i=this.metadata.sampleRate;i!==void 0&&(s.sample_rate=`${i}`);let o=this.metadata.source;return o&&o!=="url"&&(s.transaction=this.name),this.sampled!==void 0&&(s.sampled=String(this.sampled)),s}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}let r=this.spanRecorder?this.spanRecorder.spans.filter(a=>a!==this&&a.endTimestamp):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((a,c)=>a.endTimestamp&&c.endTimestamp?a.endTimestamp>c.endTimestamp?a:c:a).endTimestamp);let s=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...s,dynamicSamplingContext:this.getDynamicSamplingContext()},...s.source&&{transaction_info:{source:s.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),i}};ia.Transaction=sa});var aa=g(Zn=>{Object.defineProperty(Zn,"__esModule",{value:!0});var j=T(),RS=hs(),CS=ms(),Es={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},DS="finishReason",Zt=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],ys=class extends RS.SpanRecorder{constructor(e,n,r,s){super(s),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){e.spanId!==this.transactionSpanId&&(e.finish=n=>{e.endTimestamp=typeof n=="number"?n:j.timestampInSeconds(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},oa=class extends CS.Transaction{constructor(e,n,r=Es.idleTimeout,s=Es.finalTimeout,i=Es.heartbeatInterval,o=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=s,this._heartbeatInterval=i,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Zt[4],o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),n.configureScope(a=>a.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Zt[3],this.finish())},this._finalTimeout)}finish(e=j.timestampInSeconds()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(DS,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let n of this._beforeFinishCallbacks)n(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(n=>{if(n.spanId===this.spanId)return!0;n.endTimestamp||(n.endTimestamp=e,n.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(n,void 0,2)));let r=n.startTimestamp<e,s=(this._finalTimeout+this._idleTimeout)/1e3,i=n.endTimestamp-this.startTimestamp<s;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let o=JSON.stringify(n,void 0,2);r?i||j.logger.log("[Tracing] discarding Span since it finished after Transaction final timeout",o):j.logger.log("[Tracing] discarding Span since it happened after Transaction was finished",o)}return r&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] No active IdleTransaction");if(this._onScope){let n=this._idleHub.getScope();n.getTransaction()===this&&n.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let n=s=>{this._finished||this._pushActivity(s)},r=s=>{this._finished||this._popActivity(s)};this.spanRecorder=new ys(n,r,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Zt[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=Zt[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let n=j.timestampInSeconds();this._idleTimeoutCanceledPermanently?(this._finishReason=Zt[5],this.finish(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Zt[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};Zn.IdleTransaction=oa;Zn.IdleTransactionSpanRecorder=ys;Zn.TRACING_DEFAULTS=Es});var Ss=g(ca=>{Object.defineProperty(ca,"__esModule",{value:!0});var OS=le();function NS(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=OS.getCurrentHub().getClient(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}ca.hasTracingEnabled=NS});var Jl=g(ua=>{Object.defineProperty(ua,"__esModule",{value:!0});var St=T(),wS=Ss();function kS(t,e,n){if(!wS.hasTracingEnabled(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setMetadata({sampleRate:Number(r)})):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setMetadata({sampleRate:Number(r)})):(r=1,t.setMetadata({sampleRate:r})),PS(r)?r?(t.sampled=Math.random()<r,t.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.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"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function PS(t){return St.isNaN(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}ua.sampleTransaction=kS});var da=g(Ts=>{Object.defineProperty(Ts,"__esModule",{value:!0});var xS=T(),US=le(),MS=Wl(),LS=aa(),Ql=Jl(),qS=ms();function FS(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function GS(t,e){let n=this.getClient(),r=n&&n.getOptions()||{},s=r.instrumenter||"sentry",i=t.instrumenter||"sentry";s!==i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&xS.logger.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
|
|
12
|
+
The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`),t.sampled=!1);let o=new qS.Transaction(t,this);return o=Ql.sampleTransaction(o,r,{parentSampled:t.parentSampled,transactionContext:t,...e}),o.sampled&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function BS(t,e,n,r,s,i,o){let a=t.getClient(),c=a&&a.getOptions()||{},u=new LS.IdleTransaction(e,t,n,r,o,s);return u=Ql.sampleTransaction(u,c,{parentSampled:e.parentSampled,transactionContext:e,...i}),u.sampled&&u.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",u),u}function $S(){let t=US.getMainCarrier();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=GS),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=FS),MS.registerErrorInstrumentation())}Ts.addTracingExtensions=$S;Ts.startIdleTransaction=BS});var la=g(er=>{Object.defineProperty(er,"__esModule",{value:!0});er.SpanStatus=void 0;(function(t){t.Ok="ok";let n="deadline_exceeded";t.DeadlineExceeded=n;let r="unauthenticated";t.Unauthenticated=r;let s="permission_denied";t.PermissionDenied=s;let i="not_found";t.NotFound=i;let o="resource_exhausted";t.ResourceExhausted=o;let a="invalid_argument";t.InvalidArgument=a;let c="unimplemented";t.Unimplemented=c;let u="unavailable";t.Unavailable=u;let d="internal_error";t.InternalError=d;let l="unknown_error";t.UnknownError=l;let p="cancelled";t.Cancelled=p;let f="already_exists";t.AlreadyExists=f;let m="failed_precondition";t.FailedPrecondition=m;let E="aborted";t.Aborted=E;let b="out_of_range";t.OutOfRange=b;let v="data_loss";t.DataLoss=v})(er.SpanStatus||(er.SpanStatus={}))});var np=g(Ge=>{Object.defineProperty(Ge,"__esModule",{value:!0});var en=T(),tn=le(),Zl=Ss();function jS(t,e,n=()=>{}){let r=fa(t),s=tn.getCurrentHub(),i=s.getScope(),o=i.getSpan(),a=pa(s,o,r);i.setSpan(a);function c(){a&&a.finish(),s.getScope().setSpan(o)}let u;try{u=e(a)}catch(d){throw a&&a.setStatus("internal_error"),n(d),c(),d}return en.isThenable(u)?Promise.resolve(u).then(()=>{c()},d=>{a&&a.setStatus("internal_error"),n(d),c()}):c(),u}function ep(t,e){let n=fa(t),r=tn.getCurrentHub(),s=r.getScope(),i=s.getSpan(),o=pa(r,i,n);s.setSpan(o);function a(){o&&o.finish(),r.getScope().setSpan(i)}let c;try{c=e(o)}catch(u){throw o&&o.setStatus("internal_error"),a(),u}return en.isThenable(c)?Promise.resolve(c).then(()=>{a()},()=>{o&&o.setStatus("internal_error"),a()}):a(),c}var HS=ep;function YS(t,e){let n=fa(t),r=tn.getCurrentHub(),s=r.getScope(),i=s.getSpan(),o=pa(r,i,n);s.setSpan(o);function a(){o&&o.finish(),r.getScope().setSpan(i)}let c;try{c=e(o,a)}catch(u){throw o&&o.setStatus("internal_error"),u}return en.isThenable(c)&&Promise.resolve(c).then(void 0,()=>{o&&o.setStatus("internal_error")}),c}function KS(t){if(!Zl.hasTracingEnabled())return;let e={...t};e.name!==void 0&&e.description===void 0&&(e.description=e.name);let n=tn.getCurrentHub(),r=tp();return r?r.startChild(e):n.startTransaction(e)}function tp(){return tn.getCurrentHub().getScope().getSpan()}function WS({sentryTrace:t,baggage:e},n){let s=tn.getCurrentHub().getScope(),{traceparentData:i,dynamicSamplingContext:o,propagationContext:a}=en.tracingContextFromHeaders(t,e);s.setPropagationContext(a),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&i&&en.logger.log(`[Tracing] Continuing trace ${i.traceId}.`);let c={...i,metadata:en.dropUndefinedKeys({dynamicSamplingContext:i&&!o?{}:o})};return n(c)}function pa(t,e,n){if(Zl.hasTracingEnabled())return e?e.startChild(n):t.startTransaction(n)}function fa(t){let e={...t};return e.name!==void 0&&e.description===void 0&&(e.description=e.name),e}Ge.continueTrace=WS;Ge.getActiveSpan=tp;Ge.startActiveSpan=HS;Ge.startInactiveSpan=KS;Ge.startSpan=ep;Ge.startSpanManual=YS;Ge.trace=jS});var rp=g(ga=>{Object.defineProperty(ga,"__esModule",{value:!0});var VS=_s();function zS(t,e,n){let r=VS.getActiveTransaction();r&&r.setMeasurement(t,e,n)}ga.setMeasurement=zS});var sp=g(x=>{Object.defineProperty(x,"__esModule",{value:!0});var tr=T(),H=le();function XS(t,e){return H.getCurrentHub().captureException(t,{captureContext:e})}function JS(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return H.getCurrentHub().captureMessage(t,n,r)}function QS(t,e){return H.getCurrentHub().captureEvent(t,e)}function ZS(t){H.getCurrentHub().configureScope(t)}function eT(t){H.getCurrentHub().addBreadcrumb(t)}function tT(t,e){H.getCurrentHub().setContext(t,e)}function nT(t){H.getCurrentHub().setExtras(t)}function rT(t,e){H.getCurrentHub().setExtra(t,e)}function sT(t){H.getCurrentHub().setTags(t)}function iT(t,e){H.getCurrentHub().setTag(t,e)}function oT(t){H.getCurrentHub().setUser(t)}function aT(t){H.getCurrentHub().withScope(t)}function cT(t,e){return H.getCurrentHub().startTransaction({...t},e)}function uT(t,e){let n=H.getCurrentHub(),r=n.getScope(),s=n.getClient();if(!s)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot capture check-in. No client defined.");else if(!s.captureCheckIn)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot capture check-in. Client does not support sending check-ins.");else return s.captureCheckIn(t,e,r);return tr.uuid4()}async function dT(t){let e=H.getCurrentHub().getClient();return e?e.flush(t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function lT(t){let e=H.getCurrentHub().getClient();return e?e.close(t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function pT(){return H.getCurrentHub().lastEventId()}x.addBreadcrumb=eT;x.captureCheckIn=uT;x.captureEvent=QS;x.captureException=XS;x.captureMessage=JS;x.close=lT;x.configureScope=ZS;x.flush=dT;x.lastEventId=pT;x.setContext=tT;x.setExtra=rT;x.setExtras=nT;x.setTag=iT;x.setTags=sT;x.setUser=oT;x.startTransaction=cT;x.withScope=aT});var ma=g(ha=>{Object.defineProperty(ha,"__esModule",{value:!0});var fT=T(),gT=le(),_a=class{constructor(e,n){this._client=e,this.flushTimeout=60,this._pendingAggregates={},this._isEnabled=!0,this._intervalId=setInterval(()=>this.flush(),this.flushTimeout*1e3),this._sessionAttrs=n}flush(){let e=this.getSessionAggregates();e.aggregates.length!==0&&(this._pendingAggregates={},this._client.sendSession(e))}getSessionAggregates(){let e=Object.keys(this._pendingAggregates).map(r=>this._pendingAggregates[parseInt(r)]),n={attrs:this._sessionAttrs,aggregates:e};return fT.dropUndefinedKeys(n)}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;let e=gT.getCurrentHub().getScope(),n=e.getRequestSession();n&&n.status&&(this._incrementSessionStatusCount(n.status,new Date),e.setRequestSession(void 0))}_incrementSessionStatusCount(e,n){let r=new Date(n).setSeconds(0,0);this._pendingAggregates[r]=this._pendingAggregates[r]||{};let s=this._pendingAggregates[r];switch(s.started||(s.started=new Date(r).toISOString()),e){case"errored":return s.errored=(s.errored||0)+1,s.errored;case"ok":return s.exited=(s.exited||0)+1,s.exited;default:return s.crashed=(s.crashed||0)+1,s.crashed}}};ha.SessionFlusher=_a});var Is=g(bs=>{Object.defineProperty(bs,"__esModule",{value:!0});var Ea=T(),_T="7";function ip(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function hT(t){return`${ip(t)}${t.projectId}/envelope/`}function mT(t,e){return Ea.urlEncode({sentry_key:t.publicKey,sentry_version:_T,...e&&{sentry_client:`${e.name}/${e.version}`}})}function ET(t,e={}){let n=typeof e=="string"?e:e.tunnel,r=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return n||`${hT(t)}?${mT(t,r)}`}function yT(t,e){let n=Ea.makeDsn(t);if(!n)return"";let r=`${ip(n)}embed/error-page/`,s=`dsn=${Ea.dsnToString(n)}`;for(let i in e)if(i!=="dsn")if(i==="user"){let o=e.user;if(!o)continue;o.name&&(s+=`&name=${encodeURIComponent(o.name)}`),o.email&&(s+=`&email=${encodeURIComponent(o.email)}`)}else s+=`&${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`;return`${r}?${s}`}bs.getEnvelopeEndpointWithUrlEncodedAuth=ET;bs.getReportDialogEndpoint=yT});var op=g(As=>{Object.defineProperty(As,"__esModule",{value:!0});var nn=T();function ST(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function TT(t,e,n,r){let s=nn.getSdkMetadataForEnvelopeHeader(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:nn.dsnToString(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return nn.createEnvelope(i,[o])}function bT(t,e,n,r){let s=nn.getSdkMetadataForEnvelopeHeader(n),i=t.type&&t.type!=="replay_event"?t.type:"event";ST(t,n&&n.sdk);let o=nn.createEventEnvelopeHeaders(t,s,r,e);delete t.sdkProcessingMetadata;let a=[{type:i},t];return nn.createEnvelope(o,[a])}As.createEventEnvelope=bT;As.createSessionEnvelope=TT});var Ta=g(Tt=>{Object.defineProperty(Tt,"__esModule",{value:!0});var Sa=T(),IT=Hn(),ap=le(),ya=[];function AT(t){let e={};return t.forEach(n=>{let{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.keys(e).map(n=>e[n])}function vT(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=Sa.arrayify(n(e)):r=e;let s=AT(r),i=DT(s,o=>o.name==="Debug");if(i!==-1){let[o]=s.splice(i,1);s.push(o)}return s}function RT(t,e){let n={};return e.forEach(r=>{r&&cp(t,r,n)}),n}function cp(t,e,n){if(n[e.name]=e,ya.indexOf(e.name)===-1&&(e.setupOnce(IT.addGlobalEventProcessor,ap.getCurrentHub),ya.push(e.name)),t.on&&typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,i)=>r(s,i,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){let r=e.processEvent.bind(e),s=Object.assign((i,o)=>r(i,o,t),{id:e.name});t.addEventProcessor(s)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Sa.logger.log(`Integration installed: ${e.name}`)}function CT(t){let e=ap.getCurrentHub().getClient();if(!e||!e.addIntegration){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Sa.logger.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}function DT(t,e){for(let n=0;n<t.length;n++)if(e(t[n])===!0)return n;return-1}Tt.addIntegration=CT;Tt.getIntegrationsToSetup=vT;Tt.installedIntegrations=ya;Tt.setupIntegration=cp;Tt.setupIntegrations=RT});var ba=g(nr=>{Object.defineProperty(nr,"__esModule",{value:!0});var te=T(),OT=$n(),up=Hn(),NT=ps();function wT(t,e,n,r,s){let{normalizeDepth:i=3,normalizeMaxBreadth:o=1e3}=t,a={...e,event_id:e.event_id||n.event_id||te.uuid4(),timestamp:e.timestamp||te.dateTimestampInSeconds()},c=n.integrations||t.integrations.map(p=>p.name);kT(a,t),PT(a,c),e.type===void 0&&lp(a,t.stackParser);let u=r;n.captureContext&&(u=NT.Scope.clone(u).update(n.captureContext));let d=te.resolvedSyncPromise(a),l=s&&s.getEventProcessors?s.getEventProcessors():[];if(u){if(u.getAttachments){let p=[...n.attachments||[],...u.getAttachments()];p.length&&(n.attachments=p)}d=u.applyToEvent(a,n,l)}else d=up.notifyEventProcessors([...l,...up.getGlobalEventProcessors()],a,n);return d.then(p=>(p&&pp(p),typeof i=="number"&&i>0?xT(p,i,o):p))}function kT(t,e){let{environment:n,release:r,dist:s,maxValueLength:i=250}=e;"environment"in t||(t.environment="environment"in e?n:OT.DEFAULT_ENVIRONMENT),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&s!==void 0&&(t.dist=s),t.message&&(t.message=te.truncate(t.message,i));let o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=te.truncate(o.value,i));let a=t.request;a&&a.url&&(a.url=te.truncate(a.url,i))}var dp=new WeakMap;function lp(t,e){let n=te.GLOBAL_OBJ._sentryDebugIds;if(!n)return;let r,s=dp.get(e);s?r=s:(r=new Map,dp.set(e,r));let i=Object.keys(n).reduce((o,a)=>{let c,u=r.get(a);u?c=u:(c=e(a),r.set(a,c));for(let d=c.length-1;d>=0;d--){let l=c[d];if(l.filename){o[l.filename]=n[a];break}}return o},{});try{t.exception.values.forEach(o=>{o.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=i[a.filename])})})}catch{}}function pp(t){let e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?e[s.abs_path]=s.debug_id:s.filename&&(e[s.filename]=s.debug_id),delete s.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.keys(e).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:e[r]})})}function PT(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function xT(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(s=>({...s,...s.data&&{data:te.normalize(s.data,e,n)}}))},...t.user&&{user:te.normalize(t.user,e,n)},...t.contexts&&{contexts:te.normalize(t.contexts,e,n)},...t.extra&&{extra:te.normalize(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=te.normalize(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(s=>(s.data&&(s.data=te.normalize(s.data,e,n)),s))),r}nr.applyDebugIds=lp;nr.applyDebugMeta=pp;nr.prepareEvent=wT});var va=g(Aa=>{Object.defineProperty(Aa,"__esModule",{value:!0});var C=T(),UT=Is(),fp=op(),gp=Ta(),_p=Wn(),MT=Jn(),LT=ba(),hp="Not capturing exception because it's already been captured.",Ia=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=C.makeDsn(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.warn("No DSN provided, client will not send events."),this._dsn){let n=UT.getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(C.checkOrSetAlreadyCaught(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(hp);return}let s=n&&n.event_id;return this._process(this.eventFromException(e,n).then(i=>this._captureEvent(i,n,r)).then(i=>{s=i})),s}captureMessage(e,n,r,s){let i=r&&r.event_id,o=C.isPrimitive(e)?this.eventFromMessage(String(e),n,r):this.eventFromException(e,r);return this._process(o.then(a=>this._captureEvent(a,r,s)).then(a=>{i=a})),i}captureEvent(e,n,r){if(n&&n.originalException&&C.checkOrSetAlreadyCaught(n.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(hp);return}let s=n&&n.event_id;return this._process(this._captureEvent(e,n,r).then(i=>{s=i})),s}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),_p.updateSession(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?this._isClientDoneProcessing(e).then(r=>n.flush(e).then(s=>r&&s)):C.resolvedSyncPromise(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=gp.setupIntegrations(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){gp.setupIntegration(this,e,this._integrations)}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=fp.createEventEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])r=C.addItemToEnvelope(r,C.createAttachmentEnvelopeItem(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let s=this._sendEnvelope(r);s&&s.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let n=fp.createSessionEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){let s=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(`Adding outcome: "${s}"`),this._outcomes[s]=this._outcomes[s]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,s=!1,i=n.exception&&n.exception.values;if(i){s=!0;for(let c of i){let u=c.mechanism;if(u&&u.handled===!1){r=!0;break}}}let o=e.status==="ok";(o&&e.errors===0||o&&r)&&(_p.updateSession(e,{...r&&{status:"crashed"},errors:e.errors||Number(s||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new C.SyncPromise(n=>{let r=0,s=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=s,e&&r>=e&&(clearInterval(i),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",e,n),LT.prepareEvent(s,e,n,r,this).then(o=>{if(o===null)return o;let{propagationContext:a}=o.sdkProcessingMetadata||{};if(!(o.contexts&&o.contexts.trace)&&a){let{traceId:u,spanId:d,parentSpanId:l,dsc:p}=a;o.contexts={trace:{trace_id:u,span_id:d,parent_span_id:l},...o.contexts};let f=p||MT.getDynamicSamplingContextFromClient(u,this,r);o.sdkProcessingMetadata={dynamicSamplingContext:f,...o.sdkProcessingMetadata}}return o})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(s=>s.event_id,s=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=s;i.logLevel==="log"?C.logger.log(i.message):C.logger.warn(i)}})}_processEvent(e,n,r){let s=this.getOptions(),{sampleRate:i}=s,o=Ep(e),a=mp(e),c=e.type||"error",u=`before send for type \`${c}\``;if(a&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),C.rejectedSyncPromise(new C.SentryError(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let d=c==="replay_event"?"replay":c;return this._prepareEvent(e,n,r).then(l=>{if(l===null)throw this.recordDroppedEvent("event_processor",d,e),new C.SentryError("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return l;let f=FT(s,l,n);return qT(f,u)}).then(l=>{if(l===null)throw this.recordDroppedEvent("before_send",d,e),new C.SentryError(`${u} returned \`null\`, will not send event.`,"log");let p=r&&r.getSession();!o&&p&&this._updateSessionFromEvent(p,l);let f=l.transaction_info;if(o&&f&&l.transaction!==e.transaction){let m="custom";l.transaction_info={...f,source:m}}return this.sendEvent(l,n),l}).then(null,l=>{throw l instanceof C.SentryError?l:(this.captureException(l,{data:{__sentry__:!0},originalException:l}),new C.SentryError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
13
|
+
Reason: ${l}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.error("Error while sending event:",n)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{let[r,s]=n.split(":");return{reason:r,category:s,quantity:e[n]}})}};function qT(t,e){let n=`${e} must return \`null\` or a valid event.`;if(C.isThenable(t))return t.then(r=>{if(!C.isPlainObject(r)&&r!==null)throw new C.SentryError(n);return r},r=>{throw new C.SentryError(`${e} rejected with ${r}`)});if(!C.isPlainObject(t)&&t!==null)throw new C.SentryError(n);return t}function FT(t,e,n){let{beforeSend:r,beforeSendTransaction:s}=t;return mp(e)&&r?r(e,n):Ep(e)&&s?s(e,n):e}function mp(t){return t.type===void 0}function Ep(t){return t.type==="transaction"}Aa.BaseClient=Ia});var Da=g(Ca=>{Object.defineProperty(Ca,"__esModule",{value:!0});var Ra=T();function GT(t,e,n,r,s){let i={sent_at:new Date().toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&s&&(i.dsn=Ra.dsnToString(s)),e&&(i.trace=Ra.dropUndefinedKeys(e));let o=BT(t);return Ra.createEnvelope(i,[o])}function BT(t){return[{type:"check_in"},t]}Ca.createCheckInEnvelope=GT});var yp=g(Na=>{Object.defineProperty(Na,"__esModule",{value:!0});var Be=T(),$T=va(),jT=Da(),HT=le(),YT=ma(),KT=da(),WT=Jn();la();var Oa=class extends $T.BaseClient{constructor(e){KT.addTracingExtensions(),super(e)}eventFromException(e,n){return Be.resolvedSyncPromise(Be.eventFromUnknownInput(HT.getCurrentHub,this._options.stackParser,e,n))}eventFromMessage(e,n="info",r){return Be.resolvedSyncPromise(Be.eventFromMessage(this._options.stackParser,e,n,r,this._options.attachStacktrace))}captureException(e,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&r){let s=r.getRequestSession();s&&s.status==="ok"&&(s.status="errored")}return super.captureException(e,n,r)}captureEvent(e,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&r&&(e.type||"exception")==="exception"&&e.exception&&e.exception.values&&e.exception.values.length>0){let o=r.getRequestSession();o&&o.status==="ok"&&(o.status="errored")}return super.captureEvent(e,n,r)}close(e){return this._sessionFlusher&&this._sessionFlusher.close(),super.close(e)}initSessionFlusher(){let{release:e,environment:n}=this._options;e?this._sessionFlusher=new YT.SessionFlusher(this,{release:e,environment:n}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("Cannot initialise an instance of SessionFlusher if no release is provided!")}captureCheckIn(e,n,r){let s=e.status!=="in_progress"&&e.checkInId?e.checkInId:Be.uuid4();if(!this._isEnabled())return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("SDK not enabled, will not capture checkin."),s;let i=this.getOptions(),{release:o,environment:a,tunnel:c}=i,u={check_in_id:s,monitor_slug:e.monitorSlug,status:e.status,release:o,environment:a};e.status!=="in_progress"&&(u.duration=e.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone});let[d,l]=this._getTraceInfoFromScope(r);l&&(u.contexts={trace:l});let p=jT.createCheckInEnvelope(u,d,this.getSdkMetadata(),c,this.getDsn());return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.info("Sending checkin:",e.monitorSlug,e.status),this._sendEnvelope(p),s}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("Discarded request mode session because autoSessionTracking option was disabled")}_prepareEvent(e,n,r){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:(e.contexts||{}).runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,n,r)}_getTraceInfoFromScope(e){if(!e)return[void 0,void 0];let n=e.getSpan();if(n)return[n.transaction?n.transaction.getDynamicSamplingContext():void 0,n.getTraceContext()];let{traceId:r,spanId:s,parentSpanId:i,dsc:o}=e.getPropagationContext(),a={trace_id:r,span_id:s,parent_span_id:i};return o?[o,a]:[WT.getDynamicSamplingContextFromClient(r,this,e),a]}};Na.ServerRuntimeClient=Oa});var Sp=g(wa=>{Object.defineProperty(wa,"__esModule",{value:!0});var VT=T(),zT=le();function XT(t,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?VT.logger.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let n=zT.getCurrentHub();n.getScope().update(e.initialScope);let s=new t(e);n.bindClient(s)}wa.initAndBind=XT});var Ip=g(vs=>{Object.defineProperty(vs,"__esModule",{value:!0});var Q=T(),bp=30;function JT(t,e,n=Q.makePromiseBuffer(t.bufferSize||bp)){let r={},s=o=>n.drain(o);function i(o){let a=[];if(Q.forEachEnvelopeItem(o,(l,p)=>{let f=Q.envelopeItemTypeToDataCategory(p);if(Q.isRateLimited(r,f)){let m=Tp(l,p);t.recordDroppedEvent("ratelimit_backoff",f,m)}else a.push(l)}),a.length===0)return Q.resolvedSyncPromise();let c=Q.createEnvelope(o[0],a),u=l=>{Q.forEachEnvelopeItem(c,(p,f)=>{let m=Tp(p,f);t.recordDroppedEvent(l,Q.envelopeItemTypeToDataCategory(f),m)})},d=()=>e({body:Q.serializeEnvelope(c,t.textEncoder)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Q.logger.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Q.updateRateLimits(r,l),l),l=>{throw u("network_error"),l});return n.add(d).then(l=>l,l=>{if(l instanceof Q.SentryError)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Q.logger.error("Skipped sending event because buffer is full."),u("queue_overflow"),Q.resolvedSyncPromise();throw l})}return i.__sentry__baseTransport__=!0,{send:i,flush:s}}function Tp(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}vs.DEFAULT_TRANSPORT_BUFFER_SIZE=bp;vs.createTransport=JT});var vp=g(rr=>{Object.defineProperty(rr,"__esModule",{value:!0});var Pa=T(),Ap=100,xa=5e3,QT=36e5;function ka(t,e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pa.logger.info(`[Offline]: ${t}`,e)}function ZT(t){return e=>{let n=t(e),r=e.createStore?e.createStore(e):void 0,s=xa,i;function o(d,l,p){return Pa.envelopeContainsItemType(d,["replay_event","replay_recording","client_report"])?!1:e.shouldStore?e.shouldStore(d,l,p):!0}function a(d){r&&(i&&clearTimeout(i),i=setTimeout(async()=>{i=void 0;let l=await r.pop();l&&(ka("Attempting to send previously queued event"),u(l).catch(p=>{ka("Failed to retry sending",p)}))},d),typeof i!="number"&&i.unref&&i.unref())}function c(){i||(a(s),s=Math.min(s*2,QT))}async function u(d){try{let l=await n.send(d),p=Ap;if(l){if(l.headers&&l.headers["retry-after"])p=Pa.parseRetryAfterHeader(l.headers["retry-after"]);else if((l.statusCode||0)>=400)return l}return a(p),s=xa,l}catch(l){if(r&&await o(d,l,s))return await r.insert(d),c(),ka("Error sending. Event queued",l),{};throw l}}return e.flushAtStartup&&c(),{send:u,flush:d=>n.flush(d)}}}rr.MIN_DELAY=Ap;rr.START_DELAY=xa;rr.makeOfflineTransport=ZT});var Cp=g(Rs=>{Object.defineProperty(Rs,"__esModule",{value:!0});var Rp=T(),eb=Is();function Ua(t,e){let n;return Rp.forEachEnvelopeItem(t,(r,s)=>(e.includes(s)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function tb(t,e){return n=>{let r=t(n);return{send:async s=>{let i=Ua(s,["event","transaction","profile","replay_event"]);return i&&(i.release=e),r.send(s)},flush:s=>r.flush(s)}}}function nb(t,e){return n=>{let r=t(n),s={};function i(c,u){let d=u?`${c}:${u}`:c;if(!s[d]){let l=Rp.dsnFromString(c);if(!l)return;let p=eb.getEnvelopeEndpointWithUrlEncodedAuth(l);s[d]=u?tb(t,u)({...n,url:p}):t({...n,url:p})}return s[d]}async function o(c){function u(p){let f=p&&p.length?p:["event"];return Ua(c,f)}let d=e({envelope:c,getEvent:u}).map(p=>typeof p=="string"?i(p,void 0):i(p.dsn,p.release)).filter(p=>!!p);return d.length===0&&d.push(r),(await Promise.all(d.map(p=>p.send(c))))[0]}async function a(c){let u=[...Object.keys(s).map(l=>s[l]),r];return(await Promise.all(u.map(l=>l.flush(c)))).every(l=>l)}return{send:o,flush:a}}}Rs.eventFromEnvelope=Ua;Rs.makeMultiplexedTransport=nb});var Dp=g(Ma=>{Object.defineProperty(Ma,"__esModule",{value:!0});var rb="7.74.1";Ma.SDK_VERSION=rb});var qa=g(La=>{Object.defineProperty(La,"__esModule",{value:!0});var sb=T(),Op,Cs=class t{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=t.id}setupOnce(){Op=Function.prototype.toString;try{Function.prototype.toString=function(...e){let n=sb.getOriginalFunction(this)||this;return Op.apply(n,e)}}catch{}}};Cs.__initStatic();La.FunctionToString=Cs});var Fa=g(sr=>{Object.defineProperty(sr,"__esModule",{value:!0});var F=T(),ib=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ob=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Ds=class t{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=t.id,this._options=e}setupOnce(e,n){}processEvent(e,n,r){let s=r.getOptions(),i=Np(this._options,s);return wp(e,i)?null:e}};Ds.__initStatic();function Np(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:ib],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:ob],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function wp(t,e){return e.ignoreInternal&&pb(t)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being internal Sentry Error.
|
|
14
|
+
Event: ${F.getEventDescription(t)}`),!0):ab(t,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
15
|
+
Event: ${F.getEventDescription(t)}`),!0):cb(t,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
16
|
+
Event: ${F.getEventDescription(t)}`),!0):ub(t,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
17
17
|
Event: ${F.getEventDescription(t)}.
|
|
18
|
-
Url: ${Os(t)}`),!0):
|
|
18
|
+
Url: ${Os(t)}`),!0):db(t,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
19
19
|
Event: ${F.getEventDescription(t)}.
|
|
20
|
-
Url: ${Os(t)}`),!0)}function ob(t,e){return t.type||!e||!e.length?!1:db(t).some(n=>F.stringMatchesSomePattern(n,e))}function ab(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let n=t.transaction;return n?F.stringMatchesSomePattern(n,e):!1}function cb(t,e){if(!e||!e.length)return!1;let n=Os(t);return n?F.stringMatchesSomePattern(n,e):!1}function ub(t,e){if(!e||!e.length)return!0;let n=Os(t);return n?F.stringMatchesSomePattern(n,e):!0}function db(t){let e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&e.length===0&&F.logger.error(`Could not extract message for event ${F.getEventDescription(t)}`),e}function lb(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function pb(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Os(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?pb(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.error(`Cannot extract url for event ${F.getEventDescription(t)}`),null}}sr.InboundFilters=Ds;sr._mergeOptions=Np;sr._shouldDropEvent=wp});var kp=g(Ns=>{Object.defineProperty(Ns,"__esModule",{value:!0});var fb=qa(),gb=Fa();Ns.FunctionToString=fb.FunctionToString;Ns.InboundFilters=gb.InboundFilters});var Pp=g(Ga=>{Object.defineProperty(Ga,"__esModule",{value:!0});function _b(t,e){let n=e.getClient(),r=n&&n.getDsn(),s=n&&n.getOptions().tunnel;return mb(t,r)||hb(t,s)}function hb(t,e){return e?xp(t)===xp(e):!1}function mb(t,e){return e?t.includes(e.host):!1}function xp(t){return t[t.length-1]==="/"?t.slice(0,-1):t}Ga.isSentryRequestUrl=_b});var qp=g(ir=>{Object.defineProperty(ir,"__esModule",{value:!0});var Ba=T(),Mp=new Map,Up=new Set;function Eb(t){if(Ba.GLOBAL_OBJ._sentryModuleMetadata)for(let e of Object.keys(Ba.GLOBAL_OBJ._sentryModuleMetadata)){let n=Ba.GLOBAL_OBJ._sentryModuleMetadata[e];if(Up.has(e))continue;Up.add(e);let r=t(e);for(let s of r.reverse())if(s.filename){Mp.set(s.filename,n);break}}}function Lp(t,e){return Eb(t),Mp.get(e)}function yb(t,e){try{e.exception.values.forEach(n=>{if(n.stacktrace)for(let r of n.stacktrace.frames||[]){if(!r.filename)continue;let s=Lp(t,r.filename);s&&(r.module_metadata=s)}})}catch{}}function Sb(t){try{t.exception.values.forEach(e=>{if(e.stacktrace)for(let n of e.stacktrace.frames||[])delete n.module_metadata})}catch{}}ir.addMetadataToStackFrames=yb;ir.getMetadataForUrl=Lp;ir.stripMetadataFromStackFrames=Sb});var Gp=g($a=>{Object.defineProperty($a,"__esModule",{value:!0});var Tb=T(),Fp=qp(),ws=class t{static __initStatic(){this.id="ModuleMetadata"}constructor(){this.name=t.id}setupOnce(e,n){let r=n().getClient();if(!r||typeof r.on!="function")return;r.on("beforeEnvelope",i=>{Tb.forEachEnvelopeItem(i,(o,a)=>{if(a==="event"){let c=Array.isArray(o)?o[1]:void 0;c&&(Fp.stripMetadataFromStackFrames(c),o[1]=c)}})});let s=r.getOptions().stackParser;e(i=>(Fp.addMetadataToStackFrames(s,i),i))}};ws.__initStatic();$a.ModuleMetadata=ws});var N=g(S=>{Object.defineProperty(S,"__esModule",{value:!0});var Bp=da(),$p=aa(),jp=hs(),bb=ms(),Ib=_s(),Ab=la(),bt=np(),vb=Jn(),Rb=rp(),Y=sp(),$e=le(),ja=Wn(),Cb=ma(),Db=ps(),Ob=Hn(),Hp=Is(),Nb=va(),wb=yp(),kb=Sp(),xb=Ip(),Pb=vp(),Ub=Cp(),Mb=Dp(),Yp=Ta(),Lb=kp(),qb=ba(),Fb=Da(),Gb=Ss(),Bb=Pp(),$b=$n(),jb=Gp(),Hb=qa(),Yb=Fa(),Kb=T();S.addTracingExtensions=Bp.addTracingExtensions;S.startIdleTransaction=Bp.startIdleTransaction;S.IdleTransaction=$p.IdleTransaction;S.TRACING_DEFAULTS=$p.TRACING_DEFAULTS;S.Span=jp.Span;S.spanStatusfromHttpCode=jp.spanStatusfromHttpCode;S.Transaction=bb.Transaction;S.getActiveTransaction=Ib.getActiveTransaction;Object.defineProperty(S,"SpanStatus",{enumerable:!0,get:()=>Ab.SpanStatus});S.continueTrace=bt.continueTrace;S.getActiveSpan=bt.getActiveSpan;S.startActiveSpan=bt.startActiveSpan;S.startInactiveSpan=bt.startInactiveSpan;S.startSpan=bt.startSpan;S.startSpanManual=bt.startSpanManual;S.trace=bt.trace;S.getDynamicSamplingContextFromClient=vb.getDynamicSamplingContextFromClient;S.setMeasurement=Rb.setMeasurement;S.addBreadcrumb=Y.addBreadcrumb;S.captureCheckIn=Y.captureCheckIn;S.captureEvent=Y.captureEvent;S.captureException=Y.captureException;S.captureMessage=Y.captureMessage;S.close=Y.close;S.configureScope=Y.configureScope;S.flush=Y.flush;S.lastEventId=Y.lastEventId;S.setContext=Y.setContext;S.setExtra=Y.setExtra;S.setExtras=Y.setExtras;S.setTag=Y.setTag;S.setTags=Y.setTags;S.setUser=Y.setUser;S.startTransaction=Y.startTransaction;S.withScope=Y.withScope;S.Hub=$e.Hub;S.ensureHubOnCarrier=$e.ensureHubOnCarrier;S.getCurrentHub=$e.getCurrentHub;S.getHubFromCarrier=$e.getHubFromCarrier;S.getMainCarrier=$e.getMainCarrier;S.makeMain=$e.makeMain;S.runWithAsyncContext=$e.runWithAsyncContext;S.setAsyncContextStrategy=$e.setAsyncContextStrategy;S.setHubOnCarrier=$e.setHubOnCarrier;S.closeSession=ja.closeSession;S.makeSession=ja.makeSession;S.updateSession=ja.updateSession;S.SessionFlusher=Cb.SessionFlusher;S.Scope=Db.Scope;S.addGlobalEventProcessor=Ob.addGlobalEventProcessor;S.getEnvelopeEndpointWithUrlEncodedAuth=Hp.getEnvelopeEndpointWithUrlEncodedAuth;S.getReportDialogEndpoint=Hp.getReportDialogEndpoint;S.BaseClient=Nb.BaseClient;S.ServerRuntimeClient=wb.ServerRuntimeClient;S.initAndBind=kb.initAndBind;S.createTransport=xb.createTransport;S.makeOfflineTransport=Pb.makeOfflineTransport;S.makeMultiplexedTransport=Ub.makeMultiplexedTransport;S.SDK_VERSION=Mb.SDK_VERSION;S.addIntegration=Yp.addIntegration;S.getIntegrationsToSetup=Yp.getIntegrationsToSetup;S.Integrations=Lb;S.prepareEvent=qb.prepareEvent;S.createCheckInEnvelope=Fb.createCheckInEnvelope;S.hasTracingEnabled=Gb.hasTracingEnabled;S.isSentryRequestUrl=Bb.isSentryRequestUrl;S.DEFAULT_ENVIRONMENT=$b.DEFAULT_ENVIRONMENT;S.ModuleMetadata=jb.ModuleMetadata;S.FunctionToString=Hb.FunctionToString;S.InboundFilters=Yb.InboundFilters;S.extractTraceparentData=Kb.extractTraceparentData});var Ya=g(Ha=>{Object.defineProperty(Ha,"__esModule",{value:!0});function Wb(t,e){return t??e()}Ha._nullishCoalesce=Wb});var Kp=g(Ka=>{Object.defineProperty(Ka,"__esModule",{value:!0});var Vb=Ya();async function zb(t,e){return Vb._nullishCoalesce(t,e)}Ka._asyncNullishCoalesce=zb});var Va=g(Wa=>{Object.defineProperty(Wa,"__esModule",{value:!0});async function Xb(t){let e,n=t[0],r=1;for(;r<t.length;){let s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=await i(n)):(s==="call"||s==="optionalCall")&&(n=await i((...o)=>n.call(e,...o)),e=void 0)}return n}Wa._asyncOptionalChain=Xb});var Wp=g(za=>{Object.defineProperty(za,"__esModule",{value:!0});var Jb=Va();async function Qb(t){let e=await Jb._asyncOptionalChain(t);return e??!0}za._asyncOptionalChainDelete=Qb});var Ja=g(Xa=>{Object.defineProperty(Xa,"__esModule",{value:!0});function Zb(t){let e,n=t[0],r=1;for(;r<t.length;){let s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(e,...o)),e=void 0)}return n}Xa._optionalChain=Zb});var Vp=g(Qa=>{Object.defineProperty(Qa,"__esModule",{value:!0});var eI=Ja();function tI(t){let e=eI._optionalChain(t);return e??!0}Qa._optionalChainDelete=tI});var k=g(st=>{Object.defineProperty(st,"__esModule",{value:!0});var nI=Kp(),rI=Va(),sI=Wp(),iI=Ya(),oI=Ja(),aI=Vp();st._asyncNullishCoalesce=nI._asyncNullishCoalesce;st._asyncOptionalChain=rI._asyncOptionalChain;st._asyncOptionalChainDelete=sI._asyncOptionalChainDelete;st._nullishCoalesce=iI._nullishCoalesce;st._optionalChain=oI._optionalChain;st._optionalChainDelete=aI._optionalChainDelete});var it=g(Za=>{var{_optionalChain:zp}=k();Object.defineProperty(Za,"__esModule",{value:!0});function cI(t){let e=zp([t,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]);return(zp([e,"optionalAccess",r=>r.instrumenter])||"sentry")!=="sentry"}Za.shouldDisableAutoInstrumentation=cI});var Zp=g(or=>{var{_optionalChain:Re}=k();Object.defineProperty(or,"__esModule",{value:!0});var me=T(),uI=it(),ks=class t{static __initStatic(){this.id="Express"}constructor(e={}){this.name=t.id,this._router=e.router||e.app,this._methods=(Array.isArray(e.methods)?e.methods:[]).concat("use")}setupOnce(e,n){if(!this._router){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.error("ExpressIntegration is missing an Express instance");return}if(uI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.log("Express Integration is skipped because of instrumenter configuration.");return}pI(this._router,this._methods),fI(this._router)}};ks.__initStatic();function Xp(t,e){let n=t.length;switch(n){case 2:return function(r,s){let i=s.__sentry_transaction;if(i){let o=i.startChild({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"});s.once("finish",()=>{o.finish()})}return t.call(this,r,s)};case 3:return function(r,s,i){let o=s.__sentry_transaction,a=Re([o,"optionalAccess",c=>c.startChild,"call",c=>c({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,s,function(...c){Re([a,"optionalAccess",u=>u.finish,"call",u=>u()]),i.call(this,...c)})};case 4:return function(r,s,i,o){let a=i.__sentry_transaction,c=Re([a,"optionalAccess",u=>u.startChild,"call",u=>u({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,s,i,function(...u){Re([c,"optionalAccess",d=>d.finish,"call",d=>d()]),o.call(this,...u)})};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}function dI(t,e){return t.map(n=>typeof n=="function"?Xp(n,e):Array.isArray(n)?n.map(r=>typeof r=="function"?Xp(r,e):r):n)}function lI(t,e){let n=t[e];return t[e]=function(...r){return n.call(this,...dI(r,e))},t}function pI(t,e=[]){e.forEach(n=>lI(t,n))}function fI(t){let e="settings"in t;e&&t._router===void 0&&t.lazyrouter&&t.lazyrouter();let n=e?t._router:t;if(!n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.debug("Routing instrumentation is currently only supported in Express 4.");return}let r=Object.getPrototypeOf(n),s=r.process_params;r.process_params=function(o,a,c,u,d){c._reconstructedRoute||(c._reconstructedRoute="");let{layerRoutePath:l,isRegex:p,isArray:f,numExtraSegments:m}=gI(o);(l||p||f)&&(c._hasParameters=!0);let E;l?E=l:E=Qp(c.originalUrl,c._reconstructedRoute,o.path)||"";let b=E.split("/").filter(se=>se.length>0&&(p||f||!se.includes("*"))).join("/");b&&b.length>0&&(c._reconstructedRoute+=`/${b}${p?"/":""}`);let v=me.getNumberOfUrlSegments(c.originalUrl||"")+m,L=me.getNumberOfUrlSegments(c._reconstructedRoute);if(v===L){c._hasParameters||c._reconstructedRoute!==c.originalUrl&&(c._reconstructedRoute=c.originalUrl?me.stripUrlQueryAndFragment(c.originalUrl):c.originalUrl);let se=u.__sentry_transaction;if(se&&se.metadata.source!=="custom"){let ie=c._reconstructedRoute||"/";se.setName(...me.extractPathForTransaction(c,{path:!0,method:!0,customRoute:ie}))}}return s.call(this,o,a,c,u,d)}}var Jp=(t,e,n)=>{if(!t||!e||!n||Object.keys(n).length===0||!Re([n,"access",u=>u[0],"optionalAccess",u=>u.offset]))return;let r=n.sort((u,d)=>u.offset-d.offset),i=new RegExp(e,`${e.flags}d`).exec(t);if(!i||!i.indices)return;let[,...o]=i.indices;if(o.length!==r.length)return;let a=t,c=0;return o.forEach(([u,d],l)=>{let p=a.substring(0,u-c),f=`:${r[l].name}`,m=a.substring(d-c);a=p+f+m,c=c+(d-u-f.length)}),a};function gI(t){let e=Re([t,"access",o=>o.route,"optionalAccess",o=>o.path]),n=me.isRegExp(e),r=Array.isArray(e);if(!e){let[o]=process.versions.node.split(".").map(Number);o>=16&&(e=Jp(t.path,t.regexp,t.keys))}if(!e)return{isRegex:n,isArray:r,numExtraSegments:0};let s=r?Math.max(_I(e)-me.getNumberOfUrlSegments(t.path||""),0):0;return{layerRoutePath:hI(r,e),isRegex:n,isArray:r,numExtraSegments:s}}function _I(t){return t.reduce((e,n)=>e+me.getNumberOfUrlSegments(n.toString()),0)}function hI(t,e){return t?e.map(n=>n.toString()).join(","):e&&e.toString()}function Qp(t,e,n){let r=Re([t,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c)]),s=0,i=Re([e,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c),"access",a=>a.length])||0;return Re([n,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>Re([r,"optionalAccess",u=>u[i+s]])===c?(s+=1,!0):!1),"access",a=>a.join,"call",a=>a("/")])}or.Express=ks;or.extractOriginalRoute=Jp;or.preventDuplicateSegments=Qp});var ef=g(ec=>{var{_optionalChain:rn}=k();Object.defineProperty(ec,"__esModule",{value:!0});var sn=T(),mI=it(),xs=class t{static __initStatic(){this.id="Postgres"}constructor(e={}){this.name=t.id,this._usePgNative=!!e.usePgNative,this._module=e.module}loadDependency(){return this._module=this._module||sn.loadModule("pg")}setupOnce(e,n){if(mI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.log("Postgres Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.error("Postgres Integration was unable to require `pg` package.");return}let s=this._usePgNative?rn([r,"access",i=>i.native,"optionalAccess",i=>i.Client]):r.Client;if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.error("Postgres Integration was unable to access 'pg-native' bindings.");return}sn.fill(s.prototype,"query",function(i){return function(o,a,c){let d=n().getScope().getSpan(),l={"db.system":"postgresql"};try{this.database&&(l["db.name"]=this.database),this.host&&(l["server.address"]=this.host),this.port&&(l["server.port"]=this.port),this.user&&(l["db.user"]=this.user)}catch{}let p=rn([d,"optionalAccess",m=>m.startChild,"call",m=>m({description:typeof o=="string"?o:o.text,op:"db",origin:"auto.db.postgres",data:l})]);if(typeof c=="function")return i.call(this,o,a,function(m,E){rn([p,"optionalAccess",b=>b.finish,"call",b=>b()]),c(m,E)});if(typeof a=="function")return i.call(this,o,function(m,E){rn([p,"optionalAccess",b=>b.finish,"call",b=>b()]),a(m,E)});let f=typeof a<"u"?i.call(this,o,a):i.call(this,o);return sn.isThenable(f)?f.then(m=>(rn([p,"optionalAccess",E=>E.finish,"call",E=>E()]),m)):(rn([p,"optionalAccess",m=>m.finish,"call",m=>m()]),f)}})}};xs.__initStatic();ec.Postgres=xs});var tf=g(tc=>{var{_optionalChain:EI}=k();Object.defineProperty(tc,"__esModule",{value:!0});var ar=T(),yI=it(),Ps=class t{static __initStatic(){this.id="Mysql"}constructor(){this.name=t.id}loadDependency(){return this._module=this._module||ar.loadModule("mysql/lib/Connection.js")}setupOnce(e,n){if(yI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.log("Mysql Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.error("Mysql Integration was unable to require `mysql` package.");return}let s;try{r.prototype.connect=new Proxy(r.prototype.connect,{apply(a,c,u){return s||(s=c.config),a.apply(c,u)}})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.error("Mysql Integration was unable to instrument `mysql` config.")}function i(){return s?{"server.address":s.host,"server.port":s.port,"db.user":s.user}:{}}function o(a){if(!a||a.endTimestamp)return;let c=i();Object.keys(c).forEach(u=>{a.setData(u,c[u])}),a.finish()}ar.fill(r,"createQuery",function(a){return function(c,u,d){let p=n().getScope().getSpan(),f=EI([p,"optionalAccess",E=>E.startChild,"call",E=>E({description:typeof c=="string"?c:c.sql,op:"db",origin:"auto.db.mysql",data:{"db.system":"mysql"}})]);if(typeof d=="function")return a.call(this,c,u,function(E,b,v){o(f),d(E,b,v)});if(typeof u=="function")return a.call(this,c,function(E,b,v){o(f),u(E,b,v)});let m=a.call(this,c,u);return m.on("end",()=>{o(f)}),m}})}};Ps.__initStatic();tc.Mysql=Ps});var nf=g(nc=>{var{_optionalChain:It}=k();Object.defineProperty(nc,"__esModule",{value:!0});var cr=T(),SI=it(),TI=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],bI={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};function II(t){return t&&typeof t=="object"&&t.once&&typeof t.once=="function"}var Us=class t{static __initStatic(){this.id="Mongo"}constructor(e={}){this.name=t.id,this._operations=Array.isArray(e.operations)?e.operations:TI,this._describeOperations="describeOperations"in e?e.describeOperations:!0,this._useMongoose=!!e.useMongoose}loadDependency(){let e=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||cr.loadModule(e)}setupOnce(e,n){if(SI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&cr.logger.log("Mongo Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){let s=this._useMongoose?"mongoose":"mongodb";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&cr.logger.error(`Mongo Integration was unable to require \`${s}\` package.`);return}this._instrumentOperations(r.Collection,this._operations,n)}_instrumentOperations(e,n,r){n.forEach(s=>this._patchOperation(e,s,r))}_patchOperation(e,n,r){if(!(n in e.prototype))return;let s=this._getSpanContextFromOperationArguments.bind(this);cr.fill(e.prototype,n,function(i){return function(...o){let a=o[o.length-1],u=r().getScope().getSpan();if(typeof a!="function"||n==="mapReduce"&&o.length===2){let l=It([u,"optionalAccess",f=>f.startChild,"call",f=>f(s(this,n,o))]),p=i.call(this,...o);if(cr.isThenable(p))return p.then(f=>(It([l,"optionalAccess",m=>m.finish,"call",m=>m()]),f));if(II(p)){let f=p;try{f.once("close",()=>{It([l,"optionalAccess",m=>m.finish,"call",m=>m()])})}catch{It([l,"optionalAccess",E=>E.finish,"call",E=>E()])}return f}else return It([l,"optionalAccess",f=>f.finish,"call",f=>f()]),p}let d=It([u,"optionalAccess",l=>l.startChild,"call",l=>l(s(this,n,o.slice(0,-1)))]);return i.call(this,...o.slice(0,-1),function(l,p){It([d,"optionalAccess",f=>f.finish,"call",f=>f()]),a(l,p)})}})}_getSpanContextFromOperationArguments(e,n,r){let s={"db.system":"mongodb","db.name":e.dbName,"db.operation":n,"db.mongodb.collection":e.collectionName},i={op:"db",origin:"auto.db.mongo",description:n,data:s},o=bI[n],a=Array.isArray(this._describeOperations)?this._describeOperations.includes(n):this._describeOperations;if(!o||!a)return i;try{if(n==="mapReduce"){let[c,u]=r;s[o[0]]=typeof c=="string"?c:c.name||"<anonymous>",s[o[1]]=typeof u=="string"?u:u.name||"<anonymous>"}else for(let c=0;c<o.length;c++)s[`db.mongodb.${o[c]}`]=JSON.stringify(r[c])}catch{}return i}};Us.__initStatic();nc.Mongo=Us});var of=g(rc=>{Object.defineProperty(rc,"__esModule",{value:!0});var rf=N(),sf=T(),AI=it();function vI(t){return!!t&&!!t.$use}var Ms=class t{static __initStatic(){this.id="Prisma"}constructor(e={}){if(this.name=t.id,vI(e.client)&&!e.client._sentryInstrumented){sf.addNonEnumerableProperty(e.client,"_sentryInstrumented",!0);let n={};try{let r=e.client._engineConfig;if(r){let{activeProvider:s,clientVersion:i}=r;s&&(n["db.system"]=s),i&&(n["db.prisma.version"]=i)}}catch{}e.client.$use((r,s)=>{if(AI.shouldDisableAutoInstrumentation(rf.getCurrentHub))return s(r);let i=r.action,o=r.model;return rf.trace({name:o?`${o} ${i}`:i,op:"db.sql.prisma",origin:"auto.db.prisma",data:{...n,"db.operation":i}},()=>s(r))})}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sf.logger.warn("Unsupported Prisma client provided to PrismaIntegration. Provided client:",e.client)}setupOnce(){}};Ms.__initStatic();rc.Prisma=Ms});var af=g(sc=>{var{_optionalChain:on}=k();Object.defineProperty(sc,"__esModule",{value:!0});var ur=T(),RI=it(),Ls=class t{static __initStatic(){this.id="GraphQL"}constructor(){this.name=t.id}loadDependency(){return this._module=this._module||ur.loadModule("graphql/execution/execute.js")}setupOnce(e,n){if(RI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ur.logger.log("GraphQL Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ur.logger.error("GraphQL Integration was unable to require graphql/execution package.");return}ur.fill(r,"execute",function(s){return function(...i){let o=n().getScope(),a=o.getSpan(),c=on([a,"optionalAccess",d=>d.startChild,"call",d=>d({description:"execute",op:"graphql.execute",origin:"auto.graphql.graphql"})]);on([o,"optionalAccess",d=>d.setSpan,"call",d=>d(c)]);let u=s.call(this,...i);return ur.isThenable(u)?u.then(d=>(on([c,"optionalAccess",l=>l.finish,"call",l=>l()]),on([o,"optionalAccess",l=>l.setSpan,"call",l=>l(a)]),d)):(on([c,"optionalAccess",d=>d.finish,"call",d=>d()]),on([o,"optionalAccess",d=>d.setSpan,"call",d=>d(a)]),u)}})}};Ls.__initStatic();sc.GraphQL=Ls});var uf=g(oc=>{var{_optionalChain:ic}=k();Object.defineProperty(oc,"__esModule",{value:!0});var K=T(),CI=it(),qs=class t{static __initStatic(){this.id="Apollo"}constructor(e={useNestjs:!1}){this.name=t.id,this._useNest=!!e.useNestjs}loadDependency(){return this._useNest?this._module=this._module||K.loadModule("@nestjs/graphql"):this._module=this._module||K.loadModule("apollo-server-core"),this._module}setupOnce(e,n){if(CI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.log("Apollo Integration is skipped because of instrumenter configuration.");return}if(this._useNest){let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package.");return}K.fill(r.GraphQLFactory.prototype,"mergeWithSchema",function(s){return function(...i){return K.fill(this.resolversExplorerService,"explore",function(o){return function(){let a=K.arrayify(o.call(this));return cf(a,n)}}),s.call(this,...i)}})}else{let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.error("Apollo Integration was unable to require apollo-server-core package.");return}K.fill(r.ApolloServerBase.prototype,"constructSchema",function(s){return function(){if(!this.config.resolvers)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this.config.schema?(K.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),K.logger.warn()):this.config.modules&&K.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),K.logger.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),s.call(this);let i=K.arrayify(this.config.resolvers);return this.config.resolvers=cf(i,n),s.call(this)}})}}};qs.__initStatic();function cf(t,e){return t.map(n=>(Object.keys(n).forEach(r=>{Object.keys(n[r]).forEach(s=>{typeof n[r][s]=="function"&&DI(n,r,s,e)})}),n))}function DI(t,e,n,r){K.fill(t[e],n,function(s){return function(...i){let a=r().getScope().getSpan(),c=ic([a,"optionalAccess",d=>d.startChild,"call",d=>d({description:`${e}.${n}`,op:"graphql.resolve",origin:"auto.graphql.apollo"})]),u=s.call(this,...i);return K.isThenable(u)?u.then(d=>(ic([c,"optionalAccess",l=>l.finish,"call",l=>l()]),d)):(ic([c,"optionalAccess",d=>d.finish,"call",d=>d()]),u)}})}oc.Apollo=qs});var df=g((ac,ot)=>{Object.defineProperty(ac,"__esModule",{value:!0});var At=T(),OI=[()=>{let t=At.dynamicRequire(ot,"./apollo");return new t.Apollo},()=>{let t=At.dynamicRequire(ot,"./apollo");return new t.Apollo({useNestjs:!0})},()=>{let t=At.dynamicRequire(ot,"./graphql");return new t.GraphQL},()=>{let t=At.dynamicRequire(ot,"./mongo");return new t.Mongo},()=>{let t=At.dynamicRequire(ot,"./mongo");return new t.Mongo({mongoose:!0})},()=>{let t=At.dynamicRequire(ot,"./mysql");return new t.Mysql},()=>{let t=At.dynamicRequire(ot,"./postgres");return new t.Postgres}];ac.lazyLoadedNodePerformanceMonitoringIntegrations=OI});var je=g(cc=>{Object.defineProperty(cc,"__esModule",{value:!0});var NI=T(),wI=NI.GLOBAL_OBJ;cc.WINDOW=wI});var pf=g(uc=>{Object.defineProperty(uc,"__esModule",{value:!0});var kI=N(),lf=T(),Fs=je();function xI(){Fs.WINDOW&&Fs.WINDOW.document?Fs.WINDOW.document.addEventListener("visibilitychange",()=>{let t=kI.getActiveTransaction();if(Fs.WINDOW.document.hidden&&t){let e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&lf.logger.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&lf.logger.warn("[Tracing] Could not set up background tab detection due to lack of global document")}uc.registerBackgroundTabDetection=xI});var Gs=g(dc=>{Object.defineProperty(dc,"__esModule",{value:!0});var PI=(t,e,n)=>{let r,s;return i=>{e.value>=0&&(i||n)&&(s=e.value-(r||0),(s||r===void 0)&&(r=e.value,e.delta=s,t(e)))}};dc.bindReporter=PI});var ff=g(lc=>{Object.defineProperty(lc,"__esModule",{value:!0});var UI=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`;lc.generateUniqueID=UI});var fc=g(pc=>{Object.defineProperty(pc,"__esModule",{value:!0});var dr=je(),MI=()=>{let t=dr.WINDOW.performance.timing,e=dr.WINDOW.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(let r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},LI=()=>dr.WINDOW.__WEB_VITALS_POLYFILL__?dr.WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||MI()):dr.WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];pc.getNavigationEntry=LI});var _c=g(gc=>{Object.defineProperty(gc,"__esModule",{value:!0});var qI=fc(),FI=()=>{let t=qI.getNavigationEntry();return t&&t.activationStart||0};gc.getActivationStart=FI});var Bs=g(hc=>{Object.defineProperty(hc,"__esModule",{value:!0});var GI=je(),BI=ff(),$I=_c(),jI=fc(),HI=(t,e)=>{let n=jI.getNavigationEntry(),r="navigate";return n&&(GI.WINDOW.document.prerendering||$I.getActivationStart()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:BI.generateUniqueID(),navigationType:r}};hc.initMetric=HI});var lr=g(mc=>{Object.defineProperty(mc,"__esModule",{value:!0});var YI=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let r=new PerformanceObserver(s=>{e(s.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}};mc.observe=YI});var pr=g(Ec=>{Object.defineProperty(Ec,"__esModule",{value:!0});var KI=je(),WI=(t,e)=>{let n=r=>{(r.type==="pagehide"||KI.WINDOW.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)};Ec.onHidden=WI});var gf=g(yc=>{Object.defineProperty(yc,"__esModule",{value:!0});var VI=Gs(),zI=Bs(),XI=lr(),JI=pr(),QI=t=>{let e=zI.initMetric("CLS",0),n,r=0,s=[],i=a=>{a.forEach(c=>{if(!c.hadRecentInput){let u=s[0],d=s[s.length-1];r&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-u.startTime<5e3?(r+=c.value,s.push(c)):(r=c.value,s=[c]),r>e.value&&(e.value=r,e.entries=s,n&&n())}})},o=XI.observe("layout-shift",i);if(o){n=VI.bindReporter(t,e);let a=()=>{i(o.takeRecords()),n(!0)};return JI.onHidden(a),a}};yc.onCLS=QI});var js=g(Sc=>{Object.defineProperty(Sc,"__esModule",{value:!0});var _f=je(),ZI=pr(),$s=-1,eA=()=>_f.WINDOW.document.visibilityState==="hidden"&&!_f.WINDOW.document.prerendering?0:1/0,tA=()=>{ZI.onHidden(({timeStamp:t})=>{$s=t},!0)},nA=()=>($s<0&&($s=eA(),tA()),{get firstHiddenTime(){return $s}});Sc.getVisibilityWatcher=nA});var hf=g(Tc=>{Object.defineProperty(Tc,"__esModule",{value:!0});var rA=Gs(),sA=js(),iA=Bs(),oA=lr(),aA=pr(),cA=t=>{let e=sA.getVisibilityWatcher(),n=iA.initMetric("FID"),r,s=a=>{a.startTime<e.firstHiddenTime&&(n.value=a.processingStart-a.startTime,n.entries.push(a),r(!0))},i=a=>{a.forEach(s)},o=oA.observe("first-input",i);r=rA.bindReporter(t,n),o&&aA.onHidden(()=>{i(o.takeRecords()),o.disconnect()},!0)};Tc.onFID=cA});var Ef=g(bc=>{Object.defineProperty(bc,"__esModule",{value:!0});var uA=Gs(),dA=_c(),lA=js(),pA=Bs(),fA=lr(),gA=pr(),mf={},_A=t=>{let e=lA.getVisibilityWatcher(),n=pA.initMetric("LCP"),r,s=o=>{let a=o[o.length-1];if(a){let c=Math.max(a.startTime-dA.getActivationStart(),0);c<e.firstHiddenTime&&(n.value=c,n.entries=[a],r())}},i=fA.observe("largest-contentful-paint",s);if(i){r=uA.bindReporter(t,n);let o=()=>{mf[n.id]||(s(i.takeRecords()),i.disconnect(),mf[n.id]=!0,r(!0))};return["keydown","click"].forEach(a=>{addEventListener(a,o,{once:!0,capture:!0})}),gA.onHidden(o,!0),o}};bc.onLCP=_A});var yf=g(Hs=>{Object.defineProperty(Hs,"__esModule",{value:!0});function hA(t){return typeof t=="number"&&isFinite(t)}function mA(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}Hs._startChild=mA;Hs.isMeasurementValue=hA});var Rf=g(at=>{Object.defineProperty(at,"__esModule",{value:!0});var Tf=N(),U=T(),vt=je(),EA=gf(),yA=hf(),SA=Ef(),TA=js(),bf=lr(),He=yf();function M(t){return t/1e3}function If(){return vt.WINDOW&&vt.WINDOW.addEventListener&&vt.WINDOW.performance}var Sf=0,w={},Ce,fr;function bA(){let t=If();if(t&&U.browserPerformanceTimeOrigin){t.mark&&vt.WINDOW.performance.mark("sentry-tracing-init"),CA();let e=vA(),n=RA();return()=>{e&&e(),n&&n()}}return()=>{}}function IA(){let t=e=>{for(let n of e){let r=Tf.getActiveTransaction();if(!r)return;let s=M(U.browserPerformanceTimeOrigin+n.startTime),i=M(n.duration);r.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:s,endTimestamp:s+i})}};bf.observe("longtask",t)}function AA(){let t=e=>{for(let n of e){let r=Tf.getActiveTransaction();if(!r)return;if(n.name==="click"){let s=M(U.browserPerformanceTimeOrigin+n.startTime),i=M(n.duration);r.startChild({description:U.htmlTreeAsString(n.target),op:`ui.interaction.${n.name}`,origin:"auto.ui.browser.metrics",startTimestamp:s,endTimestamp:s+i})}}};bf.observe("event",t,{durationThreshold:0})}function vA(){return EA.onCLS(t=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding CLS"),w.cls={value:t.value,unit:""},fr=e)})}function RA(){return SA.onLCP(t=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding LCP"),w.lcp={value:t.value,unit:"millisecond"},Ce=e)})}function CA(){yA.onFID(t=>{let e=t.entries.pop();if(!e)return;let n=M(U.browserPerformanceTimeOrigin),r=M(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FID"),w.fid={value:t.value,unit:"millisecond"},w["mark.fid"]={value:n+r,unit:"second"}})}function DA(t){let e=If();if(!e||!vt.WINDOW.performance.getEntries||!U.browserPerformanceTimeOrigin)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Tracing] Adding & adjusting spans using Performance API");let n=M(U.browserPerformanceTimeOrigin),r=e.getEntries(),s,i;if(r.slice(Sf).forEach(o=>{let a=M(o.startTime),c=M(o.duration);if(!(t.op==="navigation"&&n+a<t.startTimestamp))switch(o.entryType){case"navigation":{OA(t,o,n),s=n+M(o.responseStart),i=n+M(o.requestStart);break}case"mark":case"paint":case"measure":{Af(t,o,a,c,n);let u=TA.getVisibilityWatcher(),d=o.startTime<u.firstHiddenTime;o.name==="first-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FP"),w.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FCP"),w.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{let u=o.name.replace(vt.WINDOW.location.origin,"");vf(t,o,u,a,c,n);break}}}),Sf=Math.max(r.length-1,0),wA(t),t.op==="pageload"){typeof s=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding TTFB"),w.ttfb={value:(s-t.startTimestamp)*1e3,unit:"millisecond"},typeof i=="number"&&i<=s&&(w["ttfb.requestTime"]={value:(s-i)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!w[a]||n>=t.startTimestamp)return;let c=w[a].value,u=n+M(c),d=Math.abs((u-t.startTimestamp)*1e3),l=d-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log(`[Measurements] Normalized ${a} from ${c} to ${d} (${l})`),w[a].value=d});let o=w["mark.fid"];o&&w.fid&&(He._startChild(t,{description:"first input delay",endTimestamp:o.value+M(w.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete w["mark.fid"]),"fcp"in w||delete w.cls,Object.keys(w).forEach(a=>{t.setMeasurement(a,w[a].value,w[a].unit)}),kA(t)}Ce=void 0,fr=void 0,w={}}function Af(t,e,n,r,s){let i=s+n,o=i+r;return He._startChild(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i}),i}function OA(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ys(t,e,r,n)}),Ys(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Ys(t,e,"fetch",n,"cache","domainLookupStart"),Ys(t,e,"domainLookup",n,"DNS"),NA(t,e,n)}function Ys(t,e,n,r,s,i){let o=i?e[i]:e[`${n}End`],a=e[`${n}Start`];!a||!o||He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:s||n,startTimestamp:r+M(a),endTimestamp:r+M(o)})}function NA(t,e,n){He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+M(e.requestStart),endTimestamp:n+M(e.responseEnd)}),He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+M(e.responseStart),endTimestamp:n+M(e.responseEnd)})}function vf(t,e,n,r,s,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let o={};"transferSize"in e&&(o["http.response_transfer_size"]=e.transferSize),"encodedBodySize"in e&&(o["http.response_content_length"]=e.encodedBodySize),"decodedBodySize"in e&&(o["http.decoded_response_content_length"]=e.decodedBodySize),"renderBlockingStatus"in e&&(o["resource.render_blocking_status"]=e.renderBlockingStatus);let a=i+r,c=a+s;He._startChild(t,{description:n,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:o})}function wA(t){let e=vt.WINDOW.navigator;if(!e)return;let n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),He.isMeasurementValue(n.rtt)&&(w["connection.rtt"]={value:n.rtt,unit:"millisecond"})),He.isMeasurementValue(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),He.isMeasurementValue(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function kA(t){Ce&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding LCP Data"),Ce.element&&t.setTag("lcp.element",U.htmlTreeAsString(Ce.element)),Ce.id&&t.setTag("lcp.id",Ce.id),Ce.url&&t.setTag("lcp.url",Ce.url.trim().slice(0,200)),t.setTag("lcp.size",Ce.size)),fr&&fr.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding CLS Data"),fr.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,U.htmlTreeAsString(e.node))))}at._addMeasureSpans=Af;at._addResourceSpans=vf;at.addPerformanceEntries=DA;at.startTrackingInteractions=AA;at.startTrackingLongTasks=IA;at.startTrackingWebVitals=bA});var Ac=g(Oe=>{Object.defineProperty(Oe,"__esModule",{value:!0});var an=N(),W=T(),Ks=["localhost",/^\/(?!\/)/],Ic={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Ks,tracePropagationTargets:Ks};function xA(t){let{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o}={traceFetch:Ic.traceFetch,traceXHR:Ic.traceXHR,...t},a=typeof i=="function"?i:d=>!0,c=d=>Nf(d,r||s),u={};e&&W.addInstrumentationHandler("fetch",d=>{let l=wf(d,a,c,u);o&&l&&Cf(l)}),n&&W.addInstrumentationHandler("xhr",d=>{let l=xf(d,a,c,u);o&&l&&Cf(l)})}function PA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Cf(t){let e=t.data.url,n=new PerformanceObserver(r=>{r.getEntries().forEach(i=>{PA(i)&&i.name.endsWith(e)&&(UA(i).forEach(a=>t.setData(...a)),n.disconnect())})});n.observe({entryTypes:["resource"]})}function Of(t){let e="unknown",n="unknown",r="";for(let s of t){if(s==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(s))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=s}return r===t&&(e=r),{name:e,version:n}}function De(t=0){return((W.browserPerformanceTimeOrigin||performance.timeOrigin)+t)/1e3}function UA(t){let{name:e,version:n}=Of(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),W.browserPerformanceTimeOrigin?[...r,["http.request.redirect_start",De(t.redirectStart)],["http.request.fetch_start",De(t.fetchStart)],["http.request.domain_lookup_start",De(t.domainLookupStart)],["http.request.domain_lookup_end",De(t.domainLookupEnd)],["http.request.connect_start",De(t.connectStart)],["http.request.secure_connection_start",De(t.secureConnectionStart)],["http.request.connection_end",De(t.connectEnd)],["http.request.request_start",De(t.requestStart)],["http.request.response_start",De(t.responseStart)],["http.request.response_end",De(t.responseEnd)]]:r}function Nf(t,e){return W.stringMatchesSomePattern(t,e||Ks)}function wf(t,e,n,r){if(!an.hasTracingEnabled()||!t.fetchData)return;let s=e(t.fetchData.url);if(t.endTimestamp&&s){let p=t.fetchData.__span;if(!p)return;let f=r[p];if(f){if(t.response){f.setHttpStatus(t.response.status);let m=t.response&&t.response.headers&&t.response.headers.get("content-length"),E=parseInt(m);E>0&&f.setData("http.response_content_length",E)}else t.error&&f.setStatus("internal_error");f.finish(),delete r[p]}return}let i=an.getCurrentHub(),o=i.getScope(),a=i.getClient(),c=o.getSpan(),{method:u,url:d}=t.fetchData,l=s&&c?c.startChild({data:{url:d,type:"fetch","http.method":u},description:`${u} ${d}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(l&&(t.fetchData.__span=l.spanId,r[l.spanId]=l),n(t.fetchData.url)&&a){let p=t.args[0];t.args[1]=t.args[1]||{};let f=t.args[1];f.headers=kf(p,a,o,f,l)}return l}function kf(t,e,n,r,s){let i=s||n.getSpan(),o=i&&i.transaction,{traceId:a,sampled:c,dsc:u}=n.getPropagationContext(),d=i?i.toTraceparent():W.generateSentryTraceHeader(a,void 0,c),l=o?o.getDynamicSamplingContext():u||an.getDynamicSamplingContextFromClient(a,e,n),p=W.dynamicSamplingContextToSentryBaggageHeader(l),f=typeof Request<"u"&&W.isInstanceOf(t,Request)?t.headers:r.headers;if(f)if(typeof Headers<"u"&&W.isInstanceOf(f,Headers)){let m=new Headers(f);return m.append("sentry-trace",d),p&&m.append(W.BAGGAGE_HEADER_NAME,p),m}else if(Array.isArray(f)){let m=[...f,["sentry-trace",d]];return p&&m.push([W.BAGGAGE_HEADER_NAME,p]),m}else{let m="baggage"in f?f.baggage:void 0,E=[];return Array.isArray(m)?E.push(...m):m&&E.push(m),p&&E.push(p),{...f,"sentry-trace":d,baggage:E.length>0?E.join(","):void 0}}else return{"sentry-trace":d,baggage:p}}function xf(t,e,n,r){let s=t.xhr,i=s&&s[W.SENTRY_XHR_DATA_KEY];if(!an.hasTracingEnabled()||s&&s.__sentry_own_request__||!s||!i)return;let o=e(i.url);if(t.endTimestamp&&o){let l=s.__sentry_xhr_span_id__;if(!l)return;let p=r[l];p&&(p.setHttpStatus(i.status_code),p.finish(),delete r[l]);return}let a=an.getCurrentHub(),c=a.getScope(),u=c.getSpan(),d=o&&u?u.startChild({data:{...i.data,type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(s.__sentry_xhr_span_id__=d.spanId,r[s.__sentry_xhr_span_id__]=d),s.setRequestHeader&&n(i.url))if(d){let l=d&&d.transaction,p=l&&l.getDynamicSamplingContext(),f=W.dynamicSamplingContextToSentryBaggageHeader(p);Df(s,d.toTraceparent(),f)}else{let l=a.getClient(),{traceId:p,sampled:f,dsc:m}=c.getPropagationContext(),E=W.generateSentryTraceHeader(p,void 0,f),b=m||(l?an.getDynamicSamplingContextFromClient(p,l,c):void 0),v=W.dynamicSamplingContextToSentryBaggageHeader(b);Df(s,E,v)}return d}function Df(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(W.BAGGAGE_HEADER_NAME,n)}catch{}}Oe.DEFAULT_TRACE_PROPAGATION_TARGETS=Ks;Oe.addTracingHeadersToFetchRequest=kf;Oe.defaultRequestInstrumentationOptions=Ic;Oe.extractNetworkProtocol=Of;Oe.fetchCallback=wf;Oe.instrumentOutgoingRequests=xA;Oe.shouldAttachHeaders=Nf;Oe.xhrCallback=xf});var Pf=g(vc=>{Object.defineProperty(vc,"__esModule",{value:!0});var gr=T(),_r=je();function MA(t,e=!0,n=!0){if(!_r.WINDOW||!_r.WINDOW.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&gr.logger.warn("Could not initialize routing instrumentation due to invalid location");return}let r=_r.WINDOW.location.href,s;e&&(s=t({name:_r.WINDOW.location.pathname,startTimestamp:gr.browserPerformanceTimeOrigin?gr.browserPerformanceTimeOrigin/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&gr.addInstrumentationHandler("history",({to:i,from:o})=>{if(o===void 0&&r&&r.indexOf(i)!==-1){r=void 0;return}o!==i&&(r=void 0,s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&gr.logger.log(`[Tracing] Finishing current transaction with op: ${s.op}`),s.finish()),s=t({name:_r.WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}vc.instrumentRoutingWithDefaults=MA});var qf=g(mr=>{Object.defineProperty(mr,"__esModule",{value:!0});var hr=N(),Ye=T(),LA=pf(),Ws=Rf(),Mf=Ac(),qA=Pf(),Uf=je(),Lf="BrowserTracing",FA={...hr.TRACING_DEFAULTS,markBackgroundTransactions:!0,routingInstrumentation:qA.instrumentRoutingWithDefaults,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...Mf.defaultRequestInstrumentationOptions},Rc=class{constructor(e){this.name=Lf,this._hasSetTracePropagationTargets=!1,hr.addTracingExtensions(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...FA,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=Ws.startTrackingWebVitals(),this.options.enableLongTask&&Ws.startTrackingLongTasks(),this.options._experiments.enableInteractions&&Ws.startTrackingInteractions()}setupOnce(e,n){this._getCurrentHub=n;let s=n().getClient(),i=s&&s.getOptions(),{routingInstrumentation:o,startTransactionOnLocationChange:a,startTransactionOnPageLoad:c,markBackgroundTransactions:u,traceFetch:d,traceXHR:l,shouldCreateSpanForRequest:p,enableHTTPTimings:f,_experiments:m}=this.options,E=i&&i.tracePropagationTargets,b=E||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&E&&Ye.logger.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),o(v=>{let L=this._createRouteTransaction(v);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(L,v,n),L},c,a),u&&LA.registerBackgroundTabDetection(),m.enableInteractions&&this._registerInteractionListener(),Mf.instrumentOutgoingRequests({traceFetch:d,traceXHR:l,tracePropagationTargets:b,shouldCreateSpanForRequest:p,enableHTTPTimings:f})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let n=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:s,finalTimeout:i,heartbeatInterval:o}=this.options,a=e.op==="pageload",c=a?Cc("sentry-trace"):"",u=a?Cc("baggage"):"",{traceparentData:d,dynamicSamplingContext:l,propagationContext:p}=Ye.tracingContextFromHeaders(c,u),f={...e,...d,metadata:{...e.metadata,dynamicSamplingContext:d&&!l?{}:l},trimEnd:!0},m=typeof r=="function"?r(f):f,E=m===void 0?{...f,sampled:!1}:m;E.metadata=E.name!==f.name?{...E.metadata,source:"custom"}:E.metadata,this._latestRouteName=E.name,this._latestRouteSource=E.metadata&&E.metadata.source,E.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.log(`[Tracing] Will not send ${E.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.log(`[Tracing] Starting ${E.op} transaction on scope`);let{location:b}=Uf.WINDOW,v=hr.startIdleTransaction(n,E,s,i,!0,{location:b},o),L=n.getScope();return a&&d?L.setPropagationContext(p):L.setPropagationContext({traceId:v.traceId,spanId:v.spanId,parentSpanId:v.parentSpanId,sampled:v.sampled}),v.registerBeforeFinishCallback(se=>{this._collectWebVitals(),Ws.addPerformanceEntries(se)}),v}_registerInteractionListener(){let e,n=()=>{let{idleTimeout:r,finalTimeout:s,heartbeatInterval:i}=this.options,o="ui.action.click",a=hr.getActiveTransaction();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${o} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${o} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:u}=Uf.WINDOW,d={name:this._latestRouteName,op:o,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=hr.startIdleTransaction(c,d,r,s,!0,{location:u},i)};["click"].forEach(r=>{addEventListener(r,n,{once:!1,capture:!0})})}};function Cc(t){let e=Ye.getDomElement(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}mr.BROWSER_TRACING_INTEGRATION_ID=Lf;mr.BrowserTracing=Rc;mr.getMetaContent=Cc});var Gf=g((Dc,Er)=>{Object.defineProperty(Dc,"__esModule",{value:!0});var Ff=N(),cn=T();function GA(){let t=Ff.getMainCarrier();if(!t.__SENTRY__)return;let e={mongodb(){let r=cn.dynamicRequire(Er,"./node/integrations/mongo");return new r.Mongo},mongoose(){let r=cn.dynamicRequire(Er,"./node/integrations/mongo");return new r.Mongo},mysql(){let r=cn.dynamicRequire(Er,"./node/integrations/mysql");return new r.Mysql},pg(){let r=cn.dynamicRequire(Er,"./node/integrations/postgres");return new r.Postgres}},n=Object.keys(e).filter(r=>!!cn.loadModule(r)).map(r=>{try{return e[r]()}catch{return}}).filter(r=>r);n.length>0&&(t.__SENTRY__.integrations=[...t.__SENTRY__.integrations||[],...n])}function BA(){Ff.addTracingExtensions(),cn.isNodeEnv()&&GA()}Dc.addExtensionMethods=BA});var Nc=g(D=>{Object.defineProperty(D,"__esModule",{value:!0});var Ke=N(),Bf=T(),$A=Zp(),jA=ef(),HA=tf(),YA=nf(),KA=of(),WA=af(),VA=uf(),zA=df(),$f=qf(),Oc=Ac(),XA=Gf();D.IdleTransaction=Ke.IdleTransaction;D.Span=Ke.Span;D.SpanStatus=Ke.SpanStatus;D.Transaction=Ke.Transaction;D.extractTraceparentData=Ke.extractTraceparentData;D.getActiveTransaction=Ke.getActiveTransaction;D.hasTracingEnabled=Ke.hasTracingEnabled;D.spanStatusfromHttpCode=Ke.spanStatusfromHttpCode;D.startIdleTransaction=Ke.startIdleTransaction;D.TRACEPARENT_REGEXP=Bf.TRACEPARENT_REGEXP;D.stripUrlQueryAndFragment=Bf.stripUrlQueryAndFragment;D.Express=$A.Express;D.Postgres=jA.Postgres;D.Mysql=HA.Mysql;D.Mongo=YA.Mongo;D.Prisma=KA.Prisma;D.GraphQL=WA.GraphQL;D.Apollo=VA.Apollo;D.lazyLoadedNodePerformanceMonitoringIntegrations=zA.lazyLoadedNodePerformanceMonitoringIntegrations;D.BROWSER_TRACING_INTEGRATION_ID=$f.BROWSER_TRACING_INTEGRATION_ID;D.BrowserTracing=$f.BrowserTracing;D.addTracingHeadersToFetchRequest=Oc.addTracingHeadersToFetchRequest;D.defaultRequestInstrumentationOptions=Oc.defaultRequestInstrumentationOptions;D.instrumentOutgoingRequests=Oc.instrumentOutgoingRequests;D.addExtensionMethods=XA.addExtensionMethods});var jf=g(wc=>{Object.defineProperty(wc,"__esModule",{value:!0});var JA=Nc(),QA=T();function ZA(){let t=JA.lazyLoadedNodePerformanceMonitoringIntegrations.map(e=>{try{return e()}catch{return}}).filter(e=>!!e);return t.length===0&&QA.logger.warn("Performance monitoring integrations could not be automatically loaded."),t.filter(e=>!!e.loadDependency())}wc.autoDiscoverNodePerformanceMonitoringIntegrations=ZA});var Uc=g(Pc=>{Object.defineProperty(Pc,"__esModule",{value:!0});var kc=N(),ev=require("os"),tv=require("util"),xc=class extends kc.ServerRuntimeClient{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.node",packages:[{name:"npm:@sentry/node",version:kc.SDK_VERSION}],version:kc.SDK_VERSION},e.transportOptions={textEncoder:new tv.TextEncoder,...e.transportOptions};let n={...e,platform:"node",runtime:{name:"node",version:global.process.version},serverName:e.serverName||global.process.env.SENTRY_NAME||ev.hostname()};super(n)}};Pc.NodeClient=xc});var Yf=g((Jw,Hf)=>{var un=1e3,dn=un*60,ln=dn*60,Rt=ln*24,nv=Rt*7,rv=Rt*365.25;Hf.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return sv(t);if(n==="number"&&isFinite(t))return e.long?ov(t):iv(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function sv(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*rv;case"weeks":case"week":case"w":return n*nv;case"days":case"day":case"d":return n*Rt;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ln;case"minutes":case"minute":case"mins":case"min":case"m":return n*dn;case"seconds":case"second":case"secs":case"sec":case"s":return n*un;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function iv(t){var e=Math.abs(t);return e>=Rt?Math.round(t/Rt)+"d":e>=ln?Math.round(t/ln)+"h":e>=dn?Math.round(t/dn)+"m":e>=un?Math.round(t/un)+"s":t+"ms"}function ov(t){var e=Math.abs(t);return e>=Rt?Vs(t,e,Rt,"day"):e>=ln?Vs(t,e,ln,"hour"):e>=dn?Vs(t,e,dn,"minute"):e>=un?Vs(t,e,un,"second"):t+" ms"}function Vs(t,e,n,r){var s=e>=n*1.5;return Math.round(t/n)+" "+r+(s?"s":"")}});var Mc=g((Qw,Kf)=>{function av(t){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=s,n.enabled=a,n.humanize=Yf(),n.destroy=u,Object.keys(t).forEach(d=>{n[d]=t[d]}),n.names=[],n.skips=[],n.formatters={};function e(d){let l=0;for(let p=0;p<d.length;p++)l=(l<<5)-l+d.charCodeAt(p),l|=0;return n.colors[Math.abs(l)%n.colors.length]}n.selectColor=e;function n(d){let l,p=null,f,m;function E(...b){if(!E.enabled)return;let v=E,L=Number(new Date),se=L-(l||L);v.diff=se,v.prev=l,v.curr=L,l=L,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let ie=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(x,Ue)=>{if(x==="%%")return"%";ie++;let Se=n.formatters[Ue];if(typeof Se=="function"){let ji=b[ie];x=Se.call(v,ji),b.splice(ie,1),ie--}return x}),n.formatArgs.call(v,b),(v.log||n.log).apply(v,b)}return E.namespace=d,E.useColors=n.useColors(),E.color=n.selectColor(d),E.extend=r,E.destroy=n.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(f!==n.namespaces&&(f=n.namespaces,m=n.enabled(d)),m),set:b=>{p=b}}),typeof n.init=="function"&&n.init(E),E}function r(d,l){let p=n(this.namespace+(typeof l>"u"?":":l)+d);return p.log=this.log,p}function s(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let l=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of l)p[0]==="-"?n.skips.push(p.slice(1)):n.names.push(p)}function i(d,l){let p=0,f=0,m=-1,E=0;for(;p<d.length;)if(f<l.length&&(l[f]===d[p]||l[f]==="*"))l[f]==="*"?(m=f,E=p,f++):(p++,f++);else if(m!==-1)f=m+1,E++,p=E;else return!1;for(;f<l.length&&l[f]==="*";)f++;return f===l.length}function o(){let d=[...n.names,...n.skips.map(l=>"-"+l)].join(",");return n.enable(""),d}function a(d){for(let l of n.skips)if(i(d,l))return!1;for(let l of n.names)if(i(d,l))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Kf.exports=av});var Wf=g((Z,zs)=>{Z.formatArgs=uv;Z.save=dv;Z.load=lv;Z.useColors=cv;Z.storage=pv();Z.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Z.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function cv(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function uv(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+zs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(n++,s==="%c"&&(r=n))}),t.splice(r,0,e)}Z.log=console.debug||console.log||(()=>{});function dv(t){try{t?Z.storage.setItem("debug",t):Z.storage.removeItem("debug")}catch{}}function lv(){let t;try{t=Z.storage.getItem("debug")||Z.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function pv(){try{return localStorage}catch{}}zs.exports=Mc()(Z);var{formatters:fv}=zs.exports;fv.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var zf=g((Zw,Vf)=>{"use strict";Vf.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),s=e.indexOf("--");return r!==-1&&(s===-1||r<s)}});var Qf=g((ek,Jf)=>{"use strict";var gv=require("os"),Xf=require("tty"),pe=zf(),{env:G}=process,ct;pe("no-color")||pe("no-colors")||pe("color=false")||pe("color=never")?ct=0:(pe("color")||pe("colors")||pe("color=true")||pe("color=always"))&&(ct=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?ct=1:G.FORCE_COLOR==="false"?ct=0:ct=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function Lc(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function qc(t,e){if(ct===0)return 0;if(pe("color=16m")||pe("color=full")||pe("color=truecolor"))return 3;if(pe("color=256"))return 2;if(t&&!e&&ct===void 0)return 0;let n=ct||0;if(G.TERM==="dumb")return n;if(process.platform==="win32"){let r=gv.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in G)||G.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let r=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:n}function _v(t){let e=qc(t,t&&t.isTTY);return Lc(e)}Jf.exports={supportsColor:_v,stdout:Lc(qc(!0,Xf.isatty(1))),stderr:Lc(qc(!0,Xf.isatty(2)))}});var eg=g((B,Js)=>{var hv=require("tty"),Xs=require("util");B.init=Iv;B.log=Sv;B.formatArgs=Ev;B.save=Tv;B.load=bv;B.useColors=mv;B.destroy=Xs.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");B.colors=[6,2,3,4,5,1];try{let t=Qf();t&&(t.stderr||t).level>=2&&(B.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}B.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,i)=>i.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function mv(){return"colors"in B.inspectOpts?!!B.inspectOpts.colors:hv.isatty(process.stderr.fd)}function Ev(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${s};1m${e} \x1B[0m`;t[0]=i+t[0].split(`
|
|
20
|
+
Url: ${Os(t)}`),!0)}function ab(t,e){return t.type||!e||!e.length?!1:lb(t).some(n=>F.stringMatchesSomePattern(n,e))}function cb(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let n=t.transaction;return n?F.stringMatchesSomePattern(n,e):!1}function ub(t,e){if(!e||!e.length)return!1;let n=Os(t);return n?F.stringMatchesSomePattern(n,e):!1}function db(t,e){if(!e||!e.length)return!0;let n=Os(t);return n?F.stringMatchesSomePattern(n,e):!0}function lb(t){let e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&e.length===0&&F.logger.error(`Could not extract message for event ${F.getEventDescription(t)}`),e}function pb(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function fb(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Os(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?fb(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.error(`Cannot extract url for event ${F.getEventDescription(t)}`),null}}sr.InboundFilters=Ds;sr._mergeOptions=Np;sr._shouldDropEvent=wp});var kp=g(Ns=>{Object.defineProperty(Ns,"__esModule",{value:!0});var gb=qa(),_b=Fa();Ns.FunctionToString=gb.FunctionToString;Ns.InboundFilters=_b.InboundFilters});var xp=g(Ga=>{Object.defineProperty(Ga,"__esModule",{value:!0});function hb(t,e){let n=e.getClient(),r=n&&n.getDsn(),s=n&&n.getOptions().tunnel;return Eb(t,r)||mb(t,s)}function mb(t,e){return e?Pp(t)===Pp(e):!1}function Eb(t,e){return e?t.includes(e.host):!1}function Pp(t){return t[t.length-1]==="/"?t.slice(0,-1):t}Ga.isSentryRequestUrl=hb});var qp=g(ir=>{Object.defineProperty(ir,"__esModule",{value:!0});var Ba=T(),Mp=new Map,Up=new Set;function yb(t){if(Ba.GLOBAL_OBJ._sentryModuleMetadata)for(let e of Object.keys(Ba.GLOBAL_OBJ._sentryModuleMetadata)){let n=Ba.GLOBAL_OBJ._sentryModuleMetadata[e];if(Up.has(e))continue;Up.add(e);let r=t(e);for(let s of r.reverse())if(s.filename){Mp.set(s.filename,n);break}}}function Lp(t,e){return yb(t),Mp.get(e)}function Sb(t,e){try{e.exception.values.forEach(n=>{if(n.stacktrace)for(let r of n.stacktrace.frames||[]){if(!r.filename)continue;let s=Lp(t,r.filename);s&&(r.module_metadata=s)}})}catch{}}function Tb(t){try{t.exception.values.forEach(e=>{if(e.stacktrace)for(let n of e.stacktrace.frames||[])delete n.module_metadata})}catch{}}ir.addMetadataToStackFrames=Sb;ir.getMetadataForUrl=Lp;ir.stripMetadataFromStackFrames=Tb});var Gp=g($a=>{Object.defineProperty($a,"__esModule",{value:!0});var bb=T(),Fp=qp(),ws=class t{static __initStatic(){this.id="ModuleMetadata"}constructor(){this.name=t.id}setupOnce(e,n){let r=n().getClient();if(!r||typeof r.on!="function")return;r.on("beforeEnvelope",i=>{bb.forEachEnvelopeItem(i,(o,a)=>{if(a==="event"){let c=Array.isArray(o)?o[1]:void 0;c&&(Fp.stripMetadataFromStackFrames(c),o[1]=c)}})});let s=r.getOptions().stackParser;e(i=>(Fp.addMetadataToStackFrames(s,i),i))}};ws.__initStatic();$a.ModuleMetadata=ws});var N=g(S=>{Object.defineProperty(S,"__esModule",{value:!0});var Bp=da(),$p=aa(),jp=hs(),Ib=ms(),Ab=_s(),vb=la(),bt=np(),Rb=Jn(),Cb=rp(),Y=sp(),$e=le(),ja=Wn(),Db=ma(),Ob=ps(),Nb=Hn(),Hp=Is(),wb=va(),kb=yp(),Pb=Sp(),xb=Ip(),Ub=vp(),Mb=Cp(),Lb=Dp(),Yp=Ta(),qb=kp(),Fb=ba(),Gb=Da(),Bb=Ss(),$b=xp(),jb=$n(),Hb=Gp(),Yb=qa(),Kb=Fa(),Wb=T();S.addTracingExtensions=Bp.addTracingExtensions;S.startIdleTransaction=Bp.startIdleTransaction;S.IdleTransaction=$p.IdleTransaction;S.TRACING_DEFAULTS=$p.TRACING_DEFAULTS;S.Span=jp.Span;S.spanStatusfromHttpCode=jp.spanStatusfromHttpCode;S.Transaction=Ib.Transaction;S.getActiveTransaction=Ab.getActiveTransaction;Object.defineProperty(S,"SpanStatus",{enumerable:!0,get:()=>vb.SpanStatus});S.continueTrace=bt.continueTrace;S.getActiveSpan=bt.getActiveSpan;S.startActiveSpan=bt.startActiveSpan;S.startInactiveSpan=bt.startInactiveSpan;S.startSpan=bt.startSpan;S.startSpanManual=bt.startSpanManual;S.trace=bt.trace;S.getDynamicSamplingContextFromClient=Rb.getDynamicSamplingContextFromClient;S.setMeasurement=Cb.setMeasurement;S.addBreadcrumb=Y.addBreadcrumb;S.captureCheckIn=Y.captureCheckIn;S.captureEvent=Y.captureEvent;S.captureException=Y.captureException;S.captureMessage=Y.captureMessage;S.close=Y.close;S.configureScope=Y.configureScope;S.flush=Y.flush;S.lastEventId=Y.lastEventId;S.setContext=Y.setContext;S.setExtra=Y.setExtra;S.setExtras=Y.setExtras;S.setTag=Y.setTag;S.setTags=Y.setTags;S.setUser=Y.setUser;S.startTransaction=Y.startTransaction;S.withScope=Y.withScope;S.Hub=$e.Hub;S.ensureHubOnCarrier=$e.ensureHubOnCarrier;S.getCurrentHub=$e.getCurrentHub;S.getHubFromCarrier=$e.getHubFromCarrier;S.getMainCarrier=$e.getMainCarrier;S.makeMain=$e.makeMain;S.runWithAsyncContext=$e.runWithAsyncContext;S.setAsyncContextStrategy=$e.setAsyncContextStrategy;S.setHubOnCarrier=$e.setHubOnCarrier;S.closeSession=ja.closeSession;S.makeSession=ja.makeSession;S.updateSession=ja.updateSession;S.SessionFlusher=Db.SessionFlusher;S.Scope=Ob.Scope;S.addGlobalEventProcessor=Nb.addGlobalEventProcessor;S.getEnvelopeEndpointWithUrlEncodedAuth=Hp.getEnvelopeEndpointWithUrlEncodedAuth;S.getReportDialogEndpoint=Hp.getReportDialogEndpoint;S.BaseClient=wb.BaseClient;S.ServerRuntimeClient=kb.ServerRuntimeClient;S.initAndBind=Pb.initAndBind;S.createTransport=xb.createTransport;S.makeOfflineTransport=Ub.makeOfflineTransport;S.makeMultiplexedTransport=Mb.makeMultiplexedTransport;S.SDK_VERSION=Lb.SDK_VERSION;S.addIntegration=Yp.addIntegration;S.getIntegrationsToSetup=Yp.getIntegrationsToSetup;S.Integrations=qb;S.prepareEvent=Fb.prepareEvent;S.createCheckInEnvelope=Gb.createCheckInEnvelope;S.hasTracingEnabled=Bb.hasTracingEnabled;S.isSentryRequestUrl=$b.isSentryRequestUrl;S.DEFAULT_ENVIRONMENT=jb.DEFAULT_ENVIRONMENT;S.ModuleMetadata=Hb.ModuleMetadata;S.FunctionToString=Yb.FunctionToString;S.InboundFilters=Kb.InboundFilters;S.extractTraceparentData=Wb.extractTraceparentData});var Ya=g(Ha=>{Object.defineProperty(Ha,"__esModule",{value:!0});function Vb(t,e){return t??e()}Ha._nullishCoalesce=Vb});var Kp=g(Ka=>{Object.defineProperty(Ka,"__esModule",{value:!0});var zb=Ya();async function Xb(t,e){return zb._nullishCoalesce(t,e)}Ka._asyncNullishCoalesce=Xb});var Va=g(Wa=>{Object.defineProperty(Wa,"__esModule",{value:!0});async function Jb(t){let e,n=t[0],r=1;for(;r<t.length;){let s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=await i(n)):(s==="call"||s==="optionalCall")&&(n=await i((...o)=>n.call(e,...o)),e=void 0)}return n}Wa._asyncOptionalChain=Jb});var Wp=g(za=>{Object.defineProperty(za,"__esModule",{value:!0});var Qb=Va();async function Zb(t){let e=await Qb._asyncOptionalChain(t);return e??!0}za._asyncOptionalChainDelete=Zb});var Ja=g(Xa=>{Object.defineProperty(Xa,"__esModule",{value:!0});function eI(t){let e,n=t[0],r=1;for(;r<t.length;){let s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(e,...o)),e=void 0)}return n}Xa._optionalChain=eI});var Vp=g(Qa=>{Object.defineProperty(Qa,"__esModule",{value:!0});var tI=Ja();function nI(t){let e=tI._optionalChain(t);return e??!0}Qa._optionalChainDelete=nI});var k=g(st=>{Object.defineProperty(st,"__esModule",{value:!0});var rI=Kp(),sI=Va(),iI=Wp(),oI=Ya(),aI=Ja(),cI=Vp();st._asyncNullishCoalesce=rI._asyncNullishCoalesce;st._asyncOptionalChain=sI._asyncOptionalChain;st._asyncOptionalChainDelete=iI._asyncOptionalChainDelete;st._nullishCoalesce=oI._nullishCoalesce;st._optionalChain=aI._optionalChain;st._optionalChainDelete=cI._optionalChainDelete});var it=g(Za=>{var{_optionalChain:zp}=k();Object.defineProperty(Za,"__esModule",{value:!0});function uI(t){let e=zp([t,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]);return(zp([e,"optionalAccess",r=>r.instrumenter])||"sentry")!=="sentry"}Za.shouldDisableAutoInstrumentation=uI});var Zp=g(or=>{var{_optionalChain:Re}=k();Object.defineProperty(or,"__esModule",{value:!0});var me=T(),dI=it(),ks=class t{static __initStatic(){this.id="Express"}constructor(e={}){this.name=t.id,this._router=e.router||e.app,this._methods=(Array.isArray(e.methods)?e.methods:[]).concat("use")}setupOnce(e,n){if(!this._router){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.error("ExpressIntegration is missing an Express instance");return}if(dI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.log("Express Integration is skipped because of instrumenter configuration.");return}fI(this._router,this._methods),gI(this._router)}};ks.__initStatic();function Xp(t,e){let n=t.length;switch(n){case 2:return function(r,s){let i=s.__sentry_transaction;if(i){let o=i.startChild({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"});s.once("finish",()=>{o.finish()})}return t.call(this,r,s)};case 3:return function(r,s,i){let o=s.__sentry_transaction,a=Re([o,"optionalAccess",c=>c.startChild,"call",c=>c({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,s,function(...c){Re([a,"optionalAccess",u=>u.finish,"call",u=>u()]),i.call(this,...c)})};case 4:return function(r,s,i,o){let a=i.__sentry_transaction,c=Re([a,"optionalAccess",u=>u.startChild,"call",u=>u({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,s,i,function(...u){Re([c,"optionalAccess",d=>d.finish,"call",d=>d()]),o.call(this,...u)})};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}function lI(t,e){return t.map(n=>typeof n=="function"?Xp(n,e):Array.isArray(n)?n.map(r=>typeof r=="function"?Xp(r,e):r):n)}function pI(t,e){let n=t[e];return t[e]=function(...r){return n.call(this,...lI(r,e))},t}function fI(t,e=[]){e.forEach(n=>pI(t,n))}function gI(t){let e="settings"in t;e&&t._router===void 0&&t.lazyrouter&&t.lazyrouter();let n=e?t._router:t;if(!n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.debug("Routing instrumentation is currently only supported in Express 4.");return}let r=Object.getPrototypeOf(n),s=r.process_params;r.process_params=function(o,a,c,u,d){c._reconstructedRoute||(c._reconstructedRoute="");let{layerRoutePath:l,isRegex:p,isArray:f,numExtraSegments:m}=_I(o);(l||p||f)&&(c._hasParameters=!0);let E;l?E=l:E=Qp(c.originalUrl,c._reconstructedRoute,o.path)||"";let b=E.split("/").filter(se=>se.length>0&&(p||f||!se.includes("*"))).join("/");b&&b.length>0&&(c._reconstructedRoute+=`/${b}${p?"/":""}`);let v=me.getNumberOfUrlSegments(c.originalUrl||"")+m,L=me.getNumberOfUrlSegments(c._reconstructedRoute);if(v===L){c._hasParameters||c._reconstructedRoute!==c.originalUrl&&(c._reconstructedRoute=c.originalUrl?me.stripUrlQueryAndFragment(c.originalUrl):c.originalUrl);let se=u.__sentry_transaction;if(se&&se.metadata.source!=="custom"){let ie=c._reconstructedRoute||"/";se.setName(...me.extractPathForTransaction(c,{path:!0,method:!0,customRoute:ie}))}}return s.call(this,o,a,c,u,d)}}var Jp=(t,e,n)=>{if(!t||!e||!n||Object.keys(n).length===0||!Re([n,"access",u=>u[0],"optionalAccess",u=>u.offset]))return;let r=n.sort((u,d)=>u.offset-d.offset),i=new RegExp(e,`${e.flags}d`).exec(t);if(!i||!i.indices)return;let[,...o]=i.indices;if(o.length!==r.length)return;let a=t,c=0;return o.forEach(([u,d],l)=>{let p=a.substring(0,u-c),f=`:${r[l].name}`,m=a.substring(d-c);a=p+f+m,c=c+(d-u-f.length)}),a};function _I(t){let e=Re([t,"access",o=>o.route,"optionalAccess",o=>o.path]),n=me.isRegExp(e),r=Array.isArray(e);if(!e){let[o]=process.versions.node.split(".").map(Number);o>=16&&(e=Jp(t.path,t.regexp,t.keys))}if(!e)return{isRegex:n,isArray:r,numExtraSegments:0};let s=r?Math.max(hI(e)-me.getNumberOfUrlSegments(t.path||""),0):0;return{layerRoutePath:mI(r,e),isRegex:n,isArray:r,numExtraSegments:s}}function hI(t){return t.reduce((e,n)=>e+me.getNumberOfUrlSegments(n.toString()),0)}function mI(t,e){return t?e.map(n=>n.toString()).join(","):e&&e.toString()}function Qp(t,e,n){let r=Re([t,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c)]),s=0,i=Re([e,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c),"access",a=>a.length])||0;return Re([n,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>Re([r,"optionalAccess",u=>u[i+s]])===c?(s+=1,!0):!1),"access",a=>a.join,"call",a=>a("/")])}or.Express=ks;or.extractOriginalRoute=Jp;or.preventDuplicateSegments=Qp});var ef=g(ec=>{var{_optionalChain:rn}=k();Object.defineProperty(ec,"__esModule",{value:!0});var sn=T(),EI=it(),Ps=class t{static __initStatic(){this.id="Postgres"}constructor(e={}){this.name=t.id,this._usePgNative=!!e.usePgNative,this._module=e.module}loadDependency(){return this._module=this._module||sn.loadModule("pg")}setupOnce(e,n){if(EI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.log("Postgres Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.error("Postgres Integration was unable to require `pg` package.");return}let s=this._usePgNative?rn([r,"access",i=>i.native,"optionalAccess",i=>i.Client]):r.Client;if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.error("Postgres Integration was unable to access 'pg-native' bindings.");return}sn.fill(s.prototype,"query",function(i){return function(o,a,c){let d=n().getScope().getSpan(),l={"db.system":"postgresql"};try{this.database&&(l["db.name"]=this.database),this.host&&(l["server.address"]=this.host),this.port&&(l["server.port"]=this.port),this.user&&(l["db.user"]=this.user)}catch{}let p=rn([d,"optionalAccess",m=>m.startChild,"call",m=>m({description:typeof o=="string"?o:o.text,op:"db",origin:"auto.db.postgres",data:l})]);if(typeof c=="function")return i.call(this,o,a,function(m,E){rn([p,"optionalAccess",b=>b.finish,"call",b=>b()]),c(m,E)});if(typeof a=="function")return i.call(this,o,function(m,E){rn([p,"optionalAccess",b=>b.finish,"call",b=>b()]),a(m,E)});let f=typeof a<"u"?i.call(this,o,a):i.call(this,o);return sn.isThenable(f)?f.then(m=>(rn([p,"optionalAccess",E=>E.finish,"call",E=>E()]),m)):(rn([p,"optionalAccess",m=>m.finish,"call",m=>m()]),f)}})}};Ps.__initStatic();ec.Postgres=Ps});var tf=g(tc=>{var{_optionalChain:yI}=k();Object.defineProperty(tc,"__esModule",{value:!0});var ar=T(),SI=it(),xs=class t{static __initStatic(){this.id="Mysql"}constructor(){this.name=t.id}loadDependency(){return this._module=this._module||ar.loadModule("mysql/lib/Connection.js")}setupOnce(e,n){if(SI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.log("Mysql Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.error("Mysql Integration was unable to require `mysql` package.");return}let s;try{r.prototype.connect=new Proxy(r.prototype.connect,{apply(a,c,u){return s||(s=c.config),a.apply(c,u)}})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.error("Mysql Integration was unable to instrument `mysql` config.")}function i(){return s?{"server.address":s.host,"server.port":s.port,"db.user":s.user}:{}}function o(a){if(!a||a.endTimestamp)return;let c=i();Object.keys(c).forEach(u=>{a.setData(u,c[u])}),a.finish()}ar.fill(r,"createQuery",function(a){return function(c,u,d){let p=n().getScope().getSpan(),f=yI([p,"optionalAccess",E=>E.startChild,"call",E=>E({description:typeof c=="string"?c:c.sql,op:"db",origin:"auto.db.mysql",data:{"db.system":"mysql"}})]);if(typeof d=="function")return a.call(this,c,u,function(E,b,v){o(f),d(E,b,v)});if(typeof u=="function")return a.call(this,c,function(E,b,v){o(f),u(E,b,v)});let m=a.call(this,c,u);return m.on("end",()=>{o(f)}),m}})}};xs.__initStatic();tc.Mysql=xs});var nf=g(nc=>{var{_optionalChain:It}=k();Object.defineProperty(nc,"__esModule",{value:!0});var cr=T(),TI=it(),bI=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],II={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};function AI(t){return t&&typeof t=="object"&&t.once&&typeof t.once=="function"}var Us=class t{static __initStatic(){this.id="Mongo"}constructor(e={}){this.name=t.id,this._operations=Array.isArray(e.operations)?e.operations:bI,this._describeOperations="describeOperations"in e?e.describeOperations:!0,this._useMongoose=!!e.useMongoose}loadDependency(){let e=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||cr.loadModule(e)}setupOnce(e,n){if(TI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&cr.logger.log("Mongo Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){let s=this._useMongoose?"mongoose":"mongodb";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&cr.logger.error(`Mongo Integration was unable to require \`${s}\` package.`);return}this._instrumentOperations(r.Collection,this._operations,n)}_instrumentOperations(e,n,r){n.forEach(s=>this._patchOperation(e,s,r))}_patchOperation(e,n,r){if(!(n in e.prototype))return;let s=this._getSpanContextFromOperationArguments.bind(this);cr.fill(e.prototype,n,function(i){return function(...o){let a=o[o.length-1],u=r().getScope().getSpan();if(typeof a!="function"||n==="mapReduce"&&o.length===2){let l=It([u,"optionalAccess",f=>f.startChild,"call",f=>f(s(this,n,o))]),p=i.call(this,...o);if(cr.isThenable(p))return p.then(f=>(It([l,"optionalAccess",m=>m.finish,"call",m=>m()]),f));if(AI(p)){let f=p;try{f.once("close",()=>{It([l,"optionalAccess",m=>m.finish,"call",m=>m()])})}catch{It([l,"optionalAccess",E=>E.finish,"call",E=>E()])}return f}else return It([l,"optionalAccess",f=>f.finish,"call",f=>f()]),p}let d=It([u,"optionalAccess",l=>l.startChild,"call",l=>l(s(this,n,o.slice(0,-1)))]);return i.call(this,...o.slice(0,-1),function(l,p){It([d,"optionalAccess",f=>f.finish,"call",f=>f()]),a(l,p)})}})}_getSpanContextFromOperationArguments(e,n,r){let s={"db.system":"mongodb","db.name":e.dbName,"db.operation":n,"db.mongodb.collection":e.collectionName},i={op:"db",origin:"auto.db.mongo",description:n,data:s},o=II[n],a=Array.isArray(this._describeOperations)?this._describeOperations.includes(n):this._describeOperations;if(!o||!a)return i;try{if(n==="mapReduce"){let[c,u]=r;s[o[0]]=typeof c=="string"?c:c.name||"<anonymous>",s[o[1]]=typeof u=="string"?u:u.name||"<anonymous>"}else for(let c=0;c<o.length;c++)s[`db.mongodb.${o[c]}`]=JSON.stringify(r[c])}catch{}return i}};Us.__initStatic();nc.Mongo=Us});var of=g(rc=>{Object.defineProperty(rc,"__esModule",{value:!0});var rf=N(),sf=T(),vI=it();function RI(t){return!!t&&!!t.$use}var Ms=class t{static __initStatic(){this.id="Prisma"}constructor(e={}){if(this.name=t.id,RI(e.client)&&!e.client._sentryInstrumented){sf.addNonEnumerableProperty(e.client,"_sentryInstrumented",!0);let n={};try{let r=e.client._engineConfig;if(r){let{activeProvider:s,clientVersion:i}=r;s&&(n["db.system"]=s),i&&(n["db.prisma.version"]=i)}}catch{}e.client.$use((r,s)=>{if(vI.shouldDisableAutoInstrumentation(rf.getCurrentHub))return s(r);let i=r.action,o=r.model;return rf.trace({name:o?`${o} ${i}`:i,op:"db.sql.prisma",origin:"auto.db.prisma",data:{...n,"db.operation":i}},()=>s(r))})}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sf.logger.warn("Unsupported Prisma client provided to PrismaIntegration. Provided client:",e.client)}setupOnce(){}};Ms.__initStatic();rc.Prisma=Ms});var af=g(sc=>{var{_optionalChain:on}=k();Object.defineProperty(sc,"__esModule",{value:!0});var ur=T(),CI=it(),Ls=class t{static __initStatic(){this.id="GraphQL"}constructor(){this.name=t.id}loadDependency(){return this._module=this._module||ur.loadModule("graphql/execution/execute.js")}setupOnce(e,n){if(CI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ur.logger.log("GraphQL Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ur.logger.error("GraphQL Integration was unable to require graphql/execution package.");return}ur.fill(r,"execute",function(s){return function(...i){let o=n().getScope(),a=o.getSpan(),c=on([a,"optionalAccess",d=>d.startChild,"call",d=>d({description:"execute",op:"graphql.execute",origin:"auto.graphql.graphql"})]);on([o,"optionalAccess",d=>d.setSpan,"call",d=>d(c)]);let u=s.call(this,...i);return ur.isThenable(u)?u.then(d=>(on([c,"optionalAccess",l=>l.finish,"call",l=>l()]),on([o,"optionalAccess",l=>l.setSpan,"call",l=>l(a)]),d)):(on([c,"optionalAccess",d=>d.finish,"call",d=>d()]),on([o,"optionalAccess",d=>d.setSpan,"call",d=>d(a)]),u)}})}};Ls.__initStatic();sc.GraphQL=Ls});var uf=g(oc=>{var{_optionalChain:ic}=k();Object.defineProperty(oc,"__esModule",{value:!0});var K=T(),DI=it(),qs=class t{static __initStatic(){this.id="Apollo"}constructor(e={useNestjs:!1}){this.name=t.id,this._useNest=!!e.useNestjs}loadDependency(){return this._useNest?this._module=this._module||K.loadModule("@nestjs/graphql"):this._module=this._module||K.loadModule("apollo-server-core"),this._module}setupOnce(e,n){if(DI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.log("Apollo Integration is skipped because of instrumenter configuration.");return}if(this._useNest){let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package.");return}K.fill(r.GraphQLFactory.prototype,"mergeWithSchema",function(s){return function(...i){return K.fill(this.resolversExplorerService,"explore",function(o){return function(){let a=K.arrayify(o.call(this));return cf(a,n)}}),s.call(this,...i)}})}else{let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.error("Apollo Integration was unable to require apollo-server-core package.");return}K.fill(r.ApolloServerBase.prototype,"constructSchema",function(s){return function(){if(!this.config.resolvers)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this.config.schema?(K.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),K.logger.warn()):this.config.modules&&K.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),K.logger.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),s.call(this);let i=K.arrayify(this.config.resolvers);return this.config.resolvers=cf(i,n),s.call(this)}})}}};qs.__initStatic();function cf(t,e){return t.map(n=>(Object.keys(n).forEach(r=>{Object.keys(n[r]).forEach(s=>{typeof n[r][s]=="function"&&OI(n,r,s,e)})}),n))}function OI(t,e,n,r){K.fill(t[e],n,function(s){return function(...i){let a=r().getScope().getSpan(),c=ic([a,"optionalAccess",d=>d.startChild,"call",d=>d({description:`${e}.${n}`,op:"graphql.resolve",origin:"auto.graphql.apollo"})]),u=s.call(this,...i);return K.isThenable(u)?u.then(d=>(ic([c,"optionalAccess",l=>l.finish,"call",l=>l()]),d)):(ic([c,"optionalAccess",d=>d.finish,"call",d=>d()]),u)}})}oc.Apollo=qs});var df=g((ac,ot)=>{Object.defineProperty(ac,"__esModule",{value:!0});var At=T(),NI=[()=>{let t=At.dynamicRequire(ot,"./apollo");return new t.Apollo},()=>{let t=At.dynamicRequire(ot,"./apollo");return new t.Apollo({useNestjs:!0})},()=>{let t=At.dynamicRequire(ot,"./graphql");return new t.GraphQL},()=>{let t=At.dynamicRequire(ot,"./mongo");return new t.Mongo},()=>{let t=At.dynamicRequire(ot,"./mongo");return new t.Mongo({mongoose:!0})},()=>{let t=At.dynamicRequire(ot,"./mysql");return new t.Mysql},()=>{let t=At.dynamicRequire(ot,"./postgres");return new t.Postgres}];ac.lazyLoadedNodePerformanceMonitoringIntegrations=NI});var je=g(cc=>{Object.defineProperty(cc,"__esModule",{value:!0});var wI=T(),kI=wI.GLOBAL_OBJ;cc.WINDOW=kI});var pf=g(uc=>{Object.defineProperty(uc,"__esModule",{value:!0});var PI=N(),lf=T(),Fs=je();function xI(){Fs.WINDOW&&Fs.WINDOW.document?Fs.WINDOW.document.addEventListener("visibilitychange",()=>{let t=PI.getActiveTransaction();if(Fs.WINDOW.document.hidden&&t){let e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&lf.logger.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&lf.logger.warn("[Tracing] Could not set up background tab detection due to lack of global document")}uc.registerBackgroundTabDetection=xI});var Gs=g(dc=>{Object.defineProperty(dc,"__esModule",{value:!0});var UI=(t,e,n)=>{let r,s;return i=>{e.value>=0&&(i||n)&&(s=e.value-(r||0),(s||r===void 0)&&(r=e.value,e.delta=s,t(e)))}};dc.bindReporter=UI});var ff=g(lc=>{Object.defineProperty(lc,"__esModule",{value:!0});var MI=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`;lc.generateUniqueID=MI});var fc=g(pc=>{Object.defineProperty(pc,"__esModule",{value:!0});var dr=je(),LI=()=>{let t=dr.WINDOW.performance.timing,e=dr.WINDOW.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(let r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},qI=()=>dr.WINDOW.__WEB_VITALS_POLYFILL__?dr.WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||LI()):dr.WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];pc.getNavigationEntry=qI});var _c=g(gc=>{Object.defineProperty(gc,"__esModule",{value:!0});var FI=fc(),GI=()=>{let t=FI.getNavigationEntry();return t&&t.activationStart||0};gc.getActivationStart=GI});var Bs=g(hc=>{Object.defineProperty(hc,"__esModule",{value:!0});var BI=je(),$I=ff(),jI=_c(),HI=fc(),YI=(t,e)=>{let n=HI.getNavigationEntry(),r="navigate";return n&&(BI.WINDOW.document.prerendering||jI.getActivationStart()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:$I.generateUniqueID(),navigationType:r}};hc.initMetric=YI});var lr=g(mc=>{Object.defineProperty(mc,"__esModule",{value:!0});var KI=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let r=new PerformanceObserver(s=>{e(s.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}};mc.observe=KI});var pr=g(Ec=>{Object.defineProperty(Ec,"__esModule",{value:!0});var WI=je(),VI=(t,e)=>{let n=r=>{(r.type==="pagehide"||WI.WINDOW.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)};Ec.onHidden=VI});var gf=g(yc=>{Object.defineProperty(yc,"__esModule",{value:!0});var zI=Gs(),XI=Bs(),JI=lr(),QI=pr(),ZI=t=>{let e=XI.initMetric("CLS",0),n,r=0,s=[],i=a=>{a.forEach(c=>{if(!c.hadRecentInput){let u=s[0],d=s[s.length-1];r&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-u.startTime<5e3?(r+=c.value,s.push(c)):(r=c.value,s=[c]),r>e.value&&(e.value=r,e.entries=s,n&&n())}})},o=JI.observe("layout-shift",i);if(o){n=zI.bindReporter(t,e);let a=()=>{i(o.takeRecords()),n(!0)};return QI.onHidden(a),a}};yc.onCLS=ZI});var js=g(Sc=>{Object.defineProperty(Sc,"__esModule",{value:!0});var _f=je(),eA=pr(),$s=-1,tA=()=>_f.WINDOW.document.visibilityState==="hidden"&&!_f.WINDOW.document.prerendering?0:1/0,nA=()=>{eA.onHidden(({timeStamp:t})=>{$s=t},!0)},rA=()=>($s<0&&($s=tA(),nA()),{get firstHiddenTime(){return $s}});Sc.getVisibilityWatcher=rA});var hf=g(Tc=>{Object.defineProperty(Tc,"__esModule",{value:!0});var sA=Gs(),iA=js(),oA=Bs(),aA=lr(),cA=pr(),uA=t=>{let e=iA.getVisibilityWatcher(),n=oA.initMetric("FID"),r,s=a=>{a.startTime<e.firstHiddenTime&&(n.value=a.processingStart-a.startTime,n.entries.push(a),r(!0))},i=a=>{a.forEach(s)},o=aA.observe("first-input",i);r=sA.bindReporter(t,n),o&&cA.onHidden(()=>{i(o.takeRecords()),o.disconnect()},!0)};Tc.onFID=uA});var Ef=g(bc=>{Object.defineProperty(bc,"__esModule",{value:!0});var dA=Gs(),lA=_c(),pA=js(),fA=Bs(),gA=lr(),_A=pr(),mf={},hA=t=>{let e=pA.getVisibilityWatcher(),n=fA.initMetric("LCP"),r,s=o=>{let a=o[o.length-1];if(a){let c=Math.max(a.startTime-lA.getActivationStart(),0);c<e.firstHiddenTime&&(n.value=c,n.entries=[a],r())}},i=gA.observe("largest-contentful-paint",s);if(i){r=dA.bindReporter(t,n);let o=()=>{mf[n.id]||(s(i.takeRecords()),i.disconnect(),mf[n.id]=!0,r(!0))};return["keydown","click"].forEach(a=>{addEventListener(a,o,{once:!0,capture:!0})}),_A.onHidden(o,!0),o}};bc.onLCP=hA});var yf=g(Hs=>{Object.defineProperty(Hs,"__esModule",{value:!0});function mA(t){return typeof t=="number"&&isFinite(t)}function EA(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}Hs._startChild=EA;Hs.isMeasurementValue=mA});var Rf=g(at=>{Object.defineProperty(at,"__esModule",{value:!0});var Tf=N(),U=T(),vt=je(),yA=gf(),SA=hf(),TA=Ef(),bA=js(),bf=lr(),He=yf();function M(t){return t/1e3}function If(){return vt.WINDOW&&vt.WINDOW.addEventListener&&vt.WINDOW.performance}var Sf=0,w={},Ce,fr;function IA(){let t=If();if(t&&U.browserPerformanceTimeOrigin){t.mark&&vt.WINDOW.performance.mark("sentry-tracing-init"),DA();let e=RA(),n=CA();return()=>{e&&e(),n&&n()}}return()=>{}}function AA(){let t=e=>{for(let n of e){let r=Tf.getActiveTransaction();if(!r)return;let s=M(U.browserPerformanceTimeOrigin+n.startTime),i=M(n.duration);r.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:s,endTimestamp:s+i})}};bf.observe("longtask",t)}function vA(){let t=e=>{for(let n of e){let r=Tf.getActiveTransaction();if(!r)return;if(n.name==="click"){let s=M(U.browserPerformanceTimeOrigin+n.startTime),i=M(n.duration);r.startChild({description:U.htmlTreeAsString(n.target),op:`ui.interaction.${n.name}`,origin:"auto.ui.browser.metrics",startTimestamp:s,endTimestamp:s+i})}}};bf.observe("event",t,{durationThreshold:0})}function RA(){return yA.onCLS(t=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding CLS"),w.cls={value:t.value,unit:""},fr=e)})}function CA(){return TA.onLCP(t=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding LCP"),w.lcp={value:t.value,unit:"millisecond"},Ce=e)})}function DA(){SA.onFID(t=>{let e=t.entries.pop();if(!e)return;let n=M(U.browserPerformanceTimeOrigin),r=M(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FID"),w.fid={value:t.value,unit:"millisecond"},w["mark.fid"]={value:n+r,unit:"second"}})}function OA(t){let e=If();if(!e||!vt.WINDOW.performance.getEntries||!U.browserPerformanceTimeOrigin)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Tracing] Adding & adjusting spans using Performance API");let n=M(U.browserPerformanceTimeOrigin),r=e.getEntries(),s,i;if(r.slice(Sf).forEach(o=>{let a=M(o.startTime),c=M(o.duration);if(!(t.op==="navigation"&&n+a<t.startTimestamp))switch(o.entryType){case"navigation":{NA(t,o,n),s=n+M(o.responseStart),i=n+M(o.requestStart);break}case"mark":case"paint":case"measure":{Af(t,o,a,c,n);let u=bA.getVisibilityWatcher(),d=o.startTime<u.firstHiddenTime;o.name==="first-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FP"),w.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FCP"),w.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{let u=o.name.replace(vt.WINDOW.location.origin,"");vf(t,o,u,a,c,n);break}}}),Sf=Math.max(r.length-1,0),kA(t),t.op==="pageload"){typeof s=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding TTFB"),w.ttfb={value:(s-t.startTimestamp)*1e3,unit:"millisecond"},typeof i=="number"&&i<=s&&(w["ttfb.requestTime"]={value:(s-i)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!w[a]||n>=t.startTimestamp)return;let c=w[a].value,u=n+M(c),d=Math.abs((u-t.startTimestamp)*1e3),l=d-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log(`[Measurements] Normalized ${a} from ${c} to ${d} (${l})`),w[a].value=d});let o=w["mark.fid"];o&&w.fid&&(He._startChild(t,{description:"first input delay",endTimestamp:o.value+M(w.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete w["mark.fid"]),"fcp"in w||delete w.cls,Object.keys(w).forEach(a=>{t.setMeasurement(a,w[a].value,w[a].unit)}),PA(t)}Ce=void 0,fr=void 0,w={}}function Af(t,e,n,r,s){let i=s+n,o=i+r;return He._startChild(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i}),i}function NA(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ys(t,e,r,n)}),Ys(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Ys(t,e,"fetch",n,"cache","domainLookupStart"),Ys(t,e,"domainLookup",n,"DNS"),wA(t,e,n)}function Ys(t,e,n,r,s,i){let o=i?e[i]:e[`${n}End`],a=e[`${n}Start`];!a||!o||He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:s||n,startTimestamp:r+M(a),endTimestamp:r+M(o)})}function wA(t,e,n){He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+M(e.requestStart),endTimestamp:n+M(e.responseEnd)}),He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+M(e.responseStart),endTimestamp:n+M(e.responseEnd)})}function vf(t,e,n,r,s,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let o={};"transferSize"in e&&(o["http.response_transfer_size"]=e.transferSize),"encodedBodySize"in e&&(o["http.response_content_length"]=e.encodedBodySize),"decodedBodySize"in e&&(o["http.decoded_response_content_length"]=e.decodedBodySize),"renderBlockingStatus"in e&&(o["resource.render_blocking_status"]=e.renderBlockingStatus);let a=i+r,c=a+s;He._startChild(t,{description:n,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:o})}function kA(t){let e=vt.WINDOW.navigator;if(!e)return;let n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),He.isMeasurementValue(n.rtt)&&(w["connection.rtt"]={value:n.rtt,unit:"millisecond"})),He.isMeasurementValue(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),He.isMeasurementValue(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function PA(t){Ce&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding LCP Data"),Ce.element&&t.setTag("lcp.element",U.htmlTreeAsString(Ce.element)),Ce.id&&t.setTag("lcp.id",Ce.id),Ce.url&&t.setTag("lcp.url",Ce.url.trim().slice(0,200)),t.setTag("lcp.size",Ce.size)),fr&&fr.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding CLS Data"),fr.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,U.htmlTreeAsString(e.node))))}at._addMeasureSpans=Af;at._addResourceSpans=vf;at.addPerformanceEntries=OA;at.startTrackingInteractions=vA;at.startTrackingLongTasks=AA;at.startTrackingWebVitals=IA});var Ac=g(Oe=>{Object.defineProperty(Oe,"__esModule",{value:!0});var an=N(),W=T(),Ks=["localhost",/^\/(?!\/)/],Ic={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Ks,tracePropagationTargets:Ks};function xA(t){let{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o}={traceFetch:Ic.traceFetch,traceXHR:Ic.traceXHR,...t},a=typeof i=="function"?i:d=>!0,c=d=>Nf(d,r||s),u={};e&&W.addInstrumentationHandler("fetch",d=>{let l=wf(d,a,c,u);o&&l&&Cf(l)}),n&&W.addInstrumentationHandler("xhr",d=>{let l=Pf(d,a,c,u);o&&l&&Cf(l)})}function UA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Cf(t){let e=t.data.url,n=new PerformanceObserver(r=>{r.getEntries().forEach(i=>{UA(i)&&i.name.endsWith(e)&&(MA(i).forEach(a=>t.setData(...a)),n.disconnect())})});n.observe({entryTypes:["resource"]})}function Of(t){let e="unknown",n="unknown",r="";for(let s of t){if(s==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(s))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=s}return r===t&&(e=r),{name:e,version:n}}function De(t=0){return((W.browserPerformanceTimeOrigin||performance.timeOrigin)+t)/1e3}function MA(t){let{name:e,version:n}=Of(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),W.browserPerformanceTimeOrigin?[...r,["http.request.redirect_start",De(t.redirectStart)],["http.request.fetch_start",De(t.fetchStart)],["http.request.domain_lookup_start",De(t.domainLookupStart)],["http.request.domain_lookup_end",De(t.domainLookupEnd)],["http.request.connect_start",De(t.connectStart)],["http.request.secure_connection_start",De(t.secureConnectionStart)],["http.request.connection_end",De(t.connectEnd)],["http.request.request_start",De(t.requestStart)],["http.request.response_start",De(t.responseStart)],["http.request.response_end",De(t.responseEnd)]]:r}function Nf(t,e){return W.stringMatchesSomePattern(t,e||Ks)}function wf(t,e,n,r){if(!an.hasTracingEnabled()||!t.fetchData)return;let s=e(t.fetchData.url);if(t.endTimestamp&&s){let p=t.fetchData.__span;if(!p)return;let f=r[p];if(f){if(t.response){f.setHttpStatus(t.response.status);let m=t.response&&t.response.headers&&t.response.headers.get("content-length"),E=parseInt(m);E>0&&f.setData("http.response_content_length",E)}else t.error&&f.setStatus("internal_error");f.finish(),delete r[p]}return}let i=an.getCurrentHub(),o=i.getScope(),a=i.getClient(),c=o.getSpan(),{method:u,url:d}=t.fetchData,l=s&&c?c.startChild({data:{url:d,type:"fetch","http.method":u},description:`${u} ${d}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(l&&(t.fetchData.__span=l.spanId,r[l.spanId]=l),n(t.fetchData.url)&&a){let p=t.args[0];t.args[1]=t.args[1]||{};let f=t.args[1];f.headers=kf(p,a,o,f,l)}return l}function kf(t,e,n,r,s){let i=s||n.getSpan(),o=i&&i.transaction,{traceId:a,sampled:c,dsc:u}=n.getPropagationContext(),d=i?i.toTraceparent():W.generateSentryTraceHeader(a,void 0,c),l=o?o.getDynamicSamplingContext():u||an.getDynamicSamplingContextFromClient(a,e,n),p=W.dynamicSamplingContextToSentryBaggageHeader(l),f=typeof Request<"u"&&W.isInstanceOf(t,Request)?t.headers:r.headers;if(f)if(typeof Headers<"u"&&W.isInstanceOf(f,Headers)){let m=new Headers(f);return m.append("sentry-trace",d),p&&m.append(W.BAGGAGE_HEADER_NAME,p),m}else if(Array.isArray(f)){let m=[...f,["sentry-trace",d]];return p&&m.push([W.BAGGAGE_HEADER_NAME,p]),m}else{let m="baggage"in f?f.baggage:void 0,E=[];return Array.isArray(m)?E.push(...m):m&&E.push(m),p&&E.push(p),{...f,"sentry-trace":d,baggage:E.length>0?E.join(","):void 0}}else return{"sentry-trace":d,baggage:p}}function Pf(t,e,n,r){let s=t.xhr,i=s&&s[W.SENTRY_XHR_DATA_KEY];if(!an.hasTracingEnabled()||s&&s.__sentry_own_request__||!s||!i)return;let o=e(i.url);if(t.endTimestamp&&o){let l=s.__sentry_xhr_span_id__;if(!l)return;let p=r[l];p&&(p.setHttpStatus(i.status_code),p.finish(),delete r[l]);return}let a=an.getCurrentHub(),c=a.getScope(),u=c.getSpan(),d=o&&u?u.startChild({data:{...i.data,type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(s.__sentry_xhr_span_id__=d.spanId,r[s.__sentry_xhr_span_id__]=d),s.setRequestHeader&&n(i.url))if(d){let l=d&&d.transaction,p=l&&l.getDynamicSamplingContext(),f=W.dynamicSamplingContextToSentryBaggageHeader(p);Df(s,d.toTraceparent(),f)}else{let l=a.getClient(),{traceId:p,sampled:f,dsc:m}=c.getPropagationContext(),E=W.generateSentryTraceHeader(p,void 0,f),b=m||(l?an.getDynamicSamplingContextFromClient(p,l,c):void 0),v=W.dynamicSamplingContextToSentryBaggageHeader(b);Df(s,E,v)}return d}function Df(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(W.BAGGAGE_HEADER_NAME,n)}catch{}}Oe.DEFAULT_TRACE_PROPAGATION_TARGETS=Ks;Oe.addTracingHeadersToFetchRequest=kf;Oe.defaultRequestInstrumentationOptions=Ic;Oe.extractNetworkProtocol=Of;Oe.fetchCallback=wf;Oe.instrumentOutgoingRequests=xA;Oe.shouldAttachHeaders=Nf;Oe.xhrCallback=Pf});var xf=g(vc=>{Object.defineProperty(vc,"__esModule",{value:!0});var gr=T(),_r=je();function LA(t,e=!0,n=!0){if(!_r.WINDOW||!_r.WINDOW.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&gr.logger.warn("Could not initialize routing instrumentation due to invalid location");return}let r=_r.WINDOW.location.href,s;e&&(s=t({name:_r.WINDOW.location.pathname,startTimestamp:gr.browserPerformanceTimeOrigin?gr.browserPerformanceTimeOrigin/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&gr.addInstrumentationHandler("history",({to:i,from:o})=>{if(o===void 0&&r&&r.indexOf(i)!==-1){r=void 0;return}o!==i&&(r=void 0,s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&gr.logger.log(`[Tracing] Finishing current transaction with op: ${s.op}`),s.finish()),s=t({name:_r.WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}vc.instrumentRoutingWithDefaults=LA});var qf=g(mr=>{Object.defineProperty(mr,"__esModule",{value:!0});var hr=N(),Ye=T(),qA=pf(),Ws=Rf(),Mf=Ac(),FA=xf(),Uf=je(),Lf="BrowserTracing",GA={...hr.TRACING_DEFAULTS,markBackgroundTransactions:!0,routingInstrumentation:FA.instrumentRoutingWithDefaults,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...Mf.defaultRequestInstrumentationOptions},Rc=class{constructor(e){this.name=Lf,this._hasSetTracePropagationTargets=!1,hr.addTracingExtensions(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...GA,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=Ws.startTrackingWebVitals(),this.options.enableLongTask&&Ws.startTrackingLongTasks(),this.options._experiments.enableInteractions&&Ws.startTrackingInteractions()}setupOnce(e,n){this._getCurrentHub=n;let s=n().getClient(),i=s&&s.getOptions(),{routingInstrumentation:o,startTransactionOnLocationChange:a,startTransactionOnPageLoad:c,markBackgroundTransactions:u,traceFetch:d,traceXHR:l,shouldCreateSpanForRequest:p,enableHTTPTimings:f,_experiments:m}=this.options,E=i&&i.tracePropagationTargets,b=E||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&E&&Ye.logger.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),o(v=>{let L=this._createRouteTransaction(v);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(L,v,n),L},c,a),u&&qA.registerBackgroundTabDetection(),m.enableInteractions&&this._registerInteractionListener(),Mf.instrumentOutgoingRequests({traceFetch:d,traceXHR:l,tracePropagationTargets:b,shouldCreateSpanForRequest:p,enableHTTPTimings:f})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let n=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:s,finalTimeout:i,heartbeatInterval:o}=this.options,a=e.op==="pageload",c=a?Cc("sentry-trace"):"",u=a?Cc("baggage"):"",{traceparentData:d,dynamicSamplingContext:l,propagationContext:p}=Ye.tracingContextFromHeaders(c,u),f={...e,...d,metadata:{...e.metadata,dynamicSamplingContext:d&&!l?{}:l},trimEnd:!0},m=typeof r=="function"?r(f):f,E=m===void 0?{...f,sampled:!1}:m;E.metadata=E.name!==f.name?{...E.metadata,source:"custom"}:E.metadata,this._latestRouteName=E.name,this._latestRouteSource=E.metadata&&E.metadata.source,E.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.log(`[Tracing] Will not send ${E.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.log(`[Tracing] Starting ${E.op} transaction on scope`);let{location:b}=Uf.WINDOW,v=hr.startIdleTransaction(n,E,s,i,!0,{location:b},o),L=n.getScope();return a&&d?L.setPropagationContext(p):L.setPropagationContext({traceId:v.traceId,spanId:v.spanId,parentSpanId:v.parentSpanId,sampled:v.sampled}),v.registerBeforeFinishCallback(se=>{this._collectWebVitals(),Ws.addPerformanceEntries(se)}),v}_registerInteractionListener(){let e,n=()=>{let{idleTimeout:r,finalTimeout:s,heartbeatInterval:i}=this.options,o="ui.action.click",a=hr.getActiveTransaction();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${o} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${o} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:u}=Uf.WINDOW,d={name:this._latestRouteName,op:o,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=hr.startIdleTransaction(c,d,r,s,!0,{location:u},i)};["click"].forEach(r=>{addEventListener(r,n,{once:!1,capture:!0})})}};function Cc(t){let e=Ye.getDomElement(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}mr.BROWSER_TRACING_INTEGRATION_ID=Lf;mr.BrowserTracing=Rc;mr.getMetaContent=Cc});var Gf=g((Dc,Er)=>{Object.defineProperty(Dc,"__esModule",{value:!0});var Ff=N(),cn=T();function BA(){let t=Ff.getMainCarrier();if(!t.__SENTRY__)return;let e={mongodb(){let r=cn.dynamicRequire(Er,"./node/integrations/mongo");return new r.Mongo},mongoose(){let r=cn.dynamicRequire(Er,"./node/integrations/mongo");return new r.Mongo},mysql(){let r=cn.dynamicRequire(Er,"./node/integrations/mysql");return new r.Mysql},pg(){let r=cn.dynamicRequire(Er,"./node/integrations/postgres");return new r.Postgres}},n=Object.keys(e).filter(r=>!!cn.loadModule(r)).map(r=>{try{return e[r]()}catch{return}}).filter(r=>r);n.length>0&&(t.__SENTRY__.integrations=[...t.__SENTRY__.integrations||[],...n])}function $A(){Ff.addTracingExtensions(),cn.isNodeEnv()&&BA()}Dc.addExtensionMethods=$A});var Nc=g(D=>{Object.defineProperty(D,"__esModule",{value:!0});var Ke=N(),Bf=T(),jA=Zp(),HA=ef(),YA=tf(),KA=nf(),WA=of(),VA=af(),zA=uf(),XA=df(),$f=qf(),Oc=Ac(),JA=Gf();D.IdleTransaction=Ke.IdleTransaction;D.Span=Ke.Span;D.SpanStatus=Ke.SpanStatus;D.Transaction=Ke.Transaction;D.extractTraceparentData=Ke.extractTraceparentData;D.getActiveTransaction=Ke.getActiveTransaction;D.hasTracingEnabled=Ke.hasTracingEnabled;D.spanStatusfromHttpCode=Ke.spanStatusfromHttpCode;D.startIdleTransaction=Ke.startIdleTransaction;D.TRACEPARENT_REGEXP=Bf.TRACEPARENT_REGEXP;D.stripUrlQueryAndFragment=Bf.stripUrlQueryAndFragment;D.Express=jA.Express;D.Postgres=HA.Postgres;D.Mysql=YA.Mysql;D.Mongo=KA.Mongo;D.Prisma=WA.Prisma;D.GraphQL=VA.GraphQL;D.Apollo=zA.Apollo;D.lazyLoadedNodePerformanceMonitoringIntegrations=XA.lazyLoadedNodePerformanceMonitoringIntegrations;D.BROWSER_TRACING_INTEGRATION_ID=$f.BROWSER_TRACING_INTEGRATION_ID;D.BrowserTracing=$f.BrowserTracing;D.addTracingHeadersToFetchRequest=Oc.addTracingHeadersToFetchRequest;D.defaultRequestInstrumentationOptions=Oc.defaultRequestInstrumentationOptions;D.instrumentOutgoingRequests=Oc.instrumentOutgoingRequests;D.addExtensionMethods=JA.addExtensionMethods});var jf=g(wc=>{Object.defineProperty(wc,"__esModule",{value:!0});var QA=Nc(),ZA=T();function ev(){let t=QA.lazyLoadedNodePerformanceMonitoringIntegrations.map(e=>{try{return e()}catch{return}}).filter(e=>!!e);return t.length===0&&ZA.logger.warn("Performance monitoring integrations could not be automatically loaded."),t.filter(e=>!!e.loadDependency())}wc.autoDiscoverNodePerformanceMonitoringIntegrations=ev});var Uc=g(xc=>{Object.defineProperty(xc,"__esModule",{value:!0});var kc=N(),tv=require("os"),nv=require("util"),Pc=class extends kc.ServerRuntimeClient{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.node",packages:[{name:"npm:@sentry/node",version:kc.SDK_VERSION}],version:kc.SDK_VERSION},e.transportOptions={textEncoder:new nv.TextEncoder,...e.transportOptions};let n={...e,platform:"node",runtime:{name:"node",version:global.process.version},serverName:e.serverName||global.process.env.SENTRY_NAME||tv.hostname()};super(n)}};xc.NodeClient=Pc});var Yf=g((Zw,Hf)=>{var un=1e3,dn=un*60,ln=dn*60,Rt=ln*24,rv=Rt*7,sv=Rt*365.25;Hf.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return iv(t);if(n==="number"&&isFinite(t))return e.long?av(t):ov(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function iv(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*sv;case"weeks":case"week":case"w":return n*rv;case"days":case"day":case"d":return n*Rt;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ln;case"minutes":case"minute":case"mins":case"min":case"m":return n*dn;case"seconds":case"second":case"secs":case"sec":case"s":return n*un;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function ov(t){var e=Math.abs(t);return e>=Rt?Math.round(t/Rt)+"d":e>=ln?Math.round(t/ln)+"h":e>=dn?Math.round(t/dn)+"m":e>=un?Math.round(t/un)+"s":t+"ms"}function av(t){var e=Math.abs(t);return e>=Rt?Vs(t,e,Rt,"day"):e>=ln?Vs(t,e,ln,"hour"):e>=dn?Vs(t,e,dn,"minute"):e>=un?Vs(t,e,un,"second"):t+" ms"}function Vs(t,e,n,r){var s=e>=n*1.5;return Math.round(t/n)+" "+r+(s?"s":"")}});var Mc=g((ek,Kf)=>{function cv(t){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=s,n.enabled=a,n.humanize=Yf(),n.destroy=u,Object.keys(t).forEach(d=>{n[d]=t[d]}),n.names=[],n.skips=[],n.formatters={};function e(d){let l=0;for(let p=0;p<d.length;p++)l=(l<<5)-l+d.charCodeAt(p),l|=0;return n.colors[Math.abs(l)%n.colors.length]}n.selectColor=e;function n(d){let l,p=null,f,m;function E(...b){if(!E.enabled)return;let v=E,L=Number(new Date),se=L-(l||L);v.diff=se,v.prev=l,v.curr=L,l=L,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let ie=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(P,Ue)=>{if(P==="%%")return"%";ie++;let Se=n.formatters[Ue];if(typeof Se=="function"){let ji=b[ie];P=Se.call(v,ji),b.splice(ie,1),ie--}return P}),n.formatArgs.call(v,b),(v.log||n.log).apply(v,b)}return E.namespace=d,E.useColors=n.useColors(),E.color=n.selectColor(d),E.extend=r,E.destroy=n.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(f!==n.namespaces&&(f=n.namespaces,m=n.enabled(d)),m),set:b=>{p=b}}),typeof n.init=="function"&&n.init(E),E}function r(d,l){let p=n(this.namespace+(typeof l>"u"?":":l)+d);return p.log=this.log,p}function s(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let l=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of l)p[0]==="-"?n.skips.push(p.slice(1)):n.names.push(p)}function i(d,l){let p=0,f=0,m=-1,E=0;for(;p<d.length;)if(f<l.length&&(l[f]===d[p]||l[f]==="*"))l[f]==="*"?(m=f,E=p,f++):(p++,f++);else if(m!==-1)f=m+1,E++,p=E;else return!1;for(;f<l.length&&l[f]==="*";)f++;return f===l.length}function o(){let d=[...n.names,...n.skips.map(l=>"-"+l)].join(",");return n.enable(""),d}function a(d){for(let l of n.skips)if(i(d,l))return!1;for(let l of n.names)if(i(d,l))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Kf.exports=cv});var Wf=g((Z,zs)=>{Z.formatArgs=dv;Z.save=lv;Z.load=pv;Z.useColors=uv;Z.storage=fv();Z.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Z.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function uv(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function dv(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+zs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(n++,s==="%c"&&(r=n))}),t.splice(r,0,e)}Z.log=console.debug||console.log||(()=>{});function lv(t){try{t?Z.storage.setItem("debug",t):Z.storage.removeItem("debug")}catch{}}function pv(){let t;try{t=Z.storage.getItem("debug")||Z.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function fv(){try{return localStorage}catch{}}zs.exports=Mc()(Z);var{formatters:gv}=zs.exports;gv.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var zf=g((tk,Vf)=>{"use strict";Vf.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),s=e.indexOf("--");return r!==-1&&(s===-1||r<s)}});var Qf=g((nk,Jf)=>{"use strict";var _v=require("os"),Xf=require("tty"),pe=zf(),{env:G}=process,ct;pe("no-color")||pe("no-colors")||pe("color=false")||pe("color=never")?ct=0:(pe("color")||pe("colors")||pe("color=true")||pe("color=always"))&&(ct=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?ct=1:G.FORCE_COLOR==="false"?ct=0:ct=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function Lc(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function qc(t,e){if(ct===0)return 0;if(pe("color=16m")||pe("color=full")||pe("color=truecolor"))return 3;if(pe("color=256"))return 2;if(t&&!e&&ct===void 0)return 0;let n=ct||0;if(G.TERM==="dumb")return n;if(process.platform==="win32"){let r=_v.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in G)||G.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let r=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:n}function hv(t){let e=qc(t,t&&t.isTTY);return Lc(e)}Jf.exports={supportsColor:hv,stdout:Lc(qc(!0,Xf.isatty(1))),stderr:Lc(qc(!0,Xf.isatty(2)))}});var eg=g((B,Js)=>{var mv=require("tty"),Xs=require("util");B.init=Av;B.log=Tv;B.formatArgs=yv;B.save=bv;B.load=Iv;B.useColors=Ev;B.destroy=Xs.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");B.colors=[6,2,3,4,5,1];try{let t=Qf();t&&(t.stderr||t).level>=2&&(B.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}B.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,i)=>i.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function Ev(){return"colors"in B.inspectOpts?!!B.inspectOpts.colors:mv.isatty(process.stderr.fd)}function yv(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${s};1m${e} \x1B[0m`;t[0]=i+t[0].split(`
|
|
21
21
|
`).join(`
|
|
22
|
-
`+i),t.push(s+"m+"+Js.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=
|
|
23
|
-
`)}function
|
|
24
|
-
`).map(e=>e.trim()).join(" ")};Zf.O=function(t){return this.inspectOpts.colors=this.useColors,Xs.inspect(t,this.inspectOpts)}});var Qs=g((
|
|
25
|
-
`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function Zs(t,e){return new Zs.Agent(t,e)}(function(t){class e extends
|
|
22
|
+
`+i),t.push(s+"m+"+Js.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Sv()+e+" "+t[0]}function Sv(){return B.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Tv(...t){return process.stderr.write(Xs.formatWithOptions(B.inspectOpts,...t)+`
|
|
23
|
+
`)}function bv(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Iv(){return process.env.DEBUG}function Av(t){t.inspectOpts={};let e=Object.keys(B.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=B.inspectOpts[e[n]]}Js.exports=Mc()(B);var{formatters:Zf}=Js.exports;Zf.o=function(t){return this.inspectOpts.colors=this.useColors,Xs.inspect(t,this.inspectOpts).split(`
|
|
24
|
+
`).map(e=>e.trim()).join(" ")};Zf.O=function(t){return this.inspectOpts.colors=this.useColors,Xs.inspect(t,this.inspectOpts)}});var Qs=g((rk,Fc)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Fc.exports=Wf():Fc.exports=eg()});var tg=g(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});function vv(t){return function(e,n){return new Promise((r,s)=>{t.call(this,e,n,(i,o)=>{i?s(i):r(o)})})}}Gc.default=vv});var sg=g(($c,rg)=>{"use strict";var ng=$c&&$c.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Rv=require("events"),Cv=ng(Qs()),Dv=ng(tg()),yr=Cv.default("agent-base");function Ov(t){return!!t&&typeof t.addRequest=="function"}function Bc(){let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
25
|
+
`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function Zs(t,e){return new Zs.Agent(t,e)}(function(t){class e extends Rv.EventEmitter{constructor(r,s){super();let i=s;typeof r=="function"?this.callback=r:r&&(i=r),this.timeout=null,i&&typeof i.timeout=="number"&&(this.timeout=i.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:Bc()?443:80}set defaultPort(r){this.explicitDefaultPort=r}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:Bc()?"https:":"http:"}set protocol(r){this.explicitProtocol=r}callback(r,s,i){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(r,s){let i=Object.assign({},s);typeof i.secureEndpoint!="boolean"&&(i.secureEndpoint=Bc()),i.host==null&&(i.host="localhost"),i.port==null&&(i.port=i.secureEndpoint?443:80),i.protocol==null&&(i.protocol=i.secureEndpoint?"https:":"http:"),i.host&&i.path&&delete i.path,delete i.agent,delete i.hostname,delete i._defaultAgent,delete i.defaultPort,delete i.createConnection,r._last=!0,r.shouldKeepAlive=!1;let o=!1,a=null,c=i.timeout||this.timeout,u=f=>{r._hadError||(r.emit("error",f),r._hadError=!0)},d=()=>{a=null,o=!0;let f=new Error(`A "socket" was not created for HTTP request before ${c}ms`);f.code="ETIMEOUT",u(f)},l=f=>{o||(a!==null&&(clearTimeout(a),a=null),u(f))},p=f=>{if(o)return;if(a!=null&&(clearTimeout(a),a=null),Ov(f)){yr("Callback returned another Agent instance %o",f.constructor.name),f.addRequest(r,i);return}if(f){f.once("free",()=>{this.freeSocket(f,i)}),r.onSocket(f);return}let m=new Error(`no Duplex stream was returned to agent-base for \`${r.method} ${r.path}\``);u(m)};if(typeof this.callback!="function"){u(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(yr("Converting legacy callback function to promise"),this.promisifiedCallback=Dv.default(this.callback)):this.promisifiedCallback=this.callback),typeof c=="number"&&c>0&&(a=setTimeout(d,c)),"port"in i&&typeof i.port!="number"&&(i.port=Number(i.port));try{yr("Resolving socket for %o request: %o",i.protocol,`${r.method} ${r.path}`),Promise.resolve(this.promisifiedCallback(r,i)).then(p,l)}catch(f){Promise.reject(f).catch(l)}}freeSocket(r,s){yr("Freeing socket %o %o",r.constructor.name,s),r.destroy()}destroy(){yr("Destroying agent %o",this.constructor.name)}}t.Agent=e,t.prototype=t.Agent.prototype})(Zs||(Zs={}));rg.exports=Zs});var ig=g(Tr=>{"use strict";var Nv=Tr&&Tr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tr,"__esModule",{value:!0});var wv=Nv(Qs()),Sr=wv.default("https-proxy-agent:parse-proxy-response");function kv(t){return new Promise((e,n)=>{let r=0,s=[];function i(){let l=t.read();l?d(l):t.once("readable",i)}function o(){t.removeListener("end",c),t.removeListener("error",u),t.removeListener("close",a),t.removeListener("readable",i)}function a(l){Sr("onclose had error %o",l)}function c(){Sr("onend")}function u(l){o(),Sr("onerror %o",l),n(l)}function d(l){s.push(l),r+=l.length;let p=Buffer.concat(s,r);if(p.indexOf(`\r
|
|
26
26
|
\r
|
|
27
27
|
`)===-1){Sr("have not received end of HTTP headers yet..."),i();return}let m=p.toString("ascii",0,p.indexOf(`\r
|
|
28
|
-
`)),E=+m.split(" ")[1];Sr("got proxy server response: %o",m),e({statusCode:E,buffered:p})}t.on("error",u),t.on("close",a),t.on("end",c),i()})}Tr.default=
|
|
29
|
-
`;r.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(r.auth).toString("base64")}`);let{host:u,port:d,secureEndpoint:l}=n;
|
|
30
|
-
`;let p=
|
|
31
|
-
`);let{statusCode:f,buffered:m}=yield p;if(f===200){if(e.once("socket",
|
|
32
|
-
`),a.pipe(process.stderr)}),o.on("upgrade",(a,c)=>{if(a.headers["sec-websocket-accept"]!==i){c.end(),r(new Error(`Digest mismatch ${i} !== ${a.headers["sec-websocket-accept"]}`));return}let u=new Qc(c);n(u)}),o.on("error",a=>{r(a)}),o.end()})}eu.createWebSocketClient=uR});var hg=g(tu=>{Object.defineProperty(tu,"__esModule",{value:!0});var dR=T(),lR=ei(),pR=_g();async function fR(t,e){let n=0,r=await pR.createWebSocketClient(t);return r.on("message",s=>{let i=JSON.parse(s.toString());e(i)}),s=>{r.send(JSON.stringify({id:n++,method:s}))}}async function gR(t,e){let n=await fR(t,dR.createDebugPauseMessageHandler(r=>n(r),lR.getModuleFromFilename,e));return()=>{n("Debugger.enable"),n("Debugger.pause")}}tu.captureStackTrace=gR});var ru=g(ri=>{Object.defineProperty(ri,"__esModule",{value:!0});var ni=T(),_R=require("child_process"),hR=hg(),nu=N(),mR=50,ER=5e3;function mg(t,e){let n={level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${t} ms`,stacktrace:{frames:e},mechanism:{type:"ANR"}}]}};nu.captureEvent(n),nu.flush(3e3).then(()=>{process.exit()})}function yR(t=9229){let e=require("inspector"),n,r=t;for(;n===void 0&&r<t+100;)e.open(r),n=e.url(),r++;return n}function SR(t){function e(n,...r){ni.logger.log(`[ANR] ${n}`,...r)}try{let n={...process.env};n.SENTRY_ANR_CHILD_PROCESS="true",t.captureStackTrace&&(n.SENTRY_INSPECT_URL=yR()),e(`Spawning child process with execPath:'${process.execPath}' and entryScript'${t.entryScript}'`);let r=_R.spawn(process.execPath,[t.entryScript],{env:n,stdio:ni.logger.isEnabled()?["inherit","inherit","inherit","ipc"]:["ignore","ignore","ignore","ipc"]});r.unref();let s=setInterval(()=>{try{r.send("ping")}catch{}},t.pollInterval),i=o=>(...a)=>{clearInterval(s),e(`Child process ${o}`,...a)};r.on("error",i("error")),r.on("disconnect",i("disconnect")),r.on("exit",i("exit"))}catch(n){e("Failed to start child process",n)}}function TR(){let t=process.hrtime();return{getTimeMs:()=>{let[e,n]=process.hrtime(t);return Math.floor(e*1e3+n/1e6)},reset:()=>{t=process.hrtime()}}}function bR(t){function e(i){ni.logger.log(`[ANR child process] ${i}`)}process.title="sentry-anr",e("Started"),nu.addGlobalEventProcessor(i=>(delete i.sdkProcessingMetadata,i.tags={...i.tags,"process.name":"ANR"},i));let n;process.env.SENTRY_INSPECT_URL&&(e("Connecting to debugger"),n=hR.captureStackTrace(process.env.SENTRY_INSPECT_URL,i=>{e("Capturing event with stack frames"),mg(t.anrThreshold,i)}));async function r(){e("Watchdog timeout");let i=await n;i?(e("Pausing debugger to capture stack trace"),i()):(e("Capturing event"),mg(t.anrThreshold))}let{poll:s}=ni.watchdogTimer(TR,t.pollInterval,t.anrThreshold,r);process.on("message",()=>{s()})}function Eg(){return!!process.send&&!!process.env.SENTRY_ANR_CHILD_PROCESS}function IR(t){let n={entryScript:t.entryScript||process.env.pm_exec_path||process.argv[1],pollInterval:t.pollInterval||mR,anrThreshold:t.anrThreshold||ER,captureStackTrace:!!t.captureStackTrace,debug:!!t.debug};return Eg()?(bR(n),new Promise(()=>{})):(SR(n),Promise.resolve())}ri.enableAnrDetection=IR;ri.isAnrChildProcess=Eg});var fn=g(su=>{Object.defineProperty(su,"__esModule",{value:!0});var AR=T(),vR=AR.parseSemver(process.versions.node);su.NODE_VERSION=vR});var Tg=g(iu=>{var{_optionalChain:RR}=k();Object.defineProperty(iu,"__esModule",{value:!0});var Dt=N(),yg=require("domain");function Sg(){return yg.active}function CR(){let t=Sg();if(t)return Dt.ensureHubOnCarrier(t),Dt.getHubFromCarrier(t)}function DR(t){let e={};return Dt.ensureHubOnCarrier(e,t),Dt.getHubFromCarrier(e)}function OR(t,e){let n=Sg();if(n&&RR([e,"optionalAccess",o=>o.reuseExisting]))return t();let r=yg.create(),s=n?Dt.getHubFromCarrier(n):void 0,i=DR(s);return Dt.setHubOnCarrier(r,i),r.bind(()=>t())()}function NR(){Dt.setAsyncContextStrategy({getCurrentHub:CR,runWithAsyncContext:OR})}iu.setDomainAsyncContextStrategy=NR});var bg=g(au=>{var{_optionalChain:wR}=k();Object.defineProperty(au,"__esModule",{value:!0});var ou=N(),kR=require("async_hooks"),si;function xR(){si||(si=new kR.AsyncLocalStorage);function t(){return si.getStore()}function e(r){let s={};return ou.ensureHubOnCarrier(s,r),ou.getHubFromCarrier(s)}function n(r,s){let i=t();if(i&&wR([s,"optionalAccess",a=>a.reuseExisting]))return r();let o=e(i);return si.run(o,()=>r())}ou.setAsyncContextStrategy({getCurrentHub:t,runWithAsyncContext:n})}au.setHooksAsyncContextStrategy=xR});var Ag=g(cu=>{Object.defineProperty(cu,"__esModule",{value:!0});var Ig=fn(),PR=Tg(),UR=bg();function MR(){Ig.NODE_VERSION.major&&Ig.NODE_VERSION.major>=14?UR.setHooksAsyncContextStrategy():PR.setDomainAsyncContextStrategy()}cu.setNodeAsyncContextStrategy=MR});var du=g(uu=>{Object.defineProperty(uu,"__esModule",{value:!0});var LR=N(),vg=T(),qR=require("util"),ii=class t{constructor(){t.prototype.__init.call(this)}static __initStatic(){this.id="Console"}__init(){this.name=t.id}setupOnce(){vg.addInstrumentationHandler("console",({args:e,level:n})=>{let r=LR.getCurrentHub();r.getIntegration(t)&&r.addBreadcrumb({category:"console",level:vg.severityLevelFromString(n),message:qR.format.apply(void 0,e)},{input:[...e],level:n})})}};ii.__initStatic();uu.Console=ii});var Ir=g(oi=>{(function(t,e){let n=typeof oi=="object"?oi:typeof t=="object"?t:{};e(n),typeof define=="function"&&define.amd&&define("lru",n)})(oi,function(t){let e=Symbol("newer"),n=Symbol("older");function r(c,u){typeof c!="number"&&(u=c,c=0),this.size=0,this.limit=c,this.oldest=this.newest=void 0,this._keymap=new Map,u&&(this.assign(u),c<1&&(this.limit=this.size))}t.LRUMap=r;function s(c,u){this.key=c,this.value=u,this[e]=void 0,this[n]=void 0}r.prototype._markEntryAsUsed=function(c){c!==this.newest&&(c[e]&&(c===this.oldest&&(this.oldest=c[e]),c[e][n]=c[n]),c[n]&&(c[n][e]=c[e]),c[e]=void 0,c[n]=this.newest,this.newest&&(this.newest[e]=c),this.newest=c)},r.prototype.assign=function(c){let u,d=this.limit||Number.MAX_VALUE;this._keymap.clear();let l=c[Symbol.iterator]();for(let p=l.next();!p.done;p=l.next()){let f=new s(p.value[0],p.value[1]);if(this._keymap.set(f.key,f),u?(u[e]=f,f[n]=u):this.oldest=f,u=f,d--==0)throw new Error("overflow")}this.newest=u,this.size=this._keymap.size},r.prototype.get=function(c){var u=this._keymap.get(c);if(u)return this._markEntryAsUsed(u),u.value},r.prototype.set=function(c,u){var d=this._keymap.get(c);return d?(d.value=u,this._markEntryAsUsed(d),this):(this._keymap.set(c,d=new s(c,u)),this.newest?(this.newest[e]=d,d[n]=this.newest):this.oldest=d,this.newest=d,++this.size,this.size>this.limit&&this.shift(),this)},r.prototype.shift=function(){var c=this.oldest;if(c)return this.oldest[e]?(this.oldest=this.oldest[e],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),c[e]=c[n]=void 0,this._keymap.delete(c.key),--this.size,[c.key,c.value]},r.prototype.find=function(c){let u=this._keymap.get(c);return u?u.value:void 0},r.prototype.has=function(c){return this._keymap.has(c)},r.prototype.delete=function(c){var u=this._keymap.get(c);if(u)return this._keymap.delete(u.key),u[e]&&u[n]?(u[n][e]=u[e],u[e][n]=u[n]):u[e]?(u[e][n]=void 0,this.oldest=u[e]):u[n]?(u[n][e]=void 0,this.newest=u[n]):this.oldest=this.newest=void 0,this.size--,u.value},r.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()};function i(c){this.entry=c}i.prototype[Symbol.iterator]=function(){return this},i.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function o(c){this.entry=c}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:c.key}):{done:!0,value:void 0}};function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:c.value}):{done:!0,value:void 0}},r.prototype.keys=function(){return new o(this.oldest)},r.prototype.values=function(){return new a(this.oldest)},r.prototype.entries=function(){return this},r.prototype[Symbol.iterator]=function(){return new i(this.oldest)},r.prototype.forEach=function(c,u){typeof u!="object"&&(u=this);let d=this.oldest;for(;d;)c.call(u,d.value,d.key,this),d=d[e]},r.prototype.toJSON=function(){for(var c=new Array(this.size),u=0,d=this.oldest;d;)c[u++]={key:d.key,value:d.value},d=d[e];return c},r.prototype.toString=function(){for(var c="",u=this.oldest;u;)c+=String(u.key)+":"+u.value,u=u[e],u&&(c+=" < ");return c}})});var Og=g(Ot=>{var{_optionalChain:Ne}=k();Object.defineProperty(Ot,"__esModule",{value:!0});var lu=require("url"),Rg=fn();function FR(t){let{protocol:e,hostname:n,port:r}=Dg(t),s=t.path?t.path:"/";return`${e}//${n}${r}${s}`}function Cg(t){let{protocol:e,hostname:n,port:r}=Dg(t),s=t.pathname||"/",i=t.auth?GR(t.auth):"";return`${e}//${i}${n}${r}${s}`}function GR(t){let[e,n]=t.split(":");return`${e?"[Filtered]":""}:${n?"[Filtered]":""}@`}function BR(t,e,n){if(!t)return t;let[r,s]=t.split(" ");return e.host&&!e.protocol&&(e.protocol=Ne([n,"optionalAccess",i=>i.agent,"optionalAccess",i=>i.protocol]),s=Cg(e)),Ne([s,"optionalAccess",i=>i.startsWith,"call",i=>i("///")])&&(s=s.slice(2)),`${r} ${s}`}function pu(t){let e={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:`${t.pathname||""}${t.search||""}`,href:t.href};return t.port!==""&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username}:${t.password}`),e}function $R(t,e){let n,r;if(typeof e[e.length-1]=="function"&&(n=e.pop()),typeof e[0]=="string")r=pu(new lu.URL(e[0]));else if(e[0]instanceof lu.URL)r=pu(e[0]);else{r=e[0];try{let s=new lu.URL(r.path||"",`${r.protocol||"http:"}//${r.hostname}`);r={pathname:s.pathname,search:s.search,hash:s.hash,...r}}catch{}}return e.length===2&&(r={...r,...e[1]}),r.protocol===void 0&&(Rg.NODE_VERSION.major&&Rg.NODE_VERSION.major>8?r.protocol=Ne([Ne([t,"optionalAccess",s=>s.globalAgent]),"optionalAccess",s=>s.protocol])||Ne([r.agent,"optionalAccess",s=>s.protocol])||Ne([r._defaultAgent,"optionalAccess",s=>s.protocol]):r.protocol=Ne([r.agent,"optionalAccess",s=>s.protocol])||Ne([r._defaultAgent,"optionalAccess",s=>s.protocol])||Ne([Ne([t,"optionalAccess",s=>s.globalAgent]),"optionalAccess",s=>s.protocol])),n?[r,n]:[r]}function Dg(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`;return{protocol:e,hostname:n,port:r}}Ot.cleanSpanDescription=BR;Ot.extractRawUrl=FR;Ot.extractUrl=Cg;Ot.normalizeRequestArgs=$R;Ot.urlToOptions=pu});var gu=g(fu=>{var{_optionalChain:Nt}=k();Object.defineProperty(fu,"__esModule",{value:!0});var gn=N(),we=T(),Ng=Ir(),wg=fn(),Ar=Og(),vr=class t{static __initStatic(){this.id="Http"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._breadcrumbs=typeof e.breadcrumbs>"u"?!0:e.breadcrumbs,this._tracing=e.tracing?e.tracing===!0?{}:e.tracing:void 0}setupOnce(e,n){if(!this._breadcrumbs&&!this._tracing)return;let r=Nt([n,"call",c=>c(),"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]);if(r&&r.instrumenter!=="sentry"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log("HTTP Integration is skipped because of instrumenter configuration.");return}let s=Nt([this,"access",c=>c._tracing,"optionalAccess",c=>c.shouldCreateSpanForRequest])||Nt([r,"optionalAccess",c=>c.shouldCreateSpanForRequest]),i=Nt([r,"optionalAccess",c=>c.tracePropagationTargets])||Nt([this,"access",c=>c._tracing,"optionalAccess",c=>c.tracePropagationTargets]),o=require("http"),a=kg(o,this._breadcrumbs,s,i);if(we.fill(o,"get",a),we.fill(o,"request",a),wg.NODE_VERSION.major&&wg.NODE_VERSION.major>8){let c=require("https"),u=kg(c,this._breadcrumbs,s,i);we.fill(c,"get",u),we.fill(c,"request",u)}}};vr.__initStatic();function kg(t,e,n,r){let s=new Ng.LRUMap(100),i=new Ng.LRUMap(100),o=u=>{if(n===void 0)return!0;let d=s.get(u);if(d!==void 0)return d;let l=n(u);return s.set(u,l),l},a=u=>{if(r===void 0)return!0;let d=i.get(u);if(d!==void 0)return d;let l=we.stringMatchesSomePattern(u,r);return i.set(u,l),l};function c(u,d,l,p){gn.getCurrentHub().getIntegration(vr)&&gn.getCurrentHub().addBreadcrumb({category:"http",data:{status_code:p&&p.statusCode,...d},type:"http"},{event:u,request:l,response:p})}return function(d){return function(...p){let f=Ar.normalizeRequestArgs(t,p),m=f[0],E=Ar.extractRawUrl(m),b=Ar.extractUrl(m);if(gn.isSentryRequestUrl(b,gn.getCurrentHub()))return d.apply(t,f);let v=gn.getCurrentHub(),L=v.getScope(),se=L.getSpan(),ie=jR(b,m),J=o(E)?Nt([se,"optionalAccess",x=>x.startChild,"call",x=>x({op:"http.client",origin:"auto.http.node.http",description:`${ie["http.method"]} ${ie.url}`,data:ie})]):void 0;if(a(E))if(J){let x=J.toTraceparent(),Ue=Nt([J,"optionalAccess",Se=>Se.transaction,"optionalAccess",Se=>Se.getDynamicSamplingContext,"call",Se=>Se()]);xg(m,b,x,Ue)}else{let x=v.getClient(),{traceId:Ue,sampled:Se,dsc:ji}=L.getPropagationContext(),Nh=we.generateSentryTraceHeader(Ue,void 0,Se),wh=ji||(x?gn.getDynamicSamplingContextFromClient(Ue,x,L):void 0);xg(m,b,Nh,wh)}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log(`[Tracing] Not adding sentry-trace header to outgoing request (${b}) due to mismatching tracePropagationTargets option.`);return d.apply(t,f).once("response",function(x){let Ue=this;e&&c("response",ie,Ue,x),J&&(x.statusCode&&J.setHttpStatus(x.statusCode),J.description=Ar.cleanSpanDescription(J.description,m,Ue),J.finish())}).once("error",function(){let x=this;e&&c("error",ie,x),J&&(J.setHttpStatus(500),J.description=Ar.cleanSpanDescription(J.description,m,x),J.finish())})}}}function xg(t,e,n,r){if((t.headers||{})["sentry-trace"])return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log(`[Tracing] Adding sentry-trace header ${n} to outgoing request to "${e}": `);let i=we.dynamicSamplingContextToSentryBaggageHeader(r),o=i&&i.length>0?HR(t,i):void 0;t.headers={...t.headers,"sentry-trace":n,...o&&{baggage:o}}}function jR(t,e){let n=e.method||"GET",r={url:t,"http.method":n};return e.hash&&(r["http.fragment"]=e.hash.substring(1)),e.search&&(r["http.query"]=e.search.substring(1)),r}function HR(t,e){if(!t.headers||!t.headers.baggage)return e;if(e){if(Array.isArray(t.headers.baggage))return[...t.headers.baggage,e]}else return t.headers.baggage;return[t.headers.baggage,e]}fu.Http=vr});var mu=g(hu=>{Object.defineProperty(hu,"__esModule",{value:!0});var YR=N(),_u=T(),KR=2e3;function WR(t){console.error(t);let e=YR.getCurrentHub().getClient();e===void 0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1));let n=e.getOptions(),r=n&&n.shutdownTimeout&&n.shutdownTimeout>0&&n.shutdownTimeout||KR;e.close(r).then(s=>{s||(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},s=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.error(s)})}hu.logAndExitProcess=WR});var yu=g(Eu=>{Object.defineProperty(Eu,"__esModule",{value:!0});var Pg=N(),VR=T(),Ug=mu(),ai=class t{static __initStatic(){this.id="OnUncaughtException"}__init(){this.name=t.id}__init2(){this.handler=this._makeErrorHandler()}constructor(e={}){t.prototype.__init.call(this),t.prototype.__init2.call(this),this._options={exitEvenIfOtherHandlersAreRegistered:!0,...e}}setupOnce(){global.process.on("uncaughtException",this.handler)}_makeErrorHandler(){let n=!1,r=!1,s=!1,i;return o=>{let a=Ug.logAndExitProcess,c=Pg.getCurrentHub().getClient();this._options.onFatalError?a=this._options.onFatalError:c&&c.getOptions().onFatalError&&(a=c.getOptions().onFatalError);let d=global.process.listeners("uncaughtException").reduce((p,f)=>f.name==="domainUncaughtExceptionClear"||f.tag&&f.tag==="sentry_tracingErrorCallback"||f===this.handler?p:p+1,0)===0,l=this._options.exitEvenIfOtherHandlersAreRegistered||d;if(n)l&&(s?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&VR.logger.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),Ug.logAndExitProcess(o)):r||(r=!0,setTimeout(()=>{s||(s=!0,a(i,o))},2e3)));else{let p=Pg.getCurrentHub();i=o,n=!0,p.getIntegration(t)?p.withScope(f=>{f.setLevel("fatal"),p.captureException(o,{originalException:o,data:{mechanism:{handled:!1,type:"onuncaughtexception"}}}),!s&&l&&(s=!0,a(o))}):!s&&l&&(s=!0,a(o))}}}};ai.__initStatic();Eu.OnUncaughtException=ai});var Tu=g(Su=>{Object.defineProperty(Su,"__esModule",{value:!0});var zR=N(),Mg=T(),XR=mu(),ci=class t{static __initStatic(){this.id="OnUnhandledRejection"}__init(){this.name=t.id}constructor(e={mode:"warn"}){this._options=e,t.prototype.__init.call(this)}setupOnce(){global.process.on("unhandledRejection",this.sendUnhandledPromise.bind(this))}sendUnhandledPromise(e,n){let r=zR.getCurrentHub();r.getIntegration(t)&&r.withScope(s=>{s.setExtra("unhandledPromiseRejection",!0),r.captureException(e,{originalException:n,data:{mechanism:{handled:!1,type:"onunhandledrejection"}}})}),this._handleRejection(e)}_handleRejection(e){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";this._options.mode==="warn"?Mg.consoleSandbox(()=>{console.warn(n),console.error(e&&e.stack?e.stack:e)}):this._options.mode==="strict"&&(Mg.consoleSandbox(()=>{console.warn(n)}),XR.logAndExitProcess(e))}};ci.__initStatic();Su.OnUnhandledRejection=ci});var Iu=g(bu=>{Object.defineProperty(bu,"__esModule",{value:!0});var Lg=T(),JR="cause",QR=5,ui=class t{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._key=e.key||JR,this._limit=e.limit||QR}setupOnce(){}preprocessEvent(e,n,r){let s=r.getOptions();Lg.applyAggregateErrorsToEvent(Lg.exceptionFromError,s.stackParser,s.maxValueLength,this._key,this._limit,e,n)}};ui.__initStatic();bu.LinkedErrors=ui});var Ru=g(vu=>{Object.defineProperty(vu,"__esModule",{value:!0});var qg=require("fs"),Fg=require("path"),Au;function ZR(){try{return require.cache?Object.keys(require.cache):[]}catch{return[]}}function eC(){let t=require.main&&require.main.paths||[],e=ZR(),n={},r={};return e.forEach(s=>{let i=s,o=()=>{let a=i;if(i=Fg.dirname(a),!i||a===i||r[a])return;if(t.indexOf(i)<0)return o();let c=Fg.join(a,"package.json");if(r[a]=!0,!qg.existsSync(c))return o();try{let u=JSON.parse(qg.readFileSync(c,"utf8"));n[u.name]=u.version}catch{}};o()}),n}var di=class t{constructor(){t.prototype.__init.call(this)}static __initStatic(){this.id="Modules"}__init(){this.name=t.id}setupOnce(e,n){e(r=>n().getIntegration(t)?{...r,modules:{...r.modules,...this._getModules()}}:r)}_getModules(){return Au||(Au=eC()),Au}};di.__initStatic();vu.Modules=di});var Ou=g(Du=>{var{_optionalChain:Cu}=k();Object.defineProperty(Du,"__esModule",{value:!0});var tC=T(),nC=require("fs"),rC=Ir(),li=new rC.LRUMap(100),sC=7;function iC(t){return new Promise((e,n)=>{nC.readFile(t,"utf8",(r,s)=>{r?n(r):e(s)})})}var pi=class t{static __initStatic(){this.id="ContextLines"}__init(){this.name=t.id}constructor(e={}){this._options=e,t.prototype.__init.call(this)}get _contextLines(){return this._options.frameContextLines!==void 0?this._options.frameContextLines:sC}setupOnce(e,n){e(r=>n().getIntegration(t)?this.addSourceContext(r):r)}async addSourceContext(e){let n={},r=[];if(this._contextLines>0&&Cu([e,"access",s=>s.exception,"optionalAccess",s=>s.values])){for(let s of e.exception.values)if(Cu([s,"access",i=>i.stacktrace,"optionalAccess",i=>i.frames]))for(let i=s.stacktrace.frames.length-1;i>=0;i--){let o=s.stacktrace.frames[i];o.filename&&!n[o.filename]&&!li.get(o.filename)&&(r.push(oC(o.filename)),n[o.filename]=1)}}if(r.length>0&&await Promise.all(r),this._contextLines>0&&Cu([e,"access",s=>s.exception,"optionalAccess",s=>s.values]))for(let s of e.exception.values)s.stacktrace&&s.stacktrace.frames&&await this.addSourceContextToFrames(s.stacktrace.frames);return e}addSourceContextToFrames(e){for(let n of e)if(n.filename&&n.context_line===void 0){let r=li.get(n.filename);if(r)try{tC.addContextToFrame(r,n,this._contextLines)}catch{}}}};pi.__initStatic();async function oC(t){let e=li.get(t);if(e===null)return null;if(e!==void 0)return e;let n=null;try{n=(await iC(t)).split(`
|
|
33
|
-
`)}catch{}return li.set(t,n),n}Du.ContextLines=pi});var Nu=g(_n=>{var{_optionalChain:wt}=k();Object.defineProperty(_n,"__esModule",{value:!0});var aC=require("child_process"),Bg=require("fs"),fe=require("os"),cC=require("path"),$g=require("util"),jg=$g.promisify(Bg.readFile),Hg=$g.promisify(Bg.readdir),fi=class t{static __initStatic(){this.id="Context"}__init(){this.name=t.id}constructor(e={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0}){this._options=e,t.prototype.__init.call(this)}setupOnce(e){e(n=>this.addContext(n))}async addContext(e){this._cachedContext===void 0&&(this._cachedContext=this._getContexts());let n=this._updateContext(await this._cachedContext);return e.contexts={...e.contexts,app:{...n.app,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.app])},os:{...n.os,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.os])},device:{...n.device,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.device])},culture:{...n.culture,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.culture])},cloud_resource:{...n.cloud_resource,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.cloud_resource])}},e}_updateContext(e){return wt([e,"optionalAccess",n=>n.app,"optionalAccess",n=>n.app_memory])&&(e.app.app_memory=process.memoryUsage().rss),wt([e,"optionalAccess",n=>n.device,"optionalAccess",n=>n.free_memory])&&(e.device.free_memory=fe.freemem()),e}async _getContexts(){let e={};if(this._options.os&&(e.os=await uC()),this._options.app&&(e.app=lC()),this._options.device&&(e.device=Yg(this._options.device)),this._options.culture){let n=dC();n&&(e.culture=n)}return this._options.cloudResource&&(e.cloud_resource=mC()),e}};fi.__initStatic();async function uC(){let t=fe.platform();switch(t){case"darwin":return _C();case"linux":return hC();default:return{name:pC[t]||t,version:fe.release()}}}function dC(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function lC(){let t=process.memoryUsage().rss;return{app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t}}function Yg(t){let e={},n;try{n=fe.uptime&&fe.uptime()}catch{}if(typeof n=="number"&&(e.boot_time=new Date(Date.now()-n*1e3).toISOString()),e.arch=fe.arch(),(t===!0||t.memory)&&(e.memory_size=fe.totalmem(),e.free_memory=fe.freemem()),t===!0||t.cpu){let r=fe.cpus();if(r&&r.length){let s=r[0];e.processor_count=r.length,e.cpu_description=s.model,e.processor_frequency=s.speed}}return e}var pC={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},fC=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],gC={alpine:t=>t,arch:t=>ke(/distrib_release=(.*)/,t),centos:t=>ke(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>ke(/release (..)/,t),mint:t=>ke(/distrib_release=(.*)/,t),red:t=>ke(/release ([^ ]+)/,t),suse:t=>ke(/VERSION = (.*)\n/,t),ubuntu:t=>ke(/distrib_release=(.*)/,t)};function ke(t,e){let n=t.exec(e);return n?n[1]:void 0}async function _C(){let t={kernel_version:fe.release(),name:"Mac OS X",version:`10.${Number(fe.release().split(".")[0])-4}`};try{let e=await new Promise((n,r)=>{aC.execFile("/usr/bin/sw_vers",(s,i)=>{if(s){r(s);return}n(i)})});t.name=ke(/^ProductName:\s+(.*)$/m,e),t.version=ke(/^ProductVersion:\s+(.*)$/m,e),t.build=ke(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function Gg(t){return t.split(" ")[0].toLowerCase()}async function hC(){let t={kernel_version:fe.release(),name:"Linux"};try{let e=await Hg("/etc"),n=fC.find(a=>e.includes(a.name));if(!n)return t;let r=cC.join("/etc",n.name),s=(await jg(r,{encoding:"utf-8"})).toLowerCase(),{distros:i}=n;t.name=i.find(a=>s.indexOf(Gg(a))>=0)||i[0];let o=Gg(t.name);t.version=gC[o](s)}catch{}return t}function mC(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}_n.Context=fi;_n.getDeviceContext=Yg;_n.readDirAsync=Hg;_n.readFileAsync=jg});var Kg=g(wu=>{"use strict";wu.parse=yC;wu.serialize=SC;var EC=Object.prototype.toString,gi=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function yC(t,e){if(typeof t!="string")throw new TypeError("argument str must be a string");for(var n={},r=e||{},s=r.decode||TC,i=0;i<t.length;){var o=t.indexOf("=",i);if(o===-1)break;var a=t.indexOf(";",i);if(a===-1)a=t.length;else if(a<o){i=t.lastIndexOf(";",o-1)+1;continue}var c=t.slice(i,o).trim();if(n[c]===void 0){var u=t.slice(o+1,a).trim();u.charCodeAt(0)===34&&(u=u.slice(1,-1)),n[c]=AC(u,s)}i=a+1}return n}function SC(t,e,n){var r=n||{},s=r.encode||bC;if(typeof s!="function")throw new TypeError("option encode is invalid");if(!gi.test(t))throw new TypeError("argument name is invalid");var i=s(e);if(i&&!gi.test(i))throw new TypeError("argument val is invalid");var o=t+"="+i;if(r.maxAge!=null){var a=r.maxAge-0;if(isNaN(a)||!isFinite(a))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(a)}if(r.domain){if(!gi.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!gi.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){var c=r.expires;if(!IC(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+c.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.priority){var u=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(u){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var d=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(d){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}function TC(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function bC(t){return encodeURIComponent(t)}function IC(t){return EC.call(t)==="[object Date]"||t instanceof Date}function AC(t,e){try{return e(t)}catch{return t}}});var Rr=g(hn=>{var{_optionalChain:vC}=k();Object.defineProperty(hn,"__esModule",{value:!0});var _i=T(),RC=Kg(),CC=require("url"),DC={ip:!1,request:!0,transaction:!0,user:!0},OC=["cookies","data","headers","method","query_string","url"],Wg=["id","username","email"];function ku(t,e={}){let n=t.method&&t.method.toUpperCase(),r="",s="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,s="route"):(t.originalUrl||t.url)&&(r=_i.stripUrlQueryAndFragment(t.originalUrl||t.url||""));let i="";return e.method&&n&&(i+=n),e.method&&e.path&&(i+=" "),e.path&&r&&(i+=r),[i,s]}function NC(t,e){switch(e){case"path":return ku(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"<anonymous>";default:{let n=t._reconstructedRoute?t._reconstructedRoute:void 0;return ku(t,{path:!0,method:!0,customRoute:n})[0]}}}function wC(t,e){let n={};return(Array.isArray(e)?e:Wg).forEach(s=>{t&&s in t&&(n[s]=t[s])}),n}function xu(t,e){let{include:n=OC}=e||{},r={},s=t.headers||{},i=t.method,o=t.hostname||t.host||s.host||"<no host>",a=t.protocol==="https"||t.socket&&t.socket.encrypted?"https":"http",c=t.originalUrl||t.url||"",u=c.startsWith(a)?c:`${a}://${o}${c}`;return n.forEach(d=>{switch(d){case"headers":{r.headers=s,n.includes("cookies")||delete r.headers.cookie;break}case"method":{r.method=i;break}case"url":{r.url=u;break}case"cookies":{r.cookies=t.cookies||s.cookie&&RC.parse(s.cookie)||{};break}case"query_string":{r.query_string=xC(t);break}case"data":{if(i==="GET"||i==="HEAD")break;t.body!==void 0&&(r.data=_i.isString(t.body)?t.body:JSON.stringify(_i.normalize(t.body)));break}default:({}).hasOwnProperty.call(t,d)&&(r[d]=t[d])}}),r}function kC(t,e,n){let r={...DC,...vC([n,"optionalAccess",s=>s.include])};if(r.request){let s=Array.isArray(r.request)?xu(e,{include:r.request}):xu(e);t.request={...t.request,...s}}if(r.user){let s=e.user&&_i.isPlainObject(e.user)?wC(e.user,r.user):{};Object.keys(s).length&&(t.user={...t.user,...s})}if(r.ip){let s=e.ip||e.socket&&e.socket.remoteAddress;s&&(t.user={...t.user,ip_address:s})}return r.transaction&&!t.transaction&&(t.transaction=NC(e,r.transaction)),t}function xC(t){let e=t.originalUrl||t.url||"";if(e)return e.startsWith("/")&&(e=`http://dogs.are.great${e}`),t.query||new CC.URL(e).search.replace("?","")||void 0}hn.DEFAULT_USER_INCLUDES=Wg;hn.addRequestDataToEvent=kC;hn.extractPathForTransaction=ku;hn.extractRequestData=xu});var Mu=g(Uu=>{Object.defineProperty(Uu,"__esModule",{value:!0});var PC=T(),UC=Rr(),Pu={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"},hi=class t{static __initStatic(){this.id="RequestData"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._addRequestData=UC.addRequestDataToEvent,this._options={...Pu,...e,include:{method:!0,...Pu.include,...e.include,user:e.include&&typeof e.include.user=="boolean"?e.include.user:{...Pu.include.user,...(e.include||{}).user}}}}setupOnce(e,n){let{transactionNamingScheme:r}=this._options;e(s=>{let i=n(),o=i.getIntegration(t),{sdkProcessingMetadata:a={}}=s,c=a.request;if(!o||!c)return s;let u=a.requestDataOptionsFromExpressHandler||a.requestDataOptionsFromGCPWrapper||MC(this._options),d=this._addRequestData(s,c,u);if(s.type==="transaction"||r==="handler")return d;let p=c._sentryTransaction;if(p){let f=LC(i)==="sentry.javascript.nextjs"?p.name.startsWith("/api"):r!=="path",[m]=PC.extractPathForTransaction(c,{path:!0,method:f,customRoute:p.name});d.transaction=m}return d})}};hi.__initStatic();function MC(t){let{transactionNamingScheme:e,include:{ip:n,user:r,...s}}=t,i=[];for(let[a,c]of Object.entries(s))c&&i.push(a);let o;if(r===void 0)o=!0;else if(typeof r=="boolean")o=r;else{let a=[];for(let[c,u]of Object.entries(r))u&&a.push(c);o=a}return{include:{ip:n,user:o,request:i.length!==0?i:void 0,transaction:e}}}function LC(t){try{return t.getClient().getOptions()._metadata.sdk.name}catch{return}}Uu.RequestData=hi});var Gu=g(Cr=>{var{_optionalChain:O}=k();Object.defineProperty(Cr,"__esModule",{value:!0});var Lu=T(),qC=Ir(),FC=fn();function zg(t,e,n){let r=0,s=5,i=0;return setInterval(()=>{i===0?r>t&&(s*=2,n(s),s>86400&&(s=86400),i=s):(i-=1,i===0&&e()),r=0},1e3).unref(),()=>{r+=1}}function Fu(t){let e=[],n=!1;function r(o){e=[],!n&&(n=!0,t(o))}e.push(r);function s(o){e.push(o)}function i(o){let a=e.pop()||r;try{a(o)}catch{r(o)}}return{add:s,next:i}}var qu=class{constructor(){let{Session:e}=require("inspector");this._session=new e}configureAndConnect(e,n){this._session.connect(),this._session.on("Debugger.paused",r=>{e(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,n){this._getProperties(e,r=>{let{add:s,next:i}=Fu(n);for(let o of r)if(O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&O([o,"optionalAccess",a=>a.value,"access",a=>a.className])==="Array"){let a=o.value.objectId;s(c=>this._unrollArray(a,o.name,c,i))}else if(O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.className])==="Object"){let a=o.value.objectId;s(c=>this._unrollObject(a,o.name,c,i))}else(O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])||O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.description]))&&s(a=>this._unrollOther(o,a,i));i({})})}_getProperties(e,n){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(r,s)=>{n(r?[]:s.result)})}_unrollArray(e,n,r,s){this._getProperties(e,i=>{r[n]=i.filter(o=>o.name!=="length"&&!isNaN(parseInt(o.name,10))).sort((o,a)=>parseInt(o.name,10)-parseInt(a.name,10)).map(o=>O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])),s(r)})}_unrollObject(e,n,r,s){this._getProperties(e,i=>{r[n]=i.map(o=>[o.name,O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])]).reduce((o,[a,c])=>(o[a]=c,o),{}),s(r)})}_unrollOther(e,n,r){O([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.value])?n[e.name]=e.value.value:O([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.description])&&O([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.type])!=="function"&&(n[e.name]=`<${e.value.description}>`),r(n)}};function GC(){try{return new qu}catch{return}}function Vg(t){return t!==void 0&&["","?","<anonymous>"].includes(t)}function BC(t,e){return t===e||Vg(t)&&Vg(e)}function Xg(t){if(t!==void 0)return t.slice(-10).reduce((e,n)=>`${e},${n.function},${n.lineno},${n.colno}`,"")}function $C(t,e){if(e!==void 0)return Xg(t(e,1))}var mi=class t{static __initStatic(){this.id="LocalVariables"}__init(){this.name=t.id}__init2(){this._cachedFrames=new qC.LRUMap(20)}constructor(e={},n=GC()){this._options=e,this._session=n,t.prototype.__init.call(this),t.prototype.__init2.call(this)}setupOnce(e,n){this._setup(e,O([n,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]))}_setup(e,n){if(this._session&&O([n,"optionalAccess",r=>r.includeLocalVariables])){if((FC.NODE_VERSION.major||0)<18){Lu.logger.log("The `LocalVariables` integration is only supported on Node >= v18.");return}let s=this._options.captureAllExceptions!==!1;if(this._session.configureAndConnect((i,o)=>this._handlePaused(n.stackParser,i,o),s),s){let i=this._options.maxExceptionsPerSecond||50;this._rateLimiter=zg(i,()=>{Lu.logger.log("Local variables rate-limit lifted."),O([this,"access",o=>o._session,"optionalAccess",o=>o.setPauseOnExceptions,"call",o=>o(!0)])},o=>{Lu.logger.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${o} seconds.`),O([this,"access",a=>a._session,"optionalAccess",a=>a.setPauseOnExceptions,"call",a=>a(!1)])})}e(async i=>this._addLocalVariables(i))}}_handlePaused(e,{params:{reason:n,data:r,callFrames:s}},i){if(n!=="exception"&&n!=="promiseRejection"){i();return}O([this,"access",u=>u._rateLimiter,"optionalCall",u=>u()]);let o=$C(e,O([r,"optionalAccess",u=>u.description]));if(o==null){i();return}let{add:a,next:c}=Fu(u=>{this._cachedFrames.set(o,u),i()});for(let u=0;u<Math.min(s.length,5);u++){let{scopeChain:d,functionName:l,this:p}=s[u],f=d.find(E=>E.type==="local"),m=p.className==="global"||!p.className?l:`${p.className}.${l}`;if(O([f,"optionalAccess",E=>E.object,"access",E=>E.objectId])===void 0)a(E=>{E[u]={function:m},c(E)});else{let E=f.object.objectId;a(b=>O([this,"access",v=>v._session,"optionalAccess",v=>v.getLocalVariables,"call",v=>v(E,L=>{b[u]={function:m,vars:L},c(b)})]))}}c([])}_addLocalVariables(e){for(let n of O([e,"optionalAccess",r=>r.exception,"optionalAccess",r=>r.values])||[])this._addLocalVariablesToException(n);return e}_addLocalVariablesToException(e){let n=Xg(O([e,"optionalAccess",i=>i.stacktrace,"optionalAccess",i=>i.frames]));if(n===void 0)return;let r=this._cachedFrames.delete(n);if(r===void 0)return;let s=O([e,"access",i=>i.stacktrace,"optionalAccess",i=>i.frames,"optionalAccess",i=>i.length])||0;for(let i=0;i<s;i++){let o=s-i-1;if(!O([e,"optionalAccess",a=>a.stacktrace,"optionalAccess",a=>a.frames,"optionalAccess",a=>a[o]])||!r[i])break;r[i].vars===void 0||e.stacktrace.frames[o].in_app===!1||!BC(e.stacktrace.frames[o].function,r[i].function)||(e.stacktrace.frames[o].vars=r[i].vars)}}};mi.__initStatic();Cr.LocalVariables=mi;Cr.createCallbackList=Fu;Cr.createRateLimiter=zg});var Bu=g((We,t_)=>{var{_optionalChain:e_}=k();Object.defineProperty(We,"__esModule",{value:!0});var kt=N(),xt=T(),Jg=Ir(),Qg=fn();We.ChannelName=void 0;(function(t){let e="undici:request:create";t.RequestCreate=e;let n="undici:request:headers";t.RequestEnd=n;let r="undici:request:error";t.RequestError=r})(We.ChannelName||(We.ChannelName={}));var Ei=class t{static __initStatic(){this.id="Undici"}__init(){this.name=t.id}__init2(){this._createSpanUrlMap=new Jg.LRUMap(100)}__init3(){this._headersUrlMap=new Jg.LRUMap(100)}constructor(e={}){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),t.prototype.__init5.call(this),t.prototype.__init6.call(this),this._options={breadcrumbs:e.breadcrumbs===void 0?!0:e.breadcrumbs,shouldCreateSpanForRequest:e.shouldCreateSpanForRequest}}setupOnce(e){if(Qg.NODE_VERSION.major&&Qg.NODE_VERSION.major<16)return;let n;try{n=xt.dynamicRequire(t_,"diagnostics_channel")}catch{}!n||!n.subscribe||(n.subscribe(We.ChannelName.RequestCreate,this._onRequestCreate),n.subscribe(We.ChannelName.RequestEnd,this._onRequestEnd),n.subscribe(We.ChannelName.RequestError,this._onRequestError))}_shouldCreateSpan(e){if(this._options.shouldCreateSpanForRequest===void 0)return!0;let n=this._createSpanUrlMap.get(e);if(n!==void 0)return n;let r=this._options.shouldCreateSpanForRequest(e);return this._createSpanUrlMap.set(e,r),r}__init4(){this._onRequestCreate=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r}=e,s=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(s,n)||r.__sentry_span__!==void 0)return;let i=n.getClient();if(!i)return;let o=i.getOptions(),a=n.getScope(),c=a.getSpan(),u=this._shouldCreateSpan(s)?jC(c,r,s):void 0;if(u&&(r.__sentry_span__=u),(l=>{if(o.tracePropagationTargets===void 0)return!0;let p=this._headersUrlMap.get(l);if(p!==void 0)return p;let f=xt.stringMatchesSomePattern(l,o.tracePropagationTargets);return this._headersUrlMap.set(l,f),f})(s))if(u){let l=e_([u,"optionalAccess",f=>f.transaction,"optionalAccess",f=>f.getDynamicSamplingContext,"call",f=>f()]),p=xt.dynamicSamplingContextToSentryBaggageHeader(l);Zg(r,u.toTraceparent(),p)}else{let{traceId:l,sampled:p,dsc:f}=a.getPropagationContext(),m=xt.generateSentryTraceHeader(l,void 0,p),E=f||kt.getDynamicSamplingContextFromClient(l,i,a),b=xt.dynamicSamplingContextToSentryBaggageHeader(E);Zg(r,m,b)}}}__init5(){this._onRequestEnd=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r,response:s}=e,i=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(i,n))return;let o=r.__sentry_span__;o&&(o.setHttpStatus(s.statusCode),o.finish()),this._options.breadcrumbs&&n.addBreadcrumb({category:"http",data:{method:r.method,status_code:s.statusCode,url:i},type:"http"},{event:"response",request:r,response:s})}}__init6(){this._onRequestError=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r}=e,s=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(s,n))return;let i=r.__sentry_span__;i&&(i.setStatus("internal_error"),i.finish()),this._options.breadcrumbs&&n.addBreadcrumb({category:"http",data:{method:r.method,url:s},level:"error",type:"http"},{event:"error",request:r})}}};Ei.__initStatic();function Zg(t,e,n){t.__sentry_has_headers__||(t.addHeader("sentry-trace",e),n&&t.addHeader("baggage",n),t.__sentry_has_headers__=!0)}function jC(t,e,n){let r=xt.parseUrl(n),s=e.method||"GET",i={"http.method":s};return r.search&&(i["http.query"]=r.search),r.hash&&(i["http.fragment"]=r.hash),e_([t,"optionalAccess",o=>o.startChild,"call",o=>o({op:"http.client",origin:"auto.http.node.undici",description:`${s} ${xt.getSanitizedUrlString(r)}`,data:i})])}We.Undici=Ei});var $u=g(Mt=>{var{_optionalChain:HC}=k();Object.defineProperty(Mt,"__esModule",{value:!0});var Pt=N(),Ut=T(),YC=ru(),KC=Ag(),WC=Uc(),VC=du(),zC=gu(),XC=yu(),JC=Tu(),QC=Iu(),ZC=Ru(),eD=Ou(),tD=Nu(),nD=Mu(),rD=Gu(),sD=Bu(),iD=ei(),oD=zc(),n_=[new Pt.Integrations.InboundFilters,new Pt.Integrations.FunctionToString,new VC.Console,new zC.Http,new sD.Undici,new XC.OnUncaughtException,new JC.OnUnhandledRejection,new eD.ContextLines,new rD.LocalVariables,new tD.Context,new ZC.Modules,new nD.RequestData,new QC.LinkedErrors];function aD(t={}){YC.isAnrChildProcess()&&(t.autoSessionTracking=!1,t.tracesSampleRate=0);let e=Pt.getMainCarrier();KC.setNodeAsyncContextStrategy();let n=HC([e,"access",i=>i.__SENTRY__,"optionalAccess",i=>i.integrations])||[];t.defaultIntegrations=t.defaultIntegrations===!1?[]:[...Array.isArray(t.defaultIntegrations)?t.defaultIntegrations:n_,...n],t.dsn===void 0&&process.env.SENTRY_DSN&&(t.dsn=process.env.SENTRY_DSN);let r=process.env.SENTRY_TRACES_SAMPLE_RATE;if(t.tracesSampleRate===void 0&&r){let i=parseFloat(r);isFinite(i)&&(t.tracesSampleRate=i)}if(t.release===void 0){let i=r_();i!==void 0?t.release=i:t.autoSessionTracking=!1}t.environment===void 0&&process.env.SENTRY_ENVIRONMENT&&(t.environment=process.env.SENTRY_ENVIRONMENT),t.autoSessionTracking===void 0&&t.dsn!==void 0&&(t.autoSessionTracking=!0),t.instrumenter===void 0&&(t.instrumenter="sentry");let s={...t,stackParser:Ut.stackParserFromStackParserOptions(t.stackParser||s_),integrations:Pt.getIntegrationsToSetup(t),transport:t.transport||oD.makeNodeTransport};Pt.initAndBind(t.clientClass||WC.NodeClient,s),t.autoSessionTracking&&uD(),dD()}function cD(t){if(t===void 0)return!1;let e=t&&t.getOptions();return e&&e.autoSessionTracking!==void 0?e.autoSessionTracking:!1}function r_(t){return process.env.SENTRY_RELEASE?process.env.SENTRY_RELEASE:Ut.GLOBAL_OBJ.SENTRY_RELEASE&&Ut.GLOBAL_OBJ.SENTRY_RELEASE.id?Ut.GLOBAL_OBJ.SENTRY_RELEASE.id:process.env.GITHUB_SHA||process.env.COMMIT_REF||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA||t}var s_=Ut.createStackParser(Ut.nodeStackLineParser(iD.getModuleFromFilename));function uD(){let t=Pt.getCurrentHub();t.startSession(),process.on("beforeExit",()=>{let e=t.getScope().getSession();e&&!["exited","crashed"].includes(e.status)&&t.endSession()})}function dD(){let t=(process.env.SENTRY_USE_ENVIRONMENT||"").toLowerCase();if(!["false","n","no","off","0"].includes(t)){let e=process.env.SENTRY_TRACE,n=process.env.SENTRY_BAGGAGE,{propagationContext:r}=Ut.tracingContextFromHeaders(e,n);Pt.getCurrentHub().getScope().setPropagationContext(r)}}Mt.defaultIntegrations=n_;Mt.defaultStackParser=s_;Mt.getSentryRelease=r_;Mt.init=aD;Mt.isAutoSessionTrackingEnabled=cD});var i_=g(Hu=>{Object.defineProperty(Hu,"__esModule",{value:!0});var yi=require("fs"),ju=require("path");function lD(t){let e=ju.resolve(t);if(!yi.existsSync(e))throw new Error(`Cannot read contents of ${e}. Directory does not exist.`);if(!yi.statSync(e).isDirectory())throw new Error(`Cannot read contents of ${e}, because it is not a directory.`);let n=r=>yi.readdirSync(r).reduce((s,i)=>{let o=ju.join(r,i);return yi.statSync(o).isDirectory()?s.concat(n(o)):(s.push(o),s)},[]);return n(e).map(r=>ju.relative(e,r))}Hu.deepReadDirSync=lD});var a_=g(Si=>{Object.defineProperty(Si,"__esModule",{value:!0});var o_=Rr();function pD(t,e){return o_.extractRequestData(t,{include:e})}function fD(t,e,n={}){return o_.addRequestDataToEvent(t,e,{include:n})}Si.extractRequestData=pD;Si.parseRequest=fD});var u_=g(dt=>{var{_optionalChain:mn}=k();Object.defineProperty(dt,"__esModule",{value:!0});var Ee=N(),ut=T(),gD=Rr(),Ti=$u(),c_=a_();function _D(){return function(e,n,r){let s=Ee.getCurrentHub(),i=mn([s,"access",m=>m.getClient,"call",m=>m(),"optionalAccess",m=>m.getOptions,"call",m=>m()]);if(!i||i.instrumenter!=="sentry"||mn([e,"access",m=>m.method,"optionalAccess",m=>m.toUpperCase,"call",m=>m()])==="OPTIONS"||mn([e,"access",m=>m.method,"optionalAccess",m=>m.toUpperCase,"call",m=>m()])==="HEAD")return r();let o=e.headers&&ut.isString(e.headers["sentry-trace"])?e.headers["sentry-trace"]:void 0,a=mn([e,"access",m=>m.headers,"optionalAccess",m=>m.baggage]),{traceparentData:c,dynamicSamplingContext:u,propagationContext:d}=ut.tracingContextFromHeaders(o,a);if(s.getScope().setPropagationContext(d),!Ee.hasTracingEnabled(i))return r();let[l,p]=ut.extractPathForTransaction(e,{path:!0,method:!0}),f=Ee.startTransaction({name:l,op:"http.server",origin:"auto.http.node.tracingHandler",...c,metadata:{dynamicSamplingContext:c&&!u?{}:u,request:e,source:p}},{request:gD.extractRequestData(e)});s.configureScope(m=>{m.setSpan(f)}),n.__sentry_transaction=f,n.once("finish",()=>{setImmediate(()=>{ut.addRequestDataToTransaction(f,e),f.setHttpStatus(n.statusCode),f.finish()})}),r()}}function hD(t={}){let e;if("include"in t)e={include:t.include};else{let{ip:n,request:r,transaction:s,user:i}=t;(n||r||s||i)&&(e={include:ut.dropUndefinedKeys({ip:n,request:r,transaction:s,user:i})})}return e}function mD(t){let e=hD(t),n=Ee.getCurrentHub(),r=n.getClient();if(r&&Ti.isAutoSessionTrackingEnabled(r)){r.initSessionFlusher();let s=n.getScope();s.getSession()&&s.setSession()}return function(i,o,a){if(t&&t.flushTimeout&&t.flushTimeout>0){let c=o.end;o.end=function(u,d,l){Ee.flush(t.flushTimeout).then(()=>{c.call(this,u,d,l)}).then(null,p=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ut.logger.error(p),c.call(this,u,d,l)})}}Ee.runWithAsyncContext(()=>{let c=Ee.getCurrentHub();c.configureScope(u=>{u.setSDKProcessingMetadata({request:i,requestDataOptionsFromExpressHandler:e});let d=c.getClient();Ti.isAutoSessionTrackingEnabled(d)&&c.getScope().setRequestSession({status:"ok"})}),o.once("finish",()=>{let u=c.getClient();Ti.isAutoSessionTrackingEnabled(u)&&setImmediate(()=>{u&&u._captureRequestSession&&u._captureRequestSession()})}),a()})}}function ED(t){let e=t.status||t.statusCode||t.status_code||t.output&&t.output.statusCode;return e?parseInt(e,10):500}function yD(t){return ED(t)>=500}function SD(t){return function(n,r,s,i){if((t&&t.shouldHandleError||yD)(n)){Ee.withScope(a=>{a.setSDKProcessingMetadata({request:r});let c=s.__sentry_transaction;c&&a.getSpan()===void 0&&a.setSpan(c);let u=Ee.getCurrentHub().getClient();if(u&&Ti.isAutoSessionTrackingEnabled(u)&&u._sessionFlusher!==void 0){let p=a.getRequestSession();p&&p.status!==void 0&&(p.status="crashed")}a.addEventProcessor(l=>(ut.addExceptionMechanism(l,{type:"middleware",handled:!1}),l));let d=Ee.captureException(n);s.sentry=d,i(n)});return}i(n)}}function TD(t={}){return function({path:e,type:n,next:r,rawInput:s}){let i=Ee.getCurrentHub(),o=mn([i,"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]),a=i.getScope().getTransaction();if(a){a.setName(`trpc/${e}`,"route"),a.op="rpc.server";let c={procedure_type:n};(t.attachRpcInput!==void 0?t.attachRpcInput:mn([o,"optionalAccess",u=>u.sendDefaultPii]))&&(c.input=ut.normalize(s)),a.setContext("trpc",c)}return r()}}dt.extractRequestData=c_.extractRequestData;dt.parseRequest=c_.parseRequest;dt.errorHandler=SD;dt.requestHandler=mD;dt.tracingHandler=_D;dt.trpcMiddleware=TD});var d_=g(ne=>{Object.defineProperty(ne,"__esModule",{value:!0});var bD=du(),ID=gu(),AD=yu(),vD=Tu(),RD=Iu(),CD=Ru(),DD=Ou(),OD=Nu(),ND=Mu(),wD=Gu(),kD=Bu();ne.Console=bD.Console;ne.Http=ID.Http;ne.OnUncaughtException=AD.OnUncaughtException;ne.OnUnhandledRejection=vD.OnUnhandledRejection;ne.LinkedErrors=RD.LinkedErrors;ne.Modules=CD.Modules;ne.ContextLines=DD.ContextLines;ne.Context=OD.Context;ne.RequestData=ND.RequestData;ne.LocalVariables=wD.LocalVariables;ne.Undici=kD.Undici});var l_=g(Ve=>{Object.defineProperty(Ve,"__esModule",{value:!0});var Lt=Nc();Ve.Apollo=Lt.Apollo;Ve.Express=Lt.Express;Ve.GraphQL=Lt.GraphQL;Ve.Mongo=Lt.Mongo;Ve.Mysql=Lt.Mysql;Ve.Postgres=Lt.Postgres;Ve.Prisma=Lt.Prisma});var p_=g(A=>{Object.defineProperty(A,"__esModule",{value:!0});var R=N(),xD=jf(),PD=Uc(),UD=zc(),bi=$u(),Yu=Rr(),MD=i_(),LD=ei(),qD=ru(),FD=u_(),GD=d_(),BD=l_(),$D={...R.Integrations,...GD,...BD};A.Hub=R.Hub;A.SDK_VERSION=R.SDK_VERSION;A.Scope=R.Scope;A.addBreadcrumb=R.addBreadcrumb;A.addGlobalEventProcessor=R.addGlobalEventProcessor;A.addIntegration=R.addIntegration;A.captureCheckIn=R.captureCheckIn;A.captureEvent=R.captureEvent;A.captureException=R.captureException;A.captureMessage=R.captureMessage;A.close=R.close;A.configureScope=R.configureScope;A.continueTrace=R.continueTrace;A.createTransport=R.createTransport;A.extractTraceparentData=R.extractTraceparentData;A.flush=R.flush;A.getActiveSpan=R.getActiveSpan;A.getActiveTransaction=R.getActiveTransaction;A.getCurrentHub=R.getCurrentHub;A.getHubFromCarrier=R.getHubFromCarrier;A.lastEventId=R.lastEventId;A.makeMain=R.makeMain;A.runWithAsyncContext=R.runWithAsyncContext;A.setContext=R.setContext;A.setExtra=R.setExtra;A.setExtras=R.setExtras;A.setMeasurement=R.setMeasurement;A.setTag=R.setTag;A.setTags=R.setTags;A.setUser=R.setUser;A.spanStatusfromHttpCode=R.spanStatusfromHttpCode;A.startActiveSpan=R.startActiveSpan;A.startInactiveSpan=R.startInactiveSpan;A.startSpan=R.startSpan;A.startSpanManual=R.startSpanManual;A.startTransaction=R.startTransaction;A.trace=R.trace;A.withScope=R.withScope;A.autoDiscoverNodePerformanceMonitoringIntegrations=xD.autoDiscoverNodePerformanceMonitoringIntegrations;A.NodeClient=PD.NodeClient;A.makeNodeTransport=UD.makeNodeTransport;A.defaultIntegrations=bi.defaultIntegrations;A.defaultStackParser=bi.defaultStackParser;A.getSentryRelease=bi.getSentryRelease;A.init=bi.init;A.DEFAULT_USER_INCLUDES=Yu.DEFAULT_USER_INCLUDES;A.addRequestDataToEvent=Yu.addRequestDataToEvent;A.extractRequestData=Yu.extractRequestData;A.deepReadDirSync=MD.deepReadDirSync;A.getModuleFromFilename=LD.getModuleFromFilename;A.enableAnrDetection=qD.enableAnrDetection;A.Handlers=FD;A.Integrations=$D});var h,Ku=Te(()=>{"use strict";h={GATEWAY_STARTED:"Gateway started",GATEWAY_STOPPED:"Gateway stopped",BOOTSTRAP_APPLIED:"Bootstrap applied",CHANNEL_READY:"Channel ready",CONVERSATION_STARTED:"Conversation started",EVALUATE_CONVERSATION_STARTED:"Evaluate conversation started",CONVERSATION_DELETED:"Conversation deleted",PENDING_CONVERSATION_DENIED:"Pending conversation denied",AGENTS_REFRESHED:"Agents refreshed",USER_DISPATCHED:"User dispatched",SESSION_DISPATCHED:"Session dispatched",SYNC_TICK_COMPLETED:"Sync tick completed",INBOUND_HANDLER_ENTERED:"Inbound handler entered",MESSAGE_RECEIVED:"Message received",MESSAGE_SENT:"Message sent",INBOUND_BUYER_PENDING:"Inbound buyer: no session, group still Unknown (pending)",INBOUND_BUYER_SESSION_AUTO_RECOVERED:"Inbound buyer: session missing for Allowed group, auto-recovered",INBOUND_BLOCKED_SENSITIVE:"Inbound blocked: sensitive word; reply sent",INBOUND_BLOCKED_ADDRESS_MISMATCH:"Inbound blocked: address mismatch",INBOUND_BLOCKED_INELIGIBLE:"Inbound blocked: message-eligible check failed",INBOUND_DROP_EMPTY_CONTENT:"Inbound drop: empty content",INBOUND_DROP_MISSING_JOBID:"Inbound drop: missing jobId",INBOUND_DROP_UNSUPPORTED_MSGTYPE:"Inbound drop: unsupported msgType",INBOUND_DROP_DM_NON_SYSTEM:"Inbound drop: DM sender not in system whitelist",INBOUND_DROP_DM_INVALID_PAYLOAD:"Inbound drop: DM payload invalid",INBOUND_DROP_DM_UNKNOWN_AGENT:"Inbound drop: DM target agent not local",DM_FALLBACK_TO_BACKUP:"DM fallback to backup session",DM_WHITELIST_FAIL_OPEN:"DM whitelist fail-open (empty system accounts)",FILE_UPLOADED:"File uploaded",FILE_DOWNLOADED:"File downloaded",PENDING_LIST_QUERIED:"Pending list queried",AGENT_LIST_QUERIED:"Agent list queried",SESSION_KEY_DERIVED:"Session key derived",CONVERSATION_HISTORY_QUERIED:"Conversation history queried",SESSIONS_QUERIED:"Sessions queried",GROUP_CONSENT_CHANGED:"Group consent changed",SESSION_CREATED:"Session created",SESSION_DELETED:"Session deleted",SESSION_AUTO_RECOVERED:"Session auto-recovered",INBOUND_DELIVERED:"Inbound delivered to session",DM_DELIVERED:"DM delivered to session",OUTBOUND_ELIGIBILITY_CHECKED:"Outbound eligibility checked",AGENT_CLIENT_CREATED:"Agent client created",AGENT_CLIENT_REMOVED:"Agent client removed",ADDRESS_SYNC_COMPLETED:"Address sync completed",AGENT_REFRESH_SESSION_EXPIRED:"Agent refresh aborted: onchainos session expired, local clients taken offline",OFFLINE_REPLAY_MESSAGE_REPLAYED:"Offline replay message replayed",AGENTS_WAKEUP_NOTIFIED:"Agents wakeup notified",CONFIG_SENSITIVE_WORDS_REFRESHED:"Sensitive words config refreshed",CONFIG_SYSTEM_REFRESHED:"System config refreshed",FORCED_UPDATE_STARTED:"Forced update started",FORCED_UPDATE_SUCCEEDED:"Forced update succeeded",GATEWAY_DISCONNECTED:"Gateway disconnected",GATEWAY_REQUEST:"Gateway request",GATEWAY_DELIVERY_BUFFERED:"Gateway delivery buffered",DAEMON_LIFECYCLE_SKIPPED:"Daemon lifecycle skipped",DAEMON_LIFECYCLE_REQUESTED:"Daemon lifecycle requested",PROMPT_USER_CHECKPOINT:"Prompt user checkpoint",USER_WATCH_STARTED:"User watch started",USER_WATCH_EVENT_DELIVERED:"User watch event delivered",INBOUND_DM_RAW:"Inbound DM raw",INBOUND_GROUP_RAW:"Inbound group raw",SYSTEM_NOTIFICATION_RECEIVED:"System notification received",SYSTEM_NOTIFICATION_ROUTED:"System notification routed",HERMES_SESSION_ROUTE_BINDING:"Hermes session route binding",XMTP_CONNECTION_FAILED:"XMTP connection failed",CONVERSATIONS_STREAM_FAILED:"conversations.stream failed",AGENT_START_FAILED:"agent.start failed",AGENT_STREAM_ERROR:"agent stream error",BOOTSTRAP_FAILED:"Bootstrap failed",ONCHAINOS_SESSION_EXPIRED:"Onchainos session expired",ONCHAINOS_CLI_ERROR:"Onchainos CLI error",HEARTBEAT_FAILED:"Heartbeat failed",MESSAGE_PARSE_FAILED:"Message parse failed",MESSAGE_HANDLER_ERROR:"Message handler error",OFFLINE_REPLAY_FAILED:"Offline replay failed",INBOUND_ROUTING_FAILED:"Inbound routing failed",CONVERSATION_NOT_FOUND:"Conversation not found for send",XMTP_SEND_FAILED:"XMTP send failed",AGENT_REFRESH_FAILED:"Agent refresh failed",GROUP_CONSENT_UPDATE_FAILED:"Group consent update failed",TOOL_EXECUTE_FAILED:"Tool execute failed",AGENT_RESOLUTION_FAILED:"Agent resolution failed",USER_DISPATCH_FAILED:"User dispatch failed",INBOUND_ELIGIBILITY_BYPASSED:"Inbound eligibility bypassed",INBOUND_ADDRESS_CHECK_FAILED:"Inbound address check failed",INBOUND_ADDRESS_CHECK_BYPASSED:"Inbound address check bypassed",INBOUND_SENSITIVE_CHECK_FAILED:"Inbound sensitive check failed",FILE_UPLOAD_FAILED:"File upload failed",FILE_DOWNLOAD_FAILED:"File download failed",OFFLINE_REPLAY_MESSAGE_FAILED:"Offline replay message failed",PENDING_NOTIFICATION_FAILED:"Pending notification failed",GATEWAY_CONNECT_FAILED:"Gateway connect failed",GATEWAY_REQUEST_FAILED:"Gateway request failed",PROMPT_USER_FAILED:"Prompt user failed",DAEMON_COMMAND_FAILED:"Daemon command failed",DAEMON_COMMAND_TIMEOUT:"Daemon command timeout",DAEMON_COMMAND_STALE:"Daemon command stale",DAEMON_LIFECYCLE_FAILED:"Daemon lifecycle failed",DAEMON_TICK_FAILED:"Daemon tick failed",DIRECT_CLI_FAILED:"Direct CLI failed",AI_RUN_FAILED:"AI run failed",AI_RUN_TIMEOUT:"AI run timeout",AI_RUN_TOOL_FAILED:"AI run tool failed",IPC_FAILED:"IPC failed",NOTIFY_AGENTS_WAKEUP_FAILED:"Notify agents wakeup failed",OUTBOUND_AGENT_LOOKUP_FAILED:"Outbound agent lookup failed",OUTBOUND_ELIGIBILITY_CHECK_FAILED:"Outbound eligibility check failed",OUTBOUND_ELIGIBILITY_BYPASSED:"Outbound eligibility bypassed",OUTBOUND_BLOCKED_INELIGIBLE:"Outbound blocked: message-eligible check failed",CACHE_LOAD_FAILED:"Cache load failed",CACHE_WRITE_FAILED:"Cache write failed",CONFIG_LOAD_FAILED:"Config load failed",FORCED_UPDATE_FAILED:"Forced update failed",SENTRY_INIT_SKIPPED:"Sentry init skipped",AGENT_DB_DIR_CREATE_FAILED:"Agent DB dir create failed"}});var z,h_,f_,g_,jD,HD,YD,KD,WD,Ii,__,Wu,I,m_,E_,re=Te(()=>{"use strict";ee();z=Lh(p_()),h_=require("node:crypto");Ku();Ku();f_=(0,h_.randomUUID)(),g_=new Set(["args","apikey","argv","auth","authorization","authtoken","bearer","body","cache","command","content","credential","credentials","cwd","data","error","failures","filename","file_name","filepath","file_path","headers","input","logpath","message","output","password","params","path","payload","privatekey","prompt","raw","rawevent","rawtext","request","response","accesstoken","refreshtoken","digest","nonce","salt","secret","token","stderr","stdout","title","tooloutput"]),jD=["accesstoken","apikey","authorization","authtoken","content","credential","filepath","logpath","outputpath","password","payload","privatekey","prompt","rawevent","rawtext","refreshtoken","requestbody","responsebody","secret","stderr","stdout","token","tooloutput"],HD=new Set(["onchainosagentlistresultjson","onchainosagentlistdiagnostictext"]),YD=new Set(["agentPlatform","cacheName","checkpoint","code","communicationClass","component","eventName","exitCode","kind","method","onchainosAgentId","operation","phase","platform","provider","reason","role","source","stage","status","subcommand","taskId","type"]),KD=["eventName","cacheName","checkpoint","component","method","operation","phase","reason","code","provider","type","kind","status","subcommand"],WD=new Set([h.GATEWAY_STARTED,h.GATEWAY_STOPPED,h.GATEWAY_DISCONNECTED,h.GATEWAY_REQUEST,h.GATEWAY_DELIVERY_BUFFERED,h.DAEMON_LIFECYCLE_SKIPPED,h.DAEMON_LIFECYCLE_REQUESTED,h.PROMPT_USER_CHECKPOINT,h.USER_WATCH_STARTED,h.USER_WATCH_EVENT_DELIVERED,h.CHANNEL_READY,h.CONVERSATION_STARTED,h.EVALUATE_CONVERSATION_STARTED,h.CONVERSATION_DELETED,h.USER_DISPATCHED,h.SESSION_DISPATCHED,h.SESSION_CREATED,h.SESSION_DELETED,h.SESSION_AUTO_RECOVERED,h.INBOUND_DELIVERED,h.INBOUND_DM_RAW,h.INBOUND_GROUP_RAW,h.SYSTEM_NOTIFICATION_RECEIVED,h.SYSTEM_NOTIFICATION_ROUTED,h.HERMES_SESSION_ROUTE_BINDING,h.INBOUND_BLOCKED_ADDRESS_MISMATCH,h.INBOUND_BLOCKED_INELIGIBLE,h.INBOUND_BLOCKED_SENSITIVE,h.INBOUND_DROP_DM_INVALID_PAYLOAD,h.INBOUND_DROP_DM_NON_SYSTEM,h.INBOUND_DROP_DM_UNKNOWN_AGENT,h.INBOUND_DROP_EMPTY_CONTENT,h.INBOUND_DROP_MISSING_JOBID,h.INBOUND_DROP_UNSUPPORTED_MSGTYPE,h.DM_DELIVERED,h.DM_FALLBACK_TO_BACKUP,h.DM_WHITELIST_FAIL_OPEN,h.INBOUND_BUYER_PENDING,h.INBOUND_BUYER_SESSION_AUTO_RECOVERED,h.MESSAGE_SENT,h.AGENT_CLIENT_CREATED,h.AGENT_CLIENT_REMOVED,h.ADDRESS_SYNC_COMPLETED,h.AGENTS_REFRESHED,h.AGENTS_WAKEUP_NOTIFIED,h.AGENT_LIST_QUERIED,h.BOOTSTRAP_APPLIED,h.CONFIG_SENSITIVE_WORDS_REFRESHED,h.CONFIG_SYSTEM_REFRESHED,h.FORCED_UPDATE_STARTED,h.FORCED_UPDATE_SUCCEEDED,h.CONVERSATION_HISTORY_QUERIED,h.FILE_DOWNLOADED,h.FILE_UPLOADED,h.GROUP_CONSENT_CHANGED,h.INBOUND_HANDLER_ENTERED,h.MESSAGE_RECEIVED,h.OFFLINE_REPLAY_MESSAGE_REPLAYED,h.AGENT_REFRESH_SESSION_EXPIRED,h.OUTBOUND_ELIGIBILITY_CHECKED,h.OUTBOUND_BLOCKED_INELIGIBLE,h.PENDING_CONVERSATION_DENIED,h.PENDING_LIST_QUERIED,h.SESSION_KEY_DERIVED,h.SESSIONS_QUERIED,h.SYNC_TICK_COMPLETED]),Ii=256,__=128,Wu=class t{static instance;initialized=!1;buffer=[];constructor(){}static getInstance(){return t.instance||(t.instance=new t),t.instance}init(e){if(this.initialized){_d("[logger] Already initialized, skipping.");return}try{z.init({dsn:e.dsn,release:e.release,environment:e.environment,maxBreadcrumbs:0,beforeBreadcrumb:()=>null,isInner:!1}),z.setTags({projectName:e.projectName,agentPlatform:e.agentPlatform})}catch{return}this.initialized=!0,this.flush()}info(e,n){let r=t.sanitizeExtra({flowId:f_,...n??{}});if(WD.has(e)){if(!this.initialized){this.buffer.push({level:"info",message:e,extra:r});return}try{z.withScope(s=>{t.applyDiagnostics(s,e,r),z.captureEvent({level:"info",message:e,extra:{...r,eventName:e}})})}catch{}}}error(e,n,r){let s=t.sanitizeExtra({flowId:f_,...r??{}});if(!this.initialized){this.buffer.push({level:"error",message:e,error:n,extra:s});return}try{z.withScope(i=>{i.setLevel("error"),t.applyDiagnostics(i,e,s),z.captureException(t.createSentryEvent(e),{extra:n?{...s,eventName:e,errorName:n.name,errorMessageLength:String(n.message.length)}:s})})}catch{}}async shutdown(){try{await z.close(5e3)}catch{await z.flush(5e3)}}flush(){for(;this.buffer.length>0;){let e=this.buffer.shift();e.level==="info"?this.info(e.message,e.extra):this.error(e.message,e.error,e.extra)}}static sanitizeExtra(e){return Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0).filter(([n])=>!t.isBlockedExtraKey(n)).map(([n,r])=>[n,t.safeValueForKey(n,r)]))}static isBlockedExtraKey(e){let n=e.toLowerCase(),r=t.normalizeSensitiveKey(e);return g_.has(n)||g_.has(r)?!0:t.isSafeMetricKey(r)?!1:jD.some(s=>r.includes(s))}static isSafeMetricKey(e){return/(bytes|count|length|ms|size)$/.test(e)}static safeValueForKey(e,n){return typeof n=="string"&&HD.has(t.normalizeSensitiveKey(e))?n:t.safeValue(n)}static normalizeSensitiveKey(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}static safeValue(e){if(typeof e=="string")return e.length<=Ii?e:`${e.slice(0,Ii)}...`;if(e==null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e instanceof Error)return{name:e.name,messageLength:e.message.length};if(Array.isArray(e))return e.slice(0,20).map(r=>t.safeValue(r));if(typeof e=="object")return Object.fromEntries(Object.entries(e).slice(0,50).filter(([,r])=>r!==void 0).filter(([r])=>!t.isBlockedExtraKey(r)).map(([r,s])=>[r,t.safeValueForKey(r,s)]));let n=String(e);return n.length<=Ii?n:`${n.slice(0,Ii)}...`}static tagValue(e){let n=String(e);return n.length<=__?n:`${n.slice(0,__)}...`}static normalizeTagKey(e){return e.replace(/[^A-Za-z0-9_.:-]+/g,"_").slice(0,32)||"unknown"}static applyDiagnostics(e,n,r){let s={eventName:n,...r};for(let[o,a]of Object.entries(s))YD.has(o)&&e.setTag(t.normalizeTagKey(o),t.tagValue(a));let i=["a2a",n];for(let o of KD){let a=s[o];a&&i.push(`${o}:${t.tagValue(a)}`)}e.setFingerprint(i)}static toPascalCase(e){return e.split(/[\s:]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}static createSentryEvent(e){let n=new Error(e);return n.name=t.toPascalCase(e),n.stack=`${n.name}: ${e}`,n}},I=Wu.getInstance(),m_=t=>I.init(t),E_=()=>I.shutdown()});function Vu(){return En||(process.env.OKX_AGENT_TASK_HOME?(En=Ai(process.env.OKX_AGENT_TASK_HOME),En):(En=Ai((0,vi.join)(XD(),".okx-agent-task")),En))}function Ai(t){return zD(t)}function zD(t){(0,Ri.mkdirSync)(t,{recursive:!0,mode:S_});try{(0,Ri.chmodSync)(t,S_)}catch(e){let n=e.code;if(n!=="EPERM"&&n!=="EACCES")throw e}return t}function XD(){try{let t=(0,T_.homedir)();if(t)return t}catch(t){}return(0,vi.resolve)(process.cwd())}var T_,vi,Ri,En,S_,b_=Te(()=>{"use strict";T_=require("node:os"),vi=require("node:path"),Ri=require("node:fs"),En=null,S_=448});function JD(t=Vu()){return(0,I_.join)(t,"openclaw-gateway.json")}function A_(t,e=Vu()){let n=Ai(e),r=JD(n),s=`${r}.${process.pid}.tmp`,i={version:1,url:t.url,...t.password?{password:t.password}:{},...t.token?{token:t.token}:{},updatedAt:new Date().toISOString(),source:"openclaw-plugin"};(0,ze.writeFileSync)(s,`${JSON.stringify(i,null,2)}
|
|
34
|
-
`,{encoding:"utf8",mode:384});try{(0,ze.chmodSync)(s,384)}catch{}(0,ze.renameSync)(s,r);try{(0,ze.chmodSync)(r,384)}catch{}return r}var ze,I_,v_=Te(()=>{"use strict";ze=require("node:fs"),I_=require("node:path");b_()});function C_(t){return t.includes(Di)||t.includes(`:${Oi}:`)}function R_(t){return t.toLowerCase().startsWith("0x")}function QD(t){if(typeof t=="string")return`${Di}:${t}`;let e="myAgentId"in t&&"toAgentId"in t?new URLSearchParams({my:t.myAgentId,to:t.toAgentId,job:t.jobId}):new URLSearchParams({my:t.myXmtpAddress,to:t.toXmtpAddress,job:t.jobId});return`${Di}:${e.toString()}`}function Xu(t){let e=`${Di}:`,n=t.indexOf(e);if(n===-1)return null;let r=new URLSearchParams(t.slice(n+e.length)),s=r.get("myAgentId")||r.get("myagentid"),i=r.get("toAgentId")||r.get("toagentid"),o=r.get("my"),a=r.get("to"),c=r.get("job"),u=r.get("gid");return s&&i&&c?{format:"agent",myAgentId:s,toAgentId:i,jobId:c,xmtpGroupId:u??""}:!o||!a||!c?null:!R_(o)&&(a==="_"||!R_(a))?{format:"agent",myAgentId:o,toAgentId:a,jobId:c,xmtpGroupId:u??""}:{format:"address",myXmtpAddress:o,toXmtpAddress:a,jobId:c,xmtpGroupId:u??""}}function zu(t){if(!t)return"";let e=Xu(t);return e?.jobId?e.jobId:/(?:^|:)backup:([^:&]+)/.exec(t)?.[1]??""}function Or(t){let e=t.taskId?.trim()||zu(t.scopeKey)||zu(t.sessionKey);return e?{taskId:e}:{}}function ZD(t){let e=typeof t=="string"?t:QD(t);return(0,Dr.buildAgentSessionKey)({agentId:"main",channel:Oi,peer:{kind:"group",id:e}})}function D_(){let n=Je().config.loadConfig().agents?.list;if(n&&n.length>0){let r=n.find(s=>s.id==="main");return r?r.id:n[0].id}return"main"}function O_(){return(0,Dr.buildAgentSessionKey)({agentId:D_(),channel:Oi,peer:{kind:"group",id:"backup"}})}function eO(t){return(0,Dr.buildAgentSessionKey)({agentId:D_(),channel:Oi,peer:{kind:"group",id:`backup:${t}`}})}function Ni(){let t=Je(),e=t.agent.session.resolveStorePath(void 0,{agentId:"main"}),n=t.agent.session.loadSessionStore(e,{skipCache:!0}),r=new Map,s=new Map;function i(c){if(!(!c||c==="direct"||c==="@direct"))return c.startsWith("telegram:")||c.startsWith("@")?c:`telegram:${c}`}function o(c,u){let d=c.split(":");if(u==="telegram"){let l=d.indexOf("telegram"),p=l>=0?d.slice(l+1):d.slice(3),f=p.indexOf("direct");if(f>=0){let m=f>0?p[f-1]:void 0,E=p[f+1]==="telegram"&&p[f+2]?`telegram:${p[f+2]}`:p[f+1];return{to:i(E),accountId:m}}if(p[0]==="telegram"&&p[1])return{to:`telegram:${p[1]}`,accountId:void 0};if(p[1]==="telegram"&&p[2])return{to:`telegram:${p[2]}`,accountId:p[0]};if(p.length>=2)return{to:i(p[1]),accountId:p[0]};if(p.length===1)return{to:i(p[0]),accountId:void 0}}return{to:d[4],accountId:void 0}}function a(c,u){return typeof c!="string"||c==="direct"||c==="@direct"?u:c}for(let[c,u]of Object.entries(n)){if(C_(c))continue;let d=u;if(d.spawnedBy||d.subagentRole)continue;let l=d.deliveryContext?.channel??d.lastChannel??d.origin?.provider;if(!l)continue;let p=o(c,l),f=a(d.deliveryContext?.to,p.to)??a(d.lastTo,p.to)??p.to,m=d.deliveryContext?.accountId??p.accountId,E=d.lastInteractionAt??d.updatedAt??0;f&&(!s.get(l)||E>(r.get(l)?.updatedAt??0))&&s.set(l,f);let b=r.get(l);(!b||E>b.updatedAt)&&r.set(l,{sessionKey:c,to:f,accountId:m,updatedAt:E})}for(let[c,u]of r)if(!u.to){let d=s.get(c);d&&(u.to=d)}for(let[c,u]of r)y(`[findLatestUserSessions] channel=${c} winner=${u.sessionKey} to=${u.to??"(none)"} accountId=${u.accountId??"(none)"} interactedAt=${u.updatedAt}`);return r}function N_(t){let e=new Set,n=[...t.sessionKey?[t.sessionKey]:[],...Array.isArray(t.sessionKeys)?t.sessionKeys:[]].filter(s=>s.trim()),r=[];t.jobId&&r.push({jobId:t.jobId,myAgentId:t.myAgentId,toAgentId:t.toAgentId,myXmtpAddress:t.myXmtpAddress,toXmtpAddress:t.toXmtpAddress});for(let s of n){if(s.startsWith("agent:")){e.add(s);continue}let i=sO(s);if(i){e.add(eO(i));continue}let o=w_(s);if(o){r.push(o);continue}let a=Xu(s);if(a){r.push(rO(a));continue}e.add(ZD(s))}for(let s of tO())for(let i of r)if(nO(s,i)){e.add(s);break}return[...e].sort()}function tO(){let t=Je(),e=t.agent.session.resolveStorePath(void 0,{agentId:"main"}),n=t.agent.session.loadSessionStore(e,{skipCache:!0});return Object.keys(n).filter(C_)}function nO(t,e){let n=Xu(t);if(n)return iO(n,e);let r=w_(t);return r?!(e.jobId&&r.jobId!==e.jobId||e.myAgentId&&r.myAgentId!==e.myAgentId||e.toAgentId&&r.toAgentId!==e.toAgentId||e.myXmtpAddress&&!e.myAgentId||e.toXmtpAddress&&!e.toAgentId):!e.jobId||e.myAgentId||e.toAgentId||e.myXmtpAddress||e.toXmtpAddress?!1:zu(t)===e.jobId}function rO(t){return"myAgentId"in t?{myAgentId:t.myAgentId,toAgentId:t.toAgentId,jobId:t.jobId}:{myXmtpAddress:t.myXmtpAddress,toXmtpAddress:t.toXmtpAddress,jobId:t.jobId}}function w_(t){let e=t.split(":"),n=e.indexOf("job");return n<0||e[n+2]!=="my"||e[n+4]!=="to"||!e[n+1]||!e[n+3]||!e[n+5]?null:{jobId:Ci(e[n+1]),myAgentId:Ci(e[n+3]),toAgentId:Ci(e[n+5])}}function sO(t){return t.startsWith("backup:")?Ci(t.slice(7)):null}function iO(t,e){return e.jobId&&t.jobId!==e.jobId?!1:"myAgentId"in t?!(e.myAgentId&&t.myAgentId!==e.myAgentId||e.toAgentId&&t.toAgentId!==e.toAgentId||e.myXmtpAddress&&!e.myAgentId||e.toXmtpAddress&&!e.toAgentId):!(e.myXmtpAddress&&t.myXmtpAddress.toLowerCase()!==e.myXmtpAddress.toLowerCase()||e.toXmtpAddress&&t.toXmtpAddress.toLowerCase()!==e.toXmtpAddress.toLowerCase()||e.myAgentId&&!e.myXmtpAddress||e.toAgentId&&!e.toXmtpAddress)}function Ci(t){try{return decodeURIComponent(t)}catch{return t}}var Dr,Di,Oi,Nr=Te(()=>{"use strict";ee();Dr=require("openclaw/plugin-sdk/routing");vn();Di="okx-xmtp",Oi="okx-a2a"});function Ju(t){if(t){if(typeof t=="string")return t;if(typeof t=="object"&&t!==null&&"env"in t)return process.env[t.env]||void 0}}function cO(t){return t&&(typeof t=="string"?{type:"string",configured:!0}:typeof t=="object"&&t!==null&&"env"in t?{type:"env",env:String(t.env),configured:!!Ju(t)}:{type:typeof t,configured:!0})}function Qu(t){if(!t||typeof t!="object")return t??null;if(Array.isArray(t))return t.map(n=>Qu(n));let e={};for(let[n,r]of Object.entries(t)){if(/password|token|secret/i.test(n)){e[n]=cO(r);continue}e[n]=Qu(r)}return e}function uO(t){try{return JSON.stringify(t)}catch{return"[unserializable]"}}function dO(t){let e=t.params;if(!e||typeof e!="object"||Array.isArray(e))return Or({taskId:t.taskId});let n=e;return Or({taskId:t.taskId,sessionKey:typeof n.sessionKey=="string"?n.sessionKey:typeof n.key=="string"?n.key:""})}function L_(t){let e={};for(let[n,r]of Object.entries(t))r!=null&&(e[n]=String(r));return e}function ye(t,e={}){let n=L_({phase:t,...e});y(`[gateway] ${t}: ${JSON.stringify(n)}`),I.info(t.startsWith("request_")?h.GATEWAY_REQUEST:h.GATEWAY_STARTED,{component:"openclaw_gateway",...n})}function Sn(t,e,n={},r=h.GATEWAY_CONNECT_FAILED){let s=L_({phase:t,component:"openclaw_gateway",...n});y(`[gateway] ${t}:`,e),I.error(r,e instanceof Error?e:new Error(String(e)),s)}function lO(t){for(let e of Zu)try{e(t)}catch(n){y("[gateway] event handler failed:",n)}}function q_(t){return Zu.add(t),()=>{Zu.delete(t)}}function x_(){ye("ready_gate_reset",{hasSharedClient:!!Pe,hasConnected:xe}),yn=new Promise((t,e)=>{wi=t,ki=e})}function P_(t,e,n){if(Pe!==t){ye(`${e}_skip_clear_noncurrent`,n);return}try{t.stop?.()}catch(r){Sn(`${e}_stop_failed`,r,n)}Pe=null,xe=!1,yn=null,wi=null,ki=null,ye(`${e}_cleared_client`,n)}function pO(){if(Pe)return ye("reuse_client",{hasConnected:xe,hasReadyPromise:!!yn}),{client:Pe,ready:yn};let t=F_(),{url:e,password:n,token:r}=t,s=(0,ed.randomUUID)(),i=++aO;x_(),ye("init_client",{clientSeq:i,instanceId:s,url:e,hasGatewayConfig:!!t.rawGatewayConfig,gatewayConfig:uO(Qu(t.rawGatewayConfig)),passwordConfigured:!!n,tokenConfigured:!!r,scopes:k_.join(",")});let o=new M_.GatewayClient({url:e,password:n,token:r,instanceId:s,clientName:"gateway-client",clientDisplayName:"okx-a2a-plugin",mode:"backend",role:"operator",scopes:[...k_],onHelloOk:()=>{ye("hello_ok",{clientSeq:i,instanceId:s,url:e}),xe=!0,wi?.()},onEvent:lO,onClose:(a,c)=>{if(y(`[gateway] closed (${a}): ${c||"no reason"}`),I.info(h.GATEWAY_DISCONNECTED,{clientSeq:String(i),instanceId:s,url:e,code:String(a),reason:c||"no-reason",hadConnected:String(xe)}),xe){xe=!1,x_();return}P_(o,"close_before_connect",{clientSeq:i,instanceId:s,url:e,code:a,reason:c||"no-reason"})},onConnectError:a=>{let c=a;if(c?.retryable){Sn("connect_error_retryable",a,{clientSeq:i,instanceId:s,url:e,retryable:"true",reason:c?.details?.reason??"retryable",code:c?.gatewayCode??c?.details?.code});return}Sn("connect_error",a,{clientSeq:i,instanceId:s,url:e,retryable:"false",code:c?.gatewayCode??c?.details?.code}),ki?.(a instanceof Error?a:new Error(String(a))),P_(o,"connect_error",{clientSeq:i,instanceId:s,url:e,code:c?.gatewayCode??c?.details?.code,reason:c?.details?.reason})}});return Pe=o,ye("start_client",{clientSeq:i,instanceId:s,url:e}),o.start(),{client:o,ready:yn}}function F_(){let e=Je().config.loadConfig().gateway;return{url:`ws://127.0.0.1:${e?.port??18789}`,password:Ju(e?.auth?.password),token:Ju(e?.auth?.token),rawGatewayConfig:e}}function G_(){let t=F_();try{let e=A_({url:t.url,password:t.password,token:t.token});return ye("synced_node_gateway_config",{path:e,url:t.url,passwordConfigured:!!t.password,tokenConfigured:!!t.token}),e}catch(e){return Sn("sync_node_gateway_config_failed",e,{url:t.url,passwordConfigured:!!t.password,tokenConfigured:!!t.token},h.GATEWAY_CONNECT_FAILED),null}}function B_(){if(Pe){try{Pe.stop()}catch{}Pe=null,yn=null,wi=null,ki=null,xe=!1}}function td(t){let e=t,n=e?.gatewayCode??e?.details?.code;if(!n)return null;let r=e?.details??{},s=[`code=${n}`];r.reason&&s.push(`reason=${r.reason}`),r.authReason&&s.push(`authReason=${r.authReason}`),Array.isArray(r.requestedScopes)&&r.requestedScopes.length&&s.push(`requestedScopes=${r.requestedScopes.join(",")}`),r.deviceId&&s.push(`deviceId=${r.deviceId}`),r.requestId&&s.push(`requestId=${r.requestId}`);let i=` (${s.join(", ")})`;switch(n){case"NOT_PAIRED":case"PAIRING_REQUIRED":return`Device pairing approval pending${i}. On the openclaw host run \`openclaw devices approve --latest\` to review and approve the pending request, then retry.`;case"AUTH_SCOPE_MISMATCH":return`Existing device token lacks the required scope${i}. On the openclaw host run \`openclaw devices list\` to find the operator deviceId, then \`openclaw devices rotate --device <id> --role operator --scope operator.admin\` to reissue a token with operator.admin, and restart openclaw.`;case"AUTH_TOKEN_MISSING":case"AUTH_TOKEN_MISMATCH":case"AUTH_DEVICE_TOKEN_MISMATCH":return`Gateway device token is missing or stale${i}. On the openclaw host run \`openclaw devices list\`, then \`openclaw devices remove <deviceId>\`, then restart openclaw to re-pair.`;default:return null}}async function Xe(t){let e=t.timeoutMs??oO,n=Date.now(),r=dO(t);ye("request_start",{method:t.method,timeoutMs:e,hasSharedClient:!!Pe,hasConnected:xe,...r});let{client:s,ready:i}=pO();try{await i}catch(a){let c=Date.now()-n;throw Sn("request_ready_failed",a,{method:t.method,durationMs:c,timeoutMs:e,...r,code:a?.gatewayCode??a?.code??a?.details?.code,reason:"gateway_ready_failed",communicationClass:"openclaw_gateway_connect"},h.GATEWAY_REQUEST_FAILED),a}let o=Date.now()-n;ye("request_ready",{method:t.method,readyWaitMs:o,timeoutMs:e,hasConnected:xe,...r});try{let a=await s.request(t.method,t.params,{timeoutMs:e});return ye("request_done",{method:t.method,durationMs:Date.now()-n,timeoutMs:e,...r}),a}catch(a){let c=Date.now()-n,u=/timeout|timed out/i.test(String(a?.message??a??""));Sn("request_error",a,{method:t.method,durationMs:c,timeoutMs:e,readyWaitMs:o,...r,isTimeout:u,code:a?.gatewayCode??a?.code??a?.details?.code,reason:u?"gateway_request_timeout":"gateway_request_error",communicationClass:"openclaw_gateway_rpc"},h.GATEWAY_REQUEST_FAILED);let d=td(a);if(d){let l=a?.message??String(a);try{a.message=`${l}
|
|
35
|
-
${d}`}catch{}}throw a}}async function xi(t){return Xe({method:"sessions.create",params:t})}async function $_(t){return Xe({method:"sessions.delete",params:t})}async function wr(t){let e=t.idempotencyKey??(0,ed.randomUUID)(),n={key:t.key,message:t.message,idempotencyKey:e};try{let r=await Xe({method:"sessions.send",params:n});return{runId:U_(r),raw:r}}catch(r){let s=r?.gatewayCode??r?.code,i=String(r?.message??"");if(s==="INVALID_REQUEST"&&i.includes("session not found")){await xi({key:t.key}),I.info(h.SESSION_AUTO_RECOVERED,{sessionKey:t.key,trigger:"sessions.send"});let o=await Xe({method:"sessions.send",params:n});return{runId:U_(o),raw:o}}throw r}}function U_(t){if(!t||typeof t!="object")return;let e=t.runId;return typeof e=="string"&&e.trim()?e:void 0}async function kr(t){try{return await Xe({method:"chat.inject",params:t})}catch(e){let n=e?.gatewayCode??e?.code,r=String(e?.message??"");if(n==="INVALID_REQUEST"&&r.includes("session not found"))return await xi({key:t.sessionKey}),I.info(h.SESSION_AUTO_RECOVERED,{sessionKey:t.sessionKey,trigger:"chat.inject"}),await Xe({method:"chat.inject",params:t});throw e}}var M_,ed,oO,k_,aO,Pe,yn,wi,ki,xe,Zu,Tn=Te(()=>{"use strict";ee();M_=require("openclaw/plugin-sdk/gateway-runtime"),ed=require("node:crypto");vn();re();v_();Nr();oO=2e4,k_=["operator.admin"],aO=0;Pe=null,yn=null,wi=null,ki=null,xe=!1,Zu=new Set});var W_={};fd(W_,{isPromptUserSessionRunning:()=>fO,markPromptUserSessionEnded:()=>id,markPromptUserSessionRunning:()=>sd,queuePromptUserAction:()=>gO});function qt(t){let e=H_.get(t);return e||(e={running:!1,processing:!1,queue:[]},H_.set(t,e)),e}function nd(t,e,n){t.fallbackTimer&&(clearTimeout(t.fallbackTimer),t.fallbackTimer=void 0,e&&y(`[xmtp_prompt_user:queue] fallback cleared sessionKey=${e}${n?` reason=${n}`:""}`))}function rd(t,e){nd(e,t,"reschedule");let n=e.queue[0];if(!n||e.processing)return;let r=Math.max(0,n.deadlineAt-Date.now());y(`[xmtp_prompt_user:queue] fallback scheduled sessionKey=${t} channel=${n.channel} delayMs=${r} queued=${e.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"fallback_scheduled",sessionKey:t,channel:n.channel,taskId:n.taskId,delayMs:r,queued:e.queue.length})),e.fallbackTimer=setTimeout(()=>{let s=qt(t);s.fallbackTimer=void 0,y(`[xmtp_prompt_user:queue] fallback fired sessionKey=${t} queued=${s.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"fallback_fired",sessionKey:t,taskId:s.queue[0]?.taskId,queued:s.queue.length,reason:"fallback_timeout"})),Pr(t,"fallback_timeout")},r)}async function Pr(t,e){let n=qt(t);if(n.processing)return;let r=n.queue.shift();if(!r){nd(n,t,"empty_queue"),y(`[xmtp_prompt_user:queue] dispatch skipped empty sessionKey=${t} reason=${e}`);return}nd(n,t,e),n.processing=!0;try{y(`[xmtp_prompt_user:queue] dispatch sessionKey=${t} channel=${r.channel} reason=${e} remaining=${n.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"dispatch_started",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,queued:n.queue.length}));let s=await V_({...r,onRunStarted:i=>{let o=Pi.get(i);if(o){y(`[xmtp_prompt_user:queue] run already completed sessionKey=${t} channel=${r.channel} runId=${i} state=${o.state} completedAt=${o.completedAt}`),Pi.delete(i);return}xr.set(i,{sessionKey:t,channel:r.channel,taskId:r.taskId,startedAt:Date.now()}),y(`[xmtp_prompt_user:queue] run pending sessionKey=${t} channel=${r.channel} runId=${i}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"run_pending",sessionKey:t,channel:r.channel,taskId:r.taskId,runId:i}))}});n.running=!s.runId||xr.has(s.runId),y(`[xmtp_prompt_user:queue] dispatch completed sessionKey=${t} channel=${r.channel} reason=${e} running=${n.running?1:0} runId=${s.runId??"(none)"}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"dispatch_completed",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,running:n.running?1:0,runId:s.runId,queued:n.queue.length}))}catch(s){y(`[xmtp_prompt_user:queue] dispatch failed sessionKey=${t} channel=${r.channel} reason=${e}:`,s),I.error(h.PROMPT_USER_FAILED,s instanceof Error?s:new Error(String(s)),lt({checkpoint:"dispatch_failed",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,queued:n.queue.length}))}finally{n.processing=!1}if(n.queue.length===0){y(`[xmtp_prompt_user:queue] queue drained sessionKey=${t}`);return}if(n.running){y(`[xmtp_prompt_user:queue] queue waiting sessionKey=${t} queued=${n.queue.length} running=1`),rd(t,n);return}y(`[xmtp_prompt_user:queue] queue continues sessionKey=${t} queued=${n.queue.length} running=0`),Pr(t,"session_idle")}function fO(t){return qt(t).running}async function gO(t){let e=t.target.sessionKey,n=qt(e);return n.queue.push({...t,deadlineAt:Date.now()+K_}),n.running||n.processing||n.queue.length>1?(n.queue.length===1&&rd(e,n),y(`[xmtp_prompt_user:queue] queued sessionKey=${e} channel=${t.channel} size=${n.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"queued",sessionKey:e,channel:t.channel,taskId:t.taskId,queued:n.queue.length,running:n.running?1:0,processing:n.processing?1:0})),{status:"queued",size:n.queue.length}):(await Pr(e,"session_idle"),{status:"dispatched",size:n.queue.length})}function sd(t){let e=qt(t);e.running=!0;let n=e.queue[0];n&&(n.deadlineAt=Date.now()+K_,y(`[xmtp_prompt_user:queue] fallback reset sessionKey=${t} channel=${n.channel} queued=${e.queue.length}`),rd(t,e)),y(`[xmtp_prompt_user:queue] agent_start sessionKey=${t} queued=${e.queue.length}`)}function id(t){let e=qt(t),n=_O(t);if(n.length>0){y(`[xmtp_prompt_user:queue] agent_end sessionKey=${t} queued=${e.queue.length} pendingRunIds=${n.join(",")} waiting=run_final`);return}e.running=!1,y(`[xmtp_prompt_user:queue] agent_end sessionKey=${t} queued=${e.queue.length}`),e.queue.length>0&&Pr(t,"agent_end")}function _O(t){let e=[];for(let[n,r]of xr)r.sessionKey===t&&e.push(n);return e}function Y_(t,e,n){Pi.set(t,{state:e,sessionKey:n,completedAt:Date.now()}),setTimeout(()=>{Pi.delete(t)},60*1e3)}function hO(t,e,n,r,s){let i=qt(t);i.running=!1,y(`[xmtp_prompt_user:queue] run completed sessionKey=${t} runId=${e} state=${n} durationMs=${r} queued=${i.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"run_completed",sessionKey:t,taskId:s,runId:e,status:n,durationMs:r,queued:i.queue.length})),i.queue.length>0&&Pr(t,`run_${n}`)}function lt(t){return Object.entries({component:"openclaw_prompt_user_queue",operation:"xmtp_prompt_user",checkpoint:t.checkpoint,sessionKey:t.sessionKey,channel:t.channel??"",taskId:t.taskId??"",runId:t.runId??"",reason:t.reason??"",status:t.status??"",queued:t.queued??"",delayMs:t.delayMs??"",durationMs:t.durationMs??"",running:t.running??"",processing:t.processing??""}).filter(([,n])=>n!=="").reduce((n,[r,s])=>(n[r]=String(s),n),{})}var K_,H_,xr,Pi,od=Te(()=>{"use strict";ee();Ui();Tn();re();K_=300*1e3,H_=new Map,xr=new Map,Pi=new Map;q_(t=>{let e=t;if(e.event!=="chat"||!e.payload||typeof e.payload!="object")return;let n=e.payload,r=typeof n.runId=="string"?n.runId:"";if(!r)return;let s=typeof n.state=="string"?n.state:"",i=xr.get(r);if(!i){(s==="final"||s==="error")&&Y_(r,s,String(n.sessionKey??""));return}y(`[xmtp_prompt_user:queue] observed chat event runId=${r} state=${s||"(none)"} sessionKey=${String(n.sessionKey??"")}`),!(s!=="final"&&s!=="error")&&(xr.delete(r),Y_(r,s,String(n.sessionKey??"")),hO(i.sessionKey,r,s,Date.now()-i.startedAt,i.taskId))})});async function V_(t){let{channel:e,target:n,llmContent:r,userContent:s}=t,i=await wr({key:n.sessionKey,message:r});if(i.runId?t.onRunStarted?.(i.runId):y(`[xmtp_prompt_user:queue] sessions.send returned without runId sessionKey=${n.sessionKey} channel=${e}`),n.to&&!z_.has(e)){let o={to:n.to,message:s,channel:e,sessionKey:n.sessionKey,idempotencyKey:(0,Mi.randomUUID)()};return n.accountId&&(o.accountId=n.accountId),await Xe({method:"send",params:o}),{runId:i.runId}}return await kr({sessionKey:n.sessionKey,message:s}),{runId:i.runId}}async function Li(t){let e=Ni();if(e.size===0)return y("[okx-a2a:gateway-method] dispatch_user no deliverable user session found"),{ok:!1,dispatched:[],failed:[]};let n=[],r=[],s=t.label?`[${t.label}] ${t.content}`:t.content;for(let[i,o]of e)if(!ad.has(i))try{if(o.to&&!z_.has(i)){let a={to:o.to,message:s,channel:i,sessionKey:o.sessionKey,idempotencyKey:(0,Mi.randomUUID)()};o.accountId&&(a.accountId=o.accountId),await Xe({method:"send",params:a})}else await kr({sessionKey:o.sessionKey,message:t.content,label:t.label});n.push({channel:i,sessionKey:o.sessionKey}),y(`[okx-a2a:gateway-method] dispatch_user delivered channel=${i} sessionKey=${o.sessionKey}`)}catch(a){let c=a instanceof Error?a.message:String(a);r.push({channel:i,sessionKey:o.sessionKey,error:c}),y(`[okx-a2a:gateway-method] dispatch_user failed channel=${i} sessionKey=${o.sessionKey}: ${c}`),I.error(h.USER_DISPATCH_FAILED,a instanceof Error?a:new Error(String(a)),{source:"okx-a2a.dispatch_user",channel:i,sessionKey:o.sessionKey,hasTo:o.to?"1":"0"})}return{ok:n.length>0&&r.length===0,dispatched:n,failed:r}}async function qi(t){let{queuePromptUserAction:e}=await Promise.resolve().then(()=>(od(),W_)),n=Ni();if(n.size===0)return y("[okx-a2a:gateway-method] prompt_user no deliverable user session found"),{ok:!1,dispatched:[],failed:[]};let r=[],s=[];for(let[i,o]of n)if(!ad.has(i))try{let a=await e({channel:i,target:o,llmContent:t.llmContent,userContent:t.userContent});r.push({channel:i,sessionKey:o.sessionKey,status:a.status,size:a.size}),y(`[okx-a2a:gateway-method] prompt_user ${a.status} channel=${i} sessionKey=${o.sessionKey} size=${a.size}`)}catch(a){let c=a instanceof Error?a.message:String(a);s.push({channel:i,sessionKey:o.sessionKey,error:c}),y(`[okx-a2a:gateway-method] prompt_user failed channel=${i} sessionKey=${o.sessionKey}: ${c}`),I.error(h.PROMPT_USER_FAILED,a instanceof Error?a:new Error(String(a)),{source:"okx-a2a.prompt_user",channel:i,sessionKey:o.sessionKey})}return{ok:r.length>0&&s.length===0,dispatched:r,failed:s}}async function X_(t,e){let n=Ni();if(n.size===0)return y("[sendLlmToLatestUserSessions] no latest user session found"),{dispatched:[],failed:[]};let r=[],s=[];for(let[i,o]of n)if(!ad.has(i))try{await Je().subagent.run({sessionKey:o.sessionKey,message:t,deliver:!0,idempotencyKey:(0,Mi.randomUUID)()}),r.push(i),y(`[sendLlmToLatestUserSessions] sent to ${i} sessionKey=${o.sessionKey}`)}catch(a){s.push(i),y(`[sendLlmToLatestUserSessions] send to ${i} failed:`,a),I.error(h.USER_DISPATCH_FAILED,a instanceof Error?a:new Error(String(a)),{source:e?.source??"sendLlmToLatestUserSessions",channel:i,sessionKey:o.sessionKey})}return{dispatched:r,failed:s}}var Mi,ad,z_,Ui=Te(()=>{"use strict";ee();Mi=require("node:crypto");Tn();Nr();re();vn();ad=new Set(["heartbeat","cron","webhook","voice"]),z_=new Set(["webchat","tui"])});var KO={};fd(KO,{default:()=>YO});module.exports=qh(KO);ee();vn();ee();re();var VD="main",y_={id:"okx-a2a",meta:{id:"okx-a2a",label:"OKX A2A",selectionLabel:"OKX A2A",docsPath:"channels/okx-a2a",blurb:"E2E encrypted communication (wallet-to-agent)",order:101},capabilities:{chatTypes:["group"],media:!1,reply:!0},reload:{configPrefixes:["channels.okx-a2a"]},config:{resolveAccount:async()=>({}),listAccountIds:()=>[VD]},outbound:{deliveryMode:"direct"},gateway:{startAccount:async t=>{t.setStatus({accountId:t.accountId,connected:!0,lastConnectedAt:Date.now(),lastEventAt:Date.now()}),y(`[okx-a2a:${t.accountId}] startAccount activated`),await new Promise(e=>{t.abortSignal.addEventListener("abort",()=>e(),{once:!0})}),y(`[okx-a2a:${t.accountId}] received abort signal, cleaning up...`)},stopAccount:async()=>{y("[okx-a2a] stopAccount"),await E_()}}};ee();Tn();Nr();re();var j_=async t=>{let e=N_(t),n=[];for(let r of e)await $_({key:r,...t.deleteTranscript!==void 0?{deleteTranscript:t.deleteTranscript}:{}}),n.push(r),y(`[okx-a2a] session deleted: ${r}`),I.info(h.SESSION_DELETED,{sessionKey:r,...Or({sessionKey:r})});return{ok:!0,deleted:n.length,deletedSessionKeys:n,matched:e.length}};Tn();Nr();Ui();od();ee();var J_=require("node:os"),cd=require("node:path"),Q_=require("node:fs");Tn();Ui();re();var mO=15e3,EO=50;function yO(t=process.env){return t.OKX_AGENT_TASK_HOME?.trim()||(0,cd.join)((0,J_.homedir)(),".okx-agent-task")}function SO(t=process.env){return t.OKX_A2A_OUTBOX_DB_PATH?.trim()||(0,cd.join)(yO(t),"sqlite","session-store.sqlite")}function TO(){let t=process.emitWarning;process.emitWarning=((e,...n)=>{if(!((typeof e=="string"?e:e.message).includes("SQLite is an experimental feature")&&n.some(s=>s==="ExperimentalWarning")))return t.call(process,e,...n)});try{return require("node:sqlite")}finally{process.emitWarning=t}}async function bO(t){let e=t.message_id??void 0;if(t.kind==="dispatch_user_latest"){let n=await Li({content:t.content});if(!n.ok)throw new Error(`dispatch_user_latest delivered=${n.dispatched.length} failed=${n.failed.length}`);return}if(t.kind==="prompt_user_latest"){if(!t.llm_content)throw new Error("prompt_user_latest missing llm_content");let n=await qi({userContent:t.content,llmContent:t.llm_content});if(!n.ok)throw new Error(`prompt_user_latest delivered=${n.dispatched.length} failed=${n.failed.length}`);return}if(t.kind==="chat_inject"){await kr({sessionKey:t.session_key,message:t.content}),t.llm_content&&await wr({key:t.session_key,message:t.llm_content,idempotencyKey:e});return}await wr({key:t.session_key,message:t.content,idempotencyKey:e})}async function IO(t={}){let e=t.dbPath??SO();if(!(0,Q_.existsSync)(e))return{delivered:0,failed:0,skipped:!0};let{DatabaseSync:n}=TO(),r=new n(e);try{if(r.exec("PRAGMA busy_timeout=5000"),r.exec("PRAGMA journal_mode=WAL"),!r.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='pending_gateway_deliveries'").get())return{delivered:0,failed:0,skipped:!0};let i=r.prepare(`
|
|
28
|
+
`)),E=+m.split(" ")[1];Sr("got proxy server response: %o",m),e({statusCode:E,buffered:p})}t.on("error",u),t.on("close",a),t.on("end",c),i()})}Tr.default=kv});var cg=g(Ct=>{"use strict";var Pv=Ct&&Ct.__awaiter||function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(l){o(l)}}function c(d){try{u(r.throw(d))}catch(l){o(l)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},pn=Ct&&Ct.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ct,"__esModule",{value:!0});var og=pn(require("net")),ag=pn(require("tls")),xv=pn(require("url")),Uv=pn(require("assert")),Mv=pn(Qs()),Lv=sg(),qv=pn(ig()),br=Mv.default("https-proxy-agent:agent"),jc=class extends Lv.Agent{constructor(e){let n;if(typeof e=="string"?n=xv.default.parse(e):n=e,!n)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");br("creating new HttpsProxyAgent instance: %o",n),super(n);let r=Object.assign({},n);this.secureProxy=n.secureProxy||Bv(r.protocol),r.host=r.hostname||r.host,typeof r.port=="string"&&(r.port=parseInt(r.port,10)),!r.port&&r.host&&(r.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in r)&&(r.ALPNProtocols=["http 1.1"]),r.host&&r.path&&(delete r.path,delete r.pathname),this.proxy=r}callback(e,n){return Pv(this,void 0,void 0,function*(){let{proxy:r,secureProxy:s}=this,i;s?(br("Creating `tls.Socket`: %o",r),i=ag.default.connect(r)):(br("Creating `net.Socket`: %o",r),i=og.default.connect(r));let o=Object.assign({},r.headers),c=`CONNECT ${`${n.host}:${n.port}`} HTTP/1.1\r
|
|
29
|
+
`;r.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(r.auth).toString("base64")}`);let{host:u,port:d,secureEndpoint:l}=n;Gv(d,l)||(u+=`:${d}`),o.Host=u,o.Connection="close";for(let b of Object.keys(o))c+=`${b}: ${o[b]}\r
|
|
30
|
+
`;let p=qv.default(i);i.write(`${c}\r
|
|
31
|
+
`);let{statusCode:f,buffered:m}=yield p;if(f===200){if(e.once("socket",Fv),n.secureEndpoint){br("Upgrading socket connection to TLS");let b=n.servername||n.host;return ag.default.connect(Object.assign(Object.assign({},$v(n,"host","hostname","path","port")),{socket:i,servername:b}))}return i}i.destroy();let E=new og.default.Socket({writable:!1});return E.readable=!0,e.once("socket",b=>{br("replaying proxy buffer for failed request"),Uv.default(b.listenerCount("data")>0),b.push(m),b.push(null)}),E})}};Ct.default=jc;function Fv(t){t.resume()}function Gv(t,e){return!!(!e&&t===80||e&&t===443)}function Bv(t){return typeof t=="string"?/^https:?$/i.test(t):!1}function $v(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}});var dg=g((Kc,ug)=>{"use strict";var jv=Kc&&Kc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Hc=jv(cg());function Yc(t){return new Hc.default(t)}(function(t){t.HttpsProxyAgent=Hc.default,t.prototype=Hc.default.prototype})(Yc||(Yc={}));ug.exports=Yc});var zc=g(Vc=>{var{_nullishCoalesce:Wc}=k();Object.defineProperty(Vc,"__esModule",{value:!0});var lg=N(),Hv=require("http"),Yv=require("https"),Kv=dg(),Wv=require("stream"),pg=require("url"),Vv=require("zlib"),zv=1024*32;function Xv(t){return new Wv.Readable({read(){this.push(t),this.push(null)}})}function Jv(t){let e;try{e=new pg.URL(t.url)}catch{return console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used."),lg.createTransport(t,()=>Promise.resolve({}))}let n=e.protocol==="https:",r=Qv(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),s=n?Yv:Hv,i=t.keepAlive===void 0?!1:t.keepAlive,o=r?new Kv.HttpsProxyAgent(r):new s.Agent({keepAlive:i,maxSockets:30,timeout:2e3}),a=Zv(t,Wc(t.httpModule,()=>s),o);return lg.createTransport(t,a)}function Qv(t,e){let{no_proxy:n}=process.env;if(!(n&&n.split(",").some(s=>t.host.endsWith(s)||t.hostname.endsWith(s))))return e}function Zv(t,e,n){let{hostname:r,pathname:s,port:i,protocol:o,search:a}=new pg.URL(t.url);return function(u){return new Promise((d,l)=>{let p=Xv(u.body),f={...t.headers};u.body.length>zv&&(f["content-encoding"]="gzip",p=p.pipe(Vv.createGzip()));let m=e.request({method:"POST",agent:n,headers:f,hostname:r,path:`${s}${a}`,port:i,protocol:o,ca:t.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let b=Wc(E.headers["retry-after"],()=>null),v=Wc(E.headers["x-sentry-rate-limits"],()=>null);d({statusCode:E.statusCode,headers:{"retry-after":b,"x-sentry-rate-limits":Array.isArray(v)?v[0]:v}})});m.on("error",l),p.pipe(m)})}}Vc.makeNodeTransport=Jv});var ei=g(Xc=>{Object.defineProperty(Xc,"__esModule",{value:!0});var fg=require("path"),eR=fg.sep==="\\";function tR(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function nR(t,e=eR){if(!t)return;let n=e?tR(t):t,{root:r,dir:s,base:i,ext:o}=fg.posix.parse(n),c=`${require&&require.main&&require.main.filename&&s||global.process.cwd()}/`,u=i;(o===".js"||o===".mjs"||o===".cjs")&&(u=u.slice(0,o.length*-1)),!r&&!s&&(s=".");let d=s.lastIndexOf("/node_modules/");if(d>-1)return`${s.slice(d+14).replace(/\//g,".")}:${u}`;if(d=`${s}/`.lastIndexOf(c,0),d===0){let l=s.slice(c.length).replace(/\//g,".");return l&&(l+=":"),l+=u,l}return u}Xc.getModuleFromFilename=nR});var _g=g(eu=>{Object.defineProperty(eu,"__esModule",{value:!0});var Zc=require("crypto"),rR=require("events"),sR=require("http"),iR=require("url"),ti={CONTINUATION:0,TEXT:1,BINARY:2,TERMINATE:8,PING:9,PONG:10},oR="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";function gg(t){return Buffer.byteLength(t.payload)>=t.payloadLength}function Jc(t,e,n){if(e===void 0)return t;for(let r=0;r<t.length;r++)t[r]^=e[n+r&3];return t}function aR(t){let{opcode:e,fin:n,data:r}=t,s=6,i=r.length;i>=65536?(s+=8,i=127):i>125&&(s+=2,i=126);let o=Buffer.allocUnsafe(s);o[0]=n?e|128:e,o[1]=i,i===126?o.writeUInt16BE(r.length,2):i===127&&(o.writeUInt32BE(0,2),o.writeUInt32BE(r.length,6));let a=Zc.randomBytes(4);o[1]|=128,o[s-4]=a[0],o[s-3]=a[1],o[s-2]=a[2],o[s-1]=a[3];let c=Buffer.alloc(i);for(let u=0;u<i;++u)c[u]=r[u]^a[u&3];return Buffer.concat([o,c])}function cR(t){let e=t.readUInt8(0),n=!!(e>>>7&1),r=e&15,s=t.readUInt8(1),i=!!(s>>>7&1),o=2,a=s&127;if(a>125)if(a===126)a=t.readUInt16BE(o),o+=2;else if(a===127){let d=t.readUInt32BE(o);if(o+=4,d>=Number.MAX_SAFE_INTEGER)throw new Error("Unsupported WebSocket frame: payload length > 2^53 - 1");let l=t.readUInt32BE(o);o+=4,a=d*Math.pow(2,32)+l}else throw new Error("Unknown payload length");let c;i&&(c=t.slice(o,o+4),o+=4);let u=Jc(t.slice(o),c,0);return{fin:n,opcode:r,mask:c,payload:u,payloadLength:a}}function uR(t){return Zc.createHash("sha1").update(`${t}${oR}`).digest("base64")}var Qc=class extends rR.EventEmitter{constructor(e){super(),this._unfinishedFrame=void 0,this._incompleteFrame=void 0,this._socket=e,this._alive=!0,e.on("data",n=>{this._addBuffer(n)}),e.on("error",n=>{n.code==="ECONNRESET"?this.emit("close"):this.emit("error")}),e.on("close",()=>{this.end()})}end(){this._alive&&(this._alive=!1,this.emit("close"),this._socket.end())}send(e){this._sendFrame({opcode:ti.TEXT,fin:!0,data:Buffer.from(e)})}_sendFrame(e){this._socket.write(aR(e))}_completeFrame(e){let{_unfinishedFrame:n}=this;if(n!==void 0)if(e.opcode===ti.CONTINUATION){n.payload=Buffer.concat([n.payload,Jc(e.payload,n.mask,n.payload.length)]),e.fin&&(this._unfinishedFrame=void 0,this._completeFrame(n));return}else this._unfinishedFrame=void 0;if(e.fin)if(e.opcode===ti.PING)this._sendFrame({opcode:ti.PONG,fin:!0,data:e.payload});else{let r;e.payload.length>e.payloadLength&&(r=e.payload.slice(e.payloadLength),e.payload=e.payload.slice(0,e.payloadLength)),this.emit("message",e.payload),r!==void 0&&this._addBuffer(r)}else this._unfinishedFrame=e}_addBufferToIncompleteFrame(e,n){e.payload=Buffer.concat([e.payload,Jc(n,e.mask,e.payload.length)]),gg(e)&&(this._incompleteFrame=void 0,this._completeFrame(e))}_addBuffer(e){let{_incompleteFrame:n}=this;if(n!==void 0){this._addBufferToIncompleteFrame(n,e);return}let r=cR(e);gg(r)?this._completeFrame(r):this._incompleteFrame=r}};async function dR(t){let e=iR.parse(t);return new Promise((n,r)=>{let s=Zc.randomBytes(16).toString("base64"),i=uR(s),o=sR.request({hostname:e.hostname,port:e.port,path:e.path,method:"GET",headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Key":s,"Sec-WebSocket-Version":"13"}});o.on("response",a=>{a.statusCode&&a.statusCode>=400&&process.stderr.write(`Unexpected HTTP code: ${a.statusCode}
|
|
32
|
+
`),a.pipe(process.stderr)}),o.on("upgrade",(a,c)=>{if(a.headers["sec-websocket-accept"]!==i){c.end(),r(new Error(`Digest mismatch ${i} !== ${a.headers["sec-websocket-accept"]}`));return}let u=new Qc(c);n(u)}),o.on("error",a=>{r(a)}),o.end()})}eu.createWebSocketClient=dR});var hg=g(tu=>{Object.defineProperty(tu,"__esModule",{value:!0});var lR=T(),pR=ei(),fR=_g();async function gR(t,e){let n=0,r=await fR.createWebSocketClient(t);return r.on("message",s=>{let i=JSON.parse(s.toString());e(i)}),s=>{r.send(JSON.stringify({id:n++,method:s}))}}async function _R(t,e){let n=await gR(t,lR.createDebugPauseMessageHandler(r=>n(r),pR.getModuleFromFilename,e));return()=>{n("Debugger.enable"),n("Debugger.pause")}}tu.captureStackTrace=_R});var ru=g(ri=>{Object.defineProperty(ri,"__esModule",{value:!0});var ni=T(),hR=require("child_process"),mR=hg(),nu=N(),ER=50,yR=5e3;function mg(t,e){let n={level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${t} ms`,stacktrace:{frames:e},mechanism:{type:"ANR"}}]}};nu.captureEvent(n),nu.flush(3e3).then(()=>{process.exit()})}function SR(t=9229){let e=require("inspector"),n,r=t;for(;n===void 0&&r<t+100;)e.open(r),n=e.url(),r++;return n}function TR(t){function e(n,...r){ni.logger.log(`[ANR] ${n}`,...r)}try{let n={...process.env};n.SENTRY_ANR_CHILD_PROCESS="true",t.captureStackTrace&&(n.SENTRY_INSPECT_URL=SR()),e(`Spawning child process with execPath:'${process.execPath}' and entryScript'${t.entryScript}'`);let r=hR.spawn(process.execPath,[t.entryScript],{env:n,stdio:ni.logger.isEnabled()?["inherit","inherit","inherit","ipc"]:["ignore","ignore","ignore","ipc"]});r.unref();let s=setInterval(()=>{try{r.send("ping")}catch{}},t.pollInterval),i=o=>(...a)=>{clearInterval(s),e(`Child process ${o}`,...a)};r.on("error",i("error")),r.on("disconnect",i("disconnect")),r.on("exit",i("exit"))}catch(n){e("Failed to start child process",n)}}function bR(){let t=process.hrtime();return{getTimeMs:()=>{let[e,n]=process.hrtime(t);return Math.floor(e*1e3+n/1e6)},reset:()=>{t=process.hrtime()}}}function IR(t){function e(i){ni.logger.log(`[ANR child process] ${i}`)}process.title="sentry-anr",e("Started"),nu.addGlobalEventProcessor(i=>(delete i.sdkProcessingMetadata,i.tags={...i.tags,"process.name":"ANR"},i));let n;process.env.SENTRY_INSPECT_URL&&(e("Connecting to debugger"),n=mR.captureStackTrace(process.env.SENTRY_INSPECT_URL,i=>{e("Capturing event with stack frames"),mg(t.anrThreshold,i)}));async function r(){e("Watchdog timeout");let i=await n;i?(e("Pausing debugger to capture stack trace"),i()):(e("Capturing event"),mg(t.anrThreshold))}let{poll:s}=ni.watchdogTimer(bR,t.pollInterval,t.anrThreshold,r);process.on("message",()=>{s()})}function Eg(){return!!process.send&&!!process.env.SENTRY_ANR_CHILD_PROCESS}function AR(t){let n={entryScript:t.entryScript||process.env.pm_exec_path||process.argv[1],pollInterval:t.pollInterval||ER,anrThreshold:t.anrThreshold||yR,captureStackTrace:!!t.captureStackTrace,debug:!!t.debug};return Eg()?(IR(n),new Promise(()=>{})):(TR(n),Promise.resolve())}ri.enableAnrDetection=AR;ri.isAnrChildProcess=Eg});var fn=g(su=>{Object.defineProperty(su,"__esModule",{value:!0});var vR=T(),RR=vR.parseSemver(process.versions.node);su.NODE_VERSION=RR});var Tg=g(iu=>{var{_optionalChain:CR}=k();Object.defineProperty(iu,"__esModule",{value:!0});var Dt=N(),yg=require("domain");function Sg(){return yg.active}function DR(){let t=Sg();if(t)return Dt.ensureHubOnCarrier(t),Dt.getHubFromCarrier(t)}function OR(t){let e={};return Dt.ensureHubOnCarrier(e,t),Dt.getHubFromCarrier(e)}function NR(t,e){let n=Sg();if(n&&CR([e,"optionalAccess",o=>o.reuseExisting]))return t();let r=yg.create(),s=n?Dt.getHubFromCarrier(n):void 0,i=OR(s);return Dt.setHubOnCarrier(r,i),r.bind(()=>t())()}function wR(){Dt.setAsyncContextStrategy({getCurrentHub:DR,runWithAsyncContext:NR})}iu.setDomainAsyncContextStrategy=wR});var bg=g(au=>{var{_optionalChain:kR}=k();Object.defineProperty(au,"__esModule",{value:!0});var ou=N(),PR=require("async_hooks"),si;function xR(){si||(si=new PR.AsyncLocalStorage);function t(){return si.getStore()}function e(r){let s={};return ou.ensureHubOnCarrier(s,r),ou.getHubFromCarrier(s)}function n(r,s){let i=t();if(i&&kR([s,"optionalAccess",a=>a.reuseExisting]))return r();let o=e(i);return si.run(o,()=>r())}ou.setAsyncContextStrategy({getCurrentHub:t,runWithAsyncContext:n})}au.setHooksAsyncContextStrategy=xR});var Ag=g(cu=>{Object.defineProperty(cu,"__esModule",{value:!0});var Ig=fn(),UR=Tg(),MR=bg();function LR(){Ig.NODE_VERSION.major&&Ig.NODE_VERSION.major>=14?MR.setHooksAsyncContextStrategy():UR.setDomainAsyncContextStrategy()}cu.setNodeAsyncContextStrategy=LR});var du=g(uu=>{Object.defineProperty(uu,"__esModule",{value:!0});var qR=N(),vg=T(),FR=require("util"),ii=class t{constructor(){t.prototype.__init.call(this)}static __initStatic(){this.id="Console"}__init(){this.name=t.id}setupOnce(){vg.addInstrumentationHandler("console",({args:e,level:n})=>{let r=qR.getCurrentHub();r.getIntegration(t)&&r.addBreadcrumb({category:"console",level:vg.severityLevelFromString(n),message:FR.format.apply(void 0,e)},{input:[...e],level:n})})}};ii.__initStatic();uu.Console=ii});var Ir=g(oi=>{(function(t,e){let n=typeof oi=="object"?oi:typeof t=="object"?t:{};e(n),typeof define=="function"&&define.amd&&define("lru",n)})(oi,function(t){let e=Symbol("newer"),n=Symbol("older");function r(c,u){typeof c!="number"&&(u=c,c=0),this.size=0,this.limit=c,this.oldest=this.newest=void 0,this._keymap=new Map,u&&(this.assign(u),c<1&&(this.limit=this.size))}t.LRUMap=r;function s(c,u){this.key=c,this.value=u,this[e]=void 0,this[n]=void 0}r.prototype._markEntryAsUsed=function(c){c!==this.newest&&(c[e]&&(c===this.oldest&&(this.oldest=c[e]),c[e][n]=c[n]),c[n]&&(c[n][e]=c[e]),c[e]=void 0,c[n]=this.newest,this.newest&&(this.newest[e]=c),this.newest=c)},r.prototype.assign=function(c){let u,d=this.limit||Number.MAX_VALUE;this._keymap.clear();let l=c[Symbol.iterator]();for(let p=l.next();!p.done;p=l.next()){let f=new s(p.value[0],p.value[1]);if(this._keymap.set(f.key,f),u?(u[e]=f,f[n]=u):this.oldest=f,u=f,d--==0)throw new Error("overflow")}this.newest=u,this.size=this._keymap.size},r.prototype.get=function(c){var u=this._keymap.get(c);if(u)return this._markEntryAsUsed(u),u.value},r.prototype.set=function(c,u){var d=this._keymap.get(c);return d?(d.value=u,this._markEntryAsUsed(d),this):(this._keymap.set(c,d=new s(c,u)),this.newest?(this.newest[e]=d,d[n]=this.newest):this.oldest=d,this.newest=d,++this.size,this.size>this.limit&&this.shift(),this)},r.prototype.shift=function(){var c=this.oldest;if(c)return this.oldest[e]?(this.oldest=this.oldest[e],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),c[e]=c[n]=void 0,this._keymap.delete(c.key),--this.size,[c.key,c.value]},r.prototype.find=function(c){let u=this._keymap.get(c);return u?u.value:void 0},r.prototype.has=function(c){return this._keymap.has(c)},r.prototype.delete=function(c){var u=this._keymap.get(c);if(u)return this._keymap.delete(u.key),u[e]&&u[n]?(u[n][e]=u[e],u[e][n]=u[n]):u[e]?(u[e][n]=void 0,this.oldest=u[e]):u[n]?(u[n][e]=void 0,this.newest=u[n]):this.oldest=this.newest=void 0,this.size--,u.value},r.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()};function i(c){this.entry=c}i.prototype[Symbol.iterator]=function(){return this},i.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function o(c){this.entry=c}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:c.key}):{done:!0,value:void 0}};function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:c.value}):{done:!0,value:void 0}},r.prototype.keys=function(){return new o(this.oldest)},r.prototype.values=function(){return new a(this.oldest)},r.prototype.entries=function(){return this},r.prototype[Symbol.iterator]=function(){return new i(this.oldest)},r.prototype.forEach=function(c,u){typeof u!="object"&&(u=this);let d=this.oldest;for(;d;)c.call(u,d.value,d.key,this),d=d[e]},r.prototype.toJSON=function(){for(var c=new Array(this.size),u=0,d=this.oldest;d;)c[u++]={key:d.key,value:d.value},d=d[e];return c},r.prototype.toString=function(){for(var c="",u=this.oldest;u;)c+=String(u.key)+":"+u.value,u=u[e],u&&(c+=" < ");return c}})});var Og=g(Ot=>{var{_optionalChain:Ne}=k();Object.defineProperty(Ot,"__esModule",{value:!0});var lu=require("url"),Rg=fn();function GR(t){let{protocol:e,hostname:n,port:r}=Dg(t),s=t.path?t.path:"/";return`${e}//${n}${r}${s}`}function Cg(t){let{protocol:e,hostname:n,port:r}=Dg(t),s=t.pathname||"/",i=t.auth?BR(t.auth):"";return`${e}//${i}${n}${r}${s}`}function BR(t){let[e,n]=t.split(":");return`${e?"[Filtered]":""}:${n?"[Filtered]":""}@`}function $R(t,e,n){if(!t)return t;let[r,s]=t.split(" ");return e.host&&!e.protocol&&(e.protocol=Ne([n,"optionalAccess",i=>i.agent,"optionalAccess",i=>i.protocol]),s=Cg(e)),Ne([s,"optionalAccess",i=>i.startsWith,"call",i=>i("///")])&&(s=s.slice(2)),`${r} ${s}`}function pu(t){let e={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:`${t.pathname||""}${t.search||""}`,href:t.href};return t.port!==""&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username}:${t.password}`),e}function jR(t,e){let n,r;if(typeof e[e.length-1]=="function"&&(n=e.pop()),typeof e[0]=="string")r=pu(new lu.URL(e[0]));else if(e[0]instanceof lu.URL)r=pu(e[0]);else{r=e[0];try{let s=new lu.URL(r.path||"",`${r.protocol||"http:"}//${r.hostname}`);r={pathname:s.pathname,search:s.search,hash:s.hash,...r}}catch{}}return e.length===2&&(r={...r,...e[1]}),r.protocol===void 0&&(Rg.NODE_VERSION.major&&Rg.NODE_VERSION.major>8?r.protocol=Ne([Ne([t,"optionalAccess",s=>s.globalAgent]),"optionalAccess",s=>s.protocol])||Ne([r.agent,"optionalAccess",s=>s.protocol])||Ne([r._defaultAgent,"optionalAccess",s=>s.protocol]):r.protocol=Ne([r.agent,"optionalAccess",s=>s.protocol])||Ne([r._defaultAgent,"optionalAccess",s=>s.protocol])||Ne([Ne([t,"optionalAccess",s=>s.globalAgent]),"optionalAccess",s=>s.protocol])),n?[r,n]:[r]}function Dg(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`;return{protocol:e,hostname:n,port:r}}Ot.cleanSpanDescription=$R;Ot.extractRawUrl=GR;Ot.extractUrl=Cg;Ot.normalizeRequestArgs=jR;Ot.urlToOptions=pu});var gu=g(fu=>{var{_optionalChain:Nt}=k();Object.defineProperty(fu,"__esModule",{value:!0});var gn=N(),we=T(),Ng=Ir(),wg=fn(),Ar=Og(),vr=class t{static __initStatic(){this.id="Http"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._breadcrumbs=typeof e.breadcrumbs>"u"?!0:e.breadcrumbs,this._tracing=e.tracing?e.tracing===!0?{}:e.tracing:void 0}setupOnce(e,n){if(!this._breadcrumbs&&!this._tracing)return;let r=Nt([n,"call",c=>c(),"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]);if(r&&r.instrumenter!=="sentry"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log("HTTP Integration is skipped because of instrumenter configuration.");return}let s=Nt([this,"access",c=>c._tracing,"optionalAccess",c=>c.shouldCreateSpanForRequest])||Nt([r,"optionalAccess",c=>c.shouldCreateSpanForRequest]),i=Nt([r,"optionalAccess",c=>c.tracePropagationTargets])||Nt([this,"access",c=>c._tracing,"optionalAccess",c=>c.tracePropagationTargets]),o=require("http"),a=kg(o,this._breadcrumbs,s,i);if(we.fill(o,"get",a),we.fill(o,"request",a),wg.NODE_VERSION.major&&wg.NODE_VERSION.major>8){let c=require("https"),u=kg(c,this._breadcrumbs,s,i);we.fill(c,"get",u),we.fill(c,"request",u)}}};vr.__initStatic();function kg(t,e,n,r){let s=new Ng.LRUMap(100),i=new Ng.LRUMap(100),o=u=>{if(n===void 0)return!0;let d=s.get(u);if(d!==void 0)return d;let l=n(u);return s.set(u,l),l},a=u=>{if(r===void 0)return!0;let d=i.get(u);if(d!==void 0)return d;let l=we.stringMatchesSomePattern(u,r);return i.set(u,l),l};function c(u,d,l,p){gn.getCurrentHub().getIntegration(vr)&&gn.getCurrentHub().addBreadcrumb({category:"http",data:{status_code:p&&p.statusCode,...d},type:"http"},{event:u,request:l,response:p})}return function(d){return function(...p){let f=Ar.normalizeRequestArgs(t,p),m=f[0],E=Ar.extractRawUrl(m),b=Ar.extractUrl(m);if(gn.isSentryRequestUrl(b,gn.getCurrentHub()))return d.apply(t,f);let v=gn.getCurrentHub(),L=v.getScope(),se=L.getSpan(),ie=HR(b,m),J=o(E)?Nt([se,"optionalAccess",P=>P.startChild,"call",P=>P({op:"http.client",origin:"auto.http.node.http",description:`${ie["http.method"]} ${ie.url}`,data:ie})]):void 0;if(a(E))if(J){let P=J.toTraceparent(),Ue=Nt([J,"optionalAccess",Se=>Se.transaction,"optionalAccess",Se=>Se.getDynamicSamplingContext,"call",Se=>Se()]);Pg(m,b,P,Ue)}else{let P=v.getClient(),{traceId:Ue,sampled:Se,dsc:ji}=L.getPropagationContext(),wh=we.generateSentryTraceHeader(Ue,void 0,Se),kh=ji||(P?gn.getDynamicSamplingContextFromClient(Ue,P,L):void 0);Pg(m,b,wh,kh)}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log(`[Tracing] Not adding sentry-trace header to outgoing request (${b}) due to mismatching tracePropagationTargets option.`);return d.apply(t,f).once("response",function(P){let Ue=this;e&&c("response",ie,Ue,P),J&&(P.statusCode&&J.setHttpStatus(P.statusCode),J.description=Ar.cleanSpanDescription(J.description,m,Ue),J.finish())}).once("error",function(){let P=this;e&&c("error",ie,P),J&&(J.setHttpStatus(500),J.description=Ar.cleanSpanDescription(J.description,m,P),J.finish())})}}}function Pg(t,e,n,r){if((t.headers||{})["sentry-trace"])return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log(`[Tracing] Adding sentry-trace header ${n} to outgoing request to "${e}": `);let i=we.dynamicSamplingContextToSentryBaggageHeader(r),o=i&&i.length>0?YR(t,i):void 0;t.headers={...t.headers,"sentry-trace":n,...o&&{baggage:o}}}function HR(t,e){let n=e.method||"GET",r={url:t,"http.method":n};return e.hash&&(r["http.fragment"]=e.hash.substring(1)),e.search&&(r["http.query"]=e.search.substring(1)),r}function YR(t,e){if(!t.headers||!t.headers.baggage)return e;if(e){if(Array.isArray(t.headers.baggage))return[...t.headers.baggage,e]}else return t.headers.baggage;return[t.headers.baggage,e]}fu.Http=vr});var mu=g(hu=>{Object.defineProperty(hu,"__esModule",{value:!0});var KR=N(),_u=T(),WR=2e3;function VR(t){console.error(t);let e=KR.getCurrentHub().getClient();e===void 0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1));let n=e.getOptions(),r=n&&n.shutdownTimeout&&n.shutdownTimeout>0&&n.shutdownTimeout||WR;e.close(r).then(s=>{s||(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},s=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.error(s)})}hu.logAndExitProcess=VR});var yu=g(Eu=>{Object.defineProperty(Eu,"__esModule",{value:!0});var xg=N(),zR=T(),Ug=mu(),ai=class t{static __initStatic(){this.id="OnUncaughtException"}__init(){this.name=t.id}__init2(){this.handler=this._makeErrorHandler()}constructor(e={}){t.prototype.__init.call(this),t.prototype.__init2.call(this),this._options={exitEvenIfOtherHandlersAreRegistered:!0,...e}}setupOnce(){global.process.on("uncaughtException",this.handler)}_makeErrorHandler(){let n=!1,r=!1,s=!1,i;return o=>{let a=Ug.logAndExitProcess,c=xg.getCurrentHub().getClient();this._options.onFatalError?a=this._options.onFatalError:c&&c.getOptions().onFatalError&&(a=c.getOptions().onFatalError);let d=global.process.listeners("uncaughtException").reduce((p,f)=>f.name==="domainUncaughtExceptionClear"||f.tag&&f.tag==="sentry_tracingErrorCallback"||f===this.handler?p:p+1,0)===0,l=this._options.exitEvenIfOtherHandlersAreRegistered||d;if(n)l&&(s?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&zR.logger.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),Ug.logAndExitProcess(o)):r||(r=!0,setTimeout(()=>{s||(s=!0,a(i,o))},2e3)));else{let p=xg.getCurrentHub();i=o,n=!0,p.getIntegration(t)?p.withScope(f=>{f.setLevel("fatal"),p.captureException(o,{originalException:o,data:{mechanism:{handled:!1,type:"onuncaughtexception"}}}),!s&&l&&(s=!0,a(o))}):!s&&l&&(s=!0,a(o))}}}};ai.__initStatic();Eu.OnUncaughtException=ai});var Tu=g(Su=>{Object.defineProperty(Su,"__esModule",{value:!0});var XR=N(),Mg=T(),JR=mu(),ci=class t{static __initStatic(){this.id="OnUnhandledRejection"}__init(){this.name=t.id}constructor(e={mode:"warn"}){this._options=e,t.prototype.__init.call(this)}setupOnce(){global.process.on("unhandledRejection",this.sendUnhandledPromise.bind(this))}sendUnhandledPromise(e,n){let r=XR.getCurrentHub();r.getIntegration(t)&&r.withScope(s=>{s.setExtra("unhandledPromiseRejection",!0),r.captureException(e,{originalException:n,data:{mechanism:{handled:!1,type:"onunhandledrejection"}}})}),this._handleRejection(e)}_handleRejection(e){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";this._options.mode==="warn"?Mg.consoleSandbox(()=>{console.warn(n),console.error(e&&e.stack?e.stack:e)}):this._options.mode==="strict"&&(Mg.consoleSandbox(()=>{console.warn(n)}),JR.logAndExitProcess(e))}};ci.__initStatic();Su.OnUnhandledRejection=ci});var Iu=g(bu=>{Object.defineProperty(bu,"__esModule",{value:!0});var Lg=T(),QR="cause",ZR=5,ui=class t{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._key=e.key||QR,this._limit=e.limit||ZR}setupOnce(){}preprocessEvent(e,n,r){let s=r.getOptions();Lg.applyAggregateErrorsToEvent(Lg.exceptionFromError,s.stackParser,s.maxValueLength,this._key,this._limit,e,n)}};ui.__initStatic();bu.LinkedErrors=ui});var Ru=g(vu=>{Object.defineProperty(vu,"__esModule",{value:!0});var qg=require("fs"),Fg=require("path"),Au;function eC(){try{return require.cache?Object.keys(require.cache):[]}catch{return[]}}function tC(){let t=require.main&&require.main.paths||[],e=eC(),n={},r={};return e.forEach(s=>{let i=s,o=()=>{let a=i;if(i=Fg.dirname(a),!i||a===i||r[a])return;if(t.indexOf(i)<0)return o();let c=Fg.join(a,"package.json");if(r[a]=!0,!qg.existsSync(c))return o();try{let u=JSON.parse(qg.readFileSync(c,"utf8"));n[u.name]=u.version}catch{}};o()}),n}var di=class t{constructor(){t.prototype.__init.call(this)}static __initStatic(){this.id="Modules"}__init(){this.name=t.id}setupOnce(e,n){e(r=>n().getIntegration(t)?{...r,modules:{...r.modules,...this._getModules()}}:r)}_getModules(){return Au||(Au=tC()),Au}};di.__initStatic();vu.Modules=di});var Ou=g(Du=>{var{_optionalChain:Cu}=k();Object.defineProperty(Du,"__esModule",{value:!0});var nC=T(),rC=require("fs"),sC=Ir(),li=new sC.LRUMap(100),iC=7;function oC(t){return new Promise((e,n)=>{rC.readFile(t,"utf8",(r,s)=>{r?n(r):e(s)})})}var pi=class t{static __initStatic(){this.id="ContextLines"}__init(){this.name=t.id}constructor(e={}){this._options=e,t.prototype.__init.call(this)}get _contextLines(){return this._options.frameContextLines!==void 0?this._options.frameContextLines:iC}setupOnce(e,n){e(r=>n().getIntegration(t)?this.addSourceContext(r):r)}async addSourceContext(e){let n={},r=[];if(this._contextLines>0&&Cu([e,"access",s=>s.exception,"optionalAccess",s=>s.values])){for(let s of e.exception.values)if(Cu([s,"access",i=>i.stacktrace,"optionalAccess",i=>i.frames]))for(let i=s.stacktrace.frames.length-1;i>=0;i--){let o=s.stacktrace.frames[i];o.filename&&!n[o.filename]&&!li.get(o.filename)&&(r.push(aC(o.filename)),n[o.filename]=1)}}if(r.length>0&&await Promise.all(r),this._contextLines>0&&Cu([e,"access",s=>s.exception,"optionalAccess",s=>s.values]))for(let s of e.exception.values)s.stacktrace&&s.stacktrace.frames&&await this.addSourceContextToFrames(s.stacktrace.frames);return e}addSourceContextToFrames(e){for(let n of e)if(n.filename&&n.context_line===void 0){let r=li.get(n.filename);if(r)try{nC.addContextToFrame(r,n,this._contextLines)}catch{}}}};pi.__initStatic();async function aC(t){let e=li.get(t);if(e===null)return null;if(e!==void 0)return e;let n=null;try{n=(await oC(t)).split(`
|
|
33
|
+
`)}catch{}return li.set(t,n),n}Du.ContextLines=pi});var Nu=g(_n=>{var{_optionalChain:wt}=k();Object.defineProperty(_n,"__esModule",{value:!0});var cC=require("child_process"),Bg=require("fs"),fe=require("os"),uC=require("path"),$g=require("util"),jg=$g.promisify(Bg.readFile),Hg=$g.promisify(Bg.readdir),fi=class t{static __initStatic(){this.id="Context"}__init(){this.name=t.id}constructor(e={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0}){this._options=e,t.prototype.__init.call(this)}setupOnce(e){e(n=>this.addContext(n))}async addContext(e){this._cachedContext===void 0&&(this._cachedContext=this._getContexts());let n=this._updateContext(await this._cachedContext);return e.contexts={...e.contexts,app:{...n.app,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.app])},os:{...n.os,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.os])},device:{...n.device,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.device])},culture:{...n.culture,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.culture])},cloud_resource:{...n.cloud_resource,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.cloud_resource])}},e}_updateContext(e){return wt([e,"optionalAccess",n=>n.app,"optionalAccess",n=>n.app_memory])&&(e.app.app_memory=process.memoryUsage().rss),wt([e,"optionalAccess",n=>n.device,"optionalAccess",n=>n.free_memory])&&(e.device.free_memory=fe.freemem()),e}async _getContexts(){let e={};if(this._options.os&&(e.os=await dC()),this._options.app&&(e.app=pC()),this._options.device&&(e.device=Yg(this._options.device)),this._options.culture){let n=lC();n&&(e.culture=n)}return this._options.cloudResource&&(e.cloud_resource=EC()),e}};fi.__initStatic();async function dC(){let t=fe.platform();switch(t){case"darwin":return hC();case"linux":return mC();default:return{name:fC[t]||t,version:fe.release()}}}function lC(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function pC(){let t=process.memoryUsage().rss;return{app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t}}function Yg(t){let e={},n;try{n=fe.uptime&&fe.uptime()}catch{}if(typeof n=="number"&&(e.boot_time=new Date(Date.now()-n*1e3).toISOString()),e.arch=fe.arch(),(t===!0||t.memory)&&(e.memory_size=fe.totalmem(),e.free_memory=fe.freemem()),t===!0||t.cpu){let r=fe.cpus();if(r&&r.length){let s=r[0];e.processor_count=r.length,e.cpu_description=s.model,e.processor_frequency=s.speed}}return e}var fC={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},gC=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],_C={alpine:t=>t,arch:t=>ke(/distrib_release=(.*)/,t),centos:t=>ke(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>ke(/release (..)/,t),mint:t=>ke(/distrib_release=(.*)/,t),red:t=>ke(/release ([^ ]+)/,t),suse:t=>ke(/VERSION = (.*)\n/,t),ubuntu:t=>ke(/distrib_release=(.*)/,t)};function ke(t,e){let n=t.exec(e);return n?n[1]:void 0}async function hC(){let t={kernel_version:fe.release(),name:"Mac OS X",version:`10.${Number(fe.release().split(".")[0])-4}`};try{let e=await new Promise((n,r)=>{cC.execFile("/usr/bin/sw_vers",(s,i)=>{if(s){r(s);return}n(i)})});t.name=ke(/^ProductName:\s+(.*)$/m,e),t.version=ke(/^ProductVersion:\s+(.*)$/m,e),t.build=ke(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function Gg(t){return t.split(" ")[0].toLowerCase()}async function mC(){let t={kernel_version:fe.release(),name:"Linux"};try{let e=await Hg("/etc"),n=gC.find(a=>e.includes(a.name));if(!n)return t;let r=uC.join("/etc",n.name),s=(await jg(r,{encoding:"utf-8"})).toLowerCase(),{distros:i}=n;t.name=i.find(a=>s.indexOf(Gg(a))>=0)||i[0];let o=Gg(t.name);t.version=_C[o](s)}catch{}return t}function EC(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}_n.Context=fi;_n.getDeviceContext=Yg;_n.readDirAsync=Hg;_n.readFileAsync=jg});var Kg=g(wu=>{"use strict";wu.parse=SC;wu.serialize=TC;var yC=Object.prototype.toString,gi=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function SC(t,e){if(typeof t!="string")throw new TypeError("argument str must be a string");for(var n={},r=e||{},s=r.decode||bC,i=0;i<t.length;){var o=t.indexOf("=",i);if(o===-1)break;var a=t.indexOf(";",i);if(a===-1)a=t.length;else if(a<o){i=t.lastIndexOf(";",o-1)+1;continue}var c=t.slice(i,o).trim();if(n[c]===void 0){var u=t.slice(o+1,a).trim();u.charCodeAt(0)===34&&(u=u.slice(1,-1)),n[c]=vC(u,s)}i=a+1}return n}function TC(t,e,n){var r=n||{},s=r.encode||IC;if(typeof s!="function")throw new TypeError("option encode is invalid");if(!gi.test(t))throw new TypeError("argument name is invalid");var i=s(e);if(i&&!gi.test(i))throw new TypeError("argument val is invalid");var o=t+"="+i;if(r.maxAge!=null){var a=r.maxAge-0;if(isNaN(a)||!isFinite(a))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(a)}if(r.domain){if(!gi.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!gi.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){var c=r.expires;if(!AC(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+c.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.priority){var u=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(u){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var d=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(d){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}function bC(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function IC(t){return encodeURIComponent(t)}function AC(t){return yC.call(t)==="[object Date]"||t instanceof Date}function vC(t,e){try{return e(t)}catch{return t}}});var Rr=g(hn=>{var{_optionalChain:RC}=k();Object.defineProperty(hn,"__esModule",{value:!0});var _i=T(),CC=Kg(),DC=require("url"),OC={ip:!1,request:!0,transaction:!0,user:!0},NC=["cookies","data","headers","method","query_string","url"],Wg=["id","username","email"];function ku(t,e={}){let n=t.method&&t.method.toUpperCase(),r="",s="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,s="route"):(t.originalUrl||t.url)&&(r=_i.stripUrlQueryAndFragment(t.originalUrl||t.url||""));let i="";return e.method&&n&&(i+=n),e.method&&e.path&&(i+=" "),e.path&&r&&(i+=r),[i,s]}function wC(t,e){switch(e){case"path":return ku(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"<anonymous>";default:{let n=t._reconstructedRoute?t._reconstructedRoute:void 0;return ku(t,{path:!0,method:!0,customRoute:n})[0]}}}function kC(t,e){let n={};return(Array.isArray(e)?e:Wg).forEach(s=>{t&&s in t&&(n[s]=t[s])}),n}function Pu(t,e){let{include:n=NC}=e||{},r={},s=t.headers||{},i=t.method,o=t.hostname||t.host||s.host||"<no host>",a=t.protocol==="https"||t.socket&&t.socket.encrypted?"https":"http",c=t.originalUrl||t.url||"",u=c.startsWith(a)?c:`${a}://${o}${c}`;return n.forEach(d=>{switch(d){case"headers":{r.headers=s,n.includes("cookies")||delete r.headers.cookie;break}case"method":{r.method=i;break}case"url":{r.url=u;break}case"cookies":{r.cookies=t.cookies||s.cookie&&CC.parse(s.cookie)||{};break}case"query_string":{r.query_string=xC(t);break}case"data":{if(i==="GET"||i==="HEAD")break;t.body!==void 0&&(r.data=_i.isString(t.body)?t.body:JSON.stringify(_i.normalize(t.body)));break}default:({}).hasOwnProperty.call(t,d)&&(r[d]=t[d])}}),r}function PC(t,e,n){let r={...OC,...RC([n,"optionalAccess",s=>s.include])};if(r.request){let s=Array.isArray(r.request)?Pu(e,{include:r.request}):Pu(e);t.request={...t.request,...s}}if(r.user){let s=e.user&&_i.isPlainObject(e.user)?kC(e.user,r.user):{};Object.keys(s).length&&(t.user={...t.user,...s})}if(r.ip){let s=e.ip||e.socket&&e.socket.remoteAddress;s&&(t.user={...t.user,ip_address:s})}return r.transaction&&!t.transaction&&(t.transaction=wC(e,r.transaction)),t}function xC(t){let e=t.originalUrl||t.url||"";if(e)return e.startsWith("/")&&(e=`http://dogs.are.great${e}`),t.query||new DC.URL(e).search.replace("?","")||void 0}hn.DEFAULT_USER_INCLUDES=Wg;hn.addRequestDataToEvent=PC;hn.extractPathForTransaction=ku;hn.extractRequestData=Pu});var Mu=g(Uu=>{Object.defineProperty(Uu,"__esModule",{value:!0});var UC=T(),MC=Rr(),xu={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"},hi=class t{static __initStatic(){this.id="RequestData"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._addRequestData=MC.addRequestDataToEvent,this._options={...xu,...e,include:{method:!0,...xu.include,...e.include,user:e.include&&typeof e.include.user=="boolean"?e.include.user:{...xu.include.user,...(e.include||{}).user}}}}setupOnce(e,n){let{transactionNamingScheme:r}=this._options;e(s=>{let i=n(),o=i.getIntegration(t),{sdkProcessingMetadata:a={}}=s,c=a.request;if(!o||!c)return s;let u=a.requestDataOptionsFromExpressHandler||a.requestDataOptionsFromGCPWrapper||LC(this._options),d=this._addRequestData(s,c,u);if(s.type==="transaction"||r==="handler")return d;let p=c._sentryTransaction;if(p){let f=qC(i)==="sentry.javascript.nextjs"?p.name.startsWith("/api"):r!=="path",[m]=UC.extractPathForTransaction(c,{path:!0,method:f,customRoute:p.name});d.transaction=m}return d})}};hi.__initStatic();function LC(t){let{transactionNamingScheme:e,include:{ip:n,user:r,...s}}=t,i=[];for(let[a,c]of Object.entries(s))c&&i.push(a);let o;if(r===void 0)o=!0;else if(typeof r=="boolean")o=r;else{let a=[];for(let[c,u]of Object.entries(r))u&&a.push(c);o=a}return{include:{ip:n,user:o,request:i.length!==0?i:void 0,transaction:e}}}function qC(t){try{return t.getClient().getOptions()._metadata.sdk.name}catch{return}}Uu.RequestData=hi});var Gu=g(Cr=>{var{_optionalChain:O}=k();Object.defineProperty(Cr,"__esModule",{value:!0});var Lu=T(),FC=Ir(),GC=fn();function zg(t,e,n){let r=0,s=5,i=0;return setInterval(()=>{i===0?r>t&&(s*=2,n(s),s>86400&&(s=86400),i=s):(i-=1,i===0&&e()),r=0},1e3).unref(),()=>{r+=1}}function Fu(t){let e=[],n=!1;function r(o){e=[],!n&&(n=!0,t(o))}e.push(r);function s(o){e.push(o)}function i(o){let a=e.pop()||r;try{a(o)}catch{r(o)}}return{add:s,next:i}}var qu=class{constructor(){let{Session:e}=require("inspector");this._session=new e}configureAndConnect(e,n){this._session.connect(),this._session.on("Debugger.paused",r=>{e(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,n){this._getProperties(e,r=>{let{add:s,next:i}=Fu(n);for(let o of r)if(O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&O([o,"optionalAccess",a=>a.value,"access",a=>a.className])==="Array"){let a=o.value.objectId;s(c=>this._unrollArray(a,o.name,c,i))}else if(O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.className])==="Object"){let a=o.value.objectId;s(c=>this._unrollObject(a,o.name,c,i))}else(O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])||O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.description]))&&s(a=>this._unrollOther(o,a,i));i({})})}_getProperties(e,n){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(r,s)=>{n(r?[]:s.result)})}_unrollArray(e,n,r,s){this._getProperties(e,i=>{r[n]=i.filter(o=>o.name!=="length"&&!isNaN(parseInt(o.name,10))).sort((o,a)=>parseInt(o.name,10)-parseInt(a.name,10)).map(o=>O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])),s(r)})}_unrollObject(e,n,r,s){this._getProperties(e,i=>{r[n]=i.map(o=>[o.name,O([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])]).reduce((o,[a,c])=>(o[a]=c,o),{}),s(r)})}_unrollOther(e,n,r){O([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.value])?n[e.name]=e.value.value:O([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.description])&&O([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.type])!=="function"&&(n[e.name]=`<${e.value.description}>`),r(n)}};function BC(){try{return new qu}catch{return}}function Vg(t){return t!==void 0&&["","?","<anonymous>"].includes(t)}function $C(t,e){return t===e||Vg(t)&&Vg(e)}function Xg(t){if(t!==void 0)return t.slice(-10).reduce((e,n)=>`${e},${n.function},${n.lineno},${n.colno}`,"")}function jC(t,e){if(e!==void 0)return Xg(t(e,1))}var mi=class t{static __initStatic(){this.id="LocalVariables"}__init(){this.name=t.id}__init2(){this._cachedFrames=new FC.LRUMap(20)}constructor(e={},n=BC()){this._options=e,this._session=n,t.prototype.__init.call(this),t.prototype.__init2.call(this)}setupOnce(e,n){this._setup(e,O([n,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]))}_setup(e,n){if(this._session&&O([n,"optionalAccess",r=>r.includeLocalVariables])){if((GC.NODE_VERSION.major||0)<18){Lu.logger.log("The `LocalVariables` integration is only supported on Node >= v18.");return}let s=this._options.captureAllExceptions!==!1;if(this._session.configureAndConnect((i,o)=>this._handlePaused(n.stackParser,i,o),s),s){let i=this._options.maxExceptionsPerSecond||50;this._rateLimiter=zg(i,()=>{Lu.logger.log("Local variables rate-limit lifted."),O([this,"access",o=>o._session,"optionalAccess",o=>o.setPauseOnExceptions,"call",o=>o(!0)])},o=>{Lu.logger.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${o} seconds.`),O([this,"access",a=>a._session,"optionalAccess",a=>a.setPauseOnExceptions,"call",a=>a(!1)])})}e(async i=>this._addLocalVariables(i))}}_handlePaused(e,{params:{reason:n,data:r,callFrames:s}},i){if(n!=="exception"&&n!=="promiseRejection"){i();return}O([this,"access",u=>u._rateLimiter,"optionalCall",u=>u()]);let o=jC(e,O([r,"optionalAccess",u=>u.description]));if(o==null){i();return}let{add:a,next:c}=Fu(u=>{this._cachedFrames.set(o,u),i()});for(let u=0;u<Math.min(s.length,5);u++){let{scopeChain:d,functionName:l,this:p}=s[u],f=d.find(E=>E.type==="local"),m=p.className==="global"||!p.className?l:`${p.className}.${l}`;if(O([f,"optionalAccess",E=>E.object,"access",E=>E.objectId])===void 0)a(E=>{E[u]={function:m},c(E)});else{let E=f.object.objectId;a(b=>O([this,"access",v=>v._session,"optionalAccess",v=>v.getLocalVariables,"call",v=>v(E,L=>{b[u]={function:m,vars:L},c(b)})]))}}c([])}_addLocalVariables(e){for(let n of O([e,"optionalAccess",r=>r.exception,"optionalAccess",r=>r.values])||[])this._addLocalVariablesToException(n);return e}_addLocalVariablesToException(e){let n=Xg(O([e,"optionalAccess",i=>i.stacktrace,"optionalAccess",i=>i.frames]));if(n===void 0)return;let r=this._cachedFrames.delete(n);if(r===void 0)return;let s=O([e,"access",i=>i.stacktrace,"optionalAccess",i=>i.frames,"optionalAccess",i=>i.length])||0;for(let i=0;i<s;i++){let o=s-i-1;if(!O([e,"optionalAccess",a=>a.stacktrace,"optionalAccess",a=>a.frames,"optionalAccess",a=>a[o]])||!r[i])break;r[i].vars===void 0||e.stacktrace.frames[o].in_app===!1||!$C(e.stacktrace.frames[o].function,r[i].function)||(e.stacktrace.frames[o].vars=r[i].vars)}}};mi.__initStatic();Cr.LocalVariables=mi;Cr.createCallbackList=Fu;Cr.createRateLimiter=zg});var Bu=g((We,t_)=>{var{_optionalChain:e_}=k();Object.defineProperty(We,"__esModule",{value:!0});var kt=N(),Pt=T(),Jg=Ir(),Qg=fn();We.ChannelName=void 0;(function(t){let e="undici:request:create";t.RequestCreate=e;let n="undici:request:headers";t.RequestEnd=n;let r="undici:request:error";t.RequestError=r})(We.ChannelName||(We.ChannelName={}));var Ei=class t{static __initStatic(){this.id="Undici"}__init(){this.name=t.id}__init2(){this._createSpanUrlMap=new Jg.LRUMap(100)}__init3(){this._headersUrlMap=new Jg.LRUMap(100)}constructor(e={}){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),t.prototype.__init5.call(this),t.prototype.__init6.call(this),this._options={breadcrumbs:e.breadcrumbs===void 0?!0:e.breadcrumbs,shouldCreateSpanForRequest:e.shouldCreateSpanForRequest}}setupOnce(e){if(Qg.NODE_VERSION.major&&Qg.NODE_VERSION.major<16)return;let n;try{n=Pt.dynamicRequire(t_,"diagnostics_channel")}catch{}!n||!n.subscribe||(n.subscribe(We.ChannelName.RequestCreate,this._onRequestCreate),n.subscribe(We.ChannelName.RequestEnd,this._onRequestEnd),n.subscribe(We.ChannelName.RequestError,this._onRequestError))}_shouldCreateSpan(e){if(this._options.shouldCreateSpanForRequest===void 0)return!0;let n=this._createSpanUrlMap.get(e);if(n!==void 0)return n;let r=this._options.shouldCreateSpanForRequest(e);return this._createSpanUrlMap.set(e,r),r}__init4(){this._onRequestCreate=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r}=e,s=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(s,n)||r.__sentry_span__!==void 0)return;let i=n.getClient();if(!i)return;let o=i.getOptions(),a=n.getScope(),c=a.getSpan(),u=this._shouldCreateSpan(s)?HC(c,r,s):void 0;if(u&&(r.__sentry_span__=u),(l=>{if(o.tracePropagationTargets===void 0)return!0;let p=this._headersUrlMap.get(l);if(p!==void 0)return p;let f=Pt.stringMatchesSomePattern(l,o.tracePropagationTargets);return this._headersUrlMap.set(l,f),f})(s))if(u){let l=e_([u,"optionalAccess",f=>f.transaction,"optionalAccess",f=>f.getDynamicSamplingContext,"call",f=>f()]),p=Pt.dynamicSamplingContextToSentryBaggageHeader(l);Zg(r,u.toTraceparent(),p)}else{let{traceId:l,sampled:p,dsc:f}=a.getPropagationContext(),m=Pt.generateSentryTraceHeader(l,void 0,p),E=f||kt.getDynamicSamplingContextFromClient(l,i,a),b=Pt.dynamicSamplingContextToSentryBaggageHeader(E);Zg(r,m,b)}}}__init5(){this._onRequestEnd=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r,response:s}=e,i=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(i,n))return;let o=r.__sentry_span__;o&&(o.setHttpStatus(s.statusCode),o.finish()),this._options.breadcrumbs&&n.addBreadcrumb({category:"http",data:{method:r.method,status_code:s.statusCode,url:i},type:"http"},{event:"response",request:r,response:s})}}__init6(){this._onRequestError=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r}=e,s=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(s,n))return;let i=r.__sentry_span__;i&&(i.setStatus("internal_error"),i.finish()),this._options.breadcrumbs&&n.addBreadcrumb({category:"http",data:{method:r.method,url:s},level:"error",type:"http"},{event:"error",request:r})}}};Ei.__initStatic();function Zg(t,e,n){t.__sentry_has_headers__||(t.addHeader("sentry-trace",e),n&&t.addHeader("baggage",n),t.__sentry_has_headers__=!0)}function HC(t,e,n){let r=Pt.parseUrl(n),s=e.method||"GET",i={"http.method":s};return r.search&&(i["http.query"]=r.search),r.hash&&(i["http.fragment"]=r.hash),e_([t,"optionalAccess",o=>o.startChild,"call",o=>o({op:"http.client",origin:"auto.http.node.undici",description:`${s} ${Pt.getSanitizedUrlString(r)}`,data:i})])}We.Undici=Ei});var $u=g(Mt=>{var{_optionalChain:YC}=k();Object.defineProperty(Mt,"__esModule",{value:!0});var xt=N(),Ut=T(),KC=ru(),WC=Ag(),VC=Uc(),zC=du(),XC=gu(),JC=yu(),QC=Tu(),ZC=Iu(),eD=Ru(),tD=Ou(),nD=Nu(),rD=Mu(),sD=Gu(),iD=Bu(),oD=ei(),aD=zc(),n_=[new xt.Integrations.InboundFilters,new xt.Integrations.FunctionToString,new zC.Console,new XC.Http,new iD.Undici,new JC.OnUncaughtException,new QC.OnUnhandledRejection,new tD.ContextLines,new sD.LocalVariables,new nD.Context,new eD.Modules,new rD.RequestData,new ZC.LinkedErrors];function cD(t={}){KC.isAnrChildProcess()&&(t.autoSessionTracking=!1,t.tracesSampleRate=0);let e=xt.getMainCarrier();WC.setNodeAsyncContextStrategy();let n=YC([e,"access",i=>i.__SENTRY__,"optionalAccess",i=>i.integrations])||[];t.defaultIntegrations=t.defaultIntegrations===!1?[]:[...Array.isArray(t.defaultIntegrations)?t.defaultIntegrations:n_,...n],t.dsn===void 0&&process.env.SENTRY_DSN&&(t.dsn=process.env.SENTRY_DSN);let r=process.env.SENTRY_TRACES_SAMPLE_RATE;if(t.tracesSampleRate===void 0&&r){let i=parseFloat(r);isFinite(i)&&(t.tracesSampleRate=i)}if(t.release===void 0){let i=r_();i!==void 0?t.release=i:t.autoSessionTracking=!1}t.environment===void 0&&process.env.SENTRY_ENVIRONMENT&&(t.environment=process.env.SENTRY_ENVIRONMENT),t.autoSessionTracking===void 0&&t.dsn!==void 0&&(t.autoSessionTracking=!0),t.instrumenter===void 0&&(t.instrumenter="sentry");let s={...t,stackParser:Ut.stackParserFromStackParserOptions(t.stackParser||s_),integrations:xt.getIntegrationsToSetup(t),transport:t.transport||aD.makeNodeTransport};xt.initAndBind(t.clientClass||VC.NodeClient,s),t.autoSessionTracking&&dD(),lD()}function uD(t){if(t===void 0)return!1;let e=t&&t.getOptions();return e&&e.autoSessionTracking!==void 0?e.autoSessionTracking:!1}function r_(t){return process.env.SENTRY_RELEASE?process.env.SENTRY_RELEASE:Ut.GLOBAL_OBJ.SENTRY_RELEASE&&Ut.GLOBAL_OBJ.SENTRY_RELEASE.id?Ut.GLOBAL_OBJ.SENTRY_RELEASE.id:process.env.GITHUB_SHA||process.env.COMMIT_REF||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA||t}var s_=Ut.createStackParser(Ut.nodeStackLineParser(oD.getModuleFromFilename));function dD(){let t=xt.getCurrentHub();t.startSession(),process.on("beforeExit",()=>{let e=t.getScope().getSession();e&&!["exited","crashed"].includes(e.status)&&t.endSession()})}function lD(){let t=(process.env.SENTRY_USE_ENVIRONMENT||"").toLowerCase();if(!["false","n","no","off","0"].includes(t)){let e=process.env.SENTRY_TRACE,n=process.env.SENTRY_BAGGAGE,{propagationContext:r}=Ut.tracingContextFromHeaders(e,n);xt.getCurrentHub().getScope().setPropagationContext(r)}}Mt.defaultIntegrations=n_;Mt.defaultStackParser=s_;Mt.getSentryRelease=r_;Mt.init=cD;Mt.isAutoSessionTrackingEnabled=uD});var i_=g(Hu=>{Object.defineProperty(Hu,"__esModule",{value:!0});var yi=require("fs"),ju=require("path");function pD(t){let e=ju.resolve(t);if(!yi.existsSync(e))throw new Error(`Cannot read contents of ${e}. Directory does not exist.`);if(!yi.statSync(e).isDirectory())throw new Error(`Cannot read contents of ${e}, because it is not a directory.`);let n=r=>yi.readdirSync(r).reduce((s,i)=>{let o=ju.join(r,i);return yi.statSync(o).isDirectory()?s.concat(n(o)):(s.push(o),s)},[]);return n(e).map(r=>ju.relative(e,r))}Hu.deepReadDirSync=pD});var a_=g(Si=>{Object.defineProperty(Si,"__esModule",{value:!0});var o_=Rr();function fD(t,e){return o_.extractRequestData(t,{include:e})}function gD(t,e,n={}){return o_.addRequestDataToEvent(t,e,{include:n})}Si.extractRequestData=fD;Si.parseRequest=gD});var u_=g(dt=>{var{_optionalChain:mn}=k();Object.defineProperty(dt,"__esModule",{value:!0});var Ee=N(),ut=T(),_D=Rr(),Ti=$u(),c_=a_();function hD(){return function(e,n,r){let s=Ee.getCurrentHub(),i=mn([s,"access",m=>m.getClient,"call",m=>m(),"optionalAccess",m=>m.getOptions,"call",m=>m()]);if(!i||i.instrumenter!=="sentry"||mn([e,"access",m=>m.method,"optionalAccess",m=>m.toUpperCase,"call",m=>m()])==="OPTIONS"||mn([e,"access",m=>m.method,"optionalAccess",m=>m.toUpperCase,"call",m=>m()])==="HEAD")return r();let o=e.headers&&ut.isString(e.headers["sentry-trace"])?e.headers["sentry-trace"]:void 0,a=mn([e,"access",m=>m.headers,"optionalAccess",m=>m.baggage]),{traceparentData:c,dynamicSamplingContext:u,propagationContext:d}=ut.tracingContextFromHeaders(o,a);if(s.getScope().setPropagationContext(d),!Ee.hasTracingEnabled(i))return r();let[l,p]=ut.extractPathForTransaction(e,{path:!0,method:!0}),f=Ee.startTransaction({name:l,op:"http.server",origin:"auto.http.node.tracingHandler",...c,metadata:{dynamicSamplingContext:c&&!u?{}:u,request:e,source:p}},{request:_D.extractRequestData(e)});s.configureScope(m=>{m.setSpan(f)}),n.__sentry_transaction=f,n.once("finish",()=>{setImmediate(()=>{ut.addRequestDataToTransaction(f,e),f.setHttpStatus(n.statusCode),f.finish()})}),r()}}function mD(t={}){let e;if("include"in t)e={include:t.include};else{let{ip:n,request:r,transaction:s,user:i}=t;(n||r||s||i)&&(e={include:ut.dropUndefinedKeys({ip:n,request:r,transaction:s,user:i})})}return e}function ED(t){let e=mD(t),n=Ee.getCurrentHub(),r=n.getClient();if(r&&Ti.isAutoSessionTrackingEnabled(r)){r.initSessionFlusher();let s=n.getScope();s.getSession()&&s.setSession()}return function(i,o,a){if(t&&t.flushTimeout&&t.flushTimeout>0){let c=o.end;o.end=function(u,d,l){Ee.flush(t.flushTimeout).then(()=>{c.call(this,u,d,l)}).then(null,p=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ut.logger.error(p),c.call(this,u,d,l)})}}Ee.runWithAsyncContext(()=>{let c=Ee.getCurrentHub();c.configureScope(u=>{u.setSDKProcessingMetadata({request:i,requestDataOptionsFromExpressHandler:e});let d=c.getClient();Ti.isAutoSessionTrackingEnabled(d)&&c.getScope().setRequestSession({status:"ok"})}),o.once("finish",()=>{let u=c.getClient();Ti.isAutoSessionTrackingEnabled(u)&&setImmediate(()=>{u&&u._captureRequestSession&&u._captureRequestSession()})}),a()})}}function yD(t){let e=t.status||t.statusCode||t.status_code||t.output&&t.output.statusCode;return e?parseInt(e,10):500}function SD(t){return yD(t)>=500}function TD(t){return function(n,r,s,i){if((t&&t.shouldHandleError||SD)(n)){Ee.withScope(a=>{a.setSDKProcessingMetadata({request:r});let c=s.__sentry_transaction;c&&a.getSpan()===void 0&&a.setSpan(c);let u=Ee.getCurrentHub().getClient();if(u&&Ti.isAutoSessionTrackingEnabled(u)&&u._sessionFlusher!==void 0){let p=a.getRequestSession();p&&p.status!==void 0&&(p.status="crashed")}a.addEventProcessor(l=>(ut.addExceptionMechanism(l,{type:"middleware",handled:!1}),l));let d=Ee.captureException(n);s.sentry=d,i(n)});return}i(n)}}function bD(t={}){return function({path:e,type:n,next:r,rawInput:s}){let i=Ee.getCurrentHub(),o=mn([i,"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]),a=i.getScope().getTransaction();if(a){a.setName(`trpc/${e}`,"route"),a.op="rpc.server";let c={procedure_type:n};(t.attachRpcInput!==void 0?t.attachRpcInput:mn([o,"optionalAccess",u=>u.sendDefaultPii]))&&(c.input=ut.normalize(s)),a.setContext("trpc",c)}return r()}}dt.extractRequestData=c_.extractRequestData;dt.parseRequest=c_.parseRequest;dt.errorHandler=TD;dt.requestHandler=ED;dt.tracingHandler=hD;dt.trpcMiddleware=bD});var d_=g(ne=>{Object.defineProperty(ne,"__esModule",{value:!0});var ID=du(),AD=gu(),vD=yu(),RD=Tu(),CD=Iu(),DD=Ru(),OD=Ou(),ND=Nu(),wD=Mu(),kD=Gu(),PD=Bu();ne.Console=ID.Console;ne.Http=AD.Http;ne.OnUncaughtException=vD.OnUncaughtException;ne.OnUnhandledRejection=RD.OnUnhandledRejection;ne.LinkedErrors=CD.LinkedErrors;ne.Modules=DD.Modules;ne.ContextLines=OD.ContextLines;ne.Context=ND.Context;ne.RequestData=wD.RequestData;ne.LocalVariables=kD.LocalVariables;ne.Undici=PD.Undici});var l_=g(Ve=>{Object.defineProperty(Ve,"__esModule",{value:!0});var Lt=Nc();Ve.Apollo=Lt.Apollo;Ve.Express=Lt.Express;Ve.GraphQL=Lt.GraphQL;Ve.Mongo=Lt.Mongo;Ve.Mysql=Lt.Mysql;Ve.Postgres=Lt.Postgres;Ve.Prisma=Lt.Prisma});var p_=g(A=>{Object.defineProperty(A,"__esModule",{value:!0});var R=N(),xD=jf(),UD=Uc(),MD=zc(),bi=$u(),Yu=Rr(),LD=i_(),qD=ei(),FD=ru(),GD=u_(),BD=d_(),$D=l_(),jD={...R.Integrations,...BD,...$D};A.Hub=R.Hub;A.SDK_VERSION=R.SDK_VERSION;A.Scope=R.Scope;A.addBreadcrumb=R.addBreadcrumb;A.addGlobalEventProcessor=R.addGlobalEventProcessor;A.addIntegration=R.addIntegration;A.captureCheckIn=R.captureCheckIn;A.captureEvent=R.captureEvent;A.captureException=R.captureException;A.captureMessage=R.captureMessage;A.close=R.close;A.configureScope=R.configureScope;A.continueTrace=R.continueTrace;A.createTransport=R.createTransport;A.extractTraceparentData=R.extractTraceparentData;A.flush=R.flush;A.getActiveSpan=R.getActiveSpan;A.getActiveTransaction=R.getActiveTransaction;A.getCurrentHub=R.getCurrentHub;A.getHubFromCarrier=R.getHubFromCarrier;A.lastEventId=R.lastEventId;A.makeMain=R.makeMain;A.runWithAsyncContext=R.runWithAsyncContext;A.setContext=R.setContext;A.setExtra=R.setExtra;A.setExtras=R.setExtras;A.setMeasurement=R.setMeasurement;A.setTag=R.setTag;A.setTags=R.setTags;A.setUser=R.setUser;A.spanStatusfromHttpCode=R.spanStatusfromHttpCode;A.startActiveSpan=R.startActiveSpan;A.startInactiveSpan=R.startInactiveSpan;A.startSpan=R.startSpan;A.startSpanManual=R.startSpanManual;A.startTransaction=R.startTransaction;A.trace=R.trace;A.withScope=R.withScope;A.autoDiscoverNodePerformanceMonitoringIntegrations=xD.autoDiscoverNodePerformanceMonitoringIntegrations;A.NodeClient=UD.NodeClient;A.makeNodeTransport=MD.makeNodeTransport;A.defaultIntegrations=bi.defaultIntegrations;A.defaultStackParser=bi.defaultStackParser;A.getSentryRelease=bi.getSentryRelease;A.init=bi.init;A.DEFAULT_USER_INCLUDES=Yu.DEFAULT_USER_INCLUDES;A.addRequestDataToEvent=Yu.addRequestDataToEvent;A.extractRequestData=Yu.extractRequestData;A.deepReadDirSync=LD.deepReadDirSync;A.getModuleFromFilename=qD.getModuleFromFilename;A.enableAnrDetection=FD.enableAnrDetection;A.Handlers=GD;A.Integrations=jD});var h,Ku=Te(()=>{"use strict";h={GATEWAY_STARTED:"Gateway started",GATEWAY_STOPPED:"Gateway stopped",BOOTSTRAP_APPLIED:"Bootstrap applied",CHANNEL_READY:"Channel ready",CONVERSATION_STARTED:"Conversation started",EVALUATE_CONVERSATION_STARTED:"Evaluate conversation started",CONVERSATION_DELETED:"Conversation deleted",PENDING_CONVERSATION_DENIED:"Pending conversation denied",AGENTS_REFRESHED:"Agents refreshed",USER_DISPATCHED:"User dispatched",SESSION_DISPATCHED:"Session dispatched",SYNC_TICK_COMPLETED:"Sync tick completed",INBOUND_HANDLER_ENTERED:"Inbound handler entered",MESSAGE_RECEIVED:"Message received",MESSAGE_SENT:"Message sent",INBOUND_BUYER_PENDING:"Inbound buyer: no session, group still Unknown (pending)",INBOUND_BUYER_SESSION_AUTO_RECOVERED:"Inbound buyer: session missing for Allowed group, auto-recovered",INBOUND_BLOCKED_SENSITIVE:"Inbound blocked: sensitive word; reply sent",INBOUND_BLOCKED_ADDRESS_MISMATCH:"Inbound blocked: address mismatch",INBOUND_BLOCKED_INELIGIBLE:"Inbound blocked: message-eligible check failed",INBOUND_DROP_EMPTY_CONTENT:"Inbound drop: empty content",INBOUND_DROP_MISSING_JOBID:"Inbound drop: missing jobId",INBOUND_DROP_UNSUPPORTED_MSGTYPE:"Inbound drop: unsupported msgType",INBOUND_DROP_DM_NON_SYSTEM:"Inbound drop: DM sender not in system whitelist",INBOUND_DROP_DM_INVALID_PAYLOAD:"Inbound drop: DM payload invalid",INBOUND_DROP_DM_UNKNOWN_AGENT:"Inbound drop: DM target agent not local",DM_FALLBACK_TO_BACKUP:"DM fallback to backup session",DM_WHITELIST_FAIL_OPEN:"DM whitelist fail-open (empty system accounts)",FILE_UPLOADED:"File uploaded",FILE_DOWNLOADED:"File downloaded",PENDING_LIST_QUERIED:"Pending list queried",AGENT_LIST_QUERIED:"Agent list queried",SESSION_KEY_DERIVED:"Session key derived",CONVERSATION_HISTORY_QUERIED:"Conversation history queried",SESSIONS_QUERIED:"Sessions queried",GROUP_CONSENT_CHANGED:"Group consent changed",SESSION_CREATED:"Session created",SESSION_DELETED:"Session deleted",SESSION_AUTO_RECOVERED:"Session auto-recovered",INBOUND_DELIVERED:"Inbound delivered to session",DM_DELIVERED:"DM delivered to session",OUTBOUND_ELIGIBILITY_CHECKED:"Outbound eligibility checked",AGENT_CLIENT_CREATED:"Agent client created",AGENT_CLIENT_REMOVED:"Agent client removed",ADDRESS_SYNC_COMPLETED:"Address sync completed",AGENT_REFRESH_SESSION_EXPIRED:"Agent refresh aborted: onchainos session expired, local clients taken offline",OFFLINE_REPLAY_MESSAGE_REPLAYED:"Offline replay message replayed",AGENTS_WAKEUP_NOTIFIED:"Agents wakeup notified",CONFIG_SENSITIVE_WORDS_REFRESHED:"Sensitive words config refreshed",CONFIG_SYSTEM_REFRESHED:"System config refreshed",FORCED_UPDATE_STARTED:"Forced update started",FORCED_UPDATE_SUCCEEDED:"Forced update succeeded",GATEWAY_DISCONNECTED:"Gateway disconnected",GATEWAY_REQUEST:"Gateway request",GATEWAY_DELIVERY_BUFFERED:"Gateway delivery buffered",DAEMON_LIFECYCLE_SKIPPED:"Daemon lifecycle skipped",DAEMON_LIFECYCLE_REQUESTED:"Daemon lifecycle requested",PROMPT_USER_CHECKPOINT:"Prompt user checkpoint",USER_WATCH_STARTED:"User watch started",USER_WATCH_EVENT_DELIVERED:"User watch event delivered",INBOUND_DM_RAW:"Inbound DM raw",INBOUND_GROUP_RAW:"Inbound group raw",SYSTEM_NOTIFICATION_RECEIVED:"System notification received",SYSTEM_NOTIFICATION_ROUTED:"System notification routed",HERMES_SESSION_ROUTE_BINDING:"Hermes session route binding",XMTP_CONNECTION_FAILED:"XMTP connection failed",CONVERSATIONS_STREAM_FAILED:"conversations.stream failed",AGENT_START_FAILED:"agent.start failed",AGENT_STREAM_ERROR:"agent stream error",BOOTSTRAP_FAILED:"Bootstrap failed",ONCHAINOS_SESSION_EXPIRED:"Onchainos session expired",ONCHAINOS_CLI_ERROR:"Onchainos CLI error",HEARTBEAT_FAILED:"Heartbeat failed",MESSAGE_PARSE_FAILED:"Message parse failed",MESSAGE_HANDLER_ERROR:"Message handler error",OFFLINE_REPLAY_FAILED:"Offline replay failed",INBOUND_ROUTING_FAILED:"Inbound routing failed",CONVERSATION_NOT_FOUND:"Conversation not found for send",XMTP_SEND_FAILED:"XMTP send failed",AGENT_REFRESH_FAILED:"Agent refresh failed",GROUP_CONSENT_UPDATE_FAILED:"Group consent update failed",TOOL_EXECUTE_FAILED:"Tool execute failed",AGENT_RESOLUTION_FAILED:"Agent resolution failed",USER_DISPATCH_FAILED:"User dispatch failed",INBOUND_ELIGIBILITY_BYPASSED:"Inbound eligibility bypassed",INBOUND_ADDRESS_CHECK_FAILED:"Inbound address check failed",INBOUND_ADDRESS_CHECK_BYPASSED:"Inbound address check bypassed",INBOUND_SENSITIVE_CHECK_FAILED:"Inbound sensitive check failed",FILE_UPLOAD_FAILED:"File upload failed",FILE_DOWNLOAD_FAILED:"File download failed",OFFLINE_REPLAY_MESSAGE_FAILED:"Offline replay message failed",PENDING_NOTIFICATION_FAILED:"Pending notification failed",GATEWAY_CONNECT_FAILED:"Gateway connect failed",GATEWAY_REQUEST_FAILED:"Gateway request failed",PROMPT_USER_FAILED:"Prompt user failed",DAEMON_COMMAND_FAILED:"Daemon command failed",DAEMON_COMMAND_TIMEOUT:"Daemon command timeout",DAEMON_COMMAND_STALE:"Daemon command stale",DAEMON_LIFECYCLE_FAILED:"Daemon lifecycle failed",DAEMON_TICK_FAILED:"Daemon tick failed",DIRECT_CLI_FAILED:"Direct CLI failed",AI_RUN_FAILED:"AI run failed",AI_RUN_TIMEOUT:"AI run timeout",AI_RUN_TOOL_FAILED:"AI run tool failed",IPC_FAILED:"IPC failed",NOTIFY_AGENTS_WAKEUP_FAILED:"Notify agents wakeup failed",OUTBOUND_AGENT_LOOKUP_FAILED:"Outbound agent lookup failed",OUTBOUND_ELIGIBILITY_CHECK_FAILED:"Outbound eligibility check failed",OUTBOUND_ELIGIBILITY_BYPASSED:"Outbound eligibility bypassed",OUTBOUND_BLOCKED_INELIGIBLE:"Outbound blocked: message-eligible check failed",CACHE_LOAD_FAILED:"Cache load failed",CACHE_WRITE_FAILED:"Cache write failed",CONFIG_LOAD_FAILED:"Config load failed",FORCED_UPDATE_FAILED:"Forced update failed",SENTRY_INIT_SKIPPED:"Sentry init skipped",AGENT_DB_DIR_CREATE_FAILED:"Agent DB dir create failed"}});var z,h_,f_,g_,HD,YD,KD,WD,VD,Ii,__,Wu,I,m_,E_,re=Te(()=>{"use strict";ee();z=qh(p_()),h_=require("node:crypto");Ku();Ku();f_=(0,h_.randomUUID)(),g_=new Set(["args","apikey","argv","auth","authorization","authtoken","bearer","body","cache","command","content","credential","credentials","cwd","data","error","failures","filename","file_name","filepath","file_path","headers","input","logpath","message","output","password","params","path","payload","privatekey","prompt","raw","rawevent","rawtext","request","response","accesstoken","refreshtoken","digest","nonce","salt","secret","token","stderr","stdout","title","tooloutput"]),HD=["accesstoken","apikey","authorization","authtoken","content","credential","filepath","logpath","outputpath","password","payload","privatekey","prompt","rawevent","rawtext","refreshtoken","requestbody","responsebody","secret","stderr","stdout","token","tooloutput"],YD=new Set(["onchainosagentlistresultjson","onchainosagentlistdiagnostictext"]),KD=new Set(["agentPlatform","cacheName","checkpoint","code","communicationClass","component","eventName","exitCode","kind","method","onchainosAgentId","operation","phase","platform","provider","reason","role","source","stage","status","subcommand","taskId","type"]),WD=["eventName","cacheName","checkpoint","component","method","operation","phase","reason","code","provider","type","kind","status","subcommand"],VD=new Set([h.GATEWAY_STARTED,h.GATEWAY_STOPPED,h.GATEWAY_DISCONNECTED,h.GATEWAY_REQUEST,h.GATEWAY_DELIVERY_BUFFERED,h.DAEMON_LIFECYCLE_SKIPPED,h.DAEMON_LIFECYCLE_REQUESTED,h.PROMPT_USER_CHECKPOINT,h.USER_WATCH_STARTED,h.USER_WATCH_EVENT_DELIVERED,h.CHANNEL_READY,h.CONVERSATION_STARTED,h.EVALUATE_CONVERSATION_STARTED,h.CONVERSATION_DELETED,h.USER_DISPATCHED,h.SESSION_DISPATCHED,h.SESSION_CREATED,h.SESSION_DELETED,h.SESSION_AUTO_RECOVERED,h.INBOUND_DELIVERED,h.INBOUND_DM_RAW,h.INBOUND_GROUP_RAW,h.SYSTEM_NOTIFICATION_RECEIVED,h.SYSTEM_NOTIFICATION_ROUTED,h.HERMES_SESSION_ROUTE_BINDING,h.INBOUND_BLOCKED_ADDRESS_MISMATCH,h.INBOUND_BLOCKED_INELIGIBLE,h.INBOUND_BLOCKED_SENSITIVE,h.INBOUND_DROP_DM_INVALID_PAYLOAD,h.INBOUND_DROP_DM_NON_SYSTEM,h.INBOUND_DROP_DM_UNKNOWN_AGENT,h.INBOUND_DROP_EMPTY_CONTENT,h.INBOUND_DROP_MISSING_JOBID,h.INBOUND_DROP_UNSUPPORTED_MSGTYPE,h.DM_DELIVERED,h.DM_FALLBACK_TO_BACKUP,h.DM_WHITELIST_FAIL_OPEN,h.INBOUND_BUYER_PENDING,h.INBOUND_BUYER_SESSION_AUTO_RECOVERED,h.MESSAGE_SENT,h.AGENT_CLIENT_CREATED,h.AGENT_CLIENT_REMOVED,h.ADDRESS_SYNC_COMPLETED,h.AGENTS_REFRESHED,h.AGENTS_WAKEUP_NOTIFIED,h.AGENT_LIST_QUERIED,h.BOOTSTRAP_APPLIED,h.CONFIG_SENSITIVE_WORDS_REFRESHED,h.CONFIG_SYSTEM_REFRESHED,h.FORCED_UPDATE_STARTED,h.FORCED_UPDATE_SUCCEEDED,h.CONVERSATION_HISTORY_QUERIED,h.FILE_DOWNLOADED,h.FILE_UPLOADED,h.GROUP_CONSENT_CHANGED,h.INBOUND_HANDLER_ENTERED,h.MESSAGE_RECEIVED,h.OFFLINE_REPLAY_MESSAGE_REPLAYED,h.AGENT_REFRESH_SESSION_EXPIRED,h.OUTBOUND_ELIGIBILITY_CHECKED,h.OUTBOUND_BLOCKED_INELIGIBLE,h.PENDING_CONVERSATION_DENIED,h.PENDING_LIST_QUERIED,h.SESSION_KEY_DERIVED,h.SESSIONS_QUERIED,h.SYNC_TICK_COMPLETED]),Ii=256,__=128,Wu=class t{static instance;initialized=!1;buffer=[];constructor(){}static getInstance(){return t.instance||(t.instance=new t),t.instance}init(e){if(this.initialized){_d("[logger] Already initialized, skipping.");return}try{z.init({dsn:e.dsn,release:e.release,environment:e.environment,maxBreadcrumbs:0,beforeBreadcrumb:()=>null,isInner:!1}),z.setTags({projectName:e.projectName,agentPlatform:e.agentPlatform})}catch{return}this.initialized=!0,this.flush()}info(e,n){let r=t.sanitizeExtra({flowId:f_,...n??{}});if(VD.has(e)){if(!this.initialized){this.buffer.push({level:"info",message:e,extra:r});return}try{z.withScope(s=>{t.applyDiagnostics(s,e,r),z.captureEvent({level:"info",message:e,extra:{...r,eventName:e}})})}catch{}}}error(e,n,r){let s=t.sanitizeExtra({flowId:f_,...r??{}});if(!this.initialized){this.buffer.push({level:"error",message:e,error:n,extra:s});return}try{z.withScope(i=>{i.setLevel("error"),t.applyDiagnostics(i,e,s),z.captureException(t.createSentryEvent(e),{extra:n?{...s,eventName:e,errorName:n.name,errorMessageLength:String(n.message.length)}:s})})}catch{}}async shutdown(){try{await z.close(5e3)}catch{await z.flush(5e3)}}flush(){for(;this.buffer.length>0;){let e=this.buffer.shift();e.level==="info"?this.info(e.message,e.extra):this.error(e.message,e.error,e.extra)}}static sanitizeExtra(e){return Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0).filter(([n])=>!t.isBlockedExtraKey(n)).map(([n,r])=>[n,t.safeValueForKey(n,r)]))}static isBlockedExtraKey(e){let n=e.toLowerCase(),r=t.normalizeSensitiveKey(e);return g_.has(n)||g_.has(r)?!0:t.isSafeMetricKey(r)?!1:HD.some(s=>r.includes(s))}static isSafeMetricKey(e){return/(bytes|count|length|ms|size)$/.test(e)}static safeValueForKey(e,n){return typeof n=="string"&&YD.has(t.normalizeSensitiveKey(e))?n:t.safeValue(n)}static normalizeSensitiveKey(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}static safeValue(e){if(typeof e=="string")return e.length<=Ii?e:`${e.slice(0,Ii)}...`;if(e==null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e instanceof Error)return{name:e.name,messageLength:e.message.length};if(Array.isArray(e))return e.slice(0,20).map(r=>t.safeValue(r));if(typeof e=="object")return Object.fromEntries(Object.entries(e).slice(0,50).filter(([,r])=>r!==void 0).filter(([r])=>!t.isBlockedExtraKey(r)).map(([r,s])=>[r,t.safeValueForKey(r,s)]));let n=String(e);return n.length<=Ii?n:`${n.slice(0,Ii)}...`}static tagValue(e){let n=String(e);return n.length<=__?n:`${n.slice(0,__)}...`}static normalizeTagKey(e){return e.replace(/[^A-Za-z0-9_.:-]+/g,"_").slice(0,32)||"unknown"}static applyDiagnostics(e,n,r){let s={eventName:n,...r};for(let[o,a]of Object.entries(s))KD.has(o)&&e.setTag(t.normalizeTagKey(o),t.tagValue(a));let i=["a2a",n];for(let o of WD){let a=s[o];a&&i.push(`${o}:${t.tagValue(a)}`)}e.setFingerprint(i)}static toPascalCase(e){return e.split(/[\s:]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}static createSentryEvent(e){let n=new Error(e);return n.name=t.toPascalCase(e),n.stack=`${n.name}: ${e}`,n}},I=Wu.getInstance(),m_=t=>I.init(t),E_=()=>I.shutdown()});function Vu(){return En||(process.env.OKX_AGENT_TASK_HOME?(En=Ai(process.env.OKX_AGENT_TASK_HOME),En):(En=Ai((0,vi.join)(JD(),".okx-agent-task")),En))}function Ai(t){return XD(t)}function XD(t){(0,Ri.mkdirSync)(t,{recursive:!0,mode:S_});try{(0,Ri.chmodSync)(t,S_)}catch(e){let n=e.code;if(n!=="EPERM"&&n!=="EACCES")throw e}return t}function JD(){try{let t=(0,T_.homedir)();if(t)return t}catch(t){}return(0,vi.resolve)(process.cwd())}var T_,vi,Ri,En,S_,b_=Te(()=>{"use strict";T_=require("node:os"),vi=require("node:path"),Ri=require("node:fs"),En=null,S_=448});function QD(t=Vu()){return(0,I_.join)(t,"openclaw-gateway.json")}function A_(t,e=Vu()){let n=Ai(e),r=QD(n),s=`${r}.${process.pid}.tmp`,i={version:1,url:t.url,...t.password?{password:t.password}:{},...t.token?{token:t.token}:{},updatedAt:new Date().toISOString(),source:"openclaw-plugin"};(0,ze.writeFileSync)(s,`${JSON.stringify(i,null,2)}
|
|
34
|
+
`,{encoding:"utf8",mode:384});try{(0,ze.chmodSync)(s,384)}catch{}(0,ze.renameSync)(s,r);try{(0,ze.chmodSync)(r,384)}catch{}return r}var ze,I_,v_=Te(()=>{"use strict";ze=require("node:fs"),I_=require("node:path");b_()});function C_(t){return t.includes(Di)||t.includes(`:${Oi}:`)}function R_(t){return t.toLowerCase().startsWith("0x")}function ZD(t){if(typeof t=="string")return`${Di}:${t}`;let e="myAgentId"in t&&"toAgentId"in t?new URLSearchParams({my:t.myAgentId,to:t.toAgentId,job:t.jobId}):new URLSearchParams({my:t.myXmtpAddress,to:t.toXmtpAddress,job:t.jobId});return`${Di}:${e.toString()}`}function Xu(t){let e=`${Di}:`,n=t.indexOf(e);if(n===-1)return null;let r=new URLSearchParams(t.slice(n+e.length)),s=r.get("myAgentId")||r.get("myagentid"),i=r.get("toAgentId")||r.get("toagentid"),o=r.get("my"),a=r.get("to"),c=r.get("job"),u=r.get("gid");return s&&i&&c?{format:"agent",myAgentId:s,toAgentId:i,jobId:c,xmtpGroupId:u??""}:!o||!a||!c?null:!R_(o)&&(a==="_"||!R_(a))?{format:"agent",myAgentId:o,toAgentId:a,jobId:c,xmtpGroupId:u??""}:{format:"address",myXmtpAddress:o,toXmtpAddress:a,jobId:c,xmtpGroupId:u??""}}function zu(t){if(!t)return"";let e=Xu(t);return e?.jobId?e.jobId:/(?:^|:)backup:([^:&]+)/.exec(t)?.[1]??""}function Or(t){let e=t.taskId?.trim()||zu(t.scopeKey)||zu(t.sessionKey);return e?{taskId:e}:{}}function eO(t){let e=typeof t=="string"?t:ZD(t);return(0,Dr.buildAgentSessionKey)({agentId:"main",channel:Oi,peer:{kind:"group",id:e}})}function D_(){let n=Je().config.loadConfig().agents?.list;if(n&&n.length>0){let r=n.find(s=>s.id==="main");return r?r.id:n[0].id}return"main"}function O_(){return(0,Dr.buildAgentSessionKey)({agentId:D_(),channel:Oi,peer:{kind:"group",id:"backup"}})}function tO(t){return(0,Dr.buildAgentSessionKey)({agentId:D_(),channel:Oi,peer:{kind:"group",id:`backup:${t}`}})}function Ni(){let t=Je(),e=t.agent.session.resolveStorePath(void 0,{agentId:"main"}),n=t.agent.session.loadSessionStore(e,{skipCache:!0}),r=new Map,s=new Map;function i(c){if(!(!c||c==="direct"||c==="@direct"))return c.startsWith("telegram:")||c.startsWith("@")?c:`telegram:${c}`}function o(c,u){let d=c.split(":");if(u==="telegram"){let l=d.indexOf("telegram"),p=l>=0?d.slice(l+1):d.slice(3),f=p.indexOf("direct");if(f>=0){let m=f>0?p[f-1]:void 0,E=p[f+1]==="telegram"&&p[f+2]?`telegram:${p[f+2]}`:p[f+1];return{to:i(E),accountId:m}}if(p[0]==="telegram"&&p[1])return{to:`telegram:${p[1]}`,accountId:void 0};if(p[1]==="telegram"&&p[2])return{to:`telegram:${p[2]}`,accountId:p[0]};if(p.length>=2)return{to:i(p[1]),accountId:p[0]};if(p.length===1)return{to:i(p[0]),accountId:void 0}}return{to:d[4],accountId:void 0}}function a(c,u){return typeof c!="string"||c==="direct"||c==="@direct"?u:c}for(let[c,u]of Object.entries(n)){if(C_(c))continue;let d=u;if(d.spawnedBy||d.subagentRole)continue;let l=d.deliveryContext?.channel??d.lastChannel??d.origin?.provider;if(!l)continue;let p=o(c,l),f=a(d.deliveryContext?.to,p.to)??a(d.lastTo,p.to)??p.to,m=d.deliveryContext?.accountId??p.accountId,E=d.lastInteractionAt??d.updatedAt??0;f&&(!s.get(l)||E>(r.get(l)?.updatedAt??0))&&s.set(l,f);let b=r.get(l);(!b||E>b.updatedAt)&&r.set(l,{sessionKey:c,to:f,accountId:m,updatedAt:E})}for(let[c,u]of r)if(!u.to){let d=s.get(c);d&&(u.to=d)}for(let[c,u]of r)y(`[findLatestUserSessions] channel=${c} winner=${u.sessionKey} to=${u.to??"(none)"} accountId=${u.accountId??"(none)"} interactedAt=${u.updatedAt}`);return r}function N_(t){let e=new Set,n=[...t.sessionKey?[t.sessionKey]:[],...Array.isArray(t.sessionKeys)?t.sessionKeys:[]].filter(s=>s.trim()),r=[];t.jobId&&r.push({jobId:t.jobId,myAgentId:t.myAgentId,toAgentId:t.toAgentId,myXmtpAddress:t.myXmtpAddress,toXmtpAddress:t.toXmtpAddress});for(let s of n){if(s.startsWith("agent:")){e.add(s);continue}let i=iO(s);if(i){e.add(tO(i));continue}let o=w_(s);if(o){r.push(o);continue}let a=Xu(s);if(a){r.push(sO(a));continue}e.add(eO(s))}for(let s of nO())for(let i of r)if(rO(s,i)){e.add(s);break}return[...e].sort()}function nO(){let t=Je(),e=t.agent.session.resolveStorePath(void 0,{agentId:"main"}),n=t.agent.session.loadSessionStore(e,{skipCache:!0});return Object.keys(n).filter(C_)}function rO(t,e){let n=Xu(t);if(n)return oO(n,e);let r=w_(t);return r?!(e.jobId&&r.jobId!==e.jobId||e.myAgentId&&r.myAgentId!==e.myAgentId||e.toAgentId&&r.toAgentId!==e.toAgentId||e.myXmtpAddress&&!e.myAgentId||e.toXmtpAddress&&!e.toAgentId):!e.jobId||e.myAgentId||e.toAgentId||e.myXmtpAddress||e.toXmtpAddress?!1:zu(t)===e.jobId}function sO(t){return"myAgentId"in t?{myAgentId:t.myAgentId,toAgentId:t.toAgentId,jobId:t.jobId}:{myXmtpAddress:t.myXmtpAddress,toXmtpAddress:t.toXmtpAddress,jobId:t.jobId}}function w_(t){let e=t.split(":"),n=e.indexOf("job");return n<0||e[n+2]!=="my"||e[n+4]!=="to"||!e[n+1]||!e[n+3]||!e[n+5]?null:{jobId:Ci(e[n+1]),myAgentId:Ci(e[n+3]),toAgentId:Ci(e[n+5])}}function iO(t){return t.startsWith("backup:")?Ci(t.slice(7)):null}function oO(t,e){return e.jobId&&t.jobId!==e.jobId?!1:"myAgentId"in t?!(e.myAgentId&&t.myAgentId!==e.myAgentId||e.toAgentId&&t.toAgentId!==e.toAgentId||e.myXmtpAddress&&!e.myAgentId||e.toXmtpAddress&&!e.toAgentId):!(e.myXmtpAddress&&t.myXmtpAddress.toLowerCase()!==e.myXmtpAddress.toLowerCase()||e.toXmtpAddress&&t.toXmtpAddress.toLowerCase()!==e.toXmtpAddress.toLowerCase()||e.myAgentId&&!e.myXmtpAddress||e.toAgentId&&!e.toXmtpAddress)}function Ci(t){try{return decodeURIComponent(t)}catch{return t}}var Dr,Di,Oi,Nr=Te(()=>{"use strict";ee();Dr=require("openclaw/plugin-sdk/routing");vn();Di="okx-xmtp",Oi="okx-a2a"});function Ju(t){if(t){if(typeof t=="string")return t;if(typeof t=="object"&&t!==null&&"env"in t)return process.env[t.env]||void 0}}function dO(t){return t&&(typeof t=="string"?{type:"string",configured:!0}:typeof t=="object"&&t!==null&&"env"in t?{type:"env",env:String(t.env),configured:!!Ju(t)}:{type:typeof t,configured:!0})}function Qu(t){if(!t||typeof t!="object")return t??null;if(Array.isArray(t))return t.map(n=>Qu(n));let e={};for(let[n,r]of Object.entries(t)){if(/password|token|secret/i.test(n)){e[n]=dO(r);continue}e[n]=Qu(r)}return e}function lO(t){try{return JSON.stringify(t)}catch{return"[unserializable]"}}function pO(t){let e=t.params;if(!e||typeof e!="object"||Array.isArray(e))return Or({taskId:t.taskId});let n=e;return Or({taskId:t.taskId,sessionKey:typeof n.sessionKey=="string"?n.sessionKey:typeof n.key=="string"?n.key:""})}function q_(t){let e={};for(let[n,r]of Object.entries(t))r!=null&&(e[n]=String(r));return e}function ye(t,e={}){let n=q_({phase:t,...e});y(`[gateway] ${t}: ${JSON.stringify(n)}`),I.info(t.startsWith("request_")?h.GATEWAY_REQUEST:h.GATEWAY_STARTED,{component:"openclaw_gateway",...n})}function Sn(t,e,n={},r=h.GATEWAY_CONNECT_FAILED){let s=q_({phase:t,component:"openclaw_gateway",...n});y(`[gateway] ${t}:`,e),I.error(r,e instanceof Error?e:new Error(String(e)),s)}function fO(t){for(let e of Zu)try{e(t)}catch(n){y("[gateway] event handler failed:",n)}}function F_(t){return Zu.add(t),()=>{Zu.delete(t)}}function P_(){ye("ready_gate_reset",{hasSharedClient:!!xe,hasConnected:Pe}),yn=new Promise((t,e)=>{wi=t,ki=e})}function x_(t,e,n){if(xe!==t){ye(`${e}_skip_clear_noncurrent`,n);return}try{t.stop?.()}catch(r){Sn(`${e}_stop_failed`,r,n)}xe=null,Pe=!1,yn=null,wi=null,ki=null,ye(`${e}_cleared_client`,n)}function gO(){if(xe)return ye("reuse_client",{hasConnected:Pe,hasReadyPromise:!!yn}),{client:xe,ready:yn};let t=G_(),{url:e,password:n,token:r}=t,s=(0,ed.randomUUID)(),i=++uO;P_(),ye("init_client",{clientSeq:i,instanceId:s,url:e,hasGatewayConfig:!!t.rawGatewayConfig,gatewayConfig:lO(Qu(t.rawGatewayConfig)),passwordConfigured:!!n,tokenConfigured:!!r,scopes:k_.join(",")});let o=new L_.GatewayClient({url:e,password:n,token:r,instanceId:s,clientName:"gateway-client",clientDisplayName:"okx-a2a-plugin",mode:"backend",role:"operator",scopes:[...k_],onHelloOk:()=>{ye("hello_ok",{clientSeq:i,instanceId:s,url:e}),Pe=!0,wi?.()},onEvent:fO,onClose:(a,c)=>{if(y(`[gateway] closed (${a}): ${c||"no reason"}`),I.info(h.GATEWAY_DISCONNECTED,{clientSeq:String(i),instanceId:s,url:e,code:String(a),reason:c||"no-reason",hadConnected:String(Pe)}),Pe){Pe=!1,P_();return}x_(o,"close_before_connect",{clientSeq:i,instanceId:s,url:e,code:a,reason:c||"no-reason"})},onConnectError:a=>{let c=a;if(c?.retryable){Sn("connect_error_retryable",a,{clientSeq:i,instanceId:s,url:e,retryable:"true",reason:c?.details?.reason??"retryable",code:c?.gatewayCode??c?.details?.code});return}Sn("connect_error",a,{clientSeq:i,instanceId:s,url:e,retryable:"false",code:c?.gatewayCode??c?.details?.code}),ki?.(a instanceof Error?a:new Error(String(a))),x_(o,"connect_error",{clientSeq:i,instanceId:s,url:e,code:c?.gatewayCode??c?.details?.code,reason:c?.details?.reason})}});return xe=o,ye("start_client",{clientSeq:i,instanceId:s,url:e}),o.start(),{client:o,ready:yn}}function G_(){let e=Je().config.loadConfig().gateway;return{url:`ws://127.0.0.1:${U_(process.env.OPENCLAW_GATEWAY_PORT)??U_(e?.port)??cO}`,password:Ju(e?.auth?.password),token:Ju(e?.auth?.token),rawGatewayConfig:e}}function U_(t){if(typeof t=="number"&&Number.isFinite(t)){let o=Math.trunc(t);return o>0&&o<=65535?o:null}if(typeof t!="string")return null;let e=t.trim();if(!e)return null;let n=e.match(/^\d+$/)?.[0],r=e.match(/^\[[^\]]+\]:(\d+)$/)?.[1],s=e.match(/^[^:]+:(\d+)$/)?.[1],i=Number.parseInt(n??r??s??"",10);return!Number.isFinite(i)||i<=0||i>65535?null:i}function B_(){let t=G_();try{let e=A_({url:t.url,password:t.password,token:t.token});return ye("synced_node_gateway_config",{path:e,url:t.url,passwordConfigured:!!t.password,tokenConfigured:!!t.token}),e}catch(e){return Sn("sync_node_gateway_config_failed",e,{url:t.url,passwordConfigured:!!t.password,tokenConfigured:!!t.token},h.GATEWAY_CONNECT_FAILED),null}}function $_(){if(xe){try{xe.stop()}catch{}xe=null,yn=null,wi=null,ki=null,Pe=!1}}function td(t){let e=t,n=e?.gatewayCode??e?.details?.code;if(!n)return null;let r=e?.details??{},s=[`code=${n}`];r.reason&&s.push(`reason=${r.reason}`),r.authReason&&s.push(`authReason=${r.authReason}`),Array.isArray(r.requestedScopes)&&r.requestedScopes.length&&s.push(`requestedScopes=${r.requestedScopes.join(",")}`),r.deviceId&&s.push(`deviceId=${r.deviceId}`),r.requestId&&s.push(`requestId=${r.requestId}`);let i=` (${s.join(", ")})`;switch(n){case"NOT_PAIRED":case"PAIRING_REQUIRED":return`Device pairing approval pending${i}. On the openclaw host run \`openclaw devices approve --latest\` to review and approve the pending request, then retry.`;case"AUTH_SCOPE_MISMATCH":return`Existing device token lacks the required scope${i}. On the openclaw host run \`openclaw devices list\` to find the operator deviceId, then \`openclaw devices rotate --device <id> --role operator --scope operator.admin\` to reissue a token with operator.admin, and restart openclaw.`;case"AUTH_TOKEN_MISSING":case"AUTH_TOKEN_MISMATCH":case"AUTH_DEVICE_TOKEN_MISMATCH":return`Gateway device token is missing or stale${i}. On the openclaw host run \`openclaw devices list\`, then \`openclaw devices remove <deviceId>\`, then restart openclaw to re-pair.`;default:return null}}async function Xe(t){let e=t.timeoutMs??aO,n=Date.now(),r=pO(t);ye("request_start",{method:t.method,timeoutMs:e,hasSharedClient:!!xe,hasConnected:Pe,...r});let{client:s,ready:i}=gO();try{await i}catch(a){let c=Date.now()-n;throw Sn("request_ready_failed",a,{method:t.method,durationMs:c,timeoutMs:e,...r,code:a?.gatewayCode??a?.code??a?.details?.code,reason:"gateway_ready_failed",communicationClass:"openclaw_gateway_connect"},h.GATEWAY_REQUEST_FAILED),a}let o=Date.now()-n;ye("request_ready",{method:t.method,readyWaitMs:o,timeoutMs:e,hasConnected:Pe,...r});try{let a=await s.request(t.method,t.params,{timeoutMs:e});return ye("request_done",{method:t.method,durationMs:Date.now()-n,timeoutMs:e,...r}),a}catch(a){let c=Date.now()-n,u=/timeout|timed out/i.test(String(a?.message??a??""));Sn("request_error",a,{method:t.method,durationMs:c,timeoutMs:e,readyWaitMs:o,...r,isTimeout:u,code:a?.gatewayCode??a?.code??a?.details?.code,reason:u?"gateway_request_timeout":"gateway_request_error",communicationClass:"openclaw_gateway_rpc"},h.GATEWAY_REQUEST_FAILED);let d=td(a);if(d){let l=a?.message??String(a);try{a.message=`${l}
|
|
35
|
+
${d}`}catch{}}throw a}}async function Pi(t){return Xe({method:"sessions.create",params:t})}async function j_(t){return Xe({method:"sessions.delete",params:t})}async function wr(t){let e=t.idempotencyKey??(0,ed.randomUUID)(),n={key:t.key,message:t.message,idempotencyKey:e};try{let r=await Xe({method:"sessions.send",params:n});return{runId:M_(r),raw:r}}catch(r){let s=r?.gatewayCode??r?.code,i=String(r?.message??"");if(s==="INVALID_REQUEST"&&i.includes("session not found")){await Pi({key:t.key}),I.info(h.SESSION_AUTO_RECOVERED,{sessionKey:t.key,trigger:"sessions.send"});let o=await Xe({method:"sessions.send",params:n});return{runId:M_(o),raw:o}}throw r}}function M_(t){if(!t||typeof t!="object")return;let e=t.runId;return typeof e=="string"&&e.trim()?e:void 0}async function kr(t){try{return await Xe({method:"chat.inject",params:t})}catch(e){let n=e?.gatewayCode??e?.code,r=String(e?.message??"");if(n==="INVALID_REQUEST"&&r.includes("session not found"))return await Pi({key:t.sessionKey}),I.info(h.SESSION_AUTO_RECOVERED,{sessionKey:t.sessionKey,trigger:"chat.inject"}),await Xe({method:"chat.inject",params:t});throw e}}var L_,ed,aO,cO,k_,uO,xe,yn,wi,ki,Pe,Zu,Tn=Te(()=>{"use strict";ee();L_=require("openclaw/plugin-sdk/gateway-runtime"),ed=require("node:crypto");vn();re();v_();Nr();aO=2e4,cO=18789,k_=["operator.admin"],uO=0;xe=null,yn=null,wi=null,ki=null,Pe=!1,Zu=new Set});var V_={};fd(V_,{isPromptUserSessionRunning:()=>_O,markPromptUserSessionEnded:()=>id,markPromptUserSessionRunning:()=>sd,queuePromptUserAction:()=>hO});function qt(t){let e=Y_.get(t);return e||(e={running:!1,processing:!1,queue:[]},Y_.set(t,e)),e}function nd(t,e,n){t.fallbackTimer&&(clearTimeout(t.fallbackTimer),t.fallbackTimer=void 0,e&&y(`[xmtp_prompt_user:queue] fallback cleared sessionKey=${e}${n?` reason=${n}`:""}`))}function rd(t,e){nd(e,t,"reschedule");let n=e.queue[0];if(!n||e.processing)return;let r=Math.max(0,n.deadlineAt-Date.now());y(`[xmtp_prompt_user:queue] fallback scheduled sessionKey=${t} channel=${n.channel} delayMs=${r} queued=${e.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"fallback_scheduled",sessionKey:t,channel:n.channel,taskId:n.taskId,delayMs:r,queued:e.queue.length})),e.fallbackTimer=setTimeout(()=>{let s=qt(t);s.fallbackTimer=void 0,y(`[xmtp_prompt_user:queue] fallback fired sessionKey=${t} queued=${s.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"fallback_fired",sessionKey:t,taskId:s.queue[0]?.taskId,queued:s.queue.length,reason:"fallback_timeout"})),xr(t,"fallback_timeout")},r)}async function xr(t,e){let n=qt(t);if(n.processing)return;let r=n.queue.shift();if(!r){nd(n,t,"empty_queue"),y(`[xmtp_prompt_user:queue] dispatch skipped empty sessionKey=${t} reason=${e}`);return}nd(n,t,e),n.processing=!0;try{y(`[xmtp_prompt_user:queue] dispatch sessionKey=${t} channel=${r.channel} reason=${e} remaining=${n.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"dispatch_started",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,queued:n.queue.length}));let s=await z_({...r,onRunStarted:i=>{let o=xi.get(i);if(o){y(`[xmtp_prompt_user:queue] run already completed sessionKey=${t} channel=${r.channel} runId=${i} state=${o.state} completedAt=${o.completedAt}`),xi.delete(i);return}Pr.set(i,{sessionKey:t,channel:r.channel,taskId:r.taskId,startedAt:Date.now()}),y(`[xmtp_prompt_user:queue] run pending sessionKey=${t} channel=${r.channel} runId=${i}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"run_pending",sessionKey:t,channel:r.channel,taskId:r.taskId,runId:i}))}});n.running=!s.runId||Pr.has(s.runId),y(`[xmtp_prompt_user:queue] dispatch completed sessionKey=${t} channel=${r.channel} reason=${e} running=${n.running?1:0} runId=${s.runId??"(none)"}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"dispatch_completed",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,running:n.running?1:0,runId:s.runId,queued:n.queue.length}))}catch(s){y(`[xmtp_prompt_user:queue] dispatch failed sessionKey=${t} channel=${r.channel} reason=${e}:`,s),I.error(h.PROMPT_USER_FAILED,s instanceof Error?s:new Error(String(s)),lt({checkpoint:"dispatch_failed",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,queued:n.queue.length}))}finally{n.processing=!1}if(n.queue.length===0){y(`[xmtp_prompt_user:queue] queue drained sessionKey=${t}`);return}if(n.running){y(`[xmtp_prompt_user:queue] queue waiting sessionKey=${t} queued=${n.queue.length} running=1`),rd(t,n);return}y(`[xmtp_prompt_user:queue] queue continues sessionKey=${t} queued=${n.queue.length} running=0`),xr(t,"session_idle")}function _O(t){return qt(t).running}async function hO(t){let e=t.target.sessionKey,n=qt(e);return n.queue.push({...t,deadlineAt:Date.now()+W_}),n.running||n.processing||n.queue.length>1?(n.queue.length===1&&rd(e,n),y(`[xmtp_prompt_user:queue] queued sessionKey=${e} channel=${t.channel} size=${n.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"queued",sessionKey:e,channel:t.channel,taskId:t.taskId,queued:n.queue.length,running:n.running?1:0,processing:n.processing?1:0})),{status:"queued",size:n.queue.length}):(await xr(e,"session_idle"),{status:"dispatched",size:n.queue.length})}function sd(t){let e=qt(t);e.running=!0;let n=e.queue[0];n&&(n.deadlineAt=Date.now()+W_,y(`[xmtp_prompt_user:queue] fallback reset sessionKey=${t} channel=${n.channel} queued=${e.queue.length}`),rd(t,e)),y(`[xmtp_prompt_user:queue] agent_start sessionKey=${t} queued=${e.queue.length}`)}function id(t){let e=qt(t),n=mO(t);if(n.length>0){y(`[xmtp_prompt_user:queue] agent_end sessionKey=${t} queued=${e.queue.length} pendingRunIds=${n.join(",")} waiting=run_final`);return}e.running=!1,y(`[xmtp_prompt_user:queue] agent_end sessionKey=${t} queued=${e.queue.length}`),e.queue.length>0&&xr(t,"agent_end")}function mO(t){let e=[];for(let[n,r]of Pr)r.sessionKey===t&&e.push(n);return e}function K_(t,e,n){xi.set(t,{state:e,sessionKey:n,completedAt:Date.now()}),setTimeout(()=>{xi.delete(t)},60*1e3)}function EO(t,e,n,r,s){let i=qt(t);i.running=!1,y(`[xmtp_prompt_user:queue] run completed sessionKey=${t} runId=${e} state=${n} durationMs=${r} queued=${i.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"run_completed",sessionKey:t,taskId:s,runId:e,status:n,durationMs:r,queued:i.queue.length})),i.queue.length>0&&xr(t,`run_${n}`)}function lt(t){return Object.entries({component:"openclaw_prompt_user_queue",operation:"xmtp_prompt_user",checkpoint:t.checkpoint,sessionKey:t.sessionKey,channel:t.channel??"",taskId:t.taskId??"",runId:t.runId??"",reason:t.reason??"",status:t.status??"",queued:t.queued??"",delayMs:t.delayMs??"",durationMs:t.durationMs??"",running:t.running??"",processing:t.processing??""}).filter(([,n])=>n!=="").reduce((n,[r,s])=>(n[r]=String(s),n),{})}var W_,Y_,Pr,xi,od=Te(()=>{"use strict";ee();Ui();Tn();re();W_=300*1e3,Y_=new Map,Pr=new Map,xi=new Map;F_(t=>{let e=t;if(e.event!=="chat"||!e.payload||typeof e.payload!="object")return;let n=e.payload,r=typeof n.runId=="string"?n.runId:"";if(!r)return;let s=typeof n.state=="string"?n.state:"",i=Pr.get(r);if(!i){(s==="final"||s==="error")&&K_(r,s,String(n.sessionKey??""));return}y(`[xmtp_prompt_user:queue] observed chat event runId=${r} state=${s||"(none)"} sessionKey=${String(n.sessionKey??"")}`),!(s!=="final"&&s!=="error")&&(Pr.delete(r),K_(r,s,String(n.sessionKey??"")),EO(i.sessionKey,r,s,Date.now()-i.startedAt,i.taskId))})});async function z_(t){let{channel:e,target:n,llmContent:r,userContent:s}=t,i=await wr({key:n.sessionKey,message:r});if(i.runId?t.onRunStarted?.(i.runId):y(`[xmtp_prompt_user:queue] sessions.send returned without runId sessionKey=${n.sessionKey} channel=${e}`),n.to&&!X_.has(e)){let o={to:n.to,message:s,channel:e,sessionKey:n.sessionKey,idempotencyKey:(0,Mi.randomUUID)()};return n.accountId&&(o.accountId=n.accountId),await Xe({method:"send",params:o}),{runId:i.runId}}return await kr({sessionKey:n.sessionKey,message:s}),{runId:i.runId}}async function Li(t){let e=Ni();if(e.size===0)return y("[okx-a2a:gateway-method] dispatch_user no deliverable user session found"),{ok:!1,dispatched:[],failed:[]};let n=[],r=[],s=t.label?`[${t.label}] ${t.content}`:t.content;for(let[i,o]of e)if(!ad.has(i))try{if(o.to&&!X_.has(i)){let a={to:o.to,message:s,channel:i,sessionKey:o.sessionKey,idempotencyKey:(0,Mi.randomUUID)()};o.accountId&&(a.accountId=o.accountId),await Xe({method:"send",params:a})}else await kr({sessionKey:o.sessionKey,message:t.content,label:t.label});n.push({channel:i,sessionKey:o.sessionKey}),y(`[okx-a2a:gateway-method] dispatch_user delivered channel=${i} sessionKey=${o.sessionKey}`)}catch(a){let c=a instanceof Error?a.message:String(a);r.push({channel:i,sessionKey:o.sessionKey,error:c}),y(`[okx-a2a:gateway-method] dispatch_user failed channel=${i} sessionKey=${o.sessionKey}: ${c}`),I.error(h.USER_DISPATCH_FAILED,a instanceof Error?a:new Error(String(a)),{source:"okx-a2a.dispatch_user",channel:i,sessionKey:o.sessionKey,hasTo:o.to?"1":"0"})}return{ok:n.length>0&&r.length===0,dispatched:n,failed:r}}async function qi(t){let{queuePromptUserAction:e}=await Promise.resolve().then(()=>(od(),V_)),n=Ni();if(n.size===0)return y("[okx-a2a:gateway-method] prompt_user no deliverable user session found"),{ok:!1,dispatched:[],failed:[]};let r=[],s=[];for(let[i,o]of n)if(!ad.has(i))try{let a=await e({channel:i,target:o,llmContent:t.llmContent,userContent:t.userContent});r.push({channel:i,sessionKey:o.sessionKey,status:a.status,size:a.size}),y(`[okx-a2a:gateway-method] prompt_user ${a.status} channel=${i} sessionKey=${o.sessionKey} size=${a.size}`)}catch(a){let c=a instanceof Error?a.message:String(a);s.push({channel:i,sessionKey:o.sessionKey,error:c}),y(`[okx-a2a:gateway-method] prompt_user failed channel=${i} sessionKey=${o.sessionKey}: ${c}`),I.error(h.PROMPT_USER_FAILED,a instanceof Error?a:new Error(String(a)),{source:"okx-a2a.prompt_user",channel:i,sessionKey:o.sessionKey})}return{ok:r.length>0&&s.length===0,dispatched:r,failed:s}}async function J_(t,e){let n=Ni();if(n.size===0)return y("[sendLlmToLatestUserSessions] no latest user session found"),{dispatched:[],failed:[]};let r=[],s=[];for(let[i,o]of n)if(!ad.has(i))try{await Je().subagent.run({sessionKey:o.sessionKey,message:t,deliver:!0,idempotencyKey:(0,Mi.randomUUID)()}),r.push(i),y(`[sendLlmToLatestUserSessions] sent to ${i} sessionKey=${o.sessionKey}`)}catch(a){s.push(i),y(`[sendLlmToLatestUserSessions] send to ${i} failed:`,a),I.error(h.USER_DISPATCH_FAILED,a instanceof Error?a:new Error(String(a)),{source:e?.source??"sendLlmToLatestUserSessions",channel:i,sessionKey:o.sessionKey})}return{dispatched:r,failed:s}}var Mi,ad,X_,Ui=Te(()=>{"use strict";ee();Mi=require("node:crypto");Tn();Nr();re();vn();ad=new Set(["heartbeat","cron","webhook","voice"]),X_=new Set(["webchat","tui"])});var VO={};fd(VO,{default:()=>WO});module.exports=Fh(VO);ee();vn();ee();re();var zD="main",y_={id:"okx-a2a",meta:{id:"okx-a2a",label:"OKX A2A",selectionLabel:"OKX A2A",docsPath:"channels/okx-a2a",blurb:"E2E encrypted communication (wallet-to-agent)",order:101},capabilities:{chatTypes:["group"],media:!1,reply:!0},reload:{configPrefixes:["channels.okx-a2a"]},config:{resolveAccount:async()=>({}),listAccountIds:()=>[zD]},outbound:{deliveryMode:"direct"},gateway:{startAccount:async t=>{t.setStatus({accountId:t.accountId,connected:!0,lastConnectedAt:Date.now(),lastEventAt:Date.now()}),y(`[okx-a2a:${t.accountId}] startAccount activated`),await new Promise(e=>{t.abortSignal.addEventListener("abort",()=>e(),{once:!0})}),y(`[okx-a2a:${t.accountId}] received abort signal, cleaning up...`)},stopAccount:async()=>{y("[okx-a2a] stopAccount"),await E_()}}};ee();Tn();Nr();re();var H_=async t=>{let e=N_(t),n=[];for(let r of e)await j_({key:r,...t.deleteTranscript!==void 0?{deleteTranscript:t.deleteTranscript}:{}}),n.push(r),y(`[okx-a2a] session deleted: ${r}`),I.info(h.SESSION_DELETED,{sessionKey:r,...Or({sessionKey:r})});return{ok:!0,deleted:n.length,deletedSessionKeys:n,matched:e.length}};Tn();Nr();Ui();od();ee();var Q_=require("node:os"),cd=require("node:path"),Z_=require("node:fs");Tn();Ui();re();var yO=15e3,SO=50;function TO(t=process.env){return t.OKX_AGENT_TASK_HOME?.trim()||(0,cd.join)((0,Q_.homedir)(),".okx-agent-task")}function bO(t=process.env){return t.OKX_A2A_OUTBOX_DB_PATH?.trim()||(0,cd.join)(TO(t),"sqlite","session-store.sqlite")}function IO(){let t=process.emitWarning;process.emitWarning=((e,...n)=>{if(!((typeof e=="string"?e:e.message).includes("SQLite is an experimental feature")&&n.some(s=>s==="ExperimentalWarning")))return t.call(process,e,...n)});try{return require("node:sqlite")}finally{process.emitWarning=t}}async function AO(t){let e=t.message_id??void 0;if(t.kind==="dispatch_user_latest"){let n=await Li({content:t.content});if(!n.ok)throw new Error(`dispatch_user_latest delivered=${n.dispatched.length} failed=${n.failed.length}`);return}if(t.kind==="prompt_user_latest"){if(!t.llm_content)throw new Error("prompt_user_latest missing llm_content");let n=await qi({userContent:t.content,llmContent:t.llm_content});if(!n.ok)throw new Error(`prompt_user_latest delivered=${n.dispatched.length} failed=${n.failed.length}`);return}if(t.kind==="chat_inject"){await kr({sessionKey:t.session_key,message:t.content}),t.llm_content&&await wr({key:t.session_key,message:t.llm_content,idempotencyKey:e});return}await wr({key:t.session_key,message:t.content,idempotencyKey:e})}async function vO(t={}){let e=t.dbPath??bO();if(!(0,Z_.existsSync)(e))return{delivered:0,failed:0,skipped:!0};let{DatabaseSync:n}=IO(),r=new n(e);try{if(r.exec("PRAGMA busy_timeout=5000"),r.exec("PRAGMA journal_mode=WAL"),!r.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='pending_gateway_deliveries'").get())return{delivered:0,failed:0,skipped:!0};let i=r.prepare(`
|
|
36
36
|
SELECT id, kind, provider, session_key, job_id, content, llm_content, message_id, attempts
|
|
37
37
|
FROM pending_gateway_deliveries
|
|
38
38
|
WHERE provider = 'openclaw'
|
|
39
39
|
ORDER BY created_at ASC, id ASC
|
|
40
40
|
LIMIT ?
|
|
41
|
-
`).all(t.limit??
|
|
41
|
+
`).all(t.limit??SO),o=0,a=0;for(let c of i)try{await AO(c),r.prepare("DELETE FROM pending_gateway_deliveries WHERE id = ?").run(c.id),o+=1}catch(u){a+=1;let d=u instanceof Error?u.message:String(u);r.prepare(`
|
|
42
42
|
UPDATE pending_gateway_deliveries
|
|
43
43
|
SET attempts = attempts + 1, last_error = ?, last_attempt_at = ?
|
|
44
44
|
WHERE id = ?
|
|
45
|
-
`).run(d,new Date().toISOString(),c.id),y(`[okx-a2a:outbox-drain] delivery failed id=${c.id} kind=${c.kind}: ${d}`)}return(o>0||a>0)&&I.info(h.SESSION_DISPATCHED,{onchainosAgentId:"*",source:"gateway_outbox_drain",deliveredCount:String(o),failedCount:String(a),batchSize:String(i.length)}),{delivered:o,failed:a,skipped:!1}}finally{r.close()}}function Z_(t={}){let e=t.intervalMs??mO,n=!1,r=async()=>{if(!n){n=!0;try{await IO({...t.dbPath!==void 0?{dbPath:t.dbPath}:{},...t.limit!==void 0?{limit:t.limit}:{}})}catch(i){y("[okx-a2a:outbox-drain] tick failed:",i)}finally{n=!1}}},s=setInterval(()=>{r()},e);return s.unref?.(),r(),()=>{clearInterval(s)}}ee();var Ur=require("node:child_process"),ud=require("node:fs"),Fi=require("node:os"),bn=require("node:path"),eh=require("node:util");re();var th=(0,eh.promisify)(Ur.execFile),AO=12e4,dd=3e4,nh=5e3,rh=[(0,bn.join)((0,Fi.homedir)(),".local","bin"),(0,bn.join)((0,Fi.homedir)(),"Library","pnpm"),(0,bn.join)((0,Fi.homedir)(),".npm-global","bin"),"/opt/homebrew/bin","/usr/local/bin"];function X(t,e){return{source:"openclaw_gateway",provider:"openclaw",action:t,...e??{}}}async function Gi(t,e=dd){let n=process.env.OKX_A2A_BIN?.trim();if(n)return sh(`${n} ${t.map(ch).join(" ")}`,e,Bi());let r=await vO();if(!r)return{ok:!1,stdout:"",stderr:"okx-a2a binary not found"};try{let{stdout:s,stderr:i}=await th(r,t,{timeout:e,env:Bi()});return{ok:!0,stdout:s,stderr:i}}catch(s){let i=s;return{ok:!1,stdout:String(i.stdout??""),stderr:String(i.stderr??i.message??s)}}}async function vO(){let t=await sh("command -v okx-a2a",dd),e=t.stdout.trim().split(/\r?\n/)[0]?.trim();if(t.ok&&e)return e;for(let n of rh){let r=(0,bn.join)(n,"okx-a2a");if((0,ud.existsSync)(r))return r}return null}function RO(){let t=oh("command -v okx-a2a",dd),e=t.stdout.trim().split(/\r?\n/)[0]?.trim();if(t.ok&&e)return e;for(let n of rh){let r=(0,bn.join)(n,"okx-a2a");if((0,ud.existsSync)(r))return r}return null}async function sh(t,e,n=process.env){try{let{stdout:r,stderr:s}=await th(ah(),["-lc",t],{timeout:e,env:n});return{ok:!0,stdout:r,stderr:s}}catch(r){let s=r;return{ok:!1,stdout:String(s.stdout??""),stderr:String(s.stderr??s.message??r)}}}function ih(t,e=nh){let n=process.env.OKX_A2A_BIN?.trim();if(n)return oh(`${n} ${t.map(ch).join(" ")}`,e,Bi());let r=RO();if(!r)return{ok:!1,stdout:"",stderr:"okx-a2a binary not found"};try{return{ok:!0,stdout:(0,Ur.execFileSync)(r,t,{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:e,env:Bi()}),stderr:""}}catch(s){let i=s;return{ok:!1,stdout:String(i.stdout??""),stderr:String(i.stderr??i.message??s)}}}function oh(t,e,n=process.env){try{return{ok:!0,stdout:(0,Ur.execFileSync)(ah(),["-lc",t],{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:e,env:n}),stderr:""}}catch(r){let s=r;return{ok:!1,stdout:String(s.stdout??""),stderr:String(s.stderr??s.message??r)}}}function ah(){return process.env.SHELL||"/bin/sh"}function Bi(){return{...process.env,OKX_A2A_RUNTIME_CONTEXT:"openclaw-gateway",OKX_A2A_IN_GATEWAY:"1",OKX_A2A_GATEWAY_PROVIDER:"openclaw"}}function ch(t){return`'${t.replace(/'/g,"'\\''")}'`}function CO(t){let e=t.trim();return e.startsWith("running ")?"running":e.startsWith("stale ")?"stale":e==="stopped"?"stopped":"unknown"}function uh(t){let e=t.trim().split(/\r?\n/).reverse();for(let n of e){let r=n.trim();if(r.startsWith("{"))try{let s=JSON.parse(r);if(s&&typeof s=="object"&&!Array.isArray(s))return s}catch{}}return null}async function DO(){let t=await Gi(["ai-provider","status","--json"]);if(!t.ok)return y("[okx-a2a:daemon] ai-provider status failed:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a ai-provider status failed"),X("provider_status",{status:"failed",stderr:t.stderr,stdout:t.stdout})),null;let n=uh(t.stdout)?.provider;return typeof n!="string"&&I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_status",{reason:"invalid_provider_status_output",status:"skipped",stdout:t.stdout})),typeof n=="string"?n:null}function OO(){let t=ih(["ai-provider","status","--json"]);if(!t.ok)return y("[okx-a2a:daemon] ai-provider status failed during gateway signal:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a ai-provider status failed during gateway signal"),X("provider_status_signal",{status:"failed",stderr:t.stderr,stdout:t.stdout})),null;let n=uh(t.stdout)?.provider;return typeof n!="string"&&I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_status_signal",{reason:"invalid_provider_status_output",status:"skipped",stdout:t.stdout})),typeof n=="string"?n:null}async function dh(){let t=await DO();return t!=="openclaw"?(y(`[okx-a2a:daemon] provider=${t??"(not set)"}; skipping OpenClaw-owned daemon lifecycle`),I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_mismatch",{selectedProvider:t??"",reason:"provider_not_openclaw",status:"skipped"})),!1):!0}function NO(){let t=OO();return t!=="openclaw"?(y(`[okx-a2a:daemon] provider=${t??"(not set)"}; skipping OpenClaw-owned daemon lifecycle during gateway signal`),I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_mismatch_signal",{selectedProvider:t??"",reason:"provider_not_openclaw",status:"skipped"})),!1):!0}async function lh(){if(!await dh())return;let t=await Gi(["daemon","status"]),e=t.ok?CO(t.stdout):"unknown";t.ok||y("[okx-a2a:daemon] status failed:",(t.stderr||t.stdout).trim()),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("restart",{previousStatus:e,status:"requested"}));let n=await Gi(["daemon","restart"],AO);if(!n.ok){y("[okx-a2a:daemon] restart failed:",(n.stderr||n.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon restart failed"),X("restart",{previousStatus:e,status:"failed",stderr:n.stderr,stdout:n.stdout}));return}let r=n.stdout.trim();y(`[okx-a2a:daemon] ${r||"restart ok"} selectedProvider=openclaw previousStatus=${e}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("restart",{previousStatus:e,status:"ok"}))}async function ph(){if(!await dh())return;I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop",{status:"requested"}));let t=await Gi(["daemon","stop"]);if(!t.ok){y("[okx-a2a:daemon] stop failed:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon stop failed"),X("stop",{status:"failed",stderr:t.stderr,stdout:t.stdout}));return}y(`[okx-a2a:daemon] ${t.stdout.trim()||"stop ok"}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop",{status:"ok"}))}function wO(t){if(!NO())return;I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop_signal",{reason:t,status:"requested"}));let e=ih(["daemon","stop"],nh);if(!e.ok){y(`[okx-a2a:daemon] stop failed during ${t}:`,(e.stderr||e.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon stop failed during gateway signal"),X("stop_signal",{reason:t,status:"failed",stderr:e.stderr,stdout:e.stdout}));return}y(`[okx-a2a:daemon] ${e.stdout.trim()||"stop ok"} reason=${t}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop_signal",{reason:t,status:"ok"}))}function fh(){let t=e=>{wO(e)};return process.on("SIGTERM",t),process.on("SIGINT",t),()=>{process.off("SIGTERM",t),process.off("SIGINT",t)}}ee();re();ee();var $i=require("node:fs"),_h=require("node:child_process"),hh=require("node:util");re();var mh=(0,hh.promisify)(_h.execFile),pt=null,gh=new Set(["--message"]);async function kO(){if(pt)return pt;let t=process.env.ONCHAINOS_BIN;if(t)return y(`[onchainos] using ONCHAINOS_BIN=${t}`),pt=t,pt;try{let e=process.env.SHELL||"/bin/bash",{stdout:n}=await mh(e,["-lc","command -v onchainos"]),r=xO(n);if(r)return y(`[onchainos] resolved binary via shell: ${r}`),pt=r,pt}catch(e){y("[onchainos] shell resolve failed, will fallback to bare 'onchainos':",e)}return y("[onchainos] could not resolve binary path, falling back to bare 'onchainos'"),pt="onchainos",pt}function xO(t){let e=t.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).reverse();for(let n of e)if(PO(n))return n;return null}function PO(t){try{return(0,$i.accessSync)(t,$i.constants.X_OK),!0}catch{return!1}}function Eh(t){let e=[],n=!1;for(let r of t){if(n){e.push("<redacted>"),n=!1;continue}let s=[...gh].find(i=>r.startsWith(`${i}=`));if(s){e.push(`${s}=<redacted>`);continue}e.push(r),gh.has(r)&&(n=!0)}return e}function UO(t,e){return`${t} ${Eh(e).join(" ")}`}async function yh(t){let e=await kO(),n=UO(e,t);y(`[onchainos] exec: ${n}`);let r=Date.now();try{let s=await mh(e,t);return y(`[onchainos] exec done: ${n} (${Date.now()-r}ms, stdout=${s.stdout.length}B, stderr=${s.stderr.length}B)`),s}catch(s){throw y(`[onchainos] exec error: ${n} (${Date.now()-r}ms) code=${s.code} signal=${s.signal} killed=${s.killed} message=${s.message}`),I.error(h.ONCHAINOS_CLI_ERROR,new Error("onchainos command failed"),{component:"onchainos_cli",source:"onchainos",stage:"exec",communicationClass:"onchainos_cli_or_api_issue",operation:Eh(t).slice(0,3).join(" "),reason:"exec_failed",argCount:String(t.length),exitCode:String(s?.code??""),signal:String(s?.signal??""),killed:String(s?.killed??""),stderrBytes:String(Buffer.byteLength(String(s?.stderr??""),"utf8")),stdoutBytes:String(Buffer.byteLength(String(s?.stdout??""),"utf8")),cliErrorName:s instanceof Error?s.name:"",cliErrorMessageLength:String(String(s?.message??"").length),durationMs:String(Date.now()-r)}),s}}re();var Sh={OK_FALSE:"ok_false",JSON_PARSE_FAILED:"json_parse_failed"};function Th(t){let e="0";try{JSON.parse(t),e="1"}catch{e="0"}return{responseBytes:String(Buffer.byteLength(t,"utf8")),responseJson:e}}function bh(t,e,n){return{component:"onchainos_cli",source:"onchainos",stage:"ok_false",communicationClass:"onchainos_cli_or_api_issue",operation:e,reason:Sh.OK_FALSE,...Th(t),...n}}function Ih(t,e,n={}){try{return JSON.parse(t)}catch(r){let s=r instanceof Error?r:new Error(String(r));throw I.error(h.ONCHAINOS_CLI_ERROR,s,{component:"onchainos_cli",source:"onchainos",stage:"json_parse",communicationClass:"onchainos_cli_or_api_issue",operation:e,reason:Sh.JSON_PARSE_FAILED,...Th(t),...n}),s}}re();var Ah=/session expired/i;function ld(t){try{let e=JSON.parse(t);return e.ok===!1&&Ah.test(String(e.error??""))}catch{return Ah.test(t)}}function vh(t){I.error(h.ONCHAINOS_SESSION_EXPIRED,new Error("onchainos session expired"),{component:"onchainos_cli",source:"onchainos",stage:"session_expired",operation:t,command:t,communicationClass:"onchainos_auth_issue",reason:"session_expired"})}function Rh(t,e){if(e?.notifySessionExpired){e.notifySessionExpired(t);return}vh(t)}function MO(t,e,n){ld(t)&&Rh(e,n)}function LO(t,e,n){let r=String(t?.stdout??"");r&&ld(r)&&Rh(e,n)}async function Ch(t){y("[onchainos] fetching system-config");let e,n;try{({stdout:e,stderr:n}=await yh(["agent","system-config"]))}catch(s){throw LO(s,"system-config",t),s}n&&y(`[onchainos] stderr (system-config): ${n}`);let r=Ih(e,"system-config");if(!r.ok){MO(e,"system-config",t);let s=new Error("onchainos agent system-config failed");throw I.error(h.ONCHAINOS_CLI_ERROR,s,bh(e,"system-config")),s}return y(`[onchainos] fetched system-config: ${Object.keys(r.data).length} keys`),r.data}re();var qO=process.env.SENTRY_ENV==="dev"?"dev":"prod",Dh={projectName:"okx/openclaw-okx-a2a-extension",release:"0.0.13",environment:qO};var In,An,Mr;function FO(t){let e=t?.details?.requestId;return typeof e=="string"&&e.trim()?`openclaw devices approve ${e}`:"openclaw devices approve --latest"}function GO(t){let e=t?.details??{},n=td(t);return["OKX A2A plugin needs OpenClaw gateway `operator.admin` scope before it can create sessions, inject chat messages, and route XMTP conversations.","","Ask the user whether they approve granting this scope to the OKX A2A plugin.","","If the user approves, ask them to run this command on the OpenClaw host:","","```bash",FO(t),"```","",`requestId: ${e.requestId??""}`,`deviceId: ${e.deviceId??""}`,`requestedScopes: ${Array.isArray(e.requestedScopes)?e.requestedScopes.join(","):""}`,`approvedScopes: ${Array.isArray(e.approvedScopes)?e.approvedScopes.join(","):""}`,n?`hint: ${n}`:""].filter(Boolean).join(`
|
|
46
|
-
`)}function
|
|
45
|
+
`).run(d,new Date().toISOString(),c.id),y(`[okx-a2a:outbox-drain] delivery failed id=${c.id} kind=${c.kind}: ${d}`)}return(o>0||a>0)&&I.info(h.SESSION_DISPATCHED,{onchainosAgentId:"*",source:"gateway_outbox_drain",deliveredCount:String(o),failedCount:String(a),batchSize:String(i.length)}),{delivered:o,failed:a,skipped:!1}}finally{r.close()}}function eh(t={}){let e=t.intervalMs??yO,n=!1,r=async()=>{if(!n){n=!0;try{await vO({...t.dbPath!==void 0?{dbPath:t.dbPath}:{},...t.limit!==void 0?{limit:t.limit}:{}})}catch(i){y("[okx-a2a:outbox-drain] tick failed:",i)}finally{n=!1}}},s=setInterval(()=>{r()},e);return s.unref?.(),r(),()=>{clearInterval(s)}}ee();var Ur=require("node:child_process"),ud=require("node:fs"),Fi=require("node:os"),bn=require("node:path"),th=require("node:util");re();var nh=(0,th.promisify)(Ur.execFile),RO=12e4,dd=3e4,rh=5e3,sh=[(0,bn.join)((0,Fi.homedir)(),".local","bin"),(0,bn.join)((0,Fi.homedir)(),"Library","pnpm"),(0,bn.join)((0,Fi.homedir)(),".npm-global","bin"),"/opt/homebrew/bin","/usr/local/bin"];function X(t,e){return{source:"openclaw_gateway",provider:"openclaw",action:t,...e??{}}}async function Gi(t,e=dd){let n=process.env.OKX_A2A_BIN?.trim();if(n)return ih(`${n} ${t.map(uh).join(" ")}`,e,Bi());let r=await CO();if(!r)return{ok:!1,stdout:"",stderr:"okx-a2a binary not found"};try{let{stdout:s,stderr:i}=await nh(r,t,{timeout:e,env:Bi()});return{ok:!0,stdout:s,stderr:i}}catch(s){let i=s;return{ok:!1,stdout:String(i.stdout??""),stderr:String(i.stderr??i.message??s)}}}async function CO(){let t=await ih("command -v okx-a2a",dd),e=t.stdout.trim().split(/\r?\n/)[0]?.trim();if(t.ok&&e)return e;for(let n of sh){let r=(0,bn.join)(n,"okx-a2a");if((0,ud.existsSync)(r))return r}return null}function DO(){let t=ah("command -v okx-a2a",dd),e=t.stdout.trim().split(/\r?\n/)[0]?.trim();if(t.ok&&e)return e;for(let n of sh){let r=(0,bn.join)(n,"okx-a2a");if((0,ud.existsSync)(r))return r}return null}async function ih(t,e,n=process.env){try{let{stdout:r,stderr:s}=await nh(ch(),["-lc",t],{timeout:e,env:n});return{ok:!0,stdout:r,stderr:s}}catch(r){let s=r;return{ok:!1,stdout:String(s.stdout??""),stderr:String(s.stderr??s.message??r)}}}function oh(t,e=rh){let n=process.env.OKX_A2A_BIN?.trim();if(n)return ah(`${n} ${t.map(uh).join(" ")}`,e,Bi());let r=DO();if(!r)return{ok:!1,stdout:"",stderr:"okx-a2a binary not found"};try{return{ok:!0,stdout:(0,Ur.execFileSync)(r,t,{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:e,env:Bi()}),stderr:""}}catch(s){let i=s;return{ok:!1,stdout:String(i.stdout??""),stderr:String(i.stderr??i.message??s)}}}function ah(t,e,n=process.env){try{return{ok:!0,stdout:(0,Ur.execFileSync)(ch(),["-lc",t],{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:e,env:n}),stderr:""}}catch(r){let s=r;return{ok:!1,stdout:String(s.stdout??""),stderr:String(s.stderr??s.message??r)}}}function ch(){return process.env.SHELL||"/bin/sh"}function Bi(){return{...process.env,OKX_A2A_RUNTIME_CONTEXT:"openclaw-gateway",OKX_A2A_IN_GATEWAY:"1",OKX_A2A_GATEWAY_PROVIDER:"openclaw"}}function uh(t){return`'${t.replace(/'/g,"'\\''")}'`}function OO(t){let e=t.trim();return e.startsWith("running ")?"running":e.startsWith("stale ")?"stale":e==="stopped"?"stopped":"unknown"}function dh(t){let e=t.trim().split(/\r?\n/).reverse();for(let n of e){let r=n.trim();if(r.startsWith("{"))try{let s=JSON.parse(r);if(s&&typeof s=="object"&&!Array.isArray(s))return s}catch{}}return null}async function NO(){let t=await Gi(["ai-provider","status","--json"]);if(!t.ok)return y("[okx-a2a:daemon] ai-provider status failed:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a ai-provider status failed"),X("provider_status",{status:"failed",stderr:t.stderr,stdout:t.stdout})),null;let n=dh(t.stdout)?.provider;return typeof n!="string"&&I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_status",{reason:"invalid_provider_status_output",status:"skipped",stdout:t.stdout})),typeof n=="string"?n:null}function wO(){let t=oh(["ai-provider","status","--json"]);if(!t.ok)return y("[okx-a2a:daemon] ai-provider status failed during gateway signal:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a ai-provider status failed during gateway signal"),X("provider_status_signal",{status:"failed",stderr:t.stderr,stdout:t.stdout})),null;let n=dh(t.stdout)?.provider;return typeof n!="string"&&I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_status_signal",{reason:"invalid_provider_status_output",status:"skipped",stdout:t.stdout})),typeof n=="string"?n:null}async function lh(){let t=await NO();return t!=="openclaw"?(y(`[okx-a2a:daemon] provider=${t??"(not set)"}; skipping OpenClaw-owned daemon lifecycle`),I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_mismatch",{selectedProvider:t??"",reason:"provider_not_openclaw",status:"skipped"})),!1):!0}function kO(){let t=wO();return t!=="openclaw"?(y(`[okx-a2a:daemon] provider=${t??"(not set)"}; skipping OpenClaw-owned daemon lifecycle during gateway signal`),I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_mismatch_signal",{selectedProvider:t??"",reason:"provider_not_openclaw",status:"skipped"})),!1):!0}async function ph(){if(!await lh())return;let t=await Gi(["daemon","status"]),e=t.ok?OO(t.stdout):"unknown";t.ok||y("[okx-a2a:daemon] status failed:",(t.stderr||t.stdout).trim()),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("restart",{previousStatus:e,status:"requested"}));let n=await Gi(["daemon","restart"],RO);if(!n.ok){y("[okx-a2a:daemon] restart failed:",(n.stderr||n.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon restart failed"),X("restart",{previousStatus:e,status:"failed",stderr:n.stderr,stdout:n.stdout}));return}let r=n.stdout.trim();y(`[okx-a2a:daemon] ${r||"restart ok"} selectedProvider=openclaw previousStatus=${e}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("restart",{previousStatus:e,status:"ok"}))}async function fh(){if(!await lh())return;I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop",{status:"requested"}));let t=await Gi(["daemon","stop"]);if(!t.ok){y("[okx-a2a:daemon] stop failed:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon stop failed"),X("stop",{status:"failed",stderr:t.stderr,stdout:t.stdout}));return}y(`[okx-a2a:daemon] ${t.stdout.trim()||"stop ok"}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop",{status:"ok"}))}function PO(t){if(!kO())return;I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop_signal",{reason:t,status:"requested"}));let e=oh(["daemon","stop"],rh);if(!e.ok){y(`[okx-a2a:daemon] stop failed during ${t}:`,(e.stderr||e.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon stop failed during gateway signal"),X("stop_signal",{reason:t,status:"failed",stderr:e.stderr,stdout:e.stdout}));return}y(`[okx-a2a:daemon] ${e.stdout.trim()||"stop ok"} reason=${t}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop_signal",{reason:t,status:"ok"}))}function gh(){let t=e=>{PO(e)};return process.on("SIGTERM",t),process.on("SIGINT",t),()=>{process.off("SIGTERM",t),process.off("SIGINT",t)}}ee();re();ee();var $i=require("node:fs"),hh=require("node:child_process"),mh=require("node:util");re();var Eh=(0,mh.promisify)(hh.execFile),pt=null,_h=new Set(["--message"]);async function xO(){if(pt)return pt;let t=process.env.ONCHAINOS_BIN;if(t)return y(`[onchainos] using ONCHAINOS_BIN=${t}`),pt=t,pt;try{let e=process.env.SHELL||"/bin/bash",{stdout:n}=await Eh(e,["-lc","command -v onchainos"]),r=UO(n);if(r)return y(`[onchainos] resolved binary via shell: ${r}`),pt=r,pt}catch(e){y("[onchainos] shell resolve failed, will fallback to bare 'onchainos':",e)}return y("[onchainos] could not resolve binary path, falling back to bare 'onchainos'"),pt="onchainos",pt}function UO(t){let e=t.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).reverse();for(let n of e)if(MO(n))return n;return null}function MO(t){try{return(0,$i.accessSync)(t,$i.constants.X_OK),!0}catch{return!1}}function yh(t){let e=[],n=!1;for(let r of t){if(n){e.push("<redacted>"),n=!1;continue}let s=[..._h].find(i=>r.startsWith(`${i}=`));if(s){e.push(`${s}=<redacted>`);continue}e.push(r),_h.has(r)&&(n=!0)}return e}function LO(t,e){return`${t} ${yh(e).join(" ")}`}async function Sh(t){let e=await xO(),n=LO(e,t);y(`[onchainos] exec: ${n}`);let r=Date.now();try{let s=await Eh(e,t);return y(`[onchainos] exec done: ${n} (${Date.now()-r}ms, stdout=${s.stdout.length}B, stderr=${s.stderr.length}B)`),s}catch(s){throw y(`[onchainos] exec error: ${n} (${Date.now()-r}ms) code=${s.code} signal=${s.signal} killed=${s.killed} message=${s.message}`),I.error(h.ONCHAINOS_CLI_ERROR,new Error("onchainos command failed"),{component:"onchainos_cli",source:"onchainos",stage:"exec",communicationClass:"onchainos_cli_or_api_issue",operation:yh(t).slice(0,3).join(" "),reason:"exec_failed",argCount:String(t.length),exitCode:String(s?.code??""),signal:String(s?.signal??""),killed:String(s?.killed??""),stderrBytes:String(Buffer.byteLength(String(s?.stderr??""),"utf8")),stdoutBytes:String(Buffer.byteLength(String(s?.stdout??""),"utf8")),cliErrorName:s instanceof Error?s.name:"",cliErrorMessageLength:String(String(s?.message??"").length),durationMs:String(Date.now()-r)}),s}}re();var Th={OK_FALSE:"ok_false",JSON_PARSE_FAILED:"json_parse_failed"};function bh(t){let e="0";try{JSON.parse(t),e="1"}catch{e="0"}return{responseBytes:String(Buffer.byteLength(t,"utf8")),responseJson:e}}function Ih(t,e,n){return{component:"onchainos_cli",source:"onchainos",stage:"ok_false",communicationClass:"onchainos_cli_or_api_issue",operation:e,reason:Th.OK_FALSE,...bh(t),...n}}function Ah(t,e,n={}){try{return JSON.parse(t)}catch(r){let s=r instanceof Error?r:new Error(String(r));throw I.error(h.ONCHAINOS_CLI_ERROR,s,{component:"onchainos_cli",source:"onchainos",stage:"json_parse",communicationClass:"onchainos_cli_or_api_issue",operation:e,reason:Th.JSON_PARSE_FAILED,...bh(t),...n}),s}}re();var vh=/session expired/i;function ld(t){try{let e=JSON.parse(t);return e.ok===!1&&vh.test(String(e.error??""))}catch{return vh.test(t)}}function Rh(t){I.error(h.ONCHAINOS_SESSION_EXPIRED,new Error("onchainos session expired"),{component:"onchainos_cli",source:"onchainos",stage:"session_expired",operation:t,command:t,communicationClass:"onchainos_auth_issue",reason:"session_expired"})}function Ch(t,e){if(e?.notifySessionExpired){e.notifySessionExpired(t);return}Rh(t)}function qO(t,e,n){ld(t)&&Ch(e,n)}function FO(t,e,n){let r=String(t?.stdout??"");r&&ld(r)&&Ch(e,n)}async function Dh(t){y("[onchainos] fetching system-config");let e,n;try{({stdout:e,stderr:n}=await Sh(["agent","system-config"]))}catch(s){throw FO(s,"system-config",t),s}n&&y(`[onchainos] stderr (system-config): ${n}`);let r=Ah(e,"system-config");if(!r.ok){qO(e,"system-config",t);let s=new Error("onchainos agent system-config failed");throw I.error(h.ONCHAINOS_CLI_ERROR,s,Ih(e,"system-config")),s}return y(`[onchainos] fetched system-config: ${Object.keys(r.data).length} keys`),r.data}re();var GO=process.env.SENTRY_ENV==="dev"?"dev":"prod",Oh={projectName:"okx/openclaw-okx-a2a-extension",release:"0.0.14",environment:GO};var In,An,Mr;function BO(t){let e=t?.details?.requestId;return typeof e=="string"&&e.trim()?`openclaw devices approve ${e}`:"openclaw devices approve --latest"}function $O(t){let e=t?.details??{},n=td(t);return["OKX A2A plugin needs OpenClaw gateway `operator.admin` scope before it can create sessions, inject chat messages, and route XMTP conversations.","","Ask the user whether they approve granting this scope to the OKX A2A plugin.","","If the user approves, ask them to run this command on the OpenClaw host:","","```bash",BO(t),"```","",`requestId: ${e.requestId??""}`,`deviceId: ${e.deviceId??""}`,`requestedScopes: ${Array.isArray(e.requestedScopes)?e.requestedScopes.join(","):""}`,`approvedScopes: ${Array.isArray(e.approvedScopes)?e.approvedScopes.join(","):""}`,n?`hint: ${n}`:""].filter(Boolean).join(`
|
|
46
|
+
`)}function jO(){Pi({key:O_()}).then(()=>{y("[okx-a2a:service] gateway client admin precheck succeeded"),I.info(h.GATEWAY_STARTED,{source:"gateway_preconnect",outcome:"ok"})},t=>{y("[okx-a2a:service] gateway client admin precheck failed:",t),I.error(h.GATEWAY_CONNECT_FAILED,t instanceof Error?t:new Error(String(t)),{source:"gateway_preconnect",code:String(t?.gatewayCode??t?.details?.code??""),reason:String(t?.details?.reason??""),requestId:String(t?.details?.requestId??"")}),J_($O(t),{source:"gateway_preconnect"}).then(({dispatched:e,failed:n})=>{I.info(h.USER_DISPATCHED,{source:"gateway_preconnect",outcome:n.length===0?"all_ok":"partial",dispatchedChannels:e.join(","),failedChannels:n.join(","),dispatchedCount:String(e.length),failedCount:String(n.length)})},e=>{I.error(h.USER_DISPATCH_FAILED,e instanceof Error?e:new Error(String(e)),{source:"gateway_preconnect"})})})}async function HO(t){try{let e=await Dh();if(typeof e.sentryDsn=="string"&&e.sentryDsn){m_({dsn:e.sentryDsn,...Oh,agentPlatform:"openclaw"});return}hd("[okx-a2a] system-config did not return sentryDsn; Sentry not initialized \u2014 no further events will be reported to SLS"),I.error(h.SENTRY_INIT_SKIPPED,void 0,{onchainosAgentId:"*",reason:"system-config missing sentryDsn",pluginId:Gt.id,pluginVersion:Gt.version,source:t})}catch(e){y(`[okx-a2a:service] system-config fetch failed in ${t}:`,e),I.error(h.CONFIG_LOAD_FAILED,e instanceof Error?e:new Error(String(e)),{source:t})}}function Nh(t,e){let n=[t?.sessionKey,t?.context?.sessionKey,t?.ctx?.sessionKey,t?.hookContext?.sessionKey,e?.sessionKey];for(let r of n)if(typeof r=="string"&&r.trim())return r;return null}function pd(t,e){let n=t[e];if(typeof n!="string"||!n.trim())throw new Error(`Missing required param ${e}`);return n}function Ft(t,e){let n=t[e];return typeof n=="string"&&n.trim()?n:void 0}function YO(t,e){let n=t[e];if(!Array.isArray(n))return;let r=n.filter(s=>typeof s=="string"&&s.trim().length>0).map(s=>s.trim());return r.length>0?r:void 0}function KO(t,e){let n=t[e];return typeof n=="boolean"?n:void 0}var Gt={id:"okx-a2a",name:"OKX A2A Plugin",version:"0.0.14",register(t){md(t.runtime),t.registerChannel({plugin:y_}),t.registerGatewayMethod("okx-a2a.dispatch_user",async({params:e,respond:n})=>{try{let r=pd(e,"content"),s=Ft(e,"label");n(!0,await Li({content:r,label:s}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),t.registerGatewayMethod("okx-a2a.prompt_user",async({params:e,respond:n})=>{try{let r=pd(e,"userContent"),s=pd(e,"llmContent");n(!0,await qi({userContent:r,llmContent:s}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),t.registerGatewayMethod("okx-a2a.delete_sessions",async({params:e,respond:n})=>{try{let r=Ft(e,"sessionKey"),s=YO(e,"sessionKeys"),i=Ft(e,"jobId");if(!r&&!s&&!i)throw new Error("Missing required selector: sessionKey, sessionKeys, or jobId");let o=Ft(e,"myAgentId"),a=Ft(e,"toAgentId"),c=Ft(e,"myXmtpAddress"),u=Ft(e,"toXmtpAddress"),d=KO(e,"deleteTranscript");n(!0,await H_({...r?{sessionKey:r}:{},...s?{sessionKeys:s}:{},...i?{jobId:i}:{},...o?{myAgentId:o}:{},...a?{toAgentId:a}:{},...c?{myXmtpAddress:c}:{},...u?{toXmtpAddress:u}:{},...d!==void 0?{deleteTranscript:d}:{}}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),t.registerHook("agent:bootstrap",async e=>{let n=e.context,r=n.bootstrapFiles;if(Array.isArray(r))try{let s=r.map(o=>`${o.name}(${o.missing?"missing":`${o.content?.length??0}b`})`).join(", ");y(`[okx-a2a:hook] agent:bootstrap agentId=${n.agentId??"?"} files=[${s}]`);let i=r.reduce((o,a)=>o+(a.content?.length??0),0);I.info(h.BOOTSTRAP_APPLIED,{openclawAgentId:n.agentId??"",promptSize:String(i),fileCount:String(r.length),missingCount:String(r.filter(o=>o.missing).length)})}catch(s){I.error(h.BOOTSTRAP_FAILED,s instanceof Error?s:void 0,{openclawAgentId:n.agentId??""})}},{name:"okx-a2a-agent-bootstrap"}),t.on("before_agent_run",async(e,n)=>{let r=Nh(e,n);if(!r){y("[xmtp_prompt_user:queue] before_agent_run ignored: missing sessionKey");return}sd(r)}),t.on("agent_end",async(e,n)=>{let r=Nh(e,n);if(!r){y("[xmtp_prompt_user:queue] agent_end ignored: missing sessionKey");return}id(r)}),t.registerService({id:"okx-a2a:core",start:async()=>{y("[okx-a2a:service] okx-a2a:core starting (multi-identity mode); initializing communication identities..."),Mr=Date.now(),I.info(h.GATEWAY_STARTED,{onchainosAgentId:"*",pid:String(process.pid),pluginId:Gt.id,pluginVersion:Gt.version,nodeVersion:process.version,startedAt:String(Mr)}),An&&An(),An=gh(),B_(),await ph(),jO(),In&&In(),In=eh(),await HO("openclaw_lightweight_gateway_service"),y("[okx-a2a:service] OpenClaw lightweight gateway initialized; node daemon owns XMTP receive/send/agent sync.")},stop:async()=>{In&&(In(),In=void 0),An&&(An(),An=void 0),$_(),await fh(),y("[okx-a2a:service] okx-a2a:core stopped");let e=Date.now();I.info(h.GATEWAY_STOPPED,{onchainosAgentId:"*",pid:String(process.pid),pluginId:Gt.id,pluginVersion:Gt.version,stoppedAt:String(e),uptimeMs:Mr?String(e-Mr):"unknown"}),Mr=void 0}})}},WO=Gt;
|
|
47
47
|
/*! Bundled license information:
|
|
48
48
|
|
|
49
49
|
cookie/index.js:
|