@tanagram/lore 0.1.111 → 0.1.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
3
|
-
var Sqe=Object.create;var $2=Object.defineProperty;var yqe=Object.getOwnPropertyDescriptor;var Tqe=Object.getOwnPropertyNames;var Cqe=Object.getPrototypeOf,Iqe=Object.prototype.hasOwnProperty;var Fe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ja=(e,t)=>{for(var n in t)$2(e,n,{get:t[n],enumerable:!0})},fle=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tqe(t))!Iqe.call(e,o)&&o!==n&&$2(e,o,{get:()=>t[o],enumerable:!(r=yqe(t,o))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Sqe(Cqe(e)):{},fle(t||!e||!e.__esModule?$2(n,"default",{value:e,enumerable:!0}):n,e)),ke=e=>fle($2({},"__esModule",{value:!0}),e);var A=O(()=>{(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"0.1.111"}}catch{}})()});var Xm,l$=O(()=>{A();Xm="1.9.1"});function bqe(e){let t=new Set([e]),n=new Set,r=e.match(gle);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(d){return d===e};function i(c){return n.add(c),!1}function a(c){return t.add(c),!0}return function(d){if(t.has(d))return!0;if(n.has(d))return!1;let m=d.match(gle);if(!m)return i(d);let h={major:+m[1],minor:+m[2],patch:+m[3],prerelease:m[4]};return h.prerelease!=null||o.major!==h.major?i(d):o.major===0?o.minor===h.minor&&o.patch<=h.patch?a(d):i(d):o.minor<=h.minor?a(d):i(d)}}var gle,hle,_le=O(()=>{A();l$();gle=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;hle=bqe(Xm)});function rA(e,t,n,r=!1){var o;let i=Y1[q1]=(o=Y1[q1])!==null&&o!==void 0?o:{version:Xm};if(!r&&i[e]){let a=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(a.stack||a.message),!1}if(i.version!==Xm){let a=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Xm}`);return n.error(a.stack||a.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Xm}.`),!0}function yl(e){var t,n;let r=(t=Y1[q1])===null||t===void 0?void 0:t.version;if(!(!r||!hle(r)))return(n=Y1[q1])===null||n===void 0?void 0:n[e]}function oA(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Xm}.`);let n=Y1[q1];n&&delete n[e]}var vqe,q1,Y1,hS=O(()=>{A();l$();_le();vqe=Xm.split(".")[0],q1=Symbol.for(`opentelemetry.js.api.${vqe}`),Y1=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function K1(e,t,n){let r=yl("diag");if(r)return r[e](t,...n)}var V2,Ele=O(()=>{A();hS();V2=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return K1("debug",this._namespace,t)}error(...t){return K1("error",this._namespace,t)}info(...t){return K1("info",this._namespace,t)}warn(...t){return K1("warn",this._namespace,t)}verbose(...t){return K1("verbose",this._namespace,t)}}});var ga,q2=O(()=>{A();(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(ga||(ga={}))});function Sle(e,t){e<ga.NONE?e=ga.NONE:e>ga.ALL&&(e=ga.ALL),t=t||{};function n(r,o){let i=t[r];return typeof i=="function"&&e>=o?i.bind(t):function(){}}return{error:n("error",ga.ERROR),warn:n("warn",ga.WARN),info:n("info",ga.INFO),debug:n("debug",ga.DEBUG),verbose:n("verbose",ga.VERBOSE)}}var yle=O(()=>{A();q2()});var Rqe,za,_S=O(()=>{A();Ele();yle();q2();hS();Rqe="diag",za=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let a=yl("diag");if(a)return a[o](...i)}}let n=this,r=(o,i={logLevel:ga.INFO})=>{var a,c,d;if(o===n){let S=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((a=S.stack)!==null&&a!==void 0?a:S.message),!1}typeof i=="number"&&(i={logLevel:i});let m=yl("diag"),h=Sle((c=i.logLevel)!==null&&c!==void 0?c:ga.INFO,o);if(m&&!i.suppressOverrideMessage){let S=(d=new Error().stack)!==null&&d!==void 0?d:"<failed to generate stacktrace>";m.warn(`Current logger will be overwritten from ${S}`),h.warn(`Current logger will overwrite one already registered from ${S}`)}return rA("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{oA(Rqe,n)},n.createComponentLogger=o=>new V2(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var Y2,Tle=O(()=>{A();Y2=class e{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){let n=this._entries.get(t);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let r of t)n._entries.delete(r);return n}clear(){return new e}}});var Cle,Ile=O(()=>{A();Cle=Symbol("BaggageEntryMetadata")});function ble(e={}){return new Y2(new Map(Object.entries(e)))}function vle(e){return typeof e!="string"&&(xqe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:Cle,toString(){return e}}}var xqe,d$=O(()=>{A();_S();Tle();Ile();xqe=za.instance()});function Tl(e){return Symbol.for(e)}var p$,wI,J1=O(()=>{A();p$=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let i=new e(n._currentContext);return i._currentContext.set(r,o),i},n.deleteValue=r=>{let o=new e(n._currentContext);return o._currentContext.delete(r),o}}},wI=new p$});var f$,A$,K2,Rle=O(()=>{A();f$=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],A$={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(A$[t]=console[t])}K2=class{constructor(){function t(n){return function(...r){let o=A$[n];if(typeof o!="function"&&(o=A$.log),typeof o!="function"&&console&&(o=console[n],typeof o!="function"&&(o=console.log)),typeof o=="function")return o.apply(console,r)}}for(let n=0;n<f$.length;n++)this[f$[n].n]=t(f$[n].c)}}});function xle(){return C$}var m$,MI,g$,h$,_$,E$,Z1,S$,y$,T$,C$,Dqe,Bqe,Nqe,Oqe,wqe,Mqe,kqe,I$=O(()=>{A();m$=class{constructor(){}createGauge(t,n){return Bqe}createHistogram(t,n){return Nqe}createCounter(t,n){return Dqe}createUpDownCounter(t,n){return Oqe}createObservableGauge(t,n){return Mqe}createObservableCounter(t,n){return wqe}createObservableUpDownCounter(t,n){return kqe}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},MI=class{},g$=class extends MI{add(t,n){}},h$=class extends MI{add(t,n){}},_$=class extends MI{record(t,n){}},E$=class extends MI{record(t,n){}},Z1=class{addCallback(t){}removeCallback(t){}},S$=class extends Z1{},y$=class extends Z1{},T$=class extends Z1{},C$=new m$,Dqe=new g$,Bqe=new _$,Nqe=new E$,Oqe=new h$,wqe=new S$,Mqe=new y$,kqe=new T$});var J2,Dle=O(()=>{A();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(J2||(J2={}))});var Z2,W2,b$=O(()=>{A();Z2={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},W2={set(e,t,n){e!=null&&(e[t]=n)}}});var X2,Ble=O(()=>{A();J1();X2=class{active(){return wI}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var v$,Pqe,iA,W1=O(()=>{A();Ble();hS();_S();v$="context",Pqe=new X2,iA=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return rA(v$,t,za.instance())}active(){return this._getContextManager().active()}with(t,n,r,...o){return this._getContextManager().with(t,n,r,...o)}bind(t,n){return this._getContextManager().bind(t,n)}_getContextManager(){return yl(v$)||Pqe}disable(){this._getContextManager().disable(),oA(v$,za.instance())}}});var qs,R$=O(()=>{A();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(qs||(qs={}))});var X1,ES,eP,tP=O(()=>{A();R$();X1="0000000000000000",ES="00000000000000000000000000000000",eP={traceId:ES,spanId:X1,traceFlags:qs.NONE}});var aA,nP=O(()=>{A();tP();aA=class{constructor(t=eP){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,n){return this}setAttributes(t){return this}addEvent(t,n){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,n){}}});function rP(e){return e.getValue(x$)||void 0}function Nle(){return rP(iA.getInstance().active())}function eB(e,t){return e.setValue(x$,t)}function Ole(e){return e.deleteValue(x$)}function wle(e,t){return eB(e,new aA(t))}function oP(e){var t;return(t=rP(e))===null||t===void 0?void 0:t.spanContext()}var x$,D$=O(()=>{A();J1();nP();W1();x$=Tl("OpenTelemetry Context Key SPAN")});function Mle(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(iP[e.charCodeAt(r)]|0)+(iP[e.charCodeAt(r+1)]|0)+(iP[e.charCodeAt(r+2)]|0)+(iP[e.charCodeAt(r+3)]|0);return n===t}function B$(e){return Mle(e,32)&&e!==ES}function N$(e){return Mle(e,16)&&e!==X1}function eg(e){return B$(e.traceId)&&N$(e.spanId)}function kle(e){return new aA(e)}var iP,aP=O(()=>{A();tP();nP();iP=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])});function Uqe(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}var O$,kI,w$=O(()=>{A();W1();D$();nP();aP();O$=iA.getInstance(),kI=class{startSpan(t,n,r=O$.active()){if(!!n?.root)return new aA;let i=r&&oP(r);return Uqe(i)&&eg(i)?new aA(i):new aA}startActiveSpan(t,n,r,o){let i,a,c;if(arguments.length<2)return;arguments.length===2?c=n:arguments.length===3?(i=n,c=r):(i=n,a=r,c=o);let d=a??O$.active(),m=this.startSpan(t,i,d),h=eB(d,m);return O$.with(h,c,void 0,m)}}});var Lqe,PI,M$=O(()=>{A();w$();Lqe=new kI,PI=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}startSpan(t,n,r){return this._getTracer().startSpan(t,n,r)}startActiveSpan(t,n,r,o){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Lqe}}});var sP,Ple=O(()=>{A();w$();sP=class{getTracer(t,n,r){return new kI}}});var Qqe,SS,k$=O(()=>{A();M$();Ple();Qqe=new sP,SS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new PI(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Qqe}setDelegate(t){this._delegate=t}getDelegateTracer(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(t,n,r)}}});var uP,Ule=O(()=>{A();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(uP||(uP={}))});var oo,Lle=O(()=>{A();(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(oo||(oo={}))});var si,Qle=O(()=>{A();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(si||(si={}))});function Fle(e){return jqe.test(e)}function Gle(e){return zqe.test(e)&&!Hqe.test(e)}var P$,Fqe,Gqe,jqe,zqe,Hqe,jle=O(()=>{A();P$="[_0-9a-z-*/]",Fqe=`[a-z]${P$}{0,255}`,Gqe=`[a-z0-9]${P$}{0,240}@[a-z]${P$}{0,13}`,jqe=new RegExp(`^(?:${Fqe}|${Gqe})$`),zqe=/^[ -~]{0,255}[!-~]$/,Hqe=/,|=/});var zle,$qe,Hle,$le,cP,Vle=O(()=>{A();jle();zle=32,$qe=512,Hle=",",$le="=",cP=class e{constructor(t){this._internalState=new Map,t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return Array.from(this._internalState.keys()).reduceRight((t,n)=>(t.push(n+$le+this.get(n)),t),[]).join(Hle)}_parse(t){t.length>$qe||(this._internalState=t.split(Hle).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf($le);if(i!==-1){let a=o.slice(0,i),c=o.slice(i+1,r.length);Fle(a)&&Gle(c)&&n.set(a,c)}return n},new Map),this._internalState.size>zle&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,zle))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function qle(e){return new cP(e)}var Yle=O(()=>{A();Vle()});var Ye,Kle=O(()=>{A();W1();Ye=iA.getInstance()});var Cl,Jle=O(()=>{A();_S();Cl=za.instance()});var U$,Zle,Wle=O(()=>{A();I$();U$=class{getMeter(t,n,r){return C$}},Zle=new U$});var L$,lP,Xle=O(()=>{A();Wle();hS();_S();L$="metrics",lP=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return rA(L$,t,za.instance())}getMeterProvider(){return yl(L$)||Zle}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){oA(L$,za.instance())}}});var Q$,ede=O(()=>{A();Xle();Q$=lP.getInstance()});var dP,tde=O(()=>{A();dP=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function G$(e){return e.getValue(F$)||void 0}function nde(){return G$(iA.getInstance().active())}function rde(e,t){return e.setValue(F$,t)}function ode(e){return e.deleteValue(F$)}var F$,ide=O(()=>{A();W1();J1();F$=Tl("OpenTelemetry Baggage Key")});var j$,Vqe,pP,ade=O(()=>{A();hS();tde();b$();ide();d$();_S();j$="propagation",Vqe=new dP,pP=class e{constructor(){this.createBaggage=ble,this.getBaggage=G$,this.getActiveBaggage=nde,this.setBaggage=rde,this.deleteBaggage=ode}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return rA(j$,t,za.instance())}inject(t,n,r=W2){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=Z2){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){oA(j$,za.instance())}_getGlobalPropagator(){return yl(j$)||Vqe}}});var Hp,sde=O(()=>{A();ade();Hp=pP.getInstance()});var z$,fP,ude=O(()=>{A();hS();k$();aP();D$();_S();z$="trace",fP=class e{constructor(){this._proxyTracerProvider=new SS,this.wrapSpanContext=kle,this.isSpanContextValid=eg,this.deleteSpan=Ole,this.getSpan=rP,this.getActiveSpan=Nle,this.getSpanContext=oP,this.setSpan=eB,this.setSpanContext=wle}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=rA(z$,this._proxyTracerProvider,za.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return yl(z$)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){oA(z$,za.instance()),this._proxyTracerProvider=new SS}}});var zt,cde=O(()=>{A();ude();zt=fP.getInstance()});var Ze={};ja(Ze,{DiagConsoleLogger:()=>K2,DiagLogLevel:()=>ga,INVALID_SPANID:()=>X1,INVALID_SPAN_CONTEXT:()=>eP,INVALID_TRACEID:()=>ES,ProxyTracer:()=>PI,ProxyTracerProvider:()=>SS,ROOT_CONTEXT:()=>wI,SamplingDecision:()=>uP,SpanKind:()=>oo,SpanStatusCode:()=>si,TraceFlags:()=>qs,ValueType:()=>J2,baggageEntryMetadataFromString:()=>vle,context:()=>Ye,createContextKey:()=>Tl,createNoopMeter:()=>xle,createTraceState:()=>qle,default:()=>qqe,defaultTextMapGetter:()=>Z2,defaultTextMapSetter:()=>W2,diag:()=>Cl,isSpanContextValid:()=>eg,isValidSpanId:()=>N$,isValidTraceId:()=>B$,metrics:()=>Q$,propagation:()=>Hp,trace:()=>zt});var qqe,Ge=O(()=>{A();d$();J1();Rle();q2();I$();Dle();b$();M$();k$();Ule();Lle();Qle();R$();Yle();aP();tP();Kle();Jle();ede();sde();cde();qqe={context:Ye,diag:Cl,metrics:Q$,propagation:Hp,trace:zt}});var tB=F(Jh=>{"use strict";A();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.isTracingSuppressed=Jh.unsuppressTracing=Jh.suppressTracing=void 0;var Yqe=(Ge(),ke(Ze)),H$=(0,Yqe.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Kqe(e){return e.setValue(H$,!0)}Jh.suppressTracing=Kqe;function Jqe(e){return e.deleteValue(H$)}Jh.unsuppressTracing=Jqe;function Zqe(e){return e.getValue(H$)===!0}Jh.isTracingSuppressed=Zqe});var $$=F(Ys=>{"use strict";A();Object.defineProperty(Ys,"__esModule",{value:!0});Ys.BAGGAGE_MAX_TOTAL_LENGTH=Ys.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Ys.BAGGAGE_MAX_NAME_VALUE_PAIRS=Ys.BAGGAGE_HEADER=Ys.BAGGAGE_ITEMS_SEPARATOR=Ys.BAGGAGE_PROPERTIES_SEPARATOR=Ys.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Ys.BAGGAGE_KEY_PAIR_SEPARATOR="=";Ys.BAGGAGE_PROPERTIES_SEPARATOR=";";Ys.BAGGAGE_ITEMS_SEPARATOR=",";Ys.BAGGAGE_HEADER="baggage";Ys.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Ys.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Ys.BAGGAGE_MAX_TOTAL_LENGTH=8192});var V$=F(sA=>{"use strict";A();Object.defineProperty(sA,"__esModule",{value:!0});sA.parseKeyPairsIntoRecord=sA.parsePairKeyValue=sA.getKeyPairs=sA.serializeKeyPairs=void 0;var Wqe=(Ge(),ke(Ze)),UI=$$();function Xqe(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?UI.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>UI.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}sA.serializeKeyPairs=Xqe;function e7e(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=UI.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}sA.getKeyPairs=e7e;function lde(e){if(!e)return;let t=e.indexOf(UI.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(UI.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),i=n.substring(r+1).trim();if(!o||!i)return;let a,c;try{a=decodeURIComponent(o),c=decodeURIComponent(i)}catch{return}let d;if(t!==-1&&t<e.length-1){let m=e.substring(t+1);d=(0,Wqe.baggageEntryMetadataFromString)(m)}return{key:a,value:c,metadata:d}}sA.parsePairKeyValue=lde;function t7e(e){let t={};return typeof e=="string"&&e.length>0&&e.split(UI.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=lde(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}sA.parseKeyPairsIntoRecord=t7e});var dde=F(AP=>{"use strict";A();Object.defineProperty(AP,"__esModule",{value:!0});AP.W3CBaggagePropagator=void 0;var q$=(Ge(),ke(Ze)),n7e=tB(),yS=$$(),Y$=V$(),K$=class{inject(t,n,r){let o=q$.propagation.getBaggage(t);if(!o||(0,n7e.isTracingSuppressed)(t))return;let i=(0,Y$.getKeyPairs)(o).filter(c=>c.length<=yS.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,yS.BAGGAGE_MAX_NAME_VALUE_PAIRS),a=(0,Y$.serializeKeyPairs)(i);a.length>0&&r.set(n,yS.BAGGAGE_HEADER,a)}extract(t,n,r){let o=r.get(n,yS.BAGGAGE_HEADER),i=Array.isArray(o)?o.join(yS.BAGGAGE_ITEMS_SEPARATOR):o;if(!i)return t;let a={};return i.length===0||(i.split(yS.BAGGAGE_ITEMS_SEPARATOR).forEach(d=>{let m=(0,Y$.parsePairKeyValue)(d);if(m){let h={value:m.value};m.metadata&&(h.metadata=m.metadata),a[m.key]=h}}),Object.entries(a).length===0)?t:q$.propagation.setBaggage(t,q$.propagation.createBaggage(a))}fields(){return[yS.BAGGAGE_HEADER]}};AP.W3CBaggagePropagator=K$});var pde=F(mP=>{"use strict";A();Object.defineProperty(mP,"__esModule",{value:!0});mP.AnchoredClock=void 0;var J$=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,n){this._monotonicClock=n,this._epochMillis=t.now(),this._performanceMillis=n.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}};mP.AnchoredClock=J$});var hde=F(Zh=>{"use strict";A();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.isAttributeValue=Zh.isAttributeKey=Zh.sanitizeAttributes=void 0;var fde=(Ge(),ke(Ze));function r7e(e){let t={};if(typeof e!="object"||e==null)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ade(n)){fde.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!mde(r)){fde.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}Zh.sanitizeAttributes=r7e;function Ade(e){return typeof e=="string"&&e!==""}Zh.isAttributeKey=Ade;function mde(e){return e==null?!0:Array.isArray(e)?o7e(e):gde(typeof e)}Zh.isAttributeValue=mde;function o7e(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(gde(r)){t=r;continue}return!1}return!1}}return!0}function gde(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var Z$=F(gP=>{"use strict";A();Object.defineProperty(gP,"__esModule",{value:!0});gP.loggingErrorHandler=void 0;var i7e=(Ge(),ke(Ze));function a7e(){return e=>{i7e.diag.error(s7e(e))}}gP.loggingErrorHandler=a7e;function s7e(e){return typeof e=="string"?e:JSON.stringify(u7e(e))}function u7e(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(t[r])return;let o=n[r];o&&(t[r]=String(o))}),n=Object.getPrototypeOf(n);return t}});var Ede=F(LI=>{"use strict";A();Object.defineProperty(LI,"__esModule",{value:!0});LI.globalErrorHandler=LI.setGlobalErrorHandler=void 0;var c7e=Z$(),_de=(0,c7e.loggingErrorHandler)();function l7e(e){_de=e}LI.setGlobalErrorHandler=l7e;function d7e(e){try{_de(e)}catch{}}LI.globalErrorHandler=d7e});var Cde=F(uA=>{"use strict";A();Object.defineProperty(uA,"__esModule",{value:!0});uA.getStringListFromEnv=uA.getBooleanFromEnv=uA.getStringFromEnv=uA.getNumberFromEnv=void 0;var Sde=(Ge(),ke(Ze)),yde=Fe("util");function p7e(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){Sde.diag.warn(`Unknown value ${(0,yde.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}uA.getNumberFromEnv=p7e;function Tde(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}uA.getStringFromEnv=Tde;function f7e(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||Sde.diag.warn(`Unknown value ${(0,yde.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}uA.getBooleanFromEnv=f7e;function A7e(e){return Tde(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}uA.getStringListFromEnv=A7e});var Ide=F(hP=>{"use strict";A();Object.defineProperty(hP,"__esModule",{value:!0});hP._globalThis=void 0;hP._globalThis=globalThis});var bde=F(_P=>{"use strict";A();Object.defineProperty(_P,"__esModule",{value:!0});_P.VERSION=void 0;_P.VERSION="2.6.1"});function Ii(e){let t={},n=e.length;for(let r=0;r<n;r++){let o=e[r];o&&(t[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return t}var W$=O(()=>{A()});var vde,Rde,xde,Dde,Bde,Nde,Ode,wde,Mde,kde,Pde,Ude,Lde,Qde,Fde,Gde,jde,zde,Hde,$de,Vde,qde,Yde,Kde,Jde,Zde,Wde,Xde,epe,tpe,npe,rpe,ope,ipe,ape,spe,upe,cpe,lpe,dpe,ppe,fpe,Ape,mpe,gpe,hpe,_pe,Epe,Spe,ype,Tpe,Cpe,Ipe,bpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,Mpe,kpe,Ppe,Upe,Lpe,Qpe,Fpe,Gpe,jpe,zpe,Hpe,$pe,Vpe,qpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,afe,sfe,ufe,cfe,lfe,dfe,pfe,ffe,Afe,mfe,gfe,hfe,_fe,Efe,Sfe,yfe,Tfe,Cfe,Ife,bfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,Mfe,kfe,Pfe,Ufe,Lfe,Qfe,Ffe,Gfe,jfe,zfe,Hfe,$fe,m7e,X$,g7e,h7e,_7e,E7e,e5,S7e,y7e,T7e,C7e,I7e,b7e,v7e,R7e,x7e,D7e,B7e,N7e,O7e,w7e,M7e,k7e,P7e,U7e,t5,L7e,Q7e,F7e,G7e,j7e,z7e,H7e,$7e,V7e,q7e,Y7e,K7e,n5,J7e,Z7e,r5,o5,W7e,X7e,eYe,tYe,nYe,rYe,oYe,iYe,aYe,sYe,uYe,cYe,lYe,dYe,pYe,fYe,AYe,nB,QI,i5,mYe,gYe,TS,hYe,_Ye,EYe,SYe,a5,s5,yYe,u5,TYe,CYe,IYe,bYe,vYe,RYe,xYe,DYe,BYe,NYe,OYe,wYe,MYe,kYe,PYe,UYe,LYe,QYe,FYe,GYe,jYe,zYe,HYe,c5,$Ye,VYe,qYe,YYe,KYe,JYe,ZYe,WYe,XYe,eKe,tKe,nKe,rKe,oKe,iKe,aKe,sKe,uKe,cKe,l5,lKe,d5,dKe,pKe,fKe,AKe,mKe,gKe,hKe,_Ke,EKe,Vfe,qfe,Yfe,Kfe,Jfe,Zfe,Wfe,Xfe,eAe,tAe,nAe,rAe,oAe,iAe,aAe,sAe,uAe,cAe,lAe,dAe,pAe,fAe,AAe,mAe,gAe,hAe,_Ae,EAe,SAe,yAe,TAe,CAe,IAe,bAe,vAe,RAe,xAe,DAe,BAe,NAe,OAe,wAe,MAe,kAe,PAe,UAe,LAe,SKe,yKe,TKe,CKe,IKe,bKe,vKe,RKe,xKe,DKe,BKe,NKe,OKe,wKe,MKe,kKe,PKe,UKe,LKe,QKe,FKe,GKe,jKe,zKe,HKe,$Ke,VKe,qKe,YKe,KKe,JKe,ZKe,WKe,XKe,eJe,tJe,nJe,rJe,oJe,iJe,aJe,sJe,uJe,cJe,lJe,dJe,pJe,fJe,QAe,FAe,GAe,jAe,zAe,HAe,$Ae,VAe,qAe,YAe,KAe,AJe,mJe,gJe,hJe,_Je,EJe,SJe,yJe,TJe,CJe,IJe,bJe,JAe,ZAe,WAe,XAe,eme,vJe,RJe,xJe,DJe,BJe,NJe,tme,nme,rme,OJe,wJe,MJe,kJe,ome,ime,ame,sme,PJe,UJe,LJe,QJe,FJe,ume,cme,lme,dme,pme,fme,Ame,GJe,jJe,zJe,HJe,$Je,VJe,qJe,YJe,mme,gme,hme,_me,Eme,KJe,JJe,ZJe,WJe,XJe,eZe,Sme,yme,Tme,Cme,Ime,bme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,Mme,kme,Pme,Ume,Lme,Qme,Fme,tZe,nZe,rZe,oZe,iZe,aZe,sZe,uZe,cZe,lZe,dZe,pZe,fZe,AZe,mZe,gZe,hZe,_Ze,EZe,SZe,yZe,TZe,Gme,jme,zme,Hme,$me,CZe,IZe,bZe,vZe,RZe,xZe,Vme,qme,DZe,BZe,NZe,Yme,Kme,OZe,wZe,MZe,Jme,Zme,Wme,Xme,ege,tge,nge,rge,oge,ige,age,sge,uge,cge,lge,dge,pge,kZe,PZe,UZe,LZe,QZe,FZe,GZe,jZe,zZe,HZe,$Ze,VZe,qZe,YZe,KZe,JZe,ZZe,WZe,fge,Age,XZe,eWe,tWe,mge=O(()=>{A();W$();vde="aws.lambda.invoked_arn",Rde="db.system",xde="db.connection_string",Dde="db.user",Bde="db.jdbc.driver_classname",Nde="db.name",Ode="db.statement",wde="db.operation",Mde="db.mssql.instance_name",kde="db.cassandra.keyspace",Pde="db.cassandra.page_size",Ude="db.cassandra.consistency_level",Lde="db.cassandra.table",Qde="db.cassandra.idempotence",Fde="db.cassandra.speculative_execution_count",Gde="db.cassandra.coordinator.id",jde="db.cassandra.coordinator.dc",zde="db.hbase.namespace",Hde="db.redis.database_index",$de="db.mongodb.collection",Vde="db.sql.table",qde="exception.type",Yde="exception.message",Kde="exception.stacktrace",Jde="exception.escaped",Zde="faas.trigger",Wde="faas.execution",Xde="faas.document.collection",epe="faas.document.operation",tpe="faas.document.time",npe="faas.document.name",rpe="faas.time",ope="faas.cron",ipe="faas.coldstart",ape="faas.invoked_name",spe="faas.invoked_provider",upe="faas.invoked_region",cpe="net.transport",lpe="net.peer.ip",dpe="net.peer.port",ppe="net.peer.name",fpe="net.host.ip",Ape="net.host.port",mpe="net.host.name",gpe="net.host.connection.type",hpe="net.host.connection.subtype",_pe="net.host.carrier.name",Epe="net.host.carrier.mcc",Spe="net.host.carrier.mnc",ype="net.host.carrier.icc",Tpe="peer.service",Cpe="enduser.id",Ipe="enduser.role",bpe="enduser.scope",vpe="thread.id",Rpe="thread.name",xpe="code.function",Dpe="code.namespace",Bpe="code.filepath",Npe="code.lineno",Ope="http.method",wpe="http.url",Mpe="http.target",kpe="http.host",Ppe="http.scheme",Upe="http.status_code",Lpe="http.flavor",Qpe="http.user_agent",Fpe="http.request_content_length",Gpe="http.request_content_length_uncompressed",jpe="http.response_content_length",zpe="http.response_content_length_uncompressed",Hpe="http.server_name",$pe="http.route",Vpe="http.client_ip",qpe="aws.dynamodb.table_names",Ype="aws.dynamodb.consumed_capacity",Kpe="aws.dynamodb.item_collection_metrics",Jpe="aws.dynamodb.provisioned_read_capacity",Zpe="aws.dynamodb.provisioned_write_capacity",Wpe="aws.dynamodb.consistent_read",Xpe="aws.dynamodb.projection",efe="aws.dynamodb.limit",tfe="aws.dynamodb.attributes_to_get",nfe="aws.dynamodb.index_name",rfe="aws.dynamodb.select",ofe="aws.dynamodb.global_secondary_indexes",ife="aws.dynamodb.local_secondary_indexes",afe="aws.dynamodb.exclusive_start_table",sfe="aws.dynamodb.table_count",ufe="aws.dynamodb.scan_forward",cfe="aws.dynamodb.segment",lfe="aws.dynamodb.total_segments",dfe="aws.dynamodb.count",pfe="aws.dynamodb.scanned_count",ffe="aws.dynamodb.attribute_definitions",Afe="aws.dynamodb.global_secondary_index_updates",mfe="messaging.system",gfe="messaging.destination",hfe="messaging.destination_kind",_fe="messaging.temp_destination",Efe="messaging.protocol",Sfe="messaging.protocol_version",yfe="messaging.url",Tfe="messaging.message_id",Cfe="messaging.conversation_id",Ife="messaging.message_payload_size_bytes",bfe="messaging.message_payload_compressed_size_bytes",vfe="messaging.operation",Rfe="messaging.consumer_id",xfe="messaging.rabbitmq.routing_key",Dfe="messaging.kafka.message_key",Bfe="messaging.kafka.consumer_group",Nfe="messaging.kafka.client_id",Ofe="messaging.kafka.partition",wfe="messaging.kafka.tombstone",Mfe="rpc.system",kfe="rpc.service",Pfe="rpc.method",Ufe="rpc.grpc.status_code",Lfe="rpc.jsonrpc.version",Qfe="rpc.jsonrpc.request_id",Ffe="rpc.jsonrpc.error_code",Gfe="rpc.jsonrpc.error_message",jfe="message.type",zfe="message.id",Hfe="message.compressed_size",$fe="message.uncompressed_size",m7e=vde,X$=Rde,g7e=xde,h7e=Dde,_7e=Bde,E7e=Nde,e5=Ode,S7e=wde,y7e=Mde,T7e=kde,C7e=Pde,I7e=Ude,b7e=Lde,v7e=Qde,R7e=Fde,x7e=Gde,D7e=jde,B7e=zde,N7e=Hde,O7e=$de,w7e=Vde,M7e=qde,k7e=Yde,P7e=Kde,U7e=Jde,t5=Zde,L7e=Wde,Q7e=Xde,F7e=epe,G7e=tpe,j7e=npe,z7e=rpe,H7e=ope,$7e=ipe,V7e=ape,q7e=spe,Y7e=upe,K7e=cpe,n5=lpe,J7e=dpe,Z7e=ppe,r5=fpe,o5=Ape,W7e=mpe,X7e=gpe,eYe=hpe,tYe=_pe,nYe=Epe,rYe=Spe,oYe=ype,iYe=Tpe,aYe=Cpe,sYe=Ipe,uYe=bpe,cYe=vpe,lYe=Rpe,dYe=xpe,pYe=Dpe,fYe=Bpe,AYe=Npe,nB=Ope,QI=wpe,i5=Mpe,mYe=kpe,gYe=Ppe,TS=Upe,hYe=Lpe,_Ye=Qpe,EYe=Fpe,SYe=Gpe,a5=jpe,s5=zpe,yYe=Hpe,u5=$pe,TYe=Vpe,CYe=qpe,IYe=Ype,bYe=Kpe,vYe=Jpe,RYe=Zpe,xYe=Wpe,DYe=Xpe,BYe=efe,NYe=tfe,OYe=nfe,wYe=rfe,MYe=ofe,kYe=ife,PYe=afe,UYe=sfe,LYe=ufe,QYe=cfe,FYe=lfe,GYe=dfe,jYe=pfe,zYe=ffe,HYe=Afe,c5=mfe,$Ye=gfe,VYe=hfe,qYe=_fe,YYe=Efe,KYe=Sfe,JYe=yfe,ZYe=Tfe,WYe=Cfe,XYe=Ife,eKe=bfe,tKe=vfe,nKe=Rfe,rKe=xfe,oKe=Dfe,iKe=Bfe,aKe=Nfe,sKe=Ofe,uKe=wfe,cKe=Mfe,l5=kfe,lKe=Pfe,d5=Ufe,dKe=Lfe,pKe=Qfe,fKe=Ffe,AKe=Gfe,mKe=jfe,gKe=zfe,hKe=Hfe,_Ke=$fe,EKe=Ii([vde,Rde,xde,Dde,Bde,Nde,Ode,wde,Mde,kde,Pde,Ude,Lde,Qde,Fde,Gde,jde,zde,Hde,$de,Vde,qde,Yde,Kde,Jde,Zde,Wde,Xde,epe,tpe,npe,rpe,ope,ipe,ape,spe,upe,cpe,lpe,dpe,ppe,fpe,Ape,mpe,gpe,hpe,_pe,Epe,Spe,ype,Tpe,Cpe,Ipe,bpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,Mpe,kpe,Ppe,Upe,Lpe,Qpe,Fpe,Gpe,jpe,zpe,Hpe,$pe,Vpe,qpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,afe,sfe,ufe,cfe,lfe,dfe,pfe,ffe,Afe,mfe,gfe,hfe,_fe,Efe,Sfe,yfe,Tfe,Cfe,Ife,bfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,Mfe,kfe,Pfe,Ufe,Lfe,Qfe,Ffe,Gfe,jfe,zfe,Hfe,$fe]),Vfe="other_sql",qfe="mssql",Yfe="mysql",Kfe="oracle",Jfe="db2",Zfe="postgresql",Wfe="redshift",Xfe="hive",eAe="cloudscape",tAe="hsqldb",nAe="progress",rAe="maxdb",oAe="hanadb",iAe="ingres",aAe="firstsql",sAe="edb",uAe="cache",cAe="adabas",lAe="firebird",dAe="derby",pAe="filemaker",fAe="informix",AAe="instantdb",mAe="interbase",gAe="mariadb",hAe="netezza",_Ae="pervasive",EAe="pointbase",SAe="sqlite",yAe="sybase",TAe="teradata",CAe="vertica",IAe="h2",bAe="coldfusion",vAe="cassandra",RAe="hbase",xAe="mongodb",DAe="redis",BAe="couchbase",NAe="couchdb",OAe="cosmosdb",wAe="dynamodb",MAe="neo4j",kAe="geode",PAe="elasticsearch",UAe="memcached",LAe="cockroachdb",SKe=Vfe,yKe=qfe,TKe=Yfe,CKe=Kfe,IKe=Jfe,bKe=Zfe,vKe=Wfe,RKe=Xfe,xKe=eAe,DKe=tAe,BKe=nAe,NKe=rAe,OKe=oAe,wKe=iAe,MKe=aAe,kKe=sAe,PKe=uAe,UKe=cAe,LKe=lAe,QKe=dAe,FKe=pAe,GKe=fAe,jKe=AAe,zKe=mAe,HKe=gAe,$Ke=hAe,VKe=_Ae,qKe=EAe,YKe=SAe,KKe=yAe,JKe=TAe,ZKe=CAe,WKe=IAe,XKe=bAe,eJe=vAe,tJe=RAe,nJe=xAe,rJe=DAe,oJe=BAe,iJe=NAe,aJe=OAe,sJe=wAe,uJe=MAe,cJe=kAe,lJe=PAe,dJe=UAe,pJe=LAe,fJe=Ii([Vfe,qfe,Yfe,Kfe,Jfe,Zfe,Wfe,Xfe,eAe,tAe,nAe,rAe,oAe,iAe,aAe,sAe,uAe,cAe,lAe,dAe,pAe,fAe,AAe,mAe,gAe,hAe,_Ae,EAe,SAe,yAe,TAe,CAe,IAe,bAe,vAe,RAe,xAe,DAe,BAe,NAe,OAe,wAe,MAe,kAe,PAe,UAe,LAe]),QAe="all",FAe="each_quorum",GAe="quorum",jAe="local_quorum",zAe="one",HAe="two",$Ae="three",VAe="local_one",qAe="any",YAe="serial",KAe="local_serial",AJe=QAe,mJe=FAe,gJe=GAe,hJe=jAe,_Je=zAe,EJe=HAe,SJe=$Ae,yJe=VAe,TJe=qAe,CJe=YAe,IJe=KAe,bJe=Ii([QAe,FAe,GAe,jAe,zAe,HAe,$Ae,VAe,qAe,YAe,KAe]),JAe="datasource",ZAe="http",WAe="pubsub",XAe="timer",eme="other",vJe=JAe,RJe=ZAe,xJe=WAe,DJe=XAe,BJe=eme,NJe=Ii([JAe,ZAe,WAe,XAe,eme]),tme="insert",nme="edit",rme="delete",OJe=tme,wJe=nme,MJe=rme,kJe=Ii([tme,nme,rme]),ome="alibaba_cloud",ime="aws",ame="azure",sme="gcp",PJe=ome,UJe=ime,LJe=ame,QJe=sme,FJe=Ii([ome,ime,ame,sme]),ume="ip_tcp",cme="ip_udp",lme="ip",dme="unix",pme="pipe",fme="inproc",Ame="other",GJe=ume,jJe=cme,zJe=lme,HJe=dme,$Je=pme,VJe=fme,qJe=Ame,YJe=Ii([ume,cme,lme,dme,pme,fme,Ame]),mme="wifi",gme="wired",hme="cell",_me="unavailable",Eme="unknown",KJe=mme,JJe=gme,ZJe=hme,WJe=_me,XJe=Eme,eZe=Ii([mme,gme,hme,_me,Eme]),Sme="gprs",yme="edge",Tme="umts",Cme="cdma",Ime="evdo_0",bme="evdo_a",vme="cdma2000_1xrtt",Rme="hsdpa",xme="hsupa",Dme="hspa",Bme="iden",Nme="evdo_b",Ome="lte",wme="ehrpd",Mme="hspap",kme="gsm",Pme="td_scdma",Ume="iwlan",Lme="nr",Qme="nrnsa",Fme="lte_ca",tZe=Sme,nZe=yme,rZe=Tme,oZe=Cme,iZe=Ime,aZe=bme,sZe=vme,uZe=Rme,cZe=xme,lZe=Dme,dZe=Bme,pZe=Nme,fZe=Ome,AZe=wme,mZe=Mme,gZe=kme,hZe=Pme,_Ze=Ume,EZe=Lme,SZe=Qme,yZe=Fme,TZe=Ii([Sme,yme,Tme,Cme,Ime,bme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,Mme,kme,Pme,Ume,Lme,Qme,Fme]),Gme="1.0",jme="1.1",zme="2.0",Hme="SPDY",$me="QUIC",CZe=Gme,IZe=jme,bZe=zme,vZe=Hme,RZe=$me,xZe={HTTP_1_0:Gme,HTTP_1_1:jme,HTTP_2_0:zme,SPDY:Hme,QUIC:$me},Vme="queue",qme="topic",DZe=Vme,BZe=qme,NZe=Ii([Vme,qme]),Yme="receive",Kme="process",OZe=Yme,wZe=Kme,MZe=Ii([Yme,Kme]),Jme=0,Zme=1,Wme=2,Xme=3,ege=4,tge=5,nge=6,rge=7,oge=8,ige=9,age=10,sge=11,uge=12,cge=13,lge=14,dge=15,pge=16,kZe=Jme,PZe=Zme,UZe=Wme,LZe=Xme,QZe=ege,FZe=tge,GZe=nge,jZe=rge,zZe=oge,HZe=ige,$Ze=age,VZe=sge,qZe=uge,YZe=cge,KZe=lge,JZe=dge,ZZe=pge,WZe={OK:Jme,CANCELLED:Zme,UNKNOWN:Wme,INVALID_ARGUMENT:Xme,DEADLINE_EXCEEDED:ege,NOT_FOUND:tge,ALREADY_EXISTS:nge,PERMISSION_DENIED:rge,RESOURCE_EXHAUSTED:oge,FAILED_PRECONDITION:ige,ABORTED:age,OUT_OF_RANGE:sge,UNIMPLEMENTED:uge,INTERNAL:cge,UNAVAILABLE:lge,DATA_LOSS:dge,UNAUTHENTICATED:pge},fge="SENT",Age="RECEIVED",XZe=fge,eWe=Age,tWe=Ii([fge,Age])});var gge=O(()=>{A();mge()});var hge,_ge,Ege,Sge,yge,Tge,Cge,Ige,bge,vge,Rge,xge,Dge,Bge,Nge,Oge,wge,Mge,kge,Pge,Uge,Lge,Qge,Fge,Gge,jge,zge,Hge,$ge,Vge,qge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,ahe,she,uhe,che,lhe,dhe,phe,fhe,Ahe,mhe,ghe,hhe,_he,Ehe,She,yhe,The,Che,Ihe,bhe,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,Mhe,khe,Phe,Uhe,Lhe,Qhe,Fhe,Ghe,jhe,zhe,nWe,rWe,oWe,iWe,aWe,sWe,uWe,cWe,lWe,dWe,pWe,fWe,AWe,mWe,gWe,hWe,_We,EWe,SWe,yWe,TWe,CWe,IWe,bWe,vWe,RWe,xWe,DWe,BWe,NWe,OWe,wWe,MWe,kWe,PWe,UWe,LWe,QWe,FWe,GWe,jWe,zWe,HWe,$We,VWe,qWe,YWe,KWe,JWe,ZWe,WWe,XWe,eXe,tXe,nXe,rXe,oXe,iXe,aXe,sXe,uXe,cXe,lXe,dXe,pXe,fXe,AXe,mXe,gXe,hXe,_Xe,p5,EXe,SXe,yXe,TXe,CXe,IXe,bXe,vXe,RXe,xXe,Hhe,$he,Vhe,qhe,DXe,BXe,NXe,OXe,wXe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,a_e,s_e,u_e,c_e,l_e,MXe,kXe,PXe,UXe,LXe,QXe,FXe,GXe,jXe,zXe,HXe,$Xe,VXe,qXe,YXe,KXe,JXe,ZXe,d_e,p_e,WXe,XXe,eet,f_e,A_e,m_e,g_e,h_e,__e,E_e,tet,net,ret,oet,iet,aet,set,uet,S_e,y_e,T_e,C_e,I_e,b_e,v_e,R_e,x_e,D_e,B_e,cet,det,pet,fet,Aet,met,get,het,_et,Eet,yet,Tet,N_e,O_e,w_e,M_e,k_e,P_e,U_e,L_e,Q_e,F_e,Cet,Iet,bet,vet,Ret,xet,Det,Bet,Net,Oet,wet,G_e=O(()=>{A();W$();hge="cloud.provider",_ge="cloud.account.id",Ege="cloud.region",Sge="cloud.availability_zone",yge="cloud.platform",Tge="aws.ecs.container.arn",Cge="aws.ecs.cluster.arn",Ige="aws.ecs.launchtype",bge="aws.ecs.task.arn",vge="aws.ecs.task.family",Rge="aws.ecs.task.revision",xge="aws.eks.cluster.arn",Dge="aws.log.group.names",Bge="aws.log.group.arns",Nge="aws.log.stream.names",Oge="aws.log.stream.arns",wge="container.name",Mge="container.id",kge="container.runtime",Pge="container.image.name",Uge="container.image.tag",Lge="deployment.environment",Qge="device.id",Fge="device.model.identifier",Gge="device.model.name",jge="faas.name",zge="faas.id",Hge="faas.version",$ge="faas.instance",Vge="faas.max_memory",qge="host.id",Yge="host.name",Kge="host.type",Jge="host.arch",Zge="host.image.name",Wge="host.image.id",Xge="host.image.version",ehe="k8s.cluster.name",the="k8s.node.name",nhe="k8s.node.uid",rhe="k8s.namespace.name",ohe="k8s.pod.uid",ihe="k8s.pod.name",ahe="k8s.container.name",she="k8s.replicaset.uid",uhe="k8s.replicaset.name",che="k8s.deployment.uid",lhe="k8s.deployment.name",dhe="k8s.statefulset.uid",phe="k8s.statefulset.name",fhe="k8s.daemonset.uid",Ahe="k8s.daemonset.name",mhe="k8s.job.uid",ghe="k8s.job.name",hhe="k8s.cronjob.uid",_he="k8s.cronjob.name",Ehe="os.type",She="os.description",yhe="os.name",The="os.version",Che="process.pid",Ihe="process.executable.name",bhe="process.executable.path",vhe="process.command",Rhe="process.command_line",xhe="process.command_args",Dhe="process.owner",Bhe="process.runtime.name",Nhe="process.runtime.version",Ohe="process.runtime.description",whe="service.name",Mhe="service.namespace",khe="service.instance.id",Phe="service.version",Uhe="telemetry.sdk.name",Lhe="telemetry.sdk.language",Qhe="telemetry.sdk.version",Fhe="telemetry.auto.version",Ghe="webengine.name",jhe="webengine.version",zhe="webengine.description",nWe=hge,rWe=_ge,oWe=Ege,iWe=Sge,aWe=yge,sWe=Tge,uWe=Cge,cWe=Ige,lWe=bge,dWe=vge,pWe=Rge,fWe=xge,AWe=Dge,mWe=Bge,gWe=Nge,hWe=Oge,_We=wge,EWe=Mge,SWe=kge,yWe=Pge,TWe=Uge,CWe=Lge,IWe=Qge,bWe=Fge,vWe=Gge,RWe=jge,xWe=zge,DWe=Hge,BWe=$ge,NWe=Vge,OWe=qge,wWe=Yge,MWe=Kge,kWe=Jge,PWe=Zge,UWe=Wge,LWe=Xge,QWe=ehe,FWe=the,GWe=nhe,jWe=rhe,zWe=ohe,HWe=ihe,$We=ahe,VWe=she,qWe=uhe,YWe=che,KWe=lhe,JWe=dhe,ZWe=phe,WWe=fhe,XWe=Ahe,eXe=mhe,tXe=ghe,nXe=hhe,rXe=_he,oXe=Ehe,iXe=She,aXe=yhe,sXe=The,uXe=Che,cXe=Ihe,lXe=bhe,dXe=vhe,pXe=Rhe,fXe=xhe,AXe=Dhe,mXe=Bhe,gXe=Nhe,hXe=Ohe,_Xe=whe,p5=Mhe,EXe=khe,SXe=Phe,yXe=Uhe,TXe=Lhe,CXe=Qhe,IXe=Fhe,bXe=Ghe,vXe=jhe,RXe=zhe,xXe=Ii([hge,_ge,Ege,Sge,yge,Tge,Cge,Ige,bge,vge,Rge,xge,Dge,Bge,Nge,Oge,wge,Mge,kge,Pge,Uge,Lge,Qge,Fge,Gge,jge,zge,Hge,$ge,Vge,qge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,ahe,she,uhe,che,lhe,dhe,phe,fhe,Ahe,mhe,ghe,hhe,_he,Ehe,She,yhe,The,Che,Ihe,bhe,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,Mhe,khe,Phe,Uhe,Lhe,Qhe,Fhe,Ghe,jhe,zhe]),Hhe="alibaba_cloud",$he="aws",Vhe="azure",qhe="gcp",DXe=Hhe,BXe=$he,NXe=Vhe,OXe=qhe,wXe=Ii([Hhe,$he,Vhe,qhe]),Yhe="alibaba_cloud_ecs",Khe="alibaba_cloud_fc",Jhe="aws_ec2",Zhe="aws_ecs",Whe="aws_eks",Xhe="aws_lambda",e_e="aws_elastic_beanstalk",t_e="azure_vm",n_e="azure_container_instances",r_e="azure_aks",o_e="azure_functions",i_e="azure_app_service",a_e="gcp_compute_engine",s_e="gcp_cloud_run",u_e="gcp_kubernetes_engine",c_e="gcp_cloud_functions",l_e="gcp_app_engine",MXe=Yhe,kXe=Khe,PXe=Jhe,UXe=Zhe,LXe=Whe,QXe=Xhe,FXe=e_e,GXe=t_e,jXe=n_e,zXe=r_e,HXe=o_e,$Xe=i_e,VXe=a_e,qXe=s_e,YXe=u_e,KXe=c_e,JXe=l_e,ZXe=Ii([Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,a_e,s_e,u_e,c_e,l_e]),d_e="ec2",p_e="fargate",WXe=d_e,XXe=p_e,eet=Ii([d_e,p_e]),f_e="amd64",A_e="arm32",m_e="arm64",g_e="ia64",h_e="ppc32",__e="ppc64",E_e="x86",tet=f_e,net=A_e,ret=m_e,oet=g_e,iet=h_e,aet=__e,set=E_e,uet=Ii([f_e,A_e,m_e,g_e,h_e,__e,E_e]),S_e="windows",y_e="linux",T_e="darwin",C_e="freebsd",I_e="netbsd",b_e="openbsd",v_e="dragonflybsd",R_e="hpux",x_e="aix",D_e="solaris",B_e="z_os",cet=S_e,det=y_e,pet=T_e,fet=C_e,Aet=I_e,met=b_e,get=v_e,het=R_e,_et=x_e,Eet=D_e,yet=B_e,Tet=Ii([S_e,y_e,T_e,C_e,I_e,b_e,v_e,R_e,x_e,D_e,B_e]),N_e="cpp",O_e="dotnet",w_e="erlang",M_e="go",k_e="java",P_e="nodejs",U_e="php",L_e="python",Q_e="ruby",F_e="webjs",Cet=N_e,Iet=O_e,bet=w_e,vet=M_e,Ret=k_e,xet=P_e,Det=U_e,Bet=L_e,Net=Q_e,Oet=F_e,wet=Ii([N_e,O_e,w_e,M_e,k_e,P_e,U_e,L_e,Q_e,F_e])});var j_e=O(()=>{A();G_e()});var Met,ket,Pet,Uet,Let,Qet,Fet,Get,jet,zet,Het,$et,Vet,qet,Yet,Ket,Jet,Zet,Wet,Xet,ett,ttt,ntt,rtt,ott,f5,A5,itt,FI,att,m5,g5,stt,CS,utt,ctt,ltt,dtt,ptt,ftt,Att,mtt,gtt,htt,h5,_tt,Ett,Stt,ytt,Ttt,Ctt,IS,Itt,btt,vtt,Rtt,xtt,Dtt,Btt,Ntt,Ott,wtt,Mtt,ktt,Ptt,tg,ng,Utt,Ltt,Qtt,Ftt,Gtt,jtt,ztt,Htt,$tt,Vtt,qtt,Ytt,Ktt,Jtt,Ztt,Wtt,_5,E5,Xtt,S5,y5,ent,tnt,nnt,rnt,ont,int,ant,snt,unt,cnt,lnt,dnt,pnt,fnt,T5,C5,Ant,I5,mnt,b5,gnt,hnt,_nt,Ent,Snt,ynt,Tnt,Cnt,Int,bnt,vnt,Rnt,xnt,Dnt,Bnt,Nnt,Ont,wnt,Mnt,knt,Pnt,Unt,Lnt,Qnt,Wh,Fnt,Gnt,jnt,v5,z_e=O(()=>{A();Met="aspnetcore.diagnostics.exception.result",ket="aborted",Pet="handled",Uet="skipped",Let="unhandled",Qet="aspnetcore.diagnostics.handler.type",Fet="aspnetcore.rate_limiting.policy",Get="aspnetcore.rate_limiting.result",jet="acquired",zet="endpoint_limiter",Het="global_limiter",$et="request_canceled",Vet="aspnetcore.request.is_unhandled",qet="aspnetcore.routing.is_fallback",Yet="aspnetcore.routing.match_status",Ket="failure",Jet="success",Zet="aspnetcore.user.is_authenticated",Wet="client.address",Xet="client.port",ett="code.column.number",ttt="code.file.path",ntt="code.function.name",rtt="code.line.number",ott="code.stacktrace",f5="db.collection.name",A5="db.namespace",itt="db.operation.batch.size",FI="db.operation.name",att="db.query.summary",m5="db.query.text",g5="db.response.status_code",stt="db.stored_procedure.name",CS="db.system.name",utt="mariadb",ctt="microsoft.sql_server",ltt="mysql",dtt="postgresql",ptt="dotnet.gc.heap.generation",ftt="gen0",Att="gen1",mtt="gen2",gtt="loh",htt="poh",h5="error.type",_tt="_OTHER",Ett="exception.escaped",Stt="exception.message",ytt="exception.stacktrace",Ttt="exception.type",Ctt=e=>`http.request.header.${e}`,IS="http.request.method",Itt="_OTHER",btt="CONNECT",vtt="DELETE",Rtt="GET",xtt="HEAD",Dtt="OPTIONS",Btt="PATCH",Ntt="POST",Ott="PUT",wtt="TRACE",Mtt="http.request.method_original",ktt="http.request.resend_count",Ptt=e=>`http.response.header.${e}`,tg="http.response.status_code",ng="http.route",Utt="jvm.gc.action",Ltt="jvm.gc.name",Qtt="jvm.memory.pool.name",Ftt="jvm.memory.type",Gtt="heap",jtt="non_heap",ztt="jvm.thread.daemon",Htt="jvm.thread.state",$tt="blocked",Vtt="new",qtt="runnable",Ytt="terminated",Ktt="timed_waiting",Jtt="waiting",Ztt="network.local.address",Wtt="network.local.port",_5="network.peer.address",E5="network.peer.port",Xtt="network.protocol.name",S5="network.protocol.version",y5="network.transport",ent="pipe",tnt="quic",nnt="tcp",rnt="udp",ont="unix",int="network.type",ant="ipv4",snt="ipv6",unt="otel.scope.name",cnt="otel.scope.version",lnt="otel.status_code",dnt="ERROR",pnt="OK",fnt="otel.status_description",T5="server.address",C5="server.port",Ant="service.instance.id",I5="service.name",mnt="service.namespace",b5="service.version",gnt="signalr.connection.status",hnt="app_shutdown",_nt="normal_closure",Ent="timeout",Snt="signalr.transport",ynt="long_polling",Tnt="server_sent_events",Cnt="web_sockets",Int="telemetry.sdk.language",bnt="cpp",vnt="dotnet",Rnt="erlang",xnt="go",Dnt="java",Bnt="nodejs",Nnt="php",Ont="python",wnt="ruby",Mnt="rust",knt="swift",Pnt="webjs",Unt="telemetry.sdk.name",Lnt="telemetry.sdk.version",Qnt="url.fragment",Wh="url.full",Fnt="url.path",Gnt="url.query",jnt="url.scheme",v5="user_agent.original"});var znt,Hnt,$nt,Vnt,qnt,Ynt,Knt,Jnt,Znt,Wnt,Xnt,ert,trt,nrt,rrt,ort,irt,art,srt,urt,crt,lrt,drt,prt,frt,Art,mrt,grt,hrt,_rt,Ert,Srt,yrt,Trt,Crt,Irt,brt,vrt,Rrt,xrt,Drt,Brt,Nrt,Ort,wrt,Mrt,krt,Prt,Urt,Lrt,Qrt,H_e=O(()=>{A();znt="aspnetcore.diagnostics.exceptions",Hnt="aspnetcore.rate_limiting.active_request_leases",$nt="aspnetcore.rate_limiting.queued_requests",Vnt="aspnetcore.rate_limiting.request.time_in_queue",qnt="aspnetcore.rate_limiting.request_lease.duration",Ynt="aspnetcore.rate_limiting.requests",Knt="aspnetcore.routing.match_attempts",Jnt="db.client.operation.duration",Znt="dotnet.assembly.count",Wnt="dotnet.exceptions",Xnt="dotnet.gc.collections",ert="dotnet.gc.heap.total_allocated",trt="dotnet.gc.last_collection.heap.fragmentation.size",nrt="dotnet.gc.last_collection.heap.size",rrt="dotnet.gc.last_collection.memory.committed_size",ort="dotnet.gc.pause.time",irt="dotnet.jit.compilation.time",art="dotnet.jit.compiled_il.size",srt="dotnet.jit.compiled_methods",urt="dotnet.monitor.lock_contentions",crt="dotnet.process.cpu.count",lrt="dotnet.process.cpu.time",drt="dotnet.process.memory.working_set",prt="dotnet.thread_pool.queue.length",frt="dotnet.thread_pool.thread.count",Art="dotnet.thread_pool.work_item.count",mrt="dotnet.timer.count",grt="http.client.request.duration",hrt="http.server.request.duration",_rt="jvm.class.count",Ert="jvm.class.loaded",Srt="jvm.class.unloaded",yrt="jvm.cpu.count",Trt="jvm.cpu.recent_utilization",Crt="jvm.cpu.time",Irt="jvm.gc.duration",brt="jvm.memory.committed",vrt="jvm.memory.limit",Rrt="jvm.memory.used",xrt="jvm.memory.used_after_last_gc",Drt="jvm.thread.count",Brt="kestrel.active_connections",Nrt="kestrel.active_tls_handshakes",Ort="kestrel.connection.duration",wrt="kestrel.queued_connections",Mrt="kestrel.queued_requests",krt="kestrel.rejected_connections",Prt="kestrel.tls_handshake.duration",Urt="kestrel.upgraded_connections",Lrt="signalr.server.active_connections",Qrt="signalr.server.connection.duration"});var Frt,$_e=O(()=>{A();Frt="exception"});var Ur={};ja(Ur,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>ket,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Pet,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Uet,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Let,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>jet,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>zet,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Het,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>$et,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>Ket,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Jet,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Met,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Qet,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Fet,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Get,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Vet,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>qet,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Yet,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Zet,ATTR_CLIENT_ADDRESS:()=>Wet,ATTR_CLIENT_PORT:()=>Xet,ATTR_CODE_COLUMN_NUMBER:()=>ett,ATTR_CODE_FILE_PATH:()=>ttt,ATTR_CODE_FUNCTION_NAME:()=>ntt,ATTR_CODE_LINE_NUMBER:()=>rtt,ATTR_CODE_STACKTRACE:()=>ott,ATTR_DB_COLLECTION_NAME:()=>f5,ATTR_DB_NAMESPACE:()=>A5,ATTR_DB_OPERATION_BATCH_SIZE:()=>itt,ATTR_DB_OPERATION_NAME:()=>FI,ATTR_DB_QUERY_SUMMARY:()=>att,ATTR_DB_QUERY_TEXT:()=>m5,ATTR_DB_RESPONSE_STATUS_CODE:()=>g5,ATTR_DB_STORED_PROCEDURE_NAME:()=>stt,ATTR_DB_SYSTEM_NAME:()=>CS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>ptt,ATTR_ERROR_TYPE:()=>h5,ATTR_EXCEPTION_ESCAPED:()=>Ett,ATTR_EXCEPTION_MESSAGE:()=>Stt,ATTR_EXCEPTION_STACKTRACE:()=>ytt,ATTR_EXCEPTION_TYPE:()=>Ttt,ATTR_HTTP_REQUEST_HEADER:()=>Ctt,ATTR_HTTP_REQUEST_METHOD:()=>IS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Mtt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>ktt,ATTR_HTTP_RESPONSE_HEADER:()=>Ptt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>tg,ATTR_HTTP_ROUTE:()=>ng,ATTR_JVM_GC_ACTION:()=>Utt,ATTR_JVM_GC_NAME:()=>Ltt,ATTR_JVM_MEMORY_POOL_NAME:()=>Qtt,ATTR_JVM_MEMORY_TYPE:()=>Ftt,ATTR_JVM_THREAD_DAEMON:()=>ztt,ATTR_JVM_THREAD_STATE:()=>Htt,ATTR_NETWORK_LOCAL_ADDRESS:()=>Ztt,ATTR_NETWORK_LOCAL_PORT:()=>Wtt,ATTR_NETWORK_PEER_ADDRESS:()=>_5,ATTR_NETWORK_PEER_PORT:()=>E5,ATTR_NETWORK_PROTOCOL_NAME:()=>Xtt,ATTR_NETWORK_PROTOCOL_VERSION:()=>S5,ATTR_NETWORK_TRANSPORT:()=>y5,ATTR_NETWORK_TYPE:()=>int,ATTR_OTEL_SCOPE_NAME:()=>unt,ATTR_OTEL_SCOPE_VERSION:()=>cnt,ATTR_OTEL_STATUS_CODE:()=>lnt,ATTR_OTEL_STATUS_DESCRIPTION:()=>fnt,ATTR_SERVER_ADDRESS:()=>T5,ATTR_SERVER_PORT:()=>C5,ATTR_SERVICE_INSTANCE_ID:()=>Ant,ATTR_SERVICE_NAME:()=>I5,ATTR_SERVICE_NAMESPACE:()=>mnt,ATTR_SERVICE_VERSION:()=>b5,ATTR_SIGNALR_CONNECTION_STATUS:()=>gnt,ATTR_SIGNALR_TRANSPORT:()=>Snt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Int,ATTR_TELEMETRY_SDK_NAME:()=>Unt,ATTR_TELEMETRY_SDK_VERSION:()=>Lnt,ATTR_URL_FRAGMENT:()=>Qnt,ATTR_URL_FULL:()=>Wh,ATTR_URL_PATH:()=>Fnt,ATTR_URL_QUERY:()=>Gnt,ATTR_URL_SCHEME:()=>jnt,ATTR_USER_AGENT_ORIGINAL:()=>v5,AWSECSLAUNCHTYPEVALUES_EC2:()=>WXe,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>XXe,AwsEcsLaunchtypeValues:()=>eet,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>MXe,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>kXe,CLOUDPLATFORMVALUES_AWS_EC2:()=>PXe,CLOUDPLATFORMVALUES_AWS_ECS:()=>UXe,CLOUDPLATFORMVALUES_AWS_EKS:()=>LXe,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>FXe,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>QXe,CLOUDPLATFORMVALUES_AZURE_AKS:()=>zXe,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>$Xe,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>jXe,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>HXe,CLOUDPLATFORMVALUES_AZURE_VM:()=>GXe,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>JXe,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>KXe,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>qXe,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>VXe,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>YXe,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>DXe,CLOUDPROVIDERVALUES_AWS:()=>BXe,CLOUDPROVIDERVALUES_AZURE:()=>NXe,CLOUDPROVIDERVALUES_GCP:()=>OXe,CloudPlatformValues:()=>ZXe,CloudProviderValues:()=>wXe,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>AJe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>TJe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>mJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>yJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>hJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>IJe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>_Je,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>gJe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>CJe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>SJe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>EJe,DBSYSTEMVALUES_ADABAS:()=>UKe,DBSYSTEMVALUES_CACHE:()=>PKe,DBSYSTEMVALUES_CASSANDRA:()=>eJe,DBSYSTEMVALUES_CLOUDSCAPE:()=>xKe,DBSYSTEMVALUES_COCKROACHDB:()=>pJe,DBSYSTEMVALUES_COLDFUSION:()=>XKe,DBSYSTEMVALUES_COSMOSDB:()=>aJe,DBSYSTEMVALUES_COUCHBASE:()=>oJe,DBSYSTEMVALUES_COUCHDB:()=>iJe,DBSYSTEMVALUES_DB2:()=>IKe,DBSYSTEMVALUES_DERBY:()=>QKe,DBSYSTEMVALUES_DYNAMODB:()=>sJe,DBSYSTEMVALUES_EDB:()=>kKe,DBSYSTEMVALUES_ELASTICSEARCH:()=>lJe,DBSYSTEMVALUES_FILEMAKER:()=>FKe,DBSYSTEMVALUES_FIREBIRD:()=>LKe,DBSYSTEMVALUES_FIRSTSQL:()=>MKe,DBSYSTEMVALUES_GEODE:()=>cJe,DBSYSTEMVALUES_H2:()=>WKe,DBSYSTEMVALUES_HANADB:()=>OKe,DBSYSTEMVALUES_HBASE:()=>tJe,DBSYSTEMVALUES_HIVE:()=>RKe,DBSYSTEMVALUES_HSQLDB:()=>DKe,DBSYSTEMVALUES_INFORMIX:()=>GKe,DBSYSTEMVALUES_INGRES:()=>wKe,DBSYSTEMVALUES_INSTANTDB:()=>jKe,DBSYSTEMVALUES_INTERBASE:()=>zKe,DBSYSTEMVALUES_MARIADB:()=>HKe,DBSYSTEMVALUES_MAXDB:()=>NKe,DBSYSTEMVALUES_MEMCACHED:()=>dJe,DBSYSTEMVALUES_MONGODB:()=>nJe,DBSYSTEMVALUES_MSSQL:()=>yKe,DBSYSTEMVALUES_MYSQL:()=>TKe,DBSYSTEMVALUES_NEO4J:()=>uJe,DBSYSTEMVALUES_NETEZZA:()=>$Ke,DBSYSTEMVALUES_ORACLE:()=>CKe,DBSYSTEMVALUES_OTHER_SQL:()=>SKe,DBSYSTEMVALUES_PERVASIVE:()=>VKe,DBSYSTEMVALUES_POINTBASE:()=>qKe,DBSYSTEMVALUES_POSTGRESQL:()=>bKe,DBSYSTEMVALUES_PROGRESS:()=>BKe,DBSYSTEMVALUES_REDIS:()=>rJe,DBSYSTEMVALUES_REDSHIFT:()=>vKe,DBSYSTEMVALUES_SQLITE:()=>YKe,DBSYSTEMVALUES_SYBASE:()=>KKe,DBSYSTEMVALUES_TERADATA:()=>JKe,DBSYSTEMVALUES_VERTICA:()=>ZKe,DB_SYSTEM_NAME_VALUE_MARIADB:()=>utt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>ctt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>ltt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>dtt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>ftt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Att,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>mtt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>gtt,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>htt,DbCassandraConsistencyLevelValues:()=>bJe,DbSystemValues:()=>fJe,ERROR_TYPE_VALUE_OTHER:()=>_tt,EVENT_EXCEPTION:()=>Frt,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>MJe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>wJe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>OJe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>PJe,FAASINVOKEDPROVIDERVALUES_AWS:()=>UJe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>LJe,FAASINVOKEDPROVIDERVALUES_GCP:()=>QJe,FAASTRIGGERVALUES_DATASOURCE:()=>vJe,FAASTRIGGERVALUES_HTTP:()=>RJe,FAASTRIGGERVALUES_OTHER:()=>BJe,FAASTRIGGERVALUES_PUBSUB:()=>xJe,FAASTRIGGERVALUES_TIMER:()=>DJe,FaasDocumentOperationValues:()=>kJe,FaasInvokedProviderValues:()=>FJe,FaasTriggerValues:()=>NJe,HOSTARCHVALUES_AMD64:()=>tet,HOSTARCHVALUES_ARM32:()=>net,HOSTARCHVALUES_ARM64:()=>ret,HOSTARCHVALUES_IA64:()=>oet,HOSTARCHVALUES_PPC32:()=>iet,HOSTARCHVALUES_PPC64:()=>aet,HOSTARCHVALUES_X86:()=>set,HTTPFLAVORVALUES_HTTP_1_0:()=>CZe,HTTPFLAVORVALUES_HTTP_1_1:()=>IZe,HTTPFLAVORVALUES_HTTP_2_0:()=>bZe,HTTPFLAVORVALUES_QUIC:()=>RZe,HTTPFLAVORVALUES_SPDY:()=>vZe,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>btt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>vtt,HTTP_REQUEST_METHOD_VALUE_GET:()=>Rtt,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>xtt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Dtt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Itt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Btt,HTTP_REQUEST_METHOD_VALUE_POST:()=>Ntt,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Ott,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>wtt,HostArchValues:()=>uet,HttpFlavorValues:()=>xZe,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Gtt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>jtt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>$tt,JVM_THREAD_STATE_VALUE_NEW:()=>Vtt,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>qtt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Ytt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>Ktt,JVM_THREAD_STATE_VALUE_WAITING:()=>Jtt,MESSAGETYPEVALUES_RECEIVED:()=>eWe,MESSAGETYPEVALUES_SENT:()=>XZe,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>DZe,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>BZe,MESSAGINGOPERATIONVALUES_PROCESS:()=>wZe,MESSAGINGOPERATIONVALUES_RECEIVE:()=>OZe,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>znt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Hnt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>$nt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Ynt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>qnt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Vnt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Knt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Jnt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Znt,METRIC_DOTNET_EXCEPTIONS:()=>Wnt,METRIC_DOTNET_GC_COLLECTIONS:()=>Xnt,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>ert,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>trt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>nrt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>rrt,METRIC_DOTNET_GC_PAUSE_TIME:()=>ort,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>irt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>art,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>srt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>urt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>crt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>lrt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>drt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>prt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>frt,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>Art,METRIC_DOTNET_TIMER_COUNT:()=>mrt,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>grt,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>hrt,METRIC_JVM_CLASS_COUNT:()=>_rt,METRIC_JVM_CLASS_LOADED:()=>Ert,METRIC_JVM_CLASS_UNLOADED:()=>Srt,METRIC_JVM_CPU_COUNT:()=>yrt,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Trt,METRIC_JVM_CPU_TIME:()=>Crt,METRIC_JVM_GC_DURATION:()=>Irt,METRIC_JVM_MEMORY_COMMITTED:()=>brt,METRIC_JVM_MEMORY_LIMIT:()=>vrt,METRIC_JVM_MEMORY_USED:()=>Rrt,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>xrt,METRIC_JVM_THREAD_COUNT:()=>Drt,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Brt,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Nrt,METRIC_KESTREL_CONNECTION_DURATION:()=>Ort,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>wrt,METRIC_KESTREL_QUEUED_REQUESTS:()=>Mrt,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>krt,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Prt,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Urt,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Lrt,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Qrt,MessageTypeValues:()=>tWe,MessagingDestinationKindValues:()=>NZe,MessagingOperationValues:()=>MZe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>oZe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>sZe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>nZe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>AZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>iZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>aZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>pZe,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>tZe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>gZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>uZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>lZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>mZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>cZe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>dZe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>_Ze,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>fZe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>yZe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>EZe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>SZe,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>hZe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>rZe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>ZJe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>WJe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>XJe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>KJe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>JJe,NETTRANSPORTVALUES_INPROC:()=>VJe,NETTRANSPORTVALUES_IP:()=>zJe,NETTRANSPORTVALUES_IP_TCP:()=>GJe,NETTRANSPORTVALUES_IP_UDP:()=>jJe,NETTRANSPORTVALUES_OTHER:()=>qJe,NETTRANSPORTVALUES_PIPE:()=>$Je,NETTRANSPORTVALUES_UNIX:()=>HJe,NETWORK_TRANSPORT_VALUE_PIPE:()=>ent,NETWORK_TRANSPORT_VALUE_QUIC:()=>tnt,NETWORK_TRANSPORT_VALUE_TCP:()=>nnt,NETWORK_TRANSPORT_VALUE_UDP:()=>rnt,NETWORK_TRANSPORT_VALUE_UNIX:()=>ont,NETWORK_TYPE_VALUE_IPV4:()=>ant,NETWORK_TYPE_VALUE_IPV6:()=>snt,NetHostConnectionSubtypeValues:()=>TZe,NetHostConnectionTypeValues:()=>eZe,NetTransportValues:()=>YJe,OSTYPEVALUES_AIX:()=>_et,OSTYPEVALUES_DARWIN:()=>pet,OSTYPEVALUES_DRAGONFLYBSD:()=>get,OSTYPEVALUES_FREEBSD:()=>fet,OSTYPEVALUES_HPUX:()=>het,OSTYPEVALUES_LINUX:()=>det,OSTYPEVALUES_NETBSD:()=>Aet,OSTYPEVALUES_OPENBSD:()=>met,OSTYPEVALUES_SOLARIS:()=>Eet,OSTYPEVALUES_WINDOWS:()=>cet,OSTYPEVALUES_Z_OS:()=>yet,OTEL_STATUS_CODE_VALUE_ERROR:()=>dnt,OTEL_STATUS_CODE_VALUE_OK:()=>pnt,OsTypeValues:()=>Tet,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>$Ze,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>GZe,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>PZe,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>JZe,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>QZe,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>HZe,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>YZe,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>LZe,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>FZe,RPCGRPCSTATUSCODEVALUES_OK:()=>kZe,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>VZe,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>jZe,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>zZe,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>ZZe,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>KZe,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>qZe,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>UZe,RpcGrpcStatusCodeValues:()=>WZe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>NYe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>zYe,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>xYe,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>IYe,SEMATTRS_AWS_DYNAMODB_COUNT:()=>GYe,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>PYe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>MYe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>HYe,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>OYe,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>bYe,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>BYe,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>kYe,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>DYe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>vYe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>RYe,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>jYe,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>LYe,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>QYe,SEMATTRS_AWS_DYNAMODB_SELECT:()=>wYe,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>UYe,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>CYe,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>FYe,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>m7e,SEMATTRS_CODE_FILEPATH:()=>fYe,SEMATTRS_CODE_FUNCTION:()=>dYe,SEMATTRS_CODE_LINENO:()=>AYe,SEMATTRS_CODE_NAMESPACE:()=>pYe,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>I7e,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>D7e,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>x7e,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>v7e,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>T7e,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>C7e,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>R7e,SEMATTRS_DB_CASSANDRA_TABLE:()=>b7e,SEMATTRS_DB_CONNECTION_STRING:()=>g7e,SEMATTRS_DB_HBASE_NAMESPACE:()=>B7e,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>_7e,SEMATTRS_DB_MONGODB_COLLECTION:()=>O7e,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>y7e,SEMATTRS_DB_NAME:()=>E7e,SEMATTRS_DB_OPERATION:()=>S7e,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>N7e,SEMATTRS_DB_SQL_TABLE:()=>w7e,SEMATTRS_DB_STATEMENT:()=>e5,SEMATTRS_DB_SYSTEM:()=>X$,SEMATTRS_DB_USER:()=>h7e,SEMATTRS_ENDUSER_ID:()=>aYe,SEMATTRS_ENDUSER_ROLE:()=>sYe,SEMATTRS_ENDUSER_SCOPE:()=>uYe,SEMATTRS_EXCEPTION_ESCAPED:()=>U7e,SEMATTRS_EXCEPTION_MESSAGE:()=>k7e,SEMATTRS_EXCEPTION_STACKTRACE:()=>P7e,SEMATTRS_EXCEPTION_TYPE:()=>M7e,SEMATTRS_FAAS_COLDSTART:()=>$7e,SEMATTRS_FAAS_CRON:()=>H7e,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Q7e,SEMATTRS_FAAS_DOCUMENT_NAME:()=>j7e,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>F7e,SEMATTRS_FAAS_DOCUMENT_TIME:()=>G7e,SEMATTRS_FAAS_EXECUTION:()=>L7e,SEMATTRS_FAAS_INVOKED_NAME:()=>V7e,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>q7e,SEMATTRS_FAAS_INVOKED_REGION:()=>Y7e,SEMATTRS_FAAS_TIME:()=>z7e,SEMATTRS_FAAS_TRIGGER:()=>t5,SEMATTRS_HTTP_CLIENT_IP:()=>TYe,SEMATTRS_HTTP_FLAVOR:()=>hYe,SEMATTRS_HTTP_HOST:()=>mYe,SEMATTRS_HTTP_METHOD:()=>nB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>EYe,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>SYe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>a5,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>s5,SEMATTRS_HTTP_ROUTE:()=>u5,SEMATTRS_HTTP_SCHEME:()=>gYe,SEMATTRS_HTTP_SERVER_NAME:()=>yYe,SEMATTRS_HTTP_STATUS_CODE:()=>TS,SEMATTRS_HTTP_TARGET:()=>i5,SEMATTRS_HTTP_URL:()=>QI,SEMATTRS_HTTP_USER_AGENT:()=>_Ye,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>hKe,SEMATTRS_MESSAGE_ID:()=>gKe,SEMATTRS_MESSAGE_TYPE:()=>mKe,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>_Ke,SEMATTRS_MESSAGING_CONSUMER_ID:()=>nKe,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>WYe,SEMATTRS_MESSAGING_DESTINATION:()=>$Ye,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>VYe,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>aKe,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>iKe,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>oKe,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>sKe,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>uKe,SEMATTRS_MESSAGING_MESSAGE_ID:()=>ZYe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>eKe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>XYe,SEMATTRS_MESSAGING_OPERATION:()=>tKe,SEMATTRS_MESSAGING_PROTOCOL:()=>YYe,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>KYe,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>rKe,SEMATTRS_MESSAGING_SYSTEM:()=>c5,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>qYe,SEMATTRS_MESSAGING_URL:()=>JYe,SEMATTRS_NET_HOST_CARRIER_ICC:()=>oYe,SEMATTRS_NET_HOST_CARRIER_MCC:()=>nYe,SEMATTRS_NET_HOST_CARRIER_MNC:()=>rYe,SEMATTRS_NET_HOST_CARRIER_NAME:()=>tYe,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>eYe,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>X7e,SEMATTRS_NET_HOST_IP:()=>r5,SEMATTRS_NET_HOST_NAME:()=>W7e,SEMATTRS_NET_HOST_PORT:()=>o5,SEMATTRS_NET_PEER_IP:()=>n5,SEMATTRS_NET_PEER_NAME:()=>Z7e,SEMATTRS_NET_PEER_PORT:()=>J7e,SEMATTRS_NET_TRANSPORT:()=>K7e,SEMATTRS_PEER_SERVICE:()=>iYe,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>d5,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>fKe,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>AKe,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>pKe,SEMATTRS_RPC_JSONRPC_VERSION:()=>dKe,SEMATTRS_RPC_METHOD:()=>lKe,SEMATTRS_RPC_SERVICE:()=>l5,SEMATTRS_RPC_SYSTEM:()=>cKe,SEMATTRS_THREAD_ID:()=>cYe,SEMATTRS_THREAD_NAME:()=>lYe,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>uWe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>sWe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>cWe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>lWe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>dWe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>pWe,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>fWe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>mWe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>AWe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>hWe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>gWe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>rWe,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>iWe,SEMRESATTRS_CLOUD_PLATFORM:()=>aWe,SEMRESATTRS_CLOUD_PROVIDER:()=>nWe,SEMRESATTRS_CLOUD_REGION:()=>oWe,SEMRESATTRS_CONTAINER_ID:()=>EWe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>yWe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>TWe,SEMRESATTRS_CONTAINER_NAME:()=>_We,SEMRESATTRS_CONTAINER_RUNTIME:()=>SWe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>CWe,SEMRESATTRS_DEVICE_ID:()=>IWe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>bWe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>vWe,SEMRESATTRS_FAAS_ID:()=>xWe,SEMRESATTRS_FAAS_INSTANCE:()=>BWe,SEMRESATTRS_FAAS_MAX_MEMORY:()=>NWe,SEMRESATTRS_FAAS_NAME:()=>RWe,SEMRESATTRS_FAAS_VERSION:()=>DWe,SEMRESATTRS_HOST_ARCH:()=>kWe,SEMRESATTRS_HOST_ID:()=>OWe,SEMRESATTRS_HOST_IMAGE_ID:()=>UWe,SEMRESATTRS_HOST_IMAGE_NAME:()=>PWe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>LWe,SEMRESATTRS_HOST_NAME:()=>wWe,SEMRESATTRS_HOST_TYPE:()=>MWe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>QWe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>$We,SEMRESATTRS_K8S_CRONJOB_NAME:()=>rXe,SEMRESATTRS_K8S_CRONJOB_UID:()=>nXe,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>XWe,SEMRESATTRS_K8S_DAEMONSET_UID:()=>WWe,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>KWe,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>YWe,SEMRESATTRS_K8S_JOB_NAME:()=>tXe,SEMRESATTRS_K8S_JOB_UID:()=>eXe,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>jWe,SEMRESATTRS_K8S_NODE_NAME:()=>FWe,SEMRESATTRS_K8S_NODE_UID:()=>GWe,SEMRESATTRS_K8S_POD_NAME:()=>HWe,SEMRESATTRS_K8S_POD_UID:()=>zWe,SEMRESATTRS_K8S_REPLICASET_NAME:()=>qWe,SEMRESATTRS_K8S_REPLICASET_UID:()=>VWe,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>ZWe,SEMRESATTRS_K8S_STATEFULSET_UID:()=>JWe,SEMRESATTRS_OS_DESCRIPTION:()=>iXe,SEMRESATTRS_OS_NAME:()=>aXe,SEMRESATTRS_OS_TYPE:()=>oXe,SEMRESATTRS_OS_VERSION:()=>sXe,SEMRESATTRS_PROCESS_COMMAND:()=>dXe,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>fXe,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>pXe,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>cXe,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>lXe,SEMRESATTRS_PROCESS_OWNER:()=>AXe,SEMRESATTRS_PROCESS_PID:()=>uXe,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>hXe,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>mXe,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>gXe,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>EXe,SEMRESATTRS_SERVICE_NAME:()=>_Xe,SEMRESATTRS_SERVICE_NAMESPACE:()=>p5,SEMRESATTRS_SERVICE_VERSION:()=>SXe,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>IXe,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>TXe,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>yXe,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>CXe,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>RXe,SEMRESATTRS_WEBENGINE_NAME:()=>bXe,SEMRESATTRS_WEBENGINE_VERSION:()=>vXe,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>hnt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>_nt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Ent,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>ynt,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Tnt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Cnt,SemanticAttributes:()=>EKe,SemanticResourceAttributes:()=>xXe,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Cet,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Iet,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>bet,TELEMETRYSDKLANGUAGEVALUES_GO:()=>vet,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Ret,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>xet,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Det,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Bet,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Net,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Oet,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>bnt,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>vnt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Rnt,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>xnt,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Dnt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Bnt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>Nnt,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Ont,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>wnt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Mnt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>knt,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Pnt,TelemetrySdkLanguageValues:()=>wet});var Kn=O(()=>{A();gge();j_e();z_e();H_e();$_e()});var V_e=F(EP=>{"use strict";A();Object.defineProperty(EP,"__esModule",{value:!0});EP.ATTR_PROCESS_RUNTIME_NAME=void 0;EP.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var q_e=F(yP=>{"use strict";A();Object.defineProperty(yP,"__esModule",{value:!0});yP.SDK_INFO=void 0;var Grt=bde(),SP=(Kn(),ke(Ur)),jrt=V_e();yP.SDK_INFO={[SP.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[jrt.ATTR_PROCESS_RUNTIME_NAME]:"node",[SP.ATTR_TELEMETRY_SDK_LANGUAGE]:SP.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[SP.ATTR_TELEMETRY_SDK_VERSION]:Grt.VERSION}});var Y_e=F(Ks=>{"use strict";A();Object.defineProperty(Ks,"__esModule",{value:!0});Ks.otperformance=Ks.SDK_INFO=Ks._globalThis=Ks.getStringListFromEnv=Ks.getNumberFromEnv=Ks.getBooleanFromEnv=Ks.getStringFromEnv=void 0;var TP=Cde();Object.defineProperty(Ks,"getStringFromEnv",{enumerable:!0,get:function(){return TP.getStringFromEnv}});Object.defineProperty(Ks,"getBooleanFromEnv",{enumerable:!0,get:function(){return TP.getBooleanFromEnv}});Object.defineProperty(Ks,"getNumberFromEnv",{enumerable:!0,get:function(){return TP.getNumberFromEnv}});Object.defineProperty(Ks,"getStringListFromEnv",{enumerable:!0,get:function(){return TP.getStringListFromEnv}});var zrt=Ide();Object.defineProperty(Ks,"_globalThis",{enumerable:!0,get:function(){return zrt._globalThis}});var Hrt=q_e();Object.defineProperty(Ks,"SDK_INFO",{enumerable:!0,get:function(){return Hrt.SDK_INFO}});Ks.otperformance=performance});var R5=F(Js=>{"use strict";A();Object.defineProperty(Js,"__esModule",{value:!0});Js.getStringListFromEnv=Js.getNumberFromEnv=Js.getStringFromEnv=Js.getBooleanFromEnv=Js.otperformance=Js._globalThis=Js.SDK_INFO=void 0;var bS=Y_e();Object.defineProperty(Js,"SDK_INFO",{enumerable:!0,get:function(){return bS.SDK_INFO}});Object.defineProperty(Js,"_globalThis",{enumerable:!0,get:function(){return bS._globalThis}});Object.defineProperty(Js,"otperformance",{enumerable:!0,get:function(){return bS.otperformance}});Object.defineProperty(Js,"getBooleanFromEnv",{enumerable:!0,get:function(){return bS.getBooleanFromEnv}});Object.defineProperty(Js,"getStringFromEnv",{enumerable:!0,get:function(){return bS.getStringFromEnv}});Object.defineProperty(Js,"getNumberFromEnv",{enumerable:!0,get:function(){return bS.getNumberFromEnv}});Object.defineProperty(Js,"getStringListFromEnv",{enumerable:!0,get:function(){return bS.getStringListFromEnv}})});var W_e=F(io=>{"use strict";A();Object.defineProperty(io,"__esModule",{value:!0});io.addHrTimes=io.isTimeInput=io.isTimeInputHrTime=io.hrTimeToMicroseconds=io.hrTimeToMilliseconds=io.hrTimeToNanoseconds=io.hrTimeToTimeStamp=io.hrTimeDuration=io.timeInputToHrTime=io.hrTime=io.getTimeOrigin=io.millisToHrTime=void 0;var CP=R5(),K_e=9,$rt=6,Vrt=Math.pow(10,$rt),IP=Math.pow(10,K_e);function rB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*Vrt);return[n,r]}io.millisToHrTime=rB;function qrt(){return CP.otperformance.timeOrigin}io.getTimeOrigin=qrt;function J_e(e){let t=rB(CP.otperformance.timeOrigin),n=rB(typeof e=="number"?e:CP.otperformance.now());return Z_e(t,n)}io.hrTime=J_e;function Yrt(e){if(x5(e))return e;if(typeof e=="number")return e<CP.otperformance.timeOrigin?J_e(e):rB(e);if(e instanceof Date)return rB(e.getTime());throw TypeError("Invalid input type")}io.timeInputToHrTime=Yrt;function Krt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=IP),[n,r]}io.hrTimeDuration=Krt;function Jrt(e){let t=K_e,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}io.hrTimeToTimeStamp=Jrt;function Zrt(e){return e[0]*IP+e[1]}io.hrTimeToNanoseconds=Zrt;function Wrt(e){return e[0]*1e3+e[1]/1e6}io.hrTimeToMilliseconds=Wrt;function Xrt(e){return e[0]*1e6+e[1]/1e3}io.hrTimeToMicroseconds=Xrt;function x5(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}io.isTimeInputHrTime=x5;function eot(e){return x5(e)||typeof e=="number"||e instanceof Date}io.isTimeInput=eot;function Z_e(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=IP&&(n[1]-=IP,n[0]+=1),n}io.addHrTimes=Z_e});var X_e=F(bP=>{"use strict";A();Object.defineProperty(bP,"__esModule",{value:!0});bP.unrefTimer=void 0;function tot(e){typeof e!="number"&&e.unref()}bP.unrefTimer=tot});var eEe=F(oB=>{"use strict";A();Object.defineProperty(oB,"__esModule",{value:!0});oB.ExportResultCode=void 0;var not;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(not=oB.ExportResultCode||(oB.ExportResultCode={}))});var nEe=F(vP=>{"use strict";A();Object.defineProperty(vP,"__esModule",{value:!0});vP.CompositePropagator=void 0;var tEe=(Ge(),ke(Ze)),D5=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,r)=>n.concat(r),[])))}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){tEe.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${i.message}`)}}extract(t,n,r){return this._propagators.reduce((o,i)=>{try{return i.extract(o,n,r)}catch(a){tEe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${a.message}`)}return o},t)}fields(){return this._fields.slice()}};vP.CompositePropagator=D5});var rEe=F(GI=>{"use strict";A();Object.defineProperty(GI,"__esModule",{value:!0});GI.validateValue=GI.validateKey=void 0;var B5="[_0-9a-z-*/]",rot=`[a-z]${B5}{0,255}`,oot=`[a-z0-9]${B5}{0,240}@[a-z]${B5}{0,13}`,iot=new RegExp(`^(?:${rot}|${oot})$`),aot=/^[ -~]{0,255}[!-~]$/,sot=/,|=/;function uot(e){return iot.test(e)}GI.validateKey=uot;function cot(e){return aot.test(e)&&!sot.test(e)}GI.validateValue=cot});var O5=F(RP=>{"use strict";A();Object.defineProperty(RP,"__esModule",{value:!0});RP.TraceState=void 0;var oEe=rEe(),iEe=32,lot=512,aEe=",",sEe="=",N5=class e{_internalState=new Map;constructor(t){t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,n)=>(t.push(n+sEe+this.get(n)),t),[]).join(aEe)}_parse(t){t.length>lot||(this._internalState=t.split(aEe).reverse().reduce((n,r)=>{let o=r.trim(),i=o.indexOf(sEe);if(i!==-1){let a=o.slice(0,i),c=o.slice(i+1,r.length);(0,oEe.validateKey)(a)&&(0,oEe.validateValue)(c)&&n.set(a,c)}return n},new Map),this._internalState.size>iEe&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,iEe))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}};RP.TraceState=N5});var cEe=F(Zs=>{"use strict";A();Object.defineProperty(Zs,"__esModule",{value:!0});Zs.W3CTraceContextPropagator=Zs.parseTraceParent=Zs.TRACE_STATE_HEADER=Zs.TRACE_PARENT_HEADER=void 0;var xP=(Ge(),ke(Ze)),dot=tB(),pot=O5();Zs.TRACE_PARENT_HEADER="traceparent";Zs.TRACE_STATE_HEADER="tracestate";var fot="00",Aot="(?!ff)[\\da-f]{2}",mot="(?![0]{32})[\\da-f]{32}",got="(?![0]{16})[\\da-f]{16}",hot="[\\da-f]{2}",_ot=new RegExp(`^\\s?(${Aot})-(${mot})-(${got})-(${hot})(-.*)?\\s?$`);function uEe(e){let t=_ot.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}Zs.parseTraceParent=uEe;var w5=class{inject(t,n,r){let o=xP.trace.getSpanContext(t);if(!o||(0,dot.isTracingSuppressed)(t)||!(0,xP.isSpanContextValid)(o))return;let i=`${fot}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||xP.TraceFlags.NONE).toString(16)}`;r.set(n,Zs.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,Zs.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,Zs.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let a=uEe(i);if(!a)return t;a.isRemote=!0;let c=r.get(n,Zs.TRACE_STATE_HEADER);if(c){let d=Array.isArray(c)?c.join(","):c;a.traceState=new pot.TraceState(typeof d=="string"?d:void 0)}return xP.trace.setSpanContext(t,a)}fields(){return[Zs.TRACE_PARENT_HEADER,Zs.TRACE_STATE_HEADER]}};Zs.W3CTraceContextPropagator=w5});var lEe=F($p=>{"use strict";A();Object.defineProperty($p,"__esModule",{value:!0});$p.getRPCMetadata=$p.deleteRPCMetadata=$p.setRPCMetadata=$p.RPCType=void 0;var Eot=(Ge(),ke(Ze)),M5=(0,Eot.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Sot;(function(e){e.HTTP="http"})(Sot=$p.RPCType||($p.RPCType={}));function yot(e,t){return e.setValue(M5,t)}$p.setRPCMetadata=yot;function Tot(e){return e.deleteValue(M5)}$p.deleteRPCMetadata=Tot;function Cot(e){return e.getValue(M5)}$p.getRPCMetadata=Cot});var mEe=F(DP=>{"use strict";A();Object.defineProperty(DP,"__esModule",{value:!0});DP.isPlainObject=void 0;var Iot="[object Object]",bot="[object Null]",vot="[object Undefined]",Rot=Function.prototype,dEe=Rot.toString,xot=dEe.call(Object),Dot=Object.getPrototypeOf,pEe=Object.prototype,fEe=pEe.hasOwnProperty,vS=Symbol?Symbol.toStringTag:void 0,AEe=pEe.toString;function Bot(e){if(!Not(e)||Oot(e)!==Iot)return!1;let t=Dot(e);if(t===null)return!0;let n=fEe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&dEe.call(n)===xot}DP.isPlainObject=Bot;function Not(e){return e!=null&&typeof e=="object"}function Oot(e){return e==null?e===void 0?vot:bot:vS&&vS in Object(e)?wot(e):Mot(e)}function wot(e){let t=fEe.call(e,vS),n=e[vS],r=!1;try{e[vS]=void 0,r=!0}catch{}let o=AEe.call(e);return r&&(t?e[vS]=n:delete e[vS]),o}function Mot(e){return AEe.call(e)}});var SEe=F(OP=>{"use strict";A();Object.defineProperty(OP,"__esModule",{value:!0});OP.merge=void 0;var gEe=mEe(),kot=20;function Pot(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=_Ee(t,e.shift(),0,n);return t}OP.merge=Pot;function k5(e){return NP(e)?e.slice():e}function _Ee(e,t,n=0,r){let o;if(!(n>kot)){if(n++,BP(e)||BP(t)||EEe(t))o=k5(t);else if(NP(e)){if(o=e.slice(),NP(t))for(let i=0,a=t.length;i<a;i++)o.push(k5(t[i]));else if(iB(t)){let i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){let d=i[a];o[d]=k5(t[d])}}}else if(iB(e))if(iB(t)){if(!Uot(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){let d=i[a],m=t[d];if(BP(m))typeof m>"u"?delete o[d]:o[d]=m;else{let h=o[d],S=m;if(hEe(e,d,r)||hEe(t,d,r))delete o[d];else{if(iB(h)&&iB(S)){let y=r.get(h)||[],I=r.get(S)||[];y.push({obj:e,key:d}),I.push({obj:t,key:d}),r.set(h,y),r.set(S,I)}o[d]=_Ee(o[d],m,n,r)}}}}else o=t;return o}}function hEe(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let a=r[o];if(a.key===t&&a.obj===e)return!0}return!1}function NP(e){return Array.isArray(e)}function EEe(e){return typeof e=="function"}function iB(e){return!BP(e)&&!NP(e)&&!EEe(e)&&typeof e=="object"}function BP(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function Uot(e,t){return!(!(0,gEe.isPlainObject)(e)||!(0,gEe.isPlainObject)(t))}});var yEe=F(jI=>{"use strict";A();Object.defineProperty(jI,"__esModule",{value:!0});jI.callWithTimeout=jI.TimeoutError=void 0;var wP=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};jI.TimeoutError=wP;function Lot(e,t){let n,r=new Promise(function(i,a){n=setTimeout(function(){a(new wP("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}jI.callWithTimeout=Lot});var CEe=F(zI=>{"use strict";A();Object.defineProperty(zI,"__esModule",{value:!0});zI.isUrlIgnored=zI.urlMatches=void 0;function TEe(e,t){return typeof t=="string"?e===t:!!e.match(t)}zI.urlMatches=TEe;function Qot(e,t){if(!t)return!1;for(let n of t)if(TEe(e,n))return!0;return!1}zI.isUrlIgnored=Qot});var IEe=F(MP=>{"use strict";A();Object.defineProperty(MP,"__esModule",{value:!0});MP.Deferred=void 0;var P5=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};MP.Deferred=P5});var bEe=F(kP=>{"use strict";A();Object.defineProperty(kP,"__esModule",{value:!0});kP.BindOnceFuture=void 0;var Fot=IEe(),U5=class{_isCalled=!1;_deferred=new Fot.Deferred;_callback;_that;constructor(t,n){this._callback=t,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};kP.BindOnceFuture=U5});var REe=F(PP=>{"use strict";A();Object.defineProperty(PP,"__esModule",{value:!0});PP.diagLogLevelFromString=void 0;var rg=(Ge(),ke(Ze)),vEe={ALL:rg.DiagLogLevel.ALL,VERBOSE:rg.DiagLogLevel.VERBOSE,DEBUG:rg.DiagLogLevel.DEBUG,INFO:rg.DiagLogLevel.INFO,WARN:rg.DiagLogLevel.WARN,ERROR:rg.DiagLogLevel.ERROR,NONE:rg.DiagLogLevel.NONE};function Got(e){if(e==null)return;let t=vEe[e.toUpperCase()];return t??(rg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(vEe)}, using default`),rg.DiagLogLevel.INFO)}PP.diagLogLevelFromString=Got});var DEe=F(UP=>{"use strict";A();Object.defineProperty(UP,"__esModule",{value:!0});UP._export=void 0;var xEe=(Ge(),ke(Ze)),jot=tB();function zot(e,t){return new Promise(n=>{xEe.context.with((0,jot.suppressTracing)(xEe.context.active()),()=>{e.export(t,n)})})}UP._export=zot});var Tr=F(Oe=>{"use strict";A();Object.defineProperty(Oe,"__esModule",{value:!0});Oe.internal=Oe.diagLogLevelFromString=Oe.BindOnceFuture=Oe.urlMatches=Oe.isUrlIgnored=Oe.callWithTimeout=Oe.TimeoutError=Oe.merge=Oe.TraceState=Oe.unsuppressTracing=Oe.suppressTracing=Oe.isTracingSuppressed=Oe.setRPCMetadata=Oe.getRPCMetadata=Oe.deleteRPCMetadata=Oe.RPCType=Oe.parseTraceParent=Oe.W3CTraceContextPropagator=Oe.TRACE_STATE_HEADER=Oe.TRACE_PARENT_HEADER=Oe.CompositePropagator=Oe.otperformance=Oe.getStringListFromEnv=Oe.getNumberFromEnv=Oe.getBooleanFromEnv=Oe.getStringFromEnv=Oe._globalThis=Oe.SDK_INFO=Oe.parseKeyPairsIntoRecord=Oe.ExportResultCode=Oe.unrefTimer=Oe.timeInputToHrTime=Oe.millisToHrTime=Oe.isTimeInputHrTime=Oe.isTimeInput=Oe.hrTimeToTimeStamp=Oe.hrTimeToNanoseconds=Oe.hrTimeToMilliseconds=Oe.hrTimeToMicroseconds=Oe.hrTimeDuration=Oe.hrTime=Oe.getTimeOrigin=Oe.addHrTimes=Oe.loggingErrorHandler=Oe.setGlobalErrorHandler=Oe.globalErrorHandler=Oe.sanitizeAttributes=Oe.isAttributeValue=Oe.AnchoredClock=Oe.W3CBaggagePropagator=void 0;var Hot=dde();Object.defineProperty(Oe,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Hot.W3CBaggagePropagator}});var $ot=pde();Object.defineProperty(Oe,"AnchoredClock",{enumerable:!0,get:function(){return $ot.AnchoredClock}});var BEe=hde();Object.defineProperty(Oe,"isAttributeValue",{enumerable:!0,get:function(){return BEe.isAttributeValue}});Object.defineProperty(Oe,"sanitizeAttributes",{enumerable:!0,get:function(){return BEe.sanitizeAttributes}});var NEe=Ede();Object.defineProperty(Oe,"globalErrorHandler",{enumerable:!0,get:function(){return NEe.globalErrorHandler}});Object.defineProperty(Oe,"setGlobalErrorHandler",{enumerable:!0,get:function(){return NEe.setGlobalErrorHandler}});var Vot=Z$();Object.defineProperty(Oe,"loggingErrorHandler",{enumerable:!0,get:function(){return Vot.loggingErrorHandler}});var vd=W_e();Object.defineProperty(Oe,"addHrTimes",{enumerable:!0,get:function(){return vd.addHrTimes}});Object.defineProperty(Oe,"getTimeOrigin",{enumerable:!0,get:function(){return vd.getTimeOrigin}});Object.defineProperty(Oe,"hrTime",{enumerable:!0,get:function(){return vd.hrTime}});Object.defineProperty(Oe,"hrTimeDuration",{enumerable:!0,get:function(){return vd.hrTimeDuration}});Object.defineProperty(Oe,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return vd.hrTimeToMicroseconds}});Object.defineProperty(Oe,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return vd.hrTimeToMilliseconds}});Object.defineProperty(Oe,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return vd.hrTimeToNanoseconds}});Object.defineProperty(Oe,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return vd.hrTimeToTimeStamp}});Object.defineProperty(Oe,"isTimeInput",{enumerable:!0,get:function(){return vd.isTimeInput}});Object.defineProperty(Oe,"isTimeInputHrTime",{enumerable:!0,get:function(){return vd.isTimeInputHrTime}});Object.defineProperty(Oe,"millisToHrTime",{enumerable:!0,get:function(){return vd.millisToHrTime}});Object.defineProperty(Oe,"timeInputToHrTime",{enumerable:!0,get:function(){return vd.timeInputToHrTime}});var qot=X_e();Object.defineProperty(Oe,"unrefTimer",{enumerable:!0,get:function(){return qot.unrefTimer}});var Yot=eEe();Object.defineProperty(Oe,"ExportResultCode",{enumerable:!0,get:function(){return Yot.ExportResultCode}});var Kot=V$();Object.defineProperty(Oe,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Kot.parseKeyPairsIntoRecord}});var RS=R5();Object.defineProperty(Oe,"SDK_INFO",{enumerable:!0,get:function(){return RS.SDK_INFO}});Object.defineProperty(Oe,"_globalThis",{enumerable:!0,get:function(){return RS._globalThis}});Object.defineProperty(Oe,"getStringFromEnv",{enumerable:!0,get:function(){return RS.getStringFromEnv}});Object.defineProperty(Oe,"getBooleanFromEnv",{enumerable:!0,get:function(){return RS.getBooleanFromEnv}});Object.defineProperty(Oe,"getNumberFromEnv",{enumerable:!0,get:function(){return RS.getNumberFromEnv}});Object.defineProperty(Oe,"getStringListFromEnv",{enumerable:!0,get:function(){return RS.getStringListFromEnv}});Object.defineProperty(Oe,"otperformance",{enumerable:!0,get:function(){return RS.otperformance}});var Jot=nEe();Object.defineProperty(Oe,"CompositePropagator",{enumerable:!0,get:function(){return Jot.CompositePropagator}});var LP=cEe();Object.defineProperty(Oe,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return LP.TRACE_PARENT_HEADER}});Object.defineProperty(Oe,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return LP.TRACE_STATE_HEADER}});Object.defineProperty(Oe,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return LP.W3CTraceContextPropagator}});Object.defineProperty(Oe,"parseTraceParent",{enumerable:!0,get:function(){return LP.parseTraceParent}});var QP=lEe();Object.defineProperty(Oe,"RPCType",{enumerable:!0,get:function(){return QP.RPCType}});Object.defineProperty(Oe,"deleteRPCMetadata",{enumerable:!0,get:function(){return QP.deleteRPCMetadata}});Object.defineProperty(Oe,"getRPCMetadata",{enumerable:!0,get:function(){return QP.getRPCMetadata}});Object.defineProperty(Oe,"setRPCMetadata",{enumerable:!0,get:function(){return QP.setRPCMetadata}});var L5=tB();Object.defineProperty(Oe,"isTracingSuppressed",{enumerable:!0,get:function(){return L5.isTracingSuppressed}});Object.defineProperty(Oe,"suppressTracing",{enumerable:!0,get:function(){return L5.suppressTracing}});Object.defineProperty(Oe,"unsuppressTracing",{enumerable:!0,get:function(){return L5.unsuppressTracing}});var Zot=O5();Object.defineProperty(Oe,"TraceState",{enumerable:!0,get:function(){return Zot.TraceState}});var Wot=SEe();Object.defineProperty(Oe,"merge",{enumerable:!0,get:function(){return Wot.merge}});var OEe=yEe();Object.defineProperty(Oe,"TimeoutError",{enumerable:!0,get:function(){return OEe.TimeoutError}});Object.defineProperty(Oe,"callWithTimeout",{enumerable:!0,get:function(){return OEe.callWithTimeout}});var wEe=CEe();Object.defineProperty(Oe,"isUrlIgnored",{enumerable:!0,get:function(){return wEe.isUrlIgnored}});Object.defineProperty(Oe,"urlMatches",{enumerable:!0,get:function(){return wEe.urlMatches}});var Xot=bEe();Object.defineProperty(Oe,"BindOnceFuture",{enumerable:!0,get:function(){return Xot.BindOnceFuture}});var eit=REe();Object.defineProperty(Oe,"diagLogLevelFromString",{enumerable:!0,get:function(){return eit.diagLogLevelFromString}});var tit=DEe();Oe.internal={_export:tit._export}});var MEe=F(FP=>{"use strict";A();Object.defineProperty(FP,"__esModule",{value:!0});FP.VERSION=void 0;FP.VERSION="0.214.0"});var kEe=F(aB=>{"use strict";A();Object.defineProperty(aB,"__esModule",{value:!0});aB.SeverityNumber=void 0;var nit;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(nit=aB.SeverityNumber||(aB.SeverityNumber={}))});var jP=F(HI=>{"use strict";A();Object.defineProperty(HI,"__esModule",{value:!0});HI.NOOP_LOGGER=HI.NoopLogger=void 0;var GP=class{emit(t){}};HI.NoopLogger=GP;HI.NOOP_LOGGER=new GP});var PEe=F(cA=>{"use strict";A();Object.defineProperty(cA,"__esModule",{value:!0});cA.API_BACKWARDS_COMPATIBILITY_VERSION=cA.makeGetter=cA._global=cA.GLOBAL_LOGS_API_KEY=void 0;cA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");cA._global=globalThis;function rit(e,t,n){return r=>r===e?t:n}cA.makeGetter=rit;cA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var Q5=F($I=>{"use strict";A();Object.defineProperty($I,"__esModule",{value:!0});$I.NOOP_LOGGER_PROVIDER=$I.NoopLoggerProvider=void 0;var oit=jP(),zP=class{getLogger(t,n,r){return new oit.NoopLogger}};$I.NoopLoggerProvider=zP;$I.NOOP_LOGGER_PROVIDER=new zP});var UEe=F(HP=>{"use strict";A();Object.defineProperty(HP,"__esModule",{value:!0});HP.ProxyLogger=void 0;var iit=jP(),F5=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):iit.NOOP_LOGGER}};HP.ProxyLogger=F5});var LEe=F($P=>{"use strict";A();Object.defineProperty($P,"__esModule",{value:!0});$P.ProxyLoggerProvider=void 0;var ait=Q5(),sit=UEe(),G5=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new sit.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:ait.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};$P.ProxyLoggerProvider=G5});var FEe=F(VP=>{"use strict";A();Object.defineProperty(VP,"__esModule",{value:!0});VP.LogsAPI=void 0;var Rd=PEe(),uit=Q5(),QEe=LEe(),j5=class e{constructor(){this._proxyLoggerProvider=new QEe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Rd._global[Rd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Rd._global[Rd.GLOBAL_LOGS_API_KEY]=(0,Rd.makeGetter)(Rd.API_BACKWARDS_COMPATIBILITY_VERSION,t,uit.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Rd._global[Rd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Rd._global,Rd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Rd._global[Rd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new QEe.ProxyLoggerProvider}};VP.LogsAPI=j5});var z5=F(lA=>{"use strict";A();Object.defineProperty(lA,"__esModule",{value:!0});lA.logs=lA.NoopLogger=lA.NOOP_LOGGER=lA.SeverityNumber=void 0;var cit=kEe();Object.defineProperty(lA,"SeverityNumber",{enumerable:!0,get:function(){return cit.SeverityNumber}});var GEe=jP();Object.defineProperty(lA,"NOOP_LOGGER",{enumerable:!0,get:function(){return GEe.NOOP_LOGGER}});Object.defineProperty(lA,"NoopLogger",{enumerable:!0,get:function(){return GEe.NoopLogger}});var lit=FEe();lA.logs=lit.LogsAPI.getInstance()});var jEe=F(VI=>{"use strict";A();Object.defineProperty(VI,"__esModule",{value:!0});VI.disableInstrumentations=VI.enableInstrumentations=void 0;function dit(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}VI.enableInstrumentations=dit;function pit(e){e.forEach(t=>t.disable())}VI.disableInstrumentations=pit});var $Ee=F(qP=>{"use strict";A();Object.defineProperty(qP,"__esModule",{value:!0});qP.registerInstrumentations=void 0;var zEe=(Ge(),ke(Ze)),fit=z5(),HEe=jEe();function Ait(e){let t=e.tracerProvider||zEe.trace.getTracerProvider(),n=e.meterProvider||zEe.metrics.getMeterProvider(),r=e.loggerProvider||fit.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,HEe.enableInstrumentations)(o,t,n,r),()=>{(0,HEe.disableInstrumentations)(o)}}qP.registerInstrumentations=Ait});var e0e=F(YP=>{"use strict";A();Object.defineProperty(YP,"__esModule",{value:!0});YP.satisfies=void 0;var q5=(Ge(),ke(Ze)),JEe=/^(?: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-]+)*))?$/,mit=/^(?<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-]+)*))?$/,git={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function hit(e,t,n){if(!_it(e))return q5.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Tit(e);if(!r)return!1;let o=[],i=ZEe(r,t,o,n);return i&&!n?.includePrerelease?Sit(r,o):i}YP.satisfies=hit;function _it(e){return typeof e=="string"&&JEe.test(e)}function ZEe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(H5(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=zit(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!H5(e,i,n,r))return!1;return!0}return H5(e,t,n,r)}function H5(e,t,n,r){if(t=yit(t,r),t.includes(" "))return ZEe(e,t,n,r);{let o=Cit(t);return n.push(o),Eit(e,o)}}function Eit(e,t){if(t.invalid)return!1;if(!t.version||V5(t.version))return!0;let n=qEe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=qEe(r,o)}return git[t.op]?.includes(n)}function Sit(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function yit(e,t){return e=e.trim(),e=Git(e,t),e=Fit(e),e=jit(e,t),e=e.trim(),e}function Ou(e){return!e||e.toLowerCase()==="x"||e==="*"}function Tit(e){let t=e.match(JEe);if(!t){q5.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function Cit(e){if(!e)return{};let t=e.match(mit);if(!t)return q5.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function V5(e){return e==="*"||e==="x"||e==="X"}function VEe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Iit(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function bit(e,t){if(V5(e)||V5(t))return 0;let[n,r]=Iit(VEe(e),VEe(t));return n>r?1:n<r?-1:0}function qEe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=bit(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var WEe="[a-zA-Z0-9-]",XEe="0|[1-9]\\d*",vit=`\\d*[a-zA-Z-]${WEe}*`,Rit="((?:<|>)?=?)",YEe=`(?:${XEe}|${vit})`,xit=`(?:-(${YEe}(?:\\.${YEe})*))`,KEe=`${WEe}+`,Dit=`(?:\\+(${KEe}(?:\\.${KEe})*))`,$5=`${XEe}|x|X|\\*`,sB=`[v=\\s]*(${$5})(?:\\.(${$5})(?:\\.(${$5})(?:${xit})?${Dit}?)?)?`,Bit=`^${Rit}\\s*${sB}$`,Nit=new RegExp(Bit),Oit=`^\\s*(${sB})\\s+-\\s+(${sB})\\s*$`,wit=new RegExp(Oit),Mit="(?:~>?)",kit=`^${Mit}${sB}$`,Pit=new RegExp(kit),Uit="(?:\\^)",Lit=`^${Uit}${sB}$`,Qit=new RegExp(Lit);function Fit(e){let t=Pit;return e.replace(t,(n,r,o,i,a)=>{let c;return Ou(r)?c="":Ou(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Ou(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function Git(e,t){let n=Qit,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let m;return Ou(i)?m="":Ou(a)?m=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Ou(c)?i==="0"?m=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?m=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?m=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,m})}function jit(e,t){let n=Nit;return e.replace(n,(r,o,i,a,c,d)=>{let m=Ou(i),h=m||Ou(a),S=h||Ou(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",m?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function zit(e,t){let n=wit;return e.replace(n,(r,o,i,a,c,d,m,h,S,y,I,v)=>(Ou(i)?o="":Ou(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Ou(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Ou(S)?h="":Ou(y)?h=`<${+S+1}.0.0-0`:Ou(I)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${I}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+I+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var Y5=F(Ss=>{"use strict";A();Object.defineProperty(Ss,"__esModule",{value:!0});Ss.massUnwrap=Ss.unwrap=Ss.massWrap=Ss.wrap=void 0;var wu=console.error.bind(console);function uB(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 Hit=(e,t,n)=>{if(!e||!e[t]){wu("no original function "+String(t)+" to wrap");return}if(!n){wu("no wrapper function"),wu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){wu("original object and wrapper must be functions");return}let o=n(r,t);return uB(o,"__original",r),uB(o,"__unwrap",()=>{e[t]===o&&uB(e,t,r)}),uB(o,"__wrapped",!0),uB(e,t,o),o};Ss.wrap=Hit;var $it=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{wu("must provide one or more modules to patch"),wu(new Error().stack);return}if(!(t&&Array.isArray(t))){wu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ss.wrap)(r,o,n)})})};Ss.massWrap=$it;var Vit=(e,t)=>{if(!e||!e[t]){wu("no function to unwrap."),wu(new Error().stack);return}let n=e[t];if(!n.__unwrap)wu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ss.unwrap=Vit;var qit=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{wu("must provide one or more modules to patch"),wu(new Error().stack);return}if(!(t&&Array.isArray(t))){wu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ss.unwrap)(n,r)})})};Ss.massUnwrap=qit;function cB(e){e&&e.logger&&(typeof e.logger!="function"?wu("new logger isn't a function, not replacing"):wu=e.logger)}Ss.default=cB;cB.wrap=Ss.wrap;cB.massWrap=Ss.massWrap;cB.unwrap=Ss.unwrap;cB.massUnwrap=Ss.massUnwrap});var t0e=F(JP=>{"use strict";A();Object.defineProperty(JP,"__esModule",{value:!0});JP.InstrumentationAbstract=void 0;var K5=(Ge(),ke(Ze)),Yit=z5(),KP=Y5(),J5=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=K5.diag.createComponentLogger({namespace:t}),this._tracer=K5.trace.getTracer(t,n),this._meter=K5.metrics.getMeter(t,n),this._logger=Yit.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=KP.wrap;_unwrap=KP.unwrap;_massWrap=KP.massWrap;_massUnwrap=KP.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};JP.InstrumentationAbstract=J5});var r0e=F((tqt,n0e)=>{A();var qI=1e3,YI=qI*60,KI=YI*60,xS=KI*24,Kit=xS*7,Jit=xS*365.25;n0e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Zit(e);if(n==="number"&&isFinite(e))return t.long?Xit(e):Wit(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Zit(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]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Jit;case"weeks":case"week":case"w":return n*Kit;case"days":case"day":case"d":return n*xS;case"hours":case"hour":case"hrs":case"hr":case"h":return n*KI;case"minutes":case"minute":case"mins":case"min":case"m":return n*YI;case"seconds":case"second":case"secs":case"sec":case"s":return n*qI;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Wit(e){var t=Math.abs(e);return t>=xS?Math.round(e/xS)+"d":t>=KI?Math.round(e/KI)+"h":t>=YI?Math.round(e/YI)+"m":t>=qI?Math.round(e/qI)+"s":e+"ms"}function Xit(e){var t=Math.abs(e);return t>=xS?ZP(e,t,xS,"day"):t>=KI?ZP(e,t,KI,"hour"):t>=YI?ZP(e,t,YI,"minute"):t>=qI?ZP(e,t,qI,"second"):e+" ms"}function ZP(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var Z5=F((rqt,o0e)=>{A();function eat(e){n.debug=n,n.default=n,n.coerce=d,n.disable=a,n.enable=o,n.enabled=c,n.humanize=r0e(),n.destroy=m,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let S=0;for(let y=0;y<h.length;y++)S=(S<<5)-S+h.charCodeAt(y),S|=0;return n.colors[Math.abs(S)%n.colors.length]}n.selectColor=t;function n(h){let S,y=null,I,v;function x(...N){if(!x.enabled)return;let M=x,Q=Number(new Date),j=Q-(S||Q);M.diff=j,M.prev=S,M.curr=Q,S=Q,N[0]=n.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let G=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(oe,ge)=>{if(oe==="%%")return"%";G++;let ye=n.formatters[ge];if(typeof ye=="function"){let be=N[G];oe=ye.call(M,be),N.splice(G,1),G--}return oe}),n.formatArgs.call(M,N),(M.log||n.log).apply(M,N)}return x.namespace=h,x.useColors=n.useColors(),x.color=n.selectColor(h),x.extend=r,x.destroy=n.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(I!==n.namespaces&&(I=n.namespaces,v=n.enabled(h)),v),set:N=>{y=N}}),typeof n.init=="function"&&n.init(x),x}function r(h,S){let y=n(this.namespace+(typeof S>"u"?":":S)+h);return y.log=this.log,y}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let S=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of S)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}function i(h,S){let y=0,I=0,v=-1,x=0;for(;y<h.length;)if(I<S.length&&(S[I]===h[y]||S[I]==="*"))S[I]==="*"?(v=I,x=y,I++):(y++,I++);else if(v!==-1)I=v+1,x++,y=x;else return!1;for(;I<S.length&&S[I]==="*";)I++;return I===S.length}function a(){let h=[...n.names,...n.skips.map(S=>"-"+S)].join(",");return n.enable(""),h}function c(h){for(let S of n.skips)if(i(h,S))return!1;for(let S of n.names)if(i(h,S))return!0;return!1}function d(h){return h instanceof Error?h.stack||h.message:h}function m(){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}o0e.exports=eat});var i0e=F((vc,WP)=>{A();vc.formatArgs=nat;vc.save=rat;vc.load=oat;vc.useColors=tat;vc.storage=iat();vc.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();vc.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function tat(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function nat(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+WP.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),e.splice(r,0,t)}vc.log=console.debug||console.log||(()=>{});function rat(e){try{e?vc.storage.setItem("debug",e):vc.storage.removeItem("debug")}catch{}}function oat(){let e;try{e=vc.storage.getItem("debug")||vc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function iat(){try{return localStorage}catch{}}WP.exports=Z5()(vc);var{formatters:aat}=WP.exports;aat.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var s0e=F((aqt,a0e)=>{"use strict";A();a0e.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r<o)}});var l0e=F((uqt,c0e)=>{"use strict";A();var sat=Fe("os"),u0e=Fe("tty"),xd=s0e(),{env:Ha}=process,Xh;xd("no-color")||xd("no-colors")||xd("color=false")||xd("color=never")?Xh=0:(xd("color")||xd("colors")||xd("color=true")||xd("color=always"))&&(Xh=1);"FORCE_COLOR"in Ha&&(Ha.FORCE_COLOR==="true"?Xh=1:Ha.FORCE_COLOR==="false"?Xh=0:Xh=Ha.FORCE_COLOR.length===0?1:Math.min(parseInt(Ha.FORCE_COLOR,10),3));function W5(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function X5(e,t){if(Xh===0)return 0;if(xd("color=16m")||xd("color=full")||xd("color=truecolor"))return 3;if(xd("color=256"))return 2;if(e&&!t&&Xh===void 0)return 0;let n=Xh||0;if(Ha.TERM==="dumb")return n;if(process.platform==="win32"){let r=sat.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ha)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Ha)||Ha.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Ha)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ha.TEAMCITY_VERSION)?1:0;if(Ha.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ha){let r=parseInt((Ha.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ha.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ha.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ha.TERM)||"COLORTERM"in Ha?1:n}function uat(e){let t=X5(e,e&&e.isTTY);return W5(t)}c0e.exports={supportsColor:uat,stdout:W5(X5(!0,u0e.isatty(1))),stderr:W5(X5(!0,u0e.isatty(2)))}});var p0e=F(($a,eU)=>{A();var cat=Fe("tty"),XP=Fe("util");$a.init=gat;$a.log=fat;$a.formatArgs=dat;$a.save=Aat;$a.load=mat;$a.useColors=lat;$a.destroy=XP.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");$a.colors=[6,2,3,4,5,1];try{let e=l0e();e&&(e.stderr||e).level>=2&&($a.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{}$a.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),r=process.env[t];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),e[n]=r,e},{});function lat(){return"colors"in $a.inspectOpts?!!$a.inspectOpts.colors:cat.isatty(process.stderr.fd)}function dat(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
|
|
3
|
+
var Sqe=Object.create;var $2=Object.defineProperty;var yqe=Object.getOwnPropertyDescriptor;var Tqe=Object.getOwnPropertyNames;var Cqe=Object.getPrototypeOf,Iqe=Object.prototype.hasOwnProperty;var Fe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ja=(e,t)=>{for(var n in t)$2(e,n,{get:t[n],enumerable:!0})},fle=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tqe(t))!Iqe.call(e,o)&&o!==n&&$2(e,o,{get:()=>t[o],enumerable:!(r=yqe(t,o))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Sqe(Cqe(e)):{},fle(t||!e||!e.__esModule?$2(n,"default",{value:e,enumerable:!0}):n,e)),ke=e=>fle($2({},"__esModule",{value:!0}),e);var A=O(()=>{(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"0.1.112"}}catch{}})()});var Xm,l$=O(()=>{A();Xm="1.9.1"});function bqe(e){let t=new Set([e]),n=new Set,r=e.match(gle);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(d){return d===e};function i(c){return n.add(c),!1}function a(c){return t.add(c),!0}return function(d){if(t.has(d))return!0;if(n.has(d))return!1;let m=d.match(gle);if(!m)return i(d);let h={major:+m[1],minor:+m[2],patch:+m[3],prerelease:m[4]};return h.prerelease!=null||o.major!==h.major?i(d):o.major===0?o.minor===h.minor&&o.patch<=h.patch?a(d):i(d):o.minor<=h.minor?a(d):i(d)}}var gle,hle,_le=O(()=>{A();l$();gle=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;hle=bqe(Xm)});function rA(e,t,n,r=!1){var o;let i=Y1[q1]=(o=Y1[q1])!==null&&o!==void 0?o:{version:Xm};if(!r&&i[e]){let a=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(a.stack||a.message),!1}if(i.version!==Xm){let a=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Xm}`);return n.error(a.stack||a.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Xm}.`),!0}function yl(e){var t,n;let r=(t=Y1[q1])===null||t===void 0?void 0:t.version;if(!(!r||!hle(r)))return(n=Y1[q1])===null||n===void 0?void 0:n[e]}function oA(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Xm}.`);let n=Y1[q1];n&&delete n[e]}var vqe,q1,Y1,hS=O(()=>{A();l$();_le();vqe=Xm.split(".")[0],q1=Symbol.for(`opentelemetry.js.api.${vqe}`),Y1=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function K1(e,t,n){let r=yl("diag");if(r)return r[e](t,...n)}var V2,Ele=O(()=>{A();hS();V2=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return K1("debug",this._namespace,t)}error(...t){return K1("error",this._namespace,t)}info(...t){return K1("info",this._namespace,t)}warn(...t){return K1("warn",this._namespace,t)}verbose(...t){return K1("verbose",this._namespace,t)}}});var ga,q2=O(()=>{A();(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(ga||(ga={}))});function Sle(e,t){e<ga.NONE?e=ga.NONE:e>ga.ALL&&(e=ga.ALL),t=t||{};function n(r,o){let i=t[r];return typeof i=="function"&&e>=o?i.bind(t):function(){}}return{error:n("error",ga.ERROR),warn:n("warn",ga.WARN),info:n("info",ga.INFO),debug:n("debug",ga.DEBUG),verbose:n("verbose",ga.VERBOSE)}}var yle=O(()=>{A();q2()});var Rqe,za,_S=O(()=>{A();Ele();yle();q2();hS();Rqe="diag",za=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let a=yl("diag");if(a)return a[o](...i)}}let n=this,r=(o,i={logLevel:ga.INFO})=>{var a,c,d;if(o===n){let S=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((a=S.stack)!==null&&a!==void 0?a:S.message),!1}typeof i=="number"&&(i={logLevel:i});let m=yl("diag"),h=Sle((c=i.logLevel)!==null&&c!==void 0?c:ga.INFO,o);if(m&&!i.suppressOverrideMessage){let S=(d=new Error().stack)!==null&&d!==void 0?d:"<failed to generate stacktrace>";m.warn(`Current logger will be overwritten from ${S}`),h.warn(`Current logger will overwrite one already registered from ${S}`)}return rA("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{oA(Rqe,n)},n.createComponentLogger=o=>new V2(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var Y2,Tle=O(()=>{A();Y2=class e{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){let n=this._entries.get(t);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let r of t)n._entries.delete(r);return n}clear(){return new e}}});var Cle,Ile=O(()=>{A();Cle=Symbol("BaggageEntryMetadata")});function ble(e={}){return new Y2(new Map(Object.entries(e)))}function vle(e){return typeof e!="string"&&(xqe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:Cle,toString(){return e}}}var xqe,d$=O(()=>{A();_S();Tle();Ile();xqe=za.instance()});function Tl(e){return Symbol.for(e)}var p$,wI,J1=O(()=>{A();p$=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let i=new e(n._currentContext);return i._currentContext.set(r,o),i},n.deleteValue=r=>{let o=new e(n._currentContext);return o._currentContext.delete(r),o}}},wI=new p$});var f$,A$,K2,Rle=O(()=>{A();f$=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],A$={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(A$[t]=console[t])}K2=class{constructor(){function t(n){return function(...r){let o=A$[n];if(typeof o!="function"&&(o=A$.log),typeof o!="function"&&console&&(o=console[n],typeof o!="function"&&(o=console.log)),typeof o=="function")return o.apply(console,r)}}for(let n=0;n<f$.length;n++)this[f$[n].n]=t(f$[n].c)}}});function xle(){return C$}var m$,MI,g$,h$,_$,E$,Z1,S$,y$,T$,C$,Dqe,Bqe,Nqe,Oqe,wqe,Mqe,kqe,I$=O(()=>{A();m$=class{constructor(){}createGauge(t,n){return Bqe}createHistogram(t,n){return Nqe}createCounter(t,n){return Dqe}createUpDownCounter(t,n){return Oqe}createObservableGauge(t,n){return Mqe}createObservableCounter(t,n){return wqe}createObservableUpDownCounter(t,n){return kqe}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},MI=class{},g$=class extends MI{add(t,n){}},h$=class extends MI{add(t,n){}},_$=class extends MI{record(t,n){}},E$=class extends MI{record(t,n){}},Z1=class{addCallback(t){}removeCallback(t){}},S$=class extends Z1{},y$=class extends Z1{},T$=class extends Z1{},C$=new m$,Dqe=new g$,Bqe=new _$,Nqe=new E$,Oqe=new h$,wqe=new S$,Mqe=new y$,kqe=new T$});var J2,Dle=O(()=>{A();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(J2||(J2={}))});var Z2,W2,b$=O(()=>{A();Z2={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},W2={set(e,t,n){e!=null&&(e[t]=n)}}});var X2,Ble=O(()=>{A();J1();X2=class{active(){return wI}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var v$,Pqe,iA,W1=O(()=>{A();Ble();hS();_S();v$="context",Pqe=new X2,iA=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return rA(v$,t,za.instance())}active(){return this._getContextManager().active()}with(t,n,r,...o){return this._getContextManager().with(t,n,r,...o)}bind(t,n){return this._getContextManager().bind(t,n)}_getContextManager(){return yl(v$)||Pqe}disable(){this._getContextManager().disable(),oA(v$,za.instance())}}});var qs,R$=O(()=>{A();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(qs||(qs={}))});var X1,ES,eP,tP=O(()=>{A();R$();X1="0000000000000000",ES="00000000000000000000000000000000",eP={traceId:ES,spanId:X1,traceFlags:qs.NONE}});var aA,nP=O(()=>{A();tP();aA=class{constructor(t=eP){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,n){return this}setAttributes(t){return this}addEvent(t,n){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,n){}}});function rP(e){return e.getValue(x$)||void 0}function Nle(){return rP(iA.getInstance().active())}function eB(e,t){return e.setValue(x$,t)}function Ole(e){return e.deleteValue(x$)}function wle(e,t){return eB(e,new aA(t))}function oP(e){var t;return(t=rP(e))===null||t===void 0?void 0:t.spanContext()}var x$,D$=O(()=>{A();J1();nP();W1();x$=Tl("OpenTelemetry Context Key SPAN")});function Mle(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(iP[e.charCodeAt(r)]|0)+(iP[e.charCodeAt(r+1)]|0)+(iP[e.charCodeAt(r+2)]|0)+(iP[e.charCodeAt(r+3)]|0);return n===t}function B$(e){return Mle(e,32)&&e!==ES}function N$(e){return Mle(e,16)&&e!==X1}function eg(e){return B$(e.traceId)&&N$(e.spanId)}function kle(e){return new aA(e)}var iP,aP=O(()=>{A();tP();nP();iP=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])});function Uqe(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}var O$,kI,w$=O(()=>{A();W1();D$();nP();aP();O$=iA.getInstance(),kI=class{startSpan(t,n,r=O$.active()){if(!!n?.root)return new aA;let i=r&&oP(r);return Uqe(i)&&eg(i)?new aA(i):new aA}startActiveSpan(t,n,r,o){let i,a,c;if(arguments.length<2)return;arguments.length===2?c=n:arguments.length===3?(i=n,c=r):(i=n,a=r,c=o);let d=a??O$.active(),m=this.startSpan(t,i,d),h=eB(d,m);return O$.with(h,c,void 0,m)}}});var Lqe,PI,M$=O(()=>{A();w$();Lqe=new kI,PI=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}startSpan(t,n,r){return this._getTracer().startSpan(t,n,r)}startActiveSpan(t,n,r,o){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Lqe}}});var sP,Ple=O(()=>{A();w$();sP=class{getTracer(t,n,r){return new kI}}});var Qqe,SS,k$=O(()=>{A();M$();Ple();Qqe=new sP,SS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new PI(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Qqe}setDelegate(t){this._delegate=t}getDelegateTracer(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(t,n,r)}}});var uP,Ule=O(()=>{A();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(uP||(uP={}))});var oo,Lle=O(()=>{A();(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(oo||(oo={}))});var si,Qle=O(()=>{A();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(si||(si={}))});function Fle(e){return jqe.test(e)}function Gle(e){return zqe.test(e)&&!Hqe.test(e)}var P$,Fqe,Gqe,jqe,zqe,Hqe,jle=O(()=>{A();P$="[_0-9a-z-*/]",Fqe=`[a-z]${P$}{0,255}`,Gqe=`[a-z0-9]${P$}{0,240}@[a-z]${P$}{0,13}`,jqe=new RegExp(`^(?:${Fqe}|${Gqe})$`),zqe=/^[ -~]{0,255}[!-~]$/,Hqe=/,|=/});var zle,$qe,Hle,$le,cP,Vle=O(()=>{A();jle();zle=32,$qe=512,Hle=",",$le="=",cP=class e{constructor(t){this._internalState=new Map,t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return Array.from(this._internalState.keys()).reduceRight((t,n)=>(t.push(n+$le+this.get(n)),t),[]).join(Hle)}_parse(t){t.length>$qe||(this._internalState=t.split(Hle).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf($le);if(i!==-1){let a=o.slice(0,i),c=o.slice(i+1,r.length);Fle(a)&&Gle(c)&&n.set(a,c)}return n},new Map),this._internalState.size>zle&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,zle))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function qle(e){return new cP(e)}var Yle=O(()=>{A();Vle()});var Ye,Kle=O(()=>{A();W1();Ye=iA.getInstance()});var Cl,Jle=O(()=>{A();_S();Cl=za.instance()});var U$,Zle,Wle=O(()=>{A();I$();U$=class{getMeter(t,n,r){return C$}},Zle=new U$});var L$,lP,Xle=O(()=>{A();Wle();hS();_S();L$="metrics",lP=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return rA(L$,t,za.instance())}getMeterProvider(){return yl(L$)||Zle}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){oA(L$,za.instance())}}});var Q$,ede=O(()=>{A();Xle();Q$=lP.getInstance()});var dP,tde=O(()=>{A();dP=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function G$(e){return e.getValue(F$)||void 0}function nde(){return G$(iA.getInstance().active())}function rde(e,t){return e.setValue(F$,t)}function ode(e){return e.deleteValue(F$)}var F$,ide=O(()=>{A();W1();J1();F$=Tl("OpenTelemetry Baggage Key")});var j$,Vqe,pP,ade=O(()=>{A();hS();tde();b$();ide();d$();_S();j$="propagation",Vqe=new dP,pP=class e{constructor(){this.createBaggage=ble,this.getBaggage=G$,this.getActiveBaggage=nde,this.setBaggage=rde,this.deleteBaggage=ode}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return rA(j$,t,za.instance())}inject(t,n,r=W2){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=Z2){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){oA(j$,za.instance())}_getGlobalPropagator(){return yl(j$)||Vqe}}});var Hp,sde=O(()=>{A();ade();Hp=pP.getInstance()});var z$,fP,ude=O(()=>{A();hS();k$();aP();D$();_S();z$="trace",fP=class e{constructor(){this._proxyTracerProvider=new SS,this.wrapSpanContext=kle,this.isSpanContextValid=eg,this.deleteSpan=Ole,this.getSpan=rP,this.getActiveSpan=Nle,this.getSpanContext=oP,this.setSpan=eB,this.setSpanContext=wle}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=rA(z$,this._proxyTracerProvider,za.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return yl(z$)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){oA(z$,za.instance()),this._proxyTracerProvider=new SS}}});var zt,cde=O(()=>{A();ude();zt=fP.getInstance()});var Ze={};ja(Ze,{DiagConsoleLogger:()=>K2,DiagLogLevel:()=>ga,INVALID_SPANID:()=>X1,INVALID_SPAN_CONTEXT:()=>eP,INVALID_TRACEID:()=>ES,ProxyTracer:()=>PI,ProxyTracerProvider:()=>SS,ROOT_CONTEXT:()=>wI,SamplingDecision:()=>uP,SpanKind:()=>oo,SpanStatusCode:()=>si,TraceFlags:()=>qs,ValueType:()=>J2,baggageEntryMetadataFromString:()=>vle,context:()=>Ye,createContextKey:()=>Tl,createNoopMeter:()=>xle,createTraceState:()=>qle,default:()=>qqe,defaultTextMapGetter:()=>Z2,defaultTextMapSetter:()=>W2,diag:()=>Cl,isSpanContextValid:()=>eg,isValidSpanId:()=>N$,isValidTraceId:()=>B$,metrics:()=>Q$,propagation:()=>Hp,trace:()=>zt});var qqe,Ge=O(()=>{A();d$();J1();Rle();q2();I$();Dle();b$();M$();k$();Ule();Lle();Qle();R$();Yle();aP();tP();Kle();Jle();ede();sde();cde();qqe={context:Ye,diag:Cl,metrics:Q$,propagation:Hp,trace:zt}});var tB=F(Jh=>{"use strict";A();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.isTracingSuppressed=Jh.unsuppressTracing=Jh.suppressTracing=void 0;var Yqe=(Ge(),ke(Ze)),H$=(0,Yqe.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Kqe(e){return e.setValue(H$,!0)}Jh.suppressTracing=Kqe;function Jqe(e){return e.deleteValue(H$)}Jh.unsuppressTracing=Jqe;function Zqe(e){return e.getValue(H$)===!0}Jh.isTracingSuppressed=Zqe});var $$=F(Ys=>{"use strict";A();Object.defineProperty(Ys,"__esModule",{value:!0});Ys.BAGGAGE_MAX_TOTAL_LENGTH=Ys.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Ys.BAGGAGE_MAX_NAME_VALUE_PAIRS=Ys.BAGGAGE_HEADER=Ys.BAGGAGE_ITEMS_SEPARATOR=Ys.BAGGAGE_PROPERTIES_SEPARATOR=Ys.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Ys.BAGGAGE_KEY_PAIR_SEPARATOR="=";Ys.BAGGAGE_PROPERTIES_SEPARATOR=";";Ys.BAGGAGE_ITEMS_SEPARATOR=",";Ys.BAGGAGE_HEADER="baggage";Ys.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Ys.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Ys.BAGGAGE_MAX_TOTAL_LENGTH=8192});var V$=F(sA=>{"use strict";A();Object.defineProperty(sA,"__esModule",{value:!0});sA.parseKeyPairsIntoRecord=sA.parsePairKeyValue=sA.getKeyPairs=sA.serializeKeyPairs=void 0;var Wqe=(Ge(),ke(Ze)),UI=$$();function Xqe(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?UI.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>UI.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}sA.serializeKeyPairs=Xqe;function e7e(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=UI.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}sA.getKeyPairs=e7e;function lde(e){if(!e)return;let t=e.indexOf(UI.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(UI.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),i=n.substring(r+1).trim();if(!o||!i)return;let a,c;try{a=decodeURIComponent(o),c=decodeURIComponent(i)}catch{return}let d;if(t!==-1&&t<e.length-1){let m=e.substring(t+1);d=(0,Wqe.baggageEntryMetadataFromString)(m)}return{key:a,value:c,metadata:d}}sA.parsePairKeyValue=lde;function t7e(e){let t={};return typeof e=="string"&&e.length>0&&e.split(UI.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=lde(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}sA.parseKeyPairsIntoRecord=t7e});var dde=F(AP=>{"use strict";A();Object.defineProperty(AP,"__esModule",{value:!0});AP.W3CBaggagePropagator=void 0;var q$=(Ge(),ke(Ze)),n7e=tB(),yS=$$(),Y$=V$(),K$=class{inject(t,n,r){let o=q$.propagation.getBaggage(t);if(!o||(0,n7e.isTracingSuppressed)(t))return;let i=(0,Y$.getKeyPairs)(o).filter(c=>c.length<=yS.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,yS.BAGGAGE_MAX_NAME_VALUE_PAIRS),a=(0,Y$.serializeKeyPairs)(i);a.length>0&&r.set(n,yS.BAGGAGE_HEADER,a)}extract(t,n,r){let o=r.get(n,yS.BAGGAGE_HEADER),i=Array.isArray(o)?o.join(yS.BAGGAGE_ITEMS_SEPARATOR):o;if(!i)return t;let a={};return i.length===0||(i.split(yS.BAGGAGE_ITEMS_SEPARATOR).forEach(d=>{let m=(0,Y$.parsePairKeyValue)(d);if(m){let h={value:m.value};m.metadata&&(h.metadata=m.metadata),a[m.key]=h}}),Object.entries(a).length===0)?t:q$.propagation.setBaggage(t,q$.propagation.createBaggage(a))}fields(){return[yS.BAGGAGE_HEADER]}};AP.W3CBaggagePropagator=K$});var pde=F(mP=>{"use strict";A();Object.defineProperty(mP,"__esModule",{value:!0});mP.AnchoredClock=void 0;var J$=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,n){this._monotonicClock=n,this._epochMillis=t.now(),this._performanceMillis=n.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}};mP.AnchoredClock=J$});var hde=F(Zh=>{"use strict";A();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.isAttributeValue=Zh.isAttributeKey=Zh.sanitizeAttributes=void 0;var fde=(Ge(),ke(Ze));function r7e(e){let t={};if(typeof e!="object"||e==null)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ade(n)){fde.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!mde(r)){fde.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}Zh.sanitizeAttributes=r7e;function Ade(e){return typeof e=="string"&&e!==""}Zh.isAttributeKey=Ade;function mde(e){return e==null?!0:Array.isArray(e)?o7e(e):gde(typeof e)}Zh.isAttributeValue=mde;function o7e(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(gde(r)){t=r;continue}return!1}return!1}}return!0}function gde(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var Z$=F(gP=>{"use strict";A();Object.defineProperty(gP,"__esModule",{value:!0});gP.loggingErrorHandler=void 0;var i7e=(Ge(),ke(Ze));function a7e(){return e=>{i7e.diag.error(s7e(e))}}gP.loggingErrorHandler=a7e;function s7e(e){return typeof e=="string"?e:JSON.stringify(u7e(e))}function u7e(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(t[r])return;let o=n[r];o&&(t[r]=String(o))}),n=Object.getPrototypeOf(n);return t}});var Ede=F(LI=>{"use strict";A();Object.defineProperty(LI,"__esModule",{value:!0});LI.globalErrorHandler=LI.setGlobalErrorHandler=void 0;var c7e=Z$(),_de=(0,c7e.loggingErrorHandler)();function l7e(e){_de=e}LI.setGlobalErrorHandler=l7e;function d7e(e){try{_de(e)}catch{}}LI.globalErrorHandler=d7e});var Cde=F(uA=>{"use strict";A();Object.defineProperty(uA,"__esModule",{value:!0});uA.getStringListFromEnv=uA.getBooleanFromEnv=uA.getStringFromEnv=uA.getNumberFromEnv=void 0;var Sde=(Ge(),ke(Ze)),yde=Fe("util");function p7e(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){Sde.diag.warn(`Unknown value ${(0,yde.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}uA.getNumberFromEnv=p7e;function Tde(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}uA.getStringFromEnv=Tde;function f7e(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||Sde.diag.warn(`Unknown value ${(0,yde.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}uA.getBooleanFromEnv=f7e;function A7e(e){return Tde(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}uA.getStringListFromEnv=A7e});var Ide=F(hP=>{"use strict";A();Object.defineProperty(hP,"__esModule",{value:!0});hP._globalThis=void 0;hP._globalThis=globalThis});var bde=F(_P=>{"use strict";A();Object.defineProperty(_P,"__esModule",{value:!0});_P.VERSION=void 0;_P.VERSION="2.6.1"});function Ii(e){let t={},n=e.length;for(let r=0;r<n;r++){let o=e[r];o&&(t[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return t}var W$=O(()=>{A()});var vde,Rde,xde,Dde,Bde,Nde,Ode,wde,Mde,kde,Pde,Ude,Lde,Qde,Fde,Gde,jde,zde,Hde,$de,Vde,qde,Yde,Kde,Jde,Zde,Wde,Xde,epe,tpe,npe,rpe,ope,ipe,ape,spe,upe,cpe,lpe,dpe,ppe,fpe,Ape,mpe,gpe,hpe,_pe,Epe,Spe,ype,Tpe,Cpe,Ipe,bpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,Mpe,kpe,Ppe,Upe,Lpe,Qpe,Fpe,Gpe,jpe,zpe,Hpe,$pe,Vpe,qpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,afe,sfe,ufe,cfe,lfe,dfe,pfe,ffe,Afe,mfe,gfe,hfe,_fe,Efe,Sfe,yfe,Tfe,Cfe,Ife,bfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,Mfe,kfe,Pfe,Ufe,Lfe,Qfe,Ffe,Gfe,jfe,zfe,Hfe,$fe,m7e,X$,g7e,h7e,_7e,E7e,e5,S7e,y7e,T7e,C7e,I7e,b7e,v7e,R7e,x7e,D7e,B7e,N7e,O7e,w7e,M7e,k7e,P7e,U7e,t5,L7e,Q7e,F7e,G7e,j7e,z7e,H7e,$7e,V7e,q7e,Y7e,K7e,n5,J7e,Z7e,r5,o5,W7e,X7e,eYe,tYe,nYe,rYe,oYe,iYe,aYe,sYe,uYe,cYe,lYe,dYe,pYe,fYe,AYe,nB,QI,i5,mYe,gYe,TS,hYe,_Ye,EYe,SYe,a5,s5,yYe,u5,TYe,CYe,IYe,bYe,vYe,RYe,xYe,DYe,BYe,NYe,OYe,wYe,MYe,kYe,PYe,UYe,LYe,QYe,FYe,GYe,jYe,zYe,HYe,c5,$Ye,VYe,qYe,YYe,KYe,JYe,ZYe,WYe,XYe,eKe,tKe,nKe,rKe,oKe,iKe,aKe,sKe,uKe,cKe,l5,lKe,d5,dKe,pKe,fKe,AKe,mKe,gKe,hKe,_Ke,EKe,Vfe,qfe,Yfe,Kfe,Jfe,Zfe,Wfe,Xfe,eAe,tAe,nAe,rAe,oAe,iAe,aAe,sAe,uAe,cAe,lAe,dAe,pAe,fAe,AAe,mAe,gAe,hAe,_Ae,EAe,SAe,yAe,TAe,CAe,IAe,bAe,vAe,RAe,xAe,DAe,BAe,NAe,OAe,wAe,MAe,kAe,PAe,UAe,LAe,SKe,yKe,TKe,CKe,IKe,bKe,vKe,RKe,xKe,DKe,BKe,NKe,OKe,wKe,MKe,kKe,PKe,UKe,LKe,QKe,FKe,GKe,jKe,zKe,HKe,$Ke,VKe,qKe,YKe,KKe,JKe,ZKe,WKe,XKe,eJe,tJe,nJe,rJe,oJe,iJe,aJe,sJe,uJe,cJe,lJe,dJe,pJe,fJe,QAe,FAe,GAe,jAe,zAe,HAe,$Ae,VAe,qAe,YAe,KAe,AJe,mJe,gJe,hJe,_Je,EJe,SJe,yJe,TJe,CJe,IJe,bJe,JAe,ZAe,WAe,XAe,eme,vJe,RJe,xJe,DJe,BJe,NJe,tme,nme,rme,OJe,wJe,MJe,kJe,ome,ime,ame,sme,PJe,UJe,LJe,QJe,FJe,ume,cme,lme,dme,pme,fme,Ame,GJe,jJe,zJe,HJe,$Je,VJe,qJe,YJe,mme,gme,hme,_me,Eme,KJe,JJe,ZJe,WJe,XJe,eZe,Sme,yme,Tme,Cme,Ime,bme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,Mme,kme,Pme,Ume,Lme,Qme,Fme,tZe,nZe,rZe,oZe,iZe,aZe,sZe,uZe,cZe,lZe,dZe,pZe,fZe,AZe,mZe,gZe,hZe,_Ze,EZe,SZe,yZe,TZe,Gme,jme,zme,Hme,$me,CZe,IZe,bZe,vZe,RZe,xZe,Vme,qme,DZe,BZe,NZe,Yme,Kme,OZe,wZe,MZe,Jme,Zme,Wme,Xme,ege,tge,nge,rge,oge,ige,age,sge,uge,cge,lge,dge,pge,kZe,PZe,UZe,LZe,QZe,FZe,GZe,jZe,zZe,HZe,$Ze,VZe,qZe,YZe,KZe,JZe,ZZe,WZe,fge,Age,XZe,eWe,tWe,mge=O(()=>{A();W$();vde="aws.lambda.invoked_arn",Rde="db.system",xde="db.connection_string",Dde="db.user",Bde="db.jdbc.driver_classname",Nde="db.name",Ode="db.statement",wde="db.operation",Mde="db.mssql.instance_name",kde="db.cassandra.keyspace",Pde="db.cassandra.page_size",Ude="db.cassandra.consistency_level",Lde="db.cassandra.table",Qde="db.cassandra.idempotence",Fde="db.cassandra.speculative_execution_count",Gde="db.cassandra.coordinator.id",jde="db.cassandra.coordinator.dc",zde="db.hbase.namespace",Hde="db.redis.database_index",$de="db.mongodb.collection",Vde="db.sql.table",qde="exception.type",Yde="exception.message",Kde="exception.stacktrace",Jde="exception.escaped",Zde="faas.trigger",Wde="faas.execution",Xde="faas.document.collection",epe="faas.document.operation",tpe="faas.document.time",npe="faas.document.name",rpe="faas.time",ope="faas.cron",ipe="faas.coldstart",ape="faas.invoked_name",spe="faas.invoked_provider",upe="faas.invoked_region",cpe="net.transport",lpe="net.peer.ip",dpe="net.peer.port",ppe="net.peer.name",fpe="net.host.ip",Ape="net.host.port",mpe="net.host.name",gpe="net.host.connection.type",hpe="net.host.connection.subtype",_pe="net.host.carrier.name",Epe="net.host.carrier.mcc",Spe="net.host.carrier.mnc",ype="net.host.carrier.icc",Tpe="peer.service",Cpe="enduser.id",Ipe="enduser.role",bpe="enduser.scope",vpe="thread.id",Rpe="thread.name",xpe="code.function",Dpe="code.namespace",Bpe="code.filepath",Npe="code.lineno",Ope="http.method",wpe="http.url",Mpe="http.target",kpe="http.host",Ppe="http.scheme",Upe="http.status_code",Lpe="http.flavor",Qpe="http.user_agent",Fpe="http.request_content_length",Gpe="http.request_content_length_uncompressed",jpe="http.response_content_length",zpe="http.response_content_length_uncompressed",Hpe="http.server_name",$pe="http.route",Vpe="http.client_ip",qpe="aws.dynamodb.table_names",Ype="aws.dynamodb.consumed_capacity",Kpe="aws.dynamodb.item_collection_metrics",Jpe="aws.dynamodb.provisioned_read_capacity",Zpe="aws.dynamodb.provisioned_write_capacity",Wpe="aws.dynamodb.consistent_read",Xpe="aws.dynamodb.projection",efe="aws.dynamodb.limit",tfe="aws.dynamodb.attributes_to_get",nfe="aws.dynamodb.index_name",rfe="aws.dynamodb.select",ofe="aws.dynamodb.global_secondary_indexes",ife="aws.dynamodb.local_secondary_indexes",afe="aws.dynamodb.exclusive_start_table",sfe="aws.dynamodb.table_count",ufe="aws.dynamodb.scan_forward",cfe="aws.dynamodb.segment",lfe="aws.dynamodb.total_segments",dfe="aws.dynamodb.count",pfe="aws.dynamodb.scanned_count",ffe="aws.dynamodb.attribute_definitions",Afe="aws.dynamodb.global_secondary_index_updates",mfe="messaging.system",gfe="messaging.destination",hfe="messaging.destination_kind",_fe="messaging.temp_destination",Efe="messaging.protocol",Sfe="messaging.protocol_version",yfe="messaging.url",Tfe="messaging.message_id",Cfe="messaging.conversation_id",Ife="messaging.message_payload_size_bytes",bfe="messaging.message_payload_compressed_size_bytes",vfe="messaging.operation",Rfe="messaging.consumer_id",xfe="messaging.rabbitmq.routing_key",Dfe="messaging.kafka.message_key",Bfe="messaging.kafka.consumer_group",Nfe="messaging.kafka.client_id",Ofe="messaging.kafka.partition",wfe="messaging.kafka.tombstone",Mfe="rpc.system",kfe="rpc.service",Pfe="rpc.method",Ufe="rpc.grpc.status_code",Lfe="rpc.jsonrpc.version",Qfe="rpc.jsonrpc.request_id",Ffe="rpc.jsonrpc.error_code",Gfe="rpc.jsonrpc.error_message",jfe="message.type",zfe="message.id",Hfe="message.compressed_size",$fe="message.uncompressed_size",m7e=vde,X$=Rde,g7e=xde,h7e=Dde,_7e=Bde,E7e=Nde,e5=Ode,S7e=wde,y7e=Mde,T7e=kde,C7e=Pde,I7e=Ude,b7e=Lde,v7e=Qde,R7e=Fde,x7e=Gde,D7e=jde,B7e=zde,N7e=Hde,O7e=$de,w7e=Vde,M7e=qde,k7e=Yde,P7e=Kde,U7e=Jde,t5=Zde,L7e=Wde,Q7e=Xde,F7e=epe,G7e=tpe,j7e=npe,z7e=rpe,H7e=ope,$7e=ipe,V7e=ape,q7e=spe,Y7e=upe,K7e=cpe,n5=lpe,J7e=dpe,Z7e=ppe,r5=fpe,o5=Ape,W7e=mpe,X7e=gpe,eYe=hpe,tYe=_pe,nYe=Epe,rYe=Spe,oYe=ype,iYe=Tpe,aYe=Cpe,sYe=Ipe,uYe=bpe,cYe=vpe,lYe=Rpe,dYe=xpe,pYe=Dpe,fYe=Bpe,AYe=Npe,nB=Ope,QI=wpe,i5=Mpe,mYe=kpe,gYe=Ppe,TS=Upe,hYe=Lpe,_Ye=Qpe,EYe=Fpe,SYe=Gpe,a5=jpe,s5=zpe,yYe=Hpe,u5=$pe,TYe=Vpe,CYe=qpe,IYe=Ype,bYe=Kpe,vYe=Jpe,RYe=Zpe,xYe=Wpe,DYe=Xpe,BYe=efe,NYe=tfe,OYe=nfe,wYe=rfe,MYe=ofe,kYe=ife,PYe=afe,UYe=sfe,LYe=ufe,QYe=cfe,FYe=lfe,GYe=dfe,jYe=pfe,zYe=ffe,HYe=Afe,c5=mfe,$Ye=gfe,VYe=hfe,qYe=_fe,YYe=Efe,KYe=Sfe,JYe=yfe,ZYe=Tfe,WYe=Cfe,XYe=Ife,eKe=bfe,tKe=vfe,nKe=Rfe,rKe=xfe,oKe=Dfe,iKe=Bfe,aKe=Nfe,sKe=Ofe,uKe=wfe,cKe=Mfe,l5=kfe,lKe=Pfe,d5=Ufe,dKe=Lfe,pKe=Qfe,fKe=Ffe,AKe=Gfe,mKe=jfe,gKe=zfe,hKe=Hfe,_Ke=$fe,EKe=Ii([vde,Rde,xde,Dde,Bde,Nde,Ode,wde,Mde,kde,Pde,Ude,Lde,Qde,Fde,Gde,jde,zde,Hde,$de,Vde,qde,Yde,Kde,Jde,Zde,Wde,Xde,epe,tpe,npe,rpe,ope,ipe,ape,spe,upe,cpe,lpe,dpe,ppe,fpe,Ape,mpe,gpe,hpe,_pe,Epe,Spe,ype,Tpe,Cpe,Ipe,bpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,Mpe,kpe,Ppe,Upe,Lpe,Qpe,Fpe,Gpe,jpe,zpe,Hpe,$pe,Vpe,qpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,afe,sfe,ufe,cfe,lfe,dfe,pfe,ffe,Afe,mfe,gfe,hfe,_fe,Efe,Sfe,yfe,Tfe,Cfe,Ife,bfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,Mfe,kfe,Pfe,Ufe,Lfe,Qfe,Ffe,Gfe,jfe,zfe,Hfe,$fe]),Vfe="other_sql",qfe="mssql",Yfe="mysql",Kfe="oracle",Jfe="db2",Zfe="postgresql",Wfe="redshift",Xfe="hive",eAe="cloudscape",tAe="hsqldb",nAe="progress",rAe="maxdb",oAe="hanadb",iAe="ingres",aAe="firstsql",sAe="edb",uAe="cache",cAe="adabas",lAe="firebird",dAe="derby",pAe="filemaker",fAe="informix",AAe="instantdb",mAe="interbase",gAe="mariadb",hAe="netezza",_Ae="pervasive",EAe="pointbase",SAe="sqlite",yAe="sybase",TAe="teradata",CAe="vertica",IAe="h2",bAe="coldfusion",vAe="cassandra",RAe="hbase",xAe="mongodb",DAe="redis",BAe="couchbase",NAe="couchdb",OAe="cosmosdb",wAe="dynamodb",MAe="neo4j",kAe="geode",PAe="elasticsearch",UAe="memcached",LAe="cockroachdb",SKe=Vfe,yKe=qfe,TKe=Yfe,CKe=Kfe,IKe=Jfe,bKe=Zfe,vKe=Wfe,RKe=Xfe,xKe=eAe,DKe=tAe,BKe=nAe,NKe=rAe,OKe=oAe,wKe=iAe,MKe=aAe,kKe=sAe,PKe=uAe,UKe=cAe,LKe=lAe,QKe=dAe,FKe=pAe,GKe=fAe,jKe=AAe,zKe=mAe,HKe=gAe,$Ke=hAe,VKe=_Ae,qKe=EAe,YKe=SAe,KKe=yAe,JKe=TAe,ZKe=CAe,WKe=IAe,XKe=bAe,eJe=vAe,tJe=RAe,nJe=xAe,rJe=DAe,oJe=BAe,iJe=NAe,aJe=OAe,sJe=wAe,uJe=MAe,cJe=kAe,lJe=PAe,dJe=UAe,pJe=LAe,fJe=Ii([Vfe,qfe,Yfe,Kfe,Jfe,Zfe,Wfe,Xfe,eAe,tAe,nAe,rAe,oAe,iAe,aAe,sAe,uAe,cAe,lAe,dAe,pAe,fAe,AAe,mAe,gAe,hAe,_Ae,EAe,SAe,yAe,TAe,CAe,IAe,bAe,vAe,RAe,xAe,DAe,BAe,NAe,OAe,wAe,MAe,kAe,PAe,UAe,LAe]),QAe="all",FAe="each_quorum",GAe="quorum",jAe="local_quorum",zAe="one",HAe="two",$Ae="three",VAe="local_one",qAe="any",YAe="serial",KAe="local_serial",AJe=QAe,mJe=FAe,gJe=GAe,hJe=jAe,_Je=zAe,EJe=HAe,SJe=$Ae,yJe=VAe,TJe=qAe,CJe=YAe,IJe=KAe,bJe=Ii([QAe,FAe,GAe,jAe,zAe,HAe,$Ae,VAe,qAe,YAe,KAe]),JAe="datasource",ZAe="http",WAe="pubsub",XAe="timer",eme="other",vJe=JAe,RJe=ZAe,xJe=WAe,DJe=XAe,BJe=eme,NJe=Ii([JAe,ZAe,WAe,XAe,eme]),tme="insert",nme="edit",rme="delete",OJe=tme,wJe=nme,MJe=rme,kJe=Ii([tme,nme,rme]),ome="alibaba_cloud",ime="aws",ame="azure",sme="gcp",PJe=ome,UJe=ime,LJe=ame,QJe=sme,FJe=Ii([ome,ime,ame,sme]),ume="ip_tcp",cme="ip_udp",lme="ip",dme="unix",pme="pipe",fme="inproc",Ame="other",GJe=ume,jJe=cme,zJe=lme,HJe=dme,$Je=pme,VJe=fme,qJe=Ame,YJe=Ii([ume,cme,lme,dme,pme,fme,Ame]),mme="wifi",gme="wired",hme="cell",_me="unavailable",Eme="unknown",KJe=mme,JJe=gme,ZJe=hme,WJe=_me,XJe=Eme,eZe=Ii([mme,gme,hme,_me,Eme]),Sme="gprs",yme="edge",Tme="umts",Cme="cdma",Ime="evdo_0",bme="evdo_a",vme="cdma2000_1xrtt",Rme="hsdpa",xme="hsupa",Dme="hspa",Bme="iden",Nme="evdo_b",Ome="lte",wme="ehrpd",Mme="hspap",kme="gsm",Pme="td_scdma",Ume="iwlan",Lme="nr",Qme="nrnsa",Fme="lte_ca",tZe=Sme,nZe=yme,rZe=Tme,oZe=Cme,iZe=Ime,aZe=bme,sZe=vme,uZe=Rme,cZe=xme,lZe=Dme,dZe=Bme,pZe=Nme,fZe=Ome,AZe=wme,mZe=Mme,gZe=kme,hZe=Pme,_Ze=Ume,EZe=Lme,SZe=Qme,yZe=Fme,TZe=Ii([Sme,yme,Tme,Cme,Ime,bme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,Mme,kme,Pme,Ume,Lme,Qme,Fme]),Gme="1.0",jme="1.1",zme="2.0",Hme="SPDY",$me="QUIC",CZe=Gme,IZe=jme,bZe=zme,vZe=Hme,RZe=$me,xZe={HTTP_1_0:Gme,HTTP_1_1:jme,HTTP_2_0:zme,SPDY:Hme,QUIC:$me},Vme="queue",qme="topic",DZe=Vme,BZe=qme,NZe=Ii([Vme,qme]),Yme="receive",Kme="process",OZe=Yme,wZe=Kme,MZe=Ii([Yme,Kme]),Jme=0,Zme=1,Wme=2,Xme=3,ege=4,tge=5,nge=6,rge=7,oge=8,ige=9,age=10,sge=11,uge=12,cge=13,lge=14,dge=15,pge=16,kZe=Jme,PZe=Zme,UZe=Wme,LZe=Xme,QZe=ege,FZe=tge,GZe=nge,jZe=rge,zZe=oge,HZe=ige,$Ze=age,VZe=sge,qZe=uge,YZe=cge,KZe=lge,JZe=dge,ZZe=pge,WZe={OK:Jme,CANCELLED:Zme,UNKNOWN:Wme,INVALID_ARGUMENT:Xme,DEADLINE_EXCEEDED:ege,NOT_FOUND:tge,ALREADY_EXISTS:nge,PERMISSION_DENIED:rge,RESOURCE_EXHAUSTED:oge,FAILED_PRECONDITION:ige,ABORTED:age,OUT_OF_RANGE:sge,UNIMPLEMENTED:uge,INTERNAL:cge,UNAVAILABLE:lge,DATA_LOSS:dge,UNAUTHENTICATED:pge},fge="SENT",Age="RECEIVED",XZe=fge,eWe=Age,tWe=Ii([fge,Age])});var gge=O(()=>{A();mge()});var hge,_ge,Ege,Sge,yge,Tge,Cge,Ige,bge,vge,Rge,xge,Dge,Bge,Nge,Oge,wge,Mge,kge,Pge,Uge,Lge,Qge,Fge,Gge,jge,zge,Hge,$ge,Vge,qge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,ahe,she,uhe,che,lhe,dhe,phe,fhe,Ahe,mhe,ghe,hhe,_he,Ehe,She,yhe,The,Che,Ihe,bhe,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,Mhe,khe,Phe,Uhe,Lhe,Qhe,Fhe,Ghe,jhe,zhe,nWe,rWe,oWe,iWe,aWe,sWe,uWe,cWe,lWe,dWe,pWe,fWe,AWe,mWe,gWe,hWe,_We,EWe,SWe,yWe,TWe,CWe,IWe,bWe,vWe,RWe,xWe,DWe,BWe,NWe,OWe,wWe,MWe,kWe,PWe,UWe,LWe,QWe,FWe,GWe,jWe,zWe,HWe,$We,VWe,qWe,YWe,KWe,JWe,ZWe,WWe,XWe,eXe,tXe,nXe,rXe,oXe,iXe,aXe,sXe,uXe,cXe,lXe,dXe,pXe,fXe,AXe,mXe,gXe,hXe,_Xe,p5,EXe,SXe,yXe,TXe,CXe,IXe,bXe,vXe,RXe,xXe,Hhe,$he,Vhe,qhe,DXe,BXe,NXe,OXe,wXe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,a_e,s_e,u_e,c_e,l_e,MXe,kXe,PXe,UXe,LXe,QXe,FXe,GXe,jXe,zXe,HXe,$Xe,VXe,qXe,YXe,KXe,JXe,ZXe,d_e,p_e,WXe,XXe,eet,f_e,A_e,m_e,g_e,h_e,__e,E_e,tet,net,ret,oet,iet,aet,set,uet,S_e,y_e,T_e,C_e,I_e,b_e,v_e,R_e,x_e,D_e,B_e,cet,det,pet,fet,Aet,met,get,het,_et,Eet,yet,Tet,N_e,O_e,w_e,M_e,k_e,P_e,U_e,L_e,Q_e,F_e,Cet,Iet,bet,vet,Ret,xet,Det,Bet,Net,Oet,wet,G_e=O(()=>{A();W$();hge="cloud.provider",_ge="cloud.account.id",Ege="cloud.region",Sge="cloud.availability_zone",yge="cloud.platform",Tge="aws.ecs.container.arn",Cge="aws.ecs.cluster.arn",Ige="aws.ecs.launchtype",bge="aws.ecs.task.arn",vge="aws.ecs.task.family",Rge="aws.ecs.task.revision",xge="aws.eks.cluster.arn",Dge="aws.log.group.names",Bge="aws.log.group.arns",Nge="aws.log.stream.names",Oge="aws.log.stream.arns",wge="container.name",Mge="container.id",kge="container.runtime",Pge="container.image.name",Uge="container.image.tag",Lge="deployment.environment",Qge="device.id",Fge="device.model.identifier",Gge="device.model.name",jge="faas.name",zge="faas.id",Hge="faas.version",$ge="faas.instance",Vge="faas.max_memory",qge="host.id",Yge="host.name",Kge="host.type",Jge="host.arch",Zge="host.image.name",Wge="host.image.id",Xge="host.image.version",ehe="k8s.cluster.name",the="k8s.node.name",nhe="k8s.node.uid",rhe="k8s.namespace.name",ohe="k8s.pod.uid",ihe="k8s.pod.name",ahe="k8s.container.name",she="k8s.replicaset.uid",uhe="k8s.replicaset.name",che="k8s.deployment.uid",lhe="k8s.deployment.name",dhe="k8s.statefulset.uid",phe="k8s.statefulset.name",fhe="k8s.daemonset.uid",Ahe="k8s.daemonset.name",mhe="k8s.job.uid",ghe="k8s.job.name",hhe="k8s.cronjob.uid",_he="k8s.cronjob.name",Ehe="os.type",She="os.description",yhe="os.name",The="os.version",Che="process.pid",Ihe="process.executable.name",bhe="process.executable.path",vhe="process.command",Rhe="process.command_line",xhe="process.command_args",Dhe="process.owner",Bhe="process.runtime.name",Nhe="process.runtime.version",Ohe="process.runtime.description",whe="service.name",Mhe="service.namespace",khe="service.instance.id",Phe="service.version",Uhe="telemetry.sdk.name",Lhe="telemetry.sdk.language",Qhe="telemetry.sdk.version",Fhe="telemetry.auto.version",Ghe="webengine.name",jhe="webengine.version",zhe="webengine.description",nWe=hge,rWe=_ge,oWe=Ege,iWe=Sge,aWe=yge,sWe=Tge,uWe=Cge,cWe=Ige,lWe=bge,dWe=vge,pWe=Rge,fWe=xge,AWe=Dge,mWe=Bge,gWe=Nge,hWe=Oge,_We=wge,EWe=Mge,SWe=kge,yWe=Pge,TWe=Uge,CWe=Lge,IWe=Qge,bWe=Fge,vWe=Gge,RWe=jge,xWe=zge,DWe=Hge,BWe=$ge,NWe=Vge,OWe=qge,wWe=Yge,MWe=Kge,kWe=Jge,PWe=Zge,UWe=Wge,LWe=Xge,QWe=ehe,FWe=the,GWe=nhe,jWe=rhe,zWe=ohe,HWe=ihe,$We=ahe,VWe=she,qWe=uhe,YWe=che,KWe=lhe,JWe=dhe,ZWe=phe,WWe=fhe,XWe=Ahe,eXe=mhe,tXe=ghe,nXe=hhe,rXe=_he,oXe=Ehe,iXe=She,aXe=yhe,sXe=The,uXe=Che,cXe=Ihe,lXe=bhe,dXe=vhe,pXe=Rhe,fXe=xhe,AXe=Dhe,mXe=Bhe,gXe=Nhe,hXe=Ohe,_Xe=whe,p5=Mhe,EXe=khe,SXe=Phe,yXe=Uhe,TXe=Lhe,CXe=Qhe,IXe=Fhe,bXe=Ghe,vXe=jhe,RXe=zhe,xXe=Ii([hge,_ge,Ege,Sge,yge,Tge,Cge,Ige,bge,vge,Rge,xge,Dge,Bge,Nge,Oge,wge,Mge,kge,Pge,Uge,Lge,Qge,Fge,Gge,jge,zge,Hge,$ge,Vge,qge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,ahe,she,uhe,che,lhe,dhe,phe,fhe,Ahe,mhe,ghe,hhe,_he,Ehe,She,yhe,The,Che,Ihe,bhe,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,Mhe,khe,Phe,Uhe,Lhe,Qhe,Fhe,Ghe,jhe,zhe]),Hhe="alibaba_cloud",$he="aws",Vhe="azure",qhe="gcp",DXe=Hhe,BXe=$he,NXe=Vhe,OXe=qhe,wXe=Ii([Hhe,$he,Vhe,qhe]),Yhe="alibaba_cloud_ecs",Khe="alibaba_cloud_fc",Jhe="aws_ec2",Zhe="aws_ecs",Whe="aws_eks",Xhe="aws_lambda",e_e="aws_elastic_beanstalk",t_e="azure_vm",n_e="azure_container_instances",r_e="azure_aks",o_e="azure_functions",i_e="azure_app_service",a_e="gcp_compute_engine",s_e="gcp_cloud_run",u_e="gcp_kubernetes_engine",c_e="gcp_cloud_functions",l_e="gcp_app_engine",MXe=Yhe,kXe=Khe,PXe=Jhe,UXe=Zhe,LXe=Whe,QXe=Xhe,FXe=e_e,GXe=t_e,jXe=n_e,zXe=r_e,HXe=o_e,$Xe=i_e,VXe=a_e,qXe=s_e,YXe=u_e,KXe=c_e,JXe=l_e,ZXe=Ii([Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,a_e,s_e,u_e,c_e,l_e]),d_e="ec2",p_e="fargate",WXe=d_e,XXe=p_e,eet=Ii([d_e,p_e]),f_e="amd64",A_e="arm32",m_e="arm64",g_e="ia64",h_e="ppc32",__e="ppc64",E_e="x86",tet=f_e,net=A_e,ret=m_e,oet=g_e,iet=h_e,aet=__e,set=E_e,uet=Ii([f_e,A_e,m_e,g_e,h_e,__e,E_e]),S_e="windows",y_e="linux",T_e="darwin",C_e="freebsd",I_e="netbsd",b_e="openbsd",v_e="dragonflybsd",R_e="hpux",x_e="aix",D_e="solaris",B_e="z_os",cet=S_e,det=y_e,pet=T_e,fet=C_e,Aet=I_e,met=b_e,get=v_e,het=R_e,_et=x_e,Eet=D_e,yet=B_e,Tet=Ii([S_e,y_e,T_e,C_e,I_e,b_e,v_e,R_e,x_e,D_e,B_e]),N_e="cpp",O_e="dotnet",w_e="erlang",M_e="go",k_e="java",P_e="nodejs",U_e="php",L_e="python",Q_e="ruby",F_e="webjs",Cet=N_e,Iet=O_e,bet=w_e,vet=M_e,Ret=k_e,xet=P_e,Det=U_e,Bet=L_e,Net=Q_e,Oet=F_e,wet=Ii([N_e,O_e,w_e,M_e,k_e,P_e,U_e,L_e,Q_e,F_e])});var j_e=O(()=>{A();G_e()});var Met,ket,Pet,Uet,Let,Qet,Fet,Get,jet,zet,Het,$et,Vet,qet,Yet,Ket,Jet,Zet,Wet,Xet,ett,ttt,ntt,rtt,ott,f5,A5,itt,FI,att,m5,g5,stt,CS,utt,ctt,ltt,dtt,ptt,ftt,Att,mtt,gtt,htt,h5,_tt,Ett,Stt,ytt,Ttt,Ctt,IS,Itt,btt,vtt,Rtt,xtt,Dtt,Btt,Ntt,Ott,wtt,Mtt,ktt,Ptt,tg,ng,Utt,Ltt,Qtt,Ftt,Gtt,jtt,ztt,Htt,$tt,Vtt,qtt,Ytt,Ktt,Jtt,Ztt,Wtt,_5,E5,Xtt,S5,y5,ent,tnt,nnt,rnt,ont,int,ant,snt,unt,cnt,lnt,dnt,pnt,fnt,T5,C5,Ant,I5,mnt,b5,gnt,hnt,_nt,Ent,Snt,ynt,Tnt,Cnt,Int,bnt,vnt,Rnt,xnt,Dnt,Bnt,Nnt,Ont,wnt,Mnt,knt,Pnt,Unt,Lnt,Qnt,Wh,Fnt,Gnt,jnt,v5,z_e=O(()=>{A();Met="aspnetcore.diagnostics.exception.result",ket="aborted",Pet="handled",Uet="skipped",Let="unhandled",Qet="aspnetcore.diagnostics.handler.type",Fet="aspnetcore.rate_limiting.policy",Get="aspnetcore.rate_limiting.result",jet="acquired",zet="endpoint_limiter",Het="global_limiter",$et="request_canceled",Vet="aspnetcore.request.is_unhandled",qet="aspnetcore.routing.is_fallback",Yet="aspnetcore.routing.match_status",Ket="failure",Jet="success",Zet="aspnetcore.user.is_authenticated",Wet="client.address",Xet="client.port",ett="code.column.number",ttt="code.file.path",ntt="code.function.name",rtt="code.line.number",ott="code.stacktrace",f5="db.collection.name",A5="db.namespace",itt="db.operation.batch.size",FI="db.operation.name",att="db.query.summary",m5="db.query.text",g5="db.response.status_code",stt="db.stored_procedure.name",CS="db.system.name",utt="mariadb",ctt="microsoft.sql_server",ltt="mysql",dtt="postgresql",ptt="dotnet.gc.heap.generation",ftt="gen0",Att="gen1",mtt="gen2",gtt="loh",htt="poh",h5="error.type",_tt="_OTHER",Ett="exception.escaped",Stt="exception.message",ytt="exception.stacktrace",Ttt="exception.type",Ctt=e=>`http.request.header.${e}`,IS="http.request.method",Itt="_OTHER",btt="CONNECT",vtt="DELETE",Rtt="GET",xtt="HEAD",Dtt="OPTIONS",Btt="PATCH",Ntt="POST",Ott="PUT",wtt="TRACE",Mtt="http.request.method_original",ktt="http.request.resend_count",Ptt=e=>`http.response.header.${e}`,tg="http.response.status_code",ng="http.route",Utt="jvm.gc.action",Ltt="jvm.gc.name",Qtt="jvm.memory.pool.name",Ftt="jvm.memory.type",Gtt="heap",jtt="non_heap",ztt="jvm.thread.daemon",Htt="jvm.thread.state",$tt="blocked",Vtt="new",qtt="runnable",Ytt="terminated",Ktt="timed_waiting",Jtt="waiting",Ztt="network.local.address",Wtt="network.local.port",_5="network.peer.address",E5="network.peer.port",Xtt="network.protocol.name",S5="network.protocol.version",y5="network.transport",ent="pipe",tnt="quic",nnt="tcp",rnt="udp",ont="unix",int="network.type",ant="ipv4",snt="ipv6",unt="otel.scope.name",cnt="otel.scope.version",lnt="otel.status_code",dnt="ERROR",pnt="OK",fnt="otel.status_description",T5="server.address",C5="server.port",Ant="service.instance.id",I5="service.name",mnt="service.namespace",b5="service.version",gnt="signalr.connection.status",hnt="app_shutdown",_nt="normal_closure",Ent="timeout",Snt="signalr.transport",ynt="long_polling",Tnt="server_sent_events",Cnt="web_sockets",Int="telemetry.sdk.language",bnt="cpp",vnt="dotnet",Rnt="erlang",xnt="go",Dnt="java",Bnt="nodejs",Nnt="php",Ont="python",wnt="ruby",Mnt="rust",knt="swift",Pnt="webjs",Unt="telemetry.sdk.name",Lnt="telemetry.sdk.version",Qnt="url.fragment",Wh="url.full",Fnt="url.path",Gnt="url.query",jnt="url.scheme",v5="user_agent.original"});var znt,Hnt,$nt,Vnt,qnt,Ynt,Knt,Jnt,Znt,Wnt,Xnt,ert,trt,nrt,rrt,ort,irt,art,srt,urt,crt,lrt,drt,prt,frt,Art,mrt,grt,hrt,_rt,Ert,Srt,yrt,Trt,Crt,Irt,brt,vrt,Rrt,xrt,Drt,Brt,Nrt,Ort,wrt,Mrt,krt,Prt,Urt,Lrt,Qrt,H_e=O(()=>{A();znt="aspnetcore.diagnostics.exceptions",Hnt="aspnetcore.rate_limiting.active_request_leases",$nt="aspnetcore.rate_limiting.queued_requests",Vnt="aspnetcore.rate_limiting.request.time_in_queue",qnt="aspnetcore.rate_limiting.request_lease.duration",Ynt="aspnetcore.rate_limiting.requests",Knt="aspnetcore.routing.match_attempts",Jnt="db.client.operation.duration",Znt="dotnet.assembly.count",Wnt="dotnet.exceptions",Xnt="dotnet.gc.collections",ert="dotnet.gc.heap.total_allocated",trt="dotnet.gc.last_collection.heap.fragmentation.size",nrt="dotnet.gc.last_collection.heap.size",rrt="dotnet.gc.last_collection.memory.committed_size",ort="dotnet.gc.pause.time",irt="dotnet.jit.compilation.time",art="dotnet.jit.compiled_il.size",srt="dotnet.jit.compiled_methods",urt="dotnet.monitor.lock_contentions",crt="dotnet.process.cpu.count",lrt="dotnet.process.cpu.time",drt="dotnet.process.memory.working_set",prt="dotnet.thread_pool.queue.length",frt="dotnet.thread_pool.thread.count",Art="dotnet.thread_pool.work_item.count",mrt="dotnet.timer.count",grt="http.client.request.duration",hrt="http.server.request.duration",_rt="jvm.class.count",Ert="jvm.class.loaded",Srt="jvm.class.unloaded",yrt="jvm.cpu.count",Trt="jvm.cpu.recent_utilization",Crt="jvm.cpu.time",Irt="jvm.gc.duration",brt="jvm.memory.committed",vrt="jvm.memory.limit",Rrt="jvm.memory.used",xrt="jvm.memory.used_after_last_gc",Drt="jvm.thread.count",Brt="kestrel.active_connections",Nrt="kestrel.active_tls_handshakes",Ort="kestrel.connection.duration",wrt="kestrel.queued_connections",Mrt="kestrel.queued_requests",krt="kestrel.rejected_connections",Prt="kestrel.tls_handshake.duration",Urt="kestrel.upgraded_connections",Lrt="signalr.server.active_connections",Qrt="signalr.server.connection.duration"});var Frt,$_e=O(()=>{A();Frt="exception"});var Ur={};ja(Ur,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>ket,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Pet,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Uet,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Let,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>jet,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>zet,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Het,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>$et,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>Ket,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Jet,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Met,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Qet,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Fet,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Get,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Vet,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>qet,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Yet,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Zet,ATTR_CLIENT_ADDRESS:()=>Wet,ATTR_CLIENT_PORT:()=>Xet,ATTR_CODE_COLUMN_NUMBER:()=>ett,ATTR_CODE_FILE_PATH:()=>ttt,ATTR_CODE_FUNCTION_NAME:()=>ntt,ATTR_CODE_LINE_NUMBER:()=>rtt,ATTR_CODE_STACKTRACE:()=>ott,ATTR_DB_COLLECTION_NAME:()=>f5,ATTR_DB_NAMESPACE:()=>A5,ATTR_DB_OPERATION_BATCH_SIZE:()=>itt,ATTR_DB_OPERATION_NAME:()=>FI,ATTR_DB_QUERY_SUMMARY:()=>att,ATTR_DB_QUERY_TEXT:()=>m5,ATTR_DB_RESPONSE_STATUS_CODE:()=>g5,ATTR_DB_STORED_PROCEDURE_NAME:()=>stt,ATTR_DB_SYSTEM_NAME:()=>CS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>ptt,ATTR_ERROR_TYPE:()=>h5,ATTR_EXCEPTION_ESCAPED:()=>Ett,ATTR_EXCEPTION_MESSAGE:()=>Stt,ATTR_EXCEPTION_STACKTRACE:()=>ytt,ATTR_EXCEPTION_TYPE:()=>Ttt,ATTR_HTTP_REQUEST_HEADER:()=>Ctt,ATTR_HTTP_REQUEST_METHOD:()=>IS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Mtt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>ktt,ATTR_HTTP_RESPONSE_HEADER:()=>Ptt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>tg,ATTR_HTTP_ROUTE:()=>ng,ATTR_JVM_GC_ACTION:()=>Utt,ATTR_JVM_GC_NAME:()=>Ltt,ATTR_JVM_MEMORY_POOL_NAME:()=>Qtt,ATTR_JVM_MEMORY_TYPE:()=>Ftt,ATTR_JVM_THREAD_DAEMON:()=>ztt,ATTR_JVM_THREAD_STATE:()=>Htt,ATTR_NETWORK_LOCAL_ADDRESS:()=>Ztt,ATTR_NETWORK_LOCAL_PORT:()=>Wtt,ATTR_NETWORK_PEER_ADDRESS:()=>_5,ATTR_NETWORK_PEER_PORT:()=>E5,ATTR_NETWORK_PROTOCOL_NAME:()=>Xtt,ATTR_NETWORK_PROTOCOL_VERSION:()=>S5,ATTR_NETWORK_TRANSPORT:()=>y5,ATTR_NETWORK_TYPE:()=>int,ATTR_OTEL_SCOPE_NAME:()=>unt,ATTR_OTEL_SCOPE_VERSION:()=>cnt,ATTR_OTEL_STATUS_CODE:()=>lnt,ATTR_OTEL_STATUS_DESCRIPTION:()=>fnt,ATTR_SERVER_ADDRESS:()=>T5,ATTR_SERVER_PORT:()=>C5,ATTR_SERVICE_INSTANCE_ID:()=>Ant,ATTR_SERVICE_NAME:()=>I5,ATTR_SERVICE_NAMESPACE:()=>mnt,ATTR_SERVICE_VERSION:()=>b5,ATTR_SIGNALR_CONNECTION_STATUS:()=>gnt,ATTR_SIGNALR_TRANSPORT:()=>Snt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Int,ATTR_TELEMETRY_SDK_NAME:()=>Unt,ATTR_TELEMETRY_SDK_VERSION:()=>Lnt,ATTR_URL_FRAGMENT:()=>Qnt,ATTR_URL_FULL:()=>Wh,ATTR_URL_PATH:()=>Fnt,ATTR_URL_QUERY:()=>Gnt,ATTR_URL_SCHEME:()=>jnt,ATTR_USER_AGENT_ORIGINAL:()=>v5,AWSECSLAUNCHTYPEVALUES_EC2:()=>WXe,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>XXe,AwsEcsLaunchtypeValues:()=>eet,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>MXe,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>kXe,CLOUDPLATFORMVALUES_AWS_EC2:()=>PXe,CLOUDPLATFORMVALUES_AWS_ECS:()=>UXe,CLOUDPLATFORMVALUES_AWS_EKS:()=>LXe,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>FXe,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>QXe,CLOUDPLATFORMVALUES_AZURE_AKS:()=>zXe,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>$Xe,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>jXe,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>HXe,CLOUDPLATFORMVALUES_AZURE_VM:()=>GXe,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>JXe,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>KXe,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>qXe,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>VXe,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>YXe,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>DXe,CLOUDPROVIDERVALUES_AWS:()=>BXe,CLOUDPROVIDERVALUES_AZURE:()=>NXe,CLOUDPROVIDERVALUES_GCP:()=>OXe,CloudPlatformValues:()=>ZXe,CloudProviderValues:()=>wXe,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>AJe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>TJe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>mJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>yJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>hJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>IJe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>_Je,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>gJe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>CJe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>SJe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>EJe,DBSYSTEMVALUES_ADABAS:()=>UKe,DBSYSTEMVALUES_CACHE:()=>PKe,DBSYSTEMVALUES_CASSANDRA:()=>eJe,DBSYSTEMVALUES_CLOUDSCAPE:()=>xKe,DBSYSTEMVALUES_COCKROACHDB:()=>pJe,DBSYSTEMVALUES_COLDFUSION:()=>XKe,DBSYSTEMVALUES_COSMOSDB:()=>aJe,DBSYSTEMVALUES_COUCHBASE:()=>oJe,DBSYSTEMVALUES_COUCHDB:()=>iJe,DBSYSTEMVALUES_DB2:()=>IKe,DBSYSTEMVALUES_DERBY:()=>QKe,DBSYSTEMVALUES_DYNAMODB:()=>sJe,DBSYSTEMVALUES_EDB:()=>kKe,DBSYSTEMVALUES_ELASTICSEARCH:()=>lJe,DBSYSTEMVALUES_FILEMAKER:()=>FKe,DBSYSTEMVALUES_FIREBIRD:()=>LKe,DBSYSTEMVALUES_FIRSTSQL:()=>MKe,DBSYSTEMVALUES_GEODE:()=>cJe,DBSYSTEMVALUES_H2:()=>WKe,DBSYSTEMVALUES_HANADB:()=>OKe,DBSYSTEMVALUES_HBASE:()=>tJe,DBSYSTEMVALUES_HIVE:()=>RKe,DBSYSTEMVALUES_HSQLDB:()=>DKe,DBSYSTEMVALUES_INFORMIX:()=>GKe,DBSYSTEMVALUES_INGRES:()=>wKe,DBSYSTEMVALUES_INSTANTDB:()=>jKe,DBSYSTEMVALUES_INTERBASE:()=>zKe,DBSYSTEMVALUES_MARIADB:()=>HKe,DBSYSTEMVALUES_MAXDB:()=>NKe,DBSYSTEMVALUES_MEMCACHED:()=>dJe,DBSYSTEMVALUES_MONGODB:()=>nJe,DBSYSTEMVALUES_MSSQL:()=>yKe,DBSYSTEMVALUES_MYSQL:()=>TKe,DBSYSTEMVALUES_NEO4J:()=>uJe,DBSYSTEMVALUES_NETEZZA:()=>$Ke,DBSYSTEMVALUES_ORACLE:()=>CKe,DBSYSTEMVALUES_OTHER_SQL:()=>SKe,DBSYSTEMVALUES_PERVASIVE:()=>VKe,DBSYSTEMVALUES_POINTBASE:()=>qKe,DBSYSTEMVALUES_POSTGRESQL:()=>bKe,DBSYSTEMVALUES_PROGRESS:()=>BKe,DBSYSTEMVALUES_REDIS:()=>rJe,DBSYSTEMVALUES_REDSHIFT:()=>vKe,DBSYSTEMVALUES_SQLITE:()=>YKe,DBSYSTEMVALUES_SYBASE:()=>KKe,DBSYSTEMVALUES_TERADATA:()=>JKe,DBSYSTEMVALUES_VERTICA:()=>ZKe,DB_SYSTEM_NAME_VALUE_MARIADB:()=>utt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>ctt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>ltt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>dtt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>ftt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Att,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>mtt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>gtt,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>htt,DbCassandraConsistencyLevelValues:()=>bJe,DbSystemValues:()=>fJe,ERROR_TYPE_VALUE_OTHER:()=>_tt,EVENT_EXCEPTION:()=>Frt,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>MJe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>wJe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>OJe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>PJe,FAASINVOKEDPROVIDERVALUES_AWS:()=>UJe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>LJe,FAASINVOKEDPROVIDERVALUES_GCP:()=>QJe,FAASTRIGGERVALUES_DATASOURCE:()=>vJe,FAASTRIGGERVALUES_HTTP:()=>RJe,FAASTRIGGERVALUES_OTHER:()=>BJe,FAASTRIGGERVALUES_PUBSUB:()=>xJe,FAASTRIGGERVALUES_TIMER:()=>DJe,FaasDocumentOperationValues:()=>kJe,FaasInvokedProviderValues:()=>FJe,FaasTriggerValues:()=>NJe,HOSTARCHVALUES_AMD64:()=>tet,HOSTARCHVALUES_ARM32:()=>net,HOSTARCHVALUES_ARM64:()=>ret,HOSTARCHVALUES_IA64:()=>oet,HOSTARCHVALUES_PPC32:()=>iet,HOSTARCHVALUES_PPC64:()=>aet,HOSTARCHVALUES_X86:()=>set,HTTPFLAVORVALUES_HTTP_1_0:()=>CZe,HTTPFLAVORVALUES_HTTP_1_1:()=>IZe,HTTPFLAVORVALUES_HTTP_2_0:()=>bZe,HTTPFLAVORVALUES_QUIC:()=>RZe,HTTPFLAVORVALUES_SPDY:()=>vZe,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>btt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>vtt,HTTP_REQUEST_METHOD_VALUE_GET:()=>Rtt,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>xtt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Dtt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Itt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Btt,HTTP_REQUEST_METHOD_VALUE_POST:()=>Ntt,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Ott,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>wtt,HostArchValues:()=>uet,HttpFlavorValues:()=>xZe,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Gtt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>jtt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>$tt,JVM_THREAD_STATE_VALUE_NEW:()=>Vtt,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>qtt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Ytt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>Ktt,JVM_THREAD_STATE_VALUE_WAITING:()=>Jtt,MESSAGETYPEVALUES_RECEIVED:()=>eWe,MESSAGETYPEVALUES_SENT:()=>XZe,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>DZe,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>BZe,MESSAGINGOPERATIONVALUES_PROCESS:()=>wZe,MESSAGINGOPERATIONVALUES_RECEIVE:()=>OZe,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>znt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Hnt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>$nt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Ynt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>qnt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Vnt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Knt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Jnt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Znt,METRIC_DOTNET_EXCEPTIONS:()=>Wnt,METRIC_DOTNET_GC_COLLECTIONS:()=>Xnt,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>ert,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>trt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>nrt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>rrt,METRIC_DOTNET_GC_PAUSE_TIME:()=>ort,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>irt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>art,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>srt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>urt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>crt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>lrt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>drt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>prt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>frt,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>Art,METRIC_DOTNET_TIMER_COUNT:()=>mrt,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>grt,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>hrt,METRIC_JVM_CLASS_COUNT:()=>_rt,METRIC_JVM_CLASS_LOADED:()=>Ert,METRIC_JVM_CLASS_UNLOADED:()=>Srt,METRIC_JVM_CPU_COUNT:()=>yrt,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Trt,METRIC_JVM_CPU_TIME:()=>Crt,METRIC_JVM_GC_DURATION:()=>Irt,METRIC_JVM_MEMORY_COMMITTED:()=>brt,METRIC_JVM_MEMORY_LIMIT:()=>vrt,METRIC_JVM_MEMORY_USED:()=>Rrt,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>xrt,METRIC_JVM_THREAD_COUNT:()=>Drt,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Brt,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Nrt,METRIC_KESTREL_CONNECTION_DURATION:()=>Ort,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>wrt,METRIC_KESTREL_QUEUED_REQUESTS:()=>Mrt,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>krt,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Prt,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Urt,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Lrt,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Qrt,MessageTypeValues:()=>tWe,MessagingDestinationKindValues:()=>NZe,MessagingOperationValues:()=>MZe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>oZe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>sZe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>nZe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>AZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>iZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>aZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>pZe,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>tZe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>gZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>uZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>lZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>mZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>cZe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>dZe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>_Ze,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>fZe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>yZe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>EZe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>SZe,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>hZe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>rZe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>ZJe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>WJe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>XJe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>KJe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>JJe,NETTRANSPORTVALUES_INPROC:()=>VJe,NETTRANSPORTVALUES_IP:()=>zJe,NETTRANSPORTVALUES_IP_TCP:()=>GJe,NETTRANSPORTVALUES_IP_UDP:()=>jJe,NETTRANSPORTVALUES_OTHER:()=>qJe,NETTRANSPORTVALUES_PIPE:()=>$Je,NETTRANSPORTVALUES_UNIX:()=>HJe,NETWORK_TRANSPORT_VALUE_PIPE:()=>ent,NETWORK_TRANSPORT_VALUE_QUIC:()=>tnt,NETWORK_TRANSPORT_VALUE_TCP:()=>nnt,NETWORK_TRANSPORT_VALUE_UDP:()=>rnt,NETWORK_TRANSPORT_VALUE_UNIX:()=>ont,NETWORK_TYPE_VALUE_IPV4:()=>ant,NETWORK_TYPE_VALUE_IPV6:()=>snt,NetHostConnectionSubtypeValues:()=>TZe,NetHostConnectionTypeValues:()=>eZe,NetTransportValues:()=>YJe,OSTYPEVALUES_AIX:()=>_et,OSTYPEVALUES_DARWIN:()=>pet,OSTYPEVALUES_DRAGONFLYBSD:()=>get,OSTYPEVALUES_FREEBSD:()=>fet,OSTYPEVALUES_HPUX:()=>het,OSTYPEVALUES_LINUX:()=>det,OSTYPEVALUES_NETBSD:()=>Aet,OSTYPEVALUES_OPENBSD:()=>met,OSTYPEVALUES_SOLARIS:()=>Eet,OSTYPEVALUES_WINDOWS:()=>cet,OSTYPEVALUES_Z_OS:()=>yet,OTEL_STATUS_CODE_VALUE_ERROR:()=>dnt,OTEL_STATUS_CODE_VALUE_OK:()=>pnt,OsTypeValues:()=>Tet,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>$Ze,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>GZe,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>PZe,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>JZe,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>QZe,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>HZe,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>YZe,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>LZe,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>FZe,RPCGRPCSTATUSCODEVALUES_OK:()=>kZe,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>VZe,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>jZe,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>zZe,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>ZZe,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>KZe,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>qZe,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>UZe,RpcGrpcStatusCodeValues:()=>WZe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>NYe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>zYe,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>xYe,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>IYe,SEMATTRS_AWS_DYNAMODB_COUNT:()=>GYe,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>PYe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>MYe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>HYe,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>OYe,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>bYe,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>BYe,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>kYe,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>DYe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>vYe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>RYe,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>jYe,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>LYe,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>QYe,SEMATTRS_AWS_DYNAMODB_SELECT:()=>wYe,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>UYe,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>CYe,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>FYe,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>m7e,SEMATTRS_CODE_FILEPATH:()=>fYe,SEMATTRS_CODE_FUNCTION:()=>dYe,SEMATTRS_CODE_LINENO:()=>AYe,SEMATTRS_CODE_NAMESPACE:()=>pYe,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>I7e,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>D7e,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>x7e,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>v7e,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>T7e,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>C7e,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>R7e,SEMATTRS_DB_CASSANDRA_TABLE:()=>b7e,SEMATTRS_DB_CONNECTION_STRING:()=>g7e,SEMATTRS_DB_HBASE_NAMESPACE:()=>B7e,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>_7e,SEMATTRS_DB_MONGODB_COLLECTION:()=>O7e,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>y7e,SEMATTRS_DB_NAME:()=>E7e,SEMATTRS_DB_OPERATION:()=>S7e,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>N7e,SEMATTRS_DB_SQL_TABLE:()=>w7e,SEMATTRS_DB_STATEMENT:()=>e5,SEMATTRS_DB_SYSTEM:()=>X$,SEMATTRS_DB_USER:()=>h7e,SEMATTRS_ENDUSER_ID:()=>aYe,SEMATTRS_ENDUSER_ROLE:()=>sYe,SEMATTRS_ENDUSER_SCOPE:()=>uYe,SEMATTRS_EXCEPTION_ESCAPED:()=>U7e,SEMATTRS_EXCEPTION_MESSAGE:()=>k7e,SEMATTRS_EXCEPTION_STACKTRACE:()=>P7e,SEMATTRS_EXCEPTION_TYPE:()=>M7e,SEMATTRS_FAAS_COLDSTART:()=>$7e,SEMATTRS_FAAS_CRON:()=>H7e,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Q7e,SEMATTRS_FAAS_DOCUMENT_NAME:()=>j7e,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>F7e,SEMATTRS_FAAS_DOCUMENT_TIME:()=>G7e,SEMATTRS_FAAS_EXECUTION:()=>L7e,SEMATTRS_FAAS_INVOKED_NAME:()=>V7e,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>q7e,SEMATTRS_FAAS_INVOKED_REGION:()=>Y7e,SEMATTRS_FAAS_TIME:()=>z7e,SEMATTRS_FAAS_TRIGGER:()=>t5,SEMATTRS_HTTP_CLIENT_IP:()=>TYe,SEMATTRS_HTTP_FLAVOR:()=>hYe,SEMATTRS_HTTP_HOST:()=>mYe,SEMATTRS_HTTP_METHOD:()=>nB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>EYe,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>SYe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>a5,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>s5,SEMATTRS_HTTP_ROUTE:()=>u5,SEMATTRS_HTTP_SCHEME:()=>gYe,SEMATTRS_HTTP_SERVER_NAME:()=>yYe,SEMATTRS_HTTP_STATUS_CODE:()=>TS,SEMATTRS_HTTP_TARGET:()=>i5,SEMATTRS_HTTP_URL:()=>QI,SEMATTRS_HTTP_USER_AGENT:()=>_Ye,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>hKe,SEMATTRS_MESSAGE_ID:()=>gKe,SEMATTRS_MESSAGE_TYPE:()=>mKe,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>_Ke,SEMATTRS_MESSAGING_CONSUMER_ID:()=>nKe,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>WYe,SEMATTRS_MESSAGING_DESTINATION:()=>$Ye,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>VYe,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>aKe,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>iKe,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>oKe,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>sKe,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>uKe,SEMATTRS_MESSAGING_MESSAGE_ID:()=>ZYe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>eKe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>XYe,SEMATTRS_MESSAGING_OPERATION:()=>tKe,SEMATTRS_MESSAGING_PROTOCOL:()=>YYe,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>KYe,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>rKe,SEMATTRS_MESSAGING_SYSTEM:()=>c5,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>qYe,SEMATTRS_MESSAGING_URL:()=>JYe,SEMATTRS_NET_HOST_CARRIER_ICC:()=>oYe,SEMATTRS_NET_HOST_CARRIER_MCC:()=>nYe,SEMATTRS_NET_HOST_CARRIER_MNC:()=>rYe,SEMATTRS_NET_HOST_CARRIER_NAME:()=>tYe,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>eYe,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>X7e,SEMATTRS_NET_HOST_IP:()=>r5,SEMATTRS_NET_HOST_NAME:()=>W7e,SEMATTRS_NET_HOST_PORT:()=>o5,SEMATTRS_NET_PEER_IP:()=>n5,SEMATTRS_NET_PEER_NAME:()=>Z7e,SEMATTRS_NET_PEER_PORT:()=>J7e,SEMATTRS_NET_TRANSPORT:()=>K7e,SEMATTRS_PEER_SERVICE:()=>iYe,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>d5,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>fKe,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>AKe,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>pKe,SEMATTRS_RPC_JSONRPC_VERSION:()=>dKe,SEMATTRS_RPC_METHOD:()=>lKe,SEMATTRS_RPC_SERVICE:()=>l5,SEMATTRS_RPC_SYSTEM:()=>cKe,SEMATTRS_THREAD_ID:()=>cYe,SEMATTRS_THREAD_NAME:()=>lYe,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>uWe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>sWe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>cWe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>lWe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>dWe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>pWe,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>fWe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>mWe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>AWe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>hWe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>gWe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>rWe,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>iWe,SEMRESATTRS_CLOUD_PLATFORM:()=>aWe,SEMRESATTRS_CLOUD_PROVIDER:()=>nWe,SEMRESATTRS_CLOUD_REGION:()=>oWe,SEMRESATTRS_CONTAINER_ID:()=>EWe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>yWe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>TWe,SEMRESATTRS_CONTAINER_NAME:()=>_We,SEMRESATTRS_CONTAINER_RUNTIME:()=>SWe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>CWe,SEMRESATTRS_DEVICE_ID:()=>IWe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>bWe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>vWe,SEMRESATTRS_FAAS_ID:()=>xWe,SEMRESATTRS_FAAS_INSTANCE:()=>BWe,SEMRESATTRS_FAAS_MAX_MEMORY:()=>NWe,SEMRESATTRS_FAAS_NAME:()=>RWe,SEMRESATTRS_FAAS_VERSION:()=>DWe,SEMRESATTRS_HOST_ARCH:()=>kWe,SEMRESATTRS_HOST_ID:()=>OWe,SEMRESATTRS_HOST_IMAGE_ID:()=>UWe,SEMRESATTRS_HOST_IMAGE_NAME:()=>PWe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>LWe,SEMRESATTRS_HOST_NAME:()=>wWe,SEMRESATTRS_HOST_TYPE:()=>MWe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>QWe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>$We,SEMRESATTRS_K8S_CRONJOB_NAME:()=>rXe,SEMRESATTRS_K8S_CRONJOB_UID:()=>nXe,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>XWe,SEMRESATTRS_K8S_DAEMONSET_UID:()=>WWe,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>KWe,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>YWe,SEMRESATTRS_K8S_JOB_NAME:()=>tXe,SEMRESATTRS_K8S_JOB_UID:()=>eXe,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>jWe,SEMRESATTRS_K8S_NODE_NAME:()=>FWe,SEMRESATTRS_K8S_NODE_UID:()=>GWe,SEMRESATTRS_K8S_POD_NAME:()=>HWe,SEMRESATTRS_K8S_POD_UID:()=>zWe,SEMRESATTRS_K8S_REPLICASET_NAME:()=>qWe,SEMRESATTRS_K8S_REPLICASET_UID:()=>VWe,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>ZWe,SEMRESATTRS_K8S_STATEFULSET_UID:()=>JWe,SEMRESATTRS_OS_DESCRIPTION:()=>iXe,SEMRESATTRS_OS_NAME:()=>aXe,SEMRESATTRS_OS_TYPE:()=>oXe,SEMRESATTRS_OS_VERSION:()=>sXe,SEMRESATTRS_PROCESS_COMMAND:()=>dXe,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>fXe,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>pXe,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>cXe,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>lXe,SEMRESATTRS_PROCESS_OWNER:()=>AXe,SEMRESATTRS_PROCESS_PID:()=>uXe,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>hXe,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>mXe,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>gXe,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>EXe,SEMRESATTRS_SERVICE_NAME:()=>_Xe,SEMRESATTRS_SERVICE_NAMESPACE:()=>p5,SEMRESATTRS_SERVICE_VERSION:()=>SXe,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>IXe,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>TXe,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>yXe,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>CXe,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>RXe,SEMRESATTRS_WEBENGINE_NAME:()=>bXe,SEMRESATTRS_WEBENGINE_VERSION:()=>vXe,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>hnt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>_nt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Ent,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>ynt,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Tnt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Cnt,SemanticAttributes:()=>EKe,SemanticResourceAttributes:()=>xXe,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Cet,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Iet,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>bet,TELEMETRYSDKLANGUAGEVALUES_GO:()=>vet,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Ret,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>xet,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Det,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Bet,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Net,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Oet,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>bnt,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>vnt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Rnt,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>xnt,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Dnt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Bnt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>Nnt,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Ont,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>wnt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Mnt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>knt,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Pnt,TelemetrySdkLanguageValues:()=>wet});var Kn=O(()=>{A();gge();j_e();z_e();H_e();$_e()});var V_e=F(EP=>{"use strict";A();Object.defineProperty(EP,"__esModule",{value:!0});EP.ATTR_PROCESS_RUNTIME_NAME=void 0;EP.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var q_e=F(yP=>{"use strict";A();Object.defineProperty(yP,"__esModule",{value:!0});yP.SDK_INFO=void 0;var Grt=bde(),SP=(Kn(),ke(Ur)),jrt=V_e();yP.SDK_INFO={[SP.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[jrt.ATTR_PROCESS_RUNTIME_NAME]:"node",[SP.ATTR_TELEMETRY_SDK_LANGUAGE]:SP.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[SP.ATTR_TELEMETRY_SDK_VERSION]:Grt.VERSION}});var Y_e=F(Ks=>{"use strict";A();Object.defineProperty(Ks,"__esModule",{value:!0});Ks.otperformance=Ks.SDK_INFO=Ks._globalThis=Ks.getStringListFromEnv=Ks.getNumberFromEnv=Ks.getBooleanFromEnv=Ks.getStringFromEnv=void 0;var TP=Cde();Object.defineProperty(Ks,"getStringFromEnv",{enumerable:!0,get:function(){return TP.getStringFromEnv}});Object.defineProperty(Ks,"getBooleanFromEnv",{enumerable:!0,get:function(){return TP.getBooleanFromEnv}});Object.defineProperty(Ks,"getNumberFromEnv",{enumerable:!0,get:function(){return TP.getNumberFromEnv}});Object.defineProperty(Ks,"getStringListFromEnv",{enumerable:!0,get:function(){return TP.getStringListFromEnv}});var zrt=Ide();Object.defineProperty(Ks,"_globalThis",{enumerable:!0,get:function(){return zrt._globalThis}});var Hrt=q_e();Object.defineProperty(Ks,"SDK_INFO",{enumerable:!0,get:function(){return Hrt.SDK_INFO}});Ks.otperformance=performance});var R5=F(Js=>{"use strict";A();Object.defineProperty(Js,"__esModule",{value:!0});Js.getStringListFromEnv=Js.getNumberFromEnv=Js.getStringFromEnv=Js.getBooleanFromEnv=Js.otperformance=Js._globalThis=Js.SDK_INFO=void 0;var bS=Y_e();Object.defineProperty(Js,"SDK_INFO",{enumerable:!0,get:function(){return bS.SDK_INFO}});Object.defineProperty(Js,"_globalThis",{enumerable:!0,get:function(){return bS._globalThis}});Object.defineProperty(Js,"otperformance",{enumerable:!0,get:function(){return bS.otperformance}});Object.defineProperty(Js,"getBooleanFromEnv",{enumerable:!0,get:function(){return bS.getBooleanFromEnv}});Object.defineProperty(Js,"getStringFromEnv",{enumerable:!0,get:function(){return bS.getStringFromEnv}});Object.defineProperty(Js,"getNumberFromEnv",{enumerable:!0,get:function(){return bS.getNumberFromEnv}});Object.defineProperty(Js,"getStringListFromEnv",{enumerable:!0,get:function(){return bS.getStringListFromEnv}})});var W_e=F(io=>{"use strict";A();Object.defineProperty(io,"__esModule",{value:!0});io.addHrTimes=io.isTimeInput=io.isTimeInputHrTime=io.hrTimeToMicroseconds=io.hrTimeToMilliseconds=io.hrTimeToNanoseconds=io.hrTimeToTimeStamp=io.hrTimeDuration=io.timeInputToHrTime=io.hrTime=io.getTimeOrigin=io.millisToHrTime=void 0;var CP=R5(),K_e=9,$rt=6,Vrt=Math.pow(10,$rt),IP=Math.pow(10,K_e);function rB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*Vrt);return[n,r]}io.millisToHrTime=rB;function qrt(){return CP.otperformance.timeOrigin}io.getTimeOrigin=qrt;function J_e(e){let t=rB(CP.otperformance.timeOrigin),n=rB(typeof e=="number"?e:CP.otperformance.now());return Z_e(t,n)}io.hrTime=J_e;function Yrt(e){if(x5(e))return e;if(typeof e=="number")return e<CP.otperformance.timeOrigin?J_e(e):rB(e);if(e instanceof Date)return rB(e.getTime());throw TypeError("Invalid input type")}io.timeInputToHrTime=Yrt;function Krt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=IP),[n,r]}io.hrTimeDuration=Krt;function Jrt(e){let t=K_e,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}io.hrTimeToTimeStamp=Jrt;function Zrt(e){return e[0]*IP+e[1]}io.hrTimeToNanoseconds=Zrt;function Wrt(e){return e[0]*1e3+e[1]/1e6}io.hrTimeToMilliseconds=Wrt;function Xrt(e){return e[0]*1e6+e[1]/1e3}io.hrTimeToMicroseconds=Xrt;function x5(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}io.isTimeInputHrTime=x5;function eot(e){return x5(e)||typeof e=="number"||e instanceof Date}io.isTimeInput=eot;function Z_e(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=IP&&(n[1]-=IP,n[0]+=1),n}io.addHrTimes=Z_e});var X_e=F(bP=>{"use strict";A();Object.defineProperty(bP,"__esModule",{value:!0});bP.unrefTimer=void 0;function tot(e){typeof e!="number"&&e.unref()}bP.unrefTimer=tot});var eEe=F(oB=>{"use strict";A();Object.defineProperty(oB,"__esModule",{value:!0});oB.ExportResultCode=void 0;var not;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(not=oB.ExportResultCode||(oB.ExportResultCode={}))});var nEe=F(vP=>{"use strict";A();Object.defineProperty(vP,"__esModule",{value:!0});vP.CompositePropagator=void 0;var tEe=(Ge(),ke(Ze)),D5=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,r)=>n.concat(r),[])))}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){tEe.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${i.message}`)}}extract(t,n,r){return this._propagators.reduce((o,i)=>{try{return i.extract(o,n,r)}catch(a){tEe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${a.message}`)}return o},t)}fields(){return this._fields.slice()}};vP.CompositePropagator=D5});var rEe=F(GI=>{"use strict";A();Object.defineProperty(GI,"__esModule",{value:!0});GI.validateValue=GI.validateKey=void 0;var B5="[_0-9a-z-*/]",rot=`[a-z]${B5}{0,255}`,oot=`[a-z0-9]${B5}{0,240}@[a-z]${B5}{0,13}`,iot=new RegExp(`^(?:${rot}|${oot})$`),aot=/^[ -~]{0,255}[!-~]$/,sot=/,|=/;function uot(e){return iot.test(e)}GI.validateKey=uot;function cot(e){return aot.test(e)&&!sot.test(e)}GI.validateValue=cot});var O5=F(RP=>{"use strict";A();Object.defineProperty(RP,"__esModule",{value:!0});RP.TraceState=void 0;var oEe=rEe(),iEe=32,lot=512,aEe=",",sEe="=",N5=class e{_internalState=new Map;constructor(t){t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,n)=>(t.push(n+sEe+this.get(n)),t),[]).join(aEe)}_parse(t){t.length>lot||(this._internalState=t.split(aEe).reverse().reduce((n,r)=>{let o=r.trim(),i=o.indexOf(sEe);if(i!==-1){let a=o.slice(0,i),c=o.slice(i+1,r.length);(0,oEe.validateKey)(a)&&(0,oEe.validateValue)(c)&&n.set(a,c)}return n},new Map),this._internalState.size>iEe&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,iEe))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}};RP.TraceState=N5});var cEe=F(Zs=>{"use strict";A();Object.defineProperty(Zs,"__esModule",{value:!0});Zs.W3CTraceContextPropagator=Zs.parseTraceParent=Zs.TRACE_STATE_HEADER=Zs.TRACE_PARENT_HEADER=void 0;var xP=(Ge(),ke(Ze)),dot=tB(),pot=O5();Zs.TRACE_PARENT_HEADER="traceparent";Zs.TRACE_STATE_HEADER="tracestate";var fot="00",Aot="(?!ff)[\\da-f]{2}",mot="(?![0]{32})[\\da-f]{32}",got="(?![0]{16})[\\da-f]{16}",hot="[\\da-f]{2}",_ot=new RegExp(`^\\s?(${Aot})-(${mot})-(${got})-(${hot})(-.*)?\\s?$`);function uEe(e){let t=_ot.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}Zs.parseTraceParent=uEe;var w5=class{inject(t,n,r){let o=xP.trace.getSpanContext(t);if(!o||(0,dot.isTracingSuppressed)(t)||!(0,xP.isSpanContextValid)(o))return;let i=`${fot}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||xP.TraceFlags.NONE).toString(16)}`;r.set(n,Zs.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,Zs.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,Zs.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let a=uEe(i);if(!a)return t;a.isRemote=!0;let c=r.get(n,Zs.TRACE_STATE_HEADER);if(c){let d=Array.isArray(c)?c.join(","):c;a.traceState=new pot.TraceState(typeof d=="string"?d:void 0)}return xP.trace.setSpanContext(t,a)}fields(){return[Zs.TRACE_PARENT_HEADER,Zs.TRACE_STATE_HEADER]}};Zs.W3CTraceContextPropagator=w5});var lEe=F($p=>{"use strict";A();Object.defineProperty($p,"__esModule",{value:!0});$p.getRPCMetadata=$p.deleteRPCMetadata=$p.setRPCMetadata=$p.RPCType=void 0;var Eot=(Ge(),ke(Ze)),M5=(0,Eot.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Sot;(function(e){e.HTTP="http"})(Sot=$p.RPCType||($p.RPCType={}));function yot(e,t){return e.setValue(M5,t)}$p.setRPCMetadata=yot;function Tot(e){return e.deleteValue(M5)}$p.deleteRPCMetadata=Tot;function Cot(e){return e.getValue(M5)}$p.getRPCMetadata=Cot});var mEe=F(DP=>{"use strict";A();Object.defineProperty(DP,"__esModule",{value:!0});DP.isPlainObject=void 0;var Iot="[object Object]",bot="[object Null]",vot="[object Undefined]",Rot=Function.prototype,dEe=Rot.toString,xot=dEe.call(Object),Dot=Object.getPrototypeOf,pEe=Object.prototype,fEe=pEe.hasOwnProperty,vS=Symbol?Symbol.toStringTag:void 0,AEe=pEe.toString;function Bot(e){if(!Not(e)||Oot(e)!==Iot)return!1;let t=Dot(e);if(t===null)return!0;let n=fEe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&dEe.call(n)===xot}DP.isPlainObject=Bot;function Not(e){return e!=null&&typeof e=="object"}function Oot(e){return e==null?e===void 0?vot:bot:vS&&vS in Object(e)?wot(e):Mot(e)}function wot(e){let t=fEe.call(e,vS),n=e[vS],r=!1;try{e[vS]=void 0,r=!0}catch{}let o=AEe.call(e);return r&&(t?e[vS]=n:delete e[vS]),o}function Mot(e){return AEe.call(e)}});var SEe=F(OP=>{"use strict";A();Object.defineProperty(OP,"__esModule",{value:!0});OP.merge=void 0;var gEe=mEe(),kot=20;function Pot(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=_Ee(t,e.shift(),0,n);return t}OP.merge=Pot;function k5(e){return NP(e)?e.slice():e}function _Ee(e,t,n=0,r){let o;if(!(n>kot)){if(n++,BP(e)||BP(t)||EEe(t))o=k5(t);else if(NP(e)){if(o=e.slice(),NP(t))for(let i=0,a=t.length;i<a;i++)o.push(k5(t[i]));else if(iB(t)){let i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){let d=i[a];o[d]=k5(t[d])}}}else if(iB(e))if(iB(t)){if(!Uot(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){let d=i[a],m=t[d];if(BP(m))typeof m>"u"?delete o[d]:o[d]=m;else{let h=o[d],S=m;if(hEe(e,d,r)||hEe(t,d,r))delete o[d];else{if(iB(h)&&iB(S)){let y=r.get(h)||[],I=r.get(S)||[];y.push({obj:e,key:d}),I.push({obj:t,key:d}),r.set(h,y),r.set(S,I)}o[d]=_Ee(o[d],m,n,r)}}}}else o=t;return o}}function hEe(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let a=r[o];if(a.key===t&&a.obj===e)return!0}return!1}function NP(e){return Array.isArray(e)}function EEe(e){return typeof e=="function"}function iB(e){return!BP(e)&&!NP(e)&&!EEe(e)&&typeof e=="object"}function BP(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function Uot(e,t){return!(!(0,gEe.isPlainObject)(e)||!(0,gEe.isPlainObject)(t))}});var yEe=F(jI=>{"use strict";A();Object.defineProperty(jI,"__esModule",{value:!0});jI.callWithTimeout=jI.TimeoutError=void 0;var wP=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};jI.TimeoutError=wP;function Lot(e,t){let n,r=new Promise(function(i,a){n=setTimeout(function(){a(new wP("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}jI.callWithTimeout=Lot});var CEe=F(zI=>{"use strict";A();Object.defineProperty(zI,"__esModule",{value:!0});zI.isUrlIgnored=zI.urlMatches=void 0;function TEe(e,t){return typeof t=="string"?e===t:!!e.match(t)}zI.urlMatches=TEe;function Qot(e,t){if(!t)return!1;for(let n of t)if(TEe(e,n))return!0;return!1}zI.isUrlIgnored=Qot});var IEe=F(MP=>{"use strict";A();Object.defineProperty(MP,"__esModule",{value:!0});MP.Deferred=void 0;var P5=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};MP.Deferred=P5});var bEe=F(kP=>{"use strict";A();Object.defineProperty(kP,"__esModule",{value:!0});kP.BindOnceFuture=void 0;var Fot=IEe(),U5=class{_isCalled=!1;_deferred=new Fot.Deferred;_callback;_that;constructor(t,n){this._callback=t,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};kP.BindOnceFuture=U5});var REe=F(PP=>{"use strict";A();Object.defineProperty(PP,"__esModule",{value:!0});PP.diagLogLevelFromString=void 0;var rg=(Ge(),ke(Ze)),vEe={ALL:rg.DiagLogLevel.ALL,VERBOSE:rg.DiagLogLevel.VERBOSE,DEBUG:rg.DiagLogLevel.DEBUG,INFO:rg.DiagLogLevel.INFO,WARN:rg.DiagLogLevel.WARN,ERROR:rg.DiagLogLevel.ERROR,NONE:rg.DiagLogLevel.NONE};function Got(e){if(e==null)return;let t=vEe[e.toUpperCase()];return t??(rg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(vEe)}, using default`),rg.DiagLogLevel.INFO)}PP.diagLogLevelFromString=Got});var DEe=F(UP=>{"use strict";A();Object.defineProperty(UP,"__esModule",{value:!0});UP._export=void 0;var xEe=(Ge(),ke(Ze)),jot=tB();function zot(e,t){return new Promise(n=>{xEe.context.with((0,jot.suppressTracing)(xEe.context.active()),()=>{e.export(t,n)})})}UP._export=zot});var Tr=F(Oe=>{"use strict";A();Object.defineProperty(Oe,"__esModule",{value:!0});Oe.internal=Oe.diagLogLevelFromString=Oe.BindOnceFuture=Oe.urlMatches=Oe.isUrlIgnored=Oe.callWithTimeout=Oe.TimeoutError=Oe.merge=Oe.TraceState=Oe.unsuppressTracing=Oe.suppressTracing=Oe.isTracingSuppressed=Oe.setRPCMetadata=Oe.getRPCMetadata=Oe.deleteRPCMetadata=Oe.RPCType=Oe.parseTraceParent=Oe.W3CTraceContextPropagator=Oe.TRACE_STATE_HEADER=Oe.TRACE_PARENT_HEADER=Oe.CompositePropagator=Oe.otperformance=Oe.getStringListFromEnv=Oe.getNumberFromEnv=Oe.getBooleanFromEnv=Oe.getStringFromEnv=Oe._globalThis=Oe.SDK_INFO=Oe.parseKeyPairsIntoRecord=Oe.ExportResultCode=Oe.unrefTimer=Oe.timeInputToHrTime=Oe.millisToHrTime=Oe.isTimeInputHrTime=Oe.isTimeInput=Oe.hrTimeToTimeStamp=Oe.hrTimeToNanoseconds=Oe.hrTimeToMilliseconds=Oe.hrTimeToMicroseconds=Oe.hrTimeDuration=Oe.hrTime=Oe.getTimeOrigin=Oe.addHrTimes=Oe.loggingErrorHandler=Oe.setGlobalErrorHandler=Oe.globalErrorHandler=Oe.sanitizeAttributes=Oe.isAttributeValue=Oe.AnchoredClock=Oe.W3CBaggagePropagator=void 0;var Hot=dde();Object.defineProperty(Oe,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Hot.W3CBaggagePropagator}});var $ot=pde();Object.defineProperty(Oe,"AnchoredClock",{enumerable:!0,get:function(){return $ot.AnchoredClock}});var BEe=hde();Object.defineProperty(Oe,"isAttributeValue",{enumerable:!0,get:function(){return BEe.isAttributeValue}});Object.defineProperty(Oe,"sanitizeAttributes",{enumerable:!0,get:function(){return BEe.sanitizeAttributes}});var NEe=Ede();Object.defineProperty(Oe,"globalErrorHandler",{enumerable:!0,get:function(){return NEe.globalErrorHandler}});Object.defineProperty(Oe,"setGlobalErrorHandler",{enumerable:!0,get:function(){return NEe.setGlobalErrorHandler}});var Vot=Z$();Object.defineProperty(Oe,"loggingErrorHandler",{enumerable:!0,get:function(){return Vot.loggingErrorHandler}});var vd=W_e();Object.defineProperty(Oe,"addHrTimes",{enumerable:!0,get:function(){return vd.addHrTimes}});Object.defineProperty(Oe,"getTimeOrigin",{enumerable:!0,get:function(){return vd.getTimeOrigin}});Object.defineProperty(Oe,"hrTime",{enumerable:!0,get:function(){return vd.hrTime}});Object.defineProperty(Oe,"hrTimeDuration",{enumerable:!0,get:function(){return vd.hrTimeDuration}});Object.defineProperty(Oe,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return vd.hrTimeToMicroseconds}});Object.defineProperty(Oe,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return vd.hrTimeToMilliseconds}});Object.defineProperty(Oe,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return vd.hrTimeToNanoseconds}});Object.defineProperty(Oe,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return vd.hrTimeToTimeStamp}});Object.defineProperty(Oe,"isTimeInput",{enumerable:!0,get:function(){return vd.isTimeInput}});Object.defineProperty(Oe,"isTimeInputHrTime",{enumerable:!0,get:function(){return vd.isTimeInputHrTime}});Object.defineProperty(Oe,"millisToHrTime",{enumerable:!0,get:function(){return vd.millisToHrTime}});Object.defineProperty(Oe,"timeInputToHrTime",{enumerable:!0,get:function(){return vd.timeInputToHrTime}});var qot=X_e();Object.defineProperty(Oe,"unrefTimer",{enumerable:!0,get:function(){return qot.unrefTimer}});var Yot=eEe();Object.defineProperty(Oe,"ExportResultCode",{enumerable:!0,get:function(){return Yot.ExportResultCode}});var Kot=V$();Object.defineProperty(Oe,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Kot.parseKeyPairsIntoRecord}});var RS=R5();Object.defineProperty(Oe,"SDK_INFO",{enumerable:!0,get:function(){return RS.SDK_INFO}});Object.defineProperty(Oe,"_globalThis",{enumerable:!0,get:function(){return RS._globalThis}});Object.defineProperty(Oe,"getStringFromEnv",{enumerable:!0,get:function(){return RS.getStringFromEnv}});Object.defineProperty(Oe,"getBooleanFromEnv",{enumerable:!0,get:function(){return RS.getBooleanFromEnv}});Object.defineProperty(Oe,"getNumberFromEnv",{enumerable:!0,get:function(){return RS.getNumberFromEnv}});Object.defineProperty(Oe,"getStringListFromEnv",{enumerable:!0,get:function(){return RS.getStringListFromEnv}});Object.defineProperty(Oe,"otperformance",{enumerable:!0,get:function(){return RS.otperformance}});var Jot=nEe();Object.defineProperty(Oe,"CompositePropagator",{enumerable:!0,get:function(){return Jot.CompositePropagator}});var LP=cEe();Object.defineProperty(Oe,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return LP.TRACE_PARENT_HEADER}});Object.defineProperty(Oe,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return LP.TRACE_STATE_HEADER}});Object.defineProperty(Oe,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return LP.W3CTraceContextPropagator}});Object.defineProperty(Oe,"parseTraceParent",{enumerable:!0,get:function(){return LP.parseTraceParent}});var QP=lEe();Object.defineProperty(Oe,"RPCType",{enumerable:!0,get:function(){return QP.RPCType}});Object.defineProperty(Oe,"deleteRPCMetadata",{enumerable:!0,get:function(){return QP.deleteRPCMetadata}});Object.defineProperty(Oe,"getRPCMetadata",{enumerable:!0,get:function(){return QP.getRPCMetadata}});Object.defineProperty(Oe,"setRPCMetadata",{enumerable:!0,get:function(){return QP.setRPCMetadata}});var L5=tB();Object.defineProperty(Oe,"isTracingSuppressed",{enumerable:!0,get:function(){return L5.isTracingSuppressed}});Object.defineProperty(Oe,"suppressTracing",{enumerable:!0,get:function(){return L5.suppressTracing}});Object.defineProperty(Oe,"unsuppressTracing",{enumerable:!0,get:function(){return L5.unsuppressTracing}});var Zot=O5();Object.defineProperty(Oe,"TraceState",{enumerable:!0,get:function(){return Zot.TraceState}});var Wot=SEe();Object.defineProperty(Oe,"merge",{enumerable:!0,get:function(){return Wot.merge}});var OEe=yEe();Object.defineProperty(Oe,"TimeoutError",{enumerable:!0,get:function(){return OEe.TimeoutError}});Object.defineProperty(Oe,"callWithTimeout",{enumerable:!0,get:function(){return OEe.callWithTimeout}});var wEe=CEe();Object.defineProperty(Oe,"isUrlIgnored",{enumerable:!0,get:function(){return wEe.isUrlIgnored}});Object.defineProperty(Oe,"urlMatches",{enumerable:!0,get:function(){return wEe.urlMatches}});var Xot=bEe();Object.defineProperty(Oe,"BindOnceFuture",{enumerable:!0,get:function(){return Xot.BindOnceFuture}});var eit=REe();Object.defineProperty(Oe,"diagLogLevelFromString",{enumerable:!0,get:function(){return eit.diagLogLevelFromString}});var tit=DEe();Oe.internal={_export:tit._export}});var MEe=F(FP=>{"use strict";A();Object.defineProperty(FP,"__esModule",{value:!0});FP.VERSION=void 0;FP.VERSION="0.214.0"});var kEe=F(aB=>{"use strict";A();Object.defineProperty(aB,"__esModule",{value:!0});aB.SeverityNumber=void 0;var nit;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(nit=aB.SeverityNumber||(aB.SeverityNumber={}))});var jP=F(HI=>{"use strict";A();Object.defineProperty(HI,"__esModule",{value:!0});HI.NOOP_LOGGER=HI.NoopLogger=void 0;var GP=class{emit(t){}};HI.NoopLogger=GP;HI.NOOP_LOGGER=new GP});var PEe=F(cA=>{"use strict";A();Object.defineProperty(cA,"__esModule",{value:!0});cA.API_BACKWARDS_COMPATIBILITY_VERSION=cA.makeGetter=cA._global=cA.GLOBAL_LOGS_API_KEY=void 0;cA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");cA._global=globalThis;function rit(e,t,n){return r=>r===e?t:n}cA.makeGetter=rit;cA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var Q5=F($I=>{"use strict";A();Object.defineProperty($I,"__esModule",{value:!0});$I.NOOP_LOGGER_PROVIDER=$I.NoopLoggerProvider=void 0;var oit=jP(),zP=class{getLogger(t,n,r){return new oit.NoopLogger}};$I.NoopLoggerProvider=zP;$I.NOOP_LOGGER_PROVIDER=new zP});var UEe=F(HP=>{"use strict";A();Object.defineProperty(HP,"__esModule",{value:!0});HP.ProxyLogger=void 0;var iit=jP(),F5=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):iit.NOOP_LOGGER}};HP.ProxyLogger=F5});var LEe=F($P=>{"use strict";A();Object.defineProperty($P,"__esModule",{value:!0});$P.ProxyLoggerProvider=void 0;var ait=Q5(),sit=UEe(),G5=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new sit.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:ait.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};$P.ProxyLoggerProvider=G5});var FEe=F(VP=>{"use strict";A();Object.defineProperty(VP,"__esModule",{value:!0});VP.LogsAPI=void 0;var Rd=PEe(),uit=Q5(),QEe=LEe(),j5=class e{constructor(){this._proxyLoggerProvider=new QEe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Rd._global[Rd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Rd._global[Rd.GLOBAL_LOGS_API_KEY]=(0,Rd.makeGetter)(Rd.API_BACKWARDS_COMPATIBILITY_VERSION,t,uit.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Rd._global[Rd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Rd._global,Rd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Rd._global[Rd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new QEe.ProxyLoggerProvider}};VP.LogsAPI=j5});var z5=F(lA=>{"use strict";A();Object.defineProperty(lA,"__esModule",{value:!0});lA.logs=lA.NoopLogger=lA.NOOP_LOGGER=lA.SeverityNumber=void 0;var cit=kEe();Object.defineProperty(lA,"SeverityNumber",{enumerable:!0,get:function(){return cit.SeverityNumber}});var GEe=jP();Object.defineProperty(lA,"NOOP_LOGGER",{enumerable:!0,get:function(){return GEe.NOOP_LOGGER}});Object.defineProperty(lA,"NoopLogger",{enumerable:!0,get:function(){return GEe.NoopLogger}});var lit=FEe();lA.logs=lit.LogsAPI.getInstance()});var jEe=F(VI=>{"use strict";A();Object.defineProperty(VI,"__esModule",{value:!0});VI.disableInstrumentations=VI.enableInstrumentations=void 0;function dit(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}VI.enableInstrumentations=dit;function pit(e){e.forEach(t=>t.disable())}VI.disableInstrumentations=pit});var $Ee=F(qP=>{"use strict";A();Object.defineProperty(qP,"__esModule",{value:!0});qP.registerInstrumentations=void 0;var zEe=(Ge(),ke(Ze)),fit=z5(),HEe=jEe();function Ait(e){let t=e.tracerProvider||zEe.trace.getTracerProvider(),n=e.meterProvider||zEe.metrics.getMeterProvider(),r=e.loggerProvider||fit.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,HEe.enableInstrumentations)(o,t,n,r),()=>{(0,HEe.disableInstrumentations)(o)}}qP.registerInstrumentations=Ait});var e0e=F(YP=>{"use strict";A();Object.defineProperty(YP,"__esModule",{value:!0});YP.satisfies=void 0;var q5=(Ge(),ke(Ze)),JEe=/^(?: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-]+)*))?$/,mit=/^(?<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-]+)*))?$/,git={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function hit(e,t,n){if(!_it(e))return q5.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Tit(e);if(!r)return!1;let o=[],i=ZEe(r,t,o,n);return i&&!n?.includePrerelease?Sit(r,o):i}YP.satisfies=hit;function _it(e){return typeof e=="string"&&JEe.test(e)}function ZEe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(H5(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=zit(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!H5(e,i,n,r))return!1;return!0}return H5(e,t,n,r)}function H5(e,t,n,r){if(t=yit(t,r),t.includes(" "))return ZEe(e,t,n,r);{let o=Cit(t);return n.push(o),Eit(e,o)}}function Eit(e,t){if(t.invalid)return!1;if(!t.version||V5(t.version))return!0;let n=qEe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=qEe(r,o)}return git[t.op]?.includes(n)}function Sit(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function yit(e,t){return e=e.trim(),e=Git(e,t),e=Fit(e),e=jit(e,t),e=e.trim(),e}function Ou(e){return!e||e.toLowerCase()==="x"||e==="*"}function Tit(e){let t=e.match(JEe);if(!t){q5.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function Cit(e){if(!e)return{};let t=e.match(mit);if(!t)return q5.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function V5(e){return e==="*"||e==="x"||e==="X"}function VEe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Iit(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function bit(e,t){if(V5(e)||V5(t))return 0;let[n,r]=Iit(VEe(e),VEe(t));return n>r?1:n<r?-1:0}function qEe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=bit(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var WEe="[a-zA-Z0-9-]",XEe="0|[1-9]\\d*",vit=`\\d*[a-zA-Z-]${WEe}*`,Rit="((?:<|>)?=?)",YEe=`(?:${XEe}|${vit})`,xit=`(?:-(${YEe}(?:\\.${YEe})*))`,KEe=`${WEe}+`,Dit=`(?:\\+(${KEe}(?:\\.${KEe})*))`,$5=`${XEe}|x|X|\\*`,sB=`[v=\\s]*(${$5})(?:\\.(${$5})(?:\\.(${$5})(?:${xit})?${Dit}?)?)?`,Bit=`^${Rit}\\s*${sB}$`,Nit=new RegExp(Bit),Oit=`^\\s*(${sB})\\s+-\\s+(${sB})\\s*$`,wit=new RegExp(Oit),Mit="(?:~>?)",kit=`^${Mit}${sB}$`,Pit=new RegExp(kit),Uit="(?:\\^)",Lit=`^${Uit}${sB}$`,Qit=new RegExp(Lit);function Fit(e){let t=Pit;return e.replace(t,(n,r,o,i,a)=>{let c;return Ou(r)?c="":Ou(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Ou(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function Git(e,t){let n=Qit,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let m;return Ou(i)?m="":Ou(a)?m=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Ou(c)?i==="0"?m=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?m=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?m=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,m})}function jit(e,t){let n=Nit;return e.replace(n,(r,o,i,a,c,d)=>{let m=Ou(i),h=m||Ou(a),S=h||Ou(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",m?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function zit(e,t){let n=wit;return e.replace(n,(r,o,i,a,c,d,m,h,S,y,I,v)=>(Ou(i)?o="":Ou(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Ou(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Ou(S)?h="":Ou(y)?h=`<${+S+1}.0.0-0`:Ou(I)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${I}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+I+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var Y5=F(Ss=>{"use strict";A();Object.defineProperty(Ss,"__esModule",{value:!0});Ss.massUnwrap=Ss.unwrap=Ss.massWrap=Ss.wrap=void 0;var wu=console.error.bind(console);function uB(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 Hit=(e,t,n)=>{if(!e||!e[t]){wu("no original function "+String(t)+" to wrap");return}if(!n){wu("no wrapper function"),wu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){wu("original object and wrapper must be functions");return}let o=n(r,t);return uB(o,"__original",r),uB(o,"__unwrap",()=>{e[t]===o&&uB(e,t,r)}),uB(o,"__wrapped",!0),uB(e,t,o),o};Ss.wrap=Hit;var $it=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{wu("must provide one or more modules to patch"),wu(new Error().stack);return}if(!(t&&Array.isArray(t))){wu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ss.wrap)(r,o,n)})})};Ss.massWrap=$it;var Vit=(e,t)=>{if(!e||!e[t]){wu("no function to unwrap."),wu(new Error().stack);return}let n=e[t];if(!n.__unwrap)wu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ss.unwrap=Vit;var qit=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{wu("must provide one or more modules to patch"),wu(new Error().stack);return}if(!(t&&Array.isArray(t))){wu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ss.unwrap)(n,r)})})};Ss.massUnwrap=qit;function cB(e){e&&e.logger&&(typeof e.logger!="function"?wu("new logger isn't a function, not replacing"):wu=e.logger)}Ss.default=cB;cB.wrap=Ss.wrap;cB.massWrap=Ss.massWrap;cB.unwrap=Ss.unwrap;cB.massUnwrap=Ss.massUnwrap});var t0e=F(JP=>{"use strict";A();Object.defineProperty(JP,"__esModule",{value:!0});JP.InstrumentationAbstract=void 0;var K5=(Ge(),ke(Ze)),Yit=z5(),KP=Y5(),J5=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=K5.diag.createComponentLogger({namespace:t}),this._tracer=K5.trace.getTracer(t,n),this._meter=K5.metrics.getMeter(t,n),this._logger=Yit.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=KP.wrap;_unwrap=KP.unwrap;_massWrap=KP.massWrap;_massUnwrap=KP.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};JP.InstrumentationAbstract=J5});var r0e=F((tqt,n0e)=>{A();var qI=1e3,YI=qI*60,KI=YI*60,xS=KI*24,Kit=xS*7,Jit=xS*365.25;n0e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Zit(e);if(n==="number"&&isFinite(e))return t.long?Xit(e):Wit(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Zit(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]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Jit;case"weeks":case"week":case"w":return n*Kit;case"days":case"day":case"d":return n*xS;case"hours":case"hour":case"hrs":case"hr":case"h":return n*KI;case"minutes":case"minute":case"mins":case"min":case"m":return n*YI;case"seconds":case"second":case"secs":case"sec":case"s":return n*qI;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Wit(e){var t=Math.abs(e);return t>=xS?Math.round(e/xS)+"d":t>=KI?Math.round(e/KI)+"h":t>=YI?Math.round(e/YI)+"m":t>=qI?Math.round(e/qI)+"s":e+"ms"}function Xit(e){var t=Math.abs(e);return t>=xS?ZP(e,t,xS,"day"):t>=KI?ZP(e,t,KI,"hour"):t>=YI?ZP(e,t,YI,"minute"):t>=qI?ZP(e,t,qI,"second"):e+" ms"}function ZP(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var Z5=F((rqt,o0e)=>{A();function eat(e){n.debug=n,n.default=n,n.coerce=d,n.disable=a,n.enable=o,n.enabled=c,n.humanize=r0e(),n.destroy=m,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let S=0;for(let y=0;y<h.length;y++)S=(S<<5)-S+h.charCodeAt(y),S|=0;return n.colors[Math.abs(S)%n.colors.length]}n.selectColor=t;function n(h){let S,y=null,I,v;function x(...N){if(!x.enabled)return;let M=x,Q=Number(new Date),j=Q-(S||Q);M.diff=j,M.prev=S,M.curr=Q,S=Q,N[0]=n.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let G=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(oe,ge)=>{if(oe==="%%")return"%";G++;let ye=n.formatters[ge];if(typeof ye=="function"){let be=N[G];oe=ye.call(M,be),N.splice(G,1),G--}return oe}),n.formatArgs.call(M,N),(M.log||n.log).apply(M,N)}return x.namespace=h,x.useColors=n.useColors(),x.color=n.selectColor(h),x.extend=r,x.destroy=n.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(I!==n.namespaces&&(I=n.namespaces,v=n.enabled(h)),v),set:N=>{y=N}}),typeof n.init=="function"&&n.init(x),x}function r(h,S){let y=n(this.namespace+(typeof S>"u"?":":S)+h);return y.log=this.log,y}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let S=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of S)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}function i(h,S){let y=0,I=0,v=-1,x=0;for(;y<h.length;)if(I<S.length&&(S[I]===h[y]||S[I]==="*"))S[I]==="*"?(v=I,x=y,I++):(y++,I++);else if(v!==-1)I=v+1,x++,y=x;else return!1;for(;I<S.length&&S[I]==="*";)I++;return I===S.length}function a(){let h=[...n.names,...n.skips.map(S=>"-"+S)].join(",");return n.enable(""),h}function c(h){for(let S of n.skips)if(i(h,S))return!1;for(let S of n.names)if(i(h,S))return!0;return!1}function d(h){return h instanceof Error?h.stack||h.message:h}function m(){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}o0e.exports=eat});var i0e=F((vc,WP)=>{A();vc.formatArgs=nat;vc.save=rat;vc.load=oat;vc.useColors=tat;vc.storage=iat();vc.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();vc.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function tat(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function nat(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+WP.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),e.splice(r,0,t)}vc.log=console.debug||console.log||(()=>{});function rat(e){try{e?vc.storage.setItem("debug",e):vc.storage.removeItem("debug")}catch{}}function oat(){let e;try{e=vc.storage.getItem("debug")||vc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function iat(){try{return localStorage}catch{}}WP.exports=Z5()(vc);var{formatters:aat}=WP.exports;aat.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var s0e=F((aqt,a0e)=>{"use strict";A();a0e.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r<o)}});var l0e=F((uqt,c0e)=>{"use strict";A();var sat=Fe("os"),u0e=Fe("tty"),xd=s0e(),{env:Ha}=process,Xh;xd("no-color")||xd("no-colors")||xd("color=false")||xd("color=never")?Xh=0:(xd("color")||xd("colors")||xd("color=true")||xd("color=always"))&&(Xh=1);"FORCE_COLOR"in Ha&&(Ha.FORCE_COLOR==="true"?Xh=1:Ha.FORCE_COLOR==="false"?Xh=0:Xh=Ha.FORCE_COLOR.length===0?1:Math.min(parseInt(Ha.FORCE_COLOR,10),3));function W5(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function X5(e,t){if(Xh===0)return 0;if(xd("color=16m")||xd("color=full")||xd("color=truecolor"))return 3;if(xd("color=256"))return 2;if(e&&!t&&Xh===void 0)return 0;let n=Xh||0;if(Ha.TERM==="dumb")return n;if(process.platform==="win32"){let r=sat.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ha)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Ha)||Ha.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Ha)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ha.TEAMCITY_VERSION)?1:0;if(Ha.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ha){let r=parseInt((Ha.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ha.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ha.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ha.TERM)||"COLORTERM"in Ha?1:n}function uat(e){let t=X5(e,e&&e.isTTY);return W5(t)}c0e.exports={supportsColor:uat,stdout:W5(X5(!0,u0e.isatty(1))),stderr:W5(X5(!0,u0e.isatty(2)))}});var p0e=F(($a,eU)=>{A();var cat=Fe("tty"),XP=Fe("util");$a.init=gat;$a.log=fat;$a.formatArgs=dat;$a.save=Aat;$a.load=mat;$a.useColors=lat;$a.destroy=XP.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");$a.colors=[6,2,3,4,5,1];try{let e=l0e();e&&(e.stderr||e).level>=2&&($a.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{}$a.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),r=process.env[t];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),e[n]=r,e},{});function lat(){return"colors"in $a.inspectOpts?!!$a.inspectOpts.colors:cat.isatty(process.stderr.fd)}function dat(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
|
|
4
4
|
`).join(`
|
|
5
5
|
`+i),e.push(o+"m+"+eU.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=pat()+t+" "+e[0]}function pat(){return $a.inspectOpts.hideDate?"":new Date().toISOString()+" "}function fat(...e){return process.stderr.write(XP.formatWithOptions($a.inspectOpts,...e)+`
|
|
6
6
|
`)}function Aat(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function mat(){return process.env.DEBUG}function gat(e){e.inspectOpts={};let t=Object.keys($a.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=$a.inspectOpts[t[n]]}eU.exports=Z5()($a);var{formatters:d0e}=eU.exports;d0e.o=function(e){return this.inspectOpts.colors=this.useColors,XP.inspect(e,this.inspectOpts).split(`
|
|
@@ -35,7 +35,7 @@ Url: ${dL(e)}`),!0}return!1}function Oct(e,t){return t?.length?aL(e).some(n=>c_(
|
|
|
35
35
|
`);for(let o of r){if(!o)continue;let i=o.indexOf(":");if(i===-1)continue;let a=o.substring(0,i).toLowerCase(),c=o.substring(i+1).trim(),d=n.get(a);d&&Array.isArray(d)?d.push(c):d?n.set(a,[d,c]):n.set(a,c)}}return n}onRequestCreated({request:t}){let n=this.getConfig(),r=n.enabled!==!1;if((0,bN.safeExecuteInTheMiddle)(()=>!r||t.method==="CONNECT"||n.ignoreRequestHook?.(t),oe=>oe&&this._diag.error("caught ignoreRequestHook error: ",oe),!0))return;let i=(0,e4.hrTime)(),a;try{a=new Pgt.URL(t.path,t.origin)}catch(oe){this._diag.warn("could not determine url.full:",oe);return}let c=a.protocol.replace(":",""),d=this.getRequestMethod(t.method),m={[Yi.ATTR_HTTP_REQUEST_METHOD]:d,[Yi.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:t.method,[Yi.ATTR_URL_FULL]:a.toString(),[Yi.ATTR_URL_PATH]:a.pathname,[Yi.ATTR_URL_QUERY]:a.search,[Yi.ATTR_URL_SCHEME]:c},h={https:"443",http:"80"},S=a.hostname,y=a.port||h[c];m[Yi.ATTR_SERVER_ADDRESS]=S,y&&!isNaN(Number(y))&&(m[Yi.ATTR_SERVER_PORT]=Number(y));let v=this.parseRequestHeaders(t).get("user-agent");if(v){let oe=Array.isArray(v)?v[v.length-1]:v;m[Yi.ATTR_USER_AGENT_ORIGINAL]=oe}let x=(0,bN.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(t),oe=>oe&&this._diag.error("caught startSpanHook error: ",oe),!0);x&&Object.entries(x).forEach(([oe,ge])=>{m[oe]=ge});let N=wl.context.active(),M=wl.trace.getSpan(N),Q;n.requireParentforSpans&&(!M||!wl.trace.isSpanContextValid(M.spanContext()))?Q=wl.trace.wrapSpanContext(wl.INVALID_SPAN_CONTEXT):Q=this.tracer.startSpan(d==="_OTHER"?"HTTP":d,{kind:wl.SpanKind.CLIENT,attributes:m},N),(0,bN.safeExecuteInTheMiddle)(()=>n.requestHook?.(Q,t),oe=>oe&&this._diag.error("caught requestHook error: ",oe),!0);let j=wl.trace.setSpan(wl.context.active(),Q),G={};wl.propagation.inject(j,G);let q=Object.entries(G);for(let oe=0;oe<q.length;oe++){let[ge,ye]=q[oe];typeof t.addHeader=="function"?t.addHeader(ge,ye):typeof t.headers=="string"?t.headers+=`${ge}: ${ye}\r
|
|
36
36
|
`:Array.isArray(t.headers)&&t.headers.push(ge,ye)}this._recordFromReq.set(t,{span:Q,attributes:m,startTime:i})}onRequestHeaders({request:t,socket:n}){let r=this._recordFromReq.get(t);if(!r)return;let o=this.getConfig(),{span:i}=r,{remoteAddress:a,remotePort:c}=n,d={[Yi.ATTR_NETWORK_PEER_ADDRESS]:a,[Yi.ATTR_NETWORK_PEER_PORT]:c};if(o.headersToSpanAttributes?.requestHeaders){let m=new Set(o.headersToSpanAttributes.requestHeaders.map(S=>S.toLowerCase())),h=this.parseRequestHeaders(t);for(let[S,y]of h.entries())if(m.has(S)){let I=Array.isArray(y)?y:[y];d[`http.request.header.${S}`]=I}}i.setAttributes(d)}onResponseHeaders({request:t,response:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i}=r,a={[Yi.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},c=this.getConfig();if((0,bN.safeExecuteInTheMiddle)(()=>c.responseHook?.(o,{request:t,response:n}),d=>d&&this._diag.error("caught responseHook error: ",d),!0),c.headersToSpanAttributes?.responseHeaders){let d=new Set;c.headersToSpanAttributes?.responseHeaders.forEach(m=>d.add(m.toLowerCase()));for(let m=0;m<n.headers.length;m=m+2){let h=n.headers[m].toString().toLowerCase(),S=n.headers[m+1];if(d.has(h)){let y=`http.response.header.${h}`;Object.hasOwn(a,y)?a[y].push(S.toString()):a[y]=[S.toString()]}}}o.setAttributes(a),o.setStatus({code:n.statusCode>=400?wl.SpanStatusCode.ERROR:wl.SpanStatusCode.UNSET}),r.attributes=Object.assign(i,a)}onDone({request:t}){let n=this._recordFromReq.get(t);if(!n)return;let{span:r,attributes:o,startTime:i}=n;r.end(),this._recordFromReq.delete(t),this.recordRequestDuration(o,i)}onError({request:t,error:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i,startTime:a}=r;o.recordException(n),o.setStatus({code:wl.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(t),i[Yi.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(i,a)}recordRequestDuration(t,n){let r={};[Yi.ATTR_HTTP_RESPONSE_STATUS_CODE,Yi.ATTR_HTTP_REQUEST_METHOD,Yi.ATTR_SERVER_ADDRESS,Yi.ATTR_SERVER_PORT,Yi.ATTR_URL_SCHEME,Yi.ATTR_ERROR_TYPE].forEach(a=>{a in t&&(r[a]=t[a])});let i=(0,e4.hrTimeToMilliseconds)((0,e4.hrTimeDuration)(n,(0,e4.hrTime)()))/1e3;this._httpClientDurationHistogram.record(i,r)}getRequestMethod(t){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0};return t.toUpperCase()in n?t.toUpperCase():"_OTHER"}};t4.UndiciInstrumentation=wY});var Axe=F(n4=>{"use strict";A();Object.defineProperty(n4,"__esModule",{value:!0});n4.UndiciInstrumentation=void 0;var Ugt=fxe();Object.defineProperty(n4,"UndiciInstrumentation",{enumerable:!0,get:function(){return Ugt.UndiciInstrumentation}})});function mxe(e,t="/"){let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}function Ggt(e,t={}){return typeof e.spans=="boolean"?e.spans:!t.skipOpenTelemetrySetup&&Ri(t)}function jgt(e={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=mxe(n.origin,n.path),o=e.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=mxe(n.origin,n.path);if(r.startsWith("data:")){let o=Rb(r);return{[Mt]:"auto.http.otel.node_fetch","http.url":o,[A_]:o,[Od]:`${n.method||"GET"} ${o}`}}return{[Mt]:"auto.http.otel.node_fetch"}},requestHook:e.requestHook,responseHook:e.responseHook,headersToSpanAttributes:e.headersToSpanAttributes}}var gxe,hxe,Lgt,Qgt,Fgt,_xe,Exe=O(()=>{A();gxe=ie(Axe(),1);dt();fr();hxe="NodeFetch",Lgt=at(hxe,gxe.UndiciInstrumentation,e=>jgt(e)),Qgt=at(`${hxe}.sentry`,ZS,e=>e),Fgt=(e={})=>({name:"NodeFetch",setupOnce(){Ggt(e,gt()?.getOptions())&&Lgt(e),Qgt(e)}}),_xe=Fgt});var r4=F(vN=>{"use strict";A();Object.defineProperty(vN,"__esModule",{value:!0});vN.ExpressLayerType=void 0;var zgt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(zgt=vN.ExpressLayerType||(vN.ExpressLayerType={}))});var o4=F(RN=>{"use strict";A();Object.defineProperty(RN,"__esModule",{value:!0});RN.AttributeNames=void 0;var Hgt;(function(e){e.EXPRESS_TYPE="express.type",e.EXPRESS_NAME="express.name"})(Hgt=RN.AttributeNames||(RN.AttributeNames={}))});var MY=F(ov=>{"use strict";A();Object.defineProperty(ov,"__esModule",{value:!0});ov._LAYERS_STORE_PROPERTY=ov.kLayerPatched=void 0;ov.kLayerPatched=Symbol("express-layer-patched");ov._LAYERS_STORE_PROPERTY="__ot_middlewares"});var Txe=F(Ki=>{"use strict";A();Object.defineProperty(Ki,"__esModule",{value:!0});Ki.getActualMatchedRoute=Ki.getConstructedRoute=Ki.getLayerPath=Ki.asErrorAndMessage=Ki.isLayerIgnored=Ki.getLayerMetadata=Ki.getRouterPath=Ki.storeLayerPath=void 0;var kY=r4(),iv=o4(),ry=MY(),$gt=(e,t)=>(Array.isArray(e[ry._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,ry._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t===void 0?{isLayerPathStored:!1}:(e[ry._LAYERS_STORE_PROPERTY].push(t),{isLayerPathStored:!0}));Ki.storeLayerPath=$gt;var Vgt=(e,t)=>{let n=t.handle?.stack?.[0];return n?.route?.path?`${e}${n.route.path}`:n?.handle?.stack?(0,Ki.getRouterPath)(e,n):e};Ki.getRouterPath=Vgt;var qgt=(e,t,n)=>{if(t.name==="router"){let r=(0,Ki.getRouterPath)("",t),o=r||n||e||"/";return{attributes:{[iv.AttributeNames.EXPRESS_NAME]:o,[iv.AttributeNames.EXPRESS_TYPE]:kY.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return t.name==="bound dispatch"||t.name==="handle"?{attributes:{[iv.AttributeNames.EXPRESS_NAME]:(e||n)??"request handler",[iv.AttributeNames.EXPRESS_TYPE]:kY.ExpressLayerType.REQUEST_HANDLER},name:`request handler${t.path?` - ${e||n}`:""}`}:{attributes:{[iv.AttributeNames.EXPRESS_NAME]:t.name,[iv.AttributeNames.EXPRESS_TYPE]:kY.ExpressLayerType.MIDDLEWARE},name:`middleware - ${t.name}`}};Ki.getLayerMetadata=qgt;var Ygt=(e,t)=>{if(typeof t=="string")return t===e;if(t instanceof RegExp)return t.test(e);if(typeof t=="function")return t(e);throw new TypeError("Pattern is in unsupported datatype")},Kgt=(e,t,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(t))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let r of n.ignoreLayers)if(Ygt(e,r))return!0}catch{}return!1};Ki.isLayerIgnored=Kgt;var Jgt=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];Ki.asErrorAndMessage=Jgt;var Zgt=e=>{let t=e[0];return Array.isArray(t)?t.map(n=>Sxe(n)||"").join(","):Sxe(t)};Ki.getLayerPath=Zgt;var Sxe=e=>{if(typeof e=="string")return e;if(e instanceof RegExp||typeof e=="number")return e.toString()};function yxe(e){let n=(Array.isArray(e[ry._LAYERS_STORE_PROPERTY])?e[ry._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}Ki.getConstructedRoute=yxe;function Wgt(e){let t=Array.isArray(e[ry._LAYERS_STORE_PROPERTY])?e[ry._LAYERS_STORE_PROPERTY]:[];if(t.length===0)return;if(t.every(i=>i==="/"))return e.originalUrl==="/"?"/":void 0;let n=yxe(e);if(n==="*"||n.includes("/")&&(n.includes(",")||n.includes("\\")||n.includes("*")||n.includes("[")))return n;let r=n.startsWith("/")?n:`/${n}`;return r.length>0&&(e.originalUrl===r||e.originalUrl.startsWith(r)||Xgt(r))?r:void 0}Ki.getActualMatchedRoute=Wgt;function Xgt(e){return e.includes(":")||e.includes("*")}});var Cxe=F(av=>{"use strict";A();Object.defineProperty(av,"__esModule",{value:!0});av.PACKAGE_NAME=av.PACKAGE_VERSION=void 0;av.PACKAGE_VERSION="0.62.0";av.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var xxe=F(a4=>{"use strict";A();Object.defineProperty(a4,"__esModule",{value:!0});a4.ExpressInstrumentation=void 0;var Ixe=Tr(),wc=(Ge(),ke(Ze)),bxe=r4(),vxe=o4(),BA=Txe(),Rxe=Cxe(),sv=tn(),eht=(Kn(),ke(Ur)),i4=MY(),PY=class extends sv.InstrumentationBase{constructor(t={}){super(Rxe.PACKAGE_NAME,Rxe.PACKAGE_VERSION,t)}init(){return[new sv.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],t=>{let n=typeof t?.Router?.prototype?.route=="function",r=n?t.Router.prototype:t.Router;return(0,sv.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,sv.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,sv.isWrapped)(t.application.use)&&this._unwrap(t.application,"use"),this._wrap(t.application,"use",this._getAppUsePatch(n)),t},t=>{if(t===void 0)return;let r=typeof t?.Router?.prototype?.route=="function"?t.Router.prototype:t.Router;this._unwrap(r,"route"),this._unwrap(r,"use"),this._unwrap(t.application,"use")})]}_getRoutePatch(){let t=this;return function(n){return function(...o){let i=n.apply(this,o),a=this.stack[this.stack.length-1];return t._applyPatch(a,(0,BA.getLayerPath)(o)),i}}}_getRouterUsePatch(){let t=this;return function(n){return function(...o){let i=n.apply(this,o),a=this.stack[this.stack.length-1];return t._applyPatch(a,(0,BA.getLayerPath)(o)),i}}}_getAppUsePatch(t){let n=this;return function(r){return function(...i){let a=t?this.router:this._router,c=r.apply(this,i);if(a){let d=a.stack[a.stack.length-1];n._applyPatch(d,(0,BA.getLayerPath)(i))}return c}}}_applyPatch(t,n){let r=this;t[i4.kLayerPatched]!==!0&&(t[i4.kLayerPatched]=!0,this._wrap(t,"handle",o=>{if(o.length===4)return o;let i=function(a,c){let{isLayerPathStored:d}=(0,BA.storeLayerPath)(a,n),m=(0,BA.getConstructedRoute)(a),h=(0,BA.getActualMatchedRoute)(a),S={[eht.ATTR_HTTP_ROUTE]:h},y=(0,BA.getLayerMetadata)(m,t,n),I=y.attributes[vxe.AttributeNames.EXPRESS_TYPE],v=(0,Ixe.getRPCMetadata)(wc.context.active());if(v?.type===Ixe.RPCType.HTTP&&(v.route=h),(0,BA.isLayerIgnored)(y.name,I,r.getConfig()))return I===bxe.ExpressLayerType.MIDDLEWARE&&a[i4._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(wc.trace.getSpan(wc.context.active())===void 0)return o.apply(this,arguments);let x=r._getSpanName({request:a,layerType:I,route:m},y.name),N=r.tracer.startSpan(x,{attributes:Object.assign(S,y.attributes)}),M=wc.context.active(),Q=wc.trace.setSpan(M,N),{requestHook:j}=r.getConfig();j&&(0,sv.safeExecuteInTheMiddle)(()=>j(N,{request:a,layerType:I,route:m}),ye=>{ye&&wc.diag.error("express instrumentation: request hook failed",ye)},!0);let G=!1;y.attributes[vxe.AttributeNames.EXPRESS_TYPE]===bxe.ExpressLayerType.ROUTER&&(N.end(),G=!0,Q=M);let q=()=>{G===!1&&(G=!0,N.end())},oe=Array.from(arguments),ge=oe.findIndex(ye=>typeof ye=="function");ge>=0&&(arguments[ge]=function(){let ye=arguments[0],be=![void 0,null,"route","router"].includes(ye);if(!G&&be){let[dn,xe]=(0,BA.asErrorAndMessage)(ye);N.recordException(dn),N.setStatus({code:wc.SpanStatusCode.ERROR,message:xe})}G===!1&&(G=!0,a.res?.removeListener("finish",q),N.end()),!(a.route&&be)&&d&&a[i4._LAYERS_STORE_PROPERTY].pop();let We=oe[ge],wt=wc.context.active(),tt=wc.trace.getSpan(M),$t=tt?wc.trace.setSpan(wt,tt):wt;return wc.context.bind($t,We).apply(this,arguments)});try{return wc.context.bind(Q,o).apply(this,arguments)}catch(ye){let[be,We]=(0,BA.asErrorAndMessage)(ye);throw N.recordException(be),N.setStatus({code:wc.SpanStatusCode.ERROR,message:We}),ye}finally{G||c.once("finish",q)}};for(let a in o)Object.defineProperty(i,a,{get(){return o[a]},set(c){o[a]=c}});return i}))}_getSpanName(t,n){let{spanNameHook:r}=this.getConfig();if(!(r instanceof Function))return n;try{return r(t,n)??n}catch(o){return wc.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};a4.ExpressInstrumentation=PY});var Dxe=F(P_=>{"use strict";A();Object.defineProperty(P_,"__esModule",{value:!0});P_.AttributeNames=P_.ExpressLayerType=P_.ExpressInstrumentation=void 0;var tht=xxe();Object.defineProperty(P_,"ExpressInstrumentation",{enumerable:!0,get:function(){return tht.ExpressInstrumentation}});var nht=r4();Object.defineProperty(P_,"ExpressLayerType",{enumerable:!0,get:function(){return nht.ExpressLayerType}});var rht=o4();Object.defineProperty(P_,"AttributeNames",{enumerable:!0,get:function(){return rht.AttributeNames}})});var Sa,oy=O(()=>{A();Sa=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__});function oht(e){Lr(e,"auto.http.otel.express");let t=Nt(e).data,n=t["express.type"];n&&e.setAttribute(Zt,`${n}.express`);let r=t["express.name"];typeof r=="string"&&e.updateName(r)}function iht(e,t){if(In()===Nd())return Sa&&J.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),t;if(e.layerType==="request_handler"){let n=e.request,r=n.method?n.method.toUpperCase():"GET";In().setTransactionName(`${r} ${e.route}`)}return t}var Bxe,Nxe,Oxe,aht,wxe,Mxe=O(()=>{A();Bxe=ie(Dxe(),1);dt();fr();oy();Nxe="Express";Oxe=at(Nxe,()=>new Bxe.ExpressInstrumentation({requestHook:e=>oht(e),spanNameHook:(e,t)=>iht(e,t)})),aht=()=>({name:Nxe,setupOnce(){Oxe()}}),wxe=aht});var kxe=F(xN=>{"use strict";A();Object.defineProperty(xN,"__esModule",{value:!0});xN.SeverityNumber=void 0;var sht;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(sht=xN.SeverityNumber||(xN.SeverityNumber={}))});var c4=F(uv=>{"use strict";A();Object.defineProperty(uv,"__esModule",{value:!0});uv.NOOP_LOGGER=uv.NoopLogger=void 0;var u4=class{emit(t){}};uv.NoopLogger=u4;uv.NOOP_LOGGER=new u4});var Pxe=F(NA=>{"use strict";A();Object.defineProperty(NA,"__esModule",{value:!0});NA.API_BACKWARDS_COMPATIBILITY_VERSION=NA.makeGetter=NA._global=NA.GLOBAL_LOGS_API_KEY=void 0;NA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");NA._global=globalThis;function uht(e,t,n){return r=>r===e?t:n}NA.makeGetter=uht;NA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var UY=F(cv=>{"use strict";A();Object.defineProperty(cv,"__esModule",{value:!0});cv.NOOP_LOGGER_PROVIDER=cv.NoopLoggerProvider=void 0;var cht=c4(),l4=class{getLogger(t,n,r){return new cht.NoopLogger}};cv.NoopLoggerProvider=l4;cv.NOOP_LOGGER_PROVIDER=new l4});var Uxe=F(d4=>{"use strict";A();Object.defineProperty(d4,"__esModule",{value:!0});d4.ProxyLogger=void 0;var lht=c4(),LY=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):lht.NOOP_LOGGER}};d4.ProxyLogger=LY});var Lxe=F(p4=>{"use strict";A();Object.defineProperty(p4,"__esModule",{value:!0});p4.ProxyLoggerProvider=void 0;var dht=UY(),pht=Uxe(),QY=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new pht.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:dht.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};p4.ProxyLoggerProvider=QY});var Fxe=F(f4=>{"use strict";A();Object.defineProperty(f4,"__esModule",{value:!0});f4.LogsAPI=void 0;var Ld=Pxe(),fht=UY(),Qxe=Lxe(),FY=class e{constructor(){this._proxyLoggerProvider=new Qxe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Ld._global[Ld.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Ld._global[Ld.GLOBAL_LOGS_API_KEY]=(0,Ld.makeGetter)(Ld.API_BACKWARDS_COMPATIBILITY_VERSION,t,fht.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Ld._global[Ld.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Ld._global,Ld.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Ld._global[Ld.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Qxe.ProxyLoggerProvider}};f4.LogsAPI=FY});var GY=F(OA=>{"use strict";A();Object.defineProperty(OA,"__esModule",{value:!0});OA.logs=OA.NoopLogger=OA.NOOP_LOGGER=OA.SeverityNumber=void 0;var Aht=kxe();Object.defineProperty(OA,"SeverityNumber",{enumerable:!0,get:function(){return Aht.SeverityNumber}});var Gxe=c4();Object.defineProperty(OA,"NOOP_LOGGER",{enumerable:!0,get:function(){return Gxe.NOOP_LOGGER}});Object.defineProperty(OA,"NoopLogger",{enumerable:!0,get:function(){return Gxe.NoopLogger}});var mht=Fxe();OA.logs=mht.LogsAPI.getInstance()});var jxe=F(lv=>{"use strict";A();Object.defineProperty(lv,"__esModule",{value:!0});lv.disableInstrumentations=lv.enableInstrumentations=void 0;function ght(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}lv.enableInstrumentations=ght;function hht(e){e.forEach(t=>t.disable())}lv.disableInstrumentations=hht});var $xe=F(A4=>{"use strict";A();Object.defineProperty(A4,"__esModule",{value:!0});A4.registerInstrumentations=void 0;var zxe=(Ge(),ke(Ze)),_ht=GY(),Hxe=jxe();function Eht(e){let t=e.tracerProvider||zxe.trace.getTracerProvider(),n=e.meterProvider||zxe.metrics.getMeterProvider(),r=e.loggerProvider||_ht.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Hxe.enableInstrumentations)(o,t,n,r),()=>{(0,Hxe.disableInstrumentations)(o)}}A4.registerInstrumentations=Eht});var eDe=F(m4=>{"use strict";A();Object.defineProperty(m4,"__esModule",{value:!0});m4.satisfies=void 0;var $Y=(Ge(),ke(Ze)),Jxe=/^(?: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-]+)*))?$/,Sht=/^(?<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-]+)*))?$/,yht={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Tht(e,t,n){if(!Cht(e))return $Y.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Rht(e);if(!r)return!1;let o=[],i=Zxe(r,t,o,n);return i&&!n?.includePrerelease?bht(r,o):i}m4.satisfies=Tht;function Cht(e){return typeof e=="string"&&Jxe.test(e)}function Zxe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(jY(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=Yht(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!jY(e,i,n,r))return!1;return!0}return jY(e,t,n,r)}function jY(e,t,n,r){if(t=vht(t,r),t.includes(" "))return Zxe(e,t,n,r);{let o=xht(t);return n.push(o),Iht(e,o)}}function Iht(e,t){if(t.invalid)return!1;if(!t.version||HY(t.version))return!0;let n=qxe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=qxe(r,o)}return yht[t.op]?.includes(n)}function bht(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function vht(e,t){return e=e.trim(),e=Vht(e,t),e=$ht(e),e=qht(e,t),e=e.trim(),e}function Fu(e){return!e||e.toLowerCase()==="x"||e==="*"}function Rht(e){let t=e.match(Jxe);if(!t){$Y.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function xht(e){if(!e)return{};let t=e.match(Sht);if(!t)return $Y.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function HY(e){return e==="*"||e==="x"||e==="X"}function Vxe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Dht(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function Bht(e,t){if(HY(e)||HY(t))return 0;let[n,r]=Dht(Vxe(e),Vxe(t));return n>r?1:n<r?-1:0}function qxe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=Bht(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var Wxe="[a-zA-Z0-9-]",Xxe="0|[1-9]\\d*",Nht=`\\d*[a-zA-Z-]${Wxe}*`,Oht="((?:<|>)?=?)",Yxe=`(?:${Xxe}|${Nht})`,wht=`(?:-(${Yxe}(?:\\.${Yxe})*))`,Kxe=`${Wxe}+`,Mht=`(?:\\+(${Kxe}(?:\\.${Kxe})*))`,zY=`${Xxe}|x|X|\\*`,DN=`[v=\\s]*(${zY})(?:\\.(${zY})(?:\\.(${zY})(?:${wht})?${Mht}?)?)?`,kht=`^${Oht}\\s*${DN}$`,Pht=new RegExp(kht),Uht=`^\\s*(${DN})\\s+-\\s+(${DN})\\s*$`,Lht=new RegExp(Uht),Qht="(?:~>?)",Fht=`^${Qht}${DN}$`,Ght=new RegExp(Fht),jht="(?:\\^)",zht=`^${jht}${DN}$`,Hht=new RegExp(zht);function $ht(e){let t=Ght;return e.replace(t,(n,r,o,i,a)=>{let c;return Fu(r)?c="":Fu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Fu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function Vht(e,t){let n=Hht,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let m;return Fu(i)?m="":Fu(a)?m=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Fu(c)?i==="0"?m=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?m=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?m=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,m})}function qht(e,t){let n=Pht;return e.replace(n,(r,o,i,a,c,d)=>{let m=Fu(i),h=m||Fu(a),S=h||Fu(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",m?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function Yht(e,t){let n=Lht;return e.replace(n,(r,o,i,a,c,d,m,h,S,y,I,v)=>(Fu(i)?o="":Fu(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Fu(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Fu(S)?h="":Fu(y)?h=`<${+S+1}.0.0-0`:Fu(I)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${I}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+I+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var VY=F(xs=>{"use strict";A();Object.defineProperty(xs,"__esModule",{value:!0});xs.massUnwrap=xs.unwrap=xs.massWrap=xs.wrap=void 0;var Gu=console.error.bind(console);function BN(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 Kht=(e,t,n)=>{if(!e||!e[t]){Gu("no original function "+String(t)+" to wrap");return}if(!n){Gu("no wrapper function"),Gu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){Gu("original object and wrapper must be functions");return}let o=n(r,t);return BN(o,"__original",r),BN(o,"__unwrap",()=>{e[t]===o&&BN(e,t,r)}),BN(o,"__wrapped",!0),BN(e,t,o),o};xs.wrap=Kht;var Jht=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Gu("must provide one or more modules to patch"),Gu(new Error().stack);return}if(!(t&&Array.isArray(t))){Gu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,xs.wrap)(r,o,n)})})};xs.massWrap=Jht;var Zht=(e,t)=>{if(!e||!e[t]){Gu("no function to unwrap."),Gu(new Error().stack);return}let n=e[t];if(!n.__unwrap)Gu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};xs.unwrap=Zht;var Wht=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Gu("must provide one or more modules to patch"),Gu(new Error().stack);return}if(!(t&&Array.isArray(t))){Gu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,xs.unwrap)(n,r)})})};xs.massUnwrap=Wht;function NN(e){e&&e.logger&&(typeof e.logger!="function"?Gu("new logger isn't a function, not replacing"):Gu=e.logger)}xs.default=NN;NN.wrap=xs.wrap;NN.massWrap=xs.massWrap;NN.unwrap=xs.unwrap;NN.massUnwrap=xs.massUnwrap});var tDe=F(h4=>{"use strict";A();Object.defineProperty(h4,"__esModule",{value:!0});h4.InstrumentationAbstract=void 0;var qY=(Ge(),ke(Ze)),Xht=GY(),g4=VY(),YY=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=qY.diag.createComponentLogger({namespace:t}),this._tracer=qY.trace.getTracer(t,n),this._meter=qY.metrics.getMeter(t,n),this._logger=Xht.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=g4.wrap;_unwrap=g4.unwrap;_massWrap=g4.massWrap;_massUnwrap=g4.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};h4.InstrumentationAbstract=YY});var nDe=F(U_=>{"use strict";A();Object.defineProperty(U_,"__esModule",{value:!0});U_.ModuleNameTrie=U_.ModuleNameSeparator=void 0;U_.ModuleNameSeparator="/";var _4=class{hooks=[];children=new Map},KY=class{_trie=new _4;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(U_.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new _4,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],a=!0;for(let c of t.split(U_.ModuleNameSeparator)){let d=o.children.get(c);if(!d){a=!1;break}r||i.push(...d.hooks),o=d}return r&&a&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,d)=>c.insertedId-d.insertedId),i.map(({hook:c})=>c))}};U_.ModuleNameTrie=KY});var oDe=F(E4=>{"use strict";A();Object.defineProperty(E4,"__esModule",{value:!0});E4.RequireInTheMiddleSingleton=void 0;var e_t=DS(),rDe=Fe("path"),JY=nDe(),t_t=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),ZY=class e{_moduleNameTrie=new JY.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new e_t.Hook(null,{internals:!0},(t,n,r)=>{let o=n_t(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:a}of i)t=a(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return t_t?new e:this._instance=this._instance??new e}};E4.RequireInTheMiddleSingleton=ZY;function n_t(e){return rDe.sep!==JY.ModuleNameSeparator?e.split(rDe.sep).join(JY.ModuleNameSeparator):e}});var cDe=F(ON=>{A();var iDe=[],WY=new WeakMap,aDe=new WeakMap,sDe=new Map,uDe=[],r_t={set(e,t,n){let r=WY.get(e),o=r&&r[t];return typeof o=="function"?o(n):!0},get(e,t){if(t===Symbol.toStringTag)return"Module";let n=aDe.get(e)[t];if(typeof n=="function")return n()},defineProperty(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=WY.get(e),o=r&&r[t];return typeof o=="function"?o(n.value):!0}};function o_t(e,t,n,r,o){sDe.set(e,o),WY.set(t,n),aDe.set(t,r);let i=new Proxy(t,r_t);iDe.forEach(a=>a(e,i,o)),uDe.push([e,i,o])}ON.register=o_t;ON.importHooks=iDe;ON.specifiers=sDe;ON.toHook=uDe});var nK=F((_An,pv)=>{A();var lDe=Fe("path"),i_t=tU(),{fileURLToPath:a_t}=Fe("url"),{MessageChannel:s_t}=Fe("worker_threads"),{isBuiltin:XY}=Fe("module");XY||(XY=()=>!0);var{importHooks:eK,specifiers:u_t,toHook:c_t}=cDe();function dDe(e){eK.push(e),c_t.forEach(([t,n,r])=>e(t,n,r))}function pDe(e){let t=eK.indexOf(e);t>-1&&eK.splice(t,1)}function dv(e,t,n,r){let o=e(t,n,r);o&&o!==t&&"default"in t&&(t.default=o)}var tK;function l_t(){let{port1:e,port2:t}=new s_t,n=0,r;tK=c=>{n++,e.postMessage(c)},e.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let c=setInterval(()=>{},1e3),d=new Promise(m=>{r=m}).then(()=>{clearInterval(c)});return n===0&&r(),d}let i=t;return{registerOptions:{data:{addHookMessagePort:i,include:[]},transferList:[i]},addHookMessagePort:i,waitForAllMessagesAcknowledged:o}}function wN(e,t,n){if(!(this instanceof wN))return new wN(e,t,n);typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null);let r=t?t.internals===!0:!1;tK&&Array.isArray(e)&&tK(e),this._iitmHook=(o,i,a)=>{let c=o,d=c.startsWith("node:"),m,h;if(d){let S=o.slice(5);XY(S)&&(o=S)}else if(c.startsWith("file://")){let S=Error.stackTraceLimit;Error.stackTraceLimit=0;try{m=a_t(o),o=m}catch{}if(Error.stackTraceLimit=S,m){let y=i_t(m);y&&(o=y.name,h=y.basedir)}}if(e)for(let S of e)if(m&&S===m)dv(n,i,m,void 0);else if(S===o){if(!h)dv(n,i,o,h);else if(h.endsWith(u_t.get(c)))dv(n,i,o,h);else if(r){let y=o+lDe.sep+lDe.relative(h,m);dv(n,i,y,h)}}else S===a&&dv(n,i,a,h);else dv(n,i,o,h)},dDe(this._iitmHook)}wN.prototype.unhook=function(){pDe(this._iitmHook)};pv.exports=wN;pv.exports.Hook=wN;pv.exports.addHook=dDe;pv.exports.removeHook=pDe;pv.exports.createAddHookMessageChannel=l_t});var rK=F(L_=>{"use strict";A();Object.defineProperty(L_,"__esModule",{value:!0});L_.isWrapped=L_.safeExecuteInTheMiddleAsync=L_.safeExecuteInTheMiddle=void 0;function d_t(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}L_.safeExecuteInTheMiddle=d_t;async function p_t(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(await t(r,o),r&&!n)throw r;return o}}L_.safeExecuteInTheMiddleAsync=p_t;function f_t(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}L_.isWrapped=f_t});var mDe=F(S4=>{"use strict";A();Object.defineProperty(S4,"__esModule",{value:!0});S4.InstrumentationBase=void 0;var MN=Fe("path"),fDe=Fe("util"),A_t=eDe(),oK=VY(),m_t=tDe(),g_t=oDe(),h_t=nK(),kN=(Ge(),ke(Ze)),__t=DS(),E_t=Fe("fs"),S_t=rK(),iK=class extends m_t.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=g_t.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,S_t.isWrapped)(t[n])&&this._unwrap(t,n),fDe.types.isProxy(t)){let o=(0,oK.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,oK.wrap)(t,n,r)};_unwrap=(t,n)=>fDe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,oK.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{kN.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){kN.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{kN.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){kN.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Fe.resolve(n);Fe.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,E_t.readFileSync)(MN.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{kN.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return ADe(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let a=t.files??[],c=MN.normalize(r);return a.filter(m=>m.name===c&&ADe(m.supportedVersions,i,t.includePrerelease)).reduce((m,h)=>(h.moduleExports=m,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(m,t.moduleVersion)):m),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(a,c,d)=>{if(!d&&MN.isAbsolute(c)){let m=MN.parse(c);c=m.name,d=m.dir}return this._onRequire(t,a,c,d)},r=(a,c,d)=>this._onRequire(t,a,c,d),o=MN.isAbsolute(t.name)?new __t.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new h_t.Hook([t.name],{internals:!0},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};S4.InstrumentationBase=iK;function ADe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,A_t.satisfies)(t,r,{includePrerelease:n}))}});var gDe=F(y4=>{"use strict";A();Object.defineProperty(y4,"__esModule",{value:!0});y4.normalize=void 0;var y_t=Fe("path");Object.defineProperty(y4,"normalize",{enumerable:!0,get:function(){return y_t.normalize}})});var hDe=F(fv=>{"use strict";A();Object.defineProperty(fv,"__esModule",{value:!0});fv.normalize=fv.InstrumentationBase=void 0;var T_t=mDe();Object.defineProperty(fv,"InstrumentationBase",{enumerable:!0,get:function(){return T_t.InstrumentationBase}});var C_t=gDe();Object.defineProperty(fv,"normalize",{enumerable:!0,get:function(){return C_t.normalize}})});var aK=F(Av=>{"use strict";A();Object.defineProperty(Av,"__esModule",{value:!0});Av.normalize=Av.InstrumentationBase=void 0;var _De=hDe();Object.defineProperty(Av,"InstrumentationBase",{enumerable:!0,get:function(){return _De.InstrumentationBase}});Object.defineProperty(Av,"normalize",{enumerable:!0,get:function(){return _De.normalize}})});var EDe=F(T4=>{"use strict";A();Object.defineProperty(T4,"__esModule",{value:!0});T4.InstrumentationNodeModuleDefinition=void 0;var sK=class{files;name;supportedVersions;patch;unpatch;constructor(t,n,r,o,i){this.files=i||[],this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o}};T4.InstrumentationNodeModuleDefinition=sK});var SDe=F(C4=>{"use strict";A();Object.defineProperty(C4,"__esModule",{value:!0});C4.InstrumentationNodeModuleFile=void 0;var I_t=aK(),uK=class{name;supportedVersions;patch;unpatch;constructor(t,n,r,o){this.name=(0,I_t.normalize)(t),this.supportedVersions=n,this.patch=r,this.unpatch=o}};C4.InstrumentationNodeModuleFile=uK});var yDe=F(iy=>{"use strict";A();Object.defineProperty(iy,"__esModule",{value:!0});iy.semconvStabilityFromStr=iy.SemconvStability=void 0;var I4;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(I4=iy.SemconvStability||(iy.SemconvStability={}));function b_t(e,t){let n=I4.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=I4.DUPLICATE;break}else o.toLowerCase()===e&&(n=I4.STABLE);return n}iy.semconvStabilityFromStr=b_t});var CDe=F(Ji=>{"use strict";A();Object.defineProperty(Ji,"__esModule",{value:!0});Ji.semconvStabilityFromStr=Ji.SemconvStability=Ji.safeExecuteInTheMiddleAsync=Ji.safeExecuteInTheMiddle=Ji.isWrapped=Ji.InstrumentationNodeModuleFile=Ji.InstrumentationNodeModuleDefinition=Ji.InstrumentationBase=Ji.registerInstrumentations=void 0;var v_t=$xe();Object.defineProperty(Ji,"registerInstrumentations",{enumerable:!0,get:function(){return v_t.registerInstrumentations}});var R_t=aK();Object.defineProperty(Ji,"InstrumentationBase",{enumerable:!0,get:function(){return R_t.InstrumentationBase}});var x_t=EDe();Object.defineProperty(Ji,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return x_t.InstrumentationNodeModuleDefinition}});var D_t=SDe();Object.defineProperty(Ji,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return D_t.InstrumentationNodeModuleFile}});var cK=rK();Object.defineProperty(Ji,"isWrapped",{enumerable:!0,get:function(){return cK.isWrapped}});Object.defineProperty(Ji,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return cK.safeExecuteInTheMiddle}});Object.defineProperty(Ji,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return cK.safeExecuteInTheMiddleAsync}});var TDe=yDe();Object.defineProperty(Ji,"SemconvStability",{enumerable:!0,get:function(){return TDe.SemconvStability}});Object.defineProperty(Ji,"semconvStabilityFromStr",{enumerable:!0,get:function(){return TDe.semconvStabilityFromStr}})});var IDe=F((QAn,B_t)=>{B_t.exports={name:"@fastify/otel",version:"0.18.0",description:"Official Fastify OpenTelemetry Instrumentation",main:"index.js",type:"commonjs",types:"types/index.d.ts",scripts:{lint:"eslint","lint:fix":"eslint --fix",test:"npm run test:all && npm run test:typescript","test:unit":"c8 --100 node --test","test:all":"npm run test:v4 && npm run test:v5","test:v4":"cross-env FASTIFY_VERSION=fastifyv4 npm run test:unit","test:v5":"cross-env FASTIFY_VERSION=fastify npm run test:unit","test:coverage":"c8 node --test && c8 report --reporter=html","test:typescript":"tsd"},repository:{type:"git",url:"git+https://github.com/fastify/otel.git"},keywords:["plugin","helper","fastify","instrumentation","otel","opentelemetry"],author:"Carlos Fuentes - @metcoder95 (https://metcoder.dev)",license:"MIT",bugs:{url:"https://github.com/fastify/otel/issues"},homepage:"https://github.com/fastify/otel#readme",funding:[{type:"github",url:"https://github.com/sponsors/fastify"},{type:"opencollective",url:"https://opencollective.com/fastify"}],devDependencies:{"@fastify/type-provider-typebox":"^6.1.0","@opentelemetry/context-async-hooks":"^2.0.0","@opentelemetry/contrib-test-utils":"^0.59.0","@opentelemetry/instrumentation-http":"^0.212.0","@opentelemetry/propagator-jaeger":"^2.0.0","@opentelemetry/sdk-trace-base":"^2.0.0","@opentelemetry/sdk-trace-node":"^2.2.0","@types/node":"^25.0.3",c8:"^11.0.0","cross-env":"^10.0.0",eslint:"^9.16.0",fastify:"^5.1.0","fastify-plugin":"^5.1.0",fastifyv4:"npm:fastify@^4.0.0",neostandard:"^0.12.0",tsd:"^0.33.0"},dependencies:{"@opentelemetry/core":"^2.0.0","@opentelemetry/instrumentation":"^0.212.0","@opentelemetry/semantic-conventions":"^1.28.0",minimatch:"^10.2.4"},peerDependencies:{"@opentelemetry/api":"^1.9.0"},tsd:{directory:"types"}}});var vDe=F(ay=>{"use strict";A();Object.defineProperty(ay,"__esModule",{value:!0});ay.range=ay.balanced=void 0;var N_t=(e,t,n)=>{let r=e instanceof RegExp?bDe(e,n):e,o=t instanceof RegExp?bDe(t,n):t,i=r!==null&&o!=null&&(0,ay.range)(r,o,n);return i&&{start:i[0],end:i[1],pre:n.slice(0,i[0]),body:n.slice(i[0]+r.length,i[1]),post:n.slice(i[1]+o.length)}};ay.balanced=N_t;var bDe=(e,t)=>{let n=t.match(e);return n?n[0]:null},O_t=(e,t,n)=>{let r,o,i,a,c,d=n.indexOf(e),m=n.indexOf(t,d+1),h=d;if(d>=0&&m>0){if(e===t)return[d,m];for(r=[],i=n.length;h>=0&&!c;){if(h===d)r.push(h),d=n.indexOf(e,h+1);else if(r.length===1){let S=r.pop();S!==void 0&&(c=[S,m])}else o=r.pop(),o!==void 0&&o<i&&(i=o,a=m),m=n.indexOf(t,h+1);h=d<m&&d>=0?d:m}r.length&&a!==void 0&&(c=[i,a])}return c};ay.range=O_t});var wDe=F(mv=>{"use strict";A();Object.defineProperty(mv,"__esModule",{value:!0});mv.EXPANSION_MAX=void 0;mv.expand=$_t;var RDe=vDe(),xDe="\0SLASH"+Math.random()+"\0",DDe="\0OPEN"+Math.random()+"\0",dK="\0CLOSE"+Math.random()+"\0",BDe="\0COMMA"+Math.random()+"\0",NDe="\0PERIOD"+Math.random()+"\0",w_t=new RegExp(xDe,"g"),M_t=new RegExp(DDe,"g"),k_t=new RegExp(dK,"g"),P_t=new RegExp(BDe,"g"),U_t=new RegExp(NDe,"g"),L_t=/\\\\/g,Q_t=/\\{/g,F_t=/\\}/g,G_t=/\\,/g,j_t=/\\\./g;mv.EXPANSION_MAX=1e5;function lK(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function z_t(e){return e.replace(L_t,xDe).replace(Q_t,DDe).replace(F_t,dK).replace(G_t,BDe).replace(j_t,NDe)}function H_t(e){return e.replace(w_t,"\\").replace(M_t,"{").replace(k_t,"}").replace(P_t,",").replace(U_t,".")}function ODe(e){if(!e)return[""];let t=[],n=(0,RDe.balanced)("{","}",e);if(!n)return e.split(",");let{pre:r,body:o,post:i}=n,a=r.split(",");a[a.length-1]+="{"+o+"}";let c=ODe(i);return i.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),t.push.apply(t,a),t}function $_t(e,t={}){if(!e)return[];let{max:n=mv.EXPANSION_MAX}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),PN(z_t(e),n,!0).map(H_t)}function V_t(e){return"{"+e+"}"}function q_t(e){return/^-?0\d/.test(e)}function Y_t(e,t){return e<=t}function K_t(e,t){return e>=t}function PN(e,t,n){let r=[],o=(0,RDe.balanced)("{","}",e);if(!o)return[e];let i=o.pre,a=o.post.length?PN(o.post,t,!1):[""];if(/\$$/.test(o.pre))for(let c=0;c<a.length&&c<t;c++){let d=i+"{"+o.body+"}"+a[c];r.push(d)}else{let c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),m=c||d,h=o.body.indexOf(",")>=0;if(!m&&!h)return o.post.match(/,(?!,).*\}/)?(e=o.pre+"{"+o.body+dK+o.post,PN(e,t,!0)):[e];let S;if(m)S=o.body.split(/\.\./);else if(S=ODe(o.body),S.length===1&&S[0]!==void 0&&(S=PN(S[0],t,!1).map(V_t),S.length===1))return a.map(I=>o.pre+S[0]+I);let y;if(m&&S[0]!==void 0&&S[1]!==void 0){let I=lK(S[0]),v=lK(S[1]),x=Math.max(S[0].length,S[1].length),N=S.length===3&&S[2]!==void 0?Math.abs(lK(S[2])):1,M=Y_t;v<I&&(N*=-1,M=K_t);let j=S.some(q_t);y=[];for(let G=I;M(G,v);G+=N){let q;if(d)q=String.fromCharCode(G),q==="\\"&&(q="");else if(q=String(G),j){let oe=x-q.length;if(oe>0){let ge=new Array(oe+1).join("0");G<0?q="-"+ge+q.slice(1):q=ge+q}}y.push(q)}}else{y=[];for(let I=0;I<S.length;I++)y.push.apply(y,PN(S[I],t,!1))}for(let I=0;I<y.length;I++)for(let v=0;v<a.length&&r.length<t;v++){let x=i+y[I]+a[v];(!n||m||x)&&r.push(x)}}return r}});var MDe=F(b4=>{"use strict";A();Object.defineProperty(b4,"__esModule",{value:!0});b4.assertValidPattern=void 0;var J_t=1024*64,Z_t=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>J_t)throw new TypeError("pattern is too long")};b4.assertValidPattern=Z_t});var PDe=F(v4=>{"use strict";A();Object.defineProperty(v4,"__esModule",{value:!0});v4.parseClass=void 0;var W_t={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},UN=e=>e.replace(/[[\]\\-]/g,"\\$&"),X_t=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),kDe=e=>e.join(""),eEt=(e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],i=n+1,a=!1,c=!1,d=!1,m=!1,h=n,S="";e:for(;i<e.length;){let x=e.charAt(i);if((x==="!"||x==="^")&&i===n+1){m=!0,i++;continue}if(x==="]"&&a&&!d){h=i+1;break}if(a=!0,x==="\\"&&!d){d=!0,i++;continue}if(x==="["&&!d){for(let[N,[M,Q,j]]of Object.entries(W_t))if(e.startsWith(N,i)){if(S)return["$.",!1,e.length-n,!0];i+=N.length,j?o.push(M):r.push(M),c=c||Q;continue e}}if(d=!1,S){x>S?r.push(UN(S)+"-"+UN(x)):x===S&&r.push(UN(x)),S="",i++;continue}if(e.startsWith("-]",i+1)){r.push(UN(x+"-")),i+=2;continue}if(e.startsWith("-",i+1)){S=x,i+=2;continue}r.push(UN(x)),i++}if(h<i)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,e.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!m){let x=r[0].length===2?r[0].slice(-1):r[0];return[X_t(x),!1,h-n,!1]}let y="["+(m?"^":"")+kDe(r)+"]",I="["+(m?"":"^")+kDe(o)+"]";return[r.length&&o.length?"("+y+"|"+I+")":r.length?y:I,c,h-n,!0]};v4.parseClass=eEt});var x4=F(R4=>{"use strict";A();Object.defineProperty(R4,"__esModule",{value:!0});R4.unescape=void 0;var tEt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");R4.unescape=tEt});var AK=F(O4=>{"use strict";A();var Mc;Object.defineProperty(O4,"__esModule",{value:!0});O4.AST=void 0;var nEt=PDe(),D4=x4(),rEt=new Set(["!","?","+","*","@"]),pK=e=>rEt.has(e),UDe=e=>pK(e.type),oEt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),iEt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),aEt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),LDe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),sEt="(?!(?:^|/)\\.\\.?(?:$|/))",B4="(?!\\.)",uEt=new Set(["[","."]),cEt=new Set(["..","."]),lEt=new Set("().*{}+?[]^$\\!"),dEt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fK="[^/]",QDe=fK+"*?",FDe=fK+"+?",pEt=0,N4=class{type;#n;#r;#o=!1;#e=[];#t;#s;#c;#u=!1;#i;#a;#l=!1;id=++pEt;get depth(){return(this.#t?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#n.id,parent:this.#t?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(t,n,r={}){this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#i=this.#n===this?r:this.#n.#i,this.#c=this.#n===this?[]:this.#n.#c,t==="!"&&!this.#n.#u&&this.#c.push(this),this.#s=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#e.map(t=>String(t)).join("|")+")":this.#a=this.#e.map(t=>String(t)).join("")}#h(){if(this!==this.#n)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#c.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let o=n.#s+1;!r.type&&o<r.#e.length;o++)for(let i of t.#e){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof Mc&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let t=this.type===null?this.#e.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#e.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#u&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#s===0)return!0;let t=this.#t;for(let n=0;n<this.#s;n++){let r=t.#e[n];if(!(r instanceof Mc&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let t=this.#t?this.#t.#e.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new Mc(this.type,t);for(let r of this.#e)n.copyIn(r);return n}static#d(t,n,r,o,i){let a=o.maxExtglobRecursion??2,c=!1,d=!1,m=-1,h=!1;if(n.type===null){let x=r,N="";for(;x<t.length;){let M=t.charAt(x++);if(c||M==="\\"){c=!c,N+=M;continue}if(d){x===m+1?(M==="^"||M==="!")&&(h=!0):M==="]"&&!(x===m+2&&h)&&(d=!1),N+=M;continue}else if(M==="["){d=!0,m=x,h=!1,N+=M;continue}if(!o.noext&&pK(M)&&t.charAt(x)==="("&&i<=a){n.push(N),N="";let j=new Mc(M,n);x=Mc.#d(t,j,x,o,i+1),n.push(j);continue}N+=M}return n.push(N),x}let S=r+1,y=new Mc(null,n),I=[],v="";for(;S<t.length;){let x=t.charAt(S++);if(c||x==="\\"){c=!c,v+=x;continue}if(d){S===m+1?(x==="^"||x==="!")&&(h=!0):x==="]"&&!(S===m+2&&h)&&(d=!1),v+=x;continue}else if(x==="["){d=!0,m=S,h=!1,v+=x;continue}if(!o.noext&&pK(x)&&t.charAt(S)==="("&&(i<=a||n&&n.#p(x))){let M=n&&n.#p(x)?0:1;y.push(v),v="";let Q=new Mc(x,y);y.push(Q),S=Mc.#d(t,Q,S,o,i+M);continue}if(x==="|"){y.push(v),v="",I.push(y),y=new Mc(null,n);continue}if(x===")")return v===""&&n.#e.length===0&&(n.#l=!0),y.push(v),v="",n.push(...I,y),S;v+=x}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],S}#_(t){return this.#A(t,iEt)}#A(t,n=oEt){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null)return!1;let r=t.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#p(r.type,n)}#p(t,n=aEt){return!!n.get(this.type)?.includes(t)}#E(t,n){let r=t.#e[0],o=new Mc(null,r,this.options);o.#e.push(""),r.push(o),this.#m(t,n)}#m(t,n){let r=t.#e[0];this.#e.splice(n,1,...r.#e);for(let o of r.#e)typeof o=="object"&&(o.#t=this);this.#a=void 0}#S(t){return!!LDe.get(this.type)?.has(t)}#y(t){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=t.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#T(t){let n=LDe.get(this.type),r=t.#e[0],o=n?.get(r.type);if(!o)return!1;this.#e=r.#e;for(let i of this.#e)typeof i=="object"&&(i.#t=this);this.type=o,this.#a=void 0,this.#l=!1}static fromGlob(t,n={}){let r=new Mc(null,void 0,n);return Mc.#d(t,r,0,n,0),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let t=this.toString(),[n,r,o,i]=this.toRegExpSource();if(!(o||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let c=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,c),{_src:n,_glob:t})}get options(){return this.#i}toRegExpSource(t){let n=t??!!this.#i.dot;if(this.#n===this&&(this.#f(),this.#h()),!UDe(this)){let d=this.isStart()&&this.isEnd()&&!this.#e.some(I=>typeof I!="string"),m=this.#e.map(I=>{let[v,x,N,M]=typeof I=="string"?Mc.#C(I,this.#r,d):I.toRegExpSource(t);return this.#r=this.#r||N,this.#o=this.#o||M,v}).join(""),h="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&cEt.has(this.#e[0]))){let v=uEt,x=n&&v.has(m.charAt(0))||m.startsWith("\\.")&&v.has(m.charAt(2))||m.startsWith("\\.\\.")&&v.has(m.charAt(4)),N=!n&&!t&&v.has(m.charAt(0));h=x?sEt:N?B4:""}let S="";return this.isEnd()&&this.#n.#u&&this.#t?.type==="!"&&(S="(?:$|\\/)"),[h+m+S,(0,D4.unescape)(m),this.#r=!!this.#r,this.#o]}let r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#g(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let d=this.toString(),m=this;return m.#e=[d],m.type=null,m.#r=void 0,[d,(0,D4.unescape)(this.toString()),!1,!1]}let a=!r||t||n||!B4?"":this.#g(!0);a===i&&(a=""),a&&(i=`(?:${i})(?:${a})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!n?B4:"")+FDe;else{let d=this.type==="!"?"))"+(this.isStart()&&!n&&!t?B4:"")+QDe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=o+i+d}return[c,(0,D4.unescape)(i),this.#r=!!this.#r,this.#o]}#f(){if(UDe(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#e.length;r++){let o=this.#e[r];typeof o=="object"&&(o.#f(),this.#A(o)?(n=!1,this.#m(o,r)):this.#_(o)?(n=!1,this.#E(o,r)):this.#y(o)&&(n=!1,this.#T(o)))}}while(!n&&++t<10)}else for(let t of this.#e)typeof t=="object"&&t.#f();this.#a=void 0}#g(t){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,o,i,a]=n.toRegExpSource(t);return this.#o=this.#o||a,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#C(t,n,r=!1){let o=!1,i="",a=!1,c=!1;for(let d=0;d<t.length;d++){let m=t.charAt(d);if(o){o=!1,i+=(lEt.has(m)?"\\":"")+m;continue}if(m==="*"){if(c)continue;c=!0,i+=r&&/^[*]+$/.test(t)?FDe:QDe,n=!0;continue}else c=!1;if(m==="\\"){d===t.length-1?i+="\\\\":o=!0;continue}if(m==="["){let[h,S,y,I]=(0,nEt.parseClass)(t,d);if(y){i+=h,a=a||S,d+=y-1,n=n||I;continue}}if(m==="?"){i+=fK,n=!0;continue}i+=dEt(m)}return[i,(0,D4.unescape)(t),!!n,a]}};O4.AST=N4;Mc=N4});var mK=F(w4=>{"use strict";A();Object.defineProperty(w4,"__esModule",{value:!0});w4.escape=void 0;var fEt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");w4.escape=fEt});var qDe=F(ft=>{"use strict";A();Object.defineProperty(ft,"__esModule",{value:!0});ft.unescape=ft.escape=ft.AST=ft.Minimatch=ft.match=ft.makeRe=ft.braceExpand=ft.defaults=ft.filter=ft.GLOBSTAR=ft.sep=ft.minimatch=void 0;var AEt=wDe(),M4=MDe(),zDe=AK(),mEt=mK(),gEt=x4(),hEt=(e,t,n={})=>((0,M4.assertValidPattern)(t),!n.nocomment&&t.charAt(0)==="#"?!1:new sy(t,n).match(e));ft.minimatch=hEt;var _Et=/^\*+([^+@!?\*\[\(]*)$/,EEt=e=>t=>!t.startsWith(".")&&t.endsWith(e),SEt=e=>t=>t.endsWith(e),yEt=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),TEt=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),CEt=/^\*+\.\*+$/,IEt=e=>!e.startsWith(".")&&e.includes("."),bEt=e=>e!=="."&&e!==".."&&e.includes("."),vEt=/^\.\*+$/,REt=e=>e!=="."&&e!==".."&&e.startsWith("."),xEt=/^\*+$/,DEt=e=>e.length!==0&&!e.startsWith("."),BEt=e=>e.length!==0&&e!=="."&&e!=="..",NEt=/^\?+([^+@!?\*\[\(]*)?$/,OEt=([e,t=""])=>{let n=HDe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},wEt=([e,t=""])=>{let n=$De([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},MEt=([e,t=""])=>{let n=$De([e]);return t?r=>n(r)&&r.endsWith(t):n},kEt=([e,t=""])=>{let n=HDe([e]);return t?r=>n(r)&&r.endsWith(t):n},HDe=([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},$De=([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},VDe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",GDe={win32:{sep:"\\"},posix:{sep:"/"}};ft.sep=VDe==="win32"?GDe.win32.sep:GDe.posix.sep;ft.minimatch.sep=ft.sep;ft.GLOBSTAR=Symbol("globstar **");ft.minimatch.GLOBSTAR=ft.GLOBSTAR;var PEt="[^/]",UEt=PEt+"*?",LEt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",QEt="(?:(?!(?:\\/|^)\\.).)*?",FEt=(e,t={})=>n=>(0,ft.minimatch)(n,e,t);ft.filter=FEt;ft.minimatch.filter=ft.filter;var Qd=(e,t={})=>Object.assign({},e,t),GEt=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return ft.minimatch;let t=ft.minimatch;return Object.assign((r,o,i={})=>t(r,o,Qd(e,i)),{Minimatch:class extends t.Minimatch{constructor(o,i={}){super(o,Qd(e,i))}static defaults(o){return t.defaults(Qd(e,o)).Minimatch}},AST:class extends t.AST{constructor(o,i,a={}){super(o,i,Qd(e,a))}static fromGlob(o,i={}){return t.AST.fromGlob(o,Qd(e,i))}},unescape:(r,o={})=>t.unescape(r,Qd(e,o)),escape:(r,o={})=>t.escape(r,Qd(e,o)),filter:(r,o={})=>t.filter(r,Qd(e,o)),defaults:r=>t.defaults(Qd(e,r)),makeRe:(r,o={})=>t.makeRe(r,Qd(e,o)),braceExpand:(r,o={})=>t.braceExpand(r,Qd(e,o)),match:(r,o,i={})=>t.match(r,o,Qd(e,i)),sep:t.sep,GLOBSTAR:ft.GLOBSTAR})};ft.defaults=GEt;ft.minimatch.defaults=ft.defaults;var jEt=(e,t={})=>((0,M4.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,AEt.expand)(e,{max:t.braceExpandMax}));ft.braceExpand=jEt;ft.minimatch.braceExpand=ft.braceExpand;var zEt=(e,t={})=>new sy(e,t).makeRe();ft.makeRe=zEt;ft.minimatch.makeRe=ft.makeRe;var HEt=(e,t,n={})=>{let r=new sy(t,n);return e=e.filter(o=>r.match(o)),r.options.nonull&&!e.length&&e.push(t),e};ft.match=HEt;ft.minimatch.match=ft.match;var jDe=/[?*]|[+@!]\(.*?\)|\[|\]/,$Et=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),sy=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){(0,M4.assertValidPattern)(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||VDe,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((i,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let d=i[0]===""&&i[1]===""&&(i[2]==="?"||!jDe.test(i[2]))&&!jDe.test(i[3]),m=/^[a-z]:/i.test(i[0]);if(d)return[...i.slice(0,4),...i.slice(4).map(h=>this.parse(h))];if(m)return[i[0],...i.slice(1).map(h=>this.parse(h))]}return i.map(d=>this.parse(d))});if(this.debug(this.pattern,o),this.set=o.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let a=this.set[i];a[0]===""&&a[1]===""&&this.globParts[i][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let o=0;o<t[r].length;o++)t[r][o]==="**"&&(t[r][o]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,o)=>{let i=r[r.length-1];return o==="**"&&i==="**"?r:o===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(o),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){let i=t[o];o===1&&i===""&&t[0]===""||(i==="."||i==="")&&(n=!0,t.splice(o,1),o--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let o=t[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let a=o;for(;r[a+1]==="**";)a++;a>o&&r.splice(o+1,a-o);let c=r[o+1],d=r[o+2],m=r[o+3];if(c!==".."||!d||d==="."||d===".."||!m||m==="."||m==="..")continue;n=!0,r.splice(o,1);let h=r.slice(0);h[o]="**",t.push(h),o--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(n=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let a=r[i-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let d=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...d),r.length===0&&r.push(""),i-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let o=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(o){t[n]=[],t[r]=o;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let o=0,i=0,a=[],c="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])a.push(c==="b"?n[i]:t[o]),o++,i++;else if(r&&t[o]==="**"&&n[i]===t[o+1])a.push(t[o]),o++;else if(r&&n[i]==="**"&&t[o]===n[i+1])a.push(n[i]),i++;else if(t[o]==="*"&&n[i]&&(this.options.dot||!n[i].startsWith("."))&&n[i]!=="**"){if(c==="b")return!1;c="a",a.push(t[o]),o++,i++}else if(n[i]==="*"&&t[o]&&(this.options.dot||!t[o].startsWith("."))&&t[o]!=="**"){if(c==="a")return!1;c="b",a.push(n[i]),o++,i++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let o=0,i=0;if(this.isWindows){let c=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),d=!c&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),m=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),h=!m&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),S=d?3:c?0:void 0,y=h?3:m?0:void 0;if(typeof S=="number"&&typeof y=="number"){let[I,v]=[t[S],n[y]];I.toLowerCase()===v.toLowerCase()&&(n[y]=I,i=y,o=S)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(ft.GLOBSTAR)?this.#n(t,n,r,o,i):this.#o(t,n,r,o,i)}#n(t,n,r,o,i){let a=n.indexOf(ft.GLOBSTAR,i),c=n.lastIndexOf(ft.GLOBSTAR),[d,m,h]=r?[n.slice(i,a),n.slice(a+1),[]]:[n.slice(i,a),n.slice(a+1,c),n.slice(c+1)];if(d.length){let Q=t.slice(o,o+d.length);if(!this.#o(Q,d,r,0,0))return!1;o+=d.length,i+=d.length}let S=0;if(h.length){if(h.length+o>t.length)return!1;let Q=t.length-h.length;if(this.#o(t,h,r,Q,0))S=h.length;else{if(t[t.length-1]!==""||o+h.length===t.length||(Q--,!this.#o(t,h,r,Q,0)))return!1;S=h.length+1}}if(!m.length){let Q=!!S;for(let j=o;j<t.length-S;j++){let G=String(t[j]);if(Q=!0,G==="."||G===".."||!this.options.dot&&G.startsWith("."))return!1}return r||Q}let y=[[[],0]],I=y[0],v=0,x=[0];for(let Q of m)Q===ft.GLOBSTAR?(x.push(v),I=[[],0],y.push(I)):(I[0].push(Q),v++);let N=y.length-1,M=t.length-S;for(let Q of y)Q[1]=M-(x[N--]+Q[0].length);return!!this.#r(t,y,o,0,r,0,!!S)}#r(t,n,r,o,i,a,c){let d=n[o];if(!d){for(let S=r;S<t.length;S++){c=!0;let y=t[S];if(y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1}return c}let[m,h]=d;for(;r<=h;){if(this.#o(t.slice(0,r+m.length),m,i,r,0)&&a<this.maxGlobstarRecursion){let I=this.#r(t,n,r+m.length,o+1,i,a+1,c);if(I!==!1)return I}let y=t[r];if(y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1;r++}return i||null}#o(t,n,r,o,i){let a,c,d,m;for(a=o,c=i,m=t.length,d=n.length;a<m&&c<d;a++,c++){this.debug("matchOne loop");let h=n[c],S=t[a];if(this.debug(n,h,S),h===!1||h===ft.GLOBSTAR)return!1;let y;if(typeof h=="string"?(y=S===h,this.debug("string match",h,S,y)):(y=h.test(S),this.debug("pattern match",h,S,y)),!y)return!1}if(a===m&&c===d)return!0;if(a===m)return r;if(c===d)return a===m-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return(0,ft.braceExpand)(this.pattern,this.options)}parse(t){(0,M4.assertValidPattern)(t);let n=this.options;if(t==="**")return ft.GLOBSTAR;if(t==="")return"";let r,o=null;(r=t.match(xEt))?o=n.dot?BEt:DEt:(r=t.match(_Et))?o=(n.nocase?n.dot?TEt:yEt:n.dot?SEt:EEt)(r[1]):(r=t.match(NEt))?o=(n.nocase?n.dot?wEt:OEt:n.dot?MEt:kEt)(r):(r=t.match(CEt))?o=n.dot?bEt:IEt:(r=t.match(vEt))&&(o=REt);let i=zDe.AST.fromGlob(t,this.options).toMMPattern();return o&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:o}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?UEt:n.dot?LEt:QEt,o=new Set(n.nocase?["i"]:[]),i=t.map(d=>{let m=d.map(S=>{if(S instanceof RegExp)for(let y of S.flags.split(""))o.add(y);return typeof S=="string"?$Et(S):S===ft.GLOBSTAR?ft.GLOBSTAR:S._src});m.forEach((S,y)=>{let I=m[y+1],v=m[y-1];S!==ft.GLOBSTAR||v===ft.GLOBSTAR||(v===void 0?I!==void 0&&I!==ft.GLOBSTAR?m[y+1]="(?:\\/|"+r+"\\/)?"+I:m[y]=r:I===void 0?m[y-1]=v+"(?:\\/|\\/"+r+")?":I!==ft.GLOBSTAR&&(m[y-1]=v+"(?:\\/|\\/"+r+"\\/)"+I,m[y+1]=ft.GLOBSTAR))});let h=m.filter(S=>S!==ft.GLOBSTAR);if(this.partial&&h.length>=1){let S=[];for(let y=1;y<=h.length;y++)S.push(h.slice(0,y).join("/"));return"(?:"+S.join("|")+")"}return h.join("/")}).join("|"),[a,c]=t.length>1?["(?:",")"]:["",""];i="^"+a+i+c+"$",this.partial&&(i="^(?:\\/|"+a+i.slice(1,-1)+c+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let o=this.slashSplit(t);this.debug(this.pattern,"split",o);let i=this.set;this.debug(this.pattern,"set",i);let a=o[o.length-1];if(!a)for(let c=o.length-2;!a&&c>=0;c--)a=o[c];for(let c=0;c<i.length;c++){let d=i[c],m=o;if(r.matchBase&&d.length===1&&(m=[a]),this.matchOne(m,d,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return ft.minimatch.defaults(t).Minimatch}};ft.Minimatch=sy;var VEt=AK();Object.defineProperty(ft,"AST",{enumerable:!0,get:function(){return VEt.AST}});var qEt=mK();Object.defineProperty(ft,"escape",{enumerable:!0,get:function(){return qEt.escape}});var YEt=x4();Object.defineProperty(ft,"unescape",{enumerable:!0,get:function(){return YEt.unescape}});ft.minimatch.AST=zDe.AST;ft.minimatch.Minimatch=sy;ft.minimatch.escape=mEt.escape;ft.minimatch.unescape=gEt.unescape});var e1e=F((omn,_K)=>{"use strict";A();var YDe=Fe("node:diagnostics_channel"),{context:k4,trace:gK,SpanStatusCode:P4,propagation:hK,diag:KEt}=(Ge(),ke(Ze)),{getRPCMetadata:JEt,RPCType:ZEt}=Tr(),{ATTR_HTTP_ROUTE:U4,ATTR_HTTP_RESPONSE_STATUS_CODE:KDe,ATTR_HTTP_REQUEST_METHOD:WEt,ATTR_URL_PATH:XEt}=(Kn(),ke(Ur)),{InstrumentationBase:e0t}=CDe(),{version:t0t,name:JDe}=IDe(),n0t=">=4.0.0 <6",ZDe=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],_o={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},Q_={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Cg="anonymous",F_=Symbol("fastify otel instance"),G_=Symbol("fastify otel request spans"),LN=Symbol("fastify otel request context"),WDe=Symbol("fastify otel addhook original"),XDe=Symbol("fastify otel setnotfound original"),QN=Symbol("fastify otel ignore path"),FN=Symbol("fastify otel record exceptions"),L4=class extends e0t{logger=null;_requestHook=null;_lifecycleHook=null;constructor(t){if(super(JDe,t0t,t),this.logger=KEt.createComponentLogger({namespace:JDe}),this[QN]=null,this[FN]=!0,t?.recordExceptions!=null){if(typeof t.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[FN]=t.recordExceptions}if(typeof t?.requestHook=="function"&&(this._requestHook=t.requestHook),typeof t?.lifecycleHook=="function"&&(this._lifecycleHook=t.lifecycleHook),t?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=t?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=null;this[QN]=o=>typeof n=="function"?n(o):(r==null&&(r=qDe().minimatch),r(o.url,n))}}enable(){return this._handleInitialization===void 0&&this.getConfig().registerOnInitialization&&(this._handleInitialization=t=>{this.plugin()(t.fastify,void 0,()=>{});let n=(r,o,i)=>{i()};n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",t.fastify.register(n)},YDe.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(YDe.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let t=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:n0t,name:"@fastify/otel"},n;function n(r,o,i){r.decorate(F_,t),r.decorate(WDe,r.addHook),r.decorate(XDe,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let I=this[LN],v=this[G_];return{enabled:this.routeOptions.config?.otel!==!1,span:v,tracer:t.tracer,context:I,inject:(x,N)=>hK.inject(I,x,N),extract:(x,N)=>hK.extract(I,x,N)}}),r.decorateRequest(G_,null),r.decorateRequest(LN,null),r.addHook("onRoute",function(I){if(t[QN]?.(I)===!0){t.logger.debug(`Ignoring route instrumentation ${I.method} ${I.url} because it matches the ignore path`);return}if(I.config?.otel===!1){t.logger.debug(`Ignoring route instrumentation ${I.method} ${I.url} because it is disabled`);return}for(let v of ZDe)if(I[v]!=null){let x=I[v];if(typeof x=="function")I[v]=S(x,v,{[_o.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[_o.FASTIFY_TYPE]:Q_.ROUTE,[U4]:I.url,[_o.HOOK_CALLBACK_NAME]:x.name?.length>0?x.name:Cg});else if(Array.isArray(x)){let N=[];for(let M of x)N.push(S(M,v,{[_o.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[_o.FASTIFY_TYPE]:Q_.ROUTE,[U4]:I.url,[_o.HOOK_CALLBACK_NAME]:M.name?.length>0?M.name:Cg}));I[v]=N}}I.onSend!=null?I.onSend=Array.isArray(I.onSend)?[...I.onSend,a]:[I.onSend,a]:I.onSend=a,I.onError!=null?I.onError=Array.isArray(I.onError)?[...I.onError,c]:[I.onError,c]:I.onError=c,I.handler=S(I.handler,"handler",{[_o.HOOK_NAME]:`${this.pluginName} - route-handler`,[_o.FASTIFY_TYPE]:Q_.HANDLER,[U4]:I.url,[_o.HOOK_CALLBACK_NAME]:I.handler.name.length>0?I.handler.name:Cg})}),r.addHook("onRequest",function(I,v,x){if(this[F_].isEnabled()===!1||I.routeOptions.config?.otel===!1)return x();if(this[F_][QN]?.({url:I.url,method:I.method})===!0)return this[F_].logger.debug(`Ignoring request ${I.method} ${I.url} because it matches the ignore path`),x();let N=k4.active();gK.getSpan(N)==null&&(N=hK.extract(N,I.headers));let M=JEt(N);I.routeOptions.url!=null&&M?.type===ZEt.HTTP&&(M.route=I.routeOptions.url);let Q={[_o.ROOT]:"@fastify/otel",[WEt]:I.method,[XEt]:I.url};I.routeOptions.url!=null&&(Q[U4]=I.routeOptions.url);let j=this[F_].tracer.startSpan("request",{attributes:Q},N);try{this[F_]._requestHook?.(j,I)}catch(G){this[F_].logger.error({err:G},"requestHook threw")}I[LN]=gK.setSpan(N,j),I[G_]=j,k4.with(I[LN],()=>{x()})}),r.addHook("onResponse",function(I,v,x){let N=I[G_];N!=null&&(N.setAttributes({[KDe]:v.statusCode}),N.end()),I[G_]=null,x()}),r.addHook=d,r.setNotFoundHandler=m,i();function a(y,I,v,x){let N=y[G_];N!=null&&(I.statusCode>=500&&N.setStatus({code:P4.ERROR}),N.setAttributes({[KDe]:I.statusCode}),N.end()),y[G_]=null,x(null,v)}function c(y,I,v,x){let N=y[G_];N!=null&&(N.setStatus({code:P4.ERROR,message:v.message}),t[FN]!==!1&&N.recordException(v)),x()}function d(y,I){let v=this[WDe];return ZDe.includes(y)?v.call(this,y,S(I,y,{[_o.HOOK_NAME]:`${this.pluginName} - ${y}`,[_o.FASTIFY_TYPE]:Q_.INSTANCE,[_o.HOOK_CALLBACK_NAME]:I.name?.length>0?I.name:Cg})):v.call(this,y,I)}function m(y,I){let v=this[XDe];typeof y=="function"?(I=S(y,"notFoundHandler",{[_o.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[_o.FASTIFY_TYPE]:Q_.INSTANCE,[_o.HOOK_CALLBACK_NAME]:y.name?.length>0?y.name:Cg}),v.call(this,I)):(y.preValidation!=null&&(y.preValidation=S(y.preValidation,"notFoundHandler - preValidation",{[_o.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[_o.FASTIFY_TYPE]:Q_.INSTANCE,[_o.HOOK_CALLBACK_NAME]:y.preValidation.name?.length>0?y.preValidation.name:Cg})),y.preHandler!=null&&(y.preHandler=S(y.preHandler,"notFoundHandler - preHandler",{[_o.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[_o.FASTIFY_TYPE]:Q_.INSTANCE,[_o.HOOK_CALLBACK_NAME]:y.preHandler.name?.length>0?y.preHandler.name:Cg})),I=S(I,"notFoundHandler",{[_o.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[_o.FASTIFY_TYPE]:Q_.INSTANCE,[_o.HOOK_CALLBACK_NAME]:I.name?.length>0?I.name:Cg}),v.call(this,y,I))}function h(y){for(let I of y)if(I?.routeOptions&&I.url&&I.method)return I;return null}function S(y,I,v={}){return function(...N){let M=this[F_],Q=h(N);if(Q===null)return M.logger.debug(`Ignoring route instrumentation because ${I} was called without a Fastify request argument`),y.call(this,...N);if(M.isEnabled()===!1||Q.routeOptions.config?.otel===!1)return M.logger.debug(`Ignoring route instrumentation ${Q.routeOptions.method} ${Q.routeOptions.url} because it is disabled`),y.call(this,...N);if(M[QN]?.({url:Q.url,method:Q.method})===!0)return M.logger.debug(`Ignoring route instrumentation ${Q.routeOptions.method} ${Q.routeOptions.url} because it matches the ignore path`),y.call(this,...N);let j=Q[LN]??k4.active(),G=y.name?.length>0?y.name:this.pluginName??Cg,q=M.tracer.startSpan(`${I} - ${G}`,{attributes:v},j);if(M._lifecycleHook!=null)try{M._lifecycleHook(q,{hookName:I,request:Q,handler:G})}catch(oe){M.logger.error({err:oe},"Execution of lifecycleHook failed")}return k4.with(gK.setSpan(j,q),function(){try{let oe=y.call(this,...N);return typeof oe?.then=="function"?oe.then(ge=>(q.end(),ge),ge=>(q.setStatus({code:P4.ERROR,message:ge.message}),M[FN]!==!1&&q.recordException(ge),q.end(),Promise.reject(ge))):(q.end(),oe)}catch(oe){throw q.setStatus({code:P4.ERROR,message:oe.message}),M[FN]!==!1&&q.recordException(oe),q.end(),oe}},this)}}}}};_K.exports=L4;_K.exports.FastifyOtelInstrumentation=L4});var Ig,GN,jN,t1e=O(()=>{A();(function(e){let t="fastify.name";e.FASTIFY_NAME=t;let n="fastify.type";e.FASTIFY_TYPE=n;let r="hook.name";e.HOOK_NAME=r;let o="plugin.name";e.PLUGIN_NAME=o})(Ig||(Ig={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request_handler";e.REQUEST_HANDLER=n})(GN||(GN={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request handler";e.REQUEST_HANDLER=n})(jN||(jN={}))});var zN,n1e=O(()=>{A();zN=Symbol("opentelemetry.instrumentation.fastify.request_active_span")});function EK(e,t,n,r={}){let o=t.startSpan(n,{attributes:r}),i=e[zN]||[];return i.push(o),Object.defineProperty(e,zN,{enumerable:!1,configurable:!0,value:i}),o}function Q4(e,t){let n=e[zN]||[];n.length&&(n.forEach(r=>{t&&(r.setStatus({code:si.ERROR,message:t.message}),r.recordException(t)),r.end()}),delete e[zN])}function o1e(e,t,n){let r,o;try{o=e(),r1e(o)&&o.then(i=>t(void 0,i),i=>t(i))}catch(i){r=i}finally{if(!r1e(o)&&(t(r,o),r))throw r;return o}}function r1e(e){return typeof e=="object"&&e&&typeof Object.getOwnPropertyDescriptor(e,"then")?.value=="function"||!1}var i1e=O(()=>{A();Ge();n1e()});function a0t(){let e=gt();e&&e.on("spanStart",t=>{s1e(t)})}function s1e(e){let t=Nt(e).data,n=t["fastify.type"];if(t[Zt]||!n)return;e.setAttributes({[Mt]:"auto.http.otel.fastify",[Zt]:`${n}.fastify`});let r=t["fastify.name"]||t["plugin.name"]||t["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(o)}}var G4,uy,r0t,o0t,a1e,i0t,F4,u1e=O(()=>{A();Ge();G4=ie(Tr(),1),uy=ie(tn(),1);Kn();dt();t1e();i1e();r0t="0.1.0",o0t="@sentry/instrumentation-fastify-v3",a1e="anonymous",i0t=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),F4=class extends uy.InstrumentationBase{constructor(t={}){super(o0t,r0t,t)}init(){return[new uy.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_hookOnRequest(){let t=this;return function(r,o,i){if(!t.isEnabled())return i();t._wrap(o,"send",t._patchSend());let a=r,c=(0,G4.getRPCMetadata)(Ye.active()),d=a.routeOptions?a.routeOptions.url:r.routerPath;d&&c?.type===G4.RPCType.HTTP&&(c.route=d);let m=r.method||"GET";In().setTransactionName(`${m} ${d}`),i()}}_wrapHandler(t,n,r,o){let i=this;return this._diag.debug("Patching fastify route.handler function"),function(...a){if(!i.isEnabled())return r.apply(this,a);let c=r.name||t||a1e,d=`${jN.MIDDLEWARE} - ${c}`,m=a[1],h=EK(m,i.tracer,d,{[Ig.FASTIFY_TYPE]:GN.MIDDLEWARE,[Ig.PLUGIN_NAME]:t,[Ig.HOOK_NAME]:n}),S=o&&a[a.length-1];return S&&(a[a.length-1]=function(...y){Q4(m),S.apply(this,y)}),Ye.with(zt.setSpan(Ye.active(),h),()=>o1e(()=>r.apply(this,a),y=>{y instanceof Error&&(h.setStatus({code:si.ERROR,message:y.message}),h.recordException(y)),o||Q4(m)}))}}_wrapAddHook(){let t=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let i=o[0],a=o[1],c=this.pluginName;if(!i0t.has(i))return n.apply(this,o);let d=typeof o[o.length-1]=="function"&&a.constructor.name!=="AsyncFunction";return n.apply(this,[i,t._wrapHandler(c,i,a,d)])}}}_patchConstructor(t){let n=this;function r(...o){let i=t.fastify.apply(this,o);return i.addHook("onRequest",n._hookOnRequest()),i.addHook("preHandler",n._hookPreHandler()),a0t(),n._wrap(i,"addHook",n._wrapAddHook()),i}return t.errorCodes!==void 0&&(r.errorCodes=t.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let t=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...i){let a=i[0];return t.isEnabled()?(0,uy.safeExecuteInTheMiddle)(()=>r.apply(this,i),c=>{!c&&a instanceof Error&&(c=a),Q4(this,c)}):r.apply(this,i)}}}_hookPreHandler(){let t=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,i){if(!t.isEnabled())return i();let a=r,c=a.routeOptions?.handler||a.context?.handler,d=c?.name.startsWith("bound ")?c.name.substring(6):c?.name,m=`${jN.REQUEST_HANDLER} - ${d||this.pluginName||a1e}`,h={[Ig.PLUGIN_NAME]:this.pluginName,[Ig.FASTIFY_TYPE]:GN.REQUEST_HANDLER,[u5]:a.routeOptions?a.routeOptions.url:r.routerPath};d&&(h[Ig.FASTIFY_NAME]=d);let S=EK(o,t.tracer,m,h);s1e(S);let{requestHook:y}=t.getConfig();return y&&(0,uy.safeExecuteInTheMiddle)(()=>y(S,{request:r}),I=>{I&&t._diag.error("request hook failed",I)},!0),Ye.with(zt.setSpan(Ye.active(),S),()=>{i()})}}}});import*as SK from"node:diagnostics_channel";function s0t(){let e=gt();if(e)return e.getIntegrationByName(j4)}function c1e(e,t,n,r){let o=s0t()?.getShouldHandleError()||A1e;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){Sa&&J.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(e,t,n)&&en(e,{mechanism:{handled:!1,type:"auto.function.fastify"}})}function A1e(e,t,n){let r=n.statusCode;return r>=500||r<=299}function m1e(e){let t=Nt(e),n=t.description,r=t.data,o=r["fastify.type"],i=o==="hook",a=o===n?.startsWith("handler -"),c=n==="request"||o==="request-handler";if(r[Zt]||!a&&!c&&!i)return;let d=i?"hook":a?"middleware":c?"request_handler":"<unknown>";e.setAttributes({[Mt]:"auto.http.otel.fastify",[Zt]:`${d}.fastify`});let m=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof m=="string"){let h=m.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(h)}}function c0t(){let e=gt();e&&e.on("spanStart",t=>{m1e(t)})}function l0t(e){e.addHook("onRequest",async(t,n)=>{if(t.opentelemetry){let{span:i}=t.opentelemetry();i&&m1e(i)}let r=t.routeOptions?.url,o=t.method||"GET";In().setTransactionName(`${o} ${r}`)})}var l1e,j4,d1e,p1e,u0t,f1e,g1e=O(()=>{A();l1e=ie(e1e(),1);dt();fr();oy();u1e();j4="Fastify",d1e=at(`${j4}.v3`,()=>new F4);p1e=at(`${j4}.v5`,()=>{let e=new l1e.FastifyOtelInstrumentation,t=e.plugin();return SK.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(t).after(o=>{o?Sa&&J.error("Failed to setup Fastify instrumentation",o):(c0t(),r&&l0t(r))})}),SK.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:i}=n;c1e.call(c1e,r,o,i,"diagnostics-channel")}),e}),u0t=({shouldHandleError:e})=>{let t;return{name:j4,setupOnce(){t=e||A1e,d1e(),p1e()},getShouldHandleError(){return t},setShouldHandleError(n){t=n}}},f1e=(e={})=>u0t(e)});var yK=F(rf=>{"use strict";A();Object.defineProperty(rf,"__esModule",{value:!0});rf.SpanNames=rf.TokenKind=rf.AllowedOperationTypes=void 0;var d0t;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(d0t=rf.AllowedOperationTypes||(rf.AllowedOperationTypes={}));var p0t;(function(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"})(p0t=rf.TokenKind||(rf.TokenKind={}));var f0t;(function(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"})(f0t=rf.SpanNames||(rf.SpanNames={}))});var TK=F(HN=>{"use strict";A();Object.defineProperty(HN,"__esModule",{value:!0});HN.AttributeNames=void 0;var A0t;(function(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.VARIABLES="graphql.variables.",e.ERROR_VALIDATION_NAME="graphql.validation.error"})(A0t=HN.AttributeNames||(HN.AttributeNames={}))});var z4=F(gv=>{"use strict";A();Object.defineProperty(gv,"__esModule",{value:!0});gv.OTEL_GRAPHQL_DATA_SYMBOL=gv.OTEL_PATCHED_SYMBOL=void 0;gv.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");gv.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var h1e=F(H4=>{"use strict";A();Object.defineProperty(H4,"__esModule",{value:!0});H4.OPERATION_NOT_SUPPORTED=void 0;var wmn=z4();H4.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var N1e=F(ya=>{"use strict";A();Object.defineProperty(ya,"__esModule",{value:!0});ya.wrapFieldResolver=ya.wrapFields=ya.getSourceFromLocation=ya.getOperation=ya.endSpan=ya.addSpanSource=ya.addInputVariableAttributes=ya.isPromise=void 0;var hv=(Ge(),ke(Ze)),j_=yK(),cy=TK(),bg=z4(),_1e=Object.values(j_.AllowedOperationTypes),m0t=e=>typeof e?.then=="function";ya.isPromise=m0t;var g0t=e=>typeof e=="object"&&e!==null;function CK(e,t,n){Array.isArray(n)?n.forEach((r,o)=>{CK(e,`${t}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{CK(e,`${t}.${r}`,o)}):e.setAttribute(`${cy.AttributeNames.VARIABLES}${String(t)}`,n)}function h0t(e,t){Object.entries(t).forEach(([n,r])=>{CK(e,n,r)})}ya.addInputVariableAttributes=h0t;function T1e(e,t,n,r,o){let i=R1e(t,n,r,o);e.setAttribute(cy.AttributeNames.SOURCE,i)}ya.addSpanSource=T1e;function _0t(e,t,n,r,o){let i=C1e(n,o);if(i)return{field:i,spanAdded:!1};let c=t().flatResolveSpans?b1e(n):I1e(n,o);return i={span:E0t(e,t,n,r,o,c)},T0t(n,o,i),{field:i,spanAdded:!0}}function E0t(e,t,n,r,o,i){let a={[cy.AttributeNames.FIELD_NAME]:r.fieldName,[cy.AttributeNames.FIELD_PATH]:o.join("."),[cy.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[cy.AttributeNames.PARENT_NAME]:r.parentType.name},c=e.startSpan(`${j_.SpanNames.RESOLVE} ${a[cy.AttributeNames.FIELD_PATH]}`,{attributes:a},i?hv.trace.setSpan(hv.context.active(),i):void 0),d=n[bg.OTEL_GRAPHQL_DATA_SYMBOL].source,m=r.fieldNodes.find(h=>h.kind==="Field");return m&&T1e(c,d.loc,t().allowValues,m.loc?.start,m.loc?.end),c}function S0t(e,t){t&&e.recordException(t),e.end()}ya.endSpan=S0t;function y0t(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(n=>_1e.indexOf(n?.operation)!==-1).find(n=>t===n?.name?.value):e.definitions.find(n=>_1e.indexOf(n?.operation)!==-1)}ya.getOperation=y0t;function T0t(e,t,n){return e[bg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]=n}function C1e(e,t){return e[bg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]}function I1e(e,t){for(let n=t.length-1;n>0;n--){let r=C1e(e,t.slice(0,n));if(r)return r.span}return b1e(e)}function b1e(e){return e[bg.OTEL_GRAPHQL_DATA_SYMBOL].span}function C0t(e,t){let n=[],r=t;for(;r;){let o=r.key;e&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function I0t(e){return v1e(`
|
|
37
37
|
`,e)}function E1e(e){return v1e(" ",e)}function v1e(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}var b0t=[j_.TokenKind.FLOAT,j_.TokenKind.STRING,j_.TokenKind.INT,j_.TokenKind.BLOCK_STRING];function R1e(e,t=!1,n,r){let o="";if(e?.startToken){let i=typeof n=="number"?n:e.start,a=typeof r=="number"?r:e.end,c=e.startToken.next,d=1;for(;c;){if(c.start<i){c=c.next,d=c?.line;continue}if(c.end>a){c=c.next,d=c?.line;continue}let m=c.value||c.kind,h="";!t&&b0t.indexOf(c.kind)>=0&&(m="*"),c.kind===j_.TokenKind.STRING&&(m=`"${m}"`),c.kind===j_.TokenKind.EOF&&(m=""),c.line>d?(o+=I0t(c.line-d),d=c.line,h=E1e(c.column-1)):c.line===c.prev?.line&&(h=E1e(c.start-(c.prev?.end||0))),o+=h+m,c&&(c=c.next)}}return o}ya.getSourceFromLocation=R1e;function x1e(e,t,n){if(!e||e[bg.OTEL_PATCHED_SYMBOL])return;let r=e.getFields();e[bg.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let i=r[o];if(i&&(i.resolve&&(i.resolve=B1e(t,n,i.resolve)),i.type)){let a=D1e(i.type);for(let c of a)x1e(c,t,n)}})}ya.wrapFields=x1e;function D1e(e){return"ofType"in e?D1e(e.ofType):v0t(e)?e.getTypes():R0t(e)?[e]:[]}function v0t(e){return"getTypes"in e&&typeof e.getTypes=="function"}function R0t(e){return"getFields"in e&&typeof e.getFields=="function"}var S1e=(e,t,n)=>{n&&(e.recordException(t),e.setStatus({code:hv.SpanStatusCode.ERROR,message:t.message}),e.end())},y1e=(e,t)=>{t&&e.end()};function B1e(e,t,n,r=!1){if(o[bg.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(i,a,c,d){if(!n)return;let m=t();if(m.ignoreTrivialResolveSpans&&r&&(g0t(i)||typeof i=="function")&&typeof i[d.fieldName]!="function")return n.call(this,i,a,c,d);if(!c[bg.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,i,a,c,d);let h=C0t(m.mergeItems,d&&d.path),S=h.filter(v=>typeof v=="string").length,y,I=!1;if(m.depth>=0&&m.depth<S)y=I1e(c,h);else{let{field:v,spanAdded:x}=_0t(e,t,c,d,h);y=v.span,I=x}return hv.context.with(hv.trace.setSpan(hv.context.active(),y),()=>{try{let v=n.call(this,i,a,c,d);return(0,ya.isPromise)(v)?v.then(x=>(y1e(y,I),x),x=>{throw S1e(y,x,I),x}):(y1e(y,I),v)}catch(v){throw S1e(y,v,I),v}})}return o[bg.OTEL_PATCHED_SYMBOL]=!0,o}ya.wrapFieldResolver=B1e});var O1e=F(_v=>{"use strict";A();Object.defineProperty(_v,"__esModule",{value:!0});_v.PACKAGE_NAME=_v.PACKAGE_VERSION=void 0;_v.PACKAGE_VERSION="0.62.0";_v.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var k1e=F(q4=>{"use strict";A();Object.defineProperty(q4,"__esModule",{value:!0});q4.GraphQLInstrumentation=void 0;var vg=(Ge(),ke(Ze)),Fd=tn(),$N=yK(),$4=TK(),IK=z4(),x0t=h1e(),nu=N1e(),w1e=O1e(),M1e={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},V4=[">=14.0.0 <17"],bK=class extends Fd.InstrumentationBase{constructor(t={}){super(w1e.PACKAGE_NAME,w1e.PACKAGE_VERSION,{...M1e,...t})}setConfig(t={}){super.setConfig({...M1e,...t})}init(){let t=new Fd.InstrumentationNodeModuleDefinition("graphql",V4);return t.files.push(this._addPatchingExecute()),t.files.push(this._addPatchingParser()),t.files.push(this._addPatchingValidate()),t}_addPatchingExecute(){return new Fd.InstrumentationNodeModuleFile("graphql/execution/execute.js",V4,t=>((0,Fd.isWrapped)(t.execute)&&this._unwrap(t,"execute"),this._wrap(t,"execute",this._patchExecute(t.defaultFieldResolver)),t),t=>{t&&this._unwrap(t,"execute")})}_addPatchingParser(){return new Fd.InstrumentationNodeModuleFile("graphql/language/parser.js",V4,t=>((0,Fd.isWrapped)(t.parse)&&this._unwrap(t,"parse"),this._wrap(t,"parse",this._patchParse()),t),t=>{t&&this._unwrap(t,"parse")})}_addPatchingValidate(){return new Fd.InstrumentationNodeModuleFile("graphql/validation/validate.js",V4,t=>((0,Fd.isWrapped)(t.validate)&&this._unwrap(t,"validate"),this._wrap(t,"validate",this._patchValidate()),t),t=>{t&&this._unwrap(t,"validate")})}_patchExecute(t){let n=this;return function(o){return function(){let a;if(arguments.length>=2){let m=arguments;a=n._wrapExecuteArgs(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],t)}else{let m=arguments[0];a=n._wrapExecuteArgs(m.schema,m.document,m.rootValue,m.contextValue,m.variableValues,m.operationName,m.fieldResolver,m.typeResolver,t)}let c=(0,nu.getOperation)(a.document,a.operationName),d=n._createExecuteSpan(c,a);return a.contextValue[IK.OTEL_GRAPHQL_DATA_SYMBOL]={source:a.document?a.document||a.document[IK.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:d,fields:{}},vg.context.with(vg.trace.setSpan(vg.context.active(),d),()=>(0,Fd.safeExecuteInTheMiddle)(()=>o.apply(this,[a]),(m,h)=>{n._handleExecutionResult(d,m,h)}))}}}_handleExecutionResult(t,n,r){let o=this.getConfig();if(r===void 0||n){(0,nu.endSpan)(t,n);return}if((0,nu.isPromise)(r))r.then(i=>{if(typeof o.responseHook!="function"){(0,nu.endSpan)(t);return}this._executeResponseHook(t,i)},i=>{(0,nu.endSpan)(t,i)});else{if(typeof o.responseHook!="function"){(0,nu.endSpan)(t);return}this._executeResponseHook(t,r)}}_executeResponseHook(t,n){let{responseHook:r}=this.getConfig();r&&(0,Fd.safeExecuteInTheMiddle)(()=>{r(t,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,nu.endSpan)(t,void 0)},!0)}_patchParse(){let t=this;return function(r){return function(i,a){return t._parse(this,r,i,a)}}}_patchValidate(){let t=this;return function(r){return function(i,a,c,d,m){return t._validate(this,r,i,a,c,m,d)}}}_parse(t,n,r,o){let i=this.getConfig(),a=this.tracer.startSpan($N.SpanNames.PARSE);return vg.context.with(vg.trace.setSpan(vg.context.active(),a),()=>(0,Fd.safeExecuteInTheMiddle)(()=>n.call(t,r,o),(c,d)=>{d&&((0,nu.getOperation)(d)?d.loc&&(0,nu.addSpanSource)(a,d.loc,i.allowValues):a.updateName($N.SpanNames.SCHEMA_PARSE)),(0,nu.endSpan)(a,c)}))}_validate(t,n,r,o,i,a,c){let d=this.tracer.startSpan($N.SpanNames.VALIDATE,{});return vg.context.with(vg.trace.setSpan(vg.context.active(),d),()=>(0,Fd.safeExecuteInTheMiddle)(()=>n.call(t,r,o,i,c,a),(m,h)=>{o.loc||d.updateName($N.SpanNames.SCHEMA_VALIDATE),h&&h.length&&d.recordException({name:$4.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(h)}),(0,nu.endSpan)(d,m)}))}_createExecuteSpan(t,n){let r=this.getConfig(),o=this.tracer.startSpan($N.SpanNames.EXECUTE,{});if(t){let{operation:i,name:a}=t;o.setAttribute($4.AttributeNames.OPERATION_TYPE,i);let c=a?.value;c?(o.setAttribute($4.AttributeNames.OPERATION_NAME,c),o.updateName(`${i} ${c}`)):o.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=x0t.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),o.setAttribute($4.AttributeNames.OPERATION_NAME,i)}return n.document?.loc&&(0,nu.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,nu.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(t,n,r,o,i,a,c,d,m){if(o||(o={}),o[IK.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:a,fieldResolver:c,typeResolver:d};let h=c==null,S=c??m;return c=(0,nu.wrapFieldResolver)(this.tracer,()=>this.getConfig(),S,h),t&&((0,nu.wrapFields)(t.getQueryType(),this.tracer,()=>this.getConfig()),(0,nu.wrapFields)(t.getMutationType(),this.tracer,()=>this.getConfig())),{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:a,fieldResolver:c,typeResolver:d}}};q4.GraphQLInstrumentation=bK});var P1e=F(Y4=>{"use strict";A();Object.defineProperty(Y4,"__esModule",{value:!0});Y4.GraphQLInstrumentation=void 0;var D0t=k1e();Object.defineProperty(Y4,"GraphQLInstrumentation",{enumerable:!0,get:function(){return D0t.GraphQLInstrumentation}})});function G1e(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}function N0t(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 U1e,L1e,Q1e,B0t,F1e,j1e=O(()=>{A();Ge();U1e=ie(P1e(),1);dt();fr();nv();L1e="Graphql",Q1e=at(L1e,U1e.GraphQLInstrumentation,e=>{let t=G1e(e);return{...t,responseHook(n,r){Lr(n,"auto.graphql.otel.graphql"),r.errors?.length&&!Nt(n).status&&n.setStatus({code:si.ERROR});let i=Nt(n).data,a=i["graphql.operation.type"],c=i["graphql.operation.name"];if(t.useOperationNameForRootSpan&&a){let d=ui(n),h=Nt(d).data[ev]||[],S=c?`${a} ${c}`:`${a}`;Array.isArray(h)?(h.push(S),d.setAttribute(ev,h)):typeof h=="string"?d.setAttribute(ev,[h,S]):d.setAttribute(ev,S),Nt(d).data["original-description"]||d.setAttribute("original-description",Nt(d).description),d.updateName(`${Nt(d).data["original-description"]} (${N0t(h)})`)}}}}),B0t=(e={})=>({name:L1e,setupOnce(){Q1e(G1e(e))}}),F1e=B0t});var z1e=F(K4=>{"use strict";A();Object.defineProperty(K4,"__esModule",{value:!0});K4.EVENT_LISTENERS_SET=void 0;K4.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var H1e=F(J4=>{"use strict";A();Object.defineProperty(J4,"__esModule",{value:!0});J4.bufferTextMapGetter=void 0;J4.bufferTextMapGetter={get(e,t){if(!e)return;let n=Object.keys(e);for(let r of n)if(r===t||r.toLowerCase()===t)return e[r]?.toString()},keys(e){return e?Object.keys(e):[]}}});var $1e=F(er=>{"use strict";A();Object.defineProperty(er,"__esModule",{value:!0});er.METRIC_MESSAGING_PROCESS_DURATION=er.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=er.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=er.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=er.MESSAGING_SYSTEM_VALUE_KAFKA=er.MESSAGING_OPERATION_TYPE_VALUE_SEND=er.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=er.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=er.ATTR_MESSAGING_SYSTEM=er.ATTR_MESSAGING_OPERATION_TYPE=er.ATTR_MESSAGING_OPERATION_NAME=er.ATTR_MESSAGING_KAFKA_OFFSET=er.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=er.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=er.ATTR_MESSAGING_DESTINATION_PARTITION_ID=er.ATTR_MESSAGING_DESTINATION_NAME=er.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;er.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";er.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";er.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";er.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";er.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";er.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";er.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";er.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";er.ATTR_MESSAGING_SYSTEM="messaging.system";er.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";er.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";er.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";er.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";er.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";er.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";er.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";er.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var V1e=F(Ev=>{"use strict";A();Object.defineProperty(Ev,"__esModule",{value:!0});Ev.PACKAGE_NAME=Ev.PACKAGE_VERSION=void 0;Ev.PACKAGE_VERSION="0.23.0";Ev.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var W1e=F(W4=>{"use strict";A();Object.defineProperty(W4,"__esModule",{value:!0});W4.KafkaJsInstrumentation=void 0;var Qr=(Ge(),ke(Ze)),Gd=tn(),Sv=(Kn(),ke(Ur)),q1e=z1e(),Y1e=H1e(),At=$1e(),K1e=V1e();function Z4(e,t,n){return r=>{e.add(t,{...n,...r?{[Sv.ATTR_ERROR_TYPE]:r}:{}})}}function J1e(e,t,n){return r=>{e.record((Date.now()-t)/1e3,{...n,...r?{[Sv.ATTR_ERROR_TYPE]:r}:{}})}}var Z1e=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],vK=class extends Gd.InstrumentationBase{constructor(t={}){super(K1e.PACKAGE_NAME,K1e.PACKAGE_VERSION,t)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(At.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:Z1e}}),this._sentMessages=this.meter.createCounter(At.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(At.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(At.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:Z1e}})}init(){let t=r=>{(0,Gd.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,Gd.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new Gd.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],r=>(t(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),t)}_getConsumerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,Gd.isWrapped)(i.run)&&t._unwrap(i,"run"),t._wrap(i,"run",t._getConsumerRunPatch()),t._setKafkaEventListeners(i),i}}_setKafkaEventListeners(t){t[q1e.EVENT_LISTENERS_SET]||(t.events?.REQUEST&&t.on(t.events.REQUEST,this._recordClientDurationMetric.bind(this)),t[q1e.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(t){let[n,r]=t.payload.broker.split(":");this._clientDuration.record(t.payload.duration/1e3,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:`${t.payload.apiName}`,[Sv.ATTR_SERVER_ADDRESS]:n,[Sv.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,Gd.isWrapped)(i.sendBatch)&&t._unwrap(i,"sendBatch"),t._wrap(i,"sendBatch",t._getSendBatchPatch()),(0,Gd.isWrapped)(i.send)&&t._unwrap(i,"send"),t._wrap(i,"send",t._getSendPatch()),(0,Gd.isWrapped)(i.transaction)&&t._unwrap(i,"transaction"),t._wrap(i,"transaction",t._getProducerTransactionPatch()),t._setKafkaEventListeners(i),i}}_getConsumerRunPatch(){let t=this;return n=>function(...o){let i=o[0];return i?.eachMessage&&((0,Gd.isWrapped)(i.eachMessage)&&t._unwrap(i,"eachMessage"),t._wrap(i,"eachMessage",t._getConsumerEachMessagePatch())),i?.eachBatch&&((0,Gd.isWrapped)(i.eachBatch)&&t._unwrap(i,"eachBatch"),t._wrap(i,"eachBatch",t._getConsumerEachBatchPatch())),n.call(this,i)}}_getConsumerEachMessagePatch(){let t=this;return n=>function(...o){let i=o[0],a=Qr.propagation.extract(Qr.ROOT_CONTEXT,i.message.headers,Y1e.bufferTextMapGetter),c=t._startConsumerSpan({topic:i.topic,message:i.message,operationType:At.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:a,attributes:{[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}}),d=[J1e(t._processDuration,Date.now(),{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"process",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}),Z4(t._consumedMessages,1,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"process",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)})],m=Qr.context.with(Qr.trace.setSpan(a,c),()=>n.apply(this,o));return t._endSpansOnPromise([c],d,m)}}_getConsumerEachBatchPatch(){return t=>{let n=this;return function(...o){let i=o[0],a=n._startConsumerSpan({topic:i.batch.topic,message:void 0,operationType:At.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:Qr.ROOT_CONTEXT,attributes:{[At.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:i.batch.messages.length,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}});return Qr.context.with(Qr.trace.setSpan(Qr.context.active(),a),()=>{let c=Date.now(),d=[],m=[Z4(n._consumedMessages,i.batch.messages.length,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"process",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)})];i.batch.messages.forEach(S=>{let y=Qr.propagation.extract(Qr.ROOT_CONTEXT,S.headers,Y1e.bufferTextMapGetter),I=Qr.trace.getSpan(y)?.spanContext(),v;I&&(v={context:I}),d.push(n._startConsumerSpan({topic:i.batch.topic,message:S,operationType:At.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:v,attributes:{[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}})),m.push(J1e(n._processDuration,c,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"process",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}))});let h=t.apply(this,o);return d.unshift(a),n._endSpansOnPromise(d,m,h)})}}}_getProducerTransactionPatch(){let t=this;return n=>function(...o){let i=t.tracer.startSpan("transaction"),a=n.apply(this,o);return a.then(c=>{let d=c.send;c.send=function(...I){return Qr.context.with(Qr.trace.setSpan(Qr.context.active(),i),()=>t._getSendPatch()(d).apply(this,I).catch(x=>{throw i.setStatus({code:Qr.SpanStatusCode.ERROR,message:x?.message}),i.recordException(x),x}))};let m=c.sendBatch;c.sendBatch=function(...I){return Qr.context.with(Qr.trace.setSpan(Qr.context.active(),i),()=>t._getSendBatchPatch()(m).apply(this,I).catch(x=>{throw i.setStatus({code:Qr.SpanStatusCode.ERROR,message:x?.message}),i.recordException(x),x}))};let h=c.commit;c.commit=function(...I){let v=h.apply(this,I).then(()=>{i.setStatus({code:Qr.SpanStatusCode.OK})});return t._endSpansOnPromise([i],[],v)};let S=c.abort;c.abort=function(...I){let v=S.apply(this,I);return t._endSpansOnPromise([i],[],v)}}).catch(c=>{i.setStatus({code:Qr.SpanStatusCode.ERROR,message:c?.message}),i.recordException(c),i.end()}),a}}_getSendBatchPatch(){let t=this;return n=>function(...o){let a=o[0].topicMessages||[],c=[],d=[];a.forEach(h=>{h.messages.forEach(S=>{c.push(t._startProducerSpan(h.topic,S)),d.push(Z4(t._sentMessages,1,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"send",[At.ATTR_MESSAGING_DESTINATION_NAME]:h.topic,...S.partition!==void 0?{[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(S.partition)}:{}}))})});let m=n.apply(this,o);return t._endSpansOnPromise(c,d,m)}}_getSendPatch(){let t=this;return n=>function(...o){let i=o[0],a=i.messages.map(m=>t._startProducerSpan(i.topic,m)),c=i.messages.map(m=>Z4(t._sentMessages,1,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"send",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,...m.partition!==void 0?{[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(m.partition)}:{}})),d=n.apply(this,o);return t._endSpansOnPromise(a,c,d)}}_endSpansOnPromise(t,n,r){return Promise.resolve(r).then(o=>(n.forEach(i=>i()),o)).catch(o=>{let i,a=Sv.ERROR_TYPE_VALUE_OTHER;throw typeof o=="string"||o===void 0?i=o:typeof o=="object"&&Object.prototype.hasOwnProperty.call(o,"message")&&(i=o.message,a=o.constructor.name),n.forEach(c=>c(a)),t.forEach(c=>{c.setAttribute(Sv.ATTR_ERROR_TYPE,a),c.setStatus({code:Qr.SpanStatusCode.ERROR,message:i})}),o}).finally(()=>{t.forEach(o=>o.end())})}_startConsumerSpan({topic:t,message:n,operationType:r,ctx:o,link:i,attributes:a}){let c=r===At.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,d=this.tracer.startSpan(`${c} ${t}`,{kind:r===At.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?Qr.SpanKind.CLIENT:Qr.SpanKind.CONSUMER,attributes:{...a,[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_DESTINATION_NAME]:t,[At.ATTR_MESSAGING_OPERATION_TYPE]:r,[At.ATTR_MESSAGING_OPERATION_NAME]:c,[At.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[At.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[At.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:i?[i]:[]},o),{consumerHook:m}=this.getConfig();return m&&n&&(0,Gd.safeExecuteInTheMiddle)(()=>m(d,{topic:t,message:n}),h=>{h&&this._diag.error("consumerHook error",h)},!0),d}_startProducerSpan(t,n){let r=this.tracer.startSpan(`send ${t}`,{kind:Qr.SpanKind.PRODUCER,attributes:{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_DESTINATION_NAME]:t,[At.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[At.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[At.ATTR_MESSAGING_OPERATION_NAME]:"send",[At.ATTR_MESSAGING_OPERATION_TYPE]:At.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},Qr.propagation.inject(Qr.trace.setSpan(Qr.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,Gd.safeExecuteInTheMiddle)(()=>o(r,{topic:t,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),r}};W4.KafkaJsInstrumentation=vK});var X1e=F(X4=>{"use strict";A();Object.defineProperty(X4,"__esModule",{value:!0});X4.KafkaJsInstrumentation=void 0;var O0t=W1e();Object.defineProperty(X4,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return O0t.KafkaJsInstrumentation}})});var eBe,tBe,nBe,w0t,rBe,oBe=O(()=>{A();eBe=ie(X1e(),1);fr();tBe="Kafka",nBe=at(tBe,()=>new eBe.KafkaJsInstrumentation({consumerHook(e){Lr(e,"auto.kafkajs.otel.consumer")},producerHook(e){Lr(e,"auto.kafkajs.otel.producer")}})),w0t=()=>({name:tBe,setupOnce(){nBe()}}),rBe=w0t});var iBe=F(yv=>{"use strict";A();Object.defineProperty(yv,"__esModule",{value:!0});yv.PACKAGE_NAME=yv.PACKAGE_VERSION=void 0;yv.PACKAGE_VERSION="0.58.0";yv.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var cBe=F(eF=>{"use strict";A();Object.defineProperty(eF,"__esModule",{value:!0});eF.LruMemoizerInstrumentation=void 0;var aBe=(Ge(),ke(Ze)),sBe=tn(),uBe=iBe(),RK=class extends sBe.InstrumentationBase{constructor(t={}){super(uBe.PACKAGE_NAME,uBe.PACKAGE_VERSION,t)}init(){return[new sBe.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],t=>{let n=function(){let r=t.apply(this,arguments);return function(){let o=[...arguments],i=o.pop(),a=typeof i=="function"?aBe.context.bind(aBe.context.active(),i):i;return o.push(a),r.apply(this,o)}};return n.sync=t.sync,n},void 0)]}};eF.LruMemoizerInstrumentation=RK});var lBe=F(tF=>{"use strict";A();Object.defineProperty(tF,"__esModule",{value:!0});tF.LruMemoizerInstrumentation=void 0;var M0t=cBe();Object.defineProperty(tF,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return M0t.LruMemoizerInstrumentation}})});var dBe,pBe,fBe,k0t,ABe,mBe=O(()=>{A();dBe=ie(lBe(),1);fr();pBe="LruMemoizer",fBe=at(pBe,()=>new dBe.LruMemoizerInstrumentation),k0t=()=>({name:pBe,setupOnce(){fBe()}}),ABe=k0t});var gBe=F(Do=>{"use strict";A();Object.defineProperty(Do,"__esModule",{value:!0});Do.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Do.DB_SYSTEM_VALUE_MONGODB=Do.DB_SYSTEM_NAME_VALUE_MONGODB=Do.ATTR_NET_PEER_PORT=Do.ATTR_NET_PEER_NAME=Do.ATTR_DB_SYSTEM=Do.ATTR_DB_STATEMENT=Do.ATTR_DB_OPERATION=Do.ATTR_DB_NAME=Do.ATTR_DB_MONGODB_COLLECTION=Do.ATTR_DB_CONNECTION_STRING=void 0;Do.ATTR_DB_CONNECTION_STRING="db.connection_string";Do.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Do.ATTR_DB_NAME="db.name";Do.ATTR_DB_OPERATION="db.operation";Do.ATTR_DB_STATEMENT="db.statement";Do.ATTR_DB_SYSTEM="db.system";Do.ATTR_NET_PEER_NAME="net.peer.name";Do.ATTR_NET_PEER_PORT="net.peer.port";Do.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";Do.DB_SYSTEM_VALUE_MONGODB="mongodb";Do.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var hBe=F(VN=>{"use strict";A();Object.defineProperty(VN,"__esModule",{value:!0});VN.MongodbCommandType=void 0;var P0t;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.AGGREGATE="aggregate",e.UNKNOWN="unknown"})(P0t=VN.MongodbCommandType||(VN.MongodbCommandType={}))});var _Be=F(Tv=>{"use strict";A();Object.defineProperty(Tv,"__esModule",{value:!0});Tv.PACKAGE_NAME=Tv.PACKAGE_VERSION=void 0;Tv.PACKAGE_VERSION="0.67.0";Tv.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var yBe=F(nF=>{"use strict";A();Object.defineProperty(nF,"__esModule",{value:!0});nF.MongoDBInstrumentation=void 0;var qo=(Ge(),ke(Ze)),tr=tn(),Rg=(Kn(),ke(Ur)),Ml=gBe(),ly=hBe(),EBe=_Be(),SBe={requireParentSpan:!0},xK=class e extends tr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(EBe.PACKAGE_NAME,EBe.PACKAGE_VERSION,{...SBe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,tr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,tr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...SBe,...t})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(Ml.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsage?.add(t,{"pool.name":n,state:r})}init(){let{v3PatchConnection:t,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:i,v4PatchConnectionPromise:a,v4UnpatchConnection:c}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:d,v4UnpatchConnectionPool:m}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:h,v4UnpatchSessions:S}=this._getV4SessionsPatches();return[new tr.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new tr.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],t,n)]),new tr.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new tr.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],i,c),new tr.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],a,c),new tr.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],d,m),new tr.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new tr.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],h,S)])]}_getV3ConnectionPatches(){return{v3PatchConnection:t=>((0,tr.isWrapped)(t.insert)&&this._unwrap(t,"insert"),this._wrap(t,"insert",this._getV3PatchOperation("insert")),(0,tr.isWrapped)(t.remove)&&this._unwrap(t,"remove"),this._wrap(t,"remove",this._getV3PatchOperation("remove")),(0,tr.isWrapped)(t.update)&&this._unwrap(t,"update"),this._wrap(t,"update",this._getV3PatchOperation("update")),(0,tr.isWrapped)(t.command)&&this._unwrap(t,"command"),this._wrap(t,"command",this._getV3PatchCommand()),(0,tr.isWrapped)(t.query)&&this._unwrap(t,"query"),this._wrap(t,"query",this._getV3PatchFind()),(0,tr.isWrapped)(t.getMore)&&this._unwrap(t,"getMore"),this._wrap(t,"getMore",this._getV3PatchCursor()),t),v3UnpatchConnection:t=>{t!==void 0&&(this._unwrap(t,"insert"),this._unwrap(t,"remove"),this._unwrap(t,"update"),this._unwrap(t,"command"),this._unwrap(t,"query"),this._unwrap(t,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:t=>((0,tr.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),this._wrap(t.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,tr.isWrapped)(t.release)&&this._unwrap(t,"release"),this._wrap(t.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),t),v4UnpatchSessions:t=>{t!==void 0&&((0,tr.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),(0,tr.isWrapped)(t.release)&&this._unwrap(t,"release"))}}}_getV4AcquireCommand(){let t=this;return n=>function(){let o=this.sessions.length,i=n.call(this),a=this.sessions.length;return o===a?t._connCountAdd(1,t._poolName,"used"):o-1===a&&(t._connCountAdd(-1,t._poolName,"idle"),t._connCountAdd(1,t._poolName,"used")),i}}_getV4ReleaseCommand(){let t=this;return n=>function(o){let i=n.call(this,o);return t._connCountAdd(-1,t._poolName,"used"),t._connCountAdd(1,t._poolName,"idle"),i}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:t=>{let n=t.ConnectionPool.prototype;return(0,tr.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),t},v4UnpatchConnectionPool:t=>{t!==void 0&&this._unwrap(t.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:t=>((0,tr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),this._wrap(t,"connect",this._getV4ConnectCommand()),t),v4UnpatchConnect:t=>{t!==void 0&&this._unwrap(t,"connect")}}}_getV4ConnectionPoolCheckOut(){return t=>function(r){let o=qo.context.bind(qo.context.active(),r);return t.call(this,o)}}_getV4ConnectCommand(){let t=this;return n=>function(o,i){if(n.length===1){let c=n.call(this,o);return c&&typeof c.then=="function"&&c.then(()=>t.setPoolName(o),()=>{}),c}let a=function(c,d){if(c||!d){i(c,d);return}t.setPoolName(o),i(c,d)};return n.call(this,o,a)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:t=>((0,tr.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandCallback()),t),v4PatchConnectionPromise:t=>((0,tr.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandPromise()),t),v4UnpatchConnection:t=>{t!==void 0&&this._unwrap(t.Connection.prototype,"command")}}}_getV3PatchOperation(t){let n=this;return r=>function(i,a,c,d,m){let h=qo.trace.getSpan(qo.context.active()),S=n._checkSkipInstrumentation(h),y=typeof d=="function"?d:m;if(S||typeof y!="function"||typeof c!="object")return typeof d=="function"?r.call(this,i,a,c,d):r.call(this,i,a,c,d,m);let I=n._getV3SpanAttributes(a,i,c[0],t),v=n._spanNameFromAttrs(I),x=n.tracer.startSpan(v,{kind:qo.SpanKind.CLIENT,attributes:I}),N=n._patchEnd(x,y);return typeof d=="function"?r.call(this,i,a,c,N):r.call(this,i,a,c,d,N)}}_getV3PatchCommand(){let t=this;return n=>function(o,i,a,c,d){let m=qo.trace.getSpan(qo.context.active()),h=t._checkSkipInstrumentation(m),S=typeof c=="function"?c:d;if(h||typeof S!="function"||typeof a!="object")return typeof c=="function"?n.call(this,o,i,a,c):n.call(this,o,i,a,c,d);let y=e._getCommandType(a),I=y===ly.MongodbCommandType.UNKNOWN?void 0:y,v=t._getV3SpanAttributes(i,o,a,I),x=t._spanNameFromAttrs(v),N=t.tracer.startSpan(x,{kind:qo.SpanKind.CLIENT,attributes:v}),M=t._patchEnd(N,S);return typeof c=="function"?n.call(this,o,i,a,M):n.call(this,o,i,a,c,M)}}_getV4PatchCommandCallback(){let t=this;return n=>function(o,i,a,c){let d=qo.trace.getSpan(qo.context.active()),m=t._checkSkipInstrumentation(d),h=c,S=Object.keys(i)[0];if(typeof i!="object"||i.ismaster||i.hello)return n.call(this,o,i,a,c);let y;if(!m){let v=t._getV4SpanAttributes(this,o,i,S),x=t._spanNameFromAttrs(v);y=t.tracer.startSpan(x,{kind:qo.SpanKind.CLIENT,attributes:v})}let I=t._patchEnd(y,h,this.id,S);return n.call(this,o,i,a,I)}}_getV4PatchCommandPromise(){let t=this;return n=>function(...o){let[i,a]=o,c=qo.trace.getSpan(qo.context.active()),d=t._checkSkipInstrumentation(c),m=Object.keys(a)[0],h=()=>{};if(typeof a!="object"||a.ismaster||a.hello)return n.apply(this,o);let S;if(!d){let v=t._getV4SpanAttributes(this,i,a,m),x=t._spanNameFromAttrs(v);S=t.tracer.startSpan(x,{kind:qo.SpanKind.CLIENT,attributes:v})}let y=t._patchEnd(S,h,this.id,m),I=n.apply(this,o);return I.then(v=>y(null,v),v=>y(v)),I}}_getV3PatchFind(){let t=this;return n=>function(o,i,a,c,d,m){let h=qo.trace.getSpan(qo.context.active()),S=t._checkSkipInstrumentation(h),y=typeof d=="function"?d:m;if(S||typeof y!="function"||typeof a!="object")return typeof d=="function"?n.call(this,o,i,a,c,d):n.call(this,o,i,a,c,d,m);let I=t._getV3SpanAttributes(i,o,a,"find"),v=t._spanNameFromAttrs(I),x=t.tracer.startSpan(v,{kind:qo.SpanKind.CLIENT,attributes:I}),N=t._patchEnd(x,y);return typeof d=="function"?n.call(this,o,i,a,c,N):n.call(this,o,i,a,c,d,N)}}_getV3PatchCursor(){let t=this;return n=>function(o,i,a,c,d,m){let h=qo.trace.getSpan(qo.context.active()),S=t._checkSkipInstrumentation(h),y=typeof d=="function"?d:m;if(S||typeof y!="function")return typeof d=="function"?n.call(this,o,i,a,c,d):n.call(this,o,i,a,c,d,m);let I=t._getV3SpanAttributes(i,o,a.cmd,"getMore"),v=t._spanNameFromAttrs(I),x=t.tracer.startSpan(v,{kind:qo.SpanKind.CLIENT,attributes:I}),N=t._patchEnd(x,y);return typeof d=="function"?n.call(this,o,i,a,c,N):n.call(this,o,i,a,c,d,N)}}static _getCommandType(t){return t.createIndexes!==void 0?ly.MongodbCommandType.CREATE_INDEXES:t.findandmodify!==void 0?ly.MongodbCommandType.FIND_AND_MODIFY:t.ismaster!==void 0?ly.MongodbCommandType.IS_MASTER:t.count!==void 0?ly.MongodbCommandType.COUNT:t.aggregate!==void 0?ly.MongodbCommandType.AGGREGATE:ly.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(t,n,r,o){let i,a;if(t){let d=typeof t.address=="string"?t.address.split(":"):"";d.length===2&&(i=d[0],a=d[1])}let c;return r?.documents&&r.documents[0]?c=r.documents[0]:r?.cursors?c=r.cursors:c=r,this._getSpanAttributes(n.db,n.collection,i,a,c,o)}_getV3SpanAttributes(t,n,r,o){let i,a;if(n&&n.s&&(i=n.s.options?.host??n.s.host,a=(n.s.options?.port??n.s.port)?.toString(),i==null||a==null)){let h=n.description?.address;if(h){let S=h.split(":");i=S[0],a=S[1]}}let[c,d]=t.toString().split("."),m=r?.query??r?.q??r;return this._getSpanAttributes(c,d,i,a,m,o)}_getSpanAttributes(t,n,r,o,i,a){let c={};if(this._dbSemconvStability&tr.SemconvStability.OLD&&(c[Ml.ATTR_DB_SYSTEM]=Ml.DB_SYSTEM_VALUE_MONGODB,c[Ml.ATTR_DB_NAME]=t,c[Ml.ATTR_DB_MONGODB_COLLECTION]=n,c[Ml.ATTR_DB_OPERATION]=a,c[Ml.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${t}`),this._dbSemconvStability&tr.SemconvStability.STABLE&&(c[Rg.ATTR_DB_SYSTEM_NAME]=Ml.DB_SYSTEM_NAME_VALUE_MONGODB,c[Rg.ATTR_DB_NAMESPACE]=t,c[Rg.ATTR_DB_OPERATION_NAME]=a,c[Rg.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&tr.SemconvStability.OLD&&(c[Ml.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&tr.SemconvStability.STABLE&&(c[Rg.ATTR_SERVER_ADDRESS]=r);let d=parseInt(o,10);isNaN(d)||(this._netSemconvStability&tr.SemconvStability.OLD&&(c[Ml.ATTR_NET_PEER_PORT]=d),this._netSemconvStability&tr.SemconvStability.STABLE&&(c[Rg.ATTR_SERVER_PORT]=d))}if(i){let{dbStatementSerializer:d}=this.getConfig(),m=typeof d=="function"?d:this._defaultDbStatementSerializer.bind(this);(0,tr.safeExecuteInTheMiddle)(()=>{let h=m(i);this._dbSemconvStability&tr.SemconvStability.OLD&&(c[Ml.ATTR_DB_STATEMENT]=h),this._dbSemconvStability&tr.SemconvStability.STABLE&&(c[Rg.ATTR_DB_QUERY_TEXT]=h)},h=>{h&&this._diag.error("Error running dbStatementSerializer hook",h)},!0)}return c}_spanNameFromAttrs(t){let n;return this._dbSemconvStability&tr.SemconvStability.STABLE?n=[t[Rg.ATTR_DB_OPERATION_NAME],t[Rg.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||Ml.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${t[Ml.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let t=new WeakSet;return(n,r)=>typeof r!="object"||!r?"?":t.has(r)?"[Circular]":(t.add(r),r)}_defaultDbStatementSerializer(t){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(t):JSON.stringify(t,this._getDefaultDbStatementReplacer())}_handleExecutionResult(t,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,tr.safeExecuteInTheMiddle)(()=>{r(t,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(t,n,r,o){let i=qo.context.active(),a=this,c=!1;return function(...m){if(!c){c=!0;let h=m[0];if(t){if(h instanceof Error)t.setStatus({code:qo.SpanStatusCode.ERROR,message:h.message});else{let S=m[1];a._handleExecutionResult(t,S)}t.end()}o==="endSessions"&&a._connCountAdd(-1,a._poolName,"idle")}return qo.context.with(i,()=>n.apply(this,m))}}setPoolName(t){let n=t.hostAddress?.host,r=t.hostAddress?.port,o=t.dbName,i=`mongodb://${n}:${r}/${o}`;this._poolName=i}_checkSkipInstrumentation(t){return this.getConfig().requireParentSpan===!0&&t===void 0}};nF.MongoDBInstrumentation=xK});var TBe=F(qN=>{"use strict";A();Object.defineProperty(qN,"__esModule",{value:!0});qN.MongodbCommandType=void 0;var U0t;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.UNKNOWN="unknown"})(U0t=qN.MongodbCommandType||(qN.MongodbCommandType={}))});var CBe=F(Cv=>{"use strict";A();Object.defineProperty(Cv,"__esModule",{value:!0});Cv.MongodbCommandType=Cv.MongoDBInstrumentation=void 0;var L0t=yBe();Object.defineProperty(Cv,"MongoDBInstrumentation",{enumerable:!0,get:function(){return L0t.MongoDBInstrumentation}});var Q0t=TBe();Object.defineProperty(Cv,"MongodbCommandType",{enumerable:!0,get:function(){return Q0t.MongodbCommandType}})});function F0t(e){let t=DK(e);return JSON.stringify(t)}function DK(e){if(Array.isArray(e))return e.map(t=>DK(t));if(G0t(e)){let t={};return Object.entries(e).map(([n,r])=>[n,DK(r)]).reduce((n,r)=>(z0t(r)&&(n[r[0]]=r[1]),n),t)}return"?"}function G0t(e){return typeof e=="object"&&e!==null&&!j0t(e)}function j0t(e){let t=!1;return typeof Buffer<"u"&&(t=Buffer.isBuffer(e)),t}function z0t(e){return Array.isArray(e)}var IBe,bBe,vBe,H0t,RBe,xBe=O(()=>{A();IBe=ie(CBe(),1);fr();bBe="Mongo",vBe=at(bBe,()=>new IBe.MongoDBInstrumentation({dbStatementSerializer:F0t,responseHook(e){Lr(e,"auto.db.otel.mongo")}}));H0t=()=>({name:bBe,setupOnce(){vBe()}}),RBe=H0t});var BK=F(Zi=>{"use strict";A();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.DB_SYSTEM_NAME_VALUE_MONGODB=Zi.ATTR_NET_PEER_PORT=Zi.ATTR_NET_PEER_NAME=Zi.ATTR_DB_USER=Zi.ATTR_DB_SYSTEM=Zi.ATTR_DB_STATEMENT=Zi.ATTR_DB_OPERATION=Zi.ATTR_DB_NAME=Zi.ATTR_DB_MONGODB_COLLECTION=void 0;Zi.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Zi.ATTR_DB_NAME="db.name";Zi.ATTR_DB_OPERATION="db.operation";Zi.ATTR_DB_STATEMENT="db.statement";Zi.ATTR_DB_SYSTEM="db.system";Zi.ATTR_DB_USER="db.user";Zi.ATTR_NET_PEER_NAME="net.peer.name";Zi.ATTR_NET_PEER_PORT="net.peer.port";Zi.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var NBe=F(z_=>{"use strict";A();Object.defineProperty(z_,"__esModule",{value:!0});z_.handleCallbackResponse=z_.handlePromiseResponse=z_.getAttributesFromCollection=void 0;var DBe=(Ge(),ke(Ze)),KN=tn(),YN=BK(),rF=(Kn(),ke(Ur));function $0t(e,t,n){let r={};return t&KN.SemconvStability.OLD&&(r[YN.ATTR_DB_MONGODB_COLLECTION]=e.name,r[YN.ATTR_DB_NAME]=e.conn.name,r[YN.ATTR_DB_USER]=e.conn.user),t&KN.SemconvStability.STABLE&&(r[rF.ATTR_DB_COLLECTION_NAME]=e.name,r[rF.ATTR_DB_NAMESPACE]=e.conn.name),n&KN.SemconvStability.OLD&&(r[YN.ATTR_NET_PEER_NAME]=e.conn.host,r[YN.ATTR_NET_PEER_PORT]=e.conn.port),n&KN.SemconvStability.STABLE&&(r[rF.ATTR_SERVER_ADDRESS]=e.conn.host,r[rF.ATTR_SERVER_PORT]=e.conn.port),r}z_.getAttributesFromCollection=$0t;function BBe(e,t={}){e.recordException(t),e.setStatus({code:DBe.SpanStatusCode.ERROR,message:`${t.message} ${t.code?`
|
|
38
|
-
Mongoose Error Code: ${t.code}`:""}`})}function NK(e,t,n,r=void 0){n&&(0,KN.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&DBe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function V0t(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(NK(t,o,n,r),o)).catch(o=>{throw BBe(t,o),o}).finally(()=>t.end()):(NK(t,e,n,r),t.end(),e)}z_.handlePromiseResponse=V0t;function q0t(e,t,n,r,o,i,a=void 0){let c=0;return o.length===2?c=1:o.length===3&&(c=2),o[c]=(d,m)=>(d?BBe(r,d):NK(r,m,i,a),r.end(),e(d,m)),t.apply(n,o)}z_.handleCallbackResponse=q0t});var OBe=F(Iv=>{"use strict";A();Object.defineProperty(Iv,"__esModule",{value:!0});Iv.PACKAGE_NAME=Iv.PACKAGE_VERSION=void 0;Iv.PACKAGE_VERSION="0.60.0";Iv.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var UBe=F(kc=>{"use strict";A();Object.defineProperty(kc,"__esModule",{value:!0});kc.MongooseInstrumentation=kc._ALREADY_INSTRUMENTED=kc._STORED_PARENT_SPAN=void 0;var Ta=(Ge(),ke(Ze)),Y0t=Tr(),OK=NBe(),Ds=tn(),wBe=OBe(),H_=BK(),dy=(Kn(),ke(Ur)),oF=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],K0t=["remove","count","findOneAndRemove",...oF],J0t=["count","findOneAndRemove",...oF],Z0t=[...oF];function MBe(e){return e?e.startsWith("6.")||e.startsWith("5.")?K0t:e.startsWith("7.")?J0t:Z0t:oF}function kBe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function PBe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}kc._STORED_PARENT_SPAN=Symbol("stored-parent-span");kc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var wK=class extends Ds.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(wBe.PACKAGE_NAME,wBe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ds.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ds.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Ds.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,kBe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),PBe(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),MBe(n).forEach(i=>{this._wrap(r.Query.prototype,i,this.patchAndCaptureSpanContext(i))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t,o=MBe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,kBe(n)&&this._unwrap(r.Model.prototype,"remove"),PBe(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(i=>{this._unwrap(r.Query.prototype,i)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(t){let n=this;return r=>function(i){if(n.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return r.apply(this,arguments);let a=this[kc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=n.getConfig();if(d){let h=d("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Ds.SemconvStability.OLD&&(c[H_.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ds.SemconvStability.STABLE&&(c[dy.ATTR_DB_QUERY_TEXT]=h)}let m=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",c,a);return n._handleResponse(m,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[kc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return r.apply(this,arguments);let a=this[kc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=n.getConfig();if(d){let h=d(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Ds.SemconvStability.OLD&&(c[H_.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ds.SemconvStability.STABLE&&(c[dy.ATTR_DB_QUERY_TEXT]=h)}let m=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,c,a);return n._handleResponse(m,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(a,c){if(r.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return o.apply(this,arguments);let d={document:this};a&&!(a instanceof Function)&&(d.options=a);let m={},{dbStatementSerializer:h}=r.getConfig();if(h){let y=h(t,d);r._dbSemconvStability&Ds.SemconvStability.OLD&&(m[H_.ATTR_DB_STATEMENT]=y),r._dbSemconvStability&Ds.SemconvStability.STABLE&&(m[dy.ATTR_DB_QUERY_TEXT]=y)}let S=r._startSpan(this.constructor.collection,this.constructor.modelName,t,m);return a instanceof Function&&(c=a,a=void 0),r._handleResponse(S,o,this,arguments,c,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(a,c,d){if(r.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return o.apply(this,arguments);let m=d,h=a,S=c;typeof a=="function"?(m=a,h=void 0,S=void 0):typeof c=="function"&&(m=c,S=void 0);let y={},I=r.getConfig().dbStatementSerializer;if(I){let N=I(t,{condition:{_id:this._id},updates:h,options:S});r._dbSemconvStability&Ds.SemconvStability.OLD&&(y[H_.ATTR_DB_STATEMENT]=N),r._dbSemconvStability&Ds.SemconvStability.STABLE&&(y[dy.ATTR_DB_QUERY_TEXT]=N)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,y),x=r._handleResponse(v,o,this,arguments,m,n);return x&&typeof x=="object"&&(x[kc._ALREADY_INSTRUMENTED]=!0),x}}patchModelStatic(t,n){let r=this;return o=>function(a,c,d){if(r.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return o.apply(this,arguments);typeof c=="function"&&(d=c,c=void 0);let m={};switch(t){case"insertMany":m.documents=a;break;case"bulkWrite":m.operations=a;break;default:m.document=a;break}c!==void 0&&(m.options=c);let h={},{dbStatementSerializer:S}=r.getConfig();if(S){let I=S(t,m);r._dbSemconvStability&Ds.SemconvStability.OLD&&(h[H_.ATTR_DB_STATEMENT]=I),r._dbSemconvStability&Ds.SemconvStability.STABLE&&(h[dy.ATTR_DB_QUERY_TEXT]=I)}let y=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(y,o,this,arguments,d,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=Ta.trace.getSpan(Ta.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[kc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[kc._STORED_PARENT_SPAN]=Ta.trace.getSpan(Ta.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let a={...o,...(0,OK.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Ds.SemconvStability.OLD&&(a[H_.ATTR_DB_OPERATION]=r,a[H_.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Ds.SemconvStability.STABLE&&(a[dy.ATTR_DB_OPERATION_NAME]=r,a[dy.ATTR_DB_SYSTEM_NAME]=H_.DB_SYSTEM_NAME_VALUE_MONGODB);let c=this._dbSemconvStability&Ds.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(c,{kind:Ta.SpanKind.CLIENT,attributes:a},i?Ta.trace.setSpan(Ta.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,a=void 0){let c=this;if(i instanceof Function)return c._callOriginalFunction(()=>(0,OK.handleCallbackResponse)(i,n,r,t,o,c.getConfig().responseHook,a));{let d=c._callOriginalFunction(()=>n.apply(r,o));return(0,OK.handlePromiseResponse)(d,t,c.getConfig().responseHook,a)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Ta.context.with((0,Y0t.suppressTracing)(Ta.context.active()),t):t()}};kc.MongooseInstrumentation=wK});var LBe=F(iF=>{"use strict";A();Object.defineProperty(iF,"__esModule",{value:!0});iF.MongooseInstrumentation=void 0;var W0t=UBe();Object.defineProperty(iF,"MongooseInstrumentation",{enumerable:!0,get:function(){return W0t.MongooseInstrumentation}})});var QBe,FBe,GBe,X0t,jBe,zBe=O(()=>{A();QBe=ie(LBe(),1);fr();FBe="Mongoose",GBe=at(FBe,()=>new QBe.MongooseInstrumentation({responseHook(e){Lr(e,"auto.db.otel.mongoose")}})),X0t=()=>({name:FBe,setupOnce(){GBe()}}),jBe=X0t});var HBe=F(Wi=>{"use strict";A();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Wi.DB_SYSTEM_VALUE_MYSQL=Wi.ATTR_NET_PEER_PORT=Wi.ATTR_NET_PEER_NAME=Wi.ATTR_DB_USER=Wi.ATTR_DB_SYSTEM=Wi.ATTR_DB_STATEMENT=Wi.ATTR_DB_NAME=Wi.ATTR_DB_CONNECTION_STRING=void 0;Wi.ATTR_DB_CONNECTION_STRING="db.connection_string";Wi.ATTR_DB_NAME="db.name";Wi.ATTR_DB_STATEMENT="db.statement";Wi.ATTR_DB_SYSTEM="db.system";Wi.ATTR_DB_USER="db.user";Wi.ATTR_NET_PEER_NAME="net.peer.name";Wi.ATTR_NET_PEER_PORT="net.peer.port";Wi.DB_SYSTEM_VALUE_MYSQL="mysql";Wi.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var $Be=F(JN=>{"use strict";A();Object.defineProperty(JN,"__esModule",{value:!0});JN.AttributeNames=void 0;var eSt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(eSt=JN.AttributeNames||(JN.AttributeNames={}))});var VBe=F(ru=>{"use strict";A();Object.defineProperty(ru,"__esModule",{value:!0});ru.getPoolNameOld=ru.arrayStringifyHelper=ru.getSpanName=ru.getDbValues=ru.getDbQueryText=ru.getJDBCString=ru.getConfig=void 0;function tSt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}ru.getConfig=tSt;function nSt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}ru.getJDBCString=nSt;function rSt(e){return typeof e=="string"?e:e.sql}ru.getDbQueryText=rSt;function oSt(e,t){return MK(typeof e=="string"?t:t||e.values)}ru.getDbValues=oSt;function iSt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}ru.getSpanName=iSt;function MK(e){return e?`[${e.toString()}]`:""}ru.arrayStringifyHelper=MK;function aSt(e){let t=e.config.connectionConfig,n="";return n+=t.host?`host: '${t.host}', `:"",n+=t.port?`port: ${t.port}, `:"",n+=t.database?`database: '${t.database}', `:"",n+=t.user?`user: '${t.user}'`:"",t.user||(n=n.substring(0,n.length-2)),n.trim()}ru.getPoolNameOld=aSt});var qBe=F(bv=>{"use strict";A();Object.defineProperty(bv,"__esModule",{value:!0});bv.PACKAGE_NAME=bv.PACKAGE_VERSION=void 0;bv.PACKAGE_VERSION="0.60.0";bv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var KBe=F(aF=>{"use strict";A();Object.defineProperty(aF,"__esModule",{value:!0});aF.MySQLInstrumentation=void 0;var Pc=(Ge(),ke(Ze)),jd=tn(),vv=(Kn(),ke(Ur)),xg=HBe(),sSt=$Be(),py=VBe(),YBe=qBe(),kK=class extends jd.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(YBe.PACKAGE_NAME,YBe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,jd.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,jd.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(xg.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsageOld?.add(t,{state:r,name:n})}init(){return[new jd.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,jd.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,jd.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,jd.isWrapped)(t.createPoolCluster)&&this._unwrap(t,"createPoolCluster"),this._wrap(t,"createPoolCluster",this._patchCreatePoolCluster()),t),t=>{t!==void 0&&(this._unwrap(t,"createConnection"),this._unwrap(t,"createPool"),this._unwrap(t,"createPoolCluster"))})]}_patchCreateConnection(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),i}}}_patchCreatePool(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"end",n._patchPoolEnd(i)),n._setPoolCallbacks(i,""),i}}}_patchPoolEnd(t){return n=>{let r=this;return function(i){let a=t._allConnections.length,c=t._freeConnections.length,d=a-c,m=(0,py.getPoolNameOld)(t);r._connCountAdd(-d,m,"used"),r._connCountAdd(-c,m,"idle"),n.apply(t,arguments)}}}_patchCreatePoolCluster(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"add",n._patchAdd(i)),i}}}_patchAdd(t){return n=>{let r=this;return function(i,a){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let c=t._nodes;if(c){let d=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),m=c[d].pool;r._setPoolCallbacks(m,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,a,c){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let d=r._getConnectionCallbackPatchFn(i);return n.call(t,d)}if(arguments.length===2&&typeof a=="function"){let d=r._getConnectionCallbackPatchFn(a);return n.call(t,i,d)}if(arguments.length===3&&typeof c=="function"){let d=r._getConnectionCallbackPatchFn(c);return n.call(t,i,a,d)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=Pc.context.active();return function(o,i){i&&((0,jd.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&Pc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,a){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let c={},{host:d,port:m,database:h,user:S}=(0,py.getConfig)(t.config),y=parseInt(m,10),I=(0,py.getDbQueryText)(o);r._dbSemconvStability&jd.SemconvStability.OLD&&(c[xg.ATTR_DB_SYSTEM]=xg.DB_SYSTEM_VALUE_MYSQL,c[xg.ATTR_DB_CONNECTION_STRING]=(0,py.getJDBCString)(d,m,h),c[xg.ATTR_DB_NAME]=h,c[xg.ATTR_DB_USER]=S,c[xg.ATTR_DB_STATEMENT]=I),r._dbSemconvStability&jd.SemconvStability.STABLE&&(c[vv.ATTR_DB_SYSTEM_NAME]=vv.DB_SYSTEM_NAME_VALUE_MYSQL,c[vv.ATTR_DB_NAMESPACE]=h,c[vv.ATTR_DB_QUERY_TEXT]=I),r._netSemconvStability&jd.SemconvStability.OLD&&(c[xg.ATTR_NET_PEER_NAME]=d,isNaN(y)||(c[xg.ATTR_NET_PEER_PORT]=y)),r._netSemconvStability&jd.SemconvStability.STABLE&&(c[vv.ATTR_SERVER_ADDRESS]=d,isNaN(y)||(c[vv.ATTR_SERVER_PORT]=y));let v=r.tracer.startSpan((0,py.getSpanName)(o),{kind:Pc.SpanKind.CLIENT,attributes:c});if(r.getConfig().enhancedDatabaseReporting){let M;Array.isArray(i)?M=i:arguments[2]&&(M=[i]),v.setAttribute(sSt.AttributeNames.MYSQL_VALUES,(0,py.getDbValues)(o,M))}let x=Array.from(arguments).findIndex(M=>typeof M=="function"),N=Pc.context.active();if(x===-1){let M=Pc.context.with(Pc.trace.setSpan(Pc.context.active(),v),()=>n.apply(t,arguments));return Pc.context.bind(N,M),M.on("error",Q=>v.setStatus({code:Pc.SpanStatusCode.ERROR,message:Q.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,x,r._patchCallbackQuery(v,N)),Pc.context.with(Pc.trace.setSpan(Pc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,a){return o&&t.setStatus({code:Pc.SpanStatusCode.ERROR,message:o.message}),t.end(),Pc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,py.getPoolNameOld)(t);t.on("connection",o=>{this._connCountAdd(1,r,"idle")}),t.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),t.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};aF.MySQLInstrumentation=kK});var JBe=F(sF=>{"use strict";A();Object.defineProperty(sF,"__esModule",{value:!0});sF.MySQLInstrumentation=void 0;var uSt=KBe();Object.defineProperty(sF,"MySQLInstrumentation",{enumerable:!0,get:function(){return uSt.MySQLInstrumentation}})});var ZBe,WBe,XBe,cSt,eNe,tNe=O(()=>{A();ZBe=ie(JBe(),1);fr();WBe="Mysql",XBe=at(WBe,()=>new ZBe.MySQLInstrumentation({})),cSt=()=>({name:WBe,setupOnce(){XBe()}}),eNe=cSt});var PK=F(Xa=>{"use strict";A();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.DB_SYSTEM_VALUE_MYSQL=Xa.ATTR_NET_PEER_PORT=Xa.ATTR_NET_PEER_NAME=Xa.ATTR_DB_USER=Xa.ATTR_DB_SYSTEM=Xa.ATTR_DB_STATEMENT=Xa.ATTR_DB_NAME=Xa.ATTR_DB_CONNECTION_STRING=void 0;Xa.ATTR_DB_CONNECTION_STRING="db.connection_string";Xa.ATTR_DB_NAME="db.name";Xa.ATTR_DB_STATEMENT="db.statement";Xa.ATTR_DB_SYSTEM="db.system";Xa.ATTR_DB_USER="db.user";Xa.ATTR_NET_PEER_NAME="net.peer.name";Xa.ATTR_NET_PEER_PORT="net.peer.port";Xa.DB_SYSTEM_VALUE_MYSQL="mysql"});var LK=F(uF=>{"use strict";A();Object.defineProperty(uF,"__esModule",{value:!0});uF.addSqlCommenterComment=void 0;var UK=(Ge(),ke(Ze)),lSt=Tr();function dSt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function pSt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function fSt(e,t){if(typeof t!="string"||t.length===0||dSt(t))return t;let n=new lSt.W3CTraceContextPropagator,r={};n.inject(UK.trace.setSpan(UK.ROOT_CONTEXT,e),r,UK.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(a=>{let c=pSt(r[a]);return`${a}='${c}'`}).join(",");return`${t} /*${i}*/`}uF.addSqlCommenterComment=fSt});var nNe=F(zd=>{"use strict";A();Object.defineProperty(zd,"__esModule",{value:!0});zd.getConnectionPrototypeToInstrument=zd.once=zd.getSpanName=zd.getQueryText=zd.getConnectionAttributes=void 0;var ZN=PK(),cF=tn(),QK=(Kn(),ke(Ur));function ASt(e,t,n){let{host:r,port:o,database:i,user:a}=mSt(e),c={};t&cF.SemconvStability.OLD&&(c[ZN.ATTR_DB_CONNECTION_STRING]=gSt(r,o,i),c[ZN.ATTR_DB_NAME]=i,c[ZN.ATTR_DB_USER]=a),t&cF.SemconvStability.STABLE&&(c[QK.ATTR_DB_NAMESPACE]=i);let d=parseInt(o,10);return n&cF.SemconvStability.OLD&&(c[ZN.ATTR_NET_PEER_NAME]=r,isNaN(d)||(c[ZN.ATTR_NET_PEER_PORT]=d)),n&cF.SemconvStability.STABLE&&(c[QK.ATTR_SERVER_ADDRESS]=r,isNaN(d)||(c[QK.ATTR_SERVER_PORT]=d)),c}zd.getConnectionAttributes=ASt;function mSt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function gSt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function hSt(e,t,n,r=!1,o=_St){let[i,a]=typeof e=="string"?[e,n]:[e.sql,ESt(e)?n||e.values:n];try{return r?o(i):t&&a?t(i,a):i}catch{return"Could not determine the query due to an error in masking or formatting"}}zd.getQueryText=hSt;function _St(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function ESt(e){return"values"in e}function SSt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}zd.getSpanName=SSt;var ySt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};zd.once=ySt;function TSt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}zd.getConnectionPrototypeToInstrument=TSt});var rNe=F(Rv=>{"use strict";A();Object.defineProperty(Rv,"__esModule",{value:!0});Rv.PACKAGE_NAME=Rv.PACKAGE_VERSION=void 0;Rv.PACKAGE_VERSION="0.60.0";Rv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var sNe=F(lF=>{"use strict";A();Object.defineProperty(lF,"__esModule",{value:!0});lF.MySQL2Instrumentation=void 0;var oNe=(Ge(),ke(Ze)),of=tn(),FK=PK(),iNe=LK(),xv=nNe(),aNe=rNe(),GK=(Kn(),ke(Ur)),jK=[">=1.4.2 <4"],zK=class extends of.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(aNe.PACKAGE_NAME,aNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,of.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,of.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let t;function n(i){!t&&i.format&&(t=i.format)}let r=i=>{(0,of.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,of.isWrapped)(i.execute)&&this._unwrap(i,"execute"),this._wrap(i,"execute",this._patchQuery(t,!0))},o=i=>{this._unwrap(i,"query"),this._unwrap(i,"execute")};return[new of.InstrumentationNodeModuleDefinition("mysql2",jK,i=>(n(i),i),()=>{},[new of.InstrumentationNodeModuleFile("mysql2/promise.js",jK,i=>(n(i),i),()=>{}),new of.InstrumentationNodeModuleFile("mysql2/lib/connection.js",jK,i=>{let a=(0,xv.getConnectionPrototypeToInstrument)(i);return r(a),i},i=>{if(i===void 0)return;let a=(0,xv.getConnectionPrototypeToInstrument)(i);o(a)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,a,c){let d;Array.isArray(a)?d=a:arguments[2]&&(d=[a]);let{maskStatement:m,maskStatementHook:h,responseHook:S}=o.getConfig(),y=(0,xv.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),I=(0,xv.getQueryText)(i,t,d,m,h);o._dbSemconvStability&of.SemconvStability.OLD&&(y[FK.ATTR_DB_SYSTEM]=FK.DB_SYSTEM_VALUE_MYSQL,y[FK.ATTR_DB_STATEMENT]=I),o._dbSemconvStability&of.SemconvStability.STABLE&&(y[GK.ATTR_DB_SYSTEM_NAME]=GK.DB_SYSTEM_NAME_VALUE_MYSQL,y[GK.ATTR_DB_QUERY_TEXT]=I);let v=o.tracer.startSpan((0,xv.getSpanName)(i),{kind:oNe.SpanKind.CLIENT,attributes:y});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,iNe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,iNe.addSqlCommenterComment)(v,i.sql)}));let x=(0,xv.once)((N,M)=>{N?v.setStatus({code:oNe.SpanStatusCode.ERROR,message:N.message}):typeof S=="function"&&(0,of.safeExecuteInTheMiddle)(()=>{S(v,{queryResults:M})},Q=>{Q&&o._diag.warn("Failed executing responseHook",Q)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(x));let N=r.apply(this,arguments);return N.once("error",M=>{x(M)}).once("result",M=>{x(void 0,M)}),N}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(x)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(x)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};lF.MySQL2Instrumentation=zK});var uNe=F(dF=>{"use strict";A();Object.defineProperty(dF,"__esModule",{value:!0});dF.MySQL2Instrumentation=void 0;var CSt=sNe();Object.defineProperty(dF,"MySQL2Instrumentation",{enumerable:!0,get:function(){return CSt.MySQL2Instrumentation}})});var cNe,lNe,dNe,ISt,pNe,fNe=O(()=>{A();cNe=ie(uNe(),1);fr();lNe="Mysql2",dNe=at(lNe,()=>new cNe.MySQL2Instrumentation({responseHook(e){Lr(e,"auto.db.otel.mysql2")}})),ISt=()=>({name:lNe,setupOnce(){dNe()}}),pNe=ISt});var ANe=F(ou=>{"use strict";A();Object.defineProperty(ou,"__esModule",{value:!0});ou.DB_SYSTEM_VALUE_REDIS=ou.DB_SYSTEM_NAME_VALUE_REDIS=ou.ATTR_NET_PEER_PORT=ou.ATTR_NET_PEER_NAME=ou.ATTR_DB_SYSTEM=ou.ATTR_DB_STATEMENT=ou.ATTR_DB_CONNECTION_STRING=void 0;ou.ATTR_DB_CONNECTION_STRING="db.connection_string";ou.ATTR_DB_STATEMENT="db.statement";ou.ATTR_DB_SYSTEM="db.system";ou.ATTR_NET_PEER_NAME="net.peer.name";ou.ATTR_NET_PEER_PORT="net.peer.port";ou.DB_SYSTEM_NAME_VALUE_REDIS="redis";ou.DB_SYSTEM_VALUE_REDIS="redis"});var mNe=F(pF=>{"use strict";A();Object.defineProperty(pF,"__esModule",{value:!0});pF.endSpan=void 0;var bSt=(Ge(),ke(Ze)),vSt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:bSt.SpanStatusCode.ERROR,message:t.message})),e.end()};pF.endSpan=vSt});var AF=F(fF=>{"use strict";A();Object.defineProperty(fF,"__esModule",{value:!0});fF.defaultDbStatementSerializer=void 0;var RSt=[{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}],xSt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=RSt.find(({regex:o})=>o.test(e))?.args??0,r=n>=0?t.slice(0,n):t;return t.length>r.length&&r.push(`[${t.length-n} other arguments]`),`${e} ${r.join(" ")}`}return e};fF.defaultDbStatementSerializer=xSt});var gNe=F(Dv=>{"use strict";A();Object.defineProperty(Dv,"__esModule",{value:!0});Dv.PACKAGE_NAME=Dv.PACKAGE_VERSION=void 0;Dv.PACKAGE_VERSION="0.62.0";Dv.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var SNe=F(mF=>{"use strict";A();Object.defineProperty(mF,"__esModule",{value:!0});mF.IORedisInstrumentation=void 0;var $_=(Ge(),ke(Ze)),Uc=tn(),V_=(Kn(),ke(Ur)),Lc=ANe(),hNe=tn(),WN=mNe(),DSt=AF(),_Ne=gNe(),ENe={requireParentSpan:!0},HK=class extends Uc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(_Ne.PACKAGE_NAME,_Ne.PACKAGE_VERSION,{...ENe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Uc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Uc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...ENe,...t})}init(){return[new Uc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Uc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Uc.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(t){return n=>this._traceSendCommand(n,t)}_patchConnection(){return t=>this._traceConnection(t)}_traceSendCommand(t,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return t.apply(this,arguments);let i=r.getConfig(),a=i.dbStatementSerializer||DSt.defaultDbStatementSerializer,c=$_.trace.getSpan($_.context.active())===void 0;if(i.requireParentSpan===!0&&c)return t.apply(this,arguments);let d={},{host:m,port:h}=this.options,S=a(o.name,o.args);r._dbSemconvStability&Uc.SemconvStability.OLD&&(d[Lc.ATTR_DB_SYSTEM]=Lc.DB_SYSTEM_VALUE_REDIS,d[Lc.ATTR_DB_STATEMENT]=S,d[Lc.ATTR_DB_CONNECTION_STRING]=`redis://${m}:${h}`),r._dbSemconvStability&Uc.SemconvStability.STABLE&&(d[V_.ATTR_DB_SYSTEM_NAME]=Lc.DB_SYSTEM_NAME_VALUE_REDIS,d[V_.ATTR_DB_QUERY_TEXT]=S),r._netSemconvStability&Uc.SemconvStability.OLD&&(d[Lc.ATTR_NET_PEER_NAME]=m,d[Lc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Uc.SemconvStability.STABLE&&(d[V_.ATTR_SERVER_ADDRESS]=m,d[V_.ATTR_SERVER_PORT]=h);let y=r.tracer.startSpan(o.name,{kind:$_.SpanKind.CLIENT,attributes:d}),{requestHook:I}=i;I&&(0,hNe.safeExecuteInTheMiddle)(()=>I(y,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&$_.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),x=o.resolve;o.resolve=function(M){(0,hNe.safeExecuteInTheMiddle)(()=>i.responseHook?.(y,o.name,o.args,M),Q=>{Q&&$_.diag.error("ioredis instrumentation: response hook failed",Q)},!0),(0,WN.endSpan)(y,null),x(M)};let N=o.reject;return o.reject=function(M){(0,WN.endSpan)(y,M),N(M)},v}catch(v){throw(0,WN.endSpan)(y,v),v}}}_traceConnection(t){let n=this;return function(){let r=$_.trace.getSpan($_.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:a}=this.options;n._dbSemconvStability&Uc.SemconvStability.OLD&&(o[Lc.ATTR_DB_SYSTEM]=Lc.DB_SYSTEM_VALUE_REDIS,o[Lc.ATTR_DB_STATEMENT]="connect",o[Lc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${a}`),n._dbSemconvStability&Uc.SemconvStability.STABLE&&(o[V_.ATTR_DB_SYSTEM_NAME]=Lc.DB_SYSTEM_NAME_VALUE_REDIS,o[V_.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Uc.SemconvStability.OLD&&(o[Lc.ATTR_NET_PEER_NAME]=i,o[Lc.ATTR_NET_PEER_PORT]=a),n._netSemconvStability&Uc.SemconvStability.STABLE&&(o[V_.ATTR_SERVER_ADDRESS]=i,o[V_.ATTR_SERVER_PORT]=a);let c=n.tracer.startSpan("connect",{kind:$_.SpanKind.CLIENT,attributes:o});try{let d=t.apply(this,arguments);return(0,WN.endSpan)(c,null),d}catch(d){throw(0,WN.endSpan)(c,d),d}}}};mF.IORedisInstrumentation=HK});var yNe=F(gF=>{"use strict";A();Object.defineProperty(gF,"__esModule",{value:!0});gF.IORedisInstrumentation=void 0;var BSt=SNe();Object.defineProperty(gF,"IORedisInstrumentation",{enumerable:!0,get:function(){return BSt.IORedisInstrumentation}})});var hF=F(Bv=>{"use strict";A();Object.defineProperty(Bv,"__esModule",{value:!0});Bv.PACKAGE_NAME=Bv.PACKAGE_VERSION=void 0;Bv.PACKAGE_VERSION="0.62.0";Bv.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var TNe=F(q_=>{"use strict";A();Object.defineProperty(q_,"__esModule",{value:!0});q_.getTracedCreateStreamTrace=q_.getTracedCreateClient=q_.endSpan=void 0;var XN=(Ge(),ke(Ze)),NSt=(e,t)=>{t&&e.setStatus({code:XN.SpanStatusCode.ERROR,message:t.message}),e.end()};q_.endSpan=NSt;var OSt=e=>function(){let n=e.apply(this,arguments);return XN.context.bind(XN.context.active(),n)};q_.getTracedCreateClient=OSt;var wSt=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){XN.context.bind(XN.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};q_.getTracedCreateStreamTrace=wSt});var _F=F(iu=>{"use strict";A();Object.defineProperty(iu,"__esModule",{value:!0});iu.DB_SYSTEM_VALUE_REDIS=iu.DB_SYSTEM_NAME_VALUE_REDIS=iu.ATTR_NET_PEER_PORT=iu.ATTR_NET_PEER_NAME=iu.ATTR_DB_SYSTEM=iu.ATTR_DB_STATEMENT=iu.ATTR_DB_CONNECTION_STRING=void 0;iu.ATTR_DB_CONNECTION_STRING="db.connection_string";iu.ATTR_DB_STATEMENT="db.statement";iu.ATTR_DB_SYSTEM="db.system";iu.ATTR_NET_PEER_NAME="net.peer.name";iu.ATTR_NET_PEER_PORT="net.peer.port";iu.DB_SYSTEM_NAME_VALUE_REDIS="redis";iu.DB_SYSTEM_VALUE_REDIS="redis"});var INe=F(SF=>{"use strict";A();Object.defineProperty(SF,"__esModule",{value:!0});SF.RedisInstrumentationV2_V3=void 0;var kl=tn(),EF=TNe(),CNe=hF(),eO=(Ge(),ke(Ze)),tO=(Kn(),ke(Ur)),fy=_F(),MSt=AF(),$K=class e extends kl.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(CNe.PACKAGE_NAME,CNe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,kl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,kl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new kl.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,kl.isWrapped)(t.RedisClient.prototype.internal_send_command)&&this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._wrap(t.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,kl.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,kl.isWrapped)(t.createClient)&&this._unwrap(t,"createClient"),this._wrap(t,"createClient",this._getPatchCreateClient()),t),t=>{t!==void 0&&(this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._unwrap(t.RedisClient.prototype,"create_stream"),this._unwrap(t,"createClient"))})]}_getPatchInternalSendCommand(){let t=this;return function(r){return function(i){if(arguments.length!==1||typeof i!="object")return r.apply(this,arguments);let a=t.getConfig(),c=eO.trace.getSpan(eO.context.active())===void 0;if(a.requireParentSpan===!0&&c)return r.apply(this,arguments);let d=a?.dbStatementSerializer||MSt.defaultDbStatementSerializer,m={};t._semconvStability&kl.SemconvStability.OLD&&Object.assign(m,{[fy.ATTR_DB_SYSTEM]:fy.DB_SYSTEM_VALUE_REDIS,[fy.ATTR_DB_STATEMENT]:d(i.command,i.args)}),t._semconvStability&kl.SemconvStability.STABLE&&Object.assign(m,{[tO.ATTR_DB_SYSTEM_NAME]:fy.DB_SYSTEM_NAME_VALUE_REDIS,[tO.ATTR_DB_OPERATION_NAME]:i.command,[tO.ATTR_DB_QUERY_TEXT]:d(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:eO.SpanKind.CLIENT,attributes:m});if(this.connection_options){let y={};t._semconvStability&kl.SemconvStability.OLD&&Object.assign(y,{[fy.ATTR_NET_PEER_NAME]:this.connection_options.host,[fy.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&kl.SemconvStability.STABLE&&Object.assign(y,{[tO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[tO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(y)}this.address&&t._semconvStability&kl.SemconvStability.OLD&&h.setAttribute(fy.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let S=arguments[0].callback;if(S){let y=eO.context.active();arguments[0].callback=function(v,x){if(a?.responseHook){let N=a.responseHook;(0,kl.safeExecuteInTheMiddle)(()=>{N(h,i.command,i.args,x)},M=>{M&&t._diag.error("Error executing responseHook",M)},!0)}return(0,EF.endSpan)(h,v),eO.context.with(y,S,this,...arguments)}}try{return r.apply(this,arguments)}catch(y){throw(0,EF.endSpan)(h,y),y}}}}_getPatchCreateClient(){return function(n){return(0,EF.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,EF.getTracedCreateStreamTrace)(n)}}};SF.RedisInstrumentationV2_V3=$K});var vNe=F(yF=>{"use strict";A();Object.defineProperty(yF,"__esModule",{value:!0});yF.getClientAttributes=void 0;var VK=(Kn(),ke(Ur)),Nv=_F(),bNe=tn();function kSt(e,t,n){let r={};return n&bNe.SemconvStability.OLD&&Object.assign(r,{[Nv.ATTR_DB_SYSTEM]:Nv.DB_SYSTEM_VALUE_REDIS,[Nv.ATTR_NET_PEER_NAME]:t?.socket?.host,[Nv.ATTR_NET_PEER_PORT]:t?.socket?.port,[Nv.ATTR_DB_CONNECTION_STRING]:PSt(e,t?.url)}),n&bNe.SemconvStability.STABLE&&Object.assign(r,{[VK.ATTR_DB_SYSTEM_NAME]:Nv.DB_SYSTEM_NAME_VALUE_REDIS,[VK.ATTR_SERVER_ADDRESS]:t?.socket?.host,[VK.ATTR_SERVER_PORT]:t?.socket?.port}),r}yF.getClientAttributes=kSt;function PSt(e,t){if(!(typeof t!="string"||!t))try{let n=new URL(t);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){e.error("failed to sanitize redis connection url",n)}}});var BNe=F(TF=>{"use strict";A();Object.defineProperty(TF,"__esModule",{value:!0});TF.RedisInstrumentationV4_V5=void 0;var Hd=(Ge(),ke(Ze)),Eo=tn(),RNe=vNe(),USt=AF(),xNe=hF(),qK=(Kn(),ke(Ur)),LSt=_F(),nO=Symbol("opentelemetry.instrumentation.redis.open_spans"),DNe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),YK=class e extends Eo.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(xNe.PACKAGE_NAME,xNe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Eo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Eo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let n=new Eo.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,a)=>{let c=i.transformCommandArguments;if(!c)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let d=a?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Eo.isWrapped)(i?.[d])&&this._unwrap(i,d),this._wrap(i,d,this._getPatchExtendWithCommands(c)),i},i=>{(0,Eo.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Eo.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Eo.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let a=i?.default?.prototype;return(0,Eo.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),this._wrap(a,"exec",this._getPatchMultiCommandsExec(!1)),(0,Eo.isWrapped)(a?.execAsPipeline)&&this._unwrap(a,"execAsPipeline"),this._wrap(a,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Eo.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand"),this._wrap(a,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let a=i?.default?.prototype;(0,Eo.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),(0,Eo.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand")}),o=new Eo.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let a=i?.default?.prototype;return a?.multi&&((0,Eo.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),this._wrap(a,"multi",this._getPatchRedisClientMulti())),a?.MULTI&&((0,Eo.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),this._wrap(a,"MULTI",this._getPatchRedisClientMulti())),(0,Eo.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand"),this._wrap(a,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(a,"connect",this._getPatchedClientConnect()),i},i=>{let a=i?.default?.prototype;(0,Eo.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),(0,Eo.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),(0,Eo.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand")});return new Eo.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(a){if(a?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let c=a.executor;return a.executor=function(d,m){let h=t(d,m).args;return n._traceClientCommand(c,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let a=o.apply(this,arguments);return typeof a?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),a):a.then(c=>{let d=this[nO];return n._endSpansWithRedisReplies(d,c,t),c}).catch(c=>{let d=this[nO];if(!d)n._diag.error("cannot find open spans to end for multi/pipeline");else{let m=c.constructor.name==="MultiErrorReply"?c.replies:new Array(d.length).fill(c);n._endSpansWithRedisReplies(d,m,t)}return Promise.reject(c)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[DNe]=this.options,o}}}_getPatchRedisClientSendCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchedClientConnect(){let t=this;return function(r){return function(){let i=this.options,a=(0,RNe.getClientAttributes)(t._diag,i,t._semconvStability),c=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:Hd.SpanKind.CLIENT,attributes:a});return Hd.context.with(Hd.trace.setSpan(Hd.context.active(),c),()=>r.apply(this)).then(m=>(c.end(),m)).catch(m=>(c.recordException(m),c.setStatus({code:Hd.SpanStatusCode.ERROR,message:m.message}),c.end(),Promise.reject(m)))}}}_traceClientCommand(t,n,r,o){if(Hd.trace.getSpan(Hd.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let a=n.options||n[DNe],c=o[0],d=o.slice(1),m=this.getConfig().dbStatementSerializer||USt.defaultDbStatementSerializer,h=(0,RNe.getClientAttributes)(this._diag,a,this._semconvStability);this._semconvStability&Eo.SemconvStability.STABLE&&(h[qK.ATTR_DB_OPERATION_NAME]=c);try{let I=m(c,d);I!=null&&(this._semconvStability&Eo.SemconvStability.OLD&&(h[LSt.ATTR_DB_STATEMENT]=I),this._semconvStability&Eo.SemconvStability.STABLE&&(h[qK.ATTR_DB_QUERY_TEXT]=I))}catch(I){this._diag.error("dbStatementSerializer throw an exception",I,{commandName:c})}let S=this.tracer.startSpan(`${e.COMPONENT}-${c}`,{kind:Hd.SpanKind.CLIENT,attributes:h}),y=Hd.context.with(Hd.trace.setSpan(Hd.context.active(),S),()=>t.apply(n,r));if(typeof y?.then=="function")y.then(I=>{this._endSpanWithResponse(S,c,d,I,void 0)},I=>{this._endSpanWithResponse(S,c,d,null,I)});else{let I=y;I[nO]=I[nO]||[],I[nO].push({span:S,commandName:c,commandArgs:d})}return y}_endSpansWithRedisReplies(t,n,r=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let o=t.map(c=>c.commandName),a=o.every(c=>c===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let c=0;c<t.length;c++){let{span:d,commandArgs:m}=t[c],h=n[c],[S,y]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Eo.SemconvStability.STABLE&&d.setAttribute(qK.ATTR_DB_OPERATION_NAME,a),this._endSpanWithResponse(d,o[c],m,S,y)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:a}=this.getConfig();if(!i&&a)try{a(t,n,r,o)}catch(c){this._diag.error("responseHook throw an exception",c)}i&&(t.recordException(i),t.setStatus({code:Hd.SpanStatusCode.ERROR,message:i?.message})),t.end()}};TF.RedisInstrumentationV4_V5=YK});var wNe=F(CF=>{"use strict";A();Object.defineProperty(CF,"__esModule",{value:!0});CF.RedisInstrumentation=void 0;var QSt=tn(),NNe=hF(),FSt=INe(),GSt=BNe(),ONe={requireParentSpan:!1},KK=class extends QSt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...ONe,...t};super(NNe.PACKAGE_NAME,NNe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new FSt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new GSt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...ONe,...t};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(t){super.setTracerProvider(t),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(t),this.instrumentationV4_V5.setTracerProvider(t))}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())}};CF.RedisInstrumentation=KK});var MNe=F(IF=>{"use strict";A();Object.defineProperty(IF,"__esModule",{value:!0});IF.RedisInstrumentation=void 0;var jSt=wNe();Object.defineProperty(IF,"RedisInstrumentation",{enumerable:!0,get:function(){return jSt.RedisInstrumentation}})});function rO(e,t){return e.includes(t.toLowerCase())}function ZK(e){return rO(JK,e)?"cache.get":rO(HSt,e)?"cache.put":void 0}function $St(e,t){return t.some(n=>e.startsWith(n))}function PNe(e,t){try{if(t.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?kNe(o.map(i=>n(i))):["<unknown>"],r=t[0];return rO(zSt,e)&&r!=null?n(r):kNe(t.map(o=>n(o)))}catch{return}}function UNe(e,t,n){if(!ZK(e))return!1;for(let r of t)if($St(r,n))return!0;return!1}function LNe(e){let t=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(e)?e.reduce((n,r)=>{let o=t(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):t(e)}function kNe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var zSt,JK,HSt,QNe=O(()=>{A();zSt=["get","set","setex"],JK=["get","mget"],HSt=["set","setex"]});var FNe,GNe,bF,oO,jNe,VSt,qSt,zNe,YSt,HNe,$Ne=O(()=>{A();FNe=ie(yNe(),1),GNe=ie(MNe(),1);dt();fr();QNe();bF="Redis",oO={},jNe=(e,t,n,r)=>{e.setAttribute(Mt,"auto.db.otel.redis");let o=PNe(t,n),i=ZK(t);if(!o||!i||!oO.cachePrefixes||!UNe(t,o,oO.cachePrefixes))return;let a=Nt(e).data["net.peer.name"],c=Nt(e).data["net.peer.port"];c&&a&&e.setAttributes({"network.peer.address":a,"network.peer.port":c});let d=LNe(r);d&&e.setAttribute(tV,d),rO(JK,t)&&d!==void 0&&e.setAttribute(X9,d>0),e.setAttributes({[Zt]:i,[eV]:o});let m=o.join(", ");e.updateName(oO.maxCacheKeyLength?u_(m,oO.maxCacheKeyLength):m)},VSt=at(`${bF}.IORedis`,()=>new FNe.IORedisInstrumentation({responseHook:jNe})),qSt=at(`${bF}.Redis`,()=>new GNe.RedisInstrumentation({responseHook:jNe})),zNe=Object.assign(()=>{VSt(),qSt()},{id:bF}),YSt=(e={})=>({name:bF,setupOnce(){oO=e,zNe()}}),HNe=YSt});var VNe=F(vF=>{"use strict";A();Object.defineProperty(vF,"__esModule",{value:!0});vF.EVENT_LISTENERS_SET=void 0;vF.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var WK=F(iO=>{"use strict";A();Object.defineProperty(iO,"__esModule",{value:!0});iO.AttributeNames=void 0;var KSt;(function(e){e.PG_VALUES="db.postgresql.values",e.PG_PLAN="db.postgresql.plan",e.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",e.MAX_CLIENT="db.postgresql.max.client"})(KSt=iO.AttributeNames||(iO.AttributeNames={}))});var XK=F(xr=>{"use strict";A();Object.defineProperty(xr,"__esModule",{value:!0});xr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=xr.METRIC_DB_CLIENT_CONNECTION_COUNT=xr.DB_SYSTEM_VALUE_POSTGRESQL=xr.DB_CLIENT_CONNECTION_STATE_VALUE_USED=xr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=xr.ATTR_NET_PEER_PORT=xr.ATTR_NET_PEER_NAME=xr.ATTR_DB_USER=xr.ATTR_DB_SYSTEM=xr.ATTR_DB_STATEMENT=xr.ATTR_DB_NAME=xr.ATTR_DB_CONNECTION_STRING=xr.ATTR_DB_CLIENT_CONNECTION_STATE=xr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;xr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";xr.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";xr.ATTR_DB_CONNECTION_STRING="db.connection_string";xr.ATTR_DB_NAME="db.name";xr.ATTR_DB_STATEMENT="db.statement";xr.ATTR_DB_SYSTEM="db.system";xr.ATTR_DB_USER="db.user";xr.ATTR_NET_PEER_NAME="net.peer.name";xr.ATTR_NET_PEER_PORT="net.peer.port";xr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";xr.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";xr.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";xr.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";xr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var eJ=F(aO=>{"use strict";A();Object.defineProperty(aO,"__esModule",{value:!0});aO.SpanNames=void 0;var JSt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(JSt=aO.SpanNames||(aO.SpanNames={}))});var XNe=F(nr=>{"use strict";A();Object.defineProperty(nr,"__esModule",{value:!0});nr.sanitizedErrorMessage=nr.isObjectWithTextString=nr.getErrorMessage=nr.patchClientConnectCallback=nr.patchCallbackPGPool=nr.updateCounter=nr.getPoolName=nr.patchCallback=nr.handleExecutionResult=nr.handleConfigQuery=nr.shouldSkipInstrumentation=nr.getSemanticAttributesFromPoolConnection=nr.getSemanticAttributesFromConnection=nr.getConnectionString=nr.parseAndMaskConnectionString=nr.parseNormalizedOperationName=nr.getQuerySpanName=void 0;var Y_=(Ge(),ke(Ze)),RF=WK(),$d=(Kn(),ke(Ur)),di=XK(),Ay=tn(),qNe=eJ();function YNe(e,t){if(!t)return qNe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:KNe(t.text);return`${qNe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}nr.getQuerySpanName=YNe;function KNe(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}nr.parseNormalizedOperationName=KNe;function JNe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}nr.parseAndMaskConnectionString=JNe;function tJ(e){if("connectionString"in e&&e.connectionString)return JNe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}nr.getConnectionString=tJ;function xF(e){if(Number.isInteger(e))return e}function ZNe(e,t){let n={};return t&Ay.SemconvStability.OLD&&(n={...n,[di.ATTR_DB_SYSTEM]:di.DB_SYSTEM_VALUE_POSTGRESQL,[di.ATTR_DB_NAME]:e.database,[di.ATTR_DB_CONNECTION_STRING]:tJ(e),[di.ATTR_DB_USER]:e.user,[di.ATTR_NET_PEER_NAME]:e.host,[di.ATTR_NET_PEER_PORT]:xF(e.port)}),t&Ay.SemconvStability.STABLE&&(n={...n,[$d.ATTR_DB_SYSTEM_NAME]:$d.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[$d.ATTR_DB_NAMESPACE]:e.namespace,[$d.ATTR_SERVER_ADDRESS]:e.host,[$d.ATTR_SERVER_PORT]:xF(e.port)}),n}nr.getSemanticAttributesFromConnection=ZNe;function ZSt(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[RF.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[RF.AttributeNames.MAX_CLIENT]:e.maxClient};return t&Ay.SemconvStability.OLD&&(r={...r,[di.ATTR_DB_SYSTEM]:di.DB_SYSTEM_VALUE_POSTGRESQL,[di.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[di.ATTR_DB_CONNECTION_STRING]:tJ(e),[di.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[di.ATTR_NET_PEER_PORT]:Number(n?.port)||xF(e.port),[di.ATTR_DB_USER]:n?.username??e.user}),t&Ay.SemconvStability.STABLE&&(r={...r,[$d.ATTR_DB_SYSTEM_NAME]:$d.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[$d.ATTR_DB_NAMESPACE]:e.namespace,[$d.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[$d.ATTR_SERVER_PORT]:Number(n?.port)||xF(e.port)}),r}nr.getSemanticAttributesFromPoolConnection=ZSt;function WSt(e){return e.requireParentSpan===!0&&Y_.trace.getSpan(Y_.context.active())===void 0}nr.shouldSkipInstrumentation=WSt;function XSt(e,t,n,r){let{connectionParameters:o}=this,i=o.database,a=YNe(i,r),c=e.startSpan(a,{kind:Y_.SpanKind.CLIENT,attributes:ZNe(o,n)});if(!r)return c;if(r.text&&(n&Ay.SemconvStability.OLD&&c.setAttribute(di.ATTR_DB_STATEMENT,r.text),n&Ay.SemconvStability.STABLE&&c.setAttribute($d.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let d=r.values.map(m=>m==null?"null":m instanceof Buffer?m.toString():typeof m=="object"?typeof m.toPostgres=="function"?m.toPostgres():JSON.stringify(m):m.toString());c.setAttribute(RF.AttributeNames.PG_VALUES,d)}catch(d){Y_.diag.error("failed to stringify ",r.values,d)}return typeof r.name=="string"&&c.setAttribute(RF.AttributeNames.PG_PLAN,r.name),c}nr.handleConfigQuery=XSt;function WNe(e,t,n){typeof e.responseHook=="function"&&(0,Ay.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&Y_.diag.error("Error running response hook",r)},!0)}nr.handleExecutionResult=WNe;function eyt(e,t,n,r,o){return function(a,c){a?(Object.prototype.hasOwnProperty.call(a,"code")&&(r[$d.ATTR_ERROR_TYPE]=a.code),a instanceof Error&&t.recordException(DF(a)),t.setStatus({code:Y_.SpanStatusCode.ERROR,message:a.message})):WNe(e,t,c),o(),t.end(),n.call(this,a,c)}}nr.patchCallback=eyt;function tyt(e){let t="";return t+=(e?.host?`${e.host}`:"unknown_host")+":",t+=(e?.port?`${e.port}`:"unknown_port")+"/",t+=e?.database?`${e.database}`:"unknown_database",t.trim()}nr.getPoolName=tyt;function nyt(e,t,n,r,o){let i=t.totalCount,a=t.waitingCount,c=t.idleCount,d=i-c;return n.add(d-o.used,{[di.ATTR_DB_CLIENT_CONNECTION_STATE]:di.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[di.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(c-o.idle,{[di.ATTR_DB_CLIENT_CONNECTION_STATE]:di.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[di.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(a-o.pending,{[di.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:d,idle:c,pending:a}}nr.updateCounter=nyt;function ryt(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(DF(r)),e.setStatus({code:Y_.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}nr.patchCallbackPGPool=ryt;function oyt(e,t){return function(r){r&&(r instanceof Error&&e.recordException(DF(r)),e.setStatus({code:Y_.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}nr.patchClientConnectCallback=oyt;function iyt(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}nr.getErrorMessage=iyt;function ayt(e){return typeof e=="object"&&typeof e?.text=="string"}nr.isObjectWithTextString=ayt;function DF(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}nr.sanitizedErrorMessage=DF});var eOe=F(Ov=>{"use strict";A();Object.defineProperty(Ov,"__esModule",{value:!0});Ov.PACKAGE_NAME=Ov.PACKAGE_VERSION=void 0;Ov.PACKAGE_VERSION="0.66.0";Ov.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var aOe=F(NF=>{"use strict";A();Object.defineProperty(NF,"__esModule",{value:!0});NF.PgInstrumentation=void 0;var ju=tn(),Fr=(Ge(),ke(Ze)),tOe=VNe(),Yo=XNe(),nOe=LK(),rOe=eOe(),oOe=eJ(),BF=Tr(),af=(Kn(),ke(Ur)),sO=XK();function wv(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var nJ=class extends ju.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(rOe.PACKAGE_NAME,rOe.PACKAGE_VERSION,t),this._semconvStability=(0,ju.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(af.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Fr.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(sO.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"}),this._connectionPendingRequests=this.meter.createUpDownCounter(sO.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let t=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new ju.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new ju.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new ju.InstrumentationNodeModuleDefinition("pg",t,c=>{let d=wv(c);return this._patchPgClient(d.Client),c},c=>{let d=wv(c);return this._unpatchPgClient(d.Client),c},[o,r]),a=new ju.InstrumentationNodeModuleDefinition("pg-pool",n,c=>{let d=wv(c);return(0,ju.isWrapped)(d.prototype.connect)&&this._unwrap(d.prototype,"connect"),this._wrap(d.prototype,"connect",this._getPoolConnectPatch()),d},c=>{let d=wv(c);(0,ju.isWrapped)(d.prototype.connect)&&this._unwrap(d.prototype,"connect")});return[i,a]}_patchPgClient(t){if(!t)return;let n=wv(t);return(0,ju.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,ju.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let n=wv(t);return(0,ju.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,ju.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Yo.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let a=t.tracer.startSpan(oOe.SpanNames.CONNECT,{kind:Fr.SpanKind.CLIENT,attributes:Yo.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let d=Fr.trace.getSpan(Fr.context.active());o=Yo.patchClientConnectCallback(a,o),d&&(o=Fr.context.bind(Fr.context.active(),o))}let c=Fr.context.with(Fr.trace.setSpan(Fr.context.active(),a),()=>n.call(this,o));return iOe(a,c)}}recordOperationDuration(t,n){let r={},o=[af.ATTR_DB_NAMESPACE,af.ATTR_ERROR_TYPE,af.ATTR_SERVER_PORT,af.ATTR_SERVER_ADDRESS,af.ATTR_DB_OPERATION_NAME];this._semconvStability&ju.SemconvStability.OLD&&o.push(sO.ATTR_DB_SYSTEM),this._semconvStability&ju.SemconvStability.STABLE&&o.push(af.ATTR_DB_SYSTEM_NAME),o.forEach(a=>{a in t&&(r[a]=t[a])});let i=(0,BF.hrTimeToMilliseconds)((0,BF.hrTimeDuration)(n,(0,BF.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(Yo.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,BF.hrTime)(),a=o[0],c=typeof a=="string",d=Yo.isObjectWithTextString(a),m=c?{text:a,values:Array.isArray(o[1])?o[1]:void 0}:d?{...a,name:a.name,text:a.text,values:a.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[sO.ATTR_DB_SYSTEM]:sO.DB_SYSTEM_VALUE_POSTGRESQL,[af.ATTR_DB_NAMESPACE]:this.database,[af.ATTR_SERVER_PORT]:this.connectionParameters.port,[af.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};m?.text&&(h[af.ATTR_DB_OPERATION_NAME]=Yo.parseNormalizedOperationName(m?.text));let S=()=>{t.recordOperationDuration(h,i)},y=t.getConfig(),I=Yo.handleConfigQuery.call(this,t.tracer,y,t._semconvStability,m);if(y.addSqlCommenterCommentToQueries&&(c?o[0]=(0,nOe.addSqlCommenterComment)(I,a):d&&!("name"in a)&&(o[0]={...a,text:(0,nOe.addSqlCommenterComment)(I,a.text)})),o.length>0){let N=Fr.trace.getSpan(Fr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=Yo.patchCallback(y,I,o[o.length-1],h,S),N&&(o[o.length-1]=Fr.context.bind(Fr.context.active(),o[o.length-1]));else if(typeof m?.callback=="function"){let M=Yo.patchCallback(t.getConfig(),I,m.callback,h,S);N&&(M=Fr.context.bind(Fr.context.active(),M)),o[0].callback=M}}let{requestHook:v}=y;typeof v=="function"&&m&&(0,ju.safeExecuteInTheMiddle)(()=>{let{database:N,host:M,port:Q,user:j}=this.connectionParameters;v(I,{connection:{database:N,host:M,port:Q,user:j},query:{text:m.text,values:m.values,name:m.name}})},N=>{N&&t._diag.error("Error running query hook",N)},!0);let x;try{x=n.apply(this,o)}catch(N){throw N instanceof Error&&I.recordException(Yo.sanitizedErrorMessage(N)),I.setStatus({code:Fr.SpanStatusCode.ERROR,message:Yo.getErrorMessage(N)}),I.end(),N}return x instanceof Promise?x.then(N=>new Promise(M=>{Yo.handleExecutionResult(t.getConfig(),I,N),S(),I.end(),M(N)})).catch(N=>new Promise((M,Q)=>{N instanceof Error&&I.recordException(Yo.sanitizedErrorMessage(N)),I.setStatus({code:Fr.SpanStatusCode.ERROR,message:N.message}),S(),I.end(),Q(N)})):x})}_setPoolConnectEventListeners(t){if(t[tOe.EVENT_LISTENERS_SET])return;let n=Yo.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=Yo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=Yo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=Yo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=Yo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[tOe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Yo.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let a=t.tracer.startSpan(oOe.SpanNames.POOL_CONNECT,{kind:Fr.SpanKind.CLIENT,attributes:Yo.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let d=Fr.trace.getSpan(Fr.context.active());o=Yo.patchCallbackPGPool(a,o),d&&(o=Fr.context.bind(Fr.context.active(),o))}let c=Fr.context.with(Fr.trace.setSpan(Fr.context.active(),a),()=>n.call(this,o));return iOe(a,c)}}};NF.PgInstrumentation=nJ;function iOe(e,t){if(!(t instanceof Promise))return t;let n=t;return Fr.context.bind(Fr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(Yo.sanitizedErrorMessage(r)),e.setStatus({code:Fr.SpanStatusCode.ERROR,message:Yo.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var sOe=F(Mv=>{"use strict";A();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.AttributeNames=Mv.PgInstrumentation=void 0;var syt=aOe();Object.defineProperty(Mv,"PgInstrumentation",{enumerable:!0,get:function(){return syt.PgInstrumentation}});var uyt=WK();Object.defineProperty(Mv,"AttributeNames",{enumerable:!0,get:function(){return uyt.AttributeNames}})});var uOe,cOe,lOe,cyt,dOe,pOe=O(()=>{A();uOe=ie(sOe(),1);fr();cOe="Postgres",lOe=at(cOe,uOe.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){Lr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),cyt=e=>({name:cOe,setupOnce(){lOe(e)}}),dOe=cyt});var K_,oJ,fOe,lyt,dyt,AOe,rJ,pyt,mOe,gOe=O(()=>{A();Ge();K_=ie(tn(),1);Kn();dt();fr();oy();oJ="PostgresJs",fOe=[">=3.0.0 <4"],lyt=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,dyt=Symbol.for("sentry.query.from.instrumented.sql"),AOe=at(oJ,e=>new rJ({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),rJ=class extends K_.InstrumentationBase{constructor(t){super("sentry-postgres-js",Jn,t)}init(){let t=new K_.InstrumentationNodeModuleDefinition("postgres",fOe,n=>{try{return this._patchPostgres(n)}catch(r){return Sa&&J.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new K_.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,fOe,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),t}_patchPostgres(t){let n=typeof t=="function",r=n?t:t.default;if(typeof r!="function")return Sa&&J.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...a){let c=Reflect.construct(r,a);if(!c||typeof c!="function")return Sa&&J.warn("postgres() did not return a valid instance"),c;let d=o.getConfig();return rq(c,{requireParentSpan:d.requireParentSpan,requestHook:d.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let a of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(a)){let c=Object.getOwnPropertyDescriptor(r,a);c&&Object.defineProperty(i,a,c)}return n?i:(nN(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return zt.getSpan(Ye.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(FI,r);return}let o=n?.match(lyt);o?.[1]&&t.setAttribute(FI,o[1].toUpperCase())}_reconstructQuery(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(t){return t?t.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(t){let n=this,r=t.Query.prototype.handle;return t.Query.prototype.handle=async function(...o){if(this[dyt])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),a=n._sanitizeSqlQuery(i);return Ka({name:a||"postgresjs.query",op:"db"},c=>{Lr(c,"auto.db.postgresjs"),c.setAttributes({[CS]:"postgres",[m5]:a});let d=n.getConfig(),{requestHook:m}=d;m&&(0,K_.safeExecuteInTheMiddle)(()=>m(c,a,void 0),y=>{y&&(c.setAttribute("sentry.hook.error","requestHook failed"),Sa&&J.error(`Error in requestHook for ${oJ} integration:`,y))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(y,I,v)=>{try{n._setOperationName(c,a,v?.[0]?.command),c.end()}catch(x){Sa&&J.error("Error ending span in resolve callback:",x)}return Reflect.apply(y,I,v)}});let S=this.reject;this.reject=new Proxy(S,{apply:(y,I,v)=>{try{c.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),c.setAttribute(g5,v?.[0]?.code||"unknown"),c.setAttribute(h5,v?.[0]?.name||"unknown"),n._setOperationName(c,a),c.end()}catch(x){Sa&&J.error("Error ending span in reject callback:",x)}return Reflect.apply(y,I,v)}});try{return r.apply(this,o)}catch(y){throw c.setStatus({code:2,message:y instanceof Error?y.message:"unknown_error"}),c.end(),y}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},pyt=e=>({name:oJ,setupOnce(){AOe(e)}}),mOe=pyt});var hOe=F(uO=>{"use strict";A();Object.defineProperty(uO,"__esModule",{value:!0});uO.SeverityNumber=void 0;var fyt;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(fyt=uO.SeverityNumber||(uO.SeverityNumber={}))});var wF=F(kv=>{"use strict";A();Object.defineProperty(kv,"__esModule",{value:!0});kv.NOOP_LOGGER=kv.NoopLogger=void 0;var OF=class{emit(t){}};kv.NoopLogger=OF;kv.NOOP_LOGGER=new OF});var kF=F(Pv=>{"use strict";A();Object.defineProperty(Pv,"__esModule",{value:!0});Pv.NOOP_LOGGER_PROVIDER=Pv.NoopLoggerProvider=void 0;var Ayt=wF(),MF=class{getLogger(t,n,r){return new Ayt.NoopLogger}};Pv.NoopLoggerProvider=MF;Pv.NOOP_LOGGER_PROVIDER=new MF});var aJ=F(PF=>{"use strict";A();Object.defineProperty(PF,"__esModule",{value:!0});PF.ProxyLogger=void 0;var myt=wF(),iJ=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):myt.NOOP_LOGGER}};PF.ProxyLogger=iJ});var uJ=F(UF=>{"use strict";A();Object.defineProperty(UF,"__esModule",{value:!0});UF.ProxyLoggerProvider=void 0;var gyt=kF(),hyt=aJ(),sJ=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new hyt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:gyt.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};UF.ProxyLoggerProvider=sJ});var _Oe=F(LF=>{"use strict";A();Object.defineProperty(LF,"__esModule",{value:!0});LF._globalThis=void 0;LF._globalThis=typeof globalThis=="object"?globalThis:global});var EOe=F(QF=>{"use strict";A();Object.defineProperty(QF,"__esModule",{value:!0});QF._globalThis=void 0;var _yt=_Oe();Object.defineProperty(QF,"_globalThis",{enumerable:!0,get:function(){return _yt._globalThis}})});var SOe=F(FF=>{"use strict";A();Object.defineProperty(FF,"__esModule",{value:!0});FF._globalThis=void 0;var Eyt=EOe();Object.defineProperty(FF,"_globalThis",{enumerable:!0,get:function(){return Eyt._globalThis}})});var yOe=F(wA=>{"use strict";A();Object.defineProperty(wA,"__esModule",{value:!0});wA.API_BACKWARDS_COMPATIBILITY_VERSION=wA.makeGetter=wA._global=wA.GLOBAL_LOGS_API_KEY=void 0;var Syt=SOe();wA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");wA._global=Syt._globalThis;function yyt(e,t,n){return r=>r===e?t:n}wA.makeGetter=yyt;wA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var COe=F(GF=>{"use strict";A();Object.defineProperty(GF,"__esModule",{value:!0});GF.LogsAPI=void 0;var Vd=yOe(),Tyt=kF(),TOe=uJ(),cJ=class e{constructor(){this._proxyLoggerProvider=new TOe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Vd._global[Vd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Vd._global[Vd.GLOBAL_LOGS_API_KEY]=(0,Vd.makeGetter)(Vd.API_BACKWARDS_COMPATIBILITY_VERSION,t,Tyt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Vd._global[Vd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Vd._global,Vd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Vd._global[Vd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new TOe.ProxyLoggerProvider}};GF.LogsAPI=cJ});var lJ=F(es=>{"use strict";A();Object.defineProperty(es,"__esModule",{value:!0});es.logs=es.ProxyLoggerProvider=es.ProxyLogger=es.NoopLoggerProvider=es.NOOP_LOGGER_PROVIDER=es.NoopLogger=es.NOOP_LOGGER=es.SeverityNumber=void 0;var Cyt=hOe();Object.defineProperty(es,"SeverityNumber",{enumerable:!0,get:function(){return Cyt.SeverityNumber}});var IOe=wF();Object.defineProperty(es,"NOOP_LOGGER",{enumerable:!0,get:function(){return IOe.NOOP_LOGGER}});Object.defineProperty(es,"NoopLogger",{enumerable:!0,get:function(){return IOe.NoopLogger}});var bOe=kF();Object.defineProperty(es,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return bOe.NOOP_LOGGER_PROVIDER}});Object.defineProperty(es,"NoopLoggerProvider",{enumerable:!0,get:function(){return bOe.NoopLoggerProvider}});var Iyt=aJ();Object.defineProperty(es,"ProxyLogger",{enumerable:!0,get:function(){return Iyt.ProxyLogger}});var byt=uJ();Object.defineProperty(es,"ProxyLoggerProvider",{enumerable:!0,get:function(){return byt.ProxyLoggerProvider}});var vyt=COe();es.logs=vyt.LogsAPI.getInstance()});var vOe=F(Uv=>{"use strict";A();Object.defineProperty(Uv,"__esModule",{value:!0});Uv.disableInstrumentations=Uv.enableInstrumentations=void 0;function Ryt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}Uv.enableInstrumentations=Ryt;function xyt(e){e.forEach(t=>t.disable())}Uv.disableInstrumentations=xyt});var DOe=F(jF=>{"use strict";A();Object.defineProperty(jF,"__esModule",{value:!0});jF.registerInstrumentations=void 0;var ROe=(Ge(),ke(Ze)),Dyt=lJ(),xOe=vOe();function Byt(e){let t=e.tracerProvider||ROe.trace.getTracerProvider(),n=e.meterProvider||ROe.metrics.getMeterProvider(),r=e.loggerProvider||Dyt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,xOe.enableInstrumentations)(o,t,n,r),()=>{(0,xOe.disableInstrumentations)(o)}}jF.registerInstrumentations=Byt});var LOe=F(zF=>{"use strict";A();Object.defineProperty(zF,"__esModule",{value:!0});zF.satisfies=void 0;var AJ=(Ge(),ke(Ze)),MOe=/^(?: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-]+)*))?$/,Nyt=/^(?<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-]+)*))?$/,Oyt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function wyt(e,t,n){if(!Myt(e))return AJ.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Lyt(e);if(!r)return!1;let o=[],i=kOe(r,t,o,n);return i&&!n?.includePrerelease?Pyt(r,o):i}zF.satisfies=wyt;function Myt(e){return typeof e=="string"&&MOe.test(e)}function kOe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(dJ(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=iTt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!dJ(e,i,n,r))return!1;return!0}return dJ(e,t,n,r)}function dJ(e,t,n,r){if(t=Uyt(t,r),t.includes(" "))return kOe(e,t,n,r);{let o=Qyt(t);return n.push(o),kyt(e,o)}}function kyt(e,t){if(t.invalid)return!1;if(!t.version||fJ(t.version))return!0;let n=NOe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=NOe(r,o)}return Oyt[t.op]?.includes(n)}function Pyt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Uyt(e,t){return e=e.trim(),e=rTt(e,t),e=nTt(e),e=oTt(e,t),e=e.trim(),e}function zu(e){return!e||e.toLowerCase()==="x"||e==="*"}function Lyt(e){let t=e.match(MOe);if(!t){AJ.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function Qyt(e){if(!e)return{};let t=e.match(Nyt);if(!t)return AJ.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function fJ(e){return e==="*"||e==="x"||e==="X"}function BOe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Fyt(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function Gyt(e,t){if(fJ(e)||fJ(t))return 0;let[n,r]=Fyt(BOe(e),BOe(t));return n>r?1:n<r?-1:0}function NOe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=Gyt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var POe="[a-zA-Z0-9-]",UOe="0|[1-9]\\d*",jyt=`\\d*[a-zA-Z-]${POe}*`,zyt="((?:<|>)?=?)",OOe=`(?:${UOe}|${jyt})`,Hyt=`(?:-(${OOe}(?:\\.${OOe})*))`,wOe=`${POe}+`,$yt=`(?:\\+(${wOe}(?:\\.${wOe})*))`,pJ=`${UOe}|x|X|\\*`,cO=`[v=\\s]*(${pJ})(?:\\.(${pJ})(?:\\.(${pJ})(?:${Hyt})?${$yt}?)?)?`,Vyt=`^${zyt}\\s*${cO}$`,qyt=new RegExp(Vyt),Yyt=`^\\s*(${cO})\\s+-\\s+(${cO})\\s*$`,Kyt=new RegExp(Yyt),Jyt="(?:~>?)",Zyt=`^${Jyt}${cO}$`,Wyt=new RegExp(Zyt),Xyt="(?:\\^)",eTt=`^${Xyt}${cO}$`,tTt=new RegExp(eTt);function nTt(e){let t=Wyt;return e.replace(t,(n,r,o,i,a)=>{let c;return zu(r)?c="":zu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:zu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function rTt(e,t){let n=tTt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let m;return zu(i)?m="":zu(a)?m=`>=${i}.0.0${r} <${+i+1}.0.0-0`:zu(c)?i==="0"?m=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?m=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?m=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,m})}function oTt(e,t){let n=qyt;return e.replace(n,(r,o,i,a,c,d)=>{let m=zu(i),h=m||zu(a),S=h||zu(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",m?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function iTt(e,t){let n=Kyt;return e.replace(n,(r,o,i,a,c,d,m,h,S,y,I,v)=>(zu(i)?o="":zu(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:zu(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,zu(S)?h="":zu(y)?h=`<${+S+1}.0.0-0`:zu(I)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${I}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+I+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var mJ=F(Bs=>{"use strict";A();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.massUnwrap=Bs.unwrap=Bs.massWrap=Bs.wrap=void 0;var Hu=console.error.bind(console);function lO(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 aTt=(e,t,n)=>{if(!e||!e[t]){Hu("no original function "+String(t)+" to wrap");return}if(!n){Hu("no wrapper function"),Hu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){Hu("original object and wrapper must be functions");return}let o=n(r,t);return lO(o,"__original",r),lO(o,"__unwrap",()=>{e[t]===o&&lO(e,t,r)}),lO(o,"__wrapped",!0),lO(e,t,o),o};Bs.wrap=aTt;var sTt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Hu("must provide one or more modules to patch"),Hu(new Error().stack);return}if(!(t&&Array.isArray(t))){Hu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Bs.wrap)(r,o,n)})})};Bs.massWrap=sTt;var uTt=(e,t)=>{if(!e||!e[t]){Hu("no function to unwrap."),Hu(new Error().stack);return}let n=e[t];if(!n.__unwrap)Hu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Bs.unwrap=uTt;var cTt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Hu("must provide one or more modules to patch"),Hu(new Error().stack);return}if(!(t&&Array.isArray(t))){Hu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Bs.unwrap)(n,r)})})};Bs.massUnwrap=cTt;function dO(e){e&&e.logger&&(typeof e.logger!="function"?Hu("new logger isn't a function, not replacing"):Hu=e.logger)}Bs.default=dO;dO.wrap=Bs.wrap;dO.massWrap=Bs.massWrap;dO.unwrap=Bs.unwrap;dO.massUnwrap=Bs.massUnwrap});var QOe=F($F=>{"use strict";A();Object.defineProperty($F,"__esModule",{value:!0});$F.InstrumentationAbstract=void 0;var gJ=(Ge(),ke(Ze)),lTt=lJ(),HF=mJ(),hJ=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=gJ.diag.createComponentLogger({namespace:t}),this._tracer=gJ.trace.getTracer(t,n),this._meter=gJ.metrics.getMeter(t,n),this._logger=lTt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=HF.wrap;_unwrap=HF.unwrap;_massWrap=HF.massWrap;_massUnwrap=HF.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};$F.InstrumentationAbstract=hJ});var FOe=F(J_=>{"use strict";A();Object.defineProperty(J_,"__esModule",{value:!0});J_.ModuleNameTrie=J_.ModuleNameSeparator=void 0;J_.ModuleNameSeparator="/";var VF=class{hooks=[];children=new Map},_J=class{_trie=new VF;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(J_.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new VF,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],a=!0;for(let c of t.split(J_.ModuleNameSeparator)){let d=o.children.get(c);if(!d){a=!1;break}r||i.push(...d.hooks),o=d}return r&&a&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,d)=>c.insertedId-d.insertedId),i.map(({hook:c})=>c))}};J_.ModuleNameTrie=_J});var jOe=F(qF=>{"use strict";A();Object.defineProperty(qF,"__esModule",{value:!0});qF.RequireInTheMiddleSingleton=void 0;var dTt=DS(),GOe=Fe("path"),EJ=FOe(),pTt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),SJ=class e{_moduleNameTrie=new EJ.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new dTt.Hook(null,{internals:!0},(t,n,r)=>{let o=fTt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:a}of i)t=a(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return pTt?new e:this._instance=this._instance??new e}};qF.RequireInTheMiddleSingleton=SJ;function fTt(e){return GOe.sep!==EJ.ModuleNameSeparator?e.split(GOe.sep).join(EJ.ModuleNameSeparator):e}});var yJ=F(Z_=>{"use strict";A();Object.defineProperty(Z_,"__esModule",{value:!0});Z_.isWrapped=Z_.safeExecuteInTheMiddleAsync=Z_.safeExecuteInTheMiddle=void 0;function ATt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}Z_.safeExecuteInTheMiddle=ATt;async function mTt(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}Z_.safeExecuteInTheMiddleAsync=mTt;function gTt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}Z_.isWrapped=gTt});var $Oe=F(YF=>{"use strict";A();Object.defineProperty(YF,"__esModule",{value:!0});YF.InstrumentationBase=void 0;var pO=Fe("path"),zOe=Fe("util"),hTt=LOe(),TJ=mJ(),_Tt=QOe(),ETt=jOe(),STt=nK(),fO=(Ge(),ke(Ze)),yTt=DS(),TTt=Fe("fs"),CTt=yJ(),CJ=class extends _Tt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=ETt.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,CTt.isWrapped)(t[n])&&this._unwrap(t,n),zOe.types.isProxy(t)){let o=(0,TJ.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,TJ.wrap)(t,n,r)};_unwrap=(t,n)=>zOe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,TJ.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{fO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){fO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{fO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){fO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Fe.resolve(n);Fe.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,TTt.readFileSync)(pO.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{fO.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return HOe(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let a=t.files??[],c=pO.normalize(r);return a.filter(m=>m.name===c).filter(m=>HOe(m.supportedVersions,i,t.includePrerelease)).reduce((m,h)=>(h.moduleExports=m,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(m,t.moduleVersion)):m),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(a,c,d)=>{if(!d&&pO.isAbsolute(c)){let m=pO.parse(c);c=m.name,d=m.dir}return this._onRequire(t,a,c,d)},r=(a,c,d)=>this._onRequire(t,a,c,d),o=pO.isAbsolute(t.name)?new yTt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new STt.Hook([t.name],{internals:!1},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};YF.InstrumentationBase=CJ;function HOe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,hTt.satisfies)(t,r,{includePrerelease:n}))}});var VOe=F(KF=>{"use strict";A();Object.defineProperty(KF,"__esModule",{value:!0});KF.normalize=void 0;var ITt=Fe("path");Object.defineProperty(KF,"normalize",{enumerable:!0,get:function(){return ITt.normalize}})});var qOe=F(Lv=>{"use strict";A();Object.defineProperty(Lv,"__esModule",{value:!0});Lv.normalize=Lv.InstrumentationBase=void 0;var bTt=$Oe();Object.defineProperty(Lv,"InstrumentationBase",{enumerable:!0,get:function(){return bTt.InstrumentationBase}});var vTt=VOe();Object.defineProperty(Lv,"normalize",{enumerable:!0,get:function(){return vTt.normalize}})});var IJ=F(Qv=>{"use strict";A();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.normalize=Qv.InstrumentationBase=void 0;var YOe=qOe();Object.defineProperty(Qv,"InstrumentationBase",{enumerable:!0,get:function(){return YOe.InstrumentationBase}});Object.defineProperty(Qv,"normalize",{enumerable:!0,get:function(){return YOe.normalize}})});var KOe=F(JF=>{"use strict";A();Object.defineProperty(JF,"__esModule",{value:!0});JF.InstrumentationNodeModuleDefinition=void 0;var bJ=class{name;supportedVersions;patch;unpatch;files;constructor(t,n,r,o,i){this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=i||[]}};JF.InstrumentationNodeModuleDefinition=bJ});var JOe=F(ZF=>{"use strict";A();Object.defineProperty(ZF,"__esModule",{value:!0});ZF.InstrumentationNodeModuleFile=void 0;var RTt=IJ(),vJ=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,RTt.normalize)(t)}};ZF.InstrumentationNodeModuleFile=vJ});var ZOe=F(my=>{"use strict";A();Object.defineProperty(my,"__esModule",{value:!0});my.semconvStabilityFromStr=my.SemconvStability=void 0;var WF;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(WF=my.SemconvStability||(my.SemconvStability={}));function xTt(e,t){let n=WF.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=WF.DUPLICATE;break}else o.toLowerCase()===e&&(n=WF.STABLE);return n}my.semconvStabilityFromStr=xTt});var XOe=F(Xi=>{"use strict";A();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.semconvStabilityFromStr=Xi.SemconvStability=Xi.safeExecuteInTheMiddleAsync=Xi.safeExecuteInTheMiddle=Xi.isWrapped=Xi.InstrumentationNodeModuleFile=Xi.InstrumentationNodeModuleDefinition=Xi.InstrumentationBase=Xi.registerInstrumentations=void 0;var DTt=DOe();Object.defineProperty(Xi,"registerInstrumentations",{enumerable:!0,get:function(){return DTt.registerInstrumentations}});var BTt=IJ();Object.defineProperty(Xi,"InstrumentationBase",{enumerable:!0,get:function(){return BTt.InstrumentationBase}});var NTt=KOe();Object.defineProperty(Xi,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return NTt.InstrumentationNodeModuleDefinition}});var OTt=JOe();Object.defineProperty(Xi,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return OTt.InstrumentationNodeModuleFile}});var RJ=yJ();Object.defineProperty(Xi,"isWrapped",{enumerable:!0,get:function(){return RJ.isWrapped}});Object.defineProperty(Xi,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return RJ.safeExecuteInTheMiddle}});Object.defineProperty(Xi,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return RJ.safeExecuteInTheMiddleAsync}});var WOe=ZOe();Object.defineProperty(Xi,"SemconvStability",{enumerable:!0,get:function(){return WOe.SemconvStability}});Object.defineProperty(Xi,"semconvStabilityFromStr",{enumerable:!0,get:function(){return WOe.semconvStabilityFromStr}})});function kTt(){let e=Fv[DJ];return e?.helper?e.helper:Fv[xJ]?.helper}function PTt(e){let t={helper:e};Fv[DJ]=t,Fv[xJ]=t}function UTt(){delete Fv[DJ],delete Fv[xJ]}function FTt(e){switch(e){case"client":return oo.CLIENT;case"internal":default:return oo.INTERNAL}}function nwe(e,t,n,r,o){if(rwe(t.name,o))return;let i={attributes:t.attributes,kind:FTt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,a=>{r.set(t.id,a.spanContext().spanId),t.links&&a.addLinks(t.links.flatMap(d=>{let m=r.get(d);return m?{context:{spanId:m,traceId:a.spanContext().traceId,traceFlags:a.spanContext().traceFlags}}:[]}));let c=n.filter(d=>d.parentId===t.id);for(let d of c)nwe(e,d,n,r,o);a.end(t.endTime)})}function ewe(e,t){return jTt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function jTt(e){return e!=null&&typeof e.then=="function"}function rwe(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var XF,wTt,MTt,xJ,DJ,Fv,LTt,QTt,GTt,owe,twe,zTt,HTt,iwe,awe=O(()=>{A();Ge();XF=ie(XOe(),1);Ge();wTt={name:"@prisma/instrumentation-contract",version:"7.6.0",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}},MTt=wTt.version.split(".")[0],xJ="PRISMA_INSTRUMENTATION",DJ=`V${MTt}_PRISMA_INSTRUMENTATION`,Fv=globalThis;LTt=process.env.PRISMA_SHOW_ALL_TRACES==="true",QTt="00-10-10-00";GTt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=zt.getSpanContext(e??Ye.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:QTt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)nwe(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return Ye.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!LTt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(rwe(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return ewe(i,t(i,r))}return n.startActiveSpan(o,e,i=>ewe(i,t(i,r)))}};owe={name:"@prisma/instrumentation",version:"7.6.0",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@opentelemetry/api":"1.9.0","@prisma/instrumentation-contract":"workspace:*","@types/node":"~20.19.24",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.207.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},sideEffects:!1},twe=owe.version,zTt=owe.name,HTt="@prisma/client",iwe=class extends XF.InstrumentationBase{tracerProvider;constructor(e={}){super(zTt,twe,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new XF.InstrumentationNodeModuleDefinition(HTt,[twe])]}enable(){let e=this._config;PTt(new GTt({tracerProvider:this.tracerProvider??zt.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){UTt()}isEnabled(){return kTt()!==void 0}}});function $Tt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function uwe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function VTt(e){switch(e){case"client":return oo.CLIENT;case"internal":default:return oo.INTERNAL}}var swe,BJ,qTt,cwe,lwe=O(()=>{A();Ge();awe();dt();fr();swe="Prisma";BJ=class extends iwe{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=uwe();$Tt(t)&&(t.createEngineSpan=n=>{let r=zt.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){$o(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(i=>{let a=VTt(i.kind),c=i.parent_span_id,d=i.span_id,m=i.trace_id,h=i.links?.map(y=>({context:{traceId:y.trace_id,spanId:y.span_id,traceFlags:qs.SAMPLED}})),S=zt.setSpanContext(Ye.active(),{traceId:m,spanId:c,traceFlags:qs.SAMPLED});Ye.with(S,()=>{let y={generateTraceId:()=>m,generateSpanId:()=>d};r._idGenerator=y,r.startSpan(i.name,{kind:a,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};qTt=at(swe,e=>new BJ(e)),cwe=e=>({name:swe,setupOnce(){qTt(e)},setup(t){uwe()&&t.on("spanStart",n=>{let r=Nt(n);r.description?.startsWith("prisma:")&&n.setAttribute(Mt,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}})});var dwe=F(Gv=>{"use strict";A();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.PACKAGE_NAME=Gv.PACKAGE_VERSION=void 0;Gv.PACKAGE_VERSION="0.60.0";Gv.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var NJ=F(MA=>{"use strict";A();Object.defineProperty(MA,"__esModule",{value:!0});MA.HapiLifecycleMethodNames=MA.HapiLayerType=MA.handlerPatched=MA.HapiComponentName=void 0;MA.HapiComponentName="@hapi/hapi";MA.handlerPatched=Symbol("hapi-handler-patched");MA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};MA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var pwe=F(e3=>{"use strict";A();Object.defineProperty(e3,"__esModule",{value:!0});e3.ATTR_HTTP_METHOD=void 0;e3.ATTR_HTTP_METHOD="http.method"});var OJ=F(AO=>{"use strict";A();Object.defineProperty(AO,"__esModule",{value:!0});AO.AttributeNames=void 0;var YTt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(YTt=AO.AttributeNames||(AO.AttributeNames={}))});var mwe=F(ea=>{"use strict";A();Object.defineProperty(ea,"__esModule",{value:!0});ea.getPluginFromInput=ea.getExtMetadata=ea.getRouteMetadata=ea.isPatchableExtMethod=ea.isDirectExtInput=ea.isLifecycleExtEventObj=ea.isLifecycleExtType=ea.getPluginName=void 0;var fwe=(Kn(),ke(Ur)),KTt=pwe(),mO=NJ(),W_=OJ(),Awe=tn();function JTt(e){return e.name?e.name:e.pkg.name}ea.getPluginName=JTt;var ZTt=e=>typeof e=="string"&&mO.HapiLifecycleMethodNames.has(e);ea.isLifecycleExtType=ZTt;var WTt=e=>{let t=e?.type;return t!==void 0&&(0,ea.isLifecycleExtType)(t)};ea.isLifecycleExtEventObj=WTt;var XTt=e=>Array.isArray(e)&&e.length<=3&&(0,ea.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ea.isDirectExtInput=XTt;var eCt=e=>!Array.isArray(e);ea.isPatchableExtMethod=eCt;var tCt=(e,t,n)=>{let r={[fwe.ATTR_HTTP_ROUTE]:e.path};t&Awe.SemconvStability.OLD&&(r[KTt.ATTR_HTTP_METHOD]=e.method),t&Awe.SemconvStability.STABLE&&(r[fwe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[W_.AttributeNames.HAPI_TYPE]=mO.HapiLayerType.PLUGIN,r[W_.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[W_.AttributeNames.HAPI_TYPE]=mO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ea.getRouteMetadata=tCt;var nCt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[W_.AttributeNames.EXT_TYPE]:e,[W_.AttributeNames.HAPI_TYPE]:mO.HapiLayerType.EXT,[W_.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[W_.AttributeNames.EXT_TYPE]:e,[W_.AttributeNames.HAPI_TYPE]:mO.HapiLayerType.EXT},name:r}};ea.getExtMetadata=nCt;var rCt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ea.getPluginFromInput=rCt});var _we=F(t3=>{"use strict";A();Object.defineProperty(t3,"__esModule",{value:!0});t3.HapiInstrumentation=void 0;var Pl=(Ge(),ke(Ze)),gwe=Tr(),gO=tn(),hwe=dwe(),hO=NJ(),Dg=mwe(),wJ=class extends gO.InstrumentationBase{_semconvStability;constructor(t={}){super(hwe.PACKAGE_NAME,hwe.PACKAGE_VERSION,t),this._semconvStability=(0,gO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new gO.InstrumentationNodeModuleDefinition(hO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,gO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,gO.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([n],["server","Server"])})}_getServerPatch(t){let n=this,r=this;return function(i){let a=t.apply(this,[i]);return r._wrap(a,"route",c=>n._getServerRoutePatch.bind(n)(c)),r._wrap(a,"ext",c=>n._getServerExtPatch.bind(n)(c)),r._wrap(a,"register",n._getServerRegisterPatch.bind(n)),a}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let a of o){let c=(0,Dg.getPluginFromInput)(a);n._wrapRegisterHandler(c)}else{let a=(0,Dg.getPluginFromInput)(o);n._wrapRegisterHandler(a)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let a=i[0];for(let c=0;c<a.length;c++){let d=a[c];if((0,Dg.isLifecycleExtType)(d.type)){let m=d,h=r._wrapExtMethods(m.method,d.type,n);m.method=h,a[c]=m}}return t.apply(this,i)}else if((0,Dg.isDirectExtInput)(i)){let a=i,c=a[1],d=r._wrapExtMethods(c,a[0],n);return t.apply(this,[a[0],d,a[2]])}else if((0,Dg.isLifecycleExtEventObj)(i[0])){let a=i[0],c=r._wrapExtMethods(a.method,a.type,n);return a.method=c,t.call(this,a)}return t.apply(this,i)}}_getServerRoutePatch(t,n){let r=this;return function(o){if(Array.isArray(o))for(let i=0;i<o.length;i++){let a=r._wrapRouteHandler.call(r,o[i],n);o[i]=a}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,Dg.getPluginName)(t),o=t.register,i=this,a=function(c,d){return i._wrap(c,"route",m=>n._getServerRoutePatch.bind(n)(m,r)),i._wrap(c,"ext",m=>n._getServerExtPatch.bind(n)(m,r)),o.call(this,c,d)};t.register=a}_wrapExtMethods(t,n,r){let o=this;if(t instanceof Array){for(let i=0;i<t.length;i++)t[i]=o._wrapExtMethods(t[i],n);return t}else if((0,Dg.isPatchableExtMethod)(t))return t[hO.handlerPatched]===!0?t:(t[hO.handlerPatched]=!0,async function(...a){if(Pl.trace.getSpan(Pl.context.active())===void 0)return await t.apply(this,a);let c=(0,Dg.getExtMetadata)(n,r,t.name),d=o.tracer.startSpan(c.name,{attributes:c.attributes});try{return await Pl.context.with(Pl.trace.setSpan(Pl.context.active(),d),t,void 0,...a)}catch(m){throw d.recordException(m),d.setStatus({code:Pl.SpanStatusCode.ERROR,message:m.message}),m}finally{d.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[hO.handlerPatched]===!0)return t;t[hO.handlerPatched]=!0;let o=i=>async function(...a){if(Pl.trace.getSpan(Pl.context.active())===void 0)return await i.call(this,...a);let c=(0,gwe.getRPCMetadata)(Pl.context.active());c?.type===gwe.RPCType.HTTP&&(c.route=t.path);let d=(0,Dg.getRouteMetadata)(t,r._semconvStability,n),m=r.tracer.startSpan(d.name,{attributes:d.attributes});try{return await Pl.context.with(Pl.trace.setSpan(Pl.context.active(),m),()=>i.call(this,...a))}catch(h){throw m.recordException(h),m.setStatus({code:Pl.SpanStatusCode.ERROR,message:h.message}),h}finally{m.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(a){let c=i(a);return typeof c.handler=="function"&&(c.handler=o(c.handler)),c}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};t3.HapiInstrumentation=wJ});var Ewe=F(jv=>{"use strict";A();Object.defineProperty(jv,"__esModule",{value:!0});jv.AttributeNames=jv.HapiInstrumentation=void 0;var oCt=_we();Object.defineProperty(jv,"HapiInstrumentation",{enumerable:!0,get:function(){return oCt.HapiInstrumentation}});var iCt=OJ();Object.defineProperty(jv,"AttributeNames",{enumerable:!0,get:function(){return iCt.AttributeNames}})});var Swe,ywe,Twe,aCt,Cwe,Iwe=O(()=>{A();Swe=ie(Ewe(),1);fr();ywe="Hapi",Twe=at(ywe,()=>new Swe.HapiInstrumentation),aCt=()=>({name:ywe,setupOnce(){Twe()}}),Cwe=aCt});var X_,_O,MJ=O(()=>{A();X_={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},_O={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var r3,sCt,uCt,n3,bwe=O(()=>{A();Ge();r3=ie(tn(),1);dt();MJ();sCt="@sentry/instrumentation-hono",uCt="0.0.1",n3=class extends r3.InstrumentationBase{constructor(t={}){super(sCt,uCt,t)}init(){return[new r3.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],t=>this._patch(t))]}_patch(t){let n=this;class r extends t.Hono{constructor(...i){super(...i),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{t.Hono=r}catch{return{...t,Hono:r}}return t}_patchHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let a=o.slice(1);return n.apply(this,[i,...a.map(c=>t._wrapHandler(c))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_patchOnHandler(){let t=this;return function(n){return function(...o){let i=o.slice(2);return n.apply(this,[...o.slice(0,2),...i.map(a=>t._wrapHandler(a))])}}}_patchMiddlewareHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let a=o.slice(1);return n.apply(this,[i,...a.map(c=>t._wrapHandler(c))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_wrapHandler(t){let n=this;return function(r,o){if(!n.isEnabled())return t.apply(this,[r,o]);let i=r.req.path,a=n.tracer.startSpan(i);return Ye.with(zt.setSpan(Ye.active(),a),()=>n._safeExecute(()=>{let c=t.apply(this,[r,o]);if(ys(c))return c.then(d=>{let m=n._determineHandlerType(d);return a.setAttributes({[X_.HONO_TYPE]:m,[X_.HONO_NAME]:m===_O.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(a),d});{let d=n._determineHandlerType(c);return a.setAttributes({[X_.HONO_TYPE]:d,[X_.HONO_NAME]:d===_O.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(a),c}},()=>a.end(),c=>{n._handleError(a,c),a.end()}))}}_safeExecute(t,n,r){try{let o=t();return ys(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?_O.MIDDLEWARE:_O.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:si.ERROR,message:n.message}),t.recordException(n))}}});function cCt(e){let t=Nt(e).data,n=t[X_.HONO_TYPE];if(t[Zt]||!n)return;e.setAttributes({[Mt]:"auto.http.otel.hono",[Zt]:`${n}.hono`});let r=t[X_.HONO_NAME];if(typeof r=="string"&&e.updateName(r),In()===Nd()){Sa&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[ng],i=t[IS];typeof o=="string"&&typeof i=="string"&&In().setTransactionName(`${i} ${o}`)}var vwe,Rwe,lCt,xwe,Dwe=O(()=>{A();Kn();dt();fr();oy();MJ();bwe();vwe="Hono";Rwe=at(vwe,()=>new n3({responseHook:e=>{cCt(e)}})),lCt=()=>({name:vwe,setupOnce(){Rwe()}}),xwe=lCt});var o3=F(EO=>{"use strict";A();Object.defineProperty(EO,"__esModule",{value:!0});EO.KoaLayerType=void 0;var dCt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(dCt=EO.KoaLayerType||(EO.KoaLayerType={}))});var Bwe=F(zv=>{"use strict";A();Object.defineProperty(zv,"__esModule",{value:!0});zv.PACKAGE_NAME=zv.PACKAGE_VERSION=void 0;zv.PACKAGE_VERSION="0.62.0";zv.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var kJ=F(SO=>{"use strict";A();Object.defineProperty(SO,"__esModule",{value:!0});SO.AttributeNames=void 0;var pCt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(pCt=SO.AttributeNames||(SO.AttributeNames={}))});var Owe=F(Hv=>{"use strict";A();Object.defineProperty(Hv,"__esModule",{value:!0});Hv.isLayerIgnored=Hv.getMiddlewareMetadata=void 0;var Nwe=o3(),i3=kJ(),fCt=(Kn(),ke(Ur)),ACt=(e,t,n,r)=>n?{attributes:{[i3.AttributeNames.KOA_NAME]:r?.toString(),[i3.AttributeNames.KOA_TYPE]:Nwe.KoaLayerType.ROUTER,[fCt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[i3.AttributeNames.KOA_NAME]:t.name??"middleware",[i3.AttributeNames.KOA_TYPE]:Nwe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};Hv.getMiddlewareMetadata=ACt;var mCt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));Hv.isLayerIgnored=mCt});var wwe=F(a3=>{"use strict";A();Object.defineProperty(a3,"__esModule",{value:!0});a3.kLayerPatched=void 0;a3.kLayerPatched=Symbol("koa-layer-patched")});var Qwe=F(s3=>{"use strict";A();Object.defineProperty(s3,"__esModule",{value:!0});s3.KoaInstrumentation=void 0;var kA=(Ge(),ke(Ze)),yO=tn(),Mwe=o3(),kwe=Bwe(),Pwe=Owe(),Uwe=Tr(),Lwe=wwe(),PJ=class extends yO.InstrumentationBase{constructor(t={}){super(kwe.PACKAGE_NAME,kwe.PACKAGE_VERSION,t)}init(){return new yO.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,yO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;(0,yO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(t){let n=this;return function(o){let i;return o.router?i=n._patchRouterDispatch(o):i=n._patchLayer(o,!1),t.apply(this,[i])}}_patchRouterDispatch(t){kA.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,a=o.stack;for(let c=0;c<a.length;c++){let d=a[c];a[c]=this._patchLayer(d,!0,i)}}return t}_patchLayer(t,n,r){let o=n?Mwe.KoaLayerType.ROUTER:Mwe.KoaLayerType.MIDDLEWARE;return t[Lwe.kLayerPatched]===!0||(0,Pwe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(kA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[Lwe.kLayerPatched]=!0,kA.diag.debug("patching Koa middleware layer"),async(i,a)=>{if(kA.trace.getSpan(kA.context.active())===void 0)return t(i,a);let d=(0,Pwe.getMiddlewareMetadata)(i,t,n,r),m=this.tracer.startSpan(d.name,{attributes:d.attributes}),h=(0,Uwe.getRPCMetadata)(kA.context.active());h?.type===Uwe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:S}=this.getConfig();S&&(0,yO.safeExecuteInTheMiddle)(()=>S(m,{context:i,middlewareLayer:t,layerType:o}),I=>{I&&kA.diag.error("koa instrumentation: request hook failed",I)},!0);let y=kA.trace.setSpan(kA.context.active(),m);return kA.context.with(y,async()=>{try{return await t(i,a)}catch(I){throw m.recordException(I),I}finally{m.end()}})})}};s3.KoaInstrumentation=PJ});var Fwe=F(eE=>{"use strict";A();Object.defineProperty(eE,"__esModule",{value:!0});eE.KoaLayerType=eE.AttributeNames=eE.KoaInstrumentation=void 0;var gCt=Qwe();Object.defineProperty(eE,"KoaInstrumentation",{enumerable:!0,get:function(){return gCt.KoaInstrumentation}});var hCt=kJ();Object.defineProperty(eE,"AttributeNames",{enumerable:!0,get:function(){return hCt.AttributeNames}});var _Ct=o3();Object.defineProperty(eE,"KoaLayerType",{enumerable:!0,get:function(){return _Ct.KoaLayerType}})});var Gwe,jwe,zwe,ECt,Hwe,$we=O(()=>{A();Gwe=ie(Fwe(),1);Kn();dt();fr();oy();jwe="Koa",zwe=at(jwe,Gwe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){Lr(t,"auto.http.otel.koa");let r=Nt(t).data,o=r["koa.type"];o&&t.setAttribute(Zt,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),In()===Nd()){Sa&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let a=r[ng],c=n.context?.request?.method?.toUpperCase()||"GET";a&&In().setTransactionName(`${c} ${a}`)}})),ECt=(e={})=>({name:jwe,setupOnce(){zwe(e)}}),Hwe=ECt});var UJ=F(sf=>{"use strict";A();Object.defineProperty(sf,"__esModule",{value:!0});sf.ConnectNames=sf.ConnectTypes=sf.AttributeNames=void 0;var SCt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(SCt=sf.AttributeNames||(sf.AttributeNames={}));var yCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(yCt=sf.ConnectTypes||(sf.ConnectTypes={}));var TCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(TCt=sf.ConnectNames||(sf.ConnectNames={}))});var Vwe=F($v=>{"use strict";A();Object.defineProperty($v,"__esModule",{value:!0});$v.PACKAGE_NAME=$v.PACKAGE_VERSION=void 0;$v.PACKAGE_VERSION="0.57.0";$v.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var qwe=F(u3=>{"use strict";A();Object.defineProperty(u3,"__esModule",{value:!0});u3._LAYERS_STORE_PROPERTY=void 0;u3._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var Ywe=F(nE=>{"use strict";A();Object.defineProperty(nE,"__esModule",{value:!0});nE.generateRoute=nE.replaceCurrentStackRoute=nE.addNewStackLayer=void 0;var CCt=(Ge(),ke(Ze)),tE=qwe(),ICt=e=>{Array.isArray(e[tE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,tE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[tE._LAYERS_STORE_PROPERTY].push("/");let t=e[tE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[tE._LAYERS_STORE_PROPERTY].length?e[tE._LAYERS_STORE_PROPERTY].pop():CCt.diag.warn("Connect: Trying to pop the stack multiple time")}};nE.addNewStackLayer=ICt;var bCt=(e,t)=>{t&&e[tE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};nE.replaceCurrentStackRoute=bCt;var vCt=e=>e[tE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);nE.generateRoute=vCt});var Zwe=F(rE=>{"use strict";A();Object.defineProperty(rE,"__esModule",{value:!0});rE.ConnectInstrumentation=rE.ANONYMOUS_NAME=void 0;var RCt=(Ge(),ke(Ze)),Kwe=Tr(),Vv=UJ(),Jwe=Vwe(),c3=tn(),xCt=(Kn(),ke(Ur)),LJ=Ywe();rE.ANONYMOUS_NAME="anonymous";var QJ=class extends c3.InstrumentationBase{constructor(t={}){super(Jwe.PACKAGE_NAME,Jwe.PACKAGE_VERSION,t)}init(){return[new c3.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,c3.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,c3.isWrapped)(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let n=this;return function(...r){let o=t.apply(this,r);return n._patchApp(o),o}}_patchNext(t,n){return function(o){let i=t.apply(this,[o]);return n(),i}}_startSpan(t,n){let r,o,i;t?(r=Vv.ConnectTypes.REQUEST_HANDLER,i=Vv.ConnectNames.REQUEST_HANDLER,o=t):(r=Vv.ConnectTypes.MIDDLEWARE,i=Vv.ConnectNames.MIDDLEWARE,o=n.name||rE.ANONYMOUS_NAME);let a=`${i} - ${o}`,c={attributes:{[xCt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[Vv.AttributeNames.CONNECT_TYPE]:r,[Vv.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(a,c)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[a,c,d]=o?[1,2,3]:[0,1,2],m=arguments[a],h=arguments[c],S=arguments[d];(0,LJ.replaceCurrentStackRoute)(m,t);let y=(0,Kwe.getRPCMetadata)(RCt.context.active());t&&y?.type===Kwe.RPCType.HTTP&&(y.route=(0,LJ.generateRoute)(m));let I="";t?I=`request handler - ${t}`:I=`middleware - ${n.name||rE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",I);let x=!1;function N(){x?r._diag.debug(`span ${v.name} - already finished`):(x=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",N)}return h.addListener("close",N),arguments[d]=r._patchNext(S,N),n.apply(this,arguments)}return Object.defineProperty(i,"length",{value:n.length,writable:!1,configurable:!0}),i}_patchUse(t){let n=this;return function(...r){let o=r[r.length-1],i=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(i,o),t.apply(this,r)}}_patchHandle(t){let n=this;return function(){let[r,o]=[0,2],i=arguments[r],a=arguments[o],c=(0,LJ.addNewStackLayer)(i);return typeof a=="function"&&(arguments[o]=n._patchOut(a,c)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};rE.ConnectInstrumentation=QJ});var Xwe=F(qd=>{"use strict";A();Object.defineProperty(qd,"__esModule",{value:!0});qd.ConnectTypes=qd.ConnectNames=qd.AttributeNames=qd.ANONYMOUS_NAME=qd.ConnectInstrumentation=void 0;var Wwe=Zwe();Object.defineProperty(qd,"ConnectInstrumentation",{enumerable:!0,get:function(){return Wwe.ConnectInstrumentation}});Object.defineProperty(qd,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return Wwe.ANONYMOUS_NAME}});var FJ=UJ();Object.defineProperty(qd,"AttributeNames",{enumerable:!0,get:function(){return FJ.AttributeNames}});Object.defineProperty(qd,"ConnectNames",{enumerable:!0,get:function(){return FJ.ConnectNames}});Object.defineProperty(qd,"ConnectTypes",{enumerable:!0,get:function(){return FJ.ConnectTypes}})});var eMe,tMe,nMe,DCt,rMe,oMe=O(()=>{A();eMe=ie(Xwe(),1);fr();tMe="Connect",nMe=at(tMe,()=>new eMe.ConnectInstrumentation),DCt=()=>({name:tMe,setupOnce(){nMe()}}),rMe=DCt});var iMe=F(ts=>{"use strict";A();Object.defineProperty(ts,"__esModule",{value:!0});ts.DB_SYSTEM_VALUE_MSSQL=ts.ATTR_NET_PEER_PORT=ts.ATTR_NET_PEER_NAME=ts.ATTR_DB_USER=ts.ATTR_DB_SYSTEM=ts.ATTR_DB_STATEMENT=ts.ATTR_DB_SQL_TABLE=ts.ATTR_DB_NAME=void 0;ts.ATTR_DB_NAME="db.name";ts.ATTR_DB_SQL_TABLE="db.sql.table";ts.ATTR_DB_STATEMENT="db.statement";ts.ATTR_DB_SYSTEM="db.system";ts.ATTR_DB_USER="db.user";ts.ATTR_NET_PEER_NAME="net.peer.name";ts.ATTR_NET_PEER_PORT="net.peer.port";ts.DB_SYSTEM_VALUE_MSSQL="mssql"});var aMe=F(qv=>{"use strict";A();Object.defineProperty(qv,"__esModule",{value:!0});qv.once=qv.getSpanName=void 0;function BCt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}qv.getSpanName=BCt;var NCt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};qv.once=NCt});var sMe=F(Yv=>{"use strict";A();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.PACKAGE_NAME=Yv.PACKAGE_VERSION=void 0;Yv.PACKAGE_VERSION="0.33.0";Yv.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var pMe=F(iE=>{"use strict";A();Object.defineProperty(iE,"__esModule",{value:!0});iE.TediousInstrumentation=iE.INJECTED_CTX=void 0;var Kv=(Ge(),ke(Ze)),OCt=Fe("events"),PA=tn(),gy=(Kn(),ke(Ur)),oE=iMe(),uMe=aMe(),cMe=sMe(),dMe=Symbol("opentelemetry.instrumentation-tedious.current-database");iE.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var lMe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function l3(e){Object.defineProperty(this,dMe,{value:e,writable:!0})}var GJ=class e extends PA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(cMe.PACKAGE_NAME,cMe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,PA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,PA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new PA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of lMe)(0,PA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,PA.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let n=t.Connection.prototype;for(let r of lMe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return l3.call(this,this.config?.options?.database),this.removeListener("databaseChange",l3),this.on("databaseChange",l3),this.once("end",()=>{this.removeListener("databaseChange",l3)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Kv.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",a=new n.Request(i,d=>{o()});Object.defineProperty(a,iE.INJECTED_CTX,{value:!0});let c=Buffer.from(r,"utf8");a.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,c,{length:c.length}),t.execSql(a)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(a){if(a?.[iE.INJECTED_CTX])return r.apply(this,arguments);if(!(a instanceof OCt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let c=0,d=0,m=()=>d++,h=()=>c++,S=this[dMe],y=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(a),I={};o._dbSemconvStability&PA.SemconvStability.OLD&&(I[oE.ATTR_DB_SYSTEM]=oE.DB_SYSTEM_VALUE_MSSQL,I[oE.ATTR_DB_NAME]=S,I[oE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,I[oE.ATTR_DB_STATEMENT]=y,I[oE.ATTR_DB_SQL_TABLE]=a.table),o._dbSemconvStability&PA.SemconvStability.STABLE&&(I[gy.ATTR_DB_NAMESPACE]=S,I[gy.ATTR_DB_SYSTEM_NAME]=gy.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,I[gy.ATTR_DB_QUERY_TEXT]=y,I[gy.ATTR_DB_COLLECTION_NAME]=a.table),o._netSemconvStability&PA.SemconvStability.OLD&&(I[oE.ATTR_NET_PEER_NAME]=this.config?.server,I[oE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&PA.SemconvStability.STABLE&&(I[gy.ATTR_SERVER_ADDRESS]=this.config?.server,I[gy.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,uMe.getSpanName)(t,S,y,a.table),{kind:Kv.SpanKind.CLIENT,attributes:I}),x=(0,uMe.once)(G=>{a.removeListener("done",m),a.removeListener("doneInProc",m),a.removeListener("doneProc",h),a.removeListener("error",x),this.removeListener("end",x),v.setAttribute("tedious.procedure_count",c),v.setAttribute("tedious.statement_count",d),G&&v.setStatus({code:Kv.SpanStatusCode.ERROR,message:G.message}),v.end()});a.on("done",m),a.on("doneInProc",m),a.on("doneProc",h),a.once("error",x),this.on("end",x),typeof a.callback=="function"?o._wrap(a,"callback",o._patchCallbackQuery(x)):o._diag.error("Expected request.callback to be a function");let N=()=>Kv.context.with(Kv.trace.setSpan(Kv.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return N();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(N)}return Object.defineProperty(i,"length",{value:r.length,writable:!1}),i}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r),n.apply(this,arguments)}}};iE.TediousInstrumentation=GJ});var fMe=F(d3=>{"use strict";A();Object.defineProperty(d3,"__esModule",{value:!0});d3.TediousInstrumentation=void 0;var wCt=pMe();Object.defineProperty(d3,"TediousInstrumentation",{enumerable:!0,get:function(){return wCt.TediousInstrumentation}})});var AMe,MCt,mMe,gMe,kCt,hMe,_Me=O(()=>{A();AMe=ie(fMe(),1);dt();fr();MCt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),mMe="Tedious",gMe=at(mMe,()=>new AMe.TediousInstrumentation({})),kCt=()=>{let e;return{name:mMe,setupOnce(){let t=gMe();e=oN(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=Nt(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";MCt.has(i)&&n.setAttribute(Mt,"auto.db.otel.tedious")}))}}},hMe=kCt});var EMe=F(Jv=>{"use strict";A();Object.defineProperty(Jv,"__esModule",{value:!0});Jv.PACKAGE_NAME=Jv.PACKAGE_VERSION=void 0;Jv.PACKAGE_VERSION="0.57.0";Jv.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var yMe=F(p3=>{"use strict";A();Object.defineProperty(p3,"__esModule",{value:!0});p3.GenericPoolInstrumentation=void 0;var Zv=(Ge(),ke(Ze)),hy=tn(),SMe=EMe(),jJ="generic-pool",zJ=class extends hy.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(SMe.PACKAGE_NAME,SMe.PACKAGE_VERSION,t)}init(){return[new hy.InstrumentationNodeModuleDefinition(jJ,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,hy.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new hy.InstrumentationNodeModuleDefinition(jJ,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,hy.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new hy.InstrumentationNodeModuleDefinition(jJ,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,hy.isWrapped)(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){let n=this;return function(...o){let i=Zv.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return Zv.context.with(Zv.trace.setSpan(i,a),()=>t.call(this,...o).then(c=>(a.end(),c),c=>{throw a.recordException(c),a.end(),c}))}}_poolWrapper(t){let n=this;return function(){let o=t.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(t){let n=this;return function(o,i){if(n._isDisabled)return t.call(this,o,i);let a=Zv.context.active(),c=n.tracer.startSpan("generic-pool.acquire",{},a);return Zv.context.with(Zv.trace.setSpan(a,c),()=>{t.call(this,(d,m)=>{if(c.end(),o)return o(d,m)},i)})}}};p3.GenericPoolInstrumentation=zJ});var TMe=F(f3=>{"use strict";A();Object.defineProperty(f3,"__esModule",{value:!0});f3.GenericPoolInstrumentation=void 0;var PCt=yMe();Object.defineProperty(f3,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return PCt.GenericPoolInstrumentation}})});var CMe,IMe,bMe,UCt,vMe,RMe=O(()=>{A();CMe=ie(TMe(),1);dt();fr();IMe="GenericPool",bMe=at(IMe,()=>new CMe.GenericPoolInstrumentation({})),UCt=()=>{let e;return{name:IMe,setupOnce(){let t=bMe();e=oN(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=Nt(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Mt,"auto.db.otel.generic_pool")}))}}},vMe=UCt});var HJ=F(UA=>{"use strict";A();Object.defineProperty(UA,"__esModule",{value:!0});UA.ATTR_NET_PEER_PORT=UA.ATTR_NET_PEER_NAME=UA.ATTR_MESSAGING_SYSTEM=UA.ATTR_MESSAGING_OPERATION=void 0;UA.ATTR_MESSAGING_OPERATION="messaging.operation";UA.ATTR_MESSAGING_SYSTEM="messaging.system";UA.ATTR_NET_PEER_NAME="net.peer.name";UA.ATTR_NET_PEER_PORT="net.peer.port"});var $J=F(pi=>{"use strict";A();Object.defineProperty(pi,"__esModule",{value:!0});pi.ATTR_MESSAGING_CONVERSATION_ID=pi.OLD_ATTR_MESSAGING_MESSAGE_ID=pi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=pi.ATTR_MESSAGING_URL=pi.ATTR_MESSAGING_PROTOCOL_VERSION=pi.ATTR_MESSAGING_PROTOCOL=pi.MESSAGING_OPERATION_VALUE_PROCESS=pi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=pi.ATTR_MESSAGING_DESTINATION_KIND=pi.ATTR_MESSAGING_DESTINATION=void 0;pi.ATTR_MESSAGING_DESTINATION="messaging.destination";pi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";pi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";pi.MESSAGING_OPERATION_VALUE_PROCESS="process";pi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";pi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";pi.ATTR_MESSAGING_URL="messaging.url";pi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";pi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";pi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var VJ=F(_y=>{"use strict";A();Object.defineProperty(_y,"__esModule",{value:!0});_y.DEFAULT_CONFIG=_y.EndOperation=void 0;var LCt;(function(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"})(LCt=_y.EndOperation||(_y.EndOperation={}));_y.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var NMe=F(fi=>{"use strict";A();Object.defineProperty(fi,"__esModule",{value:!0});fi.isConfirmChannelTracing=fi.unmarkConfirmChannelTracing=fi.markConfirmChannelTracing=fi.getConnectionAttributesFromUrl=fi.getConnectionAttributesFromServer=fi.normalizeExchange=fi.CONNECTION_ATTRIBUTES=fi.CHANNEL_CONSUME_TIMEOUT_TIMER=fi.CHANNEL_SPANS_NOT_ENDED=fi.MESSAGE_STORED_SPAN=void 0;var qJ=(Ge(),ke(Ze)),aE=tn(),A3=(Kn(),ke(Ur)),TO=HJ(),m3=$J();fi.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");fi.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");fi.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");fi.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var YJ=(0,qJ.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),QCt=e=>e!==""?e:"<default>";fi.normalizeExchange=QCt;var FCt=e=>e.replace(/:[^:@/]*@/,":***@"),xMe=(e,t)=>e||(t==="AMQP"?5672:5671),DMe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},BMe=e=>e||"localhost",LA=(e,t,n,r)=>n?{[t]:n}:(qJ.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),GCt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[TO.ATTR_MESSAGING_SYSTEM]:t}:{}};fi.getConnectionAttributesFromServer=GCt;var jCt=(e,t)=>{let n={[m3.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=DMe(r?.protocol);Object.assign(n,{...LA(e,m3.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=BMe(r?.hostname);t&aE.SemconvStability.OLD&&Object.assign(n,{...LA(e,TO.ATTR_NET_PEER_NAME,i,"hostname")}),t&aE.SemconvStability.STABLE&&Object.assign(n,{...LA(e,A3.ATTR_SERVER_ADDRESS,i,"hostname")});let a=xMe(r.port,o);t&aE.SemconvStability.OLD&&Object.assign(n,LA(e,TO.ATTR_NET_PEER_PORT,a,"port")),t&aE.SemconvStability.STABLE&&Object.assign(n,LA(e,A3.ATTR_SERVER_PORT,a,"port"))}else{let r=FCt(e);n[m3.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=DMe(o.protocol);Object.assign(n,{...LA(r,m3.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let a=BMe(o.hostname);t&aE.SemconvStability.OLD&&Object.assign(n,{...LA(r,TO.ATTR_NET_PEER_NAME,a,"hostname")}),t&aE.SemconvStability.STABLE&&Object.assign(n,{...LA(r,A3.ATTR_SERVER_ADDRESS,a,"hostname")});let c=xMe(o.port?parseInt(o.port):void 0,i);t&aE.SemconvStability.OLD&&Object.assign(n,LA(r,TO.ATTR_NET_PEER_PORT,c,"port")),t&aE.SemconvStability.STABLE&&Object.assign(n,LA(r,A3.ATTR_SERVER_PORT,c,"port"))}catch(o){qJ.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};fi.getConnectionAttributesFromUrl=jCt;var zCt=e=>e.setValue(YJ,!0);fi.markConfirmChannelTracing=zCt;var HCt=e=>e.deleteValue(YJ);fi.unmarkConfirmChannelTracing=HCt;var $Ct=e=>e.getValue(YJ)===!0;fi.isConfirmChannelTracing=$Ct});var OMe=F(Wv=>{"use strict";A();Object.defineProperty(Wv,"__esModule",{value:!0});Wv.PACKAGE_NAME=Wv.PACKAGE_VERSION=void 0;Wv.PACKAGE_VERSION="0.61.0";Wv.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var MMe=F(_3=>{"use strict";A();Object.defineProperty(_3,"__esModule",{value:!0});_3.AmqplibInstrumentation=void 0;var Ko=(Ge(),ke(Ze)),g3=Tr(),Ir=tn(),VCt=HJ(),Ul=$J(),$u=VJ(),Ai=NMe(),wMe=OMe(),h3=[">=0.5.5 <1"],KJ=class extends Ir.InstrumentationBase{_netSemconvStability;constructor(t={}){super(wMe.PACKAGE_NAME,wMe.PACKAGE_VERSION,{...$u.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ir.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...$u.DEFAULT_CONFIG,...t})}init(){let t=new Ir.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",h3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Ir.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",h3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Ir.InstrumentationNodeModuleFile("amqplib/lib/connect.js",h3,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new Ir.InstrumentationNodeModuleDefinition("amqplib",h3,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,Ir.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,Ir.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,Ir.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,Ir.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,Ir.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,$u.EndOperation.Ack)),(0,Ir.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,$u.EndOperation.Nack)),(0,Ir.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,$u.EndOperation.Reject)),(0,Ir.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,$u.EndOperation.AckAll)),(0,Ir.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,$u.EndOperation.NackAll)),(0,Ir.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,Ir.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,Ir.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,Ir.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,Ir.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,Ir.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,Ir.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,Ir.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,Ir.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,Ir.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,Ir.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,a){return t.call(this,o,i,function(c,d){if(c==null){let m=(0,Ai.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,Ai.getConnectionAttributesFromServer)(d);d[Ai.CONNECTION_ATTRIBUTES]={...m,...h}}a.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,$u.EndOperation.ChannelClosed,void 0);let i=this[Ai.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[Ai.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,$u.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(a){return o.endAllSpansOnChannel(this,t,n,a),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(a,c,d){let m=this,h=n===$u.EndOperation.Reject?c:d,S=m[Ai.CHANNEL_SPANS_NOT_ENDED]??[],y=S.findIndex(I=>I.msg===a);if(y<0)o.endConsumerSpan(a,t,n,h);else if(n!==$u.EndOperation.Reject&&c){for(let I=0;I<=y;I++)o.endConsumerSpan(S[I].msg,t,n,h);S.splice(0,y+1)}else o.endConsumerSpan(a,t,n,h),S.splice(y,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,a,c){let d=this;if(!Object.prototype.hasOwnProperty.call(d,Ai.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let S=setInterval(()=>{r.checkConsumeTimeoutOnChannel(d)},h);S.unref(),d[Ai.CHANNEL_CONSUME_TIMEOUT_TIMER]=S}d[Ai.CHANNEL_SPANS_NOT_ENDED]=[]}let m=function(h){if(!h)return a.call(this,h);let S=h.properties.headers??{},y=Ko.propagation.extract(Ko.ROOT_CONTEXT,S),I=h.fields?.exchange,v;if(r._config.useLinksForConsume){let Q=y?Ko.trace.getSpan(y)?.spanContext():void 0;y=void 0,Q&&(v=[{context:Q}])}let x=r.tracer.startSpan(`${i} process`,{kind:Ko.SpanKind.CONSUMER,attributes:{...d?.connection?.[Ai.CONNECTION_ATTRIBUTES],[Ul.ATTR_MESSAGING_DESTINATION]:I,[Ul.ATTR_MESSAGING_DESTINATION_KIND]:Ul.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Ul.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[VCt.ATTR_MESSAGING_OPERATION]:Ul.MESSAGING_OPERATION_VALUE_PROCESS,[Ul.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[Ul.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},y),{consumeHook:N}=r.getConfig();N&&(0,Ir.safeExecuteInTheMiddle)(()=>N(x,{moduleVersion:t,msg:h}),Q=>{Q&&Ko.diag.error("amqplib instrumentation: consumerHook error",Q)},!0),c?.noAck||(d[Ai.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,g3.hrTime)()}),h[Ai.MESSAGE_STORED_SPAN]=x);let M=y||Ko.ROOT_CONTEXT;Ko.context.with(Ko.trace.setSpan(M,x),()=>{a.call(this,h)}),c?.noAck&&(r.callConsumeEndHook(x,h,!1,$u.EndOperation.AutoAck),x.end())};return arguments[1]=m,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,a,c,d,m){let h=this,{span:S,modifiedOptions:y}=r.createPublishSpan(r,i,a,h,d),{publishHook:I}=r.getConfig();I&&(0,Ir.safeExecuteInTheMiddle)(()=>I(S,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:y,isConfirmChannel:!0}),M=>{M&&Ko.diag.error("amqplib instrumentation: publishHook error",M)},!0);let v=function(M,Q){try{m?.call(this,M,Q)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,Ir.safeExecuteInTheMiddle)(()=>j(S,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:d,isConfirmChannel:!0,confirmError:M}),G=>{G&&Ko.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),M&&S.setStatus({code:Ko.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),S.end()}},x=(0,Ai.markConfirmChannelTracing)(Ko.context.active()),N=[...arguments];return N[3]=y,N[4]=Ko.context.bind((0,Ai.unmarkConfirmChannelTracing)(Ko.trace.setSpan(x,S)),v),Ko.context.with(x,n.bind(this,...N))}}getPublishPatch(t,n){let r=this;return function(i,a,c,d){if((0,Ai.isConfirmChannelTracing)(Ko.context.active()))return n.apply(this,arguments);{let m=this,{span:h,modifiedOptions:S}=r.createPublishSpan(r,i,a,m,d),{publishHook:y}=r.getConfig();y&&(0,Ir.safeExecuteInTheMiddle)(()=>y(h,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:S,isConfirmChannel:!1}),x=>{x&&Ko.diag.error("amqplib instrumentation: publishHook error",x)},!0);let I=[...arguments];I[3]=S;let v=n.apply(this,I);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let a=(0,Ai.normalizeExchange)(n),c=t.tracer.startSpan(`publish ${a}`,{kind:Ko.SpanKind.PRODUCER,attributes:{...o.connection[Ai.CONNECTION_ATTRIBUTES],[Ul.ATTR_MESSAGING_DESTINATION]:n,[Ul.ATTR_MESSAGING_DESTINATION_KIND]:Ul.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Ul.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[Ul.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[Ul.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),d=i??{};return d.headers=d.headers??{},Ko.propagation.inject(Ko.trace.setSpan(Ko.context.active(),c),d.headers),{span:c,modifiedOptions:d}}endConsumerSpan(t,n,r,o){let i=t[Ai.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:Ko.SpanStatusCode.ERROR,message:r!==$u.EndOperation.ChannelClosed&&r!==$u.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[Ai.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[Ai.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(a=>{this.endConsumerSpan(a.msg,n,r,o)}),t[Ai.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,Ir.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),a=>{a&&Ko.diag.error("amqplib instrumentation: consumerEndHook error",a)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,g3.hrTime)(),r=t[Ai.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let a=r[o],c=(0,g3.hrTimeDuration)(a.timeOfConsume,n);if((0,g3.hrTimeToMilliseconds)(c)<i)break;this.endConsumerSpan(a.msg,null,$u.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};_3.AmqplibInstrumentation=KJ});var PMe=F(sE=>{"use strict";A();Object.defineProperty(sE,"__esModule",{value:!0});sE.EndOperation=sE.DEFAULT_CONFIG=sE.AmqplibInstrumentation=void 0;var qCt=MMe();Object.defineProperty(sE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return qCt.AmqplibInstrumentation}});var kMe=VJ();Object.defineProperty(sE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return kMe.DEFAULT_CONFIG}});Object.defineProperty(sE,"EndOperation",{enumerable:!0,get:function(){return kMe.EndOperation}})});var UMe,LMe,YCt,QMe,KCt,FMe,GMe=O(()=>{A();UMe=ie(PMe(),1);fr();LMe="Amqplib",YCt={consumeEndHook:e=>{Lr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{Lr(e,"auto.amqplib.otel.publisher")}},QMe=at(LMe,()=>new UMe.AmqplibInstrumentation(YCt)),KCt=()=>({name:LMe,setupOnce(){QMe()}}),FMe=KCt});var CO,JJ=O(()=>{A();CO="VercelAI"});function ZCt(e){if(typeof e!="object"||e===null)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 WCt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(XCt(t.content),eIt(t.content))}function XCt(e){for(let t of e){if(!ZCt(t))continue;let n=vq(t.toolCallId);n?bl(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),en(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):bl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),en(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function eIt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&Rq(t.toolCallId)}function tIt(e,t,n,r){let o=e?.recordInputs!==void 0?e.recordInputs:t.recordInputs!==void 0?t.recordInputs:n===!0?!0:r,i=e?.recordOutputs!==void 0?e.recordOutputs:t.recordOutputs!==void 0?t.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:i}}var S3,JCt,jMe,E3,zMe=O(()=>{A();S3=ie(tn(),1);dt();JJ();JCt=[">=3.0.0 <7"],jMe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];E3=class e extends S3.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",Jn,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new S3.InstrumentationNodeModuleDefinition("ai",JCt,this._patch.bind(this))}callWhenPatched(t){this._isPatched?t():this._callbacks.push(t)}_patch(t){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,i,a)=>{let c=a[0].experimental_telemetry||{},d=c.isEnabled,m=gt(),h=m?.getIntegrationByName(CO),S=h?.options,y=h?!!m?.getOptions().sendDefaultPii:!1,{recordInputs:I,recordOutputs:v}=tIt(S,c,d,y);return a[0].experimental_telemetry={...c,isEnabled:d!==void 0?d:!0,recordInputs:I,recordOutputs:v},ef(()=>Reflect.apply(o,i,a),x=>{x&&typeof x=="object"&&Vi(x,"_sentry_active_span",Dc())},()=>{},x=>{WCt(x)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of jMe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=jMe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function nIt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var HMe,rIt,$Me,VMe=O(()=>{A();dt();fr();JJ();zMe();HMe=at(CO,()=>new E3({}));rIt=(e={})=>{let t;return{name:CO,options:e,setupOnce(){t=HMe()},afterAllSetup(n){e.force??nIt(n)?bL(n):t?.callWhenPatched(()=>bL(n))}}},$Me=rIt});var T3,oIt,y3,qMe=O(()=>{A();T3=ie(tn(),1);dt();oIt=[">=4.0.0 <7"],y3=class extends T3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",Jn,t)}init(){return new T3.InstrumentationNodeModuleDefinition("openai",oIt,this._patch.bind(this))}_patch(t){let n=t;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(t,n){let r=t[n];if(!r)return t;let o=this.getConfig(),i=function(...a){if(GS(N_))return Reflect.construct(r,a);let c=Reflect.construct(r,a);return xL(c,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let a of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(a)){let c=Object.getOwnPropertyDescriptor(r,a);c&&Object.defineProperty(i,a,c)}try{t[n]=i}catch{Object.defineProperty(t,n,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=i}catch{Object.defineProperty(t,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return t}}});var YMe,iIt,KMe,JMe=O(()=>{A();dt();fr();qMe();YMe=at(N_,e=>new y3(e)),iIt=(e={})=>({name:N_,setupOnce(){YMe(e)}}),KMe=iIt});var I3,aIt,C3,ZMe=O(()=>{A();I3=ie(tn(),1);dt();aIt=[">=0.19.2 <1.0.0"],C3=class extends I3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",Jn,t)}init(){return new I3.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",aIt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(GS(O_))return Reflect.construct(n,i);let a=Reflect.construct(n,i);return DL(a,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(o,i,a)}try{t.Anthropic=o}catch{Object.defineProperty(t,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(t.default===n)try{t.default=o}catch{Object.defineProperty(t,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return t}}});var WMe,sIt,XMe,eke=O(()=>{A();dt();fr();ZMe();WMe=at(O_,e=>new C3(e)),sIt=(e={})=>({name:O_,options:e,setupOnce(){WMe(e)}}),XMe=sIt});var Xv,tke,b3,nke=O(()=>{A();Xv=ie(tn(),1);dt();tke=[">=0.10.0 <2"],b3=class extends Xv.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",Jn,t)}init(){return new Xv.InstrumentationNodeModuleDefinition("@google/genai",tke,n=>this._patch(n),n=>n,[new Xv.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",tke,n=>this._patch(n),n=>n)])}_patch(t){let n=t.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return t;let o=function(...i){if(GS(w_))return Reflect.construct(n,i);let a=Reflect.construct(n,i);return BL(a,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(o,i,a)}return nN(t,"GoogleGenAI",o),t}}});var rke,uIt,oke,ike=O(()=>{A();dt();fr();nke();rke=at(w_,e=>new b3(e)),uIt=(e={})=>({name:w_,setupOnce(){rke(e)}}),oke=uIt});function cIt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function lIt(e,t,n){return new Proxy(e,{apply(r,o,i){let c=i[1];(!c||typeof c!="object"||Array.isArray(c))&&(c={},i[1]=c);let d=c.callbacks,m=cIt(d,t);return c.callbacks=m,Reflect.apply(r,o,i)}})}var uE,v3,R3,ake=O(()=>{A();uE=ie(tn(),1);dt();v3=[">=0.1.0 <2.0.0"];R3=class extends uE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",Jn,t)}init(){let t=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)t.push(new uE.InstrumentationNodeModuleDefinition(r,v3,this._patch.bind(this),o=>o,[new uE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,v3,this._patch.bind(this),o=>o)]));return t.push(new uE.InstrumentationNodeModuleDefinition("langchain",v3,this._patch.bind(this),r=>r,[new uE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",v3,this._patch.bind(this),r=>r)])),t}_patch(t){zV([N_,O_,w_]);let n=ML(this.getConfig());return this._patchRunnableMethods(t,n),t}_patchRunnableMethods(t,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=t.universal_exports??t,i=Object.values(o).find(d=>typeof d=="function"&&r.includes(d.name));if(!i)return;let a=i.prototype;if(a.__sentry_patched__)return;a.__sentry_patched__=!0;let c=["invoke","stream","batch"];for(let d of c){let m=a[d];typeof m=="function"&&(a[d]=lIt(m,n))}}}});var ske,dIt,uke,cke=O(()=>{A();dt();fr();ake();ske=at(NL,e=>new R3(e)),dIt=(e={})=>({name:NL,setupOnce(){ske(e)}}),uke=dIt});var eR,lke,x3,dke=O(()=>{A();eR=ie(tn(),1);dt();lke=[">=0.0.0 <2.0.0"],x3=class extends eR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",Jn,t)}init(){return new eR.InstrumentationNodeModuleDefinition("@langchain/langgraph",lke,this._patch.bind(this),n=>n,[new eR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",lke,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&PL(t.StateGraph.prototype,this.getConfig()),t}}});var pke,pIt,fke,Ake=O(()=>{A();dt();fr();dke();pke=at(kL,e=>new x3(e)),pIt=(e={})=>({name:kL,setupOnce(){pke(e)}}),fke=pIt});import*as gke from"node:net";function hke(e,t,n,r,o){let a=()=>{},c=o.firestoreSpanCreationHook;typeof c=="function"&&(a=h=>{(0,Bg.safeExecuteInTheMiddle)(()=>c(h),S=>{S&&Cl.error(S?.message)},!0)});let d=new Bg.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>mke(h,n,r,e,a)),m=["@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"];for(let h of m)d.files.push(new Bg.InstrumentationNodeModuleFile(h,t,S=>mke(S,n,r,e,a),S=>_ke(S,r)));return d}function mke(e,t,n,r,o){return _ke(e,n),t(e,"addDoc",fIt(r,o)),t(e,"getDocs",mIt(r,o)),t(e,"setDoc",gIt(r,o)),t(e,"deleteDoc",AIt(r,o)),e}function _ke(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Bg.isWrapped)(e[n])&&t(e,n);return e}function fIt(e,t){return function(r){return function(o,i){let a=B3(e,"addDoc",o);return t(a),D3(a,()=>r(o,i))}}}function AIt(e,t){return function(r){return function(o){let i=B3(e,"deleteDoc",o.parent||o);return t(i),D3(i,()=>r(o))}}}function mIt(e,t){return function(r){return function(o){let i=B3(e,"getDocs",o);return t(i),D3(i,()=>r(o))}}}function gIt(e,t){return function(r){return function(o,i,a){let c=B3(e,"setDoc",o.parent||o);return t(c),D3(c,()=>typeof a<"u"?r(o,i,a):r(o,i))}}}function D3(e,t){return Ye.with(zt.setSpan(Ye.active(),e),()=>(0,Bg.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function B3(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:oo.CLIENT});return _It(r,n),r.setAttribute(FI,t),r}function hIt(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(gke.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(":");r!==-1?(t=e.host.slice(0,r),n=e.host.slice(r+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function _It(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},a={[f5]:t.path,[A5]:n.name,[CS]:"firebase.firestore","firebase.firestore.type":t.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:c,port:d}=hIt(i);c&&(a[T5]=c),d&&(a[C5]=d),e.setAttributes(a)}var Bg,Eke=O(()=>{A();Ge();Bg=ie(tn(),1);Kn()});function Ske(e,t,n,r,o){let i=()=>{},a=()=>{},c=o.functions?.errorHook,d=o.functions?.requestHook,m=o.functions?.responseHook;typeof m=="function"&&(a=(y,I)=>{(0,Ng.safeExecuteInTheMiddle)(()=>m(y,I),v=>{v&&Cl.error(v?.message)},!0)}),typeof d=="function"&&(i=y=>{(0,Ng.safeExecuteInTheMiddle)(()=>d(y),I=>{I&&Cl.error(I?.message)},!0)});let h=new Ng.InstrumentationNodeModuleDefinition("firebase-functions",t);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:y,triggerType:I})=>{h.files.push(new Ng.InstrumentationNodeModuleFile(y,t,v=>EIt(v,n,r,e,{requestHook:i,responseHook:a,errorHook:c},I),v=>yke(v,r)))}),h}function Vu(e,t,n){return function(o){return function(...i){let a=typeof i[0]=="function"?i[0]:i[1],c=typeof i[0]=="function"?void 0:i[0];if(!a)return o.call(this,...i);let d=async function(...m){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",S=e.startSpan(`firebase.function.${n}`,{kind:oo.SERVER}),y={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(y["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(y["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),S.setAttributes(y),t?.requestHook?.(S),Ye.with(zt.setSpan(Ye.active(),S),async()=>{let I,v;try{v=await a.apply(this,m)}catch(x){I=x}if(t?.responseHook?.(S,I),I&&S.recordException(I),S.end(),I)throw await t?.errorHook?.(S,I),I;return v})};return c?o.call(this,c,d):o.call(this,d)}}}function EIt(e,t,n,r,o,i){switch(yke(e,n),i){case"function":t(e,"onRequest",Vu(r,o,"http.request")),t(e,"onCall",Vu(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",Vu(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",Vu(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",Vu(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",Vu(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",Vu(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",Vu(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",Vu(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",Vu(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",Vu(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",Vu(r,o,"storage.object.finalized")),t(e,"onObjectArchived",Vu(r,o,"storage.object.archived")),t(e,"onObjectDeleted",Vu(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",Vu(r,o,"storage.object.metadataUpdated"));break}return e}function yke(e,t){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Ng.isWrapped)(e[r])&&t(e,r);return e}var Ng,Tke=O(()=>{A();Ge();Ng=ie(tn(),1)});var Ike,Cke,SIt,yIt,N3,bke=O(()=>{A();Ike=ie(tn(),1);dt();Eke();Tke();Cke={},SIt=[">=3.0.0 <5"],yIt=[">=6.0.0 <7"],N3=class extends Ike.InstrumentationBase{constructor(t=Cke){super("@sentry/instrumentation-firebase",Jn,t)}setConfig(t={}){super.setConfig({...Cke,...t})}init(){let t=[];return t.push(hke(this.tracer,SIt,this._wrap,this._unwrap,this.getConfig())),t.push(Ske(this.tracer,yIt,this._wrap,this._unwrap,this.getConfig())),t}}});var vke,TIt,Rke,CIt,xke,Dke=O(()=>{A();dt();fr();bke();vke="Firebase",TIt={firestoreSpanCreationHook:e=>{Lr(e,"auto.firebase.otel.firestore"),e.setAttribute(Zt,"db.query")},functions:{requestHook:e=>{Lr(e,"auto.firebase.otel.functions"),e.setAttribute(Zt,"http.request")},errorHook:async(e,t)=>{t&&(en(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Ib(2e3))}}},Rke=at(vke,()=>new N3(TIt)),CIt=()=>({name:vke,setupOnce(){Rke()}}),xke=CIt});function Bke(){return[wxe(),f1e(),F1e(),xwe(),RBe(),jBe(),eNe(),pNe(),HNe(),dOe(),cwe(),Cwe(),Hwe(),rMe(),hMe(),vMe(),rBe(),FMe(),ABe(),uke(),fke(),$Me(),KMe(),XMe(),oke(),mOe(),xke()]}var Nke=O(()=>{A();GMe();eke();oMe();Mxe();g1e();Dke();RMe();ike();j1e();Iwe();Dwe();oBe();$we();cke();Ake();mBe();xBe();zBe();tNe();fNe();JMe();pOe();gOe();lwe();$Ne();_Me();VMe()});function wke(e,t={}){e.getOptions().debug&&oY();let[n,r]=IIt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function IIt(e,t={}){let n=new Oke.BasicTracerProvider({sampler:new jQ(e),resource:(0,O3.defaultResource)().merge((0,O3.resourceFromAttributes)({[I5]:"node",[p5]:"sentry",[b5]:Jn})),forceFlushTimeoutMillis:500,spanProcessors:[new GQ({timeout:bIt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});zt.setGlobalTracerProvider(n),Hp.setGlobalPropagator(new FQ);let r=new HQ;return Ye.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function bIt(e){if(e!=null){if(e>ZJ)return Sa&&J.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${ZJ}`),ZJ;if(e<=0||Number.isNaN(e)){Sa&&J.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var O3,Oke,ZJ,Mke=O(()=>{A();Ge();O3=ie(h7(),1),Oke=ie(z7(),1);Kn();dt();fr();nv();oy();ZJ=1e6});function kke(){return ZQ().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(cxe(),_xe())}function Pke(e){return[...kke(),...Ri(e)?Bke():[]]}function WJ(e={}){return vIt(e,Pke)}function vIt(e={},t){jS(e,"node");let n=BY({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(wke(n,{spanProcessors:e.openTelemetrySpanProcessors}),WQ()),n}var Uke=O(()=>{A();dt();fr();lxe();Exe();Nke();Mke()});var tR=O(()=>{A();Uke();dt();fr()});function ta(){return RIt}function qu(){return Lke}function Qke(){return xIt}var RIt,Lke,xIt,Ll=O(()=>{"use strict";A();RIt="prod",Lke="0.1.111",xIt=`@tanagram/lore/${Lke}`});function wIt(e=""){if(!NIt.test(e))return e!==e.toLowerCase()}function Fke(e,t){let n=t??OIt,r=[];if(!e||typeof e!="string")return r;let o="",i,a;for(let c of e){let d=n.includes(c);if(d===!0){r.push(o),o="",i=void 0;continue}let m=wIt(c);if(a===!1){if(i===!1&&m===!0){r.push(o),o=c,i=m;continue}if(i===!0&&m===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+c,i=m;continue}}o+=c,i=m,a=d}return r.push(o),r}function MIt(e){return e?e[0].toUpperCase()+e.slice(1):""}function kIt(e){return e?e[0].toLowerCase()+e.slice(1):""}function PIt(e,t){return e?(Array.isArray(e)?e:Fke(e)).map(n=>MIt(t?.normalize?n.toLowerCase():n)).join(""):""}function bO(e,t){return kIt(PIt(e||"",t))}function w3(e,t){return e?(Array.isArray(e)?e:Fke(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function Gke(e){return w3(e||"","_")}var NIt,OIt,jke=O(()=>{A();NIt=/\d/,OIt=["-","_","/","."]});import{parseArgs as UIt}from"node:util";function U3(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function XJ(e,t=""){let n=[];for(let r of e)for(let[o,i]of r.entries())n[o]=Math.max(n[o]||0,i.length);return e.map(r=>r.map((o,i)=>t+o[i===0?"padStart":"padEnd"](n[i])).join(" ")).join(`
|
|
38
|
+
Mongoose Error Code: ${t.code}`:""}`})}function NK(e,t,n,r=void 0){n&&(0,KN.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&DBe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function V0t(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(NK(t,o,n,r),o)).catch(o=>{throw BBe(t,o),o}).finally(()=>t.end()):(NK(t,e,n,r),t.end(),e)}z_.handlePromiseResponse=V0t;function q0t(e,t,n,r,o,i,a=void 0){let c=0;return o.length===2?c=1:o.length===3&&(c=2),o[c]=(d,m)=>(d?BBe(r,d):NK(r,m,i,a),r.end(),e(d,m)),t.apply(n,o)}z_.handleCallbackResponse=q0t});var OBe=F(Iv=>{"use strict";A();Object.defineProperty(Iv,"__esModule",{value:!0});Iv.PACKAGE_NAME=Iv.PACKAGE_VERSION=void 0;Iv.PACKAGE_VERSION="0.60.0";Iv.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var UBe=F(kc=>{"use strict";A();Object.defineProperty(kc,"__esModule",{value:!0});kc.MongooseInstrumentation=kc._ALREADY_INSTRUMENTED=kc._STORED_PARENT_SPAN=void 0;var Ta=(Ge(),ke(Ze)),Y0t=Tr(),OK=NBe(),Ds=tn(),wBe=OBe(),H_=BK(),dy=(Kn(),ke(Ur)),oF=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],K0t=["remove","count","findOneAndRemove",...oF],J0t=["count","findOneAndRemove",...oF],Z0t=[...oF];function MBe(e){return e?e.startsWith("6.")||e.startsWith("5.")?K0t:e.startsWith("7.")?J0t:Z0t:oF}function kBe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function PBe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}kc._STORED_PARENT_SPAN=Symbol("stored-parent-span");kc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var wK=class extends Ds.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(wBe.PACKAGE_NAME,wBe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ds.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ds.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Ds.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,kBe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),PBe(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),MBe(n).forEach(i=>{this._wrap(r.Query.prototype,i,this.patchAndCaptureSpanContext(i))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t,o=MBe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,kBe(n)&&this._unwrap(r.Model.prototype,"remove"),PBe(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(i=>{this._unwrap(r.Query.prototype,i)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(t){let n=this;return r=>function(i){if(n.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return r.apply(this,arguments);let a=this[kc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=n.getConfig();if(d){let h=d("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Ds.SemconvStability.OLD&&(c[H_.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ds.SemconvStability.STABLE&&(c[dy.ATTR_DB_QUERY_TEXT]=h)}let m=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",c,a);return n._handleResponse(m,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[kc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return r.apply(this,arguments);let a=this[kc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=n.getConfig();if(d){let h=d(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Ds.SemconvStability.OLD&&(c[H_.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ds.SemconvStability.STABLE&&(c[dy.ATTR_DB_QUERY_TEXT]=h)}let m=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,c,a);return n._handleResponse(m,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(a,c){if(r.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return o.apply(this,arguments);let d={document:this};a&&!(a instanceof Function)&&(d.options=a);let m={},{dbStatementSerializer:h}=r.getConfig();if(h){let y=h(t,d);r._dbSemconvStability&Ds.SemconvStability.OLD&&(m[H_.ATTR_DB_STATEMENT]=y),r._dbSemconvStability&Ds.SemconvStability.STABLE&&(m[dy.ATTR_DB_QUERY_TEXT]=y)}let S=r._startSpan(this.constructor.collection,this.constructor.modelName,t,m);return a instanceof Function&&(c=a,a=void 0),r._handleResponse(S,o,this,arguments,c,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(a,c,d){if(r.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return o.apply(this,arguments);let m=d,h=a,S=c;typeof a=="function"?(m=a,h=void 0,S=void 0):typeof c=="function"&&(m=c,S=void 0);let y={},I=r.getConfig().dbStatementSerializer;if(I){let N=I(t,{condition:{_id:this._id},updates:h,options:S});r._dbSemconvStability&Ds.SemconvStability.OLD&&(y[H_.ATTR_DB_STATEMENT]=N),r._dbSemconvStability&Ds.SemconvStability.STABLE&&(y[dy.ATTR_DB_QUERY_TEXT]=N)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,y),x=r._handleResponse(v,o,this,arguments,m,n);return x&&typeof x=="object"&&(x[kc._ALREADY_INSTRUMENTED]=!0),x}}patchModelStatic(t,n){let r=this;return o=>function(a,c,d){if(r.getConfig().requireParentSpan&&Ta.trace.getSpan(Ta.context.active())===void 0)return o.apply(this,arguments);typeof c=="function"&&(d=c,c=void 0);let m={};switch(t){case"insertMany":m.documents=a;break;case"bulkWrite":m.operations=a;break;default:m.document=a;break}c!==void 0&&(m.options=c);let h={},{dbStatementSerializer:S}=r.getConfig();if(S){let I=S(t,m);r._dbSemconvStability&Ds.SemconvStability.OLD&&(h[H_.ATTR_DB_STATEMENT]=I),r._dbSemconvStability&Ds.SemconvStability.STABLE&&(h[dy.ATTR_DB_QUERY_TEXT]=I)}let y=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(y,o,this,arguments,d,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=Ta.trace.getSpan(Ta.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[kc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[kc._STORED_PARENT_SPAN]=Ta.trace.getSpan(Ta.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let a={...o,...(0,OK.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Ds.SemconvStability.OLD&&(a[H_.ATTR_DB_OPERATION]=r,a[H_.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Ds.SemconvStability.STABLE&&(a[dy.ATTR_DB_OPERATION_NAME]=r,a[dy.ATTR_DB_SYSTEM_NAME]=H_.DB_SYSTEM_NAME_VALUE_MONGODB);let c=this._dbSemconvStability&Ds.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(c,{kind:Ta.SpanKind.CLIENT,attributes:a},i?Ta.trace.setSpan(Ta.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,a=void 0){let c=this;if(i instanceof Function)return c._callOriginalFunction(()=>(0,OK.handleCallbackResponse)(i,n,r,t,o,c.getConfig().responseHook,a));{let d=c._callOriginalFunction(()=>n.apply(r,o));return(0,OK.handlePromiseResponse)(d,t,c.getConfig().responseHook,a)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Ta.context.with((0,Y0t.suppressTracing)(Ta.context.active()),t):t()}};kc.MongooseInstrumentation=wK});var LBe=F(iF=>{"use strict";A();Object.defineProperty(iF,"__esModule",{value:!0});iF.MongooseInstrumentation=void 0;var W0t=UBe();Object.defineProperty(iF,"MongooseInstrumentation",{enumerable:!0,get:function(){return W0t.MongooseInstrumentation}})});var QBe,FBe,GBe,X0t,jBe,zBe=O(()=>{A();QBe=ie(LBe(),1);fr();FBe="Mongoose",GBe=at(FBe,()=>new QBe.MongooseInstrumentation({responseHook(e){Lr(e,"auto.db.otel.mongoose")}})),X0t=()=>({name:FBe,setupOnce(){GBe()}}),jBe=X0t});var HBe=F(Wi=>{"use strict";A();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Wi.DB_SYSTEM_VALUE_MYSQL=Wi.ATTR_NET_PEER_PORT=Wi.ATTR_NET_PEER_NAME=Wi.ATTR_DB_USER=Wi.ATTR_DB_SYSTEM=Wi.ATTR_DB_STATEMENT=Wi.ATTR_DB_NAME=Wi.ATTR_DB_CONNECTION_STRING=void 0;Wi.ATTR_DB_CONNECTION_STRING="db.connection_string";Wi.ATTR_DB_NAME="db.name";Wi.ATTR_DB_STATEMENT="db.statement";Wi.ATTR_DB_SYSTEM="db.system";Wi.ATTR_DB_USER="db.user";Wi.ATTR_NET_PEER_NAME="net.peer.name";Wi.ATTR_NET_PEER_PORT="net.peer.port";Wi.DB_SYSTEM_VALUE_MYSQL="mysql";Wi.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var $Be=F(JN=>{"use strict";A();Object.defineProperty(JN,"__esModule",{value:!0});JN.AttributeNames=void 0;var eSt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(eSt=JN.AttributeNames||(JN.AttributeNames={}))});var VBe=F(ru=>{"use strict";A();Object.defineProperty(ru,"__esModule",{value:!0});ru.getPoolNameOld=ru.arrayStringifyHelper=ru.getSpanName=ru.getDbValues=ru.getDbQueryText=ru.getJDBCString=ru.getConfig=void 0;function tSt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}ru.getConfig=tSt;function nSt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}ru.getJDBCString=nSt;function rSt(e){return typeof e=="string"?e:e.sql}ru.getDbQueryText=rSt;function oSt(e,t){return MK(typeof e=="string"?t:t||e.values)}ru.getDbValues=oSt;function iSt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}ru.getSpanName=iSt;function MK(e){return e?`[${e.toString()}]`:""}ru.arrayStringifyHelper=MK;function aSt(e){let t=e.config.connectionConfig,n="";return n+=t.host?`host: '${t.host}', `:"",n+=t.port?`port: ${t.port}, `:"",n+=t.database?`database: '${t.database}', `:"",n+=t.user?`user: '${t.user}'`:"",t.user||(n=n.substring(0,n.length-2)),n.trim()}ru.getPoolNameOld=aSt});var qBe=F(bv=>{"use strict";A();Object.defineProperty(bv,"__esModule",{value:!0});bv.PACKAGE_NAME=bv.PACKAGE_VERSION=void 0;bv.PACKAGE_VERSION="0.60.0";bv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var KBe=F(aF=>{"use strict";A();Object.defineProperty(aF,"__esModule",{value:!0});aF.MySQLInstrumentation=void 0;var Pc=(Ge(),ke(Ze)),jd=tn(),vv=(Kn(),ke(Ur)),xg=HBe(),sSt=$Be(),py=VBe(),YBe=qBe(),kK=class extends jd.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(YBe.PACKAGE_NAME,YBe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,jd.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,jd.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(xg.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsageOld?.add(t,{state:r,name:n})}init(){return[new jd.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,jd.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,jd.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,jd.isWrapped)(t.createPoolCluster)&&this._unwrap(t,"createPoolCluster"),this._wrap(t,"createPoolCluster",this._patchCreatePoolCluster()),t),t=>{t!==void 0&&(this._unwrap(t,"createConnection"),this._unwrap(t,"createPool"),this._unwrap(t,"createPoolCluster"))})]}_patchCreateConnection(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),i}}}_patchCreatePool(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"end",n._patchPoolEnd(i)),n._setPoolCallbacks(i,""),i}}}_patchPoolEnd(t){return n=>{let r=this;return function(i){let a=t._allConnections.length,c=t._freeConnections.length,d=a-c,m=(0,py.getPoolNameOld)(t);r._connCountAdd(-d,m,"used"),r._connCountAdd(-c,m,"idle"),n.apply(t,arguments)}}}_patchCreatePoolCluster(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"add",n._patchAdd(i)),i}}}_patchAdd(t){return n=>{let r=this;return function(i,a){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let c=t._nodes;if(c){let d=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),m=c[d].pool;r._setPoolCallbacks(m,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,a,c){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let d=r._getConnectionCallbackPatchFn(i);return n.call(t,d)}if(arguments.length===2&&typeof a=="function"){let d=r._getConnectionCallbackPatchFn(a);return n.call(t,i,d)}if(arguments.length===3&&typeof c=="function"){let d=r._getConnectionCallbackPatchFn(c);return n.call(t,i,a,d)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=Pc.context.active();return function(o,i){i&&((0,jd.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&Pc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,a){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let c={},{host:d,port:m,database:h,user:S}=(0,py.getConfig)(t.config),y=parseInt(m,10),I=(0,py.getDbQueryText)(o);r._dbSemconvStability&jd.SemconvStability.OLD&&(c[xg.ATTR_DB_SYSTEM]=xg.DB_SYSTEM_VALUE_MYSQL,c[xg.ATTR_DB_CONNECTION_STRING]=(0,py.getJDBCString)(d,m,h),c[xg.ATTR_DB_NAME]=h,c[xg.ATTR_DB_USER]=S,c[xg.ATTR_DB_STATEMENT]=I),r._dbSemconvStability&jd.SemconvStability.STABLE&&(c[vv.ATTR_DB_SYSTEM_NAME]=vv.DB_SYSTEM_NAME_VALUE_MYSQL,c[vv.ATTR_DB_NAMESPACE]=h,c[vv.ATTR_DB_QUERY_TEXT]=I),r._netSemconvStability&jd.SemconvStability.OLD&&(c[xg.ATTR_NET_PEER_NAME]=d,isNaN(y)||(c[xg.ATTR_NET_PEER_PORT]=y)),r._netSemconvStability&jd.SemconvStability.STABLE&&(c[vv.ATTR_SERVER_ADDRESS]=d,isNaN(y)||(c[vv.ATTR_SERVER_PORT]=y));let v=r.tracer.startSpan((0,py.getSpanName)(o),{kind:Pc.SpanKind.CLIENT,attributes:c});if(r.getConfig().enhancedDatabaseReporting){let M;Array.isArray(i)?M=i:arguments[2]&&(M=[i]),v.setAttribute(sSt.AttributeNames.MYSQL_VALUES,(0,py.getDbValues)(o,M))}let x=Array.from(arguments).findIndex(M=>typeof M=="function"),N=Pc.context.active();if(x===-1){let M=Pc.context.with(Pc.trace.setSpan(Pc.context.active(),v),()=>n.apply(t,arguments));return Pc.context.bind(N,M),M.on("error",Q=>v.setStatus({code:Pc.SpanStatusCode.ERROR,message:Q.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,x,r._patchCallbackQuery(v,N)),Pc.context.with(Pc.trace.setSpan(Pc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,a){return o&&t.setStatus({code:Pc.SpanStatusCode.ERROR,message:o.message}),t.end(),Pc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,py.getPoolNameOld)(t);t.on("connection",o=>{this._connCountAdd(1,r,"idle")}),t.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),t.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};aF.MySQLInstrumentation=kK});var JBe=F(sF=>{"use strict";A();Object.defineProperty(sF,"__esModule",{value:!0});sF.MySQLInstrumentation=void 0;var uSt=KBe();Object.defineProperty(sF,"MySQLInstrumentation",{enumerable:!0,get:function(){return uSt.MySQLInstrumentation}})});var ZBe,WBe,XBe,cSt,eNe,tNe=O(()=>{A();ZBe=ie(JBe(),1);fr();WBe="Mysql",XBe=at(WBe,()=>new ZBe.MySQLInstrumentation({})),cSt=()=>({name:WBe,setupOnce(){XBe()}}),eNe=cSt});var PK=F(Xa=>{"use strict";A();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.DB_SYSTEM_VALUE_MYSQL=Xa.ATTR_NET_PEER_PORT=Xa.ATTR_NET_PEER_NAME=Xa.ATTR_DB_USER=Xa.ATTR_DB_SYSTEM=Xa.ATTR_DB_STATEMENT=Xa.ATTR_DB_NAME=Xa.ATTR_DB_CONNECTION_STRING=void 0;Xa.ATTR_DB_CONNECTION_STRING="db.connection_string";Xa.ATTR_DB_NAME="db.name";Xa.ATTR_DB_STATEMENT="db.statement";Xa.ATTR_DB_SYSTEM="db.system";Xa.ATTR_DB_USER="db.user";Xa.ATTR_NET_PEER_NAME="net.peer.name";Xa.ATTR_NET_PEER_PORT="net.peer.port";Xa.DB_SYSTEM_VALUE_MYSQL="mysql"});var LK=F(uF=>{"use strict";A();Object.defineProperty(uF,"__esModule",{value:!0});uF.addSqlCommenterComment=void 0;var UK=(Ge(),ke(Ze)),lSt=Tr();function dSt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function pSt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function fSt(e,t){if(typeof t!="string"||t.length===0||dSt(t))return t;let n=new lSt.W3CTraceContextPropagator,r={};n.inject(UK.trace.setSpan(UK.ROOT_CONTEXT,e),r,UK.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(a=>{let c=pSt(r[a]);return`${a}='${c}'`}).join(",");return`${t} /*${i}*/`}uF.addSqlCommenterComment=fSt});var nNe=F(zd=>{"use strict";A();Object.defineProperty(zd,"__esModule",{value:!0});zd.getConnectionPrototypeToInstrument=zd.once=zd.getSpanName=zd.getQueryText=zd.getConnectionAttributes=void 0;var ZN=PK(),cF=tn(),QK=(Kn(),ke(Ur));function ASt(e,t,n){let{host:r,port:o,database:i,user:a}=mSt(e),c={};t&cF.SemconvStability.OLD&&(c[ZN.ATTR_DB_CONNECTION_STRING]=gSt(r,o,i),c[ZN.ATTR_DB_NAME]=i,c[ZN.ATTR_DB_USER]=a),t&cF.SemconvStability.STABLE&&(c[QK.ATTR_DB_NAMESPACE]=i);let d=parseInt(o,10);return n&cF.SemconvStability.OLD&&(c[ZN.ATTR_NET_PEER_NAME]=r,isNaN(d)||(c[ZN.ATTR_NET_PEER_PORT]=d)),n&cF.SemconvStability.STABLE&&(c[QK.ATTR_SERVER_ADDRESS]=r,isNaN(d)||(c[QK.ATTR_SERVER_PORT]=d)),c}zd.getConnectionAttributes=ASt;function mSt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function gSt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function hSt(e,t,n,r=!1,o=_St){let[i,a]=typeof e=="string"?[e,n]:[e.sql,ESt(e)?n||e.values:n];try{return r?o(i):t&&a?t(i,a):i}catch{return"Could not determine the query due to an error in masking or formatting"}}zd.getQueryText=hSt;function _St(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function ESt(e){return"values"in e}function SSt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}zd.getSpanName=SSt;var ySt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};zd.once=ySt;function TSt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}zd.getConnectionPrototypeToInstrument=TSt});var rNe=F(Rv=>{"use strict";A();Object.defineProperty(Rv,"__esModule",{value:!0});Rv.PACKAGE_NAME=Rv.PACKAGE_VERSION=void 0;Rv.PACKAGE_VERSION="0.60.0";Rv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var sNe=F(lF=>{"use strict";A();Object.defineProperty(lF,"__esModule",{value:!0});lF.MySQL2Instrumentation=void 0;var oNe=(Ge(),ke(Ze)),of=tn(),FK=PK(),iNe=LK(),xv=nNe(),aNe=rNe(),GK=(Kn(),ke(Ur)),jK=[">=1.4.2 <4"],zK=class extends of.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(aNe.PACKAGE_NAME,aNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,of.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,of.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let t;function n(i){!t&&i.format&&(t=i.format)}let r=i=>{(0,of.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,of.isWrapped)(i.execute)&&this._unwrap(i,"execute"),this._wrap(i,"execute",this._patchQuery(t,!0))},o=i=>{this._unwrap(i,"query"),this._unwrap(i,"execute")};return[new of.InstrumentationNodeModuleDefinition("mysql2",jK,i=>(n(i),i),()=>{},[new of.InstrumentationNodeModuleFile("mysql2/promise.js",jK,i=>(n(i),i),()=>{}),new of.InstrumentationNodeModuleFile("mysql2/lib/connection.js",jK,i=>{let a=(0,xv.getConnectionPrototypeToInstrument)(i);return r(a),i},i=>{if(i===void 0)return;let a=(0,xv.getConnectionPrototypeToInstrument)(i);o(a)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,a,c){let d;Array.isArray(a)?d=a:arguments[2]&&(d=[a]);let{maskStatement:m,maskStatementHook:h,responseHook:S}=o.getConfig(),y=(0,xv.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),I=(0,xv.getQueryText)(i,t,d,m,h);o._dbSemconvStability&of.SemconvStability.OLD&&(y[FK.ATTR_DB_SYSTEM]=FK.DB_SYSTEM_VALUE_MYSQL,y[FK.ATTR_DB_STATEMENT]=I),o._dbSemconvStability&of.SemconvStability.STABLE&&(y[GK.ATTR_DB_SYSTEM_NAME]=GK.DB_SYSTEM_NAME_VALUE_MYSQL,y[GK.ATTR_DB_QUERY_TEXT]=I);let v=o.tracer.startSpan((0,xv.getSpanName)(i),{kind:oNe.SpanKind.CLIENT,attributes:y});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,iNe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,iNe.addSqlCommenterComment)(v,i.sql)}));let x=(0,xv.once)((N,M)=>{N?v.setStatus({code:oNe.SpanStatusCode.ERROR,message:N.message}):typeof S=="function"&&(0,of.safeExecuteInTheMiddle)(()=>{S(v,{queryResults:M})},Q=>{Q&&o._diag.warn("Failed executing responseHook",Q)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(x));let N=r.apply(this,arguments);return N.once("error",M=>{x(M)}).once("result",M=>{x(void 0,M)}),N}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(x)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(x)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};lF.MySQL2Instrumentation=zK});var uNe=F(dF=>{"use strict";A();Object.defineProperty(dF,"__esModule",{value:!0});dF.MySQL2Instrumentation=void 0;var CSt=sNe();Object.defineProperty(dF,"MySQL2Instrumentation",{enumerable:!0,get:function(){return CSt.MySQL2Instrumentation}})});var cNe,lNe,dNe,ISt,pNe,fNe=O(()=>{A();cNe=ie(uNe(),1);fr();lNe="Mysql2",dNe=at(lNe,()=>new cNe.MySQL2Instrumentation({responseHook(e){Lr(e,"auto.db.otel.mysql2")}})),ISt=()=>({name:lNe,setupOnce(){dNe()}}),pNe=ISt});var ANe=F(ou=>{"use strict";A();Object.defineProperty(ou,"__esModule",{value:!0});ou.DB_SYSTEM_VALUE_REDIS=ou.DB_SYSTEM_NAME_VALUE_REDIS=ou.ATTR_NET_PEER_PORT=ou.ATTR_NET_PEER_NAME=ou.ATTR_DB_SYSTEM=ou.ATTR_DB_STATEMENT=ou.ATTR_DB_CONNECTION_STRING=void 0;ou.ATTR_DB_CONNECTION_STRING="db.connection_string";ou.ATTR_DB_STATEMENT="db.statement";ou.ATTR_DB_SYSTEM="db.system";ou.ATTR_NET_PEER_NAME="net.peer.name";ou.ATTR_NET_PEER_PORT="net.peer.port";ou.DB_SYSTEM_NAME_VALUE_REDIS="redis";ou.DB_SYSTEM_VALUE_REDIS="redis"});var mNe=F(pF=>{"use strict";A();Object.defineProperty(pF,"__esModule",{value:!0});pF.endSpan=void 0;var bSt=(Ge(),ke(Ze)),vSt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:bSt.SpanStatusCode.ERROR,message:t.message})),e.end()};pF.endSpan=vSt});var AF=F(fF=>{"use strict";A();Object.defineProperty(fF,"__esModule",{value:!0});fF.defaultDbStatementSerializer=void 0;var RSt=[{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}],xSt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=RSt.find(({regex:o})=>o.test(e))?.args??0,r=n>=0?t.slice(0,n):t;return t.length>r.length&&r.push(`[${t.length-n} other arguments]`),`${e} ${r.join(" ")}`}return e};fF.defaultDbStatementSerializer=xSt});var gNe=F(Dv=>{"use strict";A();Object.defineProperty(Dv,"__esModule",{value:!0});Dv.PACKAGE_NAME=Dv.PACKAGE_VERSION=void 0;Dv.PACKAGE_VERSION="0.62.0";Dv.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var SNe=F(mF=>{"use strict";A();Object.defineProperty(mF,"__esModule",{value:!0});mF.IORedisInstrumentation=void 0;var $_=(Ge(),ke(Ze)),Uc=tn(),V_=(Kn(),ke(Ur)),Lc=ANe(),hNe=tn(),WN=mNe(),DSt=AF(),_Ne=gNe(),ENe={requireParentSpan:!0},HK=class extends Uc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(_Ne.PACKAGE_NAME,_Ne.PACKAGE_VERSION,{...ENe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Uc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Uc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...ENe,...t})}init(){return[new Uc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Uc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Uc.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(t){return n=>this._traceSendCommand(n,t)}_patchConnection(){return t=>this._traceConnection(t)}_traceSendCommand(t,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return t.apply(this,arguments);let i=r.getConfig(),a=i.dbStatementSerializer||DSt.defaultDbStatementSerializer,c=$_.trace.getSpan($_.context.active())===void 0;if(i.requireParentSpan===!0&&c)return t.apply(this,arguments);let d={},{host:m,port:h}=this.options,S=a(o.name,o.args);r._dbSemconvStability&Uc.SemconvStability.OLD&&(d[Lc.ATTR_DB_SYSTEM]=Lc.DB_SYSTEM_VALUE_REDIS,d[Lc.ATTR_DB_STATEMENT]=S,d[Lc.ATTR_DB_CONNECTION_STRING]=`redis://${m}:${h}`),r._dbSemconvStability&Uc.SemconvStability.STABLE&&(d[V_.ATTR_DB_SYSTEM_NAME]=Lc.DB_SYSTEM_NAME_VALUE_REDIS,d[V_.ATTR_DB_QUERY_TEXT]=S),r._netSemconvStability&Uc.SemconvStability.OLD&&(d[Lc.ATTR_NET_PEER_NAME]=m,d[Lc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Uc.SemconvStability.STABLE&&(d[V_.ATTR_SERVER_ADDRESS]=m,d[V_.ATTR_SERVER_PORT]=h);let y=r.tracer.startSpan(o.name,{kind:$_.SpanKind.CLIENT,attributes:d}),{requestHook:I}=i;I&&(0,hNe.safeExecuteInTheMiddle)(()=>I(y,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&$_.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),x=o.resolve;o.resolve=function(M){(0,hNe.safeExecuteInTheMiddle)(()=>i.responseHook?.(y,o.name,o.args,M),Q=>{Q&&$_.diag.error("ioredis instrumentation: response hook failed",Q)},!0),(0,WN.endSpan)(y,null),x(M)};let N=o.reject;return o.reject=function(M){(0,WN.endSpan)(y,M),N(M)},v}catch(v){throw(0,WN.endSpan)(y,v),v}}}_traceConnection(t){let n=this;return function(){let r=$_.trace.getSpan($_.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:a}=this.options;n._dbSemconvStability&Uc.SemconvStability.OLD&&(o[Lc.ATTR_DB_SYSTEM]=Lc.DB_SYSTEM_VALUE_REDIS,o[Lc.ATTR_DB_STATEMENT]="connect",o[Lc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${a}`),n._dbSemconvStability&Uc.SemconvStability.STABLE&&(o[V_.ATTR_DB_SYSTEM_NAME]=Lc.DB_SYSTEM_NAME_VALUE_REDIS,o[V_.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Uc.SemconvStability.OLD&&(o[Lc.ATTR_NET_PEER_NAME]=i,o[Lc.ATTR_NET_PEER_PORT]=a),n._netSemconvStability&Uc.SemconvStability.STABLE&&(o[V_.ATTR_SERVER_ADDRESS]=i,o[V_.ATTR_SERVER_PORT]=a);let c=n.tracer.startSpan("connect",{kind:$_.SpanKind.CLIENT,attributes:o});try{let d=t.apply(this,arguments);return(0,WN.endSpan)(c,null),d}catch(d){throw(0,WN.endSpan)(c,d),d}}}};mF.IORedisInstrumentation=HK});var yNe=F(gF=>{"use strict";A();Object.defineProperty(gF,"__esModule",{value:!0});gF.IORedisInstrumentation=void 0;var BSt=SNe();Object.defineProperty(gF,"IORedisInstrumentation",{enumerable:!0,get:function(){return BSt.IORedisInstrumentation}})});var hF=F(Bv=>{"use strict";A();Object.defineProperty(Bv,"__esModule",{value:!0});Bv.PACKAGE_NAME=Bv.PACKAGE_VERSION=void 0;Bv.PACKAGE_VERSION="0.62.0";Bv.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var TNe=F(q_=>{"use strict";A();Object.defineProperty(q_,"__esModule",{value:!0});q_.getTracedCreateStreamTrace=q_.getTracedCreateClient=q_.endSpan=void 0;var XN=(Ge(),ke(Ze)),NSt=(e,t)=>{t&&e.setStatus({code:XN.SpanStatusCode.ERROR,message:t.message}),e.end()};q_.endSpan=NSt;var OSt=e=>function(){let n=e.apply(this,arguments);return XN.context.bind(XN.context.active(),n)};q_.getTracedCreateClient=OSt;var wSt=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){XN.context.bind(XN.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};q_.getTracedCreateStreamTrace=wSt});var _F=F(iu=>{"use strict";A();Object.defineProperty(iu,"__esModule",{value:!0});iu.DB_SYSTEM_VALUE_REDIS=iu.DB_SYSTEM_NAME_VALUE_REDIS=iu.ATTR_NET_PEER_PORT=iu.ATTR_NET_PEER_NAME=iu.ATTR_DB_SYSTEM=iu.ATTR_DB_STATEMENT=iu.ATTR_DB_CONNECTION_STRING=void 0;iu.ATTR_DB_CONNECTION_STRING="db.connection_string";iu.ATTR_DB_STATEMENT="db.statement";iu.ATTR_DB_SYSTEM="db.system";iu.ATTR_NET_PEER_NAME="net.peer.name";iu.ATTR_NET_PEER_PORT="net.peer.port";iu.DB_SYSTEM_NAME_VALUE_REDIS="redis";iu.DB_SYSTEM_VALUE_REDIS="redis"});var INe=F(SF=>{"use strict";A();Object.defineProperty(SF,"__esModule",{value:!0});SF.RedisInstrumentationV2_V3=void 0;var kl=tn(),EF=TNe(),CNe=hF(),eO=(Ge(),ke(Ze)),tO=(Kn(),ke(Ur)),fy=_F(),MSt=AF(),$K=class e extends kl.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(CNe.PACKAGE_NAME,CNe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,kl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,kl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new kl.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,kl.isWrapped)(t.RedisClient.prototype.internal_send_command)&&this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._wrap(t.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,kl.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,kl.isWrapped)(t.createClient)&&this._unwrap(t,"createClient"),this._wrap(t,"createClient",this._getPatchCreateClient()),t),t=>{t!==void 0&&(this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._unwrap(t.RedisClient.prototype,"create_stream"),this._unwrap(t,"createClient"))})]}_getPatchInternalSendCommand(){let t=this;return function(r){return function(i){if(arguments.length!==1||typeof i!="object")return r.apply(this,arguments);let a=t.getConfig(),c=eO.trace.getSpan(eO.context.active())===void 0;if(a.requireParentSpan===!0&&c)return r.apply(this,arguments);let d=a?.dbStatementSerializer||MSt.defaultDbStatementSerializer,m={};t._semconvStability&kl.SemconvStability.OLD&&Object.assign(m,{[fy.ATTR_DB_SYSTEM]:fy.DB_SYSTEM_VALUE_REDIS,[fy.ATTR_DB_STATEMENT]:d(i.command,i.args)}),t._semconvStability&kl.SemconvStability.STABLE&&Object.assign(m,{[tO.ATTR_DB_SYSTEM_NAME]:fy.DB_SYSTEM_NAME_VALUE_REDIS,[tO.ATTR_DB_OPERATION_NAME]:i.command,[tO.ATTR_DB_QUERY_TEXT]:d(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:eO.SpanKind.CLIENT,attributes:m});if(this.connection_options){let y={};t._semconvStability&kl.SemconvStability.OLD&&Object.assign(y,{[fy.ATTR_NET_PEER_NAME]:this.connection_options.host,[fy.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&kl.SemconvStability.STABLE&&Object.assign(y,{[tO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[tO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(y)}this.address&&t._semconvStability&kl.SemconvStability.OLD&&h.setAttribute(fy.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let S=arguments[0].callback;if(S){let y=eO.context.active();arguments[0].callback=function(v,x){if(a?.responseHook){let N=a.responseHook;(0,kl.safeExecuteInTheMiddle)(()=>{N(h,i.command,i.args,x)},M=>{M&&t._diag.error("Error executing responseHook",M)},!0)}return(0,EF.endSpan)(h,v),eO.context.with(y,S,this,...arguments)}}try{return r.apply(this,arguments)}catch(y){throw(0,EF.endSpan)(h,y),y}}}}_getPatchCreateClient(){return function(n){return(0,EF.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,EF.getTracedCreateStreamTrace)(n)}}};SF.RedisInstrumentationV2_V3=$K});var vNe=F(yF=>{"use strict";A();Object.defineProperty(yF,"__esModule",{value:!0});yF.getClientAttributes=void 0;var VK=(Kn(),ke(Ur)),Nv=_F(),bNe=tn();function kSt(e,t,n){let r={};return n&bNe.SemconvStability.OLD&&Object.assign(r,{[Nv.ATTR_DB_SYSTEM]:Nv.DB_SYSTEM_VALUE_REDIS,[Nv.ATTR_NET_PEER_NAME]:t?.socket?.host,[Nv.ATTR_NET_PEER_PORT]:t?.socket?.port,[Nv.ATTR_DB_CONNECTION_STRING]:PSt(e,t?.url)}),n&bNe.SemconvStability.STABLE&&Object.assign(r,{[VK.ATTR_DB_SYSTEM_NAME]:Nv.DB_SYSTEM_NAME_VALUE_REDIS,[VK.ATTR_SERVER_ADDRESS]:t?.socket?.host,[VK.ATTR_SERVER_PORT]:t?.socket?.port}),r}yF.getClientAttributes=kSt;function PSt(e,t){if(!(typeof t!="string"||!t))try{let n=new URL(t);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){e.error("failed to sanitize redis connection url",n)}}});var BNe=F(TF=>{"use strict";A();Object.defineProperty(TF,"__esModule",{value:!0});TF.RedisInstrumentationV4_V5=void 0;var Hd=(Ge(),ke(Ze)),Eo=tn(),RNe=vNe(),USt=AF(),xNe=hF(),qK=(Kn(),ke(Ur)),LSt=_F(),nO=Symbol("opentelemetry.instrumentation.redis.open_spans"),DNe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),YK=class e extends Eo.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(xNe.PACKAGE_NAME,xNe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Eo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Eo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let n=new Eo.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,a)=>{let c=i.transformCommandArguments;if(!c)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let d=a?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Eo.isWrapped)(i?.[d])&&this._unwrap(i,d),this._wrap(i,d,this._getPatchExtendWithCommands(c)),i},i=>{(0,Eo.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Eo.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Eo.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let a=i?.default?.prototype;return(0,Eo.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),this._wrap(a,"exec",this._getPatchMultiCommandsExec(!1)),(0,Eo.isWrapped)(a?.execAsPipeline)&&this._unwrap(a,"execAsPipeline"),this._wrap(a,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Eo.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand"),this._wrap(a,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let a=i?.default?.prototype;(0,Eo.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),(0,Eo.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand")}),o=new Eo.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let a=i?.default?.prototype;return a?.multi&&((0,Eo.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),this._wrap(a,"multi",this._getPatchRedisClientMulti())),a?.MULTI&&((0,Eo.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),this._wrap(a,"MULTI",this._getPatchRedisClientMulti())),(0,Eo.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand"),this._wrap(a,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(a,"connect",this._getPatchedClientConnect()),i},i=>{let a=i?.default?.prototype;(0,Eo.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),(0,Eo.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),(0,Eo.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand")});return new Eo.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(a){if(a?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let c=a.executor;return a.executor=function(d,m){let h=t(d,m).args;return n._traceClientCommand(c,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let a=o.apply(this,arguments);return typeof a?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),a):a.then(c=>{let d=this[nO];return n._endSpansWithRedisReplies(d,c,t),c}).catch(c=>{let d=this[nO];if(!d)n._diag.error("cannot find open spans to end for multi/pipeline");else{let m=c.constructor.name==="MultiErrorReply"?c.replies:new Array(d.length).fill(c);n._endSpansWithRedisReplies(d,m,t)}return Promise.reject(c)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[DNe]=this.options,o}}}_getPatchRedisClientSendCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchedClientConnect(){let t=this;return function(r){return function(){let i=this.options,a=(0,RNe.getClientAttributes)(t._diag,i,t._semconvStability),c=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:Hd.SpanKind.CLIENT,attributes:a});return Hd.context.with(Hd.trace.setSpan(Hd.context.active(),c),()=>r.apply(this)).then(m=>(c.end(),m)).catch(m=>(c.recordException(m),c.setStatus({code:Hd.SpanStatusCode.ERROR,message:m.message}),c.end(),Promise.reject(m)))}}}_traceClientCommand(t,n,r,o){if(Hd.trace.getSpan(Hd.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let a=n.options||n[DNe],c=o[0],d=o.slice(1),m=this.getConfig().dbStatementSerializer||USt.defaultDbStatementSerializer,h=(0,RNe.getClientAttributes)(this._diag,a,this._semconvStability);this._semconvStability&Eo.SemconvStability.STABLE&&(h[qK.ATTR_DB_OPERATION_NAME]=c);try{let I=m(c,d);I!=null&&(this._semconvStability&Eo.SemconvStability.OLD&&(h[LSt.ATTR_DB_STATEMENT]=I),this._semconvStability&Eo.SemconvStability.STABLE&&(h[qK.ATTR_DB_QUERY_TEXT]=I))}catch(I){this._diag.error("dbStatementSerializer throw an exception",I,{commandName:c})}let S=this.tracer.startSpan(`${e.COMPONENT}-${c}`,{kind:Hd.SpanKind.CLIENT,attributes:h}),y=Hd.context.with(Hd.trace.setSpan(Hd.context.active(),S),()=>t.apply(n,r));if(typeof y?.then=="function")y.then(I=>{this._endSpanWithResponse(S,c,d,I,void 0)},I=>{this._endSpanWithResponse(S,c,d,null,I)});else{let I=y;I[nO]=I[nO]||[],I[nO].push({span:S,commandName:c,commandArgs:d})}return y}_endSpansWithRedisReplies(t,n,r=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let o=t.map(c=>c.commandName),a=o.every(c=>c===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let c=0;c<t.length;c++){let{span:d,commandArgs:m}=t[c],h=n[c],[S,y]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Eo.SemconvStability.STABLE&&d.setAttribute(qK.ATTR_DB_OPERATION_NAME,a),this._endSpanWithResponse(d,o[c],m,S,y)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:a}=this.getConfig();if(!i&&a)try{a(t,n,r,o)}catch(c){this._diag.error("responseHook throw an exception",c)}i&&(t.recordException(i),t.setStatus({code:Hd.SpanStatusCode.ERROR,message:i?.message})),t.end()}};TF.RedisInstrumentationV4_V5=YK});var wNe=F(CF=>{"use strict";A();Object.defineProperty(CF,"__esModule",{value:!0});CF.RedisInstrumentation=void 0;var QSt=tn(),NNe=hF(),FSt=INe(),GSt=BNe(),ONe={requireParentSpan:!1},KK=class extends QSt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...ONe,...t};super(NNe.PACKAGE_NAME,NNe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new FSt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new GSt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...ONe,...t};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(t){super.setTracerProvider(t),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(t),this.instrumentationV4_V5.setTracerProvider(t))}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())}};CF.RedisInstrumentation=KK});var MNe=F(IF=>{"use strict";A();Object.defineProperty(IF,"__esModule",{value:!0});IF.RedisInstrumentation=void 0;var jSt=wNe();Object.defineProperty(IF,"RedisInstrumentation",{enumerable:!0,get:function(){return jSt.RedisInstrumentation}})});function rO(e,t){return e.includes(t.toLowerCase())}function ZK(e){return rO(JK,e)?"cache.get":rO(HSt,e)?"cache.put":void 0}function $St(e,t){return t.some(n=>e.startsWith(n))}function PNe(e,t){try{if(t.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?kNe(o.map(i=>n(i))):["<unknown>"],r=t[0];return rO(zSt,e)&&r!=null?n(r):kNe(t.map(o=>n(o)))}catch{return}}function UNe(e,t,n){if(!ZK(e))return!1;for(let r of t)if($St(r,n))return!0;return!1}function LNe(e){let t=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(e)?e.reduce((n,r)=>{let o=t(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):t(e)}function kNe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var zSt,JK,HSt,QNe=O(()=>{A();zSt=["get","set","setex"],JK=["get","mget"],HSt=["set","setex"]});var FNe,GNe,bF,oO,jNe,VSt,qSt,zNe,YSt,HNe,$Ne=O(()=>{A();FNe=ie(yNe(),1),GNe=ie(MNe(),1);dt();fr();QNe();bF="Redis",oO={},jNe=(e,t,n,r)=>{e.setAttribute(Mt,"auto.db.otel.redis");let o=PNe(t,n),i=ZK(t);if(!o||!i||!oO.cachePrefixes||!UNe(t,o,oO.cachePrefixes))return;let a=Nt(e).data["net.peer.name"],c=Nt(e).data["net.peer.port"];c&&a&&e.setAttributes({"network.peer.address":a,"network.peer.port":c});let d=LNe(r);d&&e.setAttribute(tV,d),rO(JK,t)&&d!==void 0&&e.setAttribute(X9,d>0),e.setAttributes({[Zt]:i,[eV]:o});let m=o.join(", ");e.updateName(oO.maxCacheKeyLength?u_(m,oO.maxCacheKeyLength):m)},VSt=at(`${bF}.IORedis`,()=>new FNe.IORedisInstrumentation({responseHook:jNe})),qSt=at(`${bF}.Redis`,()=>new GNe.RedisInstrumentation({responseHook:jNe})),zNe=Object.assign(()=>{VSt(),qSt()},{id:bF}),YSt=(e={})=>({name:bF,setupOnce(){oO=e,zNe()}}),HNe=YSt});var VNe=F(vF=>{"use strict";A();Object.defineProperty(vF,"__esModule",{value:!0});vF.EVENT_LISTENERS_SET=void 0;vF.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var WK=F(iO=>{"use strict";A();Object.defineProperty(iO,"__esModule",{value:!0});iO.AttributeNames=void 0;var KSt;(function(e){e.PG_VALUES="db.postgresql.values",e.PG_PLAN="db.postgresql.plan",e.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",e.MAX_CLIENT="db.postgresql.max.client"})(KSt=iO.AttributeNames||(iO.AttributeNames={}))});var XK=F(xr=>{"use strict";A();Object.defineProperty(xr,"__esModule",{value:!0});xr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=xr.METRIC_DB_CLIENT_CONNECTION_COUNT=xr.DB_SYSTEM_VALUE_POSTGRESQL=xr.DB_CLIENT_CONNECTION_STATE_VALUE_USED=xr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=xr.ATTR_NET_PEER_PORT=xr.ATTR_NET_PEER_NAME=xr.ATTR_DB_USER=xr.ATTR_DB_SYSTEM=xr.ATTR_DB_STATEMENT=xr.ATTR_DB_NAME=xr.ATTR_DB_CONNECTION_STRING=xr.ATTR_DB_CLIENT_CONNECTION_STATE=xr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;xr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";xr.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";xr.ATTR_DB_CONNECTION_STRING="db.connection_string";xr.ATTR_DB_NAME="db.name";xr.ATTR_DB_STATEMENT="db.statement";xr.ATTR_DB_SYSTEM="db.system";xr.ATTR_DB_USER="db.user";xr.ATTR_NET_PEER_NAME="net.peer.name";xr.ATTR_NET_PEER_PORT="net.peer.port";xr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";xr.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";xr.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";xr.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";xr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var eJ=F(aO=>{"use strict";A();Object.defineProperty(aO,"__esModule",{value:!0});aO.SpanNames=void 0;var JSt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(JSt=aO.SpanNames||(aO.SpanNames={}))});var XNe=F(nr=>{"use strict";A();Object.defineProperty(nr,"__esModule",{value:!0});nr.sanitizedErrorMessage=nr.isObjectWithTextString=nr.getErrorMessage=nr.patchClientConnectCallback=nr.patchCallbackPGPool=nr.updateCounter=nr.getPoolName=nr.patchCallback=nr.handleExecutionResult=nr.handleConfigQuery=nr.shouldSkipInstrumentation=nr.getSemanticAttributesFromPoolConnection=nr.getSemanticAttributesFromConnection=nr.getConnectionString=nr.parseAndMaskConnectionString=nr.parseNormalizedOperationName=nr.getQuerySpanName=void 0;var Y_=(Ge(),ke(Ze)),RF=WK(),$d=(Kn(),ke(Ur)),di=XK(),Ay=tn(),qNe=eJ();function YNe(e,t){if(!t)return qNe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:KNe(t.text);return`${qNe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}nr.getQuerySpanName=YNe;function KNe(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}nr.parseNormalizedOperationName=KNe;function JNe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}nr.parseAndMaskConnectionString=JNe;function tJ(e){if("connectionString"in e&&e.connectionString)return JNe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}nr.getConnectionString=tJ;function xF(e){if(Number.isInteger(e))return e}function ZNe(e,t){let n={};return t&Ay.SemconvStability.OLD&&(n={...n,[di.ATTR_DB_SYSTEM]:di.DB_SYSTEM_VALUE_POSTGRESQL,[di.ATTR_DB_NAME]:e.database,[di.ATTR_DB_CONNECTION_STRING]:tJ(e),[di.ATTR_DB_USER]:e.user,[di.ATTR_NET_PEER_NAME]:e.host,[di.ATTR_NET_PEER_PORT]:xF(e.port)}),t&Ay.SemconvStability.STABLE&&(n={...n,[$d.ATTR_DB_SYSTEM_NAME]:$d.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[$d.ATTR_DB_NAMESPACE]:e.namespace,[$d.ATTR_SERVER_ADDRESS]:e.host,[$d.ATTR_SERVER_PORT]:xF(e.port)}),n}nr.getSemanticAttributesFromConnection=ZNe;function ZSt(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[RF.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[RF.AttributeNames.MAX_CLIENT]:e.maxClient};return t&Ay.SemconvStability.OLD&&(r={...r,[di.ATTR_DB_SYSTEM]:di.DB_SYSTEM_VALUE_POSTGRESQL,[di.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[di.ATTR_DB_CONNECTION_STRING]:tJ(e),[di.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[di.ATTR_NET_PEER_PORT]:Number(n?.port)||xF(e.port),[di.ATTR_DB_USER]:n?.username??e.user}),t&Ay.SemconvStability.STABLE&&(r={...r,[$d.ATTR_DB_SYSTEM_NAME]:$d.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[$d.ATTR_DB_NAMESPACE]:e.namespace,[$d.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[$d.ATTR_SERVER_PORT]:Number(n?.port)||xF(e.port)}),r}nr.getSemanticAttributesFromPoolConnection=ZSt;function WSt(e){return e.requireParentSpan===!0&&Y_.trace.getSpan(Y_.context.active())===void 0}nr.shouldSkipInstrumentation=WSt;function XSt(e,t,n,r){let{connectionParameters:o}=this,i=o.database,a=YNe(i,r),c=e.startSpan(a,{kind:Y_.SpanKind.CLIENT,attributes:ZNe(o,n)});if(!r)return c;if(r.text&&(n&Ay.SemconvStability.OLD&&c.setAttribute(di.ATTR_DB_STATEMENT,r.text),n&Ay.SemconvStability.STABLE&&c.setAttribute($d.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let d=r.values.map(m=>m==null?"null":m instanceof Buffer?m.toString():typeof m=="object"?typeof m.toPostgres=="function"?m.toPostgres():JSON.stringify(m):m.toString());c.setAttribute(RF.AttributeNames.PG_VALUES,d)}catch(d){Y_.diag.error("failed to stringify ",r.values,d)}return typeof r.name=="string"&&c.setAttribute(RF.AttributeNames.PG_PLAN,r.name),c}nr.handleConfigQuery=XSt;function WNe(e,t,n){typeof e.responseHook=="function"&&(0,Ay.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&Y_.diag.error("Error running response hook",r)},!0)}nr.handleExecutionResult=WNe;function eyt(e,t,n,r,o){return function(a,c){a?(Object.prototype.hasOwnProperty.call(a,"code")&&(r[$d.ATTR_ERROR_TYPE]=a.code),a instanceof Error&&t.recordException(DF(a)),t.setStatus({code:Y_.SpanStatusCode.ERROR,message:a.message})):WNe(e,t,c),o(),t.end(),n.call(this,a,c)}}nr.patchCallback=eyt;function tyt(e){let t="";return t+=(e?.host?`${e.host}`:"unknown_host")+":",t+=(e?.port?`${e.port}`:"unknown_port")+"/",t+=e?.database?`${e.database}`:"unknown_database",t.trim()}nr.getPoolName=tyt;function nyt(e,t,n,r,o){let i=t.totalCount,a=t.waitingCount,c=t.idleCount,d=i-c;return n.add(d-o.used,{[di.ATTR_DB_CLIENT_CONNECTION_STATE]:di.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[di.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(c-o.idle,{[di.ATTR_DB_CLIENT_CONNECTION_STATE]:di.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[di.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(a-o.pending,{[di.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:d,idle:c,pending:a}}nr.updateCounter=nyt;function ryt(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(DF(r)),e.setStatus({code:Y_.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}nr.patchCallbackPGPool=ryt;function oyt(e,t){return function(r){r&&(r instanceof Error&&e.recordException(DF(r)),e.setStatus({code:Y_.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}nr.patchClientConnectCallback=oyt;function iyt(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}nr.getErrorMessage=iyt;function ayt(e){return typeof e=="object"&&typeof e?.text=="string"}nr.isObjectWithTextString=ayt;function DF(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}nr.sanitizedErrorMessage=DF});var eOe=F(Ov=>{"use strict";A();Object.defineProperty(Ov,"__esModule",{value:!0});Ov.PACKAGE_NAME=Ov.PACKAGE_VERSION=void 0;Ov.PACKAGE_VERSION="0.66.0";Ov.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var aOe=F(NF=>{"use strict";A();Object.defineProperty(NF,"__esModule",{value:!0});NF.PgInstrumentation=void 0;var ju=tn(),Fr=(Ge(),ke(Ze)),tOe=VNe(),Yo=XNe(),nOe=LK(),rOe=eOe(),oOe=eJ(),BF=Tr(),af=(Kn(),ke(Ur)),sO=XK();function wv(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var nJ=class extends ju.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(rOe.PACKAGE_NAME,rOe.PACKAGE_VERSION,t),this._semconvStability=(0,ju.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(af.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Fr.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(sO.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"}),this._connectionPendingRequests=this.meter.createUpDownCounter(sO.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let t=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new ju.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new ju.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new ju.InstrumentationNodeModuleDefinition("pg",t,c=>{let d=wv(c);return this._patchPgClient(d.Client),c},c=>{let d=wv(c);return this._unpatchPgClient(d.Client),c},[o,r]),a=new ju.InstrumentationNodeModuleDefinition("pg-pool",n,c=>{let d=wv(c);return(0,ju.isWrapped)(d.prototype.connect)&&this._unwrap(d.prototype,"connect"),this._wrap(d.prototype,"connect",this._getPoolConnectPatch()),d},c=>{let d=wv(c);(0,ju.isWrapped)(d.prototype.connect)&&this._unwrap(d.prototype,"connect")});return[i,a]}_patchPgClient(t){if(!t)return;let n=wv(t);return(0,ju.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,ju.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let n=wv(t);return(0,ju.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,ju.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Yo.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let a=t.tracer.startSpan(oOe.SpanNames.CONNECT,{kind:Fr.SpanKind.CLIENT,attributes:Yo.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let d=Fr.trace.getSpan(Fr.context.active());o=Yo.patchClientConnectCallback(a,o),d&&(o=Fr.context.bind(Fr.context.active(),o))}let c=Fr.context.with(Fr.trace.setSpan(Fr.context.active(),a),()=>n.call(this,o));return iOe(a,c)}}recordOperationDuration(t,n){let r={},o=[af.ATTR_DB_NAMESPACE,af.ATTR_ERROR_TYPE,af.ATTR_SERVER_PORT,af.ATTR_SERVER_ADDRESS,af.ATTR_DB_OPERATION_NAME];this._semconvStability&ju.SemconvStability.OLD&&o.push(sO.ATTR_DB_SYSTEM),this._semconvStability&ju.SemconvStability.STABLE&&o.push(af.ATTR_DB_SYSTEM_NAME),o.forEach(a=>{a in t&&(r[a]=t[a])});let i=(0,BF.hrTimeToMilliseconds)((0,BF.hrTimeDuration)(n,(0,BF.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(Yo.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,BF.hrTime)(),a=o[0],c=typeof a=="string",d=Yo.isObjectWithTextString(a),m=c?{text:a,values:Array.isArray(o[1])?o[1]:void 0}:d?{...a,name:a.name,text:a.text,values:a.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[sO.ATTR_DB_SYSTEM]:sO.DB_SYSTEM_VALUE_POSTGRESQL,[af.ATTR_DB_NAMESPACE]:this.database,[af.ATTR_SERVER_PORT]:this.connectionParameters.port,[af.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};m?.text&&(h[af.ATTR_DB_OPERATION_NAME]=Yo.parseNormalizedOperationName(m?.text));let S=()=>{t.recordOperationDuration(h,i)},y=t.getConfig(),I=Yo.handleConfigQuery.call(this,t.tracer,y,t._semconvStability,m);if(y.addSqlCommenterCommentToQueries&&(c?o[0]=(0,nOe.addSqlCommenterComment)(I,a):d&&!("name"in a)&&(o[0]={...a,text:(0,nOe.addSqlCommenterComment)(I,a.text)})),o.length>0){let N=Fr.trace.getSpan(Fr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=Yo.patchCallback(y,I,o[o.length-1],h,S),N&&(o[o.length-1]=Fr.context.bind(Fr.context.active(),o[o.length-1]));else if(typeof m?.callback=="function"){let M=Yo.patchCallback(t.getConfig(),I,m.callback,h,S);N&&(M=Fr.context.bind(Fr.context.active(),M)),o[0].callback=M}}let{requestHook:v}=y;typeof v=="function"&&m&&(0,ju.safeExecuteInTheMiddle)(()=>{let{database:N,host:M,port:Q,user:j}=this.connectionParameters;v(I,{connection:{database:N,host:M,port:Q,user:j},query:{text:m.text,values:m.values,name:m.name}})},N=>{N&&t._diag.error("Error running query hook",N)},!0);let x;try{x=n.apply(this,o)}catch(N){throw N instanceof Error&&I.recordException(Yo.sanitizedErrorMessage(N)),I.setStatus({code:Fr.SpanStatusCode.ERROR,message:Yo.getErrorMessage(N)}),I.end(),N}return x instanceof Promise?x.then(N=>new Promise(M=>{Yo.handleExecutionResult(t.getConfig(),I,N),S(),I.end(),M(N)})).catch(N=>new Promise((M,Q)=>{N instanceof Error&&I.recordException(Yo.sanitizedErrorMessage(N)),I.setStatus({code:Fr.SpanStatusCode.ERROR,message:N.message}),S(),I.end(),Q(N)})):x})}_setPoolConnectEventListeners(t){if(t[tOe.EVENT_LISTENERS_SET])return;let n=Yo.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=Yo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=Yo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=Yo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=Yo.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[tOe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Yo.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let a=t.tracer.startSpan(oOe.SpanNames.POOL_CONNECT,{kind:Fr.SpanKind.CLIENT,attributes:Yo.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let d=Fr.trace.getSpan(Fr.context.active());o=Yo.patchCallbackPGPool(a,o),d&&(o=Fr.context.bind(Fr.context.active(),o))}let c=Fr.context.with(Fr.trace.setSpan(Fr.context.active(),a),()=>n.call(this,o));return iOe(a,c)}}};NF.PgInstrumentation=nJ;function iOe(e,t){if(!(t instanceof Promise))return t;let n=t;return Fr.context.bind(Fr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(Yo.sanitizedErrorMessage(r)),e.setStatus({code:Fr.SpanStatusCode.ERROR,message:Yo.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var sOe=F(Mv=>{"use strict";A();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.AttributeNames=Mv.PgInstrumentation=void 0;var syt=aOe();Object.defineProperty(Mv,"PgInstrumentation",{enumerable:!0,get:function(){return syt.PgInstrumentation}});var uyt=WK();Object.defineProperty(Mv,"AttributeNames",{enumerable:!0,get:function(){return uyt.AttributeNames}})});var uOe,cOe,lOe,cyt,dOe,pOe=O(()=>{A();uOe=ie(sOe(),1);fr();cOe="Postgres",lOe=at(cOe,uOe.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){Lr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),cyt=e=>({name:cOe,setupOnce(){lOe(e)}}),dOe=cyt});var K_,oJ,fOe,lyt,dyt,AOe,rJ,pyt,mOe,gOe=O(()=>{A();Ge();K_=ie(tn(),1);Kn();dt();fr();oy();oJ="PostgresJs",fOe=[">=3.0.0 <4"],lyt=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,dyt=Symbol.for("sentry.query.from.instrumented.sql"),AOe=at(oJ,e=>new rJ({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),rJ=class extends K_.InstrumentationBase{constructor(t){super("sentry-postgres-js",Jn,t)}init(){let t=new K_.InstrumentationNodeModuleDefinition("postgres",fOe,n=>{try{return this._patchPostgres(n)}catch(r){return Sa&&J.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new K_.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,fOe,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),t}_patchPostgres(t){let n=typeof t=="function",r=n?t:t.default;if(typeof r!="function")return Sa&&J.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...a){let c=Reflect.construct(r,a);if(!c||typeof c!="function")return Sa&&J.warn("postgres() did not return a valid instance"),c;let d=o.getConfig();return rq(c,{requireParentSpan:d.requireParentSpan,requestHook:d.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let a of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(a)){let c=Object.getOwnPropertyDescriptor(r,a);c&&Object.defineProperty(i,a,c)}return n?i:(nN(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return zt.getSpan(Ye.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(FI,r);return}let o=n?.match(lyt);o?.[1]&&t.setAttribute(FI,o[1].toUpperCase())}_reconstructQuery(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(t){return t?t.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(t){let n=this,r=t.Query.prototype.handle;return t.Query.prototype.handle=async function(...o){if(this[dyt])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),a=n._sanitizeSqlQuery(i);return Ka({name:a||"postgresjs.query",op:"db"},c=>{Lr(c,"auto.db.postgresjs"),c.setAttributes({[CS]:"postgres",[m5]:a});let d=n.getConfig(),{requestHook:m}=d;m&&(0,K_.safeExecuteInTheMiddle)(()=>m(c,a,void 0),y=>{y&&(c.setAttribute("sentry.hook.error","requestHook failed"),Sa&&J.error(`Error in requestHook for ${oJ} integration:`,y))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(y,I,v)=>{try{n._setOperationName(c,a,v?.[0]?.command),c.end()}catch(x){Sa&&J.error("Error ending span in resolve callback:",x)}return Reflect.apply(y,I,v)}});let S=this.reject;this.reject=new Proxy(S,{apply:(y,I,v)=>{try{c.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),c.setAttribute(g5,v?.[0]?.code||"unknown"),c.setAttribute(h5,v?.[0]?.name||"unknown"),n._setOperationName(c,a),c.end()}catch(x){Sa&&J.error("Error ending span in reject callback:",x)}return Reflect.apply(y,I,v)}});try{return r.apply(this,o)}catch(y){throw c.setStatus({code:2,message:y instanceof Error?y.message:"unknown_error"}),c.end(),y}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},pyt=e=>({name:oJ,setupOnce(){AOe(e)}}),mOe=pyt});var hOe=F(uO=>{"use strict";A();Object.defineProperty(uO,"__esModule",{value:!0});uO.SeverityNumber=void 0;var fyt;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(fyt=uO.SeverityNumber||(uO.SeverityNumber={}))});var wF=F(kv=>{"use strict";A();Object.defineProperty(kv,"__esModule",{value:!0});kv.NOOP_LOGGER=kv.NoopLogger=void 0;var OF=class{emit(t){}};kv.NoopLogger=OF;kv.NOOP_LOGGER=new OF});var kF=F(Pv=>{"use strict";A();Object.defineProperty(Pv,"__esModule",{value:!0});Pv.NOOP_LOGGER_PROVIDER=Pv.NoopLoggerProvider=void 0;var Ayt=wF(),MF=class{getLogger(t,n,r){return new Ayt.NoopLogger}};Pv.NoopLoggerProvider=MF;Pv.NOOP_LOGGER_PROVIDER=new MF});var aJ=F(PF=>{"use strict";A();Object.defineProperty(PF,"__esModule",{value:!0});PF.ProxyLogger=void 0;var myt=wF(),iJ=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):myt.NOOP_LOGGER}};PF.ProxyLogger=iJ});var uJ=F(UF=>{"use strict";A();Object.defineProperty(UF,"__esModule",{value:!0});UF.ProxyLoggerProvider=void 0;var gyt=kF(),hyt=aJ(),sJ=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new hyt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:gyt.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};UF.ProxyLoggerProvider=sJ});var _Oe=F(LF=>{"use strict";A();Object.defineProperty(LF,"__esModule",{value:!0});LF._globalThis=void 0;LF._globalThis=typeof globalThis=="object"?globalThis:global});var EOe=F(QF=>{"use strict";A();Object.defineProperty(QF,"__esModule",{value:!0});QF._globalThis=void 0;var _yt=_Oe();Object.defineProperty(QF,"_globalThis",{enumerable:!0,get:function(){return _yt._globalThis}})});var SOe=F(FF=>{"use strict";A();Object.defineProperty(FF,"__esModule",{value:!0});FF._globalThis=void 0;var Eyt=EOe();Object.defineProperty(FF,"_globalThis",{enumerable:!0,get:function(){return Eyt._globalThis}})});var yOe=F(wA=>{"use strict";A();Object.defineProperty(wA,"__esModule",{value:!0});wA.API_BACKWARDS_COMPATIBILITY_VERSION=wA.makeGetter=wA._global=wA.GLOBAL_LOGS_API_KEY=void 0;var Syt=SOe();wA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");wA._global=Syt._globalThis;function yyt(e,t,n){return r=>r===e?t:n}wA.makeGetter=yyt;wA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var COe=F(GF=>{"use strict";A();Object.defineProperty(GF,"__esModule",{value:!0});GF.LogsAPI=void 0;var Vd=yOe(),Tyt=kF(),TOe=uJ(),cJ=class e{constructor(){this._proxyLoggerProvider=new TOe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Vd._global[Vd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Vd._global[Vd.GLOBAL_LOGS_API_KEY]=(0,Vd.makeGetter)(Vd.API_BACKWARDS_COMPATIBILITY_VERSION,t,Tyt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Vd._global[Vd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Vd._global,Vd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Vd._global[Vd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new TOe.ProxyLoggerProvider}};GF.LogsAPI=cJ});var lJ=F(es=>{"use strict";A();Object.defineProperty(es,"__esModule",{value:!0});es.logs=es.ProxyLoggerProvider=es.ProxyLogger=es.NoopLoggerProvider=es.NOOP_LOGGER_PROVIDER=es.NoopLogger=es.NOOP_LOGGER=es.SeverityNumber=void 0;var Cyt=hOe();Object.defineProperty(es,"SeverityNumber",{enumerable:!0,get:function(){return Cyt.SeverityNumber}});var IOe=wF();Object.defineProperty(es,"NOOP_LOGGER",{enumerable:!0,get:function(){return IOe.NOOP_LOGGER}});Object.defineProperty(es,"NoopLogger",{enumerable:!0,get:function(){return IOe.NoopLogger}});var bOe=kF();Object.defineProperty(es,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return bOe.NOOP_LOGGER_PROVIDER}});Object.defineProperty(es,"NoopLoggerProvider",{enumerable:!0,get:function(){return bOe.NoopLoggerProvider}});var Iyt=aJ();Object.defineProperty(es,"ProxyLogger",{enumerable:!0,get:function(){return Iyt.ProxyLogger}});var byt=uJ();Object.defineProperty(es,"ProxyLoggerProvider",{enumerable:!0,get:function(){return byt.ProxyLoggerProvider}});var vyt=COe();es.logs=vyt.LogsAPI.getInstance()});var vOe=F(Uv=>{"use strict";A();Object.defineProperty(Uv,"__esModule",{value:!0});Uv.disableInstrumentations=Uv.enableInstrumentations=void 0;function Ryt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}Uv.enableInstrumentations=Ryt;function xyt(e){e.forEach(t=>t.disable())}Uv.disableInstrumentations=xyt});var DOe=F(jF=>{"use strict";A();Object.defineProperty(jF,"__esModule",{value:!0});jF.registerInstrumentations=void 0;var ROe=(Ge(),ke(Ze)),Dyt=lJ(),xOe=vOe();function Byt(e){let t=e.tracerProvider||ROe.trace.getTracerProvider(),n=e.meterProvider||ROe.metrics.getMeterProvider(),r=e.loggerProvider||Dyt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,xOe.enableInstrumentations)(o,t,n,r),()=>{(0,xOe.disableInstrumentations)(o)}}jF.registerInstrumentations=Byt});var LOe=F(zF=>{"use strict";A();Object.defineProperty(zF,"__esModule",{value:!0});zF.satisfies=void 0;var AJ=(Ge(),ke(Ze)),MOe=/^(?: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-]+)*))?$/,Nyt=/^(?<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-]+)*))?$/,Oyt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function wyt(e,t,n){if(!Myt(e))return AJ.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Lyt(e);if(!r)return!1;let o=[],i=kOe(r,t,o,n);return i&&!n?.includePrerelease?Pyt(r,o):i}zF.satisfies=wyt;function Myt(e){return typeof e=="string"&&MOe.test(e)}function kOe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(dJ(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=iTt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!dJ(e,i,n,r))return!1;return!0}return dJ(e,t,n,r)}function dJ(e,t,n,r){if(t=Uyt(t,r),t.includes(" "))return kOe(e,t,n,r);{let o=Qyt(t);return n.push(o),kyt(e,o)}}function kyt(e,t){if(t.invalid)return!1;if(!t.version||fJ(t.version))return!0;let n=NOe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=NOe(r,o)}return Oyt[t.op]?.includes(n)}function Pyt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Uyt(e,t){return e=e.trim(),e=rTt(e,t),e=nTt(e),e=oTt(e,t),e=e.trim(),e}function zu(e){return!e||e.toLowerCase()==="x"||e==="*"}function Lyt(e){let t=e.match(MOe);if(!t){AJ.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function Qyt(e){if(!e)return{};let t=e.match(Nyt);if(!t)return AJ.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function fJ(e){return e==="*"||e==="x"||e==="X"}function BOe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Fyt(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function Gyt(e,t){if(fJ(e)||fJ(t))return 0;let[n,r]=Fyt(BOe(e),BOe(t));return n>r?1:n<r?-1:0}function NOe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=Gyt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var POe="[a-zA-Z0-9-]",UOe="0|[1-9]\\d*",jyt=`\\d*[a-zA-Z-]${POe}*`,zyt="((?:<|>)?=?)",OOe=`(?:${UOe}|${jyt})`,Hyt=`(?:-(${OOe}(?:\\.${OOe})*))`,wOe=`${POe}+`,$yt=`(?:\\+(${wOe}(?:\\.${wOe})*))`,pJ=`${UOe}|x|X|\\*`,cO=`[v=\\s]*(${pJ})(?:\\.(${pJ})(?:\\.(${pJ})(?:${Hyt})?${$yt}?)?)?`,Vyt=`^${zyt}\\s*${cO}$`,qyt=new RegExp(Vyt),Yyt=`^\\s*(${cO})\\s+-\\s+(${cO})\\s*$`,Kyt=new RegExp(Yyt),Jyt="(?:~>?)",Zyt=`^${Jyt}${cO}$`,Wyt=new RegExp(Zyt),Xyt="(?:\\^)",eTt=`^${Xyt}${cO}$`,tTt=new RegExp(eTt);function nTt(e){let t=Wyt;return e.replace(t,(n,r,o,i,a)=>{let c;return zu(r)?c="":zu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:zu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function rTt(e,t){let n=tTt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let m;return zu(i)?m="":zu(a)?m=`>=${i}.0.0${r} <${+i+1}.0.0-0`:zu(c)?i==="0"?m=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?m=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?m=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:m=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:m=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,m})}function oTt(e,t){let n=qyt;return e.replace(n,(r,o,i,a,c,d)=>{let m=zu(i),h=m||zu(a),S=h||zu(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",m?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function iTt(e,t){let n=Kyt;return e.replace(n,(r,o,i,a,c,d,m,h,S,y,I,v)=>(zu(i)?o="":zu(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:zu(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,zu(S)?h="":zu(y)?h=`<${+S+1}.0.0-0`:zu(I)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${I}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+I+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var mJ=F(Bs=>{"use strict";A();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.massUnwrap=Bs.unwrap=Bs.massWrap=Bs.wrap=void 0;var Hu=console.error.bind(console);function lO(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 aTt=(e,t,n)=>{if(!e||!e[t]){Hu("no original function "+String(t)+" to wrap");return}if(!n){Hu("no wrapper function"),Hu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){Hu("original object and wrapper must be functions");return}let o=n(r,t);return lO(o,"__original",r),lO(o,"__unwrap",()=>{e[t]===o&&lO(e,t,r)}),lO(o,"__wrapped",!0),lO(e,t,o),o};Bs.wrap=aTt;var sTt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Hu("must provide one or more modules to patch"),Hu(new Error().stack);return}if(!(t&&Array.isArray(t))){Hu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Bs.wrap)(r,o,n)})})};Bs.massWrap=sTt;var uTt=(e,t)=>{if(!e||!e[t]){Hu("no function to unwrap."),Hu(new Error().stack);return}let n=e[t];if(!n.__unwrap)Hu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Bs.unwrap=uTt;var cTt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Hu("must provide one or more modules to patch"),Hu(new Error().stack);return}if(!(t&&Array.isArray(t))){Hu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Bs.unwrap)(n,r)})})};Bs.massUnwrap=cTt;function dO(e){e&&e.logger&&(typeof e.logger!="function"?Hu("new logger isn't a function, not replacing"):Hu=e.logger)}Bs.default=dO;dO.wrap=Bs.wrap;dO.massWrap=Bs.massWrap;dO.unwrap=Bs.unwrap;dO.massUnwrap=Bs.massUnwrap});var QOe=F($F=>{"use strict";A();Object.defineProperty($F,"__esModule",{value:!0});$F.InstrumentationAbstract=void 0;var gJ=(Ge(),ke(Ze)),lTt=lJ(),HF=mJ(),hJ=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=gJ.diag.createComponentLogger({namespace:t}),this._tracer=gJ.trace.getTracer(t,n),this._meter=gJ.metrics.getMeter(t,n),this._logger=lTt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=HF.wrap;_unwrap=HF.unwrap;_massWrap=HF.massWrap;_massUnwrap=HF.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};$F.InstrumentationAbstract=hJ});var FOe=F(J_=>{"use strict";A();Object.defineProperty(J_,"__esModule",{value:!0});J_.ModuleNameTrie=J_.ModuleNameSeparator=void 0;J_.ModuleNameSeparator="/";var VF=class{hooks=[];children=new Map},_J=class{_trie=new VF;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(J_.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new VF,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],a=!0;for(let c of t.split(J_.ModuleNameSeparator)){let d=o.children.get(c);if(!d){a=!1;break}r||i.push(...d.hooks),o=d}return r&&a&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,d)=>c.insertedId-d.insertedId),i.map(({hook:c})=>c))}};J_.ModuleNameTrie=_J});var jOe=F(qF=>{"use strict";A();Object.defineProperty(qF,"__esModule",{value:!0});qF.RequireInTheMiddleSingleton=void 0;var dTt=DS(),GOe=Fe("path"),EJ=FOe(),pTt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),SJ=class e{_moduleNameTrie=new EJ.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new dTt.Hook(null,{internals:!0},(t,n,r)=>{let o=fTt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:a}of i)t=a(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return pTt?new e:this._instance=this._instance??new e}};qF.RequireInTheMiddleSingleton=SJ;function fTt(e){return GOe.sep!==EJ.ModuleNameSeparator?e.split(GOe.sep).join(EJ.ModuleNameSeparator):e}});var yJ=F(Z_=>{"use strict";A();Object.defineProperty(Z_,"__esModule",{value:!0});Z_.isWrapped=Z_.safeExecuteInTheMiddleAsync=Z_.safeExecuteInTheMiddle=void 0;function ATt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}Z_.safeExecuteInTheMiddle=ATt;async function mTt(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}Z_.safeExecuteInTheMiddleAsync=mTt;function gTt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}Z_.isWrapped=gTt});var $Oe=F(YF=>{"use strict";A();Object.defineProperty(YF,"__esModule",{value:!0});YF.InstrumentationBase=void 0;var pO=Fe("path"),zOe=Fe("util"),hTt=LOe(),TJ=mJ(),_Tt=QOe(),ETt=jOe(),STt=nK(),fO=(Ge(),ke(Ze)),yTt=DS(),TTt=Fe("fs"),CTt=yJ(),CJ=class extends _Tt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=ETt.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,CTt.isWrapped)(t[n])&&this._unwrap(t,n),zOe.types.isProxy(t)){let o=(0,TJ.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,TJ.wrap)(t,n,r)};_unwrap=(t,n)=>zOe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,TJ.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{fO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){fO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{fO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){fO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Fe.resolve(n);Fe.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,TTt.readFileSync)(pO.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{fO.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return HOe(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let a=t.files??[],c=pO.normalize(r);return a.filter(m=>m.name===c).filter(m=>HOe(m.supportedVersions,i,t.includePrerelease)).reduce((m,h)=>(h.moduleExports=m,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(m,t.moduleVersion)):m),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(a,c,d)=>{if(!d&&pO.isAbsolute(c)){let m=pO.parse(c);c=m.name,d=m.dir}return this._onRequire(t,a,c,d)},r=(a,c,d)=>this._onRequire(t,a,c,d),o=pO.isAbsolute(t.name)?new yTt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new STt.Hook([t.name],{internals:!1},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};YF.InstrumentationBase=CJ;function HOe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,hTt.satisfies)(t,r,{includePrerelease:n}))}});var VOe=F(KF=>{"use strict";A();Object.defineProperty(KF,"__esModule",{value:!0});KF.normalize=void 0;var ITt=Fe("path");Object.defineProperty(KF,"normalize",{enumerable:!0,get:function(){return ITt.normalize}})});var qOe=F(Lv=>{"use strict";A();Object.defineProperty(Lv,"__esModule",{value:!0});Lv.normalize=Lv.InstrumentationBase=void 0;var bTt=$Oe();Object.defineProperty(Lv,"InstrumentationBase",{enumerable:!0,get:function(){return bTt.InstrumentationBase}});var vTt=VOe();Object.defineProperty(Lv,"normalize",{enumerable:!0,get:function(){return vTt.normalize}})});var IJ=F(Qv=>{"use strict";A();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.normalize=Qv.InstrumentationBase=void 0;var YOe=qOe();Object.defineProperty(Qv,"InstrumentationBase",{enumerable:!0,get:function(){return YOe.InstrumentationBase}});Object.defineProperty(Qv,"normalize",{enumerable:!0,get:function(){return YOe.normalize}})});var KOe=F(JF=>{"use strict";A();Object.defineProperty(JF,"__esModule",{value:!0});JF.InstrumentationNodeModuleDefinition=void 0;var bJ=class{name;supportedVersions;patch;unpatch;files;constructor(t,n,r,o,i){this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=i||[]}};JF.InstrumentationNodeModuleDefinition=bJ});var JOe=F(ZF=>{"use strict";A();Object.defineProperty(ZF,"__esModule",{value:!0});ZF.InstrumentationNodeModuleFile=void 0;var RTt=IJ(),vJ=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,RTt.normalize)(t)}};ZF.InstrumentationNodeModuleFile=vJ});var ZOe=F(my=>{"use strict";A();Object.defineProperty(my,"__esModule",{value:!0});my.semconvStabilityFromStr=my.SemconvStability=void 0;var WF;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(WF=my.SemconvStability||(my.SemconvStability={}));function xTt(e,t){let n=WF.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=WF.DUPLICATE;break}else o.toLowerCase()===e&&(n=WF.STABLE);return n}my.semconvStabilityFromStr=xTt});var XOe=F(Xi=>{"use strict";A();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.semconvStabilityFromStr=Xi.SemconvStability=Xi.safeExecuteInTheMiddleAsync=Xi.safeExecuteInTheMiddle=Xi.isWrapped=Xi.InstrumentationNodeModuleFile=Xi.InstrumentationNodeModuleDefinition=Xi.InstrumentationBase=Xi.registerInstrumentations=void 0;var DTt=DOe();Object.defineProperty(Xi,"registerInstrumentations",{enumerable:!0,get:function(){return DTt.registerInstrumentations}});var BTt=IJ();Object.defineProperty(Xi,"InstrumentationBase",{enumerable:!0,get:function(){return BTt.InstrumentationBase}});var NTt=KOe();Object.defineProperty(Xi,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return NTt.InstrumentationNodeModuleDefinition}});var OTt=JOe();Object.defineProperty(Xi,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return OTt.InstrumentationNodeModuleFile}});var RJ=yJ();Object.defineProperty(Xi,"isWrapped",{enumerable:!0,get:function(){return RJ.isWrapped}});Object.defineProperty(Xi,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return RJ.safeExecuteInTheMiddle}});Object.defineProperty(Xi,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return RJ.safeExecuteInTheMiddleAsync}});var WOe=ZOe();Object.defineProperty(Xi,"SemconvStability",{enumerable:!0,get:function(){return WOe.SemconvStability}});Object.defineProperty(Xi,"semconvStabilityFromStr",{enumerable:!0,get:function(){return WOe.semconvStabilityFromStr}})});function kTt(){let e=Fv[DJ];return e?.helper?e.helper:Fv[xJ]?.helper}function PTt(e){let t={helper:e};Fv[DJ]=t,Fv[xJ]=t}function UTt(){delete Fv[DJ],delete Fv[xJ]}function FTt(e){switch(e){case"client":return oo.CLIENT;case"internal":default:return oo.INTERNAL}}function nwe(e,t,n,r,o){if(rwe(t.name,o))return;let i={attributes:t.attributes,kind:FTt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,a=>{r.set(t.id,a.spanContext().spanId),t.links&&a.addLinks(t.links.flatMap(d=>{let m=r.get(d);return m?{context:{spanId:m,traceId:a.spanContext().traceId,traceFlags:a.spanContext().traceFlags}}:[]}));let c=n.filter(d=>d.parentId===t.id);for(let d of c)nwe(e,d,n,r,o);a.end(t.endTime)})}function ewe(e,t){return jTt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function jTt(e){return e!=null&&typeof e.then=="function"}function rwe(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var XF,wTt,MTt,xJ,DJ,Fv,LTt,QTt,GTt,owe,twe,zTt,HTt,iwe,awe=O(()=>{A();Ge();XF=ie(XOe(),1);Ge();wTt={name:"@prisma/instrumentation-contract",version:"7.6.0",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}},MTt=wTt.version.split(".")[0],xJ="PRISMA_INSTRUMENTATION",DJ=`V${MTt}_PRISMA_INSTRUMENTATION`,Fv=globalThis;LTt=process.env.PRISMA_SHOW_ALL_TRACES==="true",QTt="00-10-10-00";GTt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=zt.getSpanContext(e??Ye.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:QTt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)nwe(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return Ye.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!LTt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(rwe(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return ewe(i,t(i,r))}return n.startActiveSpan(o,e,i=>ewe(i,t(i,r)))}};owe={name:"@prisma/instrumentation",version:"7.6.0",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@opentelemetry/api":"1.9.0","@prisma/instrumentation-contract":"workspace:*","@types/node":"~20.19.24",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.207.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},sideEffects:!1},twe=owe.version,zTt=owe.name,HTt="@prisma/client",iwe=class extends XF.InstrumentationBase{tracerProvider;constructor(e={}){super(zTt,twe,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new XF.InstrumentationNodeModuleDefinition(HTt,[twe])]}enable(){let e=this._config;PTt(new GTt({tracerProvider:this.tracerProvider??zt.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){UTt()}isEnabled(){return kTt()!==void 0}}});function $Tt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function uwe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function VTt(e){switch(e){case"client":return oo.CLIENT;case"internal":default:return oo.INTERNAL}}var swe,BJ,qTt,cwe,lwe=O(()=>{A();Ge();awe();dt();fr();swe="Prisma";BJ=class extends iwe{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=uwe();$Tt(t)&&(t.createEngineSpan=n=>{let r=zt.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){$o(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(i=>{let a=VTt(i.kind),c=i.parent_span_id,d=i.span_id,m=i.trace_id,h=i.links?.map(y=>({context:{traceId:y.trace_id,spanId:y.span_id,traceFlags:qs.SAMPLED}})),S=zt.setSpanContext(Ye.active(),{traceId:m,spanId:c,traceFlags:qs.SAMPLED});Ye.with(S,()=>{let y={generateTraceId:()=>m,generateSpanId:()=>d};r._idGenerator=y,r.startSpan(i.name,{kind:a,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};qTt=at(swe,e=>new BJ(e)),cwe=e=>({name:swe,setupOnce(){qTt(e)},setup(t){uwe()&&t.on("spanStart",n=>{let r=Nt(n);r.description?.startsWith("prisma:")&&n.setAttribute(Mt,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}})});var dwe=F(Gv=>{"use strict";A();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.PACKAGE_NAME=Gv.PACKAGE_VERSION=void 0;Gv.PACKAGE_VERSION="0.60.0";Gv.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var NJ=F(MA=>{"use strict";A();Object.defineProperty(MA,"__esModule",{value:!0});MA.HapiLifecycleMethodNames=MA.HapiLayerType=MA.handlerPatched=MA.HapiComponentName=void 0;MA.HapiComponentName="@hapi/hapi";MA.handlerPatched=Symbol("hapi-handler-patched");MA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};MA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var pwe=F(e3=>{"use strict";A();Object.defineProperty(e3,"__esModule",{value:!0});e3.ATTR_HTTP_METHOD=void 0;e3.ATTR_HTTP_METHOD="http.method"});var OJ=F(AO=>{"use strict";A();Object.defineProperty(AO,"__esModule",{value:!0});AO.AttributeNames=void 0;var YTt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(YTt=AO.AttributeNames||(AO.AttributeNames={}))});var mwe=F(ea=>{"use strict";A();Object.defineProperty(ea,"__esModule",{value:!0});ea.getPluginFromInput=ea.getExtMetadata=ea.getRouteMetadata=ea.isPatchableExtMethod=ea.isDirectExtInput=ea.isLifecycleExtEventObj=ea.isLifecycleExtType=ea.getPluginName=void 0;var fwe=(Kn(),ke(Ur)),KTt=pwe(),mO=NJ(),W_=OJ(),Awe=tn();function JTt(e){return e.name?e.name:e.pkg.name}ea.getPluginName=JTt;var ZTt=e=>typeof e=="string"&&mO.HapiLifecycleMethodNames.has(e);ea.isLifecycleExtType=ZTt;var WTt=e=>{let t=e?.type;return t!==void 0&&(0,ea.isLifecycleExtType)(t)};ea.isLifecycleExtEventObj=WTt;var XTt=e=>Array.isArray(e)&&e.length<=3&&(0,ea.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ea.isDirectExtInput=XTt;var eCt=e=>!Array.isArray(e);ea.isPatchableExtMethod=eCt;var tCt=(e,t,n)=>{let r={[fwe.ATTR_HTTP_ROUTE]:e.path};t&Awe.SemconvStability.OLD&&(r[KTt.ATTR_HTTP_METHOD]=e.method),t&Awe.SemconvStability.STABLE&&(r[fwe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[W_.AttributeNames.HAPI_TYPE]=mO.HapiLayerType.PLUGIN,r[W_.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[W_.AttributeNames.HAPI_TYPE]=mO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ea.getRouteMetadata=tCt;var nCt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[W_.AttributeNames.EXT_TYPE]:e,[W_.AttributeNames.HAPI_TYPE]:mO.HapiLayerType.EXT,[W_.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[W_.AttributeNames.EXT_TYPE]:e,[W_.AttributeNames.HAPI_TYPE]:mO.HapiLayerType.EXT},name:r}};ea.getExtMetadata=nCt;var rCt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ea.getPluginFromInput=rCt});var _we=F(t3=>{"use strict";A();Object.defineProperty(t3,"__esModule",{value:!0});t3.HapiInstrumentation=void 0;var Pl=(Ge(),ke(Ze)),gwe=Tr(),gO=tn(),hwe=dwe(),hO=NJ(),Dg=mwe(),wJ=class extends gO.InstrumentationBase{_semconvStability;constructor(t={}){super(hwe.PACKAGE_NAME,hwe.PACKAGE_VERSION,t),this._semconvStability=(0,gO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new gO.InstrumentationNodeModuleDefinition(hO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,gO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,gO.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([n],["server","Server"])})}_getServerPatch(t){let n=this,r=this;return function(i){let a=t.apply(this,[i]);return r._wrap(a,"route",c=>n._getServerRoutePatch.bind(n)(c)),r._wrap(a,"ext",c=>n._getServerExtPatch.bind(n)(c)),r._wrap(a,"register",n._getServerRegisterPatch.bind(n)),a}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let a of o){let c=(0,Dg.getPluginFromInput)(a);n._wrapRegisterHandler(c)}else{let a=(0,Dg.getPluginFromInput)(o);n._wrapRegisterHandler(a)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let a=i[0];for(let c=0;c<a.length;c++){let d=a[c];if((0,Dg.isLifecycleExtType)(d.type)){let m=d,h=r._wrapExtMethods(m.method,d.type,n);m.method=h,a[c]=m}}return t.apply(this,i)}else if((0,Dg.isDirectExtInput)(i)){let a=i,c=a[1],d=r._wrapExtMethods(c,a[0],n);return t.apply(this,[a[0],d,a[2]])}else if((0,Dg.isLifecycleExtEventObj)(i[0])){let a=i[0],c=r._wrapExtMethods(a.method,a.type,n);return a.method=c,t.call(this,a)}return t.apply(this,i)}}_getServerRoutePatch(t,n){let r=this;return function(o){if(Array.isArray(o))for(let i=0;i<o.length;i++){let a=r._wrapRouteHandler.call(r,o[i],n);o[i]=a}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,Dg.getPluginName)(t),o=t.register,i=this,a=function(c,d){return i._wrap(c,"route",m=>n._getServerRoutePatch.bind(n)(m,r)),i._wrap(c,"ext",m=>n._getServerExtPatch.bind(n)(m,r)),o.call(this,c,d)};t.register=a}_wrapExtMethods(t,n,r){let o=this;if(t instanceof Array){for(let i=0;i<t.length;i++)t[i]=o._wrapExtMethods(t[i],n);return t}else if((0,Dg.isPatchableExtMethod)(t))return t[hO.handlerPatched]===!0?t:(t[hO.handlerPatched]=!0,async function(...a){if(Pl.trace.getSpan(Pl.context.active())===void 0)return await t.apply(this,a);let c=(0,Dg.getExtMetadata)(n,r,t.name),d=o.tracer.startSpan(c.name,{attributes:c.attributes});try{return await Pl.context.with(Pl.trace.setSpan(Pl.context.active(),d),t,void 0,...a)}catch(m){throw d.recordException(m),d.setStatus({code:Pl.SpanStatusCode.ERROR,message:m.message}),m}finally{d.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[hO.handlerPatched]===!0)return t;t[hO.handlerPatched]=!0;let o=i=>async function(...a){if(Pl.trace.getSpan(Pl.context.active())===void 0)return await i.call(this,...a);let c=(0,gwe.getRPCMetadata)(Pl.context.active());c?.type===gwe.RPCType.HTTP&&(c.route=t.path);let d=(0,Dg.getRouteMetadata)(t,r._semconvStability,n),m=r.tracer.startSpan(d.name,{attributes:d.attributes});try{return await Pl.context.with(Pl.trace.setSpan(Pl.context.active(),m),()=>i.call(this,...a))}catch(h){throw m.recordException(h),m.setStatus({code:Pl.SpanStatusCode.ERROR,message:h.message}),h}finally{m.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(a){let c=i(a);return typeof c.handler=="function"&&(c.handler=o(c.handler)),c}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};t3.HapiInstrumentation=wJ});var Ewe=F(jv=>{"use strict";A();Object.defineProperty(jv,"__esModule",{value:!0});jv.AttributeNames=jv.HapiInstrumentation=void 0;var oCt=_we();Object.defineProperty(jv,"HapiInstrumentation",{enumerable:!0,get:function(){return oCt.HapiInstrumentation}});var iCt=OJ();Object.defineProperty(jv,"AttributeNames",{enumerable:!0,get:function(){return iCt.AttributeNames}})});var Swe,ywe,Twe,aCt,Cwe,Iwe=O(()=>{A();Swe=ie(Ewe(),1);fr();ywe="Hapi",Twe=at(ywe,()=>new Swe.HapiInstrumentation),aCt=()=>({name:ywe,setupOnce(){Twe()}}),Cwe=aCt});var X_,_O,MJ=O(()=>{A();X_={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},_O={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var r3,sCt,uCt,n3,bwe=O(()=>{A();Ge();r3=ie(tn(),1);dt();MJ();sCt="@sentry/instrumentation-hono",uCt="0.0.1",n3=class extends r3.InstrumentationBase{constructor(t={}){super(sCt,uCt,t)}init(){return[new r3.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],t=>this._patch(t))]}_patch(t){let n=this;class r extends t.Hono{constructor(...i){super(...i),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{t.Hono=r}catch{return{...t,Hono:r}}return t}_patchHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let a=o.slice(1);return n.apply(this,[i,...a.map(c=>t._wrapHandler(c))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_patchOnHandler(){let t=this;return function(n){return function(...o){let i=o.slice(2);return n.apply(this,[...o.slice(0,2),...i.map(a=>t._wrapHandler(a))])}}}_patchMiddlewareHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let a=o.slice(1);return n.apply(this,[i,...a.map(c=>t._wrapHandler(c))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_wrapHandler(t){let n=this;return function(r,o){if(!n.isEnabled())return t.apply(this,[r,o]);let i=r.req.path,a=n.tracer.startSpan(i);return Ye.with(zt.setSpan(Ye.active(),a),()=>n._safeExecute(()=>{let c=t.apply(this,[r,o]);if(ys(c))return c.then(d=>{let m=n._determineHandlerType(d);return a.setAttributes({[X_.HONO_TYPE]:m,[X_.HONO_NAME]:m===_O.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(a),d});{let d=n._determineHandlerType(c);return a.setAttributes({[X_.HONO_TYPE]:d,[X_.HONO_NAME]:d===_O.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(a),c}},()=>a.end(),c=>{n._handleError(a,c),a.end()}))}}_safeExecute(t,n,r){try{let o=t();return ys(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?_O.MIDDLEWARE:_O.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:si.ERROR,message:n.message}),t.recordException(n))}}});function cCt(e){let t=Nt(e).data,n=t[X_.HONO_TYPE];if(t[Zt]||!n)return;e.setAttributes({[Mt]:"auto.http.otel.hono",[Zt]:`${n}.hono`});let r=t[X_.HONO_NAME];if(typeof r=="string"&&e.updateName(r),In()===Nd()){Sa&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[ng],i=t[IS];typeof o=="string"&&typeof i=="string"&&In().setTransactionName(`${i} ${o}`)}var vwe,Rwe,lCt,xwe,Dwe=O(()=>{A();Kn();dt();fr();oy();MJ();bwe();vwe="Hono";Rwe=at(vwe,()=>new n3({responseHook:e=>{cCt(e)}})),lCt=()=>({name:vwe,setupOnce(){Rwe()}}),xwe=lCt});var o3=F(EO=>{"use strict";A();Object.defineProperty(EO,"__esModule",{value:!0});EO.KoaLayerType=void 0;var dCt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(dCt=EO.KoaLayerType||(EO.KoaLayerType={}))});var Bwe=F(zv=>{"use strict";A();Object.defineProperty(zv,"__esModule",{value:!0});zv.PACKAGE_NAME=zv.PACKAGE_VERSION=void 0;zv.PACKAGE_VERSION="0.62.0";zv.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var kJ=F(SO=>{"use strict";A();Object.defineProperty(SO,"__esModule",{value:!0});SO.AttributeNames=void 0;var pCt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(pCt=SO.AttributeNames||(SO.AttributeNames={}))});var Owe=F(Hv=>{"use strict";A();Object.defineProperty(Hv,"__esModule",{value:!0});Hv.isLayerIgnored=Hv.getMiddlewareMetadata=void 0;var Nwe=o3(),i3=kJ(),fCt=(Kn(),ke(Ur)),ACt=(e,t,n,r)=>n?{attributes:{[i3.AttributeNames.KOA_NAME]:r?.toString(),[i3.AttributeNames.KOA_TYPE]:Nwe.KoaLayerType.ROUTER,[fCt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[i3.AttributeNames.KOA_NAME]:t.name??"middleware",[i3.AttributeNames.KOA_TYPE]:Nwe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};Hv.getMiddlewareMetadata=ACt;var mCt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));Hv.isLayerIgnored=mCt});var wwe=F(a3=>{"use strict";A();Object.defineProperty(a3,"__esModule",{value:!0});a3.kLayerPatched=void 0;a3.kLayerPatched=Symbol("koa-layer-patched")});var Qwe=F(s3=>{"use strict";A();Object.defineProperty(s3,"__esModule",{value:!0});s3.KoaInstrumentation=void 0;var kA=(Ge(),ke(Ze)),yO=tn(),Mwe=o3(),kwe=Bwe(),Pwe=Owe(),Uwe=Tr(),Lwe=wwe(),PJ=class extends yO.InstrumentationBase{constructor(t={}){super(kwe.PACKAGE_NAME,kwe.PACKAGE_VERSION,t)}init(){return new yO.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,yO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;(0,yO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(t){let n=this;return function(o){let i;return o.router?i=n._patchRouterDispatch(o):i=n._patchLayer(o,!1),t.apply(this,[i])}}_patchRouterDispatch(t){kA.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,a=o.stack;for(let c=0;c<a.length;c++){let d=a[c];a[c]=this._patchLayer(d,!0,i)}}return t}_patchLayer(t,n,r){let o=n?Mwe.KoaLayerType.ROUTER:Mwe.KoaLayerType.MIDDLEWARE;return t[Lwe.kLayerPatched]===!0||(0,Pwe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(kA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[Lwe.kLayerPatched]=!0,kA.diag.debug("patching Koa middleware layer"),async(i,a)=>{if(kA.trace.getSpan(kA.context.active())===void 0)return t(i,a);let d=(0,Pwe.getMiddlewareMetadata)(i,t,n,r),m=this.tracer.startSpan(d.name,{attributes:d.attributes}),h=(0,Uwe.getRPCMetadata)(kA.context.active());h?.type===Uwe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:S}=this.getConfig();S&&(0,yO.safeExecuteInTheMiddle)(()=>S(m,{context:i,middlewareLayer:t,layerType:o}),I=>{I&&kA.diag.error("koa instrumentation: request hook failed",I)},!0);let y=kA.trace.setSpan(kA.context.active(),m);return kA.context.with(y,async()=>{try{return await t(i,a)}catch(I){throw m.recordException(I),I}finally{m.end()}})})}};s3.KoaInstrumentation=PJ});var Fwe=F(eE=>{"use strict";A();Object.defineProperty(eE,"__esModule",{value:!0});eE.KoaLayerType=eE.AttributeNames=eE.KoaInstrumentation=void 0;var gCt=Qwe();Object.defineProperty(eE,"KoaInstrumentation",{enumerable:!0,get:function(){return gCt.KoaInstrumentation}});var hCt=kJ();Object.defineProperty(eE,"AttributeNames",{enumerable:!0,get:function(){return hCt.AttributeNames}});var _Ct=o3();Object.defineProperty(eE,"KoaLayerType",{enumerable:!0,get:function(){return _Ct.KoaLayerType}})});var Gwe,jwe,zwe,ECt,Hwe,$we=O(()=>{A();Gwe=ie(Fwe(),1);Kn();dt();fr();oy();jwe="Koa",zwe=at(jwe,Gwe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){Lr(t,"auto.http.otel.koa");let r=Nt(t).data,o=r["koa.type"];o&&t.setAttribute(Zt,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),In()===Nd()){Sa&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let a=r[ng],c=n.context?.request?.method?.toUpperCase()||"GET";a&&In().setTransactionName(`${c} ${a}`)}})),ECt=(e={})=>({name:jwe,setupOnce(){zwe(e)}}),Hwe=ECt});var UJ=F(sf=>{"use strict";A();Object.defineProperty(sf,"__esModule",{value:!0});sf.ConnectNames=sf.ConnectTypes=sf.AttributeNames=void 0;var SCt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(SCt=sf.AttributeNames||(sf.AttributeNames={}));var yCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(yCt=sf.ConnectTypes||(sf.ConnectTypes={}));var TCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(TCt=sf.ConnectNames||(sf.ConnectNames={}))});var Vwe=F($v=>{"use strict";A();Object.defineProperty($v,"__esModule",{value:!0});$v.PACKAGE_NAME=$v.PACKAGE_VERSION=void 0;$v.PACKAGE_VERSION="0.57.0";$v.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var qwe=F(u3=>{"use strict";A();Object.defineProperty(u3,"__esModule",{value:!0});u3._LAYERS_STORE_PROPERTY=void 0;u3._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var Ywe=F(nE=>{"use strict";A();Object.defineProperty(nE,"__esModule",{value:!0});nE.generateRoute=nE.replaceCurrentStackRoute=nE.addNewStackLayer=void 0;var CCt=(Ge(),ke(Ze)),tE=qwe(),ICt=e=>{Array.isArray(e[tE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,tE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[tE._LAYERS_STORE_PROPERTY].push("/");let t=e[tE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[tE._LAYERS_STORE_PROPERTY].length?e[tE._LAYERS_STORE_PROPERTY].pop():CCt.diag.warn("Connect: Trying to pop the stack multiple time")}};nE.addNewStackLayer=ICt;var bCt=(e,t)=>{t&&e[tE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};nE.replaceCurrentStackRoute=bCt;var vCt=e=>e[tE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);nE.generateRoute=vCt});var Zwe=F(rE=>{"use strict";A();Object.defineProperty(rE,"__esModule",{value:!0});rE.ConnectInstrumentation=rE.ANONYMOUS_NAME=void 0;var RCt=(Ge(),ke(Ze)),Kwe=Tr(),Vv=UJ(),Jwe=Vwe(),c3=tn(),xCt=(Kn(),ke(Ur)),LJ=Ywe();rE.ANONYMOUS_NAME="anonymous";var QJ=class extends c3.InstrumentationBase{constructor(t={}){super(Jwe.PACKAGE_NAME,Jwe.PACKAGE_VERSION,t)}init(){return[new c3.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,c3.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,c3.isWrapped)(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let n=this;return function(...r){let o=t.apply(this,r);return n._patchApp(o),o}}_patchNext(t,n){return function(o){let i=t.apply(this,[o]);return n(),i}}_startSpan(t,n){let r,o,i;t?(r=Vv.ConnectTypes.REQUEST_HANDLER,i=Vv.ConnectNames.REQUEST_HANDLER,o=t):(r=Vv.ConnectTypes.MIDDLEWARE,i=Vv.ConnectNames.MIDDLEWARE,o=n.name||rE.ANONYMOUS_NAME);let a=`${i} - ${o}`,c={attributes:{[xCt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[Vv.AttributeNames.CONNECT_TYPE]:r,[Vv.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(a,c)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[a,c,d]=o?[1,2,3]:[0,1,2],m=arguments[a],h=arguments[c],S=arguments[d];(0,LJ.replaceCurrentStackRoute)(m,t);let y=(0,Kwe.getRPCMetadata)(RCt.context.active());t&&y?.type===Kwe.RPCType.HTTP&&(y.route=(0,LJ.generateRoute)(m));let I="";t?I=`request handler - ${t}`:I=`middleware - ${n.name||rE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",I);let x=!1;function N(){x?r._diag.debug(`span ${v.name} - already finished`):(x=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",N)}return h.addListener("close",N),arguments[d]=r._patchNext(S,N),n.apply(this,arguments)}return Object.defineProperty(i,"length",{value:n.length,writable:!1,configurable:!0}),i}_patchUse(t){let n=this;return function(...r){let o=r[r.length-1],i=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(i,o),t.apply(this,r)}}_patchHandle(t){let n=this;return function(){let[r,o]=[0,2],i=arguments[r],a=arguments[o],c=(0,LJ.addNewStackLayer)(i);return typeof a=="function"&&(arguments[o]=n._patchOut(a,c)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};rE.ConnectInstrumentation=QJ});var Xwe=F(qd=>{"use strict";A();Object.defineProperty(qd,"__esModule",{value:!0});qd.ConnectTypes=qd.ConnectNames=qd.AttributeNames=qd.ANONYMOUS_NAME=qd.ConnectInstrumentation=void 0;var Wwe=Zwe();Object.defineProperty(qd,"ConnectInstrumentation",{enumerable:!0,get:function(){return Wwe.ConnectInstrumentation}});Object.defineProperty(qd,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return Wwe.ANONYMOUS_NAME}});var FJ=UJ();Object.defineProperty(qd,"AttributeNames",{enumerable:!0,get:function(){return FJ.AttributeNames}});Object.defineProperty(qd,"ConnectNames",{enumerable:!0,get:function(){return FJ.ConnectNames}});Object.defineProperty(qd,"ConnectTypes",{enumerable:!0,get:function(){return FJ.ConnectTypes}})});var eMe,tMe,nMe,DCt,rMe,oMe=O(()=>{A();eMe=ie(Xwe(),1);fr();tMe="Connect",nMe=at(tMe,()=>new eMe.ConnectInstrumentation),DCt=()=>({name:tMe,setupOnce(){nMe()}}),rMe=DCt});var iMe=F(ts=>{"use strict";A();Object.defineProperty(ts,"__esModule",{value:!0});ts.DB_SYSTEM_VALUE_MSSQL=ts.ATTR_NET_PEER_PORT=ts.ATTR_NET_PEER_NAME=ts.ATTR_DB_USER=ts.ATTR_DB_SYSTEM=ts.ATTR_DB_STATEMENT=ts.ATTR_DB_SQL_TABLE=ts.ATTR_DB_NAME=void 0;ts.ATTR_DB_NAME="db.name";ts.ATTR_DB_SQL_TABLE="db.sql.table";ts.ATTR_DB_STATEMENT="db.statement";ts.ATTR_DB_SYSTEM="db.system";ts.ATTR_DB_USER="db.user";ts.ATTR_NET_PEER_NAME="net.peer.name";ts.ATTR_NET_PEER_PORT="net.peer.port";ts.DB_SYSTEM_VALUE_MSSQL="mssql"});var aMe=F(qv=>{"use strict";A();Object.defineProperty(qv,"__esModule",{value:!0});qv.once=qv.getSpanName=void 0;function BCt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}qv.getSpanName=BCt;var NCt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};qv.once=NCt});var sMe=F(Yv=>{"use strict";A();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.PACKAGE_NAME=Yv.PACKAGE_VERSION=void 0;Yv.PACKAGE_VERSION="0.33.0";Yv.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var pMe=F(iE=>{"use strict";A();Object.defineProperty(iE,"__esModule",{value:!0});iE.TediousInstrumentation=iE.INJECTED_CTX=void 0;var Kv=(Ge(),ke(Ze)),OCt=Fe("events"),PA=tn(),gy=(Kn(),ke(Ur)),oE=iMe(),uMe=aMe(),cMe=sMe(),dMe=Symbol("opentelemetry.instrumentation-tedious.current-database");iE.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var lMe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function l3(e){Object.defineProperty(this,dMe,{value:e,writable:!0})}var GJ=class e extends PA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(cMe.PACKAGE_NAME,cMe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,PA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,PA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new PA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of lMe)(0,PA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,PA.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let n=t.Connection.prototype;for(let r of lMe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return l3.call(this,this.config?.options?.database),this.removeListener("databaseChange",l3),this.on("databaseChange",l3),this.once("end",()=>{this.removeListener("databaseChange",l3)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Kv.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",a=new n.Request(i,d=>{o()});Object.defineProperty(a,iE.INJECTED_CTX,{value:!0});let c=Buffer.from(r,"utf8");a.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,c,{length:c.length}),t.execSql(a)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(a){if(a?.[iE.INJECTED_CTX])return r.apply(this,arguments);if(!(a instanceof OCt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let c=0,d=0,m=()=>d++,h=()=>c++,S=this[dMe],y=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(a),I={};o._dbSemconvStability&PA.SemconvStability.OLD&&(I[oE.ATTR_DB_SYSTEM]=oE.DB_SYSTEM_VALUE_MSSQL,I[oE.ATTR_DB_NAME]=S,I[oE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,I[oE.ATTR_DB_STATEMENT]=y,I[oE.ATTR_DB_SQL_TABLE]=a.table),o._dbSemconvStability&PA.SemconvStability.STABLE&&(I[gy.ATTR_DB_NAMESPACE]=S,I[gy.ATTR_DB_SYSTEM_NAME]=gy.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,I[gy.ATTR_DB_QUERY_TEXT]=y,I[gy.ATTR_DB_COLLECTION_NAME]=a.table),o._netSemconvStability&PA.SemconvStability.OLD&&(I[oE.ATTR_NET_PEER_NAME]=this.config?.server,I[oE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&PA.SemconvStability.STABLE&&(I[gy.ATTR_SERVER_ADDRESS]=this.config?.server,I[gy.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,uMe.getSpanName)(t,S,y,a.table),{kind:Kv.SpanKind.CLIENT,attributes:I}),x=(0,uMe.once)(G=>{a.removeListener("done",m),a.removeListener("doneInProc",m),a.removeListener("doneProc",h),a.removeListener("error",x),this.removeListener("end",x),v.setAttribute("tedious.procedure_count",c),v.setAttribute("tedious.statement_count",d),G&&v.setStatus({code:Kv.SpanStatusCode.ERROR,message:G.message}),v.end()});a.on("done",m),a.on("doneInProc",m),a.on("doneProc",h),a.once("error",x),this.on("end",x),typeof a.callback=="function"?o._wrap(a,"callback",o._patchCallbackQuery(x)):o._diag.error("Expected request.callback to be a function");let N=()=>Kv.context.with(Kv.trace.setSpan(Kv.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return N();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(N)}return Object.defineProperty(i,"length",{value:r.length,writable:!1}),i}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r),n.apply(this,arguments)}}};iE.TediousInstrumentation=GJ});var fMe=F(d3=>{"use strict";A();Object.defineProperty(d3,"__esModule",{value:!0});d3.TediousInstrumentation=void 0;var wCt=pMe();Object.defineProperty(d3,"TediousInstrumentation",{enumerable:!0,get:function(){return wCt.TediousInstrumentation}})});var AMe,MCt,mMe,gMe,kCt,hMe,_Me=O(()=>{A();AMe=ie(fMe(),1);dt();fr();MCt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),mMe="Tedious",gMe=at(mMe,()=>new AMe.TediousInstrumentation({})),kCt=()=>{let e;return{name:mMe,setupOnce(){let t=gMe();e=oN(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=Nt(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";MCt.has(i)&&n.setAttribute(Mt,"auto.db.otel.tedious")}))}}},hMe=kCt});var EMe=F(Jv=>{"use strict";A();Object.defineProperty(Jv,"__esModule",{value:!0});Jv.PACKAGE_NAME=Jv.PACKAGE_VERSION=void 0;Jv.PACKAGE_VERSION="0.57.0";Jv.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var yMe=F(p3=>{"use strict";A();Object.defineProperty(p3,"__esModule",{value:!0});p3.GenericPoolInstrumentation=void 0;var Zv=(Ge(),ke(Ze)),hy=tn(),SMe=EMe(),jJ="generic-pool",zJ=class extends hy.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(SMe.PACKAGE_NAME,SMe.PACKAGE_VERSION,t)}init(){return[new hy.InstrumentationNodeModuleDefinition(jJ,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,hy.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new hy.InstrumentationNodeModuleDefinition(jJ,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,hy.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new hy.InstrumentationNodeModuleDefinition(jJ,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,hy.isWrapped)(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){let n=this;return function(...o){let i=Zv.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return Zv.context.with(Zv.trace.setSpan(i,a),()=>t.call(this,...o).then(c=>(a.end(),c),c=>{throw a.recordException(c),a.end(),c}))}}_poolWrapper(t){let n=this;return function(){let o=t.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(t){let n=this;return function(o,i){if(n._isDisabled)return t.call(this,o,i);let a=Zv.context.active(),c=n.tracer.startSpan("generic-pool.acquire",{},a);return Zv.context.with(Zv.trace.setSpan(a,c),()=>{t.call(this,(d,m)=>{if(c.end(),o)return o(d,m)},i)})}}};p3.GenericPoolInstrumentation=zJ});var TMe=F(f3=>{"use strict";A();Object.defineProperty(f3,"__esModule",{value:!0});f3.GenericPoolInstrumentation=void 0;var PCt=yMe();Object.defineProperty(f3,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return PCt.GenericPoolInstrumentation}})});var CMe,IMe,bMe,UCt,vMe,RMe=O(()=>{A();CMe=ie(TMe(),1);dt();fr();IMe="GenericPool",bMe=at(IMe,()=>new CMe.GenericPoolInstrumentation({})),UCt=()=>{let e;return{name:IMe,setupOnce(){let t=bMe();e=oN(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=Nt(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Mt,"auto.db.otel.generic_pool")}))}}},vMe=UCt});var HJ=F(UA=>{"use strict";A();Object.defineProperty(UA,"__esModule",{value:!0});UA.ATTR_NET_PEER_PORT=UA.ATTR_NET_PEER_NAME=UA.ATTR_MESSAGING_SYSTEM=UA.ATTR_MESSAGING_OPERATION=void 0;UA.ATTR_MESSAGING_OPERATION="messaging.operation";UA.ATTR_MESSAGING_SYSTEM="messaging.system";UA.ATTR_NET_PEER_NAME="net.peer.name";UA.ATTR_NET_PEER_PORT="net.peer.port"});var $J=F(pi=>{"use strict";A();Object.defineProperty(pi,"__esModule",{value:!0});pi.ATTR_MESSAGING_CONVERSATION_ID=pi.OLD_ATTR_MESSAGING_MESSAGE_ID=pi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=pi.ATTR_MESSAGING_URL=pi.ATTR_MESSAGING_PROTOCOL_VERSION=pi.ATTR_MESSAGING_PROTOCOL=pi.MESSAGING_OPERATION_VALUE_PROCESS=pi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=pi.ATTR_MESSAGING_DESTINATION_KIND=pi.ATTR_MESSAGING_DESTINATION=void 0;pi.ATTR_MESSAGING_DESTINATION="messaging.destination";pi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";pi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";pi.MESSAGING_OPERATION_VALUE_PROCESS="process";pi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";pi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";pi.ATTR_MESSAGING_URL="messaging.url";pi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";pi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";pi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var VJ=F(_y=>{"use strict";A();Object.defineProperty(_y,"__esModule",{value:!0});_y.DEFAULT_CONFIG=_y.EndOperation=void 0;var LCt;(function(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"})(LCt=_y.EndOperation||(_y.EndOperation={}));_y.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var NMe=F(fi=>{"use strict";A();Object.defineProperty(fi,"__esModule",{value:!0});fi.isConfirmChannelTracing=fi.unmarkConfirmChannelTracing=fi.markConfirmChannelTracing=fi.getConnectionAttributesFromUrl=fi.getConnectionAttributesFromServer=fi.normalizeExchange=fi.CONNECTION_ATTRIBUTES=fi.CHANNEL_CONSUME_TIMEOUT_TIMER=fi.CHANNEL_SPANS_NOT_ENDED=fi.MESSAGE_STORED_SPAN=void 0;var qJ=(Ge(),ke(Ze)),aE=tn(),A3=(Kn(),ke(Ur)),TO=HJ(),m3=$J();fi.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");fi.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");fi.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");fi.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var YJ=(0,qJ.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),QCt=e=>e!==""?e:"<default>";fi.normalizeExchange=QCt;var FCt=e=>e.replace(/:[^:@/]*@/,":***@"),xMe=(e,t)=>e||(t==="AMQP"?5672:5671),DMe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},BMe=e=>e||"localhost",LA=(e,t,n,r)=>n?{[t]:n}:(qJ.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),GCt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[TO.ATTR_MESSAGING_SYSTEM]:t}:{}};fi.getConnectionAttributesFromServer=GCt;var jCt=(e,t)=>{let n={[m3.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=DMe(r?.protocol);Object.assign(n,{...LA(e,m3.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=BMe(r?.hostname);t&aE.SemconvStability.OLD&&Object.assign(n,{...LA(e,TO.ATTR_NET_PEER_NAME,i,"hostname")}),t&aE.SemconvStability.STABLE&&Object.assign(n,{...LA(e,A3.ATTR_SERVER_ADDRESS,i,"hostname")});let a=xMe(r.port,o);t&aE.SemconvStability.OLD&&Object.assign(n,LA(e,TO.ATTR_NET_PEER_PORT,a,"port")),t&aE.SemconvStability.STABLE&&Object.assign(n,LA(e,A3.ATTR_SERVER_PORT,a,"port"))}else{let r=FCt(e);n[m3.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=DMe(o.protocol);Object.assign(n,{...LA(r,m3.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let a=BMe(o.hostname);t&aE.SemconvStability.OLD&&Object.assign(n,{...LA(r,TO.ATTR_NET_PEER_NAME,a,"hostname")}),t&aE.SemconvStability.STABLE&&Object.assign(n,{...LA(r,A3.ATTR_SERVER_ADDRESS,a,"hostname")});let c=xMe(o.port?parseInt(o.port):void 0,i);t&aE.SemconvStability.OLD&&Object.assign(n,LA(r,TO.ATTR_NET_PEER_PORT,c,"port")),t&aE.SemconvStability.STABLE&&Object.assign(n,LA(r,A3.ATTR_SERVER_PORT,c,"port"))}catch(o){qJ.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};fi.getConnectionAttributesFromUrl=jCt;var zCt=e=>e.setValue(YJ,!0);fi.markConfirmChannelTracing=zCt;var HCt=e=>e.deleteValue(YJ);fi.unmarkConfirmChannelTracing=HCt;var $Ct=e=>e.getValue(YJ)===!0;fi.isConfirmChannelTracing=$Ct});var OMe=F(Wv=>{"use strict";A();Object.defineProperty(Wv,"__esModule",{value:!0});Wv.PACKAGE_NAME=Wv.PACKAGE_VERSION=void 0;Wv.PACKAGE_VERSION="0.61.0";Wv.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var MMe=F(_3=>{"use strict";A();Object.defineProperty(_3,"__esModule",{value:!0});_3.AmqplibInstrumentation=void 0;var Ko=(Ge(),ke(Ze)),g3=Tr(),Ir=tn(),VCt=HJ(),Ul=$J(),$u=VJ(),Ai=NMe(),wMe=OMe(),h3=[">=0.5.5 <1"],KJ=class extends Ir.InstrumentationBase{_netSemconvStability;constructor(t={}){super(wMe.PACKAGE_NAME,wMe.PACKAGE_VERSION,{...$u.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ir.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...$u.DEFAULT_CONFIG,...t})}init(){let t=new Ir.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",h3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Ir.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",h3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Ir.InstrumentationNodeModuleFile("amqplib/lib/connect.js",h3,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new Ir.InstrumentationNodeModuleDefinition("amqplib",h3,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,Ir.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,Ir.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,Ir.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,Ir.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,Ir.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,$u.EndOperation.Ack)),(0,Ir.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,$u.EndOperation.Nack)),(0,Ir.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,$u.EndOperation.Reject)),(0,Ir.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,$u.EndOperation.AckAll)),(0,Ir.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,$u.EndOperation.NackAll)),(0,Ir.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,Ir.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,Ir.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,Ir.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,Ir.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,Ir.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,Ir.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,Ir.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,Ir.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,Ir.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,Ir.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,a){return t.call(this,o,i,function(c,d){if(c==null){let m=(0,Ai.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,Ai.getConnectionAttributesFromServer)(d);d[Ai.CONNECTION_ATTRIBUTES]={...m,...h}}a.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,$u.EndOperation.ChannelClosed,void 0);let i=this[Ai.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[Ai.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,$u.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(a){return o.endAllSpansOnChannel(this,t,n,a),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(a,c,d){let m=this,h=n===$u.EndOperation.Reject?c:d,S=m[Ai.CHANNEL_SPANS_NOT_ENDED]??[],y=S.findIndex(I=>I.msg===a);if(y<0)o.endConsumerSpan(a,t,n,h);else if(n!==$u.EndOperation.Reject&&c){for(let I=0;I<=y;I++)o.endConsumerSpan(S[I].msg,t,n,h);S.splice(0,y+1)}else o.endConsumerSpan(a,t,n,h),S.splice(y,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,a,c){let d=this;if(!Object.prototype.hasOwnProperty.call(d,Ai.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let S=setInterval(()=>{r.checkConsumeTimeoutOnChannel(d)},h);S.unref(),d[Ai.CHANNEL_CONSUME_TIMEOUT_TIMER]=S}d[Ai.CHANNEL_SPANS_NOT_ENDED]=[]}let m=function(h){if(!h)return a.call(this,h);let S=h.properties.headers??{},y=Ko.propagation.extract(Ko.ROOT_CONTEXT,S),I=h.fields?.exchange,v;if(r._config.useLinksForConsume){let Q=y?Ko.trace.getSpan(y)?.spanContext():void 0;y=void 0,Q&&(v=[{context:Q}])}let x=r.tracer.startSpan(`${i} process`,{kind:Ko.SpanKind.CONSUMER,attributes:{...d?.connection?.[Ai.CONNECTION_ATTRIBUTES],[Ul.ATTR_MESSAGING_DESTINATION]:I,[Ul.ATTR_MESSAGING_DESTINATION_KIND]:Ul.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Ul.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[VCt.ATTR_MESSAGING_OPERATION]:Ul.MESSAGING_OPERATION_VALUE_PROCESS,[Ul.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[Ul.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},y),{consumeHook:N}=r.getConfig();N&&(0,Ir.safeExecuteInTheMiddle)(()=>N(x,{moduleVersion:t,msg:h}),Q=>{Q&&Ko.diag.error("amqplib instrumentation: consumerHook error",Q)},!0),c?.noAck||(d[Ai.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,g3.hrTime)()}),h[Ai.MESSAGE_STORED_SPAN]=x);let M=y||Ko.ROOT_CONTEXT;Ko.context.with(Ko.trace.setSpan(M,x),()=>{a.call(this,h)}),c?.noAck&&(r.callConsumeEndHook(x,h,!1,$u.EndOperation.AutoAck),x.end())};return arguments[1]=m,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,a,c,d,m){let h=this,{span:S,modifiedOptions:y}=r.createPublishSpan(r,i,a,h,d),{publishHook:I}=r.getConfig();I&&(0,Ir.safeExecuteInTheMiddle)(()=>I(S,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:y,isConfirmChannel:!0}),M=>{M&&Ko.diag.error("amqplib instrumentation: publishHook error",M)},!0);let v=function(M,Q){try{m?.call(this,M,Q)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,Ir.safeExecuteInTheMiddle)(()=>j(S,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:d,isConfirmChannel:!0,confirmError:M}),G=>{G&&Ko.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),M&&S.setStatus({code:Ko.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),S.end()}},x=(0,Ai.markConfirmChannelTracing)(Ko.context.active()),N=[...arguments];return N[3]=y,N[4]=Ko.context.bind((0,Ai.unmarkConfirmChannelTracing)(Ko.trace.setSpan(x,S)),v),Ko.context.with(x,n.bind(this,...N))}}getPublishPatch(t,n){let r=this;return function(i,a,c,d){if((0,Ai.isConfirmChannelTracing)(Ko.context.active()))return n.apply(this,arguments);{let m=this,{span:h,modifiedOptions:S}=r.createPublishSpan(r,i,a,m,d),{publishHook:y}=r.getConfig();y&&(0,Ir.safeExecuteInTheMiddle)(()=>y(h,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:S,isConfirmChannel:!1}),x=>{x&&Ko.diag.error("amqplib instrumentation: publishHook error",x)},!0);let I=[...arguments];I[3]=S;let v=n.apply(this,I);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let a=(0,Ai.normalizeExchange)(n),c=t.tracer.startSpan(`publish ${a}`,{kind:Ko.SpanKind.PRODUCER,attributes:{...o.connection[Ai.CONNECTION_ATTRIBUTES],[Ul.ATTR_MESSAGING_DESTINATION]:n,[Ul.ATTR_MESSAGING_DESTINATION_KIND]:Ul.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Ul.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[Ul.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[Ul.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),d=i??{};return d.headers=d.headers??{},Ko.propagation.inject(Ko.trace.setSpan(Ko.context.active(),c),d.headers),{span:c,modifiedOptions:d}}endConsumerSpan(t,n,r,o){let i=t[Ai.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:Ko.SpanStatusCode.ERROR,message:r!==$u.EndOperation.ChannelClosed&&r!==$u.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[Ai.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[Ai.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(a=>{this.endConsumerSpan(a.msg,n,r,o)}),t[Ai.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,Ir.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),a=>{a&&Ko.diag.error("amqplib instrumentation: consumerEndHook error",a)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,g3.hrTime)(),r=t[Ai.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let a=r[o],c=(0,g3.hrTimeDuration)(a.timeOfConsume,n);if((0,g3.hrTimeToMilliseconds)(c)<i)break;this.endConsumerSpan(a.msg,null,$u.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};_3.AmqplibInstrumentation=KJ});var PMe=F(sE=>{"use strict";A();Object.defineProperty(sE,"__esModule",{value:!0});sE.EndOperation=sE.DEFAULT_CONFIG=sE.AmqplibInstrumentation=void 0;var qCt=MMe();Object.defineProperty(sE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return qCt.AmqplibInstrumentation}});var kMe=VJ();Object.defineProperty(sE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return kMe.DEFAULT_CONFIG}});Object.defineProperty(sE,"EndOperation",{enumerable:!0,get:function(){return kMe.EndOperation}})});var UMe,LMe,YCt,QMe,KCt,FMe,GMe=O(()=>{A();UMe=ie(PMe(),1);fr();LMe="Amqplib",YCt={consumeEndHook:e=>{Lr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{Lr(e,"auto.amqplib.otel.publisher")}},QMe=at(LMe,()=>new UMe.AmqplibInstrumentation(YCt)),KCt=()=>({name:LMe,setupOnce(){QMe()}}),FMe=KCt});var CO,JJ=O(()=>{A();CO="VercelAI"});function ZCt(e){if(typeof e!="object"||e===null)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 WCt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(XCt(t.content),eIt(t.content))}function XCt(e){for(let t of e){if(!ZCt(t))continue;let n=vq(t.toolCallId);n?bl(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),en(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):bl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),en(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function eIt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&Rq(t.toolCallId)}function tIt(e,t,n,r){let o=e?.recordInputs!==void 0?e.recordInputs:t.recordInputs!==void 0?t.recordInputs:n===!0?!0:r,i=e?.recordOutputs!==void 0?e.recordOutputs:t.recordOutputs!==void 0?t.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:i}}var S3,JCt,jMe,E3,zMe=O(()=>{A();S3=ie(tn(),1);dt();JJ();JCt=[">=3.0.0 <7"],jMe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];E3=class e extends S3.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",Jn,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new S3.InstrumentationNodeModuleDefinition("ai",JCt,this._patch.bind(this))}callWhenPatched(t){this._isPatched?t():this._callbacks.push(t)}_patch(t){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,i,a)=>{let c=a[0].experimental_telemetry||{},d=c.isEnabled,m=gt(),h=m?.getIntegrationByName(CO),S=h?.options,y=h?!!m?.getOptions().sendDefaultPii:!1,{recordInputs:I,recordOutputs:v}=tIt(S,c,d,y);return a[0].experimental_telemetry={...c,isEnabled:d!==void 0?d:!0,recordInputs:I,recordOutputs:v},ef(()=>Reflect.apply(o,i,a),x=>{x&&typeof x=="object"&&Vi(x,"_sentry_active_span",Dc())},()=>{},x=>{WCt(x)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of jMe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=jMe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function nIt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var HMe,rIt,$Me,VMe=O(()=>{A();dt();fr();JJ();zMe();HMe=at(CO,()=>new E3({}));rIt=(e={})=>{let t;return{name:CO,options:e,setupOnce(){t=HMe()},afterAllSetup(n){e.force??nIt(n)?bL(n):t?.callWhenPatched(()=>bL(n))}}},$Me=rIt});var T3,oIt,y3,qMe=O(()=>{A();T3=ie(tn(),1);dt();oIt=[">=4.0.0 <7"],y3=class extends T3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",Jn,t)}init(){return new T3.InstrumentationNodeModuleDefinition("openai",oIt,this._patch.bind(this))}_patch(t){let n=t;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(t,n){let r=t[n];if(!r)return t;let o=this.getConfig(),i=function(...a){if(GS(N_))return Reflect.construct(r,a);let c=Reflect.construct(r,a);return xL(c,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let a of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(a)){let c=Object.getOwnPropertyDescriptor(r,a);c&&Object.defineProperty(i,a,c)}try{t[n]=i}catch{Object.defineProperty(t,n,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=i}catch{Object.defineProperty(t,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return t}}});var YMe,iIt,KMe,JMe=O(()=>{A();dt();fr();qMe();YMe=at(N_,e=>new y3(e)),iIt=(e={})=>({name:N_,setupOnce(){YMe(e)}}),KMe=iIt});var I3,aIt,C3,ZMe=O(()=>{A();I3=ie(tn(),1);dt();aIt=[">=0.19.2 <1.0.0"],C3=class extends I3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",Jn,t)}init(){return new I3.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",aIt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(GS(O_))return Reflect.construct(n,i);let a=Reflect.construct(n,i);return DL(a,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(o,i,a)}try{t.Anthropic=o}catch{Object.defineProperty(t,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(t.default===n)try{t.default=o}catch{Object.defineProperty(t,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return t}}});var WMe,sIt,XMe,eke=O(()=>{A();dt();fr();ZMe();WMe=at(O_,e=>new C3(e)),sIt=(e={})=>({name:O_,options:e,setupOnce(){WMe(e)}}),XMe=sIt});var Xv,tke,b3,nke=O(()=>{A();Xv=ie(tn(),1);dt();tke=[">=0.10.0 <2"],b3=class extends Xv.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",Jn,t)}init(){return new Xv.InstrumentationNodeModuleDefinition("@google/genai",tke,n=>this._patch(n),n=>n,[new Xv.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",tke,n=>this._patch(n),n=>n)])}_patch(t){let n=t.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return t;let o=function(...i){if(GS(w_))return Reflect.construct(n,i);let a=Reflect.construct(n,i);return BL(a,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(o,i,a)}return nN(t,"GoogleGenAI",o),t}}});var rke,uIt,oke,ike=O(()=>{A();dt();fr();nke();rke=at(w_,e=>new b3(e)),uIt=(e={})=>({name:w_,setupOnce(){rke(e)}}),oke=uIt});function cIt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function lIt(e,t,n){return new Proxy(e,{apply(r,o,i){let c=i[1];(!c||typeof c!="object"||Array.isArray(c))&&(c={},i[1]=c);let d=c.callbacks,m=cIt(d,t);return c.callbacks=m,Reflect.apply(r,o,i)}})}var uE,v3,R3,ake=O(()=>{A();uE=ie(tn(),1);dt();v3=[">=0.1.0 <2.0.0"];R3=class extends uE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",Jn,t)}init(){let t=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)t.push(new uE.InstrumentationNodeModuleDefinition(r,v3,this._patch.bind(this),o=>o,[new uE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,v3,this._patch.bind(this),o=>o)]));return t.push(new uE.InstrumentationNodeModuleDefinition("langchain",v3,this._patch.bind(this),r=>r,[new uE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",v3,this._patch.bind(this),r=>r)])),t}_patch(t){zV([N_,O_,w_]);let n=ML(this.getConfig());return this._patchRunnableMethods(t,n),t}_patchRunnableMethods(t,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=t.universal_exports??t,i=Object.values(o).find(d=>typeof d=="function"&&r.includes(d.name));if(!i)return;let a=i.prototype;if(a.__sentry_patched__)return;a.__sentry_patched__=!0;let c=["invoke","stream","batch"];for(let d of c){let m=a[d];typeof m=="function"&&(a[d]=lIt(m,n))}}}});var ske,dIt,uke,cke=O(()=>{A();dt();fr();ake();ske=at(NL,e=>new R3(e)),dIt=(e={})=>({name:NL,setupOnce(){ske(e)}}),uke=dIt});var eR,lke,x3,dke=O(()=>{A();eR=ie(tn(),1);dt();lke=[">=0.0.0 <2.0.0"],x3=class extends eR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",Jn,t)}init(){return new eR.InstrumentationNodeModuleDefinition("@langchain/langgraph",lke,this._patch.bind(this),n=>n,[new eR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",lke,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&PL(t.StateGraph.prototype,this.getConfig()),t}}});var pke,pIt,fke,Ake=O(()=>{A();dt();fr();dke();pke=at(kL,e=>new x3(e)),pIt=(e={})=>({name:kL,setupOnce(){pke(e)}}),fke=pIt});import*as gke from"node:net";function hke(e,t,n,r,o){let a=()=>{},c=o.firestoreSpanCreationHook;typeof c=="function"&&(a=h=>{(0,Bg.safeExecuteInTheMiddle)(()=>c(h),S=>{S&&Cl.error(S?.message)},!0)});let d=new Bg.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>mke(h,n,r,e,a)),m=["@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"];for(let h of m)d.files.push(new Bg.InstrumentationNodeModuleFile(h,t,S=>mke(S,n,r,e,a),S=>_ke(S,r)));return d}function mke(e,t,n,r,o){return _ke(e,n),t(e,"addDoc",fIt(r,o)),t(e,"getDocs",mIt(r,o)),t(e,"setDoc",gIt(r,o)),t(e,"deleteDoc",AIt(r,o)),e}function _ke(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Bg.isWrapped)(e[n])&&t(e,n);return e}function fIt(e,t){return function(r){return function(o,i){let a=B3(e,"addDoc",o);return t(a),D3(a,()=>r(o,i))}}}function AIt(e,t){return function(r){return function(o){let i=B3(e,"deleteDoc",o.parent||o);return t(i),D3(i,()=>r(o))}}}function mIt(e,t){return function(r){return function(o){let i=B3(e,"getDocs",o);return t(i),D3(i,()=>r(o))}}}function gIt(e,t){return function(r){return function(o,i,a){let c=B3(e,"setDoc",o.parent||o);return t(c),D3(c,()=>typeof a<"u"?r(o,i,a):r(o,i))}}}function D3(e,t){return Ye.with(zt.setSpan(Ye.active(),e),()=>(0,Bg.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function B3(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:oo.CLIENT});return _It(r,n),r.setAttribute(FI,t),r}function hIt(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(gke.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(":");r!==-1?(t=e.host.slice(0,r),n=e.host.slice(r+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function _It(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},a={[f5]:t.path,[A5]:n.name,[CS]:"firebase.firestore","firebase.firestore.type":t.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:c,port:d}=hIt(i);c&&(a[T5]=c),d&&(a[C5]=d),e.setAttributes(a)}var Bg,Eke=O(()=>{A();Ge();Bg=ie(tn(),1);Kn()});function Ske(e,t,n,r,o){let i=()=>{},a=()=>{},c=o.functions?.errorHook,d=o.functions?.requestHook,m=o.functions?.responseHook;typeof m=="function"&&(a=(y,I)=>{(0,Ng.safeExecuteInTheMiddle)(()=>m(y,I),v=>{v&&Cl.error(v?.message)},!0)}),typeof d=="function"&&(i=y=>{(0,Ng.safeExecuteInTheMiddle)(()=>d(y),I=>{I&&Cl.error(I?.message)},!0)});let h=new Ng.InstrumentationNodeModuleDefinition("firebase-functions",t);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:y,triggerType:I})=>{h.files.push(new Ng.InstrumentationNodeModuleFile(y,t,v=>EIt(v,n,r,e,{requestHook:i,responseHook:a,errorHook:c},I),v=>yke(v,r)))}),h}function Vu(e,t,n){return function(o){return function(...i){let a=typeof i[0]=="function"?i[0]:i[1],c=typeof i[0]=="function"?void 0:i[0];if(!a)return o.call(this,...i);let d=async function(...m){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",S=e.startSpan(`firebase.function.${n}`,{kind:oo.SERVER}),y={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(y["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(y["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),S.setAttributes(y),t?.requestHook?.(S),Ye.with(zt.setSpan(Ye.active(),S),async()=>{let I,v;try{v=await a.apply(this,m)}catch(x){I=x}if(t?.responseHook?.(S,I),I&&S.recordException(I),S.end(),I)throw await t?.errorHook?.(S,I),I;return v})};return c?o.call(this,c,d):o.call(this,d)}}}function EIt(e,t,n,r,o,i){switch(yke(e,n),i){case"function":t(e,"onRequest",Vu(r,o,"http.request")),t(e,"onCall",Vu(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",Vu(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",Vu(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",Vu(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",Vu(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",Vu(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",Vu(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",Vu(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",Vu(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",Vu(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",Vu(r,o,"storage.object.finalized")),t(e,"onObjectArchived",Vu(r,o,"storage.object.archived")),t(e,"onObjectDeleted",Vu(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",Vu(r,o,"storage.object.metadataUpdated"));break}return e}function yke(e,t){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Ng.isWrapped)(e[r])&&t(e,r);return e}var Ng,Tke=O(()=>{A();Ge();Ng=ie(tn(),1)});var Ike,Cke,SIt,yIt,N3,bke=O(()=>{A();Ike=ie(tn(),1);dt();Eke();Tke();Cke={},SIt=[">=3.0.0 <5"],yIt=[">=6.0.0 <7"],N3=class extends Ike.InstrumentationBase{constructor(t=Cke){super("@sentry/instrumentation-firebase",Jn,t)}setConfig(t={}){super.setConfig({...Cke,...t})}init(){let t=[];return t.push(hke(this.tracer,SIt,this._wrap,this._unwrap,this.getConfig())),t.push(Ske(this.tracer,yIt,this._wrap,this._unwrap,this.getConfig())),t}}});var vke,TIt,Rke,CIt,xke,Dke=O(()=>{A();dt();fr();bke();vke="Firebase",TIt={firestoreSpanCreationHook:e=>{Lr(e,"auto.firebase.otel.firestore"),e.setAttribute(Zt,"db.query")},functions:{requestHook:e=>{Lr(e,"auto.firebase.otel.functions"),e.setAttribute(Zt,"http.request")},errorHook:async(e,t)=>{t&&(en(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Ib(2e3))}}},Rke=at(vke,()=>new N3(TIt)),CIt=()=>({name:vke,setupOnce(){Rke()}}),xke=CIt});function Bke(){return[wxe(),f1e(),F1e(),xwe(),RBe(),jBe(),eNe(),pNe(),HNe(),dOe(),cwe(),Cwe(),Hwe(),rMe(),hMe(),vMe(),rBe(),FMe(),ABe(),uke(),fke(),$Me(),KMe(),XMe(),oke(),mOe(),xke()]}var Nke=O(()=>{A();GMe();eke();oMe();Mxe();g1e();Dke();RMe();ike();j1e();Iwe();Dwe();oBe();$we();cke();Ake();mBe();xBe();zBe();tNe();fNe();JMe();pOe();gOe();lwe();$Ne();_Me();VMe()});function wke(e,t={}){e.getOptions().debug&&oY();let[n,r]=IIt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function IIt(e,t={}){let n=new Oke.BasicTracerProvider({sampler:new jQ(e),resource:(0,O3.defaultResource)().merge((0,O3.resourceFromAttributes)({[I5]:"node",[p5]:"sentry",[b5]:Jn})),forceFlushTimeoutMillis:500,spanProcessors:[new GQ({timeout:bIt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});zt.setGlobalTracerProvider(n),Hp.setGlobalPropagator(new FQ);let r=new HQ;return Ye.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function bIt(e){if(e!=null){if(e>ZJ)return Sa&&J.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${ZJ}`),ZJ;if(e<=0||Number.isNaN(e)){Sa&&J.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var O3,Oke,ZJ,Mke=O(()=>{A();Ge();O3=ie(h7(),1),Oke=ie(z7(),1);Kn();dt();fr();nv();oy();ZJ=1e6});function kke(){return ZQ().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(cxe(),_xe())}function Pke(e){return[...kke(),...Ri(e)?Bke():[]]}function WJ(e={}){return vIt(e,Pke)}function vIt(e={},t){jS(e,"node");let n=BY({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(wke(n,{spanProcessors:e.openTelemetrySpanProcessors}),WQ()),n}var Uke=O(()=>{A();dt();fr();lxe();Exe();Nke();Mke()});var tR=O(()=>{A();Uke();dt();fr()});function ta(){return RIt}function qu(){return Lke}function Qke(){return xIt}var RIt,Lke,xIt,Ll=O(()=>{"use strict";A();RIt="prod",Lke="0.1.112",xIt=`@tanagram/lore/${Lke}`});function wIt(e=""){if(!NIt.test(e))return e!==e.toLowerCase()}function Fke(e,t){let n=t??OIt,r=[];if(!e||typeof e!="string")return r;let o="",i,a;for(let c of e){let d=n.includes(c);if(d===!0){r.push(o),o="",i=void 0;continue}let m=wIt(c);if(a===!1){if(i===!1&&m===!0){r.push(o),o=c,i=m;continue}if(i===!0&&m===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+c,i=m;continue}}o+=c,i=m,a=d}return r.push(o),r}function MIt(e){return e?e[0].toUpperCase()+e.slice(1):""}function kIt(e){return e?e[0].toLowerCase()+e.slice(1):""}function PIt(e,t){return e?(Array.isArray(e)?e:Fke(e)).map(n=>MIt(t?.normalize?n.toLowerCase():n)).join(""):""}function bO(e,t){return kIt(PIt(e||"",t))}function w3(e,t){return e?(Array.isArray(e)?e:Fke(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function Gke(e){return w3(e||"","_")}var NIt,OIt,jke=O(()=>{A();NIt=/\d/,OIt=["-","_","/","."]});import{parseArgs as UIt}from"node:util";function U3(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function XJ(e,t=""){let n=[];for(let r of e)for(let[o,i]of r.entries())n[o]=Math.max(n[o]||0,i.length);return e.map(r=>r.map((o,i)=>t+o[i===0?"padStart":"padEnd"](n[i])).join(" ")).join(`
|
|
39
39
|
`)}function Ql(e){return typeof e=="function"?e():e}function LIt(e=[],t={}){let n=new Set(t.boolean||[]),r=new Set(t.string||[]),o=t.alias||{},i=t.default||{},a=new Map,c=new Map;for(let[N,M]of Object.entries(o)){let Q=M;for(let j of Q)a.set(N,j),c.has(j)||c.set(j,[]),c.get(j).push(N),a.set(j,N),c.has(N)||c.set(N,[]),c.get(N).push(j)}let d={};function m(N){if(n.has(N))return"boolean";let M=c.get(N)||[];for(let Q of M)if(n.has(Q))return"boolean";return"string"}function h(N){if(r.has(N))return!0;let M=c.get(N)||[];for(let Q of M)if(r.has(Q))return!0;return!1}let S=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(i)]);for(let N of S)d[N]||(d[N]={type:m(N),default:i[N]});for(let[N,M]of a.entries())N.length===1&&d[M]&&!d[M].short&&(d[M].short=N);let y=[],I={};for(let N=0;N<e.length;N++){let M=e[N];if(M==="--"){y.push(...e.slice(N));break}if(M.startsWith("--no-")){let Q=M.slice(5);I[Q]=!0;continue}y.push(M)}let v;try{v=UIt({args:y,options:Object.keys(d).length>0?d:void 0,allowPositionals:!0,strict:!1})}catch{v={values:{},positionals:y}}let x={_:[]};x._=v.positionals;for(let[N,M]of Object.entries(v.values)){let Q=M;m(N)==="boolean"&&typeof M=="string"?Q=M!=="false":h(N)&&typeof M=="boolean"&&(Q=""),x[N]=Q}for(let[N]of Object.entries(I)){x[N]=!1;let M=a.get(N);M&&(x[M]=!1);let Q=c.get(N);if(Q)for(let j of Q)x[j]=!1}for(let[N,M]of a.entries())x[N]!==void 0&&x[M]===void 0&&(x[M]=x[N]),x[M]!==void 0&&x[N]===void 0&&(x[N]=x[M]),x[N]!==x[M]&&i[M]===x[M]&&(x[M]=x[N]);return x}function FIt(e,t){let n={boolean:[],string:[],alias:{},default:{}},r=$ke(t);for(let c of r){if(c.type==="positional")continue;c.type==="string"||c.type==="enum"?n.string.push(c.name):c.type==="boolean"&&n.boolean.push(c.name),c.default!==void 0&&(n.default[c.name]=c.default),c.alias&&(n.alias[c.name]=c.alias);let d=bO(c.name),m=w3(c.name);if(d!==c.name||m!==c.name){let h=U3(n.alias[c.name]||[]);d!==c.name&&!h.includes(d)&&h.push(d),m!==c.name&&!h.includes(m)&&h.push(m),h.length>0&&(n.alias[c.name]=h)}}let o=LIt(e,n),[...i]=o._,a=new Proxy(o,{get(c,d){return c[d]??c[bO(d)]??c[w3(d)]}});for(let[,c]of r.entries())if(c.type==="positional"){let d=i.shift();if(d!==void 0)a[c.name]=d;else{if(c.default===void 0&&c.required!==!1)throw new Ey(`Missing required positional argument: ${c.name.toUpperCase()}`,"EARG");a[c.name]=c.default}}else if(c.type==="enum"){let d=a[c.name],m=c.options||[];if(d!==void 0&&m.length>0&&!m.includes(d))throw new Ey(`Invalid value for argument: ${uf(`--${c.name}`)} (${uf(d)}). Expected one of: ${m.map(h=>uf(h)).join(", ")}.`,"EARG")}else if(c.required&&a[c.name]===void 0)throw new Ey(`Missing required argument: --${c.name}`,"EARG");return a}function $ke(e){let t=[];for(let[n,r]of Object.entries(e||{}))t.push({...r,name:n,alias:U3(r.alias)});return t}async function GIt(e){return Promise.all(e.map(t=>Ql(t)))}async function Sy(e,t){let n=await Ql(e.args||{}),r=FIt(t.rawArgs,n),o={rawArgs:t.rawArgs,args:r,data:t.data,cmd:e},i=await GIt(e.plugins??[]),a,c;try{for(let h of i)await h.setup?.(o);typeof e.setup=="function"&&await e.setup(o);let m=await Ql(e.subCommands);if(m&&Object.keys(m).length>0){let h=jIt(t.rawArgs,n),S=t.rawArgs[h];if(S){let y=await zke(m,S);if(!y)throw new Ey(`Unknown command ${uf(S)}`,"E_UNKNOWN_COMMAND");await Sy(y,{rawArgs:t.rawArgs.slice(h+1)})}else{let y=await Ql(e.default);if(y){if(e.run)throw new Ey("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let I=await zke(m,y);if(!I)throw new Ey(`Default sub command ${uf(y)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await Sy(I,{rawArgs:t.rawArgs})}else if(!e.run)throw new Ey("No command specified.","E_NO_COMMAND")}}typeof e.run=="function"&&(a=await e.run(o))}catch(m){c=m}let d=[];if(typeof e.cleanup=="function")try{await e.cleanup(o)}catch(m){d.push(m)}for(let m of[...i].reverse())try{await m.cleanup?.(o)}catch(h){d.push(h)}if(c)throw c;if(d.length===1)throw d[0];if(d.length>1)throw new Error("Multiple cleanup errors",{cause:d});return{result:a}}async function zke(e,t){if(t in e)return Ql(e[t]);for(let n of Object.values(e)){let r=await Ql(n),o=await Ql(r?.meta);if(o?.alias&&U3(o.alias).includes(t))return r}}function jIt(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&zIt(r,t)&&n++;continue}return n}return-1}function zIt(e,t){let n=e.replace(/^-{1,2}/,""),r=bO(n);for(let[o,i]of Object.entries(t))if(!(i.type!=="string"&&i.type!=="enum")&&(r===bO(o)||(Array.isArray(i.alias)?i.alias:i.alias?[i.alias]:[]).includes(n)))return!0;return!1}async function tZ(e,t){let n=await Ql(e.meta||{}),r=$ke(await Ql(e.args||{})),o=await Ql(t?.meta||{}),i=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),a=[],c=[],d=[],m=[];for(let I of r)if(I.type==="positional"){let v=I.name.toUpperCase(),x=I.required!==!1&&I.default===void 0;c.push([uf(v+eZ(I)),Hke(I,x)]),m.push(x?`<${v}>`:`[${v}]`)}else{let v=I.required===!0&&I.default===void 0,x=[...(I.alias||[]).map(N=>`-${N}`),`--${I.name}`].join(", ")+eZ(I);if(a.push([uf(x),Hke(I,v)]),I.type==="boolean"&&(I.default===!0||I.negativeDescription)&&!HIt.test(I.name)){let N=[...(I.alias||[]).map(M=>`--no-${M}`),`--no-${I.name}`].join(", ");a.push([uf(N),[I.negativeDescription,v?P3("(Required)"):""].filter(Boolean).join(" ")])}v&&m.push(`--${I.name}`+eZ(I))}if(e.subCommands){let I=[],v=await Ql(e.subCommands);for(let[x,N]of Object.entries(v)){let M=await Ql((await Ql(N))?.meta);if(M?.hidden)continue;let Q=U3(M?.alias),j=[x,...Q].join(", ");d.push([uf(j),M?.description||""]),I.push(x,...Q)}m.push(I.join("|"))}let h=[],S=n.version||o.version;h.push(P3(`${n.description} (${i+(S?` v${S}`:"")})`),"");let y=a.length>0||c.length>0;return h.push(`${k3(M3("USAGE"))} ${uf(`${i}${y?" [OPTIONS]":""} ${m.join(" ")}`)}`,""),c.length>0&&(h.push(k3(M3("ARGUMENTS")),""),h.push(XJ(c," ")),h.push("")),a.length>0&&(h.push(k3(M3("OPTIONS")),""),h.push(XJ(a," ")),h.push("")),d.length>0&&(h.push(k3(M3("COMMANDS")),""),h.push(XJ(d," ")),h.push("",`Use ${uf(`${i} <command> --help`)} for more information about a command.`)),h.filter(I=>typeof I=="string").join(`
|
|
40
40
|
`)}function eZ(e){let t=e.valueHint?`=<${e.valueHint}>`:"",n=t||`=<${Gke(e.name)}>`;return!e.type||e.type==="positional"||e.type==="boolean"?t:e.type==="enum"&&e.options?.length?`=<${e.options.join("|")}>`:n}function Hke(e,t){let n=t?P3("(Required)"):"",r=e.default===void 0?"":P3(`(Default: ${e.default})`);return[e.description,n,r].filter(Boolean).join(" ")}var Ey,QIt,L3,M3,uf,P3,k3,HIt,nZ=O(()=>{A();jke();Ey=class extends Error{code;constructor(e,t){super(e),this.name="CLIError",this.code=t}};QIt=(()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||e.TEST||e.CI})(),L3=(e,t=39)=>n=>QIt?n:`\x1B[${e}m${n}\x1B[${t}m`,M3=L3(1,22),uf=L3(36),P3=L3(90),k3=L3(4,24);HIt=/^no[-A-Z]/});function VIt(e){Kke=e}function F3(){return Kke}function st(e,t){let n=G3({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,F3(),vO].filter(r=>!!r)});e.common.issues.push(n)}function bn(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,c)=>a.code!=="invalid_type"?{message:c.defaultError}:typeof c.data>"u"?{message:r??c.defaultError}:{message:n??c.defaultError},description:o}}function rbt(e,t){return!!((t==="v4"||!t)&&ebt.test(e)||(t==="v6"||!t)&&tbt.test(e))}function obt(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),a=parseInt(t.toFixed(o).replace(".",""));return i%a/Math.pow(10,o)}function nR(e){if(e instanceof uu){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=cf.create(nR(r))}return new uu({...e._def,shape:()=>t})}else return e instanceof wg?new wg({...e._def,type:nR(e.element)}):e instanceof cf?cf.create(nR(e.unwrap())):e instanceof Mg?Mg.create(nR(e.unwrap())):e instanceof QA?QA.create(e.items.map(t=>nR(t))):e}function uZ(e,t){let n=cE(e),r=cE(t);if(e===t)return{valid:!0,data:e};if(n===it.object&&r===it.object){let o=gr.objectKeys(t),i=gr.objectKeys(e).filter(c=>o.indexOf(c)!==-1),a={...e,...t};for(let c of i){let d=uZ(e[c],t[c]);if(!d.valid)return{valid:!1};a[c]=d.data}return{valid:!0,data:a}}else if(n===it.array&&r===it.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],c=t[i],d=uZ(a,c);if(!d.valid)return{valid:!1};o.push(d.data)}return{valid:!0,data:o}}else return n===it.date&&r===it.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function Zke(e,t){return new Ny({values:e,typeName:qt.ZodEnum,...bn(t)})}var gr,iZ,it,cE,$e,$It,Qc,vO,Kke,G3,qIt,su,gn,Jke,Yu,aZ,sZ,RO,j3,Pt,Kd,Vke,vn,YIt,KIt,JIt,ZIt,WIt,XIt,ebt,tbt,nbt,lE,yy,Ty,Cy,Iy,rR,by,vy,dE,Og,lf,oR,wg,uu,Ry,Q3,z3,xy,QA,H3,iR,aR,$3,Dy,By,Ny,Oy,pE,Fl,cf,Mg,wy,sR,uR,ibt,V3,xO,cR,Wke,abt,qt,sbt,Xke,e2e,ubt,cbt,t2e,lbt,dbt,pbt,fbt,Abt,mbt,gbt,hbt,_bt,Ebt,Sbt,ybt,Tbt,Cbt,Ibt,bbt,vbt,Rbt,xbt,Dbt,Bbt,Nbt,Obt,wbt,qke,Mbt,kbt,Pbt,Ubt,Lbt,Qbt,Fbt,Gbt,jbt,au,zbt,rZ,Hbt,Yd,cZ,kCn,PCn,UCn,n2e,$bt,Vbt,qbt,Ybt,r2e,o2e,i2e,oZ,ns,Kbt,Jbt,Zbt,Wbt,lZ,dZ,pZ,Xbt,Yke,evt,tvt,nvt,rvt,fZ,df=O(()=>{A();(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(c=>typeof o[o[c]]!="number"),a={};for(let c of i)a[c]=o[c];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(gr||(gr={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(iZ||(iZ={}));it=gr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cE=e=>{switch(typeof e){case"undefined":return it.undefined;case"string":return it.string;case"number":return isNaN(e)?it.nan:it.number;case"boolean":return it.boolean;case"function":return it.function;case"bigint":return it.bigint;case"symbol":return it.symbol;case"object":return Array.isArray(e)?it.array:e===null?it.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?it.promise:typeof Map<"u"&&e instanceof Map?it.map:typeof Set<"u"&&e instanceof Set?it.set:typeof Date<"u"&&e instanceof Date?it.date:it.object;default:return it.unknown}},$e=gr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$It=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Qc=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let c=r,d=0;for(;d<a.path.length;){let m=a.path[d];d===a.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(n(a))):c[m]=c[m]||{_errors:[]},c=c[m],d++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,gr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},r=[];for(let o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Qc.create=e=>new Qc(e);vO=(e,t)=>{let n;switch(e.code){case $e.invalid_type:e.received===it.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case $e.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gr.jsonStringifyReplacer)}`;break;case $e.unrecognized_keys:n=`Unrecognized key(s) in object: ${gr.joinValues(e.keys,", ")}`;break;case $e.invalid_union:n="Invalid input";break;case $e.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gr.joinValues(e.options)}`;break;case $e.invalid_enum_value:n=`Invalid enum value. Expected ${gr.joinValues(e.options)}, received '${e.received}'`;break;case $e.invalid_arguments:n="Invalid function arguments";break;case $e.invalid_return_type:n="Invalid function return type";break;case $e.invalid_date:n="Invalid date";break;case $e.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:gr.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case $e.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case $e.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case $e.custom:n="Invalid input";break;case $e.invalid_intersection_types:n="Intersection results could not be merged";break;case $e.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case $e.not_finite:n="Number must be finite";break;default:n=t.defaultError,gr.assertNever(e)}return{message:n}},Kke=vO;G3=e=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],a={...o,path:i},c="",d=r.filter(m=>!!m).slice().reverse();for(let m of d)c=m(a,{data:t,defaultError:c}).message;return{...o,path:i,message:o.message||c}},qIt=[];su=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let o of n){if(o.status==="aborted")return gn;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let o of n)r.push({key:await o.key,value:await o.value});return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let o of n){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return gn;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(r[i.value]=a.value)}return{status:t.value,value:r}}},gn=Object.freeze({status:"aborted"}),Jke=e=>({status:"dirty",value:e}),Yu=e=>({status:"valid",value:e}),aZ=e=>e.status==="aborted",sZ=e=>e.status==="dirty",RO=e=>e.status==="valid",j3=e=>typeof Promise<"u"&&e instanceof Promise;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Pt||(Pt={}));Kd=class{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Vke=(e,t)=>{if(RO(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Qc(e.common.issues);return this._error=n,this._error}}};vn=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return cE(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:cE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new su,ctx:{common:t.parent.common,data:t.data,parsedType:cE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(j3(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let o={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cE(t)},i=this._parseSync({data:t,path:o.path,parent:o});return Vke(o,i)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cE(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(j3(o)?o:Promise.resolve(o));return Vke(r,i)}refine(t,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{let a=t(o),c=()=>i.addIssue({code:$e.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(d=>d?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Fl({schema:this,typeName:qt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return cf.create(this,this._def)}nullable(){return Mg.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wg.create(this,this._def)}promise(){return pE.create(this,this._def)}or(t){return Ry.create([this,t],this._def)}and(t){return xy.create(this,t,this._def)}transform(t){return new Fl({...bn(this._def),schema:this,typeName:qt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new wy({...bn(this._def),innerType:this,defaultValue:n,typeName:qt.ZodDefault})}brand(){return new V3({typeName:qt.ZodBranded,type:this,...bn(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new sR({...bn(this._def),innerType:this,catchValue:n,typeName:qt.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return xO.create(this,t)}readonly(){return cR.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},YIt=/^c[^\s-]{8,}$/i,KIt=/^[a-z][a-z0-9]*$/,JIt=/[0-9A-HJKMNP-TV-Z]{26}/,ZIt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,WIt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XIt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),ebt=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,tbt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,nbt=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");lE=class e extends vn{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(o=>t.test(o),{validation:n,code:$e.invalid_string,...Pt.errToObj(r)}),this.nonempty=t=>this.min(1,Pt.errToObj(t)),this.trim=()=>new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==it.string){let i=this._getOrReturnCtx(t);return st(i,{code:$e.invalid_type,expected:it.string,received:i.parsedType}),gn}let r=new su,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),st(o,{code:$e.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),st(o,{code:$e.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,c=t.data.length<i.value;(a||c)&&(o=this._getOrReturnCtx(t,o),a?st(o,{code:$e.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&st(o,{code:$e.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")WIt.test(t.data)||(o=this._getOrReturnCtx(t,o),st(o,{validation:"email",code:$e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")XIt.test(t.data)||(o=this._getOrReturnCtx(t,o),st(o,{validation:"emoji",code:$e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")ZIt.test(t.data)||(o=this._getOrReturnCtx(t,o),st(o,{validation:"uuid",code:$e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")YIt.test(t.data)||(o=this._getOrReturnCtx(t,o),st(o,{validation:"cuid",code:$e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")KIt.test(t.data)||(o=this._getOrReturnCtx(t,o),st(o,{validation:"cuid2",code:$e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")JIt.test(t.data)||(o=this._getOrReturnCtx(t,o),st(o,{validation:"ulid",code:$e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),st(o,{validation:"url",code:$e.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),st(o,{validation:"regex",code:$e.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),st(o,{code:$e.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),st(o,{code:$e.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),st(o,{code:$e.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?nbt(i).test(t.data)||(o=this._getOrReturnCtx(t,o),st(o,{code:$e.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?rbt(t.data,i.version)||(o=this._getOrReturnCtx(t,o),st(o,{validation:"ip",code:$e.invalid_string,message:i.message}),r.dirty()):gr.assertNever(i);return{status:r.value,value:t.data}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Pt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Pt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Pt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Pt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Pt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Pt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Pt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Pt.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,...Pt.errToObj(t?.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Pt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Pt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Pt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Pt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Pt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Pt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Pt.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};lE.create=e=>{var t;return new lE({checks:[],typeName:qt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...bn(e)})};yy=class e extends vn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==it.number){let i=this._getOrReturnCtx(t);return st(i,{code:$e.invalid_type,expected:it.number,received:i.parsedType}),gn}let r,o=new su;for(let i of this._def.checks)i.kind==="int"?gr.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:$e.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),st(r,{code:$e.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),st(r,{code:$e.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?obt(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),st(r,{code:$e.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),st(r,{code:$e.not_finite,message:i.message}),o.dirty()):gr.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Pt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Pt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Pt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Pt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Pt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Pt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Pt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Pt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Pt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Pt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Pt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Pt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Pt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Pt.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&gr.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};yy.create=e=>new yy({checks:[],typeName:qt.ZodNumber,coerce:e?.coerce||!1,...bn(e)});Ty=class e extends vn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==it.bigint){let i=this._getOrReturnCtx(t);return st(i,{code:$e.invalid_type,expected:it.bigint,received:i.parsedType}),gn}let r,o=new su;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),st(r,{code:$e.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),st(r,{code:$e.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),st(r,{code:$e.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):gr.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Pt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Pt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Pt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Pt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Pt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Pt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Pt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Pt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Pt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Pt.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Ty.create=e=>{var t;return new Ty({checks:[],typeName:qt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...bn(e)})};Cy=class extends vn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==it.boolean){let r=this._getOrReturnCtx(t);return st(r,{code:$e.invalid_type,expected:it.boolean,received:r.parsedType}),gn}return Yu(t.data)}};Cy.create=e=>new Cy({typeName:qt.ZodBoolean,coerce:e?.coerce||!1,...bn(e)});Iy=class e extends vn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==it.date){let i=this._getOrReturnCtx(t);return st(i,{code:$e.invalid_type,expected:it.date,received:i.parsedType}),gn}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return st(i,{code:$e.invalid_date}),gn}let r=new su,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),st(o,{code:$e.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),st(o,{code:$e.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):gr.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Pt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Pt.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Iy.create=e=>new Iy({checks:[],coerce:e?.coerce||!1,typeName:qt.ZodDate,...bn(e)});rR=class extends vn{_parse(t){if(this._getType(t)!==it.symbol){let r=this._getOrReturnCtx(t);return st(r,{code:$e.invalid_type,expected:it.symbol,received:r.parsedType}),gn}return Yu(t.data)}};rR.create=e=>new rR({typeName:qt.ZodSymbol,...bn(e)});by=class extends vn{_parse(t){if(this._getType(t)!==it.undefined){let r=this._getOrReturnCtx(t);return st(r,{code:$e.invalid_type,expected:it.undefined,received:r.parsedType}),gn}return Yu(t.data)}};by.create=e=>new by({typeName:qt.ZodUndefined,...bn(e)});vy=class extends vn{_parse(t){if(this._getType(t)!==it.null){let r=this._getOrReturnCtx(t);return st(r,{code:$e.invalid_type,expected:it.null,received:r.parsedType}),gn}return Yu(t.data)}};vy.create=e=>new vy({typeName:qt.ZodNull,...bn(e)});dE=class extends vn{constructor(){super(...arguments),this._any=!0}_parse(t){return Yu(t.data)}};dE.create=e=>new dE({typeName:qt.ZodAny,...bn(e)});Og=class extends vn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Yu(t.data)}};Og.create=e=>new Og({typeName:qt.ZodUnknown,...bn(e)});lf=class extends vn{_parse(t){let n=this._getOrReturnCtx(t);return st(n,{code:$e.invalid_type,expected:it.never,received:n.parsedType}),gn}};lf.create=e=>new lf({typeName:qt.ZodNever,...bn(e)});oR=class extends vn{_parse(t){if(this._getType(t)!==it.undefined){let r=this._getOrReturnCtx(t);return st(r,{code:$e.invalid_type,expected:it.void,received:r.parsedType}),gn}return Yu(t.data)}};oR.create=e=>new oR({typeName:qt.ZodVoid,...bn(e)});wg=class e extends vn{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==it.array)return st(n,{code:$e.invalid_type,expected:it.array,received:n.parsedType}),gn;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,c=n.data.length<o.exactLength.value;(a||c)&&(st(n,{code:a?$e.too_big:$e.too_small,minimum:c?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(st(n,{code:$e.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(st(n,{code:$e.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>o.type._parseAsync(new Kd(n,a,n.path,c)))).then(a=>su.mergeArray(r,a));let i=[...n.data].map((a,c)=>o.type._parseSync(new Kd(n,a,n.path,c)));return su.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Pt.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Pt.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Pt.toString(n)}})}nonempty(t){return this.min(1,t)}};wg.create=(e,t)=>new wg({type:e,minLength:null,maxLength:null,exactLength:null,typeName:qt.ZodArray,...bn(t)});uu=class e extends vn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=gr.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==it.object){let m=this._getOrReturnCtx(t);return st(m,{code:$e.invalid_type,expected:it.object,received:m.parsedType}),gn}let{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof lf&&this._def.unknownKeys==="strip"))for(let m in o.data)a.includes(m)||c.push(m);let d=[];for(let m of a){let h=i[m],S=o.data[m];d.push({key:{status:"valid",value:m},value:h._parse(new Kd(o,S,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof lf){let m=this._def.unknownKeys;if(m==="passthrough")for(let h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(m==="strict")c.length>0&&(st(o,{code:$e.unrecognized_keys,keys:c}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let h of c){let S=o.data[h];d.push({key:{status:"valid",value:h},value:m._parse(new Kd(o,S,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let m=[];for(let h of d){let S=await h.key;m.push({key:S,value:await h.value,alwaysSet:h.alwaysSet})}return m}).then(m=>su.mergeObjectSync(r,m)):su.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Pt.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,a,c;let d=(a=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=Pt.errToObj(t).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:qt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return gr.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return gr.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return nR(this)}partial(t){let n={};return gr.objectKeys(this.shape).forEach(r=>{let o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return gr.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof cf;)i=i._def.innerType;n[r]=i}}),new e({...this._def,shape:()=>n})}keyof(){return Zke(gr.objectKeys(this.shape))}};uu.create=(e,t)=>new uu({shape:()=>e,unknownKeys:"strip",catchall:lf.create(),typeName:qt.ZodObject,...bn(t)});uu.strictCreate=(e,t)=>new uu({shape:()=>e,unknownKeys:"strict",catchall:lf.create(),typeName:qt.ZodObject,...bn(t)});uu.lazycreate=(e,t)=>new uu({shape:e,unknownKeys:"strip",catchall:lf.create(),typeName:qt.ZodObject,...bn(t)});Ry=class extends vn{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=i.map(c=>new Qc(c.ctx.common.issues));return st(n,{code:$e.invalid_union,unionErrors:a}),gn}if(n.common.async)return Promise.all(r.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let d of r){let m={...n,common:{...n.common,issues:[]},parent:null},h=d._parseSync({data:n.data,path:n.path,parent:m});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:m}),m.common.issues.length&&a.push(m.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=a.map(d=>new Qc(d));return st(n,{code:$e.invalid_union,unionErrors:c}),gn}}get options(){return this._def.options}};Ry.create=(e,t)=>new Ry({options:e,typeName:qt.ZodUnion,...bn(t)});Q3=e=>e instanceof Dy?Q3(e.schema):e instanceof Fl?Q3(e.innerType()):e instanceof By?[e.value]:e instanceof Ny?e.options:e instanceof Oy?Object.keys(e.enum):e instanceof wy?Q3(e._def.innerType):e instanceof by?[void 0]:e instanceof vy?[null]:null,z3=class e extends vn{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.object)return st(n,{code:$e.invalid_type,expected:it.object,received:n.parsedType}),gn;let r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(st(n,{code:$e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),gn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let o=new Map;for(let i of n){let a=Q3(i.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of a){if(o.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);o.set(c,i)}}return new e({typeName:qt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...bn(r)})}};xy=class extends vn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(i,a)=>{if(aZ(i)||aZ(a))return gn;let c=uZ(i.value,a.value);return c.valid?((sZ(i)||sZ(a))&&n.dirty(),{status:n.value,value:c.data}):(st(r,{code:$e.invalid_intersection_types}),gn)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};xy.create=(e,t,n)=>new xy({left:e,right:t,typeName:qt.ZodIntersection,...bn(n)});QA=class e extends vn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.array)return st(r,{code:$e.invalid_type,expected:it.array,received:r.parsedType}),gn;if(r.data.length<this._def.items.length)return st(r,{code:$e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gn;!this._def.rest&&r.data.length>this._def.items.length&&(st(r,{code:$e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((a,c)=>{let d=this._def.items[c]||this._def.rest;return d?d._parse(new Kd(r,a,r.path,c)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>su.mergeArray(n,a)):su.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};QA.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new QA({items:e,typeName:qt.ZodTuple,rest:null,...bn(t)})};H3=class e extends vn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.object)return st(r,{code:$e.invalid_type,expected:it.object,received:r.parsedType}),gn;let o=[],i=this._def.keyType,a=this._def.valueType;for(let c in r.data)o.push({key:i._parse(new Kd(r,c,r.path,c)),value:a._parse(new Kd(r,r.data[c],r.path,c))});return r.common.async?su.mergeObjectAsync(n,o):su.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof vn?new e({keyType:t,valueType:n,typeName:qt.ZodRecord,...bn(r)}):new e({keyType:lE.create(),valueType:t,typeName:qt.ZodRecord,...bn(n)})}},iR=class extends vn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.map)return st(r,{code:$e.invalid_type,expected:it.map,received:r.parsedType}),gn;let o=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([c,d],m)=>({key:o._parse(new Kd(r,c,r.path,[m,"key"])),value:i._parse(new Kd(r,d,r.path,[m,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let d of a){let m=await d.key,h=await d.value;if(m.status==="aborted"||h.status==="aborted")return gn;(m.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(m.value,h.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let d of a){let m=d.key,h=d.value;if(m.status==="aborted"||h.status==="aborted")return gn;(m.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(m.value,h.value)}return{status:n.value,value:c}}}};iR.create=(e,t,n)=>new iR({valueType:t,keyType:e,typeName:qt.ZodMap,...bn(n)});aR=class e extends vn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==it.set)return st(r,{code:$e.invalid_type,expected:it.set,received:r.parsedType}),gn;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(st(r,{code:$e.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(st(r,{code:$e.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function a(d){let m=new Set;for(let h of d){if(h.status==="aborted")return gn;h.status==="dirty"&&n.dirty(),m.add(h.value)}return{status:n.value,value:m}}let c=[...r.data.values()].map((d,m)=>i._parse(new Kd(r,d,r.path,m)));return r.common.async?Promise.all(c).then(d=>a(d)):a(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:Pt.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Pt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};aR.create=(e,t)=>new aR({valueType:e,minSize:null,maxSize:null,typeName:qt.ZodSet,...bn(t)});$3=class e extends vn{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.function)return st(n,{code:$e.invalid_type,expected:it.function,received:n.parsedType}),gn;function r(c,d){return G3({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,F3(),vO].filter(m=>!!m),issueData:{code:$e.invalid_arguments,argumentsError:d}})}function o(c,d){return G3({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,F3(),vO].filter(m=>!!m),issueData:{code:$e.invalid_return_type,returnTypeError:d}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof pE){let c=this;return Yu(async function(...d){let m=new Qc([]),h=await c._def.args.parseAsync(d,i).catch(I=>{throw m.addIssue(r(d,I)),m}),S=await Reflect.apply(a,this,h);return await c._def.returns._def.type.parseAsync(S,i).catch(I=>{throw m.addIssue(o(S,I)),m})})}else{let c=this;return Yu(function(...d){let m=c._def.args.safeParse(d,i);if(!m.success)throw new Qc([r(d,m.error)]);let h=Reflect.apply(a,this,m.data),S=c._def.returns.safeParse(h,i);if(!S.success)throw new Qc([o(h,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:QA.create(t).rest(Og.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e({args:t||QA.create([]).rest(Og.create()),returns:n||Og.create(),typeName:qt.ZodFunction,...bn(r)})}},Dy=class extends vn{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Dy.create=(e,t)=>new Dy({getter:e,typeName:qt.ZodLazy,...bn(t)});By=class extends vn{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return st(n,{received:n.data,code:$e.invalid_literal,expected:this._def.value}),gn}return{status:"valid",value:t.data}}get value(){return this._def.value}};By.create=(e,t)=>new By({value:e,typeName:qt.ZodLiteral,...bn(t)});Ny=class e extends vn{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return st(n,{expected:gr.joinValues(r),received:n.parsedType,code:$e.invalid_type}),gn}if(this._def.values.indexOf(t.data)===-1){let n=this._getOrReturnCtx(t),r=this._def.values;return st(n,{received:n.data,code:$e.invalid_enum_value,options:r}),gn}return Yu(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t){return e.create(t)}exclude(t){return e.create(this.options.filter(n=>!t.includes(n)))}};Ny.create=Zke;Oy=class extends vn{_parse(t){let n=gr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==it.string&&r.parsedType!==it.number){let o=gr.objectValues(n);return st(r,{expected:gr.joinValues(o),received:r.parsedType,code:$e.invalid_type}),gn}if(n.indexOf(t.data)===-1){let o=gr.objectValues(n);return st(r,{received:r.data,code:$e.invalid_enum_value,options:o}),gn}return Yu(t.data)}get enum(){return this._def.values}};Oy.create=(e,t)=>new Oy({values:e,typeName:qt.ZodNativeEnum,...bn(t)});pE=class extends vn{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==it.promise&&n.common.async===!1)return st(n,{code:$e.invalid_type,expected:it.promise,received:n.parsedType}),gn;let r=n.parsedType===it.promise?n.data:Promise.resolve(n.data);return Yu(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};pE.create=(e,t)=>new pE({type:e,typeName:qt.ZodPromise,...bn(t)});Fl=class extends vn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{st(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(c=>this._def.schema._parseAsync({data:c,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(o.type==="refinement"){let a=c=>{let d=o.refinement(c,i);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?gn:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?gn:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(o.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!RO(a))return a;let c=o.transform(a.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>RO(a)?Promise.resolve(o.transform(a.value,i)).then(c=>({status:n.value,value:c})):a);gr.assertNever(o)}};Fl.create=(e,t,n)=>new Fl({schema:e,typeName:qt.ZodEffects,effect:t,...bn(n)});Fl.createWithPreprocess=(e,t,n)=>new Fl({schema:t,effect:{type:"preprocess",transform:e},typeName:qt.ZodEffects,...bn(n)});cf=class extends vn{_parse(t){return this._getType(t)===it.undefined?Yu(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};cf.create=(e,t)=>new cf({innerType:e,typeName:qt.ZodOptional,...bn(t)});Mg=class extends vn{_parse(t){return this._getType(t)===it.null?Yu(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Mg.create=(e,t)=>new Mg({innerType:e,typeName:qt.ZodNullable,...bn(t)});wy=class extends vn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===it.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};wy.create=(e,t)=>new wy({innerType:e,typeName:qt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...bn(t)});sR=class extends vn{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return j3(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qc(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qc(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};sR.create=(e,t)=>new sR({innerType:e,typeName:qt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...bn(t)});uR=class extends vn{_parse(t){if(this._getType(t)!==it.nan){let r=this._getOrReturnCtx(t);return st(r,{code:$e.invalid_type,expected:it.nan,received:r.parsedType}),gn}return{status:"valid",value:t.data}}};uR.create=e=>new uR({typeName:qt.ZodNaN,...bn(e)});ibt=Symbol("zod_brand"),V3=class extends vn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},xO=class e extends vn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?gn:i.status==="dirty"?(n.dirty(),Jke(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?gn:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:qt.ZodPipeline})}},cR=class extends vn{_parse(t){let n=this._def.innerType._parse(t);return RO(n)&&(n.value=Object.freeze(n.value)),n}};cR.create=(e,t)=>new cR({innerType:e,typeName:qt.ZodReadonly,...bn(t)});Wke=(e,t={},n)=>e?dE.create().superRefine((r,o)=>{var i,a;if(!e(r)){let c=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,d=(a=(i=c.fatal)!==null&&i!==void 0?i:n)!==null&&a!==void 0?a:!0,m=typeof c=="string"?{message:c}:c;o.addIssue({code:"custom",...m,fatal:d})}}):dE.create(),abt={object:uu.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(qt||(qt={}));sbt=(e,t={message:`Input not instance of ${e.name}`})=>Wke(n=>n instanceof e,t),Xke=lE.create,e2e=yy.create,ubt=uR.create,cbt=Ty.create,t2e=Cy.create,lbt=Iy.create,dbt=rR.create,pbt=by.create,fbt=vy.create,Abt=dE.create,mbt=Og.create,gbt=lf.create,hbt=oR.create,_bt=wg.create,Ebt=uu.create,Sbt=uu.strictCreate,ybt=Ry.create,Tbt=z3.create,Cbt=xy.create,Ibt=QA.create,bbt=H3.create,vbt=iR.create,Rbt=aR.create,xbt=$3.create,Dbt=Dy.create,Bbt=By.create,Nbt=Ny.create,Obt=Oy.create,wbt=pE.create,qke=Fl.create,Mbt=cf.create,kbt=Mg.create,Pbt=Fl.createWithPreprocess,Ubt=xO.create,Lbt=()=>Xke().optional(),Qbt=()=>e2e().optional(),Fbt=()=>t2e().optional(),Gbt={string:e=>lE.create({...e,coerce:!0}),number:e=>yy.create({...e,coerce:!0}),boolean:e=>Cy.create({...e,coerce:!0}),bigint:e=>Ty.create({...e,coerce:!0}),date:e=>Iy.create({...e,coerce:!0})},jbt=gn,au=Object.freeze({__proto__:null,defaultErrorMap:vO,setErrorMap:VIt,getErrorMap:F3,makeIssue:G3,EMPTY_PATH:qIt,addIssueToContext:st,ParseStatus:su,INVALID:gn,DIRTY:Jke,OK:Yu,isAborted:aZ,isDirty:sZ,isValid:RO,isAsync:j3,get util(){return gr},get objectUtil(){return iZ},ZodParsedType:it,getParsedType:cE,ZodType:vn,ZodString:lE,ZodNumber:yy,ZodBigInt:Ty,ZodBoolean:Cy,ZodDate:Iy,ZodSymbol:rR,ZodUndefined:by,ZodNull:vy,ZodAny:dE,ZodUnknown:Og,ZodNever:lf,ZodVoid:oR,ZodArray:wg,ZodObject:uu,ZodUnion:Ry,ZodDiscriminatedUnion:z3,ZodIntersection:xy,ZodTuple:QA,ZodRecord:H3,ZodMap:iR,ZodSet:aR,ZodFunction:$3,ZodLazy:Dy,ZodLiteral:By,ZodEnum:Ny,ZodNativeEnum:Oy,ZodPromise:pE,ZodEffects:Fl,ZodTransformer:Fl,ZodOptional:cf,ZodNullable:Mg,ZodDefault:wy,ZodCatch:sR,ZodNaN:uR,BRAND:ibt,ZodBranded:V3,ZodPipeline:xO,ZodReadonly:cR,custom:Wke,Schema:vn,ZodSchema:vn,late:abt,get ZodFirstPartyTypeKind(){return qt},coerce:Gbt,any:Abt,array:_bt,bigint:cbt,boolean:t2e,date:lbt,discriminatedUnion:Tbt,effect:qke,enum:Nbt,function:xbt,instanceof:sbt,intersection:Cbt,lazy:Dbt,literal:Bbt,map:vbt,nan:ubt,nativeEnum:Obt,never:gbt,null:fbt,nullable:kbt,number:e2e,object:Ebt,oboolean:Fbt,onumber:Qbt,optional:Mbt,ostring:Lbt,pipeline:Ubt,preprocess:Pbt,promise:wbt,record:bbt,set:Rbt,strictObject:Sbt,string:Xke,symbol:dbt,transformer:qke,tuple:Ibt,undefined:pbt,union:ybt,unknown:mbt,void:hbt,NEVER:jbt,ZodIssueCode:$e,quotelessJson:$It,ZodError:Qc}),zbt=e=>typeof e?.safeParse=="function",rZ=e=>typeof e?.passthrough=="function",Hbt=(e,t)=>rZ(e)?rZ(t)?e.merge(t):e:rZ(t)?t:Object.assign({},e,t),Yd=au.object({name:au.literal("ZodError"),issues:au.array(au.object({path:au.array(au.union([au.string(),au.number()])),message:au.string().optional(),code:au.nativeEnum(au.ZodIssueCode)}).catchall(au.any()))}),cZ=class extends Error{constructor(t){let n=JSON.stringify(t,(r,o)=>typeof o=="bigint"?o.toString():o,2);super(n),this.name="ValidationError",this.issues=t}toString(){return this.message}},kCn=au.object({message:au.literal("Request validation failed"),pathParameterErrors:Yd.nullable(),headerErrors:Yd.nullable(),queryParameterErrors:Yd.nullable(),bodyErrors:Yd.nullable()}),PCn=au.object({pathParameterErrors:Yd.nullable(),headerErrors:Yd.nullable(),queryParameterErrors:Yd.nullable(),bodyErrors:Yd.nullable()}),UCn=au.object({paramsResult:Yd.nullable(),headersResult:Yd.nullable(),queryResult:Yd.nullable(),bodyResult:Yd.nullable()}),n2e="zod-ts-rest-polyfill",$bt=e=>{if(!e)return!1;let t=e?.["~standard"];return t?t.version===1&&typeof t.validate=="function":!1},Vbt=e=>$bt(e)?e:zbt(e)?(Object.assign(e,{"~standard":{vendor:n2e,version:1,validate:r=>{let o=e.safeParse(r);return o.success?{value:o.data}:{issues:o.error.issues}}}}),e):null,qbt=(e,t)=>e?t?e instanceof uu&&t instanceof uu?Hbt(e,t):{...e,...t}:e:t,Ybt=(e,t,{passThroughExtraKeys:n=!1}={})=>{let r=t["~standard"].validate(e);if(r instanceof Promise)throw new Error("Schema validation must be synchronous");return r.issues?t["~standard"].vendor===n2e?{error:new Qc(r.issues)}:{error:new cZ(r.issues)}:n&&typeof e=="object"&&r.value?{value:{...e,...r.value}}:{value:r.value}},r2e=Symbol("ContractNoBody"),o2e=e=>"method"in e&&"path"in e,i2e=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>{var o,i,a;return o2e(r)?[n,{...r,path:t?.pathPrefix?t.pathPrefix+r.path:r.path,headers:qbt(t?.baseHeaders,r.headers),strictStatusCodes:(o=r.strictStatusCodes)!==null&&o!==void 0?o:t?.strictStatusCodes,validateResponseOnClient:(i=r.validateResponseOnClient)!==null&&i!==void 0?i:t?.validateResponseOnClient,responses:{...t?.commonResponses,...r.responses},metadata:t?.metadata?{...t?.metadata,...(a=r.metadata)!==null&&a!==void 0?a:{}}:r.metadata}]:[n,i2e(r,t)]})),oZ=Symbol("ContractPlainType"),ns=()=>({router:(e,t)=>i2e(e,t),query:e=>e,mutation:e=>e,responses:e=>e,response:()=>oZ,body:()=>oZ,type:()=>oZ,otherResponse:({contentType:e,body:t})=>({contentType:e,body:t}),noBody:()=>r2e}),Kbt=({path:e,params:t})=>{let n=t;return e.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},Jbt=(e,t=!1)=>{let n=t?Zbt(e):Wbt(e);return n?.length>0?"?"+n:""},Zbt=e=>e?Object.entries(e).filter(([,t])=>t!==void 0).map(([t,n])=>{let r;return typeof n=="string"&&!["true","false","null"].includes(n.trim())&&isNaN(Number(n))?r=n:r=JSON.stringify(n),`${encodeURIComponent(t)}=${encodeURIComponent(r)}`}).join("&"):"",Wbt=e=>e?Object.keys(e).flatMap(t=>lZ(t,e[t])).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(n)}`).join("&"):"",lZ=(e,t)=>Array.isArray(t)?t.flatMap((n,r)=>lZ(`${e}[${r}]`,n)):t instanceof Date?[[`${e}`,t.toISOString()]]:t===null?[[`${e}`,""]]:t===void 0?[]:typeof t=="object"?Object.keys(t).flatMap(n=>lZ(`${e}[${n}]`,t[n])):[[`${e}`,`${t}`]],dZ=class extends Error{constructor(t,n){let r=n.join(",");super(`Server returned unexpected response. Expected one of: ${r} got: ${t.status}`),this.response=t}},pZ=async({route:e,path:t,method:n,headers:r,body:o,validateResponse:i,fetchOptions:a})=>{let c=await fetch(t,{...a,method:n,headers:r,body:o}),d=c.headers.get("content-type");if(d?.includes("application/")&&d?.includes("json")){let m=e.responses[c.status],h={status:c.status,body:m===r2e?void 0:await c.json(),headers:c.headers},S=Vbt(m);if(S&&(i??e.validateResponseOnClient)){let y=Ybt(h.body,S);if(y.error)throw y.error;return{...h,body:y.value}}return h}return d?.includes("text/")?{status:c.status,body:await c.text(),headers:c.headers}:{status:c.status,body:await c.blob(),headers:c.headers}},Xbt=e=>{let t=new FormData,n=(r,o)=>{o instanceof File?t.append(r,o):t.append(r,JSON.stringify(o))};return Object.entries(e).forEach(([r,o])=>{if(Array.isArray(o))for(let i of o)n(r,i);else n(r,o)}),t},Yke=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t.toLowerCase(),n])),evt=e=>{let{path:t,clientArgs:n,route:r,body:o,query:i,extraInputArgs:a,headers:c,fetchOptions:d}=e,m=n.api||pZ,h=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([I,v])=>typeof v=="function"?[I,v(e)]:[I,v])),S={...h&&Yke(h),...Yke(c)};Object.keys(S).forEach(I=>{S[I]===void 0&&delete S[I]});let y={route:r,path:t,method:r.method,headers:S,body:void 0,rawBody:o,rawQuery:i,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...d},...d?.signal&&{signal:d.signal},...d?.cache&&{cache:d.cache},...d&&"next"in d&&!!d?.next&&{next:d.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?y={...y,contentType:"multipart/form-data",body:o instanceof FormData?o:Xbt(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?y={...y,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...y.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(y={...y,contentType:"application/json",headers:{"content-type":"application/json",...y.headers},body:JSON.stringify(o)})),m({...y,...a})},tvt=(e,t,n)=>{let{query:r,params:o,body:i,headers:a,extraHeaders:c,overrideClientOptions:d,fetchOptions:m,cache:h,next:S,...y}=n||{},I={...t,...d},v=typeof o=="object"?Object.fromEntries(Object.entries(o).map(([N,M])=>[N,String(M)])):{};return{path:nvt(r,I.baseUrl,v,e,!!I.jsonQuery),clientArgs:I,route:e,body:i,query:r,extraInputArgs:y,fetchOptions:{...h&&{cache:h},...S&&{next:S},...m},headers:{...c,...a}}},nvt=(e,t,n,r,o)=>{let i=Kbt({path:r.path,params:n}),a=Jbt(e,o);return t.endsWith("/")&&i.startsWith("/")?`${t}${i.substring(1)}${a}`:`${t}${i}${a}`},rvt=(e,t)=>{let n=Object.keys(e.responses);return async r=>{let o=tvt(e,t,r),i=await evt(o);if(!t.throwOnUnknownStatus||n.includes(i.status.toString()))return i;throw new dZ(i,n)}},fZ=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>o2e(r)?[n,rvt(r,t)]:[n,fZ(r,t)]))});function ne(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);let m=a.prototype,h=Object.keys(m);for(let S=0;S<h.length;S++){let y=h[S];y in c||(c[y]=m[y].bind(c))}}let o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(c){var d;let m=n?.Parent?new i:this;r(m,c),(d=m._zod).deferred??(d.deferred=[]);for(let h of m._zod.deferred)h();return m}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function mi(e){return e&&Object.assign(My,e),My}var a2e,AZ,mZ,pf,fE,My,ky=O(()=>{A();AZ=Object.freeze({status:"aborted"});mZ=Symbol("zod_brand"),pf=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},fE=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(a2e=globalThis).__zod_globalConfig??(a2e.__zod_globalConfig={});My=globalThis.__zod_globalConfig});var Pe={};ja(Pe,{BIGINT_FORMAT_RANGES:()=>bZ,Class:()=>hZ,NUMBER_FORMAT_RANGES:()=>IZ,aborted:()=>hE,allowsEval:()=>SZ,assert:()=>uvt,assertEqual:()=>ovt,assertIs:()=>avt,assertNever:()=>svt,assertNotEqual:()=>ivt,assignProp:()=>mE,base64ToUint8Array:()=>u2e,base64urlToUint8Array:()=>bvt,cached:()=>dR,captureStackTrace:()=>Y3,cleanEnum:()=>Ivt,cleanRegex:()=>NO,clone:()=>Ku,cloneDef:()=>lvt,createTransparentProxy:()=>gvt,defineLazy:()=>Fn,esc:()=>q3,escapeRegex:()=>Jd,explicitlyAborted:()=>vZ,extend:()=>Evt,finalizeIssue:()=>Ju,floatSafeRemainder:()=>_Z,getElementAtPath:()=>dvt,getEnumValues:()=>BO,getLengthableOrigin:()=>MO,getParsedType:()=>mvt,getSizableOrigin:()=>wO,hexToUint8Array:()=>Rvt,isObject:()=>Py,isPlainObject:()=>gE,issue:()=>pR,joinValues:()=>ue,jsonStringifyReplacer:()=>lR,merge:()=>yvt,mergeDefs:()=>kg,normalizeParams:()=>ze,nullish:()=>AE,numKeys:()=>Avt,objectClone:()=>cvt,omit:()=>_vt,optionalKeys:()=>CZ,parsedType:()=>we,partial:()=>Tvt,pick:()=>hvt,prefixIssues:()=>Fc,primitiveTypes:()=>TZ,promiseAllObject:()=>pvt,propertyKeyTypes:()=>OO,randomString:()=>fvt,required:()=>Cvt,safeExtend:()=>Svt,shallowClone:()=>yZ,slugify:()=>EZ,stringifyPrimitive:()=>Ne,uint8ArrayToBase64:()=>c2e,uint8ArrayToBase64url:()=>vvt,uint8ArrayToHex:()=>xvt,unwrapMessage:()=>DO});function ovt(e){return e}function ivt(e){return e}function avt(e){}function svt(e){throw new Error("Unexpected value in exhaustive check")}function uvt(e){}function BO(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ue(e,t="|"){return e.map(n=>Ne(n)).join(t)}function lR(e,t){return typeof t=="bigint"?t.toString():t}function dR(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function AE(e){return e==null}function NO(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function _Z(e,t){let n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function Fn(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==s2e)return r===void 0&&(r=s2e,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function cvt(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function mE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function kg(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function lvt(e){return kg(e._zod.def)}function dvt(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function pvt(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=r[i];return o})}function fvt(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function q3(e){return JSON.stringify(e)}function EZ(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Py(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gE(e){if(Py(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Py(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function yZ(e){return gE(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Avt(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Jd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ku(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ze(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gvt(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,i){return t??(t=e()),Reflect.set(t,r,o,i)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function Ne(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function CZ(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function hvt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=kg(e._zod.def,{get shape(){let a={};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(a[c]=n.shape[c])}return mE(this,"shape",a),a},checks:[]});return Ku(e,i)}function _vt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=kg(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete a[c]}return mE(this,"shape",a),a},checks:[]});return Ku(e,i)}function Evt(e,t){if(!gE(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=kg(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return mE(this,"shape",i),i}});return Ku(e,o)}function Svt(e,t){if(!gE(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=kg(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return mE(this,"shape",r),r}});return Ku(e,n)}function yvt(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=kg(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return mE(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ku(e,n)}function Tvt(e,t,n){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=kg(t._zod.def,{get shape(){let c=t._zod.def.shape,d={...c};if(n)for(let m in n){if(!(m in c))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(d[m]=e?new e({type:"optional",innerType:c[m]}):c[m])}else for(let m in c)d[m]=e?new e({type:"optional",innerType:c[m]}):c[m];return mE(this,"shape",d),d},checks:[]});return Ku(t,a)}function Cvt(e,t,n){let r=kg(t._zod.def,{get shape(){let o=t._zod.def.shape,i={...o};if(n)for(let a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(let a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return mE(this,"shape",i),i}});return Ku(t,r)}function hE(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function vZ(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Fc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function DO(e){return typeof e=="string"?e:e?.message}function Ju(e,t,n){let r=e.message?e.message:DO(e.inst?._zod.def?.error?.(e))??DO(t?.error?.(e))??DO(n.customError?.(e))??DO(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:a,...c}=e;return c.path??(c.path=[]),c.message=r,t?.reportInput&&(c.input=a),c}function wO(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function MO(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function we(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function pR(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function Ivt(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function u2e(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function c2e(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function bvt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return u2e(t+n)}function vvt(e){return c2e(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Rvt(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function xvt(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var s2e,Y3,SZ,mvt,OO,TZ,IZ,bZ,hZ,Et=O(()=>{A();ky();s2e=Symbol("evaluating");Y3="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};SZ=dR(()=>{if(My.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});mvt=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},OO=new Set(["string","number","symbol"]),TZ=new Set(["string","number","bigint","boolean","symbol","undefined"]);IZ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},bZ={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};hZ=class{constructor(...t){}}});function PO(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function UO(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>r({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{let c=[...i,...a.path];if(c.length===0)n._errors.push(t(a));else{let d=n,m=0;for(;m<c.length;){let h=c[m];m===c.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(t(a))):d[h]=d[h]||{_errors:[]},d=d[h],m++}}}};return r(e),n}function RZ(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var a,c;for(let d of o.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(m=>r({issues:m},[...i,...d.path]));else if(d.code==="invalid_key")r({issues:d.issues},[...i,...d.path]);else if(d.code==="invalid_element")r({issues:d.issues},[...i,...d.path]);else{let m=[...i,...d.path];if(m.length===0){n.errors.push(t(d));continue}let h=n,S=0;for(;S<m.length;){let y=m[S],I=S===m.length-1;typeof y=="string"?(h.properties??(h.properties={}),(a=h.properties)[y]??(a[y]={errors:[]}),h=h.properties[y]):(h.items??(h.items=[]),(c=h.items)[y]??(c[y]={errors:[]}),h=h.items[y]),I&&h.errors.push(t(d)),S++}}};return r(e),n}function d2e(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function xZ(e){let t=[],n=[...e.issues].sort((r,o)=>(r.path??[]).length-(o.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${d2e(r.path)}`);return t.join(`
|
|
41
41
|
`)}var l2e,kO,Gc,DZ=O(()=>{A();ky();Et();l2e=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,lR,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kO=ne("$ZodError",l2e),Gc=ne("$ZodError",l2e,{Parent:Error})});var fR,K3,AR,J3,mR,BZ,gR,NZ,Z3,Bvt,W3,Nvt,X3,Ovt,e6,wvt,t6,Mvt,n6,kvt,r6,Pvt,o6,Uvt,OZ=O(()=>{A();ky();DZ();Et();fR=e=>(t,n,r,o)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new pf;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(d=>Ju(d,i,mi())));throw Y3(c,o?.callee),c}return a.value},K3=fR(Gc),AR=e=>async(t,n,r,o)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(d=>Ju(d,i,mi())));throw Y3(c,o?.callee),c}return a.value},J3=AR(Gc),mR=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new pf;return i.issues.length?{success:!1,error:new(e??kO)(i.issues.map(a=>Ju(a,o,mi())))}:{success:!0,data:i.value}},BZ=mR(Gc),gR=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Ju(a,o,mi())))}:{success:!0,data:i.value}},NZ=gR(Gc),Z3=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return fR(e)(t,n,o)},Bvt=Z3(Gc),W3=e=>(t,n,r)=>fR(e)(t,n,r),Nvt=W3(Gc),X3=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return AR(e)(t,n,o)},Ovt=X3(Gc),e6=e=>async(t,n,r)=>AR(e)(t,n,r),wvt=e6(Gc),t6=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return mR(e)(t,n,o)},Mvt=t6(Gc),n6=e=>(t,n,r)=>mR(e)(t,n,r),kvt=n6(Gc),r6=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return gR(e)(t,n,o)},Pvt=r6(Gc),o6=e=>async(t,n,r)=>gR(e)(t,n,r),Uvt=o6(Gc)});var Gl={};ja(Gl,{base64:()=>YZ,base64url:()=>i6,bigint:()=>tW,boolean:()=>rW,browserEmail:()=>$vt,cidrv4:()=>VZ,cidrv6:()=>qZ,cuid:()=>wZ,cuid2:()=>MZ,date:()=>ZZ,datetime:()=>XZ,domain:()=>Yvt,duration:()=>QZ,e164:()=>JZ,email:()=>GZ,emoji:()=>jZ,extendedDuration:()=>Lvt,guid:()=>FZ,hex:()=>Kvt,hostname:()=>qvt,html5Email:()=>jvt,httpProtocol:()=>KZ,idnEmail:()=>Hvt,integer:()=>nW,ipv4:()=>zZ,ipv6:()=>HZ,ksuid:()=>UZ,lowercase:()=>aW,mac:()=>$Z,md5_base64:()=>Zvt,md5_base64url:()=>Wvt,md5_hex:()=>Jvt,nanoid:()=>LZ,null:()=>oW,number:()=>a6,rfc5322Email:()=>zvt,sha1_base64:()=>eRt,sha1_base64url:()=>tRt,sha1_hex:()=>Xvt,sha256_base64:()=>rRt,sha256_base64url:()=>oRt,sha256_hex:()=>nRt,sha384_base64:()=>aRt,sha384_base64url:()=>sRt,sha384_hex:()=>iRt,sha512_base64:()=>cRt,sha512_base64url:()=>lRt,sha512_hex:()=>uRt,string:()=>eW,time:()=>WZ,ulid:()=>kZ,undefined:()=>iW,unicodeEmail:()=>p2e,uppercase:()=>sW,uuid:()=>Uy,uuid4:()=>Qvt,uuid6:()=>Fvt,uuid7:()=>Gvt,xid:()=>PZ});function jZ(){return new RegExp(Vvt,"u")}function A2e(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function WZ(e){return new RegExp(`^${A2e(e)}$`)}function XZ(e){let t=A2e({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${f2e}T(?:${r})$`)}function LO(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function QO(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var wZ,MZ,kZ,PZ,UZ,LZ,QZ,Lvt,FZ,Uy,Qvt,Fvt,Gvt,GZ,jvt,zvt,p2e,Hvt,$vt,Vvt,zZ,HZ,$Z,VZ,qZ,YZ,i6,qvt,Yvt,KZ,JZ,f2e,ZZ,eW,tW,nW,a6,rW,oW,iW,aW,sW,Kvt,Jvt,Zvt,Wvt,Xvt,eRt,tRt,nRt,rRt,oRt,iRt,aRt,sRt,uRt,cRt,lRt,s6=O(()=>{A();Et();wZ=/^[cC][0-9a-z]{6,}$/,MZ=/^[0-9a-z]+$/,kZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,PZ=/^[0-9a-vA-V]{20}$/,UZ=/^[A-Za-z0-9]{27}$/,LZ=/^[a-zA-Z0-9_-]{21}$/,QZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Lvt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,FZ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Uy=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qvt=Uy(4),Fvt=Uy(6),Gvt=Uy(7),GZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jvt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,zvt=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,p2e=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Hvt=p2e,$vt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Vvt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";zZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,HZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$Z=e=>{let t=Jd(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},VZ=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,qZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,i6=/^[A-Za-z0-9_-]*$/,qvt=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Yvt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,KZ=/^https?$/,JZ=/^\+[1-9]\d{6,14}$/,f2e="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ZZ=new RegExp(`^${f2e}$`);eW=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},tW=/^-?\d+n?$/,nW=/^-?\d+$/,a6=/^-?\d+(?:\.\d+)?$/,rW=/^(?:true|false)$/i,oW=/^null$/i,iW=/^undefined$/i,aW=/^[^A-Z]*$/,sW=/^[^a-z]*$/,Kvt=/^[0-9a-fA-F]*$/;Jvt=/^[0-9a-fA-F]{32}$/,Zvt=LO(22,"=="),Wvt=QO(22),Xvt=/^[0-9a-fA-F]{40}$/,eRt=LO(27,"="),tRt=QO(27),nRt=/^[0-9a-fA-F]{64}$/,rRt=LO(43,"="),oRt=QO(43),iRt=/^[0-9a-fA-F]{96}$/,aRt=LO(64,""),sRt=QO(64),uRt=/^[0-9a-fA-F]{128}$/,cRt=LO(86,"=="),lRt=QO(86)});function m2e(e,t,n){e.issues.length&&t.issues.push(...Fc(n,e.issues))}var qr,g2e,u6,c6,uW,cW,lW,dW,pW,fW,AW,mW,gW,hR,hW,_W,EW,SW,yW,TW,CW,IW,bW,l6=O(()=>{A();ky();s6();Et();qr=ne("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),g2e={number:"number",bigint:"bigint",object:"date"},u6=ne("$ZodCheckLessThan",(e,t)=>{qr.init(e,t);let n=g2e[typeof t.value];e._zod.onattach.push(r=>{let o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),c6=ne("$ZodCheckGreaterThan",(e,t)=>{qr.init(e,t);let n=g2e[typeof t.value];e._zod.onattach.push(r=>{let o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),uW=ne("$ZodCheckMultipleOf",(e,t)=>{qr.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):_Z(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),cW=ne("$ZodCheckNumberFormat",(e,t)=>{qr.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=IZ[t.format];e._zod.onattach.push(a=>{let c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=i,n&&(c.pattern=nW)}),e._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),lW=ne("$ZodCheckBigIntFormat",(e,t)=>{qr.init(e,t);let[n,r]=bZ[t.format];e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=o=>{let i=o.value;i<n&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),dW=ne("$ZodCheckMaxSize",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!AE(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;o.size<=t.maximum||r.issues.push({origin:wO(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),pW=ne("$ZodCheckMinSize",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!AE(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;o.size>=t.minimum||r.issues.push({origin:wO(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fW=ne("$ZodCheckSizeEquals",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!AE(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=t.size,o.maximum=t.size,o.size=t.size}),e._zod.check=r=>{let o=r.value,i=o.size;if(i===t.size)return;let a=i>t.size;r.issues.push({origin:wO(o),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),AW=ne("$ZodCheckMaxLength",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!AE(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;if(o.length<=t.maximum)return;let a=MO(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),mW=ne("$ZodCheckMinLength",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!AE(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;if(o.length>=t.minimum)return;let a=MO(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),gW=ne("$ZodCheckLengthEquals",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!AE(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{let o=r.value,i=o.length;if(i===t.length)return;let a=MO(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),hR=ne("$ZodCheckStringFormat",(e,t)=>{var n,r;qr.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),hW=ne("$ZodCheckRegex",(e,t)=>{hR.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_W=ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=aW),hR.init(e,t)}),EW=ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=sW),hR.init(e,t)}),SW=ne("$ZodCheckIncludes",(e,t)=>{qr.init(e,t);let n=Jd(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),yW=ne("$ZodCheckStartsWith",(e,t)=>{qr.init(e,t);let n=new RegExp(`^${Jd(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),TW=ne("$ZodCheckEndsWith",(e,t)=>{qr.init(e,t);let n=new RegExp(`.*${Jd(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});CW=ne("$ZodCheckProperty",(e,t)=>{qr.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(o=>m2e(o,n,t.property));m2e(r,n,t.property)}}),IW=ne("$ZodCheckMimeType",(e,t)=>{qr.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),bW=ne("$ZodCheckOverwrite",(e,t)=>{qr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var FO,vW=O(()=>{A();FO=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
|
|
@@ -489,7 +489,7 @@ exec ${sue(n)} ${sue(e)} "$@"
|
|
|
489
489
|
Authorization expired. Please try again.
|
|
490
490
|
`);return;case"login_failed":console.log(`
|
|
491
491
|
Login failed: ${e.message}
|
|
492
|
-
`);return}}});var A5e={};ja(A5e,{buildStoredAnalyticsPersonPropertiesFromWhoAmI:()=>E9e,getOpenBrowserCommand:()=>v9e,loginCommand:()=>pue,openBrowser:()=>b9e,pollForTokens:()=>I9e,requestDeviceAuthorization:()=>C9e,runLogin:()=>R9e});import{spawn as Ajt}from"node:child_process";function E9e(e){return{email:e.emailAddress,name:e.name??e.user.display_name,display_name:e.user.display_name,handle:e.user.handle}}async function hjt(e){let n=await cn({token:e}).whoAmI({headers:{}});n.status===200&&(m4e(`lore_${n.body.user.id}`),_4e(E9e(n.body)))}async function S9e(e){try{return await e.json()}catch{throw new Error(`WorkOS returned an invalid JSON response: HTTP ${e.status}`)}}function y9e(e){return[e.error_description,e.error].find(t=>typeof t=="string"&&t.length>0)??"Authorization failed"}function T9e(e,t){return new URL(t,e).toString()}async function _jt(e){let t=await e.getCliAuthConfig();if(t.status!==200)throw new Error("WorkOS CLI Auth is not configured.");return t.body}async function C9e({clientId:e,workosApiOrigin:t}){let n=await fetch(T9e(t,"/user_management/authorize/device"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:e})}),r=await S9e(n);if(!n.ok)throw new Error(y9e(r));return r}async function I9e({clientId:e,deviceCode:t,expiresIn:n,interval:r,timeoutMs:o,workosApiOrigin:i}){let a=AbortSignal.timeout(Math.min(o,n*1e3)),c=r;for(;;){let d;try{d=await fetch(T9e(i,"/user_management/authenticate"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:gjt,device_code:t,client_id:e}),signal:a})}catch(S){throw S instanceof Error&&S.name==="TimeoutError"?new Error("authorization timed out"):S}let m=await S9e(d);if(d.ok)return m;let h=m;switch(h.error){case"authorization_pending":await _9e(c*1e3);break;case"slow_down":c+=1,await _9e(c*1e3);break;case"access_denied":throw new Error("Authorization denied");case"expired_token":throw new Error("Authorization expired");default:throw new Error(y9e(h))}}}async function b9e(e){let{command:t,args:n}=v9e(process.platform,e);await new Promise((r,o)=>{let i=Ajt(t,n,{detached:!0,stdio:"ignore"});i.once("error",o),i.once("spawn",()=>{i.unref(),r()})})}function v9e(e,t){return e==="win32"?{command:"rundll32",args:["url.dll,FileProtocolHandler",t]}:e==="darwin"?{command:"open",args:[t]}:{command:"xdg-open",args:[t]}}async function Ejt(e){if(!await hr())return!1;try{return(await e.whoAmI({headers:{}})).status===200}catch{return!1}}async function Sjt(e,t,n){if(t==="darwin")try{n({kind:"auto_enable_started"});let{plistPath:r,binaryPath:o}=await e();n({kind:"auto_enable_succeeded",plistPath:r,binaryPath:o,logFile:Wd()})}catch(r){_e.warn("auto_enable_failed",{error:r instanceof Error?r.message:String(r)}),n({kind:"auto_enable_failed"})}}function yjt(e){if(VR(e))return`Could not reach the Lore API at ${qR()}. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared.`;if(e instanceof Error&&e.message==="WorkOS CLI Auth is not configured.")return e.message}async function R9e({client:e=cn(),enableLaunchAgent:t=PH,openBrowser:n=b9e,platform:r=process.platform,pollForTokens:o=I9e,requestDeviceAuthorization:i=C9e,getCliAuthConfig:a=_jt,setAccessToken:c=$R,setRefreshToken:d=WG,cacheAnalyticsDistinctId:m=hjt,timeoutMs:h=mjt,progress:S=g9e}={}){if(await Ejt(e)){S({kind:"already_logged_in"});return}try{let y=await a(e),I=await i({clientId:y.workos_client_id,workosApiOrigin:y.workos_api_origin});S({kind:"device_authorized",userCode:I.user_code,verificationUri:I.verification_uri,verificationUriComplete:I.verification_uri_complete});try{await n(I.verification_uri_complete),S({kind:"browser_opened"})}catch(x){_e.warn("open_browser_failed",{error:x instanceof Error?x.message:String(x)}),S({kind:"browser_open_failed"})}S({kind:"browser_url",url:I.verification_uri_complete}),S({kind:"waiting_for_authorization"});let v=await o({clientId:y.workos_client_id,workosApiOrigin:y.workos_api_origin,deviceCode:I.device_code,expiresIn:I.expires_in,interval:I.interval,timeoutMs:h});c(v.access_token),v.refresh_token&&d(v.refresh_token),m(v.access_token).catch(x=>{_e.warn("cache_analytics_distinct_id_failed",{error:x instanceof Error?x.message:String(x)})}),S({kind:"logged_in"}),await Sjt(t,r,S)}catch(y){y instanceof Error&&y.message==="authorization timed out"?(S({kind:"authorization_timed_out"}),Iw()):y instanceof Error&&y.message==="Authorization denied"?(S({kind:"authorization_denied"}),Iw()):y instanceof Error&&y.message==="Authorization expired"&&(S({kind:"authorization_expired"}),Iw());let I=yjt(y);throw I&&(S({kind:"login_failed",message:I}),Iw()),y}}var mjt,gjt,_9e,pue,Qse=O(async()=>{"use strict";A();Zo();_r();ej();wr();na();vE();await Pse();await f5e();FM();Ky();h9e();mjt=5*60*1e3,gjt="urn:ietf:params:oauth:grant-type:device_code";_9e=e=>new Promise(t=>setTimeout(t,e));pue={meta:{name:"login",description:"Authorize this CLI against your Lore workspace"},async run({data:e}){_e.info("command_start",{command:"login"});let t={client:e?.client,enableLaunchAgent:e?.enableLaunchAgent,openBrowser:e?.openBrowser,platform:e?.platform,pollForTokens:e?.pollForTokens,requestDeviceAuthorization:e?.requestDeviceAuthorization,getCliAuthConfig:e?.getCliAuthConfig,setAccessToken:e?.setAccessToken,setRefreshToken:e?.setRefreshToken,cacheAnalyticsDistinctId:e?.cacheAnalyticsDistinctId,timeoutMs:e?.timeoutMs};if(pu()&&!e?.progress){await p5e(t),await SH({skipIfAlreadyConfigured:!0});return}await R9e({...t,progress:e?.progress})}}});A();A();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="
|
|
492
|
+
`);return}}});var A5e={};ja(A5e,{buildStoredAnalyticsPersonPropertiesFromWhoAmI:()=>E9e,getOpenBrowserCommand:()=>v9e,loginCommand:()=>pue,openBrowser:()=>b9e,pollForTokens:()=>I9e,requestDeviceAuthorization:()=>C9e,runLogin:()=>R9e});import{spawn as Ajt}from"node:child_process";function E9e(e){return{email:e.emailAddress,name:e.name??e.user.display_name,display_name:e.user.display_name,handle:e.user.handle}}async function hjt(e){let n=await cn({token:e}).whoAmI({headers:{}});n.status===200&&(m4e(`lore_${n.body.user.id}`),_4e(E9e(n.body)))}async function S9e(e){try{return await e.json()}catch{throw new Error(`WorkOS returned an invalid JSON response: HTTP ${e.status}`)}}function y9e(e){return[e.error_description,e.error].find(t=>typeof t=="string"&&t.length>0)??"Authorization failed"}function T9e(e,t){return new URL(t,e).toString()}async function _jt(e){let t=await e.getCliAuthConfig();if(t.status!==200)throw new Error("WorkOS CLI Auth is not configured.");return t.body}async function C9e({clientId:e,workosApiOrigin:t}){let n=await fetch(T9e(t,"/user_management/authorize/device"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:e})}),r=await S9e(n);if(!n.ok)throw new Error(y9e(r));return r}async function I9e({clientId:e,deviceCode:t,expiresIn:n,interval:r,timeoutMs:o,workosApiOrigin:i}){let a=AbortSignal.timeout(Math.min(o,n*1e3)),c=r;for(;;){let d;try{d=await fetch(T9e(i,"/user_management/authenticate"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:gjt,device_code:t,client_id:e}),signal:a})}catch(S){throw S instanceof Error&&S.name==="TimeoutError"?new Error("authorization timed out"):S}let m=await S9e(d);if(d.ok)return m;let h=m;switch(h.error){case"authorization_pending":await _9e(c*1e3);break;case"slow_down":c+=1,await _9e(c*1e3);break;case"access_denied":throw new Error("Authorization denied");case"expired_token":throw new Error("Authorization expired");default:throw new Error(y9e(h))}}}async function b9e(e){let{command:t,args:n}=v9e(process.platform,e);await new Promise((r,o)=>{let i=Ajt(t,n,{detached:!0,stdio:"ignore"});i.once("error",o),i.once("spawn",()=>{i.unref(),r()})})}function v9e(e,t){return e==="win32"?{command:"rundll32",args:["url.dll,FileProtocolHandler",t]}:e==="darwin"?{command:"open",args:[t]}:{command:"xdg-open",args:[t]}}async function Ejt(e){if(!await hr())return!1;try{return(await e.whoAmI({headers:{}})).status===200}catch{return!1}}async function Sjt(e,t,n){if(t==="darwin")try{n({kind:"auto_enable_started"});let{plistPath:r,binaryPath:o}=await e();n({kind:"auto_enable_succeeded",plistPath:r,binaryPath:o,logFile:Wd()})}catch(r){_e.warn("auto_enable_failed",{error:r instanceof Error?r.message:String(r)}),n({kind:"auto_enable_failed"})}}function yjt(e){if(VR(e))return`Could not reach the Lore API at ${qR()}. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared.`;if(e instanceof Error&&e.message==="WorkOS CLI Auth is not configured.")return e.message}async function R9e({client:e=cn(),enableLaunchAgent:t=PH,openBrowser:n=b9e,platform:r=process.platform,pollForTokens:o=I9e,requestDeviceAuthorization:i=C9e,getCliAuthConfig:a=_jt,setAccessToken:c=$R,setRefreshToken:d=WG,cacheAnalyticsDistinctId:m=hjt,timeoutMs:h=mjt,progress:S=g9e}={}){if(await Ejt(e)){S({kind:"already_logged_in"});return}try{let y=await a(e),I=await i({clientId:y.workos_client_id,workosApiOrigin:y.workos_api_origin});S({kind:"device_authorized",userCode:I.user_code,verificationUri:I.verification_uri,verificationUriComplete:I.verification_uri_complete});try{await n(I.verification_uri_complete),S({kind:"browser_opened"})}catch(x){_e.warn("open_browser_failed",{error:x instanceof Error?x.message:String(x)}),S({kind:"browser_open_failed"})}S({kind:"browser_url",url:I.verification_uri_complete}),S({kind:"waiting_for_authorization"});let v=await o({clientId:y.workos_client_id,workosApiOrigin:y.workos_api_origin,deviceCode:I.device_code,expiresIn:I.expires_in,interval:I.interval,timeoutMs:h});c(v.access_token),v.refresh_token&&d(v.refresh_token),m(v.access_token).catch(x=>{_e.warn("cache_analytics_distinct_id_failed",{error:x instanceof Error?x.message:String(x)})}),S({kind:"logged_in"}),await Sjt(t,r,S)}catch(y){y instanceof Error&&y.message==="authorization timed out"?(S({kind:"authorization_timed_out"}),Iw()):y instanceof Error&&y.message==="Authorization denied"?(S({kind:"authorization_denied"}),Iw()):y instanceof Error&&y.message==="Authorization expired"&&(S({kind:"authorization_expired"}),Iw());let I=yjt(y);throw I&&(S({kind:"login_failed",message:I}),Iw()),y}}var mjt,gjt,_9e,pue,Qse=O(async()=>{"use strict";A();Zo();_r();ej();wr();na();vE();await Pse();await f5e();FM();Ky();h9e();mjt=5*60*1e3,gjt="urn:ietf:params:oauth:grant-type:device_code";_9e=e=>new Promise(t=>setTimeout(t,e));pue={meta:{name:"login",description:"Authorize this CLI against your Lore workspace"},async run({data:e}){_e.info("command_start",{command:"login"});let t={client:e?.client,enableLaunchAgent:e?.enableLaunchAgent,openBrowser:e?.openBrowser,platform:e?.platform,pollForTokens:e?.pollForTokens,requestDeviceAuthorization:e?.requestDeviceAuthorization,getCliAuthConfig:e?.getCliAuthConfig,setAccessToken:e?.setAccessToken,setRefreshToken:e?.setRefreshToken,cacheAnalyticsDistinctId:e?.cacheAnalyticsDistinctId,timeoutMs:e?.timeoutMs};if(pu()&&!e?.progress){await p5e(t),await SH({skipIfAlreadyConfigured:!0});return}await R9e({...t,progress:e?.progress})}}});A();A();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a9a49c72-e60f-471c-85c9-63e8e55f1bc9",e._sentryDebugIdIdentifier="sentry-dbid-a9a49c72-e60f-471c-85c9-63e8e55f1bc9")}catch{}})();A();A();A();function Ale(e=process.versions.node){let t=Number.parseInt(e.split(".")[0]??"",10);return!Number.isFinite(t)||t<=0?{ok:!0,currentVersion:e,message:null}:t<20?{ok:!1,currentVersion:e,message:`requires Node.js >= 20.0.0 (found ${e})`}:{ok:!0,currentVersion:e,message:null}}var mle=Ale();mle.ok||(process.stderr.write(`lore: ${mle.message}.
|
|
493
493
|
Upgrade Node (e.g. \`nvm install 20\`) and re-run.
|
|
494
494
|
`),process.exit(1));A();tR();Ll();function DIt(){let e=process.env.SENTRY_SPOTLIGHT?.trim();return!e||e==="0"||e==="false"?!1:e==="1"||e==="true"?!0:e}var BIt=DIt();WJ({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:ta(),release:qu(),sendDefaultPii:!0,enableLogs:!0,spotlight:BIt,tracesSampleRate:1});JU("service_name","lore-cli");tR();nZ();import{realpathSync as xHt}from"node:fs";import{fileURLToPath as DHt,pathToFileURL as JVe}from"node:url";A();A();jG();Zo();_r();wr();A();function bw(e){let t=e;return t._def??t.def??{}}function jwt(e){let t=bw(e);return typeof t.typeName=="string"?t.typeName:typeof t.type=="string"?t.type:void 0}function Hc(e,t,n){let r=jwt(e);return r===t||r===n}function k4e(e){let t=bw(e);if(t.element)return t.element;if(typeof t.type=="object"&&t.type!==null)return t.type}function zwt(e){let t=e.options;if(Array.isArray(t))return[...t];let n=bw(e);return Array.isArray(n.values)?[...n.values]:n.entries&&typeof n.entries=="object"?Object.values(n.entries):[]}function dre(e){if(!e||!Hc(e,"ZodObject","object"))return;let t=e.shape;if(typeof t=="function")return t();if(t&&typeof t=="object")return t;let n=bw(e).shape;if(typeof n=="function")return n();if(n&&typeof n=="object")return n}function P4e(e){let t=e,n=!1,r,o=e.description;for(;;){o=t.description??o;let i=bw(t);if(Hc(t,"ZodOptional","optional"))n=!0,t=i.innerType;else if(Hc(t,"ZodNullable","nullable"))n=!0,t=i.innerType;else if(Hc(t,"ZodDefault","default"))r=typeof i.defaultValue=="function"?i.defaultValue():i.defaultValue,t=i.innerType;else if(Hc(t,"ZodEffects","effects"))t=i.schema;else if(Hc(t,"ZodPipeline","pipe"))t=i.in;else break}return{inner:t,optional:n,defaultValue:r,description:o}}function Hwt(e,t={}){let{inner:n,optional:r,defaultValue:o,description:i}=P4e(e),a=!1,c=n;Hc(c,"ZodArray","array")&&(a=!0,c=k4e(c)??c);let d=!r&&o===void 0;return t.positional?{arg:{type:"positional",description:i,required:d,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:a}:Hc(c,"ZodEnum","enum")?{arg:{type:"enum",description:i,options:zwt(c),required:d,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:a}:Hc(c,"ZodBoolean","boolean")?{arg:{type:"boolean",description:i,required:d,...typeof o=="boolean"?{default:o}:{}},optional:r,isArray:a}:{arg:{type:"string",description:a?`${i??""}${i?" ":""}(comma-separated)`.trim()||void 0:i,required:d,...o!==void 0?{default:String(o)}:{},...a?{valueHint:"a,b,c"}:{}},optional:r,isArray:a}}function pre(e,t={}){let n={},r={};for(let[o,i]of Object.entries(e)){let{arg:a,isArray:c}=Hwt(i,t);n[o]=a,r[o]={isArray:c,leafKind:$wt(i)}}return{args:n,fields:r}}function fre(e,t={}){let n=dre(e);return n?pre(n,t):{args:{},fields:{}}}function $wt(e){let{inner:t}=P4e(e),n=t;return Hc(n,"ZodArray","array")&&(n=k4e(n)??n),Hc(n,"ZodNumber","number")?"number":Hc(n,"ZodBoolean","boolean")?"boolean":Hc(n,"ZodEnum","enum")?"enum":Hc(n,"ZodString","string")?"string":"other"}function Vwt(e,t){let n=e;for(let r of t){if(n===null||typeof n!="object"||!(r in n))throw new Error(`cliRoutes path [${t.join(".")}] does not resolve in apiContract`);n=n[r]}if(n===null||typeof n!="object"||typeof n.method!="string")throw new Error(`cliRoutes path [${t.join(".")}] is not a leaf route (missing 'method')`);return n}function qwt(e,t){let n=e;for(let r of t)n=n[r];if(typeof n!="function")throw new Error(`client method for [${t.join(".")}] is not callable`);return n}function Are(e,t){if(!(e==null||e==="")){if(t.isArray&&typeof e=="string"){let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);return n.length>0?n:void 0}if(t.leafKind==="number"&&typeof e=="string"){let n=Number(e);return Number.isFinite(n)?n:e}return e}}function Ywt(e){if(typeof e!="string")return e;try{let n=new URL(e).pathname.split("/").filter(Boolean),r=n.findIndex(i=>i==="thread"||i==="threads"),o=r>=0?n[r+1]:void 0;return o&&o.length>0?o:e}catch{return e}}function Kwt(e,t){let n=t.path.map(o=>String(o)).join(".");return` ${n?`${e}.${n}`:e}: ${t.message}`}function mre(e,t,n){if(!e)return[];let r=t??{},o=e.safeParse(r);return o.success?[]:(o.error.issues??[]).map(a=>Kwt(n,a))}function Jwt(e,t,n){return e.resource==="threads"&&t==="id"?Ywt(n):n}function U4e(e){let t=Vwt(qG,e.path),n=dre(t.pathParams),r=e.positional??(n?Object.keys(n):[]),o=new Set(r),i=pre(n?Object.fromEntries(r.map(h=>[h,n[h]])):{},{positional:!0}),a=fre(t.query),c=t.method==="GET"||t.method==="DELETE"?{args:{},fields:{}}:fre(t.body);for(let h of Object.keys(c.args))if(a.args[h]!==void 0||o.has(h))throw new Error(`route [${e.path.join(".")}] has overlapping field "${h}" across path/query/body`);let d={...i.args,...a.args,...c.args},m=e.description??t.summary??`${t.method} ${t.path}`;return{meta:{name:e.op,description:m},args:d,async run({args:h,data:S}){_e.info("command_start",{command:`${e.resource} ${e.op}`,route:e.path.join(".")});let y=S;if(!await(y?.getAccessToken??hr)())throw new ut("not logged in \u2014 run 'lore login' first");let v={};for(let ge of r){let ye=h[ge],be=Are(ye,i.fields[ge])??ye;v[ge]=Jwt(e,ge,be)}let x={};for(let[ge,ye]of Object.entries(a.fields)){let be=Are(h[ge],ye);be!==void 0&&(x[ge]=be)}let N={};for(let[ge,ye]of Object.entries(c.fields)){let be=Are(h[ge],ye);be!==void 0&&(N[ge]=be)}let M=[...mre(t.pathParams,v,"path"),...mre(t.query,x,"query"),...t.method==="GET"||t.method==="DELETE"?[]:mre(t.body,N,"body")];if(M.length>0)throw new ut(`Invalid request for \`lore ${e.resource} ${e.op}\`:
|
|
495
495
|
${M.join(`
|
|
@@ -506,7 +506,7 @@ ${M.join(`
|
|
|
506
506
|
`),!X9e(n))console.log(" currently uploading from: nothing yet \u2014 opt in to your first location below.");else{console.log(" currently uploading from:");let r=Math.max(8,...n.map(o=>o.value.length));for(let o of n){let i=o.kind==="cwd"?"dir":"repo";console.log(` ${i} ${o.value.padEnd(r)} \u2192 ${o.workspace}`)}}console.log(""),console.log(" For guided, interactive setup, run `lore configure`."),console.log(" These subcommands are the low-level CRUD for scripted edits:"),console.log(""),console.log(" lore listen create <path> [--workspace <name>] start uploading from a directory"),console.log(" lore listen list [--json] print the upload list"),console.log(" lore listen update <path> --workspace <name> reassign a dir to a different workspace"),console.log(" lore listen delete <path> stop uploading from a directory"),console.log(""),console.log(" Example: lore listen create ~/code/projectA")}};A();A();_r();na();Qx();Tf();import yue from"node:fs/promises";import nVe from"node:path";async function ozt(e){try{return await yue.access(e),!0}catch(t){if(Yr(t,"ENOENT"))return!1;throw t}}function izt(e){return nVe.join(nVe.dirname(e),"upload_dirs.bak.json")}async function azt({uploadDirsPath:e=zR(),uploadFilterPath:t=Qg(),uploadDirsBackupPath:n=izt(e)}={}){if(!await ozt(e))return;let r=await Vc(e);if(r.directories.length>0){let o=await gu(t),i=Array.from(new Set([...o.include.cwd,...r.directories.map(a=>a.path)])).sort();await im({...o,include:{...o.include,cwd:i}},t)}await yue.rm(n,{force:!0}),await yue.rename(e,n)}var rVe={id:"20260518000000-upload-dirs-to-upload-filters",run:azt};A();_r();na();UE();Tf();import szt from"node:fs/promises";async function uzt(e){try{return await szt.access(e),!0}catch(t){if(Yr(t,"ENOENT"))return!1;throw t}}async function czt({uploadFilterPath:e=Qg()}={}){if(!await uzt(e))return;let t=await gu(e),n=[],r=[];for(let o of t.include.cwd){let i=await gM(o);i?n.push(i):r.push(o)}n.length===0&&r.length===t.include.cwd.length||await im({...t,include:{...t.include,cwd:r.sort(),repo:Array.from(new Set([...t.include.repo,...n])).sort()}},e)}var oVe={id:"20260519000000-upload-filter-cwds-to-repos",run:czt};var lzt=[rVe,oVe];async function dzt(e=lzt,t=console.log){t(`running ${e.length} migration${e.length===1?"":"s"}`);for(let n of e)t(`running migration ${n.id}`),await n.run(),t(`finished migration ${n.id}`);t("finished migrations")}var iVe={meta:{name:"postinstall:migrate",hidden:!0,skipAutoupdate:!0},async run(){await dzt()}};sre();BM();A();Zo();Ll();wr();jse();import{platform as pzt,release as fzt}from"node:os";function Azt(e){return e.find(n=>!n.startsWith("-"))??"lore"}async function aVe(e){try{let t={command:Azt(e.rawArgs),rawArgs:[...e.rawArgs],cliVersion:qu(),nodeVersion:process.version,platform:pzt(),release:fzt()};(await S5e({error:e.error,context:t,logger:_e,send:async r=>{let i=await cn().createFeedback({body:r});switch(i.status){case 201:return{kind:"sent"};case 401:return{kind:"unauthorized"};case 429:return{kind:"rate-limited"};default:return{kind:"failed",error:new Error(`createFeedback returned HTTP ${i.status}`)}}}})).kind==="sent"&&_e.info("error_report_sent")}catch(t){_e.warn("error_report_unexpected_failure",{error:t instanceof Error?t.message:String(t)})}}A();A();import{createInterface as mzt}from"node:readline/promises";Zo();_r();BH();var sVe={meta:{name:"install",description:"Pull a workspace skill from Lore and write it to ~/.claude/skills/<name>/SKILL.md."},args:{target:{type:"positional",required:!0,description:"Workspace skill name"},yes:{type:"boolean",required:!1,description:"Skip the confirmation prompt before overwriting an existing SKILL.md"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new ut("install needs a skill name \u2014 e.g. `lore skills install feature`");let n=await gzt(t);if(!wM(n.name))throw new ut(`refusing to install skill with invalid name: ${JSON.stringify(n.name)}`);let r=await Hx(n.name);if(r&&r.bodyMd===n.bodyMd){console.log(`/${n.name} is already up to date at ${r.filePath}`);return}if(r&&(console.log(`A SKILL.md for /${n.name} already exists at:
|
|
507
507
|
${r.filePath}`),console.log(""),console.log("--- diff (- local, + remote) ---"),hzt(r.bodyMd,n.bodyMd),console.log("--------------------------------"),!(!!e.yes||await _zt("Overwrite with the remote version? ")))){console.log("install cancelled");return}let o=await U5e(n.name,n.bodyMd);console.log(`installed /${n.name} -> ${o}`)}};async function gzt(e){if(!await hr())throw new ut("workspace skill installs require login \u2014 run 'lore login' first");let n=await cn().getSkillRaw({params:{name:e}});if(n.status!==200){let r=n.body?.message??`getSkillRaw returned ${n.status}`;throw new ut(r)}return{name:e,bodyMd:typeof n.body=="string"?n.body:String(n.body)}}function hzt(e,t){let n=e.split(`
|
|
508
508
|
`),r=t.split(`
|
|
509
|
-
`),o=Math.max(n.length,r.length);for(let i=0;i<o;i+=1){let a=n[i],c=r[i];if(a===c){console.log(` ${a}`);continue}a!==void 0&&console.log(`- ${a}`),c!==void 0&&console.log(`+ ${c}`)}}async function _zt(e){let t=mzt({input:process.stdin,output:process.stdout});try{let n=(await t.question(`${e}[y/N] `)).trim().toLowerCase();return n==="y"||n==="yes"}finally{t.close()}}A();Zo();_r();var uVe={meta:{name:"list",description:"List skills available in your workspace."},async run(){if(!await hr())throw new ut("not logged in \u2014 run 'lore login' first");let t=await cn().listSkills({});if(t.status!==200){let n=t.body?.message??`listSkills returned ${t.status}`;throw new ut(n)}if(t.body.objects.length===0){console.log("no skills in this workspace yet");return}for(let n of t.body.objects){let r=n.source?` [${n.source}]`:"",o=n.description?` \u2014 ${n.description}`:"";console.log(`/${n.name}${r}${o}`)}}};A();Zo();_r();BH();var cVe={meta:{name:"publish",description:"Push a local SKILL.md to Lore so it can be downloaded and installed by your team. Pass --all to publish every skill in ~/.claude/skills/."},args:{name:{type:"positional",required:!1,description:"Skill directory name under ~/.claude/skills/<name>/SKILL.md or ./.claude/skills/<name>/SKILL.md"},all:{type:"boolean",required:!1,description:"Publish every locally installed skill in one go"}},async run({args:e}){if(!await hr())throw new ut("not logged in \u2014 run 'lore login' first");let t=cn(),n=await Ezt(e);if(n.length===0)throw new ut("no skills to publish \u2014 pass a name like `lore skills publish feature` or `--all`");let r=0;for(let o of n){let i=await Hx(o);if(!i){console.error(`skip ${o}: no SKILL.md found locally`);continue}let a=await t.publishSkill({params:{name:o},body:{body_md:i.bodyMd,description:i.description,published:!0}});if(a.status!==200){let c=a.body?.message??`publishSkill returned ${a.status}`;throw new ut(`failed to publish ${o}: ${c}`)}r+=1,console.log(`published /${o} (v${a.body.latest_version}, ${a.body.source}) from ${i.filePath}`)}if(r===0)throw new ut("no skills were published \u2014 check the names and try again")}};async function Ezt(e){if(e.all)return DH();let t=typeof e.name=="string"?e.name.trim():"";return t?[t]:[]}var lVe={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:cVe,install:sVe,list:uVe}};A();A();Zo();_r();var dVe={meta:{name:"channels",description:"List Slack channels the bot can see for your workspace."},async run(){if(!await hr())throw new ut("not logged in \u2014 run 'lore login' first");let t=await cn().slack.listSlackChannels();if(t.status===200){for(let r of t.body.channels){let o=r.is_private?"(private)":"";console.log(`#${r.name} ${o}`.trim())}t.body.channels.length===0&&console.log("No channels found. Make sure the Lore bot is invited to at least one channel.");return}if(t.status===404)throw new ut("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let n=t.body?.message??`unexpected status ${t.status}`;throw new ut(n)}};A();Zo();_r();var pVe={meta:{name:"post",description:"Post a Lore thread link to a Slack channel."},args:{channel:{type:"positional",required:!0,description:"Slack channel name (with or without #)"},"thread-id":{type:"string",required:!0,description:"The Lore thread ID to post (e.g. th_...)"}},async run({args:e}){if(!await hr())throw new ut("not logged in \u2014 run 'lore login' first");let t=(typeof e.channel=="string"?e.channel:"").replace(/^#/,""),n=e["thread-id"];if(!t)throw new ut("channel name is required \u2014 e.g. `lore slack post general --thread-id th_...`");if(!n)throw new ut("--thread-id is required \u2014 e.g. `lore slack post general --thread-id th_...`");let o=await cn().slack.postToSlack({body:{channel_name:t,thread_id:n}});if(o.status===200){console.log(JSON.stringify({ok:!0,channel:t,ts:o.body.ts}));return}if(o.status===404)throw new ut("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let i=o.body?.message??`unexpected status ${o.status}`;throw new ut(i)}};var fVe={meta:{name:"slack",description:"Slack integration commands."},subCommands:{channels:dVe,post:pVe}};vE();A();await so();var JH=ie(rn(),1);Ll();await CT();A();await so();var qH=ie(rn(),1);await am();A();await so();var Xx=ie(rn(),1);va();var Yl=ie(Lt(),1);function eD({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[a,c]=(0,Xx.useState)(AVe(e,n)),d=(0,Xx.useRef)(a);return(0,Xx.useEffect)(()=>{let m=AVe(e,n);d.current=m,c(m)},[e,n]),Au((m,h)=>{if(e.length!==0){if(h.upArrow||m==="k"){let S=Szt(e,d.current);d.current=S,c(S);return}if(h.downArrow||m==="j"){let S=mVe(e,d.current);d.current=S,c(S);return}if(h.return||m===" "){let S=e[d.current];S&&!S.disabled&&t(S)}}},{isActive:!r}),e.length===0?(0,Yl.jsx)(Ae,{color:ve.muted,children:"no actions available"}):(0,Yl.jsxs)(me,{flexDirection:"column",children:[e.map((m,h)=>{let S=h===a,y=m.disabled?ve.muted:S?ve.primary:ve.highlight;return(0,Yl.jsxs)(me,{children:[(0,Yl.jsx)(me,{width:2,flexShrink:0,children:(0,Yl.jsx)(Ae,{color:S?ve.primary:ve.muted,children:S?"\u203A":" "})}),(0,Yl.jsx)(me,{width:i,flexShrink:0,children:(0,Yl.jsx)(Ae,{color:y,bold:S&&!m.disabled,children:m.label})}),m.description?(0,Yl.jsx)(me,{flexGrow:1,flexShrink:1,children:(0,Yl.jsx)(Ae,{color:ve.muted,children:m.description})}):null]},m.id)}),o?(0,Yl.jsx)(me,{marginTop:1,children:(0,Yl.jsx)(Ae,{color:ve.muted,children:o})}):null]})}function AVe(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?mVe(e,n-1):n}function mVe(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r]?.disabled)return r}return t}function Szt(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r]?.disabled)return r}return t}await sm();await vT();await RT();va();A();Zo();FM();Qx();async function zH(e){if(!await(e.hasAccessToken??(async()=>!!await hr()))())return{state:"logged_out"};let n=e.client??cn();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:gVe(r.body,`whoAmI returned ${r.status}`)}:{state:"ready",userId:r.body.user.id,email:r.body.emailAddress,displayName:r.body.user.display_name,organizations:r.body.organizations,activeOrganizationId:r.body.organizationId,activeOrganizationName:r.body.org_name}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function HH(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??UH;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function $H(e){if(!await(e.hasAccessToken??(async()=>!!await hr()))())return{state:"logged_out"};let n=e.client??cn();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:gVe(r.body,`listSkills returned ${r.status}`)};let o=r.body.objects.length,i=r.body.objects.filter(a=>(a.source??"").trim()==="lore").length;return{state:"ready",count:o,published:i}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function VH(){try{return{state:"ready",directories:(await Vc()).directories}}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function gVe(e,t){if(e&&typeof e=="object"&&"message"in e){let n=e.message;if(typeof n=="string"&&n.length>0)return n}return t}var Ot=ie(Lt(),1);function KE({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=Ca(),[i,a]=(0,qH.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,qH.useEffect)(()=>{if(t)return;let d=!1;return(async()=>{let[m,h,S,y]=await Promise.all([zH(n),HH(n),$H(n),VH()]);d||a({identity:m,daemon:h,skills:S,uploadDirs:y})})(),()=>{d=!0}},[]),Au((d,m)=>{(d==="q"||m.ctrl&&d==="c"||m.escape)&&(r("quit"),o())});let c=vzt(i);return(0,Ot.jsxs)(me,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,Ot.jsx)(Ra,{title:"lore",subtitle:Tzt(i.identity),right:`v${e}`}),(0,Ot.jsxs)(me,{flexDirection:"row",gap:2,children:[(0,Ot.jsx)(me,{flexDirection:"column",width:"50%",children:(0,Ot.jsx)(kn,{title:"Daemon",children:(0,Ot.jsx)(Czt,{daemon:i.daemon})})}),(0,Ot.jsx)(me,{flexDirection:"column",width:"50%",children:(0,Ot.jsx)(kn,{title:"Workspace",children:(0,Ot.jsx)(Izt,{identity:i.identity,skills:i.skills})})})]}),(0,Ot.jsx)(me,{marginTop:1,children:(0,Ot.jsx)(kn,{title:"Upload directories",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.directories.length} configured`:void 0,children:(0,Ot.jsx)(yzt,{uploadDirs:i.uploadDirs})})}),(0,Ot.jsx)(me,{marginTop:1,children:(0,Ot.jsx)(kn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Ot.jsx)(eD,{items:c,onSelect:d=>{r(d.id),o()}})})})]})}function yzt({uploadDirs:e}){return e.state==="loading"?(0,Ot.jsx)(ws,{label:"reading ~/.lore/upload_dirs.json\u2026"}):e.state==="error"?(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"error",kind:"error"}),(0,Ot.jsx)(Ae,{color:ve.danger,children:e.message})]}):e.directories.length===0?(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,Ot.jsx)(me,{marginTop:1,children:(0,Ot.jsxs)(Ae,{color:ve.muted,children:["Run ",(0,Ot.jsx)(Ae,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,Ot.jsx)(me,{flexDirection:"column",children:e.directories.map(t=>(0,Ot.jsx)(on,{label:t.organizationName??"personal",value:t.path,kind:"success",labelWidth:16},t.path))})}function Tzt(e){switch(e.state){case"ready":{let t=e.activeOrganizationName??"";return t?`${e.email} \xB7 ${t}`:e.email}case"logged_out":return"not signed in";case"loading":return"loading\u2026";case"error":return"identity error"}}function Czt({daemon:e}){if(e.state==="loading")return(0,Ot.jsx)(ws,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(Ae,{color:ve.muted,children:"Background uploads are macOS-only today."}),(0,Ot.jsxs)(Ae,{color:ve.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"error",kind:"error"}),(0,Ot.jsx)(Ae,{color:ve.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:t.health,kind:n}),(0,Ot.jsx)(on,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,Ot.jsx)(on,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,Ot.jsx)(on,{label:"Heartbeat",value:hVe(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,Ot.jsx)(on,{label:"Last upload",value:hVe(t.status?.last_success_at)}),t.status?.last_error?(0,Ot.jsx)(on,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function Izt({identity:e,skills:t}){return e.state==="loading"?(0,Ot.jsx)(ws,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"signed out",kind:"warning"}),(0,Ot.jsx)(Ae,{color:ve.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"error",kind:"error"}),(0,Ot.jsx)(Ae,{color:ve.danger,children:e.message})]}):(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"User",value:e.email,kind:"success"}),(0,Ot.jsx)(on,{label:"Display name",value:e.displayName}),(0,Ot.jsx)(on,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,Ot.jsx)(on,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,Ot.jsx)(on,{label:"Skills",value:bzt(t)})]})}function bzt(e){return e.state==="loading"?"loading\u2026":e.state==="logged_out"?"\u2014":e.state==="error"?`error (${e.message})`:`${e.count} installed \xB7 ${e.published} published`}function vzt(e){let t=e.identity.state==="ready",n=e.daemon.state==="ready"&&e.daemon.report.enabled,r=e.daemon.state!=="unsupported",o=[];return t&&(o.push({id:"share-codex",label:"Share Codex",description:"lore share-codex --session-file <path>"}),o.push({id:"share-cowork",label:"Share Cowork",description:"lore share-cowork"}),o.push({id:"export",label:"Export Claude",description:"lore export"})),r&&(n?(o.push({id:"status",label:"Daemon status",description:"lore status"}),o.push({id:"restart",label:"Restart daemon",description:"lore restart"}),o.push({id:"disable",label:"Disable daemon",description:"lore disable"})):o.push({id:"enable",label:"Enable daemon",description:"lore enable"})),t?(o.push({id:"configure",label:"Configure uploads",description:"lore configure"}),o.push({id:"listen-list",label:"Manage upload dirs",description:"lore listen list"}),o.push({id:"skills-list",label:"Skills",description:"lore skills list"}),o.push({id:"workspaces-list",label:"Workspaces",description:"lore workspaces list"}),o.push({id:"logout",label:"Sign out",description:"lore logout"})):o.push({id:"login",label:"Sign in",description:"lore login"}),o.push({id:"quit",label:"Quit",description:"exit the dashboard"}),o}function hVe(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}A();await so();await am();await sm();va();var Wo=ie(Lt(),1),Rzt=[{id:"login",label:"Sign in with WorkOS",description:"opens your browser for a device-code flow"},{id:"quit",label:"Quit",description:"exit without signing in"}];function YH({cliVersion:e,onSelect:t}){let{exit:n}=Ca();return Au((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,Wo.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Wo.jsx)(Ra,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,Wo.jsx)(kn,{title:"What is Lore?",children:(0,Wo.jsxs)(me,{flexDirection:"column",children:[(0,Wo.jsx)(Ae,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,Wo.jsxs)(me,{marginTop:1,flexDirection:"column",children:[(0,Wo.jsx)(Ae,{color:ve.muted,children:"You'll get:"}),(0,Wo.jsxs)(Ae,{children:[(0,Wo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,Wo.jsxs)(Ae,{children:[(0,Wo.jsx)(Ae,{color:ve.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,Wo.jsxs)(Ae,{children:[(0,Wo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,Wo.jsxs)(Ae,{children:[(0,Wo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,Wo.jsx)(me,{marginTop:1,children:(0,Wo.jsx)(kn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Wo.jsx)(eD,{items:Rzt,onSelect:r=>{t(r.id),n()}})})}),(0,Wo.jsx)(me,{marginTop:1,children:(0,Wo.jsxs)(Ae,{color:ve.muted,children:["New to Lore? Run ",(0,Wo.jsx)(Ae,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var KH=ie(Lt(),1),xzt={login:["login"],logout:["logout"],enable:["enable"],disable:["disable"],status:["status"],restart:["restart"],"share-codex":["share-codex"],"share-cowork":["share-cowork"],export:["export"],"workspaces-list":["workspaces","list"],"skills-list":["skills","list"],"listen-list":["listen","list"],configure:["configure"],quit:[]};function Dzt({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,JH.useState)(void 0),{exit:i}=Ca();return(0,JH.useEffect)(()=>{let a=!1;return(async()=>{let[c,d,m,h]=await Promise.all([zH(t),HH(t),$H(t),VH()]);a||o({identity:c,daemon:d,skills:m,uploadDirs:h})})(),()=>{a=!0}},[]),r?r.identity.state==="logged_out"?(0,KH.jsx)(YH,{cliVersion:e,onSelect:a=>{n(a),i()}}):(0,KH.jsx)(KE,{cliVersion:e,initialData:r,onSelect:n}):null}async function _Ve(){let e="quit";return await qc((0,KH.jsx)(Dzt,{cliVersion:qu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:xzt[e]}}A();await CT();A();await so();var ZM=ie(rn(),1);await am();await sm();va();A();await so();await bse();await am();await bT();await sm();await xse();A();await so();va();var tD=ie(Lt(),1),Bzt="\u2588",Nzt="\u2591";function EVe({value:e,width:t=24,label:n,color:r=ve.success}){let o=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=Math.round(o*t),a=Math.max(0,t-i);return(0,tD.jsxs)(me,{children:[(0,tD.jsx)(Ae,{color:r,children:Bzt.repeat(i)}),(0,tD.jsx)(Ae,{color:ve.muted,children:Nzt.repeat(a)}),n?(0,tD.jsxs)(Ae,{color:ve.muted,children:[" ",n]}):null]})}await vT();await RT();await vse();await Mse();await Use();A();await so();await am();await bT();await sm();await vT();va();var uo=ie(Lt(),1),yVe=[{key:"resolving_session",label:"Resolving session"},{key:"uploading",label:"Uploading transcript"},{key:"parsing",label:"Parsing on server"},{key:"updating_visibility",label:"Updating visibility"},{key:"resolving_highlight",label:"Resolving highlight"}];function VM(){return{steps:yVe.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function ZH(e,t){return t.kind==="completed"?{...e,result:{url:t.url,reused:t.reused,visibility:t.visibility,clipboardCopied:t.clipboardCopied,sessionId:t.sessionId}}:t.kind==="error"?{...e,errorMessage:t.message,steps:e.steps.map(n=>n.status==="active"?{...n,status:"pending"}:n)}:t.step==="done"||t.step==="errored"?{...e,steps:e.steps.map(n=>({...n,status:n.status==="active"?"done":n.status}))}:{...e,steps:e.steps.map(n=>n.key===t.step?{...n,status:"active",label:t.label?`${SVe(n.key)} (${t.label})`:SVe(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function SVe(e){return yVe.find(t=>t.key===e)?.label??e}function Xg({title:e,subtitle:t,state:n}){return(0,uo.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,uo.jsx)(Ra,{title:e,subtitle:t}),(0,uo.jsx)(kn,{title:"Pipeline",children:(0,uo.jsx)(me,{flexDirection:"column",children:n.steps.map(r=>(0,uo.jsx)(Ozt,{step:r},r.key))})}),n.result?(0,uo.jsx)(me,{marginTop:1,flexDirection:"column",children:(0,uo.jsx)(xa,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,uo.jsxs)(me,{flexDirection:"column",children:[(0,uo.jsx)(Ae,{children:n.result.url}),(0,uo.jsx)(me,{marginTop:1,children:(0,uo.jsxs)(Ae,{color:ve.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,uo.jsx)(me,{marginTop:1,children:(0,uo.jsx)(xa,{kind:"error",title:"Failed",children:(0,uo.jsx)(Ae,{children:n.errorMessage})})}):null]})}function Ozt({step:e}){return e.status==="active"?(0,uo.jsxs)(me,{children:[(0,uo.jsx)(ws,{}),(0,uo.jsx)(Ae,{children:" "}),(0,uo.jsx)(Ae,{color:ve.primary,children:e.label})]}):e.status==="done"?(0,uo.jsxs)(me,{children:[(0,uo.jsx)(Ae,{color:ve.success,children:"\u2713 "}),(0,uo.jsx)(Ae,{color:ve.muted,children:e.label})]}):(0,uo.jsxs)(me,{children:[(0,uo.jsx)(Ae,{color:ve.muted,children:"\u25CB "}),(0,uo.jsx)(Ae,{color:ve.muted,children:e.label})]})}va();A();var qM=Date.parse("2026-05-16T12:00:00.000Z");function YM(e){return new Date(qM-e*6e4).toISOString()}var vf={plist:"/Users/alex/Library/LaunchAgents/ai.tanagram.lore.plist",binary:"/Users/alex/.lore/bin/lore-background",logFile:"/Users/alex/.lore/log.txt",status:"/Users/alex/.lore/status.json",installSource:"/opt/homebrew/bin/lore"},TVe=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:qM-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:qM-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:qM-3*60*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:qM-26*60*6e4}],wzt=[{path:"/Users/alex/code/tanagram-lore",organizationId:"org_tanagram",organizationName:"Tanagram",addedAt:"2026-05-01T09:00:00.000Z"},{path:"/Users/alex/work/acme-integration",organizationId:"org_acme",organizationName:"Acme",addedAt:"2026-05-09T13:30:00.000Z"}],nD={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:vf.plist,binary_path:vf.binary,status_path:vf.status,install_source_path:vf.installSource,status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:YM(60),last_heartbeat_at:YM(1),last_success_at:YM(5),last_completed_at:YM(5),last_thread_ids:["thr_01hx_story"]}},CVe={...nD,running:!1,healthy:!1,health:"stale heartbeat",heartbeat_fresh:!1,status:{...nD.status,state:"error",last_heartbeat_at:YM(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},Mzt={...nD,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,status:void 0},kzt={state:"ready",userId:"user_alex",email:"alex@tanagram.ai",displayName:"Alex Rivera",organizations:[{id:"org_tanagram",name:"Tanagram"},{id:"org_acme",name:"Acme"}],activeOrganizationId:"org_tanagram",activeOrganizationName:"Tanagram"},KM={identity:kzt,daemon:{state:"ready",report:nD},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",directories:wzt}},IVe={...KM,uploadDirs:{state:"ready",directories:[]}},bVe={...KM,daemon:{state:"error",message:"launchctl print failed: service not found"}},vVe={...KM,daemon:{state:"unsupported",platform:"linux"}},RVe={identity:{state:"logged_out"},daemon:{state:"ready",report:Mzt},skills:{state:"logged_out"},uploadDirs:{state:"ready",directories:[]}},xVe=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var ht=ie(Lt(),1),Kr=()=>{};function JE(...e){return e.reduce(yH,DM())}function JM(...e){return e.reduce(ZH,VM())}var pm=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,ht.jsx)(YH,{cliVersion:"0.1.0",onSelect:Kr})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,ht.jsx)(up,{state:DM()})},{id:"onboarding/login/device-code",title:"Login / device code",path:["TUI","Screens","Onboarding","Login"],description:"User has a WorkOS code and browser URL.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"})})},{id:"onboarding/login/awaiting-authorization",title:"Login / awaiting authorization",path:["TUI","Screens","Onboarding","Login"],description:"Browser is open and polling is active.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"waiting_for_authorization"})})},{id:"onboarding/login/auto-enable",title:"Login / auto-enable in progress",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded and launchd install is running.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"})})},{id:"onboarding/login/success",title:"Login / success",path:["TUI","Screens","Onboarding","Login"],description:"Signed in and background uploads enabled.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_succeeded",plistPath:vf.plist,binaryPath:vf.binary,logFile:vf.logFile})})},{id:"onboarding/login/auto-enable-failed",title:"Login / auto-enable failed",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded but the daemon install needs a retry.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_failed"})})},{id:"onboarding/login/denied",title:"Login / denied",path:["TUI","Screens","Onboarding","Login"],description:"Terminal authorization failure state.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"authorization_denied"})})},{id:"onboarding/login/api-unreachable",title:"Login / API unreachable",path:["TUI","Screens","Onboarding","Login"],description:"Early failure before WorkOS device-code negotiation.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"login_failed",message:"Could not reach the Lore API at http://localhost:4000. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared."})})},{id:"onboarding/login/already-signed-in",title:"Login / already signed in",path:["TUI","Screens","Onboarding","Login"],description:"Short-circuit copy for authenticated callers.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"already_logged_in"})})},{id:"onboarding/configure-upload-repos/loading",title:"Configure upload repos / loading",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Recent Claude Code cwd discovery is in flight.",render:()=>(0,ht.jsx)(lm,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/choose",title:"Configure upload repos / choose",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Suggested git remotes with defaults checked.",render:()=>(0,ht.jsx)(lm,{state:{phase:"choose",suggestions:TVe,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/empty",title:"Configure upload repos / empty",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"No recent sessions, with add-custom affordance.",render:()=>(0,ht.jsx)(lm,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/saved",title:"Configure upload repos / saved",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save for multiple repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/skipped",title:"Configure upload repos / skipped",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save with zero selected repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,ht.jsx)(lm,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:Kr,onSkip:Kr})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:KM,onSelect:Kr})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:IVe,onSelect:Kr})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:bVe,onSelect:Kr})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:vVe,onSelect:Kr})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:RVe,onSelect:Kr})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,ht.jsx)(Xg,{title:"lore share-codex",subtitle:"sharing this Codex session",state:VM()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,ht.jsx)(Xg,{title:"lore share-codex",subtitle:"sharing this Codex session",state:JM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading",label:"42%"})})},{id:"sharing/parsing",title:"Share flow / parsing",path:["TUI","Screens","Sharing"],description:"Server-side parsing is active.",render:()=>(0,ht.jsx)(Xg,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:JM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing",label:"queued"})})},{id:"sharing/shared",title:"Share flow / shared",path:["TUI","Screens","Sharing"],description:"New share completed and copied to clipboard.",render:()=>(0,ht.jsx)(Xg,{title:"lore share-codex",state:JM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing"},{kind:"step",step:"updating_visibility"},{kind:"step",step:"done"},{kind:"completed",url:"https://lore.tanagram.ai/thread/thr_01hx_story",reused:!1,visibility:"workspace",clipboardCopied:!0,sessionId:"thr_01hx_story"})})},{id:"sharing/already-shared",title:"Share flow / already shared",path:["TUI","Screens","Sharing"],description:"Deduped upload converges to an existing Lore thread.",render:()=>(0,ht.jsx)(Xg,{title:"lore share-cowork",state:JM({kind:"completed",url:"https://lore.tanagram.ai/thread/thr_01hx_story",reused:!0,visibility:"private",clipboardCopied:!1})})},{id:"sharing/error",title:"Share flow / error",path:["TUI","Screens","Sharing"],description:"Pipeline error callout.",render:()=>(0,ht.jsx)(Xg,{title:"lore export",state:JM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"error",message:"presigned upload failed: HTTP 403"})})},{id:"daemon/run/enable-progress",title:"Daemon run / enable progress",path:["TUI","Screens","Daemon","Run"],description:"Enable command while launchd work is active.",render:()=>(0,ht.jsx)(YE,{mode:"enable",state:{phase:"in_progress"}})},{id:"daemon/run/enable-success",title:"Daemon run / enable success",path:["TUI","Screens","Daemon","Run"],description:"Enable success includes resolved paths.",render:()=>(0,ht.jsx)(YE,{mode:"enable",state:{phase:"finished",result:{plistPath:vf.plist,binaryPath:vf.binary,logFile:vf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,ht.jsx)(YE,{mode:"disable",state:{phase:"finished"}})},{id:"daemon/run/restart-success",title:"Daemon run / restart success",path:["TUI","Screens","Daemon","Run"],description:"Restart success copy.",render:()=>(0,ht.jsx)(YE,{mode:"restart",state:{phase:"finished"}})},{id:"daemon/run/error",title:"Daemon run / error",path:["TUI","Screens","Daemon","Run"],description:"Mode-independent daemon command error.",render:()=>(0,ht.jsx)(YE,{mode:"restart",state:{phase:"errored",errorMessage:"launchctl bootstrap failed"}})},{id:"daemon/status/healthy",title:"Daemon status / healthy",path:["TUI","Screens","Daemon","Status"],description:"Healthy daemon report.",render:()=>(0,ht.jsx)(GM,{report:nD})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,ht.jsx)(GM,{report:CVe})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,ht.jsx)(Ra,{title:"lore",subtitle:"component primitive",right:"v0.1.0"})},{id:"components/primitives/panel",title:"Components / panel",path:["TUI","Components","Primitives"],description:"Bordered container with title, subtitle, and focus styling.",render:()=>(0,ht.jsx)(kn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,ht.jsx)(Ae,{color:ve.muted,children:"Panels compose screen sections and callouts."})})},{id:"components/primitives/status-line",title:"Components / status line",path:["TUI","Components","Primitives"],description:"Key/value rows with severity dots.",render:()=>(0,ht.jsxs)(kn,{title:"StatusLine",children:[(0,ht.jsx)(on,{label:"Healthy",value:"yes",kind:"success"}),(0,ht.jsx)(on,{label:"Warning",value:"needs attention",kind:"warning"}),(0,ht.jsx)(on,{label:"Error",value:"launchctl failed",kind:"error"})]})},{id:"components/primitives/progress-bar",title:"Components / progress bar",path:["TUI","Components","Primitives"],description:"Plain unicode progress bar for deterministic terminal rendering.",render:()=>(0,ht.jsx)(kn,{title:"ProgressBar",children:(0,ht.jsx)(EVe,{value:.62,label:"62%"})})},{id:"components/primitives/message-box",title:"Components / message box",path:["TUI","Components","Primitives"],description:"Severity callout for success, info, warning, and error copy.",render:()=>(0,ht.jsxs)(me,{flexDirection:"column",children:[(0,ht.jsx)(xa,{kind:"success",title:"Shared",children:(0,ht.jsx)(Ae,{children:"Copied the Lore URL to your clipboard."})}),(0,ht.jsx)(me,{marginTop:1,children:(0,ht.jsx)(xa,{kind:"error",title:"Failed",children:(0,ht.jsx)(Ae,{color:ve.muted,children:"presigned upload failed: HTTP 403"})})})]})},{id:"components/primitives/spinner",title:"Components / spinner",path:["TUI","Components","Primitives"],description:"Unrefed animated spinner primitive.",render:()=>(0,ht.jsx)(kn,{title:"Spinner",children:(0,ht.jsx)(ws,{label:"working on a terminal-friendly task\u2026"})})},{id:"components/inputs/menu",title:"Components / menu",path:["TUI","Components","Inputs"],description:"Keyboard menu with enabled and disabled items.",render:()=>(0,ht.jsx)(kn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,ht.jsx)(eD,{items:[{id:"share",label:"Share",description:"upload a session"},{id:"status",label:"Status",description:"inspect daemon"},{id:"disabled",label:"Disabled",description:"not available in this state",disabled:!0}],onSelect:Kr})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,ht.jsx)(kn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,ht.jsx)(RM,{items:[{id:"repo",label:"/Users/alex/code/tanagram-lore",initialChecked:!0},{id:"demo",label:"/Users/alex/code/customer-demo"},{id:"add",label:"+ Add a custom path\u2026",action:!0}],onSubmit:Kr,onAction:Kr})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,ht.jsx)(kn,{title:"TextInput",children:(0,ht.jsx)(gH,{initialValue:"~/code",onSubmit:Kr,onCancel:Kr})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,ht.jsx)(kn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,ht.jsx)(hH,{initialValue:"/Users/alex/code",loadSuggestions:async()=>xVe,onSubmit:Kr,onCancel:Kr})})}];function DVe(e){return pm.find(t=>t.id===e)}function rD(e){return e.path.slice(1).join(" / ")}var Mr=ie(Lt(),1);function NVe({initialStoryId:e}){let t=Math.max(0,pm.findIndex(m=>m.id===e)),[n,r]=(0,ZM.useState)(t),[o,i]=(0,ZM.useState)("sidebar"),a=(0,ZM.useRef)(o);a.current=o;let{exit:c}=Ca();Au((m,h)=>{if(h.ctrl&&m==="c"){c();return}if(a.current==="sidebar"&&m==="q"){c();return}if(h.escape){if(a.current==="preview"){a.current="sidebar",i("sidebar");return}c();return}if(a.current==="preview"&&h.tab&&h.shift){a.current="sidebar",i("sidebar");return}if(a.current==="sidebar"&&h.tab&&!h.shift){a.current="preview",i("preview");return}if(a.current==="sidebar"){if(h.upArrow||m==="k"){r(S=>BVe(S-1));return}(h.downArrow||m==="j")&&r(S=>BVe(S+1))}});let d=pm[n]??pm[0];return(0,Mr.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Mr.jsx)(Ra,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${pm.length}`}),(0,Mr.jsx)(me,{marginBottom:1,children:(0,Mr.jsx)(Ae,{color:ve.muted,children:"\u2191/\u2193 or j/k select stories \xB7 Tab focuses preview \xB7 Shift+Tab/Esc returns \xB7 q exits from sidebar"})}),(0,Mr.jsxs)(me,{flexDirection:"row",gap:2,children:[(0,Mr.jsx)(me,{width:36,flexShrink:0,children:(0,Mr.jsx)(kn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,Mr.jsx)(Pzt,{stories:pm,selectedIndex:n,focused:o==="sidebar"})})}),(0,Mr.jsx)(me,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,Mr.jsx)(kn,{title:d.title,focused:o==="preview",subtitle:o==="preview"?`${rD(d)} \xB7 focused`:rD(d),children:(0,Mr.jsxs)(me,{flexDirection:"column",children:[(0,Mr.jsx)(Ae,{color:ve.muted,children:d.description}),o==="sidebar"?(0,Mr.jsxs)(Ae,{color:ve.muted,children:["Press ",(0,Mr.jsx)(Ae,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,Mr.jsx)(me,{marginTop:1,children:d.render()})]})})})]})]})}function Pzt({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,a)=>{let c=i.path.slice(1),d=Gzt(o,c);for(let m=d;m<c.length;m++)r.push((0,Mr.jsx)(Uzt,{label:c[m]??"",level:m,marginTop:Fzt(c[m]??"",m,d),focused:n},`group:${c.slice(0,m+1).join("/")}`));r.push((0,Mr.jsx)(Lzt,{story:i,selected:a===t,focused:n},i.id)),o=c}),(0,Mr.jsx)(me,{flexDirection:"column",children:r})}function Uzt({label:e,level:t,marginTop:n,focused:r}){return(0,Mr.jsx)(me,{marginLeft:OVe(t),marginTop:n,children:(0,Mr.jsx)(Ae,{color:r?ve.primary:ve.muted,bold:r,wrap:"truncate-end",children:e})})}function Lzt({story:e,selected:t,focused:n}){let r=n?t?ve.accent:ve.highlight:ve.muted;return(0,Mr.jsxs)(me,{marginLeft:OVe(e.path.slice(1).length),children:[(0,Mr.jsx)(Ae,{color:n&&t?ve.accent:ve.muted,children:t?"\u203A ":" "}),(0,Mr.jsx)(Ae,{color:r,bold:n&&t,wrap:"truncate-end",children:Qzt(e)})]})}function Qzt(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function OVe(e){return Math.min(e,4)}function Fzt(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Gzt(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function BVe(e){let t=pm.length;return(e%t+t)%t}function wVe({story:e}){let{exit:t}=Ca();return Au((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,Mr.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Mr.jsx)(Ra,{title:e.title,subtitle:rD(e),right:"Esc to exit"}),(0,Mr.jsx)(me,{marginBottom:1,children:(0,Mr.jsx)(Ae,{color:ve.muted,children:e.description})}),e.render()]})}var Tue=ie(Lt(),1),MVe={meta:{name:"tui:stories",description:"Open the terminal story runner for Ink TUI screens.",hidden:!0,skipAutoupdate:!0},args:{story:{type:"string",description:"Open a specific story id."},list:{type:"boolean",description:"Print story ids instead of opening the runner."}},async run({args:e}){if(e.list||!process.stdin.isTTY||!process.stdout.isTTY){jzt();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=DVe(e.story.trim());if(!n){console.error(`Unknown TUI story: ${e.story}`),console.error("Run `lore tui:stories --list` to see available ids."),process.exitCode=1;return}await qc((0,Tue.jsx)(wVe,{story:n})).waitUntilExit();return}await qc((0,Tue.jsx)(NVe,{})).waitUntilExit()}};function jzt(){for(let e of pm)console.log(`${e.id} ${rD(e)} ${e.title}`)}A();wr();vE();A();await so();var WH=ie(rn(),1);await CT();var Cue=ie(Lt(),1);function zzt({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,a]=(0,WH.useState)(VM),{exit:c}=Ca();return(0,WH.useEffect)(()=>{let d=!1,m=h=>{d||a(S=>ZH(S,h))};return(async()=>{try{let h=await n(m);if(d)return;r(h),setTimeout(()=>c(),100)}catch(h){if(m({kind:"error",message:h instanceof Error?h.message:String(h)}),d)return;o(h),setTimeout(()=>c(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{d=!0}},[]),(0,Cue.jsx)(Xg,{title:e,subtitle:t,state:i})}async function oD(e){let t,n,r=!1;if(await qc((0,Cue.jsx)(zzt,{title:e.title,subtitle:e.subtitle,perform:e.perform,onResolve:i=>{t=i,r=!0},onReject:i=>{n=i}})).waitUntilExit(),!r)throw n instanceof Error?n:new Error(String(n??"share flow failed"));return t}A();tR();Zo();import Kzt from"node:os";import UVe from"node:path";A();import{spawn as Hzt}from"node:child_process";import $zt from"node:os";async function kVe(e,t={}){let n=t.timeoutMs??2e3,r=Vzt();for(let o of r)if(await qzt(o,e,n))return!0;return!1}function Vzt(){switch($zt.platform()){case"darwin":return[{name:"pbcopy",args:[]}];case"linux":return[{name:"wl-copy",args:[]},{name:"xclip",args:["-selection","clipboard"]},{name:"xsel",args:["--clipboard","--input"]}];case"win32":return[{name:"clip.exe",args:[]}];default:return[]}}async function qzt(e,t,n){return new Promise(r=>{let o;try{o=Hzt(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,a=d=>{i||(i=!0,r(d))},c=setTimeout(()=>{o.kill("SIGKILL"),a(!1)},n);o.on("error",()=>{clearTimeout(c),a(!1)}),o.on("close",d=>{clearTimeout(c),a(d===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}_r();wr();PM();BM();Vx();fT();dH();UE();A();var iD=()=>{};A();wr();DT();async function Yzt(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw cp(`resolve share highlight for thread ${t}`,r.status,r.body);return{url:r.body.url,matched:r.body.matched,start_block_id:r.body.start_block_id,end_block_id:r.body.end_block_id}}async function XH(e,t,n){try{return await Yzt(e,t,n)}catch(r){return _e.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}A();_r();DT();function PVe(e){if(e instanceof YR)return"billing_required";if(e instanceof UM)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof ut)return"validation_failed";if(e instanceof Error){let t=e.message.toLowerCase();if(t.includes("not logged in")||t.includes("unauthorized")||t.includes("unauthenticated")||t.includes("authentication failed")||t.includes("authentication required")||t.includes("auth required")||t.includes("bearer token"))return"auth_failed";if(t.includes("timed out waiting for thread")&&t.includes("parsing")||t.includes("parse timeout"))return"parsing_timeout";if(t.includes("parsing failed permanently"))return"parsing_failed";if(t.includes("econnrefused")||t.includes("econnreset")||t.includes("etimedout")||t.includes("enotfound")||t.includes("network"))return"network_failed"}return"unknown"}DT();var Jzt=new Set(["private","workspace","public"]);function Zzt(e){let t=(e??"").trim();if(!t)return"";if(!Jzt.has(t))throw new ut(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function Iue(e={}){let t=e.progress??iD,n=Zzt(e.visibility),r=(e.project??process.cwd()).trim()||process.cwd(),o=(e.sessionId??"").trim(),i="resolving_session",a=null;try{t({kind:"step",step:"resolving_session"});let c=await q$e({sessionId:o,project:r});i="auth",await nHt();let d=e.client??cn();i="collecting_local_file",a=await Wzt(c),t({kind:"step",step:"uploading",label:a.filename}),i="uploading";let{reused:m,file:h}=await Xzt(d,a);_e.info("export_upload_single_file_result",{filename:a.filename,reused:m,response:JSON.stringify(h)});let S=h.thread?.id?.trim();if(!S)throw Yn().setContext("upload_single_file_response",{filename:a.filename,reused:m,response:h}),new Error(`upload session response missing thread id for ${a.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await Zx(d,S);let y=h.thread?.visibility?.trim()??"",I=y;n&&n!==y&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),I=await eHt(d,S,n)),(I==="workspace"||I==="public")&&await $x(d);let v=tHt(S),x,N=e.highlight?.trim();if(N){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let Q=await XH(d,S,N);Q&&(v=Q.url,x={query:N,matched:Q.matched,start_block_id:Q.start_block_id,end_block_id:Q.end_block_id})}let M=await kVe(v);return t({kind:"completed",url:v,reused:m,visibility:I,clipboardCopied:M,sessionId:c.sessionId?.trim()??""}),t({kind:"step",step:"done"}),$E("lore.cli.thread_exported",{thread_id:S,harness:a.harness,visibility:I,reused:m}),{thread_id:S,url:v,session_id:c.sessionId?.trim()??"",project:c.project,reused:m,visibility:I,clipboard_copied:M,...x?{highlight:x}:{}}}catch(c){throw $E("lore.cli.upload_failed",{error_category:PVe(c),error_message:Oi(c),step:i}),c}finally{a&&await xx(a.tempPath)}}async function Wzt(e){let t=await Y$e(e),n=await Ia(t.fullPath);if(!n.exists)throw new ut(`session transcript not found at ${rHt(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await ip(e.project),o=await Sf(t.fullPath);return{key:t.key,filename:t.relativeFilename,sourcePath:t.fullPath,repoOriginPath:r,tempPath:o.tempPath,md5:o.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:e.sessionId?.trim()??"",watchedState:n}}async function Xzt(e,t){let n=await Yx(e,[t]);if(n.thread_files.length!==1)throw new Error(`upload session returned ${n.thread_files.length} files for 1 local file`);let r=n.thread_files[0];if(!r)throw new Error("upload session response missing thread file");if(!r.presigned_url?.trim()){if(!r.thread?.id?.trim()){let a=r.error?.trim()?`: ${r.error.trim()}`:"";throw new ut(`upload session for ${t.filename} returned no upload URL and no reusable thread${a}`)}return{reused:!0,file:r}}await Kx(r.presigned_url,t.tempPath);let o=await Jx(e,n.id,[r]);if(o.thread_files.length!==1)throw new Error(`complete upload session returned ${o.thread_files.length} files for 1 local file`);let i=o.thread_files[0];if(!i?.thread?.id)throw new Error(`complete upload session response missing thread for ${t.filename}`);return{reused:!1,file:{...r,thread:i.thread}}}async function eHt(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw cp(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function tHt(e){return`${qE().replace(/\/+$/,"")}/thread/${e}`}async function nHt(){let e=await hr();if(!e)throw new ut("not logged in \u2014 run 'lore login' first");return e}function rHt(e){let t=Kzt.homedir();if(!t)return e;let n=UVe.relative(t,e);return!n||n.startsWith("..")?e:UVe.join("~",n)}var LVe={meta:{name:"export",description:"Upload a single Claude Code session to Lore and print its URL"},args:{"session-id":{type:"string",description:"Claude Code session ID to export. Defaults to the most recent session for $PWD."},project:{type:"string",description:"Project path used to resolve a session when --session-id is not provided. Defaults to the current working directory."},visibility:{type:"string",description:"Set thread visibility: private, workspace, or public. Defaults to leaving the existing visibility untouched."},highlight:{type:"string",description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e,data:t}){_e.info("command_start",{command:"export"});let n={sessionId:typeof e["session-id"]=="string"?e["session-id"]:void 0,project:typeof e.project=="string"?e.project:void 0,visibility:typeof e.visibility=="string"?e.visibility:void 0,highlight:typeof e.highlight=="string"?e.highlight:void 0,client:t?.client};if(pu()&&!t?.progress){await oD({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:o=>Iue({...n,progress:o})});return}let r=await Iue({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};A();A();Ky();Zo();Ll();_r();wr();Qx();var oHt=5,iHt=1e3;async function QVe(e={}){(e.environment??ta())!=="dev"||!await aHt({fetchFn:e.fetchFn})||await sHt({client:e.client})}async function aHt(e={}){if(_w().token)return!0;let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return _e.warn("dev_preflight_no_email",{hint:"set LORE_DEV_CLI_USER_EMAIL in .env.local (run `pnpm bootstrap`) to auto-authenticate the dev uploader"}),!1;let n=e.fetchFn??globalThis.fetch,r=e.attempts??oHt,o=e.retryDelayMs??iHt,i=`${qR()}/api/cli-auth/dev-token`;for(let a=1;a<=r;a+=1)try{let c=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(c.status===404)return _e.warn("dev_preflight_endpoint_absent",{url:i}),!1;if(!c.ok){let m=await uHt(c);return _e.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:m}),!1}let d=await c.json();return d.access_token?($R(d.access_token),_e.info("dev_preflight_token_minted",{email:t,expiresIn:d.expires_in}),!0):(_e.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(c){if(a===r)return _e.warn("dev_preflight_token_unreachable",{url:i,error:Oi(c)}),!1;await cHt(o)}return!1}async function sHt(e={}){let t=await Vc();if(fH(t))return;let n=process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd(),r=e.client??cn(),o;try{let i=await r.whoAmI({headers:{}});if(i.status!==200){_e.warn("dev_preflight_whoami_failed",{status:i.status});return}let a=i.body.organizationId?.trim(),c=i.body.org_name?.trim();if(a&&c)o={id:a,name:c};else{let d=i.body.organizations[0];if(!d){_e.warn("dev_preflight_no_workspace",{});return}o={id:d.id,name:d.name}}}catch(i){_e.warn("dev_preflight_whoami_error",{error:Oi(i)});return}t=vM(t,{path:n,organizationId:o.id,organizationName:o.name}),await Lx(t),_e.info("dev_preflight_upload_dir_seeded",{path:n,workspace:o.name})}async function uHt(e){try{let t=await e.json(),n=t.message??t.error;return typeof n=="string"?n:`HTTP ${e.status}`}catch{return`HTTP ${e.status}`}}function cHt(e){return new Promise(t=>{setTimeout(t,e).unref?.()})}QM();A();_r();wr();QM();import FVe from"node:fs";import{watch as lHt}from"node:fs/promises";import GVe from"node:path";import{setTimeout as bue}from"node:timers/promises";var dHt=2e3,pHt=3e4;function fHt(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??LM).map(n=>n.historyFilePath())}async function jVe(e={}){let t=e.debounceMs??dHt,n=e.pollIntervalMs??pHt,r=fHt(e),o=e.runUploadFn??MH,i=e.signal?void 0:new AbortController,a=e.signal??i.signal,c=()=>i?.abort();i&&(process.once("SIGINT",c),process.once("SIGTERM",c));let d=!1,m=!1,h=async x=>{if(d){m=!0;return}d=!0;try{do{if(m=!1,a.aborted)break;try{let N=await o(e.uploadOptions);_e.info("watch_sync_complete",{reason:x,uploaded:N.length})}catch(N){_e.error("watch_sync_failed",{reason:x,error:Oi(N)})}}while(m&&!a.aborted)}finally{d=!1}},S,y=x=>{S&&clearTimeout(S),S=setTimeout(()=>{S=void 0,h(x)},t),S.unref?.()};_e.info("watch_start",{watchPaths:r,debounceMs:t,pollIntervalMs:n}),h("startup");let I=async x=>{for(;!a.aborted;)try{let N=FVe.existsSync(x)&&FVe.statSync(x).isDirectory(),M=N?x:GVe.dirname(x),Q=N?void 0:GVe.basename(x);for await(let j of lHt(M,{signal:a,recursive:N})){if(a.aborted)break;(Q===void 0||!j.filename||j.filename===Q)&&y("fs-event")}}catch(N){if(a.aborted||N?.name==="AbortError")break;_e.warn("watch_fs_retry",{path:x,error:Oi(N)}),await bue(n,void 0,{signal:a}).catch(()=>{})}},v=async()=>{for(;!a.aborted;){try{await bue(n,void 0,{signal:a})}catch{break}if(a.aborted)break;h("poll")}};try{await Promise.all([...r.map(I),v()])}finally{for(S&&clearTimeout(S),i&&(process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c));d;)await bue(50).catch(()=>{});_e.info("watch_stop",{})}}var zVe={meta:{name:"_run_upload",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously: watch the Claude history file and re-sync on every change. This is the launchd-free daemon `pnpm dev` runs locally.",default:!1}},async run({args:e,data:t}){let n={client:t?.client,...t?.adapters!==void 0?{adapters:t.adapters}:t?.adapter!==void 0?{adapter:t.adapter}:{},recorder:t?.recorder};if(e.watch){await QVe(),await jVe({uploadOptions:n});return}let r=await MH(n);console.log(JSON.stringify(r))}};A();Zo();Vx();vE();A();Zo();PM();Vx();fT();QM();import{spawn as AHt}from"node:child_process";import HVe from"node:path";DT();async function vue(e){let t=e.progress??iD;if(!await hr())throw new Wx;t({kind:"step",step:"resolving_session"});let r=HVe.resolve(e.sessionFile),o=HVe.basename(r),i=e.harnessInternalId?.trim()||EHt(o)||o,a=await Ia(r);if(!a.exists)throw new Error(`session file does not exist: ${r}`);let c=await Sf(r),d={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:c.tempPath,md5:c.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:a},m=e.client??cn();try{t({kind:"step",step:"uploading",label:o});let h=await Yx(m,[d]),S=h.thread_files[0];if(!S)throw new Error("create upload session returned no thread files");let y=S.thread,I=!S.presigned_url?.trim()&&!!y?.id,v=y;if(!I){if(!S.presigned_url?.trim()){let be=S.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${be}`)}await Kx(S.presigned_url,c.tempPath),v=(await mHt(m,h.id,S)).thread}let x=v?.id?.trim();if(!x)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await Zx(m,x);let N=v?.visibility?.trim()??"",M=N,Q=e.visibility;Q&&Q!==N&&(t({kind:"step",step:"updating_visibility"}),M=await gHt(m,x,Q)),(M==="workspace"||M==="public")&&await $x(m);let j=`${qE().replace(/\/+$/,"")}/thread/${x}`,G,q=e.highlight?.trim();if(q){t({kind:"step",step:"resolving_highlight"});let ye=await XH(m,x,q);ye&&(j=ye.url,G={query:q,matched:ye.matched,start_block_id:ye.start_block_id,end_block_id:ye.end_block_id})}let oe=await SHt(j),ge=_Ht(M)?M:"private";return t({kind:"completed",url:j,reused:I,visibility:ge,clipboardCopied:oe,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:x,url:j,session_id:i,project:"",reused:I,visibility:ge,clipboard_copied:oe,...G?{highlight:G}:{}}}finally{await xx(c.tempPath)}}async function mHt(e,t,n){let o=(await Jx(e,t,[n])).thread_files[0];if(!o)throw new Error("complete upload session returned no thread files");return{thread:o.thread}}async function gHt(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw cp(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var hHt=new Set(["private","workspace","public"]);function _Ht(e){return hHt.has(e)}function EHt(e){let n=e.replace(/\.jsonl$/i,"").split("-").filter(o=>o.length>0);if(n.length===0)return"";let r=n.slice(-5);return r.length===5&&r.every(o=>/^[0-9a-fA-F]+$/.test(o))?r.join("-"):n[n.length-1]??""}async function SHt(e){let t=process.platform==="darwin"?[{command:"pbcopy",args:[]}]:process.platform==="win32"?[{command:"clip.exe",args:[]}]:[{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];for(let{command:n,args:r}of t)if(await yHt(n,r,e))return!0;return!1}function yHt(e,t,n){return new Promise(r=>{let o;try{o=AHt(e,t,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}o.on("error",()=>r(!1)),o.on("exit",i=>r(i===0)),o.stdin?.on("error",()=>r(!1)),o.stdin?.end(n)})}var $Ve=["private","workspace","public"],VVe={meta:{name:"share-codex",description:"Upload a Codex session rollout (.jsonl) to Lore and print a shareable URL."},args:{"session-file":{type:"string",required:!0,description:"Absolute path to a Codex rollout file (e.g. ~/.codex/sessions/YYYY/MM/DD/rollout-...jsonl)"},visibility:{type:"string",required:!1,description:"After upload, set thread visibility to one of: private, workspace, public"},"include-skills":{type:"boolean",required:!1,description:"Also sync your locally installed SKILL.md files to Lore (captured, not published) so teammates can install them"},highlight:{type:"string",required:!1,description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e}){let t=e["session-file"];if(typeof t!="string"||t.trim()==="")throw new Error("--session-file is required");let n=THt(e.visibility);if(pu())await oD({title:"lore share-codex",subtitle:"sharing this Codex session",perform:r=>vue({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:r})});else{let r=await vue({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0});console.log(JSON.stringify(r))}if(e["include-skills"]){let r=await Yse(cn());console.error(`synced ${r.pushed.length} skill(s) to Lore${r.skipped.length>0?`; skipped ${r.skipped.length}`:""}`)}}};function THt(e){if(!(e==null||e==="")){if(typeof e!="string")throw new Error("--visibility must be a string");if(!$Ve.includes(e))throw new Error(`--visibility must be one of: ${$Ve.join(", ")}`);return e}}A();Zo();wr();PM();vE();Zse();Wse();A();import CHt from"node:crypto";DT();var IHt=async(e,t)=>{let n={method:"PUT",body:typeof t=="string"?t:new Uint8Array(t)};return{status:(await fetch(e,n)).status}};async function Rue(e,t,n={}){let r=n.progress??iD,{contents:o,accountId:i,orgId:a,sessionId:c}=t,d=CHt.createHash("md5").update(o.transcript).digest("hex");r({kind:"step",step:"resolving_session",label:c});let m=await e.createUploadSession({headers:{},body:{thread_files:[{md5:d,harness:"cowork",harness_internal_id:c,filename:"audit.jsonl",file_type:"transcript",artifact_metadata:{uploads:o.uploads,outputs:o.outputs}}]}});if(m.status!==201)throw cp("createUploadSession",m.status,m.body);let h=m.body.thread_files[0];if(h.error&&h.thread)return{threadId:h.thread.id,duplicate:!0};if(!h.presigned_url)throw new Error(`createUploadSession returned no presigned_url and no existing thread: ${JSON.stringify(h)}`);r({kind:"step",step:"uploading"});let y=await(n.putBlob??IHt)(h.presigned_url,Buffer.from(o.transcript,"utf8"));if(y.status<200||y.status>=300)throw new Error(`presigned PUT failed: HTTP ${y.status}`);let I=await e.completeUploadSession({headers:{},params:{id:m.body.id},body:{thread_files:[{storage_url:h.storage_url}]}});if(I.status!==200)throw cp("completeUploadSession",I.status,I.body);let v=I.body.thread_files[0];if(!v?.thread)throw new Error(`completeUploadSession returned no thread: ${JSON.stringify(v)}`);return{threadId:v.thread.id,duplicate:!1}}var qVe={meta:{name:"share-cowork",description:"Share a Claude Cowork local-agent-mode session to Lore. Defaults to the current session when run from inside one (e.g. by the Cowork agent itself); otherwise shares the most recent local session."},args:{session:{type:"string",description:"Share a specific session by session-id (the bottom-level uuid)"},list:{type:"boolean",description:"List local Cowork sessions (newest first) and exit without sharing"}},async run({args:e,data:t}){_e.info("command_start",{command:"share-cowork",list:!!e.list,session:e.session??null});let n=OH();if(e.list){let m=qx(n);if(m.length===0){console.error(`No Cowork sessions found under ${n}`);return}for(let h of m)console.log(vHt(h));return}let r=bHt(n,typeof e.session=="string"?e.session:void 0);if(!r)throw console.error(`No Cowork session found. Tried CWD walk-up and the most recent under
|
|
509
|
+
`),o=Math.max(n.length,r.length);for(let i=0;i<o;i+=1){let a=n[i],c=r[i];if(a===c){console.log(` ${a}`);continue}a!==void 0&&console.log(`- ${a}`),c!==void 0&&console.log(`+ ${c}`)}}async function _zt(e){let t=mzt({input:process.stdin,output:process.stdout});try{let n=(await t.question(`${e}[y/N] `)).trim().toLowerCase();return n==="y"||n==="yes"}finally{t.close()}}A();Zo();_r();var uVe={meta:{name:"list",description:"List skills available in your workspace."},async run(){if(!await hr())throw new ut("not logged in \u2014 run 'lore login' first");let t=await cn().listSkills({});if(t.status!==200){let n=t.body?.message??`listSkills returned ${t.status}`;throw new ut(n)}if(t.body.objects.length===0){console.log("no skills in this workspace yet");return}for(let n of t.body.objects){let r=n.source?` [${n.source}]`:"",o=n.description?` \u2014 ${n.description}`:"";console.log(`/${n.name}${r}${o}`)}}};A();Zo();_r();BH();var cVe={meta:{name:"publish",description:"Push a local SKILL.md to Lore so it can be downloaded and installed by your team. Pass --all to publish every skill in ~/.claude/skills/."},args:{name:{type:"positional",required:!1,description:"Skill directory name under ~/.claude/skills/<name>/SKILL.md or ./.claude/skills/<name>/SKILL.md"},all:{type:"boolean",required:!1,description:"Publish every locally installed skill in one go"}},async run({args:e}){if(!await hr())throw new ut("not logged in \u2014 run 'lore login' first");let t=cn(),n=await Ezt(e);if(n.length===0)throw new ut("no skills to publish \u2014 pass a name like `lore skills publish feature` or `--all`");let r=0;for(let o of n){let i=await Hx(o);if(!i){console.error(`skip ${o}: no SKILL.md found locally`);continue}let a=await t.publishSkill({params:{name:o},body:{body_md:i.bodyMd,description:i.description,published:!0}});if(a.status!==200){let c=a.body?.message??`publishSkill returned ${a.status}`;throw new ut(`failed to publish ${o}: ${c}`)}r+=1,console.log(`published /${o} (v${a.body.latest_version}, ${a.body.source}) from ${i.filePath}`)}if(r===0)throw new ut("no skills were published \u2014 check the names and try again")}};async function Ezt(e){if(e.all)return DH();let t=typeof e.name=="string"?e.name.trim():"";return t?[t]:[]}var lVe={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:cVe,install:sVe,list:uVe}};A();A();Zo();_r();var dVe={meta:{name:"channels",description:"List Slack channels the bot can see for your workspace."},async run(){if(!await hr())throw new ut("not logged in \u2014 run 'lore login' first");let t=await cn().slack.listSlackChannels();if(t.status===200){for(let r of t.body.channels){let o=r.is_private?"(private)":"";console.log(`#${r.name} ${o}`.trim())}t.body.channels.length===0&&console.log("No channels found. Make sure the Lore bot is invited to at least one channel.");return}if(t.status===404)throw new ut("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let n=t.body?.message??`unexpected status ${t.status}`;throw new ut(n)}};A();Zo();_r();var pVe={meta:{name:"post",description:"Post a Lore thread link to a Slack channel."},args:{channel:{type:"positional",required:!0,description:"Slack channel name (with or without #)"},"thread-id":{type:"string",required:!0,description:"The Lore thread ID to post (e.g. th_...)"}},async run({args:e}){if(!await hr())throw new ut("not logged in \u2014 run 'lore login' first");let t=(typeof e.channel=="string"?e.channel:"").replace(/^#/,""),n=e["thread-id"];if(!t)throw new ut("channel name is required \u2014 e.g. `lore slack post general --thread-id th_...`");if(!n)throw new ut("--thread-id is required \u2014 e.g. `lore slack post general --thread-id th_...`");let o=await cn().slack.postToSlack({body:{channel_name:t,thread_id:n}});if(o.status===200){console.log(JSON.stringify({ok:!0,channel:t,ts:o.body.ts}));return}if(o.status===404)throw new ut("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let i=o.body?.message??`unexpected status ${o.status}`;throw new ut(i)}};var fVe={meta:{name:"slack",description:"Slack integration commands."},subCommands:{channels:dVe,post:pVe}};vE();A();await so();var JH=ie(rn(),1);Ll();await CT();A();await so();var qH=ie(rn(),1);await am();A();await so();var Xx=ie(rn(),1);va();var Yl=ie(Lt(),1);function eD({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[a,c]=(0,Xx.useState)(AVe(e,n)),d=(0,Xx.useRef)(a);return(0,Xx.useEffect)(()=>{let m=AVe(e,n);d.current=m,c(m)},[e,n]),Au((m,h)=>{if(e.length!==0){if(h.upArrow||m==="k"){let S=Szt(e,d.current);d.current=S,c(S);return}if(h.downArrow||m==="j"){let S=mVe(e,d.current);d.current=S,c(S);return}if(h.return||m===" "){let S=e[d.current];S&&!S.disabled&&t(S)}}},{isActive:!r}),e.length===0?(0,Yl.jsx)(Ae,{color:ve.muted,children:"no actions available"}):(0,Yl.jsxs)(me,{flexDirection:"column",children:[e.map((m,h)=>{let S=h===a,y=m.disabled?ve.muted:S?ve.primary:ve.highlight;return(0,Yl.jsxs)(me,{children:[(0,Yl.jsx)(me,{width:2,flexShrink:0,children:(0,Yl.jsx)(Ae,{color:S?ve.primary:ve.muted,children:S?"\u203A":" "})}),(0,Yl.jsx)(me,{width:i,flexShrink:0,children:(0,Yl.jsx)(Ae,{color:y,bold:S&&!m.disabled,children:m.label})}),m.description?(0,Yl.jsx)(me,{flexGrow:1,flexShrink:1,children:(0,Yl.jsx)(Ae,{color:ve.muted,children:m.description})}):null]},m.id)}),o?(0,Yl.jsx)(me,{marginTop:1,children:(0,Yl.jsx)(Ae,{color:ve.muted,children:o})}):null]})}function AVe(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?mVe(e,n-1):n}function mVe(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r]?.disabled)return r}return t}function Szt(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r]?.disabled)return r}return t}await sm();await vT();await RT();va();A();Zo();FM();Qx();async function zH(e){if(!await(e.hasAccessToken??(async()=>!!await hr()))())return{state:"logged_out"};let n=e.client??cn();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:gVe(r.body,`whoAmI returned ${r.status}`)}:{state:"ready",userId:r.body.user.id,email:r.body.emailAddress,displayName:r.body.user.display_name,organizations:r.body.organizations,activeOrganizationId:r.body.organizationId,activeOrganizationName:r.body.org_name}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function HH(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??UH;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function $H(e){if(!await(e.hasAccessToken??(async()=>!!await hr()))())return{state:"logged_out"};let n=e.client??cn();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:gVe(r.body,`listSkills returned ${r.status}`)};let o=r.body.objects.length,i=r.body.objects.filter(a=>(a.source??"").trim()==="lore").length;return{state:"ready",count:o,published:i}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function VH(){try{return{state:"ready",directories:(await Vc()).directories}}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function gVe(e,t){if(e&&typeof e=="object"&&"message"in e){let n=e.message;if(typeof n=="string"&&n.length>0)return n}return t}var Ot=ie(Lt(),1);function KE({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=Ca(),[i,a]=(0,qH.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,qH.useEffect)(()=>{if(t)return;let d=!1;return(async()=>{let[m,h,S,y]=await Promise.all([zH(n),HH(n),$H(n),VH()]);d||a({identity:m,daemon:h,skills:S,uploadDirs:y})})(),()=>{d=!0}},[]),Au((d,m)=>{(d==="q"||m.ctrl&&d==="c"||m.escape)&&(r("quit"),o())});let c=vzt(i);return(0,Ot.jsxs)(me,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,Ot.jsx)(Ra,{title:"lore",subtitle:Tzt(i.identity),right:`v${e}`}),(0,Ot.jsxs)(me,{flexDirection:"row",gap:2,children:[(0,Ot.jsx)(me,{flexDirection:"column",width:"50%",children:(0,Ot.jsx)(kn,{title:"Daemon",children:(0,Ot.jsx)(Czt,{daemon:i.daemon})})}),(0,Ot.jsx)(me,{flexDirection:"column",width:"50%",children:(0,Ot.jsx)(kn,{title:"Workspace",children:(0,Ot.jsx)(Izt,{identity:i.identity,skills:i.skills})})})]}),(0,Ot.jsx)(me,{marginTop:1,children:(0,Ot.jsx)(kn,{title:"Upload directories",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.directories.length} configured`:void 0,children:(0,Ot.jsx)(yzt,{uploadDirs:i.uploadDirs})})}),(0,Ot.jsx)(me,{marginTop:1,children:(0,Ot.jsx)(kn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Ot.jsx)(eD,{items:c,onSelect:d=>{r(d.id),o()}})})})]})}function yzt({uploadDirs:e}){return e.state==="loading"?(0,Ot.jsx)(ws,{label:"reading ~/.lore/upload_dirs.json\u2026"}):e.state==="error"?(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"error",kind:"error"}),(0,Ot.jsx)(Ae,{color:ve.danger,children:e.message})]}):e.directories.length===0?(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,Ot.jsx)(me,{marginTop:1,children:(0,Ot.jsxs)(Ae,{color:ve.muted,children:["Run ",(0,Ot.jsx)(Ae,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,Ot.jsx)(me,{flexDirection:"column",children:e.directories.map(t=>(0,Ot.jsx)(on,{label:t.organizationName??"personal",value:t.path,kind:"success",labelWidth:16},t.path))})}function Tzt(e){switch(e.state){case"ready":{let t=e.activeOrganizationName??"";return t?`${e.email} \xB7 ${t}`:e.email}case"logged_out":return"not signed in";case"loading":return"loading\u2026";case"error":return"identity error"}}function Czt({daemon:e}){if(e.state==="loading")return(0,Ot.jsx)(ws,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(Ae,{color:ve.muted,children:"Background uploads are macOS-only today."}),(0,Ot.jsxs)(Ae,{color:ve.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"error",kind:"error"}),(0,Ot.jsx)(Ae,{color:ve.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:t.health,kind:n}),(0,Ot.jsx)(on,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,Ot.jsx)(on,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,Ot.jsx)(on,{label:"Heartbeat",value:hVe(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,Ot.jsx)(on,{label:"Last upload",value:hVe(t.status?.last_success_at)}),t.status?.last_error?(0,Ot.jsx)(on,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function Izt({identity:e,skills:t}){return e.state==="loading"?(0,Ot.jsx)(ws,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"signed out",kind:"warning"}),(0,Ot.jsx)(Ae,{color:ve.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"Status",value:"error",kind:"error"}),(0,Ot.jsx)(Ae,{color:ve.danger,children:e.message})]}):(0,Ot.jsxs)(me,{flexDirection:"column",children:[(0,Ot.jsx)(on,{label:"User",value:e.email,kind:"success"}),(0,Ot.jsx)(on,{label:"Display name",value:e.displayName}),(0,Ot.jsx)(on,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,Ot.jsx)(on,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,Ot.jsx)(on,{label:"Skills",value:bzt(t)})]})}function bzt(e){return e.state==="loading"?"loading\u2026":e.state==="logged_out"?"\u2014":e.state==="error"?`error (${e.message})`:`${e.count} installed \xB7 ${e.published} published`}function vzt(e){let t=e.identity.state==="ready",n=e.daemon.state==="ready"&&e.daemon.report.enabled,r=e.daemon.state!=="unsupported",o=[];return t&&(o.push({id:"share-codex",label:"Share Codex",description:"lore share-codex --session-file <path>"}),o.push({id:"share-cowork",label:"Share Cowork",description:"lore share-cowork"}),o.push({id:"export",label:"Export Claude",description:"lore export"})),r&&(n?(o.push({id:"status",label:"Daemon status",description:"lore status"}),o.push({id:"restart",label:"Restart daemon",description:"lore restart"}),o.push({id:"disable",label:"Disable daemon",description:"lore disable"})):o.push({id:"enable",label:"Enable daemon",description:"lore enable"})),t?(o.push({id:"configure",label:"Configure uploads",description:"lore configure"}),o.push({id:"listen-list",label:"Manage upload dirs",description:"lore listen list"}),o.push({id:"skills-list",label:"Skills",description:"lore skills list"}),o.push({id:"workspaces-list",label:"Workspaces",description:"lore workspaces list"}),o.push({id:"logout",label:"Sign out",description:"lore logout"})):o.push({id:"login",label:"Sign in",description:"lore login"}),o.push({id:"quit",label:"Quit",description:"exit the dashboard"}),o}function hVe(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}A();await so();await am();await sm();va();var Wo=ie(Lt(),1),Rzt=[{id:"login",label:"Sign in with WorkOS",description:"opens your browser for a device-code flow"},{id:"quit",label:"Quit",description:"exit without signing in"}];function YH({cliVersion:e,onSelect:t}){let{exit:n}=Ca();return Au((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,Wo.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Wo.jsx)(Ra,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,Wo.jsx)(kn,{title:"What is Lore?",children:(0,Wo.jsxs)(me,{flexDirection:"column",children:[(0,Wo.jsx)(Ae,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,Wo.jsxs)(me,{marginTop:1,flexDirection:"column",children:[(0,Wo.jsx)(Ae,{color:ve.muted,children:"You'll get:"}),(0,Wo.jsxs)(Ae,{children:[(0,Wo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,Wo.jsxs)(Ae,{children:[(0,Wo.jsx)(Ae,{color:ve.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,Wo.jsxs)(Ae,{children:[(0,Wo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,Wo.jsxs)(Ae,{children:[(0,Wo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,Wo.jsx)(me,{marginTop:1,children:(0,Wo.jsx)(kn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Wo.jsx)(eD,{items:Rzt,onSelect:r=>{t(r.id),n()}})})}),(0,Wo.jsx)(me,{marginTop:1,children:(0,Wo.jsxs)(Ae,{color:ve.muted,children:["New to Lore? Run ",(0,Wo.jsx)(Ae,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var KH=ie(Lt(),1),xzt={login:["login"],logout:["logout"],enable:["enable"],disable:["disable"],status:["status"],restart:["restart"],"share-codex":["share-codex"],"share-cowork":["share-cowork"],export:["export"],"workspaces-list":["workspaces","list"],"skills-list":["skills","list"],"listen-list":["listen","list"],configure:["configure"],quit:[]};function Dzt({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,JH.useState)(void 0),{exit:i}=Ca();return(0,JH.useEffect)(()=>{let a=!1;return(async()=>{let[c,d,m,h]=await Promise.all([zH(t),HH(t),$H(t),VH()]);a||o({identity:c,daemon:d,skills:m,uploadDirs:h})})(),()=>{a=!0}},[]),r?r.identity.state==="logged_out"?(0,KH.jsx)(YH,{cliVersion:e,onSelect:a=>{n(a),i()}}):(0,KH.jsx)(KE,{cliVersion:e,initialData:r,onSelect:n}):null}async function _Ve(){let e="quit";return await qc((0,KH.jsx)(Dzt,{cliVersion:qu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:xzt[e]}}A();await CT();A();await so();var ZM=ie(rn(),1);await am();await sm();va();A();await so();await bse();await am();await bT();await sm();await xse();A();await so();va();var tD=ie(Lt(),1),Bzt="\u2588",Nzt="\u2591";function EVe({value:e,width:t=24,label:n,color:r=ve.success}){let o=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=Math.round(o*t),a=Math.max(0,t-i);return(0,tD.jsxs)(me,{children:[(0,tD.jsx)(Ae,{color:r,children:Bzt.repeat(i)}),(0,tD.jsx)(Ae,{color:ve.muted,children:Nzt.repeat(a)}),n?(0,tD.jsxs)(Ae,{color:ve.muted,children:[" ",n]}):null]})}await vT();await RT();await vse();await Mse();await Use();A();await so();await am();await bT();await sm();await vT();va();var uo=ie(Lt(),1),yVe=[{key:"resolving_session",label:"Resolving session"},{key:"uploading",label:"Uploading transcript"},{key:"parsing",label:"Parsing on server"},{key:"updating_visibility",label:"Updating visibility"},{key:"resolving_highlight",label:"Resolving highlight"}];function VM(){return{steps:yVe.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function ZH(e,t){return t.kind==="completed"?{...e,result:{url:t.url,reused:t.reused,visibility:t.visibility,clipboardCopied:t.clipboardCopied,sessionId:t.sessionId}}:t.kind==="error"?{...e,errorMessage:t.message,steps:e.steps.map(n=>n.status==="active"?{...n,status:"pending"}:n)}:t.step==="done"||t.step==="errored"?{...e,steps:e.steps.map(n=>({...n,status:n.status==="active"?"done":n.status}))}:{...e,steps:e.steps.map(n=>n.key===t.step?{...n,status:"active",label:t.label?`${SVe(n.key)} (${t.label})`:SVe(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function SVe(e){return yVe.find(t=>t.key===e)?.label??e}function Xg({title:e,subtitle:t,state:n}){return(0,uo.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,uo.jsx)(Ra,{title:e,subtitle:t}),(0,uo.jsx)(kn,{title:"Pipeline",children:(0,uo.jsx)(me,{flexDirection:"column",children:n.steps.map(r=>(0,uo.jsx)(Ozt,{step:r},r.key))})}),n.result?(0,uo.jsx)(me,{marginTop:1,flexDirection:"column",children:(0,uo.jsx)(xa,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,uo.jsxs)(me,{flexDirection:"column",children:[(0,uo.jsx)(Ae,{children:n.result.url}),(0,uo.jsx)(me,{marginTop:1,children:(0,uo.jsxs)(Ae,{color:ve.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,uo.jsx)(me,{marginTop:1,children:(0,uo.jsx)(xa,{kind:"error",title:"Failed",children:(0,uo.jsx)(Ae,{children:n.errorMessage})})}):null]})}function Ozt({step:e}){return e.status==="active"?(0,uo.jsxs)(me,{children:[(0,uo.jsx)(ws,{}),(0,uo.jsx)(Ae,{children:" "}),(0,uo.jsx)(Ae,{color:ve.primary,children:e.label})]}):e.status==="done"?(0,uo.jsxs)(me,{children:[(0,uo.jsx)(Ae,{color:ve.success,children:"\u2713 "}),(0,uo.jsx)(Ae,{color:ve.muted,children:e.label})]}):(0,uo.jsxs)(me,{children:[(0,uo.jsx)(Ae,{color:ve.muted,children:"\u25CB "}),(0,uo.jsx)(Ae,{color:ve.muted,children:e.label})]})}va();A();var qM=Date.parse("2026-05-16T12:00:00.000Z");function YM(e){return new Date(qM-e*6e4).toISOString()}var vf={plist:"/Users/alex/Library/LaunchAgents/ai.tanagram.lore.plist",binary:"/Users/alex/.lore/bin/lore-background",logFile:"/Users/alex/.lore/log.txt",status:"/Users/alex/.lore/status.json",installSource:"/opt/homebrew/bin/lore"},TVe=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:qM-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:qM-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:qM-3*60*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:qM-26*60*6e4}],wzt=[{path:"/Users/alex/code/tanagram-lore",organizationId:"org_tanagram",organizationName:"Tanagram",addedAt:"2026-05-01T09:00:00.000Z"},{path:"/Users/alex/work/acme-integration",organizationId:"org_acme",organizationName:"Acme",addedAt:"2026-05-09T13:30:00.000Z"}],nD={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:vf.plist,binary_path:vf.binary,status_path:vf.status,install_source_path:vf.installSource,status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:YM(60),last_heartbeat_at:YM(1),last_success_at:YM(5),last_completed_at:YM(5),last_thread_ids:["thr_01hx_story"]}},CVe={...nD,running:!1,healthy:!1,health:"stale heartbeat",heartbeat_fresh:!1,status:{...nD.status,state:"error",last_heartbeat_at:YM(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},Mzt={...nD,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,status:void 0},kzt={state:"ready",userId:"user_alex",email:"alex@tanagram.ai",displayName:"Alex Rivera",organizations:[{id:"org_tanagram",name:"Tanagram"},{id:"org_acme",name:"Acme"}],activeOrganizationId:"org_tanagram",activeOrganizationName:"Tanagram"},KM={identity:kzt,daemon:{state:"ready",report:nD},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",directories:wzt}},IVe={...KM,uploadDirs:{state:"ready",directories:[]}},bVe={...KM,daemon:{state:"error",message:"launchctl print failed: service not found"}},vVe={...KM,daemon:{state:"unsupported",platform:"linux"}},RVe={identity:{state:"logged_out"},daemon:{state:"ready",report:Mzt},skills:{state:"logged_out"},uploadDirs:{state:"ready",directories:[]}},xVe=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var ht=ie(Lt(),1),Kr=()=>{};function JE(...e){return e.reduce(yH,DM())}function JM(...e){return e.reduce(ZH,VM())}var pm=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,ht.jsx)(YH,{cliVersion:"0.1.0",onSelect:Kr})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,ht.jsx)(up,{state:DM()})},{id:"onboarding/login/device-code",title:"Login / device code",path:["TUI","Screens","Onboarding","Login"],description:"User has a WorkOS code and browser URL.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"})})},{id:"onboarding/login/awaiting-authorization",title:"Login / awaiting authorization",path:["TUI","Screens","Onboarding","Login"],description:"Browser is open and polling is active.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"waiting_for_authorization"})})},{id:"onboarding/login/auto-enable",title:"Login / auto-enable in progress",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded and launchd install is running.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"})})},{id:"onboarding/login/success",title:"Login / success",path:["TUI","Screens","Onboarding","Login"],description:"Signed in and background uploads enabled.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_succeeded",plistPath:vf.plist,binaryPath:vf.binary,logFile:vf.logFile})})},{id:"onboarding/login/auto-enable-failed",title:"Login / auto-enable failed",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded but the daemon install needs a retry.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_failed"})})},{id:"onboarding/login/denied",title:"Login / denied",path:["TUI","Screens","Onboarding","Login"],description:"Terminal authorization failure state.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"authorization_denied"})})},{id:"onboarding/login/api-unreachable",title:"Login / API unreachable",path:["TUI","Screens","Onboarding","Login"],description:"Early failure before WorkOS device-code negotiation.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"login_failed",message:"Could not reach the Lore API at http://localhost:4000. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared."})})},{id:"onboarding/login/already-signed-in",title:"Login / already signed in",path:["TUI","Screens","Onboarding","Login"],description:"Short-circuit copy for authenticated callers.",render:()=>(0,ht.jsx)(up,{state:JE({kind:"already_logged_in"})})},{id:"onboarding/configure-upload-repos/loading",title:"Configure upload repos / loading",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Recent Claude Code cwd discovery is in flight.",render:()=>(0,ht.jsx)(lm,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/choose",title:"Configure upload repos / choose",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Suggested git remotes with defaults checked.",render:()=>(0,ht.jsx)(lm,{state:{phase:"choose",suggestions:TVe,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/empty",title:"Configure upload repos / empty",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"No recent sessions, with add-custom affordance.",render:()=>(0,ht.jsx)(lm,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/saved",title:"Configure upload repos / saved",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save for multiple repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/skipped",title:"Configure upload repos / skipped",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save with zero selected repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,ht.jsx)(lm,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:Kr,onSkip:Kr})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:KM,onSelect:Kr})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:IVe,onSelect:Kr})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:bVe,onSelect:Kr})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:vVe,onSelect:Kr})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,ht.jsx)(KE,{cliVersion:"0.1.0",initialData:RVe,onSelect:Kr})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,ht.jsx)(Xg,{title:"lore share-codex",subtitle:"sharing this Codex session",state:VM()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,ht.jsx)(Xg,{title:"lore share-codex",subtitle:"sharing this Codex session",state:JM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading",label:"42%"})})},{id:"sharing/parsing",title:"Share flow / parsing",path:["TUI","Screens","Sharing"],description:"Server-side parsing is active.",render:()=>(0,ht.jsx)(Xg,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:JM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing",label:"queued"})})},{id:"sharing/shared",title:"Share flow / shared",path:["TUI","Screens","Sharing"],description:"New share completed and copied to clipboard.",render:()=>(0,ht.jsx)(Xg,{title:"lore share-codex",state:JM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing"},{kind:"step",step:"updating_visibility"},{kind:"step",step:"done"},{kind:"completed",url:"https://lore.tanagram.ai/thread/thr_01hx_story",reused:!1,visibility:"workspace",clipboardCopied:!0,sessionId:"thr_01hx_story"})})},{id:"sharing/already-shared",title:"Share flow / already shared",path:["TUI","Screens","Sharing"],description:"Deduped upload converges to an existing Lore thread.",render:()=>(0,ht.jsx)(Xg,{title:"lore share-cowork",state:JM({kind:"completed",url:"https://lore.tanagram.ai/thread/thr_01hx_story",reused:!0,visibility:"private",clipboardCopied:!1})})},{id:"sharing/error",title:"Share flow / error",path:["TUI","Screens","Sharing"],description:"Pipeline error callout.",render:()=>(0,ht.jsx)(Xg,{title:"lore export",state:JM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"error",message:"presigned upload failed: HTTP 403"})})},{id:"daemon/run/enable-progress",title:"Daemon run / enable progress",path:["TUI","Screens","Daemon","Run"],description:"Enable command while launchd work is active.",render:()=>(0,ht.jsx)(YE,{mode:"enable",state:{phase:"in_progress"}})},{id:"daemon/run/enable-success",title:"Daemon run / enable success",path:["TUI","Screens","Daemon","Run"],description:"Enable success includes resolved paths.",render:()=>(0,ht.jsx)(YE,{mode:"enable",state:{phase:"finished",result:{plistPath:vf.plist,binaryPath:vf.binary,logFile:vf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,ht.jsx)(YE,{mode:"disable",state:{phase:"finished"}})},{id:"daemon/run/restart-success",title:"Daemon run / restart success",path:["TUI","Screens","Daemon","Run"],description:"Restart success copy.",render:()=>(0,ht.jsx)(YE,{mode:"restart",state:{phase:"finished"}})},{id:"daemon/run/error",title:"Daemon run / error",path:["TUI","Screens","Daemon","Run"],description:"Mode-independent daemon command error.",render:()=>(0,ht.jsx)(YE,{mode:"restart",state:{phase:"errored",errorMessage:"launchctl bootstrap failed"}})},{id:"daemon/status/healthy",title:"Daemon status / healthy",path:["TUI","Screens","Daemon","Status"],description:"Healthy daemon report.",render:()=>(0,ht.jsx)(GM,{report:nD})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,ht.jsx)(GM,{report:CVe})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,ht.jsx)(Ra,{title:"lore",subtitle:"component primitive",right:"v0.1.0"})},{id:"components/primitives/panel",title:"Components / panel",path:["TUI","Components","Primitives"],description:"Bordered container with title, subtitle, and focus styling.",render:()=>(0,ht.jsx)(kn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,ht.jsx)(Ae,{color:ve.muted,children:"Panels compose screen sections and callouts."})})},{id:"components/primitives/status-line",title:"Components / status line",path:["TUI","Components","Primitives"],description:"Key/value rows with severity dots.",render:()=>(0,ht.jsxs)(kn,{title:"StatusLine",children:[(0,ht.jsx)(on,{label:"Healthy",value:"yes",kind:"success"}),(0,ht.jsx)(on,{label:"Warning",value:"needs attention",kind:"warning"}),(0,ht.jsx)(on,{label:"Error",value:"launchctl failed",kind:"error"})]})},{id:"components/primitives/progress-bar",title:"Components / progress bar",path:["TUI","Components","Primitives"],description:"Plain unicode progress bar for deterministic terminal rendering.",render:()=>(0,ht.jsx)(kn,{title:"ProgressBar",children:(0,ht.jsx)(EVe,{value:.62,label:"62%"})})},{id:"components/primitives/message-box",title:"Components / message box",path:["TUI","Components","Primitives"],description:"Severity callout for success, info, warning, and error copy.",render:()=>(0,ht.jsxs)(me,{flexDirection:"column",children:[(0,ht.jsx)(xa,{kind:"success",title:"Shared",children:(0,ht.jsx)(Ae,{children:"Copied the Lore URL to your clipboard."})}),(0,ht.jsx)(me,{marginTop:1,children:(0,ht.jsx)(xa,{kind:"error",title:"Failed",children:(0,ht.jsx)(Ae,{color:ve.muted,children:"presigned upload failed: HTTP 403"})})})]})},{id:"components/primitives/spinner",title:"Components / spinner",path:["TUI","Components","Primitives"],description:"Unrefed animated spinner primitive.",render:()=>(0,ht.jsx)(kn,{title:"Spinner",children:(0,ht.jsx)(ws,{label:"working on a terminal-friendly task\u2026"})})},{id:"components/inputs/menu",title:"Components / menu",path:["TUI","Components","Inputs"],description:"Keyboard menu with enabled and disabled items.",render:()=>(0,ht.jsx)(kn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,ht.jsx)(eD,{items:[{id:"share",label:"Share",description:"upload a session"},{id:"status",label:"Status",description:"inspect daemon"},{id:"disabled",label:"Disabled",description:"not available in this state",disabled:!0}],onSelect:Kr})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,ht.jsx)(kn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,ht.jsx)(RM,{items:[{id:"repo",label:"/Users/alex/code/tanagram-lore",initialChecked:!0},{id:"demo",label:"/Users/alex/code/customer-demo"},{id:"add",label:"+ Add a custom path\u2026",action:!0}],onSubmit:Kr,onAction:Kr})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,ht.jsx)(kn,{title:"TextInput",children:(0,ht.jsx)(gH,{initialValue:"~/code",onSubmit:Kr,onCancel:Kr})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,ht.jsx)(kn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,ht.jsx)(hH,{initialValue:"/Users/alex/code",loadSuggestions:async()=>xVe,onSubmit:Kr,onCancel:Kr})})}];function DVe(e){return pm.find(t=>t.id===e)}function rD(e){return e.path.slice(1).join(" / ")}var Mr=ie(Lt(),1);function NVe({initialStoryId:e}){let t=Math.max(0,pm.findIndex(m=>m.id===e)),[n,r]=(0,ZM.useState)(t),[o,i]=(0,ZM.useState)("sidebar"),a=(0,ZM.useRef)(o);a.current=o;let{exit:c}=Ca();Au((m,h)=>{if(h.ctrl&&m==="c"){c();return}if(a.current==="sidebar"&&m==="q"){c();return}if(h.escape){if(a.current==="preview"){a.current="sidebar",i("sidebar");return}c();return}if(a.current==="preview"&&h.tab&&h.shift){a.current="sidebar",i("sidebar");return}if(a.current==="sidebar"&&h.tab&&!h.shift){a.current="preview",i("preview");return}if(a.current==="sidebar"){if(h.upArrow||m==="k"){r(S=>BVe(S-1));return}(h.downArrow||m==="j")&&r(S=>BVe(S+1))}});let d=pm[n]??pm[0];return(0,Mr.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Mr.jsx)(Ra,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${pm.length}`}),(0,Mr.jsx)(me,{marginBottom:1,children:(0,Mr.jsx)(Ae,{color:ve.muted,children:"\u2191/\u2193 or j/k select stories \xB7 Tab focuses preview \xB7 Shift+Tab/Esc returns \xB7 q exits from sidebar"})}),(0,Mr.jsxs)(me,{flexDirection:"row",gap:2,children:[(0,Mr.jsx)(me,{width:36,flexShrink:0,children:(0,Mr.jsx)(kn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,Mr.jsx)(Pzt,{stories:pm,selectedIndex:n,focused:o==="sidebar"})})}),(0,Mr.jsx)(me,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,Mr.jsx)(kn,{title:d.title,focused:o==="preview",subtitle:o==="preview"?`${rD(d)} \xB7 focused`:rD(d),children:(0,Mr.jsxs)(me,{flexDirection:"column",children:[(0,Mr.jsx)(Ae,{color:ve.muted,children:d.description}),o==="sidebar"?(0,Mr.jsxs)(Ae,{color:ve.muted,children:["Press ",(0,Mr.jsx)(Ae,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,Mr.jsx)(me,{marginTop:1,children:d.render()})]})})})]})]})}function Pzt({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,a)=>{let c=i.path.slice(1),d=Gzt(o,c);for(let m=d;m<c.length;m++)r.push((0,Mr.jsx)(Uzt,{label:c[m]??"",level:m,marginTop:Fzt(c[m]??"",m,d),focused:n},`group:${c.slice(0,m+1).join("/")}`));r.push((0,Mr.jsx)(Lzt,{story:i,selected:a===t,focused:n},i.id)),o=c}),(0,Mr.jsx)(me,{flexDirection:"column",children:r})}function Uzt({label:e,level:t,marginTop:n,focused:r}){return(0,Mr.jsx)(me,{marginLeft:OVe(t),marginTop:n,children:(0,Mr.jsx)(Ae,{color:r?ve.primary:ve.muted,bold:r,wrap:"truncate-end",children:e})})}function Lzt({story:e,selected:t,focused:n}){let r=n?t?ve.accent:ve.highlight:ve.muted;return(0,Mr.jsxs)(me,{marginLeft:OVe(e.path.slice(1).length),children:[(0,Mr.jsx)(Ae,{color:n&&t?ve.accent:ve.muted,children:t?"\u203A ":" "}),(0,Mr.jsx)(Ae,{color:r,bold:n&&t,wrap:"truncate-end",children:Qzt(e)})]})}function Qzt(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function OVe(e){return Math.min(e,4)}function Fzt(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Gzt(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function BVe(e){let t=pm.length;return(e%t+t)%t}function wVe({story:e}){let{exit:t}=Ca();return Au((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,Mr.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Mr.jsx)(Ra,{title:e.title,subtitle:rD(e),right:"Esc to exit"}),(0,Mr.jsx)(me,{marginBottom:1,children:(0,Mr.jsx)(Ae,{color:ve.muted,children:e.description})}),e.render()]})}var Tue=ie(Lt(),1),MVe={meta:{name:"tui:stories",description:"Open the terminal story runner for Ink TUI screens.",hidden:!0,skipAutoupdate:!0},args:{story:{type:"string",description:"Open a specific story id."},list:{type:"boolean",description:"Print story ids instead of opening the runner."}},async run({args:e}){if(e.list||!process.stdin.isTTY||!process.stdout.isTTY){jzt();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=DVe(e.story.trim());if(!n){console.error(`Unknown TUI story: ${e.story}`),console.error("Run `lore tui:stories --list` to see available ids."),process.exitCode=1;return}await qc((0,Tue.jsx)(wVe,{story:n})).waitUntilExit();return}await qc((0,Tue.jsx)(NVe,{})).waitUntilExit()}};function jzt(){for(let e of pm)console.log(`${e.id} ${rD(e)} ${e.title}`)}A();wr();vE();A();await so();var WH=ie(rn(),1);await CT();var Cue=ie(Lt(),1);function zzt({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,a]=(0,WH.useState)(VM),{exit:c}=Ca();return(0,WH.useEffect)(()=>{let d=!1,m=h=>{d||a(S=>ZH(S,h))};return(async()=>{try{let h=await n(m);if(d)return;r(h),setTimeout(()=>c(),100)}catch(h){if(m({kind:"error",message:h instanceof Error?h.message:String(h)}),d)return;o(h),setTimeout(()=>c(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{d=!0}},[]),(0,Cue.jsx)(Xg,{title:e,subtitle:t,state:i})}async function oD(e){let t,n,r=!1;if(await qc((0,Cue.jsx)(zzt,{title:e.title,subtitle:e.subtitle,perform:e.perform,onResolve:i=>{t=i,r=!0},onReject:i=>{n=i}})).waitUntilExit(),!r)throw n instanceof Error?n:new Error(String(n??"share flow failed"));return t}A();tR();Zo();import Kzt from"node:os";import UVe from"node:path";A();import{spawn as Hzt}from"node:child_process";import $zt from"node:os";async function kVe(e,t={}){let n=t.timeoutMs??2e3,r=Vzt();for(let o of r)if(await qzt(o,e,n))return!0;return!1}function Vzt(){switch($zt.platform()){case"darwin":return[{name:"pbcopy",args:[]}];case"linux":return[{name:"wl-copy",args:[]},{name:"xclip",args:["-selection","clipboard"]},{name:"xsel",args:["--clipboard","--input"]}];case"win32":return[{name:"clip.exe",args:[]}];default:return[]}}async function qzt(e,t,n){return new Promise(r=>{let o;try{o=Hzt(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,a=d=>{i||(i=!0,r(d))},c=setTimeout(()=>{o.kill("SIGKILL"),a(!1)},n);o.on("error",()=>{clearTimeout(c),a(!1)}),o.on("close",d=>{clearTimeout(c),a(d===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}_r();wr();PM();BM();Vx();fT();dH();UE();A();var iD=()=>{};A();wr();DT();async function Yzt(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw cp(`resolve share highlight for thread ${t}`,r.status,r.body);return{url:r.body.url,matched:r.body.matched,start_block_id:r.body.start_block_id,end_block_id:r.body.end_block_id}}async function XH(e,t,n){try{return await Yzt(e,t,n)}catch(r){return _e.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}A();_r();DT();function PVe(e){if(e instanceof YR)return"billing_required";if(e instanceof UM)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof ut)return"validation_failed";if(e instanceof Error){let t=e.message.toLowerCase();if(t.includes("not logged in")||t.includes("unauthorized")||t.includes("unauthenticated")||t.includes("authentication failed")||t.includes("authentication required")||t.includes("auth required")||t.includes("bearer token"))return"auth_failed";if(t.includes("timed out waiting for thread")&&t.includes("parsing")||t.includes("parse timeout"))return"parsing_timeout";if(t.includes("parsing failed permanently"))return"parsing_failed";if(t.includes("econnrefused")||t.includes("econnreset")||t.includes("etimedout")||t.includes("enotfound")||t.includes("network"))return"network_failed"}return"unknown"}DT();var Jzt=new Set(["private","workspace","public"]);function Zzt(e){let t=(e??"").trim();if(!t)return"";if(!Jzt.has(t))throw new ut(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function Iue(e={}){let t=e.progress??iD,n=Zzt(e.visibility),r=(e.project??process.cwd()).trim()||process.cwd(),o=(e.sessionId??"").trim(),i="resolving_session",a=null;try{t({kind:"step",step:"resolving_session"});let c=await q$e({sessionId:o,project:r});i="auth",await nHt();let d=e.client??cn();i="collecting_local_file",a=await Wzt(c),t({kind:"step",step:"uploading",label:a.filename}),i="uploading";let{reused:m,file:h}=await Xzt(d,a);_e.info("export_upload_single_file_result",{filename:a.filename,reused:m,response:JSON.stringify(h)});let S=h.thread?.id?.trim();if(!S)throw Yn().setContext("upload_single_file_response",{filename:a.filename,reused:m,response:h}),new Error(`upload session response missing thread id for ${a.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await Zx(d,S);let y=h.thread?.visibility?.trim()??"",I=y;n&&n!==y&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),I=await eHt(d,S,n)),(I==="workspace"||I==="public")&&await $x(d);let v=tHt(S),x,N=e.highlight?.trim();if(N){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let Q=await XH(d,S,N);Q&&(v=Q.url,x={query:N,matched:Q.matched,start_block_id:Q.start_block_id,end_block_id:Q.end_block_id})}let M=await kVe(v);return t({kind:"completed",url:v,reused:m,visibility:I,clipboardCopied:M,sessionId:c.sessionId?.trim()??""}),t({kind:"step",step:"done"}),$E("lore.cli.thread_exported",{thread_id:S,harness:a.harness,visibility:I,reused:m}),{thread_id:S,url:v,session_id:c.sessionId?.trim()??"",project:c.project,reused:m,visibility:I,clipboard_copied:M,...x?{highlight:x}:{}}}catch(c){throw $E("lore.cli.upload_failed",{error_category:PVe(c),error_message:Oi(c),step:i}),c}finally{a&&await xx(a.tempPath)}}async function Wzt(e){let t=await Y$e(e),n=await Ia(t.fullPath);if(!n.exists)throw new ut(`session transcript not found at ${rHt(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await ip(e.project),o=await Sf(t.fullPath);return{key:t.key,filename:t.relativeFilename,sourcePath:t.fullPath,repoOriginPath:r,tempPath:o.tempPath,md5:o.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:e.sessionId?.trim()??"",watchedState:n}}async function Xzt(e,t){let n=await Yx(e,[t]);if(n.thread_files.length!==1)throw new Error(`upload session returned ${n.thread_files.length} files for 1 local file`);let r=n.thread_files[0];if(!r)throw new Error("upload session response missing thread file");if(!r.presigned_url?.trim()){if(!r.thread?.id?.trim()){let a=r.error?.trim()?`: ${r.error.trim()}`:"";throw new ut(`upload session for ${t.filename} returned no upload URL and no reusable thread${a}`)}return{reused:!0,file:r}}await Kx(r.presigned_url,t.tempPath);let o=await Jx(e,n.id,[r]);if(o.thread_files.length!==1)throw new Error(`complete upload session returned ${o.thread_files.length} files for 1 local file`);let i=o.thread_files[0];if(!i?.thread?.id)throw new Error(`complete upload session response missing thread for ${t.filename}`);return{reused:!1,file:{...r,thread:i.thread}}}async function eHt(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw cp(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function tHt(e){return`${qE().replace(/\/+$/,"")}/thread/${e}`}async function nHt(){let e=await hr();if(!e)throw new ut("not logged in \u2014 run 'lore login' first");return e}function rHt(e){let t=Kzt.homedir();if(!t)return e;let n=UVe.relative(t,e);return!n||n.startsWith("..")?e:UVe.join("~",n)}var LVe={meta:{name:"export",description:"Upload a single Claude Code session to Lore and print its URL"},args:{"session-id":{type:"string",description:"Claude Code session ID to export. Defaults to the most recent session for $PWD."},project:{type:"string",description:"Project path used to resolve a session when --session-id is not provided. Defaults to the current working directory."},visibility:{type:"string",description:"Set thread visibility: private, workspace, or public. Defaults to leaving the existing visibility untouched."},highlight:{type:"string",description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e,data:t}){_e.info("command_start",{command:"export"});let n={sessionId:typeof e["session-id"]=="string"?e["session-id"]:void 0,project:typeof e.project=="string"?e.project:void 0,visibility:typeof e.visibility=="string"?e.visibility:void 0,highlight:typeof e.highlight=="string"?e.highlight:void 0,client:t?.client};if(pu()&&!t?.progress){await oD({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:o=>Iue({...n,progress:o})});return}let r=await Iue({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};A();A();Ky();Zo();Ll();_r();wr();Qx();var oHt=5,iHt=1e3;async function QVe(e={}){(e.environment??ta())!=="dev"||!await aHt({fetchFn:e.fetchFn})||await sHt({client:e.client})}async function aHt(e={}){if(_w().token)return!0;let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return _e.warn("dev_preflight_no_email",{hint:"set LORE_DEV_CLI_USER_EMAIL in .env.local (run `pnpm bootstrap`) to auto-authenticate the dev uploader"}),!1;let n=e.fetchFn??globalThis.fetch,r=e.attempts??oHt,o=e.retryDelayMs??iHt,i=`${qR()}/api/cli-auth/dev-token`;for(let a=1;a<=r;a+=1)try{let c=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(c.status===404)return _e.warn("dev_preflight_endpoint_absent",{url:i}),!1;if(!c.ok){let m=await uHt(c);return _e.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:m}),!1}let d=await c.json();return d.access_token?($R(d.access_token),_e.info("dev_preflight_token_minted",{email:t,expiresIn:d.expires_in}),!0):(_e.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(c){if(a===r)return _e.warn("dev_preflight_token_unreachable",{url:i,error:Oi(c)}),!1;await cHt(o)}return!1}async function sHt(e={}){let t=await Vc();if(fH(t))return;let n=process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd(),r=e.client??cn(),o;try{let i=await r.whoAmI({headers:{}});if(i.status!==200){_e.warn("dev_preflight_whoami_failed",{status:i.status});return}let a=i.body.organizationId?.trim(),c=i.body.org_name?.trim();if(a&&c)o={id:a,name:c};else{let d=i.body.organizations[0];if(!d){_e.warn("dev_preflight_no_workspace",{});return}o={id:d.id,name:d.name}}}catch(i){_e.warn("dev_preflight_whoami_error",{error:Oi(i)});return}t=vM(t,{path:n,organizationId:o.id,organizationName:o.name}),await Lx(t),_e.info("dev_preflight_upload_dir_seeded",{path:n,workspace:o.name})}async function uHt(e){try{let t=await e.json(),n=t.message??t.error;return typeof n=="string"?n:`HTTP ${e.status}`}catch{return`HTTP ${e.status}`}}function cHt(e){return new Promise(t=>{setTimeout(t,e)})}QM();A();_r();wr();QM();import FVe from"node:fs";import{watch as lHt}from"node:fs/promises";import GVe from"node:path";import{setTimeout as bue}from"node:timers/promises";var dHt=2e3,pHt=3e4;function fHt(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??LM).map(n=>n.historyFilePath())}async function jVe(e={}){let t=e.debounceMs??dHt,n=e.pollIntervalMs??pHt,r=fHt(e),o=e.runUploadFn??MH,i=e.signal?void 0:new AbortController,a=e.signal??i.signal,c=()=>i?.abort();i&&(process.once("SIGINT",c),process.once("SIGTERM",c));let d=!1,m=!1,h=async x=>{if(d){m=!0;return}d=!0;try{do{if(m=!1,a.aborted)break;try{let N=await o(e.uploadOptions);_e.info("watch_sync_complete",{reason:x,uploaded:N.length})}catch(N){_e.error("watch_sync_failed",{reason:x,error:Oi(N)})}}while(m&&!a.aborted)}finally{d=!1}},S,y=x=>{S&&clearTimeout(S),S=setTimeout(()=>{S=void 0,h(x)},t),S.unref?.()};_e.info("watch_start",{watchPaths:r,debounceMs:t,pollIntervalMs:n}),h("startup");let I=async x=>{for(;!a.aborted;)try{let N=FVe.existsSync(x)&&FVe.statSync(x).isDirectory(),M=N?x:GVe.dirname(x),Q=N?void 0:GVe.basename(x);for await(let j of lHt(M,{signal:a,recursive:N})){if(a.aborted)break;(Q===void 0||!j.filename||j.filename===Q)&&y("fs-event")}}catch(N){if(a.aborted||N?.name==="AbortError")break;_e.warn("watch_fs_retry",{path:x,error:Oi(N)}),await bue(n,void 0,{signal:a}).catch(()=>{})}},v=async()=>{for(;!a.aborted;){try{await bue(n,void 0,{signal:a})}catch{break}if(a.aborted)break;h("poll")}};try{await Promise.all([...r.map(I),v()])}finally{for(S&&clearTimeout(S),i&&(process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c));d;)await bue(50).catch(()=>{});_e.info("watch_stop",{})}}var zVe={meta:{name:"_run_upload",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously: watch the Claude history file and re-sync on every change. This is the launchd-free daemon `pnpm dev` runs locally.",default:!1}},async run({args:e,data:t}){let n={client:t?.client,...t?.adapters!==void 0?{adapters:t.adapters}:t?.adapter!==void 0?{adapter:t.adapter}:{},recorder:t?.recorder};if(e.watch){await QVe(),await jVe({uploadOptions:n});return}let r=await MH(n);console.log(JSON.stringify(r))}};A();Zo();Vx();vE();A();Zo();PM();Vx();fT();QM();import{spawn as AHt}from"node:child_process";import HVe from"node:path";DT();async function vue(e){let t=e.progress??iD;if(!await hr())throw new Wx;t({kind:"step",step:"resolving_session"});let r=HVe.resolve(e.sessionFile),o=HVe.basename(r),i=e.harnessInternalId?.trim()||EHt(o)||o,a=await Ia(r);if(!a.exists)throw new Error(`session file does not exist: ${r}`);let c=await Sf(r),d={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:c.tempPath,md5:c.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:a},m=e.client??cn();try{t({kind:"step",step:"uploading",label:o});let h=await Yx(m,[d]),S=h.thread_files[0];if(!S)throw new Error("create upload session returned no thread files");let y=S.thread,I=!S.presigned_url?.trim()&&!!y?.id,v=y;if(!I){if(!S.presigned_url?.trim()){let be=S.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${be}`)}await Kx(S.presigned_url,c.tempPath),v=(await mHt(m,h.id,S)).thread}let x=v?.id?.trim();if(!x)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await Zx(m,x);let N=v?.visibility?.trim()??"",M=N,Q=e.visibility;Q&&Q!==N&&(t({kind:"step",step:"updating_visibility"}),M=await gHt(m,x,Q)),(M==="workspace"||M==="public")&&await $x(m);let j=`${qE().replace(/\/+$/,"")}/thread/${x}`,G,q=e.highlight?.trim();if(q){t({kind:"step",step:"resolving_highlight"});let ye=await XH(m,x,q);ye&&(j=ye.url,G={query:q,matched:ye.matched,start_block_id:ye.start_block_id,end_block_id:ye.end_block_id})}let oe=await SHt(j),ge=_Ht(M)?M:"private";return t({kind:"completed",url:j,reused:I,visibility:ge,clipboardCopied:oe,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:x,url:j,session_id:i,project:"",reused:I,visibility:ge,clipboard_copied:oe,...G?{highlight:G}:{}}}finally{await xx(c.tempPath)}}async function mHt(e,t,n){let o=(await Jx(e,t,[n])).thread_files[0];if(!o)throw new Error("complete upload session returned no thread files");return{thread:o.thread}}async function gHt(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw cp(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var hHt=new Set(["private","workspace","public"]);function _Ht(e){return hHt.has(e)}function EHt(e){let n=e.replace(/\.jsonl$/i,"").split("-").filter(o=>o.length>0);if(n.length===0)return"";let r=n.slice(-5);return r.length===5&&r.every(o=>/^[0-9a-fA-F]+$/.test(o))?r.join("-"):n[n.length-1]??""}async function SHt(e){let t=process.platform==="darwin"?[{command:"pbcopy",args:[]}]:process.platform==="win32"?[{command:"clip.exe",args:[]}]:[{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];for(let{command:n,args:r}of t)if(await yHt(n,r,e))return!0;return!1}function yHt(e,t,n){return new Promise(r=>{let o;try{o=AHt(e,t,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}o.on("error",()=>r(!1)),o.on("exit",i=>r(i===0)),o.stdin?.on("error",()=>r(!1)),o.stdin?.end(n)})}var $Ve=["private","workspace","public"],VVe={meta:{name:"share-codex",description:"Upload a Codex session rollout (.jsonl) to Lore and print a shareable URL."},args:{"session-file":{type:"string",required:!0,description:"Absolute path to a Codex rollout file (e.g. ~/.codex/sessions/YYYY/MM/DD/rollout-...jsonl)"},visibility:{type:"string",required:!1,description:"After upload, set thread visibility to one of: private, workspace, public"},"include-skills":{type:"boolean",required:!1,description:"Also sync your locally installed SKILL.md files to Lore (captured, not published) so teammates can install them"},highlight:{type:"string",required:!1,description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e}){let t=e["session-file"];if(typeof t!="string"||t.trim()==="")throw new Error("--session-file is required");let n=THt(e.visibility);if(pu())await oD({title:"lore share-codex",subtitle:"sharing this Codex session",perform:r=>vue({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:r})});else{let r=await vue({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0});console.log(JSON.stringify(r))}if(e["include-skills"]){let r=await Yse(cn());console.error(`synced ${r.pushed.length} skill(s) to Lore${r.skipped.length>0?`; skipped ${r.skipped.length}`:""}`)}}};function THt(e){if(!(e==null||e==="")){if(typeof e!="string")throw new Error("--visibility must be a string");if(!$Ve.includes(e))throw new Error(`--visibility must be one of: ${$Ve.join(", ")}`);return e}}A();Zo();wr();PM();vE();Zse();Wse();A();import CHt from"node:crypto";DT();var IHt=async(e,t)=>{let n={method:"PUT",body:typeof t=="string"?t:new Uint8Array(t)};return{status:(await fetch(e,n)).status}};async function Rue(e,t,n={}){let r=n.progress??iD,{contents:o,accountId:i,orgId:a,sessionId:c}=t,d=CHt.createHash("md5").update(o.transcript).digest("hex");r({kind:"step",step:"resolving_session",label:c});let m=await e.createUploadSession({headers:{},body:{thread_files:[{md5:d,harness:"cowork",harness_internal_id:c,filename:"audit.jsonl",file_type:"transcript",artifact_metadata:{uploads:o.uploads,outputs:o.outputs}}]}});if(m.status!==201)throw cp("createUploadSession",m.status,m.body);let h=m.body.thread_files[0];if(h.error&&h.thread)return{threadId:h.thread.id,duplicate:!0};if(!h.presigned_url)throw new Error(`createUploadSession returned no presigned_url and no existing thread: ${JSON.stringify(h)}`);r({kind:"step",step:"uploading"});let y=await(n.putBlob??IHt)(h.presigned_url,Buffer.from(o.transcript,"utf8"));if(y.status<200||y.status>=300)throw new Error(`presigned PUT failed: HTTP ${y.status}`);let I=await e.completeUploadSession({headers:{},params:{id:m.body.id},body:{thread_files:[{storage_url:h.storage_url}]}});if(I.status!==200)throw cp("completeUploadSession",I.status,I.body);let v=I.body.thread_files[0];if(!v?.thread)throw new Error(`completeUploadSession returned no thread: ${JSON.stringify(v)}`);return{threadId:v.thread.id,duplicate:!1}}var qVe={meta:{name:"share-cowork",description:"Share a Claude Cowork local-agent-mode session to Lore. Defaults to the current session when run from inside one (e.g. by the Cowork agent itself); otherwise shares the most recent local session."},args:{session:{type:"string",description:"Share a specific session by session-id (the bottom-level uuid)"},list:{type:"boolean",description:"List local Cowork sessions (newest first) and exit without sharing"}},async run({args:e,data:t}){_e.info("command_start",{command:"share-cowork",list:!!e.list,session:e.session??null});let n=OH();if(e.list){let m=qx(n);if(m.length===0){console.error(`No Cowork sessions found under ${n}`);return}for(let h of m)console.log(vHt(h));return}let r=bHt(n,typeof e.session=="string"?e.session:void 0);if(!r)throw console.error(`No Cowork session found. Tried CWD walk-up and the most recent under
|
|
510
510
|
${n}
|
|
511
511
|
Run with --list to see available sessions.`),new Error("no session resolved");let o=t?.client??cn(),i=z5e(r.sessionDir),a=qE();if(pu()){await oD({title:"lore share-cowork",subtitle:`session ${r.sessionId}`,perform:async m=>{let h=await Rue(o,{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,contents:i},{progress:m});return m({kind:"completed",url:`${a.replace(/\/+$/,"")}/thread/${h.threadId}`,reused:h.duplicate,clipboardCopied:!1,sessionId:r.sessionId}),m({kind:"step",step:"done"}),h}});return}console.log(`Sharing cowork session ${r.sessionId} (${i.transcript.length} bytes transcript)...`);let c=await Rue(o,{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,contents:i}),d=`${a.replace(/\/+$/,"")}/thread/${c.threadId}`;c.duplicate?console.log(`Already on Lore: ${d}`):console.log(`Shared: ${d}`)}};function bHt(e,t){if(t){let o=qx(e).find(i=>i.sessionId===t);return o?{accountId:o.accountId,orgId:o.orgId,sessionId:o.sessionId,sessionDir:o.sessionDir,sessionsRoot:e}:null}let n=H5e(process.cwd());if(n)return n;let r=$5e(e);return r?{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,sessionDir:r.sessionDir,sessionsRoot:e}:null}function vHt(e){let t=new Date(e.mtimeMs).toISOString();return`${e.sessionId} ${e.accountId} ${e.orgId} ${t}`}A();A();Zo();_r();wr();var RHt=e=>{let t=Math.max(4,...e.map(r=>r.name.length));return[`${"Name".padEnd(t)} ID`,...e.map(r=>`${r.name.padEnd(t)} ${r.id}`)].join(`
|
|
512
512
|
`)},YVe={meta:{name:"list",description:"List workspaces you belong to."},async run({data:e}){_e.info("command_start",{command:"workspaces list"});let t=e;if(!await(t?.getAccessToken??hr)())throw new ut("not logged in \u2014 run 'lore login' first");let o=await(t?.client??cn()).whoAmI({headers:{}});if(o.status!==200){let i=o.body?.message??`whoAmI returned ${o.status}`;throw new ut(i)}console.log(RHt(o.body.organizations))}};var KVe={meta:{name:"workspaces",description:"List workspaces from your WorkOS AuthKit account. (Workspaces are organizations in the API contract.)"},subCommands:{list:YVe}};var BHt=Q4e(),WVe={...BHt,health:N9e,feedback:B9e,enable:j9e,disable:FH,restart:z9e,status:H9e,login:pue,logout:x9e,whoami:D9e,logs:w9e,version:Y9e,uninstall:q9e,export:LVe,configure:K9e,listen:tVe,workspaces:KVe,skills:lVe,slack:fVe,"share-cowork":qVe,"share-codex":VVe,"tui:stories":MVe,_run_upload:zVe,"postinstall:migrate":iVe,"postinstall:cleanup-legacy-skills":k9e,"postinstall:refresh-background-binary":P9e};function e8(e){return e.find(t=>!t.startsWith("-"))??"lore"}var NHt={name:"cli-metrics",setup(e){e.data={...e.data,commandStartedAtMs:performance.now()}},async cleanup(e){let t=e.data?.commandStartedAtMs;if(typeof t!="number")return;let n=performance.now()-t,r=e.data?.captureCliCommandMetric??I5e,o=await C5e(ZE,e.rawArgs);await r({...o,durationMs:n})}},ZE={meta:{name:"lore",description:"Lore CLI"},plugins:[NHt],subCommands:WVe};function xue(e){return e instanceof Error&&e.name==="CLIError"}function OHt(e){return xue(e)&&e.code==="E_UNKNOWN_COMMAND"}async function wHt(e){let t=j4e(e);return xl({name:`lore ${e8(t)}`,op:"cli.command",parentSpan:null,forceTransaction:!0,attributes:{"cli.command":e8(t),"cli.raw_args":e.join(" "),"cli.args":t.join(" ")}},n=>b4e(n,()=>MHt(e,t)))}async function MHt(e,t){let n=kHt(t)?M5e():void 0,r=!1;try{if(t.includes("--help")||t.includes("-h")){let[o,i]=await Z9e(ZE,t),a=o===ZE&&i===void 0?await Sue(ZE):await tZ(o,i);return console.log(a),0}if(t.includes("--version")||t.includes("-v"))return console.log(qu()),0;if(!t.some(o=>!o.startsWith("-"))){if(pu({rawArgs:e})){let{rawArgs:o}=await _Ve();return o.length===0||await Sy(ZE,{rawArgs:[...o]}),0}return console.log(await Sue(ZE)),0}return await Sy(ZE,{rawArgs:t}),0}catch(o){return OHt(o)?(console.error(`Unrecognized command: ${e8(t)}`),console.error(await tZ(ZE))):xue(o)?o.message.length>0&&console.error(o.message):ta()==="prod"&&o instanceof Error?console.error(o.message):console.error(o,`
|