@aventurevc/mcp-server 0.7.301 → 0.7.328
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/chunks/auth-B_0cUOPk.js +114 -0
- package/dist/chunks/esm-DjirWJ9q.js +222 -0
- package/dist/chunks/index.node-Dqukns1W.js +1 -0
- package/dist/chunks/{person-owner-ChqQWHII.js → person-owner-BqBLyw4S.js} +5 -4
- package/dist/chunks/text-field-_7ZvrzAF.js +1 -0
- package/dist/chunks/text-response-DDwkjRpA.js +5 -0
- package/dist/mcp-server/index.js +50 -48
- package/package.json +3 -3
- package/dist/chunks/auth-DIikL8AE.js +0 -114
- package/dist/chunks/esm-CmT2ZArF.js +0 -222
- package/dist/chunks/index.node-LwG3axmM.js +0 -1
- package/dist/chunks/mcp-generation-contract-BdBNx3qx.js +0 -4
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import{B as e,E as t,G as n,H as r,I as i,M as a,N as o,O as s,Q as c,S as l,U as u,Y as d,Z as f,_ as p,a as m,b as h,c as g,h as _,i as v,j as y,l as ee,n as b,o as te,p as x,q as ne,r as re,s as ie,u as ae,w as oe,y as se}from"./esm-VTPP_TTM.js";import{t as ce}from"./src-UMZE8fVn.js";import*as le from"node:module";import ue from"node:module";import{execFile as de}from"node:child_process";import*as fe from"node:os";import pe from"node:os";import me,{join as he,posix as ge,sep as _e}from"node:path";import{inspect as ve,promisify as ye,types as be}from"util";import*as xe from"fs";import{readFileSync as Se}from"fs";import*as Ce from"path";import{normalize as we}from"path";import Te,{createReadStream as Ee,readFile as De,readFileSync as Oe,readdir as ke}from"node:fs";import Ae,{fileURLToPath as je}from"node:url";import{EventEmitter as Me,errorMonitor as Ne}from"node:events";import*as Pe from"node:util";import Fe,{format as Ie,promisify as Le,types as Re}from"node:util";import{AsyncLocalStorage as ze}from"node:async_hooks";import*as Be from"node:net";import*as Ve from"node:http";import{Readable as S}from"node:stream";import*as C from"node:diagnostics_channel";import{subscribe as He,unsubscribe as Ue}from"node:diagnostics_channel";import*as w from"node:tls";import{createGzip as We}from"node:zlib";import{MessageChannel as Ge,Worker as Ke,isMainThread as qe,parentPort as T}from"node:worker_threads";import{URL as Je}from"url";import E from"node:tty";import*as Ye from"module";import{isMainThread as Xe,threadId as Ze}from"worker_threads";import*as Qe from"diagnostics_channel";import{createInterface as $e}from"node:readline";import*as et from"node:https";import{monitorEventLoopDelay as tt,performance as nt}from"perf_hooks";import{EventEmitter as rt}from"events";var D=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,O=globalThis,k=`10.74.0`;function it(){return at(O),O}function at(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.74.0`,t[k]=t[`10.74.0`]||{}}function ot(e,t,n=O){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[k]=r[`10.74.0`]||{};return i[e]||(i[e]=t())}var st=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],ct=`Sentry Logger `,lt={};function ut(e){if(!(`console`in O))return e();let t=O.console,n={},r=Object.keys(lt);r.forEach(e=>{let r=lt[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function dt(){vt().enabled=!0}function ft(){vt().enabled=!1}function pt(){return vt().enabled}function mt(...e){_t(`log`,...e)}function ht(...e){_t(`warn`,...e)}function gt(...e){_t(`error`,...e)}function _t(e,...t){D&&pt()&&ut(()=>{O.console[e](`${ct}[${e}]:`,...t)})}function vt(){return D?ot(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var A={enable:dt,disable:ft,isEnabled:pt,log:mt,warn:ht,error:gt},yt=50,bt=/\(error: (.*)\)/,xt=/captureMessage|captureException/;function St(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
|
|
2
|
-
`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=bt.test(n)?n.replace(bt,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=yt+r)break}}return wt(i.slice(r))}}function Ct(e){return Array.isArray(e)?St(...e):e}function wt(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Tt(t).function||``)&&t.pop(),t.reverse(),xt.test(Tt(t).function||``)&&(t.pop(),xt.test(Tt(t).function||``)&&t.pop()),t.slice(0,yt).map(e=>({...e,filename:e.filename||Tt(t).filename,function:e.function||`?`}))}function Tt(e){return e[e.length-1]||{}}var Et=`<anonymous>`;function Dt(e){try{return!e||typeof e!=`function`?Et:e.name||Et}catch{return Et}}function Ot(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function kt(e){let t=e?.startsWith(`file://`)?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var At={},jt={};function Mt(e,t){return At[e]=At[e]||[],At[e].push(t),()=>{let n=At[e];if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}function Nt(e,t){if(!jt[e]){jt[e]=!0;try{t()}catch(t){D&&A.error(`Error while instrumenting ${e}`,t)}}}function Pt(e,t){let n=e&&At[e];if(n)for(let r of n)try{r(t)}catch(t){D&&A.error(`Error while triggering instrumentation handler.
|
|
3
|
-
Type: ${e}
|
|
4
|
-
Name: ${Dt(r)}
|
|
5
|
-
Error:`,t)}}var Ft=Object.prototype.toString;function It(e){switch(Ft.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return Kt(e,Error)}}function Lt(e,t){return Ft.call(e)===`[object ${t}]`}function Rt(e){return Lt(e,`ErrorEvent`)}function zt(e){return Lt(e,`String`)}function Bt(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function Vt(e){return e===null||Bt(e)||typeof e!=`object`&&typeof e!=`function`}function Ht(e){return Lt(e,`Object`)}function j(e){return typeof e==`object`&&!!e}function Ut(e){return typeof Event<`u`&&Kt(e,Event)}function Wt(e){return Lt(e,`RegExp`)}function Gt(e){return!!(e?.then&&typeof e.then==`function`)}function Kt(e,t){try{return e instanceof t}catch{return!1}}function qt(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&Yt(i,r);try{e[t]=i}catch{D&&A.log(`Failed to replace method "${t}" in object`,e)}}function Jt(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{D&&A.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Yt(e,t){try{e.prototype=t.prototype=t.prototype||{},Jt(e,`__sentry_original__`,t)}catch{}}function Xt(e,t,n,r=!0){let i=e[t];if(typeof i!=`function`)throw Error(`Cannot wrap method: ${t} is not a function`);if(Zt(i))throw Error(`Attempting to wrap method ${t} multiple times`);Yt(n,i),Object.defineProperty(e,t,{writable:!0,configurable:!0,enumerable:r,value:n})}function Zt(e){return e.__sentry_original__}function Qt(e){if(It(e))return{message:e.message,name:e.name,stack:e.stack,...$t(e)};if(Ut(e)){let{type:t,target:n,currentTarget:r,detail:i}=e;return{type:t,target:n,currentTarget:r,...i?{detail:i}:{},...$t(e)}}return e}function $t(e){return j(e)?Object.fromEntries(Object.entries(e)):{}}function en(e){let t=Object.keys(Qt(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var tn;function nn(e){if(tn!==void 0)return tn?tn(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=O;return t in n&&typeof n[t]==`function`?(tn=n[t],tn(e)):(tn=null,e())}function rn(){return nn(()=>Math.random())}function an(){return nn(()=>Date.now())}var on=Symbol.for(`sentry.skipNormalization`),sn=Symbol.for(`sentry.overrideNormalizationDepth`);function cn(e){Jt(e,on,!0)}function ln(e,t){Jt(e,sn,t)}function un(e){return!!e[on]}function dn(e){let t=e[sn];return typeof t==`number`?t:void 0}function fn(e,t=100,n=1/0){try{return mn(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function pn(e,t=3,n=102400){let r=fn(e,t);return vn(r)>n?pn(e,t-1,n):r}function mn(e,t,n=1/0,r=1/0,i=yn()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=hn(e,t);if(!s.startsWith(`[object `))return s;if(un(t))return t;let c=dn(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return mn(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=Qt(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=mn(e,t,l-1,r,i),f++}return o(t),d}function hn(e,t){try{return typeof global<`u`&&t===global?`[Global]`:typeof t==`number`&&!Number.isFinite(t)?`[${t}]`:typeof t==`function`?`[Function: ${Dt(t)}]`:typeof t==`symbol`?`[${String(t)}]`:typeof t==`bigint`?`[BigInt: ${String(t)}]`:`[object ${gn(t)}]`}catch(e){return`**non-serializable** (${e})`}}function gn(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function _n(e){return~-encodeURI(e).split(/%..|./).length}function vn(e){return _n(JSON.stringify(e))}function yn(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function bn(e,t=`[unserializable]`){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return typeof t==`function`?t(e):t}}function xn(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Sn(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,r);return a>r-5&&(a=r),a===r&&(i=Math.max(a-140,0)),n=n.slice(i,a),i>0&&(n=`'{snip} ${n}`),a<r&&(n+=` {snip}`),n}function Cn(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];Vt(r)?n.push(String(r)):r instanceof Error?n.push(r.message?`${r.name}: ${r.message}`:r.name):n.push(hn(void 0,r))}return n.join(t)}function wn(e,t,n=!1){return zt(e)?Wt(t)?t.test(e):zt(t)?n?e===t:e.includes(t):typeof t==`function`&&t(e):!1}function Tn(e,t=[],n=!1){for(let r of t)if(wn(e,r,n))return!0;return!1}function En(){let e=O;return e.crypto||e.msCrypto}var Dn;function On(){return rn()*16}function kn(e=En()){try{if(e?.randomUUID)return nn(()=>e.randomUUID()).replace(/-/g,``)}catch{}return Dn||=`10000000100040008000100000000000`,Dn.replace(/[018]/g,e=>(e^(On()&15)>>e/4).toString(16))}function An(e){return e.exception?.values?.[0]}function jn(e){let{message:t,event_id:n}=e;if(t)return t;let r=An(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function Mn(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function Nn(e,t){let n=An(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}var Pn=/^(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 Fn(e){return parseInt(e||``,10)}function In(e){let t=e.match(Pn)||[],n=Fn(t[1]),r=Fn(t[2]),i=Fn(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(i)?void 0:i,prerelease:t[4]}}function Ln(e){if(Rn(e))return!0;try{Jt(e,`__sentry_captured__`,!0)}catch{}return!1}function Rn(e){try{return e.__sentry_captured__}catch{}}var zn=1e3;function Bn(){return an()/zn}function Vn(){let{performance:e}=O;if(!e?.now||!e.timeOrigin)return Bn;let t=e.timeOrigin;return()=>(t+nn(()=>e.now()))/zn}var Hn;function Un(){return(Hn??=Vn())()}function Wn(e){let t=Un(),n={sid:kn(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>qn(n)};return e&&Gn(n,e),n}function Gn(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Un(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:kn()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Kn(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),Gn(e,n)}function qn(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Jn(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=Jn(r[e],t[e],n-1));return r}function Yn(){return kn()}function Xn(){return kn().substring(16)}function Zn(e){try{let t=O.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function Qn(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var $n=`_sentrySpan`;function er(e,t){t?Jt(e,$n,Zn(t)):delete e[$n]}function tr(e){return Qn(e[$n])}var nr=100,rr=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Yn(),sampleRand:rn()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,er(t,tr(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Gn(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},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,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():Ht(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,er(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Yn(),sampleRand:rn()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:nr;if(n<=0)return this;let r={timestamp:Bn(),...e,message:e.message?xn(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:tr(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Jn(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||kn();if(!this._client)return D&&A.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||kn();if(!this._client)return D&&A.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||kn();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(D&&A.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function ir(){return ot(`defaultCurrentScope`,()=>new rr)}function ar(){return ot(`defaultIsolationScope`,()=>new rr)}var or=e=>e instanceof Promise&&!e[sr],sr=Symbol(`chained PromiseLike`),cr=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return or(r)&&or(e)?r:lr(e,r)},lr=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[sr]:!0}),t},ur=class{constructor(e,t){let n;n=e||new rr;let r;r=t||new rr,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return Gt(n)?cr(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function dr(){let e=at(it());return e.stack=e.stack||new ur(ir(),ar())}function fr(e){return dr().withScope(e)}function pr(e,t){let n=dr();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function mr(e){return dr().withScope(()=>e(dr().getIsolationScope()))}function hr(){return{withIsolationScope:mr,withScope:fr,withSetScope:pr,withSetIsolationScope:(e,t)=>mr(t),getCurrentScope:()=>dr().getScope(),getIsolationScope:()=>dr().getIsolationScope()}}function gr(e){let t=at(it());t.acs=e}function _r(e){let t=at(e);return t.acs?t.acs:hr()}function vr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).includes(`value`)}function yr(e,t){let{value:n,unit:r}=vr(e)?e:{value:e,unit:void 0},i=Cr(n),a=r&&typeof r==`string`?{unit:r}:{};if(i)return{...i,...a};if(!t||t===`skip-undefined`&&n===void 0)return;let o=``;try{o=JSON.stringify(n)??``}catch{}return{value:o,type:`string`,...a}}function br(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let e=yr(i,t);e&&(n[r]=e)}return n}function xr(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let e=r.value;Array.isArray(e)?t+=Sr(e[0])*e.length:Vt(e)?t+=Sr(e):t+=100}return t}function Sr(e){return typeof e==`string`?e.length*2:typeof e==`boolean`?4:typeof e==`number`?8:0}function Cr(e){if(Array.isArray(e))return{value:e,type:`array`};let t=typeof e==`string`?`string`:typeof e==`boolean`?`boolean`:typeof e==`number`&&!Number.isNaN(e)?Number.isInteger(e)?`integer`:`double`:null;if(t)return{value:e,type:t}}function wr(){return!1}function M(){return _r(it()).getCurrentScope()}function N(){return _r(it()).getIsolationScope()}function Tr(){return ot(`globalScope`,()=>new rr)}function Er(...e){let t=_r(it());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function Dr(...e){let t=_r(it());if(e.length===2){let[n,r]=e;return n?t.withSetIsolationScope(n,r):t.withIsolationScope(r)}return t.withIsolationScope(e[0])}function P(){return M().getClient()}function Or(e){let{traceId:t,parentSpanId:n,propagationSpanId:r}=e.getPropagationContext(),i={trace_id:t,span_id:r||Xn()};return n&&(i.parent_span_id=n),i}var kr=`sentry.source`,Ar=`sentry.sample_rate`,F=`sentry.op`,I=`sentry.origin`,jr=`sentry.measurement_unit`,Mr=`sentry.measurement_value`,Nr=`sentry.release`,Pr=`sentry.environment`,Fr=`sentry.sdk.integrations`,Ir=`user.id`,Lr=`user.email`,Rr=`user.ip_address`,zr=`user.name`,Br=`sentry.custom_span_name`,Vr=`sentry.profile_id`,Hr=`sentry.exclusive_time`,Ur=`cache.hit`,Wr=`cache.key`,Gr=`cache.item_size`,Kr=`http.request.method`,qr=`gen_ai.conversation.id`;function Jr(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function Yr(e,t){e.setAttribute(`http.response.status_code`,t);let n=Jr(t);n.message!==`unknown_error`&&e.setStatus(n)}var Xr=`_sentryScope`,Zr=`_sentryIsolationScope`,Qr=Symbol.for(`sentry.otelSourceInference`),$r=Symbol.for(`sentry.otelSourceExplicitlySet`),ei=Symbol.for(`sentry.tracerProviderSpan`);function ti(e,t,n){e&&(Jt(e,Zr,Zn(n)),Jt(e,Xr,t))}function ni(e){let t=e;return{scope:t[Xr],isolationScope:Qn(t[Zr])}}function ri(e){Jt(e,Qr,!0)}function ii(e){return e[Qr]===!0}function ai(e){Jt(e,$r,!0)}function oi(e){return e[$r]===!0}function si(e){Jt(e,ei,!0)}function ci(e){return e[ei]===!0}var li=`sentry-`;function ui(e){let t=fi(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function di(e){if(e)return mi(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${li}${t}`]=n),e),{}))}function fi(e){if(e&&(zt(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=pi(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):pi(e)}function pi(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function mi(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(D&&A.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}function hi(e,t){if(!e)return t;let n=fi(e),r=fi(t);if(!r)return e;let i={},a=!1,o={},s={};for(let[e,t]of Object.entries(r))e.startsWith(`sentry-`)?(o[e]=t,a=!0):s[e]=t;if(n)for(let[e,t]of Object.entries(n))(!a||!e.startsWith(`sentry-`))&&(i[e]=t);a&&Object.assign(i,o);for(let[e,t]of Object.entries(s))i[e]??(i[e]=t);return mi(i)}var gi=/^o(\d+)\./,_i=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function vi(e){return e===`http`||e===`https`}function yi(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function bi(e){let t=_i.exec(e);if(!t){ut(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return xi({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function xi(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function Si(e){if(!D)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>!e[t]&&(A.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?vi(r)?t&&isNaN(parseInt(t,10))?(A.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(A.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(A.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Ci(e){return e.match(gi)?.[1]}function wi(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Ci(n)),r}function Ti(e){let t=typeof e==`string`?bi(e):xi(e);if(t&&Si(t))return t}function Ei(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var Di=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function Oi(e){if(!e)return;let t=e.match(Di);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function ki(e){return!!e.parentSpanId||!!e.dsc}function Ai(e,t){let n=Oi(e),r=ui(t);if(!n?.traceId)return{traceId:Yn(),sampleRand:rn()};let i=Ni(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function ji(e=Yn(),t=Xn(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function Mi(e=Yn(),t=Xn(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function Ni(e,t){let n=Ei(t?.sample_rand);if(n!==void 0)return n;let r=Ei(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?rn()*r:r+rn()*(1-r):rn()}function Pi(e,t){let n=wi(e);return t&&n&&t!==n?(A.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):e.getOptions().strictTraceContinuation&&(t&&!n||!t&&n)?(A.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}var Fi=!1;function Ii(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=L(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function Li(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:L(e).parent_span_id,a=ni(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||Xn():t,trace_id:n}}function Ri(e){let{traceId:t,spanId:n}=e.spanContext();return ji(t,n,Yi(e))}function zi(e){let{traceId:t,spanId:n}=e.spanContext();return Mi(t,n,Yi(e))}function Bi(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function Vi(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function Hi(e){return typeof e==`number`?Ui(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Ui(e.getTime()):Un()}function Ui(e){return e>9999999999?e/1e3:e}function L(e){if(Ji(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(qi(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:Gi(e),start_timestamp:Hi(i),timestamp:Hi(o)||void 0,status:Xi(s),op:r[F],origin:r[I],links:Bi(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Wi(e){if(Ji(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(qi(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{name:a,span_id:t,trace_id:n,parent_span_id:Gi(e),start_timestamp:Hi(i),end_timestamp:Hi(o),is_segment:e===ia(e),status:Zi(s),attributes:Qi(r,s),links:Vi(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:``,end_timestamp:0,status:`ok`,is_segment:e===ia(e)}}function Gi(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function Ki(e){return{...e,attributes:br(e.attributes),links:e.links?.map(e=>({...e,attributes:br(e.attributes)}))}}function qi(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Ji(e){return typeof e.getSpanJSON==`function`}function Yi(e){let{traceFlags:t}=e.spanContext();return t===1}function Xi(e){if(e&&e.code!==0)return e.code===1?`ok`:e.message||`internal_error`}function Zi(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}function Qi(e,t){let n=Zi(t)===`error`?t?.message:void 0;return{...n&&{"sentry.status.message":n},...e}}var $i=`_sentryChildSpans`,ea=`_sentryRootSpan`;function ta(e,t){let n=e[ea]||e;Jt(t,ea,n),Yi(e)&&(e.isRecording()||n.isRecording())&&(e[$i]?e[$i].add(t):Jt(e,$i,new Set([t])))}function na(e){let t=new Set;function n(e){if(!t.has(e)&&Yi(e)){t.add(e);let r=e[$i]?Array.from(e[$i]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var ra=ia;function ia(e){return e[ea]||e}function R(){let e=_r(it());return e.getActiveSpan?e.getActiveSpan():tr(M())}function aa(){Fi||=(ut(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}function oa(e,t){e.updateName(t),e.setAttributes({[kr]:`custom`,[Br]:t})}function sa(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||P()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function ca(e){A.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function la(e,t){if(!t?.length)return!1;for(let n of t){if(fa(n)){if(e.description&&wn(e.description,n))return D&&ca(e),!0;continue}let t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;let r=!n.name||e.description&&wn(e.description,n.name),i=!n.op||e.op&&wn(e.op,n.op),a=!n.attributes||Object.entries(n.attributes).every(([t,n])=>ua(e.attributes?.[t],n));if(r&&i&&a)return D&&ca(e),!0}return!1}function ua(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?wn(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function da(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function fa(e){return typeof e==`string`||e instanceof RegExp}var pa=Symbol.for(`sentry.nonRecordingSpan`),ma=class{constructor(e={}){this._traceId=e.traceId||Yn(),this._spanId=e.spanId||Xn(),this.dropReason=e.dropReason,Jt(this,pa,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function ha(e){return!!e&&e[pa]===!0}var ga=`production`,_a=`_frozenDsc`;function va(e,t){Jt(e,_a,t)}function ya(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:wi(t)};return t.emit(`createDsc`,i),i}function ba(e,t){let n=t.getPropagationContext();return n.dsc||ya(n.traceId,e)}function xa(e){let t=P();if(!t)return{};let n=ra(e),r=L(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[_a];if(c)return s(c);let l=ha(n),u=l&&n.dropReason===`ignored`;if(l&&(!sa(t.getOptions())||u)){let e=ni(n).scope;if(e){let n={...ba(t,e)};return u&&(n.sampled=`false`),s(n)}}let d=a?.get(`sentry.dsc`),f=d&&ui(d);if(f)return s(f);let p=ya(e.spanContext().traceId,t),m=i[`sentry.source`]??i[`sentry.segment.name.source`],h=r.description;return m!==`url`&&h&&(p.transaction=h),sa()&&(p.sampled=String(Yi(n)),p.sample_rand=a?.get(`sentry.sample_rand`)??ni(n).scope?.getPropagationContext().sampleRand.toString()),s(p),t.emit(`createDsc`,p,n),p}function Sa(e){return di(xa(e))}function Ca(e){return Jt(e,`_streamed`,!0),e}function wa(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}function Ta(e,t=[]){return[e,t]}function Ea(e,t){let[n,r]=e;return[n,[...r,t]]}function Da(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function Oa(e,t){return Da(e,(e,n)=>t.includes(n))}function ka(e){let t=at(O);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Aa(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[ka(r),e]:r.push(typeof e==`string`?ka(e):e)}for(let e of n){let[t,n]=e;if(i(`
|
|
6
|
-
${JSON.stringify(t)}
|
|
7
|
-
`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(fn(n))}i(e)}}return typeof r==`string`?r:ja(r)}function ja(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Ma(e){return[{type:`span`},e]}function Na(e){let t=typeof e.data==`string`?ka(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Pa={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`};function Fa(e){return e in Pa}function Ia(e){return Fa(e)?Pa[e]:e}function La(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Ra(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(an()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:yi(r)},...i&&{trace:i}}}function za(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Ba(e,t,n,r){let i=La(n);return Ta({sent_at:new Date(an()).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:yi(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function Va(e,t,n,r){let i=La(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;za(e,n?.sdk);let o=Ra(e,i,r,t);return delete e.sdkProcessingMetadata,Ta(o,[[{type:a},e]])}function Ha(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=xa(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date(an()).toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:yi(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=L(e);return!la({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=L(e);return(wa(s)?t:s(t))||(aa(),t)}:L,f=[];for(let e of l){let t=d(e);t&&f.push(Ma(t))}return Ta(o,f)}function Ua(e){if(!D)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=L(e),{spanId:i}=e.spanContext(),a=Yi(e),o=ra(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=L(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}A.log(`${c}
|
|
8
|
-
${l.join(`
|
|
9
|
-
`)}`)}function Wa(e){if(!D)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=L(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${ra(e)===e?`root `:``}span "${t}" with ID ${r}`;A.log(i)}function Ga(e,t,n,r=R()){let i=r&&ra(r);i&&(D&&A.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Mr]:t,[jr]:n}))}function Ka(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[jr],i=n[Mr];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function qa(e){at(it()).segmentSpanCaptureStrategy=e}function Ja(){return at(it()).segmentSpanCaptureStrategy}function Ya(e){return e.getOptions().traceLifecycle===`stream`}var Xa=1e3,Za=class{constructor(e={}){this._traceId=e.traceId||Yn(),this._spanId=e.spanId||Xn(),this._startTime=e.startTimestamp||Un(),this._links=e.links,this._attributes={},this.setAttributes({[I]:`manual`,[F]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._frozen||(this._links?this._links.push(e):this._links=[e]),this}addLinks(e){return this._frozen||(this._links?this._links.push(...e):this._links=e),this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return this._frozen?this:(t===void 0?delete this._attributes[e]:this._attributes[e]=t,e===`sentry.source`&&t!==void 0&&ii(this)&&ai(this),this)}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._frozen||(this._startTime=Hi(e))}setStatus(e){return this._frozen||(this._status=e),this}updateName(e){return this._frozen?this:(this._name=e,ii(this)||this.setAttribute(kr,`custom`),this)}end(e){if(this._endTime){this._frozen=ci(this);return}this._endTime=Hi(e),Wa(this),this._onSpanEnded(),this._frozen=ci(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[F],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Xi(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[I],profile_id:this._attributes[Vr],exclusive_time:this._attributes[Hr],measurements:Ka(this._events),is_segment:this._isStandaloneSpan&&ra(this)===this||void 0,segment_id:this._isStandaloneSpan?ra(this).spanContext().spanId:void 0,links:Bi(this._links)}}getStreamedSpanJSON(){return{name:this._name??``,span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===ra(this),status:Zi(this._status),attributes:Qi(this._attributes,this._status),links:Vi(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){if(this._frozen)return this;D&&A.log(`[Tracing] Adding an event to span:`,e);let r=Qa(t)?t:n||Un(),i=Qa(t)?{}:t||{},a={name:e,time:Hi(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=P();e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this));let t=ra(this),n=this._isStandaloneSpan||this===t;if(this._isStandaloneSpan){this._sampled?to(Ha([this],e)):(D&&A.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}if(!n){let e=Ja();if(e){let n=ni(this).scope||M();e.onChildSpanEnded(this,t,e=>this._convertSpanToTransaction(e),n)}return}if(e&&Ya(e)){e.emit(`afterSegmentSpanEnd`,this);return}let r=ni(this).scope||M(),i=Ja();if(i)i.onSegmentSpanEnded(e=>this._convertSpanToTransaction(e),r);else{let e=this._convertSpanToTransaction();e&&r.captureEvent(e)}}_convertSpanToTransaction(e={}){if(!$a(L(this)))return;this._name||=(D&&A.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:t,isolationScope:n}=ni(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;e.onSpanCaptured?.(this);let i=[];for(let t of na(this)){if(t===this||eo(t)||e.isSpanAlreadyCaptured?.(t))continue;let n=L(t);$a(n)&&(e.onSpanCaptured?.(t),i.push(n))}let a=this._attributes[kr];delete this._attributes[Br];let o=!1;i.forEach(e=>{delete e.data[Br],e.op?.startsWith(`gen_ai.`)&&(o=!0)});let s={contexts:{trace:Ii(this)},spans:i.length>Xa?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,Xa):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:xa(this),hasGenAiSpans:o},request:r,...a&&{transaction_info:{source:a}}},c=Ka(this._events);return c&&Object.keys(c).length&&(D&&A.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(c,void 0,2)),s.measurements=c),s}};function Qa(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function $a(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function eo(e){return e instanceof Za&&e.isStandaloneSpan()}function to(e){let t=P();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function no(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(e){throw t(e),n(),e}return ro(i,t,n,r)}function ro(e,t,n,r){return Gt(e)?cr(e,e=>{n(),r(e)},e=>{t(e),n()}):(n(),r(e),e)}function io(e,t,n){if(!sa(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=Ei(i);if(a===void 0)return D&&A.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return D&&A.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,a,r];let o=n<a;return o||D&&A.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var ao=`__SENTRY_SUPPRESS_TRACING__`;function z(e,t){let n=_o();if(n.startSpan)return n.startSpan(e,t);let r=go(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return Er(s,()=>xo(a)(()=>{let n=M(),o=bo(n,a),s=P(),c=e.onlyIfParent&&!o?mo(n,s):ho({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!Co(c)||!o)&&er(n,c),no(()=>t(c),()=>{let{status:e}=L(c);c.isRecording()&&(!e||e===`ok`)&&c.setStatus({code:2,message:`internal_error`})},()=>{c.end()})}))}function oo(e,t){let n=_o();if(n.startSpanManual)return n.startSpanManual(e,t);let r=go(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return Er(s,()=>xo(a)(()=>{let n=M(),o=bo(n,a),s=e.onlyIfParent&&!o?mo(n,P()):ho({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!Co(s)||!o)&&er(n,s),no(()=>t(s,()=>s.end()),()=>{let{status:e}=L(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function B(e){let t=_o();return t.startInactiveSpan?t.startInactiveSpan(e):co(e)}function so(e){return co(e)}function co(e){let t=go(e),{forceTransaction:n,parentSpan:r}=e;return(e.scope?t=>Er(e.scope,t):r===void 0?e=>e():e=>V(r,e))(()=>{let i=M(),a=bo(i,r),o=P();return e.onlyIfParent&&!a?mo(i,o):ho({parentSpan:a,spanArguments:t,forceTransaction:n,scope:i})})}var lo=(e,t)=>{let n=_r(it());if(n.continueTrace)return n.continueTrace(e,t);let{sentryTrace:r,baggage:i}=e,a=P(),o=ui(i);return a&&!Pi(a,o?.org_id)?po(t):Er(e=>{let n=Ai(r,i);return e.setPropagationContext(n),er(e,void 0),t()})};function V(e,t){let n=_o();return n.withActiveSpan?n.withActiveSpan(e,t):Er(n=>(er(n,e||void 0),t(n)))}function uo(e){let t=_o();return t.suppressTracing?t.suppressTracing(e):Er(t=>{t.setSDKProcessingMetadata({[ao]:!0});let n=e();return t.setSDKProcessingMetadata({[ao]:void 0}),n})}function fo(e=M()){let t=_o();return t.isTracingSuppressed?t.isTracingSuppressed(e):e.getScopeData().sdkProcessingMetadata[ao]===!0}function po(e){let t=_o();return t.startNewTrace?t.startNewTrace(e):Er(t=>(t.setPropagationContext({traceId:Yn(),sampleRand:rn()}),D&&A.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),V(null,e)))}function mo(e,t){t?.recordDroppedEvent(`no_parent_span`,`span`);let n=new ma({traceId:e.getPropagationContext().traceId});return ti(n,e,N()),n}function ho({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){let i=N();if(!sa()){let t=r.getPropagationContext(),a=new ma({traceId:e?e.spanContext().traceId:t.traceId});return e&&!n&&ta(e,a),ti(a,r,i),a}let a=P();if(So(a,t)){fo(r)||a?.recordDroppedEvent(`ignored`,`span`);let t=new ma({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});return e&&!n&&ta(e,t),ti(t,r,i),t}let o;if(e&&!n)o=yo(e,r,t,i),ta(e,o);else if(e){let n=xa(e),{traceId:a,spanId:s}=e.spanContext(),c=Yi(e);o=vo({traceId:a,parentSpanId:s,...t},r,i,c),va(o,n)}else{let{traceId:e,dsc:n,parentSpanId:a,sampled:s}=r.getPropagationContext();o=vo({traceId:e,parentSpanId:a,...t},r,i,s),n&&va(o,n)}return Ua(o),o}function go(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=Hi(e.startTime),delete n.startTime,n}return t}function _o(){return _r(it())}function vo(e,t,n,r){let i=P(),a=i?.getOptions()||{},{name:o=``}=e,s={spanAttributes:{...e.attributes},spanName:o,parentSampled:r};i?.emit(`beforeSampling`,s,{decision:!1});let c=s.parentSampled??r,l=s.spanAttributes,u=t.getPropagationContext(),d=fo(t),[f,p,m]=d?[!1]:io(a,{name:o,parentSampled:c,attributes:l,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:Ei(u.dsc?.sample_rate)},u.sampleRand),h=new Za({...e,attributes:{[kr]:`custom`,[Ar]:p!==void 0&&m?p:void 0,...l},sampled:f});return!f&&i&&!d&&(D&&A.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),i.recordDroppedEvent(`sample_rate`,Ya(i)?`span`:`transaction`)),ti(h,t,n),i&&i.emit(`spanStart`,h),h}function yo(e,t,n,r){let{spanId:i,traceId:a}=e.spanContext(),o=fo(t),s=!o&&Yi(e),c=s?new Za({...n,parentSpanId:i,traceId:a,sampled:s}):new ma({traceId:a});ta(e,c),ti(c,t,r);let l=P();return l?(Ya(l)&&ha(c)&&(ha(e)&&e.dropReason?(c.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,`span`)):o||(c.dropReason=`sample_rate`,l.recordDroppedEvent(`sample_rate`,`span`))),l.emit(`spanStart`,c),n.endTimestamp&&(l.emit(`spanEnd`,c),l.emit(`afterSpanEnd`,c)),c):c}function bo(e,t){if(t)return t;if(t===null)return;let n=tr(e);if(!n)return;let r=P();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ra(n):n}function xo(e){return e===void 0?e=>e():t=>V(e,t)}function So(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Ya(e)||!n?.length?!1:la({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function Co(e){return ha(e)&&e.dropReason===`ignored`}function wo(e,t,n){let r,i,a,o=n?.maxWait?Math.max(n.maxWait,t):0,s=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){i!==void 0&&clearTimeout(i),a!==void 0&&clearTimeout(a),i=a=void 0}function u(){return i!==void 0||a!==void 0?c():r}function d(){return i&&clearTimeout(i),i=s(c,t),o&&a===void 0&&(a=s(c,o)),r}return d.cancel=l,d.flush=u,d}var To=new WeakSet,Eo=e=>To.has(e),Do=e=>{To.add(e)},Oo=new WeakMap;function ko(e){if(Ja()||qa(Ao),Oo.has(e))return;let t=new Set,n=wo(()=>{let e=[...t];t.clear();for(let t of e)t()},1,{maxWait:100});e.on(`flush`,()=>{n.flush()}),Oo.set(e,e=>{t.add(e),n()})}var Ao={onSegmentSpanEnded(e,t){let n=t.getClient(),r=n&&Oo.get(n);if(!r){let t=e();t&&n?.captureEvent(t);return}r(()=>{let t=e({isSpanAlreadyCaptured:Eo,onSpanCaptured:Do});t&&n.captureEvent(t)})},onChildSpanEnded(e,t,n,r){if(To.has(e)||!To.has(t))return;let i=r.getClient(),a=i&&Oo.get(i),o=()=>{let e=n({isSpanAlreadyCaptured:Eo,onSpanCaptured:Do});e?.contexts?.trace?.data&&(e.contexts.trace.data[`sentry.parent_span_already_sent`]=!0),e&&i?.captureEvent(e)};a?a(o):o()}},jo=[`addListener`,`on`,`once`,`prependListener`,`prependOnceListener`,`addEventListener`],Mo=[`removeListener`,`off`,`removeEventListener`],No=Symbol(`SentryScopeBoundListeners`),Po;function Fo(e){return Po!==void 0&&(e===Po||e.listener===Po)}function Io(e,t=M()){let n=e;if(Uo(n))return e;Ho(n);for(let e of jo)typeof n[e]==`function`&&(n[e]=zo(n,n[e],t));for(let e of Mo)typeof n[e]==`function`&&(n[e]=Bo(n,n[e]));return typeof n.removeAllListeners==`function`&&(n.removeAllListeners=Vo(n,n.removeAllListeners)),e}function Lo(e,t){return function(...n){return Er(t,()=>e.apply(this,n))}}function Ro(e){return typeof e==`function`}function zo(e,t,n){return function(...r){let i=r[0],a=r[1],o=r.slice(2);if(!Ro(a)||Fo(a))return t.apply(this,r);let s=Uo(e)||Ho(e),c=s.get(i);c||(c=new WeakMap,s.set(i,c));let l=c.get(a);l||(l=Lo(a,n),c.set(a,l));let u=Po;Po=l;try{return t.call(this,i,l,...o)}finally{Po=u}}}function Bo(e,t){return function(...n){let r=n[0],i=n[1],a=n.slice(2),o=Ro(i)?Uo(e)?.get(r)?.get(i):void 0;return o?t.call(this,r,o,...a):t.apply(this,n)}}function Vo(e,t){return function(...n){let r=Uo(e);if(r){if(n.length===0)Ho(e);else{let e=n[0];r.delete(e)}}return t.apply(this,n)}}function Ho(e){let t=new Map;return e[No]=t,t}function Uo(e){return e[No]}function Wo(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Jo(e,t),r&&Zo(e,r),Qo(e,n),Yo(e,i),Xo(e,a)}function Go(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Ko(e,`extra`,n),Ko(e,`tags`,r),Ko(e,`attributes`,i),Ko(e,`user`,a),Ko(e,`contexts`,o),e.sdkProcessingMetadata=Jn(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Ko(e,t,n){e[t]=Jn(e[t],n,1)}function qo(e,t){let n=Tr().getScopeData();return e&&Go(n,e.getScopeData()),t&&Go(n,t.getScopeData()),n}function Jo(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Yo(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Xo(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Zo(e,t){e.contexts={trace:Li(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:xa(t),...e.sdkProcessingMetadata};let n=L(ra(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function Qo(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function $o(e){let t={},{response:n,profile:r,cloud_resource:i,culture:a,state:o}=e;if(n&&(n.status_code!=null&&(t[`http.response.status_code`]=n.status_code),n.body_size!=null&&(t[`http.response.body.size`]=n.body_size)),r&&(r.profile_id&&(t[`sentry.profile_id`]=r.profile_id),r.profiler_id&&(t[`sentry.profiler_id`]=r.profiler_id)),i)for(let[e,n]of Object.entries(i))n!=null&&(t[e]=n);a&&(a.locale&&(t[`culture.locale`]=a.locale),a.timezone&&(t[`culture.timezone`]=a.timezone)),o?.state&&typeof o.state.type==`string`&&(t[`state.type`]=o.state.type);let s=e.angular;if(s){let e=s.version;(typeof e==`string`||typeof e==`number`)&&(t[`angular.version`]=e)}let c=e.react;if(c){let e=c.version;(typeof e==`string`||typeof e==`number`)&&(t[`react.version`]=e)}return t}var es=`aws.dynamodb.attribute_definitions`,ts=`aws.dynamodb.consistent_read`,ns=`aws.dynamodb.consumed_capacity`,rs=`aws.dynamodb.count`,is=`aws.dynamodb.exclusive_start_table`,as=`aws.dynamodb.global_secondary_indexes`,os=`aws.dynamodb.global_secondary_index_updates`,ss=`aws.dynamodb.index_name`,cs=`aws.dynamodb.item_collection_metrics`,ls=`aws.dynamodb.limit`,us=`aws.dynamodb.local_secondary_indexes`,ds=`aws.dynamodb.projection`,fs=`aws.dynamodb.provisioned_read_capacity`,ps=`aws.dynamodb.provisioned_write_capacity`,ms=`aws.dynamodb.scanned_count`,hs=`aws.dynamodb.scan_forward`,gs=`aws.dynamodb.segment`,_s=`aws.dynamodb.select`,vs=`aws.dynamodb.table_count`,ys=`aws.dynamodb.table_names`,bs=`aws.dynamodb.total_segments`,xs=`aws.kinesis.stream.name`,Ss=`aws.request.extended_id`,Cs=`aws.request.id`,ws=`aws.s3.bucket`,Ts=`aws.secretsmanager.secret.arn`,Es=`aws.sns.topic.arn`,Ds=`aws.step_functions.activity.arn`,Os=`aws.step_functions.state_machine.arn`,ks=`cache.key`,As=`cloud.region`,js=`code.function.name`,Ms=`db.collection.name`,Ns=`db.name`,Ps=`db.namespace`,Fs=`db.operation`,Is=`db.operation.batch.size`,Ls=`db.operation.name`,Rs=`db.query.text`,zs=`db.statement`,Bs=`db.system`,Vs=`db.system.name`,Hs=`db.user`,Us=`error.type`,Ws=`faas.execution`,Gs=`faas.invoked_name`,Ks=`faas.invoked_provider`,qs=`faas.invoked_region`,Js=`faas.name`,Ys=`faas.trigger`,Xs=`gen_ai.embeddings.input`,Zs=`gen_ai.function_id`,Qs=`gen_ai.input.messages`,$s=`gen_ai.operation.name`,ec=`gen_ai.output.messages`,tc=`gen_ai.request.available_tools`,nc=`gen_ai.request.max_tokens`,rc=`gen_ai.request.model`,ic=`gen_ai.request.stop_sequences`,ac=`gen_ai.request.temperature`,oc=`gen_ai.request.top_p`,sc=`gen_ai.response.finish_reasons`,cc=`gen_ai.response.id`,lc=`gen_ai.response.model`,uc=`gen_ai.response.streaming`,dc=`gen_ai.system`,fc=`gen_ai.tool.input`,pc=`gen_ai.tool.name`,mc=`gen_ai.tool.output`,hc=`gen_ai.tool.type`,gc=`gen_ai.usage.input_tokens`,_c=`gen_ai.usage.output_tokens`,vc=`gen_ai.usage.total_tokens`,yc=`graphql.document`,bc=`graphql.operation.name`,xc=`graphql.operation.type`,Sc=`http.client_ip`,Cc=`http.flavor`,wc=`http.host`,Tc=`http.method`,Ec=`http.request.method`,Dc=`http.response.status_code`,Oc=`http.route`,kc=`http.scheme`,Ac=`http.status_code`,jc=`http.target`,Mc=`http.url`,Nc=`http.user_agent`,Pc=`koa.name`,Fc=`koa.type`,Ic=`messaging.batch.message_count`,Lc=`messaging.destination`,Rc=`messaging.destination.name`,zc=`messaging.message.id`,Bc=`messaging.operation.name`,Vc=`messaging.operation.type`,Hc=`messaging.system`,Uc=`network.peer.address`,Wc=`network.peer.port`,Gc=`network.protocol.name`,Kc=`network.protocol.version`,qc=`net.host.ip`,Jc=`net.host.name`,Yc=`net.host.port`,Xc=`net.peer.ip`,Zc=`net.peer.name`,Qc=`net.peer.port`,$c=`net.transport`,el=`rpc.grpc.status_code`,tl=`rpc.method`,nl=`rpc.service`,rl=`rpc.system`,il=`sentry.graphql.operation`,al=`sentry.http.prefetch`,ol=`sentry.origin`,sl=`sentry.sdk.name`,cl=`sentry.sdk.version`,ll=`sentry.segment.id`,ul=`sentry.segment.name`,dl=`sentry.trace_lifecycle`,fl=`server.address`,pl=`server.port`,ml=`service.name`,hl=`service.version`,gl=`url.full`,_l=`url.path`,vl=`url.query`,yl=`url.scheme`,bl=`user_agent.original`;function xl(e,t){let n=Wi(e),r=ia(e),i=Wi(r),{isolationScope:a,scope:o}=ni(e),s=qo(a,o);Tl(n,i,t,s);let c=e.kind;t.emit(`preprocessSpan`,n,{spanKind:c}),n.is_segment&&(Sl(n,s),wl(n,t),t.emit(`processSegmentSpan`,n)),t.emit(`processSpan`,n);let{beforeSendSpan:l}=t.getOptions(),u=l&&wa(l)?El(n,l):n,d=u.attributes?.[kr];return n.is_segment&&d&&Cl(u,{"sentry.segment.name.source":d}),{...Ki(u),_segmentSpan:r}}function Sl(e,t){Cl(e,$o(t.contexts))}function Cl(e,t){let n=e.attributes??={};Object.entries(t).forEach(([e,t])=>{t!=null&&!(e in n)&&(n[e]=t)})}function wl(e,t){let n=t.getIntegrationNames();n.length&&Cl(e,{[Fr]:n})}function Tl(e,t,n,r){let i=n.getSdkMetadata(),{release:a,environment:o}=n.getOptions();Cl(e,{[dl]:`stream`,[ul]:t.name,[ll]:t.span_id,[sl]:i?.sdk?.name,[cl]:i?.sdk?.version,[Nr]:a,[Pr]:o||`production`,[Ir]:r.user?.id,[Lr]:r.user?.email,[Rr]:r.user?.ip_address,[zr]:r.user?.username,...r.attributes})}function El(e,t){return t(e)||(aa(),e)}var Dl=0,Ol=1,kl=2;function Al(e){return new Ml(t=>{t(e)})}function jl(e){return new Ml((t,n)=>{n(e)})}var Ml=class e{constructor(e){this._state=Dl,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===Dl)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===Ol&&e[1](this._value),this._state===kl&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===Dl){if(Gt(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(Ol,e)},r=e=>{t(kl,e)};try{e(n,r)}catch(e){r(e)}}};function Nl(e,t,n,r=0){try{let i=Pl(t,n,e,r);return Gt(i)?i:Al(i)}catch(e){return jl(e)}}function Pl(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return D&&a===null&&A.log(`Event processor "${i.id||`?`}" dropped event`),Gt(a)?a.then(e=>Pl(e,t,n,r+1)):Pl(a,t,n,r+1)}var Fl,Il,Ll,Rl;function zl(e){let t=O._sentryDebugIds,n=O._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Rl&&r.length===Il&&i.length===Ll)return Rl;Il=r.length,Ll=i.length,Rl={},Fl||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=Fl?.[r];if(i&&Rl&&t)Rl[i[0]]=t,Fl&&(Fl[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&Rl&&Fl){Rl[i]=t,Fl[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),Rl}function Bl(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||kn(),timestamp:t.timestamp||Bn()},l=n.integrations||e.integrations.map(e=>e.name);Vl(c,e),Wl(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Hl(c,e.stackParser);let u=Kl(r,n.captureContext);n.mechanism&&Nn(c,n.mechanism);let d=i?i.getEventProcessors():[],f=qo(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Wo(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Al(c):Nl(m,c,n)).then(e=>(e&&Ul(e),typeof o==`number`&&o>0?Gl(e,o,s):e))}function Vl(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=xn(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=xn(e.value,a)})}function Hl(e,t){let n=zl(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Ul(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function Wl(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Gl(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:fn(e.data,t,n)}}))},...e.user&&{user:fn(e.user,t,n)},...e.contexts&&{contexts:fn(e.contexts,t,n)},...e.extra&&{extra:fn(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=fn(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:fn(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=fn(e.contexts.flags,3,n)),r}function Kl(e,t){if(!t)return e;let n=e?e.clone():new rr;return n.update(t),n}function ql(e){if(e)return Jl(e)||Xl(e)?{captureContext:e}:e}function Jl(e){return e instanceof rr||typeof e==`function`}var Yl=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Xl(e){return Object.keys(e).some(e=>Yl.includes(e))}function H(e,t){return M().captureException(e,ql(t))}function Zl(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return M().captureMessage(e,n,r)}function Ql(e,t){return M().captureEvent(e,t)}function $l(e,t){N().setContext(e,t)}function eu(e){N().setExtras(e)}function tu(e,t){N().setExtra(e,t)}function nu(e){N().setTags(e)}function ru(e,t){N().setTag(e,t)}function iu(e){N().setAttributes(e)}function au(e,t){N().setAttribute(e,t)}function ou(e){N().setUser(e)}function su(e){N().setConversationId(e)}function cu(){return N().lastEventId()}async function lu(e){let t=P();return t?t.flush(e):(D&&A.warn(`Cannot flush events. No client defined.`),Promise.resolve(!1))}async function uu(e){let t=P();return t?t.close(e):(D&&A.warn(`Cannot flush events and disable SDK. No client defined.`),Promise.resolve(!1))}function du(){return!!P()}function fu(){let e=P();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function pu(e){N().addEventProcessor(e)}function mu(e){let t=N(),{user:n}=qo(t,M()),{userAgent:r}=O.navigator||{},i=Wn({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&Gn(a,{status:`exited`}),hu(),t.setSession(i),i}function hu(){let e=N(),t=M().getSession()||e.getSession();t&&Kn(t),gu(),e.setSession()}function gu(){let e=N(),t=P(),n=e.getSession();n&&t&&t.captureSession(n)}function _u(e=!1){if(e){hu();return}gu()}function vu(e,t,n){function r(){let r=yu({monitorSlug:e,status:`in_progress`},n),i=Un();function a(t){yu({monitorSlug:e,status:t,checkInId:r,duration:Un()-i})}let o;try{o=t()}catch(e){throw a(`error`),e}return Gt(o)?o.then(e=>(a(`ok`),e),e=>{throw a(`error`),e}):(a(`ok`),o)}let i={...M().getPropagationContext()};return Dr(()=>{if(n?.isolateTrace)return po(r);let e=M();return ki(e.getPropagationContext())||e.setPropagationContext(i),r()})}function yu(e,t){let n=M(),r=P();if(!r)D&&A.warn(`Cannot capture check-in. No client defined.`);else if(!r.captureCheckIn)D&&A.warn(`Cannot capture check-in. Client does not support sending check-ins.`);else return r.captureCheckIn(e,t,n);return kn()}function bu(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}function U(e,t=1){if(_r(it()).getTracingChannelBinding?.()){e();return}t&&bu(setTimeout(()=>{U(e,t-1)},1))}function xu(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Su(e){return`${xu(e)}${e.projectId}/envelope/`}function Cu(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function wu(e,t,n){return t||`${Su(e)}?${Cu(e,n)}`}var Tu=[];function Eu(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function Du(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return Eu(r)}function Ou(e,t){let n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Au(e,t,n)}),n}function ku(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Au(e,t,n){if(n[t.name]){D&&A.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Tu.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),Tu.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}[`processSpan`,`processSegmentSpan`].forEach(n=>{let r=t[n];typeof r==`function`&&e.on(n,n=>r.call(t,n,e))}),D&&A.log(`Integration installed: ${t.name}`)}function ju(e){let t=P();if(!t){D&&A.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function W(e){return e}function Mu(e,t){let n={...e,...t};for(let r in t){let i=e[r],a=t[r];typeof i==`function`&&typeof a==`function`&&(n[r]=new Proxy(i,{apply:(e,t,n)=>(Reflect.apply(e,t,n),Reflect.apply(a,t,n))}))}return n}var Nu=`sentry.timestamp.sequence`,Pu=0,Fu;function Iu(e){let t=Math.floor(e*1e3);Fu!==void 0&&t!==Fu&&(Pu=0);let n=Pu;return Pu++,Fu=t,{key:Nu,value:{value:n,type:`integer`}}}function Lu(e,t){return t?Er(t,()=>{let n=R(),r=n?Li(n):Or(t);return[n?xa(n):ba(e,t),r]}):[void 0,void 0]}var Ru={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function zu(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function Bu(){return!zu()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function Vu(){return typeof window<`u`&&(!Bu()||Hu())}function Hu(){return O.process?.type===`renderer`}function Uu(e,t){let n=t?`auto`:`never`;return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{version:2,...Vu()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Wu(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=yi(r)),Ta(a,[Uu(e,i)])}var Gu=100;function Ku(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function qu(e,t){let n=Zu(),r=Xu(e);r===void 0?n.set(e,[t]):r.length>=Gu?(Yu(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Ju(e,t=M(),n=qu){let r=t?.getClient()??P();if(!r){D&&A.warn(`No client available to capture log.`);return}let{release:i,environment:a,enableLogs:o=!0,beforeSendLog:s}=r.getOptions();if(!o){D&&A.warn(`logging option not enabled, log will not be captured.`);return}let[,c]=Lu(r,t),l={...e.attributes},{user:{id:u,email:d,username:f},attributes:p={}}=qo(N(),t);Ku(l,`user.id`,u,!1),Ku(l,`user.email`,d,!1),Ku(l,`user.name`,f,!1),Ku(l,`sentry.release`,i),Ku(l,`sentry.environment`,a);let{name:m,version:h}=r.getSdkMetadata()?.sdk??{};Ku(l,`sentry.sdk.name`,m),Ku(l,`sentry.sdk.version`,h);let g=r.getIntegrationByName(`Replay`),_=g?.getReplayId(!0);Ku(l,`sentry.replay_id`,_),_&&g?.getRecordingMode()===`buffer`&&Ku(l,`sentry._internal.replay_is_buffering`,!0);let v=e.message;if(Bt(v)){let{__sentry_template_string__:e,__sentry_template_values__:t=[]}=v;t?.length&&(l[`sentry.message.template`]=e),t.forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=e})}Ku(l,`sentry.trace.parent_span_id`,tr(t)?.spanContext().spanId);let y={...e,attributes:l};r.emit(`beforeCaptureLog`,y);let ee=s?ut(()=>s(y)):y;if(!ee){r.recordDroppedEvent(`before_send`,`log_item`,1),D&&A.warn(`beforeSendLog returned null, log will not be captured.`);return}let{level:b,message:te,attributes:x={},severityNumber:ne}=ee,re=Un(),ie=Iu(re);n(r,{timestamp:re,level:b,body:$u(String(te)),trace_id:c?.trace_id,severity_number:ne??Ru[b],attributes:Qu({...br(p),...br(x,!0),[ie.key]:ie.value})}),r.emit(`afterCaptureLog`,ee)}function Yu(e,t){let n=t??Xu(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Wu(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Zu().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function Xu(e){return Zu().get(e)}function Zu(){return ot(`clientToLogBufferMap`,()=>new WeakMap)}function Qu(e){let t={};for(let[n,r]of Object.entries(e)){let e=$u(n);t[e]=r.type===`string`?{...r,value:$u(r.value)}:r}return t}function $u(e){let t=Object(e),n=t.isWellFormed,r=t.toWellFormed;return typeof n==`function`&&typeof r==`function`?n.call(e)?e:r.call(e):e}function ed(e,t){let n=t?`auto`:`never`;return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{version:2,...Vu()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function td(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=yi(r)),Ta(a,[ed(e,i)])}var nd=1e3;function rd(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function id(e,t){let n=ud(),r=ld(e);r===void 0?n.set(e,[t]):r.length>=nd?(cd(e,r),n.set(e,[t])):n.set(e,[...r,t])}function ad(e,t,n){let{release:r,environment:i}=t.getOptions(),a={...e.attributes};rd(a,`user.id`,n.id,!1),rd(a,`user.email`,n.email,!1),rd(a,`user.name`,n.username,!1),rd(a,`sentry.release`,r),rd(a,`sentry.environment`,i);let{name:o,version:s}=t.getSdkMetadata()?.sdk??{};rd(a,`sentry.sdk.name`,o),rd(a,`sentry.sdk.version`,s);let c=t.getIntegrationByName(`Replay`),l=c?.getReplayId(!0);return rd(a,`sentry.replay_id`,l),l&&c?.getRecordingMode()===`buffer`&&rd(a,`sentry._internal.replay_is_buffering`,!0),{...e,attributes:a}}function od(e,t,n,r){let[,i]=Lu(t,n),a=tr(n),o=a?a.spanContext().traceId:i?.trace_id,s=a?a.spanContext().spanId:void 0,c=Un(),l=Iu(c);return{timestamp:c,trace_id:o??``,span_id:s,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...br(r),...br(e.attributes,`skip-undefined`),[l.key]:l.value}}}function sd(e,t){let n=t?.scope??M(),r=t?.captureSerializedMetric??id,i=n?.getClient()??P();if(!i){D&&A.warn(`No client available to capture metric.`);return}let{_experiments:a,enableMetrics:o,beforeSendMetric:s}=i.getOptions();if(!(o??a?.enableMetrics??!0)){D&&A.warn(`metrics option not enabled, metric will not be captured.`);return}let{user:c,attributes:l}=qo(N(),n),u=ad(e,i,c);i.emit(`processMetric`,u);let d=s||a?.beforeSendMetric,f=d?d(u):u;if(!f){D&&A.log("`beforeSendMetric` returned `null`, will not send metric.");return}let p=od(f,i,n,l);D&&A.log(`[Metric]`,p),r(i,p),i.emit(`afterCaptureMetric`,f)}function cd(e,t){let n=t??ld(e)??[];if(n.length===0)return;let r=e.getOptions(),i=td(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);ud().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function ld(e){return ud().get(e)}function ud(){return ot(`clientToMetricBufferMap`,()=>new WeakMap)}function dd(e){return Ki({trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||``,start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status===`ok`||e.status===`cancelled`?`ok`:`error`,is_segment:!1,attributes:{...e.data},links:e.links})}function fd(e,t){if(e.type!==`transaction`||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||t.getOptions().streamGenAiSpans===!1||Ya(t))return;let n=[],r=[];for(let t of e.spans)t.op?.startsWith(`gen_ai.`)?n.push(dd(t)):r.push(t);if(n.length===0)return;e.spans=r;let i=t.getDataCollectionOptions().userInfo?`auto`:`never`;return[{type:`span`,item_count:n.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...Vu()&&{ingest_settings:{infer_ip:i,infer_user_agent:i}},items:n}]}var pd=Symbol.for(`SentryBufferFullError`);function md(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return jl(pd);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return Al(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>bu(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var hd=6e4;function gd(e,t=an()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?hd:r-t}function _d(e,t){return e[t]||e.all||0}function vd(e,t,n=an()){return _d(e,t)>n}function yd(e,{statusCode:t,headers:n},r=an()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+gd(o,r):t===429&&(i.all=r+6e4);return i}function bd(e,t,n=md(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(Da(i,(t,n)=>{let i=Ia(n);vd(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=Ta(i[0],a),s=t=>{if(Oa(o,[`client_report`])){D&&A.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}Da(o,(n,r)=>{e.recordDroppedEvent(t,Ia(r))})};return n.add(()=>t({body:Aa(o)}).then(e=>e.statusCode===413?(D&&A.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(D&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&A.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=yd(r,e),e),e=>{throw s(`network_error`),D&&A.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===pd)return D&&A.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function xd(e,t,n){let r=[{type:`client_report`},{timestamp:n||Bn(),discarded_events:e}];return Ta(t?{dsn:t}:{},[r])}function Sd(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Cd(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[Vr],exclusive_time:o?.[Hr],measurements:e.measurements,is_segment:!0}}function wd(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var Td=`[Filtered]`,Ed=[`forwarded`,`-ip`,`remote-`,`via`,`-user`],Dd=[`auth`,`token`,`secret`,`session`,`password`,`passwd`,`pwd`,`key`,`jwt`,`bearer`,`sso`,`saml`,`csrf`,`xsrf`,`credentials`,`sid`,`identity`,`set-cookie`,`cookie`],Od=[`.sid`,`sessid`,`remember`,`oidc`,`pkce`,`nonce`,`__secure-`,`__host-`,`awsalb`,`awselb`,`akamai`,`__stripe`,`cognito`,`firebase`,`supabase`,`sb-`,`mfa`,`2fa`];function kd(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[`incomingRequest`,`outgoingRequest`,`incomingResponse`,`outgoingResponse`],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:Ed},httpHeaders:{request:{deny:Ed},response:{deny:Ed}},httpBodies:[],urlQueryParams:{deny:Ed},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7}}var Ad={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[`incomingRequest`,`outgoingRequest`,`incomingResponse`,`outgoingResponse`],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function jd(e){let t=e.dataCollection==null?kd(e.sendDefaultPii):Ad,n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var Md=`Not capturing exception because it's already been captured.`,Nd=`Discarded session because of missing or non-string release`,Pd=Symbol.for(`SentryInternalError`),Fd=Symbol.for(`SentryDoNotSendEventError`),Id=5e3;function Ld(e){return{message:e,[Pd]:!0}}function Rd(e){return{message:e,[Fd]:!0}}function zd(e){return j(e)&&Pd in e}function Bd(e){return j(e)&&Fd in e}function Vd(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{if(a+=r(t),a>=8e5)i(e);else if(!s){let t=e.getOptions()._flushInterval??Id;t>0&&(s=!0,o=bu(setTimeout(()=>{i(e)},t)))}}),e.on(`flush`,()=>{i(e)})}var Hd=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=md(e.transportOptions?.bufferSize??64),this._dataCollection=jd(e),e.dsn?this._dsn=Ti(e.dsn):D&&A.warn(`No DSN provided, client will not send events.`),this._dsn){let t=wu(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs??!0,this._options.enableLogs&&Vd(this,`afterCaptureLog`,`flushLogs`,Yd,Yu),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Vd(this,`afterCaptureMetric`,`flushMetrics`,Jd,cd)}captureException(e,t,n){let r=kn();if(Ln(e))return D&&A.log(Md),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:kn(),...n},a=Bt(e)?e:String(e),o=Vt(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=kn();if(t?.originalException&&Ln(t.originalException))return D&&A.log(Md),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=Ud(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),Gn(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(this.emit(`flush`),!t)return!0;let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Au(this,e,this._integrations),t||ku(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=fd(e,this),r=Va(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])r=Ea(r,Na(e));n&&(r=Ea(r,n)),this.sendEnvelope(r).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=ga}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){D&&A.warn(Nd);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){D&&A.warn(Nd);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=Ba(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;D&&A.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return D&&A.error(`Error while sending envelope:`,e),{}}return D&&A.error(`Transport disabled`),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Ou(this,e),ku(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(Gn(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=this.getIntegrationNames();return!t.integrations&&a.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Bl(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...Or(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ba(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=M(),r=N()){return D&&Kd(e)&&A.log(`Captured error event \`${Sd(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{D&&(Bd(e)?A.log(e.message):zd(e)?A.warn(e.message):A.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=qd(e),s=Kd(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:Ei(a),u=Ud(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),Rd("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:Wd(Gd(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw Rd(`${c} returned \`null\`, will not send event.`)}let d=n.getSession()||r.getSession();if(s&&d&&this._updateSessionFromEvent(d,i),s&&typeof l==`number`&&rn()>l)throw this.recordDroppedEvent(`sample_rate`,`error`),Rd(`Discarding event because it's not included in the random sample (sampling rate = ${a})`);if(o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let f=i.transaction_info;return o&&f&&i.transaction!==e.transaction&&(i.transaction_info={...f,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw Bd(e)||zd(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),Ld(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
10
|
-
Reason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===pd&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){D&&A.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){D&&A.log(`No outcomes to send`);return}if(!this._dsn){D&&A.log(`No dsn provided, will not send outcomes`);return}D&&A.log(`Sending outcomes:`,e);let t=xd(e,this._options.tunnel&&yi(this._dsn));this.sendEnvelope(t)}};function Ud(e){return e===`replay_event`?`replay`:e||`error`}function Wd(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Gt(e))return e.then(e=>{if(!Ht(e)&&e!==null)throw Ld(n);return e},e=>{throw Ld(`${t} rejected with ${e}`)});if(!Ht(e)&&e!==null)throw Ld(n);return e}function Gd(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,ignoreSpans:o}=t,s=!wa(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(Kd(c)&&i)return i(c,r);if(qd(c)){if(s||o){let t=Cd(c);if(o?.length&&la({description:t.description,op:t.op,attributes:t.data},o))return null;if(s){let e=s(t);e?c=Jn(n,wd(e)):aa()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(o?.length&&la({description:e.description,op:e.op,attributes:e.data},o)){da(n,e);continue}if(s){let n=s(e);n?t.push(n):(aa(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function Kd(e){return e.type===void 0}function qd(e){return e.type===`transaction`}function Jd(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Xd(e.attributes)}function Yd(e){let t=0;return e.message&&(t+=e.message.length*2),t+Xd(e.attributes)}function Xd(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Zd(e[0]):Vt(e)?t+=Zd(e):t+=100}),t}function Zd(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function Qd(e){M().setClient(e)}var $d=new Set;function ef(e){e.forEach(e=>{$d.add(e),D&&A.log(`AI provider "${e}" wrapping will be skipped`)})}function tf(e){return $d.has(e)}function nf(){$d.clear(),D&&A.log(`Cleared AI provider skip registrations`)}function rf(e,t){return t.some(t=>e.includes(t))}function af(e,t,n){if(t===!1)return{};let r=n==null?Dd:[...Dd,...n],i={};if(t===!0){for(let t of Object.keys(e))i[t]=rf(t.toLowerCase(),r)?Td:e[t];return i}if(`deny`in t){let n=t.deny.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let a=t.toLowerCase();i[t]=rf(a,r)||n.some(e=>a.includes(e))?Td:e[t]}return i}let a=t.allow.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let n=t.toLowerCase();i[t]=rf(n,r)?Td:a.some(e=>n.includes(e))?e[t]:Td}return i}function of(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}var sf=new Set([`false`,`f`,`n`,`no`,`off`,`0`]),cf=new Set([`true`,`t`,`y`,`yes`,`on`,`1`]);function lf(e,t){let n=String(e).toLowerCase();return sf.has(n)?!1:cf.has(n)?!0:t?.strict?null:!!e}function uf(e,t,n,r,i){let a={sent_at:new Date(an()).toISOString()};return n?.sdk&&(a.sdk={name:n.sdk.name,version:n.sdk.version}),r&&i&&(a.dsn=yi(i)),t&&(a.trace=t),Ta(a,[df(e)])}function df(e){return[{type:`check_in`},e]}var ff=`thismessage:/`;function pf(e){return`isRelative`in e}function mf(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?ff:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function hf(e){if(pf(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function gf(e,t,n,r){return`${n?.method?.toUpperCase()??`GET`} ${r||(e?t===`client`?hf(e):e.pathname:`/`)}`}function _f(e,t,n,r,i){let a={[I]:n,[kr]:`url`};return i&&(a[t===`server`?`http.route`:`url.template`]=i,a[kr]=`route`),r?.method&&(a[Kr]=r.method.toUpperCase()),e&&(e.search&&(a[`url.query`]=e.search),e.hash&&(a[`url.fragment`]=e.hash),e.pathname&&(a[`url.path`]=e.pathname,e.pathname===`/`&&(a[kr]=`route`)),pf(e)||(a[gl]=e.href,e.port&&(a[`url.port`]=e.port),e.protocol&&(a[`url.scheme`]=e.protocol),e.hostname&&(a[t===`server`?`server.address`:`url.domain`]=e.hostname))),[gf(e,t,r,i),a]}function vf(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function yf(e){return e.split(/[?#]/,1)[0]}function bf(e){let{protocol:t,host:n,path:r}=e,i=n?.replace(/^.*@/,`[filtered]:[filtered]@`).replace(/(:80)$/,``).replace(/(:443)$/,``)||``;return`${t?`${t}://`:``}${i}${r}`}function xf(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function Sf(e,...t){let n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join(`\0`).replace(/%/g,`%%`).replace(/\0/g,`%s`),n.__sentry_template_values__=t,n}var Cf=Sf;function wf(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:k})),i.version=k)}function Tf(e={}){let t=e.client||P();if(!fu()||!t)return{};let n=_r(it());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||M(),i=e.span||R(),a=ha(i)&&!sa(t.getOptions());if(!i&&wr())return{};let o=i&&!a?Ri(i):Ef(r),s=di(i?xa(i):ba(t,r));if(!Di.test(o))return A.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let c={"sentry-trace":o,baggage:s};return e.propagateTraceparent&&(c.traceparent=i&&!a?zi(i):Df(r)),c}function Ef(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ji(t,r,n)}function Df(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Mi(t,r,n)}var Of=`[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:`;function kf(e,t,n){if(typeof e!=`string`||!t)return!0;let r=n?.get(e);if(r!==void 0)return D&&!r&&A.log(Of,e),r;let i=Tn(e,t);return n?.set(e,i),D&&!i&&A.log(Of,e),i}function Af(e){return Object.entries(e||Tf()).map(([e,t])=>`<meta name="${e}" content="${t}"/>`).join(``)}function jf(e){return Array.from(new Set(e))}var Mf=1048576;function Nf(e){return e===`small`?1e3:e===`medium`?1e4:Mf}function Pf(e){let t={};try{e.forEach((e,n)=>{typeof e==`string`&&(t[n]=e)})}catch{}return t}function Ff(e){let t=Object.create(null);try{Object.entries(e).forEach(([e,n])=>{typeof n==`string`?t[e]=n:typeof n==`number`&&(t[e]=String(n))})}catch{}return t}function If(e){let t=e.headers||{},n=(typeof t[`x-forwarded-host`]==`string`?t[`x-forwarded-host`]:void 0)||(typeof t.host==`string`?t.host:void 0),r=(typeof t[`x-forwarded-proto`]==`string`?t[`x-forwarded-proto`]:void 0)||e.protocol||(e.socket?.encrypted?`https`:`http`),i=e.url||``,a=Lf({url:i,host:n,protocol:r}),o=e.body||void 0,s=e.cookies;return{url:a,method:e.method,query_string:Vf(i),headers:Ff(t),cookies:s,data:o}}function Lf({url:e,protocol:t,host:n}){if(e?.startsWith(`http`))return e;if(e&&n)return`${t}://${n}${e}`}function Rf(e,t=!1,n=`request`){let r=typeof t==`boolean`?kd(t):t,i=n===`request`?r.httpHeaders.request:r.httpHeaders.response,a=r.cookies,o=`http.${n}.header.`,s={};try{let t={};for(let[n,r]of Object.entries(e)){if(r==null)continue;let e=n.toLowerCase();if(e===`cookie`||e===`set-cookie`){if(a===!1)continue;if(typeof r==`string`&&r!==``){let t=af(Bf(r,e===`set-cookie`),a,Od);for(let[n,r]of Object.entries(t))s[`${o}${zf(e)}.${zf(n)}`]=r}else s[`${o}${zf(e)}`]=Td}else{if(i===!1)continue;Array.isArray(r)?t[e]=r.map(e=>e==null?e:String(e)).join(`;`):typeof r==`string`&&(t[e]=r)}}if(i!==!1){let e=af(t,i);for(let[t,n]of Object.entries(e))s[`${o}${zf(t)}`]=n}}catch{}return s}function zf(e){return e.replace(/-/g,`_`)}function Bf(e,t){let n=e.indexOf(`;`),r=t&&n!==-1?e.substring(0,n):e,i=t?[r]:r.split(`; `),a={};for(let e of i){let t=e.indexOf(`=`),n=(t===-1?e:e.substring(0,t)).toLowerCase();a[n]=t===-1?``:e.substring(t+1)}return a}function Vf(e){if(e)try{let t=new URL(e,`http://s.io`).search.slice(1);return t.length?t:void 0}catch{return}}var G={INTERNAL:0,SERVER:1,CLIENT:2,PRODUCER:3,CONSUMER:4},Hf={[G.INTERNAL]:`INTERNAL`,[G.SERVER]:`SERVER`,[G.CLIENT]:`CLIENT`,[G.PRODUCER]:`PRODUCER`,[G.CONSUMER]:`CONSUMER`};function Uf(e){return Hf[e]}var Wf=100;function Gf(e,t){let n=P(),r=N();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Wf}=n.getOptions();if(a<=0)return;let o={timestamp:Bn(),...e},s=i?ut(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var Kf=`FunctionToString`,qf=new WeakMap,Jf=W((()=>({name:Kf,setupOnce(){let e=Function.prototype.toString;try{Function.prototype.toString=function(...t){let n=Zt(this),r;try{qf.has(P())&&n!==void 0&&(r=n)}catch{}return e.apply(r??this,t)}}catch{}},setup(e){qf.set(e,!0)}}))),Yf=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/Java exception was raised during method invocation$/,/Java object is gone$/],Xf=`EventFilters`,Zf=W((e={})=>{let t;return{name:Xf,setup(n){t=$f(e,n.getOptions())},processEvent(n,r,i){return t||=$f(e,i.getOptions()),ep(n,t)?null:n}}}),Qf=W(((e={})=>({...Zf(e),name:`InboundFilters`})));function $f(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Yf],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function ep(e,t){if(!e.type){if(tp(e,t.ignoreErrors))return D&&A.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
11
|
-
Event: ${jn(e)}`),!0;if(sp(e))return D&&A.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
12
|
-
Event: ${jn(e)}`),!0;if(rp(e,t.denyUrls))return D&&A.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
13
|
-
Event: ${jn(e)}.
|
|
14
|
-
Url: ${op(e)}`),!0;if(!ip(e,t.allowUrls))return D&&A.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
15
|
-
Event: ${jn(e)}.
|
|
16
|
-
Url: ${op(e)}`),!0}else if(e.type===`transaction`&&np(e,t.ignoreTransactions))return D&&A.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
17
|
-
Event: ${jn(e)}`),!0;return!1}function tp(e,t){return t?.length?Sd(e).some(e=>Tn(e,t)):!1}function np(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Tn(n,t):!1}function rp(e,t){if(!t?.length)return!1;let n=op(e);return n?Tn(n,t):!1}function ip(e,t){if(!t?.length)return!0;let n=op(e);return!n||Tn(n,t)}function ap(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function op(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?ap(t):null}catch{return D&&A.error(`Cannot extract url for event ${jn(e)}`),null}}function sp(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function cp(e,t,n,r,i,a){if(!i.exception?.values||!a||!It(a.originalException))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=lp(e,t,r,a.originalException,n,i.exception.values,o,0))}function lp(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(It(r[i])){dp(o,s,r);let a=e(t,r[i]),l=c.length;fp(a,i,l,s),c=lp(e,t,n,r[i],i,[a,...c],a,l)}return up(r)&&r.errors.forEach((a,l)=>{if(It(a)){dp(o,s,r);let u=e(t,a),d=c.length;fp(u,`errors[${l}]`,d,s),c=lp(e,t,n,a,i,[u,...c],u,d)}}),c}function up(e){return Array.isArray(e.errors)}function dp(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...up(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function fp(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function pp(e,t){return e(t.stack||``,1)}function mp(e){return It(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function hp(e){return mp(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function gp(e,t){let n={type:t.name||t.constructor.name,value:hp(t)},r=pp(e,t);return r.length&&(n.stacktrace={frames:r}),n}function _p(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(It(n))return n}}function vp(e){if(`name`in e&&typeof e.name==`string`){let t=`'${e.name}' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message '${e.message}'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;let t=en(e);if(Rt(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=yp(e);return`${n&&n!==`Object`?`'${n}'`:`Object`} captured as exception with keys: ${t}`}function yp(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function bp(e,t,n,r){if(It(n))return[n,void 0];if(t.synthetic=!0,Ht(n)){let t=e?.getOptions().normalizeDepth,i={__serialized__:pn(n,t)},a=_p(n);if(a)return[a,i];let o=vp(n),s=r?.syntheticException||Error(o);return s.message=o,[s,i]}let i=r?.syntheticException||Error(n);return i.message=`${n}`,[i,void 0]}function xp(e,t,n,r){let i=r?.data&&r.data.mechanism||{handled:!0,type:`generic`},[a,o]=bp(e,i,n,r),s={exception:{values:[gp(t,a)]}};return o&&(s.extra=o),Mn(s,void 0,void 0),Nn(s,i),{...s,event_id:r?.event_id}}function Sp(e,t,n=`info`,r,i){let a={event_id:r?.event_id,level:n};if(i&&r?.syntheticException){let n=pp(e,r.syntheticException);n.length&&(a.exception={values:[{value:t,stacktrace:{frames:n}}]},Nn(a,{synthetic:!0}))}if(Bt(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return a.logentry={message:e,params:n},a}return a.message=t,a}var Cp=`cause`,wp=5,Tp=`LinkedErrors`,Ep=W(((e={})=>{let t=e.limit||wp,n=e.key||Cp;return{name:Tp,preprocessEvent(e,r,i){cp(gp,i.getOptions().stackParser,n,t,e,r)}}})),Dp=[`X-Client-IP`,`X-Forwarded-For`,`Fly-Client-IP`,`CF-Connecting-IP`,`Fastly-Client-Ip`,`True-Client-Ip`,`X-Real-IP`,`X-Cluster-Client-IP`,`X-Forwarded`,`Forwarded-For`,`Forwarded`,`X-Vercel-Forwarded-For`];function Op(e){let t={};for(let n of Object.keys(e))t[n.toLowerCase()]=e[n];return Dp.map(e=>{let n=t[e.toLowerCase()],r=Array.isArray(n)?n.join(`;`):n;return e===`Forwarded`?kp(r):r?.split(`,`).map(e=>e.trim())}).reduce((e,t)=>t?e.concat(t):e,[]).find(e=>e!==null&&Ap(e))||null}function kp(e){if(!e)return null;for(let t of e.split(`;`))if(t.startsWith(`for=`))return t.slice(4);return null}function Ap(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}var jp=`RequestData`,Mp=W(((e={})=>{function t(t){let n=t.getDataCollectionOptions(),r={...n,...e.include?.cookies===!0&&n.cookies===!1&&{cookies:!0},...e.include?.headers===!0&&n.httpHeaders.request===!1&&{httpHeaders:{...n.httpHeaders,request:!0}}};return{dataCollection:r,include:{cookies:r.cookies!==!1,data:!0,headers:r.httpHeaders.request!==!1,ip:r.userInfo,query_string:r.urlQueryParams!==!1,url:!0,...e.include}}}return{name:jp,processEvent(e,n,r){let{sdkProcessingMetadata:i={}}=e,{normalizedRequest:a,ipAddress:o}=i,{include:s}=t(r);return a&&Np(e,a,{ipAddress:o},s),e},processSegmentSpan(e,n){let{sdkProcessingMetadata:r={}}=N().getScopeData(),{normalizedRequest:i,ipAddress:a}=r;if(!i)return;let{include:o,dataCollection:s}=t(n);Pp(e,i,a,o,s)}}}));function Np(e,t,n,r){if(e.request={...e.request,...Fp(t,r)},r.ip){let r=t.headers&&Op(t.headers)||n.ipAddress;r&&(e.user={...e.user,ip_address:r})}}function Pp(e,t,n,r,i){let a=Fp(t,r),o={};if(a.url&&(o[gl]=a.url),a.method&&(o[`http.request.method`]=a.method),a.query_string&&(o[vl]=Ip(a.query_string)),Cl(e,o),a.cookies&&Object.keys(a.cookies).length>0&&Cl(e,Rf({cookie:Object.entries(a.cookies).map(([e,t])=>`${e}=${t}`).join(`; `)},i,`request`)),a.headers&&Cl(e,Rf(a.headers,i,`request`)),a.data!=null){let t=typeof a.data==`string`?a.data:JSON.stringify(a.data);t&&Cl(e,{"http.request.body.data":t})}if(r.ip){let r=t.headers&&Op(t.headers)||n||void 0;r&&Cl(e,{[Rr]:r})}}function Fp(e,t){let n={},r={...e.headers};if(t.headers&&(n.headers=r,t.cookies||delete r.cookie,!t.ip)){let e=new Set(Dp.map(e=>e.toLowerCase()));for(let t of Object.keys(r))e.has(t.toLowerCase())&&delete r[t]}return n.method=e.method,t.url&&(n.url=e.url),t.cookies&&(n.cookies=e.cookies||(r?.cookie?of(r.cookie):void 0)||{}),t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function Ip(e){return typeof e==`string`?e||void 0:(Array.isArray(e)?e:Object.entries(e)).map(([e,t])=>`${e}=${t}`).join(`&`)||void 0}var Lp=new Set([]);function Rp(e){let t=`console`,n=Mt(t,e);return Nt(t,Vp),n}function zp(e){for(let t of e)Lp.add(t);return()=>{for(let t of e)Lp.delete(t)}}var Bp=new Set;function Vp(){`console`in O&&st.forEach(function(e){!Bp.has(e)&&e in O.console&&(Bp.add(e),qt(O.console,e,function(t){return lt[e]=t,function(...t){let n=t[0],r=lt[e],i=Lp.size&&typeof n==`string`&&Tn(n,Lp);i||Pt(`console`,{args:t,level:e}),(!i||D&&A.isEnabled())&&r?.apply(O.console,t)}}))})}function Hp(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var Up=`CaptureConsole`,Wp=W(((e={})=>{let t=e.levels||st,n=e.handled??!0;return{name:Up,setup(e){`console`in O&&Rp(({args:r,level:i})=>{P()===e&&t.includes(i)&&Gp(r,i,n)})}}}));function Gp(e,t,n){let r=Hp(t),i=Error(),a={level:Hp(t),extra:{arguments:e}};Er(o=>{if(o.addEventProcessor(e=>(e.logger=`console`,Nn(e,{handled:n,type:`auto.core.capture_console`}),e)),t===`assert`){if(!e[0]){let t=`Assertion failed: ${Cn(e.slice(1),` `)||`console.assert`}`;o.setExtra(`arguments`,e.slice(1)),o.captureMessage(t,r,{captureContext:a,syntheticException:i})}return}let s=e.find(e=>e instanceof Error);if(s){H(s,a);return}let c=Cn(e,` `);o.captureMessage(c,r,{captureContext:a,syntheticException:i})})}var Kp=`Dedupe`,qp=W((()=>{let e;return{name:Kp,processEvent(t){if(t.type)return t;try{if(Jp(t,e))return D&&A.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function Jp(e,t){return t?!!(Yp(e,t)||Xp(e,t)):!1}function Yp(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Qp(e,t)||!Zp(e,t))}function Xp(e,t){let n=$p(t),r=$p(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Qp(e,t)||!Zp(e,t))}function Zp(e,t){let n=Ot(e),r=Ot(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Qp(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function $p(e){return e.exception?.values?.[0]}var em=`ExtraErrorData`,tm=W(((e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:em,processEvent(e,r,i){let{maxValueLength:a}=i.getOptions();return nm(e,r,t,n,a)}}}));function nm(e,t={},n,r,i){if(!t.originalException||!It(t.originalException))return e;let a=t.originalException.name||t.originalException.constructor.name,o=rm(t.originalException,r,i);if(o){let t={...e.contexts},r=fn(o,n);return Ht(r)&&(cn(r),t[a]=r),{...e,contexts:t}}return e}function rm(e,t,n){try{let r=[`name`,`message`,`stack`,`line`,`column`,`fileName`,`lineNumber`,`columnNumber`,`toJSON`],i={};for(let t of Object.keys(e)){if(r.indexOf(t)!==-1)continue;let a=e[t];i[t]=It(a)||typeof a==`string`?n?xn(`${a}`,n):`${a}`:a}if(t&&e.cause!==void 0&&(i.cause=It(e.cause)?{[e.cause.name||e.cause.constructor.name]:rm(e.cause,!1,n)}:e.cause),typeof e.toJSON==`function`){let t=e.toJSON();for(let e of Object.keys(t)){let n=t[e];i[e]=It(n)?n.toString():n}}return i}catch(e){D&&A.error(`Unable to extract extra data from the Error object:`,e)}return null}function im(e,t){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t];r===`.`?e.splice(t,1):r===`..`?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;)e.unshift(`..`);return e}var am=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function om(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=am.exec(t);return n?n.slice(1):[]}function sm(...e){let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:`/`;i&&(t=`${i}/${t}`,n=i.charAt(0)===`/`)}return t=im(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`}function cm(e){let t=0;for(;t<e.length&&e[t]===``;t++);let n=e.length-1;for(;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}function lm(e,t){e=sm(e).slice(1),t=sm(t).slice(1);let n=cm(e.split(`/`)),r=cm(t.split(`/`)),i=Math.min(n.length,r.length),a=i;for(let e=0;e<i;e++)if(n[e]!==r[e]){a=e;break}let o=[];for(let e=a;e<n.length;e++)o.push(`..`);return o=o.concat(r.slice(a)),o.join(`/`)}function um(e){let t=om(e),n=t[0]||``,r=t[1];return!n&&!r?`.`:(r&&=r.slice(0,r.length-1),n+r)}function dm(e,t){let n=om(e)[2]||``;return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var fm=`RewriteFrames`,pm=W((e={})=>{let t=e.root,n=e.prefix||`app:///`,r=`window`in O&&!!O.window,i=e.iteratee||mm({isBrowser:r,root:t,prefix:n});function a(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>({...e,...e.stacktrace&&{stacktrace:o(e.stacktrace)}}))}}}catch{return e}}function o(e){return{...e,frames:e?.frames?.map(e=>i(e))}}return{name:fm,processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=a(t)),t}}});function mm({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes(`\\`)&&!r.filename.includes(`/`),a=/^\//.test(r.filename);if(e){if(t){let e=r.filename;e.indexOf(t)===0&&(r.filename=e.replace(t,n))}}else if(i||a){let e=i?r.filename.replace(/^[a-zA-Z]:/,``).replace(/\\/g,`/`):r.filename;r.filename=`${n}${t?lm(t,e):dm(e)}`}return r}}var hm=[`reauthenticate`,`signInAnonymously`,`signInWithOAuth`,`signInWithIdToken`,`signInWithOtp`,`signInWithPassword`,`signInWithSSO`,`signOut`,`signUp`,`verifyOtp`],gm=[`createUser`,`deleteUser`,`listUsers`,`getUserById`,`updateUserById`,`inviteUserByEmail`],_m={eq:`eq`,neq:`neq`,gt:`gt`,gte:`gte`,lt:`lt`,lte:`lte`,like:`like`,"like(all)":`likeAllOf`,"like(any)":`likeAnyOf`,ilike:`ilike`,"ilike(all)":`ilikeAllOf`,"ilike(any)":`ilikeAnyOf`,is:`is`,in:`in`,cs:`contains`,cd:`containedBy`,sr:`rangeGt`,nxl:`rangeGte`,sl:`rangeLt`,nxr:`rangeLte`,adj:`rangeAdjacent`,ov:`overlaps`,fts:``,plfts:`plain`,phfts:`phrase`,wfts:`websearch`,not:`not`},vm=[`select`,`insert`,`upsert`,`update`,`delete`];function ym(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function bm(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function xm(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function Sm(e,t){return xm(e,t)!==void 0}function Cm(e,t){if(!e)return;if(typeof e.get==`function`)return e.get(t)??void 0;let n=e,r=t.toLowerCase(),i=Object.keys(n).find(e=>e.toLowerCase()===r);return i===void 0?void 0:n[i]}function wm(e,t={}){switch(e){case`GET`:return`select`;case`POST`:return Cm(t,`Prefer`)?.includes(`resolution=`)?`upsert`:`insert`;case`PATCH`:return`update`;case`DELETE`:return`delete`;default:return`<unknown-op>`}}function Tm(e,t){if(t===``||t===`*`)return`select(*)`;if(e===`select`)return`select(${t})`;if(e===`or`||e.endsWith(`.or`))return`${e}${t}`;let[n,...r]=t.split(`.`),i;return i=n?.startsWith(`fts`)?`textSearch`:n?.startsWith(`plfts`)?`textSearch[plain]`:n?.startsWith(`phfts`)?`textSearch[phrase]`:n?.startsWith(`wfts`)?`textSearch[websearch]`:n&&_m[n]||`filter`,`${i}(${e}, ${r.join(`.`)})`}function Em(e,t=!1){return new Proxy(e,{apply(n,r,i){return z({name:`auth ${t?`(admin) `:``}${e.name}`,attributes:{[I]:`auto.db.supabase`,[F]:`db`,"db.system":`postgresql`,"db.operation":`auth.${t?`admin.`:``}${e.name}`}},e=>Reflect.apply(n,r,i).then(t=>(j(t)&&`error`in t&&t.error?(e.setStatus({code:2}),H(t.error,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}})):e.setStatus({code:1}),e.end(),t)).catch(t=>{throw e.setStatus({code:2}),e.end(),H(t,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}}),t}).then(...i))}})}function Dm(e){let t=e.auth;if(t&&!bm(e.auth)){for(let n of hm){let r=t[n];r&&typeof e.auth[n]==`function`&&(e.auth[n]=Em(r))}for(let n of gm){let r=t.admin[n];r&&typeof e.auth.admin[n]==`function`&&(e.auth.admin[n]=Em(r,!0))}ym(e.auth)}}function Om(e,t){bm(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(e,n,r){let i=Reflect.apply(e,n,r),a=i.constructor;return Am(a,t),i}}),ym(e.prototype.from))}function km(e,t){bm(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(e,n,r){let i=vm,a=n,o=wm(a.method,a.headers);if(!i.includes(o)||!a?.url?.pathname||typeof a.url.pathname!=`string`)return Reflect.apply(e,n,r);let s=a.url.pathname.split(`/`),c=s.length>0?s[s.length-1]:``,l=[];for(let[e,t]of a.url.searchParams.entries())l.push(Tm(e,t));let u=Object.create(null);if(Ht(a.body))for(let[e,t]of Object.entries(a.body))u[e]=t;let d=P(),f=t.sendOperationData??d?.getDataCollectionOptions().databaseQueryData===!0,p=xm(a.body,u),m=o===`select`?``:`${o}${Sm(a.body,u)?`(...) `:``}`,h=f?l.join(` `):l.length>0?`[redacted]`:``,g=[m.trimEnd(),h].filter(Boolean).join(` `),_=g?`${g} from(${c})`:`from(${c})`,v={"db.table":c,"db.schema":a.schema,"db.url":a.url.origin,"db.sdk":Cm(a.headers,`X-Client-Info`),"db.system":`postgresql`,"db.operation":o,[I]:`auto.db.supabase`,[F]:`db`};return l.length&&f&&(v[`db.query`]=l),p!==void 0&&f&&(v[`db.body`]=p),z({name:_,attributes:v},t=>Reflect.apply(e,n,[]).then(e=>{if(t&&(e&&typeof e==`object`&&`status`in e&&Yr(t,e.status||500),t.end()),e?.error){let t=Error(e.error.message);e.error.code&&(t.code=e.error.code),e.error.details&&(t.details=e.error.details);let n={};l.length&&f&&(n.query=l),p!==void 0&&f&&(n.body=p),H(t,e=>(e.addEventProcessor(e=>(Nn(e,{handled:!1,type:`auto.db.supabase.postgres`}),e)),e.setContext(`supabase`,n),e))}let n={type:`supabase`,category:`db.${o}`,message:_},r={};return l.length&&f&&(r.query=l),p!==void 0&&f&&(r.body=p),Object.keys(r).length&&(n.data=r),Gf(n),e},e=>{throw t&&(Yr(t,500),t.end()),e}).then(...r))}}),ym(e.prototype.then))}function Am(e,t){for(let n of vm)bm(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(e,r,i){let a=Reflect.apply(e,r,i),o=a.constructor;return D&&A.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),km(o,t),a}}),ym(e.prototype[n]))}var jm=(e,t={})=>{if(!e){D&&A.warn(`Supabase integration was not installed because no Supabase client was provided.`);return}Om(e.constructor===Function?e:e.constructor,t),Dm(e)},Mm=`Supabase`,Nm=((e,t)=>({setupOnce(){jm(e,t)},name:Mm})),Pm=W(e=>Nm(e.supabaseClient,{sendOperationData:e.sendOperationData})),Fm=10,Im=`ZodErrors`;function Lm(e){return It(e)&&e.name===`ZodError`&&Array.isArray(e.issues)}function Rm(e){return{...e,path:`path`in e&&Array.isArray(e.path)?e.path.join(`.`):void 0,keys:`keys`in e?JSON.stringify(e.keys):void 0,unionErrors:`unionErrors`in e?JSON.stringify(e.unionErrors):void 0}}function zm(e){return e.map(e=>typeof e==`number`?`<array>`:e).join(`.`)}function Bm(e){let t=new Set;for(let n of e.issues){let e=zm(n.path);e.length>0&&t.add(e)}let n=Array.from(t);if(n.length===0){let t=`variable`;if(e.issues.length>0){let n=e.issues[0];n!==void 0&&`expected`in n&&typeof n.expected==`string`&&(t=n.expected)}return`Failed to validate ${t}`}return`Failed to validate keys: ${xn(n.join(`, `),100)}`}function Vm(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!Lm(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(Rm);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:`zod_issues.json`,data:JSON.stringify({issues:i})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:Bm(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,e)}}}catch(e){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:`an exception was thrown while processing ZodError within applyZodErrorsToEvent()`,error:e instanceof Error?`${e.name}: ${e.message}
|
|
18
|
-
${e.stack}`:`unknown`}}}}}var Hm=W(((e={})=>{let t=e.limit??Fm;return{name:Im,processEvent(n,r){return Vm(t,e.saveZodIssuesAsAttachment,n,r)}}})),Um=`Console`,Wm=W((e={})=>{let t=new Set(e.levels||st);return{name:Um,setup(n){let r=Rp(({args:e,level:r})=>{P()===n&&t.has(r)&&Gm(r,e)});if(n.registerCleanup(r),e.filter){let t=zp(e.filter);n.registerCleanup(t)}}}});function Gm(e,t){let n={category:`console`,data:{arguments:t,logger:`console`},level:Hp(e),message:Km(t)};if(e===`assert`){if(t[0]===!1){let e=t.slice(1);n.message=e.length>0?`Assertion failed: ${Km(e)}`:`Assertion failed`,n.data.arguments=e}else return}Gf(n,{input:t,level:e})}function Km(e){return`util`in O&&typeof O.util.format==`function`?O.util.format(...e):Cn(e,` `)}var qm=`flag.evaluation.`;function Jm(e){if(e.type)return e;let t=M().getScopeData().contexts.flags,n=t?t.values:[];return n.length?(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...n]},e):e}function Ym(e,t,n=100){let r=M().getScopeData().contexts;r.flags||={values:[]};let i=r.flags.values;Xm(i,e,t,n)}function Xm(e,t,n,r){if(typeof n!=`boolean`)return;if(e.length>r){D&&A.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let i=e.findIndex(e=>e.flag===t);i!==-1&&e.splice(i,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function Zm(e,t,n=10){if(typeof t!=`boolean`)return;let r=R();if(!r)return;let i=L(r).data;if(`${qm}${e}`in i){r.setAttribute(`${qm}${e}`,t);return}Object.keys(i).filter(e=>e.startsWith(qm)).length<n&&r.setAttribute(`${qm}${e}`,t)}var Qm=W(()=>({name:`FeatureFlags`,processEvent(e,t,n){return Jm(e)},addFeatureFlag(e,t){Ym(e,t),Zm(e,t)}})),$m=W(({growthbookClass:e})=>({name:`GrowthBook`,setupOnce(){let t=e.prototype;typeof t.isOn==`function`&&qt(t,`isOn`,eh),typeof t.getFeatureValue==`function`&&qt(t,`getFeatureValue`,eh)},processEvent(e,t,n){return Jm(e)}}));function eh(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`&&(Ym(n,r),Zm(n,r)),r}}var th=`ConversationId`,nh=W((()=>({name:th,setup(e){e.on(`spanStart`,e=>{let t=M().getScopeData(),n=N().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=L(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(qr,r)}})}})));function rh(e){return!!e&&e._profiler!==void 0&&typeof e._profiler.start==`function`&&typeof e._profiler.stop==`function`}function ih(){let e=P();if(!e){D&&A.warn(`No Sentry client available, profiling is not started`);return}let t=e.getIntegrationByName(`ProfilingIntegration`);if(!t){D&&A.warn(`ProfilingIntegration is not available`);return}if(!rh(t)){D&&A.warn(`Profiler is not available on profiling integration.`);return}t._profiler.start()}function ah(){let e=P();if(!e){D&&A.warn(`No Sentry client available, profiling is not started`);return}let t=e.getIntegrationByName(`ProfilingIntegration`);if(!t){D&&A.warn(`ProfilingIntegration is not available`);return}if(!rh(t)){D&&A.warn(`Profiler is not available on profiling integration.`);return}t._profiler.stop()}var oh={startProfiler:ih,stopProfiler:ah};function sh(e,t={},n=M()){let{message:r,name:i,email:a,url:o,source:s,associatedEventId:c,tags:l}=e,u={contexts:{feedback:{contact_email:a,name:i,message:r,url:o,source:s,associated_event_id:c}},type:`feedback`,level:`info`,tags:l},d=n?.getClient()||P();return d&&d.emit(`beforeSendFeedback`,u,t),n.captureEvent(u,t)}function ch(e,t,n){return`util`in O&&typeof O.util.format==`function`?O.util.format(...e):lh(e,t,n)}function lh(e,t,n){return e.map(e=>Vt(e)?String(e):JSON.stringify(fn(e,t,n))).join(` `)}function uh(e){return/%[sdifocO]/.test(e)}function dh(e,t){let n={};return n[`sentry.message.template`]=`${e} ${Array(t.length).fill(`{}`).join(` `)}`,t.forEach((e,t)=>{n[`sentry.message.parameter.${t}`]=e}),n}var fh=`ConsoleLogs`,ph={[I]:`auto.log.console`},mh=W(((e={})=>{let t=e.levels||st;return{name:fh,setup(e){let{enableLogs:n,normalizeDepth:r=3,normalizeMaxBreadth:i=1e3}=e.getOptions();if(!n){D&&A.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=Rp(({args:n,level:a})=>{if(P()!==e||!t.includes(a))return;let o=n[0],s=n.slice(1);if(a===`assert`){o||Ju({level:`error`,message:s.length>0?`Assertion failed: ${ch(s,r,i)}`:`Assertion failed`,attributes:ph});return}let c=a===`log`,l={...ph};if(Ht(o)){Object.assign(l,fn(o,r,i));let e=typeof n[1]==`string`?2:1;n.slice(e).forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=fn(e,r,i)})}else if(s.length>0&&typeof o==`string`&&!uh(o)){let e=dh(o,s);for(let[t,n]of Object.entries(e))l[t]=t.startsWith(`sentry.message.parameter.`)?fn(n,r,i):n}Ju({level:c?`info`:a,message:ch(n,r,i),severityNumber:c?10:void 0,attributes:l})});e.registerCleanup(a)}}})),hh=f({count:()=>_h,distribution:()=>yh,gauge:()=>vh});function gh(e,t,n,r){sd({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function _h(e,t=1,n){gh(`counter`,e,t,n)}function vh(e,t,n){gh(`gauge`,e,t,n)}function yh(e,t,n){gh(`distribution`,e,t,n)}var bh=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function xh(e={}){let t=new Set(e.levels??bh),n=e.client;return{log(e){let{type:r,level:i,message:a,args:o,tag:s,date:c,...l}=e,u=n||P();if(!u)return;let d=wh(r,i);if(!t.has(d))return;let{normalizeDepth:f=3,normalizeMaxBreadth:p=1e3}=u.getOptions(),m={};for(let[e,t]of Object.entries(l))m[e]=fn(t,f,p);m[`sentry.origin`]=`auto.log.consola`,s&&(m[`consola.tag`]=s),r&&(m[`consola.type`]=r),i!=null&&typeof i==`number`&&(m[`consola.level`]=i);let h=Eh(Th(o,f,p),f,p);h?.attributes&&Object.assign(m,h.attributes),Ju({level:d,message:h?.message||a||o&&ch(o,f,p)||``,attributes:m})}}}var Sh={silent:`trace`,fatal:`fatal`,error:`error`,warn:`warn`,log:`info`,info:`info`,success:`info`,fail:`error`,ready:`info`,start:`info`,box:`info`,debug:`debug`,trace:`trace`,verbose:`debug`,critical:`fatal`,notice:`info`},Ch={0:`fatal`,1:`warn`,2:`info`,3:`info`,4:`debug`,5:`trace`};function wh(e,t){if(e===`verbose`)return`debug`;if(e===`silent`)return`trace`;if(e){let t=Sh[e];if(t)return t}if(typeof t==`number`){let e=Ch[t];if(e)return e}return`info`}function Th(e,t,n){if(!e?.length)return{message:``};let r=ch(e,t,n),i=e[0];if(Ht(i)){let t=typeof e[1]==`string`?2:1;return{message:r,attributes:i,messageParameters:e.slice(t)}}{let t=e.slice(1),n=t.length>0&&typeof i==`string`&&!uh(i);return{message:r,messageTemplate:n?i:void 0,messageParameters:n?t:void 0}}}function Eh(e,t,n){let{message:r,attributes:i,messageTemplate:a,messageParameters:o}=e,s={};if(a&&o){let e=dh(a,o);for(let[r,i]of Object.entries(e))s[r]=r.startsWith(`sentry.message.parameter.`)?fn(i,t,n):i}else o&&o.length>0&&o.forEach((e,r)=>{s[`sentry.message.parameter.${r}`]=fn(e,t,n)});return{message:r,attributes:{...fn(i,t,n),...s}}}var Dh=`gen_ai.prompt`,Oh=`gen_ai.system`,kh=`gen_ai.request.model`,Ah=`gen_ai.request.stream`,jh=`gen_ai.request.temperature`,Mh=`gen_ai.request.max_tokens`,Nh=`gen_ai.request.frequency_penalty`,Ph=`gen_ai.request.presence_penalty`,Fh=`gen_ai.request.top_p`,Ih=`gen_ai.request.top_k`,Lh=`gen_ai.request.encoding_format`,Rh=`gen_ai.request.dimensions`,zh=`gen_ai.response.finish_reasons`,Bh=`gen_ai.response.model`,Vh=`gen_ai.response.id`,Hh=`gen_ai.response.stop_reason`,Uh=`gen_ai.usage.input_tokens`,Wh=`gen_ai.usage.output_tokens`,Gh=`gen_ai.usage.total_tokens`,Kh=`gen_ai.operation.name`,qh=`sentry.sdk_meta.gen_ai.input.messages.original_length`,Jh=`gen_ai.input.messages`,Yh=`gen_ai.output.messages`,Xh=`gen_ai.system_instructions`,Zh=`gen_ai.response.text`,Qh=`gen_ai.request.available_tools`,$h=`gen_ai.response.streaming`,eg=`gen_ai.response.tool_calls`,tg=`gen_ai.agent.name`,ng=`gen_ai.pipeline.name`,rg=`gen_ai.conversation.id`,ig=`gen_ai.usage.cache_creation_input_tokens`,ag=`gen_ai.usage.cache_read_input_tokens`,og=`gen_ai.usage.input_tokens.cache_write`,sg=`gen_ai.usage.input_tokens.cached`,cg=`gen_ai.invoke_agent`,lg=`gen_ai.embeddings.input`,ug=`gen_ai.embeddings`,dg=`gen_ai.execute_tool`,fg=`gen_ai.tool.name`,pg=`gen_ai.tool.call.id`,mg=`gen_ai.tool.type`,hg=`gen_ai.tool.input`,gg=`gen_ai.tool.output`,_g=`gen_ai.tool.description`;function vg(e){return!e||typeof e!=`object`?!1:xg(e)||Sg(e)||yg(e)||Cg(e)||wg(e)||Tg(e)||Eg(e)||Dg(e)||Og(e)||kg(e)||Ag(e)||jg(e)}function yg(e){return`image_url`in e?typeof e.image_url==`string`?e.image_url.startsWith(`data:`):bg(e):!1}function bg(e){return`image_url`in e&&!!e.image_url&&typeof e.image_url==`object`&&`url`in e.image_url&&typeof e.image_url.url==`string`&&e.image_url.url.startsWith(`data:`)}function xg(e){return`type`in e&&typeof e.type==`string`&&`source`in e&&vg(e.source)}function Sg(e){return`inlineData`in e&&!!e.inlineData&&typeof e.inlineData==`object`&&`data`in e.inlineData&&typeof e.inlineData.data==`string`}function Cg(e){return`type`in e&&e.type===`input_audio`&&`input_audio`in e&&!!e.input_audio&&typeof e.input_audio==`object`&&`data`in e.input_audio&&typeof e.input_audio.data==`string`}function wg(e){return`type`in e&&e.type===`file`&&`file`in e&&!!e.file&&typeof e.file==`object`&&`file_data`in e.file&&typeof e.file.file_data==`string`}function Tg(e){return`media_type`in e&&typeof e.media_type==`string`&&`data`in e}function Eg(e){return`type`in e&&e.type===`file`&&`mediaType`in e&&typeof e.mediaType==`string`&&`data`in e&&typeof e.data==`string`&&!e.data.startsWith(`http://`)&&!e.data.startsWith(`https://`)}function Dg(e){return`type`in e&&e.type===`image`&&`image`in e&&typeof e.image==`string`&&!e.image.startsWith(`http://`)&&!e.image.startsWith(`https://`)}function Og(e){return`type`in e&&(e.type===`blob`||e.type===`base64`)}function kg(e){return`b64_json`in e}function Ag(e){return`type`in e&&`result`in e&&e.type===`image_generation`}function jg(e){return`uri`in e&&typeof e.uri==`string`&&e.uri.startsWith(`data:`)}var Mg=`[Blob substitute]`,Ng=[`image_url`,`data`,`content`,`b64_json`,`result`,`uri`,`image`];function Pg(e){let t={...e};vg(t.source)&&(t.source=Pg(t.source)),Sg(e)&&(t.inlineData={...e.inlineData,data:Mg}),bg(e)&&(t.image_url={...e.image_url,url:Mg}),Cg(e)&&(t.input_audio={...e.input_audio,data:Mg}),wg(e)&&(t.file={...e.file,file_data:Mg});for(let e of Ng)typeof t[e]==`string`&&(t[e]=Mg);return t}var Fg=2e4,Ig=e=>new TextEncoder().encode(e).length,Lg=e=>Ig(JSON.stringify(e));function Rg(e,t){if(Ig(e)<=t)return e;let n=0,r=e.length,i=``;for(;n<=r;){let a=Math.floor((n+r)/2),o=e.slice(0,a);Ig(o)<=t?(i=o,n=a+1):r=a-1}return i}function zg(e){return typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``}function Bg(e,t){return typeof e==`string`?t:{...e,text:t}}function Vg(e){return typeof e==`object`&&!!e&&`content`in e&&typeof e.content==`string`}function Hg(e){return typeof e==`object`&&!!e&&`content`in e&&Array.isArray(e.content)}function Ug(e){return typeof e==`object`&&!!e&&`parts`in e&&Array.isArray(e.parts)&&e.parts.length>0}function Wg(e,t){let n=t-Lg({...e,content:``});if(n<=0)return[];let r=Rg(e.content,n);return[{...e,content:r}]}function Gg(e){return`parts`in e&&Array.isArray(e.parts)?{key:`parts`,items:e.parts}:`content`in e&&Array.isArray(e.content)?{key:`content`,items:e.content}:{key:null,items:[]}}function Kg(e,t){let{key:n,items:r}=Gg(e);if(n===null||r.length===0)return[];let i=r.map(e=>Bg(e,``)),a=t-Lg({...e,[n]:i});if(a<=0)return[];let o=[];for(let e of r){let t=zg(e),n=Ig(t);if(n<=a)o.push(e),a-=n;else if(o.length===0){let n=Rg(t,a);n&&o.push(Bg(e,n));break}else break}return o.length<=0?[]:[{...e,[n]:o}]}function qg(e,t){if(!e)return[];if(typeof e==`string`){let n=Rg(e,t);return n?[n]:[]}return typeof e==`object`?Vg(e)?Wg(e,t):Hg(e)||Ug(e)?Kg(e,t):[]:[]}function Jg(e){return e.map(e=>{let t;return e&&typeof e==`object`&&(Hg(e)?t={...e,content:Jg(e.content)}:`content`in e&&vg(e.content)&&(t={...e,content:Pg(e.content)}),Ug(e)&&(t={...t??e,parts:Jg(e.parts)}),vg(t)?t=Pg(t):vg(e)&&(t=Pg(e))),t??e})}function Yg(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],i=Jg([r]),a=i[0];return Lg(a)<=n?i:qg(a,n)}function Xg(e){return Yg(e,Fg)}function Zg(e){return Rg(e,Fg)}function Qg(e){let t=P()?.getDataCollectionOptions().genAI;return{...e,recordInputs:e?.recordInputs??t?.inputs??!1,recordOutputs:e?.recordOutputs??t?.outputs??!1}}function $g(e){if(e!==void 0)return e;let t=P();return!t||!Ya(t)&&t.getOptions().streamGenAiSpans===!1}function e_(e,t){return e?`${e}.${t}`:t}function t_(e,t,n,r,i){if(t!==void 0&&e.setAttributes({[Uh]:t}),n!==void 0&&e.setAttributes({[Wh]:n}),t!==void 0||n!==void 0||r!==void 0||i!==void 0){let a=(t??0)+(n??0)+(r??0)+(i??0);e.setAttributes({[Gh]:a})}}function n_(e,t,n){if(!e.isRecording())return;let r={[$h]:!0};t.responseId&&(r[Vh]=t.responseId),t.responseModel&&(r[Bh]=t.responseModel),t.promptTokens!==void 0&&(r[Uh]=t.promptTokens),t.completionTokens!==void 0&&(r[Wh]=t.completionTokens),t.totalTokens===void 0?(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[Gh]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)):r[Gh]=t.totalTokens,t.finishReasons.length&&(r[zh]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[Zh]=t.responseTexts.join(``)),n&&t.toolCalls.length&&(r[eg]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function r_(e){if(typeof e==`string`)return Zg(e);try{return JSON.stringify(Array.isArray(e)?Xg(e):e)}catch{return`[unserializable]`}}function i_(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(e=>e&&typeof e==`object`&&`role`in e&&e.role===`system`);if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],r=typeof n.content==`string`?n.content:n.content===void 0?void 0:JSON.stringify(n.content);return r?{systemInstructions:JSON.stringify([{type:`text`,content:r}]),filteredMessages:[...e.slice(0,t),...e.slice(t+1)]}:{systemInstructions:void 0,filteredMessages:e}}async function a_(e,t){let[n,r]=await Promise.all([t,e]);return r&&typeof r==`object`&&`data`in r?{...r,data:n}:n}function o_(e,t){return Gt(e)?new Proxy(e,{get(e,n){let r=n in Promise.prototype||n===Symbol.toStringTag?t:e,i=Reflect.get(r,n);return n===`withResponse`&&typeof i==`function`?function(){return a_(i.call(e),t)}:typeof i==`function`?i.bind(r):i}}):t}var s_=`WorkersAI`,c_=new Map,l_=new Map,u_=new Map([[`ai.generateText`,`invoke_agent`],[`ai.streamText`,`invoke_agent`],[`ai.generateObject`,`invoke_agent`],[`ai.streamObject`,`invoke_agent`],[`ai.generateText.doGenerate`,`generate_content`],[`ai.streamText.doStream`,`generate_content`],[`ai.generateObject.doGenerate`,`generate_content`],[`ai.streamObject.doStream`,`generate_content`],[`ai.embed.doEmbed`,`embeddings`],[`ai.embedMany.doEmbed`,`embeddings`],[`ai.rerank.doRerank`,`rerank`],[`ai.toolCall`,`execute_tool`]]),d_=`operation.name`,f_=`ai.operationId`,p_=`ai.prompt`,m_=`ai.schema`,h_=`ai.response.object`,g_=`ai.values`,__=`ai.response.text`,v_=`ai.response.toolCalls`,y_=`ai.response.finishReason`,b_=`ai.prompt.messages`,x_=`ai.prompt.tools`,S_=`ai.model.id`,C_=`ai.response.providerMetadata`,w_=`ai.usage.cachedInputTokens`,T_=`ai.telemetry.functionId`,E_=`ai.usage.completionTokens`,D_=`ai.usage.promptTokens`,O_=`ai.usage.tokens`,k_=`ai.toolCall.name`,A_=`ai.toolCall.id`,j_=`ai.toolCall.args`,M_=`ai.toolCall.result`;function N_(e,t){let n=e.parent_span_id;if(!n)return;let r=e.data[Uh],i=e.data[Wh];if(typeof r==`number`||typeof i==`number`){let e=t.get(n)||{inputTokens:0,outputTokens:0};typeof r==`number`&&(e.inputTokens+=r),typeof i==`number`&&(e.outputTokens+=i),t.set(n,e)}}function P_(e,t){let n=t.get(e.span_id);n&&e.data&&(n.inputTokens>0&&(e.data[Uh]=n.inputTokens),n.outputTokens>0&&(e.data[Wh]=n.outputTokens),(n.inputTokens>0||n.outputTokens>0)&&(e.data[`gen_ai.usage.total_tokens`]=n.inputTokens+n.outputTokens))}function F_(e){let t=new Map;for(let n of e){let e=n.data[Qh];if(typeof e==`string`)try{let n=JSON.parse(e);for(let e of n)e.name&&e.description&&!t.has(e.name)&&t.set(e.name,e.description)}catch{}}return t}function I_(e,t){let n=F_(e);for(let r of e){if(r.op===`gen_ai.execute_tool`){let e=r.data[fg];if(typeof e==`string`){let t=n.get(e);t&&(r.data[_g]=t)}}r.op===`gen_ai.invoke_agent`&&P_(r,t)}}function L_(e){return c_.get(e)}function R_(e){c_.delete(e)}function z_(e){let t=e.map(e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e});return JSON.stringify(t)}function B_(e){return e.filter(e=>!!e&&typeof e==`object`&&`role`in e&&`content`in e)}function V_(e){try{let t=JSON.parse(e);if(t&&typeof t==`object`){let{messages:e}=t,{prompt:n,system:r}=t,i=[];if(typeof r==`string`&&i.push({role:`system`,content:r}),typeof e==`string`)try{e=JSON.parse(e)}catch{}if(Array.isArray(e))return i.push(...B_(e)),i;if(Array.isArray(n))return i.push(...B_(n)),i;if(typeof n==`string`&&i.push({role:`user`,content:n}),i.length>0)return i}}catch{}return[]}function H_(e,t,n){if(typeof t[`ai.prompt`]==`string`&&!t[`gen_ai.input.messages`]&&!t[`ai.prompt.messages`]){let r=t[p_],i=V_(r);if(i.length){let{systemInstructions:t,filteredMessages:r}=i_(i);t&&e.setAttribute(Xh,t);let a=Array.isArray(r)?r.length:0,o=n?r_(r):bn(r);e.setAttributes({[p_]:o,[Jh]:o,[qh]:a})}}else if(typeof t[`ai.prompt.messages`]==`string`){let r=t[b_];try{let t=JSON.parse(r);if(Array.isArray(t)){let{systemInstructions:i,filteredMessages:a}=i_(t);i&&e.setAttribute(Xh,i);let o=Array.isArray(a)?a.length:0,s=!n&&a===t?r:n?r_(a):bn(a);e.setAttributes({[b_]:s,[Jh]:s,[qh]:o})}}catch{}}}function U_(e){let{data:t,description:n}=L(e);if(!n)return;if(t[`ai.toolCall.name`]&&t[`ai.toolCall.id`]&&n===`ai.toolCall`){Z_(e,t);return}if(!t[`ai.operationId`]&&!n.startsWith(`ai.`))return;u_.get(n)===`generate_content`&&ef([s_]);let r=P()?.getIntegrationByName(`VercelAI`);Q_(e,n,t,$g(r?.options?.enableTruncation))}function W_(e){if(e.type===`transaction`&&e.spans){let t=new Map;for(let n of e.spans)J_(n),N_(n,t);I_(e.spans,t);let n=e.contexts?.trace;n?.op===`gen_ai.invoke_agent`&&P_(n,t)}return e}function G_(e){if(typeof e!=`string`)return`stop`;switch(e){case`tool-calls`:return`tool_call`;case`stop`:case`length`:case`content_filter`:case`error`:return e;default:return e}}function K_(e){let t=e[__],n=e[v_],r=e[y_];if(t==null&&n==null)return;let i=[];if(typeof t==`string`&&t.length>0&&i.push({type:`text`,content:t}),n!=null)try{let t=typeof n==`string`?JSON.parse(n):n;if(Array.isArray(t)){for(let e of t){let t=e.input??e.args;i.push({type:`tool_call`,id:e.toolCallId,name:e.toolName,arguments:typeof t==`string`?t:JSON.stringify(t??{})})}delete e[v_]}}catch{}if(i.length>0){let t={role:`assistant`,parts:i,finish_reason:G_(r)};e[Yh]=JSON.stringify([t]),delete e[__]}}function q_(e){if(X_(e,E_,Wh),X_(e,D_,Uh),X_(e,w_,sg),X_(e,`ai.usage.inputTokens`,Uh),X_(e,`ai.usage.outputTokens`,Wh),X_(e,O_,Uh),X_(e,`ai.response.avgOutputTokensPerSecond`,`ai.response.avgCompletionTokensPerSecond`),!Object.keys(e).some(e=>e.startsWith(`ai.usage.inputTokenDetails.`))&&typeof e[`gen_ai.usage.input_tokens`]==`number`&&typeof e[`gen_ai.usage.input_tokens.cached`]==`number`&&(e[Uh]=e[Uh]+e[sg]),typeof e[`gen_ai.usage.input_tokens`]==`number`&&(e[Gh]=(typeof e[`gen_ai.usage.output_tokens`]==`number`?e[Wh]:0)+e[Uh]),e[`ai.prompt.tools`]&&Array.isArray(e[`ai.prompt.tools`])&&(e[x_]=z_(e[x_])),e[`operation.name`]){let t=e[`ai.operationId`]?e[f_]:e[d_];e[Kh]=u_.get(t)??t,delete e[d_]}if(X_(e,b_,Jh),K_(e),X_(e,h_,`gen_ai.response.object`),X_(e,x_,`gen_ai.request.available_tools`),X_(e,j_,hg),X_(e,M_,gg),X_(e,m_,`gen_ai.request.schema`),X_(e,S_,kh),Array.isArray(e[`ai.values`])){let t=e[g_].map(e=>{try{return JSON.parse(e)}catch{return e}});e[lg]=t.length===1?t[0]:JSON.stringify(t)}rv(e);for(let t of Object.keys(e))Array.isArray(e[t])&&(e[t]=JSON.stringify(e[t])),t.startsWith(`ai.`)&&X_(e,t,`vercel.${t}`)}function J_(e){let{data:t,origin:n}=e;n===`auto.vercelai.otel`&&(e.status&&e.status!==`ok`&&(e.status=`internal_error`),q_(t))}function Y_(e){let t=e.attributes;if(t?.[`sentry.origin`]===`auto.vercelai.otel`){if(q_(t),t[`sentry.op`]===`gen_ai.execute_tool`&&e.parent_span_id){let n=l_.get(e.parent_span_id);if(n){let e=t[fg];if(typeof e==`string`){let r=n.get(e);r&&(t[_g]=r)}}}l_.delete(e.span_id)}}function X_(e,t,n){e[t]!=null&&(e[n]=e[t],delete e[t])}function Z_(e,t){e.setAttribute(I,`auto.vercelai.otel`),e.setAttribute(F,`gen_ai.execute_tool`),e.setAttribute(Kh,`execute_tool`),X_(t,k_,fg),X_(t,A_,pg);let n=t[pg];typeof n==`string`&&c_.set(n,e.spanContext()),t[`gen_ai.tool.type`]||e.setAttribute(mg,`function`);let r=t[fg];r&&e.updateName(`execute_tool ${r}`)}function Q_(e,t,n,r){e.setAttribute(I,`auto.vercelai.otel`);let i=t.replace(`ai.`,``);e.setAttribute(`ai.pipeline.name`,i),e.updateName(i);let a=n[T_];a&&typeof a==`string`&&e.setAttribute(`gen_ai.function_id`,a),H_(e,n,r),n[`ai.model.id`]&&!n[`gen_ai.response.model`]&&e.setAttribute(Bh,n[S_]),e.setAttribute(`ai.streaming`,t.includes(`stream`));let o=u_.get(t);if(o?e.setAttribute(F,`gen_ai.${o}`):t.startsWith(`ai.stream`)&&e.setAttribute(F,`ai.run`),o===`invoke_agent`){a&&typeof a==`string`?e.updateName(`invoke_agent ${a}`):e.updateName(`invoke_agent`);return}let s=n[S_];s&&o&&e.updateName(`${o} ${s}`);let c=P();if(c&&Ya(c)&&n[`ai.prompt.tools`]&&Array.isArray(n[`ai.prompt.tools`])){let t=new Map;for(let e of n[x_])try{let n=typeof e==`string`?JSON.parse(e):e;n?.name&&n?.description&&t.set(n.name,n.description)}catch{}if(t.size>0){let n=L(e).parent_span_id;n&&l_.set(n,t)}}}var $_=new WeakSet;function ev(e){$_.has(e)||($_.add(e),e.on(`spanStart`,U_),e.addEventProcessor(Object.assign(W_,{id:`VercelAiEventProcessor`})),e.on(`processSpan`,e=>{Y_(e)}))}function tv(e){let t={};if(!e||typeof e!=`object`)return t;let n=e,r=n.openai??n.azure;r&&(iv(t,sg,r.cachedPromptTokens),iv(t,`gen_ai.usage.output_tokens.reasoning`,r.reasoningTokens),iv(t,`gen_ai.usage.output_tokens.prediction_accepted`,r.acceptedPredictionTokens),iv(t,`gen_ai.usage.output_tokens.prediction_rejected`,r.rejectedPredictionTokens),iv(t,rg,r.responseId)),n.anthropic&&(iv(t,sg,n.anthropic.usage?.cache_read_input_tokens??n.anthropic.cacheReadInputTokens),iv(t,og,n.anthropic.usage?.cache_creation_input_tokens??n.anthropic.cacheCreationInputTokens)),n.bedrock?.usage&&(iv(t,sg,n.bedrock.usage.cacheReadInputTokens),iv(t,og,n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(iv(t,sg,n.deepseek.promptCacheHitTokens),iv(t,`gen_ai.usage.input_tokens.cache_miss`,n.deepseek.promptCacheMissTokens));let i=(n.google??n.vertex)?.usageMetadata;return i&&typeof i.thoughtsTokenCount==`number`&&i.thoughtsTokenCount>0&&(t[Wh]=(i.candidatesTokenCount??0)+i.thoughtsTokenCount,iv(t,Gh,i.totalTokenCount),iv(t,`gen_ai.usage.reasoning.output_tokens`,i.thoughtsTokenCount)),t}var nv=new Set([Wh,Gh,`gen_ai.usage.reasoning.output_tokens`]);function rv(e){let t=e[C_];if(!t)return;let n=e[Kh]===`invoke_agent`;try{let r=tv(JSON.parse(t));for(let[t,i]of Object.entries(r))t===`gen_ai.conversation.id`&&e[t]||n&&nv.has(t)||(e[t]=i)}catch{}}function iv(e,t,n){n!=null&&(e[t]=n)}var av=`OpenAI`,ov={"responses.create":{operation:`chat`},"chat.completions.create":{operation:`chat`},"embeddings.create":{operation:`embeddings`},"conversations.create":{operation:`chat`}},sv=[`response.created`,`response.in_progress`,`response.failed`,`response.completed`,`response.incomplete`,`response.queued`,`response.output_text.delta`,`response.output_item.added`,`response.function_call_arguments.delta`,`response.function_call_arguments.done`,`response.output_item.done`];function cv(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`&&e.type.startsWith(`response.`)}function lv(e){return typeof e==`object`&&!!e&&`object`in e&&e.object===`chat.completion.chunk`}function uv(e,t,n){if(!t||typeof t!=`object`)return;let r=t,i={};if(typeof r.id==`string`&&(i[Vh]=r.id),typeof r.model==`string`&&(i[Bh]=r.model),r.object===`conversation`&&typeof r.id==`string`&&(i[rg]=r.id),r.usage&&typeof r.usage==`object`){let e=r.usage,t=e.prompt_tokens??e.input_tokens;typeof t==`number`&&(i[Uh]=t);let n=e.completion_tokens??e.output_tokens;typeof n==`number`&&(i[Wh]=n),typeof e.total_tokens==`number`&&(i[Gh]=e.total_tokens)}if(Array.isArray(r.choices)){let e=r.choices,t=e.map(e=>e.finish_reason).filter(e=>typeof e==`string`);if(t.length>0&&(i[zh]=JSON.stringify(t)),n){let t=e.map(e=>e.message?.content||``);i[Zh]=JSON.stringify(t);let n=e.map(e=>e.message?.tool_calls).filter(e=>Array.isArray(e)&&e.length>0).flat();n.length>0&&(i[eg]=JSON.stringify(n))}}if(typeof r.status==`string`&&(i[`gen_ai.response.finish_reasons`]||(i[zh]=JSON.stringify([r.status]))),n&&(typeof r.output_text==`string`&&!i[`gen_ai.response.text`]&&(i[Zh]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!i[`gen_ai.response.tool_calls`])){let e=r.output.filter(e=>e?.type===`function_call`);e.length>0&&(i[eg]=JSON.stringify(e))}e.setAttributes(i)}function dv(e){if(`conversation`in e&&typeof e.conversation==`string`)return e.conversation;if(`previous_response_id`in e&&typeof e.previous_response_id==`string`)return e.previous_response_id}function fv(e){let t={[kh]:e.model??`unknown`};`temperature`in e&&(t[jh]=e.temperature),`top_p`in e&&(t[Fh]=e.top_p),`frequency_penalty`in e&&(t[Nh]=e.frequency_penalty),`presence_penalty`in e&&(t[Ph]=e.presence_penalty),`stream`in e&&(t[Ah]=e.stream),`encoding_format`in e&&(t[Lh]=e.encoding_format),`dimensions`in e&&(t[Rh]=e.dimensions);let n=dv(e);return n&&(t[rg]=n),t}function pv(e,t){for(let n of e){let e=n.index;if(e!==void 0&&n.function){if(!(e in t.chatCompletionToolCalls))t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||``}};else{let r=t.chatCompletionToolCalls[e];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}}}}function mv(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&pv(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function hv(e,t,n,r){if(!(e&&typeof e==`object`)){t.eventTypes.push(`unknown:non-object`);return}if(e instanceof Error){r.setStatus({code:2,message:`internal_error`}),H(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream-response`}});return}if(!(`type`in e))return;let i=e;if(!sv.includes(i.type)){t.eventTypes.push(i.type);return}if(n&&(i.type===`response.output_item.done`&&`item`in i&&t.responsesApiToolCalls.push(i.item),i.type===`response.output_text.delta`&&`delta`in i&&i.delta)){t.responseTexts.push(i.delta);return}if(`response`in i){let{response:e}=i;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}async function*gv(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let i of e)lv(i)?mv(i,r,n):cv(i)&&hv(i,r,n,t),yield i}finally{let e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];n_(t,{...r,toolCalls:e},n)}}function _v(e){let t=Array.isArray(e.tools)?e.tools:[],n=e.web_search_options&&typeof e.web_search_options==`object`?[{type:`web_search_options`,...e.web_search_options}]:[],r=[...t,...n];if(r.length!==0)try{return JSON.stringify(r)}catch(e){D&&A.error(`Failed to serialize OpenAI tools:`,e);return}}function vv(e,t){let n={[Oh]:`openai`,[Kh]:t,[I]:`auto.ai.openai`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0],r=_v(t);r&&(n[Qh]=r),Object.assign(n,fv(t))}else n[kh]=`unknown`;return n}function yv(e,t,n,r){if(n===`embeddings`&&`input`in t){let n=t.input;if(n==null||typeof n==`string`&&n.length===0||Array.isArray(n)&&n.length===0)return;e.setAttribute(lg,typeof n==`string`?n:JSON.stringify(n));return}let i=`input`in t?t.input:`messages`in t?t.messages:void 0;if(!i||Array.isArray(i)&&i.length===0)return;let{systemInstructions:a,filteredMessages:o}=i_(i);a&&e.setAttribute(Xh,a),e.setAttribute(Jh,r?r_(o):bn(o)),Array.isArray(o)?e.setAttribute(qh,o.length):e.setAttribute(qh,1)}function bv(e,t,n,r,i){return function(...t){let a=n.operation||`unknown`,o=vv(t,a),s=o[`gen_ai.request.model`]||`unknown`,c=t[0],l=c&&typeof c==`object`&&c.stream===!0,u={name:`${a} ${s}`,op:`gen_ai.${a}`,attributes:o};if(l){let n,o=oo(u,o=>(n=e.apply(r,t),i.recordInputs&&c&&yv(o,c,a,$g(i.enableTruncation)),(async()=>{try{return gv(await n,o,i.recordOutputs??!1)}catch(e){throw o.setStatus({code:2,message:`internal_error`}),o.end(),e}})()));return o_(n,o)}let d,f=z(u,n=>(d=e.apply(r,t),i.recordInputs&&c&&yv(n,c,a,$g(i.enableTruncation)),d.then(e=>(uv(n,e,i.recordOutputs),e))));return o_(d,f)}}function xv(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=e_(t,String(r)),o=ov[a];return typeof i==`function`&&o?bv(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?xv(i,a,n):i}})}function Sv(e,t){return xv(e,``,Qg(t))}var Cv=`Anthropic_AI`,wv={"messages.create":{operation:`chat`},"messages.stream":{operation:`chat`,streaming:!0},"messages.countTokens":{operation:`chat`},"models.get":{operation:`models`},"completions.create":{operation:`chat`},"models.retrieve":{operation:`models`},"beta.messages.create":{operation:`chat`}};function Tv(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:i}=i_(t);r&&e.setAttributes({[Xh]:r});let a=Array.isArray(i)?i.length:1;e.setAttributes({[Jh]:n?r_(i):bn(i),[qh]:a})}var Ev={invalid_request_error:`invalid_argument`,authentication_error:`unauthenticated`,permission_error:`permission_denied`,not_found_error:`not_found`,request_too_large:`failed_precondition`,rate_limit_error:`resource_exhausted`,api_error:`internal_error`,overloaded_error:`unavailable`};function Dv(e){return e&&Ev[e]||`internal_error`}function Ov(e,t){t.error&&(e.setStatus({code:2,message:Dv(t.error.type)}),H(t.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}))}function kv(e){let{system:t,messages:n,input:r}=e,i=typeof t==`string`?[{role:`system`,content:e.system}]:[],a=(Array.isArray(r)?r:r==null?void 0:[r])??(Array.isArray(n)?n:n==null?[]:[n]);return[...i,...a]}function Av(e,t){return`type`in e&&typeof e.type==`string`&&e.type===`error`&&(t.setStatus({code:2,message:Dv(e.error?.type)}),!0)}function jv(e,t){if(e.type===`message_delta`&&(e.usage&&typeof e.usage.output_tokens==`number`&&(t.completionTokens=e.usage.output_tokens),e.delta?.stop_reason&&t.finishReasons.push(e.delta.stop_reason)),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.usage&&(typeof n.usage.input_tokens==`number`&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens==`number`&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens==`number`&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function Mv(e,t){e.type===`content_block_start`&&typeof e.index==`number`&&e.content_block&&(e.content_block.type===`tool_use`||e.content_block.type===`server_tool_use`)&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function Nv(e,t,n){if(e.type===`content_block_delta`&&e.delta){if(typeof e.index==`number`&&`partial_json`in e.delta&&typeof e.delta.partial_json==`string`){let n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text==`string`&&t.responseTexts.push(e.delta.text)}}function Pv(e,t){if(e.type!==`content_block_stop`||typeof e.index!=`number`)return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(``),i;try{i=r?JSON.parse(r):{}}catch{i={__unparsed:r}}t.toolCalls.push({type:`tool_use`,id:n.id,name:n.name,input:i}),delete t.activeToolBlocks[e.index]}function Fv(e,t,n,r){e&&typeof e==`object`&&(Av(e,r)||(jv(e,t),Mv(e,t),Nv(e,t,n),Pv(e,t)))}async function*Iv(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let i of e)Fv(i,r,n,t),yield i}finally{n_(t,r,n)}}function Lv(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on(`streamEvent`,e=>{Fv(e,r,n,t)}),e.on(`message`,()=>{n_(t,r,n)}),e.on(`error`,e=>{H(e,{mechanism:{handled:!1,type:`auto.ai.anthropic.stream_error`}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end())}),e}var Rv=!1,zv=new WeakSet;function Bv(e,t,n){let r={[Oh]:`anthropic`,[Kh]:n,[I]:`auto.ai.anthropic`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0];t.tools&&Array.isArray(t.tools)&&(r[Qh]=JSON.stringify(t.tools)),r[kh]=t.model??`unknown`,`temperature`in t&&(r[jh]=t.temperature),`top_p`in t&&(r[Fh]=t.top_p),`stream`in t&&(r[Ah]=t.stream),`top_k`in t&&(r[Ih]=t.top_k),`frequency_penalty`in t&&(r[Nh]=t.frequency_penalty),`max_tokens`in t&&(r[Mh]=t.max_tokens)}else r[kh]=t===`models.retrieve`||t===`models.get`?e[0]:`unknown`;return r}function Vv(e,t,n){Tv(e,kv(t),n),`prompt`in t&&e.setAttributes({[Dh]:JSON.stringify(t.prompt)})}function Hv(e,t){if(`content`in t&&Array.isArray(t.content)){e.setAttributes({[Zh]:t.content.map(e=>e.text).filter(e=>!!e).join(``)});let n=[];for(let e of t.content)(e.type===`tool_use`||e.type===`server_tool_use`)&&n.push(e);n.length>0&&e.setAttributes({[eg]:JSON.stringify(n)})}`completion`in t&&e.setAttributes({[Zh]:t.completion}),`input_tokens`in t&&e.setAttributes({[Zh]:JSON.stringify(t.input_tokens)})}function Uv(e,t){`id`in t&&`model`in t&&(e.setAttributes({[Vh]:t.id,[Bh]:t.model}),`usage`in t&&t.usage&&t_(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function Wv(e,t,n){if(t&&typeof t==`object`){if(`type`in t&&t.type===`error`){Ov(e,t);return}n&&Hv(e,t),Uv(e,t)}}function Gv(e,t){throw t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end()),e}function Kv(e,t,n,r,i,a,o,s,c,l){let u={name:`${i} ${r[`gen_ai.request.model`]??`unknown`}`,op:`gen_ai.${i}`,attributes:r};if(c&&!l){let r,i=oo(u,i=>(r=e.apply(t,n),s.recordInputs&&o&&Vv(i,o,$g(s.enableTruncation)),(async()=>{try{return Iv(await r,i,s.recordOutputs??!1)}catch(e){return Gv(e,i)}})()));return o_(r,i)}return oo(u,r=>{try{s.recordInputs&&o&&Vv(r,o,$g(s.enableTruncation)),Rv=!0;let i=e.apply(t,n);return Rv=!1,Lv(i,r,s.recordOutputs??!1)}catch(e){return Rv=!1,Gv(e,r)}})}function qv(e,t,n,r,i){return new Proxy(e,{apply(e,a,o){let s=a===void 0?r:a,c=n.streaming===!0;if(!c&&Rv)return e.apply(s,o);let l=n.operation||`unknown`,u=Bv(o,t,l),d=u[`gen_ai.request.model`]??`unknown`,f=typeof o[0]==`object`?o[0]:void 0,p=!!f?.stream;if(p||c)return Kv(e,s,o,u,l,t,f,i,p,c);let m,h=z({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:u},t=>(m=e.apply(s,o),i.recordInputs&&f&&Vv(t,f,$g(i.enableTruncation)),m.then(e=>(Wv(t,e,i.recordOutputs),e))));return o_(m,h)}})}function Jv(e,t){for(let n of Object.keys(wv)){let r=n.split(`.`),i=r.pop(),a=e;for(let e of r)a=a?.[e];if(!a||typeof a[i]!=`function`)continue;let o=a[i];if(zv.has(o))continue;let s=qv(o,n,wv[n],a,t);zv.add(s),a[i]=s}return e}function Yv(e,t){return Jv(e,Qg(t))}var Xv=`Google_GenAI`,Zv={"models.generateContent":{operation:`generate_content`},"models.generateContentStream":{operation:`generate_content`,streaming:!0},"models.embedContent":{operation:`embeddings`},"chats.create":{proxyResultPath:`chat`},"chat.sendMessage":{operation:`chat`},"chat.sendMessageStream":{operation:`chat`,streaming:!0}},Qv=`google_genai`;function $v(e,t){let n=e?.promptFeedback;if(n?.blockReason){let e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:`internal_error`}),H(`Content blocked: ${e}`,{mechanism:{handled:!1,type:`auto.ai.google_genai`}}),!0}return!1}function ey(e,t){typeof e.responseId==`string`&&(t.responseId=e.responseId),typeof e.modelVersion==`string`&&(t.responseModel=e.modelVersion);let n=e.usageMetadata;n&&(typeof n.promptTokenCount==`number`&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount==`number`&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount==`number`&&(t.totalTokens=n.totalTokenCount))}function ty(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let e of r?.content?.parts??[])n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:`function`,id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}function ny(e,t,n,r){e&&!$v(e,r)&&(ey(e,t),ty(e,t,n))}async function*ry(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let i of e)ny(i,r,n,t),yield i}finally{n_(t,r,n)}}function iy(e,t=`user`){return typeof e==`string`?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(e=>iy(e,t)):typeof e!=`object`||!e?[]:`role`in e&&typeof e.role==`string`?[e]:`parts`in e?[{...e,role:t}]:[{role:t,content:e}]}function ay(e,t){if(`model`in e&&typeof e.model==`string`)return e.model;if(t&&typeof t==`object`){let e=t;if(`model`in e&&typeof e.model==`string`)return e.model;if(`modelVersion`in e&&typeof e.modelVersion==`string`)return e.modelVersion}return`unknown`}function oy(e){let t={};return`temperature`in e&&typeof e.temperature==`number`&&(t[jh]=e.temperature),`topP`in e&&typeof e.topP==`number`&&(t[Fh]=e.topP),`topK`in e&&typeof e.topK==`number`&&(t[Ih]=e.topK),`maxOutputTokens`in e&&typeof e.maxOutputTokens==`number`&&(t[Mh]=e.maxOutputTokens),`frequencyPenalty`in e&&typeof e.frequencyPenalty==`number`&&(t[Nh]=e.frequencyPenalty),`presencePenalty`in e&&typeof e.presencePenalty==`number`&&(t[Ph]=e.presencePenalty),t}function sy(e,t,n){let r={[Oh]:Qv,[Kh]:e,[I]:`auto.ai.google_genai`};if(t){if(r[kh]=ay(t,n),`config`in t&&typeof t.config==`object`&&t.config){let e=t.config;if(Object.assign(r,oy(e)),`tools`in e&&Array.isArray(e.tools)){let t=e.tools.flatMap(e=>e.functionDeclarations);r[Qh]=JSON.stringify(t)}}}else r[kh]=ay({},n);return r}function cy(e,t,n,r){if(n===`embeddings`){let n=t.contents;n!=null&&e.setAttribute(lg,typeof n==`string`?n:JSON.stringify(n));return}let i=[];if(`config`in t&&t.config&&typeof t.config==`object`&&`systemInstruction`in t.config&&t.config.systemInstruction&&i.push(...iy(t.config.systemInstruction,`system`)),`history`in t&&i.push(...iy(t.history,`user`)),`contents`in t&&i.push(...iy(t.contents,`user`)),`message`in t&&i.push(...iy(t.message,`user`)),Array.isArray(i)&&i.length){let{systemInstructions:t,filteredMessages:n}=i_(i);t&&e.setAttribute(Xh,t);let a=Array.isArray(n)?n.length:0;e.setAttributes({[qh]:a,[Jh]:r?r_(n):bn(n)})}}function ly(e,t,n){if(t&&typeof t==`object`){if(t.modelVersion&&e.setAttribute(Bh,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata==`object`){let n=t.usageMetadata;typeof n.promptTokenCount==`number`&&e.setAttributes({[Uh]:n.promptTokenCount}),typeof n.candidatesTokenCount==`number`&&e.setAttributes({[Wh]:n.candidatesTokenCount}),typeof n.totalTokenCount==`number`&&e.setAttributes({[Gh]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let n=t.candidates.map(e=>e.content?.parts&&Array.isArray(e.content.parts)?e.content.parts.map(e=>typeof e.text==`string`?e.text:``).filter(e=>e.length>0).join(``):``).filter(e=>e.length>0);n.length>0&&e.setAttributes({[Zh]:n.join(``)})}if(n&&t.functionCalls){let n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[eg]:JSON.stringify(n)})}}}function uy(e,t,n,r,i){let a=n.operation===`embeddings`;return new Proxy(e,{apply(e,t,o){let s=n.operation||`unknown`,c=o[0],l=sy(s,c,r),u=l[`gen_ai.request.model`]??`unknown`;return n.streaming?oo({name:`${s} ${u}`,op:`gen_ai.${s}`,attributes:l},async t=>{try{return i.recordInputs&&c&&cy(t,c,s,$g(i.enableTruncation)),ry(await e.apply(r,o),t,!!i.recordOutputs)}catch(e){throw t.setStatus({code:2,message:`internal_error`}),t.end(),e}}):z({name:`${s} ${u}`,op:`gen_ai.${s}`,attributes:l},t=>(i.recordInputs&&c&&cy(t,c,s,$g(i.enableTruncation)),no(()=>e.apply(r,o),()=>{},()=>{},e=>{a||ly(t,e,i.recordOutputs)})))}})}function dy(e,t=``,n){return new Proxy(e,{get:(e,r,i)=>{let a=Reflect.get(e,r,i),o=e_(t,String(r)),s=Zv[o];if(typeof a==`function`&&s){let t=s.operation?uy(a,o,s,e,n):a.bind(e);return s.proxyResultPath?function(...e){let r=t(...e);return r&&typeof r==`object`?dy(r,s.proxyResultPath,n):r}:t}return typeof a==`function`?a.bind(e):a&&typeof a==`object`?dy(a,o,n):a}})}function fy(e,t){return dy(e,``,Qg(t))}var py=`LangChain`,my=`auto.ai.langchain`,hy={human:`user`,ai:`assistant`,assistant:`assistant`,system:`system`,function:`function`,tool:`tool`},gy=(e,t,n)=>{n!=null&&(e[t]=n)},_y=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function vy(e){if(Array.isArray(e))try{let t=e.map(e=>e&&typeof e==`object`&&vg(e)?Pg(e):e);return JSON.stringify(t)}catch{return String(e)}return bn(e,String)}function yy(e){let t=e.toLowerCase();return hy[t]??t}function by(e){return e.includes(`System`)?`system`:e.includes(`Human`)?`user`:e.includes(`AI`)||e.includes(`Assistant`)?`assistant`:e.includes(`Function`)?`function`:e.includes(`Tool`)?`tool`:`user`}function xy(e){if(e&&!Array.isArray(e))return e.invocation_params}function Sy(e){return e.map(e=>{let t=e._getType;if(typeof t==`function`)return{role:yy(t.call(e)),content:vy(e.content)};if(e.lc===1&&e.kwargs){let t=e.id,n=Array.isArray(t)&&t.length>0?t[t.length-1]:``;return{role:yy(typeof n==`string`?by(n):`user`),content:vy(e.kwargs?.content)}}if(e.type)return{role:yy(String(e.type).toLowerCase()),content:vy(e.content)};if(e.role)return{role:yy(String(e.role)),content:vy(e.content)};let n=e.constructor?.name;return n&&n!==`Object`?{role:yy(by(n)),content:vy(e.content)}:{role:`user`,content:vy(e.content)}})}function Cy(e,t,n){let r={},i=`kwargs`in e?e.kwargs:void 0;_y(r,jh,t?.temperature??n?.ls_temperature??i?.temperature),_y(r,Mh,t?.max_tokens??n?.ls_max_tokens??i?.max_tokens),_y(r,Fh,t?.top_p??i?.top_p);let a=t?.frequency_penalty;_y(r,Nh,a);let o=t?.presence_penalty;return _y(r,Ph,o),t&&`stream`in t&&gy(r,Ah,!!t.stream),r}function wy(e,t,n,r,i){return{[Oh]:bn(e??`langchain`,String),[Kh]:`chat`,[kh]:bn(t,String),[I]:my,...Cy(n,r,i)}}function Ty(e,t,n,r,i,a){let o=a?.ls_provider,s=wy(o,i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){gy(s,qh,t.length);let e=t.map(e=>({role:`user`,content:e}));gy(s,Jh,r?r_(e):bn(e))}return s}function Ey(e,t,n,r,i,a){let o=wy(a?.ls_provider??e.id?.[2],i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){let{systemInstructions:e,filteredMessages:n}=i_(Sy(t.flat()));e&&gy(o,Xh,e),gy(o,qh,Array.isArray(n)?n.length:0),gy(o,Jh,r?r_(n):bn(n))}return o}function Dy(e,t){let n=[],r=e.flat();for(let e of r){let t=e.message?.tool_calls;if(Array.isArray(t)&&t.length>0)n.push(...t);else{let t=e.message?.content;if(Array.isArray(t))for(let e of t){let t=e;t.type===`tool_use`&&n.push(t)}}}n.length>0&&gy(t,eg,bn(n,String))}function Oy(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)_y(t,Uh,n.promptTokens),_y(t,Wh,n.completionTokens),_y(t,Gh,n.totalTokens);else if(r){_y(t,Uh,r.input_tokens),_y(t,Wh,r.output_tokens);let e=Number(r.input_tokens),n=Number(r.output_tokens),i=(Number.isNaN(e)?0:e)+(Number.isNaN(n)?0:n);i>0&&_y(t,Gh,i),r.cache_creation_input_tokens!==void 0&&_y(t,ig,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&_y(t,ag,r.cache_read_input_tokens)}}function ky(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let r=e.generations.flat().map(e=>e.generationInfo?.finish_reason?e.generationInfo.finish_reason:e.generation_info?.finish_reason?e.generation_info.finish_reason:null).filter(e=>typeof e==`string`);if(r.length>0&&gy(n,zh,bn(r,String)),Dy(e.generations,n),t){let t=e.generations.flat().map(e=>e.text??e.message?.content).filter(e=>typeof e==`string`);t.length>0&&gy(n,Zh,bn(t,String))}}Oy(e.llmOutput,n);let r=e.llmOutput,i=e.generations?.[0]?.[0]?.message,a=r?.model_name??r?.model??i?.response_metadata?.model_name;a&&gy(n,Bh,a);let o=r?.id??i?.id;o&&gy(n,Vh,o);let s=r?.stop_reason??i?.response_metadata?.finish_reason;return s&&gy(n,Hh,bn(s,String)),n}function Ay(e){let t={},n=e?.lc_agent_name;return typeof n==`string`&&(t[tg]=n),t}function jy(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(e=>{let t=e.function;return{type:`function`,name:e.name??t?.name??``,description:e.description??t?.description}});return JSON.stringify(n)}function My(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.addHandler==`function`&&typeof t.copy==`function`}function Ny(e){return typeof e==`object`&&e?.name===`SentryCallbackHandler`}function Py(e){return e.some(Ny)}function Fy(e,t){if(!e)return[t];if(My(e)){if(Py(e.handlers??[]))return e;let n=e.copy();return n.addHandler(t,!0),n}let n=Array.isArray(e)?e:[e];return Py(n)?e:[...n,t]}function Iy(e={}){let{recordInputs:t,recordOutputs:n}=Qg(e),r=$g(e.enableTruncation),i=new Map,a=e=>{let t=i.get(e);t?.isRecording()&&(t.end(),i.delete(e))},o={lc_serializable:!1,lc_namespace:[`langchain_core`,`callbacks`,`sentry`],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:[`langchain_core`,`callbacks`,`sentry`],lc_kwargs:{},name:`SentryCallbackHandler`,ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(e,n,a,o,s,c,l,u){let d=xy(c),f=Ty(e,n,t,r,d,l),p=f[kh],m=f[Kh];oo({name:`${m} ${p}`,op:`gen_ai.chat`,attributes:{...Ay(l),...f,[F]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleChatModelStart(e,n,a,o,s,c,l,u){let d=xy(c),f=Ey(e,n,t,r,d,l),p=jy(s);p&&(f[Qh]=p);let m=f[kh],h=f[Kh];oo({name:`${h} ${m}`,op:`gen_ai.chat`,attributes:{...Ay(l),...f,[F]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleLLMEnd(e,t,r,o,s){let c=i.get(t);if(c?.isRecording()){let r=ky(e,n);r&&c.setAttributes(r),a(t)}},handleLLMError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},handleChainStart(e,n,r,a,o,s,c,l){if(s?.__sentry_langgraph__)return;let u=l||e.name||`unknown_chain`,d={[I]:`auto.ai.langchain`,"langchain.chain.name":u};t&&(d[`langchain.chain.inputs`]=JSON.stringify(n)),oo({name:`chain ${u}`,op:`gen_ai.invoke_agent`,attributes:{...d,[F]:`gen_ai.invoke_agent`}},e=>(i.set(r,e),e))},handleChainEnd(e,t){let r=i.get(t);r?.isRecording()&&(n&&r.setAttributes({"langchain.chain.outputs":JSON.stringify(e)}),a(t))},handleChainError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},handleToolStart(e,n,r,a,o,s,c){if(s?.__sentry_langgraph__)return;let l=c||e.name||`unknown_tool`,u={...Ay(s),[I]:my,[Kh]:`execute_tool`,[fg]:l};t&&(u[hg]=n),oo({name:`execute_tool ${l}`,op:`gen_ai.execute_tool`,attributes:{...u,[F]:`gen_ai.execute_tool`}},e=>(i.set(r,e),e))},handleToolEnd(e,t){let r=i.get(t);if(r?.isRecording()){if(n){let t=e,n=t&&typeof t==`object`&&`content`in t?t.content:e;r.setAttributes({[gg]:typeof n==`string`?n:JSON.stringify(n)})}a(t)}},handleToolError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},copy(){return o},toJSON(){return{lc:1,type:`not_implemented`,id:o.lc_id}},toJSONNotImplemented(){return{lc:1,type:`not_implemented`,id:o.lc_id}}};return o}function Ly(e){let t=e.constructor?.name??``;return t.includes(`OpenAI`)?`openai`:t.includes(`Google`)?`google_genai`:t.includes(`Mistral`)?`mistralai`:t.includes(`Vertex`)?`google_vertexai`:t.includes(`Bedrock`)?`aws_bedrock`:t.includes(`Ollama`)?`ollama`:t.includes(`Cloudflare`)?`cloudflare`:t.includes(`Cohere`)?`cohere`:`langchain`}function Ry(e){let t=e??{},n={[I]:my,[F]:ug,[Kh]:`embeddings`,[kh]:t.model??`unknown`};return n[Oh]=Ly(t),`dimensions`in t&&(n[Rh]=t.dimensions),`encodingFormat`in t&&(n[Lh]=t.encodingFormat),n}function zy(e,t,n={}){let{recordInputs:r}=Qg(n),i=Ry(e),a=i[`gen_ai.request.model`]||`unknown`;return r&&t!=null&&(i[lg]=typeof t==`string`?t:JSON.stringify(t)),{name:`embeddings ${a}`,op:ug,attributes:i}}function By(e,t={}){return new Proxy(e,{apply(e,n,r){return z(zy(n,r[0],t),()=>Reflect.apply(e,n,r))}})}function Vy(e,t){let n=e;return typeof n.embedQuery==`function`&&(n.embedQuery=By(n.embedQuery,t)),typeof n.embedDocuments==`function`&&(n.embedDocuments=By(n.embedDocuments,t)),e}var Hy=`LangGraph`,Uy=`auto.ai.langgraph`;function Wy(e){let t=e[0];if(typeof t!=`object`||!t||!(`llm`in t)||!t.llm||typeof t.llm!=`object`)return null;let n=t.llm;return typeof n.modelName!=`string`&&typeof n.model!=`string`?null:n}function Gy(e){let t=e[0];return typeof t==`object`&&t&&`name`in t&&typeof t.name==`string`?t.name:null}function Ky(e,t,n){let r=`__sentry_tool_wrapped__`;for(let i of e){if(!i||typeof i!=`object`)continue;let e=i,a=e.invoke;if(typeof a!=`function`||Object.prototype.hasOwnProperty.call(e,r))continue;let o=typeof e.name==`string`?e.name:`unknown_tool`,s=typeof e.description==`string`?e.description:void 0;e.invoke=new Proxy(a,{apply(e,r,i){let a={[I]:Uy,[F]:dg,[Kh]:`execute_tool`,[fg]:o,[mg]:`function`},c=i[1]?.metadata?.lc_agent_name??n;typeof c==`string`&&(a[tg]=c),s&&(a[_g]=s);let l=i[0];if(typeof l==`object`&&l&&(`id`in l&&typeof l.id==`string`&&(a[pg]=l.id),t.recordInputs)){let e=`args`in l&&typeof l.args==`object`?l.args:l;try{a[hg]=JSON.stringify(e)}catch{}}return z({op:dg,name:`execute_tool ${o}`,attributes:a},async n=>{try{let a=await Reflect.apply(e,r,i);if(t.recordOutputs)try{let e=a,t=e&&typeof e==`object`&&`content`in e?e.content:a;n.setAttribute(gg,typeof t==`string`?t:JSON.stringify(t))}catch{}return a}catch(e){throw n.setStatus({code:2,message:`internal_error`}),e}})}}),Object.defineProperty(e,r,{value:!0,enumerable:!1})}return e}function qy(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n==`object`){let e=n.tool_calls;e&&Array.isArray(e)&&t.push(...e)}return t.length>0?t:null}function Jy(e){let t=e,n=0,r=0,i=0;if(t.usage_metadata&&typeof t.usage_metadata==`object`){let e=t.usage_metadata;return typeof e.input_tokens==`number`&&(n=e.input_tokens),typeof e.output_tokens==`number`&&(r=e.output_tokens),typeof e.total_tokens==`number`&&(i=e.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:i}}if(t.response_metadata&&typeof t.response_metadata==`object`){let e=t.response_metadata;if(e.tokenUsage&&typeof e.tokenUsage==`object`){let t=e.tokenUsage;typeof t.promptTokens==`number`&&(n=t.promptTokens),typeof t.completionTokens==`number`&&(r=t.completionTokens),typeof t.totalTokens==`number`&&(i=t.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:i}}function Yy(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata==`object`){let t=n.response_metadata;t.model_name&&typeof t.model_name==`string`&&e.setAttribute(Bh,t.model_name),t.finish_reason&&typeof t.finish_reason==`string`&&e.setAttribute(zh,[t.finish_reason])}}function Xy(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(e=>({name:e.lc_kwargs?.name,description:e.lc_kwargs?.description,schema:e.lc_kwargs?.schema}))}function Zy(e,t,n){let r=n?.messages;if(!r||!Array.isArray(r))return;let i=t?.length??0,a=r.length>i?r.slice(i):[];if(a.length===0)return;let o=qy(a);o&&e.setAttribute(eg,JSON.stringify(o));let s=Sy(a);e.setAttribute(Zh,JSON.stringify(s));let c=0,l=0,u=0;for(let t of a){let n=Jy(t);c+=n.inputTokens,l+=n.outputTokens,u+=n.totalTokens,Yy(e,t)}c>0&&e.setAttribute(Uh,c),l>0&&e.setAttribute(Wh,l),u>0&&e.setAttribute(Gh,u)}var Qy=!1,$y=`__sentry_patched__`;function eb(e){let t={[I]:Uy,[F]:`gen_ai.create_agent`,[Kh]:`create_agent`};return e&&(t[tg]=e),{op:`gen_ai.create_agent`,name:e?`create_agent ${e}`:`create_agent`,attributes:t}}function tb(e,t){if(Object.prototype.hasOwnProperty.call(e,$y))return e;let n=Iy(t),r=new Proxy(e,{apply(e,r,i){return Qy?Reflect.apply(e,r,i):z(eb(),a=>{try{let o=Reflect.apply(e,r,i),s=i.length>0?i[0]:{};s?.name&&typeof s.name==`string`&&(a.setAttribute(tg,s.name),a.updateName(`create_agent ${s.name}`));let c=o.invoke;return c&&typeof c==`function`&&(o.invoke=nb(c.bind(o),o,s,t,void 0,n)),o}catch(e){throw a.setStatus({code:2,message:`internal_error`}),e}})}});return Object.defineProperty(r,$y,{value:!0,enumerable:!1}),r}function nb(e,t,n,r,i,a){return new Proxy(e,{apply(e,o,s){let c=i?.modelName??i?.model;return z({op:`gen_ai.invoke_agent`,name:`invoke_agent`,attributes:{[I]:Uy,[F]:cg,[Kh]:`invoke_agent`}},async i=>{try{let l=n?.name;l&&typeof l==`string`&&(i.setAttribute(ng,l),i.setAttribute(tg,l),i.updateName(`invoke_agent ${l}`)),c&&i.setAttribute(kh,c);let u=(s.length>1?s[1]:void 0)?.configurable?.thread_id;if(u&&typeof u==`string`&&i.setAttribute(rg,u),a){let e=s[1]??{};s[1]=e,e.metadata={...e.metadata??{},__sentry_langgraph__:!0,...typeof l==`string`?{lc_agent_name:l}:{}},e.callbacks=Fy(e.callbacks,a)}let d=Xy(t);d&&i.setAttribute(Qh,JSON.stringify(d));let f=r.recordInputs,p=r.recordOutputs,m=s.length>0?s[0]?.messages??[]:[];if(m&&f){let{systemInstructions:e,filteredMessages:t}=i_(Sy(m));e&&i.setAttribute(Xh,e);let n=$g(r.enableTruncation),a=Array.isArray(t)?t.length:0;i.setAttributes({[Jh]:n?r_(t):bn(t),[qh]:a})}let h=await Reflect.apply(e,o,s);return p&&Zy(i,m??null,h),h}catch(e){throw i.setStatus({code:2,message:`internal_error`}),e}})}})}function rb(e,t){if(Object.prototype.hasOwnProperty.call(e,$y))return e;let n=Qg(t),r=Iy(n),i=new Proxy(e,{apply(e,t,i){let a=Wy(i),o=Gy(i),s=i[0];s&&Array.isArray(s.tools)&&s.tools.length>0&&Ky(s.tools,n,o??void 0),Qy=!0;let c;try{c=Reflect.apply(e,t,i)}finally{Qy=!1}let l=c.invoke;if(l&&typeof l==`function`){let e={};o&&(e.name=o),c.invoke=nb(l.bind(c),c,e,n,a,r)}return c}});return Object.defineProperty(i,$y,{value:!0,enumerable:!1}),i}function ib(e,t){return e.compile=tb(e.compile,Qg(t)),e}var ab=ib;function ob(e,t,n){let r=n.getOptions(),i=n.getDsn(),a=r.tunnel,o=La(r._metadata),s={sent_at:new Date(an()).toISOString(),...sb(t)&&{trace:t},...o&&{sdk:o},...!!a&&i&&{dsn:yi(i)}},c=n.getDataCollectionOptions().userInfo?`auto`:`never`;return Ta(s,[[{type:`span`,item_count:e.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...Vu()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}]])}function sb(e){return!!e.trace_id&&!!e.public_key}function cb(e){let t=156;if(t+=e.name.length*2,t+=xr(e.attributes),e.links&&e.links.length>0){let n=e.links[0]?.attributes,r=100+(n?xr(n):0);t+=r*e.links.length}return t}var lb=1e3,ub=5e6,db=class{constructor(e,t){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:n,flushInterval:r,maxTraceWeightInBytes:i}=t??{};this._maxSpanLimit=n&&n>0&&n<=lb?n:lb,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=i&&i>0?i:ub,this._client.on(`flush`,()=>{this.drain()}),this._client.on(`close`,()=>{this._traceBuckets.forEach(e=>{clearTimeout(e.timeout)}),this._traceBuckets.clear()})}add(e){let t=e.trace_id,n=this._traceBuckets.get(t);n||(n={spans:new Set,size:0,timeout:bu(setTimeout(()=>{this.flush(t)},this._flushInterval))},this._traceBuckets.set(t,n)),n.spans.add(e),n.size+=cb(e),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(t)}drain(){this._traceBuckets.size&&(D&&A.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,t)=>{this.flush(t)}))}flush(e){let t=this._traceBuckets.get(e);if(!t)return;if(!t.spans.size){this._removeTrace(e);return}let n=Array.from(t.spans),r=n[0]?._segmentSpan;if(!r){D&&A.warn(`No segment span reference found on span JSON, cannot compute DSC`),this._removeTrace(e);return}let i=xa(r),a=n.map(e=>{let{_segmentSpan:t,...n}=e;return n}),o=ob(a,i,this._client);D&&A.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(o).then(null,e=>{D&&A.error(`Error while sending streamed span envelope:`,e)}),this._removeTrace(e)}_removeTrace(e){let t=this._traceBuckets.get(e);t&&clearTimeout(t.timeout),this._traceBuckets.delete(e)}},fb=W(()=>({name:`SpanStreaming`,setup(e){let t=`SpanStreaming integration requires`,n=`Falling back to static trace lifecycle.`,r=e.getOptions();if(!Ya(e)){r.traceLifecycle=`static`,D&&A.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let i=r.beforeSendSpan;if(i&&!wa(i)){r.traceLifecycle=`static`,D&&A.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let a=new db(e);e.on(`afterSpanEnd`,t=>{Yi(t)&&a.add(xl(t,e))})}}));function pb(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}function mb(e,t,n){let r=e[t];if(typeof r==`function`){try{e[t]=n}catch{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=n}catch{Object.defineProperty(e,"default",{value:n,writable:!0,configurable:!0,enumerable:!0})}}}var hb=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let t=this._cache.get(e);if(t!==void 0)return this._cache.delete(e),this._cache.set(e,t),t}set(e,t){if(this._cache.size>=this._maxSize){let e=this._cache.keys().next().value;this._cache.delete(e)}this._cache.set(e,t)}remove(e){let t=this._cache.get(e);return t&&this._cache.delete(e),t}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(t=>e.push(t)),e}};function gb(e){let t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}var _b=class extends Hd{constructor(e){gb(e),e.traceLifecycle===`stream`&&!e.integrations.some(e=>e.name===`SpanStreaming`)&&e.integrations.push(fb()),super(e),this._disposeCallbacks=[],this._setUpMetricsProcessing()}eventFromException(e,t){let n=xp(this,this._options.stackParser,e,t);return n.level=`error`,Al(n)}eventFromMessage(e,t=`info`,n){return Al(Sp(this._options.stackParser,e,t,n,this._options.attachStacktrace))}captureException(e,t,n){return vb(t),super.captureException(e,t,n)}captureEvent(e,t,n){return!e.type&&e.exception?.values&&e.exception.values.length>0&&vb(t),super.captureEvent(e,t,n)}captureCheckIn(e,t,n){let r=`checkInId`in e&&e.checkInId?e.checkInId:kn();if(!this._isEnabled())return D&&A.warn(`SDK not enabled, will not capture check-in.`),r;let{release:i,environment:a,tunnel:o}=this.getOptions(),s={check_in_id:r,monitor_slug:e.monitorSlug,status:e.status,release:i,environment:a};`duration`in e&&(s.duration=e.duration),t&&(s.monitor_config={schedule:t.schedule,checkin_margin:t.checkinMargin,max_runtime:t.maxRuntime,timezone:t.timezone,failure_issue_threshold:t.failureIssueThreshold,recovery_threshold:t.recoveryThreshold});let[c,l]=Lu(this,n);l&&(s.contexts={trace:l});let u=uf(s,c,this.getSdkMetadata(),o,this.getDsn());return D&&A.log(`Sending checkin:`,e.monitorSlug,e.status),this.sendEnvelope(u),r}registerCleanup(e){this._disposeCallbacks.push(e)}dispose(){D&&A.log(`Disposing client...`);for(let e of this._disposeCallbacks)try{e()}catch{}this._disposeCallbacks.length=0;for(let e of Object.keys(this._hooks))this._hooks[e]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=md(64)}_prepareEvent(e,t,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,t,n,r)}_setUpMetricsProcessing(){this.on(`processMetric`,e=>{this._options.serverName&&(e.attributes={"server.address":this._options.serverName,...e.attributes})})}};function vb(e){let t=N().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!==`crashed`?t.status=`errored`:n||(t.status=`crashed`)}}var yb={mechanism:{handled:!1,type:`auto.rpc.trpc.middleware`}};function bb(e){typeof e==`object`&&e&&`ok`in e&&!e.ok&&`error`in e&&H(e.error,yb)}function xb(e={}){return async function(t){let{path:n,type:r,next:i,rawInput:a,getRawInput:o}=t,s=P(),c=s?.getOptions(),l=s?.getDataCollectionOptions(),u={procedure_path:n,procedure_type:r};if(ln(u,1+(c?.normalizeDepth??5)),(e.attachRpcInput===void 0?l?.httpBodies.includes(`incomingRequest`):e.attachRpcInput)&&(a!==void 0&&(u.input=fn(a)),o!==void 0&&typeof o==`function`))try{u.input=fn(await o())}catch{}return Dr(t=>(t.setContext(`trpc`,u),oo({name:`trpc/${n}`,op:`rpc.server`,attributes:{[kr]:`route`,[I]:`auto.rpc.trpc`},forceTransaction:!!e.forceTransaction},async e=>{try{let t=await i();return bb(t),e.end(),t}catch(t){throw H(t,yb),e.end(),t}})))}}function Sb(e,t,n){try{if(!P())return;let r=R();r?.isRecording()&&r.setStatus({code:2,message:`internal_error`}),H(e,{mechanism:{type:`auto.ai.mcp_server`,handled:!1,data:{error_type:t||`handler_execution`,...n}}})}catch{}}function Cb(e,t){qt(e,t,e=>function(n,...r){let i=r[r.length-1];if(typeof i!=`function`)return e.call(this,n,...r);let a=wb(i,t,n);return e.call(this,n,...r.slice(0,-1),a)})}function wb(e,t,n){return function(...r){try{return Tb.call(this,e,t,n,r)}catch(t){return D&&A.warn(`MCP handler wrapping failed:`,t),e.apply(this,r)}}}function Tb(e,t,n,r){try{let i=e.apply(this,r);return j(i)&&typeof i.then==`function`?Promise.resolve(i).catch(e=>{throw Eb(e,t,n),e}):i}catch(e){throw Eb(e,t,n),e}}function Eb(e,t,n){try{let r={};t===`tool`||t===`registerTool`?(r.tool_name=n,e.name===`ProtocolValidationError`||e.message.includes(`validation`)||e.message.includes(`protocol`)?Sb(e,`validation`,r):e.name===`ServerTimeoutError`||e.message.includes(`timed out`)||e.message.includes(`timeout`)?Sb(e,`timeout`,r):Sb(e,`tool_execution`,r)):t===`resource`||t===`registerResource`?(r.resource_uri=n,Sb(e,`resource_execution`,r)):(t===`prompt`||t===`registerPrompt`)&&(r.prompt_name=n,Sb(e,`prompt_execution`,r))}catch{}}function Db(e){typeof e.tool==`function`&&Cb(e,`tool`),typeof e.registerTool==`function`&&Cb(e,`registerTool`)}function Ob(e){typeof e.resource==`function`&&Cb(e,`resource`),typeof e.registerResource==`function`&&Cb(e,`registerResource`)}function kb(e){typeof e.prompt==`function`&&Cb(e,`prompt`),typeof e.registerPrompt==`function`&&Cb(e,`registerPrompt`)}function Ab(e){Db(e),Ob(e),kb(e)}function jb(e){let t=e,n=t._registeredTools;if(j(n))for(let[e,t]of Object.entries(n))typeof t.executor==`function`&&(t.executor=wb(t.executor,`registerTool`,e));let r=t._registeredResources;if(j(r))for(let[e,t]of Object.entries(r))typeof t.readCallback==`function`&&(t.readCallback=wb(t.readCallback,`registerResource`,e));let i=t._registeredResourceTemplates;if(j(i))for(let[e,t]of Object.entries(i))typeof t.readCallback==`function`&&(t.readCallback=wb(t.readCallback,`registerResource`,e));let a=t._registeredPrompts;if(j(a))for(let[e,t]of Object.entries(a))typeof t.handler==`function`&&(t.handler=wb(t.handler,`registerPrompt`,e))}var Mb=`mcp.method.name`,Nb=`mcp.transport`,Pb=`mcp.server.name`,Fb=`mcp.server.title`,Ib=`mcp.server.version`,Lb=`mcp.protocol.version`,Rb=`mcp.tool.name`,zb=`mcp.resource.uri`,Bb=`mcp.prompt.name`,Vb=`mcp.tool.result.is_error`,Hb=`mcp.tool.result.content_count`,Ub=`mcp.prompt.result.description`,Wb=`mcp.prompt.result.message_count`,Gb=`mcp.request.argument`,Kb=`mcp.logging.level`,qb=`mcp.logging.logger`,Jb=`mcp.logging.data_type`,Yb=`mcp.logging.message`,Xb=`network.transport`,Zb=`network.protocol.version`,Qb=`client.address`,$b=`client.port`,ex=`mcp.server`,tx=`mcp.notification.client_to_server`,nx=`mcp.notification.server_to_client`,rx=`auto.function.mcp_server`,ix=`auto.mcp.notification`,ax=`route`;function ox(e){return j(e)&&`jsonrpc`in e&&e.jsonrpc===`2.0`&&`method`in e&&`id`in e}function sx(e){return j(e)&&`jsonrpc`in e&&e.jsonrpc===`2.0`&&`method`in e&&!(`id`in e)}function cx(e){return j(e)&&`jsonrpc`in e&&e.jsonrpc===`2.0`&&`id`in e&&(`result`in e||`error`in e)}function lx(e){return j(e)&&`connect`in e&&(`tool`in e&&`resource`in e&&`prompt`in e||`registerTool`in e&&`registerResource`in e&&`registerPrompt`in e)?!0:(D&&A.warn(`Did not patch MCP server. Interface is incompatible.`),!1)}function ux(e){return j(e)}function dx(e,t){let n={[Hb]:e.length};for(let[r,i]of e.entries()){if(!ux(i))continue;let a=e.length===1?`mcp.tool.result`:`mcp.tool.result.${r}`;if(typeof i.type==`string`&&(n[`${a}.content_type`]=i.type),t){let e=(e,t)=>{typeof t==`string`&&(n[`${a}.${e}`]=t)};e(`mime_type`,i.mimeType),e(`uri`,i.uri),e(`name`,i.name),typeof i.text==`string`&&(n[`${a}.content`]=i.text),typeof i.data==`string`&&(n[`${a}.data_size`]=i.data.length);let t=i.resource;ux(t)&&(e(`resource_uri`,t.uri),e(`resource_mime_type`,t.mimeType))}}return n}function fx(e,t){if(!ux(e))return{};let n=Array.isArray(e.content)?dx(e.content,t):{};return typeof e.isError==`boolean`&&(n[Vb]=e.isError),n}function px(e,t){let n={};if(!ux(e))return n;if(t&&typeof e.description==`string`&&(n[Ub]=e.description),Array.isArray(e.messages)&&(n[Wb]=e.messages.length,t)){let t=e.messages;for(let[e,r]of t.entries()){if(!ux(r))continue;let i=t.length===1?`mcp.prompt.result`:`mcp.prompt.result.${e}`;if(((e,r)=>{if(typeof r==`string`){let a=t.length===1?`${i}.message_${e}`:`${i}.${e}`;n[a]=r}})(`role`,r.role),ux(r.content)){let e=r.content;if(typeof e.text==`string`){let r=t.length===1?`${i}.message_content`:`${i}.content`;n[r]=e.text}}}}return n}var mx=new Map,hx=new WeakMap;function gx(e){let t=e.sessionId;return t?mx.get(t):hx.get(e)}function _x(e,t){let n=e.sessionId;n?mx.set(n,t):hx.set(e,t)}function vx(e,t){_x(e,{...gx(e)||{},...t})}function yx(e){return gx(e)?.clientInfo}function bx(e){return gx(e)?.protocolVersion}function xx(e){return gx(e)}function Sx(e){let t=e.sessionId;t&&mx.delete(t)}var Cx=`io.modelcontextprotocol/protocolVersion`,wx=`io.modelcontextprotocol/clientInfo`,Tx=`io.modelcontextprotocol/serverInfo`;function Ex(e){let t={};return ux(e)&&(typeof e.name==`string`&&(t.name=e.name),typeof e.title==`string`&&(t.title=e.title),typeof e.version==`string`&&(t.version=e.version)),t}function Dx(e){let t={};return ux(e.params)&&(typeof e.params.protocolVersion==`string`&&(t.protocolVersion=e.params.protocolVersion),e.params.clientInfo&&(t.clientInfo=Ex(e.params.clientInfo))),t}function Ox(e){let t={};if(ux(e.params)&&ux(e.params._meta)){let n=e.params._meta;typeof n[Cx]==`string`&&(t.protocolVersion=n[Cx]),n[wx]&&(t.clientInfo=Ex(n[wx]))}return t}function kx(e){let t={};return ux(e)&&(typeof e.protocolVersion==`string`&&(t.protocolVersion=e.protocolVersion),e.serverInfo&&(t.serverInfo=Ex(e.serverInfo))),t}function Ax(e){let t={};return ux(e)&&ux(e._meta)&&e._meta[Tx]&&(t.serverInfo=Ex(e._meta[Tx])),t}function jx(e){let t=yx(e),n={};return t?.name&&(n[`mcp.client.name`]=t.name),t?.title&&(n[`mcp.client.title`]=t.title),t?.version&&(n[`mcp.client.version`]=t.version),n}function Mx(e){let t={};return e?.name&&(t[`mcp.client.name`]=e.name),e?.title&&(t[`mcp.client.title`]=e.title),e?.version&&(t[`mcp.client.version`]=e.version),t}function Nx(e){let t=xx(e)?.serverInfo,n={};return t?.name&&(n[Pb]=t.name),t?.title&&(n[Fb]=t.title),t?.version&&(n[Ib]=t.version),n}function Px(e){let t={};return e?.name&&(t[Pb]=e.name),e?.title&&(t[Fb]=e.title),e?.version&&(t[Ib]=e.version),t}function Fx(e){return{address:e?.requestInfo?.remoteAddress||e?.clientAddress||e?.request?.ip||e?.request?.connection?.remoteAddress,port:e?.requestInfo?.remotePort||e?.clientPort||e?.request?.connection?.remotePort}}function Ix(e){if(!e?.constructor)return{mcpTransport:`unknown`,networkTransport:`unknown`};let t=typeof e.constructor?.name==`string`?e.constructor.name:`unknown`,n=`unknown`,r=t.toLowerCase();return r.includes(`stdio`)?n=`pipe`:(r.includes(`http`)||r.includes(`sse`))&&(n=`tcp`),{mcpTransport:t,networkTransport:n}}function Lx(e,t){let n=e&&`sessionId`in e?e.sessionId:void 0,r=t?Fx(t):{},{mcpTransport:i,networkTransport:a}=Ix(e),o=jx(e),s=Nx(e),c=bx(e);return{...n&&{"mcp.session.id":n},...r.address&&{"client.address":r.address},...r.port&&{"client.port":r.port},[Nb]:i,[Xb]:a,[Zb]:`2.0`,...c&&{"mcp.protocol.version":c},...o,...s}}var Rx=new Map,zx=new WeakMap;function Bx(e){let t=e.sessionId;if(t){let e=Rx.get(t);return e||(e=new Map,Rx.set(t,e)),e}let n=zx.get(e);return n||(n=new Map,zx.set(e,n)),n}function Vx(e,t,n,r,i){Bx(e).set(t,{span:n,method:r,capturePolicy:i,startTime:Date.now()})}function Hx(e,t,n,r=!1){let i=Bx(e),a=i.get(t);if(a){let{span:o,method:s}=a,c=s===`initialize`?kx(n):Ax(n);(c.protocolVersion||c.serverInfo)&&vx(e,c);let l={...Px(c.serverInfo)};if(c.protocolVersion&&(l[Lb]=c.protocolVersion),Object.keys(l).length>0&&o.setAttributes(l),r)o.setStatus({code:2,message:`internal_error`});else if(s===`tools/call`){let e=fx(n,a.capturePolicy.recordOutputs);o.setAttributes(e)}else if(s===`prompts/get`){let e=px(n,a.capturePolicy.recordOutputs);o.setAttributes(e)}o.end(),i.delete(t)}}function Ux(e){let t=e.sessionId;if(t){let e=Rx.get(t);if(e){for(let[,t]of e)t.span.setStatus({code:2,message:`cancelled`}),t.span.end();Rx.delete(t)}return}let n=zx.get(e);if(n){for(let[,e]of n)e.span.setStatus({code:2,message:`cancelled`}),e.span.end();n.clear()}}var Wx={"tools/call":{targetField:`name`,targetAttribute:Rb,captureArguments:!0,argumentsField:`arguments`},"resources/read":{targetField:`uri`,targetAttribute:zb,captureUri:!0},"resources/subscribe":{targetField:`uri`,targetAttribute:zb},"resources/unsubscribe":{targetField:`uri`,targetAttribute:zb},"prompts/get":{targetField:`name`,targetAttribute:Bb,captureName:!0,captureArguments:!0,argumentsField:`arguments`}};function Gx(e,t){let n=Wx[e];if(!n)return{attributes:{}};let r=n.targetField&&typeof t?.[n.targetField]==`string`?t[n.targetField]:void 0;return{target:r,attributes:r&&n.targetAttribute?{[n.targetAttribute]:r}:{}}}function Kx(e,t){let n={},r=Wx[e];if(!r)return n;if(r.captureArguments&&r.argumentsField&&t?.[r.argumentsField]){let e=t[r.argumentsField];if(j(e))for(let[t,r]of Object.entries(e))n[`${Gb}.${t.toLowerCase()}`]=JSON.stringify(r)}return r.captureUri&&t?.uri&&(n[`${Gb}.uri`]=JSON.stringify(t.uri)),r.captureName&&t?.name&&(n[`${Gb}.name`]=JSON.stringify(t.name)),n}function qx(e){return typeof e==`string`?e:JSON.stringify(e)}function Jx(e,t,n){let r={};switch(e){case`notifications/cancelled`:t?.requestId&&(r[`mcp.cancelled.request_id`]=String(t.requestId)),t?.reason&&(r[`mcp.cancelled.reason`]=String(t.reason));break;case`notifications/message`:t?.level&&(r[Kb]=String(t.level)),t?.logger&&(r[qb]=String(t.logger)),t?.data!==void 0&&(r[Jb]=typeof t.data,n&&(r[Yb]=qx(t.data)));break;case`notifications/progress`:t?.progressToken&&(r[`mcp.progress.token`]=String(t.progressToken)),typeof t?.progress==`number`&&(r[`mcp.progress.current`]=t.progress),typeof t?.total==`number`&&(r[`mcp.progress.total`]=t.total,typeof t?.progress==`number`&&(r[`mcp.progress.percentage`]=t.progress/t.total*100)),t?.message&&(r[`mcp.progress.message`]=String(t.message));break;case`notifications/resources/updated`:if(t?.uri){r[zb]=String(t.uri);let e=mf(String(t.uri));e&&!pf(e)&&(r[`mcp.resource.protocol`]=e.protocol.replace(`:`,``))}break;case`notifications/initialized`:r[`mcp.lifecycle.phase`]=`initialization_complete`,r[`mcp.protocol.ready`]=1}return r}function Yx(e,t,n,r){if(e===`request`){let e=t,i=Gx(e.method,n||{});return{...e.id!==void 0&&{"mcp.request.id":String(e.id)},...i.attributes,...r?Kx(e.method,n||{}):{}}}return Jx(t.method,n||{},r)}var Xx=new Set([Qb,$b,zb]);function Zx(e){return Xx.has(e)}function Qx(e,t){return t?e:Object.entries(e).reduce((e,[t,n])=>(Zx(t)||(e[t]=n),e),{})}function $x(e,t){return t?`${e} ${t}`:e}function eS(e){let t,n;switch(e){case`request`:t=ex,n=rx;break;case`notification-incoming`:t=tx,n=ix;break;case`notification-outgoing`:t=nx,n=ix}return{[F]:t,[I]:n,[kr]:ax}}function tS(e){let{type:t,message:n,transport:r,extra:i,callback:a,options:o}=e,{method:s}=n,c=n.params,l;l=t===`request`?$x(s,Gx(s,c||{}).target):s;let u=Qx({...Lx(r,i),[Mb]:s,...Yx(t,n,c,o?.recordInputs),...eS(t)},!!P()?.getDataCollectionOptions().userInfo);return z({name:l,forceTransaction:!0,attributes:u},a)}function nS(e,t,n,r,i){return tS({type:`notification-incoming`,message:e,transport:t,extra:n,callback:i,options:r})}function rS(e,t,n,r){return tS({type:`notification-outgoing`,message:e,transport:t,options:n,callback:r})}function iS(e,t,n,r){let{method:i}=e,a=e.params;return{name:$x(i,Gx(i,a||{}).target),op:ex,forceTransaction:!0,attributes:Qx({...Lx(t,n),[Mb]:i,...Yx(`request`,e,a,r?.recordInputs),...eS(`request`)},!!P()?.getDataCollectionOptions().userInfo)}}function aS(e){if(e.recordInputs!==void 0&&e.recordOutputs!==void 0)return{recordInputs:e.recordInputs,recordOutputs:e.recordOutputs};let t=P()?.getDataCollectionOptions().genAI;return{recordInputs:e.recordInputs??t?.inputs??!1,recordOutputs:e.recordOutputs??t?.outputs??!1}}function oS(e,t){e.onmessage&&qt(e,`onmessage`,n=>function(r,i){let a=ox(r)?r:void 0,o=sx(r)?r:void 0,s=a||o,c;if(s)try{c=a?.method===`initialize`?Dx(a):Ox(s),(c.protocolVersion||c.clientInfo)&&vx(e,c)}catch{}if(a){let r=aS(t);return Dr(N().clone(),()=>{let t=B(iS(a,e,i,r));return a.method===`initialize`&&c&&t.setAttributes({...Mx(c.clientInfo),...c.protocolVersion&&{"mcp.protocol.version":c.protocolVersion}}),Vx(e,a.id,t,a.method,r),V(t,()=>n.call(this,a,i))})}return o?nS(o,e,i,aS(t),()=>n.call(this,o,i)):n.call(this,r,i)})}function sS(e,t){e.send&&qt(e,`send`,n=>async function(...r){let[i]=r;return sx(i)?rS(i,e,aS(t),()=>n.call(this,...r)):(cx(i)&&i.id!==null&&i.id!==void 0&&(i.error&&uS(i.error),Hx(e,i.id,i.result,!!i.error)),n.call(this,...r))})}function cS(e){e.onclose&&qt(e,`onclose`,t=>function(...n){return Ux(e),Sx(e),t.call(this,...n)})}function lS(e){e.onerror&&qt(e,`onerror`,e=>function(t){return dS(t),e.call(this,t)})}function uS(e){try{if(j(e)&&`code`in e&&`message`in e){let t=e;if(t.code===-32603||t.code>=-32099&&t.code<=-32e3){let e=Error(t.message);e.name=`JsonRpcError_${t.code}`,Sb(e,`protocol`)}}}catch{}}function dS(e){try{Sb(e,`transport`)}catch{}}var fS=new WeakSet;function pS(e,t){if(fS.has(e)||!lx(e))return e;let n=e,r={...t};return qt(n,`connect`,e=>async function(t,...n){let i=await e.call(this,t,...n);return oS(t,r),sS(t,r),cS(t),lS(t),i}),Ab(n),jb(n),fS.add(e),e}function mS(e,t=!1){return!(t||e&&!e.startsWith(`/`)&&!e.match(/^[A-Z]:/)&&!e.startsWith(`.`)&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes(`node_modules/`)}function hS(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return i=>{let a=i.match(r);if(a)return{filename:`<data:${a[2]}>`,function:a[1]};let o=i.match(n);if(o){let t,n,r,i,a;if(o[1]){r=o[1];let e=r.lastIndexOf(`.`);if(r[e-1]===`.`&&e--,e>0){t=r.slice(0,e),n=r.slice(e+1);let i=t.indexOf(`.Module`);i>0&&(r=r.slice(i+1),t=t.slice(0,i))}i=void 0}n&&(i=t,a=n),n===`<anonymous>`&&(a=void 0,r=void 0),r===void 0&&(a||=`?`,r=i?`${i}.${a}`:a);let s=kt(o[2]),c=o[5]===`native`;!s&&o[5]&&!c&&(s=o[5]);let l=s?vS(s):void 0;return{filename:l??s,module:l&&e?.(l),function:r,lineno:_S(o[3]),colno:_S(o[4]),in_app:mS(s||``,c)}}if(i.match(t))return{filename:i}}}function gS(e){return[90,hS(e)]}function _S(e){return parseInt(e||``,10)||void 0}function vS(e){try{return decodeURI(e)}catch{return}}var yS=new WeakMap,bS=(e,t)=>{let n=yS.get(e);n?n.push(t):yS.set(e,[t])},xS=e=>{let t=yS.get(e);return t||(t=[],yS.set(e,t)),t},SS=`express.name`,CS=`http.route`,wS=`express.type`,TS=`router`,ES=`middleware`,DS=`request_handler`,OS=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];function kS(e){return e.includes(`:`)||e.includes(`*`)}var AS=(e,t,n)=>{if(t.name===`router`){let r=jS(``,t)||n||e||`/`;return{attributes:{[SS]:r,[wS]:TS},name:`router - ${r}`}}return t.name===`bound dispatch`||t.name===`handle`?{attributes:{[SS]:(e||n)??`request handler`,[wS]:DS},name:`request handler${t.path?` - ${e||n}`:``}`}:{attributes:{[SS]:t.name,[wS]:ES},name:`middleware - ${t.name}`}},jS=(e,t)=>{let n=Array.isArray(t.handle?.stack)?t.handle?.stack?.[0]:void 0;return n?.route?.path?`${e}${n.route.path}`:n&&Array.isArray(n?.handle?.stack)?jS(e,n):e},MS=(e,t,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(t))return!0;if(!Array.isArray(n?.ignoreLayers))return!1;try{return Tn(e,n.ignoreLayers,!0)}catch{}return!1};function NS(e,t){let n=xS(e);if(n.length===0)return;if(n.every(e=>e===`/`))return e.originalUrl===`/`?`/`:void 0;if(t===`*`||t.includes(`/`)&&(t.includes(`,`)||t.includes(`\\`)||t.includes(`*`)||t.includes(`[`)))return t;let r=t.startsWith(`/`)?t:`/${t}`;return r.length>0&&(e.originalUrl===r||e.originalUrl.startsWith(r)||kS(r))?r:void 0}function PS(e){let t=xS(e),n=``;for(let e of t)e!==`/`&&e!==`/*`&&(n+=!n||n.endsWith(`/`)?e:`/${e}`);return n.replace(/\/{2,}/g,`/`)}var FS=e=>{let t=e[0];return Array.isArray(t)?t.map(e=>IS(e)||``).join(`,`):IS(t)},IS=e=>typeof e==`string`?e:e instanceof RegExp||typeof e==`number`?String(e):void 0,LS=e=>RS(e?.Router?.prototype),RS=e=>(typeof e==`object`||typeof e==`function`)&&!!e&&`route`in e&&typeof e.route==`function`,zS=e=>RS(e.Router)&&!LS(e);function BS(e){let t=e.status||e.statusCode||e.status_code||e.output?.statusCode;return t?parseInt(t,10):500}function VS(e){return BS(e)>=500}function HS(e){if(!N()?.getScopeData()?.sdkProcessingMetadata?.normalizedRequest){let t=If(e);N().setSDKProcessingMetadata({normalizedRequest:t})}}function US(e,t,n){if(!t?.handle)return;let r=t,i=r.handle;if(Zt(i)||i.length===4)return;function a(t,a,...o){let s=e();HS(t);let c=R();if(!c)return i.apply(this,[t,a,...o]);n&&bS(t,n);let l=xS(t),u=!!n,d=PS(t),f=NS(t,d);s.onRouteResolved?.(f);let p=AS(d,r,n),m=p.attributes[SS],h=p.attributes[wS],g=Object.assign(p.attributes,{[I]:`auto.http.express`,[F]:`${h}.express`});if(f&&(g[CS]=f),MS(p.attributes[`express.name`],h,s))return u&&l.pop(),i.apply(this,[t,a,...o]);let _=N();if(_!==ar()){if(h===`request_handler`){let e=t.method?t.method.toUpperCase():`GET`;_.setTransactionName(`${e} ${d}`)}}else D&&A.warn(`Isolation scope is still default isolation scope - skipping setting transactionName`);return oo({name:m,attributes:g},e=>{let n=!1;p.attributes[`express.type`]===`router`&&(e.end(),n=!0);let r=()=>{n||(n=!0,e.end())};for(let i=0;i<o.length;i++){let s=o[i];if(typeof s==`function`){o[i]=function(...i){let o=i[0],d=!!o&&o!==`route`&&o!==`router`;if(!n&&d){let[t,n]=OS(o);e.setStatus({code:2,message:n})}return n||(n=!0,a.removeListener(`finish`,r),e.end()),!(t.route&&d)&&u&&l.pop(),V(c,()=>s.apply(this,i))};break}}try{return i.apply(this,[t,a,...o])}catch(t){let[n,r]=OS(t);throw e.setStatus({code:2,message:r}),t}finally{n||a.once(`finish`,r)}})}for(let e in i)e in a||Object.defineProperty(a,e,{get(){return i[e]},set(t){i[e]=t}});Yt(a,i),Object.defineProperty(r,"handle",{enumerable:!0,configurable:!0,writable:!0,value:a})}function WS(e){return!!e&&typeof e==`object`&&`default`in e&&e.default||e}function GS(e){return!!e.express}var KS=!1;function qS(){KS||(KS=!0,D&&A.warn("[Express] `patchExpressModule(options)` is deprecated. Use `patchExpressModule(moduleExports, getOptions)` instead."))}function JS(e,t){let n,r;if(!t&&GS(e)){let{express:t,...i}=e;r=t,n=()=>i,qS()}else if(typeof t!=`function`)throw TypeError("`patchExpressModule(moduleExports, getOptions)` requires a `getOptions` callback");else n=t,r=e;let i=WS(r),a=LS(i)?i.Router.prototype:zS(i)?i.Router:void 0;if(!a)throw TypeError(`no valid Express route function to instrument`);let o=a.route;try{Xt(a,`route`,function(...e){let t=o.apply(this,e),r=this.stack[this.stack.length-1];return US(n,r,FS(e)),t})}catch(e){D&&A.error(`Failed to patch express route method:`,e)}let s=a.use;try{Xt(a,`use`,function(...e){let t=s.apply(this,e),r=this.stack[this.stack.length-1];return r&&US(n,r,FS(e)),t})}catch(e){D&&A.error(`Failed to patch express use method:`,e)}let{application:c}=i,l=c.use;try{Xt(c,`use`,function(...e){let t=l.apply(this,e),r=LS(i)?this.router:this._router;if(r){let t=r.stack[r.stack.length-1];t&&US(n,t,FS(e))}return t})}catch(e){D&&A.error(`Failed to patch express application.use method:`,e)}return i}function YS(){return P()?.getIntegrationByName(`Express`)?.getShouldHandleError?.()}function XS(e){return function(t,n,r,i){HS(n);let a=e?.shouldHandleError??YS()??VS;if(a===!1){i(t);return}a(t)&&(r.sentry=H(t,{mechanism:{type:`auto.middleware.express`,handled:!1}})),i(t)}}function ZS(e,t){e.use(QS()),e.use(XS(t))}function QS(){return function(e,t,n){HS(e),n()}}var $S=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,eC=Symbol(`sentryPostgresConnectionContext`),tC=Symbol.for(`sentry.instrumented.postgresjs`),nC=Symbol.for(`sentry.query.from.instrumented.sql`);function rC(e,t){return!e||typeof e!=`function`?(D&&A.warn(`instrumentPostgresJsSql: provided value is not a valid postgres.js sql instance`),e):iC(e,{requireParentSpan:!0,...t})}function iC(e,t,n){if(e[tC])return e;let r=new Proxy(e,{apply(e,n,i){let a=Reflect.apply(e,n,i);return j(a)&&`handle`in a&&sC(a,r,t),a},get(e,n){let i=e[n];return typeof n!=`string`||typeof i!=`function`?i:n===`unsafe`||n===`file`?aC(i,e,r,t):n===`begin`||n===`reserve`?oC(i,e,r,t):i}});return n?r[eC]=n:hC(e,r),e[tC]=!0,r[tC]=!0,r}function aC(e,t,n,r){return function(...i){let a=Reflect.apply(e,t,i);return j(a)&&`handle`in a&&sC(a,n,r),a}}function oC(e,t,n,r){return function(...i){let a=n[eC];if(typeof i[i.length-1]!=`function`){let n=Reflect.apply(e,t,i);return n&&typeof n.then==`function`?n.then(e=>iC(e,r,a)):n}let o=i.length===1?i[0]:i[1],s=function(e){let t=iC(e,r,a);return o(t)},c=i.length===1?[s]:[i[0],s];return Reflect.apply(e,t,c)}}function sC(e,t,n){if(e.handle?.__sentryWrapped)return;e[nC]=!0;let r=e.handle,i=async function(...i){if(this.executed||!cC(n))return r.apply(this,i);let a=dC(lC(e.strings));return oo({name:a||`postgresjs.query`,op:`db`},e=>{e.setAttribute(I,`auto.db.postgresjs`),e.setAttributes({"db.system.name":`postgres`,"db.query.text":a});let o=t?t[eC]:void 0;if(fC(e,o),n.requestHook)try{n.requestHook(e,a,o)}catch(t){e.setAttribute(`sentry.hook.error`,`requestHook failed`),D&&A.error(`Error in requestHook for PostgresJs instrumentation:`,t)}let s=this;s.resolve=new Proxy(s.resolve,{apply:(t,n,r)=>{try{pC(e,a,r?.[0]?.command),e.end()}catch(e){D&&A.error(`Error ending span in resolve callback:`,e)}return Reflect.apply(t,n,r)}}),s.reject=new Proxy(s.reject,{apply:(t,n,r)=>{try{e.setStatus({code:2,message:r?.[0]?.message||`unknown_error`}),e.setAttribute(`db.response.status_code`,r?.[0]?.code||`unknown`),e.setAttribute(`error.type`,r?.[0]?.name||`unknown`),pC(e,a),e.end()}catch(e){D&&A.error(`Error ending span in reject callback:`,e)}return Reflect.apply(t,n,r)}});try{return r.apply(this,i)}catch(t){throw e.setStatus({code:2,message:t instanceof Error?t.message:`unknown_error`}),e.end(),t}})};i.__sentryWrapped=!0,e.handle=i}function cC(e){return R()!==void 0||!e.requireParentSpan}function lC(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((e,t,n)=>n===0?t:`${e}$${n}${t}`,``)}var uC;function dC(e){return e?(uC||=RegExp(`(?<!\\$)-?\\b\\d+\\b`,`g`),e.replace(/--.*$/gm,``).replace(/\/\*[\s\S]*?\*\//g,``).replace(/;\s*$/,``).replace(/\s+/g,` `).trim().replace(/\bX'[0-9A-Fa-f]*'/gi,`?`).replace(/\bB'[01]*'/gi,`?`).replace(/'(?:[^']|'')*'/g,`?`).replace(/\b0x[0-9A-Fa-f]+/gi,`?`).replace(/\b(?:TRUE|FALSE)\b/gi,`?`).replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,`?`).replace(/-?\b\d+\.\d+\b/g,`?`).replace(/-?\.\d+\b/g,`?`).replace(uC,`?`).replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,`IN (?)`).replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,`IN ($?)`)):`Unknown SQL Query`}function fC(e,t){if(t&&(t.ATTR_DB_NAMESPACE&&e.setAttribute(`db.namespace`,t.ATTR_DB_NAMESPACE),t.ATTR_SERVER_ADDRESS&&e.setAttribute(`server.address`,t.ATTR_SERVER_ADDRESS),t.ATTR_SERVER_PORT!==void 0)){let n=parseInt(t.ATTR_SERVER_PORT,10);isNaN(n)||e.setAttribute(`server.port`,n)}}function pC(e,t,n){if(n){e.setAttribute(`db.operation.name`,n);return}let r=t?.match($S);r?.[1]&&e.setAttribute(`db.operation.name`,r[1].toUpperCase())}function mC(e){let t=e.host?.[0]||`localhost`,n=e.port?.[0]||5432;return{ATTR_DB_NAMESPACE:typeof e.database==`string`&&e.database!==``?e.database:void 0,ATTR_SERVER_ADDRESS:t,ATTR_SERVER_PORT:String(n)}}function hC(e,t){let n=e;n.options&&typeof n.options==`object`&&(t[eC]=mC(n.options))}var gC=`http.client.request.created`,_C=`http.server.request.start`;function vC(e){let t=e.host||``,n=/^(.*):(\d+)$/.exec(t),r=n?n[1]:t,i=e.port??(n?Number(n[2]):void 0);return{method:e.method,port:i,protocol:e.protocol,host:e.host,hostname:r,path:e.path,headers:e.getHeaders()}}function yC(e){try{return String(bC(e))}catch{return``}}function bC(e){let t=e.protocol||`http:`,n=e.headers?.host&&String(e.headers?.host)||e.hostname||e.host||``,r=!e.port||e.port===80||e.port===443||/^(.*):(\d+)$/.test(n)?``:`:${e.port}`,i=e.path?e.path:`/`,a=`${t}//${n}${r}`;return new URL(i.startsWith(`//`)?`${a}${i}`:i,a)}function xC(e){return String(yC(vC(e)))}function SC(e,t){let n=vf(xC(e)),r=t?.statusCode,i=pb(r);Gf({category:`http`,data:{status_code:r,url:bf(n),"http.method":e.method||`GET`,...n.search?{"http.query":n.search}:{},...n.hash?{"http.fragment":n.hash}:{}},type:`http`,level:i},{event:`response`,request:e,response:t})}function CC(e){let t=xC(e),[n,r]=_f(mf(t),`client`,`auto.http.client`,e),i=e.getHeader(`user-agent`);return{name:n,attributes:{[F]:`http.client`,"otel.kind":`CLIENT`,"http.url":t,"http.method":e.method,"http.target":e.path||`/`,"net.peer.name":e.host,"http.host":e.getHeader(`host`),...i?{"user_agent.original":i}:{},...r},onlyIfParent:!0}}function wC(e,t){let{statusCode:n,statusMessage:r,httpVersion:i,socket:a}=e,o=i?.toUpperCase()===`QUIC`?`ip_udp`:`ip_tcp`;t.setAttributes({"http.response.status_code":n,"network.protocol.version":i,"http.flavor":i,"network.transport":o,"net.transport":o,"http.status_text":r?.toUpperCase(),"http.status_code":n,...EC(e),...TC(a)})}function TC(e){if(!e)return{};let{remoteAddress:t,remotePort:n}=e;return{"network.peer.address":t,"network.peer.port":n,"net.peer.ip":t,"net.peer.port":n}}function EC(e){let{headers:t}=e,n=t[`content-length`],r=n?parseInt(String(n),10):-1,i=t[`content-encoding`];return r>=0?i&&i!==`identity`?{"http.response_content_length":r}:{"http.response_content_length_uncompressed":r}:{}}function DC(e,t){let n=xC(e),{tracePropagationTargets:r,propagateTraceparent:i}=P()?.getOptions()??{};if(!kf(n,r,t)||e.getHeader(`sentry-trace`))return;let a=Tf({propagateTraceparent:i});if(!a)return;let{"sentry-trace":o,baggage:s,traceparent:c}=a;if(o)try{e.setHeader(`sentry-trace`,o),D&&A.log(`@sentry/instrumentation-http`,`Added sentry-trace header`)}catch(e){D&&A.error(`@sentry/instrumentation-http`,`Failed to set sentry-trace header:`,It(e)?e.message:`Unknown error`)}if(c&&!e.getHeader(`traceparent`))try{e.setHeader(`traceparent`,c),D&&A.log(`@sentry/instrumentation-http`,`Added traceparent header`)}catch(e){D&&A.error(`@sentry/instrumentation-http`,`Failed to set traceparent header:`,It(e)?e.message:`Unknown error`)}if(s){let t=hi(e.getHeader(`baggage`),s);if(t)try{e.setHeader(`baggage`,t),D&&A.log(`@sentry/instrumentation-http`,`Added baggage header`)}catch(e){D&&A.error(`@sentry/instrumentation-http`,`Failed to set baggage header:`,It(e)?e.message:`Unknown error`)}}}var OC=e=>typeof e.__unwrap==`function`,kC=`Double-wrapped http.client detected. Either disable spans in Sentry.httpIntegration, or disable the OpenTelemetry HTTP instrumentation. See: https://docs.sentry.io/platforms/javascript/guides/express/opentelemetry/custom-setup/#custom-http-instrumentation`,AC=!1,jC=D?e=>{AC||(OC(e.request)||OC(e.get))&&(AC=!0,A.warn(kC))}:()=>{};function MC(e){let t=new hb(100),n=()=>P()?.getOptions(),r=r=>{if(M().getScopeData().sdkProcessingMetadata.__SENTRY_SUPPRESS_TRACING__===!0)return;let i=n(),{errorMonitor:a=`error`,spans:o=!i||sa(i),propagateTrace:s=!1,breadcrumbs:c=!0,http:l,https:u,suppressOtelWarning:d=!1}=e,{request:f}=r;if(e.ignoreOutgoingRequests?.(xC(f),f))return;let p=!1;function m(e,t){p||(p=!0,SC(e,t))}function h(e){e.on(a,()=>m(e,void 0)),e.prependListener(`response`,t=>{e.listenerCount(`response`)<=1&&t.resume(),t.on(`end`,()=>m(e,t)),t.on(a,()=>m(e,t))})}if(!o){c&&h(f),s&&DC(f,t);return}d||(l&&jC(l),u&&jC(u));let g=B(CC(f));e.outgoingRequestHook?.(g,f),s&&(g.isRecording()?V(g,()=>{DC(f,t)}):DC(f,t));let _=!1;function v(e){_||(_=!0,g.setStatus(e),g.end())}let y=()=>v({code:0});f.on(`close`,y),f.on(a,e=>{D&&A.log(`@sentry/instrumentation-http`,`outgoingRequest on request error()`,e),c&&m(f,void 0),v({code:2})}),f.prependListener(`response`,t=>{f.removeListener(`close`,y),f.listenerCount(`response`)<=1&&t.resume(),wC(t,g),Io(t),e.outgoingResponseHook?.(g,t);let n=!1;function r(r){if(!n){n=!0,r&&D&&A.log(`@sentry/instrumentation-http`,`outgoingRequest on response error()`,r),c&&m(f,t);let i=t.aborted&&!t.complete,a=r||typeof t.statusCode!=`number`||i?{code:2}:Jr(t.statusCode);e.applyCustomAttributesOnSpan?.(g,f,t),v(a)}}t.on(`end`,()=>r()),t.on(a,r)})};return{[gC]:r}}var NC;function PC(e,t){let n=e.ClientRequest?.prototype;if(typeof n?._storeHeader!=`function`||(NC=MC({...t,http:e})[gC],Zt(n._storeHeader)))return;let r=n._storeHeader;Xt(n,`_storeHeader`,function(...e){try{NC({request:this},gC)}catch{}return r.apply(this,e)})}function FC(e,t={}){return PC(WS(e),t),e}var IC=(e,t={})=>FC(e,t);function LC(e,t,n,r){let i=0,a=[];D&&A.log(r,`Patching request.on`);let o=new WeakMap,s=Nf(n);try{e.on=e.addListener=new Proxy(e.on,{apply:(e,t,n)=>{let[c,l,...u]=n;if(c===`data`){D&&A.log(r,`Handling request.on("data") with maximum body size of ${s}b`);let n=new Proxy(l,{apply:(e,t,n)=>{try{let e=n[0],t=Buffer.from(e);i<s?(a.push(t),i+=t.byteLength):D&&A.log(r,`Dropping request body chunk because maximum body length of ${s}b is exceeded.`)}catch{D&&A.error(r,`Encountered error while storing body chunk.`)}return Reflect.apply(e,t,n)}});return o.set(l,n),Reflect.apply(e,t,[c,n,...u])}return Reflect.apply(e,t,n)}}),e.off=e.removeListener=new Proxy(e.off,{apply:(e,t,n)=>{let[,r]=n,i=o.get(r);if(i){o.delete(r);let a=n.slice();return a[1]=i,Reflect.apply(e,t,a)}return Reflect.apply(e,t,n)}}),e.on(`end`,()=>{try{let e=Buffer.concat(a).toString(`utf-8`);if(e){let n=Buffer.byteLength(e,`utf-8`)>s?`${Buffer.from(e).subarray(0,s-3).toString(`utf-8`)}...`:e;t.setSDKProcessingMetadata({normalizedRequest:{data:n}})}}catch(e){D&&A.error(r,`Error building captured request body`,e)}})}catch(e){D&&A.error(r,`Error patching request to capture body`,e)}}var RC=new WeakMap;function zC(e,{requestIsolationScope:t,response:n,sessionFlushingDelayMS:r}){t.setSDKProcessingMetadata({requestSession:{status:`ok`}}),n.once(`close`,()=>{let n=t.getScopeData().sdkProcessingMetadata.requestSession;if(e&&n){D&&A.log(`Recorded request session with status: ${n.status}`);let t=new Date(an());t.setSeconds(0,0);let i=t.toISOString(),a=RC.get(e),o=a?.[i]||{exited:0,crashed:0,errored:0};if(o[{ok:`exited`,crashed:`crashed`,errored:`errored`}[n.status]]++,a)a[i]=o;else{D&&A.log(`Opened new request session aggregate.`);let t={[i]:o};RC.set(e,t);let n=()=>{clearTimeout(s),a(),RC.delete(e);let n=Object.entries(t).map(([e,t])=>({started:e,exited:t.exited,errored:t.errored,crashed:t.crashed}));e.sendSession({aggregates:n})},a=e.on(`flush`,()=>{D&&A.log(`Sending request session aggregate due to client flush`),n()}),s=setTimeout(()=>{D&&A.log(`Sending request session aggregate due to flushing schedule`),n()},r);bu(s)}}})}var BC=`Http.Server`,VC=`Http.SentryServerSpans`,HC=new WeakMap,UC=Symbol.for(`sentry_http_server_instrumented`);function WC(e){return!e[UC]&&(e[UC]=!0)}function GC(e,t){let n=t.emit;if(n===HC.get(t))return;let r=new Proxy(n,{apply(t,n,r){let[i,...a]=r;if(i!==`request`)return t.apply(n,r);let o=P(),[s,c]=a;if(!o||!WC(s))return t.apply(n,r);D&&A.log(BC,`Handling incoming request`);let l=N().clone();l.setClient(o);let u=s.socket?.remoteAddress,d=s.url||`/`,f=If(s),{maxRequestBodySize:p=`medium`,ignoreRequestBody:m,sessions:h=!0,sessionFlushingDelayMS:g=6e4}=e;p!==`none`&&!m?.(d,s)&&LC(s,l,p,BC),l.setSDKProcessingMetadata({normalizedRequest:f,ipAddress:u});let _=`${(s.method||`GET`).toUpperCase()} ${yf(d)}`;return l.setTransactionName(_),h&&zC(o,{requestIsolationScope:l,response:c,sessionFlushingDelayMS:g??6e4}),Dr(l,()=>{let i=f.headers?.[`sentry-trace`],a=f.headers?.baggage,o=Array.isArray(i)?i[0]:i;return lo({sentryTrace:o,baggage:Array.isArray(a)?a[0]:a},()=>{let i=M().getPropagationContext();i.propagationSpanId=Xn(),o||(i.traceId=Yn(),i.sampleRand=rn()),c.once(`close`,()=>{l.setContext(`response`,{status_code:c.statusCode})});let a=e.wrapServerEmitRequest,u=!1;return a?a(s,c,f,()=>{u=t.apply(n,r)}):u=t.apply(n,r),u})})}});HC.set(t,r),t.emit=r}function KC(e){let t=e.wrapServerEmitRequest,n=qC(e),r={...e,wrapServerEmitRequest(r,i,a,o){let s=P()?.getOptions();e.spans??(s?sa(s):!1)?n(r,i,a,o):t?t(r,i,a,o):o()}},i=e=>{let{server:t}=e;GC(r,t)};return{[_C]:i}}function qC(e){let{wrapServerEmitRequest:t,ignoreIncomingRequests:n,ignoreStaticAssets:r=!0,onSpanCreated:i,errorMonitor:a=`error`,onSpanEnd:o}=e;return(e,s,c,l)=>{return typeof __SENTRY_TRACING__<`u`&&!__SENTRY_TRACING__?l():t?t(e,s,c,u):u();function u(){let t=N().getClient();if(!t)return l();if(JC(e,{ignoreStaticAssets:r,ignoreIncomingRequests:n}))return D&&A.log(VC,`Skipping span creation for incoming request`,e.url),l();let u=c.url||e.url||`/`,d=mf(u),f=d?d.pathname:yf(u),p=(e.method||`GET`).toUpperCase(),m=`${p} ${f}`,h=e.headers,g=h[`user-agent`],_=h[`x-forwarded-for`],v=e.httpVersion,y=h.host,ee=y?.replace(/^(.*)(:[0-9]{1,5})/,`$1`)||`localhost`,b=u.startsWith(`https`)?`https`:`http`,{socket:te}=e,{localAddress:x,localPort:ne,remoteAddress:re,remotePort:ie}=te??{};return oo({name:m,kind:G.SERVER,attributes:{[F]:`http.server`,[I]:`auto.http.server`,[kr]:`url`,"http.route":f,"otel.kind":`SERVER`,"net.host.ip":x,"net.host.port":ne,"net.peer.ip":re,"net.peer.port":ie,"sentry.http.prefetch":XC(e)||void 0,[gl]:d&&!pf(d)?d.href:void 0,[_l]:d?.pathname??f,[Mc]:u,"http.method":p,"http.target":d?`${d.pathname}${d.search}`:f,"http.host":y,"net.host.name":ee,"http.client_ip":typeof _==`string`?_.split(`,`)[0]:void 0,"http.user_agent":g,"http.scheme":b,"http.flavor":v,"net.transport":v?.toUpperCase()===`QUIC`?`ip_udp`:`ip_tcp`,...ZC(e),...Rf(c.headers||{},t.getDataCollectionOptions())}},n=>{i?.(n,e,s);let r=!1;function c(i){r||(r=!0,n.setAttributes({"http.status_text":s.statusMessage?.toUpperCase(),"http.response.status_code":s.statusCode,"http.status_code":s.statusCode,...Rf(Ff(s.headers),t?.getDataCollectionOptions()??!1,`response`)}),n.setStatus(i),o?.(n,e,s),n.end())}s.once(`close`,()=>{c(Jr(s.statusCode))}),s.once(a,()=>{let e=Jr(s.statusCode);c(e.code===2?e:{code:2})}),l()})}}}function JC(e,{ignoreStaticAssets:t,ignoreIncomingRequests:n}){let r=e.url,i=e.method?.toUpperCase();return!!(i===`OPTIONS`||i===`HEAD`||!r||t&&i===`GET`&&YC(r)||n?.(r,e))}function YC(e){let t=yf(e);return!!(t.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)||t.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/))}function XC(e){return e.headers[`next-router-prefetch`]===`1`}function ZC(e){let{headers:t}=e,n=t[`content-length`],r=n?parseInt(String(n),10):-1,i=t[`content-encoding`];return r>=0?i&&i!==`identity`?{"http.request_content_length":r}:{"http.request_content_length_uncompressed":r}:{}}var QC=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;x();var $C=u(`sentry_http_server_instrumented`),ew=`Http.Server`;function tw(e,t){Jt(e,`_startSpanCallback`,new WeakRef(t))}var nw=((e={})=>{let t={sessions:e.sessions??!0,sessionFlushingDelayMS:e.sessionFlushingDelayMS??6e4,maxRequestBodySize:e.maxRequestBodySize??`medium`,spans:!1,ignoreRequestBody:e.ignoreRequestBody,wrapServerEmitRequest(e,t,n,r){let i=P();if(!i||l.active().getValue($C))return r();let a=p.extract(l.active(),n.headers).setValue($C,!0);l.with(a,()=>{i.emit(`httpServerRequest`,e,t,n);let a=e._startSpanCallback?.deref();a?a(()=>(r(),!0)):r()})}};return{name:ew,setupOnce(){let{[_C]:e}=KC(t);He(_C,e)},afterAllSetup(e){QC&&e.getIntegrationByName(`Http`)&&A.warn("It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.")}}});x();var rw=u(`OpenTelemetry SDK Context Key RPC_METADATA`),iw;(function(e){e.HTTP=`http`})(iw||={});function aw(e,t){return e.setValue(rw,t)}x();var ow=`Http.ServerSpans`,sw=((e={})=>{let t=e.ignoreStaticAssets??!0,n=e.ignoreIncomingRequests,r=e.ignoreStatusCodes??[[401,404],[301,303],[305,399]],{onSpanCreated:i}=e,{requestHook:a,responseHook:o,applyCustomAttributesOnSpan:s}=e.instrumentation??{};return{name:ow,setup(e){typeof __SENTRY_TRACING__<`u`&&!__SENTRY_TRACING__||e.on(`httpServerRequest`,(r,c,u)=>{let d=r,f=c;tw(d,r=>{if(uw(d,{ignoreStaticAssets:t,ignoreIncomingRequests:n}))return QC&&A.log(ow,`Skipping span creation for incoming request`,d.url),r();let c=u.url||d.url||`/`,p=mf(c),m=d.headers,h=m[`user-agent`],g=m[`x-forwarded-for`],_=d.httpVersion,v=m.host,y=v?.replace(/^(.*)(:[0-9]{1,5})/,`$1`)||`localhost`,ee=c.startsWith(`https`)?`https`:`http`,b=u.method||d.method?.toUpperCase()||`GET`,te=p?p.pathname:yf(c),x=B({name:`${b} ${te}`,kind:G.SERVER,attributes:{[F]:`http.server`,[I]:`auto.http.otel.http`,[al]:cw(d)||void 0,[gl]:p&&!pf(p)?p.href:void 0,[_l]:p?.pathname??te,[Mc]:c,[Tc]:u.method,[jc]:p?`${p.pathname}${p.search}`:te,[wc]:v,[Jc]:y,[Sc]:typeof g==`string`?g.split(`,`)[0]:void 0,[Nc]:h,[kc]:ee,[Cc]:_,[$c]:_?.toUpperCase()===`QUIC`?`ip_udp`:`ip_tcp`,...dw(d),...Rf(u.headers||{},e.getDataCollectionOptions())}});a?.(x,d),o?.(x,f),s?.(x,d,f),i?.(x,d,f);let ne={type:iw.HTTP,span:x};return V(x,()=>l.with(aw(l.active(),ne),()=>{Io(d),Io(f);let e=!1;function t(t){if(e)return;e=!0;let n=mw(d,f,ne);x.setAttributes(n),x.setStatus(t),x.end();let r=n[`http.route`];r&&N().setTransactionName(`${d.method?.toUpperCase()||`GET`} ${r}`)}return f.on(`close`,()=>{t(Jr(f.statusCode))}),f.on(Ne,()=>{let e=Jr(f.statusCode);t(e.code===2?e:{code:2})}),r()}))})})},processEvent(e){if(e.type===`transaction`){let t=e.contexts?.trace?.data?.[`http.response.status_code`];if(typeof t==`number`){if(hw(t,r))return QC&&A.log(`Dropping transaction due to status code`,t),null;e.contexts={...e.contexts,response:{...e.contexts?.response,status_code:t}}}}return e},afterAllSetup(e){QC&&(e.getIntegrationByName(`Http`)&&A.warn("It seems that you have manually added `httpServerSpansIntegration` while `httpIntegration` is also present. Make sure to remove `httpIntegration` when adding `httpServerSpansIntegration`."),e.getIntegrationByName(`Http.Server`)||A.error("It seems that you have manually added `httpServerSpansIntegration` without adding `httpServerIntegration`. This is a requiement for spans to be created - please add the `httpServerIntegration` integration."))}}});function cw(e){return e.headers[`next-router-prefetch`]===`1`}function lw(e){let t=yf(e);return!!(t.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)||t.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/))}function uw(e,{ignoreStaticAssets:t,ignoreIncomingRequests:n}){if(fo())return!0;let r=e.url,i=e.method?.toUpperCase();return!!(i===`OPTIONS`||i===`HEAD`||!r||t&&i===`GET`&&lw(r)||n?.(r,e))}function dw(e){let t=fw(e.headers);return t==null?{}:pw(e.headers)?{"http.request_content_length":t}:{"http.request_content_length_uncompressed":t}}function fw(e){let t=e[`content-length`];if(t===void 0)return null;let n=parseInt(t,10);return isNaN(n)?null:n}function pw(e){let t=e[`content-encoding`];return!!t&&t!==`identity`}function mw(e,t,n){let{socket:r}=e,{statusCode:i,statusMessage:a}=t,o={[Dc]:i,[Ac]:i,"http.status_text":a?.toUpperCase()};if(r){let{localAddress:e,localPort:t,remoteAddress:n,remotePort:i}=r;o[qc]=e,o[Yc]=t,o[Xc]=n,o[Qc]=i}return o[Ac]=i,o[`http.status_text`]=(a||``).toUpperCase(),n?.type===iw.HTTP&&n.route!==void 0&&(o[Oc]=n.route),o}function hw(e,t){return t.some(t=>{if(typeof t==`number`)return t===e;let[n,r]=t;return e>=n&&e<=r})}var gw=class{emit(e){}enabled(){return!1}},_w=new gw,vw=Symbol.for(`io.opentelemetry.js.api.logs`),yw=globalThis;function bw(e,t,n){return r=>r===e?t:n}var xw=new class{getLogger(e,t,n){return new gw}},Sw=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):_w}},Cw=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new Sw(this,e,t,n)}_getDelegate(){return this._delegate??xw}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},ww=class e{constructor(){this._proxyLoggerProvider=new Cw}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return yw[vw]?this.getLoggerProvider():(yw[vw]=bw(1,e,xw),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return yw[vw]?.call(yw,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete yw[vw],this._proxyLoggerProvider=new Cw}}.getInstance();function Tw(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Ew(e){e.forEach(e=>e.disable())}x();function Dw(e){let t=e.tracerProvider||_.getTracerProvider(),n=e.meterProvider||se.getMeterProvider(),r=e.loggerProvider||ww.getLoggerProvider(),i=e.instrumentations?.flat()??[];return Tw(i,t,n,r),()=>{Ew(i)}}x();var Ow=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,kw=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Aw={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function jw(e,t,n){if(!Mw(e))return h.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,`$1`);let r=zw(e);if(!r)return!1;let i=[],a=Nw(r,t,i,n);return a&&!n?.includePrerelease?Iw(r,i):a}function Mw(e){return typeof e==`string`&&Ow.test(e)}function Nw(e,t,n,r){if(t.includes(`||`)){let i=t.trim().split(`||`);for(let t of i)if(Pw(e,t,n,r))return!0;return!1}if(t.includes(` - `))t=pT(t,r);else if(t.includes(` `)){let i=t.trim().replace(/\s{2,}/g,` `).split(` `);for(let t of i)if(!Pw(e,t,n,r))return!1;return!0}return Pw(e,t,n,r)}function Pw(e,t,n,r){if(t=Lw(t,r),t.includes(` `))return Nw(e,t,n,r);{let r=Bw(t);return n.push(r),Fw(e,r)}}function Fw(e,t){if(t.invalid)return!1;if(!t.version||Vw(t.version))return!0;let n=Gw(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],i=t.prereleaseSegments||[];n=!r.length&&!i.length?0:!r.length&&i.length?1:r.length&&!i.length?-1:Gw(r,i)}return Aw[t.op]?.includes(n)}function Iw(e,t){return!e.prerelease||t.some(t=>t.prerelease&&t.version===e.version)}function Lw(e,t){return e=e.trim(),e=dT(e,t),e=uT(e),e=fT(e,t),e=e.trim(),e}function Rw(e){return!e||e.toLowerCase()===`x`||e===`*`}function zw(e){let t=e.match(Ow);if(!t){h.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,i=t.groups.build,a=n.split(`.`),o=r?.split(`.`);return{op:void 0,version:n,versionSegments:a,versionSegmentCount:a.length,prerelease:r,prereleaseSegments:o,prereleaseSegmentCount:o?o.length:0,build:i}}function Bw(e){if(!e)return{};let t=e.match(kw);if(!t)return h.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,i=t.groups.prerelease,a=t.groups.build,o=r.split(`.`),s=i?.split(`.`);return n===`==`&&(n=`=`),{op:n||`=`,version:r,versionSegments:o,versionSegmentCount:o.length,prerelease:i,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:a}}function Vw(e){return e===`*`||e===`x`||e===`X`}function Hw(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Uw(e,t){if(typeof e==typeof t){if(typeof e==`number`||typeof e==`string`)return[e,t];throw Error(`Version segments can only be strings or numbers`)}return[String(e),String(t)]}function Ww(e,t){if(Vw(e)||Vw(t))return 0;let[n,r]=Uw(Hw(e),Hw(t));return n>r?1:n<r?-1:0}function Gw(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=Ww(e[n]||`0`,t[n]||`0`);if(r!==0)return r}return 0}var Kw=`[a-zA-Z0-9-]`,qw=`0|[1-9]\\d*`,Jw=`\\d*[a-zA-Z-]${Kw}*`,Yw=`((?:<|>)?=?)`,Xw=`(?:${qw}|${Jw})`,Zw=`(?:-(${Xw}(?:\\.${Xw})*))`,Qw=`${Kw}+`,$w=`(?:\\+(${Qw}(?:\\.${Qw})*))`,eT=`${qw}|x|X|\\*`,tT=`[v=\\s]*(${eT})(?:\\.(${eT})(?:\\.(${eT})(?:${Zw})?${$w}?)?)?`,nT=`^${Yw}\\s*${tT}$`,rT=new RegExp(nT),iT=`^\\s*(${tT})\\s+-\\s+(${tT})\\s*\$`,aT=new RegExp(iT),oT=`^(?:~>?)${tT}$`,sT=new RegExp(oT),cT=`^(?:\\^)${tT}$`,lT=new RegExp(cT);function uT(e){let t=sT;return e.replace(t,(e,t,n,r,i)=>{let a;return a=Rw(t)?``:Rw(n)?`>=${t}.0.0 <${+t+1}.0.0-0`:Rw(r)?`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:i?`>=${t}.${n}.${r}-${i} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${r} <${t}.${+n+1}.0-0`,a})}function dT(e,t){let n=lT,r=t?.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>{let o;return o=Rw(t)?``:Rw(n)?`>=${t}.0.0${r} <${+t+1}.0.0-0`:Rw(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.0${r} <${+t+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${+i+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${i}-${a} <${+t+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i}${r} <${t}.${n}.${+i+1}-0`:`>=${t}.${n}.${i}${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${i} <${+t+1}.0.0-0`,o})}function fT(e,t){let n=rT;return e.replace(n,(e,n,r,i,a,o)=>{let s=Rw(r),c=s||Rw(i),l=c||Rw(a),u=l;return n===`=`&&u&&(n=``),o=t?.includePrerelease?`-0`:``,s?e=n===`>`||n===`<`?`<0.0.0-0`:`*`:n&&u?(c&&(i=0),a=0,n===`>`?(n=`>=`,c?(r=+r+1,i=0,a=0):(i=+i+1,a=0)):n===`<=`&&(n=`<`,c?r=+r+1:i=+i+1),n===`<`&&(o=`-0`),e=`${n+r}.${i}.${a}${o}`):c?e=`>=${r}.0.0${o} <${+r+1}.0.0-0`:l&&(e=`>=${r}.${i}.0${o} <${r}.${+i+1}.0-0`),e})}function pT(e,t){let n=aT;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>(n=Rw(r)?``:Rw(i)?`>=${r}.0.0${t?.includePrerelease?`-0`:``}`:Rw(a)?`>=${r}.${i}.0${t?.includePrerelease?`-0`:``}`:o?`>=${n}`:`>=${n}${t?.includePrerelease?`-0`:``}`,c=Rw(l)?``:Rw(u)?`<${+l+1}.0.0-0`:Rw(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t?.includePrerelease?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()))}var mT=console.error.bind(console);function hT(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var gT=(e,t,n)=>{if(!e||!e[t]){mT(`no original function `+String(t)+` to wrap`);return}if(!n){mT(`no wrapper function`),mT(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){mT(`original object and wrapper must be functions`);return}let i=n(r,t);return hT(i,`__original`,r),hT(i,`__unwrap`,()=>{e[t]===i&&hT(e,t,r)}),hT(i,`__wrapped`,!0),hT(e,t,i),i},_T=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{mT(`must provide one or more modules to patch`),mT(Error().stack);return}if(!(t&&Array.isArray(t))){mT(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{gT(e,t,n)})})},vT=(e,t)=>{if(!e||!e[t]){mT(`no function to unwrap.`),mT(Error().stack);return}let n=e[t];if(!n.__unwrap)mT(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},yT=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{mT(`must provide one or more modules to patch`),mT(Error().stack);return}if(!(t&&Array.isArray(t))){mT(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{vT(e,t)})})};x();var bT=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=h.createComponentLogger({namespace:e}),this._tracer=_.getTracer(e,t),this._meter=se.getMeter(e,t),this._logger=ww.getLogger(e,t),this._updateMetricInstruments()}_wrap=gT;_unwrap=vT;_massWrap=_T;_massUnwrap=yT;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},xT=d(((e,t)=>{var n=c(`path`).sep;t.exports=function(e){var t=e.split(n),r=t.lastIndexOf(`node_modules`);if(r!==-1&&t[r+1]){for(var i=t[r+1][0]===`@`,a=i?t[r+1]+`/`+t[r+2]:t[r+1],o=i?3:2,s=``,c=r+o-1,l=0;l<=c;l++)s+=l===c?t[l]:t[l]+n;for(var u=``,d=t.length-1,f=r+o;f<=d;f++)u+=f===d?t[f]:t[f]+n;return{name:a,basedir:s,path:u}}}})),ST=d(((e,t)=>{var n=c(`path`),r=c(`module`),i=ce()(`require-in-the-middle`),a=xT();t.exports=d,t.exports.Hook=d;var o,s;if(r.isBuiltin)s=r.isBuiltin;else if(r.builtinModules)s=e=>e.startsWith(`node:`)?!0:(o===void 0&&(o=new Set(r.builtinModules)),o.has(e));else throw Error(`'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0`);var l=/([/\\]index)?(\.js)?$/,u=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol(`RitmExports`)}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{let t=c.cache[e];return!!(t&&this._kRitmExports in t)}}get(e,t){let n=this._localCache.get(e);if(n!==void 0)return n;if(!t){let t=c.cache[e];return t&&t[this._kRitmExports]}}set(e,t,n){n?this._localCache.set(e,t):e in c.cache?c.cache[e][this._kRitmExports]=t:(i(`non-core module is unexpectedly not in require.cache: "%s"`,e),this._localCache.set(e,t))}};function d(e,t,o){if(!(this instanceof d))return new d(e,t,o);if(typeof e==`function`?(o=e,e=null,t=null):typeof t==`function`&&(o=t,t=null),typeof r._resolveFilename!=`function`){console.error(`Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!`,typeof r._resolveFilename),console.error(`Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues`,process.version);return}this._cache=new u,this._unhooked=!1,this._origRequire=r.prototype.require;let l=this,p=new Set,m=t?t.internals===!0:!1,h=Array.isArray(e);i(`registering require hook`),this._require=r.prototype.require=function(e){return l._unhooked===!0?(i(`ignoring require call - module is soft-unhooked`),l._origRequire.apply(this,arguments)):g.call(this,arguments,!1)},typeof process.getBuiltinModule==`function`&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(e){return l._unhooked===!0?(i(`ignoring process.getBuiltinModule call - module is soft-unhooked`),l._origGetBuiltinModule.apply(this,arguments)):g.call(this,arguments,!0)});function g(t,u){let d=t[0],g=s(d),_;if(g){if(_=d,d.startsWith(`node:`)){let e=d.slice(5);s(e)&&(_=e)}}else if(u)return i(`call to process.getBuiltinModule with unknown built-in id`),l._origGetBuiltinModule.apply(this,t);else try{_=r._resolveFilename(d,this)}catch(e){return i(`Module._resolveFilename("%s") threw %j, calling original Module.require`,d,e.message),l._origRequire.apply(this,t)}let v,y;if(i(`processing %s module require('%s'): %s`,g===!0?`core`:`non-core`,d,_),l._cache.has(_,g)===!0)return i(`returning already patched cached module: %s`,_),l._cache.get(_,g);let ee=p.has(_);ee===!1&&p.add(_);let b=u?l._origGetBuiltinModule.apply(this,t):l._origRequire.apply(this,t);if(ee===!0)return i(`module is in the process of being patched already - ignoring: %s`,_),b;if(p.delete(_),g===!0){if(h===!0&&e.includes(_)===!1)return i(`ignoring core module not on whitelist: %s`,_),b;v=_}else if(h===!0&&e.includes(_)){let e=n.parse(_);v=e.name,y=e.dir}else{let t=a(_);if(t===void 0)return i(`could not parse filename: %s`,_),b;v=t.name,y=t.basedir;let r=f(t);i(`resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)`,v,d,r,y);let o=!1;if(h){if(!d.startsWith(`.`)&&e.includes(d)&&(v=d,o=!0),!e.includes(v)&&!e.includes(r))return b;e.includes(r)&&r!==v&&(v=r,o=!0)}if(!o){let e;try{e=c.resolve(v,{paths:[y]})}catch{return i(`could not resolve module: %s`,v),l._cache.set(_,b,g),b}if(e!==_){if(m===!0)v=v+n.sep+n.relative(y,_),i(`preparing to process require of internal file: %s`,v);else return i(`ignoring require of non-main module file: %s`,e),l._cache.set(_,b,g),b}}}l._cache.set(_,b,g),i(`calling require hook: %s`,v);let te=o(b,v,y);return l._cache.set(_,te,g),i(`returning module: %s`,v),te}}d.prototype.unhook=function(){this._unhooked=!0,this._require===r.prototype.require?(r.prototype.require=this._origRequire,i(`require unhook successful`)):i(`require unhook unsuccessful`),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,i(`process.getBuiltinModule unhook successful`)):i(`process.getBuiltinModule unhook unsuccessful`))};function f(e){let t=n.sep===`/`?e.path:e.path.split(n.sep).join(`/`);return n.posix.join(e.name,t).replace(l,``)}})),CT=class{hooks=[];children=new Map},wT=class{_trie=new CT;_counter=0;insert(e){let t=this._trie;for(let n of e.moduleName.split(`/`)){let e=t.children.get(n);e||(e=new CT,t.children.set(n,e)),t=e}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:n}={}){let r=this._trie,i=[],a=!0;for(let t of e.split(`/`)){let e=r.children.get(t);if(!e){a=!1;break}n||i.push(...e.hooks),r=e}return n&&a&&i.push(...r.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(t&&i.sort((e,t)=>e.insertedId-t.insertedId),i.map(({hook:e})=>e))}},TT=ST(),ET=[`afterEach`,`after`,`beforeEach`,`before`,`describe`,`it`].every(e=>typeof global[e]==`function`),DT=class e{_moduleNameTrie=new wT;static _instance;constructor(){this._initialize()}_initialize(){new TT.Hook(null,{internals:!0},(e,t,n)=>{let r=OT(t),i=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:r}of i)e=r(e,t,n);return e})}register(e,t){let n={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(n),n}static getInstance(){return ET?new e:this._instance=this._instance??new e}};function OT(e){return Ce.sep===`/`?e:e.split(Ce.sep).join(`/`)}var kT=d((e=>{var t=[],n=new WeakMap,r=new Map,i=[];function a(e,t){return t===`module.exports`&&!Object.hasOwn(e,t)?e.default:e[t]}function o(e,t,r){return n.get(e).write(t,r)}function s(e,t,n){if(!(`value`in n))throw Error(`Getters/setters are not supported for exports property descriptors.`);return o(e,t,n.value)}var c={defineProperty:s,set:o};function l(e,a,o){let{namespace:s}=a;r.set(e,o),n.set(s,a);let l=new Proxy(s,c);t.forEach(t=>t(e,l,o)),i.push([e,l,o])}var u=[0,10,50],d=class{namespace=Object.create(null,{[Symbol.toStringTag]:{value:`Module`}});#e=Object.create(null);#t;#n;#r;constructor(e,t,n,r){if(this.#t=n,t!==void 0)for(let n=0;n<t.length;n++)this.#i(t[n],n,r?.[n]??e)}#i(e,t,n){let r;try{r=a(n,e),this.#t(t,r),this.namespace[e]=r}catch(e){if(!(e instanceof ReferenceError))throw e}r===void 0&&(this.#r??=[]).push(this.#a(e,t,n)),this.#e[e]=t}write(e,t){let n=this.#e[e];return n!==void 0&&(this.#t(n,t),this.#r!==void 0&&(this.#n??=Object.create(null),this.#n[e]=!0),this.namespace[e]=t),!0}#a(e,t,n){return()=>{if(this.#n?.[e]===!0)return!0;try{let r=a(n,e);return r!==void 0&&(this.#t(t,r),this.namespace[e]=r,!0)}catch(e){if(e instanceof ReferenceError)return!1;throw e}}}#o(){let e=this.#r;if(e===void 0)return;let t;for(let n of e)n()!==!0&&(t??=[]).push(n);this.#r=t}flush(){this.#r!==void 0&&queueMicrotask(()=>{this.#o(),this.#s(0)})}#s(e){if(this.#r===void 0)return;if(e>=u.length){this.#r=void 0;return}let t=setTimeout(()=>{this.#o(),this.#s(e+1)},u[e]);t&&typeof t.unref==`function`&&t.unref()}};e.register=l,e.ModuleBinder=d,e.importHooks=t,e.specifiers=r,e.toHook=i})),AT=d(((e,t)=>{var n=c(`path`),r=xT(),{fileURLToPath:i}=c(`url`),{MessageChannel:a}=c(`worker_threads`),{isBuiltin:o}=c(`module`);o||=()=>!0;var{importHooks:s,specifiers:l,toHook:u}=kT();function d(e,t){if(!(process.env.TURBOPACK??process.argv.includes(`--turbo`)))return!1;let n=e.slice(0,e.lastIndexOf(`-`));return t.endsWith(n)}function f(e){s.push(e),u.forEach(([t,n,r])=>e(t,n,r))}function p(e){let t=s.indexOf(e);t>-1&&s.splice(t,1)}function m(e,t,n,r){let i=e(t,n,r);i&&i!==t&&`default`in t&&(t.default=i)}var h;function g(){let{port1:e,port2:t}=new a,n=0,r;h=t=>{n++,e.postMessage(t)},e.on(`message`,()=>{n--,r&&n<=0&&r()}).unref();function i(){let e=setInterval(()=>{},1e3),t=new Promise(e=>{r=e}).then(()=>{clearInterval(e)});return n===0&&r(),t}let o=t;return{registerOptions:{data:{addHookMessagePort:o,include:[]},transferList:[o]},addHookMessagePort:o,waitForAllMessagesAcknowledged:i}}function _(e,t,a){if(!(this instanceof _))return new _(e,t,a);typeof e==`function`?(a=e,e=null,t=null):typeof t==`function`&&(a=t,t=null);let s=t?t.internals===!0:!1;h&&Array.isArray(e)&&h(e),this._iitmHook=(t,c,u)=>{let f=t,p=f.startsWith(`node:`),h,g;if(p){let e=t.slice(5);o(e)&&(t=e)}else if(f.startsWith(`file://`)){let e=Error.stackTraceLimit;Error.stackTraceLimit=0;try{h=i(t),t=h}catch{}if(Error.stackTraceLimit=e,h){let e=r(h);e&&(t=e.name,g=e.basedir)}}if(e)for(let r of e)if(h&&r===h)m(a,c,h,void 0);else if(r===t){if(!g)m(a,c,t,g);else if(g.endsWith(l.get(f))||d(l.get(f),g))m(a,c,t,g);else if(s){let e=t+n.sep+n.relative(g,h);m(a,c,e,g)}}else r===u&&m(a,c,u,g);else m(a,c,t,g)},f(this._iitmHook)}_.prototype.unhook=function(){p(this._iitmHook)},t.exports=_,t.exports.Hook=_,t.exports.addHook=f,t.exports.removeHook=p,t.exports.createAddHookMessageChannel=g}));function jT(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function K(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var MT=AT();x();var q=class extends bT{_modules;_hooks=[];_requireInTheMiddleSingleton=DT.getInstance();_enabled=!1;constructor(e,t,n){super(e,t,n);let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_wrap=(e,t,n)=>{if(K(e[t])&&this._unwrap(e,t),be.isProxy(e)){let r=gT(Object.assign({},e),t,n);return Object.defineProperty(e,t,{value:r}),r}return gT(e,t,n)};_unwrap=(e,t)=>be.isProxy(e)?Object.defineProperty(e,t,{value:e[t]}):vT(e,t);_massWrap=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{h.error(`must provide one or more modules to patch`);return}if(!(t&&Array.isArray(t))){h.error(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{this._wrap(e,t,n)})})};_massUnwrap=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{h.error(`must provide one or more modules to patch`);return}if(!(t&&Array.isArray(t))){h.error(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{this._unwrap(e,t)})})};_warnOnPreloadedModules(){let e=globalThis.require;e?.resolve&&e?.cache&&this._modules.forEach(t=>{let{name:n}=t;try{let t=e.resolve(n);e.cache[t]?.loaded&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let t=Se(Ce.join(e,`package.json`),{encoding:`utf8`}),n=JSON.parse(t).version;return typeof n==`string`?n:void 0}catch{h.warn(`Failed extracting version`,e)}}_onRequire(e,t,n,r){if(!r)return typeof e.patch==`function`&&(e.moduleExports=t,this._enabled)?(this._diag.debug(`Applying instrumentation patch for nodejs core module on require hook`,{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(r);if(e.moduleVersion=i,e.name===n)return NT(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch==`function`&&(e.moduleExports=t,this._enabled)?(this._diag.debug(`Applying instrumentation patch for module on require hook`,{module:e.name,version:e.moduleVersion,baseDir:r}),e.patch(t,e.moduleVersion)):t;let a=e.files??[],o=Ce.normalize(n);return a.filter(t=>t.name===o&&NT(t.supportedVersions,i,e.includePrerelease)).reduce((t,n)=>(n.moduleExports=t,this._enabled?(this._diag.debug(`Applying instrumentation patch for nodejs module file on require hook`,{module:e.name,version:e.moduleVersion,fileName:n.name,baseDir:r}),n.patch(t,e.moduleVersion)):t),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch==`function`&&e.moduleExports&&(this._diag.debug(`Applying instrumentation patch for nodejs module on instrumentation enabled`,{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug(`Applying instrumentation patch for nodejs module file on instrumentation enabled`,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(t,n,r)=>{if(!r&&Ce.isAbsolute(n)){let e=Ce.parse(n);n=e.name,r=e.dir}return this._onRequire(e,t,n,r)},n=(t,n,r)=>this._onRequire(e,t,n,r),r=Ce.isAbsolute(e.name)?new TT.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(r);let i=new MT.Hook([e.name],{internals:!0},t);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch==`function`&&e.moduleExports&&(this._diag.debug(`Removing instrumentation patch for nodejs module on instrumentation disabled`,{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug(`Removing instrumentation patch for nodejs module file on instrumentation disabled`,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};function NT(e,t,n){return t===void 0?e.includes(`*`):e.some(e=>jw(t,e,{includePrerelease:n}))}var J=class{files;name;supportedVersions;patch;unpatch;constructor(e,t,n,r,i){this.files=i||[],this.name=e,this.supportedVersions=t,this.patch=n,this.unpatch=r}},PT=In(process.versions.node),FT=PT.major,IT=PT.minor;x();var LT=PT.major===22&&PT.minor>=12||PT.major===23&&PT.minor>=2||PT.major>=24;function RT(e={}){let{outgoingRequestApplyCustomAttributes:t,...n}=e,r={propagateTrace:n.propagateTraceInOutgoingRequests??!0,applyCustomAttributesOnSpan:t,...n,spans:n.createSpansForOutgoingRequests!==!1&&(n.spans??!0),ignoreOutgoingRequests(e,t){return fo()||!!n.ignoreOutgoingRequests?.(e,vC(t))},outgoingRequestHook(e,t){n.outgoingRequestHook?.(e,t);let r=t.once;t.once=new Proxy(r,{apply(t,n,r){let[i]=r;if(i!==`response`)return t.apply(n,r);let a=l.active(),o=_.setSpan(a,e);return l.with(o,()=>t.apply(n,r))}})},outgoingResponseHook(e,t){n.outgoingResponseHook?.(e,t)},errorMonitor:Ne,http:Ve};LT?BT(r):VT(r)}var zT;function BT(e){let{[gC]:t}=MC(e);zT&&Ue(gC,zT),He(gC,t),zT=t}function VT(e){IC(Ve,e)}var HT=`Http`;Object.assign(RT,{id:`${HT}.sentry`});var UT=W((e={})=>{let t=e.spans??!1,n=e.disableIncomingRequestSpans??!1,r=t&&!n,i={sessions:e.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:e.sessionFlushingDelayMS,ignoreRequestBody:e.ignoreIncomingRequestBody,maxRequestBodySize:e.maxIncomingRequestBodySize},a={ignoreIncomingRequests:e.ignoreIncomingRequests,ignoreStaticAssets:e.ignoreStaticAssets,ignoreStatusCodes:e.dropSpansForIncomingRequestStatusCodes},o={breadcrumbs:e.breadcrumbs,propagateTraceInOutgoingRequests:e.tracePropagation??!0,ignoreOutgoingRequests:e.ignoreOutgoingRequests,spans:t},s=nw(i),c=sw(a);return{name:HT,setup(e){r&&c.setup(e)},setupOnce(){s.setupOnce(),RT(o)},processEvent(e){return c.processEvent(e)}}}),WT=`sentry-trace`,GT=`baggage`,KT=`traceparent`;function qT(e,t,n){let r=tE(e.origin,e.path),{tracePropagationTargets:i,propagateTraceparent:a}=P()?.getOptions()||{};if(!kf(r,i,t))return;let o=n&&Co(n)&&R()?void 0:n,s=o?V(o,()=>Tf({propagateTraceparent:a})):Tf({propagateTraceparent:a});if(!s)return;let{"sentry-trace":c,baggage:l,traceparent:u}=s,d=Array.isArray(e.headers)?JT(e.headers):YT(e.headers);if(ZT(d,WT),ZT(d,GT),a&&ZT(d,KT),QT(d,WT)===-1){c&&d.push(WT,c),u&&QT(d,`traceparent`)===-1&&d.push(`traceparent`,u);let e=QT(d,GT);if(l&&e===-1)d.push(GT,l);else if(l){let t=d[e+1],n=hi(t,l);n&&(d[e+1]=n)}}Array.isArray(e.headers)?e.headers.splice(0,e.headers.length,...d):e.headers=XT(d)}function JT(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];n%2==0?t.push(typeof r==`string`?r:String(r)):t.push(Array.isArray(r)?r.join(`, `):r??``)}return t}function YT(e){let t=e.split(`\r
|
|
19
|
-
`),n=[];for(let e of t)try{let t=e.indexOf(`:`);if(t===-1)continue;let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();r&&n.push(r,i)}catch{A.warn(`Failed to convert string request header to array header: ${e}`)}return n}function XT(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1];r&&i!=null&&t.push(`${r}: ${i}`)}return t.length?t.join(`\r
|
|
20
|
-
`).concat(`\r
|
|
21
|
-
`):``}function ZT(e,t){let n=-1;for(let r=0;r<e.length;r+=2){if(e[r]!==t)continue;if(n===-1){n=r;continue}let i=e[n+1];if(t===GT&&i){let t=hi(e[r+1],i);t&&(e[n+1]=t)}e.splice(r,2),r-=2}}function QT(e,t){return e.findIndex((e,n)=>n%2==0&&e===t)}function $T(e,t){let n=eE(e),r=t.statusCode,i=pb(r);Gf({category:`http`,data:{status_code:r,...n},type:`http`,level:i},{event:`response`,request:e,response:t})}function eE(e){try{let t=vf(tE(e.origin,e.path)),n={url:bf(t),"http.method":e.method||`GET`};return t.search&&(n[`http.query`]=t.search),t.hash&&(n[`http.fragment`]=t.hash),n}catch{return{}}}function tE(e,t=`/`){try{return new URL(t,e).toString()}catch{let n=`${e}`;return n.endsWith(`/`)&&t.startsWith(`/`)?`${n}${t.slice(1)}`:!n.endsWith(`/`)&&!t.startsWith(`/`)?`${n}/${t}`:`${n}${t}`}}var nE=`http.request.method_original`,rE=[],iE=new WeakMap,aE=new WeakMap,oE=new hb(100);function sE(e={}){rE.length||(lE(`undici:request:create`,t=>dE(e,t)),lE(`undici:client:sendHeaders`,t=>fE(e,t)),lE(`undici:request:headers`,t=>pE(e,t)),lE(`undici:request:trailers`,e=>mE(e)),lE(`undici:request:error`,e=>hE(e)))}function cE(e,t){try{return e()}catch(e){t(e);return}}function lE(e,t){let[n=0,r=0]=process.version.replace(`v`,``).split(`.`).map(e=>Number(e));n>18||n===18&&r>=19?rE.push(Qe.subscribe?.(e,t)):rE.push(Qe.channel(e).subscribe(t))}function uE(e){let t=new Map;if(Array.isArray(e.headers))for(let n=0;n<e.headers.length;n+=2){let r=e.headers[n],i=e.headers[n+1];typeof r==`string`&&i!==void 0&&t.set(r.toLowerCase(),i)}else if(typeof e.headers==`string`){let n=e.headers.split(`\r
|
|
22
|
-
`);for(let e of n){if(!e)continue;let n=e.indexOf(`:`);if(n===-1)continue;let r=e.substring(0,n).toLowerCase(),i=e.substring(n+1).trim(),a=t.get(r);a&&Array.isArray(a)?a.push(i):a?t.set(r,[a,i]):t.set(r,i)}}return t}function dE(e,{request:t}){let n=_E(t.origin,t.path),r=cE(()=>!!e.ignoreOutgoingRequests?.(n),e=>e&&QC&&A.error(`caught ignoreOutgoingRequests error: `,e)),i=fo()||!!r;if(aE.set(t,i),!e.spans){e.tracePropagation!==!1&&!i&&qT(t,oE);return}if(t.method===`CONNECT`||r)return;let a;try{a=new Je(t.path,t.origin)}catch(e){QC&&A.warn(`could not determine url.full:`,e);return}let o=a.protocol.replace(`:`,``),s=gE(t.method),c={[Ec]:s,[nE]:t.method,[gl]:a.toString(),[_l]:a.pathname,[vl]:a.search,[yl]:o,[I]:`auto.http.otel.node_fetch`};if(n.startsWith(`data:`)){let e=xf(n);c[`http.url`]=e,c[gl]=e,c[Br]=`${t.method||`GET`} ${e}`}let l={https:`443`,http:`80`},u=a.hostname,d=a.port||l[o];c[fl]=u,d&&!isNaN(Number(d))&&(c[pl]=Number(d));let f=uE(t).get(`user-agent`);f&&(c[bl]=Array.isArray(f)?f[f.length-1]:f);let p=P(),m=B({name:s===`_OTHER`?`HTTP`:s,kind:G.CLIENT,attributes:c,onlyIfParent:!p||!Ya(p)});cE(()=>e.requestHook?.(m,t),e=>e&&QC&&A.error(`caught requestHook error: `,e)),qT(t,oE,m),iE.set(t,m)}function fE(e,{request:t,socket:n}){let r=iE.get(t);if(!r)return;let{remoteAddress:i,remotePort:a}=n,o={[Uc]:i,[Wc]:a};if(e.headersToSpanAttributes?.requestHeaders){let n=new Set(e.headersToSpanAttributes.requestHeaders.map(e=>e.toLowerCase())),r=uE(t);for(let[e,t]of r.entries())if(n.has(e)){let n=Array.isArray(t)?t:[t];o[`http.request.header.${e}`]=n}}r.setAttributes(o)}function pE(e,{request:t,response:n}){e.breadcrumbs!==!1&&!aE.get(t)&&$T(t,n);let r=iE.get(t);if(!r)return;let i={[Dc]:n.statusCode};if(cE(()=>e.responseHook?.(r,{request:t,response:n}),e=>e&&QC&&A.error(`caught responseHook error: `,e)),e.headersToSpanAttributes?.responseHeaders){let t=new Set;e.headersToSpanAttributes?.responseHeaders.forEach(e=>t.add(e.toLowerCase()));for(let e=0;e<n.headers.length;e+=2){let r=n.headers[e],a=n.headers[e+1];if(r===void 0||a===void 0)continue;let o=r.toString().toLowerCase(),s=a;if(t.has(o)){let e=`http.response.header.${o}`;Object.prototype.hasOwnProperty.call(i,e)?i[e].push(s.toString()):i[e]=[s.toString()]}}}r.setAttributes(i),n.statusCode>=400&&r.setStatus(Jr(n.statusCode))}function mE({request:e}){let t=iE.get(e);t&&(t.end(),iE.delete(e))}function hE({request:e,error:t}){let n=iE.get(e);n&&(n.setStatus({code:2,message:t.message}),n.end(),iE.delete(e))}function gE(e){return e.toUpperCase()in{CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0}?e.toUpperCase():`_OTHER`}function _E(e,t=`/`){let n=`${e}`;return n.endsWith(`/`)&&t.startsWith(`/`)?`${n}${t.slice(1)}`:!n.endsWith(`/`)&&!t.startsWith(`/`)?`${n}/${t}`:`${n}${t}`}var vE=W(((e={})=>({name:`NodeFetch`,setupOnce(){sE(e)}})));x();function yE(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){h.warn(`Unknown value ${ve(t)} for ${e}, expected a number, using defaults`);return}return n}function bE(e){let t=process.env[e];if(t!=null&&t.trim()!==``)return t}var xE=`[object Object]`,SE=`[object Null]`,CE=`[object Undefined]`,wE=Function.prototype.toString,TE=wE.call(Object),EE=Object.getPrototypeOf,DE=Object.prototype,OE=DE.hasOwnProperty,kE=Symbol?Symbol.toStringTag:void 0,AE=DE.toString;function jE(e){if(!ME(e)||NE(e)!==xE)return!1;let t=EE(e);if(t===null)return!0;let n=OE.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&wE.call(n)===TE}function ME(e){return typeof e==`object`&&!!e}function NE(e){return e==null?e===void 0?CE:SE:kE&&kE in Object(e)?PE(e):FE(e)}function PE(e){let t=OE.call(e,kE),n=e[kE],r=!1;try{e[kE]=void 0,r=!0}catch{}let i=AE.call(e);return r&&(t?e[kE]=n:delete e[kE]),i}function FE(e){return AE.call(e)}var IE=20;function LE(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=zE(t,e.shift(),0,n);return t}function RE(e){return VE(e)?e.slice():e}function zE(e,t,n=0,r){let i;if(!(n>IE)){if(n++,WE(e)||WE(t)||HE(t))i=RE(t);else if(VE(e)){if(i=e.slice(),VE(t))for(let e=0,n=t.length;e<n;e++)i.push(RE(t[e]));else if(UE(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r!==`__proto__`&&r!==`constructor`&&r!==`prototype`&&(i[r]=RE(t[r]))}}}else if(UE(e)){if(UE(t)){if(!GE(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(WE(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(BE(e,s,r)||BE(t,s,r))delete i[s];else{if(UE(a)&&UE(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=zE(i[s],c,n,r)}}}}else i=t}return i}}function BE(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function VE(e){return Array.isArray(e)}function HE(e){return typeof e==`function`}function UE(e){return!WE(e)&&!VE(e)&&!HE(e)&&typeof e==`object`}function WE(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function GE(e,t){return!(!jE(e)||!jE(t))}x();var KE=u(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function qE(e){return e.getValue(KE)===!0}x();function JE(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!YE(n)){h.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!XE(r)){h.warn(`Invalid attribute value set for key: ${n}`);continue}t[n]=Array.isArray(r)?r.slice():r}return t}function YE(e){return typeof e==`string`&&e!==``}function XE(e){return e==null?!0:Array.isArray(e)?ZE(e):QE(typeof e)}function ZE(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(QE(e)){t=e;continue}return!1}return!1}}return!0}function QE(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}x();function $E(){return e=>{h.error(eD(e))}}function eD(e){return typeof e==`string`?e:JSON.stringify(tD(e))}function tD(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var nD=$E();function rD(e){try{nD(e)}catch{}}var iD=`2.11.0`,aD=`process.runtime.name`;b();var oD={[g]:`opentelemetry`,[aD]:`node`,[ie]:ae,[ee]:iD},sD=performance,cD=9,lD=10**6,uD=10**cD;function dD(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*lD)]}function fD(e){return gD(dD(sD.timeOrigin),dD(typeof e==`number`?e:sD.now()))}function pD(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=uD),[n,r]}function mD(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function hD(e){return mD(e)||typeof e==`number`||e instanceof Date}function gD(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=uD&&(n[1]-=uD,n[0]+=1),n}var _D;function vD(){if(_D===void 0)try{let e=globalThis.process.argv0;_D=e?`unknown_service:${e}`:`unknown_service`}catch{_D=`unknown_service`}return _D}var yD=e=>typeof e==`object`&&!!e&&typeof e.then==`function`;x(),b();var bD=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=CD(t),r._asyncAttributesPending=t.filter(([e,t])=>yD(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(yD(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=CD(this._rawAttributes),this._schemaUrl=wD(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,yD(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&h.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(yD(n)){h.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=TD(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function xD(e,t){return bD.FromAttributeList(Object.entries(e),t)}function SD(){return xD({[te]:vD(),[ie]:oD[ie],[g]:oD[g],[ee]:oD[ee]})}function CD(e){return e.map(([e,t])=>yD(t)?[e,t.catch(t=>{h.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function wD(e){if(typeof e==`string`||e===void 0)return e;h.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function TD(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;h.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var ED=`exception`,DD=Symbol.for(`nodejs.util.inspect.custom`);function OD(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function kD(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}x(),b();var AD=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:oe.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=sD.now(),this._performanceOffset=t-(this._performanceStartTime+sD.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return h.warn(`Invalid attribute key: ${e}`),this;if(!XE(t))return h.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return h.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&h.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),hD(t)&&(hD(n)||(n=t),t=void 0);let i=JE(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&h.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=JE(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===oe.UNSET||this.status.code===oe.OK)return this;let t={code:e.code};return e.code===oe.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&h.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){h.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=pD(this.startTime,this.endTime),this._duration[0]<0&&(h.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&h.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&h.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=sD.now())return fD(e+this._performanceOffset);if(typeof e==`number`)return dD(e);if(e instanceof Date)return dD(e.getTime());if(mD(e))return e;if(this._startTimeProvided)return dD(Date.now());let t=sD.now()-this._performanceStartTime;return gD(this.startTime,dD(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[re]=e:e&&(e.code?n[m]=e.code.toString():e.name&&(n[m]=e.name),e.message&&(n[re]=e.message),e.stack&&(n[v]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(ED,n,t):h.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);h.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(h.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[DD](e,t,n){return kD(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:OD(this.resource)}},e,t,n)}},jD;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(jD||={});var MD=`otel.span.parent.origin`,ND=`otel.span.sampling_result`,PD=`otel.sdk.span.live`,FD=`otel.sdk.span.started`,ID=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(FD,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(PD,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=RD(t);if(this.startedSpans.add(1,{[MD]:LD(e),[ND]:n}),t===jD.NOT_RECORD)return()=>{};let r={[ND]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function LD(e){return e?e.isRemote?`remote`:`local`:`none`}function RD(e){switch(e){case jD.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case jD.RECORD:return`RECORD_ONLY`;case jD.NOT_RECORD:return`DROP`}}var zD=`2.11.0`;x();var BD=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor;let n=t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,zD);this._tracerMetrics=new ID(n)}startSpan(e,n={},r=l.active()){n.root&&(r=_.deleteSpan(r));let a=_.getSpan(r);if(qE(r))return h.debug(`Instrumentation suppressed, returning Noop Span`),_.wrapSpanContext(o);let c=a?.spanContext(),u=this._idGenerator.generateSpanId(),d,f,p;!c||!_.isSpanContextValid(c)?f=this._idGenerator.generateTraceId():(f=c.traceId,p=c.traceState,d=c);let m=n.kind??t.INTERNAL,g=(n.links??[]).map(e=>({context:e.context,attributes:JE(e.attributes)})),v=JE(n.attributes),y=this._sampler.shouldSample(r,f,e,m,v,g),ee=this._tracerMetrics.startSpan(c,y.decision);p=y.traceState??p;let b=y.decision===s.RECORD_AND_SAMPLED?i.SAMPLED:i.NONE,te={traceId:f,spanId:u,traceFlags:b,traceState:p};if(y.decision===s.NOT_RECORD)return h.debug(`Recording is off, propagating context in a non-recording span`),_.wrapSpanContext(te);let x=JE(Object.assign(v,y.attributes));return new AD({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:te,name:e,kind:m,links:g,parentSpanContext:d,attributes:x,startTime:n.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:ee})}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??l.active(),c=this.startSpan(e,i,s),u=_.setSpan(s,c);return l.with(u,o,void 0,c)}[DD](e,t,n){return kD(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:OD(this._resource)},spanLimits:this._spanLimits},e,t,n)}},VD=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{rD(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},HD=class{shouldSample(){return{decision:jD.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},UD=class{shouldSample(){return{decision:jD.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}};x();var WD=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(rD(Error(`ParentBasedSampler must have a root sampler configured`)),new UD),this._remoteParentSampled=e.remoteParentSampled??new UD,this._remoteParentNotSampled=e.remoteParentNotSampled??new HD,this._localParentSampled=e.localParentSampled??new UD,this._localParentNotSampled=e.localParentNotSampled??new HD}shouldSample(e,t,n,r,a,o){let s=_.getSpanContext(e);return!s||!y(s)?this._root.shouldSample(e,t,n,r,a,o):s.isRemote?s.traceFlags&i.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,a,o):this._remoteParentNotSampled.shouldSample(e,t,n,r,a,o):s.traceFlags&i.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,a,o):this._localParentNotSampled.shouldSample(e,t,n,r,a,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},GD=8,KD=16,qD=class{generateTraceId=YD(KD);generateSpanId=YD(GD)},JD=Buffer.allocUnsafe(KD);function YD(e){return function(){for(let t=0;t<e/4;t++)JD.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<e&&!(JD[t]>0);t++)t===e-1&&(JD[e-1]=1);return JD.toString(`hex`,0,e)}}x();var XD;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(XD||={});var ZD=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(t={}){this._forceFlushTimeoutMillis=t.forceFlushTimeoutMillis??3e4,this._resource=t.resource??SD();let n=t.spanProcessors??[];this._activeSpanProcessor=new VD(n),this._tracerOptions={resource:this._resource,sampler:t.sampler??new WD({root:new UD}),spanLimits:{attributeCountLimit:t.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:t.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:t.spanLimits?.eventCountLimit??128,linkCountLimit:t.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:t.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:t.spanLimits?.attributePerLinkCountLimit??128},idGenerator:t.idGenerator||new qD,spanProcessor:this._activeSpanProcessor,meterProvider:t.meterProvider??{getMeter(){return e()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new BD({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(e){let t=e?.timeoutMillis??this._forceFlushTimeoutMillis,n=this._activeSpanProcessor._spanProcessors.map(e=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${t} ms`)),r=XD.timeout},t);e.forceFlush().then(()=>{clearTimeout(i),r!==XD.timeout&&(r=XD.resolved,n(r))}).catch(e=>{clearTimeout(i),r=XD.error,n(e)})}));return new Promise((e,t)=>{Promise.all(n).then(n=>{let r=n.filter(e=>e!==XD.resolved);r.length>0?t(r):e()}).catch(e=>t([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[DD](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return kD(`TracerProvider`,{resource:{attributes:OD(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}};x();var QD=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=this._ratio===1?4294967296:Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:a(t)&&this._accumulate(t)<this._upperBound?jD.RECORD_AND_SAMPLED:jD.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}};x();var $D;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})($D||={});var eO=1;function tO(){return{sampler:nO(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:yE(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:yE(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:yE(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:yE(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:yE(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:yE(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:yE(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:yE(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}function nO(){let e=bE(`OTEL_TRACES_SAMPLER`)??$D.ParentBasedAlwaysOn;switch(e){case $D.AlwaysOn:return new UD;case $D.AlwaysOff:return new HD;case $D.ParentBasedAlwaysOn:return new WD({root:new UD});case $D.ParentBasedAlwaysOff:return new WD({root:new HD});case $D.TraceIdRatio:return new QD(rO());case $D.ParentBasedTraceIdRatio:return new WD({root:new QD(rO())});default:return h.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${$D.ParentBasedAlwaysOn}".`),new WD({root:new UD})}}function rO(){let e=yE(`OTEL_TRACES_SAMPLER_ARG`);return e==null?(h.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${eO}.`),eO):e<0||e>1?(h.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to ${eO}.`),eO):e}function iO(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??yE(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??yE(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??yE(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??yE(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,Object.assign({},e,{spanLimits:t})}var aO=class extends ZD{constructor(e={}){let t=LE({},tO(),iO(e));delete t.generalLimits,super(t)}};x();var oO=u(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function sO(e){return e.setValue(oO,!0)}function cO(e){return e.getValue(oO)===!0}var lO=`baggage`,uO=4096;x();function dO(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function fO(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function pO(e){if(!e)return;let t=e.indexOf(`;`),r=t===-1?e:e.substring(0,t),i=r.indexOf(`=`);if(i<=0)return;let a=r.substring(0,i).trim(),o=r.substring(i+1).trim();if(!a||!o)return;let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch{return}let l;if(t!==-1&&t<e.length-1){let r=e.substring(t+1);l=n(r)}return{key:s,value:c,metadata:l}}function mO(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=pO(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}x();var hO=class{inject(e,t,n){let r=p.getBaggage(e);if(!r||cO(e))return;let i=dO(fO(r).filter(e=>e.length<=uO).slice(0,180));i.length>0&&n.set(t,lO,i)}extract(e,t,n){let r=n.get(t,lO);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=mO(r[e],i,a,o);else[a]=mO(r,i,a,o);return a===0?e:p.setBaggage(e,p.createBaggage(i))}fields(){return[lO]}},gO=`2.11.0`,_O=`process.runtime.name`;b();var vO={[g]:`opentelemetry`,[_O]:`node`,[ie]:ae,[ee]:gO};x();var yO=`sentry.parentIsRemote`,bO=`sentry.graphql.operation`;function xO(e){if(`parentSpanId`in e)return e.parentSpanId;if(`parentSpanContext`in e)return e.parentSpanContext?.spanId}function SO(e){return j(e.attributes)}function CO(e){return typeof e.kind==`number`}function wO(e){return!!e.status}function TO(e){return!!e.name}function EO(e){if(!SO(e))return{};let t=e.attributes[`url.full`]||e.attributes[`http.url`],n={url:t,"http.method":e.attributes[`http.request.method`]||e.attributes[`http.method`]};!n[`http.method`]&&n.url&&(n[`http.method`]=`GET`);try{if(typeof t==`string`){let e=vf(t);n.url=bf(e),e.search&&(n[`http.query`]=e.search),e.hash&&(n[`http.fragment`]=e.hash)}}catch{}return n}function DO(e){return CO(e)?e.kind:t.INTERNAL}var OO=`sentry-trace`,kO=`baggage`,AO=`sentry.dsc`,jO=`sentry.sampled_not_recording`,MO=`sentry.url`,NO=`sentry.sample_rand`,PO=`sentry.sample_rate`,FO=`sentry.ignored`,IO=`sentry.segment_ignored`,LO=u(`sentry_scopes`),RO=u(`sentry_fork_isolation_scope`),zO=u(`sentry_fork_set_scope`),BO=u(`sentry_fork_set_isolation_scope`),VO=`_scopeContext`;function HO(e){return e.getValue(LO)}function UO(e,t){return e.setValue(LO,t)}function WO(e,t){Jt(e,VO,Zn(t))}function GO(e){return Qn(e[VO])}function KO(e){let{traceFlags:t,traceState:n}=e,r=n?n.get(jO)===`1`:!1;if(t===i.SAMPLED)return!0;if(r)return!1;let a=n?n.get(AO):void 0,o=a?ui(a):void 0;if(o?.sampled===`true`)return!0;if(o?.sampled===`false`)return!1}function qO(e,t){let n=e.spanContext(),r=ra(e),i=KO(n);if(i!==void 0)return i;if(Co(r))return!1;if(sa(t?.getOptions())&&!n.isRemote&&Ji(r))return Yi(e)}function JO(e,t,n){let r=t[`http.request.method`]||t[`http.method`];if(r)return ZO({attributes:t,name:e,kind:n},r);let i=t[`db.system.name`]||t[`db.system`],a=typeof t[`sentry.op`]==`string`&&t[`sentry.op`].startsWith(`cache.`);if(i&&!a)return XO({attributes:t,name:e});let o=t[`sentry.source`]===`custom`?`custom`:`route`;if(t[`rpc.service`])return{...ek(e,t,`route`),op:`rpc`};if(t[`messaging.system`])return{...ek(e,t,o),op:`message`};let s=t[Ys];return s?{...ek(e,t,o),op:s.toString()}:{op:void 0,description:e,source:`custom`}}function YO(e){let t,n;if(SO(e))t=e.attributes,n=TO(e)?e.name:`<unknown>`;else{let r=typeof e.spanContext==`function`?L(e):void 0;t=r?.data||{},n=TO(e)?e.name:r?.description||`<unknown>`}let r=DO(e);return JO(n,t,r)}function XO({attributes:e,name:t}){let n=e[Br];if(typeof n==`string`)return{op:`db`,description:n,source:e[`sentry.source`]||`custom`};if(e[`sentry.source`]===`custom`)return{op:`db`,description:t,source:`custom`};let r=e[zs];return{op:`db`,description:r?r.toString():t,source:`task`}}function ZO({name:e,kind:n,attributes:r},i){let a=[`http`];switch(n){case t.CLIENT:a.push(`client`);break;case t.SERVER:a.push(`server`)}r[`sentry.http.prefetch`]&&a.push(`prefetch`);let{urlPath:o,url:s,query:c,fragment:l,hasRoute:u}=$O(r,n);if(!o)return{...ek(e,r),op:a.join(`.`)};let d=r[bO],f=`${i} ${o}`,p=d?`${f} (${QO(d)})`:f,m=u||o===`/`?`route`:`url`,h={};s&&(h.url=s),c&&(h[`http.query`]=c.slice(1)),l&&(h[`http.fragment`]=l.slice(1));let g=n===t.CLIENT||n===t.SERVER,_=!`${r[`sentry.origin`]||`manual`}`.startsWith(`auto`),v=r[kr]===`custom`,y=r[Br],{description:ee,source:b}=!v&&y==null&&(g||!_)?{description:p,source:m}:ek(e,r);return{op:a.join(`.`),description:ee,source:b,data:h}}function QO(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(`, `):`${t.slice(0,5).join(`, `)}, +${t.length-5}`}return`${e}`}function $O(e,n){let r=e[jc],i=e[`http.url`]||e[`url.full`],a=e[Oc],o=typeof i==`string`?vf(i):void 0,s=o?bf(o):void 0,c=o?.search||void 0,l=o?.hash||void 0;return typeof a==`string`?{urlPath:a,url:s,query:c,fragment:l,hasRoute:!0}:n===t.SERVER&&typeof r==`string`?{urlPath:yf(r),url:s,query:c,fragment:l,hasRoute:!1}:o?{urlPath:s,url:s,query:c,fragment:l,hasRoute:!1}:typeof r==`string`?{urlPath:yf(r),url:s,query:c,fragment:l,hasRoute:!1}:{urlPath:void 0,url:s,query:c,fragment:l,hasRoute:!1}}function ek(e,t,n=`custom`){let r=t[`sentry.source`]||n,i=t[Br];return i&&typeof i==`string`?{description:i,source:r}:{description:e,source:r}}function tk(e){e.on(`createDsc`,(t,n)=>{if(!n)return;let r=L(n),i=r.data[kr],a=qO(n,e);if(a===!1)delete t.transaction;else if(r.description){let{description:e}=YO(n);i!==`url`&&e&&(t.transaction=e)}sa()&&(t.sampled=a==null?void 0:String(a))})}function nk(){return _.getActiveSpan()}var rk=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,ik=class e{constructor(){this._internalState=new Map}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reverse().map(e=>`${e}=${this._internalState.get(e)}`).join(`,`)}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}};function ak({dsc:e,sampled:t}){let n=e?di(e):void 0,r=new ik,i=n?r.set(AO,n):r;return t===!1?i.set(jO,`1`):i}var ok=new Set;function sk(){return Array.from(ok)}function ck(e){ok.add(e)}var lk=class extends hO{constructor(){super(),ck(`SentryPropagator`),this._urlMatchesTargetsMap=new hb(100)}inject(e,t,n){if(cO(e)){rk&&A.log(`[Tracing] Not injecting trace data for url because tracing is suppressed.`);return}let r=_.getSpan(e),i=r&&gk(r),{tracePropagationTargets:a,propagateTraceparent:o}=P()?.getOptions()||{};if(!kf(i,a,this._urlMatchesTargetsMap)){rk&&A.log(`[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:`,i);return}let s=mk(t),c=hk(t),l=p.getBaggage(e)||p.createBaggage({}),{dynamicSamplingContext:u,traceId:d,spanId:f,sampled:m}=uk(e);if(s){let e=fi(s);e&&Object.entries(e).forEach(([e,t])=>{(c||!e.startsWith(`sentry-`))&&(l=l.setEntry(e,{value:t}))})}!c&&u&&(l=Object.entries(u).reduce((e,[t,n])=>n?e.setEntry(`${li}${t}`,{value:n}):e,l)),!c&&d&&d!==`00000000000000000000000000000000`&&(n.set(t,OO,ji(d,f,m)),o&&n.set(t,`traceparent`,Mi(d,f,m))),super.inject(p.setBaggage(e,l),t,n)}extract(e,t,n){let r=n.get(t,OO),i=n.get(t,kO);return pk(dk(e,{sentryTrace:r?Array.isArray(r)?r[0]:r:void 0,baggage:i}))}fields(){return[OO,kO,`traceparent`]}};function uk(e,t={}){let n=_.getSpan(e);if(n?.spanContext().isRemote){let e=n.spanContext();return{dynamicSamplingContext:xa(n),traceId:e.traceId,spanId:void 0,sampled:KO(e)}}if(n){let e=n.spanContext();return{dynamicSamplingContext:xa(n),traceId:e.traceId,spanId:e.spanId,sampled:qO(n,t.client)}}let r=t.scope||HO(e)?.scope||M(),i=t.client||P(),a=r.getPropagationContext();return{dynamicSamplingContext:i?ba(i,r):void 0,traceId:a.traceId,spanId:a.propagationSpanId,sampled:a.sampled}}function dk(e,{sentryTrace:t,baggage:n}){let{traceId:r,parentSpanId:i,sampled:a,dsc:o}=Ai(t,n),s=P(),c=ui(n);if(!i||s&&!Pi(s,c?.org_id))return e;let l=_k({traceId:r,spanId:i,sampled:a,dsc:o});return _.setSpanContext(e,l)}function fk(e,t,n){let r=pk(dk(e,t));return l.with(r,n)}function pk(e){let t=HO(e);return UO(e,{scope:t?t.scope:M().clone(),isolationScope:t?t.isolationScope:N()})}function mk(e){try{let t=e[kO];return Array.isArray(t)?t.join(`,`):t}catch{return}}function hk(e){try{return e[OO]}catch{return}}function gk(e){let t=L(e).data,n=t[`http.url`]||t[`url.full`];if(typeof n==`string`)return n;let r=e.spanContext().traceState?.get(MO);if(r)return r}function _k({spanId:e,traceId:t,sampled:n,dsc:r}){let a=ak({dsc:r,sampled:n});return{traceId:t,spanId:e,isRemote:!0,traceFlags:n?i.SAMPLED:i.NONE,traceState:a}}function vk(e,t,n){let r=Ck(),{name:i,parentSpan:a}=e;return Mk(a)(()=>{let a=Dk(e.scope,e.forceTransaction),o=e.onlyIfParent&&!_.getSpan(a),s=o?sO(a):a;o&&P()?.recordDroppedEvent(`no_parent_span`,`span`);let c=wk(e);if(!sa()){let e=cO(s)?s:sO(s);return l.with(e,()=>r.startActiveSpan(i,c,e,e=>(Ek(e),l.with(a,()=>no(()=>t(e),()=>{L(e).status===void 0&&e.setStatus({code:oe.ERROR})},n?()=>e.end():void 0)))))}return r.startActiveSpan(i,c,s,e=>(Ek(e),no(()=>t(e),()=>{L(e).status===void 0&&e.setStatus({code:oe.ERROR})},n?()=>e.end():void 0)))})}function yk(e,t){return vk(e,t,!0)}function bk(e,t){return vk(e,e=>t(e,()=>e.end()),!1)}function xk(e){let t=Ck(),{name:n,parentSpan:r}=e;return Mk(r)(()=>{let r=Dk(e.scope,e.forceTransaction),i=e.onlyIfParent&&!_.getSpan(r),a=i?sO(r):r;i&&P()?.recordDroppedEvent(`no_parent_span`,`span`);let o=wk(e);sa()||(a=cO(a)?a:sO(a));let s=t.startSpan(n,o,a);return Ek(s),s})}function Sk(e,t){let n=e?_.setSpan(l.active(),e):_.deleteSpan(l.active());return l.with(n,()=>t(M()))}function Ck(){return P()?.tracer||_.getTracer(`@sentry/opentelemetry`,`10.74.0`)}function wk(e){let{startTime:t,attributes:n,kind:r,op:i,links:a}=e,o=typeof t==`number`?Tk(t):t;return{attributes:i?{[F]:i,...n}:n,kind:r,links:a,startTime:o}}function Tk(e){return e<9999999999?e*1e3:e}function Ek(e){let t=e.end.bind(e);e.end=e=>t(typeof e==`number`?Tk(e):e)}function Dk(e,t){let n=Ok(e),r=_.getSpan(n);if(!r||!t)return n;let a=_.deleteSpan(n),{spanId:o,traceId:s}=r.spanContext(),c=KO(r.spanContext()),l=ak({dsc:xa(ra(r)),sampled:c}),u={traceId:s,spanId:o,isRemote:!0,traceFlags:c?i.SAMPLED:i.NONE,traceState:l};return _.setSpanContext(a,u)}function Ok(e){if(e){let t=GO(e);if(t)return t}return l.active()}function kk(e,t){return fk(l.active(),e,t)}function Ak(e){let t=Yn(),n={traceId:t,spanId:Xn(),isRemote:!0,traceFlags:i.NONE},r=_.setSpanContext(l.active(),n);return l.with(r,()=>(M().setPropagationContext({traceId:t,sampleRand:rn()}),e()))}function jk(e,t){let n=GO(t),r=n&&_.getSpan(n),i=r?Li(r):Or(t);return[r?xa(r):ba(e,t),i]}function Mk(e){return e===void 0?e=>e():t=>Sk(e,t)}function Nk(e){let t=sO(l.active());return l.with(t,e)}function Pk(e){let t=e?GO(e):l.active();return t?cO(t):!1}function Fk(e){e.on(`preprocessEvent`,e=>{let t=nk();return!t||e.type===`transaction`?void 0:(e.contexts={trace:Li(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:xa(ra(t)),...e.sdkProcessingMetadata},e)})}function Ik(e,t){let n=_.getSpan(e),r;if(n?.spanContext().traceState?.get(`sentry.ignored`)===`1`){let n=_.deleteSpan(e),i=_.getSpan(t);r=i?_.setSpan(n,i):n}else r=e;let i=HO(r),a=i?.scope||M(),o=i?.isolationScope||N(),s=r.getValue(RO)===!0,c=r.getValue(zO),l=r.getValue(BO),u=c||a.clone(),d={scope:u,isolationScope:l||(s?o.clone():o)},f=UO(r,d).deleteValue(RO).deleteValue(zO).deleteValue(BO);return WO(u,f),f}function Lk(e){let t=new Map;for(let n of e)zk(t,n);return Array.from(t,function([e,t]){return t})}function Rk(e){return e.attributes[yO]===!0?void 0:xO(e)}function zk(e,t){let n=t.spanContext().spanId,r=Rk(t);if(!r){Vk(e,{id:n,span:t,children:[]});return}let i=Bk(e,r),a=Vk(e,{id:n,span:t,parentNode:i,children:[]});i.children.push(a)}function Bk(e,t){return e.get(t)||Vk(e,{id:t,children:[]})}function Vk(e,t){let n=e.get(t.id);return n?.span?n:n&&!n.span?(n.span=t.span,n.parentNode=t.parentNode,n):(e.set(t.id,t),t)}var Hk={1:`cancelled`,2:`unknown_error`,3:`invalid_argument`,4:`deadline_exceeded`,5:`not_found`,6:`already_exists`,7:`permission_denied`,8:`resource_exhausted`,9:`failed_precondition`,10:`aborted`,11:`out_of_range`,12:`unimplemented`,13:`internal_error`,14:`unavailable`,15:`data_loss`,16:`unauthenticated`},Uk=e=>Object.values(Hk).includes(e);function Wk(e){let t=SO(e)?e.attributes:{},n=wO(e)?e.status:void 0;if(n){if(n.code===oe.OK)return{code:1};if(n.code===oe.ERROR){if(n.message===void 0){let e=Gk(t);if(e)return e}return n.message&&Uk(n.message)?{code:2,message:n.message}:{code:2,message:`internal_error`}}}return Gk(t)||(n?.code===oe.UNSET?{code:1}:{code:2,message:`unknown_error`})}function Gk(e){let t=e[`http.response.status_code`]||e[`http.status_code`],n=e[el],r=typeof t==`number`?t:typeof t==`string`?parseInt(t):void 0;if(typeof r==`number`)return Jr(r);if(typeof n==`string`)return{code:2,message:Hk[n]||`unknown_error`}}var Kk=1e3,qk=300,Jk=1e4,Yk=class{constructor(e){this._finishedSpanBucketSize=e?.timeout||qk,this._finishedSpanBuckets=Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(an()/1e3),this._spansToBucketEntry=new WeakMap,this._sentSpans=new hb(Jk),this._debouncedFlush=wo(this.flush.bind(this),1,{maxWait:100})}export(e){let t=Math.floor(an()/1e3);if(this._lastCleanupTimestampInS!==t){let e=0;this._finishedSpanBuckets.forEach((n,r)=>{n&&n.timestampInS<=t-this._finishedSpanBucketSize&&(e+=n.spans.size,this._finishedSpanBuckets[r]=void 0)}),e>0&&rk&&A.log(`SpanExporter dropped ${e} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=t}let n=t%this._finishedSpanBucketSize,r=this._finishedSpanBuckets[n]||{timestampInS:t,spans:new Set};this._finishedSpanBuckets[n]=r,r.spans.add(e),this._spansToBucketEntry.set(e,r);let i=Rk(e);(!i||this._sentSpans.get(i))&&this._debouncedFlush()}flush(){let e=this._finishedSpanBuckets.flatMap(e=>e?Array.from(e.spans):[]),t=this._maybeSend(e),n=t.size,r=e.length-n;rk&&A.log(`SpanExporter exported ${n} spans, ${r} spans are waiting for their parent spans to finish`);for(let e of t){this._sentSpans.set(e.spanContext().spanId,1);let t=this._spansToBucketEntry.get(e);t&&t.spans.delete(e)}this._debouncedFlush.cancel()}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._sentSpans.clear(),this._debouncedFlush.cancel()}_maybeSend(e){let t=Lk(e),n=new Set,r=this._getCompletedRootNodes(t);for(let e of r){let t=e.span;n.add(t);let r=Zk(t);if(e.parentNode&&this._sentSpans.get(e.parentNode.id)){let e=r.contexts?.trace?.data;e&&(e[`sentry.parent_span_already_sent`]=!0)}let i=r.spans||[],a=!1;for(let t of e.children)Qk(t,i,n)&&(a=!0);r.spans=i.length>Kk?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,Kk):i,a&&(r.sdkProcessingMetadata={...r.sdkProcessingMetadata,hasGenAiSpans:!0});let o=Ka(t.events);o&&(r.measurements=o),Ql(r)}return n}_nodeIsCompletedRootNodeOrHasSentParent(e){return!!e.span&&(!e.parentNode||!!this._sentSpans.get(e.parentNode.id))}_getCompletedRootNodes(e){return e.filter(e=>this._nodeIsCompletedRootNodeOrHasSentParent(e))}};function Xk(e){let t=e.attributes;return{origin:t[I],op:t[F],source:t[kr]}}function Zk(e){let{op:t,description:n,data:r,origin:i=`manual`,source:a}=$k(e),o=ni(e),s=e.attributes[Ar],c={[kr]:a,[Ar]:s,[F]:t,[I]:i,...r,...eA(e.attributes)},{links:l}=e,{traceId:u,spanId:d}=e.spanContext(),f={parent_span_id:xO(e),span_id:d,trace_id:u,data:c,origin:i,op:t,status:Xi(Wk(e)),links:Bi(l)},p=c[Dc],m=typeof p==`number`?{response:{status_code:p}}:void 0;return{contexts:{trace:f,otel:{resource:e.resource.attributes},...m},spans:[],start_timestamp:Hi(e.startTime),timestamp:Hi(e.endTime),transaction:n,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:o.scope,capturedSpanIsolationScope:o.isolationScope,sampleRate:s,dynamicSamplingContext:xa(e)},...a&&{transaction_info:{source:a}}}}function Qk(e,t,n){let r=e.span;if(r&&n.add(r),!r){let r=!1;return e.children.forEach(e=>{Qk(e,t,n)&&(r=!0)}),r}let i=r.spanContext().spanId,a=r.spanContext().traceId,o=xO(r),{attributes:s,startTime:c,endTime:l,links:u}=r,{op:d,description:f,data:p,origin:m=`manual`}=$k(r),h={[I]:m,[F]:d,...eA(s),...p},g=Wk(r),_={span_id:i,trace_id:a,data:h,description:f,parent_span_id:o,start_timestamp:Hi(c),timestamp:Hi(l)||void 0,status:Xi(g),op:d,origin:m,measurements:Ka(r.events),links:Bi(u)};t.push(_);let v=!!d?.startsWith(`gen_ai.`);return e.children.forEach(e=>{Qk(e,t,n)&&(v=!0)}),v}function $k(e){let{op:t,source:n,origin:r}=Xk(e),{op:i,description:a,source:o,data:s}=YO(e);return{op:t||i,description:a,source:n||o,origin:r,data:{...s,...tA(e)}}}function eA(e){let t={...e};return delete t[Ar],delete t[yO],delete t[Br],t}function tA(e){let n=e.attributes,r={};e.kind!==t.INTERNAL&&(r[`otel.kind`]=t[e.kind]);let i=n[Ac];i&&(r[Dc]=i);let a=EO(e);return a.url&&(r.url=a.url),a[`http.query`]&&(r[`http.query`]=a[`http.query`].slice(1)),a[`http.fragment`]&&(r[`http.fragment`]=a[`http.fragment`].slice(1)),r}function nA(e,t){let n=e.attributes??{},r=t?.spanKind??G.INTERNAL,{op:i,description:a,source:o,data:s}=JO(e.name,n,r);e.name=a,Cl(e,{[F]:i,[kr]:o,[ol]:`manual`,...s}),r!==G.INTERNAL&&Cl(e,{"otel.kind":Uf(r)})}var rA=class{constructor(e){this._unsubscribePreprocessSpan=void 0,ck(`SentrySpanProcessor`),this._exporter=new Yk(e),this._client=e?.client??P(),this._client&&Ya(this._client)&&(this._unsubscribePreprocessSpan=this._client.on(`preprocessSpan`,nA))}async forceFlush(){this._exporter.flush()}async shutdown(){this._unsubscribePreprocessSpan?.(),this._exporter.clear()}onStart(e,t){let n=_.getSpan(t),i=HO(t);n&&!n.spanContext().isRemote&&ta(n,e),n?.spanContext().isRemote&&e.setAttribute(yO,!0),t===r&&(i={scope:ir(),isolationScope:ar()}),i&&ti(e,i.scope,i.isolationScope),Ua(e),this._client?.emit(`spanStart`,e)}onEnd(e){Wa(e),this._client?.emit(`spanEnd`,e),this._client&&Ya(this._client)?this._client.emit(`afterSpanEnd`,e):this._exporter.export(e)}},iA=class{constructor(e){this._client=e,this._isSpanStreaming=Ya(e),ck(`SentrySampler`)}shouldSample(e,n,r,i,a,o){let s=this._client.getOptions(),{ignoreSpans:c}=s,l=cA(e),u=l?.spanContext();if(!sa(s))return oA({decision:void 0,context:e,spanAttributes:a});let d=a[`http.method`]||a[`http.request.method`];if(i===t.CLIENT&&d&&(!l||u?.isRemote)&&!this._isSpanStreaming)return this._client.recordDroppedEvent(`no_parent_span`,`span`),oA({decision:void 0,context:e,spanAttributes:a});let f=l?aA(l,n,r):void 0;if(l&&!u?.isRemote){if(this._isSpanStreaming){if(f&&c?.length){let{description:t,op:n}=JO(r,a,i);if(la({description:t,op:a[`sentry.op`]??n,attributes:a},c))return this._client.recordDroppedEvent(`ignored`,`span`),oA({decision:jD.NOT_RECORD,context:e,spanAttributes:a,ignoredChildSpan:!0})}if(!f){let e=u?.traceState?.get(IO)===`1`;this._client.recordDroppedEvent(e?`ignored`:`sample_rate`,`span`)}}return oA({decision:f?jD.RECORD_AND_SAMPLED:jD.NOT_RECORD,context:e,spanAttributes:a})}let{description:p,data:m,op:h}=JO(r,a,i),g={...m,...a};if(h&&(g[F]=h),this._isSpanStreaming&&c?.length&&la({description:p,op:g[`sentry.op`]??h,attributes:g},c))return this._client.recordDroppedEvent(`ignored`,`span`),oA({decision:jD.NOT_RECORD,context:e,spanAttributes:a,ignoredSegmentSpan:!0});let _={decision:!0};if(this._client.emit(`beforeSampling`,{spanAttributes:g,spanName:p,parentSampled:f,parentContext:u},_),!_.decision)return oA({decision:void 0,context:e,spanAttributes:a});let{isolationScope:v}=HO(e)??{},y=u?.traceState?u.traceState.get(AO):void 0,ee=y?ui(y):void 0,b=Ei(ee?.sample_rand)??rn(),[te,x,ne]=io(s,{name:p,attributes:g,normalizedRequest:v?.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampled:f,parentSampleRate:Ei(ee?.sample_rate)},b),re=`${d}`.toUpperCase();return re===`OPTIONS`||re===`HEAD`?(rk&&A.log(`[Tracing] Not sampling span because HTTP method is '${re}' for ${r}`),oA({decision:jD.NOT_RECORD,context:e,spanAttributes:a,sampleRand:b,downstreamTraceSampleRate:0})):(!te&&f===void 0&&(rk&&A.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),this._client.recordDroppedEvent(`sample_rate`,this._isSpanStreaming?`span`:`transaction`)),{...oA({decision:te?jD.RECORD_AND_SAMPLED:jD.NOT_RECORD,context:e,spanAttributes:a,sampleRand:b,downstreamTraceSampleRate:ne?x:void 0}),attributes:{[Ar]:ne?x:void 0}})}toString(){return`SentrySampler`}};function aA(e,t,n){let r=e.spanContext();if(y(r)&&r.traceId===t){if(r.isRemote){let t=KO(e.spanContext());return rk&&A.log(`[Tracing] Inheriting remote parent's sampled decision for ${n}: ${t}`),t}let t=KO(r);return rk&&A.log(`[Tracing] Inheriting parent's sampled decision for ${n}: ${t}`),t}}function oA({decision:e,context:t,spanAttributes:n,sampleRand:r,downstreamTraceSampleRate:i,ignoredChildSpan:a,ignoredSegmentSpan:o}){let s=sA(t,n);return i!==void 0&&(s=s.set(PO,`${i}`)),r!==void 0&&(s=s.set(NO,`${r}`)),a&&(s=s.set(FO,`1`)),o&&(s=s.set(IO,`1`)),e==null?{decision:jD.NOT_RECORD,traceState:s}:e===jD.NOT_RECORD?{decision:e,traceState:s.set(jO,`1`)}:{decision:e,traceState:s}}function sA(e,t){let n=_.getSpan(e)?.spanContext()?.traceState||new ik,r=t[`http.url`]||t[`url.full`];return r&&typeof r==`string`&&(n=n.set(MO,r)),n}function cA(e){let t=_.getSpan(e);return t&&y(t.spanContext())?t:void 0}function lA(e,n={}){let r=L(e),i=r.data,a=e.kind??t.INTERNAL,o=ii(e),s=i[Br]!==void 0,c=o&&!s&&!oi(e),l=c&&i[`sentry.source`]===`custom`?{...i,[kr]:void 0}:i,u=JO(r.description||`<unknown>`,l,a);if(a!==t.INTERNAL&&i[`otel.kind`]===void 0&&e.setAttribute(`otel.kind`,t[a]),u.op&&i[`sentry.op`]===void 0&&e.setAttribute(F,u.op),u.source!==void 0&&u.source!==`custom`&&(n.finalizeStatus||u.source!==`url`)&&(r.parent_span_id===void 0||a===t.SERVER)&&(i[`sentry.source`]===void 0||c)&&e.setAttribute(kr,u.source),u.data&&Object.entries(u.data).forEach(([t,n])=>{n!==void 0&&i[t]===void 0&&e.setAttribute(t,n)}),n.finalizeStatus){fA(e,i);let t=P();dA(e,i,r.status,!!t&&Ya(t))}o&&u.description!==r.description&&(i[`sentry.source`]!==`custom`||c)&&e.updateName(u.description)}function uA(e,n){Jt(e,`kind`,n??t.INTERNAL)}function dA(e,t,n,r){if(n===void 0){e.setStatus(Gk(t)||{code:1});return}!r&&n!==`ok`&&!Uk(n)&&e.setStatus({code:2,message:`internal_error`})}function fA(e,t){let n=t[Ac];t[`http.response.status_code`]===void 0&&n!==void 0&&(e.setAttribute(Dc,n),t[Dc]=n)}var pA=class{startSpan(e,t={},n){let r=n||l.active(),i=t.root?void 0:_.getSpan(r);if(cO(r))return this._createNonRecordingSpan(i);let a=this._startSentrySpan(e,t,i,n!==void 0);return si(a),uA(a,t.kind),t.attributes?.[`sentry.source`]===void 0&&ri(a),lA(a),a}startActiveSpan(e,t,n,r){let i=typeof t==`function`?{}:t,a=typeof n==`function`||n===void 0?l.active():n,o=typeof t==`function`?t:typeof n==`function`?n:r,s=this.startSpan(e,i,a),c=ni(s).isolationScope,u=e=>c?e.setValue(BO,c):e;return Co(s)&&_.getSpan(a)?l.with(u(a),()=>o(s)):l.with(u(_.setSpan(a,s)),()=>(er(M(),s),o(s)))}_startSentrySpan(e,t,n,r){let i={name:e,attributes:t.attributes,links:t.links,startTime:t.startTime};return t.root?po(()=>so({...i,parentSpan:null})):n?.spanContext().isRemote?this._startRootSpanWithRemoteParent(i,n):n?so({...i,parentSpan:n}):po(()=>so({...i,parentSpan:r?null:void 0}))}_startRootSpanWithRemoteParent(e,t){let{spanId:n,traceId:r,traceState:i}=t.spanContext(),a=xa(t),o=typeof a.sample_rand==`string`?Number(a.sample_rand):void 0,s=!!i?.get(AO);return Er(i=>(i.setPropagationContext({traceId:r,parentSpanId:n,sampled:KO(t.spanContext()),dsc:s?a:void 0,sampleRand:typeof o==`number`&&!Number.isNaN(o)?o:rn()}),er(i,void 0),so({...e,parentSpan:null})))}_createNonRecordingSpan(e){let t=new ma({traceId:e?.spanContext().traceId});return e&&ta(e,t),ti(t,M(),N()),t}},mA=class{constructor(e={}){this._tracers=new Map,this.resource=e.resource}getTracer(e,t,n){let r=JSON.stringify([e,t,n]),i=this._tracers.get(r);if(i)return i;let a=new pA;return this._tracers.set(r,a),a}forceFlush(){return Promise.resolve()}shutdown(){return Promise.resolve()}},hA=`telemetry.sdk.language`,gA=`telemetry.sdk.name`,_A=`telemetry.sdk.version`,vA=`service.namespace`,yA=class e{constructor(e){this._attributes=e}get attributes(){return this._attributes}merge(t){return t?new e({...this._attributes,...t.attributes}):this}getRawAttributes(){return Object.entries(this._attributes)}};function bA(e){if(!e)return{};let t={};for(let n of e.split(`,`)){let e=n.indexOf(`=`);if(e===-1)continue;let r=n.substring(0,e).trim(),i=n.substring(e+1).trim();if(r)try{t[r]=decodeURIComponent(i)}catch{t[r]=i}}return t}function xA(e){let t=typeof process<`u`?process.env:{},n=t.OTEL_SERVICE_NAME,r=bA(t.OTEL_RESOURCE_ATTRIBUTES);return new yA({[vA]:`sentry`,[ml]:e,...r,...n?{[ml]:n}:{},[hl]:k,[hA]:vO[hA],[gA]:vO[gA],[_A]:vO[_A]})}function SA({span:e,scope:t,client:n,propagateTraceparent:r}={}){let i=(t&&GO(t))??l.active();if(e){let{scope:t}=ni(e);i=t&&GO(t)||_.setSpan(l.active(),e)}let{traceId:a,spanId:o,sampled:s,dynamicSamplingContext:c}=uk(i,{scope:t,client:n}),u={"sentry-trace":ji(a,o,s),baggage:di(c)};return r&&(u.traceparent=Mi(a,o,s)),u}function CA(e){function t(){return HO(l.active())||{scope:ir(),isolationScope:ar()}}function n(e){let t=l.active();return l.with(t,()=>e(o()))}function r(e,t){let n=GO(e)||l.active();return l.with(n.setValue(zO,e),()=>t(e))}function i(e){let t=l.active();return l.with(t.setValue(RO,!0),()=>{let t=o();return ki(t.getPropagationContext())||t.setPropagationContext({traceId:Yn(),sampleRand:rn()}),e(s())})}function a(e,t){let n=l.active();return l.with(n.setValue(BO,e),()=>t(s()))}function o(){return t().scope}function s(){return t().isolationScope}gr({withScope:n,withSetScope:r,withSetIsolationScope:a,withIsolationScope:i,getCurrentScope:o,getIsolationScope:s,startSpan:yk,startSpanManual:bk,startInactiveSpan:xk,getActiveSpan:nk,suppressTracing:Nk,isTracingSuppressed:Pk,getTraceData:SA,continueTrace:kk,startNewTrace:Ak,withActiveSpan:Sk,getTracingChannelBinding:e?.getTracingChannelBinding})}x();var wA=[`addListener`,`on`,`once`,`prependListener`,`prependOnceListener`],TA=class{constructor(){this._kOtListeners=Symbol(`OtListeners`),this._wrapped=!1,ck(`SentryContextManager`),this._asyncLocalStorage=_r(it()).getTracingChannelBinding?.()?.asyncLocalStorage??new ze}active(){return this._asyncLocalStorage.getStore()??r}with(e,t,n,...r){let i=Ik(e,this.active()),a=n==null?t:t.bind(n);return this._asyncLocalStorage.run(i,a,...r)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}bind(e,t){return t instanceof Me?this._bindEventEmitter(e,t):typeof t==`function`?this._bindFunction(e,t):t}getAsyncLocalStorageLookup(){return{asyncLocalStorage:this._asyncLocalStorage,contextSymbol:LO}}_bindFunction(e,t){let n=this.with.bind(this),r=function(...r){return n(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindEventEmitter(e,t){if(this._getPatchMap(t)!==void 0)return t;this._createPatchMap(t);for(let n of wA)t[n]!==void 0&&(t[n]=this._patchAddListener(t,t[n],e));return typeof t.removeListener==`function`&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off==`function`&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners==`function`&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners)),t}_patchRemoveListener(e,t){let n=this;return function(r,i){let a=n._getPatchMap(e)?.[r];if(a===void 0)return t.call(this,r,i);let o=a.get(i);return t.call(this,r,o||i)}}_patchRemoveAllListeners(e,t){let n=this;return function(r){let i=n._getPatchMap(e);return i!==void 0&&(arguments.length===0?n._createPatchMap(e):r!==void 0&&i[r]!==void 0&&delete i[r]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let r=this;return function(i,a){if(r._wrapped)return t.call(this,i,a);let o=r._getPatchMap(e);o===void 0&&(o=r._createPatchMap(e));let s=o[i];s===void 0&&(s=new WeakMap,o[i]=s);let c=r.bind(n,a);s.set(a,c),r._wrapped=!0;try{return t.call(this,i,c)}finally{r._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};function EA(e){CA({getTracingChannelBinding:e?.skipOpenTelemetrySetup?OA():DA()})}function DA(){let e=new ze;return()=>({asyncLocalStorage:e,getStoreWithActiveSpan:kA})}function OA(){return()=>{try{let e=l._getContextManager()?.getAsyncLocalStorageLookup().asyncLocalStorage;return e?{asyncLocalStorage:e,getStoreWithActiveSpan:kA}:void 0}catch{return}}}function kA(e){let t=l.active();return Co(e)&&ra(e)!==e||e.spanContext().traceState?.get(`sentry.ignored`)===`1`?t:_.setSpan(t,e)}var AA=TA;x();function jA(){h.disable(),h.setLogger({error:A.error,warn:A.warn,info:A.log,debug:A.log,verbose:A.log},ne.DEBUG)}var MA={};function Y(e,t,n){return n?PA(e,t,n):NA(e,t)}function NA(e,t){return Object.assign(n=>{let r=MA[e];if(r)return n&&r.setConfig(n),r;let i=t(n);return MA[e]=i,Dw({instrumentations:[i]}),i},{id:e})}function PA(e,t,n){return Object.assign(r=>{let i=n(r),a=MA[e];if(a)return a.setConfig(i),a;let o=new t(i);return MA[e]=o,Dw({instrumentations:[o]}),o},{id:e})}var FA=`ChildProcess`,IA=W((e={})=>({name:FA,setup(){C.channel(`child_process`).subscribe(t=>{j(t)&&`process`in t&&LA(t.process,e)}),C.channel(`worker_threads`).subscribe(t=>{j(t)&&`worker`in t&&RA(t.worker,e)})}}));function LA(e,t){let n=!1,r;e.on(`spawn`,()=>{if(e.spawnfile===`/usr/bin/sw_vers`){n=!0;return}r={spawnfile:e.spawnfile},t.includeChildProcessArgs&&(r.spawnargs=e.spawnargs)}).on(`exit`,e=>{n||(n=!0,e!==null&&e!==0&&Gf({category:`child_process`,message:`Child process exited with code '${e}'`,level:e===0?`info`:`warning`,data:r}))}).on(`error`,e=>{n||(n=!0,Gf({category:`child_process`,message:`Child process errored with '${e.message}'`,level:`error`,data:r}))})}function RA(e,t){let n;e.on(`online`,()=>{n=e.threadId}).on(`error`,e=>{t.captureWorkerErrors===!1?Gf({category:`worker_thread`,message:`Worker thread errored with '${e.message}'`,level:`error`,data:{threadId:n}}):H(e,{mechanism:{type:`auto.child_process.worker_thread`,handled:!1,data:{threadId:String(n)}}})})}var zA=Le(De),BA=Le(ke),VA=`Context`,HA=W(((e={})=>{let t={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e},n=t.app?JA():void 0,r=t.device?YA(t.device):void 0,i=t.culture?qA():void 0,a=t.cloudResource?rj():void 0,o=t.os?KA():void 0,s={"process.runtime.engine.name":`v8`,"process.runtime.engine.version":process.versions.v8,...WA({app:n,device:r,culture:i,cloud_resource:a})};o&&o.then(e=>Object.assign(s,WA({os:e}))).catch(()=>{});let c=(async()=>{let e={};return o&&(e.os=await o),n&&(e.app=n),r&&(e.device=r),i&&(e.culture=i),a&&(e.cloud_resource=a),e})();async function l(e){let t=UA(await c);return e.contexts={...e.contexts,app:{...t.app,...e.contexts?.app},os:{...t.os,...e.contexts?.os},device:{...t.device,...e.contexts?.device},culture:{...t.culture,...e.contexts?.culture},cloud_resource:{...t.cloud_resource,...e.contexts?.cloud_resource}},e}return{name:VA,processEvent(e){return l(e)},processSegmentSpan(e){Cl(e,s),Cl(e,GA(n,r))}}}));function UA(e){if(e.app?.app_memory&&(e.app.app_memory=process.memoryUsage().rss),e.app?.free_memory&&typeof process.availableMemory==`function`){let t=process.availableMemory?.();t!=null&&(e.app.free_memory=t)}return e.device?.free_memory&&(e.device.free_memory=fe.freemem()),e}function WA(e){let t={},{app:n,device:r,os:i,culture:a,cloud_resource:o}=e;if(n&&n.app_start_time&&(t[`app.start_time`]=n.app_start_time),r&&(r.arch&&(t[`device.archs`]=[r.arch]),r.boot_time&&(t[`device.boot_time`]=r.boot_time),r.memory_size!=null&&(t[`device.memory_size`]=r.memory_size),r.processor_count!=null&&(t[`device.processor_count`]=r.processor_count),r.cpu_description&&(t[`device.cpu_description`]=r.cpu_description),r.processor_frequency!=null&&(t[`device.processor_frequency`]=r.processor_frequency)),i&&(i.name&&(t[`os.name`]=i.name),i.version&&(t[`os.version`]=i.version),i.kernel_version&&(t[`os.kernel_version`]=i.kernel_version),i.build&&(t[`os.build`]=i.build)),a&&(a.locale&&(t[`culture.locale`]=a.locale),a.timezone&&(t[`culture.timezone`]=a.timezone)),o)for(let[e,n]of Object.entries(o))n!=null&&(t[e]=n);return t}function GA(e,t){let n={};if(e&&(n[`app.memory`]=process.memoryUsage().rss,typeof process.availableMemory==`function`)){let e=process.availableMemory?.();e!=null&&(n[`app.free_memory`]=e)}return t?.free_memory!=null&&(n[`device.free_memory`]=fe.freemem()),n}async function KA(){let e=fe.platform();switch(e){case`darwin`:return ej();case`linux`:return nj();default:return{name:XA[e]||e,version:fe.release()}}}function qA(){try{if(typeof process.versions.icu!=`string`)return;let e=new Date(9e8);if(new Intl.DateTimeFormat(`es`,{month:`long`}).format(e)===`enero`){let e=Intl.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone}}}catch{}}function JA(){let e=process.memoryUsage().rss,t={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory==`function`){let e=process.availableMemory?.();e!=null&&(t.free_memory=e)}return t}function YA(e){let t={},n;try{n=fe.uptime()}catch{}if(typeof n==`number`&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=fe.arch(),(e===!0||e.memory)&&(t.memory_size=fe.totalmem(),t.free_memory=fe.freemem()),e===!0||e.cpu){let e=fe.cpus(),n=e?.[0];n&&(t.processor_count=e.length,t.cpu_description=n.model,t.processor_frequency=n.speed)}return t}var XA={aix:`IBM AIX`,freebsd:`FreeBSD`,openbsd:`OpenBSD`,sunos:`SunOS`,win32:`Windows`,ohos:`OpenHarmony`,android:`Android`},ZA=[{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`]}],QA={alpine:e=>e,arch:e=>$A(/distrib_release=(.*)/,e),centos:e=>$A(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>$A(/release (..)/,e),mint:e=>$A(/distrib_release=(.*)/,e),red:e=>$A(/release ([^ ]+)/,e),suse:e=>$A(/VERSION = (.*)\n/,e),ubuntu:e=>$A(/distrib_release=(.*)/,e)};function $A(e,t){let n=e.exec(t);return n?n[1]:void 0}async function ej(){let e={kernel_version:fe.release(),name:`Mac OS X`,version:`10.${Number(fe.release().split(`.`)[0])-4}`};try{let t=await new Promise((e,t)=>{de(`/usr/bin/sw_vers`,(n,r)=>{if(n){t(n);return}e(r)})});e.name=$A(/^ProductName:\s+(.*)$/m,t),e.version=$A(/^ProductVersion:\s+(.*)$/m,t),e.build=$A(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function tj(e){return e.split(` `)[0].toLowerCase()}async function nj(){let e={kernel_version:fe.release(),name:`Linux`};try{let t=await BA(`/etc`),n=ZA.find(e=>t.includes(e.name));if(!n)return e;let r=(await zA(he(`/etc`,n.name),{encoding:`utf-8`})).toLowerCase(),{distros:i}=n;e.name=i.find(e=>r.indexOf(tj(e))>=0)||i[0],e.version=QA[tj(e.name)]?.(r)}catch{}return e}function rj(){if(process.env.VERCEL)return{"cloud.provider":`vercel`,"cloud.region":process.env.VERCEL_REGION};if(process.env.AWS_REGION)return{"cloud.provider":`aws`,"cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV};if(process.env.GCP_PROJECT)return{"cloud.provider":`gcp`};if(process.env.ALIYUN_REGION_ID)return{"cloud.provider":`alibaba_cloud`,"cloud.region":process.env.ALIYUN_REGION_ID};if(process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME)return{"cloud.provider":`azure`,"cloud.region":process.env.REGION_NAME};if(process.env.IBM_CLOUD_REGION)return{"cloud.provider":`ibm_cloud`,"cloud.region":process.env.IBM_CLOUD_REGION};if(process.env.TENCENTCLOUD_REGION)return{"cloud.provider":`tencent_cloud`,"cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE};if(process.env.NETLIFY)return{"cloud.provider":`netlify`};if(process.env.FLY_REGION)return{"cloud.provider":`fly.io`,"cloud.region":process.env.FLY_REGION};if(process.env.DYNO)return{"cloud.provider":`heroku`}}var ij=new hb(10),aj=new hb(20),oj=7,sj=`ContextLines`;function cj(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function lj(e){return!!(e.startsWith(`node:`)||e.endsWith(`.min.js`)||e.endsWith(`.min.cjs`)||e.endsWith(`.min.mjs`)||e.startsWith(`data:`))}function uj(e){return e.lineno!==void 0&&e.lineno>1e4||e.colno!==void 0&&e.colno>1e3}function dj(e,t){let n=ij.get(e);if(n===void 0)return!1;for(let e=t[0];e<=t[1];e++)if(n[e]===void 0)return!1;return!0}function fj(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!=`number`)return[];let i=bj(r,t),a=[];for(;;){if(n===e.length-1){a.push(i);break}let r=e[n+1];if(typeof r!=`number`)break;r<=i[1]?i[1]=r+t:(a.push(i),i=bj(r,t)),n++}return a}function pj(e,t,n){return new Promise((r,i)=>{let a=Ee(e),o=$e({input:a});function s(){a.destroy(),r()}let c=0,l=0,u=t[l];if(u===void 0){s();return}let d=u[0],f=u[1];function p(t){aj.set(e,1),QC&&A.error(`Failed to read file: ${e}. Error: ${t}`),o.close(),o.removeAllListeners(),s()}a.on(`error`,p),o.on(`error`,p),o.on(`close`,s),o.on(`line`,e=>{if(c++,!(c<d)&&(n[c]=Sn(e,0),c>=f)){if(l===t.length-1){o.close(),o.removeAllListeners();return}l++;let e=t[l];if(e===void 0){o.close(),o.removeAllListeners();return}d=e[0],f=e[1]}})})}async function mj(e,t){let n={};if(t>0&&e.exception?.values){for(let t of e.exception.values)if(t.stacktrace?.frames?.length)for(let e=t.stacktrace.frames.length-1;e>=0;e--){let r=t.stacktrace.frames[e],i=r?.filename;!r||typeof i!=`string`||typeof r.lineno!=`number`||lj(i)||uj(r)||(n[i]||(n[i]=[]),n[i].push(r.lineno))}}let r=Object.keys(n);if(r.length==0)return e;let i=[];for(let e of r){if(aj.get(e))continue;let r=n[e];if(!r)continue;r.sort((e,t)=>e-t);let a=fj(r,t);if(a.every(t=>dj(e,t)))continue;let o=cj(ij,e,{});i.push(pj(e,a,o))}if(await Promise.all(i).catch(()=>{QC&&A.log(`Failed to read one or more source files and resolve context lines`)}),t>0&&e.exception?.values)for(let n of e.exception.values)n.stacktrace?.frames&&n.stacktrace.frames.length>0&&hj(n.stacktrace.frames,t,ij);return e}function hj(e,t,n){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno==`number`){let e=n.get(r.filename);if(e===void 0)continue;_j(r.lineno,r,t,e)}}function gj(e){delete e.pre_context,delete e.context_line,delete e.post_context}function _j(e,t,n,r){if(t.lineno===void 0||r===void 0){QC&&A.error(`Cannot resolve context for frame with no lineno or file contents`);return}t.pre_context=[];for(let i=vj(e,n);i<e;i++){let e=r[i];if(e===void 0){gj(t),QC&&A.error(`Could not find line ${i} in file ${t.filename}`);return}t.pre_context.push(e)}if(r[e]===void 0){gj(t),QC&&A.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let i=yj(e,n);t.post_context=[];for(let n=e+1;n<=i;n++){let e=r[n];if(e===void 0)break;t.post_context.push(e)}}function vj(e,t){return Math.max(1,e-t)}function yj(e,t){return e+t}function bj(e,t){return[vj(e,t),yj(e,t)]}var xj=W(((e={})=>({name:sj,processEvent(t,n,r){return mj(t,e.frameContextLines??r?.getDataCollectionOptions().frameContextLines??oj)}}))),Sj;async function Cj(){if(Sj===void 0)try{Sj=!!(await import(`node:inspector`)).url()}catch{Sj=!1}return Sj}function wj(e,t){return af(e,t)}var Tj=`__SENTRY_ERROR_LOCAL_VARIABLES__`;function Ej(e,t,n){let r=0,i=5,a=0;return setInterval(()=>{a===0?r>e&&(i*=2,n(i),i>86400&&(i=86400),a=i):(--a,a===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function Dj(e){return e!==void 0&&(e.length===0||e===`?`||e===`<anonymous>`)}function Oj(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||Dj(e)&&Dj(t)}var kj=`LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjc0LjAgKGNlNTAwOWEpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0s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0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=`;function Aj(...e){A.log(`[LocalVariables]`,...e)}var jj=W(((e={})=>{function t(t,n,r){if(r===!1)return;let i=(t.stacktrace?.frames||[]).filter(e=>e.function!==`new Promise`);for(let t=0;t<i.length;t++){let a=i.length-t-1,o=n[t],s=i[a];if(!s||!o)break;o.vars===void 0||s.in_app===!1&&e.includeOutOfAppFrames!==!0||!Oj(s.function,o.function)||(s.vars=wj(o.vars,r))}}function n(e,n){if(n.originalException&&typeof n.originalException==`object`&&`__SENTRY_ERROR_LOCAL_VARIABLES__`in n.originalException&&Array.isArray(n.originalException.__SENTRY_ERROR_LOCAL_VARIABLES__)){let r=P()?.getDataCollectionOptions().stackFrameVariables??!0;for(let i of e.exception?.values||[])t(i,n.originalException[Tj],r);n.originalException[Tj]=void 0}return e}async function r(){let e=await import(`node:inspector`);e.url()||e.open(0)}function i(e){let t=new Ke(new URL(`data:application/javascript;base64,${kj}`),{workerData:e,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on(`exit`,()=>{t.terminate()}),t.once(`error`,e=>{Aj(`Worker error`,e)}),t.once(`exit`,e=>{Aj(`Worker exit`,e)}),t.unref()}return{name:`LocalVariablesAsync`,async setup(t){if(!t.getOptions().includeLocalVariables)return;if(await Cj()){A.warn(`Local variables capture has been disabled because the debugger was already enabled`);return}let n={...e,debug:A.isEnabled()};r().then(()=>{try{i(n)}catch(e){A.error(`Failed to start worker`,e)}},e=>{A.error(`Failed to start inspector`,e)})},processEvent(e,t){return n(e,t)}}}));function Mj(e){if(e!==void 0)return e.slice(-10).reduce((e,t)=>`${e},${t.function},${t.lineno},${t.colno}`,``)}function Nj(e,t){if(t!==void 0)return Mj(e(t,1))}function Pj(e){let t=[],n=!1;function r(r){t=[],!n&&(n=!0,e(r))}t.push(r);function i(e){t.push(e)}function a(e){let n=t.pop()||r;try{n(e)}catch{r(e)}}return{add:i,next:a}}var Fj=class e{constructor(e){this._session=e}static async create(t){if(t)return t;let n=await import(`node:inspector`);return new e(new n.Session)}configureAndConnect(e,t){this._session.connect(),this._session.on(`Debugger.paused`,t=>{e(t,()=>{this._session.post(`Debugger.resume`)})}),this._session.post(`Debugger.enable`),this._session.post(`Debugger.setPauseOnExceptions`,{state:t?`all`:`uncaught`})}setPauseOnExceptions(e){this._session.post(`Debugger.setPauseOnExceptions`,{state:e?`all`:`uncaught`})}getLocalVariables(e,t){this._getProperties(e,e=>{let{add:n,next:r}=Pj(t);for(let t of e)if(t.value?.objectId&&t.value.className===`Array`){let e=t.value.objectId;n(n=>this._unrollArray(e,t.name,n,r))}else if(t.value?.objectId&&t.value.className===`Object`){let e=t.value.objectId;n(n=>this._unrollObject(e,t.name,n,r))}else t.value&&n(e=>this._unrollOther(t,e,r));r({})})}_getProperties(e,t){this._session.post(`Runtime.getProperties`,{objectId:e,ownProperties:!0},(e,n)=>{t(e?[]:n.result)})}_unrollArray(e,t,n,r){this._getProperties(e,e=>{n[t]=e.filter(e=>e.name!==`length`&&!isNaN(parseInt(e.name,10))).sort((e,t)=>parseInt(e.name,10)-parseInt(t.name,10)).map(e=>e.value?.value),r(n)})}_unrollObject(e,t,n,r){this._getProperties(e,e=>{n[t]=e.map(e=>[e.name,e.value?.value]).reduce((e,[t,n])=>(e[t]=n,e),{}),r(n)})}_unrollOther(e,t,n){e.value&&(`value`in e.value?e.value.value===void 0||e.value.value===null?t[e.name]=`<${e.value.value}>`:t[e.name]=e.value.value:`description`in e.value&&e.value.type!==`function`?t[e.name]=`<${e.value.description}>`:e.value.type===`undefined`&&(t[e.name]=`<undefined>`)),n(t)}},Ij=`LocalVariables`,Lj=W(((e={},t)=>{let n=new hb(20),r,i=!1;function a(t,r){let i=Mj(t.stacktrace?.frames);if(i===void 0)return;let a=n.remove(i);if(a===void 0||r===!1)return;let o=(t.stacktrace?.frames||[]).filter(e=>e.function!==`new Promise`);for(let t=0;t<o.length;t++){let n=o.length-t-1,i=a[t],s=o[n];if(!s||!i)break;i.vars===void 0||s.in_app===!1&&e.includeOutOfAppFrames!==!0||!Oj(s.function,i.function)||(s.vars=wj(i.vars,r))}}function o(e){for(let t of e.exception?.values||[])a(t,P()?.getDataCollectionOptions().stackFrameVariables??!0);return e}let s;async function c(){let a=P()?.getOptions();if(a?.includeLocalVariables){if(FT<18){A.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await Cj()){A.warn(`Local variables capture has been disabled because the debugger was already enabled`);return}try{let o=await Fj.create(t),s=(e,{params:{reason:t,data:i,callFrames:a}},s)=>{if(t!==`exception`&&t!==`promiseRejection`){s();return}r?.();let c=Nj(e,i.description);if(c==null){s();return}let{add:l,next:u}=Pj(e=>{n.set(c,e),s()});for(let e=0;e<Math.min(a.length,5);e++){let{scopeChain:t,functionName:n,this:r}=a[e],i=t.find(e=>e.type===`local`),s=r.className===`global`||!r.className?n:`${r.className}.${n}`;if(i?.object.objectId===void 0)l(t=>{t[e]={function:s},u(t)});else{let t=i.object.objectId;l(n=>o.getLocalVariables(t,t=>{n[e]={function:s,vars:t},u(n)}))}}u([])},c=e.captureAllExceptions!==!1;o.configureAndConnect((e,t)=>s(a.stackParser,e,t),c),c&&(r=Ej(e.maxExceptionsPerSecond||50,()=>{A.log(`Local variables rate-limit lifted.`),o.setPauseOnExceptions(!0)},e=>{A.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${e} seconds.`),o.setPauseOnExceptions(!1)})),i=!0}catch(e){A.log("The `LocalVariables` integration failed to start.",e)}}}return{name:Ij,setupOnce(){s=c()},async processEvent(e){return await s,i?o(e):e},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}})),Rj=(e={})=>PT.major<19?Lj(e):jj(e),zj,Bj=`Modules`;function Vj(){return typeof __SENTRY_SERVER_MODULES__<`u`?__SENTRY_SERVER_MODULES__:O.__SENTRY_SERVER_MODULES__??{}}var Hj=(()=>({name:Bj,processEvent(e){return e.modules={...e.modules,...Wj()},e},getModules:Wj}));function Uj(){return{...Vj(),...Kj()}}function Wj(){return zj||=Uj(),zj}function Gj(){try{let e=he(process.cwd(),`package.json`);return JSON.parse(Oe(e,`utf8`))}catch{return{}}}function Kj(){let e=Gj();return{...e.dependencies,...e.devDependencies}}var qj=2e3;function Jj(e){ut(()=>{console.error(e)});let t=P();if(t===void 0){QC&&A.warn(`No NodeClient was defined, we are exiting the process now.`),global.process.exit(1);return}let n=t.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:qj;t.close(r).then(e=>{e||QC&&A.warn(`We reached the timeout for emptying the request buffer, still exiting now!`),global.process.exit(1)},e=>{QC&&A.error(e)})}var Yj=`OnUncaughtException`,Xj=W((e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:Yj,setup(e){Xe&&global.process.on(`uncaughtException`,Zj(e,t))}}});function Zj(e,t){let n=!1,r=!1,i=!1,a,o=e.getOptions();return Object.assign(s=>{let c=Jj;t.onFatalError?c=t.onFatalError:o.onFatalError&&(c=o.onFatalError);let l=global.process.listeners(`uncaughtException`).filter(e=>e.name!==`domainUncaughtExceptionClear`&&e._errorHandler!==!0).length===0,u=t.exitEvenIfOtherHandlersAreRegistered||l;n?u&&(i?(QC&&A.warn(`uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown`),Jj(s)):r||(r=!0,setTimeout(()=>{i||(i=!0,c(a,s))},2e3))):(a=s,n=!0,P()===e&&H(s,{originalException:s,captureContext:{level:`fatal`},mechanism:{handled:!1,type:`auto.node.onuncaughtexception`}}),!i&&u&&(i=!0,c(s)))},{_errorHandler:!0})}var Qj=`OnUnhandledRejection`,$j=[{name:`AI_NoOutputGeneratedError`},{name:`AbortError`}],eM=W(((e={})=>{let t={mode:e.mode??`warn`,ignore:[...$j,...e.ignore??[]]};return{name:Qj,setup(e){global.process.on(`unhandledRejection`,iM(e,t))}}}));function tM(e){if(!j(e))return{name:``,message:String(e??``)};let t=e;return{name:typeof t.name==`string`?t.name:``,message:typeof t.message==`string`?t.message:String(e)}}function nM(e,t){let n=e.name===void 0||wn(t.name,e.name,!0),r=e.message===void 0||wn(t.message,e.message);return n&&r}function rM(e,t){let n=tM(t);return e.some(e=>nM(e,n))}function iM(e,t){return function(n,r){if(P()!==e||rM(t.ignore??[],n))return;let i=t.mode===`strict`?`fatal`:`error`,a=j(n)?n._sentry_active_span:void 0;(a?e=>V(a,e):e=>e())(()=>{H(n,{originalException:n,captureContext:{extra:{unhandledPromiseRejection:!0},level:i},mechanism:{handled:!1,type:`auto.node.onunhandledrejection`}})}),aM(n,t.mode)}}function aM(e,t){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:`;t===`warn`?ut(()=>{console.warn(n),console.error(j(e)&&`stack`in e?e.stack:e)}):t===`strict`&&(ut(()=>{console.warn(n)}),Jj(e))}var oM=`ProcessSession`,sM=W(()=>({name:oM,setupOnce(){mu(),process.on(`beforeExit`,()=>{N().getSession()?.status===`ok`&&hu()})}})),cM=`Spotlight`,lM=W(((e={})=>{let t={sidecarUrl:e.sidecarUrl||`http://localhost:8969/stream`};return{name:cM,setup(e){try{process.env.NODE_ENV&&process.env.NODE_ENV!==`development`&&A.warn(`[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?`)}catch{}uM(e,t)}}}));function uM(e,t){let n=dM(t.sidecarUrl);if(!n)return;let r=0;e.on(`beforeEnvelope`,e=>{if(r>3){A.warn(`[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests`);return}let t=Aa(e);uo(()=>{let e=Ve.request({method:`POST`,path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":`application/x-sentry-envelope`}},e=>{e.statusCode&&e.statusCode>=200&&e.statusCode<400&&(r=0),e.on(`data`,()=>{}),e.on(`end`,()=>{}),e.setEncoding(`utf8`)});e.on(`error`,()=>{r++,A.warn(`[Spotlight] Failed to send envelope to Spotlight Sidecar`)}),e.write(t),e.end()})})}function dM(e){try{return new URL(`${e}`)}catch{A.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var fM=W((e={})=>({name:`Console`,setup(t){process.env.LAMBDA_TASK_ROOT&&Nt(`console`,pM),Wm({...e,filter:[...e.filter||[],`[DEP0205] DeprecationWarning`]}).setup?.(t)}}));function pM(){let e=O?.console;e&&st.forEach(t=>{t in e&&mM(e,t)})}function mM(e,t){let n=e[t];lt[t]=n;let r=n,i,a=!1,o=function(...i){if(a){n.apply(e,i);return}a=!0;try{Pt(`console`,{args:i,level:t}),r.apply(e,i)}finally{a=!1}};Yt(o,n);let s=n.bind(e);lt[t]=s;try{let n=o;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return n},set(e){e===o?(i!==void 0&&(r=i,i=void 0),n=o):e===s?(i=r,n=s):typeof e==`function`&&!e.__sentry_original__?(r=e,n=o):n=e}})}catch{qt(e,t,function(e){return lt[t]=e,function(...e){Pt(`console`,{args:e,level:t}),lt[t]?.apply(this,e)}})}}var hM=`NodeSystemError`;function gM(e){return!(e instanceof Error)||!(`errno`in e)||typeof e.errno!=`number`||typeof Pe.getSystemErrorMap!=`function`?!1:Pe.getSystemErrorMap().has(e.errno)}var _M=W((e={})=>({name:hM,processEvent:(t,n,r)=>{if(!gM(n.originalException))return t;let i=n.originalException,a={...i};!r.getDataCollectionOptions().userInfo&&e.includePaths!==!0&&(delete a.path,delete a.dest),t.contexts={...t.contexts,node_system_error:a};for(let e of t.exception?.values||[])e.value&&(i.path&&e.value.includes(i.path)&&(e.value=e.value.replace(`'${i.path}'`,``).trim()),i.dest&&e.value.includes(i.dest)&&(e.value=e.value.replace(`'${i.dest}'`,``).trim()));return t}})),vM,yM=Symbol(`AgentBaseInternalState`),bM=class extends (vM=Ve.Agent,vM){constructor(e){super(e),this[yM]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint==`boolean`)return e.secureEndpoint;if(typeof e.protocol==`string`)return e.protocol===`https:`}let{stack:t}=Error();return typeof t==`string`&&t.split(`
|
|
23
|
-
`).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1)}createSocket(e,t,n){let r={...t,secureEndpoint:this.isSecureEndpoint(t)};Promise.resolve().then(()=>this.connect(e,r)).then(i=>{if(i instanceof Ve.Agent)return i.addRequest(e,r);this[yM].currentSocket=i,super.createSocket(e,t,n)},n)}createConnection(){let e=this[yM].currentSocket;if(this[yM].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[yM].defaultPort??(this.protocol===`https:`?443:80)}set defaultPort(e){this[yM]&&(this[yM].defaultPort=e)}get protocol(){return this[yM].protocol??(this.isSecureEndpoint()?`https:`:`http:`)}set protocol(e){this[yM]&&(this[yM].protocol=e)}};function xM(...e){A.log(`[https-proxy-agent:parse-proxy-response]`,...e)}function SM(e){return new Promise((t,n)=>{let r=0,i=[];function a(){let t=e.read();t?l(t):e.once(`readable`,a)}function o(){e.removeListener(`end`,s),e.removeListener(`error`,c),e.removeListener(`readable`,a)}function s(){o(),xM(`onend`),n(Error(`Proxy connection ended before receiving CONNECT response`))}function c(e){o(),xM(`onerror %o`,e),n(e)}function l(s){i.push(s),r+=s.length;let c=Buffer.concat(i,r),l=c.indexOf(`\r
|
|
24
|
-
\r
|
|
25
|
-
`);if(l===-1){xM(`have not received end of HTTP headers yet...`),a();return}let u=c.subarray(0,l).toString(`ascii`).split(`\r
|
|
26
|
-
`),d=u.shift();if(!d)return e.destroy(),n(Error(`No header received from proxy CONNECT response`));let f=d.split(` `),p=+(f[1]||0),m=f.slice(2).join(` `),h={};for(let t of u){if(!t)continue;let r=t.indexOf(`:`);if(r===-1)return e.destroy(),n(Error(`Invalid header from proxy CONNECT response: "${t}"`));let i=t.slice(0,r).toLowerCase(),a=t.slice(r+1).trimStart(),o=h[i];typeof o==`string`?h[i]=[o,a]:Array.isArray(o)?o.push(a):h[i]=a}xM(`got proxy server response: %o %o`,d,h),o(),t({connect:{statusCode:p,statusText:m,headers:h},buffered:c})}e.on(`error`,c),e.on(`end`,s),a()})}function CM(...e){A.log(`[https-proxy-agent]`,...e)}var wM=class extends bM{constructor(e,t){super(t),this.options={},this.proxy=typeof e==`string`?new URL(e):e,this.proxyHeaders=t?.headers??{},CM(`Creating new HttpsProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={ALPNProtocols:[`http/1.1`],...t?EM(t,`headers`):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw TypeError(`No "host" provided`);let r;if(n.protocol===`https:`){CM("Creating `tls.Socket`: %o",this.connectOpts);let e=this.connectOpts.servername||this.connectOpts.host;r=w.connect({...this.connectOpts,servername:e&&Be.isIP(e)?void 0:e})}else CM("Creating `net.Socket`: %o",this.connectOpts),r=Be.connect(this.connectOpts);let i=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},a=Be.isIPv6(t.host)?`[${t.host}]`:t.host,o=`CONNECT ${a}:${t.port} HTTP/1.1\r
|
|
27
|
-
`;if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}i.Host=`${a}:${t.port}`,i[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let e of Object.keys(i))o+=`${e}: ${i[e]}\r
|
|
28
|
-
`;let s=SM(r);r.write(`${o}\r
|
|
29
|
-
`);let{connect:c,buffered:l}=await s;if(e.emit(`proxyConnect`,c),this.emit(`proxyConnect`,c,e),c.statusCode===200){if(e.once(`socket`,TM),t.secureEndpoint){CM(`Upgrading socket connection to TLS`);let e=t.servername||t.host;return w.connect({...EM(t,`host`,`path`,`port`),socket:r,servername:Be.isIP(e)?void 0:e})}return r}r.destroy();let u=new Be.Socket({writable:!1});return u.readable=!0,e.once(`socket`,e=>{CM(`Replaying proxy buffer for failed request`),e.push(l),e.push(null)}),u}};wM.protocols=[`http`,`https`];function TM(e){e.resume()}function EM(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}var DM=32768;function OM(e){return new S({read(){this.push(e),this.push(null)}})}function kM(e){let t;try{t=new URL(e.url)}catch{return ut(()=>{console.warn(`[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.`)}),bd(e,()=>Promise.resolve({}))}let n=t.protocol===`https:`,r=AM(t,e.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),i=n?et:Ve,a=e.keepAlive!==void 0&&e.keepAlive,o=r?new wM(r):new i.Agent({keepAlive:a,maxSockets:30,timeout:2e3});return bd(e,jM(e,e.httpModule??i,o))}function AM(e,t){let{no_proxy:n}=process.env;if(!n?.split(`,`).some(t=>e.host.endsWith(t)||e.hostname.endsWith(t)))return t}function jM(e,t,n){let{hostname:r,pathname:i,port:a,protocol:o,search:s}=new URL(e.url);return function(c){return new Promise((l,u)=>{uo(()=>{let d=OM(c.body),f={...e.headers};c.body.length>DM&&(f[`content-encoding`]=`gzip`,d=d.pipe(We()));let p=r.startsWith(`[`),m=t.request({method:`POST`,agent:n,headers:f,hostname:p?r.slice(1,-1):r,path:`${i}${s}`,port:a,protocol:o,ca:e.caCerts},e=>{e.on(`data`,()=>{}),e.on(`end`,()=>{}),e.setEncoding(`utf8`);let t=e.headers[`retry-after`]??null,n=e.headers[`x-sentry-rate-limits`]??null;l({statusCode:e.statusCode,headers:{"retry-after":t,"x-sentry-rate-limits":Array.isArray(n)?n[0]||null:n}})});m.on(`error`,u),d.pipe(m)})})}}function MM(e){if(e===!1)return!1;if(typeof e==`string`)return e;let t=lf(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?n??!0:t??n}function NM(e){return e.replace(/^[A-Z]:/,``).replace(/\\/g,`/`)}function PM(e=process.argv[1]?um(process.argv[1]):process.cwd(),t=_e===`\\`){let n=t?NM(e):e;return e=>{if(!e)return;let r=t?NM(e):e,{dir:i,base:a,ext:o}=ge.parse(r);(o===`.js`||o===`.mjs`||o===`.cjs`)&&(a=a.slice(0,o.length*-1));let s=decodeURIComponent(a);i||=`.`;let c=i.lastIndexOf(`/node_modules`);if(c>-1)return`${i.slice(c+14).replace(/\//g,`.`)}:${s}`;if(i.startsWith(n)){let e=i.slice(n.length+1).replace(/\//g,`.`);return e?`${e}:${s}`:s}return s}}function FM(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(O.SENTRY_RELEASE?.id)return O.SENTRY_RELEASE.id;let t=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||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,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return t||n||r||e}var IM=St(gS(PM()));x();var LM=6e4,RM=class extends _b{constructor(e){let t=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||fe.hostname(),n={...e,platform:`node`,runtime:e.runtime||{name:`node`,version:global.process.version},serverName:t};e.openTelemetryInstrumentations&&Dw({instrumentations:e.openTelemetryInstrumentations}),wf(n,`node`),A.log(`Initializing Sentry: process: ${process.pid}, thread: ${Xe?`main`:`worker-${Ze}`}.`),super(n),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Yu(this)},t&&this.on(`beforeCaptureLog`,e=>{e.attributes={...e.attributes,"server.address":t}}),process.on(`beforeExit`,this._logOnExitFlushListener)),ko(this)}get tracer(){if(this._tracer)return this._tracer;let e=k,t=_.getTracer(`@sentry/node`,e);return this._tracer=t,t}async flush(e){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}async close(e){this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off(`beforeExit`,this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off(`beforeExit`,this._logOnExitFlushListener);let t=await super.close(e);return this.traceProvider&&await this.traceProvider.shutdown(),t}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{QC&&A.log(`Flushing client reports based on interval.`),this._flushOutcomes()},e.clientReportFlushInterval??LM).unref(),process.on(`beforeExit`,this._clientReportOnExitFlushListener))}_setupIntegrations(){nf(),super._setupIntegrations()}_getTraceInfoFromScope(e){return e?jk(this,e):[void 0,void 0]}},zM;function BM(){return FT>=21||FT===20&&IT>=6||FT===18&&IT>=19||(zM||(zM=!0,ut(()=>{console.warn(`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`)})),!1)}function VM(){if(BM()&&!O._sentryEsmLoaderHookRegistered){O._sentryEsmLoaderHookRegistered=!0;try{let{addHookMessagePort:e}=(0,MT.createAddHookMessageChannel)();Ye.register(`import-in-the-middle/hook.mjs`,import.meta.url,{data:{addHookMessagePort:e,include:[]},transferList:[e]})}catch(e){A.warn(`Failed to register 'import-in-the-middle' hook`,e)}}}function HM(){return[Qf(),Jf(),Ep(),Mp(),_M(),nh(),fM(),UT(),vE(),Xj(),eM(),xj(),Rj(),HA(),IA(),sM(),Hj()]}function UM(e={}){return WM(e,HM)}function WM(e={},t){let n=KM(e,t);n.debug===!0&&(QC?A.enable():ut(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),n.registerEsmLoaderHooks!==!1&&VM(),EA(n),M().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:e})=>e===`Spotlight`)&&n.integrations.push(lM({sidecarUrl:typeof n.spotlight==`string`?n.spotlight:void 0})),wf(n,`node-core`);let r=new RM(n);return M().setClient(r),r.init(),A.log(`SDK initialized from ESM`),r.startClientReportTracking(),YM(),tk(r),Fk(r),process.env.VERCEL&&process.on(`SIGTERM`,async()=>{await r.flush(200)}),r}function GM(){if(!QC)return;let e=sk(),t=[`SentryContextManager`,`SentryPropagator`],n=e.includes(`SentryTracerProvider`);sa()&&!n&&t.push(`SentrySpanProcessor`);for(let n of t)e.includes(n)||A.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);!n&&!e.includes(`SentrySampler`)&&A.warn("You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.")}function KM(e,t){let n=qM(e.release),r=MM(e.spotlight),i=JM(e.tracesSampleRate),a={...e,dsn:e.dsn??process.env.SENTRY_DSN,environment:e.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:e.sendClientReports??!0,transport:e.transport??kM,stackParser:Ct(e.stackParser||IM),release:n,tracesSampleRate:i,spotlight:r,debug:lf(e.debug??process.env.SENTRY_DEBUG)},o=e.integrations,s=Du({defaultIntegrations:e.defaultIntegrations??t(a),integrations:o});return{...a,integrations:s}}function qM(e){if(e!==void 0)return e;let t=FM();if(t!==void 0)return t}function JM(e){if(e!==void 0)return e;let t=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!t)return;let n=parseFloat(t);return isFinite(n)?n:void 0}function YM(){if(lf(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,n=Ai(e,t);M().setPropagationContext(n)}}var XM=e=>({package:e,"javascript.is_cjs":!1});function ZM(e,t){let n=P()?.getOptions();!n?.disableInstrumentationWarnings&&!(K(e)||typeof Zt(e)==`function`)&&fu()&&sa(n)&&(ut(()=>{console.warn(`[Sentry] ${t} is not instrumented. Please make sure to initialize Sentry in a separate file that you \`--import\` when running node, see: https://docs.sentry.io/platforms/javascript/guides/${t}/install/esm/.`)}),Tr().setContext(`missing_instrumentation`,XM(t)))}var{isPromise:QM}=Re,$M=`LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjc0LjAgKGNlNTAwOWEpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyB0fWZyb20ibm9kZTppbnNwZWN0b3IiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIG4scGFyZW50UG9ydCBhcyBlfWZyb20ibm9kZTp3b3JrZXJfdGhyZWFkcyI7aW1wb3J0e3Bvc2l4IGFzIHIsc2VwIGFzIG99ZnJvbSJub2RlOnBhdGgiO2ltcG9ydCphcyBpIGZyb20ibm9kZTpodHRwIjtpbXBvcnQqYXMgcyBmcm9tIm5vZGU6aHR0cHMiO2ltcG9ydHtSZWFkYWJsZSBhcyBjfWZyb20ibm9kZTpzdHJlYW0iO2ltcG9ydHtjcmVhdGVHemlwIGFzIHV9ZnJvbSJub2RlOnpsaWIiO2ltcG9ydCphcyBhIGZyb20ibm9kZTpuZXQiO2ltcG9ydCphcyBmIGZyb20ibm9kZTp0bHMiO2NvbnN0IGg9InVuZGVmaW5lZCI9PXR5cGVvZiBfX1NFTlRSWV9ERUJVR19ffHxfX1NFTlRSWV9ERUJVR19fLHA9Z2xvYmFsVGhpcyxkPSIxMC43NC4wIjtmdW5jdGlvbiBsKCl7cmV0dXJuIGcocCkscH1mdW5jdGlvbiBnKHQpe2NvbnN0IG49dC5fX1NFTlRSWV9fPXQuX19TRU5UUllfX3x8e307cmV0dXJuIG4udmVyc2lvbj1uLnZlcnNpb258fGQsbltkXT1uW2RdfHx7fX1mdW5jdGlvbiBtKHQsbixlPXApe2NvbnN0IHI9ZS5fX1NFTlRSWV9fPWUuX19T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ldCBpPSExLHM9ITA7cmV0dXJuIHNldEludGVydmFsKCgpPT57Y29uc3QgdD1vLmdldFRpbWVNcygpOyExPT09aSYmdD5uK2UmJihpPSEwLHMmJnIoKSksdDxuK2UmJihpPSExKX0sMjApLHtwb2xsOigpPT57by5yZXNldCgpfSxlbmFibGVkOnQ9PntzPXR9fX0oZnVuY3Rpb24oKXtsZXQgdD1wcm9jZXNzLmhydGltZSgpO3JldHVybntnZXRUaW1lTXM6KCk9Pntjb25zdFtuLGVdPXByb2Nlc3MuaHJ0aW1lKHQpO3JldHVybiBNYXRoLmZsb29yKDFlMypuK2UvMWU2KX0scmVzZXQ6KCk9Pnt0PXByb2Nlc3MuaHJ0aW1lKCl9fX0sYW4ucG9sbEludGVydmFsLGFuLmFuclRocmVzaG9sZCxmdW5jdGlvbigpe2RuKCJXYXRjaGRvZyB0aW1lb3V0IiksU24/KGRuKCJQYXVzaW5nIGRlYnVnZ2VyIHRvIGNhcHR1cmUgc3RhY2sgdHJhY2UiKSxTbigpKTooZG4oIkNhcHR1cmluZyBldmVudCB3aXRob3V0IGEgc3RhY2sgdHJhY2UiKSxfbigpLnRoZW4obnVsbCwoKT0+e2RuKCJTZW5kaW5nIEFOUiBldmVudCBmYWlsZWQgb24gd2F0Y2hkb2cgdGltZW91dC4iKX0pKX0pO2U/Lm9uKCJtZXNzYWdlIix0PT57dC5zZXNzaW9uJiYoZm49SCh0LnNlc3Npb24pKSx0LmRlYnVnSW1hZ2VzJiYocG49dC5kZWJ1Z0ltYWdlcyksd24oKX0pOw==`,eN=50,tN=5e3;function nN(e,...t){A.log(`[ANR] ${e}`,...t)}function rN(){return O}function iN(){let e=qo(N(),M());return e.attachments=[],e.eventProcessors=[],e}async function aN(e){let t={message:`ANR`},n={};for(let r of e.getEventProcessors()){if(t===null)break;t=await r(t,n)}return t?.contexts||{}}var oN=`Anr`,sN=W(((e={})=>{if(PT.major<16||PT.major===16&&PT.minor<17)throw Error(`ANR detection requires Node 16.17.0 or later`);let t,n,r=rN();return r.__SENTRY_GET_SCOPES__=iN,{name:oN,startWorker:()=>{t||n&&(t=cN(n,e))},stopWorker:()=>{t&&t.then(e=>{e(),t=void 0})},async setup(t){n=t,e.captureStackTrace&&await Cj()&&(A.warn(`ANR captureStackTrace has been disabled because the debugger was already enabled`),e.captureStackTrace=!1),setImmediate(()=>this.startWorker())}}}));async function cN(e,t){let n=e.getDsn();if(!n)return()=>{};let r=await aN(e);delete r.app?.app_memory,delete r.device?.free_memory;let i=e.getOptions(),a=e.getSdkMetadata()||{};a.sdk&&(a.sdk.integrations=i.integrations.map(e=>e.name));let o={debug:A.isEnabled(),dsn:n,tunnel:i.tunnel,environment:i.environment||`production`,release:i.release,dist:i.dist,sdkMetadata:a,appRootPath:t.appRootPath,pollInterval:t.pollInterval||eN,anrThreshold:t.anrThreshold||tN,captureStackTrace:!!t.captureStackTrace,maxAnrEvents:t.maxAnrEvents||1,staticTags:t.staticTags||{},contexts:r};if(o.captureStackTrace){let e=await import(`node:inspector`);e.url()||e.open(0)}let s=new Ke(new URL(`data:application/javascript;base64,${$M}`),{workerData:o,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on(`exit`,()=>{s.terminate()});let c=setInterval(()=>{try{let e=N().getSession(),t=e?{...e,toJSON:void 0}:void 0;s.postMessage({session:t,debugImages:zl(i.stackParser)})}catch{}},o.pollInterval);return c.unref(),s.on(`message`,e=>{e===`session-ended`&&(nN(`ANR event sent from ANR worker. Clearing session in this thread.`),N().setSession(void 0))}),s.once(`error`,e=>{clearInterval(c),nN(`ANR worker error`,e)}),s.once(`exit`,e=>{clearInterval(c),nN(`ANR worker exit`,e)}),s.unref(),()=>{s.terminate(),clearInterval(c)}}function lN(e){let t=P()?.getIntegrationByName(oN);if(!t)return e();t.stopWorker();let n=e();return QM(n)?n.finally(()=>t.startWorker()):(t.startWorker(),n)}function uN(e,...t){let[n,r,i,a]=t;if(Array.isArray(r)){let t={...i};t[`sentry.message.template`]=n,r.forEach((e,n)=>{t[`sentry.message.parameter.${n}`]=e}),Ju({level:e,message:Ie(n,...r),attributes:t},a?.scope)}else Ju({level:e,message:n,attributes:r},i?.scope??a?.scope)}var dN=f({debug:()=>pN,error:()=>gN,fatal:()=>_N,fmt:()=>Cf,info:()=>mN,trace:()=>fN,warn:()=>hN});function fN(...e){uN(`trace`,...e)}function pN(...e){uN(`debug`,...e)}function mN(...e){uN(`info`,...e)}function hN(...e){uN(`warn`,...e)}function gN(...e){uN(`error`,...e)}function _N(...e){uN(`fatal`,...e)}var vN=`NodeRuntimeMetrics`,yN=3e4,bN=1e3,xN=10;function SN(e,t,n){return Number.isFinite(e)?e<bN?(console.warn(`[Sentry] ${t}: collectionIntervalMs (${e}) is below the minimum of ${bN}ms. Using minimum of ${bN}ms.`),bN):e:(console.warn(`[Sentry] ${t}: collectionIntervalMs (${e}) is invalid. Using default of ${n}ms.`),n)}var CN=W((e={})=>{let t=SN(e.collectionIntervalMs??yN,vN,yN),n={cpuUtilization:!0,memHeapUsed:!0,memHeapTotal:!0,memRss:!0,eventLoopDelayP50:!0,eventLoopDelayP99:!0,eventLoopUtilization:!0,uptime:!0,cpuTime:!1,memExternal:!1,eventLoopDelayMin:!1,eventLoopDelayMax:!1,eventLoopDelayMean:!1,eventLoopDelayP90:!1,...e.collect},r=n.eventLoopDelayP99||n.eventLoopDelayMin||n.eventLoopDelayMax||n.eventLoopDelayMean||n.eventLoopDelayP50||n.eventLoopDelayP90,i=n.cpuUtilization||n.cpuTime,a,o,s,c=0,l,u=xN*1e6,d=e=>Math.max(0,(e-u)/1e9),f={attributes:{"sentry.origin":`auto.node.runtime_metrics`}},p={unit:`byte`,attributes:{"sentry.origin":`auto.node.runtime_metrics`}},m={unit:`second`,attributes:{"sentry.origin":`auto.node.runtime_metrics`}};function h(){let e=an(),t=e-c;if(i&&o!==void 0){let e=process.cpuUsage(o);n.cpuTime&&(vh(`node.runtime.cpu.user`,e.user/1e6,m),vh(`node.runtime.cpu.system`,e.system/1e6,m)),n.cpuUtilization&&t>0&&vh(`node.runtime.cpu.utilization`,(e.user+e.system)/(t*1e3),f),o=process.cpuUsage()}if(n.memRss||n.memHeapUsed||n.memHeapTotal||n.memExternal){let e=process.memoryUsage();n.memRss&&vh(`node.runtime.mem.rss`,e.rss,p),n.memHeapUsed&&vh(`node.runtime.mem.heap_used`,e.heapUsed,p),n.memHeapTotal&&vh(`node.runtime.mem.heap_total`,e.heapTotal,p),n.memExternal&&(vh(`node.runtime.mem.external`,e.external,p),vh(`node.runtime.mem.array_buffers`,e.arrayBuffers,p))}if(r&&l&&(n.eventLoopDelayMin&&vh(`node.runtime.event_loop.delay.min`,d(l.min),m),n.eventLoopDelayMax&&vh(`node.runtime.event_loop.delay.max`,d(l.max),m),n.eventLoopDelayMean&&vh(`node.runtime.event_loop.delay.mean`,d(l.mean),m),n.eventLoopDelayP50&&vh(`node.runtime.event_loop.delay.p50`,d(l.percentile(50)),m),n.eventLoopDelayP90&&vh(`node.runtime.event_loop.delay.p90`,d(l.percentile(90)),m),n.eventLoopDelayP99&&vh(`node.runtime.event_loop.delay.p99`,d(l.percentile(99)),m),l.reset()),n.eventLoopUtilization&&s!==void 0){let e=nt.eventLoopUtilization();vh(`node.runtime.event_loop.utilization`,nt.eventLoopUtilization(e,s).utilization,f),s=e}n.uptime&&t>0&&_h(`node.runtime.process.uptime`,t/1e3,m),c=e}return{name:vN,setup(){if(r){l?.disable();try{l=tt({resolution:xN}),l.enable()}catch{l=void 0}}i&&(o=process.cpuUsage()),n.eventLoopUtilization&&(s=nt.eventLoopUtilization()),c=an(),a&&clearInterval(a),a=bu(setInterval(h,t))}}}),wN=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`],TN=Symbol.for(`level`),EN=Symbol.for(`message`),DN=Symbol.for(`splat`);function ON(e,t){class n extends e{constructor(e){super(e),this._levels=new Set(t?.levels??wN)}log(e,n){try{if(setImmediate(()=>{this.emit(`logged`,e)}),!j(e))return;let n=e[TN],{level:r,message:i,timestamp:a,...o}=e;o[TN]=void 0,o[EN]=void 0,o[DN]=void 0;let s=t?.customLevelMap?.[n],c=kN[n],l=s??c??`info`;this._levels.has(l)?uN(l,i,{...o,"sentry.origin":`auto.log.winston`}):!s&&!c&&QC&&A.log(`Winston log level ${n} is not captured by Sentry. Please add ${n} to the "customLevelMap" option of the Sentry Winston transport.`)}catch{}n&&n()}}return n}var kN={silly:`trace`,debug:`debug`,verbose:`debug`,http:`debug`,info:`info`,notice:`info`,warn:`warn`,warning:`warn`,error:`error`,emerg:`fatal`,alert:`fatal`,crit:`fatal`},AN=Symbol(`sentry-track-pino-logger`);function jN(e,t,n){let r=Object.getOwnPropertySymbols(e),i=`Symbol(${t})`;for(let t of r)if(t.toString()===i){let r=e[t];return typeof r==`string`?r:n}return n}var MN={error:{levels:[],handled:!0},log:{levels:[`trace`,`debug`,`info`,`warn`,`error`,`fatal`]}};function NN(e){let{level:t,time:n,pid:r,hostname:i,...a}=e;return a}var PN=W((e={})=>{let t={autoInstrument:e.autoInstrument!==!1,error:{...MN.error,...e.error},log:{...MN.log,...e.log}};function n(e){let n=e[AN];return n===`track`||n!==`ignore`&&t.autoInstrument}return{name:`Pino`,setup:e=>{let r=!!e.getOptions().enableLogs,i=C.tracingChannel(`pino_asJson`);function a(e,i,a){if(!n(e))return;let o=NN(a),[s,c,l]=i,u=e?.levels?.labels?.[l]||`info`,d=jN(e,`pino.messageKey`,`msg`),f=c||o?.[d]||``;if(r&&t.log.levels.includes(u)&&Ju({level:u,message:f,attributes:{...o,"sentry.origin":`auto.log.pino`,"pino.logger.level":l}}),t.error.levels.includes(u)){let n=jN(e,`pino.errorKey`,`err`),r={};for(let[e,t]of Object.entries(o))e!==n&&e!==d&&(r[e]=t);f&&(r[d]=f);let i={level:Hp(u),contexts:{pino:r}};Er(e=>{e.addEventProcessor(e=>(e.logger=`pino`,Nn(e,{handled:t.error.handled,type:`auto.log.pino`}),e));let r=s[n];if(r){H(r,i);return}Zl(f,i)})}}i.end.subscribe(e=>{let{instance:t,arguments:n,result:r}=e;a(t,n,JSON.parse(r))})}}}),FN=Object.assign(PN,{trackLogger(e){j(e)&&`levels`in e&&(e[AN]=`track`)},untrackLogger(e){j(e)&&`levels`in e&&(e[AN]=`ignore`)}});function IN(e,t){e.setAttribute(I,t)}var LN=[[`january`,`1`],[`february`,`2`],[`march`,`3`],[`april`,`4`],[`may`,`5`],[`june`,`6`],[`july`,`7`],[`august`,`8`],[`september`,`9`],[`october`,`10`],[`november`,`11`],[`december`,`12`],[`jan`,`1`],[`feb`,`2`],[`mar`,`3`],[`apr`,`4`],[`may`,`5`],[`jun`,`6`],[`jul`,`7`],[`aug`,`8`],[`sep`,`9`],[`oct`,`10`],[`nov`,`11`],[`dec`,`12`],[`sunday`,`0`],[`monday`,`1`],[`tuesday`,`2`],[`wednesday`,`3`],[`thursday`,`4`],[`friday`,`5`],[`saturday`,`6`],[`sun`,`0`],[`mon`,`1`],[`tue`,`2`],[`wed`,`3`],[`thu`,`4`],[`fri`,`5`],[`sat`,`6`]];function RN(e){return LN.reduce((e,[t,n])=>e.replace(new RegExp(t,`gi`),n),e)}var zN=`Automatic instrumentation of CronJob only supports crontab string`;function BN(e,t){let n=!1;return new Proxy(e,{construct(e,r){let[i,a,o,s,c,...l]=r;if(typeof i!=`string`)throw Error(zN);if(n)throw Error(`A job named '${t}' has already been scheduled`);n=!0;let u=RN(i);async function d(e,n){return vu(t,async()=>{try{await a(e,n)}catch(e){throw H(e,{mechanism:{handled:!1,type:`auto.function.cron.instrumentCron`}}),e}},{schedule:{type:`crontab`,value:u},timezone:c||void 0})}return new e(i,d,o,s,c,...l)},get(e,r){return r===`from`?r=>{let{cronTime:i,onTick:a,timeZone:o}=r;if(typeof i!=`string`)throw Error(zN);if(n)throw Error(`A job named '${t}' has already been scheduled`);n=!0;let s=RN(i);return r.onTick=async(e,n)=>vu(t,async()=>{try{await a(e,n)}catch(e){throw H(e,{mechanism:{handled:!1,type:`auto.function.cron.instrumentCron`}}),e}},{schedule:{type:`crontab`,value:s},timezone:o||void 0}),e.from(r)}:e[r]}})}function VN(e,t={}){return new Proxy(e,{get(e,n){return n===`schedule`&&e.schedule?new Proxy(e.schedule,{apply(e,n,r){let[i,a,o]=r,s=o?.name,c=o?.timezone;if(!s)throw Error(`Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.`);return e.apply(n,[i,async(...e)=>vu(s,async()=>{try{return await a(...e)}catch(e){throw H(e,{mechanism:{handled:!1,type:`auto.function.node-cron.instrumentNodeCron`}}),e}},{schedule:{type:`crontab`,value:RN(i)},timezone:c,...t}),o])}}):e[n]}})}function HN(e){return new Proxy(e,{get(e,t){return t===`scheduleJob`?new Proxy(e.scheduleJob,{apply(e,t,n){let[r,i,a]=n;if(typeof r!=`string`||typeof i!=`string`||typeof a!=`function`)throw Error(`Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string`);let o=r,s=i;async function c(){return vu(o,async()=>{await a?.()},{schedule:{type:`crontab`,value:RN(s)}})}return e.apply(t,[o,s,c])}}):e[t]}})}var UN={instrumentCron:BN,instrumentNodeCron:VN,instrumentNodeSchedule:HN},WN=`Http`,GN=Object.assign(RT,{id:`${WN}.sentry`}),KN=W((e={})=>{let t=e.spans??!0,n=e.disableIncomingRequestSpans,r=t&&!n,i={sessions:e.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:e.sessionFlushingDelayMS,ignoreRequestBody:e.ignoreIncomingRequestBody,maxRequestBodySize:e.maxIncomingRequestBodySize},a={ignoreIncomingRequests:e.ignoreIncomingRequests,ignoreStaticAssets:e.ignoreStaticAssets,ignoreStatusCodes:e.dropSpansForIncomingRequestStatusCodes,instrumentation:e.instrumentation,onSpanCreated:e.incomingRequestSpanHook},o=nw(i),s=sw(a);return{name:WN,setup(e){let t=e.getOptions();r&&sa(t)&&s.setup(e)},setupOnce(){o.setupOnce(),RT({breadcrumbs:e.breadcrumbs,spans:t,propagateTraceInOutgoingRequests:e.tracePropagation??!0,createSpansForOutgoingRequests:t,ignoreOutgoingRequests:e.ignoreOutgoingRequests,outgoingRequestHook:(t,n)=>{let r=xC(n);if(r.startsWith(`data:`)){let e=xf(r);t.setAttribute(`http.url`,e),t.setAttribute(gl,e),t.updateName(`${n.method||`GET`} ${e}`)}e.instrumentation?.requestHook?.(t,n)},outgoingResponseHook:e.instrumentation?.responseHook,outgoingRequestApplyCustomAttributes:e.instrumentation?.applyCustomAttributesOnSpan})},processEvent(e){return s.processEvent(e)}}}),qN=W(((e={})=>({name:`NodeFetch`,setupOnce(){let t=P()?.getOptions();sE({...e,spans:JN(e,t)})}})));function JN(e,t={}){return e.spans??(!t.skipOpenTelemetrySetup&&sa(t))}var YN=`access.appendFile.chmod.chown.copyFile.cp.lchown.link.lstat.lutimes.mkdir.mkdtemp.open.opendir.readdir.readFile.readlink.realpath.rename.rm.rmdir.stat.symlink.truncate.unlink.utimes.writeFile`.split(`.`),XN=`access,appendFile,chmod,chown,copyFile,cp,exists,lchown,link,lstat,lutimes,mkdir,mkdtemp,open,opendir,readdir,readFile,readlink,realpath,realpath.native,rename,rm,rmdir,stat,symlink,truncate,unlink,utimes,writeFile`.split(`,`),ZN=`accessSync,appendFileSync,chmodSync,chownSync,copyFileSync,cpSync,existsSync,lchownSync,linkSync,lstatSync,lutimesSync,mkdirSync,mkdtempSync,opendirSync,openSync,readdirSync,readFileSync,readlinkSync,realpathSync,realpathSync.native,renameSync,rmdirSync,rmSync,statSync,symlinkSync,truncateSync,unlinkSync,utimesSync,writeFileSync`.split(`,`);function QN(e){let t=e.split(`.`);if(t.length>1){if(t.length!==2)throw Error(`Invalid member function name ${e}`);return t}return[e]}function $N(e,t){if(!t)throw Error(JSON.stringify({member:t}));let[n,r]=QN(t);return r?{objectToPatch:e[n],functionNameToPatch:r}:{objectToPatch:e,functionNameToPatch:n}}var eP=`auto.file.fs`,tP=`file`,nP=[`rename`,`renameSync`],rP=[`copyFile`,`cp`,`copyFileSync`,`cpSync`],iP=[`link`,`linkSync`],aP=[`mkdtemp`,`mkdtempSync`],oP=[`symlink`,`symlinkSync`],sP=`access,appendFile,chmod,chown,exists,mkdir,lchown,lstat,lutimes,open,opendir,readdir,readFile,readlink,realpath,realpath.native,rm,rmdir,stat,truncate,unlink,utimes,writeFile,accessSync,appendFileSync,chmodSync,chownSync,existsSync,lchownSync,lstatSync,lutimesSync,opendirSync,mkdirSync,openSync,readdirSync,readFileSync,readlinkSync,realpathSync,realpathSync.native,rmdirSync,rmSync,statSync,truncateSync,unlinkSync,utimesSync,writeFileSync`.split(`,`);function cP(e,t,n){let r={[F]:tP,[I]:eP};return n.recordFilePaths&&(typeof t[0]==`string`&&sP.includes(e)?r.path_argument=t[0]:typeof t[0]==`string`&&typeof t[1]==`string`?oP.includes(e)?(r.target_argument=t[0],r.path_argument=t[1]):iP.includes(e)?(r.existing_path_argument=t[0],r.new_path_argument=t[1]):rP.includes(e)?(r.src_argument=t[0],r.dest_argument=t[1]):nP.includes(e)&&(r.old_path_argument=t[0],r.new_path_argument=t[1]):typeof t[0]==`string`&&aP.includes(e)&&(r.prefix_argument=t[0])),r}function lP(e,t){return Object.assign(e,t)}var uP=new WeakMap;function dP(e,t,n){let r=e[t];if(typeof r!=`function`)return;let i=uP.get(e);i||(i=new Set,uP.set(e,i)),!i.has(t)&&(i.add(t),e[t]=n(r))}function fP(e,t,n){return lP(function(...r){let i=cP(e,r,n);return z({name:`fs.${e}`,onlyIfParent:!0,attributes:i},e=>{try{return uo(()=>t.apply(this,r))}catch(t){throw _P(e,t,n),t}})},t)}function pP(e,t,n){return lP(function(...r){let i=r.length-1,a=r[i];if(typeof a!=`function`)return t.apply(this,r);let o=cP(e,r,n),s=B({name:`fs.${e}`,onlyIfParent:!0,attributes:o}),c=R();r[i]=function(...e){let t=e[0];return t&&_P(s,t,n),s.end(),c?V(c,()=>a.apply(this,e)):a.apply(this,e)};try{return uo(()=>t.apply(this,r))}catch(e){throw _P(s,e,n),s.end(),e}},t)}function mP(e,t){let n=`exists`,r=lP(function(...r){let i=r.length-1,a=r[i];if(typeof a!=`function`)return e.apply(this,r);let o=cP(n,r,t),s=B({name:`fs.${n}`,onlyIfParent:!0,attributes:o}),c=R();r[i]=function(...e){return s.end(),c?V(c,()=>a.apply(this,e)):a.apply(this,e)};try{return uo(()=>e.apply(this,r))}catch(e){throw _P(s,e,t),s.end(),e}},e),i=function(e){return new Promise(t=>r(e,t))};return Object.defineProperty(i,"name",{value:n}),Object.defineProperty(r,ye.custom,{value:i}),r}function hP(e,t,n){return lP(async function(...r){let i=cP(e,r,n);return z({name:`fs.${e}`,onlyIfParent:!0,attributes:i},async e=>{try{return await uo(()=>t.apply(this,r))}catch(t){throw _P(e,t,n),t}})},t)}function gP(e={}){for(let t of ZN){let{objectToPatch:n,functionNameToPatch:r}=$N(xe,t);dP(n,r,n=>fP(t,n,e))}for(let t of XN){let{objectToPatch:n,functionNameToPatch:r}=$N(xe,t);t===`exists`?dP(n,r,t=>mP(t,e)):dP(n,r,n=>pP(t,n,e))}let t=xe.promises;for(let n of YN)dP(t,n,t=>hP(n,t,e))}function _P(e,t,n){e.setStatus({code:2,message:`internal_error`}),n.recordErrorMessagesAsSpanAttributes&&t instanceof Error&&e.setAttribute(`fs_error`,t.message)}var vP=`FileSystem`,yP=W((e={})=>({name:vP,setupOnce(){gP(e)}})),bP=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function xP(e){let t=R();if(!t)return;let n=ra(t);n&&L(n).data[`sentry.op`]===`http.server`&&n.setAttribute(`http.route`,e)}var SP=`Express`,CP=[`>=4.0.0 <6`];function wP(e,t){ZS(e,t),ZM(e.use,`express`)}var TP=Y(SP,e=>new EP(e)),EP=class extends q{constructor(e={}){super(`sentry-express`,k,e)}init(){return new J(`express`,CP,e=>{try{JS(e,()=>({...this.getConfig(),onRouteResolved(e){e&&xP(e)}}))}catch(e){bP&&A.error(`Failed to patch express module:`,e)}return e},e=>e)}},DP=W((e=>({name:SP,setupOnce(){TP(e)},getShouldHandleError(){return e?.shouldHandleError}}))),OP=(e=>(e.FASTIFY_NAME=`fastify.name`,e.FASTIFY_TYPE=`fastify.type`,e.HOOK_NAME=`hook.name`,e.PLUGIN_NAME=`plugin.name`,e))(OP||{}),kP=(e=>(e.MIDDLEWARE=`middleware`,e.REQUEST_HANDLER=`request_handler`,e))(kP||{}),AP=(e=>(e.MIDDLEWARE=`middleware`,e.REQUEST_HANDLER=`request handler`,e))(AP||{}),jP=Symbol(`opentelemetry.instrumentation.fastify.request_active_span`);x();function MP(e,t,n,r={}){let i=t.startSpan(n,{attributes:r}),a=e[jP]||[];return a.push(i),Object.defineProperty(e,jP,{enumerable:!1,configurable:!0,value:a}),i}function NP(e,t){let n=e[jP]||[];n.length&&(n.forEach(e=>{t&&(e.setStatus({code:oe.ERROR,message:t.message}),e.recordException(t)),e.end()}),delete e[jP])}function PP(e,t,n){let r,i;try{i=e(),FP(i)&&i.then(e=>t(void 0,e),e=>t(e))}catch(e){r=e}finally{if(!FP(i)&&(t(r,i),r))throw r;return i}}function FP(e){return typeof e==`object`&&e&&typeof Object.getOwnPropertyDescriptor(e,`then`)?.value==`function`||!1}x();var IP=`@sentry/instrumentation-fastify-v3`,LP=`anonymous`,RP=new Set([`onTimeout`,`onRequest`,`preParsing`,`preValidation`,`preSerialization`,`preHandler`,`onSend`,`onResponse`,`onError`]),zP=class extends q{constructor(e={}){super(IP,k,e)}init(){return[new J(`fastify`,[`>=3.0.0 <3.21.0`],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(t,n,r){if(!e.isEnabled())return r();e._wrap(n,`send`,e._patchSend());let i=t,a=i.routeOptions?i.routeOptions.url:t.routerPath;a&&xP(a);let o=t.method||`GET`;N().setTransactionName(`${o} ${a}`),r()}}_wrapHandler(e,t,n,r){let i=this;return this._diag.debug(`Patching fastify route.handler function`),function(...a){if(!i.isEnabled())return n.apply(this,a);let o=n.name||e||LP,s=`${AP.MIDDLEWARE} - ${o}`,c=a[1],u=MP(c,i.tracer,s,{[OP.FASTIFY_TYPE]:kP.MIDDLEWARE,[OP.PLUGIN_NAME]:e,[OP.HOOK_NAME]:t}),d=r&&a[a.length-1];return d&&(a[a.length-1]=function(...e){NP(c),d.apply(this,e)}),l.with(_.setSpan(l.active(),u),()=>PP(()=>n.apply(this,a),e=>{e instanceof Error&&(u.setStatus({code:oe.ERROR,message:e.message}),u.recordException(e)),r||NP(c)}))}}_wrapAddHook(){let e=this;return this._diag.debug(`Patching fastify server.addHook function`),function(t){return function(...n){let r=n[0],i=n[1],a=this.pluginName;if(!RP.has(r))return t.apply(this,n);let o=typeof n[n.length-1]==`function`&&i.constructor.name!==`AsyncFunction`;return t.apply(this,[r,e._wrapHandler(a,r,i,o)])}}}_patchConstructor(e){let t=this;function n(...n){let r=e.fastify.apply(this,n);return r.addHook(`onRequest`,t._hookOnRequest()),r.addHook(`preHandler`,t._hookPreHandler()),BP(),t._wrap(r,`addHook`,t._wrapAddHook()),r}return e.errorCodes!==void 0&&(n.errorCodes=e.errorCodes),n.fastify=n,n.default=n,n}_patchSend(){let e=this;return this._diag.debug(`Patching fastify reply.send function`),function(t){return function(...n){let r=n[0];return e.isEnabled()?jT(()=>t.apply(this,n),e=>{!e&&r instanceof Error&&(e=r),NP(this,e)}):t.apply(this,n)}}}_hookPreHandler(){let e=this;return this._diag.debug(`Patching fastify preHandler function`),function(t,n,r){if(!e.isEnabled())return r();let i=t,a=i.routeOptions?.handler||i.context?.handler,o=a?.name.startsWith(`bound `)?a.name.substring(6):a?.name,s=`${AP.REQUEST_HANDLER} - ${o||this.pluginName||LP}`,c={[OP.PLUGIN_NAME]:this.pluginName,[OP.FASTIFY_TYPE]:kP.REQUEST_HANDLER,[Oc]:i.routeOptions?i.routeOptions.url:t.routerPath};o&&(c[OP.FASTIFY_NAME]=o);let u=MP(n,e.tracer,s,c);VP(u);let{requestHook:d}=e.getConfig();return d&&jT(()=>d(u,{request:t}),t=>{t&&e._diag.error(`request hook failed`,t)},!0),l.with(_.setSpan(l.active(),u),()=>{r()})}}};function BP(){let e=P();e&&e.on(`spanStart`,e=>{VP(e)})}function VP(e){let t=L(e).data,n=t[`fastify.type`];if(t[`sentry.op`]||!n)return;e.setAttributes({[I]:`auto.http.otel.fastify`,[F]:`${n}.fastify`});let r=t[`fastify.name`]||t[`plugin.name`]||t[`hook.name`];if(typeof r==`string`){let t=r.replace(/^fastify -> /,``).replace(/^@fastify\/otel -> /,``);e.updateName(t)}}var HP=`execute_tool`,UP=`invoke_agent`,WP=`graphql`,X=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,GP=()=>{};function Z(e,t,n){let r=KP(e,t,n),i=n?.beforeSpanEnd,a=n?.deferSpanEnd,o=e=>typeof n?.captureError==`function`?n.captureError(e):{mechanism:{type:`auto.diagnostic_channels.bind_span`,handled:!1}},s=(e,t)=>{n?.captureError&&H(t,o(t));let{message:r,attributes:i}=JP(t);e.setStatus({code:2,message:r}),e.setAttributes(i)},c=(e,t)=>{let n=!1;return r=>{n||(n=!0,r!==void 0&&s(e,r),qP(t,i))}},l={start:GP,asyncStart:GP,end(e){if(`error`in e||`result`in e){let t=e._sentrySpan;if(t&&a?.({span:t,data:e,end:c(t,e)}))return;qP(e,i)}},error(e){let t=e._sentrySpan;t&&s(t,e.error)},asyncEnd(e){let t=e._sentrySpan;t&&a?.({span:t,data:e,end:c(t,e)})||qP(e,i)}};return r.channel.subscribe(l),{channel:r.channel,unbind:()=>{r.channel.unsubscribe(l),r.unbind()}}}function KP(e,t,n){let r=_r(it()).getTracingChannelBinding?.();if(!r)return X&&A.log(`[TracingChannel] Could not access async context binding.`),{channel:e,unbind:GP};let i=r.asyncLocalStorage;return e.start.bindStore(i,e=>{e._sentryCallerStore=i.getStore();let a=!n?.requiresParentSpan||R()?t(e):void 0;return a?(e._sentrySpan=a,r.getStoreWithActiveSpan(a)):e._sentryCallerStore}),e.asyncStart.bindStore(i,e=>e._sentryCallerStore),{channel:e,unbind:()=>{e.start.unbindStore(i),e.asyncStart.unbindStore(i)}}}function qP(e,t){let n=e._sentrySpan;n&&(t?.(n,e),n.end())}function JP(e){let t=j(e),n=t?`message`in e?e.message:void 0:e,r=n?String(n):void 0,i=t&&`name`in e?String(e.name):`unknown`;return{message:r,attributes:{[Us]:i}}}var YP=`original-description`,XP=new Set([`Int`,`Float`,`String`,`BlockString`]);function ZP(e,t,n){let r=ra(e);if(r===e)return;let i=L(r),a=n?`${t} ${n}`:t,o=i.data[il],s;s=Array.isArray(o)?[...o,a]:typeof o==`string`?[o,a]:a,r.setAttribute(il,s);let c=i.data[YP]??i.description;i.data[YP]||r.setAttribute(YP,c),r.updateName(`${c} (${QP(s)})`)}function QP(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(`, `):`${t.slice(0,5).join(`, `)}, +${t.length-5}`}return e}function $P(e,t,n){return e&&t?`${e} ${t}`:e||n}function eF(e){if(j(e)&&`errors`in e){let t=e.errors;return Array.isArray(t)&&t.length>0}return!1}function tF(e){let t=e?.loc,n=t?.source?.body;if(typeof n==`string`&&t?.startToken)try{let e=[];for(let n=t.startToken;n;n=n.next)XP.has(n.kind)&&e.push({start:n.start,end:n.end,kind:n.kind});let r=n;for(let t=e.length-1;t>=0;t--){let{start:n,end:i,kind:a}=e[t],o=a===`String`||a===`BlockString`?`"*"`:`*`;r=r.slice(0,n)+o+r.slice(i)}return r}catch{return}}function nF(e){if(P()?.getDataCollectionOptions().graphQL.document===!0)return tF(e)}var rF=`graphql:parse`,iF=`graphql:validate`,aF=`graphql:execute`,oF=`graphql:subscribe`,sF=`graphql:resolve`,cF=`auto.graphql.diagnostic_channel`,lF=`graphql.parse`,uF=`graphql.validate`,dF=`graphql.execute`,fF=`graphql.subscribe`,pF=`graphql.resolve`,mF=`graphql.field.name`,hF=`graphql.field.path`,gF=`graphql.field.type`,_F=`graphql.parent.name`;function vF(e,t={}){let n=t.ignoreResolveSpans!==!1,r=t.ignoreTrivialResolveSpans!==!1,i=t.useOperationNameForRootSpan!==!1;yF(e),bF(e),xF(e,aF,dF,i),xF(e,oF,fF,i),n||SF(e,r)}function yF(e){Z(e(rF),()=>B({name:lF,attributes:{[I]:cF,[F]:WP}}))}function bF(e){Z(e(iF),e=>B({name:uF,attributes:{[I]:cF,[F]:WP,[yc]:nF(e.document)}}),{beforeSpanEnd:(e,t)=>{Array.isArray(t.result)&&t.result.length>0&&e.setStatus({code:2,message:`invalid_argument`})}})}function xF(e,t,n,r){Z(e(t),e=>{let t=B({name:$P(e.operationType,e.operationName,n),attributes:{[I]:cF,[F]:WP,[xc]:e.operationType,[bc]:e.operationName||void 0,[yc]:nF(e.document)}});return r&&e.operationType&&ZP(t,e.operationType,e.operationName),t},{beforeSpanEnd:(e,t)=>{eF(t.result)&&e.setStatus({code:2,message:`internal_error`})}})}function SF(e,t){Z(e(sF),e=>{if(!(t&&e.isDefaultResolver))return B({name:`${pF} ${e.fieldPath}`,attributes:{[I]:cF,[F]:WP,[mF]:e.fieldName,[hF]:e.fieldPath,[gF]:e.fieldType,[_F]:e.parentType}})})}var CF=W(((e={})=>({name:`Graphql`,setupOnce(){C.tracingChannel&&U(()=>{vF(C.tracingChannel,e)})}}))),wF=`mongoose:query`,TF=`mongoose:aggregate`,EF=`mongoose:model:save`,DF=`mongoose:model:insertMany`,OF=`mongoose:model:bulkWrite`,kF=`mongoose:cursor:next`,AF=`auto.db.mongoose.diagnostic_channel`,jF=`mongodb`,MF=10,NF=!1;function PF(e){if(!NF){NF=!0;try{FF(e,wF),FF(e,TF),FF(e,EF),FF(e,DF),FF(e,OF),FF(e,kF)}catch{X&&A.log(`Mongoose node:diagnostics_channel subscription failed.`)}}}function FF(e,t){Z(e(t),e=>{let t=e.collection,n=LF(e.args?.pipeline??e.args?.filter),r=IF(e);return B({name:t?`mongoose.${t}.${e.operation}`:`mongoose.${e.operation}`,attributes:{[I]:AF,[F]:`db`,[Vs]:jF,[Ls]:e.operation,[Ms]:t??void 0,[Ps]:e.database??void 0,[Rs]:n??void 0,[Is]:r??void 0,[fl]:e.serverAddress??void 0,[pl]:e.serverPort??void 0}})})}function IF(e){let t=e.args,n=e.operation===`insertMany`?t?.docs:e.operation===`bulkWrite`?t?.ops:void 0;return Array.isArray(n)&&n.length>1?n.length:void 0}function LF(e){if(e!=null)try{let t=RF(e,0),n=JSON.stringify(t);return n==null||n===`{}`||n===`[]`?void 0:n}catch{return}}function RF(e,t){if(t>MF)return`?`;if(Array.isArray(e))return e.map(e=>RF(e,t+1));if(j(e)){let n={};for(let r of Object.keys(e))n[r]=RF(e[r],t+1);return n}return`?`}var zF=W((()=>({name:`Mongoose`,setupOnce(){C.tracingChannel&&U(()=>{PF(C.tracingChannel)})}}))),BF=`db.system`,VF=`db.name`,HF=`db.operation`,UF=`db.statement`,WF=`db.mongodb.collection`,GF=`db.connection_string`,KF=`net.peer.name`,qF=`net.peer.port`,JF=`mongodb`;function YF(e){return JSON.stringify(XF(e))}function XF(e){return Array.isArray(e)?e.map(e=>XF(e)):ZF(e)?Object.entries(e).map(([e,t])=>[e,XF(t)]).reduce((e,t)=>($F(t)&&(e[t[0]]=t[1]),e),{}):`?`}function ZF(e){return j(e)&&!QF(e)}function QF(e){return typeof Buffer<`u`&&Buffer.isBuffer(e)}function $F(e){return Array.isArray(e)}function eI(e,t,n,r,i){let a,o;if(e){let t=typeof e.address==`string`?e.address.split(`:`):``;t.length===2&&(a=t[0],o=t[1])}let s;return s=n?.documents?.[0]?n.documents[0]:n?.cursors?n.cursors:n,tI(t.db,t.collection,a,o,s,r,i)}function tI(e,t,n,r,i,a,o){let s={[I]:o,[BF]:JF,[VF]:e,[WF]:t,[HF]:a,[GF]:`mongodb://${n}:${r}/${e}`};if(n&&r){s[KF]=n;let e=parseInt(r,10);isNaN(e)||(s[qF]=e)}if(i)try{s[UF]=YF(i)}catch{}return s}function nI(e){if(e.createIndexes!==void 0)return`createIndexes`;if(e.findandmodify!==void 0)return`findAndModify`;if(e.ismaster!==void 0)return`isMaster`;if(e.count!==void 0)return`count`;if(e.aggregate!==void 0)return`aggregate`}function rI(e,t,n,r,i){let a,o;if(t?.s&&(a=t.s.options?.host??t.s.host,o=(t.s.options?.port??t.s.port)?.toString(),a==null||o==null)){let e=t.description?.address;if(e){let t=e.split(`:`);a=t[0],o=t[1]}}let[s,c]=e.toString().split(`.`),l=n?.query??n?.q??n;return tI(s,c,a,o,l,r,i)}function iI(e){return B({name:`mongodb.${e[HF]||`command`}`,op:`db`,kind:G.CLIENT,attributes:e})}var aI=`mysql2:query`,oI=`mysql2:execute`,sI=`mysql2:connect`,cI=`mysql2:pool:connect`,lI=`auto.db.mysql2.diagnostic_channel`,uI=`mysql`,dI=/^\s*(\w+)/;function fI(e){pI(e,aI),pI(e,oI),mI(e,sI,`mysql2.connect`),mI(e,cI,`mysql2.pool.connect`)}function pI(e,t){Z(e(t),e=>{let t=e.query?dC(e.query):void 0,n=t?.match(dI)?.[1]?.toUpperCase();return B({name:t||`mysql2.query`,attributes:{[I]:lI,[F]:`db`,[Vs]:uI,[Rs]:t,[Ls]:n,[Ps]:e.database||void 0,[fl]:e.serverAddress,[pl]:e.serverPort}})},{requiresParentSpan:!0})}function mI(e,t,n){Z(e(t),e=>B({name:n,attributes:{[I]:lI,[F]:`db`,[Vs]:uI,[Ps]:e.database||void 0,[fl]:e.serverAddress,[pl]:e.serverPort}}),{requiresParentSpan:!0})}var hI=W((()=>({name:`Mysql2`,setupOnce(){C.tracingChannel&&U(()=>{fI(C.tracingChannel)})}}))),gI=`7`,_I=`PRISMA_INSTRUMENTATION`,vI=`V${gI}_PRISMA_INSTRUMENTATION`,yI=globalThis;function bI(e){let t={helper:e};yI[vI]=t,yI[_I]=t}var xI=(()=>{try{return process.env.PRISMA_SHOW_ALL_TRACES===`true`}catch{return!1}})(),SI=`00-10-10-00`,CI=`auto.db.otel.prisma`,wI=1e3,TI=new hb(wI),EI=[];function DI(e,t){TI.set(e,t)}function OI(e,t){let n={...t,[I]:CI};return e===`prisma:engine:db_query`&&n[`db.system`]==null&&(n[Bs]=`prisma`),n}function kI(e,t){let n=t[`db.query.text`];return(e===`prisma:engine:db_query`||e===`prisma:client:db_query`)&&typeof n==`string`?n:e}function AI(){let e=!0;for(;e;){e=!1;for(let t=EI.length-1;t>=0;t--){let n=EI[t],r=TI.get(n.parent_span_id);if(!r)continue;let i=OI(n.name,n.attributes),a=B({name:kI(n.name,i),attributes:i,kind:n.kind===`client`?G.CLIENT:G.INTERNAL,startTime:n.start_time,parentSpan:r});DI(n.span_id,a),n.links&&a.addLinks(n.links.flatMap(e=>{let t=TI.get(e.span_id);return t?[{context:t.spanContext()}]:[]})),a.end(n.end_time),EI.splice(t,1),e=!0}}}var jI=class{constructor({ignoreSpanTypes:e}){this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(e){let t=(e??R())?.spanContext();return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:SI}dispatchEngineSpans(e){let t=new Map,n=e.filter(e=>e.parentId===null);for(let r of n)MI(r,e,t,this.ignoreSpanTypes)}createEngineSpan(e){EI.push(...e.spans),AI();let t=EI.length-wI;t>0&&(X&&A.log(`[Prisma] Dropping ${t} unresolved v5 engine span(s) whose parent was never registered.`),EI.splice(0,t))}getActiveContext(){return R()}runInChildSpan(e,t){let n=typeof e==`string`?{name:e}:e;if(n.internal&&!xI)return t();let r=`prisma:client:${n.name}`;if(FI(r,this.ignoreSpanTypes))return t();let i=R(),a=OI(r,n.attributes),o={name:kI(r,a),attributes:a,kind:n.kind,links:n.links,startTime:n.startTime,parentSpan:i};if(n.active===!1){let e=B(o);return DI(e.spanContext().spanId,e),NI(e,()=>t(e,i))}return oo(o,e=>(DI(e.spanContext().spanId,e),NI(e,()=>t(e,i))))}};function MI(e,t,n,r){if(FI(e.name,r))return;let i=OI(e.name,e.attributes);oo({name:kI(e.name,i),attributes:i,kind:e.kind===`client`?G.CLIENT:G.INTERNAL,startTime:e.startTime},i=>{n.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(e=>{let t=n.get(e);return t?{context:{spanId:t,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=t.filter(t=>t.parentId===e.id);for(let e of a)MI(e,t,n,r);i.end(e.endTime)})}function NI(e,t){let n;try{n=t()}catch(t){throw e.end(),t}return PI(n)?n.then(t=>(e.end(),t),t=>{throw e.end(),t}):(e.end(),n)}function PI(e){return e!=null&&typeof e.then==`function`}function FI(e,t){return t.some(t=>typeof t==`string`?t===e:t.test(e))}var II=`Prisma`;function LI(e){bI(new jI({ignoreSpanTypes:e?.instrumentationConfig?.ignoreSpanTypes??[]}))}var RI=W((e=>({name:II,setupOnce(){LI(e)}}))),zI=`node-redis:command`,BI=`node-redis:batch`,VI=`node-redis:connect`,HI=`ioredis:command`,UI=`ioredis:connect`,WI=`auto.db.redis.diagnostic_channel`,GI=`redis`;function KI(e,t){qI(e,zI,e=>e.args.slice(1),t),JI(e,BI,e=>e.batchMode===`PIPELINE`?`PIPELINE`:`MULTI`),YI(e,VI),qI(e,HI,e=>e.args,t),YI(e,UI)}function qI(e,t,n,r){Z(e(t),e=>{let t=n(e),r=t.length?`${e.command} ${t.join(` `)}`:e.command;return B({name:`redis-${e.command}`,attributes:{[I]:WI,[F]:`db.redis`,[Vs]:GI,[Rs]:r,...e.serverAddress==null?{}:{[fl]:e.serverAddress},...e.serverPort==null?{}:{[pl]:e.serverPort}}})},{beforeSpanEnd(e,t){`error`in t||XI(r,e,t.command,n(t),t.result)}})}function JI(e,t,n){Z(e(t),e=>B({name:n(e),attributes:{[I]:WI,[F]:`db.redis`,[Vs]:GI,...Number(e.batchSize)>1?{[Is]:e.batchSize}:{},...e.serverAddress==null?{}:{[fl]:e.serverAddress},...e.serverPort==null?{}:{[pl]:e.serverPort}}}))}function YI(e,t){Z(e(t),e=>B({name:`redis-connect`,attributes:{[I]:WI,[F]:`db.redis.connect`,[Vs]:GI,...e.serverAddress==null?{}:{[fl]:e.serverAddress},...e.serverPort==null?{}:{[pl]:e.serverPort}}}))}function XI(e,t,n,r,i){if(e)try{e(t,n,r,i)}catch{}}var ZI=W(((e={})=>({name:`Redis`,setupOnce(){C.tracingChannel&&U(()=>{KI(C.tracingChannel,e.responseHook)})}}))),QI=[{regex:/^ECHO/i,args:0},{regex:/^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i,args:1},{regex:/^(HSET|HMSET|LSET|LINSERT)/i,args:2},{regex:/^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i,args:-1}],$I=(e,t)=>{if(Array.isArray(t)&&t.length){let n=QI.find(({regex:t})=>t.test(e))?.args??0,r=n>=0?t.slice(0,n):t.slice();return t.length>r.length&&r.push(`[${t.length-n} other arguments]`),`${e} ${r.join(` `)}`}return e};function Q(e){return typeof e==`string`?e:void 0}function eL(e){return typeof e==`number`&&!isNaN(e)?e:void 0}function tL(e,t){return e===void 0&&t===void 0?void 0:(e??0)+(t??0)}function nL(e){return j(e)&&typeof e.pipeThrough==`function`&&typeof e.getReader==`function`}function rL(e,t,n){let r=e.getReader(),i={toolCalls:[]},a=``,o=!1,s=()=>{o||(o=!0,a&&(i.text=a),t(i))},c=e=>{o||(o=!0,n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await r.read();if(t){s(),e.close();return}a+=iL(i,n)??``,e.enqueue(n)}catch(t){c(t),e.error(t)}},cancel(e){return s(),r.cancel(e)}})}function iL(e,t){if(!j(t))return;let{type:n,delta:r,textDelta:i,id:a,modelId:o,toolCallId:s,toolName:c,input:l,args:u,finishReason:d,usage:f,providerMetadata:p}=t;switch(n){case`text-delta`:{let e=r??i;return typeof e==`string`?e:void 0}case`tool-call`:e.toolCalls.push({toolCallId:s,toolName:c,input:l??u});return;case`response-metadata`:typeof a==`string`&&(e.responseId=a),typeof o==`string`&&(e.responseModel=o);return;case`finish`:e.finishReason=d,e.usage=f,p!==void 0&&(e.providerMetadata=p);return;default:return}}var aL=`ai:telemetry`,oL=`auto.vercelai.channel`,sL=`gen_ai.tool.call.id`,cL=`gen_ai.tool.description`,lL=`embeddings`,uL=`rerank`,dL=`generate_content`,fL=`WorkersAI`,pL=`vercel.ai.operationId`,mL=`vercel.ai.model.provider`,hL=`vercel.ai.settings.maxRetries`,gL=new Map,_L=new Map,vL=new Map,yL=new Set([`generateText`,`streamText`,`generateObject`,`embed`,`embedMany`,`rerank`]);function bL(e){if(!yL.has(e.type))return;let t=Q(e.event.callId);t&&xL(t)}function xL(e){gL.delete(e),_L.delete(e),vL.delete(e)}function SL(e,t){if(yL.has(t))for(let t of nv)delete e[t]}function CL(e,t){if(!e||!Array.isArray(t))return;let n=_L.get(e);for(let e of t)j(e)&&typeof e.name==`string`&&typeof e.description==`string`&&(n??=new Map,n.has(e.name)||n.set(e.name,e.description));n&&_L.set(e,n)}function wL(e,t,n){let r=e?_L.get(e)?.get(t):void 0;if(r)return r;if(Array.isArray(n)){let e=n.find(e=>j(e)&&e.name===t);return j(e)?Q(e.description):void 0}if(j(n)){let e=n[t];return j(e)?Q(e.description):void 0}}function TL(e,t={}){Z(e(aL),e=>AL(e,t),{beforeSpanEnd:(e,n)=>{FL(e,n,t),bL(n)},deferSpanEnd:({data:e,end:n})=>EL(e,t,n)})}function EL(e,t,n){if(e.type!==`languageModelCall`||!j(e.result))return!1;let r=e.result,i=r.stream;if(!nL(i))return!1;let a=Q(e.event.callId),{recordOutputs:o}=WL(e.event,t);return r.stream=rL(i,t=>{e.result={...r,...DL(t)},n(),OL(a,t,o)},e=>n(e)),!0}function DL(e){let t=[];e.text&&t.push({type:`text`,text:e.text});for(let n of e.toolCalls)t.push({type:`tool-call`,...n});return{content:t,...e.usage===void 0?{}:{usage:e.usage},...e.finishReason===void 0?{}:{finishReason:e.finishReason},...e.providerMetadata===void 0?{}:{providerMetadata:e.providerMetadata},...e.responseId||e.responseModel?{response:{...e.responseId?{id:e.responseId}:{},...e.responseModel?{modelId:e.responseModel}:{}}}:{}}}function OL(e,t,n){let r=e?vL.get(e):void 0;if(!r)return;let i=j(t.usage)?t.usage:void 0;if(i){let e=RL(i.inputTokens)??RL(i.promptTokens)??RL(i.tokens),t=RL(i.outputTokens)??RL(i.completionTokens);kL(r,gc,e),kL(r,_c,t),kL(r,vc,RL(i.totalTokens)??tL(e,t))}if(n){let e=zL(HL(t.text,t.toolCalls),LL({finishReason:t.finishReason}));e&&r.setAttribute(ec,e)}}function kL(e,t,n){if(n===void 0)return;let r=L(e).data[t];e.setAttribute(t,(typeof r==`number`?r:0)+n)}function AL(e,t){let{type:n,event:r}=e;if(n===`step`||!r||typeof r!=`object`)return;let{recordInputs:i,enableTruncation:a}=WL(r,t),o=Q(r.provider),s=Q(r.modelId),c=Q(r.callId),l=eL(r.maxRetries);i&&CL(c,r.tools);let u={[I]:oL,...o?{[dc]:o,[mL]:o}:{},...s?{[rc]:s}:{},...l===void 0?{}:{[hL]:l}};switch(n){case`generateText`:case`streamText`:case`generateObject`:return ML(r,u,i,a,c,n===`streamText`);case`languageModelCall`:return ef([fL]),NL(r,u,i,a,c,s);case`executeTool`:return PL(r,i);case`embed`:case`embedMany`:{let e=n===`embedMany`?r.values:r.value;return jL(lL,s,{...u,...i&&e!==void 0?{[Xs]:bn(e)}:{}})}case`rerank`:return jL(uL,s,u);default:return}}function jL(e,t,n){return B({name:t?`${e} ${t}`:e,op:`gen_ai.${e}`,attributes:{[$s]:e,...n}})}function ML(e,t,n,r,i,a){let o=Q(e.functionId),s=Q(e.operationId)??(a?`ai.streamText`:`ai.generateText`);i&&gL.set(i,{operationId:s,isStream:a});let c=jL(UP,o,{...t,[pL]:s,[uc]:a,...o?{[Zs]:o}:{},...n?KL(e,r):{}});return a&&i&&vL.set(i,c),c}function NL(e,t,n,r,i,a){let o=i?gL.get(i):void 0,s=o?`${o.operationId}.${o.isStream?`doStream`:`doGenerate`}`:`ai.generateText.doGenerate`;return jL(dL,a,{...t,[pL]:s,...n?KL(e,r):{},...n&&Array.isArray(e.tools)?{[tc]:bn(e.tools)}:{}})}function PL(e,t){let n=j(e.toolCall)?e.toolCall:{},r=Q(n.toolName),i=Q(e.toolCallId)??Q(n.toolCallId),a=n.input??n.args,o=t&&r?wL(Q(e.callId),r,e.tools):void 0;return jL(HP,r,{[I]:oL,[hc]:`function`,...r?{[pc]:r}:{},...i?{[sL]:i}:{},...o?{[cL]:o}:{},...t&&a!==void 0?{[fc]:bn(a)}:{}})}function FL(e,t,n){let{type:r,result:i}=t;if(!j(i))return;let{recordOutputs:a}=WL(t.event,n);if(r===`executeTool`){a&&e.setAttribute(mc,bn(i.output??i));let n=j(i.output)?i.output:void 0;n?.type===`tool-error`&&UL(e,t,n.error);return}let o=j(i.usage)?i.usage:void 0;if(o){let t=RL(o.inputTokens)??RL(o.promptTokens)??RL(o.tokens),n=RL(o.outputTokens)??RL(o.completionTokens),r=RL(o.totalTokens)??tL(t,n);t!==void 0&&e.setAttribute(gc,t),n!==void 0&&e.setAttribute(_c,n),r!==void 0&&e.setAttribute(vc,r)}let s=LL(i);s&&r===`languageModelCall`&&e.setAttribute(sc,bn([s]));let c=j(i.response)?i.response:void 0,l=Q(c?.id)??Q(i.responseId);l&&e.setAttribute(cc,l);let u=Q(c?.modelId)??Q(t.event.modelId);u&&e.setAttribute(lc,u);let d=i.providerMetadata,f=tv(d);if(`gen_ai.conversation.id`in f&&L(e).data[`gen_ai.conversation.id`]&&delete f[qr],SL(f,r),e.setAttributes(f),a){let t=zL(r===`languageModelCall`&&Array.isArray(i.content)?VL(i.content):HL(i.text,i.toolCalls),s);t&&e.setAttribute(ec,t)}}function IL(e){return e===`tool-calls`?`tool_call`:e??`stop`}function LL(e){let t=e.finishReason;return typeof t==`string`?t:j(t)?Q(t.unified):void 0}function RL(e){return eL(e)??(j(e)?eL(e.total):void 0)}function zL(e,t){if(e.length)return bn([{role:`assistant`,parts:e,finish_reason:IL(t)}])}function BL(e){let t=e.input??e.args;return{type:`tool_call`,id:Q(e.toolCallId),name:Q(e.toolName),arguments:typeof t==`string`?t:bn(t??{})}}function VL(e){let t=[];for(let n of e)j(n)&&(n.type===`text`&&typeof n.text==`string`?t.push({type:`text`,content:n.text}):n.type===`tool-call`&&t.push(BL(n)));return t}function HL(e,t){let n=[];if(typeof e==`string`&&e.length&&n.push({type:`text`,content:e}),Array.isArray(t))for(let e of t)j(e)&&n.push(BL(e));return n}function UL(e,t,n){e.setStatus({code:2,message:n instanceof Error?n.message:`tool_error`});let r=j(t.event.toolCall)?t.event.toolCall:{},i=Q(r.toolName),a=Q(t.event.toolCallId)??Q(r.toolCallId);Er(t=>{t.setContext(`trace`,Li(e)),i&&t.setTag(`vercel.ai.tool.name`,i),a&&t.setTag(`vercel.ai.tool.callId`,a),t.setLevel(`error`),H(n instanceof Error?n:Error(typeof n==`string`?n:`Tool execution failed`),{mechanism:{type:`auto.vercelai.channel`,handled:!1}})})}function WL(e,t){let n=P()?.getDataCollectionOptions().genAI;return{recordInputs:GL(t.recordInputs,e.recordInputs,n?.inputs),recordOutputs:GL(t.recordOutputs,e.recordOutputs,n?.outputs),enableTruncation:$g(t.enableTruncation)}}function GL(e,t,n){return typeof e==`boolean`?e:typeof t==`boolean`?t:n===!0}function KL(e,t){let n={},r=Q(e.instructions);r&&(n[Xh]=bn([{type:`text`,content:r}]));let i=e.messages??e.prompt;return i!==void 0&&(n[Qs]=t?r_(i):bn(i),n[qh]=Array.isArray(i)?i.length:1),n}var qL=W(((e={})=>({name:`VercelAI`,setupOnce(){C.tracingChannel&&U(()=>{TL(C.tracingChannel,e)})}}))),JL=`@sentry/instrumentation-fastify`,YL=`>=3.21.0 <6`,XL=`auto.http.otel.fastify`,ZL=`hook.fastify`,QL=`request_handler.fastify`,$L=[`onRequest`,`preParsing`,`preValidation`,`preHandler`,`preSerialization`,`onSend`,`onResponse`,`onError`],eR=`hook.name`,tR=`fastify.type`,nR=`hook.callback.name`,rR=`fastify.root`,iR=`route-hook`,aR=`hook`,oR=`request-handler`,sR=`anonymous`,cR=Symbol(`sentry fastify request span`),lR=Symbol(`sentry fastify addHook original`),uR=Symbol(`sentry fastify setNotFoundHandler original`);function dR(e){return e.routeOptions?.url??e.routerPath}function fR(e){return e.routeOptions?.config??e.routeConfig}function pR(e){return j(e)&&!!e.method&&!!e.url&&(!!e.routeOptions||`routerPath`in e)}function mR(e,t,n){e.decorate(lR,e.addHook),e.decorate(uR,e.setNotFoundHandler),e.decorateRequest(`opentelemetry`,function(){return{span:this[cR]}}),e.decorateRequest(cR,null),e.addHook(`onRoute`,gR),e.addHook(`onRequest`,yR),e.addHook(`onResponse`,bR),e.addHook=CR,e.setNotFoundHandler=wR,n()}var hR=mR;hR[Symbol.for(`skip-override`)]=!0,hR[Symbol.for(`fastify.display-name`)]=JL,hR[Symbol.for(`plugin-meta`)]={fastify:YL,name:JL};function gR(e){if(e.config?.otel!==!1){for(let t of $L){let n=e[t];typeof n==`function`?e[t]=ER(n,t,_R(this.pluginName,t,n,e.url)):Array.isArray(n)&&(e[t]=n.map(n=>ER(n,t,_R(this.pluginName,t,n,e.url))))}e.onSend=vR(e.onSend,xR),e.onError=vR(e.onError,SR),e.handler=ER(e.handler,`handler`,{[eR]:`${this.pluginName} - route-handler`,[tR]:oR,[Oc]:e.url,[nR]:e.handler.name.length>0?e.handler.name:sR})}}function _R(e,t,n,r){return{[eR]:`${e} - route -> ${t}`,[tR]:iR,[Oc]:r,[nR]:n.name?.length>0?n.name:sR}}function vR(e,t){return e==null?t:Array.isArray(e)?[...e,t]:[e,t]}function yR(e,t,n){if(fR(e)?.otel===!1)return n();let r={[I]:XL,[rR]:JL,[Ec]:e.method,[_l]:e.url},i=dR(e);if(i!=null){r[Oc]=i;let e=R(),t=e&&ra(e);t&&L(t).data[`sentry.op`]===`http.server`&&t.setAttribute(Oc,i)}let a=B({name:`request`,op:QL,attributes:r});e[cR]=a,V(a,()=>{n()})}function bR(e,t,n){let r=e[cR];r!=null&&(r.setAttributes({[Dc]:t.statusCode}),r.end()),e[cR]=null,n()}function xR(e,t,n,r){let i=e[cR];i!=null&&(t.statusCode>=500&&i.setStatus({code:2}),i.setAttributes({[Dc]:t.statusCode}),i.end()),e[cR]=null,r(null,n)}function SR(e,t,n,r){e[cR]?.setStatus({code:2,message:n.message}),r()}function CR(e,t){let n=this[lR];return $L.includes(e)?n.call(this,e,ER(t,e,{[eR]:`${this.pluginName} - ${e}`,[tR]:aR,[nR]:t.name?.length>0?t.name:sR})):n.call(this,e,t)}function wR(e,t){let n=this[uR];if(typeof e==`function`){n.call(this,ER(e,`notFoundHandler`,{[eR]:`${this.pluginName} - not-found-handler`,[tR]:aR,[nR]:e.name?.length>0?e.name:sR}));return}if(e.preValidation!=null&&(e.preValidation=ER(e.preValidation,`notFoundHandler - preValidation`,{[eR]:`${this.pluginName} - not-found-handler - preValidation`,[tR]:aR,[nR]:e.preValidation.name?.length>0?e.preValidation.name:sR})),e.preHandler!=null&&(e.preHandler=ER(e.preHandler,`notFoundHandler - preHandler`,{[eR]:`${this.pluginName} - not-found-handler - preHandler`,[tR]:aR,[nR]:e.preHandler.name?.length>0?e.preHandler.name:sR})),t==null){n.call(this,e);return}n.call(this,e,ER(t,`notFoundHandler`,{[eR]:`${this.pluginName} - not-found-handler`,[tR]:aR,[nR]:t.name?.length>0?t.name:sR}))}function TR(e){for(let t of e)if(pR(t))return t;return null}function ER(e,t,n={}){return function(...r){let i=TR(r);if(i===null||fR(i)?.otel===!1)return e.call(this,...r);let a=i[cR]??void 0,o=e.name?.length>0?e.name:this.pluginName??sR,s=n[tR],c=s===aR?ZL:s===oR?QL:void 0;return z({name:c?DR(n[eR]):`${t} - ${o}`,op:c,attributes:{...n,[I]:XL},parentSpan:a},()=>e.call(this,...r))}}function DR(e=``){return e.replace(/^fastify -> /,``).replace(/^@fastify\/otel -> /,``).replace(/^@sentry\/instrumentation-fastify -> /,``)}function OR(e){e.addHook(`onRequest`,async(e,t)=>{let n=dR(e),r=e.method||`GET`;N().setTransactionName(`${r} ${n}`)})}var kR=!1,AR=Object.assign(function(){kR||(kR=!0,C.subscribe(`fastify.initialization`,e=>{let t=e.fastify;t?.register(mR).after(e=>{e?X&&A.error(`Failed to setup Fastify instrumentation`,e):t&&OR(t)})}))},{id:`Fastify.v5`}),jR=`Fastify`;function MR(e,t,n){let r=n.statusCode;return r>=500||r<=299}function NR(){return P()?.getIntegrationByName(jR)}function PR(){C.subscribe(`tracing:fastify.request.handler:error`,e=>{let{error:t,request:n,reply:r}=e;FR.call(FR,t,n,r,`diagnostics-channel`)})}function FR(e,t,n,r){let i=NR()?.getShouldHandleError()||MR;if(r===`diagnostics-channel`&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r===`onError-hook`){X&&A.warn(`Fastify error handler was already registered via diagnostics channel.`,"You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}i(e,t,n)&&H(e,{mechanism:{handled:!1,type:`auto.function.fastify`}})}var IR=W((({shouldHandleError:e}={})=>{let t;return{name:jR,setupOnce(){t=e||MR,PR(),AR()},getShouldHandleError(){return t},setShouldHandleError(e){t=e}}})),LR=FR,RR=`db.mongodb.collection`,zR=`db.name`,BR=`db.user`,VR=`net.peer.name`,HR=`net.peer.port`,UR=`db.operation`,WR=`db.system`;function GR({collection:e,modelName:t,operation:n,origin:r,parentSpan:i}){let a={[RR]:e?.name,[zR]:e?.conn?.name,[BR]:e?.conn?.user,[VR]:e?.conn?.host,[HR]:e?.conn?.port,[UR]:n,[WR]:`mongoose`,[I]:r};return B({name:`mongoose.${t}.${n}`,op:`db`,kind:G.CLIENT,attributes:a,parentSpan:i})}var KR=`Fastify`,qR=Y(`${KR}.v3`,()=>new zP);function JR(){let e=P();if(e)return e.getIntegrationByName(KR)}var YR=(e=>Mu(IR(e),{setupOnce(){qR()}})),XR=W((e={})=>YR(e));function ZR(e,t){t?.shouldHandleError&&JR()?.setShouldHandleError(t.shouldHandleError);let n=Object.assign(function(e,t,n){e.addHook(`onError`,async(e,t,n)=>{LR.call(LR,n,e,t,`onError-hook`)}),n()},{[Symbol.for(`skip-override`)]:!0,[Symbol.for(`fastify.display-name`)]:`sentry-fastify-error-handler`});e.register(n)}var QR=class{constructor(e,t,n,r){this.name=we(e),this.supportedVersions=t,this.patch=n,this.unpatch=r}},$R=(e=>(e.QUERY=`query`,e.MUTATION=`mutation`,e.SUBSCRIPTION=`subscription`,e))($R||{}),ez=(e=>(e.SOF=`<SOF>`,e.EOF=`<EOF>`,e.BANG=`!`,e.DOLLAR=`$`,e.AMP=`&`,e.PAREN_L=`(`,e.PAREN_R=`)`,e.SPREAD=`...`,e.COLON=`:`,e.EQUALS=`=`,e.AT=`@`,e.BRACKET_L=`[`,e.BRACKET_R=`]`,e.BRACE_L=`{`,e.PIPE=`|`,e.BRACE_R=`}`,e.NAME=`Name`,e.INT=`Int`,e.FLOAT=`Float`,e.STRING=`String`,e.BLOCK_STRING=`BlockString`,e.COMMENT=`Comment`,e))(ez||{}),tz=(e=>(e.EXECUTE=`graphql.execute`,e.PARSE=`graphql.parse`,e.RESOLVE=`graphql.resolve`,e.VALIDATE=`graphql.validate`,e.SCHEMA_VALIDATE=`graphql.validateSchema`,e.SCHEMA_PARSE=`graphql.parseSchema`,e))(tz||{}),nz=(e=>(e.SOURCE=`graphql.source`,e.FIELD_NAME=`graphql.field.name`,e.FIELD_PATH=`graphql.field.path`,e.FIELD_TYPE=`graphql.field.type`,e.PARENT_NAME=`graphql.parent.name`,e.OPERATION_TYPE=`graphql.operation.type`,e.OPERATION_NAME=`graphql.operation.name`,e))(nz||{}),rz=Symbol.for(`opentelemetry.patched`),iz=Symbol.for(`opentelemetry.graphql_data`),az=`Operation$operationName$not supported`,oz=Object.values($R),sz=e=>typeof e?.then==`function`;function cz(e,t,n,r){if(P()?.getDataCollectionOptions().graphQL.document===!0){let i=Sz(t,n,r);e.setAttribute(nz.SOURCE,i)}}function lz(e,t,n){let r=mz(e,n);return r?{field:r,spanAdded:!1}:(r={span:uz(e,t,n,hz(e,n))},pz(e,n,r),{field:r,spanAdded:!0})}function uz(e,t,n,r){let i={[nz.FIELD_NAME]:t.fieldName,[nz.FIELD_PATH]:n.join(`.`),[nz.FIELD_TYPE]:t.returnType.toString(),[nz.PARENT_NAME]:t.parentType.name},a=B({name:`${tz.RESOLVE} ${i[nz.FIELD_PATH]}`,attributes:i,parentSpan:r}),o=e[iz].source,s=t.fieldNodes.find(e=>e.kind===`Field`);return s&&cz(a,o.loc,s.loc?.start,s.loc?.end),a}function dz(e,t){t&&e.setStatus({code:2,message:t.message}),e.end()}function fz(e,t){if(e&&Array.isArray(e.definitions))return t?e.definitions.filter(e=>oz.indexOf(e?.operation)!==-1).find(e=>t===e?.name?.value):e.definitions.find(e=>oz.indexOf(e?.operation)!==-1)}function pz(e,t,n){return e[iz].fields[t.join(`.`)]=n}function mz(e,t){return e[iz].fields[t.join(`.`)]}function hz(e,t){for(let n=t.length-1;n>0;n--){let r=mz(e,t.slice(0,n));if(r)return r.span}return gz(e)}function gz(e){return e[iz].span}function _z(e){let t=[],n=e;for(;n;)t.push(String(n.key)),n=n.prev;return t.reverse()}function vz(e){return bz(`
|
|
30
|
-
`,e)}function yz(e){return bz(` `,e)}function bz(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}var xz=[ez.FLOAT,ez.STRING,ez.INT,ez.BLOCK_STRING];function Sz(e,t,n){let r=``;if(e?.startToken){let i=typeof t==`number`?t:e.start,a=typeof n==`number`?n:e.end,o=e.startToken.next,s=1;for(;o;){if(o.start<i){o=o.next,s=o?.line;continue}if(o.end>a){o=o.next,s=o?.line;continue}let e=o.value||o.kind,t=``;xz.indexOf(o.kind)>=0&&(e=`*`),o.kind===ez.STRING&&(e=`"${e}"`),o.kind===ez.EOF&&(e=``),o.line>s?(r+=vz(o.line-s),s=o.line,t=yz(o.column-1)):o.line===o.prev?.line&&(t=yz(o.start-(o.prev?.end||0))),r+=t+e,o&&=o.next}}return r}function Cz(e,t){if(!e||e[rz])return;let n=e.getFields();e[rz]=!0,Object.keys(n).forEach(e=>{let r=n[e];if(r&&(r.resolve&&=kz(t,r.resolve),r.type)){let e=wz(r.type);for(let n of e)Cz(n,t)}})}function wz(e){return`ofType`in e?wz(e.ofType):Tz(e)?e.getTypes():Ez(e)?[e]:[]}function Tz(e){return`getTypes`in e&&typeof e.getTypes==`function`}function Ez(e){return`getFields`in e&&typeof e.getFields==`function`}var Dz=(e,t,n)=>{n&&(e.setStatus({code:2,message:t.message}),e.end())},Oz=(e,t)=>{t&&e.end()};function kz(e,t,n=!1){if(r[rz]||typeof t!=`function`)return t;function r(r,i,a,o){if(!t)return;if(e().ignoreTrivialResolveSpans&&n&&(j(r)||typeof r==`function`)&&typeof r[o.fieldName]!=`function`||!a[iz])return t.call(this,r,i,a,o);let{field:s,spanAdded:c}=lz(a,o,_z(o?.path)),l=s.span,u=c;return V(l,()=>{try{let e=t.call(this,r,i,a,o);return sz(e)?e.then(e=>(Oz(l,u),e),e=>{throw Dz(l,e,u),e}):(Oz(l,u),e)}catch(e){throw Dz(l,e,u),e}})}return r[rz]=!0,r}var Az=`@sentry/instrumentation-graphql`,jz=`auto.graphql.otel.graphql`,Mz={ignoreResolveSpans:!1},Nz=[`>=14.0.0 <17`],Pz=class extends q{constructor(e={}){super(Az,k,{...Mz,...e})}setConfig(e={}){super.setConfig({...Mz,...e})}init(){let e=new J(`graphql`,Nz);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new QR(`graphql/execution/execute.js`,Nz,e=>(K(e.execute)&&this._unwrap(e,`execute`),this._wrap(e,`execute`,this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,`execute`)})}_addPatchingParser(){return new QR(`graphql/language/parser.js`,Nz,e=>(K(e.parse)&&this._unwrap(e,`parse`),this._wrap(e,`parse`,this._patchParse()),e),e=>{e&&this._unwrap(e,`parse`)})}_addPatchingValidate(){return new QR(`graphql/validation/validate.js`,Nz,e=>(K(e.validate)&&this._unwrap(e,`validate`),this._wrap(e,`validate`,this._patchValidate()),e),e=>{e&&this._unwrap(e,`validate`)})}_patchExecute(e){let t=this;return function(n){return function(){let r;if(arguments.length>=2){let n=arguments;r=t._wrapExecuteArgs(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],e)}else{let n=arguments[0];r=t._wrapExecuteArgs(n.schema,n.document,n.rootValue,n.contextValue,n.variableValues,n.operationName,n.fieldResolver,n.typeResolver,e)}let i=fz(r.document,r.operationName),a=t._createExecuteSpan(i,r);return r.contextValue[iz]={source:r.document?r.document||r.document[iz]:void 0,span:a,fields:{}},V(a,()=>jT(()=>n.apply(this,[r]),(e,n)=>{t._handleExecutionResult(a,e,n)}))}}}_handleExecutionResult(e,t,n){if(n===void 0||t){dz(e,t);return}sz(n)?n.then(t=>{this._updateSpanFromResult(e,t),dz(e)},t=>{dz(e,t)}):(this._updateSpanFromResult(e,n),dz(e))}_updateSpanFromResult(e,t){if(t.errors?.length&&!L(e).status&&e.setStatus({code:2}),!this.getConfig().useOperationNameForRootSpan)return;let n=L(e).data,r=n[nz.OPERATION_TYPE],i=n[nz.OPERATION_NAME];if(!r)return;let a=ra(e),o=L(a).data[`sentry.graphql.operation`]||[],s=i?`${r} ${i}`:`${r}`;Array.isArray(o)?(o.push(s),a.setAttribute(bO,o)):typeof o==`string`?a.setAttribute(bO,[o,s]):a.setAttribute(bO,s),L(a).data[`original-description`]||a.setAttribute(`original-description`,L(a).description),a.updateName(`${L(a).data[`original-description`]} (${Fz(o)})`)}_patchParse(){let e=this;return function(t){return function(n,r){return e._parse(this,t,n,r)}}}_patchValidate(){let e=this;return function(t){return function(n,r,i,a,o){return e._validate(this,t,n,r,i,o,a)}}}_parse(e,t,n,r){let i=B({name:tz.PARSE});return V(i,()=>jT(()=>t.call(e,n,r),(e,t)=>{t&&(fz(t)?t.loc&&cz(i,t.loc):i.updateName(tz.SCHEMA_PARSE)),dz(i,e)}))}_validate(e,t,n,r,i,a,o){let s=B({name:tz.VALIDATE});return V(s,()=>jT(()=>t.call(e,n,r,i,o,a),(e,t)=>{r.loc||s.updateName(tz.SCHEMA_VALIDATE),dz(s,e)}))}_createExecuteSpan(e,t){let n=B({name:tz.EXECUTE,attributes:{[I]:jz}});if(e){let{operation:t,name:r}=e;n.setAttribute(nz.OPERATION_TYPE,t);let i=r?.value;i?(n.setAttribute(nz.OPERATION_NAME,i),n.updateName(`${t} ${i}`)):n.updateName(t)}else{let e=` `;t.operationName&&(e=` "${t.operationName}" `),e=az.replace(`$operationName$`,e),n.setAttribute(nz.OPERATION_NAME,e)}return t.document?.loc&&cz(n,t.document.loc),n}_wrapExecuteArgs(e,t,n,r,i,a,o,s,c){return r||={},r[iz]||this.getConfig().ignoreResolveSpans?{schema:e,document:t,rootValue:n,contextValue:r,variableValues:i,operationName:a,fieldResolver:o,typeResolver:s}:(o=kz(()=>this.getConfig(),o??c,o==null),e&&(Cz(e.getQueryType(),()=>this.getConfig()),Cz(e.getMutationType(),()=>this.getConfig())),{schema:e,document:t,rootValue:n,contextValue:r,variableValues:i,operationName:a,fieldResolver:o,typeResolver:s})}};function Fz(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(`, `):`${t.slice(0,5).join(`, `)}, +${t.length-5}`}return`${e}`}var Iz=`Graphql`,Lz=Y(Iz,Pz,e=>zz(e)),Rz=W(((e={})=>Mu(CF(zz(e)),{name:Iz,setupOnce(){Lz(zz(e))}})));function zz(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}var Bz=`messaging.destination.partition.id`,Vz=`messaging.kafka.message.key`,Hz=`messaging.kafka.message.tombstone`,Uz=`messaging.kafka.offset`,Wz=`process`,Gz=`receive`,Kz=`send`,qz=`kafka`,Jz=`_OTHER`;x();var Yz=`auto.kafkajs.otel.producer`,Xz=`auto.kafkajs.otel.consumer`;function Zz(e,t){let n=e?.[t];if(n!=null)return Array.isArray(n)?n[0]?.toString():n.toString()}function Qz(e){let t=Zz(e,`sentry-trace`);if(!t)return;let{traceId:n,parentSpanId:r,sampled:a}=Ai(t,Zz(e,`baggage`));if(r)return[{context:{traceId:n,spanId:r,isRemote:!0,traceFlags:a?i.SAMPLED:i.NONE}}]}function $z({topic:e,message:t,operationType:n,links:r,attributes:i}){let a=n===`receive`?`poll`:n;return B({name:`${a} ${e}`,kind:n===`receive`?G.CLIENT:G.CONSUMER,links:r,attributes:{...i,[Hc]:qz,[Rc]:e,[Vc]:n,[Bc]:a,[Vz]:t?.key?String(t.key):void 0,[Hz]:t?.key&&t.value===null?!0:void 0,[Uz]:t?.offset,...t?{[I]:Xz}:{}}})}function eB(e,t){let n=B({name:`send ${e}`,kind:G.PRODUCER,attributes:{[Hc]:qz,[Rc]:e,[Vz]:t.key?String(t.key):void 0,[Hz]:t.key&&t.value===null?!0:void 0,[Bz]:t.partition===void 0?void 0:String(t.partition),[Bc]:`send`,[Vc]:Kz,[I]:Yz}});t.headers=t.headers??{};let r=Tf({span:n});return r[`sentry-trace`]&&(t.headers[`sentry-trace`]=r[`sentry-trace`]),r.baggage&&(t.headers.baggage=r.baggage),n}function tB(e,t){return Promise.resolve(t).catch(t=>{let n,r=Jz;throw typeof t==`string`||t===void 0?n=t:typeof t==`object`&&Object.prototype.hasOwnProperty.call(t,`message`)&&(n=t.message,r=t.constructor.name),e.forEach(e=>{e.setAttribute(Us,r),e.setStatus({code:2,message:n})}),t}).finally(()=>{e.forEach(e=>e.end())})}var nB=`@sentry/instrumentation-kafkajs`,rB=class extends q{constructor(e={}){super(nB,k,e)}init(){let e=e=>{K(e?.Kafka?.prototype.producer)&&this._unwrap(e.Kafka.prototype,`producer`),K(e?.Kafka?.prototype.consumer)&&this._unwrap(e.Kafka.prototype,`consumer`)};return new J(`kafkajs`,[`>=0.3.0 <3`],t=>(e(t),this._wrap(t?.Kafka?.prototype,`producer`,this._getProducerPatch()),this._wrap(t?.Kafka?.prototype,`consumer`,this._getConsumerPatch()),t),e)}_getConsumerPatch(){let e=this;return t=>function(...n){let r=t.apply(this,n);return K(r.run)&&e._unwrap(r,`run`),e._wrap(r,`run`,e._getConsumerRunPatch()),r}}_getProducerPatch(){let e=this;return t=>function(...n){let r=t.apply(this,n);return K(r.sendBatch)&&e._unwrap(r,`sendBatch`),e._wrap(r,`sendBatch`,e._getSendBatchPatch()),K(r.send)&&e._unwrap(r,`send`),e._wrap(r,`send`,e._getSendPatch()),K(r.transaction)&&e._unwrap(r,`transaction`),e._wrap(r,`transaction`,e._getProducerTransactionPatch()),r}}_getConsumerRunPatch(){let e=this;return t=>function(...n){let r=n[0];return r?.eachMessage&&(K(r.eachMessage)&&e._unwrap(r,`eachMessage`),e._wrap(r,`eachMessage`,e._getConsumerEachMessagePatch())),r?.eachBatch&&(K(r.eachBatch)&&e._unwrap(r,`eachBatch`),e._wrap(r,`eachBatch`,e._getConsumerEachBatchPatch())),t.call(this,r)}}_getConsumerEachMessagePatch(){return e=>function(...t){let n=t[0];return lo({sentryTrace:Zz(n.message.headers,`sentry-trace`),baggage:Zz(n.message.headers,`baggage`)},()=>{let r=$z({topic:n.topic,message:n.message,operationType:Wz,attributes:{[Bz]:String(n.partition)}}),i=V(r,()=>e.apply(this,t));return tB([r],i)})}}_getConsumerEachBatchPatch(){return e=>function(...t){let n=t[0],r=po(()=>$z({topic:n.batch.topic,message:void 0,operationType:Gz,attributes:{[Ic]:n.batch.messages.length,[Bz]:String(n.batch.partition)}}));return V(r,()=>{let i=[r];return n.batch.messages.forEach(e=>{i.push($z({topic:n.batch.topic,message:e,operationType:Wz,links:Qz(e.headers),attributes:{[Bz]:String(n.batch.partition)}}))}),tB(i,e.apply(this,t))})}}_getProducerTransactionPatch(){let e=this;return t=>function(...n){let r=B({name:`transaction`}),i=t.apply(this,n);return i.then(t=>{let n=t.send;t.send=function(...t){return V(r,()=>e._getSendPatch()(n).apply(this,t).catch(e=>{throw r.setStatus({code:2,message:e?.message}),e}))};let i=t.sendBatch;t.sendBatch=function(...t){return V(r,()=>e._getSendBatchPatch()(i).apply(this,t).catch(e=>{throw r.setStatus({code:2,message:e?.message}),e}))};let a=t.commit;t.commit=function(...e){let t=a.apply(this,e).then(()=>{r.setStatus({code:1})});return tB([r],t)};let o=t.abort;t.abort=function(...e){let t=o.apply(this,e);return tB([r],t)}}).catch(e=>{r.setStatus({code:2,message:e?.message}),r.end()}),i}}_getSendBatchPatch(){return e=>function(...t){let n=t[0].topicMessages||[],r=[];return n.forEach(e=>{e.messages.forEach(t=>{r.push(eB(e.topic,t))})}),tB(r,e.apply(this,t))}}_getSendPatch(){return e=>function(...t){let n=t[0];return tB(n.messages.map(e=>eB(n.topic,e)),e.apply(this,t))}}},iB=`Kafka`,aB=Y(iB,()=>new rB),oB=W((()=>({name:iB,setupOnce(){aB()}}))),sB=`@sentry/instrumentation-lru-memoizer`,cB=class extends q{constructor(){super(sB,k,{})}init(){return[new J(`lru-memoizer`,[`>=1.3 <4`],e=>Object.assign(function(...t){let n=e.apply(this,t);return function(...e){let t=e.pop(),r=M(),i=typeof t==`function`?function(...e){return Er(r,()=>t.apply(this,e))}:t;return n.apply(this,[...e,i])}},{sync:e.sync}),void 0)]}},lB=`LruMemoizer`,uB=Y(lB,()=>new cB),dB=W((()=>({name:lB,setupOnce(){uB()}}))),fB=`auto.db.otel.mongo`;function pB(e,t,n,r){return eI(e,t,n,r,fB)}function mB(e,t,n,r){return rI(e,t,n,r,fB)}function hB(e,t){let n=R(),r=!1;return function(...i){if(!r){r=!0;let t=i[0];e&&(t instanceof Error&&e.setStatus({code:2,message:t.message}),e.end())}return V(n??null,()=>t.apply(this,i))}}function gB(){return!R()}function _B(e){return t=>function(n,r,i,a,o){let s=typeof a==`function`?a:o;if(gB()||typeof s!=`function`||typeof i!=`object`)return typeof a==`function`?t.call(this,n,r,i,a):t.call(this,n,r,i,a,o);let c=hB(iI(mB(r,n,i[0],e)),s);return typeof a==`function`?t.call(this,n,r,i,c):t.call(this,n,r,i,a,c)}}function vB(){return e=>function(t,n,r,i,a){let o=typeof i==`function`?i:a;if(gB()||typeof o!=`function`||typeof r!=`object`)return typeof i==`function`?e.call(this,t,n,r,i):e.call(this,t,n,r,i,a);let s=hB(iI(mB(n,t,r,nI(r))),o);return typeof i==`function`?e.call(this,t,n,r,s):e.call(this,t,n,r,i,s)}}function yB(){return e=>function(t,n,r,i){let a=i,o=Object.keys(n)[0];if(typeof n!=`object`||n.ismaster||n.hello)return e.call(this,t,n,r,i);let s;gB()||(s=iI(pB(this,t,n,o)));let c=hB(s,a);return e.call(this,t,n,r,c)}}function bB(){return e=>function(...t){let[n,r]=t,i=Object.keys(r)[0],a=()=>void 0;if(typeof r!=`object`||r.ismaster||r.hello)return e.apply(this,t);let o;gB()||(o=iI(pB(this,n,r,i)));let s=hB(o,a),c=e.apply(this,t);return c.then(e=>s(null,e),e=>s(e)),c}}function xB(){return e=>function(t,n,r,i,a,o){let s=typeof a==`function`?a:o;if(gB()||typeof s!=`function`||typeof r!=`object`)return typeof a==`function`?e.call(this,t,n,r,i,a):e.call(this,t,n,r,i,a,o);let c=hB(iI(mB(n,t,r,`find`)),s);return typeof a==`function`?e.call(this,t,n,r,i,c):e.call(this,t,n,r,i,a,c)}}function SB(){return e=>function(t,n,r,i,a,o){let s=typeof a==`function`?a:o;if(gB()||typeof s!=`function`)return typeof a==`function`?e.call(this,t,n,r,i,a):e.call(this,t,n,r,i,a,o);let c=hB(iI(mB(n,t,r.cmd,`getMore`)),s);return typeof a==`function`?e.call(this,t,n,r,i,c):e.call(this,t,n,r,i,a,c)}}function CB(){return e=>function(t){let n=R();return e.call(this,function(...e){return V(n??null,()=>t.apply(this,e))})}}var wB=`@sentry/instrumentation-mongodb`,TB=class extends q{constructor(e={}){super(wB,k,e)}init(){let{v3PatchConnection:e,v3UnpatchConnection:t}=this._getV3ConnectionPatches(),{v4PatchConnectionCallback:n,v4PatchConnectionPromise:r,v4UnpatchConnection:i}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:a,v4UnpatchConnectionPool:o}=this._getV4ConnectionPoolPatches();return[new J(`mongodb`,[`>=3.3.0 <4`],void 0,void 0,[new QR(`mongodb/lib/core/wireprotocol/index.js`,[`>=3.3.0 <4`],e,t)]),new J(`mongodb`,[`>=4.0.0 <8`],void 0,void 0,[new QR(`mongodb/lib/cmap/connection.js`,[`>=4.0.0 <6.4`],n,i),new QR(`mongodb/lib/cmap/connection.js`,[`>=6.4.0 <8`],r,i),new QR(`mongodb/lib/cmap/connection_pool.js`,[`>=4.0.0 <6.4`],a,o)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>(K(e.insert)&&this._unwrap(e,`insert`),this._wrap(e,`insert`,_B(`insert`)),K(e.remove)&&this._unwrap(e,`remove`),this._wrap(e,`remove`,_B(`remove`)),K(e.update)&&this._unwrap(e,`update`),this._wrap(e,`update`,_B(`update`)),K(e.command)&&this._unwrap(e,`command`),this._wrap(e,`command`,vB()),K(e.query)&&this._unwrap(e,`query`),this._wrap(e,`query`,xB()),K(e.getMore)&&this._unwrap(e,`getMore`),this._wrap(e,`getMore`,SB()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,`insert`),this._unwrap(e,`remove`),this._unwrap(e,`update`),this._unwrap(e,`command`),this._unwrap(e,`query`),this._unwrap(e,`getMore`))}}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let t=e.ConnectionPool.prototype;return K(t.checkOut)&&this._unwrap(t,`checkOut`),this._wrap(t,`checkOut`,CB()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,`checkOut`)}}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>(K(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,`command`),this._wrap(e.Connection.prototype,`command`,yB()),e),v4PatchConnectionPromise:e=>(K(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,`command`),this._wrap(e.Connection.prototype,`command`,bB()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,`command`)}}}},EB=`Mongo`,DB=Y(EB,()=>new TB),OB=W((()=>({name:EB,setupOnce(){DB()}})));function kB(e,t){e.setStatus({code:2,message:`${t.message} ${t.code?`
|
|
31
|
-
Mongoose Error Code: ${t.code}`:``}`})}function AB(e,t){return e instanceof Promise?e.catch(e=>{throw kB(t,e),e}).finally(()=>t.end()):(t.end(),e)}function jB(e,t,n,r,i){let a=0;return i.length===2?a=1:i.length===3&&(a=2),i[a]=(t,n)=>(t&&kB(r,t),r.end(),e(t,n)),t.apply(n,i)}var MB=`@sentry/instrumentation-mongoose`,NB=`auto.db.otel.mongoose`,PB=[`deleteOne`,`deleteMany`,`find`,`findOne`,`estimatedDocumentCount`,`countDocuments`,`distinct`,`where`,`$where`,`findOneAndUpdate`,`findOneAndDelete`,`findOneAndReplace`],FB=[`remove`,`count`,`findOneAndRemove`,...PB],IB=[`count`,`findOneAndRemove`,...PB],LB=[...PB];function RB(e){return e?e.startsWith(`6.`)||e.startsWith(`5.`)?FB:e.startsWith(`7.`)?IB:LB:PB}function zB(e){return e&&(e.startsWith(`5.`)||e.startsWith(`6.`))||!1}function BB(e){return!e||!e.startsWith(`8.`)?!1:parseInt(e.split(`.`)[1],10)>=21}var VB=Symbol(`stored-parent-span`),HB=Symbol(`already-instrumented`),UB=class extends q{constructor(e={}){super(MB,k,e)}init(){return new J(`mongoose`,[`>=5.9.7 <9.7.0`],this.patch.bind(this),this.unpatch.bind(this))}patch(e,t){let n=e[Symbol.toStringTag]===`Module`&&e.default?e.default:e;return this._wrap(n.Model.prototype,`save`,this.patchOnModelMethods(`save`)),n.Model.prototype.$save=n.Model.prototype.save,zB(t)&&this._wrap(n.Model.prototype,`remove`,this.patchOnModelMethods(`remove`)),BB(t)&&(this._wrap(n.Model.prototype,`updateOne`,this._patchDocumentUpdateMethods(`updateOne`)),this._wrap(n.Model.prototype,`deleteOne`,this._patchDocumentUpdateMethods(`deleteOne`))),this._wrap(n.Query.prototype,`exec`,this.patchQueryExec()),this._wrap(n.Aggregate.prototype,`exec`,this.patchAggregateExec()),RB(t).forEach(e=>{this._wrap(n.Query.prototype,e,this.patchAndCaptureSpanContext(e))}),this._wrap(n.Model,`aggregate`,this.patchModelAggregate()),this._wrap(n.Model,`insertMany`,this.patchModelStatic(`insertMany`)),this._wrap(n.Model,`bulkWrite`,this.patchModelStatic(`bulkWrite`)),n}unpatch(e,t){let n=e[Symbol.toStringTag]===`Module`&&e.default?e.default:e,r=RB(t);this._unwrap(n.Model.prototype,`save`),n.Model.prototype.$save=n.Model.prototype.save,zB(t)&&this._unwrap(n.Model.prototype,`remove`),BB(t)&&(this._unwrap(n.Model.prototype,`updateOne`),this._unwrap(n.Model.prototype,`deleteOne`)),this._unwrap(n.Query.prototype,`exec`),this._unwrap(n.Aggregate.prototype,`exec`),r.forEach(e=>{this._unwrap(n.Query.prototype,e)}),this._unwrap(n.Model,`aggregate`),this._unwrap(n.Model,`insertMany`),this._unwrap(n.Model,`bulkWrite`)}patchAggregateExec(){let e=this;return t=>function(n){let r=this[VB],i=GR({collection:this._model.collection,modelName:this._model?.modelName,operation:`aggregate`,origin:NB,parentSpan:r});return e._handleResponse(i,t,this,arguments,n)}}patchQueryExec(){let e=this;return t=>function(n){if(this[HB])return t.apply(this,arguments);let r=this[VB],i=GR({collection:this.mongooseCollection,modelName:this.model.modelName,operation:this.op,origin:NB,parentSpan:r});return e._handleResponse(i,t,this,arguments,n)}}patchOnModelMethods(e){let t=this;return n=>function(r,i){let a=GR({collection:this.constructor.collection,modelName:this.constructor.modelName,operation:e,origin:NB});return r instanceof Function&&(i=r),t._handleResponse(a,n,this,arguments,i)}}_patchDocumentUpdateMethods(e){let t=this;return n=>function(r,i,a){let o=a;typeof r==`function`?o=r:typeof i==`function`&&(o=i);let s=GR({collection:this.constructor.collection,modelName:this.constructor.modelName,operation:e,origin:NB}),c=t._handleResponse(s,n,this,arguments,o);return c&&typeof c==`object`&&(c[HB]=!0),c}}patchModelStatic(e){let t=this;return n=>function(r,i,a){typeof i==`function`&&(a=i);let o=GR({collection:this.collection,modelName:this.modelName,operation:e,origin:NB});return t._handleResponse(o,n,this,arguments,a)}}patchModelAggregate(){return e=>function(){let t=R(),n=e.apply(this,arguments);return n&&(n[VB]=t),n}}patchAndCaptureSpanContext(e){return e=>function(){return this[VB]=R(),e.apply(this,arguments)}}_handleResponse(e,t,n,r,i){return V(e,()=>i instanceof Function?jB(i,t,n,e,r):AB(t.apply(n,r),e))}},WB=`Mongoose`,GB=Y(WB,()=>new UB),KB=W((()=>Mu(zF(),{name:WB,setupOnce(){GB()}}))),qB=`db.connection_string`,JB=`mysql`;function YB(e){let{host:t,port:n,database:r,user:i}=e?.connectionConfig||e||{};return{host:t,port:n,database:r,user:i}}function XB(e,t,n){let r=`jdbc:mysql://${e||`localhost`}`;return typeof t==`number`&&(r+=`:${t}`),typeof n==`string`&&(r+=`/${n}`),r}function ZB(e){return typeof e==`string`?e:e.sql}function QB(e){let t=typeof e==`object`?e.sql:e,n=t?.indexOf(` `);return typeof n==`number`&&n!==-1?t?.substring(0,n):t}var $B=`@sentry/instrumentation-mysql`,eV=`auto.db.otel.mysql`,tV=class extends q{constructor(e={}){super($B,k,e)}init(){return[new J(`mysql`,[`>=2.0.0 <3`],e=>(K(e.createConnection)&&this._unwrap(e,`createConnection`),this._wrap(e,`createConnection`,this._patchCreateConnection()),K(e.createPool)&&this._unwrap(e,`createPool`),this._wrap(e,`createPool`,this._patchCreatePool()),K(e.createPoolCluster)&&this._unwrap(e,`createPoolCluster`),this._wrap(e,`createPoolCluster`,this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,`createConnection`),this._unwrap(e,`createPool`),this._unwrap(e,`createPoolCluster`))})]}_patchCreateConnection(){return e=>{let t=this;return function(n){let r=e(...arguments);return t._wrap(r,`query`,t._patchQuery(r)),r}}}_patchCreatePool(){return e=>{let t=this;return function(n){let r=e(...arguments);return t._wrap(r,`query`,t._patchQuery(r)),t._wrap(r,`getConnection`,t._patchGetConnection(r)),r}}}_patchCreatePoolCluster(){return e=>{let t=this;return function(n){let r=e(...arguments);return t._wrap(r,`getConnection`,t._patchGetConnection(r)),r}}}_patchGetConnection(e){return t=>{let n=this;return function(r,i,a){if(!n._enabled)return n._unwrap(e,`getConnection`),t.apply(e,arguments);if(arguments.length===1&&typeof r==`function`){let i=n._getConnectionCallbackPatchFn(r);return t.call(e,i)}if(arguments.length===2&&typeof i==`function`){let a=n._getConnectionCallbackPatchFn(i);return t.call(e,r,a)}if(arguments.length===3&&typeof a==`function`){let o=n._getConnectionCallbackPatchFn(a);return t.call(e,r,i,o)}return t.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let t=this,n=M();return function(r,i){i&&(K(i.query)||t._wrap(i,`query`,t._patchQuery(i))),typeof e==`function`&&Er(n,()=>e.call(this,r,i))}}_patchQuery(e){return t=>{let n=this;return function(r,i,a){if(!n._enabled)return n._unwrap(e,`query`),t.apply(e,arguments);let{host:o,port:s,database:c,user:l}=YB(e.config),u=parseInt(String(s),10),d={[I]:eV,[Bs]:JB,[qB]:XB(o,s,c),[Ns]:c,[Hs]:l,[zs]:ZB(r),[Zc]:o};isNaN(u)||(d[Qc]=u);let f=B({name:QB(r),kind:G.CLIENT,attributes:d}),p=Array.from(arguments).findIndex(e=>typeof e==`function`),m=M();if(p===-1){let n=V(f,()=>t.apply(e,arguments));return Io(n,m),n.on(`error`,e=>{f.setStatus({code:2,message:e.message})}).on(`end`,()=>{f.end()})}return n._wrap(arguments,p,n._patchCallbackQuery(f,m)),V(f,()=>t.apply(e,arguments))}}}_patchCallbackQuery(e,t){return n=>function(r,i,a){return r&&e.setStatus({code:2,message:r.message}),e.end(),Er(t,()=>n(...arguments))}}},nV=`Mysql`,rV=Y(nV,()=>new tV({})),iV=W((()=>({name:nV,setupOnce(){rV()}}))),aV=`db.connection_string`,oV=`mysql`;function sV(e){let{host:t,port:n,database:r,user:i}=cV(e),a={[aV]:lV(t,n,r),[Ns]:r,[Hs]:i,[Zc]:t},o=parseInt(n,10);return isNaN(o)||(a[Qc]=o),a}function cV(e){let{host:t,port:n,database:r,user:i}=e?.connectionConfig||e||{};return{host:t,port:n,database:r,user:i}}function lV(e,t,n){let r=`jdbc:mysql://${e||`localhost`}`;return typeof t==`number`&&(r+=`:${t}`),typeof n==`string`&&(r+=`/${n}`),r}function uV(e,t,n){let[r,i]=typeof e==`string`?[e,n]:[e.sql,dV(e)?n||e.values:n];try{return t&&i?t(r,i):r}catch{return`Could not determine the query due to an error in formatting`}}function dV(e){return`values`in e}function fV(e){let t=typeof e==`object`?e.sql:e,n=t?.indexOf(` `);return typeof n==`number`&&n!==-1?t?.substring(0,n):t}var pV=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};function mV(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query==`function`&&typeof n?.execute==`function`?n:t}var hV=`@sentry/instrumentation-mysql2`,gV=`auto.db.otel.mysql2`,_V=[`>=1.4.2 <3.20.0`],vV=class extends q{constructor(e={}){super(hV,k,e)}init(){let e;function t(t){!e&&t.format&&(e=t.format)}let n=t=>{K(t.query)&&this._unwrap(t,`query`),this._wrap(t,`query`,this._patchQuery(e)),K(t.execute)&&this._unwrap(t,`execute`),this._wrap(t,`execute`,this._patchQuery(e))},r=e=>{this._unwrap(e,`query`),this._unwrap(e,`execute`)};return[new J(`mysql2`,_V,e=>(t(e),e),()=>{},[new QR(`mysql2/promise.js`,_V,e=>(t(e),e),()=>{}),new QR(`mysql2/lib/connection.js`,_V,e=>{let t=mV(e);return n(t),e},e=>{if(e===void 0)return;let t=mV(e);r(t)})])]}_patchQuery(e){let t=this;return n=>function(r,i,a){let o;Array.isArray(i)?o=i:arguments[2]&&(o=[i]);let s={...sV(this.config),[Bs]:oV,[zs]:uV(r,e,o),[I]:gV},c=B({name:fV(r),kind:G.CLIENT,attributes:s}),l=pV(e=>{e&&c.setStatus({code:2,message:e.message}),c.end()});if(arguments.length===1){typeof r.onResult==`function`&&t._wrap(r,`onResult`,t._patchCallbackQuery(l));let e=n.apply(this,arguments);return e.once(`error`,e=>{l(e)}).once(`result`,()=>{l()}),e}return typeof arguments[1]==`function`?t._wrap(arguments,1,t._patchCallbackQuery(l)):typeof arguments[2]==`function`&&t._wrap(arguments,2,t._patchCallbackQuery(l)),n.apply(this,arguments)}}_patchCallbackQuery(e){return t=>function(...n){return e(n[0]),t(...n)}}},yV=`Mysql2`,bV=Y(yV,()=>new vV),xV=W((()=>Mu(hI(),{name:yV,setupOnce(){bV()}}))),SV,CV;function wV(e){SV=e}function TV(){return!!SV}function EV(){if(SV)return CV??=SV()}var DV=[`get`,`set`,`setex`],OV=[`get`,`mget`],kV=[`set`,`setex`],AV=[`del`,`unlink`];function jV(e,t){return e.includes(t.toLowerCase())}function MV(e){if(jV(OV,e))return`cache.get`;if(jV(kV,e))return`cache.put`;if(jV(AV,e))return`cache.remove`}function NV(e,t){return t.some(t=>e.startsWith(t))}function PV(e,t){try{if(t.length===0)return;let n=e=>typeof e==`string`||typeof e==`number`||Buffer.isBuffer(e)?[e.toString()]:Array.isArray(e)?LV(e.map(e=>n(e))):[`<unknown>`],r=t[0];return jV(DV,e)&&r!=null?n(r):LV(t.map(e=>n(e)))}catch{return}}function FV(e,t,n){if(!MV(e))return!1;for(let e of t)if(NV(e,n))return!0;return!1}function IV(e){let t=e=>{try{return Buffer.isBuffer(e)?e.byteLength:typeof e==`string`?e.length:typeof e==`number`?e.toString().length:e==null?0:JSON.stringify(e).length}catch{return}};return Array.isArray(e)?e.reduce((e,n)=>{let r=t(n);return typeof r==`number`?e===void 0?r:e+r:e},0):t(e)}function LV(e){let t=[],n=e=>{e.forEach(e=>{Array.isArray(e)?n(e):t.push(e)})};return n(e),t}var RV={};function zV(e){RV=e}var BV=(e,t,n,r)=>{let i=PV(t,n),a=MV(t);if(!i||!a||!RV.cachePrefixes||!FV(t,i,RV.cachePrefixes))return;let o=L(e).data,s=o[`net.peer.name`]??o[`server.address`],c=o[`net.peer.port`]??o[`server.port`];c&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":c});let l=jV(AV,t)?void 0:IV(r);l&&e.setAttribute(Gr,l),jV(OV,t)&&l!==void 0&&e.setAttribute(Ur,l>0),e.setAttributes({[F]:a,[Wr]:i});let u=i.join(`, `);e.updateName(RV.maxCacheKeyLength?xn(u,RV.maxCacheKeyLength):u)},VV=`db.connection_string`,HV=`redis`,UV=`@sentry/instrumentation-ioredis`,WV=`auto.db.otel.redis`,GV=[`>=2.0.0 <5.11.0`];function KV(e,t){t&&e.setStatus({code:2,message:t.message}),e.end()}var qV=class extends q{constructor(e={}){super(UV,k,e)}init(){return[new J(`ioredis`,GV,e=>{let t=e[Symbol.toStringTag]===`Module`&&e.default?e.default:e;return K(t.prototype.sendCommand)&&this._unwrap(t.prototype,`sendCommand`),this._wrap(t.prototype,`sendCommand`,this._patchSendCommand()),K(t.prototype.connect)&&this._unwrap(t.prototype,`connect`),this._wrap(t.prototype,`connect`,this._patchConnection()),e},e=>{if(e===void 0)return;let t=e[Symbol.toStringTag]===`Module`&&e.default?e.default:e;this._unwrap(t.prototype,`sendCommand`),this._unwrap(t.prototype,`connect`)})]}_patchSendCommand(){let e=this;return t=>function(...n){let r=n[0];if(n.length<1||typeof r!=`object`||!R())return t.apply(this,n);let{host:i,port:a}=this.options,o={[Bs]:HV,[zs]:$I(r.name,r.args),[VV]:`redis://${i}:${a}`,[Zc]:i,[Qc]:a,[I]:WV},s=B({name:r.name,kind:G.CLIENT,attributes:o});try{let i=t.apply(this,n),a=r.resolve;r.resolve=function(t){e._callResponseHook(s,r,t),KV(s,null),a(t)};let o=r.reject;return r.reject=function(e){KV(s,e),o(e)},i}catch(e){throw KV(s,e),e}}}_patchConnection(){return e=>function(...t){if(!R())return e.apply(this,t);let{host:n,port:r}=this.options,i={[Bs]:HV,[zs]:`connect`,[VV]:`redis://${n}:${r}`,[Zc]:n,[Qc]:r,[I]:WV},a=B({name:`connect`,kind:G.CLIENT,attributes:i});try{let n=e.apply(this,t);return n instanceof Promise?n.then(e=>(KV(a,null),e),e=>(KV(a,e),Promise.reject(e))):(KV(a,null),n)}catch(e){throw KV(a,e),e}}}_callResponseHook(e,t,n){let{responseHook:r}=this.getConfig();if(r)try{r(e,t.name,t.args,n)}catch{}}},JV=`@sentry/instrumentation-redis`,YV=`auto.db.otel.redis`,XV=Symbol(`opentelemetry.instrumentation.redis.open_spans`),ZV=Symbol(`opentelemetry.instrumentation.redis.multi_command_options`);function QV(e,t){t&&e.setStatus({code:2,message:t.message}),e.end()}function $V(e,t,n,r,i){if(e)try{e(t,n,r,i)}catch{}}function eH(e){if(typeof e==`string`&&e)try{let t=new URL(e);return t.searchParams.delete(`user_pwd`),t.username=``,t.password=``,t.href}catch(e){bP&&A.error(`failed to sanitize redis connection url`,e)}}function tH(e){return{[Bs]:HV,[Zc]:e?.socket?.host,[Qc]:e?.socket?.port,[VV]:eH(e?.url),[I]:YV}}var nH=class e extends q{constructor(e={}){super(JV,k,e)}init(){return[new J(`redis`,[`>=2.6.0 <4`],e=>(K(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,`internal_send_command`),this._wrap(e.RedisClient.prototype,`internal_send_command`,this._getPatchInternalSendCommand()),e),e=>{e!==void 0&&this._unwrap(e.RedisClient.prototype,`internal_send_command`)})]}_getPatchInternalSendCommand(){let t=this;return function(n){return function(r){if(arguments.length!==1||typeof r!=`object`)return n.apply(this,arguments);let i={[Bs]:HV,[zs]:$I(r.command,r.args),[I]:YV};this.connection_options&&(i[Zc]=this.connection_options.host,i[Qc]=this.connection_options.port),this.address&&(i[VV]=`redis://${this.address}`);let a=B({name:`${e.COMPONENT}-${r.command}`,kind:G.CLIENT,attributes:i}),o=arguments[0].callback;if(o){let e=R();arguments[0].callback=function(n,i){return $V(t.getConfig().responseHook,a,r.command,r.args,i),QV(a,n),V(e??null,()=>o.apply(this,arguments))}}try{return n.apply(this,arguments)}catch(e){throw QV(a,e),e}}}}};nH.COMPONENT=`redis`;var rH=nH,iH=class e extends q{constructor(e={}){super(JV,k,e)}init(){return[this._getInstrumentationNodeModuleDefinition(`@redis/client`),this._getInstrumentationNodeModuleDefinition(`@node-redis/client`)]}_getInstrumentationNodeModuleDefinition(e){return new J(e,[`^1.0.0`,`>=5.0.0 <5.12.0`],e=>e,()=>{},[new QR(`${e}/dist/lib/commander.js`,[`^1.0.0`],(e,t)=>{let n=e.transformCommandArguments;if(!n)return bP&&A.error(`internal instrumentation error, missing transformCommandArguments function`),e;let r=t?.startsWith(`1.0.`)?`extendWithCommands`:`attachCommands`;return K(e?.[r])&&this._unwrap(e,r),this._wrap(e,r,this._getPatchExtendWithCommands(n)),e},e=>{K(e?.extendWithCommands)&&this._unwrap(e,`extendWithCommands`),K(e?.attachCommands)&&this._unwrap(e,`attachCommands`)}),new QR(`${e}/dist/lib/client/multi-command.js`,[`^1.0.0`,`>=5.0.0 <5.12.0`],e=>{let t=e?.default?.prototype;return K(t?.exec)&&this._unwrap(t,`exec`),this._wrap(t,`exec`,this._getPatchMultiCommandsExec()),K(t?.execAsPipeline)&&this._unwrap(t,`execAsPipeline`),this._wrap(t,`execAsPipeline`,this._getPatchMultiCommandsExec()),K(t?.addCommand)&&this._unwrap(t,`addCommand`),this._wrap(t,`addCommand`,this._getPatchMultiCommandsAddCommand()),e},e=>{let t=e?.default?.prototype;K(t?.exec)&&this._unwrap(t,`exec`),K(t?.execAsPipeline)&&this._unwrap(t,`execAsPipeline`),K(t?.addCommand)&&this._unwrap(t,`addCommand`)}),new QR(`${e}/dist/lib/client/index.js`,[`^1.0.0`,`>=5.0.0 <5.12.0`],e=>{let t=e?.default?.prototype;return t?.multi&&(K(t?.multi)&&this._unwrap(t,`multi`),this._wrap(t,`multi`,this._getPatchRedisClientMulti())),t?.MULTI&&(K(t?.MULTI)&&this._unwrap(t,`MULTI`),this._wrap(t,`MULTI`,this._getPatchRedisClientMulti())),K(t?.sendCommand)&&this._unwrap(t,`sendCommand`),this._wrap(t,`sendCommand`,this._getPatchRedisClientSendCommand()),K(t?.connect)&&this._unwrap(t,`connect`),this._wrap(t,`connect`,this._getPatchedClientConnect()),e},e=>{let t=e?.default?.prototype;K(t?.multi)&&this._unwrap(t,`multi`),K(t?.MULTI)&&this._unwrap(t,`MULTI`),K(t?.sendCommand)&&this._unwrap(t,`sendCommand`),K(t?.connect)&&this._unwrap(t,`connect`)})])}_getPatchExtendWithCommands(e){let t=this;return function(n){return function(r){if(r?.BaseClass?.name!==`RedisClient`)return n.apply(this,arguments);let i=r.executor;return r.executor=function(n,r){let a=e(n,r).args;return t._traceClientCommand(i,this,arguments,a)},n.apply(this,arguments)}}}_getPatchMultiCommandsExec(){let e=this;return function(t){return function(){let n=t.apply(this,arguments);return typeof n?.then==`function`?n.then(t=>{let n=this[XV];return e._endSpansWithRedisReplies(n,t),t}).catch(t=>{let n=this[XV];if(!n)bP&&A.error(`cannot find open spans to end for multi/pipeline`);else{let r=t.constructor.name===`MultiErrorReply`?t.replies:Array(n.length).fill(t);e._endSpansWithRedisReplies(n,r)}return Promise.reject(t)}):(bP&&A.error(`non-promise result when patching exec/execAsPipeline`),n)}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(t){return function(n){return e._traceClientCommand(t,this,arguments,n)}}}_getPatchRedisClientMulti(){return function(e){return function(){let t=e.apply(this,arguments);return t[ZV]=this.options,t}}}_getPatchRedisClientSendCommand(){let e=this;return function(t){return function(n){return e._traceClientCommand(t,this,arguments,n)}}}_getPatchedClientConnect(){return function(t){return function(){let n=tH(this.options),r=B({name:`${e.COMPONENT}-connect`,kind:G.CLIENT,attributes:n});return V(r,()=>t.apply(this)).then(e=>(r.end(),e),e=>(QV(r,e),Promise.reject(e)))}}}_traceClientCommand(t,n,r,i){let a=n.options||n[ZV],o=i[0],s=i.slice(1),c=tH(a),l=$I(o,s);l!=null&&(c[zs]=l);let u=B({name:`${e.COMPONENT}-${o}`,kind:G.CLIENT,attributes:c}),d=V(u,()=>t.apply(n,r));if(d instanceof Promise)d.then(e=>{this._endSpanWithResponse(u,o,s,e,void 0)},e=>{this._endSpanWithResponse(u,o,s,null,e)});else{let e=d;e[XV]=e[XV]||[],e[XV].push({span:u,commandName:o,commandArgs:s})}return d}_endSpansWithRedisReplies(e,t){if(!e){bP&&A.error(`cannot find open spans to end for redis multi/pipeline`);return}if(t.length!==e.length){bP&&A.error(`number of multi command spans does not match response from redis`);return}for(let n=0;n<e.length;n++){let{span:r,commandName:i,commandArgs:a}=e[n],o=t[n],[s,c]=o instanceof Error?[null,o]:[o,void 0];this._endSpanWithResponse(r,i,a,s,c)}}_endSpanWithResponse(e,t,n,r,i){i||$V(this.getConfig().responseHook,e,t,n,r),QV(e,i)}};iH.COMPONENT=`redis`;var aH=iH,oH=class extends q{constructor(e={}){super(JV,k,e),this.initialized=!1,this.instrumentationV2_V3=new rH(this.getConfig()),this.instrumentationV4_V5=new aH(this.getConfig()),this.initialized=!0}setConfig(e={}){super.setConfig(e),this.initialized&&(this.instrumentationV2_V3.setConfig(e),this.instrumentationV4_V5.setConfig(e))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}},sH=`Redis`,cH=Y(`${sH}.IORedis`,()=>new qV({responseHook:BV})),lH=Y(`${sH}.Redis`,()=>new oH({responseHook:BV})),uH=Object.assign(()=>{(!TV()||!C.tracingChannel)&&(cH(),lH())},{id:sH}),dH=W(((e={})=>Mu(ZI({responseHook:BV}),{name:sH,setupOnce(){zV(e),uH()}}))),fH=(e=>(e.QUERY_PREFIX=`pg.query`,e.CONNECT=`pg.connect`,e.POOL_CONNECT=`pg-pool.connect`,e))(fH||{}),pH=(e=>(e.PG_PLAN=`db.postgresql.plan`,e.IDLE_TIMEOUT_MILLIS=`db.postgresql.idle.timeout.millis`,e.MAX_CLIENT=`db.postgresql.max.client`,e))(pH||{}),mH=`db.connection_string`,hH=`postgresql`,gH=`auto.db.otel.postgres`;function _H(e,t){if(!t)return fH.QUERY_PREFIX;let n=typeof t.name==`string`&&t.name?t.name:vH(t.text);return`${fH.QUERY_PREFIX}:${n}${e?` ${e}`:``}`}function vH(e){let t=e.trim(),n=t.indexOf(` `),r=n===-1?t:t.slice(0,n);return r=r.toUpperCase(),r.endsWith(`;`)?r.slice(0,-1):r}function yH(e){try{let t=new URL(e);return t.username=``,t.password=``,t.toString()}catch{return`postgresql://localhost:5432/`}}function bH(e){return`connectionString`in e&&e.connectionString?yH(e.connectionString):`postgresql://${e.host||`localhost`}:${e.port||5432}/${e.database||``}`}function xH(e){if(Number.isInteger(e))return e}function SH(e){return{[Bs]:hH,[Ns]:e.database,[mH]:bH(e),[Hs]:e.user,[Zc]:e.host,[Qc]:xH(e.port)}}function CH(e){let t;try{t=e.connectionString?new URL(e.connectionString):void 0}catch{t=void 0}return{[pH.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[pH.MAX_CLIENT]:e.maxClient,[Bs]:hH,[Ns]:t?.pathname.slice(1)??e.database,[mH]:bH(e),[Zc]:t?.hostname??e.host,[Qc]:Number(t?.port)||xH(e.port),[Hs]:t?.username??e.user}}function wH(){return R()===void 0}function TH(e){let{connectionParameters:t}=this,n=t.database,r=B({name:_H(n,e),kind:G.CLIENT,attributes:{...SH(t),[I]:gH}});return e?(e.text&&r.setAttribute(zs,e.text),typeof e.name==`string`&&r.setAttribute(pH.PG_PLAN,e.name),r):r}function EH(e,t){return function(n,r){n&&e.setStatus({code:2,message:n.message}),e.end(),t.call(this,n,r)}}function DH(e,t){return function(n,r,i){n&&e.setStatus({code:2,message:n.message}),e.end(),t.call(this,n,r,i)}}function OH(e,t){return function(...n){let r=n[0];r instanceof Error&&e.setStatus({code:2,message:r.message}),e.end(),t.apply(this,n)}}function kH(e){return typeof e==`object`&&e&&`message`in e?String(e.message):void 0}function AH(e){return typeof e==`object`&&typeof e?.text==`string`}var jH=`@sentry/instrumentation-pg`;function MH(e){return e[Symbol.toStringTag]===`Module`?e.default:e}function NH(e,t){return function(...n){return V(e,()=>t.apply(this,n))}}var PH=class extends q{constructor(e={}){super(jH,k,e)}init(){let e=[`>=8.0.3 <9`],t=[`>=2.0.0 <4`],n=new QR(`pg/lib/native/client.js`,e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this));return[new J(`pg`,e,e=>{let t=MH(e);return this._patchPgClient(t.Client),e},e=>{let t=MH(e);return this._unpatchPgClient(t.Client),e},[new QR(`pg/lib/client.js`,e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),n]),new J(`pg-pool`,t,e=>{let t=MH(e);return K(t.prototype.connect)&&this._unwrap(t.prototype,`connect`),this._wrap(t.prototype,`connect`,this._getPoolConnectPatch()),t},e=>{let t=MH(e);K(t.prototype.connect)&&this._unwrap(t.prototype,`connect`)})]}_patchPgClient(e){if(!e)return;let t=MH(e);return K(t.prototype.query)&&this._unwrap(t.prototype,`query`),K(t.prototype.connect)&&this._unwrap(t.prototype,`connect`),this._wrap(t.prototype,`query`,this._getClientQueryPatch()),this._wrap(t.prototype,`connect`,this._getClientConnectPatch()),e}_unpatchPgClient(e){let t=MH(e);return K(t.prototype.query)&&this._unwrap(t.prototype,`query`),K(t.prototype.connect)&&this._unwrap(t.prototype,`connect`),e}_getClientConnectPatch(){let e=this;return t=>function(n){if(wH()||e.getConfig().ignoreConnectSpans)return t.call(this,n);let r=B({name:fH.CONNECT,kind:G.CLIENT,attributes:SH(this)}),i=n;if(i){let e=R();i=OH(r,i),e&&(i=NH(e,i))}return FH(r,V(r,()=>t.call(this,i)))}}_getClientQueryPatch(){return e=>(this._diag.debug(`Patching pg.Client.prototype.query`),function(...t){if(wH())return e.apply(this,t);let n=t[0],r=typeof n==`string`,i=AH(n),a=r?{text:n,values:Array.isArray(t[1])?t[1]:void 0}:i?{...n,name:n.name,text:n.text,values:n.values??(Array.isArray(t[1])?t[1]:void 0)}:void 0,o=TH.call(this,a);if(t.length>0){let e=R();if(typeof t[t.length-1]==`function`)t[t.length-1]=EH(o,t[t.length-1]),e&&(t[t.length-1]=NH(e,t[t.length-1]));else if(typeof a?.callback==`function`){let n=EH(o,a.callback);e&&(n=NH(e,n)),t[0].callback=n}}let s;try{s=e.apply(this,t)}catch(e){throw o.setStatus({code:2,message:kH(e)}),o.end(),e}return s instanceof Promise?s.then(e=>(o.end(),e)).catch(e=>(o.setStatus({code:2,message:kH(e)}),o.end(),Promise.reject(e))):s})}_getPoolConnectPatch(){let e=this;return t=>function(n){if(wH()||e.getConfig().ignoreConnectSpans)return t.call(this,n);let r=B({name:fH.POOL_CONNECT,kind:G.CLIENT,attributes:CH(this.options)}),i=n;if(i){let e=R();i=DH(r,i),e&&(i=NH(e,i))}return FH(r,V(r,()=>t.call(this,i)))}}};function FH(e,t){return t instanceof Promise?t.then(t=>(e.end(),t)).catch(t=>(e.setStatus({code:2,message:kH(t)}),e.end(),Promise.reject(t))):t}var IH=`Postgres`,LH=Y(IH,PH,e=>({ignoreConnectSpans:e?.ignoreConnectSpans??!1})),RH=W((e=>({name:IH,setupOnce(){LH(e)}})));x();var zH=`PostgresJs`,BH=[`>=3.0.0 <4`],VH=`db.response.status_code`,HH=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,UH=Symbol.for(`sentry.query.from.instrumented.sql`),WH=Y(zH,e=>new GH({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),GH=class extends q{constructor(e){super(`sentry-postgres-js`,k,e)}init(){let e=new J(`postgres`,BH,e=>{try{return this._patchPostgres(e)}catch(t){return bP&&A.error(`Failed to patch postgres module:`,t),e}},e=>e);return[`src`,`cf/src`,`cjs/src`].forEach(t=>{e.files.push(new QR(`postgres/${t}/query.js`,BH,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let t=typeof e==`function`,n=t?e:e.default;if(typeof n!=`function`)return bP&&A.warn(`postgres module does not export a function. Skipping instrumentation.`),e;let r=this,i=function(...e){let t=Reflect.construct(n,e);if(!t||typeof t!=`function`)return bP&&A.warn(`postgres() did not return a valid instance`),t;let i=r.getConfig();return rC(t,{requireParentSpan:i.requireParentSpan,requestHook:i.requestHook})};Object.setPrototypeOf(i,n),Object.setPrototypeOf(i.prototype,n.prototype);for(let e of Object.getOwnPropertyNames(n))if(![`length`,`name`,`prototype`].includes(e)){let t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(i,e,t)}return t?i:(mb(e,`default`,i),e)}_shouldCreateSpans(){let e=this.getConfig();return _.getSpan(l.active())!==void 0||!e.requireParentSpan}_setOperationName(e,t,n){if(n){e.setAttribute(Ls,n);return}let r=t?.match(HH);r?.[1]&&e.setAttribute(Ls,r[1].toUpperCase())}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((e,t,n)=>n===0?t:`${e}$${n}${t}`,``)}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,``).replace(/\/\*[\s\S]*?\*\//g,``).replace(/;\s*$/,``).replace(/\s+/g,` `).trim().replace(/\bX'[0-9A-Fa-f]*'/gi,`?`).replace(/\bB'[01]*'/gi,`?`).replace(/'(?:[^']|'')*'/g,`?`).replace(/\b0x[0-9A-Fa-f]+/gi,`?`).replace(/\b(?:TRUE|FALSE)\b/gi,`?`).replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,`?`).replace(/-?\b\d+\.\d+\b/g,`?`).replace(/-?\.\d+\b/g,`?`).replace(/(?<!\$)-?\b\d+\b/g,`?`).replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,`IN (?)`).replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,`IN ($?)`):`Unknown SQL Query`}_patchQueryPrototype(e){let t=this,n=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...e){if(this.executed||this[UH]||!t._shouldCreateSpans())return n.apply(this,e);let r=t._reconstructQuery(this.strings),i=t._sanitizeSqlQuery(r);return oo({name:i||`postgresjs.query`,op:`db`},r=>{IN(r,`auto.db.postgresjs`),r.setAttributes({[Vs]:`postgres`,[Rs]:i});let{requestHook:a}=t.getConfig();a&&jT(()=>a(r,i,void 0),e=>{e&&(r.setAttribute(`sentry.hook.error`,`requestHook failed`),bP&&A.error(`Error in requestHook for ${zH} integration:`,e))},!0);let o=this.resolve;this.resolve=new Proxy(o,{apply:(e,n,a)=>{try{t._setOperationName(r,i,a?.[0]?.command),r.end()}catch(e){bP&&A.error(`Error ending span in resolve callback:`,e)}return Reflect.apply(e,n,a)}});let s=this.reject;this.reject=new Proxy(s,{apply:(e,n,a)=>{try{r.setStatus({code:2,message:a?.[0]?.message||`unknown_error`}),r.setAttribute(VH,a?.[0]?.code||`unknown`),r.setAttribute(Us,a?.[0]?.name||`unknown`),t._setOperationName(r,i),r.end()}catch(e){bP&&A.error(`Error ending span in reject callback:`,e)}return Reflect.apply(e,n,a)}});try{return n.apply(this,e)}catch(e){throw r.setStatus({code:2,message:e instanceof Error?e.message:`unknown_error`}),r.end(),e}})},e.Query.prototype.handle.__sentry_original__=n,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},KH=W((e=>({name:zH,setupOnce(){WH(e)}}))),qH=(e=>(e.HAPI_TYPE=`hapi.type`,e.PLUGIN_NAME=`hapi.plugin.name`,e.EXT_TYPE=`server.ext.type`,e))(qH||{}),JH=`@hapi/hapi`,YH=Symbol(`hapi-handler-patched`),XH={ROUTER:`router`,PLUGIN:`plugin`,EXT:`server.ext`},ZH=new Set([`onPreAuth`,`onCredentials`,`onPostAuth`,`onPreHandler`,`onPostHandler`,`onPreResponse`,`onRequest`]);function QH(e){return e.name?e.name:e.pkg.name}var $H=e=>typeof e==`string`&&ZH.has(e),eU=e=>{let t=e?.type;return t!==void 0&&$H(t)},tU=e=>Array.isArray(e)&&e.length<=3&&$H(e[0])&&typeof e[1]==`function`,nU=e=>!Array.isArray(e),rU=(e,t)=>{let n={[Oc]:e.path,[Tc]:e.method},r;return t?(n[qH.HAPI_TYPE]=XH.PLUGIN,n[qH.PLUGIN_NAME]=t,r=`${t}: route - ${e.path}`):(n[qH.HAPI_TYPE]=XH.ROUTER,r=`route - ${e.path}`),{attributes:n,name:r}},iU=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!==`method`&&(r=`ext - ${e} - ${n}`),t?{attributes:{[qH.EXT_TYPE]:e,[qH.HAPI_TYPE]:XH.EXT,[qH.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[qH.EXT_TYPE]:e,[qH.HAPI_TYPE]:XH.EXT},name:r}},aU=e=>`plugin`in e?`plugin`in e.plugin?e.plugin.plugin:e.plugin:e;x();var oU=`@sentry/instrumentation-hapi`,sU=class extends q{constructor(e={}){super(oU,k,e)}init(){return new J(JH,[`>=17.0.0 <22`],e=>{let t=e[Symbol.toStringTag]===`Module`?e.default:e;return K(t.server)||this._wrap(t,`server`,this._getServerPatch.bind(this)),K(t.Server)||this._wrap(t,`Server`,this._getServerPatch.bind(this)),t},e=>{let t=e[Symbol.toStringTag]===`Module`?e.default:e;this._massUnwrap([t],[`server`,`Server`])})}_getServerPatch(e){let t=this,n=this;return function(r){let i=e.apply(this,[r]);return n._wrap(i,`route`,e=>t._getServerRoutePatch.bind(t)(e)),n._wrap(i,`ext`,e=>t._getServerExtPatch.bind(t)(e)),n._wrap(i,`register`,t._getServerRegisterPatch.bind(t)),i}}_getServerRegisterPatch(e){let t=this;return function(n,r){if(Array.isArray(n))for(let e of n){let n=aU(e);t._wrapRegisterHandler(n)}else{let e=aU(n);t._wrapRegisterHandler(e)}return e.apply(this,[n,r])}}_getServerExtPatch(e,t){let n=this;return function(...r){if(Array.isArray(r[0])){let i=r[0];for(let e=0;e<i.length;e++){let r=i[e];if($H(r.type)){let a=r;a.method=n._wrapExtMethods(a.method,r.type,t),i[e]=a}}return e.apply(this,r)}if(tU(r)){let i=r,a=i[1],o=n._wrapExtMethods(a,i[0],t);return e.apply(this,[i[0],o,i[2]])}if(eU(r[0])){let i=r[0];return i.method=n._wrapExtMethods(i.method,i.type,t),e.call(this,i)}return e.apply(this,r)}}_getServerRoutePatch(e,t){let n=this;return function(r){if(Array.isArray(r))for(let e=0;e<r.length;e++){let i=n._wrapRouteHandler.call(n,r[e],t);r[e]=i}else r=n._wrapRouteHandler.call(n,r,t);return e.apply(this,[r])}}_wrapRegisterHandler(e){let t=this,n=QH(e),r=e.register,i=this;e.register=function(e,a){return i._wrap(e,`route`,e=>t._getServerRoutePatch.bind(t)(e,n)),i._wrap(e,`ext`,e=>t._getServerExtPatch.bind(t)(e,n)),r.call(this,e,a)}}_wrapExtMethods(e,t,n){let r=this;if(e instanceof Array){for(let n=0;n<e.length;n++)e[n]=r._wrapExtMethods(e[n],t);return e}return nU(e)?e[YH]===!0?e:(e[YH]=!0,function(...r){if(_.getSpan(l.active())===void 0)return e.apply(this,r);let i=iU(t,n,e.name);return z({name:i.name,op:`${i.attributes[qH.HAPI_TYPE]}.hapi`,attributes:{...i.attributes,[I]:`auto.http.otel.hapi`}},()=>e.apply(void 0,r))}):e}_wrapRouteHandler(e,t){if(e[YH]===!0)return e;e[YH]=!0;let n=n=>function(...r){if(_.getSpan(l.active())===void 0)return n.call(this,...r);xP(e.path);let i=rU(e,t);return z({name:i.name,op:`${i.attributes[qH.HAPI_TYPE]}.hapi`,attributes:{...i.attributes,[I]:`auto.http.otel.hapi`}},()=>n.call(this,...r))};if(typeof e.handler==`function`)e.handler=n(e.handler);else if(typeof e.options==`function`){let t=e.options;e.options=function(e){let r=t(e);return typeof r.handler==`function`&&(r.handler=n(r.handler)),r}}else typeof e.options?.handler==`function`&&(e.options.handler=n(e.options.handler));return e}},cU=`Hapi`,lU=Y(cU,()=>new sU),uU=W((()=>({name:cU,setupOnce(){lU()}})));function dU(e){return!!(e&&typeof e==`object`&&`error`in e&&e.error)}function fU(e){H(e,{mechanism:{type:`auto.function.hapi`,handled:!1}})}var pU={name:`SentryHapiErrorPlugin`,version:k,register:async function(e){e.events.on({name:`request`,channels:[`error`]},(e,t)=>{if(N()!==ar()){let t=e.route;t.path&&N().setTransactionName(`${t.method.toUpperCase()} ${t.path}`)}else bP&&A.warn(`Isolation scope is still the default isolation scope - skipping setting transactionName`);dU(t)&&fU(t.error)})}};async function mU(e){await e.register(pU),ZM(e.register,`hapi`)}var hU={HONO_TYPE:`hono.type`,HONO_NAME:`hono.name`},gU={MIDDLEWARE:`middleware`,REQUEST_HANDLER:`request_handler`};x();var _U=`@sentry/instrumentation-hono`,vU=`0.0.1`,yU=class extends q{constructor(e={}){super(_U,vU,e)}init(){return[new J(`hono`,[`>=4.0.0 <5`],e=>this._patch(e))]}_patch(e){let t=this;class n extends e.Hono{constructor(...e){super(...e),t._wrap(this,`get`,t._patchHandler()),t._wrap(this,`post`,t._patchHandler()),t._wrap(this,`put`,t._patchHandler()),t._wrap(this,`delete`,t._patchHandler()),t._wrap(this,`options`,t._patchHandler()),t._wrap(this,`patch`,t._patchHandler()),t._wrap(this,`all`,t._patchHandler()),t._wrap(this,`on`,t._patchOnHandler()),t._wrap(this,`use`,t._patchMiddlewareHandler())}}try{e.Hono=n}catch{return{...e,Hono:n}}return e}_patchHandler(){let e=this;return function(t){return function(...n){if(typeof n[0]==`string`){let r=n[0];if(n.length===1)return t.apply(this,[r]);let i=n.slice(1);return t.apply(this,[r,...i.map(t=>e._wrapHandler(t))])}return t.apply(this,n.map(t=>e._wrapHandler(t)))}}}_patchOnHandler(){let e=this;return function(t){return function(...n){let r=n.slice(2);return t.apply(this,[...n.slice(0,2),...r.map(t=>e._wrapHandler(t))])}}}_patchMiddlewareHandler(){let e=this;return function(t){return function(...n){if(typeof n[0]==`string`){let r=n[0];if(n.length===1)return t.apply(this,[r]);let i=n.slice(1);return t.apply(this,[r,...i.map(t=>e._wrapHandler(t))])}return t.apply(this,n.map(t=>e._wrapHandler(t)))}}}_wrapHandler(e){let t=this;return function(n,r){if(!t.isEnabled())return e.apply(this,[n,r]);let i=n.req.path,a=t.tracer.startSpan(i);return l.with(_.setSpan(l.active(),a),()=>t._safeExecute(()=>{let o=e.apply(this,[n,r]);if(Gt(o))return o.then(n=>{let r=t._determineHandlerType(n);return a.setAttributes({[hU.HONO_TYPE]:r,[hU.HONO_NAME]:r===gU.REQUEST_HANDLER?i:e.name||`anonymous`}),t.getConfig().responseHook?.(a),n});{let n=t._determineHandlerType(o);return a.setAttributes({[hU.HONO_TYPE]:n,[hU.HONO_NAME]:n===gU.REQUEST_HANDLER?i:e.name||`anonymous`}),t.getConfig().responseHook?.(a),o}},()=>a.end(),e=>{t._handleError(a,e),a.end()}))}}_safeExecute(e,t,n){try{let r=e();return Gt(r)?r.then(()=>t(),e=>n(e)):t(),r}catch(e){throw n(e),e}}_determineHandlerType(e){return e===void 0?gU.MIDDLEWARE:gU.REQUEST_HANDLER}_handleError(e,t){t instanceof Error&&(e.setStatus({code:oe.ERROR,message:t.message}),e.recordException(t))}},bU=`Hono`;function xU(e){let t=L(e).data,n=t[hU.HONO_TYPE];if(t[`sentry.op`]||!n)return;e.setAttributes({[I]:`auto.http.otel.hono`,[F]:`${n}.hono`});let r=t[hU.HONO_NAME];if(typeof r==`string`&&e.updateName(r),N()===ar()){bP&&A.warn(`Isolation scope is default isolation scope - skipping setting transactionName`);return}let i=t[Oc],a=t[Ec];typeof i==`string`&&typeof a==`string`&&N().setTransactionName(`${a} ${i}`)}var SU=Y(bU,()=>new yU({responseHook:e=>{xU(e)}})),CU=W((()=>({name:bU,setupOnce(){SU()}})));function wU(){return async function(e,t){let n=If(e.req);N().setSDKProcessingMetadata({normalizedRequest:n}),await t()}}function TU(e){return e.res.status>=500}function EU(e){return async function(t,n){await n(),(e?.shouldHandleError||TU)(t)&&(t.res.sentry=H(t.error,{mechanism:{type:`auto.middleware.hono`,handled:!1}}))}}function DU(e,t){e.use(wU()),e.use(EU(t)),ZM(e.use,`hono`)}var OU=(e=>(e.ROUTER=`router`,e.MIDDLEWARE=`middleware`,e))(OU||{}),kU=(e=>(e.KOA_TYPE=`koa.type`,e.KOA_NAME=`koa.name`,e))(kU||{}),AU=(e,t,n,r)=>n?{attributes:{[kU.KOA_NAME]:r?.toString(),[kU.KOA_TYPE]:OU.ROUTER,[Oc]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[kU.KOA_NAME]:t.name??`middleware`,[kU.KOA_TYPE]:OU.MIDDLEWARE,[js]:t.name??`middleware`},name:`middleware - ${t.name}`},jU=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e)),MU=Symbol(`koa-layer-patched`);x();var NU=`@sentry/instrumentation-koa`,PU=class extends q{constructor(e={}){super(NU,k,e)}init(){return new J(`koa`,[`>=2.0.0 <4`],e=>{let t=e[Symbol.toStringTag]===`Module`?e.default:e;return t==null?t:(K(t.prototype.use)&&this._unwrap(t.prototype,`use`),this._wrap(t.prototype,`use`,this._getKoaUsePatch.bind(this)),e)},e=>{let t=e[Symbol.toStringTag]===`Module`?e.default:e;t&&K(t.prototype.use)&&this._unwrap(t.prototype,`use`)})}_getKoaUsePatch(e){let t=this._patchRouterDispatch.bind(this),n=this._patchLayer.bind(this);return function(r){let i=r.router?t(r):n(r,!1);return e.apply(this,[i])}}_patchRouterDispatch(e){let t=e.router?.stack??[];for(let e of t){let t=e.path,n=e.stack;for(let e=0;e<n.length;e++){let r=n[e];n[e]=this._patchLayer(r,!0,t)}}return e}_patchLayer(e,t,n){let r=t?OU.ROUTER:OU.MIDDLEWARE;return e[MU]===!0||jU(r,this.getConfig())||e.constructor.name===`GeneratorFunction`||e.constructor.name===`AsyncGeneratorFunction`?e:(e[MU]=!0,(i,a)=>{if(_.getSpan(l.active())===void 0)return e(i,a);let o=AU(i,e,t,n);i._matchedRoute&&xP(i._matchedRoute.toString());let s=o.attributes[kU.KOA_NAME];return z({name:typeof s==`string`?s||`< unknown >`:o.name,op:`${r}.koa`,attributes:{...o.attributes,[I]:`auto.http.otel.koa`}},()=>{let t=o.attributes[Oc];if(N()===ar())bP&&A.warn(`Isolation scope is default isolation scope - skipping setting transactionName`);else if(t){let e=i.request?.method?.toUpperCase()||`GET`;N().setTransactionName(`${e} ${t}`)}return e(i,a)})})}},FU=`Koa`,IU=Y(FU,PU,(e={})=>({ignoreLayersType:e.ignoreLayersType})),LU=W(((e={})=>({name:FU,setupOnce(){IU(e)}}))),RU=e=>{e.use(async(e,t)=>{try{await t()}catch(e){throw H(e,{mechanism:{handled:!1,type:`auto.middleware.koa`}}),e}}),ZM(e.use,`koa`)},zU=(e=>(e.CONNECT_TYPE=`connect.type`,e.CONNECT_NAME=`connect.name`,e))(zU||{}),BU=(e=>(e.MIDDLEWARE=`middleware`,e.REQUEST_HANDLER=`request_handler`,e))(BU||{}),VU=Symbol(`opentelemetry.instrumentation-connect.request-route-stack`),HU=e=>{Array.isArray(e[VU])===!1&&Object.defineProperty(e,VU,{enumerable:!1,value:[]}),e[VU].push(`/`);let t=e[VU].length;return()=>{t===e[VU].length?e[VU].pop():bP&&A.warn(`Connect: Trying to pop the stack multiple time`)}},UU=(e,t)=>{t&&e[VU].splice(-1,1,t)},WU=e=>e[VU].reduce((e,t)=>e.replace(/\/+$/,``)+t),GU=`@sentry/instrumentation-connect`,KU=`anonymous`,qU=class extends q{constructor(e={}){super(GU,k,e)}init(){return[new J(`connect`,[`>=3.0.0 <4`],e=>this._patchConstructor(e))]}_patchApp(e){K(e.use)||this._wrap(e,`use`,this._patchUse.bind(this)),K(e.handle)||this._wrap(e,`handle`,this._patchHandle.bind(this))}_patchConstructor(e){let t=this._patchApp.bind(this);return function(...n){let r=Reflect.apply(e,this,n);return t(r),r}}_patchNext(e,t,n){return function(r){It(r)&&t.setStatus({code:2,message:`internal_error`});let i=e.apply(this,[r]);return n(),i}}_startSpan(e,t){let n=e?BU.REQUEST_HANDLER:BU.MIDDLEWARE,r=e||t.name||KU;return B({name:r,op:`${n}.connect`,attributes:{[I]:`auto.http.otel.connect`,[Oc]:e.length>0?e:`/`,[zU.CONNECT_TYPE]:n,[zU.CONNECT_NAME]:r}})}_patchMiddleware(e,t){let n=this.isEnabled.bind(this),r=this._startSpan.bind(this),i=this._patchNext.bind(this),a=t.length===4;function o(){if(!n())return Reflect.apply(t,this,arguments);let[o,s,c]=a?[1,2,3]:[0,1,2],l=arguments[o],u=arguments[s],d=arguments[c];UU(l,e),e&&xP(WU(l));let f=r(e,t),p=!1;function m(){p||(p=!0,f.end()),u.removeListener(`close`,m)}u.addListener(`close`,m),arguments[c]=i(d,f,m);try{return Reflect.apply(t,this,arguments)}catch(e){throw f.setStatus({code:2,message:`internal_error`}),m(),e}}return Object.defineProperty(o,"length",{value:t.length,writable:!1,configurable:!0}),o}_patchUse(e){let t=this._patchMiddleware.bind(this);return function(...n){let r=n[n.length-1],i=n[n.length-2]||``;return n[n.length-1]=t(i,r),e.apply(this,n)}}_patchHandle(e){let t=this._patchOut.bind(this);return function(){let[n,r]=[0,2],i=arguments[n],a=arguments[r],o=HU(i);return typeof a==`function`&&(arguments[r]=t(a,o)),Reflect.apply(e,this,arguments)}}_patchOut(e,t){return function(...n){return t(),Reflect.apply(e,this,n)}}},JU=`Connect`,YU=Y(JU,()=>new qU),XU=W((()=>({name:JU,setupOnce(){YU()}})));function ZU(e,t,n,r){H(e,{mechanism:{handled:!1,type:`auto.middleware.connect`}}),r(e)}var QU=e=>{e.use(ZU),ZM(e.use,`connect`)},$U=`db.sql.table`,eW=`sqlite`,tW=`postgresql`,nW=e=>{if(e){if(e.client){if(e.client._formatQuery)return e.client._formatQuery.bind(e.client);if(e.client.SqlString)return e.client.SqlString.format.bind(e.client.SqlString)}if(e.builder)return e.builder.toString.bind(e.builder)}return()=>`<noop formatter>`},rW=new Map([[`sqlite3`,eW],[`pg`,tW]]),iW=e=>rW.get(e)||e,aW=(e,t,n)=>t?n?`${t} ${e}.${n}`:`${t} ${e}`:e,oW=(e,t)=>typeof e==`string`&&typeof t==`number`&&0<t&&t<e.length?`${e.substring(0,t)}..`:e,sW=e=>{if(e)try{return new URL(e).pathname?.replace(/^\//,``)||void 0}catch{return}},cW=e=>{if(e)try{return new URL(e).hostname||void 0}catch{return}},lW=e=>{if(e)try{let t=new URL(e).port;return t?parseInt(t,10):void 0}catch{return}},uW=e=>{let t=e?._single?.table;return typeof t==`object`?uW(t):t},dW=`@sentry/instrumentation-knex`,fW=`auto.db.otel.knex`,pW=`knex`,mW=[`>=0.22.0 <4`,`>=0.10.0 <0.18.0`,`>=0.19.0 <0.22.0`,`>=0.18.0 <0.19.0`],hW=1022,gW=Symbol(`sentry.instrumentation-knex.parent-span`),_W=class extends q{constructor(e={}){super(dW,k,e)}init(){let e=new J(pW,mW);return e.files.push(this._getClientNodeModuleFileInstrumentation(`src`),this._getClientNodeModuleFileInstrumentation(`lib`),this._getRunnerNodeModuleFileInstrumentation(`src`),this._getRunnerNodeModuleFileInstrumentation(`lib`),this._getRunnerNodeModuleFileInstrumentation(`lib/execution`)),e}_getRunnerNodeModuleFileInstrumentation(e){return new QR(`knex/${e}/runner.js`,mW,(e,t)=>(this._ensureWrapped(e.prototype,`query`,this._createQueryWrapper(t)),e),e=>(this._unwrap(e.prototype,`query`),e))}_getClientNodeModuleFileInstrumentation(e){return new QR(`knex/${e}/client.js`,mW,e=>(this._ensureWrapped(e.prototype,`queryBuilder`,this._storeContext.bind(this)),this._ensureWrapped(e.prototype,`schemaBuilder`,this._storeContext.bind(this)),this._ensureWrapped(e.prototype,`raw`,this._storeContext.bind(this)),e),e=>(this._unwrap(e.prototype,`queryBuilder`),this._unwrap(e.prototype,`schemaBuilder`),this._unwrap(e.prototype,`raw`),e))}_createQueryWrapper(e){return function(t){return function(n){let r=this.client.config,i=uW(this.builder),a=n?.method,o=r?.connection?.connectionString,s=r?.connection?.filename||r?.connection?.database||sW(o),c={[I]:fW,"knex.version":e,[Bs]:iW(this.client.driverName),[$U]:i,[Fs]:a,[Hs]:r?.connection?.user,[Ns]:s,[Zc]:r?.connection?.host??cW(o),[Qc]:r?.connection?.port??lW(o),[$c]:r?.connection?.filename===`:memory:`?`inproc`:void 0,[zs]:oW(n?.sql,hW)},l=this.builder[gW]||R(),u=arguments;return z({name:aW(s,a,i),kind:G.CLIENT,attributes:c,parentSpan:l,onlyIfParent:!0},e=>t.apply(this,u).catch(t=>{let r=nW(this)(n.sql,n.bindings||[]),i=t.message.replace(`${r} - `,``);throw e.setStatus({code:2,message:i}),t}))}}}_storeContext(e){return function(){let t=e.apply(this,arguments);return Object.defineProperty(t,gW,{value:R()}),t}}_ensureWrapped(e,t,n){K(e[t])&&this._unwrap(e,t),this._wrap(e,t,n)}},vW=`sentrySubscribeOrchestrionChannel`;function yW(e){let t=new Set,n=[];for(let{module:r}of e){let e=`${r.name}\0${r.versionRange}\0${String(r.filePath)}`;t.has(e)||(t.add(e),n.push({channelName:r.name,module:r,astQuery:`Program`,transform:vW}))}return n}var bW={name:`amqplib`,versionRange:`>=0.5.5 <2`},xW=[{channelName:`publish`,module:{...bW,filePath:`lib/channel_model.js`},functionQuery:{className:`Channel`,methodName:`publish`,kind:`Sync`}},{channelName:`confirmPublish`,module:{...bW,filePath:`lib/channel_model.js`},functionQuery:{className:`ConfirmChannel`,methodName:`publish`,kind:`Callback`}},{channelName:`consume`,module:{...bW,filePath:`lib/channel_model.js`},functionQuery:{className:`Channel`,methodName:`consume`,kind:`Async`}},{channelName:`dispatch`,module:{...bW,filePath:`lib/channel.js`},functionQuery:{className:`BaseChannel`,methodName:`dispatchMessage`,kind:`Sync`}},{channelName:`ack`,module:{...bW,filePath:`lib/channel_model.js`},functionQuery:{className:`Channel`,methodName:`ack`,kind:`Sync`}},{channelName:`nack`,module:{...bW,filePath:`lib/channel_model.js`},functionQuery:{className:`Channel`,methodName:`nack`,kind:`Sync`}},{channelName:`reject`,module:{...bW,filePath:`lib/channel_model.js`},functionQuery:{className:`Channel`,methodName:`reject`,kind:`Sync`}},{channelName:`ackAll`,module:{...bW,filePath:`lib/channel_model.js`},functionQuery:{className:`Channel`,methodName:`ackAll`,kind:`Sync`}},{channelName:`nackAll`,module:{...bW,filePath:`lib/channel_model.js`},functionQuery:{className:`Channel`,methodName:`nackAll`,kind:`Sync`}},{channelName:`connect`,module:{...bW,filePath:`lib/connect.js`},functionQuery:{functionName:`connect`,kind:`Callback`}}],SW={AMQPLIB_PUBLISH:`orchestrion:amqplib:publish`,AMQPLIB_CONFIRM_PUBLISH:`orchestrion:amqplib:confirmPublish`,AMQPLIB_CONSUME:`orchestrion:amqplib:consume`,AMQPLIB_DISPATCH:`orchestrion:amqplib:dispatch`,AMQPLIB_ACK:`orchestrion:amqplib:ack`,AMQPLIB_NACK:`orchestrion:amqplib:nack`,AMQPLIB_REJECT:`orchestrion:amqplib:reject`,AMQPLIB_ACK_ALL:`orchestrion:amqplib:ackAll`,AMQPLIB_NACK_ALL:`orchestrion:amqplib:nackAll`,AMQPLIB_CONNECT:`orchestrion:amqplib:connect`},CW=yW(xW),wW=[...[`resources/messages/messages.js`,`resources/messages/messages.mjs`].flatMap(e=>[`create`,`countTokens`].map(t=>({channelName:`chat`,module:{name:`@anthropic-ai/sdk`,versionRange:`>=0.19.2 <1`,filePath:e},functionQuery:{className:`Messages`,methodName:t,kind:`Auto`}}))),...[`resources/completions.js`,`resources/completions.mjs`].map(e=>({channelName:`chat`,module:{name:`@anthropic-ai/sdk`,versionRange:`>=0.19.2 <1`,filePath:e},functionQuery:{className:`Completions`,methodName:`create`,kind:`Auto`}})),...[`resources/beta/messages/messages.js`,`resources/beta/messages/messages.mjs`].map(e=>({channelName:`chat`,module:{name:`@anthropic-ai/sdk`,versionRange:`>=0.19.2 <1`,filePath:e},functionQuery:{className:`Messages`,methodName:`create`,kind:`Auto`}})),...[`resources/models.js`,`resources/models.mjs`].map(e=>({channelName:`models`,module:{name:`@anthropic-ai/sdk`,versionRange:`>=0.19.2 <1`,filePath:e},functionQuery:{className:`Models`,methodName:`retrieve`,kind:`Auto`}})),...[`resources/messages/messages.js`,`resources/messages/messages.mjs`].map(e=>({channelName:`messages-stream`,module:{name:`@anthropic-ai/sdk`,versionRange:`>=0.19.2 <1`,filePath:e},functionQuery:{className:`Messages`,methodName:`stream`,kind:`Sync`}}))],TW={ANTHROPIC_CHAT:`orchestrion:@anthropic-ai/sdk:chat`,ANTHROPIC_MODELS:`orchestrion:@anthropic-ai/sdk:models`,ANTHROPIC_MESSAGES_STREAM:`orchestrion:@anthropic-ai/sdk:messages-stream`},EW=yW(wW),DW=[{channelName:`send`,module:{name:`@smithy/core`,versionRange:`>=3.24.0 <4`,filePath:`dist-cjs/submodules/client/index.js`},functionQuery:{className:`Client`,methodName:`send`,kind:`Async`}},{channelName:`send`,module:{name:`@smithy/smithy-client`,versionRange:`>=1.0.3 <5`,filePath:`dist-cjs/index.js`},functionQuery:{className:`Client`,methodName:`send`,kind:`Async`}},{channelName:`send`,module:{name:`@aws-sdk/smithy-client`,versionRange:`^3.1.0`,filePath:`dist-cjs/index.js`},functionQuery:{className:`Client`,methodName:`send`,kind:`Async`}}],OW={AWS_SMITHY_CORE_SEND:`orchestrion:@smithy/core:send`,AWS_SMITHY_CLIENT_SEND:`orchestrion:@smithy/smithy-client:send`,AWS_SDK_SMITHY_CLIENT_SEND:`orchestrion:@aws-sdk/smithy-client:send`},kW=yW(DW),AW={name:`dataloader`,versionRange:`>=2.0.0 <3`,filePath:`index.js`},jW=[{channelName:`construct`,module:AW,functionQuery:{functionName:`DataLoader`,kind:`Sync`}},{channelName:`load`,module:AW,functionQuery:{expressionName:`load`,kind:`Async`}},{channelName:`loadMany`,module:AW,functionQuery:{expressionName:`loadMany`,kind:`Async`}},{channelName:`prime`,module:AW,functionQuery:{expressionName:`prime`,kind:`Sync`}},{channelName:`clear`,module:AW,functionQuery:{expressionName:`clear`,kind:`Sync`}},{channelName:`clearAll`,module:AW,functionQuery:{expressionName:`clearAll`,kind:`Sync`}}],MW={DATALOADER_CONSTRUCT:`orchestrion:dataloader:construct`,DATALOADER_LOAD:`orchestrion:dataloader:load`,DATALOADER_LOAD_MANY:`orchestrion:dataloader:loadMany`,DATALOADER_PRIME:`orchestrion:dataloader:prime`,DATALOADER_CLEAR:`orchestrion:dataloader:clear`,DATALOADER_CLEAR_ALL:`orchestrion:dataloader:clearAll`},NW=yW(jW),PW=[{channelName:`handle`,module:{name:`express`,versionRange:`>=4.0.0 <5`,filePath:`lib/router/layer.js`},functionQuery:{expressionName:`handle_request`,kind:`Callback`}},{channelName:`handle`,module:{name:`router`,versionRange:`>=2.0.0 <3`,filePath:`lib/layer.js`},functionQuery:{expressionName:`handleRequest`,kind:`Callback`}},{channelName:`register`,module:{name:`express`,versionRange:`>=4.0.0 <5`,filePath:`lib/router/index.js`},functionQuery:{expressionName:`route`,kind:`Sync`}},{channelName:`register`,module:{name:`express`,versionRange:`>=4.0.0 <5`,filePath:`lib/router/index.js`},functionQuery:{expressionName:`use`,kind:`Sync`}},{channelName:`register`,module:{name:`router`,versionRange:`>=2.0.0 <3`,filePath:`index.js`},functionQuery:{expressionName:`route`,kind:`Sync`}},{channelName:`register`,module:{name:`router`,versionRange:`>=2.0.0 <3`,filePath:`index.js`},functionQuery:{expressionName:`use`,kind:`Sync`}}],FW={EXPRESS_HANDLE:`orchestrion:express:handle`,ROUTER_HANDLE:`orchestrion:router:handle`,EXPRESS_REGISTER:`orchestrion:express:register`,ROUTER_REGISTER:`orchestrion:router:register`},IW=yW(PW),LW=`>=3.0.0 <5`,RW=/dist\/lite\/(index|common-[^/]+)\.node\.(cjs\.js|mjs)$/,zW=[{functionName:`addDoc`,channelName:`add-doc`},{functionName:`getDocs`,channelName:`get-docs`},{functionName:`setDoc`,channelName:`set-doc`},{functionName:`deleteDoc`,channelName:`delete-doc`}],BW=`>=6.0.0 <7`,VW=[{file:`lib/v2/providers/https.js`,functionName:`onRequest`,channelName:`http-request`},{file:`lib/v2/providers/https.js`,functionName:`onCall`,channelName:`http-call`},{file:`lib/v2/providers/firestore.js`,functionName:`onDocumentCreated`,channelName:`firestore-created`},{file:`lib/v2/providers/firestore.js`,functionName:`onDocumentCreatedWithAuthContext`,channelName:`firestore-created`},{file:`lib/v2/providers/firestore.js`,functionName:`onDocumentUpdated`,channelName:`firestore-updated`},{file:`lib/v2/providers/firestore.js`,functionName:`onDocumentUpdatedWithAuthContext`,channelName:`firestore-updated`},{file:`lib/v2/providers/firestore.js`,functionName:`onDocumentDeleted`,channelName:`firestore-deleted`},{file:`lib/v2/providers/firestore.js`,functionName:`onDocumentDeletedWithAuthContext`,channelName:`firestore-deleted`},{file:`lib/v2/providers/firestore.js`,functionName:`onDocumentWritten`,channelName:`firestore-written`},{file:`lib/v2/providers/firestore.js`,functionName:`onDocumentWrittenWithAuthContext`,channelName:`firestore-written`},{file:`lib/v2/providers/scheduler.js`,functionName:`onSchedule`,channelName:`scheduler`},{file:`lib/v2/providers/storage.js`,functionName:`onObjectFinalized`,channelName:`storage-finalized`},{file:`lib/v2/providers/storage.js`,functionName:`onObjectArchived`,channelName:`storage-archived`},{file:`lib/v2/providers/storage.js`,functionName:`onObjectDeleted`,channelName:`storage-deleted`},{file:`lib/v2/providers/storage.js`,functionName:`onObjectMetadataUpdated`,channelName:`storage-metadata-updated`}],HW=[...zW.map(({functionName:e,channelName:t})=>({channelName:t,module:{name:`@firebase/firestore`,versionRange:LW,filePath:RW},functionQuery:{functionName:e,kind:`Auto`}})),...VW.map(({file:e,functionName:t,channelName:n})=>({channelName:n,module:{name:`firebase-functions`,versionRange:BW,filePath:e},functionQuery:{functionName:t,kind:`Sync`}}))],UW={FIREBASE_FIRESTORE_ADD_DOC:`orchestrion:@firebase/firestore:add-doc`,FIREBASE_FIRESTORE_GET_DOCS:`orchestrion:@firebase/firestore:get-docs`,FIREBASE_FIRESTORE_SET_DOC:`orchestrion:@firebase/firestore:set-doc`,FIREBASE_FIRESTORE_DELETE_DOC:`orchestrion:@firebase/firestore:delete-doc`,FIREBASE_FUNCTIONS_HTTP_REQUEST:`orchestrion:firebase-functions:http-request`,FIREBASE_FUNCTIONS_HTTP_CALL:`orchestrion:firebase-functions:http-call`,FIREBASE_FUNCTIONS_FIRESTORE_CREATED:`orchestrion:firebase-functions:firestore-created`,FIREBASE_FUNCTIONS_FIRESTORE_UPDATED:`orchestrion:firebase-functions:firestore-updated`,FIREBASE_FUNCTIONS_FIRESTORE_DELETED:`orchestrion:firebase-functions:firestore-deleted`,FIREBASE_FUNCTIONS_FIRESTORE_WRITTEN:`orchestrion:firebase-functions:firestore-written`,FIREBASE_FUNCTIONS_SCHEDULER:`orchestrion:firebase-functions:scheduler`,FIREBASE_FUNCTIONS_STORAGE_FINALIZED:`orchestrion:firebase-functions:storage-finalized`,FIREBASE_FUNCTIONS_STORAGE_ARCHIVED:`orchestrion:firebase-functions:storage-archived`,FIREBASE_FUNCTIONS_STORAGE_DELETED:`orchestrion:firebase-functions:storage-deleted`,FIREBASE_FUNCTIONS_STORAGE_METADATA_UPDATED:`orchestrion:firebase-functions:storage-metadata-updated`},WW=yW(HW),GW=[{channelName:`acquire`,module:{name:`generic-pool`,versionRange:`>=3.0.0 <4`,filePath:`lib/Pool.js`},functionQuery:{className:`Pool`,methodName:`acquire`,kind:`Auto`}},{channelName:`acquire`,module:{name:`generic-pool`,versionRange:`>=2.4.0 <3`,filePath:`lib/generic-pool.js`},functionQuery:{expressionName:`acquire`,kind:`Callback`}}],KW={GENERIC_POOL_ACQUIRE:`orchestrion:generic-pool:acquire`},qW=yW(GW),JW=[`dist/node/index.js`,`dist/node/index.mjs`,`dist/node/index.cjs`],YW=[...JW.flatMap(e=>[`generateContent`,`generateContentStream`].map(t=>({channelName:`generate-content`,module:{name:`@google/genai`,versionRange:`>=0.10.0 <2`,filePath:e},functionQuery:{expressionName:t,kind:`Auto`}}))),...JW.map(e=>({channelName:`embed-content`,module:{name:`@google/genai`,versionRange:`>=0.10.0 <2`,filePath:e},functionQuery:{className:`Models`,methodName:`embedContent`,kind:`Auto`}})),...JW.flatMap(e=>[`sendMessage`,`sendMessageStream`].map(t=>({channelName:`chat`,module:{name:`@google/genai`,versionRange:`>=0.10.0 <2`,filePath:e},functionQuery:{className:`Chat`,methodName:t,kind:`Auto`}})))],XW={GOOGLE_GENAI_GENERATE_CONTENT:`orchestrion:@google/genai:generate-content`,GOOGLE_GENAI_EMBED_CONTENT:`orchestrion:@google/genai:embed-content`,GOOGLE_GENAI_CHAT:`orchestrion:@google/genai:chat`},ZW=yW(YW),QW=[{channelName:`parse`,module:{name:`graphql`,versionRange:`>=14.0.0 <17`,filePath:`language/parser.js`},functionQuery:{functionName:`parse`,kind:`Sync`}},{channelName:`validate`,module:{name:`graphql`,versionRange:`>=14.0.0 <17`,filePath:`validation/validate.js`},functionQuery:{functionName:`validate`,kind:`Sync`}},{channelName:`execute`,module:{name:`graphql`,versionRange:`>=14.0.0 <17`,filePath:`execution/execute.js`},functionQuery:{functionName:`execute`,kind:`Auto`}}],$W={GRAPHQL_PARSE:`orchestrion:graphql:parse`,GRAPHQL_VALIDATE:`orchestrion:graphql:validate`,GRAPHQL_EXECUTE:`orchestrion:graphql:execute`},eG=yW(QW),tG=[{channelName:`route`,module:{name:`@hapi/hapi`,versionRange:`>=17.0.0 <22.0.0`,filePath:`lib/server.js`},functionQuery:{methodName:`route`,kind:`Sync`}},{channelName:`ext`,module:{name:`@hapi/hapi`,versionRange:`>=17.0.0 <22.0.0`,filePath:`lib/server.js`},functionQuery:{methodName:`ext`,kind:`Sync`}}],nG={HAPI_ROUTE:`orchestrion:@hapi/hapi:route`,HAPI_EXT:`orchestrion:@hapi/hapi:ext`},rG=yW(tG),iG=[...[`lib/redis.js`,`built/redis.js`,`built/redis/index.js`].flatMap(e=>[{channelName:`command`,module:{name:`ioredis`,versionRange:`>=2.0.0 <5.0.0`,filePath:e},functionQuery:{expressionName:`sendCommand`,kind:`Async`}},{channelName:`connect`,module:{name:`ioredis`,versionRange:`>=2.0.0 <5.0.0`,filePath:e},functionQuery:{expressionName:`connect`,kind:`Async`}}]),{channelName:`command`,module:{name:`ioredis`,versionRange:`>=5.0.0 <5.11.0`,filePath:`built/Redis.js`},functionQuery:{className:`Redis`,methodName:`sendCommand`,kind:`Async`}},{channelName:`connect`,module:{name:`ioredis`,versionRange:`>=5.0.0 <5.11.0`,filePath:`built/Redis.js`},functionQuery:{className:`Redis`,methodName:`connect`,kind:`Async`}}],aG={IOREDIS_COMMAND:`orchestrion:ioredis:command`,IOREDIS_CONNECT:`orchestrion:ioredis:connect`},oG=yW(iG),sG=[{channelName:`send_batch`,module:{name:`kafkajs`,versionRange:`>=2.0.0 <3`,filePath:`src/producer/messageProducer.js`},functionQuery:{expressionName:`sendBatch`,kind:`Async`}},{channelName:`consumer_run`,module:{name:`kafkajs`,versionRange:`>=2.0.0 <3`,filePath:`src/consumer/index.js`},functionQuery:{expressionName:`run`,kind:`Async`}}],cG={KAFKAJS_SEND_BATCH:`orchestrion:kafkajs:send_batch`,KAFKAJS_CONSUMER_RUN:`orchestrion:kafkajs:consumer_run`},lG=yW(sG),uG=`knex`,dG=[{filePath:`lib/execution/runner.js`,versionRange:`>=0.22.0 <4`},{filePath:`lib/runner.js`,versionRange:`>=0.10.0 <0.22.0`},{filePath:`src/runner.js`,versionRange:`>=0.18.0 <0.19.0`}],fG=[{filePath:`lib/client.js`,versionRange:`>=0.10.0 <4`},{filePath:`src/client.js`,versionRange:`>=0.18.0 <0.19.0`}],pG=[`queryBuilder`,`schemaBuilder`,`raw`];function mG(e,t){return{channelName:`query`,module:{name:uG,versionRange:t,filePath:e},functionQuery:{className:`Runner`,methodName:`query`,kind:`Async`}}}function hG(e,t,n){return{channelName:e,module:{name:uG,versionRange:n,filePath:t},functionQuery:{className:`Client`,methodName:e,kind:`Sync`}}}var gG=[...dG.map(({filePath:e,versionRange:t})=>mG(e,t)),...fG.flatMap(({filePath:e,versionRange:t})=>pG.map(n=>hG(n,e,t)))],_G={KNEX_QUERY:`orchestrion:knex:query`,KNEX_QUERY_BUILDER:`orchestrion:knex:queryBuilder`,KNEX_SCHEMA_BUILDER:`orchestrion:knex:schemaBuilder`,KNEX_RAW:`orchestrion:knex:raw`},vG=yW(gG),yG=[{channelName:`use`,module:{name:`koa`,versionRange:`>=2.0.0 <4`,filePath:`lib/application.js`},functionQuery:{className:`Application`,methodName:`use`,kind:`Sync`}}],bG={KOA_USE:`orchestrion:koa:use`},xG=yW(yG),SG=[`dist/language_models/chat_models.cjs`,`dist/language_models/chat_models.js`].flatMap(e=>{let t={name:`@langchain/core`,versionRange:`>=0.1.0 <2.0.0`,filePath:e};return[{channelName:`chatModelInvoke`,module:t,functionQuery:{className:`BaseChatModel`,methodName:`invoke`,kind:`Async`}},{channelName:`chatModelStream`,module:t,functionQuery:{className:`BaseChatModel`,methodName:`_streamIterator`,kind:`Async`}}]}),CG=`embedQuery`,wG=`embedDocuments`,TG=[{name:`@langchain/openai`,versionRange:`>=0.1.0 <2.0.0`,methods:[CG,wG]},{name:`@langchain/google-genai`,versionRange:`>=0.1.0 <3.0.0`,methods:[CG,wG]},{name:`@langchain/mistralai`,versionRange:`>=0.1.0 <2.0.0`,methods:[CG,wG]},{name:`@langchain/google-common`,versionRange:`>=0.1.0 <3.0.0`,methods:[wG]}],EG=TG.flatMap(({name:e,versionRange:t,methods:n})=>[`dist/embeddings.cjs`,`dist/embeddings.js`].flatMap(r=>n.map(n=>({channelName:n,module:{name:e,versionRange:t,filePath:r},functionQuery:{methodName:n,kind:`Async`}})))),DG=[...SG,...EG],OG=TG.flatMap(({name:e,methods:t})=>t.map(t=>`orchestrion:${e}:${t}`)),kG={LANGCHAIN_CHAT_MODEL_INVOKE:`orchestrion:@langchain/core:chatModelInvoke`,LANGCHAIN_CHAT_MODEL_STREAM:`orchestrion:@langchain/core:chatModelStream`},AG=yW(DG),jG=e=>({name:`@langchain/langgraph`,versionRange:`>=0.0.0 <2.0.0`,filePath:e}),MG=[`dist/graph/state.cjs`,`dist/graph/state.js`].map(e=>({channelName:`stateGraphCompile`,module:jG(e),functionQuery:{className:`StateGraph`,methodName:`compile`,kind:`Sync`}})),NG=[`dist/prebuilt/react_agent_executor.cjs`,`dist/prebuilt/react_agent_executor.js`].map(e=>({channelName:`createReactAgent`,module:jG(e),functionQuery:{functionName:`createReactAgent`,kind:`Sync`}})),PG=[...MG,...NG],FG={LANGGRAPH_STATE_GRAPH_COMPILE:`orchestrion:@langchain/langgraph:stateGraphCompile`,LANGGRAPH_CREATE_REACT_AGENT:`orchestrion:@langchain/langgraph:createReactAgent`},IG=yW(PG),LG=[{channelName:`load`,module:{name:`lru-memoizer`,versionRange:`>=2.1.0 <4`,filePath:`lib/async.js`},functionQuery:{functionName:`memoizedFunction`,kind:`Callback`}}],RG={LRU_MEMOIZER_LOAD:`orchestrion:lru-memoizer:load`},zG=yW(LG),BG={name:`mongodb`},VG=[{channelName:`command`,module:{...BG,versionRange:`>=6.4.0 <8`,filePath:`lib/cmap/connection.js`},functionQuery:{methodName:`command`,kind:`Async`}},{channelName:`command`,module:{...BG,versionRange:`>=4.0.0 <6.4`,filePath:`lib/cmap/connection.js`},functionQuery:{methodName:`command`,kind:`Callback`}},{channelName:`checkout`,module:{...BG,versionRange:`>=4.0.0 <6.4`,filePath:`lib/cmap/connection_pool.js`},functionQuery:{methodName:`checkOut`,kind:`Callback`}},...[`insert`,`update`,`remove`].map(e=>({channelName:`v3_${e}`,module:{...BG,versionRange:`>=3.3.0 <4`,filePath:`lib/core/wireprotocol/index.js`},functionQuery:{expressionName:e,kind:`Callback`}})),{channelName:`v3_command`,module:{...BG,versionRange:`>=3.3.0 <4`,filePath:`lib/core/wireprotocol/command.js`},functionQuery:{functionName:`command`,kind:`Callback`}},{channelName:`v3_query`,module:{...BG,versionRange:`>=3.3.0 <4`,filePath:`lib/core/wireprotocol/query.js`},functionQuery:{functionName:`query`,kind:`Callback`}},{channelName:`v3_get_more`,module:{...BG,versionRange:`>=3.3.0 <4`,filePath:`lib/core/wireprotocol/get_more.js`},functionQuery:{functionName:`getMore`,kind:`Callback`}}],HG={MONGODB_COMMAND:`orchestrion:mongodb:command`,MONGODB_CHECKOUT:`orchestrion:mongodb:checkout`,MONGODB_V3_INSERT:`orchestrion:mongodb:v3_insert`,MONGODB_V3_UPDATE:`orchestrion:mongodb:v3_update`,MONGODB_V3_REMOVE:`orchestrion:mongodb:v3_remove`,MONGODB_V3_COMMAND:`orchestrion:mongodb:v3_command`,MONGODB_V3_QUERY:`orchestrion:mongodb:v3_query`,MONGODB_V3_GET_MORE:`orchestrion:mongodb:v3_get_more`},UG=yW(VG),WG={name:`mongoose`,versionRange:`>=5.9.7 <9.7.0`},GG=[`find`,`findOne`,`deleteOne`,`deleteMany`,`estimatedDocumentCount`,`countDocuments`,`distinct`,`where`,`$where`,`findOneAndUpdate`,`findOneAndDelete`,`findOneAndReplace`,`remove`,`count`,`findOneAndRemove`],KG=[{channelName:`query_exec`,module:{...WG,filePath:`lib/query.js`},functionQuery:{expressionName:`exec`,kind:`Auto`}},{channelName:`aggregate_exec`,module:{...WG,filePath:`lib/aggregate.js`},functionQuery:{expressionName:`exec`,kind:`Auto`}},{channelName:`model_save`,module:{...WG,filePath:`lib/model.js`},functionQuery:{expressionName:`save`,kind:`Auto`}},{channelName:`model_insert_many`,module:{...WG,filePath:`lib/model.js`},functionQuery:{expressionName:`insertMany`,kind:`Auto`}},{channelName:`model_bulk_write`,module:{...WG,filePath:`lib/model.js`},functionQuery:{expressionName:`bulkWrite`,kind:`Auto`}},{channelName:`model_remove`,module:{...WG,filePath:`lib/model.js`},functionQuery:{expressionName:`remove`,kind:`Auto`}},{channelName:`model_aggregate`,module:{...WG,filePath:`lib/model.js`},functionQuery:{expressionName:`aggregate`,kind:`Sync`}},...GG.map(e=>({channelName:`ctx_${e}`,module:{...WG,filePath:`lib/query.js`},functionQuery:{expressionName:e,kind:`Sync`}}))],qG={MONGOOSE_QUERY_EXEC:`orchestrion:mongoose:query_exec`,MONGOOSE_AGGREGATE_EXEC:`orchestrion:mongoose:aggregate_exec`,MONGOOSE_MODEL_SAVE:`orchestrion:mongoose:model_save`,MONGOOSE_MODEL_INSERT_MANY:`orchestrion:mongoose:model_insert_many`,MONGOOSE_MODEL_BULK_WRITE:`orchestrion:mongoose:model_bulk_write`,MONGOOSE_MODEL_REMOVE:`orchestrion:mongoose:model_remove`,MONGOOSE_MODEL_AGGREGATE:`orchestrion:mongoose:model_aggregate`},JG=GG.map(e=>`orchestrion:mongoose:ctx_${e}`),YG=yW(KG),XG=[{channelName:`query`,module:{name:`mysql2`,versionRange:`>=1.4.2 <3.11.5`,filePath:`lib/connection.js`},functionQuery:{className:`Connection`,methodName:`query`,kind:`Callback`}},{channelName:`execute`,module:{name:`mysql2`,versionRange:`>=1.4.2 <3.11.5`,filePath:`lib/connection.js`},functionQuery:{className:`Connection`,methodName:`execute`,kind:`Callback`}},{channelName:`query`,module:{name:`mysql2`,versionRange:`>=3.11.5 <3.20.0`,filePath:`lib/base/connection.js`},functionQuery:{className:`BaseConnection`,methodName:`query`,kind:`Callback`}},{channelName:`execute`,module:{name:`mysql2`,versionRange:`>=3.11.5 <3.20.0`,filePath:`lib/base/connection.js`},functionQuery:{className:`BaseConnection`,methodName:`execute`,kind:`Callback`}}],ZG={MYSQL2_QUERY:`orchestrion:mysql2:query`,MYSQL2_EXECUTE:`orchestrion:mysql2:execute`},QG=yW(XG),$G=[{channelName:`query`,module:{name:`mysql`,versionRange:`>=2.0.0 <3`,filePath:`lib/Connection.js`},functionQuery:{expressionName:`query`,kind:`Auto`}}],eK={MYSQL_QUERY:`orchestrion:mysql:query`},tK=yW($G);function nK(e){return e}var rK=[{channelName:`nestFactoryCreate`,module:{name:`@nestjs/core`,versionRange:`>=8.0.0 <12`,filePath:`nest-factory.js`},functionQuery:{className:`NestFactoryStatic`,methodName:`create`,kind:`Async`}},{channelName:`routerExecutionContextCreate`,module:{name:`@nestjs/core`,versionRange:`>=8.0.0 <12`,filePath:`router/router-execution-context.js`},functionQuery:{className:`RouterExecutionContext`,methodName:`create`,kind:`Sync`}},nK({channelName:`injectableDecorator`,module:{name:`@nestjs/common`,versionRange:`>=8.0.0 <12`,filePath:`decorators/core/injectable.decorator.js`},astQuery:`FunctionDeclaration[id.name="Injectable"] ReturnStatement > ArrowFunctionExpression`,functionQuery:{kind:`Sync`}}),nK({channelName:`catchDecorator`,module:{name:`@nestjs/common`,versionRange:`>=8.0.0 <12`,filePath:`decorators/core/catch.decorator.js`},astQuery:`FunctionDeclaration[id.name="Catch"] ReturnStatement > ArrowFunctionExpression`,functionQuery:{kind:`Sync`}}),{channelName:`cronDecorator`,module:{name:`@nestjs/schedule`,versionRange:`>=2.0.0`,filePath:`dist/decorators/cron.decorator.js`},functionQuery:{functionName:`Cron`,kind:`Sync`}},{channelName:`intervalDecorator`,module:{name:`@nestjs/schedule`,versionRange:`>=2.0.0`,filePath:`dist/decorators/interval.decorator.js`},functionQuery:{functionName:`Interval`,kind:`Sync`}},{channelName:`timeoutDecorator`,module:{name:`@nestjs/schedule`,versionRange:`>=2.0.0`,filePath:`dist/decorators/timeout.decorator.js`},functionQuery:{functionName:`Timeout`,kind:`Sync`}},{channelName:`onEventDecorator`,module:{name:`@nestjs/event-emitter`,versionRange:`>=2.0.0`,filePath:`dist/decorators/on-event.decorator.js`},functionQuery:{expressionName:`OnEvent`,kind:`Sync`}},{channelName:`processorDecorator`,module:{name:`@nestjs/bullmq`,versionRange:`>=10.0.0`,filePath:`dist/decorators/processor.decorator.js`},functionQuery:{functionName:`Processor`,kind:`Sync`}}],iK={NESTJS_APP_CREATION:`orchestrion:@nestjs/core:nestFactoryCreate`,NESTJS_ROUTER_CONTEXT:`orchestrion:@nestjs/core:routerExecutionContextCreate`,NESTJS_INJECTABLE:`orchestrion:@nestjs/common:injectableDecorator`,NESTJS_CATCH:`orchestrion:@nestjs/common:catchDecorator`,NESTJS_SCHEDULE_CRON:`orchestrion:@nestjs/schedule:cronDecorator`,NESTJS_SCHEDULE_INTERVAL:`orchestrion:@nestjs/schedule:intervalDecorator`,NESTJS_SCHEDULE_TIMEOUT:`orchestrion:@nestjs/schedule:timeoutDecorator`,NESTJS_ONEVENT:`orchestrion:@nestjs/event-emitter:onEventDecorator`,NESTJS_PROCESSOR:`orchestrion:@nestjs/bullmq:processorDecorator`},aK=yW(rK),oK=[...[`resources/chat/completions/completions.js`,`resources/chat/completions/completions.mjs`].map(e=>({channelName:`chat`,module:{name:`openai`,versionRange:`>=4.0.0 <8`,filePath:e},functionQuery:{className:`Completions`,methodName:`create`,kind:`Auto`}})),...[`resources/responses/responses.js`,`resources/responses/responses.mjs`].map(e=>({channelName:`chat`,module:{name:`openai`,versionRange:`>=4.0.0 <8`,filePath:e},functionQuery:{className:`Responses`,methodName:`create`,kind:`Auto`}})),...[`resources/embeddings.js`,`resources/embeddings.mjs`].map(e=>({channelName:`embeddings`,module:{name:`openai`,versionRange:`>=4.0.0 <8`,filePath:e},functionQuery:{className:`Embeddings`,methodName:`create`,kind:`Auto`}})),...[`resources/conversations/conversations.js`,`resources/conversations/conversations.mjs`].map(e=>({channelName:`chat`,module:{name:`openai`,versionRange:`>=4.0.0 <8`,filePath:e},functionQuery:{className:`Conversations`,methodName:`create`,kind:`Auto`}}))],sK={OPENAI_CHAT:`orchestrion:openai:chat`,OPENAI_EMBEDDINGS:`orchestrion:openai:embeddings`},cK=yW(oK),lK=[{channelName:`query`,module:{name:`pg`,versionRange:`>=8.0.3 <9`,filePath:`lib/client.js`},functionQuery:{className:`Client`,methodName:`query`,kind:`Auto`}},{channelName:`connect`,module:{name:`pg`,versionRange:`>=8.0.3 <9`,filePath:`lib/client.js`},functionQuery:{className:`Client`,methodName:`connect`,kind:`Auto`}},{channelName:`query`,module:{name:`pg`,versionRange:`>=8.0.3 <9`,filePath:`lib/native/client.js`},functionQuery:{expressionName:`query`,kind:`Auto`}},{channelName:`connect`,module:{name:`pg`,versionRange:`>=8.0.3 <9`,filePath:`lib/native/client.js`},functionQuery:{expressionName:`connect`,kind:`Auto`}},{channelName:`connect`,module:{name:`pg-pool`,versionRange:`>=2.0.0 <4`,filePath:`index.js`},functionQuery:{className:`Pool`,methodName:`connect`,kind:`Auto`}}],uK={PG_QUERY:`orchestrion:pg:query`,PG_CONNECT:`orchestrion:pg:connect`,PGPOOL_CONNECT:`orchestrion:pg-pool:connect`},dK=yW(lK),fK=[`src`,`cjs/src`].flatMap(e=>[{channelName:`handle`,module:{name:`postgres`,versionRange:`>=3.0.0 <4`,filePath:`${e}/query.js`},functionQuery:{className:`Query`,methodName:`handle`,kind:`Async`}},{channelName:`connection`,module:{name:`postgres`,versionRange:`>=3.0.0 <4`,filePath:`${e}/connection.js`},functionQuery:{functionName:`Connection`,kind:`Sync`}},{channelName:`execute`,module:{name:`postgres`,versionRange:`>=3.0.0 <4`,filePath:`${e}/connection.js`},functionQuery:{functionName:`execute`,kind:`Sync`}},{channelName:`connect`,module:{name:`postgres`,versionRange:`>=3.0.0 <4`,filePath:`${e}/connection.js`},functionQuery:{methodName:`connect`,kind:`Sync`}}]),pK={POSTGRESJS_HANDLE:`orchestrion:postgres:handle`,POSTGRESJS_CONNECTION:`orchestrion:postgres:connection`,POSTGRESJS_EXECUTE:`orchestrion:postgres:execute`,POSTGRESJS_CONNECT:`orchestrion:postgres:connect`},mK=yW(fK),hK=[{channelName:`command`,module:{name:`redis`,versionRange:`>=2.6.0 <4`,filePath:`index.js`},functionQuery:{expressionName:`internal_send_command`,kind:`Sync`}},{channelName:`executor`,module:{name:`@redis/client`,versionRange:`^1.0.0`,filePath:`dist/lib/client/index.js`},functionQuery:{className:`RedisClient`,methodName:`commandsExecutor`,kind:`Async`}},{channelName:`command`,module:{name:`@redis/client`,versionRange:`^1.0.0`,filePath:`dist/lib/client/index.js`},functionQuery:{className:`RedisClient`,methodName:`sendCommand`,kind:`Async`}},{channelName:`connect`,module:{name:`@redis/client`,versionRange:`^1.0.0`,filePath:`dist/lib/client/index.js`},functionQuery:{className:`RedisClient`,methodName:`connect`,kind:`Async`}},{channelName:`command`,module:{name:`@redis/client`,versionRange:`>=5.0.0 <5.12.0`,filePath:`dist/lib/client/index.js`},functionQuery:{className:`RedisClient`,methodName:`sendCommand`,kind:`Async`}},{channelName:`connect`,module:{name:`@redis/client`,versionRange:`>=5.0.0 <5.12.0`,filePath:`dist/lib/client/index.js`},functionQuery:{className:`RedisClient`,methodName:`connect`,kind:`Async`}},{channelName:`multi`,module:{name:`@redis/client`,versionRange:`>=5.0.0 <5.12.0`,filePath:`dist/lib/client/index.js`},functionQuery:{className:`RedisClient`,methodName:`_executeMulti`,kind:`Async`}},{channelName:`pipeline`,module:{name:`@redis/client`,versionRange:`>=5.0.0 <5.12.0`,filePath:`dist/lib/client/index.js`},functionQuery:{className:`RedisClient`,methodName:`_executePipeline`,kind:`Async`}},{channelName:`batch`,module:{name:`@redis/client`,versionRange:`^1.0.0`,filePath:`dist/lib/client/index.js`},functionQuery:{className:`RedisClient`,methodName:`multiExecutor`,kind:`Async`}}],gK={REDIS_COMMAND:`orchestrion:redis:command`,NODE_REDIS_COMMAND:`orchestrion:@redis/client:command`,NODE_REDIS_EXECUTOR:`orchestrion:@redis/client:executor`,NODE_REDIS_CONNECT:`orchestrion:@redis/client:connect`,NODE_REDIS_MULTI:`orchestrion:@redis/client:multi`,NODE_REDIS_PIPELINE:`orchestrion:@redis/client:pipeline`,NODE_REDIS_BATCH:`orchestrion:@redis/client:batch`},_K=yW(hK),vK=[`dist`,`dist/esm`].flatMap(e=>[{channelName:`requestHandler`,module:{name:`@remix-run/server-runtime`,versionRange:`>=2.0.0 <3`,filePath:`${e}/server.js`},astQuery:`FunctionExpression[id.name="requestHandler"]`,functionQuery:{kind:`Async`}},{channelName:`matchServerRoutes`,module:{name:`@remix-run/server-runtime`,versionRange:`>=2.0.0 <3`,filePath:`${e}/routeMatching.js`},functionQuery:{functionName:`matchServerRoutes`,kind:`Sync`}},{channelName:`callRouteLoader`,module:{name:`@remix-run/server-runtime`,versionRange:`>=2.9.0 <3`,filePath:`${e}/data.js`},functionQuery:{functionName:`callRouteLoader`,kind:`Async`}},{channelName:`callRouteAction`,module:{name:`@remix-run/server-runtime`,versionRange:`>=2.9.0 <3`,filePath:`${e}/data.js`},functionQuery:{functionName:`callRouteAction`,kind:`Async`}},{channelName:`callRouteLoader`,module:{name:`@remix-run/server-runtime`,versionRange:`>=2.0.0 <2.9.0`,filePath:`${e}/data.js`},functionQuery:{functionName:`callRouteLoaderRR`,kind:`Async`}},{channelName:`callRouteAction`,module:{name:`@remix-run/server-runtime`,versionRange:`>=2.0.0 <2.9.0`,filePath:`${e}/data.js`},functionQuery:{functionName:`callRouteActionRR`,kind:`Async`}}]),yK={REMIX_REQUEST_HANDLER:`orchestrion:@remix-run/server-runtime:requestHandler`,REMIX_MATCH_SERVER_ROUTES:`orchestrion:@remix-run/server-runtime:matchServerRoutes`,REMIX_CALL_ROUTE_LOADER:`orchestrion:@remix-run/server-runtime:callRouteLoader`,REMIX_CALL_ROUTE_ACTION:`orchestrion:@remix-run/server-runtime:callRouteAction`},bK=yW(vK),xK=`tedious`,SK=`lib/connection.js`,CK=`>=1.11.0 <20`,wK=[`connect`,`execSql`,`execSqlBatch`,`callProcedure`,`execBulkLoad`,`prepare`,`execute`].map(e=>({channelName:e,module:{name:xK,versionRange:CK,filePath:SK},functionQuery:{className:`Connection`,methodName:e,kind:`Sync`}})),TK={TEDIOUS_CONNECT:`orchestrion:tedious:connect`,TEDIOUS_EXEC_SQL:`orchestrion:tedious:execSql`,TEDIOUS_EXEC_SQL_BATCH:`orchestrion:tedious:execSqlBatch`,TEDIOUS_CALL_PROCEDURE:`orchestrion:tedious:callProcedure`,TEDIOUS_EXEC_BULK_LOAD:`orchestrion:tedious:execBulkLoad`,TEDIOUS_PREPARE:`orchestrion:tedious:prepare`,TEDIOUS_EXECUTE:`orchestrion:tedious:execute`},EK=yW(wK),DK=[...kK(`>=4.0.0 <7.0.0`,`generateText`,`generateText`,`Async`),...kK(`>=4.0.0 <7.0.0`,`streamText`,`streamText`,`Sync`),...kK(`>=4.0.0 <7.0.0`,`generateObject`,`generateObject`,`Async`),...kK(`>=4.0.0 <7.0.0`,`embed`,`embed`,`Async`),...kK(`>=4.0.0 <7.0.0`,`embedMany`,`embedMany`,`Async`),...kK(`>=5.0.0 <7.0.0`,`resolveLanguageModel`,`resolveLanguageModel`,`Sync`),...kK(`>=6.0.0 <7.0.0`,`executeToolCall`,`executeToolCall`,`Async`)],OK={VERCEL_AI_GENERATE_TEXT:`orchestrion:ai:generateText`,VERCEL_AI_STREAM_TEXT:`orchestrion:ai:streamText`,VERCEL_AI_GENERATE_OBJECT:`orchestrion:ai:generateObject`,VERCEL_AI_EMBED:`orchestrion:ai:embed`,VERCEL_AI_EMBED_MANY:`orchestrion:ai:embedMany`,VERCEL_AI_EXECUTE_TOOL_CALL:`orchestrion:ai:executeToolCall`,VERCEL_AI_RESOLVE_LANGUAGE_MODEL:`orchestrion:ai:resolveLanguageModel`};function kK(e,t,n,r){return[`dist/index.js`,`dist/index.mjs`].map(i=>({channelName:t,module:{name:`ai`,versionRange:e,filePath:i},functionQuery:{functionName:n,kind:r}}))}var AK=yW(DK),$={...SW,...TW,...OW,...MW,...FW,...UW,...KW,...XW,...$W,...nG,...aG,...cG,..._G,...bG,...kG,...FG,...RG,...HG,...qG,...ZG,...eK,...iK,...sK,...uK,...pK,...gK,...yK,...TK,...OK},jK=`Amqplib`,MK=`auto.amqplib.orchestrion.publisher`,NK=`auto.amqplib.orchestrion.consumer`,PK=`messaging.operation`,FK=`messaging.destination`,IK=`messaging.destination_kind`,LK=`messaging.rabbitmq.routing_key`,RK=`messaging.protocol`,zK=`messaging.protocol_version`,BK=`messaging.url`,VK=`messaging.message_id`,HK=`messaging.conversation_id`,UK=`messaging.rabbitmq.destination.routing_key`,WK=`messaging.message.conversation_id`,GK=`topic`,KK=`process`,qK=`send`,JK=6e4,YK={Ack:`ack`,AckAll:`ackAll`,Reject:`reject`,Nack:`nack`,NackAll:`nackAll`,ChannelClosed:`channel closed`,ChannelError:`channel error`,InstrumentationTimeout:`instrumentation timeout`},XK=Symbol(`sentry.amqplib.message.stored-span`),ZK=Symbol(`sentry.amqplib.channel.spans-not-ended`),QK=Symbol(`sentry.amqplib.channel.consume-timeout-timer`),$K=Symbol(`sentry.amqplib.channel.consumer-info`),eq=Symbol(`sentry.amqplib.channel.is-confirm-publishing`),tq=Symbol(`sentry.amqplib.connection.attributes`),nq=()=>{},rq=!1,iq=(()=>({name:jK,setupOnce(){C.tracingChannel&&!rq&&(rq=!0,X&&A.log(`[orchestrion:amqplib] subscribing to amqplib tracing channels`),U(()=>{uq(),aq(),oq(),sq(),cq(),lq()}))}}));function aq(){Z(C.tracingChannel($.AMQPLIB_PUBLISH),e=>{if(!e.self?.[eq])return _q(e)})}function oq(){let e=C.tracingChannel($.AMQPLIB_CONFIRM_PUBLISH);Z(e,e=>(e.self&&(e.self[eq]=!0),_q(e))),e.end.subscribe(e=>{let t=e.self;t&&(t[eq]=!1)})}function sq(){let e=C.tracingChannel($.AMQPLIB_CONSUME);e.start.subscribe(nq),e.asyncEnd.subscribe(e=>{let t=e,n=t.self,r=t.result?.consumerTag;if(!n||!r)return;fq(n);let i=t.arguments[0],a=typeof i==`string`?i:`<unknown>`,o=t.arguments[2];n[$K]?.set(r,{noAck:!!o?.noAck,queue:a})})}function cq(){Z(C.tracingChannel($.AMQPLIB_DISPATCH),e=>{let t=e.self,n=e.arguments[0],r=e.arguments[1];if(!t||!r)return;fq(t);let i=n?.consumerTag?t[$K]?.get(n.consumerTag):void 0,a=i?.queue??r.fields?.routingKey??`<unknown>`,o=i?.noAck??!1,s=r.properties?.headers,c=lo({sentryTrace:Dq(s,`sentry-trace`),baggage:Dq(s,`baggage`)},()=>vq(a,r,t));return o||(t[ZK]?.push({msg:r,timeOfConsume:Un()}),r[XK]=c),e._sentryNoAck=o,c},{deferSpanEnd({data:e}){return!e._sentryNoAck}})}function lq(){C.tracingChannel($.AMQPLIB_ACK).start.subscribe(e=>dq(e,!1,YK.Ack)),C.tracingChannel($.AMQPLIB_NACK).start.subscribe(e=>dq(e,!0,YK.Nack)),C.tracingChannel($.AMQPLIB_REJECT).start.subscribe(e=>dq(e,!0,YK.Reject)),C.tracingChannel($.AMQPLIB_ACK_ALL).start.subscribe(e=>{let t=e;t.self&&hq(t.self,!1,YK.AckAll,void 0)}),C.tracingChannel($.AMQPLIB_NACK_ALL).start.subscribe(e=>{let t=e;t.self&&hq(t.self,!0,YK.NackAll,t.arguments[0])})}function uq(){let e=C.tracingChannel($.AMQPLIB_CONNECT);e.start.subscribe(nq),e.asyncEnd.subscribe(e=>{let t=e,n=t.result;n&&typeof n==`object`&&(n[tq]={...xq(t.arguments?.[0]),...bq(n)})})}function dq(e,t,n){let r=e.self;if(!r)return;let i=e.arguments[0];if(!i)return;let a=e.arguments[1],o=e.arguments[2],s=n===YK.Reject?a:o,c=r[ZK]??[],l=c.findIndex(e=>e.msg===i);if(l<0)gq(i,t,n,s);else if(n!==YK.Reject&&a){for(let e=0;e<=l;e++)gq(c[e].msg,t,n,s);c.splice(0,l+1)}else gq(i,t,n,s),c.splice(l,1)}function fq(e){if(Object.prototype.hasOwnProperty.call(e,ZK))return;e[ZK]=[],e[$K]=new Map;let t=setInterval(()=>mq(e),JK);t.unref?.(),e[QK]=t,typeof e.on==`function`&&(e.on(`close`,()=>{hq(e,!0,YK.ChannelClosed,void 0),pq(e)}),e.on(`error`,()=>{hq(e,!0,YK.ChannelError,void 0),pq(e)}))}function pq(e){let t=e[QK];t&&(clearInterval(t),e[QK]=void 0)}function mq(e){let t=Un(),n=e[ZK]??[],r=0;for(;r<n.length;r++){let e=n[r];if((t-e.timeOfConsume)*1e3<JK)break;gq(e.msg,null,YK.InstrumentationTimeout,!0)}n.splice(0,r)}function hq(e,t,n,r){(e[ZK]??[]).forEach(e=>{gq(e.msg,t,n,r)}),e[ZK]=[]}function gq(e,t,n,r){let i=e[XK];i&&(t!==!1&&i.setStatus({code:2,message:n!==YK.ChannelClosed&&n!==YK.ChannelError?`${n} called on message${r===!0?` with requeue`:r===!1?` without requeue`:``}`:n}),i.end(),e[XK]=void 0)}function _q(e){let t=e.arguments[0],n=e.arguments[1],r=typeof t==`string`?t:``,i=typeof n==`string`?n:``,a=e.arguments[3],o=B({name:`publish ${Sq(r)}`,op:`message`,kind:G.PRODUCER,attributes:{...yq(e.self),[FK]:r,[Rc]:r,[IK]:GK,[LK]:i,[UK]:i,[Vc]:qK,[VK]:a?.messageId,[zc]:a?.messageId,[HK]:a?.correlationId,[WK]:a?.correlationId,[I]:MK}});(!a||typeof a!=`object`)&&(a={},e.arguments[3]=a);let s=a.headers&&typeof a.headers==`object`?a.headers:a.headers={},c=Tf({span:o});return c[`sentry-trace`]&&(s[`sentry-trace`]=c[`sentry-trace`]),c.baggage&&(s.baggage=c.baggage),o}function vq(e,t,n){return B({name:`${e} process`,op:`message`,kind:G.CONSUMER,attributes:{...yq(n),[FK]:t.fields?.exchange,[Rc]:t.fields?.exchange,[IK]:GK,[LK]:t.fields?.routingKey,[UK]:t.fields?.routingKey,[PK]:KK,[Vc]:KK,[VK]:t.properties?.messageId,[zc]:t.properties?.messageId,[HK]:t.properties?.correlationId,[WK]:t.properties?.correlationId,[I]:NK}})}function yq(e){let t=e?.connection,n=t?.[tq];if(n)return n;let r=t?.serverProperties?.product??t?.connection?.serverProperties?.product;return typeof r==`string`&&r?{[Hc]:r.toLowerCase()}:{}}function bq(e){let t=e.serverProperties?.product??e.connection?.serverProperties?.product;return typeof t==`string`&&t?{[Hc]:t.toLowerCase()}:{}}function xq(e){let t={[zK]:`0.9.1`,[Kc]:`0.9.1`},n=e||`amqp://localhost`;if(typeof n==`object`){let e=n,r=Tq(e.protocol),i=Eq(e.hostname),a=wq(e.port,r);t[RK]=r,t[Gc]=r,t[fl]=i,t[pl]=a,t[Zc]=i,t[Qc]=a}else if(typeof n==`string`){let e=Cq(n);t[BK]=e,t[gl]=e;try{let n=new URL(e),r=Tq(n.protocol),i=Eq(n.hostname),a=wq(n.port?parseInt(n.port,10):void 0,r);t[RK]=r,t[Gc]=r,t[fl]=i,t[pl]=a,t[Zc]=i,t[Qc]=a}catch{}}return t}function Sq(e){return e===``?`<default>`:e}function Cq(e){return e.replace(/:[^:@/]*@/,`:***@`)}function wq(e,t){return e||(t===`AMQP`?5672:5671)}function Tq(e){let t=e||`amqp`;return(t.endsWith(`:`)?t.substring(0,t.length-1):t).toUpperCase()}function Eq(e){return e||`localhost`}function Dq(e,t){let n=e?.[t];if(n!=null)return String(Array.isArray(n)?n[0]:n)}var Oq=W(iq),kq=`Anthropic_AI`,Aq=`auto.ai.orchestrion.anthropic`,jq=[{channel:$.ANTHROPIC_CHAT,operation:`chat`,methodPath:`messages.create`,stream:`async-iterable`},{channel:$.ANTHROPIC_MODELS,operation:`models`,methodPath:`models.retrieve`,stream:`none`},{channel:$.ANTHROPIC_MESSAGES_STREAM,operation:`chat`,methodPath:`messages.stream`,stream:`message-stream`}],Mq=!1,Nq=((e={})=>({name:kq,setupOnce(){C.tracingChannel&&!Mq&&(Mq=!0,U(()=>{for(let{channel:t,operation:n,methodPath:r,stream:i}of jq)X&&A.log(`[orchestrion:anthropic] subscribing to channel "${t}"`),Z(C.tracingChannel(t),t=>Pq(t,n,r,e),{beforeSpanEnd:(t,n)=>{Wv(t,n.result,Qg(e).recordOutputs)},deferSpanEnd:({span:t,data:n})=>Lq(t,n,i,e)})}))}}));function Pq(e,t,n,r){let i=e.arguments??[];if(tf(kq)||i[1]?.headers?.[`X-Stainless-Helper-Method`]===`stream`)return;let a=typeof i[0]==`object`&&i[0]!==null?i[0]:void 0,{recordInputs:o}=Qg(r),s=$g(r.enableTruncation),c=Bv(i,n,t),l=c[`gen_ai.request.model`]||`unknown`;c[I]=Aq;let u=B({name:`${t} ${l}`,op:`gen_ai.${t}`,attributes:c});return o&&a&&Vv(u,a,s),u}function Fq(e){return!!e&&typeof e[Symbol.asyncIterator]==`function`}function Iq(e){return!!e&&typeof e.on==`function`}function Lq(e,t,n,r){let{recordOutputs:i}=Qg(r),a=t.result;if(n===`async-iterable`&&Fq(a)){let t=a[Symbol.asyncIterator].bind(a),n=Iv({[Symbol.asyncIterator]:t},e,i);return a[Symbol.asyncIterator]=()=>n,!0}return n===`message-stream`&&Iq(a)?(Lv(a,e,i),!0):!1}var Rq=W(Nq),zq=`auto.aws.orchestrion.aws_sdk`,Bq=`dynamodb`,Vq=`messaging.destination_kind`,Hq=`topic`,Uq=`chat`,Wq=`aws.bedrock`,Gq=new TextDecoder,Kq=class{requestPreSpanHook(e){switch(e.commandName){case`Converse`:return this._requestPreSpanHookConverse(e,!1);case`ConverseStream`:return this._requestPreSpanHookConverse(e,!0);case`InvokeModel`:return this._requestPreSpanHookInvokeModel(e,!1);case`InvokeModelWithResponseStream`:return this._requestPreSpanHookInvokeModel(e,!0)}return{}}responseHook(e,t){let n=e.request.commandName;if(!t.isRecording()){(n===`ConverseStream`||n===`InvokeModelWithResponseStream`)&&t.end();return}switch(n){case`Converse`:return this._responseHookConverse(e,t);case`ConverseStream`:return this._responseHookConverseStream(e,t);case`InvokeModel`:return this._responseHookInvokeModel(e,t);case`InvokeModelWithResponseStream`:return this._responseHookInvokeModelWithResponseStream(e,t)}}_requestPreSpanHookConverse(e,t){let n=Uq,r={[dc]:Wq,[$s]:Uq},i=e.commandInput.modelId;i&&(r[rc]=i,n&&(n+=` ${i}`));let a=e.commandInput.inferenceConfig;if(a){let{maxTokens:e,temperature:t,topP:n,stopSequences:i}=a;e!==void 0&&(r[nc]=e),t!==void 0&&(r[ac]=t),n!==void 0&&(r[oc]=n),i!==void 0&&(r[ic]=i)}return{spanName:n,isStream:t,spanAttributes:r}}_requestPreSpanHookInvokeModel(e,t){let n={[dc]:Wq},r=e.commandInput?.modelId;if(r&&(n[rc]=r),e.commandInput?.body){let t=JSON.parse(e.commandInput.body);r.includes(`amazon.titan`)?(t.textGenerationConfig?.temperature!==void 0&&(n[ac]=t.textGenerationConfig.temperature),t.textGenerationConfig?.topP!==void 0&&(n[oc]=t.textGenerationConfig.topP),t.textGenerationConfig?.maxTokenCount!==void 0&&(n[nc]=t.textGenerationConfig.maxTokenCount),t.textGenerationConfig?.stopSequences!==void 0&&(n[ic]=t.textGenerationConfig.stopSequences)):r.includes(`amazon.nova`)?(t.inferenceConfig?.temperature!==void 0&&(n[ac]=t.inferenceConfig.temperature),t.inferenceConfig?.top_p!==void 0&&(n[oc]=t.inferenceConfig.top_p),t.inferenceConfig?.max_new_tokens!==void 0&&(n[nc]=t.inferenceConfig.max_new_tokens),t.inferenceConfig?.stopSequences!==void 0&&(n[ic]=t.inferenceConfig.stopSequences)):r.includes(`anthropic.claude`)?(t.max_tokens!==void 0&&(n[nc]=t.max_tokens),t.temperature!==void 0&&(n[ac]=t.temperature),t.top_p!==void 0&&(n[oc]=t.top_p),t.stop_sequences!==void 0&&(n[ic]=t.stop_sequences)):r.includes(`meta.llama`)?(t.max_gen_len!==void 0&&(n[nc]=t.max_gen_len),t.temperature!==void 0&&(n[ac]=t.temperature),t.top_p!==void 0&&(n[oc]=t.top_p)):r.includes(`cohere.command-r`)?(t.max_tokens!==void 0&&(n[nc]=t.max_tokens),t.temperature!==void 0&&(n[ac]=t.temperature),t.p!==void 0&&(n[oc]=t.p),t.message!==void 0&&(n[gc]=Math.ceil(t.message.length/6)),t.stop_sequences!==void 0&&(n[ic]=t.stop_sequences)):r.includes(`cohere.command`)?(t.max_tokens!==void 0&&(n[nc]=t.max_tokens),t.temperature!==void 0&&(n[ac]=t.temperature),t.p!==void 0&&(n[oc]=t.p),t.prompt!==void 0&&(n[gc]=Math.ceil(t.prompt.length/6)),t.stop_sequences!==void 0&&(n[ic]=t.stop_sequences)):r.includes(`mistral`)&&(t.prompt!==void 0&&(n[gc]=Math.ceil(t.prompt.length/6)),t.max_tokens!==void 0&&(n[nc]=t.max_tokens),t.temperature!==void 0&&(n[ac]=t.temperature),t.top_p!==void 0&&(n[oc]=t.top_p),t.stop!==void 0&&(n[ic]=t.stop))}return{isStream:t,spanAttributes:n}}_responseHookConverse(e,t){let{stopReason:n,usage:r}=e.data;Yq(t,n),Xq(t,r)}_responseHookConverseStream(e,t){e.data.stream=Jq(e.data.stream,t)}_responseHookInvokeModel(e,t){let n=e.request.commandInput?.modelId;if(e.data?.body){let r=Gq.decode(e.data.body),i=JSON.parse(r);n.includes(`amazon.titan`)?(i.inputTextTokenCount!==void 0&&t.setAttribute(gc,i.inputTextTokenCount),i.results?.[0]?.tokenCount!==void 0&&t.setAttribute(_c,i.results[0].tokenCount),i.results?.[0]?.completionReason!==void 0&&t.setAttribute(sc,[i.results[0].completionReason])):n.includes(`amazon.nova`)?(i.usage!==void 0&&(i.usage.inputTokens!==void 0&&t.setAttribute(gc,i.usage.inputTokens),i.usage.outputTokens!==void 0&&t.setAttribute(_c,i.usage.outputTokens)),i.stopReason!==void 0&&t.setAttribute(sc,[i.stopReason])):n.includes(`anthropic.claude`)?(i.usage?.input_tokens!==void 0&&t.setAttribute(gc,i.usage.input_tokens),i.usage?.output_tokens!==void 0&&t.setAttribute(_c,i.usage.output_tokens),i.stop_reason!==void 0&&t.setAttribute(sc,[i.stop_reason])):n.includes(`meta.llama`)?(i.prompt_token_count!==void 0&&t.setAttribute(gc,i.prompt_token_count),i.generation_token_count!==void 0&&t.setAttribute(_c,i.generation_token_count),i.stop_reason!==void 0&&t.setAttribute(sc,[i.stop_reason])):n.includes(`cohere.command-r`)?(i.text!==void 0&&t.setAttribute(_c,Math.ceil(i.text.length/6)),i.finish_reason!==void 0&&t.setAttribute(sc,[i.finish_reason])):n.includes(`cohere.command`)?(i.generations?.[0]?.text!==void 0&&t.setAttribute(_c,Math.ceil(i.generations[0].text.length/6)),i.generations?.[0]?.finish_reason!==void 0&&t.setAttribute(sc,[i.generations[0].finish_reason])):n.includes(`mistral`)&&(i.outputs?.[0]?.text!==void 0&&t.setAttribute(_c,Math.ceil(i.outputs[0].text.length/6)),i.outputs?.[0]?.stop_reason!==void 0&&t.setAttribute(sc,[i.outputs[0].stop_reason]))}}_responseHookInvokeModelWithResponseStream(e,t){let n=e.data?.body,r=e.request.commandInput?.modelId;if(!n||!r)return;let i=qq(r);e.data.body=(async function*(){try{for await(let e of n){if(i){let n=Zq(e?.chunk?.bytes);n&&i(n,t)}yield e}}finally{t.end()}})()}};function qq(e){if(e.includes(`amazon.titan`))return eJ;if(e.includes(`anthropic.claude`))return $q;if(e.includes(`amazon.nova`))return Qq;if(e.includes(`meta.llama`))return tJ;if(e.includes(`cohere.command-r`))return iJ;if(e.includes(`cohere.command`))return rJ;if(e.includes(`mistral`))return nJ}async function*Jq(e,t){try{let n;for await(let r of e)Yq(t,r.messageStop?.stopReason),n=r.metadata?.usage,yield r;Xq(t,n)}finally{t.end()}}function Yq(e,t){t!==void 0&&e.setAttribute(sc,[t])}function Xq(e,t){if(t){let{inputTokens:n,outputTokens:r}=t;n!==void 0&&e.setAttribute(gc,n),r!==void 0&&e.setAttribute(_c,r)}}function Zq(e){if(!e||!(e instanceof Uint8Array))return null;try{let t=Buffer.from(e).toString(`utf-8`);return JSON.parse(t)}catch(e){return X&&A.warn(`[orchestrion:aws-sdk] failed to parse streamed bedrock chunk`,e),null}}function Qq(e,t){e.metadata?.usage!==void 0&&(e.metadata?.usage.inputTokens!==void 0&&t.setAttribute(gc,e.metadata.usage.inputTokens),e.metadata?.usage.outputTokens!==void 0&&t.setAttribute(_c,e.metadata.usage.outputTokens)),e.messageStop?.stopReason!==void 0&&t.setAttribute(sc,[e.messageStop.stopReason])}function $q(e,t){e.message?.usage?.input_tokens!==void 0&&t.setAttribute(gc,e.message.usage.input_tokens),e.message?.usage?.output_tokens!==void 0&&t.setAttribute(_c,e.message.usage.output_tokens),e.delta?.stop_reason!==void 0&&t.setAttribute(sc,[e.delta.stop_reason])}function eJ(e,t){e.inputTextTokenCount!==void 0&&t.setAttribute(gc,e.inputTextTokenCount),e.totalOutputTextTokenCount!==void 0&&t.setAttribute(_c,e.totalOutputTextTokenCount),e.completionReason!==void 0&&t.setAttribute(sc,[e.completionReason])}function tJ(e,t){e.prompt_token_count!==void 0&&t.setAttribute(gc,e.prompt_token_count),e.generation_token_count!==void 0&&t.setAttribute(_c,e.generation_token_count),e.stop_reason!==void 0&&t.setAttribute(sc,[e.stop_reason])}function nJ(e,t){e.outputs?.[0]?.text!==void 0&&t.setAttribute(_c,Math.ceil(e.outputs[0].text.length/6)),e.outputs?.[0]?.stop_reason!==void 0&&t.setAttribute(sc,[e.outputs[0].stop_reason])}function rJ(e,t){e.generations?.[0]?.text!==void 0&&t.setAttribute(_c,Math.ceil(e.generations[0].text.length/6)),e.generations?.[0]?.finish_reason!==void 0&&t.setAttribute(sc,[e.generations[0].finish_reason])}function iJ(e,t){e.text!==void 0&&t.setAttribute(_c,Math.ceil(e.text.length/6)),e.finish_reason!==void 0&&t.setAttribute(sc,[e.finish_reason])}function aJ(e){return Array.isArray(e)?e:[e]}var oJ=class{requestPreSpanHook(e){let t=e.commandName,n=e.commandInput?.TableName,r={};return r[Bs]=Bq,r[Ns]=n,r[Fs]=t,e.commandInput?.TableName?r[ys]=[e.commandInput.TableName]:e.commandInput?.RequestItems&&(r[ys]=Object.keys(e.commandInput.RequestItems)),(t===`CreateTable`||t===`UpdateTable`)&&e.commandInput?.ProvisionedThroughput&&(r[fs]=e.commandInput.ProvisionedThroughput.ReadCapacityUnits,r[ps]=e.commandInput.ProvisionedThroughput.WriteCapacityUnits),(t===`GetItem`||t===`Scan`||t===`Query`)&&e.commandInput?.ConsistentRead&&(r[ts]=e.commandInput.ConsistentRead),(t===`Query`||t===`Scan`)&&e.commandInput?.ProjectionExpression&&(r[ds]=e.commandInput.ProjectionExpression),t===`CreateTable`&&(e.commandInput?.GlobalSecondaryIndexes&&(r[as]=aJ(e.commandInput.GlobalSecondaryIndexes).map(e=>JSON.stringify(e))),e.commandInput?.LocalSecondaryIndexes&&(r[us]=aJ(e.commandInput.LocalSecondaryIndexes).map(e=>JSON.stringify(e)))),(t===`ListTables`||t===`Query`||t===`Scan`)&&e.commandInput?.Limit&&(r[ls]=e.commandInput.Limit),t===`ListTables`&&e.commandInput?.ExclusiveStartTableName&&(r[is]=e.commandInput.ExclusiveStartTableName),t===`Query`&&(e.commandInput?.ScanIndexForward&&(r[hs]=e.commandInput.ScanIndexForward),e.commandInput?.IndexName&&(r[ss]=e.commandInput.IndexName),e.commandInput?.Select&&(r[_s]=e.commandInput.Select)),t===`Scan`&&(e.commandInput?.Segment&&(r[gs]=e.commandInput?.Segment),e.commandInput?.TotalSegments&&(r[bs]=e.commandInput?.TotalSegments),e.commandInput?.IndexName&&(r[ss]=e.commandInput.IndexName),e.commandInput?.Select&&(r[_s]=e.commandInput.Select)),t===`UpdateTable`&&(e.commandInput?.AttributeDefinitions&&(r[es]=aJ(e.commandInput.AttributeDefinitions).map(e=>JSON.stringify(e))),e.commandInput?.GlobalSecondaryIndexUpdates&&(r[os]=aJ(e.commandInput.GlobalSecondaryIndexUpdates).map(e=>JSON.stringify(e)))),{spanAttributes:r,spanKind:G.CLIENT,spanOp:`db`}}responseHook(e,t){e.data?.ConsumedCapacity&&t.setAttribute(ns,aJ(e.data.ConsumedCapacity).map(e=>JSON.stringify(e))),e.data?.ItemCollectionMetrics&&t.setAttribute(cs,aJ(e.data.ItemCollectionMetrics).map(e=>JSON.stringify(e))),e.data?.TableNames&&t.setAttribute(vs,e.data?.TableNames.length),e.data?.Count&&t.setAttribute(rs,e.data?.Count),e.data?.ScannedCount&&t.setAttribute(ms,e.data?.ScannedCount)}},sJ=class{requestPreSpanHook(e){let t=e.commandInput?.StreamName,n={};return t&&(n[xs]=t),{spanAttributes:n,spanKind:G.CLIENT}}},cJ=`Invoke`,lJ=class{requestPreSpanHook(e){let t=e.commandInput?.FunctionName,n={},r;return e.commandName===cJ&&(n[Gs]=t,n[Ks]=`aws`,r=`${t} ${cJ}`),{spanAttributes:n,spanKind:G.CLIENT,spanName:r}}requestPostSpanHook(e,t){e.commandName===cJ&&e.commandInput&&(e.commandInput.ClientContext=uJ(e.commandInput.ClientContext,t))}responseHook(e,t){e.request.commandName===cJ&&(t.setAttribute(Ws,e.requestId),e.request.region&&t.setAttribute(qs,e.request.region))}};function uJ(e,t){try{let n=Tf({span:t}),r=e?JSON.parse(Buffer.from(e,`base64`).toString(`utf8`)):{},i={...r,custom:{...r.custom,...n}},a=Buffer.from(JSON.stringify(i)).toString(`base64`);return a.length>3583?(X&&A.warn(`[orchestrion:aws-sdk] cannot set trace propagation on lambda invoke parameters due to ClientContext length limitations.`),e):a}catch(t){return X&&A.log(`[orchestrion:aws-sdk] failed to set trace propagation on lambda ClientContext`,t),e}}var dJ=class{requestPreSpanHook(e){let t=e.commandInput?.Bucket,n={};return t&&(n[ws]=t),{spanAttributes:n,spanKind:G.CLIENT}}},fJ=class{requestPreSpanHook(e){let t=e.commandInput?.SecretId,n={};return typeof t==`string`&&t.startsWith(`arn:aws:secretsmanager:`)&&(n[Ts]=t),{spanAttributes:n,spanKind:G.CLIENT}}responseHook(e,t){let n=e.data?.ARN;n&&t.setAttribute(Ts,n)}},pJ=`sentry-trace`,mJ=`baggage`,hJ=[pJ,mJ];function gJ(e,t){let n=e??{},r=Object.keys(t);if(Object.keys(n).length+r.length<=10)for(let e of r){let r=t[e];r&&(n[e]={DataType:`String`,StringValue:r})}else X&&A.warn(`[orchestrion:aws-sdk] cannot set trace propagation on SQS/SNS message due to maximum amount of MessageAttributes`);return n}function _J(e){let t=e.MessageAttributes??{},n=t[pJ]?.StringValue??t[pJ]?.Value;if(n)return{sentryTrace:n,baggage:t[mJ]?.StringValue??t[mJ]?.Value}}function vJ(e=[]){return jf([...e,...hJ])}var yJ=class{requestPreSpanHook(e){let t=G.CLIENT,n=`SNS ${e.commandName}`,r={[Hc]:`aws.sns`};if(e.commandName===`Publish`){t=G.PRODUCER,r[Vq]=Hq;let{TopicArn:i,TargetArn:a,PhoneNumber:o}=e.commandInput,s=bJ(i,a,o);r[Lc]=s,r[Rc]=i||a||o||`unknown`,n=`${o?`phone_number`:s} send`}let i=e.commandInput?.TopicArn;return i&&(r[Es]=i),{spanAttributes:r,spanKind:t,spanName:n}}requestPostSpanHook(e,t){if(e.commandName===`Publish`){let n=e.commandInput.MessageAttributes??{};e.commandInput.MessageAttributes=gJ(n,Tf({span:t}))}}responseHook(e,t){let n=e.data?.TopicArn;n&&t.setAttribute(Es,n)}};function bJ(e,t,n){if(e||t){let n=e??t;try{return n.substring(n.lastIndexOf(`:`)+1)}catch{return n}}return n||`unknown`}var xJ=class{requestPreSpanHook(e){let t=CJ(e.commandInput),n=wJ(t),r=G.CLIENT,i,a={[Hc]:`aws_sqs`,[Rc]:n,[gl]:t};switch(e.commandName){case`ReceiveMessage`:r=G.CONSUMER,i=`${n} receive`,a[Vc]=`receive`,e.commandInput.MessageAttributeNames=vJ(e.commandInput.MessageAttributeNames);break;case`SendMessage`:case`SendMessageBatch`:r=G.PRODUCER,i=`${n} send`}return{spanAttributes:a,spanKind:r,spanName:i}}requestPostSpanHook(e,t){switch(e.commandName){case`SendMessage`:{let n=e.commandInput.MessageAttributes??{};e.commandInput.MessageAttributes=gJ(n,Tf({span:t}))}break;case`SendMessageBatch`:{let n=e.commandInput?.Entries;if(Array.isArray(n)){let e=Tf({span:t});n.forEach(t=>{t.MessageAttributes=gJ(t.MessageAttributes??{},e)})}}}}responseHook(e,t){switch(e.request.commandName){case`SendMessage`:t.setAttribute(zc,e?.data?.MessageId);break;case`SendMessageBatch`:break;case`ReceiveMessage`:{let n=e?.data?.Messages||[];t.setAttribute(Ic,n.length);for(let e of n)SJ(t,e);break}}}};function SJ(e,t){let n=_J(t);if(!n)return;let{parentSpanId:r,traceId:i,sampled:a}=Ai(n.sentryTrace,n.baggage);i&&r&&e.addLink({context:{traceId:i,spanId:r,traceFlags:+!!a},attributes:{[zc]:t.MessageId}})}function CJ(e){return e?.QueueUrl}function wJ(e){if(!e)return;let t=e.split(`/`);if(t.length!==0)return t[t.length-1]}var TJ=class{requestPreSpanHook(e){let t=e.commandInput?.stateMachineArn,n=e.commandInput?.activityArn,r={};return t&&(r[Os]=t),n&&(r[Ds]=n),{spanAttributes:r,spanKind:G.CLIENT}}},EJ=class{constructor(){this._services=new Map([[`SecretsManager`,new fJ],[`SFN`,new TJ],[`SQS`,new xJ],[`SNS`,new yJ],[`DynamoDB`,new oJ],[`Lambda`,new lJ],[`S3`,new dJ],[`Kinesis`,new sJ],[`BedrockRuntime`,new Kq]])}requestPreSpanHook(e){let t=this._services.get(e.serviceName);return t?t.requestPreSpanHook(e):{}}requestPostSpanHook(e,t){this._services.get(e.serviceName)?.requestPostSpanHook?.(e,t)}responseHook(e,t){this._services.get(e.request.serviceName)?.responseHook?.(e,t)}};function DJ(e,t){let n=t.length;return e?.slice(-n)===t?e.slice(0,-n):e}function OJ(e,t,n,r){return{serviceName:e?.replace(/\s+/g,``),commandName:DJ(t,`Command`),commandInput:n,region:r}}function kJ(e){return{[rl]:`aws-api`,[tl]:e.commandName,[nl]:e.serviceName,[As]:e.region}}var AJ=`Aws`;function jJ(e){try{return e()}catch(e){X&&A.warn(`[orchestrion:aws-sdk] error building span`,e);return}}function MJ(e,t){t&&(t.requestId&&e.setAttribute(Cs,t.requestId),t.httpStatusCode&&e.setAttribute(Ac,t.httpStatusCode),t.extendedRequestId&&e.setAttribute(Ss,t.extendedRequestId))}var NJ=W((()=>{let e=new EJ;return{name:AJ,setupOnce(){if(!C.tracingChannel)return;let t=t=>jJ(()=>{let n=t.arguments[0],r=n?.constructor?.name;if(!n||!r)return;let i=t.self?.config,a=i?.serviceId??DJ(t.self?.constructor?.name||`AWS`,`Client`);n.input||={};let o=OJ(a,r,n.input,void 0),s=e.requestPreSpanHook(o),c=B({name:s.spanName??`${o.serviceName}.${o.commandName}`,kind:s.spanKind??G.CLIENT,op:s.spanOp||`rpc`,attributes:{[I]:zq,...kJ(o),...s.spanAttributes}});t._sentryNormalizedRequest=o,t._sentryRequestMetadata=s;let l;try{l=i?.region?.()}catch{}let u={settled:!1,promise:Promise.resolve(l).then(e=>{e&&(o.region=e,c.setAttribute(As,e))}).catch(()=>{}).finally(()=>{u.settled=!0})};return t._sentryRegion=u,jJ(()=>e.requestPostSpanHook(o,c)),c}),n={deferSpanEnd({span:t,data:n,end:r}){let i=n._sentryNormalizedRequest,a=n._sentryRequestMetadata;if(!i)return!1;let o=`error`in n;if(jJ(()=>{if(o){let e=n.error,r=e?.$metadata;MJ(t,{requestId:e?.RequestId??r?.requestId,httpStatusCode:r?.httpStatusCode,extendedRequestId:e?.extendedRequestId??r?.extendedRequestId});return}let r=n.result;MJ(t,r?.$metadata);let a={data:r,request:i,requestId:r?.$metadata?.requestId};e.responseHook(a,t)}),a?.isStream&&!o)return!0;let s=n._sentryRegion;return s&&!s.settled?(s.promise.then(()=>r()),!0):!1}},r=[$.AWS_SMITHY_CORE_SEND,$.AWS_SMITHY_CLIENT_SEND,$.AWS_SDK_SMITHY_CLIENT_SEND];X&&A.log(`[orchestrion:aws-sdk] subscribing to channels "${r.join(`", "`)}"`),U(()=>{for(let e of r)Z(C.tracingChannel(e),t,n)})}}})),PJ=`Dataloader`,FJ=`dataloader`,IJ=`auto.db.orchestrion.dataloader`,LJ=`cache.get`,RJ=Symbol(`sentry.dataloader.wrapped`);function zJ(e,t){let n=e?.name;return n?`${FJ}.${t} ${n}`:`${FJ}.${t}`}function BJ(e){return Array.isArray(e)?e.map(e=>String(e)):e==null?void 0:[String(e)]}function VJ(e,t,n){let r=t===`load`||t===`loadMany`||t===`batch`;return{name:zJ(e,t),kind:t===`batch`?void 0:G.CLIENT,op:r?LJ:void 0,onlyIfParent:!0,attributes:{[I]:IJ,[ks]:r?BJ(n):void 0}}}var HJ=(()=>({name:PJ,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:dataloader] subscribing to dataloader tracing channels`),U(()=>{UJ(),WJ(),GJ($.DATALOADER_LOAD_MANY,`loadMany`),GJ($.DATALOADER_PRIME,`prime`),GJ($.DATALOADER_CLEAR,`clear`),GJ($.DATALOADER_CLEAR_ALL,`clearAll`)}))}}));function UJ(){C.tracingChannel($.DATALOADER_CONSTRUCT).start.subscribe(e=>{let t=e,n=t.arguments[0];if(typeof n!=`function`||n[RJ])return;let r=n,i=function(...e){return z({...VJ(this,`batch`,e[0]),links:this._batch?.spanLinks},()=>r.apply(this,e))};i[RJ]=!0,t.arguments[0]=i})}function WJ(){let e=C.tracingChannel($.DATALOADER_LOAD);Z(e,e=>KJ(e.self,`load`,e.arguments[0]),{requiresParentSpan:!0}),e.end.subscribe(e=>{let t=e,n=t._sentrySpan,r=t.self?._batch;n&&r&&n.isRecording()&&(r.spanLinks??=[]).push({context:n.spanContext()})})}function GJ(e,t){Z(C.tracingChannel(e),e=>KJ(e.self,t,e.arguments[0]),{requiresParentSpan:!0})}function KJ(e,t,n){return B(VJ(e,t,n))}var qJ=W(HJ),JJ=`GenericPool`,YJ=W((()=>({name:JJ,setupOnce(){C.tracingChannel&&U(()=>XJ())}})));function XJ(){Z(C.tracingChannel($.GENERIC_POOL_ACQUIRE),()=>B({name:`generic-pool.acquire`,attributes:{[I]:`auto.db.orchestrion.generic_pool`}}))}var ZJ=`Google_GenAI`,QJ=`auto.ai.orchestrion.google_genai`,$J=[{channel:$.GOOGLE_GENAI_GENERATE_CONTENT,operation:`generate_content`},{channel:$.GOOGLE_GENAI_EMBED_CONTENT,operation:`embeddings`},{channel:$.GOOGLE_GENAI_CHAT,operation:`chat`}],eY=!1,tY=((e={})=>({name:ZJ,setupOnce(){C.tracingChannel&&!eY&&(eY=!0,U(()=>{for(let{channel:t,operation:n}of $J)X&&A.log(`[orchestrion:google-genai] subscribing to channel "${t}"`),Z(C.tracingChannel(t),t=>nY(t,n,e),{beforeSpanEnd:(t,r)=>{n!==`embeddings`&&ly(t,r.result,Qg(e).recordOutputs)},deferSpanEnd:({span:t,data:n})=>iY(t,n,e)})}))}}));function nY(e,t,n){if(tf(ZJ))return;if(t!==`chat`){let e=R();if(e){let{op:t,origin:n}=L(e);if(n===QJ&&t===`gen_ai.chat`)return}}let r=(e.arguments??[])[0],{recordInputs:i}=Qg(n),a=$g(n.enableTruncation),o=sy(t,r,e.self),s=o[`gen_ai.request.model`]||`unknown`;o[I]=QJ;let c=B({name:`${t} ${s}`,op:`gen_ai.${t}`,attributes:o});return i&&r&&cy(c,r,t,a),c}function rY(e){return!!e&&typeof e[Symbol.asyncIterator]==`function`}function iY(e,t,n){let r=t.result;if(!rY(r))return!1;let{recordOutputs:i}=Qg(n),a=r[Symbol.asyncIterator].bind(r),o=ry({[Symbol.asyncIterator]:a},e,i??!1);return r[Symbol.asyncIterator]=()=>o,!0}var aY=W(tY),oY=`auto.graphql.diagnostic_channel`,sY=`graphql.parse`,cY=`graphql.validate`,lY=`graphql.execute`,uY=`graphql.resolve`,dY=`graphql.field.name`,fY=`graphql.field.path`,pY=`graphql.field.type`,mY=`graphql.parent.name`,hY=Symbol.for(`opentelemetry.graphql_data`),gY=Symbol.for(`opentelemetry.patched`);function _Y(e){return typeof e?.then==`function`}function vY(e,t){if(!e||e[gY])return;e[gY]=!0;let n=e.getFields();Object.keys(n).forEach(e=>{let r=n[e];if(r&&(r.resolve&&=yY(t,r.resolve),r.type))for(let e of DY(r.type))vY(e,t)})}function yY(e,t,n=!1){if(typeof t!=`function`||t[gY])return t;function r(r,i,a,o){if(!t)return;let s=a??{};if(e().ignoreTrivialResolveSpans&&n&&(j(r)||typeof r==`function`)&&typeof r[o.fieldName]!=`function`||!s[hY])return t.call(this,r,i,s,o);let{field:c,spanAdded:l}=xY(s,o,EY(o.path)),u=c.span;return V(u,()=>{try{let e=t.call(this,r,i,s,o);return _Y(e)?e.then(e=>(bY(u,l),e),e=>{throw bY(u,l,e),e}):(bY(u,l),e)}catch(e){throw bY(u,l,e),e}})}return r[gY]=!0,r}function bY(e,t,n){t&&(n&&e.setStatus({code:2,message:n.message}),e.end())}function xY(e,t,n){let r=wY(e,n);if(r)return{field:r,spanAdded:!1};let i={span:SY(t,n,TY(e,n))};return CY(e,n,i),{field:i,spanAdded:!0}}function SY(e,t,n){let r={[I]:oY,[F]:WP,[dY]:e.fieldName,[fY]:t.join(`.`),[pY]:e.returnType.toString(),[mY]:e.parentType.name};return B({name:`${uY} ${t.join(`.`)}`,attributes:r,parentSpan:n})}function CY(e,t,n){let r=e[hY];r&&(r.fields[t.join(`.`)]=n)}function wY(e,t){return e[hY]?.fields[t.join(`.`)]}function TY(e,t){for(let n=t.length-1;n>0;n--){let r=wY(e,t.slice(0,n));if(r)return r.span}return e[hY]?.span}function EY(e){let t=[],n=e;for(;n;)t.push(String(n.key)),n=n.prev;return t.reverse()}function DY(e){return`ofType`in e&&e.ofType?DY(e.ofType):OY(e)?e.getTypes():kY(e)?[e]:[]}function OY(e){return`getTypes`in e&&typeof e.getTypes==`function`}function kY(e){return`getFields`in e&&typeof e.getFields==`function`}function AY(e,t){let n=e?.definitions;if(!n||!Array.isArray(n))return;let r=e=>!!e?.operation&&[`query`,`mutation`,`subscription`].indexOf(e.operation)!==-1;return t?n.filter(r).find(e=>t===e?.name?.value):n.find(r)}var jY={[I]:oY,[F]:WP};function MY(){return B({name:sY,attributes:{...jY}})}function NY(e){return B({name:cY,attributes:{...jY,[yc]:nF(e)}})}function PY(e,t){Array.isArray(t)&&t.length>0&&e.setStatus({code:2,message:`invalid_argument`})}function FY(e){if(e.length>=2)return{schema:e[0],document:e[1],contextValue:e[3]??{},operationName:e[5],fieldResolver:e[6],writeBack:(t,n)=>{e[3]=t,e[6]=n}};let t=e[0]??{};return{schema:t.schema,document:t.document,contextValue:t.contextValue??{},operationName:t.operationName,fieldResolver:t.fieldResolver,writeBack:(e,n)=>{t.contextValue=e,t.fieldResolver=n}}}function IY(e,t,n,r){let i=FY(e),{schema:a,document:o}=i,{contextValue:s,fieldResolver:c}=i,l=!!s[hY];if(!n.ignoreResolveSpans&&!l){let e=c==null,n=t?.defaultFieldResolver,i=c??n;i&&(c=yY(r,i,e)),a&&(vY(a.getQueryType(),r),vY(a.getMutationType(),r))}let u=AY(o,i.operationName),d=u?.operation,f=u?.name?.value??i.operationName??void 0,p=B({name:$P(d,f||void 0,lY),attributes:{...jY,[xc]:d,[bc]:f||void 0,[yc]:nF(o)}});return n.useOperationNameForRootSpan&&d&&ZP(p,d,f||void 0),s[hY]={source:o,span:p,fields:{}},i.writeBack(s,c),p}function LY(e,t){eF(t)&&e.setStatus({code:2,message:`internal_error`})}var RY=`Graphql`;function zY(e){return{ignoreResolveSpans:e.ignoreResolveSpans!==!1,ignoreTrivialResolveSpans:e.ignoreTrivialResolveSpans!==!1,useOperationNameForRootSpan:e.useOperationNameForRootSpan!==!1}}function BY(e){try{return e()}catch(e){X&&A.warn(`[orchestrion:graphql] error building span`,e);return}}var VY=W(((e={})=>{let t=zY(e),n=()=>t;return{name:RY,setupOnce(){C.tracingChannel&&U(()=>{Z(C.tracingChannel($.GRAPHQL_PARSE),()=>BY(()=>MY())),Z(C.tracingChannel($.GRAPHQL_VALIDATE),e=>BY(()=>NY(e.arguments[1])),{beforeSpanEnd:(e,t)=>void BY(()=>PY(e,t.result))}),Z(C.tracingChannel($.GRAPHQL_EXECUTE),e=>BY(()=>IY(e.arguments,e.self,t,n)),{beforeSpanEnd:(e,t)=>void BY(()=>LY(e,t.result))})})}}})),HY=e=>{let t=VY(e);return Mu(CF(e),{name:RY,setupOnce:()=>t.setupOnce?.()})},UY=[`onPreAuth`,`onCredentials`,`onPostAuth`,`onPreHandler`,`onPostHandler`,`onPreResponse`,`onRequest`],WY=Symbol(`hapi-handler-patched`),GY={ROUTER:`router`,PLUGIN:`plugin`,EXT:`server.ext`},KY=new Set(UY),qY=(e=>(e.HAPI_TYPE=`hapi.type`,e.PLUGIN_NAME=`hapi.plugin.name`,e.EXT_TYPE=`server.ext.type`,e))(qY||{});function JY(e){let t=R();if(!t)return;let n=ra(t);n&&L(n).data[`sentry.op`]===`http.server`&&n.setAttribute(Oc,e)}var YY=e=>typeof e==`string`&&KY.has(e),XY=e=>{let t=e?.type;return t!==void 0&&YY(t)},ZY=e=>Array.isArray(e)&&e.length<=3&&YY(e[0])&&typeof e[1]==`function`,QY=e=>!Array.isArray(e),$Y=(e,t)=>{let n={[Oc]:e.path,[Tc]:e.method},r;return t?(n[qY.HAPI_TYPE]=GY.PLUGIN,n[qY.PLUGIN_NAME]=t,r=`${t}: route - ${e.path}`):(n[qY.HAPI_TYPE]=GY.ROUTER,r=`route - ${e.path}`),{attributes:n,name:r}},eX=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!==`method`&&(r=`ext - ${e} - ${n}`),t?{attributes:{[qY.EXT_TYPE]:e,[qY.HAPI_TYPE]:GY.EXT,[qY.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[qY.EXT_TYPE]:e,[qY.HAPI_TYPE]:GY.EXT},name:r}};function tX(e,t){return z({name:e.name,op:`${e.attributes[qY.HAPI_TYPE]}.hapi`,attributes:{...e.attributes,[I]:`auto.http.orchestrion.hapi`}},t)}function nX(e,t){if(e[WY]===!0)return e;e[WY]=!0;let n=n=>function(...r){return R()?(JY(e.path),tX($Y(e,t),()=>n.call(this,...r))):n.call(this,...r)};if(typeof e.handler==`function`)e.handler=n(e.handler);else if(typeof e.options==`function`){let t=e.options;e.options=function(e){let r=t(e);return typeof r.handler==`function`&&(r.handler=n(r.handler)),r}}else typeof e.options?.handler==`function`&&(e.options.handler=n(e.options.handler));return e}function rX(e,t,n){if(Array.isArray(e)){for(let n=0;n<e.length;n++)e[n]=rX(e[n],t);return e}if(QY(e)){if(e[WY]===!0)return e;e[WY]=!0;let r=function(...r){return R()?tX(eX(t,n,e.name),()=>e.apply(void 0,r)):e.apply(this,r)};return r[WY]=!0,r}return e}function iX(e,t){let n=e[0];if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=nX(n[e],t);else e[0]=nX(n,t)}function aX(e,t){if(Array.isArray(e[0])){let n=e[0];for(let e=0;e<n.length;e++){let r=n[e];if(YY(r.type)){let i=r;i.method=rX(i.method,r.type,t),n[e]=i}}return}if(ZY(e)){let n=e,r=n[1];e[1]=rX(r,n[0],t);return}if(XY(e[0])){let n=e[0];n.method=rX(n.method,n.type,t)}}var oX=`Hapi`,sX=W((()=>({name:oX,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:hapi] subscribing to channels "${$.HAPI_ROUTE}" / "${$.HAPI_EXT}"`),C.tracingChannel($.HAPI_ROUTE).subscribe({start(e){let t=e;iX(t.arguments,t.self?.realm?.plugin)},end(){},asyncStart(){},asyncEnd(){},error(){}}),C.tracingChannel($.HAPI_EXT).subscribe({start(e){let t=e;aX(t.arguments,t.self?.realm?.plugin)},end(){},asyncStart(){},asyncEnd(){},error(){}}))}}))),cX=`Koa`,lX=`auto.http.orchestrion.koa`,uX={ROUTER:`router`,MIDDLEWARE:`middleware`},dX=Symbol(`sentry.koa.layer-patched`),fX=!1,pX=((e={})=>{let t=e.ignoreLayersType??[];return{name:cX,setupOnce(){C.tracingChannel&&!fX&&(fX=!0,X&&A.log(`[orchestrion:koa] subscribing to channel "${$.KOA_USE}"`),C.tracingChannel($.KOA_USE).subscribe({start(e){mX(e,t)},end(){},asyncStart(){},asyncEnd(){},error(){}}))}}});function mX(e,t){let n=e.arguments[0];typeof n==`function`&&(e.arguments[0]=hX(n,t))}function hX(e,t){return e.router?gX(e,t):_X(e,!1,t)}function gX(e,t){let n=e.router?.stack??[];for(let e of n){let n=e.path,r=e.stack;r.forEach((e,i)=>{r[i]=_X(e,!0,t,n)})}return e}function _X(e,t,n,r){let i=t?uX.ROUTER:uX.MIDDLEWARE;return e[dX]===!0||n.includes(i)||e.constructor.name===`GeneratorFunction`||e.constructor.name===`AsyncGeneratorFunction`?e:(e[dX]=!0,(n,a)=>{if(!R())return e(n,a);let o=vX(n,e,t,r);n._matchedRoute&&yX(n._matchedRoute.toString());let s=o.attributes[Pc];return z({name:typeof s==`string`?s||`< unknown >`:o.name,op:`${i}.koa`,attributes:{...o.attributes,[I]:lX}},()=>{let t=o.attributes[Oc];if(N()===ar())X&&A.warn(`Isolation scope is default isolation scope - skipping setting transactionName`);else if(t){let e=n.request?.method?.toUpperCase()||`GET`;N().setTransactionName(`${e} ${t}`)}return e(n,a)})})}function vX(e,t,n,r){return n?{attributes:{[Pc]:r?.toString(),[Fc]:uX.ROUTER,[Oc]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[Pc]:t.name||`middleware`,[Fc]:uX.MIDDLEWARE,[js]:t.name||`middleware`},name:`middleware - ${t.name}`}}function yX(e){let t=R();if(!t)return;let n=ra(t);n&&L(n).data[`sentry.op`]===`http.server`&&n.setAttribute(Oc,e)}var bX=W(pX),xX=`IORedis`,SX=`auto.db.orchestrion.redis`,CX=`db.connection_string`;function wX(e){return{host:e?.options?.host,port:e?.options?.port}}function TX(e,t){return{[Bs]:`redis`,[CX]:`redis://${e}:${t}`,[Zc]:e,[Qc]:t,[I]:SX}}var EX=new WeakSet;function DX(e){let t=e.arguments?.[0];if(!t||typeof t!=`object`||EX.has(t))return;EX.add(t);let{host:n,port:r}=wX(e.self),i=$I(t.name,t.args??[]);return B({name:i,op:`db`,attributes:{...TX(n,r),[zs]:i}})}var OX=((e={})=>{let t=e.responseHook;return{name:xX,setupOnce(){if(!C.tracingChannel)return;X&&A.log(`[orchestrion:ioredis] subscribing to "${$.IOREDIS_COMMAND}"/"${$.IOREDIS_CONNECT}"`);let e=C.tracingChannel($.IOREDIS_COMMAND),n=C.tracingChannel($.IOREDIS_CONNECT);U(()=>{Z(e,DX,{requiresParentSpan:!0,beforeSpanEnd(e,n){if(`error`in n||!t)return;let r=n.arguments?.[0];r&&kX(t,e,r,n.result)}}),Z(n,e=>{let{host:t,port:n}=wX(e.self);return B({name:`connect`,op:`db`,attributes:{...TX(t,n),[zs]:`connect`}})},{requiresParentSpan:!0})})}}});function kX(e,t,n,r){try{e(t,n.name,n.args,r)}catch{}}var AX=W(OX),jX=`messaging.destination.partition.id`,MX=`messaging.kafka.message.key`,NX=`messaging.kafka.message.tombstone`,PX=`messaging.kafka.offset`,FX=`process`,IX=`receive`,LX=`send`,RX=`kafka`,zX=`_OTHER`,BX=`auto.kafkajs.orchestrion.producer`,VX=`auto.kafkajs.orchestrion.consumer`,HX=1,UX=0;function WX(e,t){let n=e?.[t];if(n!=null)return Array.isArray(n)?n[0]?.toString():n.toString()}function GX(e){let t=WX(e,`sentry-trace`);if(!t)return;let{traceId:n,parentSpanId:r,sampled:i}=Ai(t,WX(e,`baggage`));if(r)return[{context:{traceId:n,spanId:r,isRemote:!0,traceFlags:i?HX:UX}}]}function KX({topic:e,message:t,operationType:n,links:r,attributes:i}){let a=n===`receive`?`poll`:n;return B({name:`${a} ${e}`,op:`message`,kind:n===`receive`?G.CLIENT:G.CONSUMER,links:r,attributes:{...i,[Hc]:RX,[Rc]:e,[Vc]:n,[Bc]:a,[MX]:t?.key?String(t.key):void 0,[NX]:t?.key&&t.value===null?!0:void 0,[PX]:t?.offset,...t?{[I]:VX}:{}}})}function qX(e,t){let n=B({name:`send ${e}`,op:`message`,kind:G.PRODUCER,attributes:{[Hc]:RX,[Rc]:e,[MX]:t.key?String(t.key):void 0,[NX]:t.key&&t.value===null?!0:void 0,[jX]:t.partition===void 0?void 0:String(t.partition),[Bc]:`send`,[Vc]:LX,[I]:BX}});t.headers=t.headers??{};let r=Tf({span:n});return r[`sentry-trace`]&&(t.headers[`sentry-trace`]=r[`sentry-trace`]),r.baggage&&(t.headers.baggage=r.baggage),n}function JX(e,t){let n,r=zX;typeof t==`string`||t===void 0?n=t:typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(t,`message`)&&(n=t.message,r=t.constructor.name),e.forEach(e=>{e.setAttribute(Us,r),e.setStatus({code:2,message:n})})}function YX(e,t){return Promise.resolve(t).catch(t=>{throw JX(e,t),t}).finally(()=>{e.forEach(e=>e.end())})}var XX=Symbol(`sentry-kafkajs-consumer-callback-wrapped`);function ZX(e){return typeof e==`function`&&e[XX]===!0}function QX(e){let t=function(t){return lo({sentryTrace:WX(t.message.headers,`sentry-trace`),baggage:WX(t.message.headers,`baggage`)},()=>{let n=KX({topic:t.topic,message:t.message,operationType:FX,attributes:{[jX]:String(t.partition)}}),r=V(n,()=>e.call(this,t));return YX([n],r)})};return t[XX]=!0,t}function $X(e){let t=function(t){let n=po(()=>KX({topic:t.batch.topic,message:void 0,operationType:IX,attributes:{[Ic]:t.batch.messages.length,[jX]:String(t.batch.partition)}}));return V(n,()=>{let r=[n];return t.batch.messages.forEach(e=>{r.push(KX({topic:t.batch.topic,message:e,operationType:FX,links:GX(e.headers),attributes:{[jX]:String(t.batch.partition)}}))}),YX(r,e.call(this,t))})};return t[XX]=!0,t}var eZ=`Kafka`;function tZ(){C.tracingChannel($.KAFKAJS_SEND_BATCH).subscribe({start(e){let t=[];(e.arguments[0]?.topicMessages??[]).forEach(e=>{e.messages.forEach(n=>{t.push(qX(e.topic,n))})}),e._sentrySpans=t},error(e){e._sentrySpans&&JX(e._sentrySpans,e.error)},asyncEnd(e){e._sentrySpans?.forEach(e=>e.end())}})}function nZ(){C.tracingChannel($.KAFKAJS_CONSUMER_RUN).subscribe({start(e){let t=e.arguments[0];t&&typeof t==`object`&&(typeof t.eachMessage==`function`&&!ZX(t.eachMessage)&&(t.eachMessage=QX(t.eachMessage)),typeof t.eachBatch==`function`&&!ZX(t.eachBatch)&&(t.eachBatch=$X(t.eachBatch)))}})}var rZ=W((()=>({name:eZ,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:kafkajs] subscribing to channels "${$.KAFKAJS_SEND_BATCH}", "${$.KAFKAJS_CONSUMER_RUN}"`),tZ(),nZ())}}))),iZ=`Knex`,aZ=`auto.db.orchestrion.knex`,oZ=1021,sZ=`db.sql.table`,cZ=`sqlite`,lZ=`postgresql`,uZ=Symbol(`sentry.orchestrion.knex.parent-span`),dZ=(()=>({name:iZ,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:knex] subscribing to channel "${$.KNEX_QUERY}"`),U(()=>{fZ($.KNEX_QUERY_BUILDER),fZ($.KNEX_SCHEMA_BUILDER),fZ($.KNEX_RAW),pZ()}))}}));function fZ(e){C.tracingChannel(e).end.subscribe(e=>{let t=e.result;if(!t||typeof t!=`object`||uZ in t)return;let n=R();n&&Object.defineProperty(t,uZ,{value:n})})}function pZ(){Z(C.tracingChannel($.KNEX_QUERY),e=>{let t=e.self,n=t?.builder,r=n?.[uZ]??R();if(!r)return;let i=e.arguments[0],a=t?.client,o=a?.config?.connection,s=o?.connectionString,c=vZ(n),l=i?.method,u=o?.filename||o?.database||yZ(s),d={[I]:aZ,"knex.version":e.moduleVersion,[Bs]:gZ(a?.driverName),[sZ]:c,[Fs]:l,[Hs]:o?.user,[Ns]:u,[Zc]:o?.host??bZ(s),[Qc]:o?.port??xZ(s),[$c]:o?.filename===`:memory:`?`inproc`:void 0,[zs]:i?.sql==null?void 0:xn(i.sql,oZ)};return B({name:_Z(u,l,c)??`knex.query`,kind:G.CLIENT,op:`db`,parentSpan:r,attributes:d})},{beforeSpanEnd(e,t){if(`error`in t){let n=mZ(t);n!==void 0&&e.setStatus({code:2,message:n})}}})}function mZ(e){let t=e.error;if(!t||typeof t!=`object`||typeof t.message!=`string`)return;let n=t.message,r=e.arguments[0];if(!r?.sql)return n;try{let t=hZ(e.self)(r.sql,r.bindings||[]);return n.replace(`${t} - `,``)}catch{return n}}function hZ(e){if(e){let t=e.client;if(t){if(t._formatQuery)return t._formatQuery.bind(t);if(t.SqlString)return t.SqlString.format.bind(t.SqlString)}if(e.builder?.toString)return e.builder.toString.bind(e.builder)}return()=>`<noop formatter>`}function gZ(e){return e===`sqlite3`?cZ:e===`pg`?lZ:e}function _Z(e,t,n){return t&&e?n?`${t} ${e}.${n}`:`${t} ${e}`:e}function vZ(e){let t=e?._single?.table;return t&&typeof t==`object`?vZ(t):typeof t==`string`?t:void 0}function yZ(e){if(e)try{return new URL(e).pathname?.replace(/^\//,``)||void 0}catch{return}}function bZ(e){if(e)try{return new URL(e).hostname||void 0}catch{return}}function xZ(e){if(e)try{let t=new URL(e).port;return t?parseInt(t,10):void 0}catch{return}}var SZ=W(dZ),CZ=py,wZ=[av,Cv,Xv],TZ=!1;function EZ(){ef(wZ)}var DZ=((e={})=>({name:CZ,setupOnce(){if(!C.tracingChannel||TZ)return;TZ=!0;let t=Iy(e),n=e=>{EZ();let n=e.arguments;if(!Array.isArray(n))return;let r=n[1];(!r||typeof r!=`object`||Array.isArray(r))&&(r={},n[1]=r),r.callbacks=Fy(r.callbacks,t)};for(let e of[$.LANGCHAIN_CHAT_MODEL_INVOKE,$.LANGCHAIN_CHAT_MODEL_STREAM])X&&A.log(`[orchestrion:langchain] subscribing to channel "${e}"`),C.tracingChannel(e).start.subscribe(n);U(()=>{for(let t of OG)X&&A.log(`[orchestrion:langchain] subscribing to channel "${t}"`),Z(C.tracingChannel(t),t=>OZ(t,e))})}}));function OZ(e,t){EZ();let n=(e.arguments??[])[0];return B(zy(e.self,n,t))}var kZ=W(DZ),AZ=Hy,jZ=!1,MZ=!1,NZ=((e={})=>({name:AZ,setupOnce(){if(!C.tracingChannel||jZ)return;jZ=!0;let t=Qg(e),n=Iy(t);U(()=>{X&&A.log(`[orchestrion:langgraph] subscribing to channel "${$.LANGGRAPH_STATE_GRAPH_COMPILE}"`),Z(C.tracingChannel($.LANGGRAPH_STATE_GRAPH_COMPILE),e=>{if(MZ)return;let t=PZ(e.arguments);return B(eb(typeof t?.name==`string`?t.name:void 0))},{beforeSpanEnd:(e,r)=>{FZ(r.result,PZ(r.arguments)??{},t,null,n)}}),X&&A.log(`[orchestrion:langgraph] subscribing to channel "${$.LANGGRAPH_CREATE_REACT_AGENT}"`);let e=C.tracingChannel($.LANGGRAPH_CREATE_REACT_AGENT);e.start.subscribe(e=>{MZ=!0;try{let{arguments:n}=e,r=PZ(n);r&&Array.isArray(r.tools)&&r.tools.length>0&&Ky(r.tools,t,Gy(n)??void 0)}catch(e){X&&A.error(`[orchestrion:langgraph] failed to wrap createReactAgent tools`,e)}}),e.end.subscribe(e=>{MZ=!1;let{arguments:r,result:i}=e,a=Gy(r)??void 0;FZ(i,a?{name:a}:{},t,Wy(r),n)}),e.error.subscribe(()=>{MZ=!1})})}}));function PZ(e){let t=(e??[])[0];return typeof t==`object`&&t?t:void 0}function FZ(e,t,n,r,i){if(!e||typeof e!=`object`)return;let a=e,o=a.invoke;typeof o==`function`&&(a.invoke=nb(o.bind(a),a,t,n,r,i))}var IZ=W(NZ),LZ=`LruMemoizer`,RZ=W((()=>({name:LZ,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:lru-memoizer] subscribing to channel "${$.LRU_MEMOIZER_LOAD}"`),U(()=>{Z(C.tracingChannel($.LRU_MEMOIZER_LOAD),()=>void 0)}))}}))),zZ=`Mongo`,BZ=`auto.db.orchestrion.mongo`,VZ=new Set([`insert`,`update`,`delete`,`find`,`getMore`,`killCursors`]),HZ=(()=>({name:zZ,setupOnce(){C.tracingChannel&&U(()=>{UZ(),WZ(),GZ()})}}));function UZ(){Z(C.tracingChannel($.MONGODB_COMMAND),e=>{let t=e.arguments??[],n=t[0],r=t[1];if(!n||!r||typeof r!=`object`||r.ismaster||r.hello)return;let i=Object.keys(r)[0];return iI(eI(e.self,n,r,i,BZ))},{requiresParentSpan:!0})}function WZ(){Z(C.tracingChannel($.MONGODB_CHECKOUT),()=>void 0)}function GZ(){for(let e of[`insert`,`update`,`remove`])KZ(e===`insert`?$.MONGODB_V3_INSERT:e===`update`?$.MONGODB_V3_UPDATE:$.MONGODB_V3_REMOVE,t=>({topology:t[0],ns:t[1],command:t[2]?.[0],operation:e}));KZ($.MONGODB_V3_COMMAND,e=>{let t=e[2],n=t?Object.keys(t)[0]:void 0;if(!(n&&VZ.has(n)))return{topology:e[0],ns:e[1],command:t,operation:t?nI(t):void 0}}),KZ($.MONGODB_V3_QUERY,e=>({topology:e[0],ns:e[1],command:e[2],operation:`find`})),KZ($.MONGODB_V3_GET_MORE,e=>({topology:e[0],ns:e[1],command:e[2]?.cmd,operation:`getMore`}))}function KZ(e,t){Z(C.tracingChannel(e),e=>{let n=e.arguments;if(!n)return;let r=t(n);if(r&&typeof r.ns==`string`)return iI(rI(r.ns,r.topology,r.command,r.operation,BZ))},{requiresParentSpan:!0})}var qZ=W(HZ),JZ=`Mongoose`,YZ=`auto.db.orchestrion.mongoose`,XZ=new WeakMap,ZZ=!1,QZ=(()=>({name:JZ,setupOnce(){C.tracingChannel&&U(()=>{PF(C.tracingChannel),$Z()})}}));function $Z(){if(!ZZ){ZZ=!0,X&&A.log(`[orchestrion:mongoose] subscribing to injected channels`);for(let e of JG)tQ(e).subscribe({start(e){rQ(e.self)}});tQ($.MONGOOSE_MODEL_AGGREGATE).subscribe({end(e){let t=e.result;t&&typeof t==`object`&&rQ(t)}}),nQ($.MONGOOSE_QUERY_EXEC,e=>{let t=e;return eQ(t.mongooseCollection,t.model?.modelName,t.op??`exec`,XZ.get(e))}),nQ($.MONGOOSE_AGGREGATE_EXEC,e=>{let t=e._model;return eQ(t?.collection,t?.modelName,`aggregate`,XZ.get(e))}),nQ($.MONGOOSE_MODEL_SAVE,e=>{let t=e.constructor;return eQ(t.collection,t.modelName,`save`)}),nQ($.MONGOOSE_MODEL_REMOVE,e=>{let t=e.constructor;return eQ(t.collection,t.modelName,`remove`)}),nQ($.MONGOOSE_MODEL_INSERT_MANY,e=>{let t=e;return eQ(t.collection,t.modelName,`insertMany`)}),nQ($.MONGOOSE_MODEL_BULK_WRITE,e=>{let t=e;return eQ(t.collection,t.modelName,`bulkWrite`)})}}function eQ(e,t,n,r){return GR({collection:e,modelName:t,operation:n,origin:YZ,parentSpan:r})}function tQ(e){return C.tracingChannel(e)}function nQ(e,t){Z(C.tracingChannel(e),e=>{let n=e.self;if(n)return t(n)})}function rQ(e){let t=R();e&&t&&XZ.set(e,t)}var iQ=W(QZ),aQ=`Mysql`,oQ=`db.system`,sQ=`db.connection_string`,cQ=`db.name`,lQ=`db.user`,uQ=`db.statement`,dQ=`net.peer.name`,fQ=`net.peer.port`,pQ=(()=>({name:aQ,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:mysql] subscribing to channel "${$.MYSQL_QUERY}"`),U(()=>{Z(C.tracingChannel($.MYSQL_QUERY),e=>{let t=hQ(e.arguments[0]),{host:n,port:r,database:i,user:a}=gQ(e.self),o=typeof r==`string`?parseInt(r,10):r,s=typeof o==`number`&&!isNaN(o);return e._sentryCallerScope=M(),B({name:t??`mysql.query`,kind:G.CLIENT,op:`db`,attributes:{[oQ]:`mysql`,[I]:`auto.db.orchestrion.mysql`,[sQ]:_Q(n,s?o:void 0,i),...i?{[cQ]:i}:{},...a?{[lQ]:a}:{},...t?{[uQ]:t}:{},...n?{[dQ]:n}:{},...s?{[fQ]:o}:{}}})},{deferSpanEnd({data:e,end:t}){let n=e.result;if(!n||typeof n!=`object`||!mQ(n))return!1;let r=e._sentryCallerScope;return r&&Io(n,r),n.on(`error`,e=>t(e)),n.on(`end`,()=>t()),!0}})}))}}));function mQ(e){return`on`in e&&typeof e.on==`function`}function hQ(e){if(typeof e==`string`)return e;if(j(e)&&`sql`in e){let t=e.sql;return typeof t==`string`?t:void 0}}function gQ(e){let t=e?.config?.connectionConfig??e?.config??{};return{host:t.host,port:t.port,database:t.database,user:t.user}}function _Q(e,t,n){let r=`jdbc:mysql://${e||`localhost`}`;return typeof t==`number`&&(r+=`:${t}`),n&&(r+=`/${n}`),r}var vQ=W(pQ),yQ=`Mysql2`,bQ=`auto.db.orchestrion.mysql2`,xQ=`mysql`;function SQ(){fI(C.tracingChannel),CQ($.MYSQL2_QUERY),CQ($.MYSQL2_EXECUTE)}function CQ(e){Z(C.tracingChannel(e),e=>{let t=wQ(e.arguments);return B({name:t??`mysql2.query`,kind:G.CLIENT,attributes:{[I]:bQ,[F]:`db`,[Bs]:xQ,...EQ(e.self?.config),[zs]:t||void 0}})},{requiresParentSpan:!0})}function wQ(e){return TQ(e[0])}function TQ(e){if(typeof e==`string`)return e;if(j(e)&&`sql`in e){let t=e.sql;return typeof t==`string`?t:void 0}}function EQ(e){let{host:t,port:n,database:r,user:i}=e?.connectionConfig??e??{},a=typeof n==`string`?parseInt(n,10):n,o=typeof a==`number`&&!isNaN(a);return{[Ns]:r||void 0,[Hs]:i||void 0,[Zc]:t||void 0,[Qc]:o?a:void 0}}var DQ=W((()=>({name:yQ,setupOnce(){C.tracingChannel&&U(()=>{SQ()})}}))),OQ=`OpenAI`,kQ=`auto.ai.orchestrion.openai`,AQ=[{channel:$.OPENAI_CHAT,operation:`chat`},{channel:$.OPENAI_EMBEDDINGS,operation:`embeddings`}],jQ=!1,MQ=((e={})=>({name:OQ,setupOnce(){C.tracingChannel&&!jQ&&(jQ=!0,U(()=>{for(let{channel:t,operation:n}of AQ)X&&A.log(`[orchestrion:openai] subscribing to channel "${t}"`),Z(C.tracingChannel(t),t=>NQ(t,n,e),{beforeSpanEnd:(t,n)=>{uv(t,n.result,Qg(e).recordOutputs)},deferSpanEnd:({span:t,data:n})=>FQ(t,n,e)})}))}}));function NQ(e,t,n){if(tf(OQ))return;let r=e.arguments??[],i=r[0],{recordInputs:a}=Qg(n),o=$g(n.enableTruncation),s=vv(r,t);s[I]=kQ;let c=B({name:`${t} ${i?.model||`unknown`}`,op:`gen_ai.${t}`,attributes:s});return a&&i&&yv(c,i,t,o),c}function PQ(e){return!!e&&typeof e[Symbol.asyncIterator]==`function`}function FQ(e,t,n){let r=t.result;if(!PQ(r))return!1;let{recordOutputs:i}=Qg(n),a=r[Symbol.asyncIterator].bind(r),o=gv({[Symbol.asyncIterator]:a},e,i??!1);return r[Symbol.asyncIterator]=()=>o,!0}var IQ=W(MQ),LQ=`Postgres`,RQ=`auto.db.orchestrion.postgres`,zQ=`db.system`,BQ=`db.name`,VQ=`db.connection_string`,HQ=`db.user`,UQ=`db.statement`,WQ=`net.peer.name`,GQ=`net.peer.port`,KQ=`db.postgresql.plan`,qQ=`db.postgresql.idle.timeout.millis`,JQ=`db.postgresql.max.client`,YQ=`postgresql`,XQ=`pg.query`,ZQ=`pg.connect`,QQ=`pg-pool.connect`,$Q=((e={})=>({name:LQ,setupOnce(){C.tracingChannel&&U(()=>{e$($.PG_QUERY,t$,{deferStreamedResult:!0}),e.ignoreConnectSpans||(e$($.PG_CONNECT,n$),e$($.PGPOOL_CONNECT,r$))})}}));function e$(e,t,{deferStreamedResult:n=!1}={}){X&&A.log(`[orchestrion:pg] subscribing to channel "${e}"`),Z(C.tracingChannel(e),e=>(e._sentryCallerScope=M(),B({...t(e),kind:G.CLIENT})),n?{requiresParentSpan:!0,deferSpanEnd({data:e,end:t}){let n=e.result;if(!n||typeof n!=`object`||!i$(n))return!1;let r=e._sentryCallerScope;return r&&Io(n,r),n.on(`error`,e=>t(e)),n.on(`end`,()=>t()),!0}}:{requiresParentSpan:!0})}function t$(e){let t=e.self?.connectionParameters??{},n=a$(e.arguments);return{name:n?.text??XQ,op:`db`,attributes:{...o$(t),[I]:RQ,[UQ]:n?.text||void 0,[KQ]:typeof n?.name==`string`?n.name:void 0}}}function n$(e){return{name:ZQ,op:`db`,attributes:o$(e.self?.connectionParameters??{})}}function r$(e){return{name:QQ,op:`db`,attributes:s$(e.self?.options??{})}}function i$(e){return`on`in e&&typeof e.on==`function`}function a$(e){let t=e[0];if(typeof t==`string`)return{text:t};if(j(t)&&typeof t.text==`string`){let e=t;return{text:e.text,name:e.name}}}function o$(e){return{[zQ]:YQ,[VQ]:c$(e),[BQ]:e.database,[HQ]:e.user,[WQ]:e.host,[GQ]:Number.isInteger(e.port)?e.port:void 0}}function s$(e){let t;try{t=e.connectionString?new URL(e.connectionString):void 0}catch{t=void 0}let n=t?.pathname.slice(1)||e.database,r=t?.hostname||e.host,i=Number(t?.port)||(Number.isInteger(e.port)?e.port:void 0),a=t?.username||e.user;return{[zQ]:YQ,[VQ]:c$(e),[qQ]:e.idleTimeoutMillis,[JQ]:e.max,[BQ]:n,[GQ]:i,[WQ]:r||void 0,[HQ]:a||void 0}}function c$(e){if(e.connectionString)try{let t=new URL(e.connectionString);return t.username=``,t.password=``,t.toString()}catch{return`postgresql://localhost:5432/`}return`postgresql://${e.host||`localhost`}:${e.port||5432}/${e.database||``}`}var l$=W($Q),u$=`PostgresJs`,d$=`auto.db.orchestrion.postgresjs`,f$=`db.response.status_code`,p$=()=>{},m$=Symbol.for(`sentry.query.from.instrumented.sql`),h$=Symbol(`sentryPostgresJsSpan`),g$=Symbol(`sentryPostgresJsConnectionAttrsSet`),_$=Symbol(`sentryPostgresJsSpanEnded`),v$=new WeakMap,y$=[];function b$(e){y$.some(t=>t.ATTR_SERVER_ADDRESS===e.ATTR_SERVER_ADDRESS&&t.ATTR_SERVER_PORT===e.ATTR_SERVER_PORT&&t.ATTR_DB_NAMESPACE===e.ATTR_DB_NAMESPACE)||y$.push(e)}function x$(){return y$.length===1?y$[0]:void 0}function S$(e){let t=e.result,n=e.arguments?.[0];if(!t||typeof t!=`object`||!n)return;let r=mC(n);v$.set(t,r),b$(r)}function C$(e,t,n){let r=t;r[g$]||(r[g$]=!0,fC(e,n))}function w$(e){let t=e.self,n=e.arguments?.[0];if(!t||!n)return;let r=n[h$],i=v$.get(t);r&&i&&C$(r,n,i)}function T$(e,t,n){let r=e.self;if(!r)return;let i=()=>{e[_$]=!0},a=r.resolve;typeof a==`function`&&(r.resolve=function(...e){i();try{let r=e[0]?.command;pC(t,n,r),t.end()}catch(e){X&&A.error(`[orchestrion:postgresjs] error ending span in resolve:`,e)}return a.apply(this,e)});let o=r.reject;typeof o==`function`&&(r.reject=function(...e){i();try{let r=e[0];t.setStatus({code:2,message:r?.message||`unknown_error`}),t.setAttribute(f$,r?.code||`unknown`),t.setAttribute(Us,r?.name||`unknown`),pC(t,n),t.end()}catch(e){X&&A.error(`[orchestrion:postgresjs] error ending span in reject:`,e)}return o.apply(this,e)})}var E$=W(((e={})=>{let{requireParentSpan:t,requestHook:n}=e;return{name:u$,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:postgresjs] subscribing to "${$.POSTGRESJS_HANDLE}"`),C.tracingChannel($.POSTGRESJS_CONNECTION).subscribe({start:p$,asyncStart:p$,asyncEnd:p$,error:p$,end:S$}),C.tracingChannel($.POSTGRESJS_EXECUTE).subscribe({end:p$,asyncStart:p$,asyncEnd:p$,error:p$,start:w$}),C.tracingChannel($.POSTGRESJS_CONNECT).subscribe({end:p$,asyncStart:p$,asyncEnd:p$,error:p$,start:w$}),U(()=>{Z(C.tracingChannel($.POSTGRESJS_HANDLE),e=>{let t=e.self;if(!t||t.executed===!0||t[m$])return;let r=dC(lC(t.strings)),i=B({name:r||`postgresjs.query`,op:`db`,kind:G.CLIENT,attributes:{[I]:d$,[Vs]:`postgres`,[Rs]:r}});t[h$]=i;let a=x$();if(a&&C$(i,t,a),n)try{n(i,r,a)}catch(e){i.setAttribute(`sentry.hook.error`,`requestHook failed`),X&&A.error(`[orchestrion:postgresjs] error in requestHook:`,e)}return T$(e,i,r),i},{requiresParentSpan:t!==!1,deferSpanEnd({data:e}){return e[_$]?!0:!(`error`in e)}})}))}}})),D$=`Tedious`,O$=`auto.db.orchestrion.tedious`,k$=`mssql`,A$=`db.sql.table`,j$=Symbol(`sentry.orchestrion.tedious.current-database`);function M$(e){Object.defineProperty(this,j$,{value:e,writable:!0,configurable:!0})}function N$(){this.removeListener(`databaseChange`,M$)}function P$(){C.tracingChannel($.TEDIOUS_CONNECT).start.subscribe(e=>{let t=e.self;t&&(M$.call(t,t.config?.options?.database),t.removeListener(`databaseChange`,M$),t.on(`databaseChange`,M$),t.removeListener(`end`,N$),t.once(`end`,N$))})}function F$(e,t){C.tracingChannel(e).start.subscribe(e=>{let n=e,r=n.self,i=n.arguments[0];if(!r||!(i instanceof Me))return;let a=0,o=0,s=()=>{o++},c=()=>{a++},l=r[j$],u=I$(i),d={[I]:O$,[Bs]:k$,[Ns]:l,[Hs]:r.config?.userName??r.config?.authentication?.options?.userName,[zs]:u,[A$]:i.table,[Zc]:r.config?.server,[Qc]:r.config?.options?.port},f=B({name:L$(t,l,u,i.table),kind:G.CLIENT,op:`db`,attributes:d}),p=R$(e=>{i.removeListener(`done`,s),i.removeListener(`doneInProc`,s),i.removeListener(`doneProc`,c),i.removeListener(`error`,p),r.removeListener(`end`,p),f.setAttribute(`tedious.procedure_count`,a),f.setAttribute(`tedious.statement_count`,o),e&&f.setStatus({code:2,message:e.message}),f.end()});if(i.on(`done`,s),i.on(`doneInProc`,s),i.on(`doneProc`,c),i.once(`error`,p),r.on(`end`,p),typeof i.callback==`function`){let e=i.callback;i.callback=function(...t){return p(t[0]),e.apply(this,t)}}})}function I$(e){if(e.sqlTextOrProcedure===`sp_prepare`&&e.parametersByName?.stmt?.value!=null){let t=e.parametersByName.stmt.value;return typeof t==`string`?t:void 0}return e.sqlTextOrProcedure}function L$(e,t,n,r){return e===`execBulkLoad`&&r&&t?`${e} ${r} ${t}`:e===`callProcedure`?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:e}function R$(e){let t=!1;return(...n)=>{t||(t=!0,e(...n))}}var z$=W((()=>({name:D$,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:tedious] subscribing to channel "${$.TEDIOUS_EXEC_SQL}"`),U(()=>{P$(),F$($.TEDIOUS_EXEC_SQL,`execSql`),F$($.TEDIOUS_EXEC_SQL_BATCH,`execSqlBatch`),F$($.TEDIOUS_CALL_PROCEDURE,`callProcedure`),F$($.TEDIOUS_EXEC_BULK_LOAD,`execBulkLoad`),F$($.TEDIOUS_PREPARE,`prepare`),F$($.TEDIOUS_EXECUTE,`execute`)}))}}))),B$=Symbol(`SentryVercelAiModelPatched`),V$=Symbol(`SentryVercelAiToolPatched`),H$=0;function U$(){return`v6-${++H$}`}var W$=new WeakMap,G$=new WeakSet,K$=new WeakSet,q$=new WeakMap,J$=new WeakMap,Y$=new WeakMap,X$=new WeakSet,Z$=!1;function Q$(e,t={}){if(!Z$){Z$=!0;try{$$(e,$.VERCEL_AI_GENERATE_TEXT,u1(`generateText`),t),$$(e,$.VERCEL_AI_STREAM_TEXT,u1(`streamText`),t),$$(e,$.VERCEL_AI_GENERATE_OBJECT,u1(`generateObject`),t),$$(e,$.VERCEL_AI_EMBED,(e,t)=>({type:`embed`,event:{callId:U$(),...p1(e.model),maxRetries:e.maxRetries,value:e.value,...f1(t)}}),t),$$(e,$.VERCEL_AI_EMBED_MANY,(e,t)=>({type:`embedMany`,event:{callId:U$(),...p1(e.model),maxRetries:e.maxRetries,values:e.values,...f1(t)}}),t),$$(e,$.VERCEL_AI_EXECUTE_TOOL_CALL,(e,t)=>({type:`executeTool`,event:{callId:U$(),toolCall:e.toolCall,tools:e.tools,...f1(t)}}),t),i1(e,$.VERCEL_AI_RESOLVE_LANGUAGE_MODEL,t)}catch{X&&A.log(`Vercel AI orchestrion channel subscription failed.`)}}}function $$(e,t,n,r){let i=e(t),a=e=>{let t=j(e.arguments[0])?e.arguments[0]:{},i=j(t.experimental_telemetry)?t.experimental_telemetry:{};if(i.isEnabled===!1&&!X$.has(i))return;let a=n(t,i);r1(t,i);let o=R(),s=AL(a,r);if(s){W$.set(e,a),G$.add(s);let n=j(t.model)&&t.model.specificationVersion===`v1`;Y$.set(s,{callSiteSpan:o,toolErrorsBubbleToCaller:n}),a.type===`executeTool`&&K$.add(s);let c=Q(a.event.callId);c&&q$.set(s,c),J$.set(s,f1(i)),j(t.tools)&&c1(t.tools,r),n&&o1(t.model,r)}return s};Z(i,e=>a(e),{beforeSpanEnd:(e,t)=>{let n=W$.get(t);if(n){if(`error`in t){let n=Y$.get(e)?.callSiteSpan;n&&j(t.error)&&Jt(t.error,`_sentry_active_span`,n)}else n.result=n.type===`executeTool`?{output:t.result}:t.result,FL(e,n,r);n.type!==`streamText`&&bL(n),W$.delete(t)}},deferSpanEnd:({data:e,end:t})=>e1(e,t)})}function e1(e,t){if(W$.get(e)?.type!==`streamText`||`error`in e||!t1(e.result))return!1;let n=e.result;return(async()=>{try{let[r,i,a,o,s]=await Promise.all([n.totalUsage??n.usage,n.text,n.toolCalls,n.finishReason,n.response]);e.result={usage:r,text:i,toolCalls:a,finishReason:o,response:s},t()}catch(e){t(e)}})(),!0}function t1(e){return j(e)&&(n1(e.totalUsage)||n1(e.usage))}function n1(e){return j(e)&&typeof e.then==`function`}function r1(e,t){if(t.isEnabled!==!0)return;let n={...t,isEnabled:!1};X$.add(n),e.experimental_telemetry=n}function i1(e,t,n){e(t).subscribe({end(e){let t=e;j(t.result)&&o1(t.result,n)},start(){},asyncStart(){},asyncEnd(){},error(){}})}function a1(){let e=R();return e&&G$.has(e)?e:void 0}function o1(e,t){e[B$]||(e[B$]=!0,s1(e,`doGenerate`,t),s1(e,`doStream`,t))}function s1(e,t,n){let r=e[t];typeof r==`function`&&(e[t]=function(...i){let a=a1();if(!a)return Promise.resolve(r.apply(this,i));let o=j(i[0])?i[0]:{},s=q$.get(a),c={type:`languageModelCall`,event:{callId:s,provider:e.provider,modelId:e.modelId,tools:o.tools??(j(o.mode)?o.mode.tools:void 0),messages:o.prompt,...J$.get(a)}},l=V(a,()=>AL(c,n));if(!l)return Promise.resolve(r.apply(this,i));let u=()=>{t===`doStream`&&s&&xL(s)},d=e=>{throw l.setStatus({code:2,message:e instanceof Error?e.message:`unknown_error`}),l.end(),u(),e};try{return Promise.resolve(r.apply(this,i)).then(e=>t===`doStream`&&j(e)&&nL(e.stream)?(e.stream=rL(e.stream,t=>{c.result={...e,...DL(t)},FL(l,c,n),l.end(),u()},e=>{l.setStatus({code:2,message:e instanceof Error?e.message:`unknown_error`}),l.end(),u()}),e):(c.result=e,FL(l,c,n),l.end(),u(),e),d)}catch(e){return d(e)}})}function c1(e,t){try{for(let[n,r]of Object.entries(e))j(r)&&l1(n,r,e,t)}catch{X&&A.log(`Vercel AI orchestrion tool patching failed.`)}}function l1(e,t,n,r){let i=t.execute;typeof i!=`function`||t[V$]||(t[V$]=!0,t.execute=function(t,...a){let o=a1();if(!o||K$.has(o))return i.apply(this,[t,...a]);let s=j(a[0])?a[0]:{},c={type:`executeTool`,event:{callId:q$.get(o),toolCall:{toolName:e,toolCallId:Q(s.toolCallId),input:t},tools:n,...J$.get(o)}},l=V(o,()=>AL(c,r));if(!l)return i.apply(this,[t,...a]);let u=e=>{throw Y$.get(o)?.toolErrorsBubbleToCaller?l.setStatus({code:2,message:e instanceof Error?e.message:`tool_error`}):UL(l,c,e),l.end(),e};try{return Promise.resolve(i.apply(this,[t,...a])).then(e=>(c.result={output:e},FL(l,c,r),l.end(),e),u)}catch(e){return u(e)}})}function u1(e){return(t,n)=>({type:e,event:{callId:U$(),operationId:`ai.${e}`,functionId:Q(n.functionId),...p1(t.model),maxRetries:t.maxRetries,instructions:Q(t.system),messages:d1(t),...f1(n)}})}function d1(e){return Array.isArray(e.messages)?e.messages:typeof e.prompt==`string`?[{role:`user`,content:e.prompt}]:e.messages??e.prompt}function f1(e){let t=e.isEnabled===!0||void 0;return{recordInputs:e.recordInputs??t,recordOutputs:e.recordOutputs??t}}function p1(e){return{provider:m1(e,`provider`),modelId:m1(e,`modelId`)}}function m1(e,t){return j(e)?Q(e[t]):void 0}var h1=W(((e={})=>Mu(qL(e),{options:e,setupOnce(){C.tracingChannel&&U(()=>{Q$(C.tracingChannel,e)})}}))),g1=new WeakMap;function _1(e,t){g1.set(e,t)}function v1(e){return g1.get(e)}var y1=new WeakMap;function b1(e){let t=y1.get(e);return t||(t=[],y1.set(e,t)),t}function x1(e,t){b1(e).push(t)}function S1(e){b1(e).pop()}function C1(e){let t=e[0];return Array.isArray(t)?t.map(e=>w1(e)??``).join(`,`):w1(t)}function w1(e){return typeof e==`string`?e:e instanceof RegExp||typeof e==`number`?String(e):void 0}function T1(e){let t=b1(e),n=``;for(let e of t)e!==`/`&&e!==`/*`&&(n+=!n||n.endsWith(`/`)?e:`/${e}`);return n.replace(/\/{2,}/g,`/`)}function E1(e,t){let n=b1(e);if(n.length===0)return;let r=typeof e.originalUrl==`string`?e.originalUrl:``;if(n.every(e=>e===`/`))return r===`/`?`/`:void 0;if(t===`*`||t.includes(`/`)&&(t.includes(`,`)||t.includes(`\\`)||t.includes(`*`)||t.includes(`[`)))return t;let i=t.startsWith(`/`)?t:`/${t}`;return i.length>0&&(r===i||r.startsWith(i)||D1(i))?i:void 0}function D1(e){return e.includes(`:`)||e.includes(`*`)}var O1=`auto.http.express`,k1=`express.name`,A1=`express.type`,j1=()=>{},M1=!1;function N1(e,t){if(!M1){M1=!0;for(let e of[$.EXPRESS_REGISTER,$.ROUTER_REGISTER])t(e).subscribe({start:j1,asyncStart:j1,asyncEnd:j1,error:j1,end:P1});for(let n of[$.EXPRESS_HANDLE,$.ROUTER_HANDLE]){X&&A.log(`[orchestrion:express] subscribing to channel "${n}"`);let r=t(n);Z(r,t=>I1(t,e),{beforeSpanEnd(e,t){t._sentryCleanup?.()}}),r.subscribe({start:j1,asyncEnd:j1,end:j1,error:j1,asyncStart:F1})}}}function P1(e){let t=e.self?.stack;if(!Array.isArray(t))return;let n=t[t.length-1];n&&_1(n,C1(e.arguments??[]))}function F1(e){if(!e._sentryStoredLayer)return;e._sentryStoredLayer=!1;let t=e.arguments?.[0];t&&S1(t)}function I1(e,t){let n=e.self,r=e.arguments;if(!n||!Array.isArray(r)||n.handle?.length===4||n.method&&!n.route)return;let i=r[0],a=r[1];if(!i||!R())return;let o=L1(n),s=v1(n);s!=null&&(x1(i,s),e._sentryStoredLayer=!0);let c=o===`request_handler`?T1(i):void 0,l=o===`request_handler`&&c!=null?E1(i,c):void 0,u=o===`request_handler`?c||`request handler`:o===`router`?n.path??`/`:n.name??`<anonymous>`;if(l&&R1(l),o===`request_handler`&&c){let e=N();if(e!==ar()){let t=typeof i.method==`string`?i.method.toUpperCase():`GET`;e.setTransactionName(`${t} ${c}`)}else X&&A.warn(`[orchestrion:express] Isolation scope is still default isolation scope - skipping transaction name`)}if(z1(u,o,t))return;let d=B({name:u,attributes:{[I]:O1,[F]:`${o}.express`,[k1]:u,[A1]:o,...l?{[Oc]:l}:{}}});if(a&&typeof a.once==`function`){let t=()=>{d.end()};a.once(`finish`,t),e._sentryCleanup=()=>a.removeListener(`finish`,t)}return d}function L1(e){return e.name===`router`?`router`:e.name===`bound dispatch`||e.name===`handle`?`request_handler`:`middleware`}function R1(e){let t=R(),n=t&&ra(t);n&&L(n).data[`sentry.op`]===`http.server`&&n.setAttribute(Oc,e)}function z1(e,t,n){let{ignoreLayers:r,ignoreLayersType:i}=n;if(Array.isArray(i)&&i.includes(t))return!0;if(!Array.isArray(r))return!1;try{return Tn(e,r,!0)}catch{return!1}}var B1=`Express`,V1=W(((e={})=>({name:B1,setupOnce(){C.tracingChannel&&U(()=>{N1(e,C.tracingChannel)})},getShouldHandleError(){return e.shouldHandleError}})));function H1(e,t){return B({name:`${e} ${t.path}`,op:`db.query`,kind:G.CLIENT,attributes:{[I]:`auto.firebase.orchestrion.firestore`,[Ls]:e,...W1(t)}})}function U1(e){let t,n;if(typeof e.host==`string`){if(e.host.startsWith(`[`)){if(e.host.endsWith(`]`))t=e.host.replace(/^\[|\]$/g,``);else if(e.host.includes(`]:`)){let r=e.host.lastIndexOf(`:`);r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,``),n=e.host.slice(r+1))}}else if(Be.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(`:`);r===-1?t=e.host:(t=e.host.slice(0,r),n=e.host.slice(r+1))}}return{address:t,port:n?parseInt(n,10):void 0}}function W1(e){let t=e.firestore.app,n=t.options,r=e.firestore.toJSON()?.settings||{},i={[Ms]:e.path,[Ps]:t.name,[Vs]:`firebase.firestore`,"firebase.firestore.type":e.type,"firebase.firestore.options.projectId":n.projectId,"firebase.firestore.options.appId":n.appId,"firebase.firestore.options.messagingSenderId":n.messagingSenderId,"firebase.firestore.options.storageBucket":n.storageBucket},{address:a,port:o}=U1(r);return a&&(i[fl]=a),o&&(i[pl]=o),i}var G1=`auto.firebase.orchestrion.functions`,K1=`__sentryFirebaseWrapped`;function q1(e,t){let n=e.arguments;if(!Array.isArray(n)||n.length===0)return;let r=typeof n[0]==`function`?0:1,i=n[r];typeof i!=`function`||i[K1]||(n[r]=J1(i,t))}function J1(e,t){let n=async function(...n){let r=process.env.FUNCTION_TARGET||process.env.K_SERVICE||`unknown`,i={[I]:G1,[Js]:r,[Ys]:t,"faas.provider":`firebase`};return process.env.GCLOUD_PROJECT&&(i[`cloud.project_id`]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(i[`cloud.event_source`]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),oo({name:`firebase.function.${t}`,op:`function.firebase`,kind:G.SERVER,attributes:i},async t=>{try{let r=await e.apply(this,n);return t.end(),r}catch(e){throw t.setStatus({code:2}),H(e,{mechanism:{type:G1,handled:!1}}),t.end(),await lu(2e3),e}})};return n[K1]=!0,n}var Y1=[{channel:$.FIREBASE_FIRESTORE_ADD_DOC,spanName:`addDoc`,useParent:!1},{channel:$.FIREBASE_FIRESTORE_GET_DOCS,spanName:`getDocs`,useParent:!1},{channel:$.FIREBASE_FIRESTORE_SET_DOC,spanName:`setDoc`,useParent:!0},{channel:$.FIREBASE_FIRESTORE_DELETE_DOC,spanName:`deleteDoc`,useParent:!0}],X1=[{channel:$.FIREBASE_FUNCTIONS_HTTP_REQUEST,triggerType:`http.request`},{channel:$.FIREBASE_FUNCTIONS_HTTP_CALL,triggerType:`http.call`},{channel:$.FIREBASE_FUNCTIONS_FIRESTORE_CREATED,triggerType:`firestore.document.created`},{channel:$.FIREBASE_FUNCTIONS_FIRESTORE_UPDATED,triggerType:`firestore.document.updated`},{channel:$.FIREBASE_FUNCTIONS_FIRESTORE_DELETED,triggerType:`firestore.document.deleted`},{channel:$.FIREBASE_FUNCTIONS_FIRESTORE_WRITTEN,triggerType:`firestore.document.written`},{channel:$.FIREBASE_FUNCTIONS_SCHEDULER,triggerType:`scheduler.scheduled`},{channel:$.FIREBASE_FUNCTIONS_STORAGE_FINALIZED,triggerType:`storage.object.finalized`},{channel:$.FIREBASE_FUNCTIONS_STORAGE_ARCHIVED,triggerType:`storage.object.archived`},{channel:$.FIREBASE_FUNCTIONS_STORAGE_DELETED,triggerType:`storage.object.deleted`},{channel:$.FIREBASE_FUNCTIONS_STORAGE_METADATA_UPDATED,triggerType:`storage.object.metadataUpdated`}],Z1=()=>{};function Q1(e){try{return e()}catch(e){X&&A.warn(`[orchestrion:firebase] error handling channel event`,e);return}}function $1(){for(let{channel:e,spanName:t,useParent:n}of Y1)Z(C.tracingChannel(e),e=>Q1(()=>{let r=e.arguments[0];if(!r)return;let i=n&&r.parent||r;return H1(t,i)}));for(let{channel:e,triggerType:t}of X1)C.tracingChannel(e).subscribe({start:e=>void Q1(()=>q1(e,t)),end:Z1,asyncStart:Z1,asyncEnd:Z1,error:Z1})}var e0=`Firebase`,t0=W((()=>({name:e0,setupOnce(){C.tracingChannel&&U(()=>{$1()})}})));function n0(){return!!O.__SENTRY_ORCHESTRION__}function r0(){let{runtime:e,bundler:t}=O.__SENTRY_ORCHESTRION__??{};if(!e&&!t){A.warn("[Sentry] No diagnostics-channel injection detected. Channel-based integrations will not record spans. Make sure the diagnostics channels are injected via the runtime `--import` hook or a bundler plugin before the instrumented modules load.");return}A.log(e?`[Sentry] Runtime hook registered, injected libraries=${JSON.stringify(e)}`:`[Sentry] Runtime hook not registered`),A.log(t?`[Sentry] Bundler plugin ran, injected libraries=${JSON.stringify(t)}`:`[Sentry] Bundler plugin did not run`)}var i0=`RedisChannel`,a0=`auto.db.orchestrion.redis`,o0=`db.connection_string`,s0=`redis`;function c0(e,t){t&&e.setStatus({code:2,message:t instanceof Error?t.message:String(t)}),e.end()}function l0(e,t,n,r,i){if(e)try{e(t,n,r,i)}catch{}}function u0(e){let t=e[0];return j(t)&&Object.getOwnPropertySymbols(t).length>0?e.slice(1):e}function d0(e){if(typeof e==`string`&&e)try{let t=new URL(e);return t.searchParams.delete(`user_pwd`),t.username=``,t.password=``,t.href}catch{return}}function f0(e){return{[Bs]:s0,[Zc]:e?.socket?.host,[Qc]:e?.socket?.port,[o0]:d0(e?.url),[I]:a0}}function p0(e,t,n){return B({name:`redis-${e}`,kind:G.CLIENT,attributes:{...n,[F]:`db`,[zs]:$I(e,t)}})}function m0(e){let t=C.tracingChannel($.REDIS_COMMAND),n=()=>{};t.subscribe({end:n,asyncStart:n,asyncEnd:n,start(t){let n=t.arguments?.[0];if(!n||typeof n!=`object`)return;let r=n.callback;if(typeof r!=`function`)return;let i=t.self,a={[Bs]:s0,[I]:a0};a[Zc]=i?.connection_options?.host,a[Qc]=i?.connection_options?.port,i?.address&&(a[o0]=`redis://${i.address}`);let o=p0(n.command,n.args??[],a);t._sentrySpan=o;let s=R();n.callback=function(t,i){t||l0(e,o,n.command,n.args??[],i),c0(o,t);let a=arguments;return V(s??null,()=>r.apply(this,a))}},error(e){let t=e._sentrySpan;t&&c0(t,e.error)}})}function h0(e,t,n){Z(C.tracingChannel(e),e=>{let n=t(e);if(!n?.length)return;let r=String(n[0]),i=e.self?.options;return p0(r,n.slice(1),f0(i))},{beforeSpanEnd(e,r){if(`error`in r||!n)return;let i=t(r);i?.length&&l0(n,e,String(i[0]),i.slice(1),r.result)}})}function g0(e){let t=e.arguments?.[0];return Array.isArray(t)?t:void 0}function _0(e){let t=e.arguments?.[0],n=e.arguments?.[1];if(typeof t?.transformArguments==`function`&&Array.isArray(n))try{return t.transformArguments(...u0(n))}catch{return}}function v0(){Z(C.tracingChannel($.NODE_REDIS_CONNECT),e=>{let t=e.self?.options;return B({name:`redis-connect`,kind:G.CLIENT,attributes:{...f0(t),[F]:`db`}})})}function y0(e,t){Z(C.tracingChannel(e),e=>{let n=e.arguments?.[0],r=Array.isArray(n)?n.length:void 0,i=e.self?.options?.socket;return B({name:t(e),kind:G.CLIENT,attributes:{[I]:a0,[F]:`db.redis`,[Vs]:s0,...r&&r>1?{[Is]:r}:{},...i?.host==null?{}:{[fl]:i.host},...i?.port==null?{}:{[pl]:i.port}}})})}var b0=W(((e={})=>{let t=e.responseHook;return{name:i0,setupOnce(){C.tracingChannel&&(X&&A.log(`[orchestrion:redis] subscribing to "${$.REDIS_COMMAND}" and node-redis channels`),m0(t),U(()=>{h0($.NODE_REDIS_COMMAND,g0,t),h0($.NODE_REDIS_EXECUTOR,_0,t),v0(),y0($.NODE_REDIS_MULTI,()=>`MULTI`),y0($.NODE_REDIS_PIPELINE,()=>`PIPELINE`),y0($.NODE_REDIS_BATCH,e=>e.arguments?.[2]===void 0?`PIPELINE`:`MULTI`)}))}}})),x0={postgresIntegration:l$,postgresJsIntegration:E$,mongoIntegration:qZ,mysqlIntegration:vQ,mysql2Integration:DQ,genericPoolIntegration:YJ,mongooseIntegration:iQ,lruMemoizerIntegration:RZ,openaiIntegration:IQ,anthropicIntegration:Rq,googleGenAIIntegration:aY,langChainIntegration:kZ,langGraphIntegration:IZ,vercelAiIntegration:h1,amqplibIntegration:Oq,hapiIntegration:sX,koaIntegration:bX,expressIntegration:V1,graphqlIntegration:HY,kafkajsIntegration:rZ,tediousIntegration:z$,awsIntegration:NJ,firebaseIntegration:t0},S0=`Knex`,C0=Y(S0,()=>new _W),w0=W((()=>({name:S0,setupOnce(){n0()?SZ().setupOnce?.():C0()}}))),T0=`db.sql.table`,E0=`mssql`;function D0(e,t,n,r){return e===`execBulkLoad`&&r&&t?`${e} ${r} ${t}`:e===`callProcedure`?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}var O0=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}},k0=`@sentry/instrumentation-tedious`,A0=Symbol(`opentelemetry.instrumentation-tedious.current-database`),j0=[`callProcedure`,`execSql`,`execSqlBatch`,`execBulkLoad`,`prepare`,`execute`];function M0(e){Object.defineProperty(this,A0,{value:e,writable:!0})}var N0=class e extends q{constructor(e={}){super(k0,k,e)}init(){return[new J(e.COMPONENT,[`>=1.11.0 <20`],e=>{let t=e.Connection.prototype;for(let e of j0)K(t[e])&&this._unwrap(t,e),this._wrap(t,e,this._patchQuery(e));return K(t.connect)&&this._unwrap(t,`connect`),this._wrap(t,`connect`,this._patchConnect),e},e=>{if(e===void 0)return;let t=e.Connection.prototype;for(let e of j0)this._unwrap(t,e);this._unwrap(t,`connect`)})]}_patchConnect(e){return function(){return M0.call(this,this.config?.options?.database),this.removeListener(`databaseChange`,M0),this.on(`databaseChange`,M0),this.once(`end`,()=>{this.removeListener(`databaseChange`,M0)}),e.apply(this,arguments)}}_patchQuery(e){return t=>{let n=this;function r(r){if(!(r instanceof rt))return n._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),t.apply(this,arguments);let i=0,a=0,o=()=>a++,s=()=>i++,c=this[A0],l=(e=>e.sqlTextOrProcedure===`sp_prepare`&&e.parametersByName?.stmt?.value?e.parametersByName.stmt.value:e.sqlTextOrProcedure)(r),u={[I]:`auto.db.otel.tedious`,[Bs]:E0,[Ns]:c,[Hs]:this.config?.userName??this.config?.authentication?.options?.userName,[zs]:l,[T0]:r.table,[Zc]:this.config?.server,[Qc]:this.config?.options?.port},d=B({name:D0(e,c,l,r.table),kind:G.CLIENT,attributes:u}),f=O0(e=>{r.removeListener(`done`,o),r.removeListener(`doneInProc`,o),r.removeListener(`doneProc`,s),r.removeListener(`error`,f),this.removeListener(`end`,f),d.setAttribute(`tedious.procedure_count`,i),d.setAttribute(`tedious.statement_count`,a),e&&d.setStatus({code:2,message:e.message}),d.end()});return r.on(`done`,o),r.on(`doneInProc`,o),r.on(`doneProc`,s),r.once(`error`,f),this.on(`end`,f),typeof r.callback==`function`?n._wrap(r,`callback`,n._patchCallbackQuery(f)):n._diag.error(`Expected request.callback to be a function`),V(d,()=>t.apply(this,arguments))}return Object.defineProperty(r,"length",{value:t.length,writable:!1}),r}}_patchCallbackQuery(e){return t=>function(n,r,i){return e(n),t.apply(this,arguments)}}};N0.COMPONENT=`tedious`;var P0=N0,F0=`Tedious`,I0=Y(F0,()=>new P0({})),L0=W((()=>({name:F0,setupOnce(){I0()}}))),R0=`generic-pool`,z0=`@sentry/instrumentation-generic-pool`,B0=class extends q{constructor(e={}){super(z0,k,e),this._isDisabled=!1}init(){return[new J(R0,[`>=3.0.0 <4`],e=>{let t=e.Pool;return K(t.prototype.acquire)&&this._unwrap(t.prototype,`acquire`),this._wrap(t.prototype,`acquire`,this._acquirePatcher.bind(this)),e},e=>{let t=e.Pool;return this._unwrap(t.prototype,`acquire`),e}),new J(R0,[`>=2.4.0 <3`],e=>{let t=e.Pool;return K(t.prototype.acquire)&&this._unwrap(t.prototype,`acquire`),this._wrap(t.prototype,`acquire`,this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let t=e.Pool;return this._unwrap(t.prototype,`acquire`),e}),new J(R0,[`>=2.0.0 <2.4`],e=>(this._isDisabled=!1,K(e.Pool)&&this._unwrap(e,`Pool`),this._wrap(e,`Pool`,this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){return function(...t){return z({name:`generic-pool.acquire`,attributes:{[I]:`auto.db.otel.generic_pool`}},()=>e.call(this,...t))}}_poolWrapper(e){let t=this._wrap.bind(this),n=this._acquireWithCallbacksPatcher.bind(this);return function(...r){let i=e.apply(this,r);return t(i,`acquire`,n),i}}_acquireWithCallbacksPatcher(e){let t=()=>this._isDisabled;return function(n,r){return t()?e.call(this,n,r):oo({name:`generic-pool.acquire`,attributes:{[I]:`auto.db.otel.generic_pool`}},t=>{e.call(this,(e,r)=>{e&&t.setStatus({code:2,message:`internal_error`}),t.end(),n&&n(e,r)},r)})}}},V0=`GenericPool`,H0=Y(V0,()=>new B0({})),U0=W((()=>({name:V0,setupOnce(){H0()}}))),W0=`dataloader`,G0=`@sentry/instrumentation-dataloader`,K0=`auto.db.otel.dataloader`;function q0(e){return e[Symbol.toStringTag]===`Module`}function J0(e){return q0(e)?e.default:e}function Y0(e,t){let n=e.name;return n?`${W0}.${t} ${n}`:`${W0}.${t}`}function X0(e){if(e===`load`||e===`loadMany`||e===`batch`)return`cache.get`}function Z0(e){return Array.isArray(e)?e.map(e=>String(e)):e==null?void 0:[String(e)]}var Q0=class extends q{constructor(e={}){super(G0,k,e)}init(){return[new J(W0,[`>=2.0.0 <3`],e=>{let t=J0(e);return this._patchLoad(t.prototype),this._patchLoadMany(t.prototype),this._patchPrime(t.prototype),this._patchClear(t.prototype),this._patchClearAll(t.prototype),this._getPatchedConstructor(t)},e=>{let t=J0(e);[`load`,`loadMany`,`prime`,`clear`,`clearAll`].forEach(e=>{K(t.prototype[e])&&this._unwrap(t.prototype,e)})})]}_wrapBatchLoadFn(e){let t=this;return function(...n){return t.isEnabled()?z({name:Y0(this,`batch`),links:this._batch?.spanLinks,attributes:{[I]:K0,[F]:X0(`batch`),[ks]:Z0(n[0])},onlyIfParent:!0},()=>e.apply(this,n)):e.call(this,...n)}}_getPatchedConstructor(e){let t=this,n=e.prototype;if(!t.isEnabled())return e;function r(...n){return typeof n[0]==`function`&&(K(n[0])&&t._unwrap(n,0),n[0]=t._wrapBatchLoadFn(n[0])),e.apply(this,n)}return r.prototype=n,r}_patchLoad(e){K(e.load)&&this._unwrap(e,`load`),this._wrap(e,`load`,this._getPatchedLoad.bind(this))}_getPatchedLoad(e){return function(...t){return z({name:Y0(this,`load`),kind:G.CLIENT,attributes:{[I]:K0,[F]:X0(`load`),[ks]:Z0(t[0])},onlyIfParent:!0},n=>{let r=e.call(this,...t);return this._batch&&n.isRecording()&&(this._batch.spanLinks||(this._batch.spanLinks=[]),this._batch.spanLinks.push({context:n.spanContext()})),r})}}_patchLoadMany(e){K(e.loadMany)&&this._unwrap(e,`loadMany`),this._wrap(e,`loadMany`,this._getPatchedLoadMany.bind(this))}_getPatchedLoadMany(e){return function(...t){return z({name:Y0(this,`loadMany`),kind:G.CLIENT,attributes:{[I]:K0,[F]:X0(`loadMany`),[ks]:Z0(t[0])},onlyIfParent:!0},()=>e.call(this,...t))}}_patchPrime(e){K(e.prime)&&this._unwrap(e,`prime`),this._wrap(e,`prime`,this._getPatchedPrime.bind(this))}_getPatchedPrime(e){return function(...t){return z({name:Y0(this,`prime`),kind:G.CLIENT,attributes:{[I]:K0,[F]:X0(`prime`)},onlyIfParent:!0},()=>e.call(this,...t))}}_patchClear(e){K(e.clear)&&this._unwrap(e,`clear`),this._wrap(e,`clear`,this._getPatchedClear.bind(this))}_getPatchedClear(e){return function(...t){return z({name:Y0(this,`clear`),kind:G.CLIENT,attributes:{[I]:K0,[F]:X0(`clear`)},onlyIfParent:!0},()=>e.call(this,...t))}}_patchClearAll(e){K(e.clearAll)&&this._unwrap(e,`clearAll`),this._wrap(e,`clearAll`,this._getPatchedClearAll.bind(this))}_getPatchedClearAll(e){return function(...t){return z({name:Y0(this,`clearAll`),kind:G.CLIENT,attributes:{[I]:K0,[F]:X0(`clearAll`)},onlyIfParent:!0},()=>e.call(this,...t))}}},$0=`Dataloader`,e2=Y($0,()=>new Q0),t2=W((()=>({name:$0,setupOnce(){n0()?qJ().setupOnce?.():e2()}}))),n2=(e=>(e.AutoAck=`auto ack`,e.Ack=`ack`,e.AckAll=`ackAll`,e.Reject=`reject`,e.Nack=`nack`,e.NackAll=`nackAll`,e.ChannelClosed=`channel closed`,e.ChannelError=`channel error`,e.InstrumentationTimeout=`instrumentation timeout`,e))(n2||{}),r2=`messaging.operation`,i2=`messaging.destination`,a2=`messaging.destination_kind`,o2=`messaging.rabbitmq.routing_key`,s2=`messaging.protocol`,c2=`messaging.protocol_version`,l2=`messaging.url`,u2=`messaging.message_id`,d2=`messaging.conversation_id`,f2=`topic`,p2=`process`;x();var m2=`auto.amqplib.otel.publisher`,h2=`auto.amqplib.otel.consumer`,g2=Symbol(`opentelemetry.amqplib.message.stored-span`),_2=Symbol(`opentelemetry.amqplib.channel.spans-not-ended`),v2=Symbol(`opentelemetry.amqplib.channel.consumer-timeout-timer`),y2=Symbol(`opentelemetry.amqplib.connection.attributes`),b2=Symbol(`sentry.amqplib.channel.is-confirm-publishing`),x2=e=>e===``?`<default>`:e,S2=e=>e.replace(/:[^:@/]*@/,`:***@`),C2=(e,t)=>e||(t===`AMQP`?5672:5671),w2=e=>{let t=e||`amqp`;return(t.endsWith(`:`)?t.substring(0,t.length-1):t).toUpperCase()},T2=e=>e||`localhost`,E2=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[Hc]:t}:{}},D2=e=>{let t={[c2]:`0.9.1`},n=e||`amqp://localhost`;if(typeof n==`object`){let e=n,r=w2(e?.protocol);t[s2]=r,t[Zc]=T2(e?.hostname),t[Qc]=C2(e.port,r)}else{let e=S2(n);t[l2]=e;try{let n=new URL(e),r=w2(n.protocol);t[s2]=r,t[Zc]=T2(n.hostname),t[Qc]=C2(n.port?parseInt(n.port):void 0,r)}catch{}}return t};function O2(e,t){let n=e?.[t];if(n!=null)return String(Array.isArray(n)?n[0]:n)}function k2(e,n,r,i){let a=B({name:`publish ${x2(e)}`,kind:t.PRODUCER,attributes:{...r.connection[y2],[i2]:e,[a2]:f2,[o2]:n,[u2]:i?.messageId,[d2]:i?.correlationId,[I]:m2}}),o=i??{};o.headers=o.headers??{};let s=Tf({span:a});return s[`sentry-trace`]&&(o.headers[`sentry-trace`]=s[`sentry-trace`]),s.baggage&&(o.headers.baggage=s.baggage),{span:a,modifiedOptions:o}}function A2(e,n,r){return B({name:`${e} process`,kind:t.CONSUMER,attributes:{...r?.connection?.[y2],[i2]:n.fields?.exchange,[a2]:f2,[o2]:n.fields?.routingKey,[r2]:p2,[u2]:n?.properties.messageId,[d2]:n?.properties.correlationId,[I]:h2}})}var j2=6e4;function M2(e,t,n,r){let i=e[g2];i&&(t!==!1&&i.setStatus({code:2,message:n!==n2.ChannelClosed&&n!==n2.ChannelError?`${n} called on message${r===!0?` with requeue`:r===!1?` without requeue`:``}`:n}),i.end(),e[g2]=void 0)}function N2(e,t,n,r){(e[_2]??[]).forEach(e=>{M2(e.msg,t,n,r)}),e[_2]=[]}function P2(e){let t=Un(),n=e[_2]??[],r=0;for(;r<n.length;r++){let e=n[r];if((t-e.timeOfConsume)*1e3<j2)break;M2(e.msg,null,n2.InstrumentationTimeout,!0)}n.splice(0,r)}function F2(e){return function(t,n,r){return e.call(this,t,n,function(e,n){if(e==null){let e=D2(t),r=E2(n);n[y2]={...e,...r}}r.apply(this,arguments)})}}function I2(e){return function(t){if(t===`close`){N2(this,!0,n2.ChannelClosed,void 0);let e=this[v2];e&&clearInterval(e),this[v2]=void 0}else t===`error`&&N2(this,!0,n2.ChannelError,void 0);return e.apply(this,arguments)}}function L2(e,t){return n=>function(r){return N2(this,e,t,r),n.apply(this,arguments)}}function R2(e,t){return n=>function(r,i,a){let o=this,s=t===n2.Reject?i:a,c=o[_2]??[],l=c.findIndex(e=>e.msg===r);if(l<0)M2(r,e,t,s);else if(t!==n2.Reject&&i){for(let n=0;n<=l;n++)M2(c[n].msg,e,t,s);c.splice(0,l+1)}else M2(r,e,t,s),c.splice(l,1);return n.apply(this,arguments)}}function z2(e){return function(t,n,r){let i=this;if(!Object.prototype.hasOwnProperty.call(i,_2)){let e=setInterval(()=>{P2(i)},j2);e.unref(),i[v2]=e,i[_2]=[]}let a=function(e){if(!e)return n.call(this,e);let a=e.properties.headers??{};lo({sentryTrace:O2(a,`sentry-trace`),baggage:O2(a,`baggage`)},()=>{let a=A2(t,e,i);r?.noAck||(i[_2].push({msg:e,timeOfConsume:Un()}),e[g2]=a),V(a,()=>{n.call(this,e)}),r?.noAck&&a.end()})},o=Array.prototype.slice.call(arguments);return o[1]=a,e.apply(this,o)}}function B2(e){return function(t,n,r,i,a){let o=this,{span:s,modifiedOptions:c}=k2(t,n,o,i),l=function(e,t){try{V(s,()=>{a?.call(this,e,t)})}finally{e&&s.setStatus({code:2,message:`message confirmation has been nack'ed`}),s.end()}},u=[...arguments];u[3]=c,u[4]=l,o[b2]=!0;try{return e.apply(this,u)}finally{o[b2]=!1}}}function V2(e){return function(t,n,r,i){if(this[b2])return e.apply(this,arguments);let{span:a,modifiedOptions:o}=k2(t,n,this,i),s=[...arguments];s[3]=o;let c=e.apply(this,s);return a.end(),c}}var H2=`@sentry/instrumentation-amqplib`,U2=[`>=0.5.5 <2`],W2=class extends q{constructor(e={}){super(H2,k,e)}init(){let e=new QR(`amqplib/lib/channel_model.js`,U2,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),t=new QR(`amqplib/lib/callback_model.js`,U2,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this));return new J(`amqplib`,U2,void 0,void 0,[e,new QR(`amqplib/lib/connect.js`,U2,this.patchConnect.bind(this),this.unpatchConnect.bind(this)),t])}patchConnect(e){let t=this.unpatchConnect(e);return K(t.connect)||this._wrap(t,`connect`,F2),t}unpatchConnect(e){return K(e.connect)&&this._unwrap(e,`connect`),e}patchChannelModel(e){return K(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,`publish`,V2),K(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,`consume`,z2),K(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,`ack`,R2(!1,n2.Ack)),K(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,`nack`,R2(!0,n2.Nack)),K(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,`reject`,R2(!0,n2.Reject)),K(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,`ackAll`,L2(!1,n2.AckAll)),K(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,`nackAll`,L2(!0,n2.NackAll)),K(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,`emit`,I2),K(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,`publish`,B2),e}unpatchChannelModel(e){return K(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,`publish`),K(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,`consume`),K(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,`ack`),K(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,`nack`),K(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,`reject`),K(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,`ackAll`),K(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,`nackAll`),K(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,`emit`),K(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,`publish`),e}},G2=`Amqplib`,K2=Y(G2,()=>new W2),q2=W((()=>({name:G2,setupOnce(){K2()}}))),J2=`VercelAI`,Y2=[`>=3.0.0 <7`],X2=[`generateText`,`streamText`,`generateObject`,`streamObject`,`embed`,`embedMany`,`rerank`];function Z2(e){if(typeof e!=`object`||!e)return!1;let t=e;return`type`in t&&`error`in t&&`toolName`in t&&`toolCallId`in t&&t.type===`tool-error`&&t.error instanceof Error}function Q2(e){if(typeof e!=`object`||!e||!(`content`in e))return;let t=e;Array.isArray(t.content)&&($2(t.content),e4(t.content))}function $2(e){for(let t of e){if(!Z2(t))continue;let e=L_(t.toolCallId);Er(e?n=>{n.setContext(`trace`,{trace_id:e.traceId,span_id:e.spanId}),n.setTag(`vercel.ai.tool.name`,t.toolName),n.setTag(`vercel.ai.tool.callId`,t.toolCallId),n.setLevel(`error`),H(t.error,{mechanism:{type:`auto.vercelai.otel`,handled:!1}})}:e=>{e.setTag(`vercel.ai.tool.name`,t.toolName),e.setTag(`vercel.ai.tool.callId`,t.toolCallId),e.setLevel(`error`),H(t.error,{mechanism:{type:`auto.vercelai.otel`,handled:!1}})})}}function e4(e){for(let t of e)typeof t==`object`&&t&&`toolCallId`in t&&typeof t.toolCallId==`string`&&R_(t.toolCallId)}function t4(e,t,n,r,i){return{recordInputs:e?.recordInputs===void 0?t.recordInputs===void 0?n===!0||r:t.recordInputs:e.recordInputs,recordOutputs:e?.recordOutputs===void 0?t.recordOutputs===void 0?n===!0||i:t.recordOutputs:e.recordOutputs}}var n4=class extends q{constructor(e={}){super(`@sentry/instrumentation-vercel-ai`,k,e),this._isPatched=!1,this._callbacks=[]}init(){return new J(`ai`,Y2,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(e=>e()),this._callbacks=[];let t=e=>new Proxy(e,{apply:(e,t,n)=>{let r=n[0].experimental_telemetry||{},i=r.isEnabled,a=P(),o=a?.getIntegrationByName(J2),s=o?.options,c=o?a?.getDataCollectionOptions().genAI:void 0,{recordInputs:l,recordOutputs:u}=t4(s,r,i,!!c?.inputs,!!c?.outputs);return n[0].experimental_telemetry={...r,isEnabled:i===void 0||i,recordInputs:l,recordOutputs:u},no(()=>Reflect.apply(e,t,n),e=>{e&&typeof e==`object`&&Jt(e,`_sentry_active_span`,R())},()=>{},e=>{Q2(e)})}});if(Object.prototype.toString.call(e)===`[object Module]`){for(let n of X2)e[n]!=null&&(e[n]=t(e[n]));return e}{let n=X2.reduce((n,r)=>(e[r]!=null&&(n[r]=t(e[r])),n),{});return{...e,...n}}}},r4=Y(J2,()=>new n4({}));function i4(e){return!!e.getIntegrationByName(`Modules`)?.getModules?.()?.ai}var a4=W(((e={})=>{let t;return Mu(qL(e),{options:e,setupOnce(){t=r4()},afterAllSetup(n){e.force??i4(n)?ev(n):t?.callWhenPatched(()=>ev(n))}})})),o4=[`>=4.0.0 <8`],s4=class extends q{constructor(e={}){super(`@sentry/instrumentation-openai`,k,e)}init(){return new J(`openai`,o4,this._patch.bind(this))}_patch(e){let t=e;return t=this._patchClient(t,`OpenAI`),t=this._patchClient(t,`AzureOpenAI`),t}_patchClient(e,t){let n=e[t];if(!n)return e;let r=this.getConfig(),i=function(...e){return tf(`OpenAI`)?Reflect.construct(n,e):Sv(Reflect.construct(n,e),r)};Object.setPrototypeOf(i,n),Object.setPrototypeOf(i.prototype,n.prototype);for(let e of Object.getOwnPropertyNames(n))if(![`length`,`name`,`prototype`].includes(e)){let t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(i,e,t)}try{e[t]=i}catch{Object.defineProperty(e,t,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=i}catch{Object.defineProperty(e,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return e}},c4=Y(av,e=>new s4(e)),l4=W(((e={})=>({name:av,setupOnce(){c4(e)}}))),u4=[`>=0.19.2 <1.0.0`],d4=class extends q{constructor(e={}){super(`@sentry/instrumentation-anthropic-ai`,k,e)}init(){return new J(`@anthropic-ai/sdk`,u4,this._patch.bind(this))}_patch(e){let t=e.Anthropic,n=this.getConfig(),r=function(...e){return tf(`Anthropic_AI`)?Reflect.construct(t,e):Yv(Reflect.construct(t,e),n)};Object.setPrototypeOf(r,t),Object.setPrototypeOf(r.prototype,t.prototype);for(let e of Object.getOwnPropertyNames(t))if(![`length`,`name`,`prototype`].includes(e)){let n=Object.getOwnPropertyDescriptor(t,e);n&&Object.defineProperty(r,e,n)}try{e.Anthropic=r}catch{Object.defineProperty(e,"Anthropic",{value:r,writable:!0,configurable:!0,enumerable:!0})}if(e.default===t)try{e.default=r}catch{Object.defineProperty(e,"default",{value:r,writable:!0,configurable:!0,enumerable:!0})}return e}},f4=Y(Cv,e=>new d4(e)),p4=W(((e={})=>({name:Cv,options:e,setupOnce(){f4(e)}}))),m4=[`>=0.10.0 <2`],h4=class extends q{constructor(e={}){super(`@sentry/instrumentation-google-genai`,k,e)}init(){return new J(`@google/genai`,m4,e=>this._patch(e),e=>e,[new QR(`@google/genai/dist/node/index.cjs`,m4,e=>this._patch(e),e=>e)])}_patch(e){let t=e.GoogleGenAI,n=this.getConfig();if(typeof t!=`function`)return e;let r=function(...e){return tf(`Google_GenAI`)?Reflect.construct(t,e):fy(Reflect.construct(t,e),n)};Object.setPrototypeOf(r,t),Object.setPrototypeOf(r.prototype,t.prototype);for(let e of Object.getOwnPropertyNames(t))if(![`length`,`name`,`prototype`].includes(e)){let n=Object.getOwnPropertyDescriptor(t,e);n&&Object.defineProperty(r,e,n)}return mb(e,`GoogleGenAI`,r),e}},g4=Y(Xv,e=>new h4(e)),_4=W(((e={})=>({name:Xv,setupOnce(){g4(e)}}))),v4=[`>=0.1.0 <2.0.0`];function y4(e,t,n){return new Proxy(e,{apply(e,n,r){let i=r[1];return(!i||typeof i!=`object`||Array.isArray(i))&&(i={},r[1]=i),i.callbacks=Fy(i.callbacks,t),Reflect.apply(e,n,r)}})}var b4=class extends q{constructor(e={}){super(`@sentry/instrumentation-langchain`,k,e)}init(){let e=[];for(let t of[`@langchain/anthropic`,`@langchain/openai`,`@langchain/google-genai`,`@langchain/mistralai`,`@langchain/google-vertexai`,`@langchain/groq`])e.push(new J(t,v4,this._patch.bind(this),e=>e,[new QR(`${t}/dist/index.cjs`,v4,this._patch.bind(this),e=>e)]));return e.push(new J(`langchain`,v4,this._patch.bind(this),e=>e,[new QR(`langchain/dist/chat_models/universal.cjs`,v4,this._patch.bind(this),e=>e)])),e}_patch(e){ef([av,Cv,Xv]);let t=this.getConfig(),n=Iy(t);return this._patchRunnableMethods(e,n),this._patchEmbeddingsMethods(e,t),e}_patchRunnableMethods(e,t){let n=[`ChatAnthropic`,`ChatOpenAI`,`ChatGoogleGenerativeAI`,`ChatMistralAI`,`ChatVertexAI`,`ChatGroq`,`ConfigurableModel`],r=e.universal_exports??e,i=Object.values(r).find(e=>typeof e==`function`&&n.includes(e.name));if(!i)return;let a=i.prototype;if(!a.__sentry_patched__){a.__sentry_patched__=!0;for(let e of[`invoke`,`stream`,`batch`]){let n=a[e];typeof n==`function`&&(a[e]=y4(n,t))}}}_patchEmbeddingsMethods(e,t){let n=e.universal_exports??e;for(let e of Object.values(n)){if(typeof e!=`function`||!e.prototype)continue;let n=e.prototype;typeof n.embedQuery==`function`&&typeof n.embedDocuments==`function`&&(n.__sentry_patched__||(n.__sentry_patched__=!0,Vy(n,t)))}}},x4=Y(py,e=>new b4(e)),S4=W(((e={})=>({name:py,setupOnce(){x4(e)}}))),C4=[`>=0.0.0 <2.0.0`],w4=class extends q{constructor(e={}){super(`@sentry/instrumentation-langgraph`,k,e)}init(){return[new J(`@langchain/langgraph`,C4,this._patch.bind(this),e=>e,[new QR(`@langchain/langgraph/dist/index.cjs`,C4,this._patch.bind(this),e=>e),new QR(`@langchain/langgraph/dist/prebuilt/index.cjs`,C4,this._patch.bind(this),e=>e)]),new J(`@langchain/langgraph/prebuilt`,C4,this._patch.bind(this),e=>e,[new QR(`@langchain/langgraph/dist/prebuilt/index.cjs`,C4,this._patch.bind(this),e=>e)])]}_patch(e){let t=P()?.getDataCollectionOptions().genAI,n={...this.getConfig(),recordInputs:this.getConfig().recordInputs??t?.inputs??!1,recordOutputs:this.getConfig().recordOutputs??t?.outputs??!1};if(e.StateGraph&&typeof e.StateGraph==`function`&&ib(e.StateGraph.prototype,n),e.createReactAgent&&typeof e.createReactAgent==`function`){let t=e.createReactAgent;Object.defineProperty(e,"createReactAgent",{value:rb(t,n),writable:!0,enumerable:!0,configurable:!0})}return e}},T4=Y(Hy,e=>new w4(e)),E4=W(((e={})=>({name:Hy,setupOnce(){T4(e)}}))),D4=W(e=>(Vu()||ut(()=>{console.warn(`The launchDarklyIntegration() can only be used in the browser.`)}),{name:`LaunchDarkly`}));function O4(){return Vu()||ut(()=>{console.warn(`The buildLaunchDarklyFlagUsedHandler() can only be used in the browser.`)}),{name:`sentry-flag-auditor`,type:`flag-used`,synchronous:!0,method:()=>null}}var k4=W(e=>(Vu()||ut(()=>{console.warn(`The openFeatureIntegration() can only be used in the browser.`)}),{name:`OpenFeature`})),A4=class{constructor(){Vu()||ut(()=>{console.warn(`The OpenFeatureIntegrationHook can only be used in the browser.`)})}after(){}error(){}},j4=W(e=>(Vu()||ut(()=>{console.warn(`The statsigIntegration() can only be used in the browser.`)}),{name:`Statsig`})),M4=W(e=>(Vu()||ut(()=>{console.warn(`The unleashIntegration() can only be used in the browser.`)}),{name:`Unleash`})),N4=$m;function P4(e,t,n){let r=new J(`@firebase/firestore`,e,e=>F4(e,t,n));for(let i of[`@firebase/firestore/dist/lite/index.node.cjs.js`,`@firebase/firestore/dist/lite/index.node.mjs.js`,`@firebase/firestore/dist/lite/index.rn.esm2017.js`,`@firebase/firestore/dist/lite/index.cjs.js`])r.files.push(new QR(i,e,e=>F4(e,t,n),e=>I4(e,n)));return r}function F4(e,t,n){return I4(e,n),t(e,`addDoc`,L4()),t(e,`getDocs`,z4()),t(e,`setDoc`,B4()),t(e,`deleteDoc`,R4()),e}function I4(e,t){for(let n of[`addDoc`,`getDocs`,`setDoc`,`deleteDoc`])K(e[n])&&t(e,n);return e}function L4(){return function(e){return function(t,n){return V4(`addDoc`,t,()=>e(t,n))}}}function R4(){return function(e){return function(t){return V4(`deleteDoc`,t.parent||t,()=>e(t))}}}function z4(){return function(e){return function(t){return V4(`getDocs`,t,()=>e(t))}}}function B4(){return function(e){return function(t,n,r){return V4(`setDoc`,t.parent||t,()=>r===void 0?e(t,n):e(t,n,r))}}}function V4(e,t,n){return z({name:`${e} ${t.path}`,op:`db.query`,kind:G.CLIENT,attributes:{[I]:`auto.firebase.otel.firestore`,[Ls]:e,...U4(t)}},n)}function H4(e){let t,n;if(typeof e.host==`string`){if(e.host.startsWith(`[`)){if(e.host.endsWith(`]`))t=e.host.replace(/^\[|\]$/g,``);else if(e.host.includes(`]:`)){let r=e.host.lastIndexOf(`:`);r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,``),n=e.host.slice(r+1))}}else if(Be.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(`:`);r===-1?t=e.host:(t=e.host.slice(0,r),n=e.host.slice(r+1))}}return{address:t,port:n?parseInt(n,10):void 0}}function U4(e){let t=e.firestore.app,n=t.options,r=(e.firestore.toJSON()||{}).settings||{},i={[Ms]:e.path,[Ps]:t.name,[Vs]:`firebase.firestore`,"firebase.firestore.type":e.type,"firebase.firestore.options.projectId":n.projectId,"firebase.firestore.options.appId":n.appId,"firebase.firestore.options.messagingSenderId":n.messagingSenderId,"firebase.firestore.options.storageBucket":n.storageBucket},{address:a,port:o}=H4(r);return a&&(i[fl]=a),o&&(i[pl]=o),i}function W4(e,t,n){let r=new J(`firebase-functions`,e);return[{name:`firebase-functions/lib/v2/providers/https.js`,triggerType:`function`},{name:`firebase-functions/lib/v2/providers/firestore.js`,triggerType:`firestore`},{name:`firebase-functions/lib/v2/providers/scheduler.js`,triggerType:`scheduler`},{name:`firebase-functions/lib/v2/storage.js`,triggerType:`storage`}].forEach(({name:i,triggerType:a})=>{r.files.push(new QR(i,e,e=>K4(e,t,n,a),e=>q4(e,n)))}),r}function G4(e){return function(t){return function(...n){let r=typeof n[0]==`function`?n[0]:n[1],i=typeof n[0]==`function`?void 0:n[0];if(!r)return t.call(this,...n);let a=async function(...t){let n=process.env.FUNCTION_TARGET||process.env.K_SERVICE||`unknown`,i={[I]:`auto.firebase.otel.functions`,"faas.name":n,"faas.trigger":e,"faas.provider":`firebase`};return process.env.GCLOUD_PROJECT&&(i[`cloud.project_id`]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(i[`cloud.event_source`]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),oo({name:`firebase.function.${e}`,op:`http.request`,kind:G.SERVER,attributes:i},async e=>{try{let n=await r.apply(this,t);return e.end(),n}catch(t){throw e.setStatus({code:2}),H(t,{mechanism:{type:`auto.firebase.otel.functions`,handled:!1}}),e.end(),await lu(2e3),t}})};return i?t.call(this,i,a):t.call(this,a)}}}function K4(e,t,n,r){switch(q4(e,n),r){case`function`:t(e,`onRequest`,G4(`http.request`)),t(e,`onCall`,G4(`http.call`));break;case`firestore`:t(e,`onDocumentCreated`,G4(`firestore.document.created`)),t(e,`onDocumentUpdated`,G4(`firestore.document.updated`)),t(e,`onDocumentDeleted`,G4(`firestore.document.deleted`)),t(e,`onDocumentWritten`,G4(`firestore.document.written`)),t(e,`onDocumentCreatedWithAuthContext`,G4(`firestore.document.created`)),t(e,`onDocumentUpdatedWithAuthContext`,G4(`firestore.document.updated`)),t(e,`onDocumentDeletedWithAuthContext`,G4(`firestore.document.deleted`)),t(e,`onDocumentWrittenWithAuthContext`,G4(`firestore.document.written`));break;case`scheduler`:t(e,`onSchedule`,G4(`scheduler.scheduled`));break;case`storage`:t(e,`onObjectFinalized`,G4(`storage.object.finalized`)),t(e,`onObjectArchived`,G4(`storage.object.archived`)),t(e,`onObjectDeleted`,G4(`storage.object.deleted`)),t(e,`onObjectMetadataUpdated`,G4(`storage.object.metadataUpdated`))}return e}function q4(e,t){for(let n of[`onSchedule`,`onRequest`,`onCall`,`onObjectFinalized`,`onObjectArchived`,`onObjectDeleted`,`onObjectMetadataUpdated`,`onDocumentCreated`,`onDocumentUpdated`,`onDocumentDeleted`,`onDocumentWritten`,`onDocumentCreatedWithAuthContext`,`onDocumentUpdatedWithAuthContext`,`onDocumentDeletedWithAuthContext`,`onDocumentWrittenWithAuthContext`])K(e[n])&&t(e,n);return e}var J4=[`>=3.0.0 <5`],Y4=[`>=6.0.0 <7`],X4=class extends q{constructor(e={}){super(`@sentry/instrumentation-firebase`,k,e)}init(){let e=[];return e.push(P4(J4,this._wrap,this._unwrap)),e.push(W4(Y4,this._wrap,this._unwrap)),e}},Z4=`Firebase`,Q4=Y(Z4,()=>new X4),$4=W((()=>({name:Z4,setupOnce(){Q4()}})));function e3(){return[DP(),XR(),Rz(),CU(),OB(),KB(),iV(),xV(),dH(),RH(),RI(),uU(),LU(),XU(),L0(),U0(),oB(),q2(),dB(),S4(),E4(),a4(),l4(),p4(),_4(),KH(),$4()]}function t3(){return[GN,TP,YU,qR,lU,SU,aB,IU,uB,DB,GB,rV,bV,LH,lU,Lz,uH,I0,H0,K2,x4,r4,c4,WH,Q4,f4,g4,T4]}x();var n3=1e6,r3=Symbol.for(`opentelemetry.js.api.1`);function i3(e){if(_.setGlobalTracerProvider(e))return!0;let t=globalThis,n=t[r3];if(n&&!n.trace){if(bP&&A.warn("Replaced a pre-existing OpenTelemetry API registry that was created by a different @opentelemetry/api version and would have blocked tracing. If you want to manage OpenTelemetry yourself, set `skipOpenTelemetrySetup: true` in `Sentry.init()`."),t[r3]=void 0,!_.setGlobalTracerProvider(e))return!1;let r=t[r3];if(r){let{propagation:e,context:i,...a}=n;t[r3]={...a,...r}}return!0}return!1}function a3(e,t={}){e.getOptions().debug&&jA();let[n,r]=c3(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function o3(e={}){let{debug:t}=e;t&&A.enable(),VM(),s3(e.integrations).forEach(e=>{e(),t&&A.log(`[Sentry] Preloaded ${e.id} instrumentation`)})}function s3(e){let t=t3();return e?t.filter(t=>{let n=t.id;return e.some(e=>n===e||n.startsWith(`${e}.`))}):t}function c3(e,t={}){if(!(e.getOptions().openTelemetryBasicTracerProvider||t.spanProcessors?.length))return l3(e);let n=new aO({sampler:new iA(e),resource:xA(`node`),forceFlushTimeoutMillis:500,spanProcessors:[new rA({timeout:u3(e.getOptions().maxSpanWaitDuration),client:e}),...t.spanProcessors||[]]});i3(n),p.setGlobalPropagator(new lk);let r=new AA;return l.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function l3(e){let t=new mA({resource:xA(`node`)});if(!i3(t))return bP&&A.warn(`Could not register SentryTracerProvider because another OpenTelemetry tracer provider is already registered.`),[void 0,void 0];ck(`SentryTracerProvider`),p.setGlobalPropagator(new lk);let n=new AA;return l.setGlobalContextManager(n),e.on(`spanEnd`,e=>{lA(e,{finalizeStatus:!0})}),Ya(e)&&e.on(`preprocessSpan`,nA),e.on(`preprocessEvent`,e=>{e.type===`transaction`&&(e.contexts={...e.contexts,otel:{resource:t.resource?.attributes,...e.contexts?.otel}})}),[t,n.getAsyncLocalStorageLookup()]}function u3(e){if(e!=null){if(e>n3)return bP&&A.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${n3}`),n3;if(e<=0||Number.isNaN(e)){bP&&A.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}function d3(){return HM().filter(e=>e.name!==`Http`&&e.name!==`NodeFetch`).concat(KN(),qN())}function f3(e){return[...d3(),...sa(e)?e3():[]]}function p3(e,t){if(TV()&&sa(t)){let t=EV();if(t){let n=new Set(t.replacedOtelIntegrationNames);return[...e.filter(e=>!n.has(e.name)),...t.integrations]}}return e}function m3(e={}){return h3(e,f3)}function h3(e={},t){wf(e,`node`);let n=TV()&&sa(e)?EV():void 0;n&&n.register();let r=e.defaultIntegrations??t(e);if(n&&Array.isArray(r)&&r.length>0){let e=new Set(n.replacedOtelIntegrationNames);r=[...r.filter(t=>!e.has(t.name)),...n.integrations]}let i=UM({...e,defaultIntegrations:r});return i&&!e.skipOpenTelemetrySetup&&(a3(i,{spanProcessors:e.openTelemetrySpanProcessors}),GM()),n&&n.detect(),i}function g3(e={}){return h3(e,()=>[])}var _3=[...xW,...wW,...DW,...jW,...PW,...HW,...GW,...YW,...QW,...tG,...iG,...sG,...gG,...yG,...DG,...PG,...LG,...VG,...KG,...XG,...$G,...rK,...oK,...lK,...fK,...hK,...vK,...wK,...DK];[...CW,...EW,...kW,...NW,...IW,...WW,...qW,...ZW,...eG,...rG,...oG,...lG,...vG,...xG,...AG,...IG,...zG,...UG,...YG,...QG,...tK,...aK,...cK,...dK,...mK,..._K,...bK,...EK,...AK];function v3(e=[]){return[...jf([..._3,...e].map(e=>e.module.name)),`@remix-run/node`]}v3();function y3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var b3=x3;function x3(e,t){let[n]=k3(e,``);for(let e of w3(t))if(S3(e,n))return!0;return!1}function S3(e,t){for(let[n,r]of e)if(!A3(t,r,n))return!1;return!0}function C3(e){return e===`latest`&&(e=`>=0`),e.match(/^([^\d+]*)(\d.*)$/)||[null,``,`*.*.*`]}function w3(e){let t=[],n=[],r=e.trim().split(/\s+/);for(let e=0;e<r.length;e++){let i=r[e];if(i===`-`)continue;if(i===`||`){t.push(n),n=[];continue}if(/^[<>=~v^]+$/.test(i)&&e+1<r.length){r[e+1]=i+r[e+1];continue}let a=C3(i),o=a[1]||`=`;o.endsWith(`v`)&&(o=o.slice(0,-1));let[s,c]=k3(a[2],o);if(e+2<r.length&&r[e+1]===`-`){let t=C3(r[e+2]);r[e+2]=`<=`+(t[2].indexOf(`-`)===-1?t[2]+`.*.*`:t[2]),c=`>=`}if(c[0]===`~`){let e=a[2].split(`-`)[0].split(`.`).length;n.push([`>=`,s]),n.push([`<`,e===1?T3(s,0):T3(s,1)])}else if(c[0]===`^`){let e=s[0]===0?s[1]===0?2:1:0;n.push([`>=`,s]),n.push([`<`,e===0?T3(s,0):e===1?T3(s,1):T3(s,2)])}else n.push([c.replace(`~`,``).replace(`^`,``),s])}return n.length&&t.push(n),t}function T3(e,t){let n=e.slice(0);if(e[t]===-1)return n;for(n[t++]++;t<3;t++)n[t]=0;return n}function E3(e){return e===`x`||e===`X`||e===`*`||e===`latest`?-1:Number(e)}function D3(e){return/^\d+$/.test(e)?Number(e):e}function O3(e,t,n){return n===-1?e!==`<`:e===`=`?t===n:e===`>`?t>n:e===`>=`?t>=n:e===`<`?t<n:e===`<=`&&t<=n}function k3(e,t){e=e.split(`+`)[0];let[n,r]=e.split(`-`),i=n.split(`.`).map(E3).slice(0,3),a=Math.max(i.length-1,0);return t===`>`?(t=`>=`,i.push(0,0,0),i[a]++):t===``?i.push(0,0,0):i.push(-1,-1,-1),r?[i.slice(0,3).concat(r.split(`.`).map(D3)),t]:[i.slice(0,3),t]}function A3(e,t,n){if(!O3(`=`,e[0],t[0]))return O3(n,e[0],t[0]);if(!O3(`=`,e[1],t[1]))return O3(n,e[1],t[1]);if(!O3(`=`,e[2],t[2])||e.length===3&&t.length===3)return O3(n,e[2],t[2]);if(n[0]===`<`&&(t.length===3||e.length===3))return!1;if(n[0]===`>`){if(e.length===3)return!0;if(t.length===3)return!1}for(let r=3;r<Math.max(e.length,t.length);r++)if(O3(n,e[r]||``,t[r]||``))return!0;return!1}function j3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function M3(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}})(e,t)||F3(e,t)||(function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
32
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function N3(e){return(function(e){if(Array.isArray(e))return j3(e)})(e)||(function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)})(e)||F3(e)||(function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
33
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function P3(e){return(P3=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e})(e)}function F3(e,t){if(e){if(typeof e==`string`)return j3(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j3(e,t):void 0}}function I3(e,t){return e(t={exports:{}},t.exports),t.exports}var L3=I3((function(e,t){(function e(t){var n,r,i,a,o,s;function c(e){var t,n,r={};for(t in e)e.hasOwnProperty(t)&&(n=e[t],r[t]=typeof n==`object`&&n?c(n):n);return r}function l(e,t){this.parent=e,this.key=t}function u(e,t,n,r){this.node=e,this.path=t,this.wrap=n,this.ref=r}function d(){}function f(e){return typeof e==`object`&&!!e&&typeof e.type==`string`}function p(e,t){return(e===n.ObjectExpression||e===n.ObjectPattern)&&t===`properties`}function m(e,t){for(var n=e.length-1;n>=0;--n)if(e[n].node===t)return!0;return!1}function h(e,t){return new d().traverse(e,t)}function g(e,t){var n=(function(e,t){for(var n,r=e.length,i=0,a;r;)t(e[a=i+(n=r>>>1)])?r=n:(i=a+1,r-=n+1);return i})(t,(function(t){return t.range[0]>e.range[0]}));return e.extendedRange=[e.range[0],e.range[1]],n!==t.length&&(e.extendedRange[1]=t[n].range[0]),--n>=0&&(e.extendedRange[0]=t[n].range[1]),e}return n={AssignmentExpression:`AssignmentExpression`,AssignmentPattern:`AssignmentPattern`,ArrayExpression:`ArrayExpression`,ArrayPattern:`ArrayPattern`,ArrowFunctionExpression:`ArrowFunctionExpression`,AwaitExpression:`AwaitExpression`,BlockStatement:`BlockStatement`,BinaryExpression:`BinaryExpression`,BreakStatement:`BreakStatement`,CallExpression:`CallExpression`,CatchClause:`CatchClause`,ChainExpression:`ChainExpression`,ClassBody:`ClassBody`,ClassDeclaration:`ClassDeclaration`,ClassExpression:`ClassExpression`,ComprehensionBlock:`ComprehensionBlock`,ComprehensionExpression:`ComprehensionExpression`,ConditionalExpression:`ConditionalExpression`,ContinueStatement:`ContinueStatement`,DebuggerStatement:`DebuggerStatement`,DirectiveStatement:`DirectiveStatement`,DoWhileStatement:`DoWhileStatement`,EmptyStatement:`EmptyStatement`,ExportAllDeclaration:`ExportAllDeclaration`,ExportDefaultDeclaration:`ExportDefaultDeclaration`,ExportNamedDeclaration:`ExportNamedDeclaration`,ExportSpecifier:`ExportSpecifier`,ExpressionStatement:`ExpressionStatement`,ForStatement:`ForStatement`,ForInStatement:`ForInStatement`,ForOfStatement:`ForOfStatement`,FunctionDeclaration:`FunctionDeclaration`,FunctionExpression:`FunctionExpression`,GeneratorExpression:`GeneratorExpression`,Identifier:`Identifier`,IfStatement:`IfStatement`,ImportExpression:`ImportExpression`,ImportDeclaration:`ImportDeclaration`,ImportDefaultSpecifier:`ImportDefaultSpecifier`,ImportNamespaceSpecifier:`ImportNamespaceSpecifier`,ImportSpecifier:`ImportSpecifier`,Literal:`Literal`,LabeledStatement:`LabeledStatement`,LogicalExpression:`LogicalExpression`,MemberExpression:`MemberExpression`,MetaProperty:`MetaProperty`,MethodDefinition:`MethodDefinition`,ModuleSpecifier:`ModuleSpecifier`,NewExpression:`NewExpression`,ObjectExpression:`ObjectExpression`,ObjectPattern:`ObjectPattern`,PrivateIdentifier:`PrivateIdentifier`,Program:`Program`,Property:`Property`,PropertyDefinition:`PropertyDefinition`,RestElement:`RestElement`,ReturnStatement:`ReturnStatement`,SequenceExpression:`SequenceExpression`,SpreadElement:`SpreadElement`,Super:`Super`,SwitchStatement:`SwitchStatement`,SwitchCase:`SwitchCase`,TaggedTemplateExpression:`TaggedTemplateExpression`,TemplateElement:`TemplateElement`,TemplateLiteral:`TemplateLiteral`,ThisExpression:`ThisExpression`,ThrowStatement:`ThrowStatement`,TryStatement:`TryStatement`,UnaryExpression:`UnaryExpression`,UpdateExpression:`UpdateExpression`,VariableDeclaration:`VariableDeclaration`,VariableDeclarator:`VariableDeclarator`,WhileStatement:`WhileStatement`,WithStatement:`WithStatement`,YieldExpression:`YieldExpression`},i={AssignmentExpression:[`left`,`right`],AssignmentPattern:[`left`,`right`],ArrayExpression:[`elements`],ArrayPattern:[`elements`],ArrowFunctionExpression:[`params`,`body`],AwaitExpression:[`argument`],BlockStatement:[`body`],BinaryExpression:[`left`,`right`],BreakStatement:[`label`],CallExpression:[`callee`,`arguments`],CatchClause:[`param`,`body`],ChainExpression:[`expression`],ClassBody:[`body`],ClassDeclaration:[`id`,`superClass`,`body`],ClassExpression:[`id`,`superClass`,`body`],ComprehensionBlock:[`left`,`right`],ComprehensionExpression:[`blocks`,`filter`,`body`],ConditionalExpression:[`test`,`consequent`,`alternate`],ContinueStatement:[`label`],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:[`body`,`test`],EmptyStatement:[],ExportAllDeclaration:[`source`],ExportDefaultDeclaration:[`declaration`],ExportNamedDeclaration:[`declaration`,`specifiers`,`source`],ExportSpecifier:[`exported`,`local`],ExpressionStatement:[`expression`],ForStatement:[`init`,`test`,`update`,`body`],ForInStatement:[`left`,`right`,`body`],ForOfStatement:[`left`,`right`,`body`],FunctionDeclaration:[`id`,`params`,`body`],FunctionExpression:[`id`,`params`,`body`],GeneratorExpression:[`blocks`,`filter`,`body`],Identifier:[],IfStatement:[`test`,`consequent`,`alternate`],ImportExpression:[`source`],ImportDeclaration:[`specifiers`,`source`],ImportDefaultSpecifier:[`local`],ImportNamespaceSpecifier:[`local`],ImportSpecifier:[`imported`,`local`],Literal:[],LabeledStatement:[`label`,`body`],LogicalExpression:[`left`,`right`],MemberExpression:[`object`,`property`],MetaProperty:[`meta`,`property`],MethodDefinition:[`key`,`value`],ModuleSpecifier:[],NewExpression:[`callee`,`arguments`],ObjectExpression:[`properties`],ObjectPattern:[`properties`],PrivateIdentifier:[],Program:[`body`],Property:[`key`,`value`],PropertyDefinition:[`key`,`value`],RestElement:[`argument`],ReturnStatement:[`argument`],SequenceExpression:[`expressions`],SpreadElement:[`argument`],Super:[],SwitchStatement:[`discriminant`,`cases`],SwitchCase:[`test`,`consequent`],TaggedTemplateExpression:[`tag`,`quasi`],TemplateElement:[],TemplateLiteral:[`quasis`,`expressions`],ThisExpression:[],ThrowStatement:[`argument`],TryStatement:[`block`,`handler`,`finalizer`],UnaryExpression:[`argument`],UpdateExpression:[`argument`],VariableDeclaration:[`declarations`],VariableDeclarator:[`id`,`init`],WhileStatement:[`test`,`body`],WithStatement:[`object`,`body`],YieldExpression:[`argument`]},r={Break:a={},Skip:o={},Remove:s={}},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},d.prototype.path=function(){var e,t,n,r,i;function a(e,t){if(Array.isArray(t))for(n=0,r=t.length;n<r;++n)e.push(t[n]);else e.push(t)}if(!this.__current.path)return null;for(i=[],e=2,t=this.__leavelist.length;e<t;++e)a(i,this.__leavelist[e].path);return a(i,this.__current.path),i},d.prototype.type=function(){return this.current().type||this.__current.wrap},d.prototype.parents=function(){var e,t,n=[];for(e=1,t=this.__leavelist.length;e<t;++e)n.push(this.__leavelist[e].node);return n},d.prototype.current=function(){return this.__current.node},d.prototype.__execute=function(e,t){var n,r=void 0;return n=this.__current,this.__current=t,this.__state=null,e&&(r=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=n,r},d.prototype.notify=function(e){this.__state=e},d.prototype.skip=function(){this.notify(o)},d.prototype.break=function(){this.notify(a)},d.prototype.remove=function(){this.notify(s)},d.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,t.fallback===`iteration`?this.__fallback=Object.keys:typeof t.fallback==`function`&&(this.__fallback=t.fallback),this.__keys=i,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys))},d.prototype.traverse=function(e,t){var n,r,i,s,c,l,d,h,g,_,v,y;for(this.__initialize(e,t),y={},n=this.__worklist,r=this.__leavelist,n.push(new u(e,null,null,null)),r.push(new u(null,null,null,null));n.length;)if((i=n.pop())!==y){if(i.node){if(l=this.__execute(t.enter,i),this.__state===a||l===a)return;if(n.push(y),r.push(i),this.__state===o||l===o)continue;if(c=(s=i.node).type||i.wrap,!(_=this.__keys[c])){if(!this.__fallback)throw Error(`Unknown node type `+c+`.`);_=this.__fallback(s)}for(h=_.length;--h>=0;)if(v=s[d=_[h]]){if(Array.isArray(v)){for(g=v.length;--g>=0;)if(v[g]&&!m(r,v[g])){if(p(c,_[h]))i=new u(v[g],[d,g],`Property`,null);else{if(!f(v[g]))continue;i=new u(v[g],[d,g],null,null)}n.push(i)}}else if(f(v)){if(m(r,v))continue;n.push(new u(v,d,null,null))}}}}else if(i=r.pop(),l=this.__execute(t.leave,i),this.__state===a||l===a)return},d.prototype.replace=function(e,t){var n,r,i,c,d,m,h,g,_,v,y,ee,b;function te(e){var t,r,i,a;if(e.ref.remove()){for(r=e.ref.key,a=e.ref.parent,t=n.length;t--;)if((i=n[t]).ref&&i.ref.parent===a){if(i.ref.key<r)break;--i.ref.key}}}for(this.__initialize(e,t),y={},n=this.__worklist,r=this.__leavelist,m=new u(e,null,null,new l(ee={root:e},`root`)),n.push(m),r.push(m);n.length;)if((m=n.pop())!==y){if((d=this.__execute(t.enter,m))!==void 0&&d!==a&&d!==o&&d!==s&&(m.ref.replace(d),m.node=d),this.__state!==s&&d!==s||(te(m),m.node=null),this.__state===a||d===a)return ee.root;if((i=m.node)&&(n.push(y),r.push(m),this.__state!==o&&d!==o)){if(c=i.type||m.wrap,!(_=this.__keys[c])){if(!this.__fallback)throw Error(`Unknown node type `+c+`.`);_=this.__fallback(i)}for(h=_.length;--h>=0;)if(v=i[b=_[h]]){if(Array.isArray(v)){for(g=v.length;--g>=0;)if(v[g]){if(p(c,_[h]))m=new u(v[g],[b,g],`Property`,new l(v,g));else{if(!f(v[g]))continue;m=new u(v[g],[b,g],null,new l(v,g))}n.push(m)}}else f(v)&&n.push(new u(v,b,null,new l(i,b)))}}}else if(m=r.pop(),(d=this.__execute(t.leave,m))!==void 0&&d!==a&&d!==o&&d!==s&&m.ref.replace(d),this.__state!==s&&d!==s||te(m),this.__state===a||d===a)return ee.root;return ee.root},t.Syntax=n,t.traverse=h,t.replace=function(e,t){return new d().replace(e,t)},t.attachComments=function(e,t,n){var i,a,o,s,l=[];if(!e.range)throw Error(`attachComments needs range information`);if(!n.length){if(t.length){for(o=0,a=t.length;o<a;o+=1)(i=c(t[o])).extendedRange=[0,e.range[0]],l.push(i);e.leadingComments=l}return e}for(o=0,a=t.length;o<a;o+=1)l.push(g(c(t[o]),n));return s=0,h(e,{enter:function(e){for(var t;s<l.length&&!((t=l[s]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||=[],e.leadingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?r.Break:l[s].extendedRange[0]>e.range[1]?r.Skip:void 0}}),s=0,h(e,{leave:function(e){for(var t;s<l.length&&(t=l[s],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||=[],e.trailingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?r.Break:l[s].extendedRange[0]>e.range[1]?r.Skip:void 0}}),e},t.VisitorKeys=i,t.VisitorOption=r,t.Controller=d,t.cloneEnvironment=function(){return e({})},t})(t)})),R3=I3((function(e){e.exports&&=(function(){function e(t,n,r,i){this.message=t,this.expected=n,this.found=r,this.location=i,this.name=`SyntaxError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e)}return(function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n})(e,Error),e.buildMessage=function(e,t){var n={literal:function(e){return`"`+i(e.text)+`"`},class:function(e){var t,n=``;for(t=0;t<e.parts.length;t++)n+=e.parts[t]instanceof Array?a(e.parts[t][0])+`-`+a(e.parts[t][1]):a(e.parts[t]);return`[`+(e.inverted?`^`:``)+n+`]`},any:function(e){return`any character`},end:function(e){return`end of input`},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\0/g,`\\0`).replace(/\t/g,`\\t`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/[\x00-\x0F]/g,(function(e){return`\\x0`+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return`\\x`+r(e)}))}function a(e){return e.replace(/\\/g,`\\\\`).replace(/\]/g,`\\]`).replace(/\^/g,`\\^`).replace(/-/g,`\\-`).replace(/\0/g,`\\0`).replace(/\t/g,`\\t`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/[\x00-\x0F]/g,(function(e){return`\\x0`+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return`\\x`+r(e)}))}return`Expected `+(function(e){var t,r,i,a=Array(e.length);for(t=0;t<e.length;t++)a[t]=(i=e[t],n[i.type](i));if(a.sort(),a.length>0){for(t=1,r=1;t<a.length;t++)a[t-1]!==a[t]&&(a[r]=a[t],r++);a.length=r}switch(a.length){case 1:return a[0];case 2:return a[0]+` or `+a[1];default:return a.slice(0,-1).join(`, `)+`, or `+a[a.length-1]}})(e)+` but `+(function(e){return e?`"`+i(e)+`"`:`end of input`})(t)+` found.`},{SyntaxError:e,parse:function(t,n){n=n===void 0?{}:n;var r,i,a,o,s={},c={start:Je},l=Je,u=We(` `,!1),d=/^[^ [\],():#!=><~+.]/,f=Ge([` `,`[`,`]`,`,`,`(`,`)`,`:`,`#`,`!`,`=`,`>`,`<`,`~`,`+`,`.`],!0,!1),p=We(`>`,!1),m=We(`~`,!1),h=We(`+`,!1),g=We(`,`,!1),_=function(e,t){return[e].concat(t.map((function(e){return e[3]})))},v=We(`!`,!1),y=We(`*`,!1),ee=We(`#`,!1),b=We(`[`,!1),te=We(`]`,!1),x=/^[><!]/,ne=Ge([`>`,`<`,`!`],!1,!1),re=We(`=`,!1),ie=function(e){return(e||``)+`=`},ae=/^[><]/,oe=Ge([`>`,`<`],!1,!1),se=We(`.`,!1),ce=function(e,t,n){return{type:`attribute`,name:e,operator:t,value:n}},le=We(`"`,!1),ue=/^[^\\"]/,de=Ge([`\\`,`"`],!0,!1),fe=We(`\\`,!1),pe={type:`any`},me=function(e,t){return e+t},he=function(e){return{type:`literal`,value:(t=e.join(``),t.replace(/\\(.)/g,(function(e,t){switch(t){case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
|
|
34
|
-
`;case`r`:return`\r`;case`t`:return` `;case`v`:return`\v`;default:return t}})))};var t},ge=We(`'`,!1),_e=/^[^\\']/,ve=Ge([`\\`,`'`],!0,!1),ye=/^[0-9]/,be=Ge([[`0`,`9`]],!1,!1),xe=We(`type(`,!1),Se=/^[^ )]/,Ce=Ge([` `,`)`],!0,!1),we=We(`)`,!1),Te=/^[imsu]/,Ee=Ge([`i`,`m`,`s`,`u`],!1,!1),De=We(`/`,!1),Oe=/^[^\]\\]/,ke=Ge([`]`,`\\`],!0,!1),Ae=/^[^\/\\[]/,je=Ge([`/`,`\\`,`[`],!0,!1),Me=We(`:not(`,!1),Ne=We(`:matches(`,!1),Pe=function(e){return{type:`matches`,selectors:e}},Fe=We(`:is(`,!1),Ie=We(`:has(`,!1),Le=We(`:first-child`,!1),Re=We(`:last-child`,!1),ze=We(`:nth-child(`,!1),Be=We(`:nth-last-child(`,!1),Ve=We(`:`,!1),S=0,C=[{line:1,column:1}],He=0,Ue=[],w={};if(`startRule`in n){if(!(n.startRule in c))throw Error(`Can't start parsing from rule "`+n.startRule+`".`);l=c[n.startRule]}function We(e,t){return{type:`literal`,text:e,ignoreCase:t}}function Ge(e,t,n){return{type:`class`,parts:e,inverted:t,ignoreCase:n}}function Ke(e){var n,r=C[e];if(r)return r;for(n=e-1;!C[n];)n--;for(r={line:(r=C[n]).line,column:r.column};n<e;)t.charCodeAt(n)===10?(r.line++,r.column=1):r.column++,n++;return C[e]=r,r}function qe(e,t){var n=Ke(e),r=Ke(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:r.line,column:r.column}}}function T(e){S<He||(S>He&&(He=S,Ue=[]),Ue.push(e))}function Je(){var e,t,n,r,i=36*S+0,a=w[i];return a?(S=a.nextPos,a.result):(e=S,(t=E())!==s&&(n=Ze())!==s&&E()!==s?e=t=(r=n).length===1?r[0]:{type:`matches`,selectors:r}:(S=e,e=s),e===s&&(e=S,(t=E())!==s&&(t=void 0),e=t),w[i]={nextPos:S,result:e},e)}function E(){var e,n,r=36*S+1,i=w[r];if(i)return S=i.nextPos,i.result;for(e=[],t.charCodeAt(S)===32?(n=` `,S++):(n=s,T(u));n!==s;)e.push(n),t.charCodeAt(S)===32?(n=` `,S++):(n=s,T(u));return w[r]={nextPos:S,result:e},e}function Ye(){var e,n,r,i=36*S+2,a=w[i];if(a)return S=a.nextPos,a.result;if(n=[],d.test(t.charAt(S))?(r=t.charAt(S),S++):(r=s,T(f)),r!==s)for(;r!==s;)n.push(r),d.test(t.charAt(S))?(r=t.charAt(S),S++):(r=s,T(f));else n=s;return n!==s&&(n=n.join(``)),e=n,w[i]={nextPos:S,result:e},e}function Xe(){var e,n,r,i=36*S+3,a=w[i];return a?(S=a.nextPos,a.result):(e=S,(n=E())===s?(S=e,e=s):(t.charCodeAt(S)===62?(r=`>`,S++):(r=s,T(p)),r!==s&&E()!==s?e=n=`child`:(S=e,e=s)),e===s&&(e=S,(n=E())===s?(S=e,e=s):(t.charCodeAt(S)===126?(r=`~`,S++):(r=s,T(m)),r!==s&&E()!==s?e=n=`sibling`:(S=e,e=s)),e===s&&(e=S,(n=E())===s?(S=e,e=s):(t.charCodeAt(S)===43?(r=`+`,S++):(r=s,T(h)),r!==s&&E()!==s?e=n=`adjacent`:(S=e,e=s)),e===s&&(e=S,t.charCodeAt(S)===32?(n=` `,S++):(n=s,T(u)),n!==s&&(r=E())!==s?e=n=`descendant`:(S=e,e=s)))),w[i]={nextPos:S,result:e},e)}function Ze(){var e,n,r,i,a,o,c,l,u=36*S+5,d=w[u];if(d)return S=d.nextPos,d.result;if(e=S,(n=$e())!==s){for(r=[],i=S,(a=E())===s?(S=i,i=s):(t.charCodeAt(S)===44?(o=`,`,S++):(o=s,T(g)),o!==s&&(c=E())!==s&&(l=$e())!==s?i=a=[a,o,c,l]:(S=i,i=s));i!==s;)r.push(i),i=S,(a=E())===s?(S=i,i=s):(t.charCodeAt(S)===44?(o=`,`,S++):(o=s,T(g)),o!==s&&(c=E())!==s&&(l=$e())!==s?i=a=[a,o,c,l]:(S=i,i=s));r===s?(S=e,e=s):e=n=_(n,r)}else S=e,e=s;return w[u]={nextPos:S,result:e},e}function Qe(){var e,t,n,r,i,a=36*S+6,o=w[a];return o?(S=o.nextPos,o.result):(e=S,(t=Xe())===s&&(t=null),t!==s&&(n=$e())!==s?(i=n,e=t=(r=t)?{type:r,left:{type:`exactNode`},right:i}:i):(S=e,e=s),w[a]={nextPos:S,result:e},e)}function $e(){var e,t,n,r,i,a,o,c=36*S+7,l=w[c];if(l)return S=l.nextPos,l.result;if(e=S,(t=et())!==s){for(n=[],r=S,(i=Xe())!==s&&(a=et())!==s?r=i=[i,a]:(S=r,r=s);r!==s;)n.push(r),r=S,(i=Xe())!==s&&(a=et())!==s?r=i=[i,a]:(S=r,r=s);n===s?(S=e,e=s):(o=t,e=t=n.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),o))}else S=e,e=s;return w[c]={nextPos:S,result:e},e}function et(){var e,n,r,i,a,o,c,l=36*S+8,u=w[l];if(u)return S=u.nextPos,u.result;if(e=S,t.charCodeAt(S)===33?(n=`!`,S++):(n=s,T(v)),n===s&&(n=null),n!==s){if(r=[],(i=tt())!==s)for(;i!==s;)r.push(i),i=tt();else r=s;r===s?(S=e,e=s):(a=n,c=(o=r).length===1?o[0]:{type:`compound`,selectors:o},a&&(c.subject=!0),e=n=c)}else S=e,e=s;return w[l]={nextPos:S,result:e},e}function tt(){var e,n=36*S+9,r=w[n];return r?(S=r.nextPos,r.result):((e=(function(){var e,n,r=36*S+10,i=w[r];return i?(S=i.nextPos,i.result):(t.charCodeAt(S)===42?(n=`*`,S++):(n=s,T(y)),n!==s&&(n={type:`wildcard`,value:n}),e=n,w[r]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r,i=36*S+11,a=w[i];return a?(S=a.nextPos,a.result):(e=S,t.charCodeAt(S)===35?(n=`#`,S++):(n=s,T(ee)),n===s&&(n=null),n!==s&&(r=Ye())!==s?e=n={type:`identifier`,value:r}:(S=e,e=s),w[i]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r,i,a=36*S+12,o=w[a];return o?(S=o.nextPos,o.result):(e=S,t.charCodeAt(S)===91?(n=`[`,S++):(n=s,T(b)),n!==s&&E()!==s&&(r=(function(){var e,n,r,i,a=36*S+16,o=w[a];return o?(S=o.nextPos,o.result):(e=S,(n=nt())!==s&&E()!==s&&(r=(function(){var e,n,r,i=36*S+14,a=w[i];return a?(S=a.nextPos,a.result):(e=S,t.charCodeAt(S)===33?(n=`!`,S++):(n=s,T(v)),n===s&&(n=null),n===s?(S=e,e=s):(t.charCodeAt(S)===61?(r=`=`,S++):(r=s,T(re)),r===s?(S=e,e=s):(n=ie(n),e=n)),w[i]={nextPos:S,result:e},e)})())!==s&&E()!==s?((i=(function(){var e,n,r,i,a,o=36*S+20,c=w[o];if(c)return S=c.nextPos,c.result;if(e=S,t.substr(S,5)===`type(`?(n=`type(`,S+=5):(n=s,T(xe)),n!==s){if(E()!==s){if(r=[],Se.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(Ce)),i!==s)for(;i!==s;)r.push(i),Se.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(Ce));else r=s;r!==s&&(i=E())!==s?(t.charCodeAt(S)===41?(a=`)`,S++):(a=s,T(we)),a===s?(S=e,e=s):(n={type:`type`,value:r.join(``)},e=n)):(S=e,e=s)}else S=e,e=s}else S=e,e=s;return w[o]={nextPos:S,result:e},e})())===s&&(i=(function(){var e,n,r,i,a,o,c=36*S+22,l=w[c];if(l)return S=l.nextPos,l.result;if(e=S,t.charCodeAt(S)===47?(n=`/`,S++):(n=s,T(De)),n!==s){if(r=[],(i=rt())===s&&(i=D())===s&&(i=O()),i!==s)for(;i!==s;)r.push(i),(i=rt())===s&&(i=D())===s&&(i=O());else r=s;r===s?(S=e,e=s):(t.charCodeAt(S)===47?(i=`/`,S++):(i=s,T(De)),i===s?(S=e,e=s):((a=(function(){var e,n,r=36*S+21,i=w[r];if(i)return S=i.nextPos,i.result;if(e=[],Te.test(t.charAt(S))?(n=t.charAt(S),S++):(n=s,T(Ee)),n!==s)for(;n!==s;)e.push(n),Te.test(t.charAt(S))?(n=t.charAt(S),S++):(n=s,T(Ee));else e=s;return w[r]={nextPos:S,result:e},e})())===s&&(a=null),a===s?(S=e,e=s):(o=a,n={type:`regexp`,value:new RegExp(r.join(``),o?o.join(``):``)},e=n)))}else S=e,e=s;return w[c]={nextPos:S,result:e},e})()),i===s?(S=e,e=s):(n=ce(n,r,i),e=n)):(S=e,e=s),e===s&&(e=S,(n=nt())!==s&&E()!==s&&(r=(function(){var e,n,r,i=36*S+13,a=w[i];return a?(S=a.nextPos,a.result):(e=S,x.test(t.charAt(S))?(n=t.charAt(S),S++):(n=s,T(ne)),n===s&&(n=null),n===s?(S=e,e=s):(t.charCodeAt(S)===61?(r=`=`,S++):(r=s,T(re)),r===s?(S=e,e=s):(n=ie(n),e=n)),e===s&&(ae.test(t.charAt(S))?(e=t.charAt(S),S++):(e=s,T(oe))),w[i]={nextPos:S,result:e},e)})())!==s&&E()!==s?((i=(function(){var e,n,r,i,a,o,c=36*S+17,l=w[c];if(l)return S=l.nextPos,l.result;if(e=S,t.charCodeAt(S)===34?(n=`"`,S++):(n=s,T(le)),n!==s){for(r=[],ue.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(de)),i===s&&(i=S,t.charCodeAt(S)===92?(a=`\\`,S++):(a=s,T(fe)),a===s?(S=i,i=s):(t.length>S?(o=t.charAt(S),S++):(o=s,T(pe)),o===s?(S=i,i=s):(a=me(a,o),i=a)));i!==s;)r.push(i),ue.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(de)),i===s&&(i=S,t.charCodeAt(S)===92?(a=`\\`,S++):(a=s,T(fe)),a===s?(S=i,i=s):(t.length>S?(o=t.charAt(S),S++):(o=s,T(pe)),o===s?(S=i,i=s):(a=me(a,o),i=a)));r===s?(S=e,e=s):(t.charCodeAt(S)===34?(i=`"`,S++):(i=s,T(le)),i===s?(S=e,e=s):(n=he(r),e=n))}else S=e,e=s;if(e===s){if(e=S,t.charCodeAt(S)===39?(n=`'`,S++):(n=s,T(ge)),n!==s){for(r=[],_e.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(ve)),i===s&&(i=S,t.charCodeAt(S)===92?(a=`\\`,S++):(a=s,T(fe)),a===s?(S=i,i=s):(t.length>S?(o=t.charAt(S),S++):(o=s,T(pe)),o===s?(S=i,i=s):(a=me(a,o),i=a)));i!==s;)r.push(i),_e.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(ve)),i===s&&(i=S,t.charCodeAt(S)===92?(a=`\\`,S++):(a=s,T(fe)),a===s?(S=i,i=s):(t.length>S?(o=t.charAt(S),S++):(o=s,T(pe)),o===s?(S=i,i=s):(a=me(a,o),i=a)));r===s?(S=e,e=s):(t.charCodeAt(S)===39?(i=`'`,S++):(i=s,T(ge)),i===s?(S=e,e=s):(n=he(r),e=n))}else S=e,e=s}return w[c]={nextPos:S,result:e},e})())===s&&(i=(function(){var e,n,r,i,a,o,c,l=36*S+18,u=w[l];if(u)return S=u.nextPos,u.result;for(e=S,n=S,r=[],ye.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(be));i!==s;)r.push(i),ye.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(be));if(r===s?(S=n,n=s):(t.charCodeAt(S)===46?(i=`.`,S++):(i=s,T(se)),i===s?(S=n,n=s):n=r=[r,i]),n===s&&(n=null),n!==s){if(r=[],ye.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(be)),i!==s)for(;i!==s;)r.push(i),ye.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(be));else r=s;r===s?(S=e,e=s):(o=r,c=(a=n)?[].concat.apply([],a).join(``):``,n={type:`literal`,value:parseFloat(c+o.join(``))},e=n)}else S=e,e=s;return w[l]={nextPos:S,result:e},e})())===s&&(i=(function(){var e,t,n=36*S+19,r=w[n];return r?(S=r.nextPos,r.result):((t=Ye())!==s&&(t={type:`literal`,value:t}),e=t,w[n]={nextPos:S,result:e},e)})()),i===s?(S=e,e=s):(n=ce(n,r,i),e=n)):(S=e,e=s),e===s&&(e=S,(n=nt())!==s&&(n={type:`attribute`,name:n}),e=n)),w[a]={nextPos:S,result:e},e)})())!==s&&E()!==s?(t.charCodeAt(S)===93?(i=`]`,S++):(i=s,T(te)),i===s?(S=e,e=s):e=n=r):(S=e,e=s),w[a]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r,i,a,o,c,l,u=36*S+26,d=w[u];if(d)return S=d.nextPos,d.result;if(e=S,t.charCodeAt(S)===46?(n=`.`,S++):(n=s,T(se)),n!==s){if((r=Ye())!==s){for(i=[],a=S,t.charCodeAt(S)===46?(o=`.`,S++):(o=s,T(se)),o!==s&&(c=Ye())!==s?a=o=[o,c]:(S=a,a=s);a!==s;)i.push(a),a=S,t.charCodeAt(S)===46?(o=`.`,S++):(o=s,T(se)),o!==s&&(c=Ye())!==s?a=o=[o,c]:(S=a,a=s);i===s?(S=e,e=s):(l=r,n={type:`field`,name:i.reduce((function(e,t){return e+t[0]+t[1]}),l)},e=n)}else S=e,e=s}else S=e,e=s;return w[u]={nextPos:S,result:e},e})())===s&&(e=(function(){var e,n,r,i,a=36*S+27,o=w[a];return o?(S=o.nextPos,o.result):(e=S,t.substr(S,5)===`:not(`?(n=`:not(`,S+=5):(n=s,T(Me)),n!==s&&E()!==s&&(r=Ze())!==s&&E()!==s?(t.charCodeAt(S)===41?(i=`)`,S++):(i=s,T(we)),i===s?(S=e,e=s):e=n={type:`not`,selectors:r}):(S=e,e=s),w[a]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r,i,a=36*S+28,o=w[a];return o?(S=o.nextPos,o.result):(e=S,t.substr(S,9)===`:matches(`?(n=`:matches(`,S+=9):(n=s,T(Ne)),n!==s&&E()!==s&&(r=Ze())!==s&&E()!==s?(t.charCodeAt(S)===41?(i=`)`,S++):(i=s,T(we)),i===s?(S=e,e=s):(n=Pe(r),e=n)):(S=e,e=s),w[a]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r,i,a=36*S+29,o=w[a];return o?(S=o.nextPos,o.result):(e=S,t.substr(S,4)===`:is(`?(n=`:is(`,S+=4):(n=s,T(Fe)),n!==s&&E()!==s&&(r=Ze())!==s&&E()!==s?(t.charCodeAt(S)===41?(i=`)`,S++):(i=s,T(we)),i===s?(S=e,e=s):(n=Pe(r),e=n)):(S=e,e=s),w[a]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r,i,a=36*S+30,o=w[a];return o?(S=o.nextPos,o.result):(e=S,t.substr(S,5)===`:has(`?(n=`:has(`,S+=5):(n=s,T(Ie)),n!==s&&E()!==s&&(r=(function(){var e,n,r,i,a,o,c,l,u=36*S+4,d=w[u];if(d)return S=d.nextPos,d.result;if(e=S,(n=Qe())!==s){for(r=[],i=S,(a=E())===s?(S=i,i=s):(t.charCodeAt(S)===44?(o=`,`,S++):(o=s,T(g)),o!==s&&(c=E())!==s&&(l=Qe())!==s?i=a=[a,o,c,l]:(S=i,i=s));i!==s;)r.push(i),i=S,(a=E())===s?(S=i,i=s):(t.charCodeAt(S)===44?(o=`,`,S++):(o=s,T(g)),o!==s&&(c=E())!==s&&(l=Qe())!==s?i=a=[a,o,c,l]:(S=i,i=s));r===s?(S=e,e=s):e=n=_(n,r)}else S=e,e=s;return w[u]={nextPos:S,result:e},e})())!==s&&E()!==s?(t.charCodeAt(S)===41?(i=`)`,S++):(i=s,T(we)),i===s?(S=e,e=s):e=n={type:`has`,selectors:r}):(S=e,e=s),w[a]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r=36*S+31,i=w[r];return i?(S=i.nextPos,i.result):(t.substr(S,12)===`:first-child`?(n=`:first-child`,S+=12):(n=s,T(Le)),n!==s&&(n=k(1)),e=n,w[r]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r=36*S+32,i=w[r];return i?(S=i.nextPos,i.result):(t.substr(S,11)===`:last-child`?(n=`:last-child`,S+=11):(n=s,T(Re)),n!==s&&(n=it(1)),e=n,w[r]={nextPos:S,result:e},e)})())===s&&(e=(function(){var e,n,r,i,a,o=36*S+33,c=w[o];if(c)return S=c.nextPos,c.result;if(e=S,t.substr(S,11)===`:nth-child(`?(n=`:nth-child(`,S+=11):(n=s,T(ze)),n!==s){if(E()!==s){if(r=[],ye.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(be)),i!==s)for(;i!==s;)r.push(i),ye.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(be));else r=s;r!==s&&(i=E())!==s?(t.charCodeAt(S)===41?(a=`)`,S++):(a=s,T(we)),a===s?(S=e,e=s):(n=k(parseInt(r.join(``),10)),e=n)):(S=e,e=s)}else S=e,e=s}else S=e,e=s;return w[o]={nextPos:S,result:e},e})())===s&&(e=(function(){var e,n,r,i,a,o=36*S+34,c=w[o];if(c)return S=c.nextPos,c.result;if(e=S,t.substr(S,16)===`:nth-last-child(`?(n=`:nth-last-child(`,S+=16):(n=s,T(Be)),n!==s){if(E()!==s){if(r=[],ye.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(be)),i!==s)for(;i!==s;)r.push(i),ye.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(be));else r=s;r!==s&&(i=E())!==s?(t.charCodeAt(S)===41?(a=`)`,S++):(a=s,T(we)),a===s?(S=e,e=s):(n=it(parseInt(r.join(``),10)),e=n)):(S=e,e=s)}else S=e,e=s}else S=e,e=s;return w[o]={nextPos:S,result:e},e})())===s&&(e=(function(){var e,n,r,i=36*S+35,a=w[i];return a?(S=a.nextPos,a.result):(e=S,t.charCodeAt(S)===58?(n=`:`,S++):(n=s,T(Ve)),n!==s&&(r=Ye())!==s?e=n={type:`class`,name:r}:(S=e,e=s),w[i]={nextPos:S,result:e},e)})()),w[n]={nextPos:S,result:e},e)}function nt(){var e,n,r,i,a,o,c,l,u=36*S+15,d=w[u];if(d)return S=d.nextPos,d.result;if(e=S,(n=Ye())!==s){for(r=[],i=S,t.charCodeAt(S)===46?(a=`.`,S++):(a=s,T(se)),a!==s&&(o=Ye())!==s?i=a=[a,o]:(S=i,i=s);i!==s;)r.push(i),i=S,t.charCodeAt(S)===46?(a=`.`,S++):(a=s,T(se)),a!==s&&(o=Ye())!==s?i=a=[a,o]:(S=i,i=s);r===s?(S=e,e=s):(c=n,l=r,e=n=[].concat.apply([c],l).join(``))}else S=e,e=s;return w[u]={nextPos:S,result:e},e}function rt(){var e,n,r,i,a=36*S+23,o=w[a];if(o)return S=o.nextPos,o.result;if(e=S,t.charCodeAt(S)===91?(n=`[`,S++):(n=s,T(b)),n!==s){if(r=[],Oe.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(ke)),i===s&&(i=D()),i!==s)for(;i!==s;)r.push(i),Oe.test(t.charAt(S))?(i=t.charAt(S),S++):(i=s,T(ke)),i===s&&(i=D());else r=s;r===s?(S=e,e=s):(t.charCodeAt(S)===93?(i=`]`,S++):(i=s,T(te)),i===s?(S=e,e=s):e=n=`[`+r.join(``)+`]`)}else S=e,e=s;return w[a]={nextPos:S,result:e},e}function D(){var e,n,r,i=36*S+24,a=w[i];return a?(S=a.nextPos,a.result):(e=S,t.charCodeAt(S)===92?(n=`\\`,S++):(n=s,T(fe)),n===s?(S=e,e=s):(t.length>S?(r=t.charAt(S),S++):(r=s,T(pe)),r===s?(S=e,e=s):e=n=`\\`+r),w[i]={nextPos:S,result:e},e)}function O(){var e,n,r,i=36*S+25,a=w[i];if(a)return S=a.nextPos,a.result;if(n=[],Ae.test(t.charAt(S))?(r=t.charAt(S),S++):(r=s,T(je)),r!==s)for(;r!==s;)n.push(r),Ae.test(t.charAt(S))?(r=t.charAt(S),S++):(r=s,T(je));else n=s;return n!==s&&(n=n.join(``)),e=n,w[i]={nextPos:S,result:e},e}function k(e){return{type:`nth-child`,index:{type:`literal`,value:e}}}function it(e){return{type:`nth-last-child`,index:{type:`literal`,value:e}}}if((r=l())!==s&&S===t.length)return r;throw r!==s&&S<t.length&&T({type:`end`}),i=Ue,a=He<t.length?t.charAt(He):null,o=He<t.length?qe(He,He+1):qe(He,He),new e(e.buildMessage(i,a),i,a,o)}}})()}));function z3(e,t){for(var n=0;n<t.length;++n){if(e==null)return e;e=e[t[n]]}return e}var B3=typeof WeakMap==`function`?new WeakMap:null;function V3(e){if(e==null)return function(){return!0};if(B3!=null){var t=B3.get(e);return t??(t=H3(e),B3.set(e,t)),t}return H3(e)}function H3(e){switch(e.type){case`wildcard`:return function(){return!0};case`identifier`:var t=e.value.toLowerCase();return function(e,n,r){return t===e[r&&r.nodeTypeKey||`type`].toLowerCase()};case`exactNode`:return function(e,t){return t.length===0};case`field`:var n=e.name.split(`.`);return function(e,t){return(function e(t,n,r,i){for(var a=n,o=i;o<r.length;++o){if(a==null)return!1;var s=a[r[o]];if(Array.isArray(s)){for(var c=0;c<s.length;++c)if(e(t,s[c],r,o+1))return!0;return!1}a=s}return t===a})(e,t[n.length-1],n,0)};case`matches`:var r=e.selectors.map(V3);return function(e,t,n){for(var i=0;i<r.length;++i)if(r[i](e,t,n))return!0;return!1};case`compound`:var i=e.selectors.map(V3);return function(e,t,n){for(var r=0;r<i.length;++r)if(!i[r](e,t,n))return!1;return!0};case`not`:var a=e.selectors.map(V3);return function(e,t,n){for(var r=0;r<a.length;++r)if(a[r](e,t,n))return!1;return!0};case`has`:var o=e.selectors.map(V3);return function(e,t,n){var r=!1,i=[];return L3.traverse(e,{enter:function(e,t){t!=null&&i.unshift(t);for(var a=0;a<o.length;++a)if(o[a](e,i,n))return r=!0,void this.break()},leave:function(){i.shift()},keys:n&&n.visitorKeys,fallback:n&&n.fallback||`iteration`}),r};case`child`:var s=V3(e.left),c=V3(e.right);return function(e,t,n){return!!(t.length>0&&c(e,t,n))&&s(t[0],t.slice(1),n)};case`descendant`:var l=V3(e.left),u=V3(e.right);return function(e,t,n){if(u(e,t,n)){for(var r=0,i=t.length;r<i;++r)if(l(t[r],t.slice(r+1),n))return!0}return!1};case`attribute`:var d=e.name.split(`.`);switch(e.operator){case void 0:return function(e){return z3(e,d)!=null};case`=`:switch(e.value.type){case`regexp`:return function(t){var n=z3(t,d);return typeof n==`string`&&e.value.value.test(n)};case`literal`:var f=`${e.value.value}`;return function(e){return f===`${z3(e,d)}`};case`type`:return function(t){return e.value.value===P3(z3(t,d))}}throw Error(`Unknown selector value type: ${e.value.type}`);case`!=`:switch(e.value.type){case`regexp`:return function(t){return!e.value.value.test(z3(t,d))};case`literal`:var p=`${e.value.value}`;return function(e){return p!==`${z3(e,d)}`};case`type`:return function(t){return e.value.value!==P3(z3(t,d))}}throw Error(`Unknown selector value type: ${e.value.type}`);case`<=`:return function(t){return z3(t,d)<=e.value.value};case`<`:return function(t){return z3(t,d)<e.value.value};case`>`:return function(t){return z3(t,d)>e.value.value};case`>=`:return function(t){return z3(t,d)>=e.value.value}}throw Error(`Unknown operator: ${e.operator}`);case`sibling`:var m=V3(e.left),h=V3(e.right);return function(t,n,r){return h(t,n,r)&&G3(t,m,n,`LEFT_SIDE`,r)||e.left.subject&&m(t,n,r)&&G3(t,h,n,`RIGHT_SIDE`,r)};case`adjacent`:var g=V3(e.left),_=V3(e.right);return function(t,n,r){return _(t,n,r)&&K3(t,g,n,`LEFT_SIDE`,r)||e.right.subject&&g(t,n,r)&&K3(t,_,n,`RIGHT_SIDE`,r)};case`nth-child`:var v=e.index.value,y=V3(e.right);return function(e,t,n){return y(e,t,n)&&q3(e,t,v,n)};case`nth-last-child`:var ee=-e.index.value,b=V3(e.right);return function(e,t,n){return b(e,t,n)&&q3(e,t,ee,n)};case`class`:var te=e.name.toLowerCase();return function(t,n,r){if(r&&r.matchClass)return r.matchClass(e.name,t,n);if(r&&r.nodeTypeKey)return!1;switch(te){case`statement`:if(t.type.slice(-9)===`Statement`)return!0;case`declaration`:return t.type.slice(-11)===`Declaration`;case`pattern`:if(t.type.slice(-7)===`Pattern`)return!0;case`expression`:return t.type.slice(-10)===`Expression`||t.type.slice(-7)===`Literal`||t.type===`Identifier`&&(n.length===0||n[0].type!==`MetaProperty`)||t.type===`MetaProperty`;case`function`:return t.type===`FunctionDeclaration`||t.type===`FunctionExpression`||t.type===`ArrowFunctionExpression`}throw Error(`Unknown class name: ${e.name}`)}}throw Error(`Unknown selector type: ${e.type}`)}function U3(e,t){var n=t&&t.nodeTypeKey||`type`,r=e[n];return t&&t.visitorKeys&&t.visitorKeys[r]?t.visitorKeys[r]:L3.VisitorKeys[r]?L3.VisitorKeys[r]:t&&typeof t.fallback==`function`?t.fallback(e):Object.keys(e).filter((function(e){return e!==n}))}function W3(e,t){var n=t&&t.nodeTypeKey||`type`;return e!==null&&P3(e)===`object`&&typeof e[n]==`string`}function G3(e,t,n,r,i){var a=M3(n,1)[0];if(!a)return!1;for(var o=U3(a,i),s=0;s<o.length;++s){var c=a[o[s]];if(Array.isArray(c)){var l=c.indexOf(e);if(l<0)continue;var u=void 0,d=void 0;r===`LEFT_SIDE`?(u=0,d=l):(u=l+1,d=c.length);for(var f=u;f<d;++f)if(W3(c[f],i)&&t(c[f],n,i))return!0}}return!1}function K3(e,t,n,r,i){var a=M3(n,1)[0];if(!a)return!1;for(var o=U3(a,i),s=0;s<o.length;++s){var c=a[o[s]];if(Array.isArray(c)){var l=c.indexOf(e);if(l<0)continue;if(r===`LEFT_SIDE`&&l>0&&W3(c[l-1],i)&&t(c[l-1],n,i)||r===`RIGHT_SIDE`&&l<c.length-1&&W3(c[l+1],i)&&t(c[l+1],n,i))return!0}}return!1}function q3(e,t,n,r){if(n===0)return!1;var i=M3(t,1)[0];if(!i)return!1;for(var a=U3(i,r),o=0;o<a.length;++o){var s=i[a[o]];if(Array.isArray(s)){var c=n<0?s.length+n:n-1;if(c>=0&&c<s.length&&s[c]===e)return!0}}return!1}function J3(e,t,n,r){if(t){var i=[],a=V3(t),o=(function e(t,n){if(t==null||P3(t)!=`object`)return[];n??=t;for(var r=t.subject?[n]:[],i=Object.keys(t),a=0;a<i.length;++a){var o=i[a],s=t[o];r.push.apply(r,N3(e(s,o===`left`?s:n)))}return r})(t).map(V3);L3.traverse(e,{enter:function(e,t){if(t!=null&&i.unshift(t),a(e,i,r)){if(o.length)for(var s=0,c=o.length;s<c;++s){o[s](e,i,r)&&n(e,t,i);for(var l=0,u=i.length;l<u;++l){var d=i.slice(l+1);o[s](i[l],d,r)&&n(i[l],t,d)}}else n(e,t,i)}},leave:function(){i.shift()},keys:r&&r.visitorKeys,fallback:r&&r.fallback||`iteration`})}}function Y3(e,t,n){var r=[];return J3(e,t,(function(e){r.push(e)}),n),r}function X3(e){return R3.parse(e)}function Z3(e,t,n){return Y3(e,X3(t),n)}Z3.parse=X3,Z3.match=Y3,Z3.traverse=J3,Z3.matches=function(e,t,n,r){return!t||!!e&&(n||=[],V3(t)(e,n,r))},Z3.query=Z3;var Q3={},$3={},e6={exports:{}},t6=Z3,{parse:n6}=Q3,r6=e=>e.declarations?.[0]?.id?.properties?.[0]?.value?.name===`tr_ch_apm_tracingChannel`,i6=/[^\w]/g,a6=e=>`tr_ch_apm$${e.replace(i6,`_`)}`,o6=e6.exports={tracingChannelImport({dcModule:e,moduleType:t},n){if(n.body.some(r6))return;let r={module:t===`esm`},i=n.body.findIndex(e=>e.directive===`use strict`),a=t===`esm`?`import tr_ch_apm_dc from "${e}"`:`const tr_ch_apm_dc = require("${e}")`;n.body.splice(i+1,0,n6(a,r).body[0],n6(`const { tracingChannel: tr_ch_apm_tracingChannel } = tr_ch_apm_dc`,r).body[0],n6(`const tr_ch_apm_hasSubscribers = ch => ch.start.hasSubscribers
|
|
35
|
-
|| ch.end.hasSubscribers
|
|
36
|
-
|| ch.asyncStart.hasSubscribers
|
|
37
|
-
|| ch.asyncEnd.hasSubscribers
|
|
38
|
-
|| ch.error.hasSubscribers`,r).body[0])},tracingChannelDeclaration(e,t){let{channelName:n,module:{name:r}}=e,i=a6(n);if(t.body.some(e=>e.declarations?.[0]?.id?.name===i))return;o6.tracingChannelImport(e,t);let a=t.body.findIndex(r6),o=`
|
|
39
|
-
const ${i} = tr_ch_apm_tracingChannel("orchestrion:${r}:${n}")
|
|
40
|
-
`;t.body.splice(a+1,0,n6(o).body[0])},traceCallback:c6,tracePromise:c6,traceSync:c6,traceAuto:c6};function s6(e){return[...(e||[]).filter(e=>e.type!==`RestElement`&&e.type!==`AssignmentPattern`).map((e,t)=>({type:`Identifier`,name:`__apm$arg${t}`})),{type:`RestElement`,argument:{type:`Identifier`,name:`__apm$args`}}]}function c6(e,t,n,r){let i=r[r.length-1];t.type===`ClassDeclaration`||t.type===`ClassExpression`?u6(e,t,i):l6(e,t,i)}function l6(e,t,n){o6.tracingChannelDeclaration(e,n);let{functionQuery:{methodName:r,privateMethodName:i,functionName:a,expressionName:o,propertyName:s}}=e,c=r===`constructor`||!r&&!i&&!a&&!o&&!s?`ArrowFunctionExpression`:t.type,l=t.params;t.body=d6(e,{type:c,params:l,body:t.body,async:t.async,expression:!1,generator:t.generator},n),t.params=s6(l),t.generator=!1,t.async=!1,f6(e,t)}function u6(e,t,n){let{functionQuery:r,operator:i}=e,{methodName:a}=r;if(!a)return;let o=t.body;if(o.body.some(({key:e})=>e.name===a))return;let s=o.body.find(({kind:e})=>e===`constructor`);o6.tracingChannelDeclaration(e,n),s||(s=n6(t.superClass?`class A extends Object { constructor (...args) { super(...args) } }`:`class A { constructor () {} }`).body[0].body.body[0],o.body.unshift(s));let c=n6(`
|
|
41
|
-
const __apm$${a} = this["${a}"]
|
|
42
|
-
this["${a}"] = function () {}
|
|
43
|
-
if (typeof __apm$${a} === 'function') {
|
|
44
|
-
Object.defineProperty(this["${a}"], 'length', {
|
|
45
|
-
value: __apm$${a}.length,
|
|
46
|
-
configurable: true
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
`).body,l=c[1].expression.right;l.params=[{type:`RestElement`,argument:{type:`Identifier`,name:`__apm$args`}}],l.async=i===`tracePromise`,l.body=d6(e,{type:`Identifier`,name:`__apm$${a}`},n),f6(e,l),s.value.body.body.push(...c)}function d6(e,t,n){let{operator:r,moduleVersion:i}=e,{returnKind:a}=e.functionQuery,o=a?v6(e,a,n):``,s;r===`traceCallback`&&(s=m6(e,t,o)),r===`tracePromise`&&(s=h6(e,t,o)),r===`traceSync`&&(s=g6(e,t,o)),r===`traceAuto`&&(s=p6(e,t,o));let c=(t.params||[]).filter(e=>e.type!==`RestElement`&&e.type!==`AssignmentPattern`).map((e,t)=>`__apm$arg${t}`).concat(`...__apm$args`).join(`, `),l=s.body[0].body,u=n6(t.type===`ArrowFunctionExpression`?`
|
|
50
|
-
const __apm$arguments = [${c}];
|
|
51
|
-
const __apm$ctx = {
|
|
52
|
-
arguments: __apm$arguments,
|
|
53
|
-
moduleVersion: ${JSON.stringify(i)}
|
|
54
|
-
};
|
|
55
|
-
const __apm$traced = () => {
|
|
56
|
-
const __apm$wrapped = () => {};
|
|
57
|
-
return __apm$wrapped(...__apm$arguments);
|
|
58
|
-
};
|
|
59
|
-
`:`
|
|
60
|
-
const __apm$arguments = [${c}].slice(0, arguments.length);
|
|
61
|
-
const __apm$ctx = {
|
|
62
|
-
arguments: __apm$arguments,
|
|
63
|
-
self: this,
|
|
64
|
-
moduleVersion: ${JSON.stringify(i)}
|
|
65
|
-
};
|
|
66
|
-
const __apm$traced = () => {
|
|
67
|
-
const __apm$wrapped = () => {};
|
|
68
|
-
return __apm$wrapped.apply(this, __apm$arguments);
|
|
69
|
-
};
|
|
70
|
-
`).body;return l.body.unshift(...u),t6.query(l,`[id.name=__apm$wrapped]`)[0].init=t,l}function f6(e,t){let n=new Set;t6.traverse(t.body,t6.parse(`[object.type=Super]`),(e,t)=>{let{name:r}=e.property,i;if(t.callee){let{expression:e}=n6(`__apm$super['${r}'].call(this)`).body[0];t.callee=i=e.callee,t.arguments.unshift(...e.arguments)}else t.expression=i=n6(`__apm$super['${r}']`).body[0];i.computed=t.callee.computed,i.optional=t.callee.optional,n.add(r)});for(let e of n){let n=n6(`
|
|
71
|
-
class Wrapper {
|
|
72
|
-
wrapper () {
|
|
73
|
-
__apm$super['${e}'] = super['${e}']
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
`).body[0].body.body[0].value.body.body[0];t.body.body.unshift(n)}n.size>0&&t.body.body.unshift(n6(`const __apm$super = {}`).body[0])}function p6(e,t,n=``){let r=m6(e,t,n),i=h6(e,t,n),[a,o,s,c,l,u]=r.body[0].body.body,d={type:`IfStatement`,test:c.test,consequent:{type:`BlockStatement`,body:i.body[0].body.body},alternate:null};return r.body[0].body.body=[a,d,o,s,l,u],r}function m6(e,t,n=``){let{channelName:r,functionQuery:{callbackIndex:i=-1}}=e,a=a6(r);return n6(`
|
|
77
|
-
function wrapper () {
|
|
78
|
-
const __apm$cb = Array.prototype.at.call(__apm$arguments, ${i});
|
|
79
|
-
|
|
80
|
-
if (!${a}.start.hasSubscribers) return __apm$traced();
|
|
81
|
-
|
|
82
|
-
function __apm$wrappedCb(err, res) {
|
|
83
|
-
if (err) {
|
|
84
|
-
__apm$ctx.error = err;
|
|
85
|
-
${a}.error.publish(__apm$ctx);
|
|
86
|
-
} else {
|
|
87
|
-
__apm$ctx.result = res;
|
|
88
|
-
${n}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
${a}.asyncStart.runStores(__apm$ctx, () => {
|
|
92
|
-
try {
|
|
93
|
-
if (__apm$cb) {
|
|
94
|
-
return __apm$cb.apply(this, arguments);
|
|
95
|
-
}
|
|
96
|
-
} finally {
|
|
97
|
-
${a}.asyncEnd.publish(__apm$ctx);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (typeof __apm$cb !== 'function') {
|
|
103
|
-
return __apm$traced();
|
|
104
|
-
}
|
|
105
|
-
Array.prototype.splice.call(__apm$arguments, ${i}, 1, __apm$wrappedCb);
|
|
106
|
-
|
|
107
|
-
return ${a}.start.runStores(__apm$ctx, () => {
|
|
108
|
-
try {
|
|
109
|
-
return __apm$traced();
|
|
110
|
-
} catch (err) {
|
|
111
|
-
__apm$ctx.error = err;
|
|
112
|
-
${a}.error.publish(__apm$ctx);
|
|
113
|
-
throw err;
|
|
114
|
-
} finally {
|
|
115
|
-
__apm$ctx.self ??= this;
|
|
116
|
-
${a}.end.publish(__apm$ctx);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
`)}function h6(e,t,n=``){let{channelName:r}=e,i=a6(r);return n6(`
|
|
121
|
-
function wrapper () {
|
|
122
|
-
if (!tr_ch_apm_hasSubscribers(${i})) return __apm$traced();
|
|
123
|
-
|
|
124
|
-
return ${i}.start.runStores(__apm$ctx, () => {
|
|
125
|
-
try {
|
|
126
|
-
let promise = __apm$traced();
|
|
127
|
-
if (typeof promise?.then !== 'function') {
|
|
128
|
-
__apm$ctx.result = promise;
|
|
129
|
-
${n}
|
|
130
|
-
return __apm$ctx.result;
|
|
131
|
-
}
|
|
132
|
-
// Mirror Node.js core diagnostics_channel behaviour: for native Promise
|
|
133
|
-
// instances, chain normally (safe since there is no subclass API to
|
|
134
|
-
// preserve). For Promise subclasses and other thenables, side-chain the
|
|
135
|
-
// callbacks for event publishing and return the original so that any
|
|
136
|
-
// subclass-specific methods (e.g. APIPromise.withResponse()) remain
|
|
137
|
-
// accessible to the caller.
|
|
138
|
-
if (promise instanceof Promise && promise.constructor === Promise) {
|
|
139
|
-
return promise.then(
|
|
140
|
-
result => {
|
|
141
|
-
__apm$ctx.result = result;
|
|
142
|
-
${n}
|
|
143
|
-
${i}.asyncStart.publish(__apm$ctx);
|
|
144
|
-
${i}.asyncEnd.publish(__apm$ctx);
|
|
145
|
-
return __apm$ctx.result;
|
|
146
|
-
},
|
|
147
|
-
err => {
|
|
148
|
-
__apm$ctx.error = err;
|
|
149
|
-
${i}.error.publish(__apm$ctx);
|
|
150
|
-
${i}.asyncStart.publish(__apm$ctx);
|
|
151
|
-
${i}.asyncEnd.publish(__apm$ctx);
|
|
152
|
-
throw err;
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
promise.then(
|
|
157
|
-
result => {
|
|
158
|
-
__apm$ctx.result = result;
|
|
159
|
-
${n}
|
|
160
|
-
${i}.asyncStart.publish(__apm$ctx);
|
|
161
|
-
${i}.asyncEnd.publish(__apm$ctx);
|
|
162
|
-
},
|
|
163
|
-
err => {
|
|
164
|
-
__apm$ctx.error = err;
|
|
165
|
-
${i}.error.publish(__apm$ctx);
|
|
166
|
-
${i}.asyncStart.publish(__apm$ctx);
|
|
167
|
-
${i}.asyncEnd.publish(__apm$ctx);
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
return promise;
|
|
171
|
-
} catch (err) {
|
|
172
|
-
__apm$ctx.error = err;
|
|
173
|
-
${i}.error.publish(__apm$ctx);
|
|
174
|
-
throw err;
|
|
175
|
-
} finally {
|
|
176
|
-
__apm$ctx.self ??= this;
|
|
177
|
-
${i}.end.publish(__apm$ctx);
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
`)}function g6(e,t,n=``){let{channelName:r}=e,i=a6(r);return n6(`
|
|
182
|
-
function wrapper () {
|
|
183
|
-
if (!tr_ch_apm_hasSubscribers(${i})) return __apm$traced();
|
|
184
|
-
|
|
185
|
-
return ${i}.start.runStores(__apm$ctx, () => {
|
|
186
|
-
try {
|
|
187
|
-
__apm$ctx.result = __apm$traced();
|
|
188
|
-
${n}
|
|
189
|
-
} catch (err) {
|
|
190
|
-
__apm$ctx.error = err;
|
|
191
|
-
${i}.error.publish(__apm$ctx);
|
|
192
|
-
throw err;
|
|
193
|
-
} finally {
|
|
194
|
-
__apm$ctx.self ??= this;
|
|
195
|
-
${i}.end.publish(__apm$ctx);
|
|
196
|
-
}
|
|
197
|
-
return __apm$ctx.result;
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
`)}function _6(e,t){let{channelName:n,module:{name:r}}=e,i=a6(n+`:next`);if(t.body.some(e=>e.declarations?.[0]?.id?.name===i))return;let a=a6(n),o=t.body.findIndex(e=>e.declarations?.[0]?.id?.name===a),s=`const ${i} = tr_ch_apm_tracingChannel("orchestrion:${r}:${n}:next")`;t.body.splice(o+1,0,n6(s).body[0])}function v6(e,t,n){let{channelName:r}=e,i=t===`Iterator`?`traceSync`:`tracePromise`,a=a6(r+`:next`);return _6(e,n),`
|
|
201
|
-
const __apm$iter = __apm$ctx.result;
|
|
202
|
-
if (__apm$iter != null && typeof __apm$iter.next === 'function') {
|
|
203
|
-
const __apm$patchIter = function (method) {
|
|
204
|
-
const __apm$orig = __apm$iter[method];
|
|
205
|
-
if (typeof __apm$orig !== 'function') return;
|
|
206
|
-
__apm$iter[method] = function () {
|
|
207
|
-
const __apm$iterArgs = Array.prototype.slice.call(arguments);
|
|
208
|
-
if (!tr_ch_apm_hasSubscribers(${a})) return __apm$orig.apply(this, __apm$iterArgs);
|
|
209
|
-
__apm$ctx.method = method;
|
|
210
|
-
__apm$ctx.arguments = __apm$iterArgs;
|
|
211
|
-
return ${a}.${i}(__apm$orig, __apm$ctx, this, ...__apm$iterArgs);
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
__apm$patchIter('next');
|
|
215
|
-
__apm$patchIter('throw');
|
|
216
|
-
__apm$patchIter('return');
|
|
217
|
-
}
|
|
218
|
-
`}var y6=e6.exports,b6={},x6=e=>{throw TypeError(e)},S6=(e,t,n)=>t.has(e)||x6(`Cannot `+n),C6=(e,t,n)=>(S6(e,t,`read from private field`),n?n.call(e):t.get(e)),w6=(e,t,n)=>t.has(e)?x6(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),T6=(e,t,n,r)=>(S6(e,t,`write to private field`),t.set(e,n),n),E6=(e,t,n)=>(S6(e,t,`access private method`),n),D6,O6,k6,A6,j6,M6,N6,P6,F6,I6,L6,R6,z6=Z3,{parse:B6}=Q3,{generate:V6}=$3,H6=y6,U6,W6,G6=class{constructor(e,t,n,r,i,a={}){w6(this,N6),w6(this,D6,null),w6(this,O6,null),w6(this,k6,null),w6(this,A6,[]),w6(this,j6,null),w6(this,M6,{}),T6(this,D6,e),T6(this,O6,t),T6(this,k6,n),T6(this,A6,r),T6(this,j6,i),T6(this,M6,a)}free(){}get moduleName(){return C6(this,D6)}get filePath(){return C6(this,k6)}transform(e,t,n){if(Buffer.isBuffer(e)&&(e=e.toString()),!e)return{code:e};let r,i={},a=0;for(let n of C6(this,A6)){let{astQuery:o,functionQuery:s={}}=n;if(!r){let n={loc:!0,ranges:!0,raw:!0,module:t===`esm`};try{r=B6(e,n)}catch{r=B6(e,{...n,module:!n.module})}t===`esm`&&(i=E6(this,N6,I6).call(this,r))}let c=E6(this,N6,L6).call(this,s,i),l=o||E6(this,N6,R6).call(this,c),u={...n,dcModule:C6(this,j6),moduleType:t,moduleVersion:C6(this,O6),functionQuery:c};u.operator=E6(this,N6,F6).call(this,u),z6.traverse(r,z6.parse(l),(...e)=>{a++,E6(this,N6,P6).call(this,u,...e)})}if(a===0&&C6(this,A6).length>0){let e=C6(this,A6).map(({astQuery:e,functionQuery:t={}})=>{if(e)return e;let n=E6(this,N6,L6).call(this,t,i),r=(e=>e.methodName||e.privateMethodName||e.functionName||e.expressionName||`constructor`)(t),a=t.className||t.functionName||t.expressionName,o=n.className||n.functionName||n.expressionName;return a&&a!==o?`${a} (local name: ${o})`:r});throw Error(`Failed to find injection points for: ${JSON.stringify(e)}`)}if(r){U6??=b6.SourceMapConsumer,W6??=b6.SourceMapGenerator;let e=`${C6(this,D6)}/${C6(this,k6)}`,t;if(n){let r=new U6(n);r.file=e,t=W6.fromSourceMap(r)}else t=new W6({file:e});return{code:V6(r,{sourceMap:t}),map:t.toString()}}return{code:e}}};D6=new WeakMap,O6=new WeakMap,k6=new WeakMap,A6=new WeakMap,j6=new WeakMap,M6=new WeakMap,N6=new WeakSet,P6=function(e,...t){let n=C6(this,M6)[e.operator]??H6[e.operator],{index:r=0}=e.functionQuery,[i]=t,a=i.init?.type||i.type;a!==`ClassDeclaration`&&a!==`ClassExpression`&&(i.type===`VariableDeclarator`||(e.functionIndex=++e.functionIndex||0,r!==null&&r!==e.functionIndex))||n(e,...t)},F6=function({transform:e,functionQuery:{kind:t}}){if(e)return e;switch(t){case`Async`:return`tracePromise`;case`Auto`:return`traceAuto`;case`Callback`:return`traceCallback`;case`Sync`:return`traceSync`;default:return`traceSync`}},I6=function(e){let t={};for(let n of e.body)if(n.type===`ExportNamedDeclaration`&&!n.source){for(let e of n.specifiers)if(e.exported&&e.local){let n=e.exported.name??e.exported.value,r=e.local.name??e.local.value;n&&r&&(t[n]=r)}}return t},L6=function(e,t){if(!e.isExportAlias)return e;let{functionName:n,expressionName:r,className:i}=e;return n&&t[n]?{...e,functionName:t[n]}:r&&t[r]?{...e,expressionName:t[r]}:i&&t[i]?{...e,className:t[i]}:e},R6=function(e){let{functionName:t,expressionName:n,className:r,objectName:i,propertyName:a}=e,o=e.privateMethodName?`PrivateIdentifier`:`Identifier`,s=[],c=e.methodName||e.privateMethodName;if(r?(c??=`constructor`,s.push(`[id.name="${r}"]`,`[id.name="${r}"] > ClassExpression`,`[id.name="${r}"] > ClassBody > [key.name="${c}"][key.type=${o}] > [async]`,`[id.name="${r}"] > ClassExpression > ClassBody > [key.name="${c}"][key.type=${o}] > [async]`)):c&&s.push(`ClassBody > [key.name="${c}"][key.type=${o}] > [async]`,`Property[key.name="${c}"][key.type=${o}] > [async]`),t?s.push(`FunctionDeclaration[id.name="${t}"][async]`):n&&s.push(`FunctionExpression[id.name="${n}"][async]`,`ArrowFunctionExpression[id.name="${n}"][async]`,`VariableDeclarator[id.name="${n}"] > FunctionExpression[async]`,`VariableDeclarator[id.name="${n}"] > ArrowFunctionExpression[async]`,`AssignmentExpression[left.property.name="${n}"] > FunctionExpression[async]`,`AssignmentExpression[left.property.name="${n}"] > ArrowFunctionExpression[async]`,`AssignmentExpression[left.name="${n}"] > FunctionExpression[async]`,`AssignmentExpression[left.name="${n}"] > ArrowFunctionExpression[async]`),i||a){if(!i||!a)throw Error(`functionQuery: 'objectName' and 'propertyName' must be used together (got objectName=${i}, propertyName=${a})`);let e=i===`this`?`left.object.type=ThisExpression`:`left.object.name="${i}"`;s.push(`AssignmentExpression[${e}][left.property.name="${a}"] > [async]`)}return s.join(`, `)};var K6={Transformer:G6},q6=e=>{throw TypeError(e)},J6=(e,t,n)=>t.has(e)||q6(`Cannot `+n),Y6=(e,t,n)=>(J6(e,t,`read from private field`),n?n.call(e):t.get(e)),X6=(e,t,n)=>t.has(e)?q6(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Z6=(e,t,n,r)=>(J6(e,t,`write to private field`),t.set(e,n),n),Q6,$6,e8,t8,n8=b3,{Transformer:r8}=K6,i8=class{constructor(e,t){X6(this,Q6,[]),X6(this,$6,null),X6(this,e8,{}),X6(this,t8,{}),Z6(this,Q6,e),Z6(this,$6,t||`diagnostics_channel`)}free(){Z6(this,e8,{})}addTransform(e,t){Y6(this,t8)[e]=t}getTransformer(e,t,n){n=n.replace(/\\/g,`/`);let r=`${e}/${n}@${t}`;if(Y6(this,e8)[r])return Y6(this,e8)[r];let i=Y6(this,Q6).filter(({module:r})=>r.name===e&&(typeof r.filePath==`string`?r.filePath===n:r.filePath.test(n))&&n8(t,r.versionRange));if(i.length!==0)return Y6(this,e8)[r]=new r8(e,t,n,i,Y6(this,$6),Y6(this,t8)),Y6(this,e8)[r]}};Q6=new WeakMap,$6=new WeakMap,e8=new WeakMap,t8=new WeakMap;var{InstrumentationMatcher:a8}={InstrumentationMatcher:i8};function o8(e,t){return new a8(e,t)}var s8={create:o8},c8=me.sep,l8=function(e){var t=e.split(c8),n=t.lastIndexOf(`node_modules`);if(n!==-1&&t[n+1]){for(var r=t[n+1][0]===`@`,i=r?t[n+1]+`/`+t[n+2]:t[n+1],a=r?3:2,o=``,s=n+a-1,c=0;c<=s;c++)o+=c===s?t[c]:t[c]+c8;for(var l=``,u=t.length-1,d=n+a;d<=u;d++)l+=d===u?t[d]:t[d]+c8;return{name:i,basedir:o,path:l}}},u8=y3(l8),{readFileSync:d8}=Te,{join:f8}=me,p8=new Map;function m8(e){if(p8.has(e))return p8.get(e);try{let t=d8(f8(e,`package.json`)),{version:n}=JSON.parse(t);return p8.set(e,n),n}catch{return process.version.slice(1)}}var h8=m8,g8=y3(h8),_8;function v8(e){_8=e}function y8(e){_8&&_8(e)}var b8={setDiagnosticsHook:v8,emitDiagnostics:y8},x8={exports:{}},S8=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)},C8=pe,w8=E,T8=S8,{env:E8}=process,D8;T8(`no-color`)||T8(`no-colors`)||T8(`color=false`)||T8(`color=never`)?D8=0:(T8(`color`)||T8(`colors`)||T8(`color=true`)||T8(`color=always`))&&(D8=1),`FORCE_COLOR`in E8&&(D8=E8.FORCE_COLOR===`true`?1:E8.FORCE_COLOR===`false`?0:E8.FORCE_COLOR.length===0?1:Math.min(parseInt(E8.FORCE_COLOR,10),3));function O8(e){return e!==0&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function k8(e,t){if(D8===0)return 0;if(T8(`color=16m`)||T8(`color=full`)||T8(`color=truecolor`))return 3;if(T8(`color=256`))return 2;if(e&&!t&&D8===void 0)return 0;let n=D8||0;if(E8.TERM===`dumb`)return n;if(process.platform===`win32`){let e=C8.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in E8)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in E8)||E8.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in E8)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(E8.TEAMCITY_VERSION);if(E8.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in E8){let e=parseInt((E8.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(E8.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(E8.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(E8.TERM)||`COLORTERM`in E8?1:n}function A8(e){return O8(k8(e,e&&e.isTTY))}var j8={supportsColor:A8,stdout:O8(k8(!0,w8.isatty(1))),stderr:O8(k8(!0,w8.isatty(2)))},M8=1e3,N8=M8*60,P8=N8*60,F8=P8*24,I8=F8*7,L8=F8*365.25,R8=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return z8(e);if(n===`number`&&isFinite(e))return t.long?V8(e):B8(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function z8(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return n*L8;case`weeks`:case`week`:case`w`:return n*I8;case`days`:case`day`:case`d`:return n*F8;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return n*P8;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return n*N8;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return n*M8;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return n;default:return}}}}function B8(e){var t=Math.abs(e);return t>=F8?Math.round(e/F8)+`d`:t>=P8?Math.round(e/P8)+`h`:t>=N8?Math.round(e/N8)+`m`:t>=M8?Math.round(e/M8)+`s`:e+`ms`}function V8(e){var t=Math.abs(e);return t>=F8?H8(e,t,F8,`day`):t>=P8?H8(e,t,P8,`hour`):t>=N8?H8(e,t,N8,`minute`):t>=M8?H8(e,t,M8,`second`):e+` ms`}function H8(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}function U8(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=R8,n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){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}var W8=U8;(function(e,t){let n=E,r=Fe;t.init=u,t.log=s,t.formatArgs=a,t.save=c,t.load=l,t.useColors=i,t.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{let e=j8;e&&(e.stderr||e).level>=2&&(t.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{}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in t.inspectOpts?!!t.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(t){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \x1B[0m`;t[0]=a+t[0].split(`
|
|
219
|
-
`).join(`
|
|
220
|
-
`+a),t.push(i+`m+`+e.exports.humanize(this.diff)+`\x1B[0m`)}else t[0]=o()+n+` `+t[0]}function o(){return t.inspectOpts.hideDate?``:new Date().toISOString()+` `}function s(...e){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...e)+`
|
|
221
|
-
`)}function c(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(e){e.inspectOpts={};let n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]}e.exports=W8(t);let{formatters:d}=e.exports;d.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(`
|
|
222
|
-
`).map(e=>e.trim()).join(` `)},d.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})(x8,x8.exports);var G8=x8.exports,K8=y3(G8),{create:q8}=s8,J8=ue,Y8=l8,{pathToFileURL:X8}=Ae,Z8=h8,{emitDiagnostics:Q8}=b8,$8=G8(`@apm-js-collab/tracing-hooks:module-patch`),e5=class{constructor({instrumentations:e=[]}={}){this.packages=new Set(e.map(e=>e.module.name)),this.instrumentator=q8(e),this.compile=J8.prototype._compile}patch(){let e=this;J8.prototype._compile=function(...t){let[n,r]=t,i=Y8(r);if(i&&e.packages.has(i.name)){$8(`found resolved module, checking if there is a transformer %s`,r);let a=Z8(i.basedir,i.name),o=e.instrumentator.getTransformer(i.name,a,i.path);if(o){$8(`transforming file %s`,r);try{t[0]=o.transform(n,`cjs`)?.code,Q8({url:X8(r).href,moduleName:o.moduleName}),process.env.TRACING_DUMP&&t5(t[0],r)}catch(e){$8(`Error transforming module %s: %o`,r,e),Q8({url:X8(r).href,moduleName:o.moduleName,error:e})}finally{o.free()}}}return e.compile.apply(this,t)}}unpatch(){J8.prototype._compile=this.compile}};function t5(e,t){let n=pe,r=me,i=Te,a=process.env.TRACING_DUMP_DIR??n.tmpdir(),o=r.dirname(t),s=r.basename(t),c=r.join(a,o),l=r.join(c,s);$8(`Dumping patched code to: %s`,l),i.mkdirSync(c,{recursive:!0}),i.writeFileSync(l,e)}var n5=y3(e5),r5=K8(`@apm-js-collab/tracing-hooks:esm-hook`),i5=null,a5=null,o5=null,s5=b8.emitDiagnostics;function c5(){let{port1:e,port2:t}=new Ge;return e.on(`message`,b8.emitDiagnostics),e.unref(),t}function l5(e={}){let t=e?.instrumentations||[];o5=s8.create(t),a5=new Set(t.map(e=>e.module.name)),i5=new Map,s5=e?.diagnosticsPort?u5(e.diagnosticsPort):b8.emitDiagnostics}function u5(e){return t=>{try{let n=t.error===void 0||t.error instanceof Error?t.error:Error(String(t.error));e.postMessage({...t,error:n})}catch(e){r5(`failed to post diagnostics for %s: %o`,t.url,e)}}}function d5(e){let t=u8(e.url);if(t&&a5.has(t.name)){let n=g8(je(t.basedir)),r=o5.getTransformer(t.name,n,t.path);r&&i5.set(e.url,r)}return e}function f5(e,t,n){return d5(n(e,t))}function p5(e,t,n){let r=n(e,t);if(i5.has(e)===!1)return r;if(r.format===`commonjs`){let t=new URL(r.responseURL??e);r.source??=Oe(t)}return m5(e,r)}function m5(e,t){let n=t.source;if(n){let r=i5.get(e);try{let i=t.format===`module`?`esm`:t.format===`commonjs`?`cjs`:`unknown`,a=typeof n==`string`?n:Buffer.from(n).toString(`utf8`);t.source=r.transform(a,i)?.code,t.shortCircuit=!0,s5({url:e,moduleName:r.moduleName})}catch(t){r5(`Error transforming module %s: %o`,e,t),s5({url:e,moduleName:r.moduleName,error:t})}finally{r.free()}}return t}b8.setDiagnosticsHook;function h5(e){if(e){let{major:t=0,minor:n=0}=In(e);return t>2||t===2&&n>=8}let{major:t=0,minor:n=0}=In(process.versions.node??`0.0.0`);return t>25||t===25&&n>=1||t===24&&n>=13}function g5(e){if(!qe&&!T||O?.__SENTRY_ORCHESTRION__?.runtime)return;let t=globalThis,n=h5(t.Deno?.version?.deno),r=le;b8.setDiagnosticsHook(({moduleName:e,error:t})=>{t?A.warn(`[orchestrion] failed to inject diagnostics-channel into ${e}:`,t):(O.__SENTRY_ORCHESTRION__=O.__SENTRY_ORCHESTRION__||{},O.__SENTRY_ORCHESTRION__.runtime=O.__SENTRY_ORCHESTRION__.runtime||[],O.__SENTRY_ORCHESTRION__.runtime.push(e))});try{if(typeof r.registerHooks==`function`&&n)l5({instrumentations:_3}),r.registerHooks({resolve:f5,load:p5}),A.log(`Registered diagnostics-channel injection via Module.registerHooks()`);else if(typeof r.register==`function`&&!t.Bun&&!t.Deno){let e=c5(),t;t=import.meta.url,r.register(`@sentry/server-utils/orchestrion/hook`,{parentURL:t,data:{instrumentations:_3,diagnosticsPort:e},transferList:[e]}),new n5({instrumentations:_3}).patch(),A.log(`Registered diagnostics-channel injection via Module.register()`)}else{A.warn(`No available Node API to register diagnostics-channel injection hooks; skipping.`);return}}catch(e){A.warn(`Failed to register diagnostics-channel injection hooks; channel-based integrations will not record spans.`,e);return}O.__SENTRY_ORCHESTRION__=O.__SENTRY_ORCHESTRION__||{},O.__SENTRY_ORCHESTRION__.runtime=O.__SENTRY_ORCHESTRION__.runtime||[]}function _5(){return x0}function v5(e){wV(()=>{let e=Object.values(x0).map(e=>e()),t=e.map(e=>e.name);return{integrations:[...e,AX({responseHook:BV}),b0({responseHook:BV})],replacedOtelIntegrationNames:t,register:()=>g5(),detect:r0}})}export{PT as NODE_VERSION,RM as NodeClient,A4 as OpenFeatureIntegrationHook,k as SDK_VERSION,F as SEMANTIC_ATTRIBUTE_SENTRY_OP,I as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,Ar as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,kr as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,rr as Scope,AA as SentryContextManager,SN as _INTERNAL_normalizeCollectionInterval,Gf as addBreadcrumb,pu as addEventProcessor,ju as addIntegration,q2 as amqplibIntegration,sN as anrIntegration,p4 as anthropicAIIntegration,p3 as applyDiagnosticsChannelInjectionIntegrations,Io as bindScopeToEmitter,O4 as buildLaunchDarklyFlagUsedHandler,yu as captureCheckIn,Wp as captureConsoleIntegration,Ql as captureEvent,H as captureException,sh as captureFeedback,Zl as captureMessage,_u as captureSession,IA as childProcessIntegration,uu as close,XU as connectIntegration,fM as consoleIntegration,mh as consoleLoggingIntegration,xj as contextLinesIntegration,lo as continueTrace,xh as createConsolaReporter,PM as createGetModuleFromFilename,Iy as createLangChainCallbackHandler,ON as createSentryWinstonTransport,bd as createTransport,UN as cron,t2 as dataloaderIntegration,qp as dedupeIntegration,IM as defaultStackParser,_5 as diagnosticsChannelInjectionIntegrations,lN as disableAnrDetectionForCallback,hu as endSession,Zf as eventFiltersIntegration,v5 as experimentalUseDiagnosticsChannelInjection,XS as expressErrorHandler,DP as expressIntegration,tm as extraErrorDataIntegration,XR as fastifyIntegration,Qm as featureFlagsIntegration,$4 as firebaseIntegration,lu as flush,yP as fsIntegration,Jf as functionToStringIntegration,Y as generateInstrumentOnce,U0 as genericPoolIntegration,R as getActiveSpan,e3 as getAutoPerformanceIntegrations,P as getClient,M as getCurrentScope,f3 as getDefaultIntegrations,d3 as getDefaultIntegrationsWithoutPerformance,Tr as getGlobalScope,N as getIsolationScope,ra as getRootSpan,FM as getSentryRelease,na as getSpanDescendants,Jr as getSpanStatusFromHttpCode,Tf as getTraceData,Af as getTraceMetaTags,_4 as googleGenAIIntegration,Rz as graphqlIntegration,N4 as growthbookIntegration,uU as hapiIntegration,CU as honoIntegration,Rf as httpHeadersToSpanAttributes,KN as httpIntegration,nw as httpServerIntegration,sw as httpServerSpansIntegration,Qf as inboundFiltersIntegration,m3 as init,a3 as initOpenTelemetry,g3 as initWithoutDefaultIntegrations,Yv as instrumentAnthropicAiClient,fy as instrumentGoogleGenAIClient,Vy as instrumentLangChainEmbeddings,ab as instrumentLangGraph,Sv as instrumentOpenAiClient,ib as instrumentStateGraph,tb as instrumentStateGraphCompile,jm as instrumentSupabaseClient,TV as isDiagnosticsChannelInjectionEnabled,fu as isEnabled,du as isInitialized,oB as kafkaIntegration,w0 as knexIntegration,LU as koaIntegration,S4 as langChainIntegration,E4 as langGraphIntegration,cu as lastEventId,D4 as launchDarklyIntegration,Ep as linkedErrorsIntegration,Rj as localVariablesIntegration,dN as logger,dB as lruMemoizerIntegration,kM as makeNodeTransport,hh as metrics,Hj as modulesIntegration,OB as mongoIntegration,KB as mongooseIntegration,xV as mysql2Integration,iV as mysqlIntegration,qN as nativeNodeFetchIntegration,HA as nodeContextIntegration,CN as nodeRuntimeMetricsIntegration,Xj as onUncaughtExceptionIntegration,eM as onUnhandledRejectionIntegration,l4 as openAIIntegration,k4 as openFeatureIntegration,Sf as parameterize,FN as pinoIntegration,RH as postgresIntegration,KH as postgresJsIntegration,o3 as preloadOpenTelemetry,RI as prismaIntegration,sM as processSessionIntegration,oh as profiler,dH as redisIntegration,Mp as requestDataIntegration,pm as rewriteFramesIntegration,au as setAttribute,iu as setAttributes,$l as setContext,su as setConversationId,Qd as setCurrentClient,tu as setExtra,eu as setExtras,Yr as setHttpStatus,Ga as setMeasurement,EA as setNodeAsyncContextStrategy,ru as setTag,nu as setTags,ou as setUser,QU as setupConnectErrorHandler,wP as setupExpressErrorHandler,ZR as setupFastifyErrorHandler,mU as setupHapiErrorHandler,DU as setupHonoErrorHandler,RU as setupKoaErrorHandler,fb as spanStreamingIntegration,Sa as spanToBaggageHeader,L as spanToJSON,Ri as spanToTraceHeader,lM as spotlightIntegration,B as startInactiveSpan,po as startNewTrace,mu as startSession,z as startSpan,oo as startSpanManual,j4 as statsigIntegration,Pm as supabaseIntegration,uo as suppressTracing,_M as systemErrorIntegration,L0 as tediousIntegration,xb as trpcMiddleware,M4 as unleashIntegration,oa as updateSpanName,GM as validateOpenTelemetrySetup,a4 as vercelAIIntegration,Pf as winterCGHeadersToDict,V as withActiveSpan,Dr as withIsolationScope,vu as withMonitor,Er as withScope,Ca as withStreamedSpan,pS as wrapMcpServerWithSentry,Hm as zodErrorsIntegration};
|