@tanagram/lore 0.1.224 → 0.1.225
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 +5 -5
- package/package.json +4 -4
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 Ent=Object.create;var zL=Object.defineProperty;var ynt=Object.getOwnPropertyDescriptor;var Snt=Object.getOwnPropertyNames;var Tnt=Object.getPrototypeOf,bnt=Object.prototype.hasOwnProperty;var Ue=(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 B=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var M=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Ws=(e,t)=>{for(var n in t)zL(e,n,{get:t[n],enumerable:!0})},NAe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Snt(t))!bnt.call(e,o)&&o!==n&&zL(e,o,{get:()=>t[o],enumerable:!(r=ynt(t,o))||r.enumerable});return e};var ue=(e,t,n)=>(n=e!=null?Ent(Tnt(e)):{},NAe(t||!e||!e.__esModule?zL(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>NAe(zL({},"__esModule",{value:!0}),e);var A=B(()=>{(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.224"}}catch{}})()});var bg,xq=B(()=>{A();bg="1.9.1"});function Int(e){let t=new Set([e]),n=new Set,r=e.match(kAe);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(l){return l===e};function i(u){return n.add(u),!1}function s(u){return t.add(u),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;let f=l.match(kAe);if(!f)return i(l);let h={major:+f[1],minor:+f[2],patch:+f[3],prerelease:f[4]};return h.prerelease!=null||o.major!==h.major?i(l):o.major===0?o.minor===h.minor&&o.patch<=h.patch?s(l):i(l):o.minor<=h.minor?s(l):i(l)}}var kAe,OAe,PAe=B(()=>{A();xq();kAe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;OAe=Int(bg)});function vm(e,t,n,r=!1){var o;let i=cw[uw]=(o=cw[uw])!==null&&o!==void 0?o:{version:bg};if(!r&&i[e]){let s=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(s.stack||s.message),!1}if(i.version!==bg){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${bg}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${bg}.`),!0}function jl(e){var t,n;let r=(t=cw[uw])===null||t===void 0?void 0:t.version;if(!(!r||!OAe(r)))return(n=cw[uw])===null||n===void 0?void 0:n[e]}function Rm(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${bg}.`);let n=cw[uw];n&&delete n[e]}var Cnt,uw,cw,cS=B(()=>{A();xq();PAe();Cnt=bg.split(".")[0],uw=Symbol.for(`opentelemetry.js.api.${Cnt}`),cw=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function lw(e,t,n){let r=jl("diag");if(r)return r[e](t,...n)}var HL,MAe=B(()=>{A();cS();HL=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return lw("debug",this._namespace,t)}error(...t){return lw("error",this._namespace,t)}info(...t){return lw("info",this._namespace,t)}warn(...t){return lw("warn",this._namespace,t)}verbose(...t){return lw("verbose",this._namespace,t)}}});var Rs,$L=B(()=>{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"})(Rs||(Rs={}))});function LAe(e,t){e<Rs.NONE?e=Rs.NONE:e>Rs.ALL&&(e=Rs.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",Rs.ERROR),warn:n("warn",Rs.WARN),info:n("info",Rs.INFO),debug:n("debug",Rs.DEBUG),verbose:n("verbose",Rs.VERBOSE)}}var UAe=B(()=>{A();$L()});var vnt,Xs,lS=B(()=>{A();MAe();UAe();$L();cS();vnt="diag",Xs=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let s=jl("diag");if(s)return s[o](...i)}}let n=this,r=(o,i={logLevel:Rs.INFO})=>{var s,u,l;if(o===n){let _=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=_.stack)!==null&&s!==void 0?s:_.message),!1}typeof i=="number"&&(i={logLevel:i});let f=jl("diag"),h=LAe((u=i.logLevel)!==null&&u!==void 0?u:Rs.INFO,o);if(f&&!i.suppressOverrideMessage){let _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";f.warn(`Current logger will be overwritten from ${_}`),h.warn(`Current logger will overwrite one already registered from ${_}`)}return vm("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{Rm(vnt,n)},n.createComponentLogger=o=>new HL(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var qL,QAe=B(()=>{A();qL=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 FAe,GAe=B(()=>{A();FAe=Symbol("BaggageEntryMetadata")});function jAe(e={}){return new qL(new Map(Object.entries(e)))}function zAe(e){return typeof e!="string"&&(Rnt.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:FAe,toString(){return e}}}var Rnt,Dq=B(()=>{A();lS();QAe();GAe();Rnt=Xs.instance()});function zl(e){return Symbol.for(e)}var Nq,kC,dw=B(()=>{A();Nq=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}}},kC=new Nq});var wq,Bq,VL,HAe=B(()=>{A();wq=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Bq={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(Bq[t]=console[t])}VL=class{constructor(){function t(n){return function(...r){let o=Bq[n];if(typeof o!="function"&&(o=Bq.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<wq.length;n++)this[wq[n].n]=t(wq[n].c)}}});function $Ae(){return Gq}var kq,OC,Oq,Pq,Mq,Lq,pw,Uq,Qq,Fq,Gq,xnt,Dnt,Nnt,wnt,Bnt,knt,Ont,jq=B(()=>{A();kq=class{constructor(){}createGauge(t,n){return Dnt}createHistogram(t,n){return Nnt}createCounter(t,n){return xnt}createUpDownCounter(t,n){return wnt}createObservableGauge(t,n){return knt}createObservableCounter(t,n){return Bnt}createObservableUpDownCounter(t,n){return Ont}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},OC=class{},Oq=class extends OC{add(t,n){}},Pq=class extends OC{add(t,n){}},Mq=class extends OC{record(t,n){}},Lq=class extends OC{record(t,n){}},pw=class{addCallback(t){}removeCallback(t){}},Uq=class extends pw{},Qq=class extends pw{},Fq=class extends pw{},Gq=new kq,xnt=new Oq,Dnt=new Mq,Nnt=new Lq,wnt=new Pq,Bnt=new Uq,knt=new Qq,Ont=new Fq});var YL,qAe=B(()=>{A();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(YL||(YL={}))});var KL,JL,zq=B(()=>{A();KL={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},JL={set(e,t,n){e!=null&&(e[t]=n)}}});var ZL,VAe=B(()=>{A();dw();ZL=class{active(){return kC}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var Hq,Pnt,xm,fw=B(()=>{A();VAe();cS();lS();Hq="context",Pnt=new ZL,xm=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return vm(Hq,t,Xs.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 jl(Hq)||Pnt}disable(){this._getContextManager().disable(),Rm(Hq,Xs.instance())}}});var ou,$q=B(()=>{A();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(ou||(ou={}))});var mw,dS,WL,XL=B(()=>{A();$q();mw="0000000000000000",dS="00000000000000000000000000000000",WL={traceId:dS,spanId:mw,traceFlags:ou.NONE}});var Dm,eU=B(()=>{A();XL();Dm=class{constructor(t=WL){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 tU(e){return e.getValue(qq)||void 0}function YAe(){return tU(xm.getInstance().active())}function Aw(e,t){return e.setValue(qq,t)}function KAe(e){return e.deleteValue(qq)}function JAe(e,t){return Aw(e,new Dm(t))}function nU(e){var t;return(t=tU(e))===null||t===void 0?void 0:t.spanContext()}var qq,Vq=B(()=>{A();dw();eU();fw();qq=zl("OpenTelemetry Context Key SPAN")});function ZAe(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(rU[e.charCodeAt(r)]|0)+(rU[e.charCodeAt(r+1)]|0)+(rU[e.charCodeAt(r+2)]|0)+(rU[e.charCodeAt(r+3)]|0);return n===t}function Yq(e){return ZAe(e,32)&&e!==dS}function Kq(e){return ZAe(e,16)&&e!==mw}function Ig(e){return Yq(e.traceId)&&Kq(e.spanId)}function WAe(e){return new Dm(e)}var rU,oU=B(()=>{A();XL();eU();rU=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 Mnt(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 Jq,PC,Zq=B(()=>{A();fw();Vq();eU();oU();Jq=xm.getInstance(),PC=class{startSpan(t,n,r=Jq.active()){if(!!n?.root)return new Dm;let i=r&&nU(r);return Mnt(i)&&Ig(i)?new Dm(i):new Dm}startActiveSpan(t,n,r,o){let i,s,u;if(arguments.length<2)return;arguments.length===2?u=n:arguments.length===3?(i=n,u=r):(i=n,s=r,u=o);let l=s??Jq.active(),f=this.startSpan(t,i,l),h=Aw(l,f);return Jq.with(h,u,void 0,f)}}});var Lnt,MC,Wq=B(()=>{A();Zq();Lnt=new PC,MC=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):Lnt}}});var iU,XAe=B(()=>{A();Zq();iU=class{getTracer(t,n,r){return new PC}}});var Unt,pS,Xq=B(()=>{A();Wq();XAe();Unt=new iU,pS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new MC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Unt}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 sU,ege=B(()=>{A();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(sU||(sU={}))});var mo,tge=B(()=>{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"})(mo||(mo={}))});var gi,nge=B(()=>{A();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(gi||(gi={}))});function rge(e){return Gnt.test(e)}function oge(e){return jnt.test(e)&&!znt.test(e)}var eV,Qnt,Fnt,Gnt,jnt,znt,ige=B(()=>{A();eV="[_0-9a-z-*/]",Qnt=`[a-z]${eV}{0,255}`,Fnt=`[a-z0-9]${eV}{0,240}@[a-z]${eV}{0,13}`,Gnt=new RegExp(`^(?:${Qnt}|${Fnt})$`),jnt=/^[ -~]{0,255}[!-~]$/,znt=/,|=/});var sge,Hnt,age,uge,aU,cge=B(()=>{A();ige();sge=32,Hnt=512,age=",",uge="=",aU=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+uge+this.get(n)),t),[]).join(age)}_parse(t){t.length>Hnt||(this._internalState=t.split(age).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(uge);if(i!==-1){let s=o.slice(0,i),u=o.slice(i+1,r.length);rge(s)&&oge(u)&&n.set(s,u)}return n},new Map),this._internalState.size>sge&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,sge))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function lge(e){return new aU(e)}var dge=B(()=>{A();cge()});var We,pge=B(()=>{A();fw();We=xm.getInstance()});var Hl,fge=B(()=>{A();lS();Hl=Xs.instance()});var tV,mge,Age=B(()=>{A();jq();tV=class{getMeter(t,n,r){return Gq}},mge=new tV});var nV,uU,gge=B(()=>{A();Age();cS();lS();nV="metrics",uU=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return vm(nV,t,Xs.instance())}getMeterProvider(){return jl(nV)||mge}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){Rm(nV,Xs.instance())}}});var rV,hge=B(()=>{A();gge();rV=uU.getInstance()});var cU,_ge=B(()=>{A();cU=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function iV(e){return e.getValue(oV)||void 0}function Ege(){return iV(xm.getInstance().active())}function yge(e,t){return e.setValue(oV,t)}function Sge(e){return e.deleteValue(oV)}var oV,Tge=B(()=>{A();fw();dw();oV=zl("OpenTelemetry Baggage Key")});var sV,$nt,lU,bge=B(()=>{A();cS();_ge();zq();Tge();Dq();lS();sV="propagation",$nt=new cU,lU=class e{constructor(){this.createBaggage=jAe,this.getBaggage=iV,this.getActiveBaggage=Ege,this.setBaggage=yge,this.deleteBaggage=Sge}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return vm(sV,t,Xs.instance())}inject(t,n,r=JL){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=KL){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Rm(sV,Xs.instance())}_getGlobalPropagator(){return jl(sV)||$nt}}});var Af,Ige=B(()=>{A();bge();Af=lU.getInstance()});var aV,dU,Cge=B(()=>{A();cS();Xq();oU();Vq();lS();aV="trace",dU=class e{constructor(){this._proxyTracerProvider=new pS,this.wrapSpanContext=WAe,this.isSpanContextValid=Ig,this.deleteSpan=KAe,this.getSpan=tU,this.getActiveSpan=YAe,this.getSpanContext=nU,this.setSpan=Aw,this.setSpanContext=JAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=vm(aV,this._proxyTracerProvider,Xs.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return jl(aV)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){Rm(aV,Xs.instance()),this._proxyTracerProvider=new pS}}});var Jt,vge=B(()=>{A();Cge();Jt=dU.getInstance()});var tt={};Ws(tt,{DiagConsoleLogger:()=>VL,DiagLogLevel:()=>Rs,INVALID_SPANID:()=>mw,INVALID_SPAN_CONTEXT:()=>WL,INVALID_TRACEID:()=>dS,ProxyTracer:()=>MC,ProxyTracerProvider:()=>pS,ROOT_CONTEXT:()=>kC,SamplingDecision:()=>sU,SpanKind:()=>mo,SpanStatusCode:()=>gi,TraceFlags:()=>ou,ValueType:()=>YL,baggageEntryMetadataFromString:()=>zAe,context:()=>We,createContextKey:()=>zl,createNoopMeter:()=>$Ae,createTraceState:()=>lge,default:()=>qnt,defaultTextMapGetter:()=>KL,defaultTextMapSetter:()=>JL,diag:()=>Hl,isSpanContextValid:()=>Ig,isValidSpanId:()=>Kq,isValidTraceId:()=>Yq,metrics:()=>rV,propagation:()=>Af,trace:()=>Jt});var qnt,He=B(()=>{A();Dq();dw();HAe();$L();jq();qAe();zq();Wq();Xq();ege();tge();nge();$q();dge();oU();XL();pge();fge();hge();Ige();vge();qnt={context:We,diag:Hl,metrics:rV,propagation:Af,trace:Jt}});var gw=M(R_=>{"use strict";A();Object.defineProperty(R_,"__esModule",{value:!0});R_.isTracingSuppressed=R_.unsuppressTracing=R_.suppressTracing=void 0;var Vnt=(He(),Me(tt)),uV=(0,Vnt.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ynt(e){return e.setValue(uV,!0)}R_.suppressTracing=Ynt;function Knt(e){return e.deleteValue(uV)}R_.unsuppressTracing=Knt;function Jnt(e){return e.getValue(uV)===!0}R_.isTracingSuppressed=Jnt});var cV=M(iu=>{"use strict";A();Object.defineProperty(iu,"__esModule",{value:!0});iu.BAGGAGE_MAX_TOTAL_LENGTH=iu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=iu.BAGGAGE_MAX_NAME_VALUE_PAIRS=iu.BAGGAGE_HEADER=iu.BAGGAGE_ITEMS_SEPARATOR=iu.BAGGAGE_PROPERTIES_SEPARATOR=iu.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;iu.BAGGAGE_KEY_PAIR_SEPARATOR="=";iu.BAGGAGE_PROPERTIES_SEPARATOR=";";iu.BAGGAGE_ITEMS_SEPARATOR=",";iu.BAGGAGE_HEADER="baggage";iu.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;iu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;iu.BAGGAGE_MAX_TOTAL_LENGTH=8192});var dV=M(Kd=>{"use strict";A();Object.defineProperty(Kd,"__esModule",{value:!0});Kd.parseKeyPairsIntoRecord=Kd.parseBaggageHeaderString=Kd.parsePairKeyValue=Kd.getKeyPairs=Kd.serializeKeyPairs=void 0;var Znt=(He(),Me(tt)),Nm=cV();function Wnt(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?Nm.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Nm.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}Kd.serializeKeyPairs=Wnt;function Xnt(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Nm.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}Kd.getKeyPairs=Xnt;function lV(e){if(!e)return;let t=e.indexOf(Nm.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(Nm.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 s,u;try{s=decodeURIComponent(o),u=decodeURIComponent(i)}catch{return}let l;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);l=(0,Znt.baggageEntryMetadataFromString)(f)}return{key:s,value:u,metadata:l}}Kd.parsePairKeyValue=lV;function ert(e,t,n,r){let o=0;for(;o<e.length&&n<Nm.BAGGAGE_MAX_NAME_VALUE_PAIRS;){let i=e.indexOf(Nm.BAGGAGE_ITEMS_SEPARATOR,o),s=i===-1?e.length:i,u=s-o;if(u<=Nm.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS){let l=lV(e.substring(o,s));if(l){let f=(n===0?0:1)+u;if(r+f>Nm.BAGGAGE_MAX_TOTAL_LENGTH)break;t[l.key]=l.metadata?{value:l.value,metadata:l.metadata}:{value:l.value},n++,r+=f}}if(i===-1)break;o=i+1}return[n,r]}Kd.parseBaggageHeaderString=ert;function trt(e){let t={};return typeof e=="string"&&e.length>0&&e.split(Nm.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=lV(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}Kd.parseKeyPairsIntoRecord=trt});var Rge=M(fU=>{"use strict";A();Object.defineProperty(fU,"__esModule",{value:!0});fU.W3CBaggagePropagator=void 0;var pV=(He(),Me(tt)),nrt=gw(),hw=cV(),pU=dV(),fV=class{inject(t,n,r){let o=pV.propagation.getBaggage(t);if(!o||(0,nrt.isTracingSuppressed)(t))return;let i=(0,pU.getKeyPairs)(o).filter(u=>u.length<=hw.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,hw.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,pU.serializeKeyPairs)(i);s.length>0&&r.set(n,hw.BAGGAGE_HEADER,s)}extract(t,n,r){let o=r.get(n,hw.BAGGAGE_HEADER);if(!o)return t;let i={},s=0,u=0;if(Array.isArray(o))for(let l=0;l<o.length;l++)[s,u]=(0,pU.parseBaggageHeaderString)(o[l],i,s,u);else[s]=(0,pU.parseBaggageHeaderString)(o,i,s,u);return s===0?t:pV.propagation.setBaggage(t,pV.propagation.createBaggage(i))}fields(){return[hw.BAGGAGE_HEADER]}};fU.W3CBaggagePropagator=fV});var xge=M(mU=>{"use strict";A();Object.defineProperty(mU,"__esModule",{value:!0});mU.AnchoredClock=void 0;var mV=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}};mU.AnchoredClock=mV});var kge=M(x_=>{"use strict";A();Object.defineProperty(x_,"__esModule",{value:!0});x_.isAttributeValue=x_.isAttributeKey=x_.sanitizeAttributes=void 0;var Dge=(He(),Me(tt));function rrt(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(!Nge(n)){Dge.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!wge(r)){Dge.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}x_.sanitizeAttributes=rrt;function Nge(e){return typeof e=="string"&&e!==""}x_.isAttributeKey=Nge;function wge(e){return e==null?!0:Array.isArray(e)?ort(e):Bge(typeof e)}x_.isAttributeValue=wge;function ort(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(Bge(r)){t=r;continue}return!1}return!1}}return!0}function Bge(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var AV=M(AU=>{"use strict";A();Object.defineProperty(AU,"__esModule",{value:!0});AU.loggingErrorHandler=void 0;var irt=(He(),Me(tt));function srt(){return e=>{irt.diag.error(art(e))}}AU.loggingErrorHandler=srt;function art(e){return typeof e=="string"?e:JSON.stringify(urt(e))}function urt(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 Pge=M(LC=>{"use strict";A();Object.defineProperty(LC,"__esModule",{value:!0});LC.globalErrorHandler=LC.setGlobalErrorHandler=void 0;var crt=AV(),Oge=(0,crt.loggingErrorHandler)();function lrt(e){Oge=e}LC.setGlobalErrorHandler=lrt;function drt(e){try{Oge(e)}catch{}}LC.globalErrorHandler=drt});var Qge=M(wm=>{"use strict";A();Object.defineProperty(wm,"__esModule",{value:!0});wm.getStringListFromEnv=wm.getBooleanFromEnv=wm.getStringFromEnv=wm.getNumberFromEnv=void 0;var Mge=(He(),Me(tt)),Lge=Ue("util");function prt(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){Mge.diag.warn(`Unknown value ${(0,Lge.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}wm.getNumberFromEnv=prt;function Uge(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}wm.getStringFromEnv=Uge;function frt(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||Mge.diag.warn(`Unknown value ${(0,Lge.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}wm.getBooleanFromEnv=frt;function mrt(e){return Uge(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}wm.getStringListFromEnv=mrt});var Fge=M(gU=>{"use strict";A();Object.defineProperty(gU,"__esModule",{value:!0});gU._globalThis=void 0;gU._globalThis=globalThis});var Gge=M(hU=>{"use strict";A();Object.defineProperty(hU,"__esModule",{value:!0});hU.VERSION=void 0;hU.VERSION="2.8.0"});function Mi(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 gV=B(()=>{A()});var jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,whe,Bhe,khe,Ohe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,w_e,B_e,k_e,O_e,P_e,M_e,L_e,U_e,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,Art,hV,grt,hrt,_rt,Ert,_V,yrt,Srt,Trt,brt,Irt,Crt,vrt,Rrt,xrt,Drt,Nrt,wrt,Brt,krt,Ort,Prt,Mrt,Lrt,EV,Urt,Qrt,Frt,Grt,jrt,zrt,Hrt,$rt,qrt,Vrt,Yrt,Krt,yV,Jrt,Zrt,SV,TV,Wrt,Xrt,eot,tot,not,rot,oot,iot,sot,aot,uot,cot,lot,dot,pot,fot,mot,_w,UC,bV,Aot,got,fS,hot,_ot,Eot,yot,IV,CV,Sot,vV,Tot,bot,Iot,Cot,vot,Rot,xot,Dot,Not,wot,Bot,kot,Oot,Pot,Mot,Lot,Uot,Qot,Fot,Got,jot,zot,Hot,RV,$ot,qot,Vot,Yot,Kot,Jot,Zot,Wot,Xot,eit,tit,nit,rit,oit,iit,sit,ait,uit,cit,xV,lit,DV,dit,pit,fit,mit,Ait,git,hit,_it,Eit,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,wEe,BEe,kEe,OEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,jEe,zEe,HEe,$Ee,qEe,VEe,YEe,KEe,JEe,ZEe,WEe,XEe,eye,yit,Sit,Tit,bit,Iit,Cit,vit,Rit,xit,Dit,Nit,wit,Bit,kit,Oit,Pit,Mit,Lit,Uit,Qit,Fit,Git,jit,zit,Hit,$it,qit,Vit,Yit,Kit,Jit,Zit,Wit,Xit,est,tst,nst,rst,ost,ist,sst,ast,ust,cst,lst,dst,pst,fst,tye,nye,rye,oye,iye,sye,aye,uye,cye,lye,dye,mst,Ast,gst,hst,_st,Est,yst,Sst,Tst,bst,Ist,Cst,pye,fye,mye,Aye,gye,vst,Rst,xst,Dst,Nst,wst,hye,_ye,Eye,Bst,kst,Ost,Pst,yye,Sye,Tye,bye,Mst,Lst,Ust,Qst,Fst,Iye,Cye,vye,Rye,xye,Dye,Nye,Gst,jst,zst,Hst,$st,qst,Vst,Yst,wye,Bye,kye,Oye,Pye,Kst,Jst,Zst,Wst,Xst,eat,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,e0e,t0e,n0e,tat,nat,rat,oat,iat,sat,aat,uat,cat,lat,dat,pat,fat,mat,Aat,gat,hat,_at,Eat,yat,Sat,Tat,r0e,o0e,i0e,s0e,a0e,bat,Iat,Cat,vat,Rat,xat,u0e,c0e,Dat,Nat,wat,l0e,d0e,Bat,kat,Oat,p0e,f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,Pat,Mat,Lat,Uat,Qat,Fat,Gat,jat,zat,Hat,$at,qat,Vat,Yat,Kat,Jat,Zat,Wat,D0e,N0e,Xat,eut,tut,w0e=B(()=>{A();gV();jge="aws.lambda.invoked_arn",zge="db.system",Hge="db.connection_string",$ge="db.user",qge="db.jdbc.driver_classname",Vge="db.name",Yge="db.statement",Kge="db.operation",Jge="db.mssql.instance_name",Zge="db.cassandra.keyspace",Wge="db.cassandra.page_size",Xge="db.cassandra.consistency_level",ehe="db.cassandra.table",the="db.cassandra.idempotence",nhe="db.cassandra.speculative_execution_count",rhe="db.cassandra.coordinator.id",ohe="db.cassandra.coordinator.dc",ihe="db.hbase.namespace",she="db.redis.database_index",ahe="db.mongodb.collection",uhe="db.sql.table",che="exception.type",lhe="exception.message",dhe="exception.stacktrace",phe="exception.escaped",fhe="faas.trigger",mhe="faas.execution",Ahe="faas.document.collection",ghe="faas.document.operation",hhe="faas.document.time",_he="faas.document.name",Ehe="faas.time",yhe="faas.cron",She="faas.coldstart",The="faas.invoked_name",bhe="faas.invoked_provider",Ihe="faas.invoked_region",Che="net.transport",vhe="net.peer.ip",Rhe="net.peer.port",xhe="net.peer.name",Dhe="net.host.ip",Nhe="net.host.port",whe="net.host.name",Bhe="net.host.connection.type",khe="net.host.connection.subtype",Ohe="net.host.carrier.name",Phe="net.host.carrier.mcc",Mhe="net.host.carrier.mnc",Lhe="net.host.carrier.icc",Uhe="peer.service",Qhe="enduser.id",Fhe="enduser.role",Ghe="enduser.scope",jhe="thread.id",zhe="thread.name",Hhe="code.function",$he="code.namespace",qhe="code.filepath",Vhe="code.lineno",Yhe="http.method",Khe="http.url",Jhe="http.target",Zhe="http.host",Whe="http.scheme",Xhe="http.status_code",e_e="http.flavor",t_e="http.user_agent",n_e="http.request_content_length",r_e="http.request_content_length_uncompressed",o_e="http.response_content_length",i_e="http.response_content_length_uncompressed",s_e="http.server_name",a_e="http.route",u_e="http.client_ip",c_e="aws.dynamodb.table_names",l_e="aws.dynamodb.consumed_capacity",d_e="aws.dynamodb.item_collection_metrics",p_e="aws.dynamodb.provisioned_read_capacity",f_e="aws.dynamodb.provisioned_write_capacity",m_e="aws.dynamodb.consistent_read",A_e="aws.dynamodb.projection",g_e="aws.dynamodb.limit",h_e="aws.dynamodb.attributes_to_get",__e="aws.dynamodb.index_name",E_e="aws.dynamodb.select",y_e="aws.dynamodb.global_secondary_indexes",S_e="aws.dynamodb.local_secondary_indexes",T_e="aws.dynamodb.exclusive_start_table",b_e="aws.dynamodb.table_count",I_e="aws.dynamodb.scan_forward",C_e="aws.dynamodb.segment",v_e="aws.dynamodb.total_segments",R_e="aws.dynamodb.count",x_e="aws.dynamodb.scanned_count",D_e="aws.dynamodb.attribute_definitions",N_e="aws.dynamodb.global_secondary_index_updates",w_e="messaging.system",B_e="messaging.destination",k_e="messaging.destination_kind",O_e="messaging.temp_destination",P_e="messaging.protocol",M_e="messaging.protocol_version",L_e="messaging.url",U_e="messaging.message_id",Q_e="messaging.conversation_id",F_e="messaging.message_payload_size_bytes",G_e="messaging.message_payload_compressed_size_bytes",j_e="messaging.operation",z_e="messaging.consumer_id",H_e="messaging.rabbitmq.routing_key",$_e="messaging.kafka.message_key",q_e="messaging.kafka.consumer_group",V_e="messaging.kafka.client_id",Y_e="messaging.kafka.partition",K_e="messaging.kafka.tombstone",J_e="rpc.system",Z_e="rpc.service",W_e="rpc.method",X_e="rpc.grpc.status_code",eEe="rpc.jsonrpc.version",tEe="rpc.jsonrpc.request_id",nEe="rpc.jsonrpc.error_code",rEe="rpc.jsonrpc.error_message",oEe="message.type",iEe="message.id",sEe="message.compressed_size",aEe="message.uncompressed_size",Art=jge,hV=zge,grt=Hge,hrt=$ge,_rt=qge,Ert=Vge,_V=Yge,yrt=Kge,Srt=Jge,Trt=Zge,brt=Wge,Irt=Xge,Crt=ehe,vrt=the,Rrt=nhe,xrt=rhe,Drt=ohe,Nrt=ihe,wrt=she,Brt=ahe,krt=uhe,Ort=che,Prt=lhe,Mrt=dhe,Lrt=phe,EV=fhe,Urt=mhe,Qrt=Ahe,Frt=ghe,Grt=hhe,jrt=_he,zrt=Ehe,Hrt=yhe,$rt=She,qrt=The,Vrt=bhe,Yrt=Ihe,Krt=Che,yV=vhe,Jrt=Rhe,Zrt=xhe,SV=Dhe,TV=Nhe,Wrt=whe,Xrt=Bhe,eot=khe,tot=Ohe,not=Phe,rot=Mhe,oot=Lhe,iot=Uhe,sot=Qhe,aot=Fhe,uot=Ghe,cot=jhe,lot=zhe,dot=Hhe,pot=$he,fot=qhe,mot=Vhe,_w=Yhe,UC=Khe,bV=Jhe,Aot=Zhe,got=Whe,fS=Xhe,hot=e_e,_ot=t_e,Eot=n_e,yot=r_e,IV=o_e,CV=i_e,Sot=s_e,vV=a_e,Tot=u_e,bot=c_e,Iot=l_e,Cot=d_e,vot=p_e,Rot=f_e,xot=m_e,Dot=A_e,Not=g_e,wot=h_e,Bot=__e,kot=E_e,Oot=y_e,Pot=S_e,Mot=T_e,Lot=b_e,Uot=I_e,Qot=C_e,Fot=v_e,Got=R_e,jot=x_e,zot=D_e,Hot=N_e,RV=w_e,$ot=B_e,qot=k_e,Vot=O_e,Yot=P_e,Kot=M_e,Jot=L_e,Zot=U_e,Wot=Q_e,Xot=F_e,eit=G_e,tit=j_e,nit=z_e,rit=H_e,oit=$_e,iit=q_e,sit=V_e,ait=Y_e,uit=K_e,cit=J_e,xV=Z_e,lit=W_e,DV=X_e,dit=eEe,pit=tEe,fit=nEe,mit=rEe,Ait=oEe,git=iEe,hit=sEe,_it=aEe,Eit=Mi([jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,whe,Bhe,khe,Ohe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,w_e,B_e,k_e,O_e,P_e,M_e,L_e,U_e,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe]),uEe="other_sql",cEe="mssql",lEe="mysql",dEe="oracle",pEe="db2",fEe="postgresql",mEe="redshift",AEe="hive",gEe="cloudscape",hEe="hsqldb",_Ee="progress",EEe="maxdb",yEe="hanadb",SEe="ingres",TEe="firstsql",bEe="edb",IEe="cache",CEe="adabas",vEe="firebird",REe="derby",xEe="filemaker",DEe="informix",NEe="instantdb",wEe="interbase",BEe="mariadb",kEe="netezza",OEe="pervasive",PEe="pointbase",MEe="sqlite",LEe="sybase",UEe="teradata",QEe="vertica",FEe="h2",GEe="coldfusion",jEe="cassandra",zEe="hbase",HEe="mongodb",$Ee="redis",qEe="couchbase",VEe="couchdb",YEe="cosmosdb",KEe="dynamodb",JEe="neo4j",ZEe="geode",WEe="elasticsearch",XEe="memcached",eye="cockroachdb",yit=uEe,Sit=cEe,Tit=lEe,bit=dEe,Iit=pEe,Cit=fEe,vit=mEe,Rit=AEe,xit=gEe,Dit=hEe,Nit=_Ee,wit=EEe,Bit=yEe,kit=SEe,Oit=TEe,Pit=bEe,Mit=IEe,Lit=CEe,Uit=vEe,Qit=REe,Fit=xEe,Git=DEe,jit=NEe,zit=wEe,Hit=BEe,$it=kEe,qit=OEe,Vit=PEe,Yit=MEe,Kit=LEe,Jit=UEe,Zit=QEe,Wit=FEe,Xit=GEe,est=jEe,tst=zEe,nst=HEe,rst=$Ee,ost=qEe,ist=VEe,sst=YEe,ast=KEe,ust=JEe,cst=ZEe,lst=WEe,dst=XEe,pst=eye,fst=Mi([uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,wEe,BEe,kEe,OEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,jEe,zEe,HEe,$Ee,qEe,VEe,YEe,KEe,JEe,ZEe,WEe,XEe,eye]),tye="all",nye="each_quorum",rye="quorum",oye="local_quorum",iye="one",sye="two",aye="three",uye="local_one",cye="any",lye="serial",dye="local_serial",mst=tye,Ast=nye,gst=rye,hst=oye,_st=iye,Est=sye,yst=aye,Sst=uye,Tst=cye,bst=lye,Ist=dye,Cst=Mi([tye,nye,rye,oye,iye,sye,aye,uye,cye,lye,dye]),pye="datasource",fye="http",mye="pubsub",Aye="timer",gye="other",vst=pye,Rst=fye,xst=mye,Dst=Aye,Nst=gye,wst=Mi([pye,fye,mye,Aye,gye]),hye="insert",_ye="edit",Eye="delete",Bst=hye,kst=_ye,Ost=Eye,Pst=Mi([hye,_ye,Eye]),yye="alibaba_cloud",Sye="aws",Tye="azure",bye="gcp",Mst=yye,Lst=Sye,Ust=Tye,Qst=bye,Fst=Mi([yye,Sye,Tye,bye]),Iye="ip_tcp",Cye="ip_udp",vye="ip",Rye="unix",xye="pipe",Dye="inproc",Nye="other",Gst=Iye,jst=Cye,zst=vye,Hst=Rye,$st=xye,qst=Dye,Vst=Nye,Yst=Mi([Iye,Cye,vye,Rye,xye,Dye,Nye]),wye="wifi",Bye="wired",kye="cell",Oye="unavailable",Pye="unknown",Kst=wye,Jst=Bye,Zst=kye,Wst=Oye,Xst=Pye,eat=Mi([wye,Bye,kye,Oye,Pye]),Mye="gprs",Lye="edge",Uye="umts",Qye="cdma",Fye="evdo_0",Gye="evdo_a",jye="cdma2000_1xrtt",zye="hsdpa",Hye="hsupa",$ye="hspa",qye="iden",Vye="evdo_b",Yye="lte",Kye="ehrpd",Jye="hspap",Zye="gsm",Wye="td_scdma",Xye="iwlan",e0e="nr",t0e="nrnsa",n0e="lte_ca",tat=Mye,nat=Lye,rat=Uye,oat=Qye,iat=Fye,sat=Gye,aat=jye,uat=zye,cat=Hye,lat=$ye,dat=qye,pat=Vye,fat=Yye,mat=Kye,Aat=Jye,gat=Zye,hat=Wye,_at=Xye,Eat=e0e,yat=t0e,Sat=n0e,Tat=Mi([Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,e0e,t0e,n0e]),r0e="1.0",o0e="1.1",i0e="2.0",s0e="SPDY",a0e="QUIC",bat=r0e,Iat=o0e,Cat=i0e,vat=s0e,Rat=a0e,xat={HTTP_1_0:r0e,HTTP_1_1:o0e,HTTP_2_0:i0e,SPDY:s0e,QUIC:a0e},u0e="queue",c0e="topic",Dat=u0e,Nat=c0e,wat=Mi([u0e,c0e]),l0e="receive",d0e="process",Bat=l0e,kat=d0e,Oat=Mi([l0e,d0e]),p0e=0,f0e=1,m0e=2,A0e=3,g0e=4,h0e=5,_0e=6,E0e=7,y0e=8,S0e=9,T0e=10,b0e=11,I0e=12,C0e=13,v0e=14,R0e=15,x0e=16,Pat=p0e,Mat=f0e,Lat=m0e,Uat=A0e,Qat=g0e,Fat=h0e,Gat=_0e,jat=E0e,zat=y0e,Hat=S0e,$at=T0e,qat=b0e,Vat=I0e,Yat=C0e,Kat=v0e,Jat=R0e,Zat=x0e,Wat={OK:p0e,CANCELLED:f0e,UNKNOWN:m0e,INVALID_ARGUMENT:A0e,DEADLINE_EXCEEDED:g0e,NOT_FOUND:h0e,ALREADY_EXISTS:_0e,PERMISSION_DENIED:E0e,RESOURCE_EXHAUSTED:y0e,FAILED_PRECONDITION:S0e,ABORTED:T0e,OUT_OF_RANGE:b0e,UNIMPLEMENTED:I0e,INTERNAL:C0e,UNAVAILABLE:v0e,DATA_LOSS:R0e,UNAUTHENTICATED:x0e},D0e="SENT",N0e="RECEIVED",Xat=D0e,eut=N0e,tut=Mi([D0e,N0e])});var B0e=B(()=>{A();w0e()});var k0e,O0e,P0e,M0e,L0e,U0e,Q0e,F0e,G0e,j0e,z0e,H0e,$0e,q0e,V0e,Y0e,K0e,J0e,Z0e,W0e,X0e,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,wSe,BSe,kSe,OSe,PSe,MSe,LSe,USe,QSe,FSe,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,rTe,oTe,iTe,nut,rut,out,iut,sut,aut,uut,cut,lut,dut,put,fut,mut,Aut,gut,hut,_ut,Eut,yut,Sut,Tut,but,Iut,Cut,vut,Rut,xut,Dut,Nut,wut,But,kut,Out,Put,Mut,Lut,Uut,Qut,Fut,Gut,jut,zut,Hut,$ut,qut,Vut,Yut,Kut,Jut,Zut,Wut,Xut,ect,tct,nct,rct,oct,ict,sct,act,uct,cct,lct,dct,pct,fct,mct,Act,gct,hct,_ct,NV,Ect,yct,Sct,Tct,bct,Ict,Cct,vct,Rct,xct,sTe,aTe,uTe,cTe,Dct,Nct,wct,Bct,kct,lTe,dTe,pTe,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,bTe,ITe,CTe,vTe,Oct,Pct,Mct,Lct,Uct,Qct,Fct,Gct,jct,zct,Hct,$ct,qct,Vct,Yct,Kct,Jct,Zct,RTe,xTe,Wct,Xct,elt,DTe,NTe,wTe,BTe,kTe,OTe,PTe,tlt,nlt,rlt,olt,ilt,slt,alt,ult,MTe,LTe,UTe,QTe,FTe,GTe,jTe,zTe,HTe,$Te,qTe,clt,llt,dlt,plt,flt,mlt,Alt,glt,hlt,_lt,Elt,ylt,VTe,YTe,KTe,JTe,ZTe,WTe,XTe,ebe,tbe,nbe,Slt,Tlt,blt,Ilt,Clt,vlt,Rlt,xlt,Dlt,Nlt,wlt,rbe=B(()=>{A();gV();k0e="cloud.provider",O0e="cloud.account.id",P0e="cloud.region",M0e="cloud.availability_zone",L0e="cloud.platform",U0e="aws.ecs.container.arn",Q0e="aws.ecs.cluster.arn",F0e="aws.ecs.launchtype",G0e="aws.ecs.task.arn",j0e="aws.ecs.task.family",z0e="aws.ecs.task.revision",H0e="aws.eks.cluster.arn",$0e="aws.log.group.names",q0e="aws.log.group.arns",V0e="aws.log.stream.names",Y0e="aws.log.stream.arns",K0e="container.name",J0e="container.id",Z0e="container.runtime",W0e="container.image.name",X0e="container.image.tag",eSe="deployment.environment",tSe="device.id",nSe="device.model.identifier",rSe="device.model.name",oSe="faas.name",iSe="faas.id",sSe="faas.version",aSe="faas.instance",uSe="faas.max_memory",cSe="host.id",lSe="host.name",dSe="host.type",pSe="host.arch",fSe="host.image.name",mSe="host.image.id",ASe="host.image.version",gSe="k8s.cluster.name",hSe="k8s.node.name",_Se="k8s.node.uid",ESe="k8s.namespace.name",ySe="k8s.pod.uid",SSe="k8s.pod.name",TSe="k8s.container.name",bSe="k8s.replicaset.uid",ISe="k8s.replicaset.name",CSe="k8s.deployment.uid",vSe="k8s.deployment.name",RSe="k8s.statefulset.uid",xSe="k8s.statefulset.name",DSe="k8s.daemonset.uid",NSe="k8s.daemonset.name",wSe="k8s.job.uid",BSe="k8s.job.name",kSe="k8s.cronjob.uid",OSe="k8s.cronjob.name",PSe="os.type",MSe="os.description",LSe="os.name",USe="os.version",QSe="process.pid",FSe="process.executable.name",GSe="process.executable.path",jSe="process.command",zSe="process.command_line",HSe="process.command_args",$Se="process.owner",qSe="process.runtime.name",VSe="process.runtime.version",YSe="process.runtime.description",KSe="service.name",JSe="service.namespace",ZSe="service.instance.id",WSe="service.version",XSe="telemetry.sdk.name",eTe="telemetry.sdk.language",tTe="telemetry.sdk.version",nTe="telemetry.auto.version",rTe="webengine.name",oTe="webengine.version",iTe="webengine.description",nut=k0e,rut=O0e,out=P0e,iut=M0e,sut=L0e,aut=U0e,uut=Q0e,cut=F0e,lut=G0e,dut=j0e,put=z0e,fut=H0e,mut=$0e,Aut=q0e,gut=V0e,hut=Y0e,_ut=K0e,Eut=J0e,yut=Z0e,Sut=W0e,Tut=X0e,but=eSe,Iut=tSe,Cut=nSe,vut=rSe,Rut=oSe,xut=iSe,Dut=sSe,Nut=aSe,wut=uSe,But=cSe,kut=lSe,Out=dSe,Put=pSe,Mut=fSe,Lut=mSe,Uut=ASe,Qut=gSe,Fut=hSe,Gut=_Se,jut=ESe,zut=ySe,Hut=SSe,$ut=TSe,qut=bSe,Vut=ISe,Yut=CSe,Kut=vSe,Jut=RSe,Zut=xSe,Wut=DSe,Xut=NSe,ect=wSe,tct=BSe,nct=kSe,rct=OSe,oct=PSe,ict=MSe,sct=LSe,act=USe,uct=QSe,cct=FSe,lct=GSe,dct=jSe,pct=zSe,fct=HSe,mct=$Se,Act=qSe,gct=VSe,hct=YSe,_ct=KSe,NV=JSe,Ect=ZSe,yct=WSe,Sct=XSe,Tct=eTe,bct=tTe,Ict=nTe,Cct=rTe,vct=oTe,Rct=iTe,xct=Mi([k0e,O0e,P0e,M0e,L0e,U0e,Q0e,F0e,G0e,j0e,z0e,H0e,$0e,q0e,V0e,Y0e,K0e,J0e,Z0e,W0e,X0e,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,wSe,BSe,kSe,OSe,PSe,MSe,LSe,USe,QSe,FSe,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,rTe,oTe,iTe]),sTe="alibaba_cloud",aTe="aws",uTe="azure",cTe="gcp",Dct=sTe,Nct=aTe,wct=uTe,Bct=cTe,kct=Mi([sTe,aTe,uTe,cTe]),lTe="alibaba_cloud_ecs",dTe="alibaba_cloud_fc",pTe="aws_ec2",fTe="aws_ecs",mTe="aws_eks",ATe="aws_lambda",gTe="aws_elastic_beanstalk",hTe="azure_vm",_Te="azure_container_instances",ETe="azure_aks",yTe="azure_functions",STe="azure_app_service",TTe="gcp_compute_engine",bTe="gcp_cloud_run",ITe="gcp_kubernetes_engine",CTe="gcp_cloud_functions",vTe="gcp_app_engine",Oct=lTe,Pct=dTe,Mct=pTe,Lct=fTe,Uct=mTe,Qct=ATe,Fct=gTe,Gct=hTe,jct=_Te,zct=ETe,Hct=yTe,$ct=STe,qct=TTe,Vct=bTe,Yct=ITe,Kct=CTe,Jct=vTe,Zct=Mi([lTe,dTe,pTe,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,bTe,ITe,CTe,vTe]),RTe="ec2",xTe="fargate",Wct=RTe,Xct=xTe,elt=Mi([RTe,xTe]),DTe="amd64",NTe="arm32",wTe="arm64",BTe="ia64",kTe="ppc32",OTe="ppc64",PTe="x86",tlt=DTe,nlt=NTe,rlt=wTe,olt=BTe,ilt=kTe,slt=OTe,alt=PTe,ult=Mi([DTe,NTe,wTe,BTe,kTe,OTe,PTe]),MTe="windows",LTe="linux",UTe="darwin",QTe="freebsd",FTe="netbsd",GTe="openbsd",jTe="dragonflybsd",zTe="hpux",HTe="aix",$Te="solaris",qTe="z_os",clt=MTe,llt=LTe,dlt=UTe,plt=QTe,flt=FTe,mlt=GTe,Alt=jTe,glt=zTe,hlt=HTe,_lt=$Te,Elt=qTe,ylt=Mi([MTe,LTe,UTe,QTe,FTe,GTe,jTe,zTe,HTe,$Te,qTe]),VTe="cpp",YTe="dotnet",KTe="erlang",JTe="go",ZTe="java",WTe="nodejs",XTe="php",ebe="python",tbe="ruby",nbe="webjs",Slt=VTe,Tlt=YTe,blt=KTe,Ilt=JTe,Clt=ZTe,vlt=WTe,Rlt=XTe,xlt=ebe,Dlt=tbe,Nlt=nbe,wlt=Mi([VTe,YTe,KTe,JTe,ZTe,WTe,XTe,ebe,tbe,nbe])});var obe=B(()=>{A();rbe()});var Blt,klt,Olt,Plt,Mlt,Llt,Ult,Qlt,Flt,Glt,jlt,zlt,Hlt,$lt,qlt,Vlt,Ylt,Klt,Jlt,Zlt,Wlt,Xlt,edt,tdt,ndt,wV,BV,rdt,QC,odt,kV,OV,idt,mS,sdt,adt,udt,cdt,ldt,ddt,pdt,fdt,Yan,Kan,PV,mdt,Adt,gdt,hdt,_dt,Edt,AS,ydt,Sdt,Tdt,Jan,bdt,Idt,Cdt,vdt,Zan,Rdt,xdt,Ddt,Ndt,Cg,vg,wdt,Bdt,kdt,Odt,Pdt,Mdt,Ldt,Udt,Qdt,Wan,Fdt,Gdt,jdt,zdt,Hdt,$dt,MV,LV,qdt,UV,QV,Vdt,Ydt,Xan,eun,Kdt,Jdt,Zdt,Wdt,Xdt,ept,tpt,npt,tun,rpt,FV,GV,opt,jV,ipt,zV,spt,apt,upt,cpt,lpt,dpt,ppt,fpt,mpt,nun,Apt,gpt,run,hpt,_pt,oun,Ept,ypt,Spt,Tpt,bpt,Ipt,Cpt,vpt,D_,Rpt,xpt,Dpt,HV,ibe=B(()=>{A();Blt="aspnetcore.diagnostics.exception.result",klt="aborted",Olt="handled",Plt="skipped",Mlt="unhandled",Llt="aspnetcore.diagnostics.handler.type",Ult="aspnetcore.rate_limiting.policy",Qlt="aspnetcore.rate_limiting.result",Flt="acquired",Glt="endpoint_limiter",jlt="global_limiter",zlt="request_canceled",Hlt="aspnetcore.request.is_unhandled",$lt="aspnetcore.routing.is_fallback",qlt="aspnetcore.routing.match_status",Vlt="failure",Ylt="success",Klt="aspnetcore.user.is_authenticated",Jlt="client.address",Zlt="client.port",Wlt="code.column.number",Xlt="code.file.path",edt="code.function.name",tdt="code.line.number",ndt="code.stacktrace",wV="db.collection.name",BV="db.namespace",rdt="db.operation.batch.size",QC="db.operation.name",odt="db.query.summary",kV="db.query.text",OV="db.response.status_code",idt="db.stored_procedure.name",mS="db.system.name",sdt="mariadb",adt="microsoft.sql_server",udt="mysql",cdt="postgresql",ldt="dotnet.gc.heap.generation",ddt="gen0",pdt="gen1",fdt="gen2",Yan="loh",Kan="poh",PV="error.type",mdt="_OTHER",Adt="exception.escaped",gdt="exception.message",hdt="exception.stacktrace",_dt="exception.type",Edt=e=>`http.request.header.${e}`,AS="http.request.method",ydt="_OTHER",Sdt="CONNECT",Tdt="DELETE",Jan="GET",bdt="HEAD",Idt="OPTIONS",Cdt="PATCH",vdt="POST",Zan="PUT",Rdt="TRACE",xdt="http.request.method_original",Ddt="http.request.resend_count",Ndt=e=>`http.response.header.${e}`,Cg="http.response.status_code",vg="http.route",wdt="jvm.gc.action",Bdt="jvm.gc.name",kdt="jvm.memory.pool.name",Odt="jvm.memory.type",Pdt="heap",Mdt="non_heap",Ldt="jvm.thread.daemon",Udt="jvm.thread.state",Qdt="blocked",Wan="new",Fdt="runnable",Gdt="terminated",jdt="timed_waiting",zdt="waiting",Hdt="network.local.address",$dt="network.local.port",MV="network.peer.address",LV="network.peer.port",qdt="network.protocol.name",UV="network.protocol.version",QV="network.transport",Vdt="pipe",Ydt="quic",Xan="tcp",eun="udp",Kdt="unix",Jdt="network.type",Zdt="ipv4",Wdt="ipv6",Xdt="otel.scope.name",ept="otel.scope.version",tpt="otel.status_code",npt="ERROR",tun="OK",rpt="otel.status_description",FV="server.address",GV="server.port",opt="service.instance.id",jV="service.name",ipt="service.namespace",zV="service.version",spt="signalr.connection.status",apt="app_shutdown",upt="normal_closure",cpt="timeout",lpt="signalr.transport",dpt="long_polling",ppt="server_sent_events",fpt="web_sockets",mpt="telemetry.sdk.language",nun="cpp",Apt="dotnet",gpt="erlang",run="go",hpt="java",_pt="nodejs",oun="php",Ept="python",ypt="ruby",Spt="rust",Tpt="swift",bpt="webjs",Ipt="telemetry.sdk.name",Cpt="telemetry.sdk.version",vpt="url.fragment",D_="url.full",Rpt="url.path",xpt="url.query",Dpt="url.scheme",HV="user_agent.original"});var Npt,wpt,Bpt,kpt,Opt,Ppt,Mpt,Lpt,Upt,Qpt,Fpt,Gpt,jpt,zpt,Hpt,$pt,qpt,Vpt,Ypt,Kpt,Jpt,Zpt,Wpt,Xpt,eft,tft,nft,rft,oft,ift,sft,aft,uft,cft,lft,dft,pft,fft,mft,Aft,gft,hft,_ft,Eft,yft,Sft,Tft,bft,Ift,Cft,vft,sbe=B(()=>{A();Npt="aspnetcore.diagnostics.exceptions",wpt="aspnetcore.rate_limiting.active_request_leases",Bpt="aspnetcore.rate_limiting.queued_requests",kpt="aspnetcore.rate_limiting.request.time_in_queue",Opt="aspnetcore.rate_limiting.request_lease.duration",Ppt="aspnetcore.rate_limiting.requests",Mpt="aspnetcore.routing.match_attempts",Lpt="db.client.operation.duration",Upt="dotnet.assembly.count",Qpt="dotnet.exceptions",Fpt="dotnet.gc.collections",Gpt="dotnet.gc.heap.total_allocated",jpt="dotnet.gc.last_collection.heap.fragmentation.size",zpt="dotnet.gc.last_collection.heap.size",Hpt="dotnet.gc.last_collection.memory.committed_size",$pt="dotnet.gc.pause.time",qpt="dotnet.jit.compilation.time",Vpt="dotnet.jit.compiled_il.size",Ypt="dotnet.jit.compiled_methods",Kpt="dotnet.monitor.lock_contentions",Jpt="dotnet.process.cpu.count",Zpt="dotnet.process.cpu.time",Wpt="dotnet.process.memory.working_set",Xpt="dotnet.thread_pool.queue.length",eft="dotnet.thread_pool.thread.count",tft="dotnet.thread_pool.work_item.count",nft="dotnet.timer.count",rft="http.client.request.duration",oft="http.server.request.duration",ift="jvm.class.count",sft="jvm.class.loaded",aft="jvm.class.unloaded",uft="jvm.cpu.count",cft="jvm.cpu.recent_utilization",lft="jvm.cpu.time",dft="jvm.gc.duration",pft="jvm.memory.committed",fft="jvm.memory.limit",mft="jvm.memory.used",Aft="jvm.memory.used_after_last_gc",gft="jvm.thread.count",hft="kestrel.active_connections",_ft="kestrel.active_tls_handshakes",Eft="kestrel.connection.duration",yft="kestrel.queued_connections",Sft="kestrel.queued_requests",Tft="kestrel.rejected_connections",bft="kestrel.tls_handshake.duration",Ift="kestrel.upgraded_connections",Cft="signalr.server.active_connections",vft="signalr.server.connection.duration"});var Rft,abe=B(()=>{A();Rft="exception"});var qr={};Ws(qr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>klt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Olt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Plt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Mlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>Flt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Glt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>jlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>zlt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>Vlt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Ylt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Blt,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Llt,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Ult,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Qlt,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Hlt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>$lt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>qlt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Klt,ATTR_CLIENT_ADDRESS:()=>Jlt,ATTR_CLIENT_PORT:()=>Zlt,ATTR_CODE_COLUMN_NUMBER:()=>Wlt,ATTR_CODE_FILE_PATH:()=>Xlt,ATTR_CODE_FUNCTION_NAME:()=>edt,ATTR_CODE_LINE_NUMBER:()=>tdt,ATTR_CODE_STACKTRACE:()=>ndt,ATTR_DB_COLLECTION_NAME:()=>wV,ATTR_DB_NAMESPACE:()=>BV,ATTR_DB_OPERATION_BATCH_SIZE:()=>rdt,ATTR_DB_OPERATION_NAME:()=>QC,ATTR_DB_QUERY_SUMMARY:()=>odt,ATTR_DB_QUERY_TEXT:()=>kV,ATTR_DB_RESPONSE_STATUS_CODE:()=>OV,ATTR_DB_STORED_PROCEDURE_NAME:()=>idt,ATTR_DB_SYSTEM_NAME:()=>mS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>ldt,ATTR_ERROR_TYPE:()=>PV,ATTR_EXCEPTION_ESCAPED:()=>Adt,ATTR_EXCEPTION_MESSAGE:()=>gdt,ATTR_EXCEPTION_STACKTRACE:()=>hdt,ATTR_EXCEPTION_TYPE:()=>_dt,ATTR_HTTP_REQUEST_HEADER:()=>Edt,ATTR_HTTP_REQUEST_METHOD:()=>AS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>xdt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Ddt,ATTR_HTTP_RESPONSE_HEADER:()=>Ndt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>Cg,ATTR_HTTP_ROUTE:()=>vg,ATTR_JVM_GC_ACTION:()=>wdt,ATTR_JVM_GC_NAME:()=>Bdt,ATTR_JVM_MEMORY_POOL_NAME:()=>kdt,ATTR_JVM_MEMORY_TYPE:()=>Odt,ATTR_JVM_THREAD_DAEMON:()=>Ldt,ATTR_JVM_THREAD_STATE:()=>Udt,ATTR_NETWORK_LOCAL_ADDRESS:()=>Hdt,ATTR_NETWORK_LOCAL_PORT:()=>$dt,ATTR_NETWORK_PEER_ADDRESS:()=>MV,ATTR_NETWORK_PEER_PORT:()=>LV,ATTR_NETWORK_PROTOCOL_NAME:()=>qdt,ATTR_NETWORK_PROTOCOL_VERSION:()=>UV,ATTR_NETWORK_TRANSPORT:()=>QV,ATTR_NETWORK_TYPE:()=>Jdt,ATTR_OTEL_SCOPE_NAME:()=>Xdt,ATTR_OTEL_SCOPE_VERSION:()=>ept,ATTR_OTEL_STATUS_CODE:()=>tpt,ATTR_OTEL_STATUS_DESCRIPTION:()=>rpt,ATTR_SERVER_ADDRESS:()=>FV,ATTR_SERVER_PORT:()=>GV,ATTR_SERVICE_INSTANCE_ID:()=>opt,ATTR_SERVICE_NAME:()=>jV,ATTR_SERVICE_NAMESPACE:()=>ipt,ATTR_SERVICE_VERSION:()=>zV,ATTR_SIGNALR_CONNECTION_STATUS:()=>spt,ATTR_SIGNALR_TRANSPORT:()=>lpt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>mpt,ATTR_TELEMETRY_SDK_NAME:()=>Ipt,ATTR_TELEMETRY_SDK_VERSION:()=>Cpt,ATTR_URL_FRAGMENT:()=>vpt,ATTR_URL_FULL:()=>D_,ATTR_URL_PATH:()=>Rpt,ATTR_URL_QUERY:()=>xpt,ATTR_URL_SCHEME:()=>Dpt,ATTR_USER_AGENT_ORIGINAL:()=>HV,AWSECSLAUNCHTYPEVALUES_EC2:()=>Wct,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Xct,AwsEcsLaunchtypeValues:()=>elt,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Oct,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Pct,CLOUDPLATFORMVALUES_AWS_EC2:()=>Mct,CLOUDPLATFORMVALUES_AWS_ECS:()=>Lct,CLOUDPLATFORMVALUES_AWS_EKS:()=>Uct,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Fct,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Qct,CLOUDPLATFORMVALUES_AZURE_AKS:()=>zct,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>$ct,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>jct,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Hct,CLOUDPLATFORMVALUES_AZURE_VM:()=>Gct,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Jct,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Kct,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Vct,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>qct,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Yct,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Dct,CLOUDPROVIDERVALUES_AWS:()=>Nct,CLOUDPROVIDERVALUES_AZURE:()=>wct,CLOUDPROVIDERVALUES_GCP:()=>Bct,CloudPlatformValues:()=>Zct,CloudProviderValues:()=>kct,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>mst,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Tst,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Ast,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Sst,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>hst,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Ist,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>_st,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>gst,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>bst,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>yst,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Est,DBSYSTEMVALUES_ADABAS:()=>Lit,DBSYSTEMVALUES_CACHE:()=>Mit,DBSYSTEMVALUES_CASSANDRA:()=>est,DBSYSTEMVALUES_CLOUDSCAPE:()=>xit,DBSYSTEMVALUES_COCKROACHDB:()=>pst,DBSYSTEMVALUES_COLDFUSION:()=>Xit,DBSYSTEMVALUES_COSMOSDB:()=>sst,DBSYSTEMVALUES_COUCHBASE:()=>ost,DBSYSTEMVALUES_COUCHDB:()=>ist,DBSYSTEMVALUES_DB2:()=>Iit,DBSYSTEMVALUES_DERBY:()=>Qit,DBSYSTEMVALUES_DYNAMODB:()=>ast,DBSYSTEMVALUES_EDB:()=>Pit,DBSYSTEMVALUES_ELASTICSEARCH:()=>lst,DBSYSTEMVALUES_FILEMAKER:()=>Fit,DBSYSTEMVALUES_FIREBIRD:()=>Uit,DBSYSTEMVALUES_FIRSTSQL:()=>Oit,DBSYSTEMVALUES_GEODE:()=>cst,DBSYSTEMVALUES_H2:()=>Wit,DBSYSTEMVALUES_HANADB:()=>Bit,DBSYSTEMVALUES_HBASE:()=>tst,DBSYSTEMVALUES_HIVE:()=>Rit,DBSYSTEMVALUES_HSQLDB:()=>Dit,DBSYSTEMVALUES_INFORMIX:()=>Git,DBSYSTEMVALUES_INGRES:()=>kit,DBSYSTEMVALUES_INSTANTDB:()=>jit,DBSYSTEMVALUES_INTERBASE:()=>zit,DBSYSTEMVALUES_MARIADB:()=>Hit,DBSYSTEMVALUES_MAXDB:()=>wit,DBSYSTEMVALUES_MEMCACHED:()=>dst,DBSYSTEMVALUES_MONGODB:()=>nst,DBSYSTEMVALUES_MSSQL:()=>Sit,DBSYSTEMVALUES_MYSQL:()=>Tit,DBSYSTEMVALUES_NEO4J:()=>ust,DBSYSTEMVALUES_NETEZZA:()=>$it,DBSYSTEMVALUES_ORACLE:()=>bit,DBSYSTEMVALUES_OTHER_SQL:()=>yit,DBSYSTEMVALUES_PERVASIVE:()=>qit,DBSYSTEMVALUES_POINTBASE:()=>Vit,DBSYSTEMVALUES_POSTGRESQL:()=>Cit,DBSYSTEMVALUES_PROGRESS:()=>Nit,DBSYSTEMVALUES_REDIS:()=>rst,DBSYSTEMVALUES_REDSHIFT:()=>vit,DBSYSTEMVALUES_SQLITE:()=>Yit,DBSYSTEMVALUES_SYBASE:()=>Kit,DBSYSTEMVALUES_TERADATA:()=>Jit,DBSYSTEMVALUES_VERTICA:()=>Zit,DB_SYSTEM_NAME_VALUE_MARIADB:()=>sdt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>adt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>udt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>cdt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>ddt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>pdt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>fdt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Yan,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Kan,DbCassandraConsistencyLevelValues:()=>Cst,DbSystemValues:()=>fst,ERROR_TYPE_VALUE_OTHER:()=>mdt,EVENT_EXCEPTION:()=>Rft,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Ost,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>kst,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Bst,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Mst,FAASINVOKEDPROVIDERVALUES_AWS:()=>Lst,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Ust,FAASINVOKEDPROVIDERVALUES_GCP:()=>Qst,FAASTRIGGERVALUES_DATASOURCE:()=>vst,FAASTRIGGERVALUES_HTTP:()=>Rst,FAASTRIGGERVALUES_OTHER:()=>Nst,FAASTRIGGERVALUES_PUBSUB:()=>xst,FAASTRIGGERVALUES_TIMER:()=>Dst,FaasDocumentOperationValues:()=>Pst,FaasInvokedProviderValues:()=>Fst,FaasTriggerValues:()=>wst,HOSTARCHVALUES_AMD64:()=>tlt,HOSTARCHVALUES_ARM32:()=>nlt,HOSTARCHVALUES_ARM64:()=>rlt,HOSTARCHVALUES_IA64:()=>olt,HOSTARCHVALUES_PPC32:()=>ilt,HOSTARCHVALUES_PPC64:()=>slt,HOSTARCHVALUES_X86:()=>alt,HTTPFLAVORVALUES_HTTP_1_0:()=>bat,HTTPFLAVORVALUES_HTTP_1_1:()=>Iat,HTTPFLAVORVALUES_HTTP_2_0:()=>Cat,HTTPFLAVORVALUES_QUIC:()=>Rat,HTTPFLAVORVALUES_SPDY:()=>vat,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Sdt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Tdt,HTTP_REQUEST_METHOD_VALUE_GET:()=>Jan,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>bdt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Idt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>ydt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Cdt,HTTP_REQUEST_METHOD_VALUE_POST:()=>vdt,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Zan,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Rdt,HostArchValues:()=>ult,HttpFlavorValues:()=>xat,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Pdt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Mdt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Qdt,JVM_THREAD_STATE_VALUE_NEW:()=>Wan,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Fdt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Gdt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>jdt,JVM_THREAD_STATE_VALUE_WAITING:()=>zdt,MESSAGETYPEVALUES_RECEIVED:()=>eut,MESSAGETYPEVALUES_SENT:()=>Xat,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Dat,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Nat,MESSAGINGOPERATIONVALUES_PROCESS:()=>kat,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Bat,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Npt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>wpt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Bpt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Ppt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Opt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>kpt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Mpt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Lpt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Upt,METRIC_DOTNET_EXCEPTIONS:()=>Qpt,METRIC_DOTNET_GC_COLLECTIONS:()=>Fpt,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>Gpt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>jpt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>zpt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Hpt,METRIC_DOTNET_GC_PAUSE_TIME:()=>$pt,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>qpt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Vpt,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Ypt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Kpt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>Jpt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>Zpt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>Wpt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>Xpt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>eft,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>tft,METRIC_DOTNET_TIMER_COUNT:()=>nft,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>rft,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>oft,METRIC_JVM_CLASS_COUNT:()=>ift,METRIC_JVM_CLASS_LOADED:()=>sft,METRIC_JVM_CLASS_UNLOADED:()=>aft,METRIC_JVM_CPU_COUNT:()=>uft,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>cft,METRIC_JVM_CPU_TIME:()=>lft,METRIC_JVM_GC_DURATION:()=>dft,METRIC_JVM_MEMORY_COMMITTED:()=>pft,METRIC_JVM_MEMORY_LIMIT:()=>fft,METRIC_JVM_MEMORY_USED:()=>mft,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Aft,METRIC_JVM_THREAD_COUNT:()=>gft,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>hft,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>_ft,METRIC_KESTREL_CONNECTION_DURATION:()=>Eft,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>yft,METRIC_KESTREL_QUEUED_REQUESTS:()=>Sft,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Tft,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>bft,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Ift,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Cft,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>vft,MessageTypeValues:()=>tut,MessagingDestinationKindValues:()=>wat,MessagingOperationValues:()=>Oat,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>oat,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>aat,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>nat,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>mat,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>iat,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>sat,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>pat,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>tat,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>gat,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>uat,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>lat,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Aat,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>cat,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>dat,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>_at,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>fat,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Sat,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Eat,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>yat,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>hat,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>rat,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Zst,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>Wst,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Xst,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Kst,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>Jst,NETTRANSPORTVALUES_INPROC:()=>qst,NETTRANSPORTVALUES_IP:()=>zst,NETTRANSPORTVALUES_IP_TCP:()=>Gst,NETTRANSPORTVALUES_IP_UDP:()=>jst,NETTRANSPORTVALUES_OTHER:()=>Vst,NETTRANSPORTVALUES_PIPE:()=>$st,NETTRANSPORTVALUES_UNIX:()=>Hst,NETWORK_TRANSPORT_VALUE_PIPE:()=>Vdt,NETWORK_TRANSPORT_VALUE_QUIC:()=>Ydt,NETWORK_TRANSPORT_VALUE_TCP:()=>Xan,NETWORK_TRANSPORT_VALUE_UDP:()=>eun,NETWORK_TRANSPORT_VALUE_UNIX:()=>Kdt,NETWORK_TYPE_VALUE_IPV4:()=>Zdt,NETWORK_TYPE_VALUE_IPV6:()=>Wdt,NetHostConnectionSubtypeValues:()=>Tat,NetHostConnectionTypeValues:()=>eat,NetTransportValues:()=>Yst,OSTYPEVALUES_AIX:()=>hlt,OSTYPEVALUES_DARWIN:()=>dlt,OSTYPEVALUES_DRAGONFLYBSD:()=>Alt,OSTYPEVALUES_FREEBSD:()=>plt,OSTYPEVALUES_HPUX:()=>glt,OSTYPEVALUES_LINUX:()=>llt,OSTYPEVALUES_NETBSD:()=>flt,OSTYPEVALUES_OPENBSD:()=>mlt,OSTYPEVALUES_SOLARIS:()=>_lt,OSTYPEVALUES_WINDOWS:()=>clt,OSTYPEVALUES_Z_OS:()=>Elt,OTEL_STATUS_CODE_VALUE_ERROR:()=>npt,OTEL_STATUS_CODE_VALUE_OK:()=>tun,OsTypeValues:()=>ylt,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>$at,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Gat,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Mat,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Jat,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Qat,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Hat,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Yat,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Uat,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Fat,RPCGRPCSTATUSCODEVALUES_OK:()=>Pat,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>qat,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>jat,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>zat,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Zat,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Kat,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Vat,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Lat,RpcGrpcStatusCodeValues:()=>Wat,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>wot,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>zot,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>xot,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Iot,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Got,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Mot,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Oot,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Hot,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Bot,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Cot,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Not,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Pot,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Dot,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>vot,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Rot,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>jot,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Uot,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Qot,SEMATTRS_AWS_DYNAMODB_SELECT:()=>kot,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Lot,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>bot,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Fot,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Art,SEMATTRS_CODE_FILEPATH:()=>fot,SEMATTRS_CODE_FUNCTION:()=>dot,SEMATTRS_CODE_LINENO:()=>mot,SEMATTRS_CODE_NAMESPACE:()=>pot,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Irt,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Drt,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>xrt,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>vrt,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Trt,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>brt,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Rrt,SEMATTRS_DB_CASSANDRA_TABLE:()=>Crt,SEMATTRS_DB_CONNECTION_STRING:()=>grt,SEMATTRS_DB_HBASE_NAMESPACE:()=>Nrt,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>_rt,SEMATTRS_DB_MONGODB_COLLECTION:()=>Brt,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Srt,SEMATTRS_DB_NAME:()=>Ert,SEMATTRS_DB_OPERATION:()=>yrt,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>wrt,SEMATTRS_DB_SQL_TABLE:()=>krt,SEMATTRS_DB_STATEMENT:()=>_V,SEMATTRS_DB_SYSTEM:()=>hV,SEMATTRS_DB_USER:()=>hrt,SEMATTRS_ENDUSER_ID:()=>sot,SEMATTRS_ENDUSER_ROLE:()=>aot,SEMATTRS_ENDUSER_SCOPE:()=>uot,SEMATTRS_EXCEPTION_ESCAPED:()=>Lrt,SEMATTRS_EXCEPTION_MESSAGE:()=>Prt,SEMATTRS_EXCEPTION_STACKTRACE:()=>Mrt,SEMATTRS_EXCEPTION_TYPE:()=>Ort,SEMATTRS_FAAS_COLDSTART:()=>$rt,SEMATTRS_FAAS_CRON:()=>Hrt,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Qrt,SEMATTRS_FAAS_DOCUMENT_NAME:()=>jrt,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Frt,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Grt,SEMATTRS_FAAS_EXECUTION:()=>Urt,SEMATTRS_FAAS_INVOKED_NAME:()=>qrt,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Vrt,SEMATTRS_FAAS_INVOKED_REGION:()=>Yrt,SEMATTRS_FAAS_TIME:()=>zrt,SEMATTRS_FAAS_TRIGGER:()=>EV,SEMATTRS_HTTP_CLIENT_IP:()=>Tot,SEMATTRS_HTTP_FLAVOR:()=>hot,SEMATTRS_HTTP_HOST:()=>Aot,SEMATTRS_HTTP_METHOD:()=>_w,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Eot,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>yot,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>IV,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>CV,SEMATTRS_HTTP_ROUTE:()=>vV,SEMATTRS_HTTP_SCHEME:()=>got,SEMATTRS_HTTP_SERVER_NAME:()=>Sot,SEMATTRS_HTTP_STATUS_CODE:()=>fS,SEMATTRS_HTTP_TARGET:()=>bV,SEMATTRS_HTTP_URL:()=>UC,SEMATTRS_HTTP_USER_AGENT:()=>_ot,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>hit,SEMATTRS_MESSAGE_ID:()=>git,SEMATTRS_MESSAGE_TYPE:()=>Ait,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>_it,SEMATTRS_MESSAGING_CONSUMER_ID:()=>nit,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Wot,SEMATTRS_MESSAGING_DESTINATION:()=>$ot,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>qot,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>sit,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>iit,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>oit,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>ait,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>uit,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Zot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>eit,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Xot,SEMATTRS_MESSAGING_OPERATION:()=>tit,SEMATTRS_MESSAGING_PROTOCOL:()=>Yot,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Kot,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>rit,SEMATTRS_MESSAGING_SYSTEM:()=>RV,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Vot,SEMATTRS_MESSAGING_URL:()=>Jot,SEMATTRS_NET_HOST_CARRIER_ICC:()=>oot,SEMATTRS_NET_HOST_CARRIER_MCC:()=>not,SEMATTRS_NET_HOST_CARRIER_MNC:()=>rot,SEMATTRS_NET_HOST_CARRIER_NAME:()=>tot,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>eot,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>Xrt,SEMATTRS_NET_HOST_IP:()=>SV,SEMATTRS_NET_HOST_NAME:()=>Wrt,SEMATTRS_NET_HOST_PORT:()=>TV,SEMATTRS_NET_PEER_IP:()=>yV,SEMATTRS_NET_PEER_NAME:()=>Zrt,SEMATTRS_NET_PEER_PORT:()=>Jrt,SEMATTRS_NET_TRANSPORT:()=>Krt,SEMATTRS_PEER_SERVICE:()=>iot,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>DV,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>fit,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>mit,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>pit,SEMATTRS_RPC_JSONRPC_VERSION:()=>dit,SEMATTRS_RPC_METHOD:()=>lit,SEMATTRS_RPC_SERVICE:()=>xV,SEMATTRS_RPC_SYSTEM:()=>cit,SEMATTRS_THREAD_ID:()=>cot,SEMATTRS_THREAD_NAME:()=>lot,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>uut,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>aut,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>cut,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>lut,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>dut,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>put,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>fut,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Aut,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>mut,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>hut,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>gut,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>rut,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>iut,SEMRESATTRS_CLOUD_PLATFORM:()=>sut,SEMRESATTRS_CLOUD_PROVIDER:()=>nut,SEMRESATTRS_CLOUD_REGION:()=>out,SEMRESATTRS_CONTAINER_ID:()=>Eut,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Sut,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Tut,SEMRESATTRS_CONTAINER_NAME:()=>_ut,SEMRESATTRS_CONTAINER_RUNTIME:()=>yut,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>but,SEMRESATTRS_DEVICE_ID:()=>Iut,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Cut,SEMRESATTRS_DEVICE_MODEL_NAME:()=>vut,SEMRESATTRS_FAAS_ID:()=>xut,SEMRESATTRS_FAAS_INSTANCE:()=>Nut,SEMRESATTRS_FAAS_MAX_MEMORY:()=>wut,SEMRESATTRS_FAAS_NAME:()=>Rut,SEMRESATTRS_FAAS_VERSION:()=>Dut,SEMRESATTRS_HOST_ARCH:()=>Put,SEMRESATTRS_HOST_ID:()=>But,SEMRESATTRS_HOST_IMAGE_ID:()=>Lut,SEMRESATTRS_HOST_IMAGE_NAME:()=>Mut,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Uut,SEMRESATTRS_HOST_NAME:()=>kut,SEMRESATTRS_HOST_TYPE:()=>Out,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Qut,SEMRESATTRS_K8S_CONTAINER_NAME:()=>$ut,SEMRESATTRS_K8S_CRONJOB_NAME:()=>rct,SEMRESATTRS_K8S_CRONJOB_UID:()=>nct,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Xut,SEMRESATTRS_K8S_DAEMONSET_UID:()=>Wut,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Kut,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Yut,SEMRESATTRS_K8S_JOB_NAME:()=>tct,SEMRESATTRS_K8S_JOB_UID:()=>ect,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>jut,SEMRESATTRS_K8S_NODE_NAME:()=>Fut,SEMRESATTRS_K8S_NODE_UID:()=>Gut,SEMRESATTRS_K8S_POD_NAME:()=>Hut,SEMRESATTRS_K8S_POD_UID:()=>zut,SEMRESATTRS_K8S_REPLICASET_NAME:()=>Vut,SEMRESATTRS_K8S_REPLICASET_UID:()=>qut,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Zut,SEMRESATTRS_K8S_STATEFULSET_UID:()=>Jut,SEMRESATTRS_OS_DESCRIPTION:()=>ict,SEMRESATTRS_OS_NAME:()=>sct,SEMRESATTRS_OS_TYPE:()=>oct,SEMRESATTRS_OS_VERSION:()=>act,SEMRESATTRS_PROCESS_COMMAND:()=>dct,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>fct,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>pct,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>cct,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>lct,SEMRESATTRS_PROCESS_OWNER:()=>mct,SEMRESATTRS_PROCESS_PID:()=>uct,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>hct,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Act,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>gct,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Ect,SEMRESATTRS_SERVICE_NAME:()=>_ct,SEMRESATTRS_SERVICE_NAMESPACE:()=>NV,SEMRESATTRS_SERVICE_VERSION:()=>yct,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Ict,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Tct,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Sct,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>bct,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Rct,SEMRESATTRS_WEBENGINE_NAME:()=>Cct,SEMRESATTRS_WEBENGINE_VERSION:()=>vct,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>apt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>upt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>cpt,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>dpt,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>ppt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>fpt,SemanticAttributes:()=>Eit,SemanticResourceAttributes:()=>xct,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Slt,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Tlt,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>blt,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Ilt,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Clt,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>vlt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Rlt,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>xlt,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Dlt,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Nlt,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>nun,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Apt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>gpt,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>run,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>hpt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>_pt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>oun,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Ept,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>ypt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Spt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Tpt,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>bpt,TelemetrySdkLanguageValues:()=>wlt});var Xn=B(()=>{A();B0e();obe();ibe();sbe();abe()});var ube=M(_U=>{"use strict";A();Object.defineProperty(_U,"__esModule",{value:!0});_U.ATTR_PROCESS_RUNTIME_NAME=void 0;_U.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var cbe=M(yU=>{"use strict";A();Object.defineProperty(yU,"__esModule",{value:!0});yU.SDK_INFO=void 0;var xft=Gge(),EU=(Xn(),Me(qr)),Dft=ube();yU.SDK_INFO={[EU.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[Dft.ATTR_PROCESS_RUNTIME_NAME]:"node",[EU.ATTR_TELEMETRY_SDK_LANGUAGE]:EU.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[EU.ATTR_TELEMETRY_SDK_VERSION]:xft.VERSION}});var lbe=M(su=>{"use strict";A();Object.defineProperty(su,"__esModule",{value:!0});su.otperformance=su.SDK_INFO=su._globalThis=su.getStringListFromEnv=su.getNumberFromEnv=su.getBooleanFromEnv=su.getStringFromEnv=void 0;var SU=Qge();Object.defineProperty(su,"getStringFromEnv",{enumerable:!0,get:function(){return SU.getStringFromEnv}});Object.defineProperty(su,"getBooleanFromEnv",{enumerable:!0,get:function(){return SU.getBooleanFromEnv}});Object.defineProperty(su,"getNumberFromEnv",{enumerable:!0,get:function(){return SU.getNumberFromEnv}});Object.defineProperty(su,"getStringListFromEnv",{enumerable:!0,get:function(){return SU.getStringListFromEnv}});var Nft=Fge();Object.defineProperty(su,"_globalThis",{enumerable:!0,get:function(){return Nft._globalThis}});var wft=cbe();Object.defineProperty(su,"SDK_INFO",{enumerable:!0,get:function(){return wft.SDK_INFO}});su.otperformance=performance});var $V=M(au=>{"use strict";A();Object.defineProperty(au,"__esModule",{value:!0});au.getStringListFromEnv=au.getNumberFromEnv=au.getStringFromEnv=au.getBooleanFromEnv=au.otperformance=au._globalThis=au.SDK_INFO=void 0;var gS=lbe();Object.defineProperty(au,"SDK_INFO",{enumerable:!0,get:function(){return gS.SDK_INFO}});Object.defineProperty(au,"_globalThis",{enumerable:!0,get:function(){return gS._globalThis}});Object.defineProperty(au,"otperformance",{enumerable:!0,get:function(){return gS.otperformance}});Object.defineProperty(au,"getBooleanFromEnv",{enumerable:!0,get:function(){return gS.getBooleanFromEnv}});Object.defineProperty(au,"getStringFromEnv",{enumerable:!0,get:function(){return gS.getStringFromEnv}});Object.defineProperty(au,"getNumberFromEnv",{enumerable:!0,get:function(){return gS.getNumberFromEnv}});Object.defineProperty(au,"getStringListFromEnv",{enumerable:!0,get:function(){return gS.getStringListFromEnv}})});var mbe=M(Vr=>{"use strict";A();Object.defineProperty(Vr,"__esModule",{value:!0});Vr.addHrTimes=Vr.isTimeInput=Vr.isTimeInputHrTime=Vr.hrTimeToSeconds=Vr.hrTimeToMilliseconds=Vr.hrTimeToMicroseconds=Vr.hrTimeToNanoseconds=Vr.hrTimeToTimeStamp=Vr.hrTimeDuration=Vr.timeInputToHrTime=Vr.hrTime=Vr.getTimeOrigin=Vr.millisToHrTime=void 0;var TU=$V(),dbe=9,Bft=6,kft=Math.pow(10,Bft),Ew=Math.pow(10,dbe);function yw(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*kft);return[n,r]}Vr.millisToHrTime=yw;function Oft(){return TU.otperformance.timeOrigin}Vr.getTimeOrigin=Oft;function pbe(e){let t=yw(TU.otperformance.timeOrigin),n=yw(typeof e=="number"?e:TU.otperformance.now());return fbe(t,n)}Vr.hrTime=pbe;function Pft(e){if(qV(e))return e;if(typeof e=="number")return e<TU.otperformance.timeOrigin?pbe(e):yw(e);if(e instanceof Date)return yw(e.getTime());throw TypeError("Invalid input type")}Vr.timeInputToHrTime=Pft;function Mft(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=Ew),[n,r]}Vr.hrTimeDuration=Mft;function Lft(e){let t=dbe,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}Vr.hrTimeToTimeStamp=Lft;function Uft(e){return e[0]*Ew+e[1]}Vr.hrTimeToNanoseconds=Uft;function Qft(e){return e[0]*1e6+e[1]/1e3}Vr.hrTimeToMicroseconds=Qft;function Fft(e){return e[0]*1e3+e[1]/1e6}Vr.hrTimeToMilliseconds=Fft;function Gft(e){return e[0]+e[1]/Ew}Vr.hrTimeToSeconds=Gft;function qV(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}Vr.isTimeInputHrTime=qV;function jft(e){return qV(e)||typeof e=="number"||e instanceof Date}Vr.isTimeInput=jft;function fbe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Ew&&(n[1]-=Ew,n[0]+=1),n}Vr.addHrTimes=fbe});var Abe=M(bU=>{"use strict";A();Object.defineProperty(bU,"__esModule",{value:!0});bU.unrefTimer=void 0;function zft(e){typeof e!="number"&&e.unref()}bU.unrefTimer=zft});var gbe=M(Sw=>{"use strict";A();Object.defineProperty(Sw,"__esModule",{value:!0});Sw.ExportResultCode=void 0;var Hft;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(Hft=Sw.ExportResultCode||(Sw.ExportResultCode={}))});var _be=M(IU=>{"use strict";A();Object.defineProperty(IU,"__esModule",{value:!0});IU.CompositePropagator=void 0;var hbe=(He(),Me(tt)),VV=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let n=new Set;for(let r of this._propagators){let o=typeof r.fields=="function"?r.fields():[];for(let i of o)n.add(i)}this._fields=Array.from(n)}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){hbe.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(s){hbe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};IU.CompositePropagator=VV});var Ebe=M(FC=>{"use strict";A();Object.defineProperty(FC,"__esModule",{value:!0});FC.validateValue=FC.validateKey=void 0;var YV="[_0-9a-z-*/]",$ft=`[a-z]${YV}{0,255}`,qft=`[a-z0-9]${YV}{0,240}@[a-z]${YV}{0,13}`,Vft=new RegExp(`^(?:${$ft}|${qft})$`),Yft=/^[ -~]{0,255}[!-~]$/,Kft=/,|=/;function Jft(e){return Vft.test(e)}FC.validateKey=Jft;function Zft(e){return Yft.test(e)&&!Kft.test(e)}FC.validateValue=Zft});var JV=M(vU=>{"use strict";A();Object.defineProperty(vU,"__esModule",{value:!0});vU.TraceState=void 0;var CU=Ebe(),Wft=32,ybe=512,Sbe=",",Tbe="=",KV=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,CU.validateKey)(t)||!(0,CU.validateValue)(n))return this;let r=this._getState(),o=r.get(t),i=this._length;if(typeof o=="string"?i+=n.length-o.length:i+=t.length+n.length+(r.size>0?2:1),i>ybe)return this;let s=new Map(r);return s.delete(t),s.set(t,n),this._fromState(s,i)}unset(t){let n=this._getState(),r=n.get(t);if(typeof r!="string")return this;let o=this._length-(t.length+r.length+1);n.size>1&&(o=o-1);let i=new Map(n);return i.delete(t),this._fromState(i,o)}get(t){return this._getState().get(t)}serialize(){let t="",n=0;for(let r of this._getState())n>0&&(t=Sbe+t),t=`${r[0]}${Tbe}${r[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(Sbe),n=new Map,r=0;for(let o of t){let i=o.trim(),s=i.indexOf(Tbe);if(s===-1)continue;let u=i.slice(0,s),l=i.slice(s+1);if(!(0,CU.validateKey)(u)||!(0,CU.validateValue)(l))continue;let f=r+i.length+(n.size>0?1:0);if(!(f>ybe)&&(n.set(u,l),r=f,n.size>=Wft))break}return this._length=r,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};vU.TraceState=KV});var Ibe=M(uu=>{"use strict";A();Object.defineProperty(uu,"__esModule",{value:!0});uu.W3CTraceContextPropagator=uu.parseTraceParent=uu.TRACE_STATE_HEADER=uu.TRACE_PARENT_HEADER=void 0;var RU=(He(),Me(tt)),Xft=gw(),emt=JV();uu.TRACE_PARENT_HEADER="traceparent";uu.TRACE_STATE_HEADER="tracestate";var tmt="00",nmt="(?!ff)[\\da-f]{2}",rmt="(?![0]{32})[\\da-f]{32}",omt="(?![0]{16})[\\da-f]{16}",imt="[\\da-f]{2}",smt=new RegExp(`^\\s?(${nmt})-(${rmt})-(${omt})-(${imt})(-.*)?\\s?$`);function bbe(e){let t=smt.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}uu.parseTraceParent=bbe;var ZV=class{inject(t,n,r){let o=RU.trace.getSpanContext(t);if(!o||(0,Xft.isTracingSuppressed)(t)||!(0,RU.isSpanContextValid)(o))return;let i=`${tmt}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||RU.TraceFlags.NONE).toString(16)}`;r.set(n,uu.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,uu.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,uu.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=bbe(i);if(!s)return t;s.isRemote=!0;let u=r.get(n,uu.TRACE_STATE_HEADER);if(u){let l=Array.isArray(u)?u.join(","):u;s.traceState=new emt.TraceState(typeof l=="string"?l:void 0)}return RU.trace.setSpanContext(t,s)}fields(){return[uu.TRACE_PARENT_HEADER,uu.TRACE_STATE_HEADER]}};uu.W3CTraceContextPropagator=ZV});var Cbe=M(gf=>{"use strict";A();Object.defineProperty(gf,"__esModule",{value:!0});gf.getRPCMetadata=gf.deleteRPCMetadata=gf.setRPCMetadata=gf.RPCType=void 0;var amt=(He(),Me(tt)),WV=(0,amt.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),umt;(function(e){e.HTTP="http"})(umt=gf.RPCType||(gf.RPCType={}));function cmt(e,t){return e.setValue(WV,t)}gf.setRPCMetadata=cmt;function lmt(e){return e.deleteValue(WV)}gf.deleteRPCMetadata=lmt;function dmt(e){return e.getValue(WV)}gf.getRPCMetadata=dmt});var Nbe=M(xU=>{"use strict";A();Object.defineProperty(xU,"__esModule",{value:!0});xU.isPlainObject=void 0;var pmt="[object Object]",fmt="[object Null]",mmt="[object Undefined]",Amt=Function.prototype,vbe=Amt.toString,gmt=vbe.call(Object),hmt=Object.getPrototypeOf,Rbe=Object.prototype,xbe=Rbe.hasOwnProperty,hS=Symbol?Symbol.toStringTag:void 0,Dbe=Rbe.toString;function _mt(e){if(!Emt(e)||ymt(e)!==pmt)return!1;let t=hmt(e);if(t===null)return!0;let n=xbe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&vbe.call(n)===gmt}xU.isPlainObject=_mt;function Emt(e){return e!=null&&typeof e=="object"}function ymt(e){return e==null?e===void 0?mmt:fmt:hS&&hS in Object(e)?Smt(e):Tmt(e)}function Smt(e){let t=xbe.call(e,hS),n=e[hS],r=!1;try{e[hS]=void 0,r=!0}catch{}let o=Dbe.call(e);return r&&(t?e[hS]=n:delete e[hS]),o}function Tmt(e){return Dbe.call(e)}});var Pbe=M(wU=>{"use strict";A();Object.defineProperty(wU,"__esModule",{value:!0});wU.merge=void 0;var wbe=Nbe(),bmt=20;function Imt(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=kbe(t,e.shift(),0,n);return t}wU.merge=Imt;function XV(e){return NU(e)?e.slice():e}function kbe(e,t,n=0,r){let o;if(!(n>bmt)){if(n++,DU(e)||DU(t)||Obe(t))o=XV(t);else if(NU(e)){if(o=e.slice(),NU(t))for(let i=0,s=t.length;i<s;i++)o.push(XV(t[i]));else if(Tw(t)){let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];l==="__proto__"||l==="constructor"||l==="prototype"||(o[l]=XV(t[l]))}}}else if(Tw(e))if(Tw(t)){if(!Cmt(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];if(l==="__proto__"||l==="constructor"||l==="prototype")continue;let f=t[l];if(DU(f))typeof f>"u"?delete o[l]:o[l]=f;else{let h=o[l],_=f;if(Bbe(e,l,r)||Bbe(t,l,r))delete o[l];else{if(Tw(h)&&Tw(_)){let E=r.get(h)||[],T=r.get(_)||[];E.push({obj:e,key:l}),T.push({obj:t,key:l}),r.set(h,E),r.set(_,T)}o[l]=kbe(o[l],f,n,r)}}}}else o=t;return o}}function Bbe(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let s=r[o];if(s.key===t&&s.obj===e)return!0}return!1}function NU(e){return Array.isArray(e)}function Obe(e){return typeof e=="function"}function Tw(e){return!DU(e)&&!NU(e)&&!Obe(e)&&typeof e=="object"}function DU(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function Cmt(e,t){return!(!(0,wbe.isPlainObject)(e)||!(0,wbe.isPlainObject)(t))}});var Mbe=M(GC=>{"use strict";A();Object.defineProperty(GC,"__esModule",{value:!0});GC.callWithTimeout=GC.TimeoutError=void 0;var BU=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};GC.TimeoutError=BU;function vmt(e,t){let n,r=new Promise(function(i,s){n=setTimeout(function(){s(new BU("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}GC.callWithTimeout=vmt});var Ube=M(jC=>{"use strict";A();Object.defineProperty(jC,"__esModule",{value:!0});jC.isUrlIgnored=jC.urlMatches=void 0;function Lbe(e,t){return typeof t=="string"?e===t:!!e.match(t)}jC.urlMatches=Lbe;function Rmt(e,t){if(!t)return!1;for(let n of t)if(Lbe(e,n))return!0;return!1}jC.isUrlIgnored=Rmt});var Qbe=M(kU=>{"use strict";A();Object.defineProperty(kU,"__esModule",{value:!0});kU.Deferred=void 0;var e7=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)}};kU.Deferred=e7});var Fbe=M(OU=>{"use strict";A();Object.defineProperty(OU,"__esModule",{value:!0});OU.BindOnceFuture=void 0;var xmt=Qbe(),t7=class{_isCalled=!1;_deferred=new xmt.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}};OU.BindOnceFuture=t7});var jbe=M(PU=>{"use strict";A();Object.defineProperty(PU,"__esModule",{value:!0});PU.diagLogLevelFromString=void 0;var Rg=(He(),Me(tt)),Gbe={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 Dmt(e){if(e==null)return;let t=Gbe[e.toUpperCase()];return t??(Rg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(Gbe)}, using default`),Rg.DiagLogLevel.INFO)}PU.diagLogLevelFromString=Dmt});var Hbe=M(MU=>{"use strict";A();Object.defineProperty(MU,"__esModule",{value:!0});MU._export=void 0;var zbe=(He(),Me(tt)),Nmt=gw();function wmt(e,t){return new Promise(n=>{zbe.context.with((0,Nmt.suppressTracing)(zbe.context.active()),()=>{e.export(t,n)})})}MU._export=wmt});var Rr=M(we=>{"use strict";A();Object.defineProperty(we,"__esModule",{value:!0});we.diagLogLevelFromString=we.BindOnceFuture=we.urlMatches=we.isUrlIgnored=we.callWithTimeout=we.TimeoutError=we.merge=we.TraceState=we.unsuppressTracing=we.suppressTracing=we.isTracingSuppressed=we.setRPCMetadata=we.getRPCMetadata=we.deleteRPCMetadata=we.RPCType=we.parseTraceParent=we.W3CTraceContextPropagator=we.TRACE_STATE_HEADER=we.TRACE_PARENT_HEADER=we.CompositePropagator=we.otperformance=we.getStringListFromEnv=we.getNumberFromEnv=we.getBooleanFromEnv=we.getStringFromEnv=we._globalThis=we.SDK_INFO=we.parseKeyPairsIntoRecord=we.ExportResultCode=we.unrefTimer=we.timeInputToHrTime=we.millisToHrTime=we.isTimeInputHrTime=we.isTimeInput=we.hrTimeToTimeStamp=we.hrTimeToSeconds=we.hrTimeToNanoseconds=we.hrTimeToMilliseconds=we.hrTimeToMicroseconds=we.hrTimeDuration=we.hrTime=we.getTimeOrigin=we.addHrTimes=we.loggingErrorHandler=we.setGlobalErrorHandler=we.globalErrorHandler=we.sanitizeAttributes=we.isAttributeValue=we.AnchoredClock=we.W3CBaggagePropagator=void 0;we.internal=void 0;var Bmt=Rge();Object.defineProperty(we,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Bmt.W3CBaggagePropagator}});var kmt=xge();Object.defineProperty(we,"AnchoredClock",{enumerable:!0,get:function(){return kmt.AnchoredClock}});var $be=kge();Object.defineProperty(we,"isAttributeValue",{enumerable:!0,get:function(){return $be.isAttributeValue}});Object.defineProperty(we,"sanitizeAttributes",{enumerable:!0,get:function(){return $be.sanitizeAttributes}});var qbe=Pge();Object.defineProperty(we,"globalErrorHandler",{enumerable:!0,get:function(){return qbe.globalErrorHandler}});Object.defineProperty(we,"setGlobalErrorHandler",{enumerable:!0,get:function(){return qbe.setGlobalErrorHandler}});var Omt=AV();Object.defineProperty(we,"loggingErrorHandler",{enumerable:!0,get:function(){return Omt.loggingErrorHandler}});var $l=mbe();Object.defineProperty(we,"addHrTimes",{enumerable:!0,get:function(){return $l.addHrTimes}});Object.defineProperty(we,"getTimeOrigin",{enumerable:!0,get:function(){return $l.getTimeOrigin}});Object.defineProperty(we,"hrTime",{enumerable:!0,get:function(){return $l.hrTime}});Object.defineProperty(we,"hrTimeDuration",{enumerable:!0,get:function(){return $l.hrTimeDuration}});Object.defineProperty(we,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return $l.hrTimeToMicroseconds}});Object.defineProperty(we,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return $l.hrTimeToMilliseconds}});Object.defineProperty(we,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return $l.hrTimeToNanoseconds}});Object.defineProperty(we,"hrTimeToSeconds",{enumerable:!0,get:function(){return $l.hrTimeToSeconds}});Object.defineProperty(we,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return $l.hrTimeToTimeStamp}});Object.defineProperty(we,"isTimeInput",{enumerable:!0,get:function(){return $l.isTimeInput}});Object.defineProperty(we,"isTimeInputHrTime",{enumerable:!0,get:function(){return $l.isTimeInputHrTime}});Object.defineProperty(we,"millisToHrTime",{enumerable:!0,get:function(){return $l.millisToHrTime}});Object.defineProperty(we,"timeInputToHrTime",{enumerable:!0,get:function(){return $l.timeInputToHrTime}});var Pmt=Abe();Object.defineProperty(we,"unrefTimer",{enumerable:!0,get:function(){return Pmt.unrefTimer}});var Mmt=gbe();Object.defineProperty(we,"ExportResultCode",{enumerable:!0,get:function(){return Mmt.ExportResultCode}});var Lmt=dV();Object.defineProperty(we,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Lmt.parseKeyPairsIntoRecord}});var _S=$V();Object.defineProperty(we,"SDK_INFO",{enumerable:!0,get:function(){return _S.SDK_INFO}});Object.defineProperty(we,"_globalThis",{enumerable:!0,get:function(){return _S._globalThis}});Object.defineProperty(we,"getStringFromEnv",{enumerable:!0,get:function(){return _S.getStringFromEnv}});Object.defineProperty(we,"getBooleanFromEnv",{enumerable:!0,get:function(){return _S.getBooleanFromEnv}});Object.defineProperty(we,"getNumberFromEnv",{enumerable:!0,get:function(){return _S.getNumberFromEnv}});Object.defineProperty(we,"getStringListFromEnv",{enumerable:!0,get:function(){return _S.getStringListFromEnv}});Object.defineProperty(we,"otperformance",{enumerable:!0,get:function(){return _S.otperformance}});var Umt=_be();Object.defineProperty(we,"CompositePropagator",{enumerable:!0,get:function(){return Umt.CompositePropagator}});var LU=Ibe();Object.defineProperty(we,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return LU.TRACE_PARENT_HEADER}});Object.defineProperty(we,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return LU.TRACE_STATE_HEADER}});Object.defineProperty(we,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return LU.W3CTraceContextPropagator}});Object.defineProperty(we,"parseTraceParent",{enumerable:!0,get:function(){return LU.parseTraceParent}});var UU=Cbe();Object.defineProperty(we,"RPCType",{enumerable:!0,get:function(){return UU.RPCType}});Object.defineProperty(we,"deleteRPCMetadata",{enumerable:!0,get:function(){return UU.deleteRPCMetadata}});Object.defineProperty(we,"getRPCMetadata",{enumerable:!0,get:function(){return UU.getRPCMetadata}});Object.defineProperty(we,"setRPCMetadata",{enumerable:!0,get:function(){return UU.setRPCMetadata}});var n7=gw();Object.defineProperty(we,"isTracingSuppressed",{enumerable:!0,get:function(){return n7.isTracingSuppressed}});Object.defineProperty(we,"suppressTracing",{enumerable:!0,get:function(){return n7.suppressTracing}});Object.defineProperty(we,"unsuppressTracing",{enumerable:!0,get:function(){return n7.unsuppressTracing}});var Qmt=JV();Object.defineProperty(we,"TraceState",{enumerable:!0,get:function(){return Qmt.TraceState}});var Fmt=Pbe();Object.defineProperty(we,"merge",{enumerable:!0,get:function(){return Fmt.merge}});var Vbe=Mbe();Object.defineProperty(we,"TimeoutError",{enumerable:!0,get:function(){return Vbe.TimeoutError}});Object.defineProperty(we,"callWithTimeout",{enumerable:!0,get:function(){return Vbe.callWithTimeout}});var Ybe=Ube();Object.defineProperty(we,"isUrlIgnored",{enumerable:!0,get:function(){return Ybe.isUrlIgnored}});Object.defineProperty(we,"urlMatches",{enumerable:!0,get:function(){return Ybe.urlMatches}});var Gmt=Fbe();Object.defineProperty(we,"BindOnceFuture",{enumerable:!0,get:function(){return Gmt.BindOnceFuture}});var jmt=jbe();Object.defineProperty(we,"diagLogLevelFromString",{enumerable:!0,get:function(){return jmt.diagLogLevelFromString}});var zmt=Hbe();we.internal={_export:zmt._export}});var Kbe=M(QU=>{"use strict";A();Object.defineProperty(QU,"__esModule",{value:!0});QU.VERSION=void 0;QU.VERSION="0.214.0"});var Jbe=M(bw=>{"use strict";A();Object.defineProperty(bw,"__esModule",{value:!0});bw.SeverityNumber=void 0;var Hmt;(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"})(Hmt=bw.SeverityNumber||(bw.SeverityNumber={}))});var GU=M(zC=>{"use strict";A();Object.defineProperty(zC,"__esModule",{value:!0});zC.NOOP_LOGGER=zC.NoopLogger=void 0;var FU=class{emit(t){}};zC.NoopLogger=FU;zC.NOOP_LOGGER=new FU});var Zbe=M(Bm=>{"use strict";A();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.API_BACKWARDS_COMPATIBILITY_VERSION=Bm.makeGetter=Bm._global=Bm.GLOBAL_LOGS_API_KEY=void 0;Bm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Bm._global=globalThis;function $mt(e,t,n){return r=>r===e?t:n}Bm.makeGetter=$mt;Bm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var r7=M(HC=>{"use strict";A();Object.defineProperty(HC,"__esModule",{value:!0});HC.NOOP_LOGGER_PROVIDER=HC.NoopLoggerProvider=void 0;var qmt=GU(),jU=class{getLogger(t,n,r){return new qmt.NoopLogger}};HC.NoopLoggerProvider=jU;HC.NOOP_LOGGER_PROVIDER=new jU});var Wbe=M(zU=>{"use strict";A();Object.defineProperty(zU,"__esModule",{value:!0});zU.ProxyLogger=void 0;var Vmt=GU(),o7=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):Vmt.NOOP_LOGGER}};zU.ProxyLogger=o7});var Xbe=M(HU=>{"use strict";A();Object.defineProperty(HU,"__esModule",{value:!0});HU.ProxyLoggerProvider=void 0;var Ymt=r7(),Kmt=Wbe(),i7=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new Kmt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Ymt.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)}};HU.ProxyLoggerProvider=i7});var tIe=M($U=>{"use strict";A();Object.defineProperty($U,"__esModule",{value:!0});$U.LogsAPI=void 0;var Jd=Zbe(),Jmt=r7(),eIe=Xbe(),s7=class e{constructor(){this._proxyLoggerProvider=new eIe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Jd._global[Jd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Jd._global[Jd.GLOBAL_LOGS_API_KEY]=(0,Jd.makeGetter)(Jd.API_BACKWARDS_COMPATIBILITY_VERSION,t,Jmt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Jd._global[Jd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Jd._global,Jd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Jd._global[Jd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new eIe.ProxyLoggerProvider}};$U.LogsAPI=s7});var a7=M(km=>{"use strict";A();Object.defineProperty(km,"__esModule",{value:!0});km.logs=km.NoopLogger=km.NOOP_LOGGER=km.SeverityNumber=void 0;var Zmt=Jbe();Object.defineProperty(km,"SeverityNumber",{enumerable:!0,get:function(){return Zmt.SeverityNumber}});var nIe=GU();Object.defineProperty(km,"NOOP_LOGGER",{enumerable:!0,get:function(){return nIe.NOOP_LOGGER}});Object.defineProperty(km,"NoopLogger",{enumerable:!0,get:function(){return nIe.NoopLogger}});var Wmt=tIe();km.logs=Wmt.LogsAPI.getInstance()});var rIe=M($C=>{"use strict";A();Object.defineProperty($C,"__esModule",{value:!0});$C.disableInstrumentations=$C.enableInstrumentations=void 0;function Xmt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}$C.enableInstrumentations=Xmt;function eAt(e){e.forEach(t=>t.disable())}$C.disableInstrumentations=eAt});var sIe=M(qU=>{"use strict";A();Object.defineProperty(qU,"__esModule",{value:!0});qU.registerInstrumentations=void 0;var oIe=(He(),Me(tt)),tAt=a7(),iIe=rIe();function nAt(e){let t=e.tracerProvider||oIe.trace.getTracerProvider(),n=e.meterProvider||oIe.metrics.getMeterProvider(),r=e.loggerProvider||tAt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,iIe.enableInstrumentations)(o,t,n,r),()=>{(0,iIe.disableInstrumentations)(o)}}qU.registerInstrumentations=nAt});var AIe=M(VU=>{"use strict";A();Object.defineProperty(VU,"__esModule",{value:!0});VU.satisfies=void 0;var d7=(He(),Me(tt)),dIe=/^(?: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-]+)*))?$/,rAt=/^(?<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-]+)*))?$/,oAt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function iAt(e,t,n){if(!sAt(e))return d7.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=lAt(e);if(!r)return!1;let o=[],i=pIe(r,t,o,n);return i&&!n?.includePrerelease?uAt(r,o):i}VU.satisfies=iAt;function sAt(e){return typeof e=="string"&&dIe.test(e)}function pIe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(u7(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=wAt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!u7(e,i,n,r))return!1;return!0}return u7(e,t,n,r)}function u7(e,t,n,r){if(t=cAt(t,r),t.includes(" "))return pIe(e,t,n,r);{let o=dAt(t);return n.push(o),aAt(e,o)}}function aAt(e,t){if(t.invalid)return!1;if(!t.version||l7(t.version))return!0;let n=uIe(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=uIe(r,o)}return oAt[t.op]?.includes(n)}function uAt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function cAt(e,t){return e=e.trim(),e=DAt(e,t),e=xAt(e),e=NAt(e,t),e=e.trim(),e}function $u(e){return!e||e.toLowerCase()==="x"||e==="*"}function lAt(e){let t=e.match(dIe);if(!t){d7.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function dAt(e){if(!e)return{};let t=e.match(rAt);if(!t)return d7.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function l7(e){return e==="*"||e==="x"||e==="X"}function aIe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function pAt(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 fAt(e,t){if(l7(e)||l7(t))return 0;let[n,r]=pAt(aIe(e),aIe(t));return n>r?1:n<r?-1:0}function uIe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=fAt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var fIe="[a-zA-Z0-9-]",mIe="0|[1-9]\\d*",mAt=`\\d*[a-zA-Z-]${fIe}*`,AAt="((?:<|>)?=?)",cIe=`(?:${mIe}|${mAt})`,gAt=`(?:-(${cIe}(?:\\.${cIe})*))`,lIe=`${fIe}+`,hAt=`(?:\\+(${lIe}(?:\\.${lIe})*))`,c7=`${mIe}|x|X|\\*`,Iw=`[v=\\s]*(${c7})(?:\\.(${c7})(?:\\.(${c7})(?:${gAt})?${hAt}?)?)?`,_At=`^${AAt}\\s*${Iw}$`,EAt=new RegExp(_At),yAt=`^\\s*(${Iw})\\s+-\\s+(${Iw})\\s*$`,SAt=new RegExp(yAt),TAt="(?:~>?)",bAt=`^${TAt}${Iw}$`,IAt=new RegExp(bAt),CAt="(?:\\^)",vAt=`^${CAt}${Iw}$`,RAt=new RegExp(vAt);function xAt(e){let t=IAt;return e.replace(t,(n,r,o,i,s)=>{let u;return $u(r)?u="":$u(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:$u(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function DAt(e,t){let n=RAt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return $u(i)?f="":$u(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:$u(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function NAt(e,t){let n=EAt;return e.replace(n,(r,o,i,s,u,l)=>{let f=$u(i),h=f||$u(s),_=h||$u(u),E=_;return o==="="&&E&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&E?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function wAt(e,t){let n=SAt;return e.replace(n,(r,o,i,s,u,l,f,h,_,E,T,v)=>($u(i)?o="":$u(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:$u(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,$u(_)?h="":$u(E)?h=`<${+_+1}.0.0-0`:$u(T)?h=`<${_}.${+E+1}.0-0`:v?h=`<=${_}.${E}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${E}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var p7=M(Na=>{"use strict";A();Object.defineProperty(Na,"__esModule",{value:!0});Na.massUnwrap=Na.unwrap=Na.massWrap=Na.wrap=void 0;var qu=console.error.bind(console);function Cw(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 BAt=(e,t,n)=>{if(!e||!e[t]){qu("no original function "+String(t)+" to wrap");return}if(!n){qu("no wrapper function"),qu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){qu("original object and wrapper must be functions");return}let o=n(r,t);return Cw(o,"__original",r),Cw(o,"__unwrap",()=>{e[t]===o&&Cw(e,t,r)}),Cw(o,"__wrapped",!0),Cw(e,t,o),o};Na.wrap=BAt;var kAt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Na.wrap)(r,o,n)})})};Na.massWrap=kAt;var OAt=(e,t)=>{if(!e||!e[t]){qu("no function to unwrap."),qu(new Error().stack);return}let n=e[t];if(!n.__unwrap)qu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Na.unwrap=OAt;var PAt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Na.unwrap)(n,r)})})};Na.massUnwrap=PAt;function vw(e){e&&e.logger&&(typeof e.logger!="function"?qu("new logger isn't a function, not replacing"):qu=e.logger)}Na.default=vw;vw.wrap=Na.wrap;vw.massWrap=Na.massWrap;vw.unwrap=Na.unwrap;vw.massUnwrap=Na.massUnwrap});var gIe=M(KU=>{"use strict";A();Object.defineProperty(KU,"__esModule",{value:!0});KU.InstrumentationAbstract=void 0;var f7=(He(),Me(tt)),MAt=a7(),YU=p7(),m7=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=f7.diag.createComponentLogger({namespace:t}),this._tracer=f7.trace.getTracer(t,n),this._meter=f7.metrics.getMeter(t,n),this._logger=MAt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=YU.wrap;_unwrap=YU.unwrap;_massWrap=YU.massWrap;_massUnwrap=YU.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)}}};KU.InstrumentationAbstract=m7});var _Ie=M((kcn,hIe)=>{A();var qC=1e3,VC=qC*60,YC=VC*60,ES=YC*24,LAt=ES*7,UAt=ES*365.25;hIe.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return QAt(e);if(n==="number"&&isFinite(e))return t.long?GAt(e):FAt(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function QAt(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*UAt;case"weeks":case"week":case"w":return n*LAt;case"days":case"day":case"d":return n*ES;case"hours":case"hour":case"hrs":case"hr":case"h":return n*YC;case"minutes":case"minute":case"mins":case"min":case"m":return n*VC;case"seconds":case"second":case"secs":case"sec":case"s":return n*qC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function FAt(e){var t=Math.abs(e);return t>=ES?Math.round(e/ES)+"d":t>=YC?Math.round(e/YC)+"h":t>=VC?Math.round(e/VC)+"m":t>=qC?Math.round(e/qC)+"s":e+"ms"}function GAt(e){var t=Math.abs(e);return t>=ES?JU(e,t,ES,"day"):t>=YC?JU(e,t,YC,"hour"):t>=VC?JU(e,t,VC,"minute"):t>=qC?JU(e,t,qC,"second"):e+" ms"}function JU(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var A7=M((Pcn,EIe)=>{A();function jAt(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=o,n.enabled=u,n.humanize=_Ie(),n.destroy=f,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let _=0;for(let E=0;E<h.length;E++)_=(_<<5)-_+h.charCodeAt(E),_|=0;return n.colors[Math.abs(_)%n.colors.length]}n.selectColor=t;function n(h){let _,E=null,T,v;function R(...x){if(!R.enabled)return;let k=R,P=Number(new Date),j=P-(_||P);k.diff=j,k.prev=_,k.curr=P,_=P,x[0]=n.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let G=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(V,ae)=>{if(V==="%%")return"%";G++;let te=n.formatters[ae];if(typeof te=="function"){let _e=x[G];V=te.call(k,_e),x.splice(G,1),G--}return V}),n.formatArgs.call(k,x),(k.log||n.log).apply(k,x)}return R.namespace=h,R.useColors=n.useColors(),R.color=n.selectColor(h),R.extend=r,R.destroy=n.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>E!==null?E:(T!==n.namespaces&&(T=n.namespaces,v=n.enabled(h)),v),set:x=>{E=x}}),typeof n.init=="function"&&n.init(R),R}function r(h,_){let E=n(this.namespace+(typeof _>"u"?":":_)+h);return E.log=this.log,E}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let _=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let E of _)E[0]==="-"?n.skips.push(E.slice(1)):n.names.push(E)}function i(h,_){let E=0,T=0,v=-1,R=0;for(;E<h.length;)if(T<_.length&&(_[T]===h[E]||_[T]==="*"))_[T]==="*"?(v=T,R=E,T++):(E++,T++);else if(v!==-1)T=v+1,R++,E=R;else return!1;for(;T<_.length&&_[T]==="*";)T++;return T===_.length}function s(){let h=[...n.names,...n.skips.map(_=>"-"+_)].join(",");return n.enable(""),h}function u(h){for(let _ of n.skips)if(i(h,_))return!1;for(let _ of n.names)if(i(h,_))return!0;return!1}function l(h){return h instanceof Error?h.stack||h.message:h}function f(){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}EIe.exports=jAt});var yIe=M((jc,ZU)=>{A();jc.formatArgs=HAt;jc.save=$At;jc.load=qAt;jc.useColors=zAt;jc.storage=VAt();jc.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`."))}})();jc.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 zAt(){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 HAt(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+ZU.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)}jc.log=console.debug||console.log||(()=>{});function $At(e){try{e?jc.storage.setItem("debug",e):jc.storage.removeItem("debug")}catch{}}function qAt(){let e;try{e=jc.storage.getItem("debug")||jc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function VAt(){try{return localStorage}catch{}}ZU.exports=A7()(jc);var{formatters:YAt}=ZU.exports;YAt.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var TIe=M((Ucn,SIe)=>{"use strict";A();SIe.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 CIe=M((Fcn,IIe)=>{"use strict";A();var KAt=Ue("os"),bIe=Ue("tty"),Zd=TIe(),{env:ea}=process,N_;Zd("no-color")||Zd("no-colors")||Zd("color=false")||Zd("color=never")?N_=0:(Zd("color")||Zd("colors")||Zd("color=true")||Zd("color=always"))&&(N_=1);"FORCE_COLOR"in ea&&(ea.FORCE_COLOR==="true"?N_=1:ea.FORCE_COLOR==="false"?N_=0:N_=ea.FORCE_COLOR.length===0?1:Math.min(parseInt(ea.FORCE_COLOR,10),3));function g7(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function h7(e,t){if(N_===0)return 0;if(Zd("color=16m")||Zd("color=full")||Zd("color=truecolor"))return 3;if(Zd("color=256"))return 2;if(e&&!t&&N_===void 0)return 0;let n=N_||0;if(ea.TERM==="dumb")return n;if(process.platform==="win32"){let r=KAt.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in ea)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in ea)||ea.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in ea)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ea.TEAMCITY_VERSION)?1:0;if(ea.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ea){let r=parseInt((ea.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ea.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ea.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ea.TERM)||"COLORTERM"in ea?1:n}function JAt(e){let t=h7(e,e&&e.isTTY);return g7(t)}IIe.exports={supportsColor:JAt,stdout:g7(h7(!0,bIe.isatty(1))),stderr:g7(h7(!0,bIe.isatty(2)))}});var RIe=M((ta,XU)=>{A();var ZAt=Ue("tty"),WU=Ue("util");ta.init=ogt;ta.log=tgt;ta.formatArgs=XAt;ta.save=ngt;ta.load=rgt;ta.useColors=WAt;ta.destroy=WU.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ta.colors=[6,2,3,4,5,1];try{let e=CIe();e&&(e.stderr||e).level>=2&&(ta.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{}ta.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 WAt(){return"colors"in ta.inspectOpts?!!ta.inspectOpts.colors:ZAt.isatty(process.stderr.fd)}function XAt(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 Ent=Object.create;var zL=Object.defineProperty;var ynt=Object.getOwnPropertyDescriptor;var Snt=Object.getOwnPropertyNames;var Tnt=Object.getPrototypeOf,bnt=Object.prototype.hasOwnProperty;var Ue=(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 B=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var M=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Ws=(e,t)=>{for(var n in t)zL(e,n,{get:t[n],enumerable:!0})},NAe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Snt(t))!bnt.call(e,o)&&o!==n&&zL(e,o,{get:()=>t[o],enumerable:!(r=ynt(t,o))||r.enumerable});return e};var ue=(e,t,n)=>(n=e!=null?Ent(Tnt(e)):{},NAe(t||!e||!e.__esModule?zL(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>NAe(zL({},"__esModule",{value:!0}),e);var A=B(()=>{(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.225"}}catch{}})()});var bg,xq=B(()=>{A();bg="1.9.1"});function Int(e){let t=new Set([e]),n=new Set,r=e.match(kAe);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(l){return l===e};function i(u){return n.add(u),!1}function s(u){return t.add(u),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;let f=l.match(kAe);if(!f)return i(l);let h={major:+f[1],minor:+f[2],patch:+f[3],prerelease:f[4]};return h.prerelease!=null||o.major!==h.major?i(l):o.major===0?o.minor===h.minor&&o.patch<=h.patch?s(l):i(l):o.minor<=h.minor?s(l):i(l)}}var kAe,OAe,PAe=B(()=>{A();xq();kAe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;OAe=Int(bg)});function vm(e,t,n,r=!1){var o;let i=cw[uw]=(o=cw[uw])!==null&&o!==void 0?o:{version:bg};if(!r&&i[e]){let s=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(s.stack||s.message),!1}if(i.version!==bg){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${bg}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${bg}.`),!0}function jl(e){var t,n;let r=(t=cw[uw])===null||t===void 0?void 0:t.version;if(!(!r||!OAe(r)))return(n=cw[uw])===null||n===void 0?void 0:n[e]}function Rm(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${bg}.`);let n=cw[uw];n&&delete n[e]}var Cnt,uw,cw,cS=B(()=>{A();xq();PAe();Cnt=bg.split(".")[0],uw=Symbol.for(`opentelemetry.js.api.${Cnt}`),cw=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function lw(e,t,n){let r=jl("diag");if(r)return r[e](t,...n)}var HL,MAe=B(()=>{A();cS();HL=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return lw("debug",this._namespace,t)}error(...t){return lw("error",this._namespace,t)}info(...t){return lw("info",this._namespace,t)}warn(...t){return lw("warn",this._namespace,t)}verbose(...t){return lw("verbose",this._namespace,t)}}});var Rs,$L=B(()=>{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"})(Rs||(Rs={}))});function LAe(e,t){e<Rs.NONE?e=Rs.NONE:e>Rs.ALL&&(e=Rs.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",Rs.ERROR),warn:n("warn",Rs.WARN),info:n("info",Rs.INFO),debug:n("debug",Rs.DEBUG),verbose:n("verbose",Rs.VERBOSE)}}var UAe=B(()=>{A();$L()});var vnt,Xs,lS=B(()=>{A();MAe();UAe();$L();cS();vnt="diag",Xs=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let s=jl("diag");if(s)return s[o](...i)}}let n=this,r=(o,i={logLevel:Rs.INFO})=>{var s,u,l;if(o===n){let _=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=_.stack)!==null&&s!==void 0?s:_.message),!1}typeof i=="number"&&(i={logLevel:i});let f=jl("diag"),h=LAe((u=i.logLevel)!==null&&u!==void 0?u:Rs.INFO,o);if(f&&!i.suppressOverrideMessage){let _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";f.warn(`Current logger will be overwritten from ${_}`),h.warn(`Current logger will overwrite one already registered from ${_}`)}return vm("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{Rm(vnt,n)},n.createComponentLogger=o=>new HL(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var qL,QAe=B(()=>{A();qL=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 FAe,GAe=B(()=>{A();FAe=Symbol("BaggageEntryMetadata")});function jAe(e={}){return new qL(new Map(Object.entries(e)))}function zAe(e){return typeof e!="string"&&(Rnt.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:FAe,toString(){return e}}}var Rnt,Dq=B(()=>{A();lS();QAe();GAe();Rnt=Xs.instance()});function zl(e){return Symbol.for(e)}var Nq,kC,dw=B(()=>{A();Nq=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}}},kC=new Nq});var wq,Bq,VL,HAe=B(()=>{A();wq=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Bq={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(Bq[t]=console[t])}VL=class{constructor(){function t(n){return function(...r){let o=Bq[n];if(typeof o!="function"&&(o=Bq.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<wq.length;n++)this[wq[n].n]=t(wq[n].c)}}});function $Ae(){return Gq}var kq,OC,Oq,Pq,Mq,Lq,pw,Uq,Qq,Fq,Gq,xnt,Dnt,Nnt,wnt,Bnt,knt,Ont,jq=B(()=>{A();kq=class{constructor(){}createGauge(t,n){return Dnt}createHistogram(t,n){return Nnt}createCounter(t,n){return xnt}createUpDownCounter(t,n){return wnt}createObservableGauge(t,n){return knt}createObservableCounter(t,n){return Bnt}createObservableUpDownCounter(t,n){return Ont}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},OC=class{},Oq=class extends OC{add(t,n){}},Pq=class extends OC{add(t,n){}},Mq=class extends OC{record(t,n){}},Lq=class extends OC{record(t,n){}},pw=class{addCallback(t){}removeCallback(t){}},Uq=class extends pw{},Qq=class extends pw{},Fq=class extends pw{},Gq=new kq,xnt=new Oq,Dnt=new Mq,Nnt=new Lq,wnt=new Pq,Bnt=new Uq,knt=new Qq,Ont=new Fq});var YL,qAe=B(()=>{A();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(YL||(YL={}))});var KL,JL,zq=B(()=>{A();KL={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},JL={set(e,t,n){e!=null&&(e[t]=n)}}});var ZL,VAe=B(()=>{A();dw();ZL=class{active(){return kC}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var Hq,Pnt,xm,fw=B(()=>{A();VAe();cS();lS();Hq="context",Pnt=new ZL,xm=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return vm(Hq,t,Xs.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 jl(Hq)||Pnt}disable(){this._getContextManager().disable(),Rm(Hq,Xs.instance())}}});var ou,$q=B(()=>{A();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(ou||(ou={}))});var mw,dS,WL,XL=B(()=>{A();$q();mw="0000000000000000",dS="00000000000000000000000000000000",WL={traceId:dS,spanId:mw,traceFlags:ou.NONE}});var Dm,eU=B(()=>{A();XL();Dm=class{constructor(t=WL){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 tU(e){return e.getValue(qq)||void 0}function YAe(){return tU(xm.getInstance().active())}function Aw(e,t){return e.setValue(qq,t)}function KAe(e){return e.deleteValue(qq)}function JAe(e,t){return Aw(e,new Dm(t))}function nU(e){var t;return(t=tU(e))===null||t===void 0?void 0:t.spanContext()}var qq,Vq=B(()=>{A();dw();eU();fw();qq=zl("OpenTelemetry Context Key SPAN")});function ZAe(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(rU[e.charCodeAt(r)]|0)+(rU[e.charCodeAt(r+1)]|0)+(rU[e.charCodeAt(r+2)]|0)+(rU[e.charCodeAt(r+3)]|0);return n===t}function Yq(e){return ZAe(e,32)&&e!==dS}function Kq(e){return ZAe(e,16)&&e!==mw}function Ig(e){return Yq(e.traceId)&&Kq(e.spanId)}function WAe(e){return new Dm(e)}var rU,oU=B(()=>{A();XL();eU();rU=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 Mnt(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 Jq,PC,Zq=B(()=>{A();fw();Vq();eU();oU();Jq=xm.getInstance(),PC=class{startSpan(t,n,r=Jq.active()){if(!!n?.root)return new Dm;let i=r&&nU(r);return Mnt(i)&&Ig(i)?new Dm(i):new Dm}startActiveSpan(t,n,r,o){let i,s,u;if(arguments.length<2)return;arguments.length===2?u=n:arguments.length===3?(i=n,u=r):(i=n,s=r,u=o);let l=s??Jq.active(),f=this.startSpan(t,i,l),h=Aw(l,f);return Jq.with(h,u,void 0,f)}}});var Lnt,MC,Wq=B(()=>{A();Zq();Lnt=new PC,MC=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):Lnt}}});var iU,XAe=B(()=>{A();Zq();iU=class{getTracer(t,n,r){return new PC}}});var Unt,pS,Xq=B(()=>{A();Wq();XAe();Unt=new iU,pS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new MC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Unt}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 sU,ege=B(()=>{A();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(sU||(sU={}))});var mo,tge=B(()=>{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"})(mo||(mo={}))});var gi,nge=B(()=>{A();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(gi||(gi={}))});function rge(e){return Gnt.test(e)}function oge(e){return jnt.test(e)&&!znt.test(e)}var eV,Qnt,Fnt,Gnt,jnt,znt,ige=B(()=>{A();eV="[_0-9a-z-*/]",Qnt=`[a-z]${eV}{0,255}`,Fnt=`[a-z0-9]${eV}{0,240}@[a-z]${eV}{0,13}`,Gnt=new RegExp(`^(?:${Qnt}|${Fnt})$`),jnt=/^[ -~]{0,255}[!-~]$/,znt=/,|=/});var sge,Hnt,age,uge,aU,cge=B(()=>{A();ige();sge=32,Hnt=512,age=",",uge="=",aU=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+uge+this.get(n)),t),[]).join(age)}_parse(t){t.length>Hnt||(this._internalState=t.split(age).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(uge);if(i!==-1){let s=o.slice(0,i),u=o.slice(i+1,r.length);rge(s)&&oge(u)&&n.set(s,u)}return n},new Map),this._internalState.size>sge&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,sge))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function lge(e){return new aU(e)}var dge=B(()=>{A();cge()});var We,pge=B(()=>{A();fw();We=xm.getInstance()});var Hl,fge=B(()=>{A();lS();Hl=Xs.instance()});var tV,mge,Age=B(()=>{A();jq();tV=class{getMeter(t,n,r){return Gq}},mge=new tV});var nV,uU,gge=B(()=>{A();Age();cS();lS();nV="metrics",uU=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return vm(nV,t,Xs.instance())}getMeterProvider(){return jl(nV)||mge}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){Rm(nV,Xs.instance())}}});var rV,hge=B(()=>{A();gge();rV=uU.getInstance()});var cU,_ge=B(()=>{A();cU=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function iV(e){return e.getValue(oV)||void 0}function Ege(){return iV(xm.getInstance().active())}function yge(e,t){return e.setValue(oV,t)}function Sge(e){return e.deleteValue(oV)}var oV,Tge=B(()=>{A();fw();dw();oV=zl("OpenTelemetry Baggage Key")});var sV,$nt,lU,bge=B(()=>{A();cS();_ge();zq();Tge();Dq();lS();sV="propagation",$nt=new cU,lU=class e{constructor(){this.createBaggage=jAe,this.getBaggage=iV,this.getActiveBaggage=Ege,this.setBaggage=yge,this.deleteBaggage=Sge}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return vm(sV,t,Xs.instance())}inject(t,n,r=JL){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=KL){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Rm(sV,Xs.instance())}_getGlobalPropagator(){return jl(sV)||$nt}}});var Af,Ige=B(()=>{A();bge();Af=lU.getInstance()});var aV,dU,Cge=B(()=>{A();cS();Xq();oU();Vq();lS();aV="trace",dU=class e{constructor(){this._proxyTracerProvider=new pS,this.wrapSpanContext=WAe,this.isSpanContextValid=Ig,this.deleteSpan=KAe,this.getSpan=tU,this.getActiveSpan=YAe,this.getSpanContext=nU,this.setSpan=Aw,this.setSpanContext=JAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=vm(aV,this._proxyTracerProvider,Xs.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return jl(aV)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){Rm(aV,Xs.instance()),this._proxyTracerProvider=new pS}}});var Jt,vge=B(()=>{A();Cge();Jt=dU.getInstance()});var tt={};Ws(tt,{DiagConsoleLogger:()=>VL,DiagLogLevel:()=>Rs,INVALID_SPANID:()=>mw,INVALID_SPAN_CONTEXT:()=>WL,INVALID_TRACEID:()=>dS,ProxyTracer:()=>MC,ProxyTracerProvider:()=>pS,ROOT_CONTEXT:()=>kC,SamplingDecision:()=>sU,SpanKind:()=>mo,SpanStatusCode:()=>gi,TraceFlags:()=>ou,ValueType:()=>YL,baggageEntryMetadataFromString:()=>zAe,context:()=>We,createContextKey:()=>zl,createNoopMeter:()=>$Ae,createTraceState:()=>lge,default:()=>qnt,defaultTextMapGetter:()=>KL,defaultTextMapSetter:()=>JL,diag:()=>Hl,isSpanContextValid:()=>Ig,isValidSpanId:()=>Kq,isValidTraceId:()=>Yq,metrics:()=>rV,propagation:()=>Af,trace:()=>Jt});var qnt,He=B(()=>{A();Dq();dw();HAe();$L();jq();qAe();zq();Wq();Xq();ege();tge();nge();$q();dge();oU();XL();pge();fge();hge();Ige();vge();qnt={context:We,diag:Hl,metrics:rV,propagation:Af,trace:Jt}});var gw=M(R_=>{"use strict";A();Object.defineProperty(R_,"__esModule",{value:!0});R_.isTracingSuppressed=R_.unsuppressTracing=R_.suppressTracing=void 0;var Vnt=(He(),Me(tt)),uV=(0,Vnt.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ynt(e){return e.setValue(uV,!0)}R_.suppressTracing=Ynt;function Knt(e){return e.deleteValue(uV)}R_.unsuppressTracing=Knt;function Jnt(e){return e.getValue(uV)===!0}R_.isTracingSuppressed=Jnt});var cV=M(iu=>{"use strict";A();Object.defineProperty(iu,"__esModule",{value:!0});iu.BAGGAGE_MAX_TOTAL_LENGTH=iu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=iu.BAGGAGE_MAX_NAME_VALUE_PAIRS=iu.BAGGAGE_HEADER=iu.BAGGAGE_ITEMS_SEPARATOR=iu.BAGGAGE_PROPERTIES_SEPARATOR=iu.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;iu.BAGGAGE_KEY_PAIR_SEPARATOR="=";iu.BAGGAGE_PROPERTIES_SEPARATOR=";";iu.BAGGAGE_ITEMS_SEPARATOR=",";iu.BAGGAGE_HEADER="baggage";iu.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;iu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;iu.BAGGAGE_MAX_TOTAL_LENGTH=8192});var dV=M(Kd=>{"use strict";A();Object.defineProperty(Kd,"__esModule",{value:!0});Kd.parseKeyPairsIntoRecord=Kd.parseBaggageHeaderString=Kd.parsePairKeyValue=Kd.getKeyPairs=Kd.serializeKeyPairs=void 0;var Znt=(He(),Me(tt)),Nm=cV();function Wnt(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?Nm.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Nm.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}Kd.serializeKeyPairs=Wnt;function Xnt(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Nm.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}Kd.getKeyPairs=Xnt;function lV(e){if(!e)return;let t=e.indexOf(Nm.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(Nm.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 s,u;try{s=decodeURIComponent(o),u=decodeURIComponent(i)}catch{return}let l;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);l=(0,Znt.baggageEntryMetadataFromString)(f)}return{key:s,value:u,metadata:l}}Kd.parsePairKeyValue=lV;function ert(e,t,n,r){let o=0;for(;o<e.length&&n<Nm.BAGGAGE_MAX_NAME_VALUE_PAIRS;){let i=e.indexOf(Nm.BAGGAGE_ITEMS_SEPARATOR,o),s=i===-1?e.length:i,u=s-o;if(u<=Nm.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS){let l=lV(e.substring(o,s));if(l){let f=(n===0?0:1)+u;if(r+f>Nm.BAGGAGE_MAX_TOTAL_LENGTH)break;t[l.key]=l.metadata?{value:l.value,metadata:l.metadata}:{value:l.value},n++,r+=f}}if(i===-1)break;o=i+1}return[n,r]}Kd.parseBaggageHeaderString=ert;function trt(e){let t={};return typeof e=="string"&&e.length>0&&e.split(Nm.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=lV(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}Kd.parseKeyPairsIntoRecord=trt});var Rge=M(fU=>{"use strict";A();Object.defineProperty(fU,"__esModule",{value:!0});fU.W3CBaggagePropagator=void 0;var pV=(He(),Me(tt)),nrt=gw(),hw=cV(),pU=dV(),fV=class{inject(t,n,r){let o=pV.propagation.getBaggage(t);if(!o||(0,nrt.isTracingSuppressed)(t))return;let i=(0,pU.getKeyPairs)(o).filter(u=>u.length<=hw.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,hw.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,pU.serializeKeyPairs)(i);s.length>0&&r.set(n,hw.BAGGAGE_HEADER,s)}extract(t,n,r){let o=r.get(n,hw.BAGGAGE_HEADER);if(!o)return t;let i={},s=0,u=0;if(Array.isArray(o))for(let l=0;l<o.length;l++)[s,u]=(0,pU.parseBaggageHeaderString)(o[l],i,s,u);else[s]=(0,pU.parseBaggageHeaderString)(o,i,s,u);return s===0?t:pV.propagation.setBaggage(t,pV.propagation.createBaggage(i))}fields(){return[hw.BAGGAGE_HEADER]}};fU.W3CBaggagePropagator=fV});var xge=M(mU=>{"use strict";A();Object.defineProperty(mU,"__esModule",{value:!0});mU.AnchoredClock=void 0;var mV=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}};mU.AnchoredClock=mV});var kge=M(x_=>{"use strict";A();Object.defineProperty(x_,"__esModule",{value:!0});x_.isAttributeValue=x_.isAttributeKey=x_.sanitizeAttributes=void 0;var Dge=(He(),Me(tt));function rrt(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(!Nge(n)){Dge.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!wge(r)){Dge.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}x_.sanitizeAttributes=rrt;function Nge(e){return typeof e=="string"&&e!==""}x_.isAttributeKey=Nge;function wge(e){return e==null?!0:Array.isArray(e)?ort(e):Bge(typeof e)}x_.isAttributeValue=wge;function ort(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(Bge(r)){t=r;continue}return!1}return!1}}return!0}function Bge(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var AV=M(AU=>{"use strict";A();Object.defineProperty(AU,"__esModule",{value:!0});AU.loggingErrorHandler=void 0;var irt=(He(),Me(tt));function srt(){return e=>{irt.diag.error(art(e))}}AU.loggingErrorHandler=srt;function art(e){return typeof e=="string"?e:JSON.stringify(urt(e))}function urt(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 Pge=M(LC=>{"use strict";A();Object.defineProperty(LC,"__esModule",{value:!0});LC.globalErrorHandler=LC.setGlobalErrorHandler=void 0;var crt=AV(),Oge=(0,crt.loggingErrorHandler)();function lrt(e){Oge=e}LC.setGlobalErrorHandler=lrt;function drt(e){try{Oge(e)}catch{}}LC.globalErrorHandler=drt});var Qge=M(wm=>{"use strict";A();Object.defineProperty(wm,"__esModule",{value:!0});wm.getStringListFromEnv=wm.getBooleanFromEnv=wm.getStringFromEnv=wm.getNumberFromEnv=void 0;var Mge=(He(),Me(tt)),Lge=Ue("util");function prt(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){Mge.diag.warn(`Unknown value ${(0,Lge.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}wm.getNumberFromEnv=prt;function Uge(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}wm.getStringFromEnv=Uge;function frt(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||Mge.diag.warn(`Unknown value ${(0,Lge.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}wm.getBooleanFromEnv=frt;function mrt(e){return Uge(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}wm.getStringListFromEnv=mrt});var Fge=M(gU=>{"use strict";A();Object.defineProperty(gU,"__esModule",{value:!0});gU._globalThis=void 0;gU._globalThis=globalThis});var Gge=M(hU=>{"use strict";A();Object.defineProperty(hU,"__esModule",{value:!0});hU.VERSION=void 0;hU.VERSION="2.8.0"});function Mi(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 gV=B(()=>{A()});var jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,whe,Bhe,khe,Ohe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,w_e,B_e,k_e,O_e,P_e,M_e,L_e,U_e,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,Art,hV,grt,hrt,_rt,Ert,_V,yrt,Srt,Trt,brt,Irt,Crt,vrt,Rrt,xrt,Drt,Nrt,wrt,Brt,krt,Ort,Prt,Mrt,Lrt,EV,Urt,Qrt,Frt,Grt,jrt,zrt,Hrt,$rt,qrt,Vrt,Yrt,Krt,yV,Jrt,Zrt,SV,TV,Wrt,Xrt,eot,tot,not,rot,oot,iot,sot,aot,uot,cot,lot,dot,pot,fot,mot,_w,UC,bV,Aot,got,fS,hot,_ot,Eot,yot,IV,CV,Sot,vV,Tot,bot,Iot,Cot,vot,Rot,xot,Dot,Not,wot,Bot,kot,Oot,Pot,Mot,Lot,Uot,Qot,Fot,Got,jot,zot,Hot,RV,$ot,qot,Vot,Yot,Kot,Jot,Zot,Wot,Xot,eit,tit,nit,rit,oit,iit,sit,ait,uit,cit,xV,lit,DV,dit,pit,fit,mit,Ait,git,hit,_it,Eit,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,wEe,BEe,kEe,OEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,jEe,zEe,HEe,$Ee,qEe,VEe,YEe,KEe,JEe,ZEe,WEe,XEe,eye,yit,Sit,Tit,bit,Iit,Cit,vit,Rit,xit,Dit,Nit,wit,Bit,kit,Oit,Pit,Mit,Lit,Uit,Qit,Fit,Git,jit,zit,Hit,$it,qit,Vit,Yit,Kit,Jit,Zit,Wit,Xit,est,tst,nst,rst,ost,ist,sst,ast,ust,cst,lst,dst,pst,fst,tye,nye,rye,oye,iye,sye,aye,uye,cye,lye,dye,mst,Ast,gst,hst,_st,Est,yst,Sst,Tst,bst,Ist,Cst,pye,fye,mye,Aye,gye,vst,Rst,xst,Dst,Nst,wst,hye,_ye,Eye,Bst,kst,Ost,Pst,yye,Sye,Tye,bye,Mst,Lst,Ust,Qst,Fst,Iye,Cye,vye,Rye,xye,Dye,Nye,Gst,jst,zst,Hst,$st,qst,Vst,Yst,wye,Bye,kye,Oye,Pye,Kst,Jst,Zst,Wst,Xst,eat,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,e0e,t0e,n0e,tat,nat,rat,oat,iat,sat,aat,uat,cat,lat,dat,pat,fat,mat,Aat,gat,hat,_at,Eat,yat,Sat,Tat,r0e,o0e,i0e,s0e,a0e,bat,Iat,Cat,vat,Rat,xat,u0e,c0e,Dat,Nat,wat,l0e,d0e,Bat,kat,Oat,p0e,f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,Pat,Mat,Lat,Uat,Qat,Fat,Gat,jat,zat,Hat,$at,qat,Vat,Yat,Kat,Jat,Zat,Wat,D0e,N0e,Xat,eut,tut,w0e=B(()=>{A();gV();jge="aws.lambda.invoked_arn",zge="db.system",Hge="db.connection_string",$ge="db.user",qge="db.jdbc.driver_classname",Vge="db.name",Yge="db.statement",Kge="db.operation",Jge="db.mssql.instance_name",Zge="db.cassandra.keyspace",Wge="db.cassandra.page_size",Xge="db.cassandra.consistency_level",ehe="db.cassandra.table",the="db.cassandra.idempotence",nhe="db.cassandra.speculative_execution_count",rhe="db.cassandra.coordinator.id",ohe="db.cassandra.coordinator.dc",ihe="db.hbase.namespace",she="db.redis.database_index",ahe="db.mongodb.collection",uhe="db.sql.table",che="exception.type",lhe="exception.message",dhe="exception.stacktrace",phe="exception.escaped",fhe="faas.trigger",mhe="faas.execution",Ahe="faas.document.collection",ghe="faas.document.operation",hhe="faas.document.time",_he="faas.document.name",Ehe="faas.time",yhe="faas.cron",She="faas.coldstart",The="faas.invoked_name",bhe="faas.invoked_provider",Ihe="faas.invoked_region",Che="net.transport",vhe="net.peer.ip",Rhe="net.peer.port",xhe="net.peer.name",Dhe="net.host.ip",Nhe="net.host.port",whe="net.host.name",Bhe="net.host.connection.type",khe="net.host.connection.subtype",Ohe="net.host.carrier.name",Phe="net.host.carrier.mcc",Mhe="net.host.carrier.mnc",Lhe="net.host.carrier.icc",Uhe="peer.service",Qhe="enduser.id",Fhe="enduser.role",Ghe="enduser.scope",jhe="thread.id",zhe="thread.name",Hhe="code.function",$he="code.namespace",qhe="code.filepath",Vhe="code.lineno",Yhe="http.method",Khe="http.url",Jhe="http.target",Zhe="http.host",Whe="http.scheme",Xhe="http.status_code",e_e="http.flavor",t_e="http.user_agent",n_e="http.request_content_length",r_e="http.request_content_length_uncompressed",o_e="http.response_content_length",i_e="http.response_content_length_uncompressed",s_e="http.server_name",a_e="http.route",u_e="http.client_ip",c_e="aws.dynamodb.table_names",l_e="aws.dynamodb.consumed_capacity",d_e="aws.dynamodb.item_collection_metrics",p_e="aws.dynamodb.provisioned_read_capacity",f_e="aws.dynamodb.provisioned_write_capacity",m_e="aws.dynamodb.consistent_read",A_e="aws.dynamodb.projection",g_e="aws.dynamodb.limit",h_e="aws.dynamodb.attributes_to_get",__e="aws.dynamodb.index_name",E_e="aws.dynamodb.select",y_e="aws.dynamodb.global_secondary_indexes",S_e="aws.dynamodb.local_secondary_indexes",T_e="aws.dynamodb.exclusive_start_table",b_e="aws.dynamodb.table_count",I_e="aws.dynamodb.scan_forward",C_e="aws.dynamodb.segment",v_e="aws.dynamodb.total_segments",R_e="aws.dynamodb.count",x_e="aws.dynamodb.scanned_count",D_e="aws.dynamodb.attribute_definitions",N_e="aws.dynamodb.global_secondary_index_updates",w_e="messaging.system",B_e="messaging.destination",k_e="messaging.destination_kind",O_e="messaging.temp_destination",P_e="messaging.protocol",M_e="messaging.protocol_version",L_e="messaging.url",U_e="messaging.message_id",Q_e="messaging.conversation_id",F_e="messaging.message_payload_size_bytes",G_e="messaging.message_payload_compressed_size_bytes",j_e="messaging.operation",z_e="messaging.consumer_id",H_e="messaging.rabbitmq.routing_key",$_e="messaging.kafka.message_key",q_e="messaging.kafka.consumer_group",V_e="messaging.kafka.client_id",Y_e="messaging.kafka.partition",K_e="messaging.kafka.tombstone",J_e="rpc.system",Z_e="rpc.service",W_e="rpc.method",X_e="rpc.grpc.status_code",eEe="rpc.jsonrpc.version",tEe="rpc.jsonrpc.request_id",nEe="rpc.jsonrpc.error_code",rEe="rpc.jsonrpc.error_message",oEe="message.type",iEe="message.id",sEe="message.compressed_size",aEe="message.uncompressed_size",Art=jge,hV=zge,grt=Hge,hrt=$ge,_rt=qge,Ert=Vge,_V=Yge,yrt=Kge,Srt=Jge,Trt=Zge,brt=Wge,Irt=Xge,Crt=ehe,vrt=the,Rrt=nhe,xrt=rhe,Drt=ohe,Nrt=ihe,wrt=she,Brt=ahe,krt=uhe,Ort=che,Prt=lhe,Mrt=dhe,Lrt=phe,EV=fhe,Urt=mhe,Qrt=Ahe,Frt=ghe,Grt=hhe,jrt=_he,zrt=Ehe,Hrt=yhe,$rt=She,qrt=The,Vrt=bhe,Yrt=Ihe,Krt=Che,yV=vhe,Jrt=Rhe,Zrt=xhe,SV=Dhe,TV=Nhe,Wrt=whe,Xrt=Bhe,eot=khe,tot=Ohe,not=Phe,rot=Mhe,oot=Lhe,iot=Uhe,sot=Qhe,aot=Fhe,uot=Ghe,cot=jhe,lot=zhe,dot=Hhe,pot=$he,fot=qhe,mot=Vhe,_w=Yhe,UC=Khe,bV=Jhe,Aot=Zhe,got=Whe,fS=Xhe,hot=e_e,_ot=t_e,Eot=n_e,yot=r_e,IV=o_e,CV=i_e,Sot=s_e,vV=a_e,Tot=u_e,bot=c_e,Iot=l_e,Cot=d_e,vot=p_e,Rot=f_e,xot=m_e,Dot=A_e,Not=g_e,wot=h_e,Bot=__e,kot=E_e,Oot=y_e,Pot=S_e,Mot=T_e,Lot=b_e,Uot=I_e,Qot=C_e,Fot=v_e,Got=R_e,jot=x_e,zot=D_e,Hot=N_e,RV=w_e,$ot=B_e,qot=k_e,Vot=O_e,Yot=P_e,Kot=M_e,Jot=L_e,Zot=U_e,Wot=Q_e,Xot=F_e,eit=G_e,tit=j_e,nit=z_e,rit=H_e,oit=$_e,iit=q_e,sit=V_e,ait=Y_e,uit=K_e,cit=J_e,xV=Z_e,lit=W_e,DV=X_e,dit=eEe,pit=tEe,fit=nEe,mit=rEe,Ait=oEe,git=iEe,hit=sEe,_it=aEe,Eit=Mi([jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,whe,Bhe,khe,Ohe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,w_e,B_e,k_e,O_e,P_e,M_e,L_e,U_e,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe]),uEe="other_sql",cEe="mssql",lEe="mysql",dEe="oracle",pEe="db2",fEe="postgresql",mEe="redshift",AEe="hive",gEe="cloudscape",hEe="hsqldb",_Ee="progress",EEe="maxdb",yEe="hanadb",SEe="ingres",TEe="firstsql",bEe="edb",IEe="cache",CEe="adabas",vEe="firebird",REe="derby",xEe="filemaker",DEe="informix",NEe="instantdb",wEe="interbase",BEe="mariadb",kEe="netezza",OEe="pervasive",PEe="pointbase",MEe="sqlite",LEe="sybase",UEe="teradata",QEe="vertica",FEe="h2",GEe="coldfusion",jEe="cassandra",zEe="hbase",HEe="mongodb",$Ee="redis",qEe="couchbase",VEe="couchdb",YEe="cosmosdb",KEe="dynamodb",JEe="neo4j",ZEe="geode",WEe="elasticsearch",XEe="memcached",eye="cockroachdb",yit=uEe,Sit=cEe,Tit=lEe,bit=dEe,Iit=pEe,Cit=fEe,vit=mEe,Rit=AEe,xit=gEe,Dit=hEe,Nit=_Ee,wit=EEe,Bit=yEe,kit=SEe,Oit=TEe,Pit=bEe,Mit=IEe,Lit=CEe,Uit=vEe,Qit=REe,Fit=xEe,Git=DEe,jit=NEe,zit=wEe,Hit=BEe,$it=kEe,qit=OEe,Vit=PEe,Yit=MEe,Kit=LEe,Jit=UEe,Zit=QEe,Wit=FEe,Xit=GEe,est=jEe,tst=zEe,nst=HEe,rst=$Ee,ost=qEe,ist=VEe,sst=YEe,ast=KEe,ust=JEe,cst=ZEe,lst=WEe,dst=XEe,pst=eye,fst=Mi([uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,wEe,BEe,kEe,OEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,jEe,zEe,HEe,$Ee,qEe,VEe,YEe,KEe,JEe,ZEe,WEe,XEe,eye]),tye="all",nye="each_quorum",rye="quorum",oye="local_quorum",iye="one",sye="two",aye="three",uye="local_one",cye="any",lye="serial",dye="local_serial",mst=tye,Ast=nye,gst=rye,hst=oye,_st=iye,Est=sye,yst=aye,Sst=uye,Tst=cye,bst=lye,Ist=dye,Cst=Mi([tye,nye,rye,oye,iye,sye,aye,uye,cye,lye,dye]),pye="datasource",fye="http",mye="pubsub",Aye="timer",gye="other",vst=pye,Rst=fye,xst=mye,Dst=Aye,Nst=gye,wst=Mi([pye,fye,mye,Aye,gye]),hye="insert",_ye="edit",Eye="delete",Bst=hye,kst=_ye,Ost=Eye,Pst=Mi([hye,_ye,Eye]),yye="alibaba_cloud",Sye="aws",Tye="azure",bye="gcp",Mst=yye,Lst=Sye,Ust=Tye,Qst=bye,Fst=Mi([yye,Sye,Tye,bye]),Iye="ip_tcp",Cye="ip_udp",vye="ip",Rye="unix",xye="pipe",Dye="inproc",Nye="other",Gst=Iye,jst=Cye,zst=vye,Hst=Rye,$st=xye,qst=Dye,Vst=Nye,Yst=Mi([Iye,Cye,vye,Rye,xye,Dye,Nye]),wye="wifi",Bye="wired",kye="cell",Oye="unavailable",Pye="unknown",Kst=wye,Jst=Bye,Zst=kye,Wst=Oye,Xst=Pye,eat=Mi([wye,Bye,kye,Oye,Pye]),Mye="gprs",Lye="edge",Uye="umts",Qye="cdma",Fye="evdo_0",Gye="evdo_a",jye="cdma2000_1xrtt",zye="hsdpa",Hye="hsupa",$ye="hspa",qye="iden",Vye="evdo_b",Yye="lte",Kye="ehrpd",Jye="hspap",Zye="gsm",Wye="td_scdma",Xye="iwlan",e0e="nr",t0e="nrnsa",n0e="lte_ca",tat=Mye,nat=Lye,rat=Uye,oat=Qye,iat=Fye,sat=Gye,aat=jye,uat=zye,cat=Hye,lat=$ye,dat=qye,pat=Vye,fat=Yye,mat=Kye,Aat=Jye,gat=Zye,hat=Wye,_at=Xye,Eat=e0e,yat=t0e,Sat=n0e,Tat=Mi([Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,e0e,t0e,n0e]),r0e="1.0",o0e="1.1",i0e="2.0",s0e="SPDY",a0e="QUIC",bat=r0e,Iat=o0e,Cat=i0e,vat=s0e,Rat=a0e,xat={HTTP_1_0:r0e,HTTP_1_1:o0e,HTTP_2_0:i0e,SPDY:s0e,QUIC:a0e},u0e="queue",c0e="topic",Dat=u0e,Nat=c0e,wat=Mi([u0e,c0e]),l0e="receive",d0e="process",Bat=l0e,kat=d0e,Oat=Mi([l0e,d0e]),p0e=0,f0e=1,m0e=2,A0e=3,g0e=4,h0e=5,_0e=6,E0e=7,y0e=8,S0e=9,T0e=10,b0e=11,I0e=12,C0e=13,v0e=14,R0e=15,x0e=16,Pat=p0e,Mat=f0e,Lat=m0e,Uat=A0e,Qat=g0e,Fat=h0e,Gat=_0e,jat=E0e,zat=y0e,Hat=S0e,$at=T0e,qat=b0e,Vat=I0e,Yat=C0e,Kat=v0e,Jat=R0e,Zat=x0e,Wat={OK:p0e,CANCELLED:f0e,UNKNOWN:m0e,INVALID_ARGUMENT:A0e,DEADLINE_EXCEEDED:g0e,NOT_FOUND:h0e,ALREADY_EXISTS:_0e,PERMISSION_DENIED:E0e,RESOURCE_EXHAUSTED:y0e,FAILED_PRECONDITION:S0e,ABORTED:T0e,OUT_OF_RANGE:b0e,UNIMPLEMENTED:I0e,INTERNAL:C0e,UNAVAILABLE:v0e,DATA_LOSS:R0e,UNAUTHENTICATED:x0e},D0e="SENT",N0e="RECEIVED",Xat=D0e,eut=N0e,tut=Mi([D0e,N0e])});var B0e=B(()=>{A();w0e()});var k0e,O0e,P0e,M0e,L0e,U0e,Q0e,F0e,G0e,j0e,z0e,H0e,$0e,q0e,V0e,Y0e,K0e,J0e,Z0e,W0e,X0e,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,wSe,BSe,kSe,OSe,PSe,MSe,LSe,USe,QSe,FSe,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,rTe,oTe,iTe,nut,rut,out,iut,sut,aut,uut,cut,lut,dut,put,fut,mut,Aut,gut,hut,_ut,Eut,yut,Sut,Tut,but,Iut,Cut,vut,Rut,xut,Dut,Nut,wut,But,kut,Out,Put,Mut,Lut,Uut,Qut,Fut,Gut,jut,zut,Hut,$ut,qut,Vut,Yut,Kut,Jut,Zut,Wut,Xut,ect,tct,nct,rct,oct,ict,sct,act,uct,cct,lct,dct,pct,fct,mct,Act,gct,hct,_ct,NV,Ect,yct,Sct,Tct,bct,Ict,Cct,vct,Rct,xct,sTe,aTe,uTe,cTe,Dct,Nct,wct,Bct,kct,lTe,dTe,pTe,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,bTe,ITe,CTe,vTe,Oct,Pct,Mct,Lct,Uct,Qct,Fct,Gct,jct,zct,Hct,$ct,qct,Vct,Yct,Kct,Jct,Zct,RTe,xTe,Wct,Xct,elt,DTe,NTe,wTe,BTe,kTe,OTe,PTe,tlt,nlt,rlt,olt,ilt,slt,alt,ult,MTe,LTe,UTe,QTe,FTe,GTe,jTe,zTe,HTe,$Te,qTe,clt,llt,dlt,plt,flt,mlt,Alt,glt,hlt,_lt,Elt,ylt,VTe,YTe,KTe,JTe,ZTe,WTe,XTe,ebe,tbe,nbe,Slt,Tlt,blt,Ilt,Clt,vlt,Rlt,xlt,Dlt,Nlt,wlt,rbe=B(()=>{A();gV();k0e="cloud.provider",O0e="cloud.account.id",P0e="cloud.region",M0e="cloud.availability_zone",L0e="cloud.platform",U0e="aws.ecs.container.arn",Q0e="aws.ecs.cluster.arn",F0e="aws.ecs.launchtype",G0e="aws.ecs.task.arn",j0e="aws.ecs.task.family",z0e="aws.ecs.task.revision",H0e="aws.eks.cluster.arn",$0e="aws.log.group.names",q0e="aws.log.group.arns",V0e="aws.log.stream.names",Y0e="aws.log.stream.arns",K0e="container.name",J0e="container.id",Z0e="container.runtime",W0e="container.image.name",X0e="container.image.tag",eSe="deployment.environment",tSe="device.id",nSe="device.model.identifier",rSe="device.model.name",oSe="faas.name",iSe="faas.id",sSe="faas.version",aSe="faas.instance",uSe="faas.max_memory",cSe="host.id",lSe="host.name",dSe="host.type",pSe="host.arch",fSe="host.image.name",mSe="host.image.id",ASe="host.image.version",gSe="k8s.cluster.name",hSe="k8s.node.name",_Se="k8s.node.uid",ESe="k8s.namespace.name",ySe="k8s.pod.uid",SSe="k8s.pod.name",TSe="k8s.container.name",bSe="k8s.replicaset.uid",ISe="k8s.replicaset.name",CSe="k8s.deployment.uid",vSe="k8s.deployment.name",RSe="k8s.statefulset.uid",xSe="k8s.statefulset.name",DSe="k8s.daemonset.uid",NSe="k8s.daemonset.name",wSe="k8s.job.uid",BSe="k8s.job.name",kSe="k8s.cronjob.uid",OSe="k8s.cronjob.name",PSe="os.type",MSe="os.description",LSe="os.name",USe="os.version",QSe="process.pid",FSe="process.executable.name",GSe="process.executable.path",jSe="process.command",zSe="process.command_line",HSe="process.command_args",$Se="process.owner",qSe="process.runtime.name",VSe="process.runtime.version",YSe="process.runtime.description",KSe="service.name",JSe="service.namespace",ZSe="service.instance.id",WSe="service.version",XSe="telemetry.sdk.name",eTe="telemetry.sdk.language",tTe="telemetry.sdk.version",nTe="telemetry.auto.version",rTe="webengine.name",oTe="webengine.version",iTe="webengine.description",nut=k0e,rut=O0e,out=P0e,iut=M0e,sut=L0e,aut=U0e,uut=Q0e,cut=F0e,lut=G0e,dut=j0e,put=z0e,fut=H0e,mut=$0e,Aut=q0e,gut=V0e,hut=Y0e,_ut=K0e,Eut=J0e,yut=Z0e,Sut=W0e,Tut=X0e,but=eSe,Iut=tSe,Cut=nSe,vut=rSe,Rut=oSe,xut=iSe,Dut=sSe,Nut=aSe,wut=uSe,But=cSe,kut=lSe,Out=dSe,Put=pSe,Mut=fSe,Lut=mSe,Uut=ASe,Qut=gSe,Fut=hSe,Gut=_Se,jut=ESe,zut=ySe,Hut=SSe,$ut=TSe,qut=bSe,Vut=ISe,Yut=CSe,Kut=vSe,Jut=RSe,Zut=xSe,Wut=DSe,Xut=NSe,ect=wSe,tct=BSe,nct=kSe,rct=OSe,oct=PSe,ict=MSe,sct=LSe,act=USe,uct=QSe,cct=FSe,lct=GSe,dct=jSe,pct=zSe,fct=HSe,mct=$Se,Act=qSe,gct=VSe,hct=YSe,_ct=KSe,NV=JSe,Ect=ZSe,yct=WSe,Sct=XSe,Tct=eTe,bct=tTe,Ict=nTe,Cct=rTe,vct=oTe,Rct=iTe,xct=Mi([k0e,O0e,P0e,M0e,L0e,U0e,Q0e,F0e,G0e,j0e,z0e,H0e,$0e,q0e,V0e,Y0e,K0e,J0e,Z0e,W0e,X0e,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,wSe,BSe,kSe,OSe,PSe,MSe,LSe,USe,QSe,FSe,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,rTe,oTe,iTe]),sTe="alibaba_cloud",aTe="aws",uTe="azure",cTe="gcp",Dct=sTe,Nct=aTe,wct=uTe,Bct=cTe,kct=Mi([sTe,aTe,uTe,cTe]),lTe="alibaba_cloud_ecs",dTe="alibaba_cloud_fc",pTe="aws_ec2",fTe="aws_ecs",mTe="aws_eks",ATe="aws_lambda",gTe="aws_elastic_beanstalk",hTe="azure_vm",_Te="azure_container_instances",ETe="azure_aks",yTe="azure_functions",STe="azure_app_service",TTe="gcp_compute_engine",bTe="gcp_cloud_run",ITe="gcp_kubernetes_engine",CTe="gcp_cloud_functions",vTe="gcp_app_engine",Oct=lTe,Pct=dTe,Mct=pTe,Lct=fTe,Uct=mTe,Qct=ATe,Fct=gTe,Gct=hTe,jct=_Te,zct=ETe,Hct=yTe,$ct=STe,qct=TTe,Vct=bTe,Yct=ITe,Kct=CTe,Jct=vTe,Zct=Mi([lTe,dTe,pTe,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,bTe,ITe,CTe,vTe]),RTe="ec2",xTe="fargate",Wct=RTe,Xct=xTe,elt=Mi([RTe,xTe]),DTe="amd64",NTe="arm32",wTe="arm64",BTe="ia64",kTe="ppc32",OTe="ppc64",PTe="x86",tlt=DTe,nlt=NTe,rlt=wTe,olt=BTe,ilt=kTe,slt=OTe,alt=PTe,ult=Mi([DTe,NTe,wTe,BTe,kTe,OTe,PTe]),MTe="windows",LTe="linux",UTe="darwin",QTe="freebsd",FTe="netbsd",GTe="openbsd",jTe="dragonflybsd",zTe="hpux",HTe="aix",$Te="solaris",qTe="z_os",clt=MTe,llt=LTe,dlt=UTe,plt=QTe,flt=FTe,mlt=GTe,Alt=jTe,glt=zTe,hlt=HTe,_lt=$Te,Elt=qTe,ylt=Mi([MTe,LTe,UTe,QTe,FTe,GTe,jTe,zTe,HTe,$Te,qTe]),VTe="cpp",YTe="dotnet",KTe="erlang",JTe="go",ZTe="java",WTe="nodejs",XTe="php",ebe="python",tbe="ruby",nbe="webjs",Slt=VTe,Tlt=YTe,blt=KTe,Ilt=JTe,Clt=ZTe,vlt=WTe,Rlt=XTe,xlt=ebe,Dlt=tbe,Nlt=nbe,wlt=Mi([VTe,YTe,KTe,JTe,ZTe,WTe,XTe,ebe,tbe,nbe])});var obe=B(()=>{A();rbe()});var Blt,klt,Olt,Plt,Mlt,Llt,Ult,Qlt,Flt,Glt,jlt,zlt,Hlt,$lt,qlt,Vlt,Ylt,Klt,Jlt,Zlt,Wlt,Xlt,edt,tdt,ndt,wV,BV,rdt,QC,odt,kV,OV,idt,mS,sdt,adt,udt,cdt,ldt,ddt,pdt,fdt,Yan,Kan,PV,mdt,Adt,gdt,hdt,_dt,Edt,AS,ydt,Sdt,Tdt,Jan,bdt,Idt,Cdt,vdt,Zan,Rdt,xdt,Ddt,Ndt,Cg,vg,wdt,Bdt,kdt,Odt,Pdt,Mdt,Ldt,Udt,Qdt,Wan,Fdt,Gdt,jdt,zdt,Hdt,$dt,MV,LV,qdt,UV,QV,Vdt,Ydt,Xan,eun,Kdt,Jdt,Zdt,Wdt,Xdt,ept,tpt,npt,tun,rpt,FV,GV,opt,jV,ipt,zV,spt,apt,upt,cpt,lpt,dpt,ppt,fpt,mpt,nun,Apt,gpt,run,hpt,_pt,oun,Ept,ypt,Spt,Tpt,bpt,Ipt,Cpt,vpt,D_,Rpt,xpt,Dpt,HV,ibe=B(()=>{A();Blt="aspnetcore.diagnostics.exception.result",klt="aborted",Olt="handled",Plt="skipped",Mlt="unhandled",Llt="aspnetcore.diagnostics.handler.type",Ult="aspnetcore.rate_limiting.policy",Qlt="aspnetcore.rate_limiting.result",Flt="acquired",Glt="endpoint_limiter",jlt="global_limiter",zlt="request_canceled",Hlt="aspnetcore.request.is_unhandled",$lt="aspnetcore.routing.is_fallback",qlt="aspnetcore.routing.match_status",Vlt="failure",Ylt="success",Klt="aspnetcore.user.is_authenticated",Jlt="client.address",Zlt="client.port",Wlt="code.column.number",Xlt="code.file.path",edt="code.function.name",tdt="code.line.number",ndt="code.stacktrace",wV="db.collection.name",BV="db.namespace",rdt="db.operation.batch.size",QC="db.operation.name",odt="db.query.summary",kV="db.query.text",OV="db.response.status_code",idt="db.stored_procedure.name",mS="db.system.name",sdt="mariadb",adt="microsoft.sql_server",udt="mysql",cdt="postgresql",ldt="dotnet.gc.heap.generation",ddt="gen0",pdt="gen1",fdt="gen2",Yan="loh",Kan="poh",PV="error.type",mdt="_OTHER",Adt="exception.escaped",gdt="exception.message",hdt="exception.stacktrace",_dt="exception.type",Edt=e=>`http.request.header.${e}`,AS="http.request.method",ydt="_OTHER",Sdt="CONNECT",Tdt="DELETE",Jan="GET",bdt="HEAD",Idt="OPTIONS",Cdt="PATCH",vdt="POST",Zan="PUT",Rdt="TRACE",xdt="http.request.method_original",Ddt="http.request.resend_count",Ndt=e=>`http.response.header.${e}`,Cg="http.response.status_code",vg="http.route",wdt="jvm.gc.action",Bdt="jvm.gc.name",kdt="jvm.memory.pool.name",Odt="jvm.memory.type",Pdt="heap",Mdt="non_heap",Ldt="jvm.thread.daemon",Udt="jvm.thread.state",Qdt="blocked",Wan="new",Fdt="runnable",Gdt="terminated",jdt="timed_waiting",zdt="waiting",Hdt="network.local.address",$dt="network.local.port",MV="network.peer.address",LV="network.peer.port",qdt="network.protocol.name",UV="network.protocol.version",QV="network.transport",Vdt="pipe",Ydt="quic",Xan="tcp",eun="udp",Kdt="unix",Jdt="network.type",Zdt="ipv4",Wdt="ipv6",Xdt="otel.scope.name",ept="otel.scope.version",tpt="otel.status_code",npt="ERROR",tun="OK",rpt="otel.status_description",FV="server.address",GV="server.port",opt="service.instance.id",jV="service.name",ipt="service.namespace",zV="service.version",spt="signalr.connection.status",apt="app_shutdown",upt="normal_closure",cpt="timeout",lpt="signalr.transport",dpt="long_polling",ppt="server_sent_events",fpt="web_sockets",mpt="telemetry.sdk.language",nun="cpp",Apt="dotnet",gpt="erlang",run="go",hpt="java",_pt="nodejs",oun="php",Ept="python",ypt="ruby",Spt="rust",Tpt="swift",bpt="webjs",Ipt="telemetry.sdk.name",Cpt="telemetry.sdk.version",vpt="url.fragment",D_="url.full",Rpt="url.path",xpt="url.query",Dpt="url.scheme",HV="user_agent.original"});var Npt,wpt,Bpt,kpt,Opt,Ppt,Mpt,Lpt,Upt,Qpt,Fpt,Gpt,jpt,zpt,Hpt,$pt,qpt,Vpt,Ypt,Kpt,Jpt,Zpt,Wpt,Xpt,eft,tft,nft,rft,oft,ift,sft,aft,uft,cft,lft,dft,pft,fft,mft,Aft,gft,hft,_ft,Eft,yft,Sft,Tft,bft,Ift,Cft,vft,sbe=B(()=>{A();Npt="aspnetcore.diagnostics.exceptions",wpt="aspnetcore.rate_limiting.active_request_leases",Bpt="aspnetcore.rate_limiting.queued_requests",kpt="aspnetcore.rate_limiting.request.time_in_queue",Opt="aspnetcore.rate_limiting.request_lease.duration",Ppt="aspnetcore.rate_limiting.requests",Mpt="aspnetcore.routing.match_attempts",Lpt="db.client.operation.duration",Upt="dotnet.assembly.count",Qpt="dotnet.exceptions",Fpt="dotnet.gc.collections",Gpt="dotnet.gc.heap.total_allocated",jpt="dotnet.gc.last_collection.heap.fragmentation.size",zpt="dotnet.gc.last_collection.heap.size",Hpt="dotnet.gc.last_collection.memory.committed_size",$pt="dotnet.gc.pause.time",qpt="dotnet.jit.compilation.time",Vpt="dotnet.jit.compiled_il.size",Ypt="dotnet.jit.compiled_methods",Kpt="dotnet.monitor.lock_contentions",Jpt="dotnet.process.cpu.count",Zpt="dotnet.process.cpu.time",Wpt="dotnet.process.memory.working_set",Xpt="dotnet.thread_pool.queue.length",eft="dotnet.thread_pool.thread.count",tft="dotnet.thread_pool.work_item.count",nft="dotnet.timer.count",rft="http.client.request.duration",oft="http.server.request.duration",ift="jvm.class.count",sft="jvm.class.loaded",aft="jvm.class.unloaded",uft="jvm.cpu.count",cft="jvm.cpu.recent_utilization",lft="jvm.cpu.time",dft="jvm.gc.duration",pft="jvm.memory.committed",fft="jvm.memory.limit",mft="jvm.memory.used",Aft="jvm.memory.used_after_last_gc",gft="jvm.thread.count",hft="kestrel.active_connections",_ft="kestrel.active_tls_handshakes",Eft="kestrel.connection.duration",yft="kestrel.queued_connections",Sft="kestrel.queued_requests",Tft="kestrel.rejected_connections",bft="kestrel.tls_handshake.duration",Ift="kestrel.upgraded_connections",Cft="signalr.server.active_connections",vft="signalr.server.connection.duration"});var Rft,abe=B(()=>{A();Rft="exception"});var qr={};Ws(qr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>klt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Olt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Plt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Mlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>Flt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Glt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>jlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>zlt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>Vlt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Ylt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Blt,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Llt,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Ult,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Qlt,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Hlt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>$lt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>qlt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Klt,ATTR_CLIENT_ADDRESS:()=>Jlt,ATTR_CLIENT_PORT:()=>Zlt,ATTR_CODE_COLUMN_NUMBER:()=>Wlt,ATTR_CODE_FILE_PATH:()=>Xlt,ATTR_CODE_FUNCTION_NAME:()=>edt,ATTR_CODE_LINE_NUMBER:()=>tdt,ATTR_CODE_STACKTRACE:()=>ndt,ATTR_DB_COLLECTION_NAME:()=>wV,ATTR_DB_NAMESPACE:()=>BV,ATTR_DB_OPERATION_BATCH_SIZE:()=>rdt,ATTR_DB_OPERATION_NAME:()=>QC,ATTR_DB_QUERY_SUMMARY:()=>odt,ATTR_DB_QUERY_TEXT:()=>kV,ATTR_DB_RESPONSE_STATUS_CODE:()=>OV,ATTR_DB_STORED_PROCEDURE_NAME:()=>idt,ATTR_DB_SYSTEM_NAME:()=>mS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>ldt,ATTR_ERROR_TYPE:()=>PV,ATTR_EXCEPTION_ESCAPED:()=>Adt,ATTR_EXCEPTION_MESSAGE:()=>gdt,ATTR_EXCEPTION_STACKTRACE:()=>hdt,ATTR_EXCEPTION_TYPE:()=>_dt,ATTR_HTTP_REQUEST_HEADER:()=>Edt,ATTR_HTTP_REQUEST_METHOD:()=>AS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>xdt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Ddt,ATTR_HTTP_RESPONSE_HEADER:()=>Ndt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>Cg,ATTR_HTTP_ROUTE:()=>vg,ATTR_JVM_GC_ACTION:()=>wdt,ATTR_JVM_GC_NAME:()=>Bdt,ATTR_JVM_MEMORY_POOL_NAME:()=>kdt,ATTR_JVM_MEMORY_TYPE:()=>Odt,ATTR_JVM_THREAD_DAEMON:()=>Ldt,ATTR_JVM_THREAD_STATE:()=>Udt,ATTR_NETWORK_LOCAL_ADDRESS:()=>Hdt,ATTR_NETWORK_LOCAL_PORT:()=>$dt,ATTR_NETWORK_PEER_ADDRESS:()=>MV,ATTR_NETWORK_PEER_PORT:()=>LV,ATTR_NETWORK_PROTOCOL_NAME:()=>qdt,ATTR_NETWORK_PROTOCOL_VERSION:()=>UV,ATTR_NETWORK_TRANSPORT:()=>QV,ATTR_NETWORK_TYPE:()=>Jdt,ATTR_OTEL_SCOPE_NAME:()=>Xdt,ATTR_OTEL_SCOPE_VERSION:()=>ept,ATTR_OTEL_STATUS_CODE:()=>tpt,ATTR_OTEL_STATUS_DESCRIPTION:()=>rpt,ATTR_SERVER_ADDRESS:()=>FV,ATTR_SERVER_PORT:()=>GV,ATTR_SERVICE_INSTANCE_ID:()=>opt,ATTR_SERVICE_NAME:()=>jV,ATTR_SERVICE_NAMESPACE:()=>ipt,ATTR_SERVICE_VERSION:()=>zV,ATTR_SIGNALR_CONNECTION_STATUS:()=>spt,ATTR_SIGNALR_TRANSPORT:()=>lpt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>mpt,ATTR_TELEMETRY_SDK_NAME:()=>Ipt,ATTR_TELEMETRY_SDK_VERSION:()=>Cpt,ATTR_URL_FRAGMENT:()=>vpt,ATTR_URL_FULL:()=>D_,ATTR_URL_PATH:()=>Rpt,ATTR_URL_QUERY:()=>xpt,ATTR_URL_SCHEME:()=>Dpt,ATTR_USER_AGENT_ORIGINAL:()=>HV,AWSECSLAUNCHTYPEVALUES_EC2:()=>Wct,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Xct,AwsEcsLaunchtypeValues:()=>elt,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Oct,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Pct,CLOUDPLATFORMVALUES_AWS_EC2:()=>Mct,CLOUDPLATFORMVALUES_AWS_ECS:()=>Lct,CLOUDPLATFORMVALUES_AWS_EKS:()=>Uct,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Fct,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Qct,CLOUDPLATFORMVALUES_AZURE_AKS:()=>zct,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>$ct,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>jct,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Hct,CLOUDPLATFORMVALUES_AZURE_VM:()=>Gct,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Jct,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Kct,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Vct,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>qct,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Yct,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Dct,CLOUDPROVIDERVALUES_AWS:()=>Nct,CLOUDPROVIDERVALUES_AZURE:()=>wct,CLOUDPROVIDERVALUES_GCP:()=>Bct,CloudPlatformValues:()=>Zct,CloudProviderValues:()=>kct,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>mst,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Tst,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Ast,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Sst,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>hst,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Ist,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>_st,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>gst,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>bst,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>yst,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Est,DBSYSTEMVALUES_ADABAS:()=>Lit,DBSYSTEMVALUES_CACHE:()=>Mit,DBSYSTEMVALUES_CASSANDRA:()=>est,DBSYSTEMVALUES_CLOUDSCAPE:()=>xit,DBSYSTEMVALUES_COCKROACHDB:()=>pst,DBSYSTEMVALUES_COLDFUSION:()=>Xit,DBSYSTEMVALUES_COSMOSDB:()=>sst,DBSYSTEMVALUES_COUCHBASE:()=>ost,DBSYSTEMVALUES_COUCHDB:()=>ist,DBSYSTEMVALUES_DB2:()=>Iit,DBSYSTEMVALUES_DERBY:()=>Qit,DBSYSTEMVALUES_DYNAMODB:()=>ast,DBSYSTEMVALUES_EDB:()=>Pit,DBSYSTEMVALUES_ELASTICSEARCH:()=>lst,DBSYSTEMVALUES_FILEMAKER:()=>Fit,DBSYSTEMVALUES_FIREBIRD:()=>Uit,DBSYSTEMVALUES_FIRSTSQL:()=>Oit,DBSYSTEMVALUES_GEODE:()=>cst,DBSYSTEMVALUES_H2:()=>Wit,DBSYSTEMVALUES_HANADB:()=>Bit,DBSYSTEMVALUES_HBASE:()=>tst,DBSYSTEMVALUES_HIVE:()=>Rit,DBSYSTEMVALUES_HSQLDB:()=>Dit,DBSYSTEMVALUES_INFORMIX:()=>Git,DBSYSTEMVALUES_INGRES:()=>kit,DBSYSTEMVALUES_INSTANTDB:()=>jit,DBSYSTEMVALUES_INTERBASE:()=>zit,DBSYSTEMVALUES_MARIADB:()=>Hit,DBSYSTEMVALUES_MAXDB:()=>wit,DBSYSTEMVALUES_MEMCACHED:()=>dst,DBSYSTEMVALUES_MONGODB:()=>nst,DBSYSTEMVALUES_MSSQL:()=>Sit,DBSYSTEMVALUES_MYSQL:()=>Tit,DBSYSTEMVALUES_NEO4J:()=>ust,DBSYSTEMVALUES_NETEZZA:()=>$it,DBSYSTEMVALUES_ORACLE:()=>bit,DBSYSTEMVALUES_OTHER_SQL:()=>yit,DBSYSTEMVALUES_PERVASIVE:()=>qit,DBSYSTEMVALUES_POINTBASE:()=>Vit,DBSYSTEMVALUES_POSTGRESQL:()=>Cit,DBSYSTEMVALUES_PROGRESS:()=>Nit,DBSYSTEMVALUES_REDIS:()=>rst,DBSYSTEMVALUES_REDSHIFT:()=>vit,DBSYSTEMVALUES_SQLITE:()=>Yit,DBSYSTEMVALUES_SYBASE:()=>Kit,DBSYSTEMVALUES_TERADATA:()=>Jit,DBSYSTEMVALUES_VERTICA:()=>Zit,DB_SYSTEM_NAME_VALUE_MARIADB:()=>sdt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>adt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>udt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>cdt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>ddt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>pdt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>fdt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Yan,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Kan,DbCassandraConsistencyLevelValues:()=>Cst,DbSystemValues:()=>fst,ERROR_TYPE_VALUE_OTHER:()=>mdt,EVENT_EXCEPTION:()=>Rft,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Ost,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>kst,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Bst,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Mst,FAASINVOKEDPROVIDERVALUES_AWS:()=>Lst,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Ust,FAASINVOKEDPROVIDERVALUES_GCP:()=>Qst,FAASTRIGGERVALUES_DATASOURCE:()=>vst,FAASTRIGGERVALUES_HTTP:()=>Rst,FAASTRIGGERVALUES_OTHER:()=>Nst,FAASTRIGGERVALUES_PUBSUB:()=>xst,FAASTRIGGERVALUES_TIMER:()=>Dst,FaasDocumentOperationValues:()=>Pst,FaasInvokedProviderValues:()=>Fst,FaasTriggerValues:()=>wst,HOSTARCHVALUES_AMD64:()=>tlt,HOSTARCHVALUES_ARM32:()=>nlt,HOSTARCHVALUES_ARM64:()=>rlt,HOSTARCHVALUES_IA64:()=>olt,HOSTARCHVALUES_PPC32:()=>ilt,HOSTARCHVALUES_PPC64:()=>slt,HOSTARCHVALUES_X86:()=>alt,HTTPFLAVORVALUES_HTTP_1_0:()=>bat,HTTPFLAVORVALUES_HTTP_1_1:()=>Iat,HTTPFLAVORVALUES_HTTP_2_0:()=>Cat,HTTPFLAVORVALUES_QUIC:()=>Rat,HTTPFLAVORVALUES_SPDY:()=>vat,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Sdt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Tdt,HTTP_REQUEST_METHOD_VALUE_GET:()=>Jan,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>bdt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Idt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>ydt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Cdt,HTTP_REQUEST_METHOD_VALUE_POST:()=>vdt,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Zan,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Rdt,HostArchValues:()=>ult,HttpFlavorValues:()=>xat,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Pdt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Mdt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Qdt,JVM_THREAD_STATE_VALUE_NEW:()=>Wan,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Fdt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Gdt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>jdt,JVM_THREAD_STATE_VALUE_WAITING:()=>zdt,MESSAGETYPEVALUES_RECEIVED:()=>eut,MESSAGETYPEVALUES_SENT:()=>Xat,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Dat,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Nat,MESSAGINGOPERATIONVALUES_PROCESS:()=>kat,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Bat,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Npt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>wpt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Bpt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Ppt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Opt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>kpt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Mpt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Lpt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Upt,METRIC_DOTNET_EXCEPTIONS:()=>Qpt,METRIC_DOTNET_GC_COLLECTIONS:()=>Fpt,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>Gpt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>jpt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>zpt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Hpt,METRIC_DOTNET_GC_PAUSE_TIME:()=>$pt,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>qpt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Vpt,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Ypt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Kpt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>Jpt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>Zpt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>Wpt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>Xpt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>eft,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>tft,METRIC_DOTNET_TIMER_COUNT:()=>nft,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>rft,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>oft,METRIC_JVM_CLASS_COUNT:()=>ift,METRIC_JVM_CLASS_LOADED:()=>sft,METRIC_JVM_CLASS_UNLOADED:()=>aft,METRIC_JVM_CPU_COUNT:()=>uft,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>cft,METRIC_JVM_CPU_TIME:()=>lft,METRIC_JVM_GC_DURATION:()=>dft,METRIC_JVM_MEMORY_COMMITTED:()=>pft,METRIC_JVM_MEMORY_LIMIT:()=>fft,METRIC_JVM_MEMORY_USED:()=>mft,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Aft,METRIC_JVM_THREAD_COUNT:()=>gft,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>hft,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>_ft,METRIC_KESTREL_CONNECTION_DURATION:()=>Eft,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>yft,METRIC_KESTREL_QUEUED_REQUESTS:()=>Sft,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Tft,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>bft,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Ift,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Cft,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>vft,MessageTypeValues:()=>tut,MessagingDestinationKindValues:()=>wat,MessagingOperationValues:()=>Oat,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>oat,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>aat,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>nat,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>mat,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>iat,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>sat,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>pat,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>tat,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>gat,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>uat,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>lat,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Aat,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>cat,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>dat,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>_at,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>fat,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Sat,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Eat,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>yat,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>hat,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>rat,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Zst,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>Wst,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Xst,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Kst,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>Jst,NETTRANSPORTVALUES_INPROC:()=>qst,NETTRANSPORTVALUES_IP:()=>zst,NETTRANSPORTVALUES_IP_TCP:()=>Gst,NETTRANSPORTVALUES_IP_UDP:()=>jst,NETTRANSPORTVALUES_OTHER:()=>Vst,NETTRANSPORTVALUES_PIPE:()=>$st,NETTRANSPORTVALUES_UNIX:()=>Hst,NETWORK_TRANSPORT_VALUE_PIPE:()=>Vdt,NETWORK_TRANSPORT_VALUE_QUIC:()=>Ydt,NETWORK_TRANSPORT_VALUE_TCP:()=>Xan,NETWORK_TRANSPORT_VALUE_UDP:()=>eun,NETWORK_TRANSPORT_VALUE_UNIX:()=>Kdt,NETWORK_TYPE_VALUE_IPV4:()=>Zdt,NETWORK_TYPE_VALUE_IPV6:()=>Wdt,NetHostConnectionSubtypeValues:()=>Tat,NetHostConnectionTypeValues:()=>eat,NetTransportValues:()=>Yst,OSTYPEVALUES_AIX:()=>hlt,OSTYPEVALUES_DARWIN:()=>dlt,OSTYPEVALUES_DRAGONFLYBSD:()=>Alt,OSTYPEVALUES_FREEBSD:()=>plt,OSTYPEVALUES_HPUX:()=>glt,OSTYPEVALUES_LINUX:()=>llt,OSTYPEVALUES_NETBSD:()=>flt,OSTYPEVALUES_OPENBSD:()=>mlt,OSTYPEVALUES_SOLARIS:()=>_lt,OSTYPEVALUES_WINDOWS:()=>clt,OSTYPEVALUES_Z_OS:()=>Elt,OTEL_STATUS_CODE_VALUE_ERROR:()=>npt,OTEL_STATUS_CODE_VALUE_OK:()=>tun,OsTypeValues:()=>ylt,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>$at,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Gat,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Mat,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Jat,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Qat,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Hat,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Yat,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Uat,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Fat,RPCGRPCSTATUSCODEVALUES_OK:()=>Pat,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>qat,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>jat,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>zat,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Zat,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Kat,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Vat,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Lat,RpcGrpcStatusCodeValues:()=>Wat,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>wot,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>zot,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>xot,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Iot,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Got,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Mot,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Oot,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Hot,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Bot,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Cot,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Not,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Pot,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Dot,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>vot,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Rot,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>jot,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Uot,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Qot,SEMATTRS_AWS_DYNAMODB_SELECT:()=>kot,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Lot,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>bot,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Fot,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Art,SEMATTRS_CODE_FILEPATH:()=>fot,SEMATTRS_CODE_FUNCTION:()=>dot,SEMATTRS_CODE_LINENO:()=>mot,SEMATTRS_CODE_NAMESPACE:()=>pot,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Irt,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Drt,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>xrt,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>vrt,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Trt,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>brt,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Rrt,SEMATTRS_DB_CASSANDRA_TABLE:()=>Crt,SEMATTRS_DB_CONNECTION_STRING:()=>grt,SEMATTRS_DB_HBASE_NAMESPACE:()=>Nrt,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>_rt,SEMATTRS_DB_MONGODB_COLLECTION:()=>Brt,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Srt,SEMATTRS_DB_NAME:()=>Ert,SEMATTRS_DB_OPERATION:()=>yrt,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>wrt,SEMATTRS_DB_SQL_TABLE:()=>krt,SEMATTRS_DB_STATEMENT:()=>_V,SEMATTRS_DB_SYSTEM:()=>hV,SEMATTRS_DB_USER:()=>hrt,SEMATTRS_ENDUSER_ID:()=>sot,SEMATTRS_ENDUSER_ROLE:()=>aot,SEMATTRS_ENDUSER_SCOPE:()=>uot,SEMATTRS_EXCEPTION_ESCAPED:()=>Lrt,SEMATTRS_EXCEPTION_MESSAGE:()=>Prt,SEMATTRS_EXCEPTION_STACKTRACE:()=>Mrt,SEMATTRS_EXCEPTION_TYPE:()=>Ort,SEMATTRS_FAAS_COLDSTART:()=>$rt,SEMATTRS_FAAS_CRON:()=>Hrt,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Qrt,SEMATTRS_FAAS_DOCUMENT_NAME:()=>jrt,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Frt,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Grt,SEMATTRS_FAAS_EXECUTION:()=>Urt,SEMATTRS_FAAS_INVOKED_NAME:()=>qrt,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Vrt,SEMATTRS_FAAS_INVOKED_REGION:()=>Yrt,SEMATTRS_FAAS_TIME:()=>zrt,SEMATTRS_FAAS_TRIGGER:()=>EV,SEMATTRS_HTTP_CLIENT_IP:()=>Tot,SEMATTRS_HTTP_FLAVOR:()=>hot,SEMATTRS_HTTP_HOST:()=>Aot,SEMATTRS_HTTP_METHOD:()=>_w,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Eot,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>yot,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>IV,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>CV,SEMATTRS_HTTP_ROUTE:()=>vV,SEMATTRS_HTTP_SCHEME:()=>got,SEMATTRS_HTTP_SERVER_NAME:()=>Sot,SEMATTRS_HTTP_STATUS_CODE:()=>fS,SEMATTRS_HTTP_TARGET:()=>bV,SEMATTRS_HTTP_URL:()=>UC,SEMATTRS_HTTP_USER_AGENT:()=>_ot,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>hit,SEMATTRS_MESSAGE_ID:()=>git,SEMATTRS_MESSAGE_TYPE:()=>Ait,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>_it,SEMATTRS_MESSAGING_CONSUMER_ID:()=>nit,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Wot,SEMATTRS_MESSAGING_DESTINATION:()=>$ot,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>qot,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>sit,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>iit,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>oit,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>ait,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>uit,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Zot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>eit,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Xot,SEMATTRS_MESSAGING_OPERATION:()=>tit,SEMATTRS_MESSAGING_PROTOCOL:()=>Yot,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Kot,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>rit,SEMATTRS_MESSAGING_SYSTEM:()=>RV,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Vot,SEMATTRS_MESSAGING_URL:()=>Jot,SEMATTRS_NET_HOST_CARRIER_ICC:()=>oot,SEMATTRS_NET_HOST_CARRIER_MCC:()=>not,SEMATTRS_NET_HOST_CARRIER_MNC:()=>rot,SEMATTRS_NET_HOST_CARRIER_NAME:()=>tot,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>eot,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>Xrt,SEMATTRS_NET_HOST_IP:()=>SV,SEMATTRS_NET_HOST_NAME:()=>Wrt,SEMATTRS_NET_HOST_PORT:()=>TV,SEMATTRS_NET_PEER_IP:()=>yV,SEMATTRS_NET_PEER_NAME:()=>Zrt,SEMATTRS_NET_PEER_PORT:()=>Jrt,SEMATTRS_NET_TRANSPORT:()=>Krt,SEMATTRS_PEER_SERVICE:()=>iot,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>DV,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>fit,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>mit,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>pit,SEMATTRS_RPC_JSONRPC_VERSION:()=>dit,SEMATTRS_RPC_METHOD:()=>lit,SEMATTRS_RPC_SERVICE:()=>xV,SEMATTRS_RPC_SYSTEM:()=>cit,SEMATTRS_THREAD_ID:()=>cot,SEMATTRS_THREAD_NAME:()=>lot,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>uut,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>aut,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>cut,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>lut,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>dut,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>put,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>fut,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Aut,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>mut,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>hut,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>gut,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>rut,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>iut,SEMRESATTRS_CLOUD_PLATFORM:()=>sut,SEMRESATTRS_CLOUD_PROVIDER:()=>nut,SEMRESATTRS_CLOUD_REGION:()=>out,SEMRESATTRS_CONTAINER_ID:()=>Eut,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Sut,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Tut,SEMRESATTRS_CONTAINER_NAME:()=>_ut,SEMRESATTRS_CONTAINER_RUNTIME:()=>yut,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>but,SEMRESATTRS_DEVICE_ID:()=>Iut,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Cut,SEMRESATTRS_DEVICE_MODEL_NAME:()=>vut,SEMRESATTRS_FAAS_ID:()=>xut,SEMRESATTRS_FAAS_INSTANCE:()=>Nut,SEMRESATTRS_FAAS_MAX_MEMORY:()=>wut,SEMRESATTRS_FAAS_NAME:()=>Rut,SEMRESATTRS_FAAS_VERSION:()=>Dut,SEMRESATTRS_HOST_ARCH:()=>Put,SEMRESATTRS_HOST_ID:()=>But,SEMRESATTRS_HOST_IMAGE_ID:()=>Lut,SEMRESATTRS_HOST_IMAGE_NAME:()=>Mut,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Uut,SEMRESATTRS_HOST_NAME:()=>kut,SEMRESATTRS_HOST_TYPE:()=>Out,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Qut,SEMRESATTRS_K8S_CONTAINER_NAME:()=>$ut,SEMRESATTRS_K8S_CRONJOB_NAME:()=>rct,SEMRESATTRS_K8S_CRONJOB_UID:()=>nct,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Xut,SEMRESATTRS_K8S_DAEMONSET_UID:()=>Wut,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Kut,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Yut,SEMRESATTRS_K8S_JOB_NAME:()=>tct,SEMRESATTRS_K8S_JOB_UID:()=>ect,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>jut,SEMRESATTRS_K8S_NODE_NAME:()=>Fut,SEMRESATTRS_K8S_NODE_UID:()=>Gut,SEMRESATTRS_K8S_POD_NAME:()=>Hut,SEMRESATTRS_K8S_POD_UID:()=>zut,SEMRESATTRS_K8S_REPLICASET_NAME:()=>Vut,SEMRESATTRS_K8S_REPLICASET_UID:()=>qut,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Zut,SEMRESATTRS_K8S_STATEFULSET_UID:()=>Jut,SEMRESATTRS_OS_DESCRIPTION:()=>ict,SEMRESATTRS_OS_NAME:()=>sct,SEMRESATTRS_OS_TYPE:()=>oct,SEMRESATTRS_OS_VERSION:()=>act,SEMRESATTRS_PROCESS_COMMAND:()=>dct,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>fct,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>pct,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>cct,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>lct,SEMRESATTRS_PROCESS_OWNER:()=>mct,SEMRESATTRS_PROCESS_PID:()=>uct,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>hct,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Act,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>gct,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Ect,SEMRESATTRS_SERVICE_NAME:()=>_ct,SEMRESATTRS_SERVICE_NAMESPACE:()=>NV,SEMRESATTRS_SERVICE_VERSION:()=>yct,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Ict,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Tct,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Sct,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>bct,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Rct,SEMRESATTRS_WEBENGINE_NAME:()=>Cct,SEMRESATTRS_WEBENGINE_VERSION:()=>vct,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>apt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>upt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>cpt,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>dpt,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>ppt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>fpt,SemanticAttributes:()=>Eit,SemanticResourceAttributes:()=>xct,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Slt,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Tlt,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>blt,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Ilt,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Clt,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>vlt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Rlt,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>xlt,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Dlt,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Nlt,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>nun,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Apt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>gpt,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>run,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>hpt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>_pt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>oun,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Ept,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>ypt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Spt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Tpt,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>bpt,TelemetrySdkLanguageValues:()=>wlt});var Xn=B(()=>{A();B0e();obe();ibe();sbe();abe()});var ube=M(_U=>{"use strict";A();Object.defineProperty(_U,"__esModule",{value:!0});_U.ATTR_PROCESS_RUNTIME_NAME=void 0;_U.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var cbe=M(yU=>{"use strict";A();Object.defineProperty(yU,"__esModule",{value:!0});yU.SDK_INFO=void 0;var xft=Gge(),EU=(Xn(),Me(qr)),Dft=ube();yU.SDK_INFO={[EU.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[Dft.ATTR_PROCESS_RUNTIME_NAME]:"node",[EU.ATTR_TELEMETRY_SDK_LANGUAGE]:EU.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[EU.ATTR_TELEMETRY_SDK_VERSION]:xft.VERSION}});var lbe=M(su=>{"use strict";A();Object.defineProperty(su,"__esModule",{value:!0});su.otperformance=su.SDK_INFO=su._globalThis=su.getStringListFromEnv=su.getNumberFromEnv=su.getBooleanFromEnv=su.getStringFromEnv=void 0;var SU=Qge();Object.defineProperty(su,"getStringFromEnv",{enumerable:!0,get:function(){return SU.getStringFromEnv}});Object.defineProperty(su,"getBooleanFromEnv",{enumerable:!0,get:function(){return SU.getBooleanFromEnv}});Object.defineProperty(su,"getNumberFromEnv",{enumerable:!0,get:function(){return SU.getNumberFromEnv}});Object.defineProperty(su,"getStringListFromEnv",{enumerable:!0,get:function(){return SU.getStringListFromEnv}});var Nft=Fge();Object.defineProperty(su,"_globalThis",{enumerable:!0,get:function(){return Nft._globalThis}});var wft=cbe();Object.defineProperty(su,"SDK_INFO",{enumerable:!0,get:function(){return wft.SDK_INFO}});su.otperformance=performance});var $V=M(au=>{"use strict";A();Object.defineProperty(au,"__esModule",{value:!0});au.getStringListFromEnv=au.getNumberFromEnv=au.getStringFromEnv=au.getBooleanFromEnv=au.otperformance=au._globalThis=au.SDK_INFO=void 0;var gS=lbe();Object.defineProperty(au,"SDK_INFO",{enumerable:!0,get:function(){return gS.SDK_INFO}});Object.defineProperty(au,"_globalThis",{enumerable:!0,get:function(){return gS._globalThis}});Object.defineProperty(au,"otperformance",{enumerable:!0,get:function(){return gS.otperformance}});Object.defineProperty(au,"getBooleanFromEnv",{enumerable:!0,get:function(){return gS.getBooleanFromEnv}});Object.defineProperty(au,"getStringFromEnv",{enumerable:!0,get:function(){return gS.getStringFromEnv}});Object.defineProperty(au,"getNumberFromEnv",{enumerable:!0,get:function(){return gS.getNumberFromEnv}});Object.defineProperty(au,"getStringListFromEnv",{enumerable:!0,get:function(){return gS.getStringListFromEnv}})});var mbe=M(Vr=>{"use strict";A();Object.defineProperty(Vr,"__esModule",{value:!0});Vr.addHrTimes=Vr.isTimeInput=Vr.isTimeInputHrTime=Vr.hrTimeToSeconds=Vr.hrTimeToMilliseconds=Vr.hrTimeToMicroseconds=Vr.hrTimeToNanoseconds=Vr.hrTimeToTimeStamp=Vr.hrTimeDuration=Vr.timeInputToHrTime=Vr.hrTime=Vr.getTimeOrigin=Vr.millisToHrTime=void 0;var TU=$V(),dbe=9,Bft=6,kft=Math.pow(10,Bft),Ew=Math.pow(10,dbe);function yw(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*kft);return[n,r]}Vr.millisToHrTime=yw;function Oft(){return TU.otperformance.timeOrigin}Vr.getTimeOrigin=Oft;function pbe(e){let t=yw(TU.otperformance.timeOrigin),n=yw(typeof e=="number"?e:TU.otperformance.now());return fbe(t,n)}Vr.hrTime=pbe;function Pft(e){if(qV(e))return e;if(typeof e=="number")return e<TU.otperformance.timeOrigin?pbe(e):yw(e);if(e instanceof Date)return yw(e.getTime());throw TypeError("Invalid input type")}Vr.timeInputToHrTime=Pft;function Mft(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=Ew),[n,r]}Vr.hrTimeDuration=Mft;function Lft(e){let t=dbe,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}Vr.hrTimeToTimeStamp=Lft;function Uft(e){return e[0]*Ew+e[1]}Vr.hrTimeToNanoseconds=Uft;function Qft(e){return e[0]*1e6+e[1]/1e3}Vr.hrTimeToMicroseconds=Qft;function Fft(e){return e[0]*1e3+e[1]/1e6}Vr.hrTimeToMilliseconds=Fft;function Gft(e){return e[0]+e[1]/Ew}Vr.hrTimeToSeconds=Gft;function qV(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}Vr.isTimeInputHrTime=qV;function jft(e){return qV(e)||typeof e=="number"||e instanceof Date}Vr.isTimeInput=jft;function fbe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Ew&&(n[1]-=Ew,n[0]+=1),n}Vr.addHrTimes=fbe});var Abe=M(bU=>{"use strict";A();Object.defineProperty(bU,"__esModule",{value:!0});bU.unrefTimer=void 0;function zft(e){typeof e!="number"&&e.unref()}bU.unrefTimer=zft});var gbe=M(Sw=>{"use strict";A();Object.defineProperty(Sw,"__esModule",{value:!0});Sw.ExportResultCode=void 0;var Hft;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(Hft=Sw.ExportResultCode||(Sw.ExportResultCode={}))});var _be=M(IU=>{"use strict";A();Object.defineProperty(IU,"__esModule",{value:!0});IU.CompositePropagator=void 0;var hbe=(He(),Me(tt)),VV=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let n=new Set;for(let r of this._propagators){let o=typeof r.fields=="function"?r.fields():[];for(let i of o)n.add(i)}this._fields=Array.from(n)}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){hbe.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(s){hbe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};IU.CompositePropagator=VV});var Ebe=M(FC=>{"use strict";A();Object.defineProperty(FC,"__esModule",{value:!0});FC.validateValue=FC.validateKey=void 0;var YV="[_0-9a-z-*/]",$ft=`[a-z]${YV}{0,255}`,qft=`[a-z0-9]${YV}{0,240}@[a-z]${YV}{0,13}`,Vft=new RegExp(`^(?:${$ft}|${qft})$`),Yft=/^[ -~]{0,255}[!-~]$/,Kft=/,|=/;function Jft(e){return Vft.test(e)}FC.validateKey=Jft;function Zft(e){return Yft.test(e)&&!Kft.test(e)}FC.validateValue=Zft});var JV=M(vU=>{"use strict";A();Object.defineProperty(vU,"__esModule",{value:!0});vU.TraceState=void 0;var CU=Ebe(),Wft=32,ybe=512,Sbe=",",Tbe="=",KV=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,CU.validateKey)(t)||!(0,CU.validateValue)(n))return this;let r=this._getState(),o=r.get(t),i=this._length;if(typeof o=="string"?i+=n.length-o.length:i+=t.length+n.length+(r.size>0?2:1),i>ybe)return this;let s=new Map(r);return s.delete(t),s.set(t,n),this._fromState(s,i)}unset(t){let n=this._getState(),r=n.get(t);if(typeof r!="string")return this;let o=this._length-(t.length+r.length+1);n.size>1&&(o=o-1);let i=new Map(n);return i.delete(t),this._fromState(i,o)}get(t){return this._getState().get(t)}serialize(){let t="",n=0;for(let r of this._getState())n>0&&(t=Sbe+t),t=`${r[0]}${Tbe}${r[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(Sbe),n=new Map,r=0;for(let o of t){let i=o.trim(),s=i.indexOf(Tbe);if(s===-1)continue;let u=i.slice(0,s),l=i.slice(s+1);if(!(0,CU.validateKey)(u)||!(0,CU.validateValue)(l))continue;let f=r+i.length+(n.size>0?1:0);if(!(f>ybe)&&(n.set(u,l),r=f,n.size>=Wft))break}return this._length=r,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};vU.TraceState=KV});var Ibe=M(uu=>{"use strict";A();Object.defineProperty(uu,"__esModule",{value:!0});uu.W3CTraceContextPropagator=uu.parseTraceParent=uu.TRACE_STATE_HEADER=uu.TRACE_PARENT_HEADER=void 0;var RU=(He(),Me(tt)),Xft=gw(),emt=JV();uu.TRACE_PARENT_HEADER="traceparent";uu.TRACE_STATE_HEADER="tracestate";var tmt="00",nmt="(?!ff)[\\da-f]{2}",rmt="(?![0]{32})[\\da-f]{32}",omt="(?![0]{16})[\\da-f]{16}",imt="[\\da-f]{2}",smt=new RegExp(`^\\s?(${nmt})-(${rmt})-(${omt})-(${imt})(-.*)?\\s?$`);function bbe(e){let t=smt.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}uu.parseTraceParent=bbe;var ZV=class{inject(t,n,r){let o=RU.trace.getSpanContext(t);if(!o||(0,Xft.isTracingSuppressed)(t)||!(0,RU.isSpanContextValid)(o))return;let i=`${tmt}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||RU.TraceFlags.NONE).toString(16)}`;r.set(n,uu.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,uu.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,uu.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=bbe(i);if(!s)return t;s.isRemote=!0;let u=r.get(n,uu.TRACE_STATE_HEADER);if(u){let l=Array.isArray(u)?u.join(","):u;s.traceState=new emt.TraceState(typeof l=="string"?l:void 0)}return RU.trace.setSpanContext(t,s)}fields(){return[uu.TRACE_PARENT_HEADER,uu.TRACE_STATE_HEADER]}};uu.W3CTraceContextPropagator=ZV});var Cbe=M(gf=>{"use strict";A();Object.defineProperty(gf,"__esModule",{value:!0});gf.getRPCMetadata=gf.deleteRPCMetadata=gf.setRPCMetadata=gf.RPCType=void 0;var amt=(He(),Me(tt)),WV=(0,amt.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),umt;(function(e){e.HTTP="http"})(umt=gf.RPCType||(gf.RPCType={}));function cmt(e,t){return e.setValue(WV,t)}gf.setRPCMetadata=cmt;function lmt(e){return e.deleteValue(WV)}gf.deleteRPCMetadata=lmt;function dmt(e){return e.getValue(WV)}gf.getRPCMetadata=dmt});var Nbe=M(xU=>{"use strict";A();Object.defineProperty(xU,"__esModule",{value:!0});xU.isPlainObject=void 0;var pmt="[object Object]",fmt="[object Null]",mmt="[object Undefined]",Amt=Function.prototype,vbe=Amt.toString,gmt=vbe.call(Object),hmt=Object.getPrototypeOf,Rbe=Object.prototype,xbe=Rbe.hasOwnProperty,hS=Symbol?Symbol.toStringTag:void 0,Dbe=Rbe.toString;function _mt(e){if(!Emt(e)||ymt(e)!==pmt)return!1;let t=hmt(e);if(t===null)return!0;let n=xbe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&vbe.call(n)===gmt}xU.isPlainObject=_mt;function Emt(e){return e!=null&&typeof e=="object"}function ymt(e){return e==null?e===void 0?mmt:fmt:hS&&hS in Object(e)?Smt(e):Tmt(e)}function Smt(e){let t=xbe.call(e,hS),n=e[hS],r=!1;try{e[hS]=void 0,r=!0}catch{}let o=Dbe.call(e);return r&&(t?e[hS]=n:delete e[hS]),o}function Tmt(e){return Dbe.call(e)}});var Pbe=M(wU=>{"use strict";A();Object.defineProperty(wU,"__esModule",{value:!0});wU.merge=void 0;var wbe=Nbe(),bmt=20;function Imt(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=kbe(t,e.shift(),0,n);return t}wU.merge=Imt;function XV(e){return NU(e)?e.slice():e}function kbe(e,t,n=0,r){let o;if(!(n>bmt)){if(n++,DU(e)||DU(t)||Obe(t))o=XV(t);else if(NU(e)){if(o=e.slice(),NU(t))for(let i=0,s=t.length;i<s;i++)o.push(XV(t[i]));else if(Tw(t)){let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];l==="__proto__"||l==="constructor"||l==="prototype"||(o[l]=XV(t[l]))}}}else if(Tw(e))if(Tw(t)){if(!Cmt(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];if(l==="__proto__"||l==="constructor"||l==="prototype")continue;let f=t[l];if(DU(f))typeof f>"u"?delete o[l]:o[l]=f;else{let h=o[l],_=f;if(Bbe(e,l,r)||Bbe(t,l,r))delete o[l];else{if(Tw(h)&&Tw(_)){let E=r.get(h)||[],T=r.get(_)||[];E.push({obj:e,key:l}),T.push({obj:t,key:l}),r.set(h,E),r.set(_,T)}o[l]=kbe(o[l],f,n,r)}}}}else o=t;return o}}function Bbe(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let s=r[o];if(s.key===t&&s.obj===e)return!0}return!1}function NU(e){return Array.isArray(e)}function Obe(e){return typeof e=="function"}function Tw(e){return!DU(e)&&!NU(e)&&!Obe(e)&&typeof e=="object"}function DU(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function Cmt(e,t){return!(!(0,wbe.isPlainObject)(e)||!(0,wbe.isPlainObject)(t))}});var Mbe=M(GC=>{"use strict";A();Object.defineProperty(GC,"__esModule",{value:!0});GC.callWithTimeout=GC.TimeoutError=void 0;var BU=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};GC.TimeoutError=BU;function vmt(e,t){let n,r=new Promise(function(i,s){n=setTimeout(function(){s(new BU("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}GC.callWithTimeout=vmt});var Ube=M(jC=>{"use strict";A();Object.defineProperty(jC,"__esModule",{value:!0});jC.isUrlIgnored=jC.urlMatches=void 0;function Lbe(e,t){return typeof t=="string"?e===t:!!e.match(t)}jC.urlMatches=Lbe;function Rmt(e,t){if(!t)return!1;for(let n of t)if(Lbe(e,n))return!0;return!1}jC.isUrlIgnored=Rmt});var Qbe=M(kU=>{"use strict";A();Object.defineProperty(kU,"__esModule",{value:!0});kU.Deferred=void 0;var e7=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)}};kU.Deferred=e7});var Fbe=M(OU=>{"use strict";A();Object.defineProperty(OU,"__esModule",{value:!0});OU.BindOnceFuture=void 0;var xmt=Qbe(),t7=class{_isCalled=!1;_deferred=new xmt.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}};OU.BindOnceFuture=t7});var jbe=M(PU=>{"use strict";A();Object.defineProperty(PU,"__esModule",{value:!0});PU.diagLogLevelFromString=void 0;var Rg=(He(),Me(tt)),Gbe={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 Dmt(e){if(e==null)return;let t=Gbe[e.toUpperCase()];return t??(Rg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(Gbe)}, using default`),Rg.DiagLogLevel.INFO)}PU.diagLogLevelFromString=Dmt});var Hbe=M(MU=>{"use strict";A();Object.defineProperty(MU,"__esModule",{value:!0});MU._export=void 0;var zbe=(He(),Me(tt)),Nmt=gw();function wmt(e,t){return new Promise(n=>{zbe.context.with((0,Nmt.suppressTracing)(zbe.context.active()),()=>{e.export(t,n)})})}MU._export=wmt});var Rr=M(we=>{"use strict";A();Object.defineProperty(we,"__esModule",{value:!0});we.diagLogLevelFromString=we.BindOnceFuture=we.urlMatches=we.isUrlIgnored=we.callWithTimeout=we.TimeoutError=we.merge=we.TraceState=we.unsuppressTracing=we.suppressTracing=we.isTracingSuppressed=we.setRPCMetadata=we.getRPCMetadata=we.deleteRPCMetadata=we.RPCType=we.parseTraceParent=we.W3CTraceContextPropagator=we.TRACE_STATE_HEADER=we.TRACE_PARENT_HEADER=we.CompositePropagator=we.otperformance=we.getStringListFromEnv=we.getNumberFromEnv=we.getBooleanFromEnv=we.getStringFromEnv=we._globalThis=we.SDK_INFO=we.parseKeyPairsIntoRecord=we.ExportResultCode=we.unrefTimer=we.timeInputToHrTime=we.millisToHrTime=we.isTimeInputHrTime=we.isTimeInput=we.hrTimeToTimeStamp=we.hrTimeToSeconds=we.hrTimeToNanoseconds=we.hrTimeToMilliseconds=we.hrTimeToMicroseconds=we.hrTimeDuration=we.hrTime=we.getTimeOrigin=we.addHrTimes=we.loggingErrorHandler=we.setGlobalErrorHandler=we.globalErrorHandler=we.sanitizeAttributes=we.isAttributeValue=we.AnchoredClock=we.W3CBaggagePropagator=void 0;we.internal=void 0;var Bmt=Rge();Object.defineProperty(we,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Bmt.W3CBaggagePropagator}});var kmt=xge();Object.defineProperty(we,"AnchoredClock",{enumerable:!0,get:function(){return kmt.AnchoredClock}});var $be=kge();Object.defineProperty(we,"isAttributeValue",{enumerable:!0,get:function(){return $be.isAttributeValue}});Object.defineProperty(we,"sanitizeAttributes",{enumerable:!0,get:function(){return $be.sanitizeAttributes}});var qbe=Pge();Object.defineProperty(we,"globalErrorHandler",{enumerable:!0,get:function(){return qbe.globalErrorHandler}});Object.defineProperty(we,"setGlobalErrorHandler",{enumerable:!0,get:function(){return qbe.setGlobalErrorHandler}});var Omt=AV();Object.defineProperty(we,"loggingErrorHandler",{enumerable:!0,get:function(){return Omt.loggingErrorHandler}});var $l=mbe();Object.defineProperty(we,"addHrTimes",{enumerable:!0,get:function(){return $l.addHrTimes}});Object.defineProperty(we,"getTimeOrigin",{enumerable:!0,get:function(){return $l.getTimeOrigin}});Object.defineProperty(we,"hrTime",{enumerable:!0,get:function(){return $l.hrTime}});Object.defineProperty(we,"hrTimeDuration",{enumerable:!0,get:function(){return $l.hrTimeDuration}});Object.defineProperty(we,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return $l.hrTimeToMicroseconds}});Object.defineProperty(we,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return $l.hrTimeToMilliseconds}});Object.defineProperty(we,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return $l.hrTimeToNanoseconds}});Object.defineProperty(we,"hrTimeToSeconds",{enumerable:!0,get:function(){return $l.hrTimeToSeconds}});Object.defineProperty(we,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return $l.hrTimeToTimeStamp}});Object.defineProperty(we,"isTimeInput",{enumerable:!0,get:function(){return $l.isTimeInput}});Object.defineProperty(we,"isTimeInputHrTime",{enumerable:!0,get:function(){return $l.isTimeInputHrTime}});Object.defineProperty(we,"millisToHrTime",{enumerable:!0,get:function(){return $l.millisToHrTime}});Object.defineProperty(we,"timeInputToHrTime",{enumerable:!0,get:function(){return $l.timeInputToHrTime}});var Pmt=Abe();Object.defineProperty(we,"unrefTimer",{enumerable:!0,get:function(){return Pmt.unrefTimer}});var Mmt=gbe();Object.defineProperty(we,"ExportResultCode",{enumerable:!0,get:function(){return Mmt.ExportResultCode}});var Lmt=dV();Object.defineProperty(we,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Lmt.parseKeyPairsIntoRecord}});var _S=$V();Object.defineProperty(we,"SDK_INFO",{enumerable:!0,get:function(){return _S.SDK_INFO}});Object.defineProperty(we,"_globalThis",{enumerable:!0,get:function(){return _S._globalThis}});Object.defineProperty(we,"getStringFromEnv",{enumerable:!0,get:function(){return _S.getStringFromEnv}});Object.defineProperty(we,"getBooleanFromEnv",{enumerable:!0,get:function(){return _S.getBooleanFromEnv}});Object.defineProperty(we,"getNumberFromEnv",{enumerable:!0,get:function(){return _S.getNumberFromEnv}});Object.defineProperty(we,"getStringListFromEnv",{enumerable:!0,get:function(){return _S.getStringListFromEnv}});Object.defineProperty(we,"otperformance",{enumerable:!0,get:function(){return _S.otperformance}});var Umt=_be();Object.defineProperty(we,"CompositePropagator",{enumerable:!0,get:function(){return Umt.CompositePropagator}});var LU=Ibe();Object.defineProperty(we,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return LU.TRACE_PARENT_HEADER}});Object.defineProperty(we,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return LU.TRACE_STATE_HEADER}});Object.defineProperty(we,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return LU.W3CTraceContextPropagator}});Object.defineProperty(we,"parseTraceParent",{enumerable:!0,get:function(){return LU.parseTraceParent}});var UU=Cbe();Object.defineProperty(we,"RPCType",{enumerable:!0,get:function(){return UU.RPCType}});Object.defineProperty(we,"deleteRPCMetadata",{enumerable:!0,get:function(){return UU.deleteRPCMetadata}});Object.defineProperty(we,"getRPCMetadata",{enumerable:!0,get:function(){return UU.getRPCMetadata}});Object.defineProperty(we,"setRPCMetadata",{enumerable:!0,get:function(){return UU.setRPCMetadata}});var n7=gw();Object.defineProperty(we,"isTracingSuppressed",{enumerable:!0,get:function(){return n7.isTracingSuppressed}});Object.defineProperty(we,"suppressTracing",{enumerable:!0,get:function(){return n7.suppressTracing}});Object.defineProperty(we,"unsuppressTracing",{enumerable:!0,get:function(){return n7.unsuppressTracing}});var Qmt=JV();Object.defineProperty(we,"TraceState",{enumerable:!0,get:function(){return Qmt.TraceState}});var Fmt=Pbe();Object.defineProperty(we,"merge",{enumerable:!0,get:function(){return Fmt.merge}});var Vbe=Mbe();Object.defineProperty(we,"TimeoutError",{enumerable:!0,get:function(){return Vbe.TimeoutError}});Object.defineProperty(we,"callWithTimeout",{enumerable:!0,get:function(){return Vbe.callWithTimeout}});var Ybe=Ube();Object.defineProperty(we,"isUrlIgnored",{enumerable:!0,get:function(){return Ybe.isUrlIgnored}});Object.defineProperty(we,"urlMatches",{enumerable:!0,get:function(){return Ybe.urlMatches}});var Gmt=Fbe();Object.defineProperty(we,"BindOnceFuture",{enumerable:!0,get:function(){return Gmt.BindOnceFuture}});var jmt=jbe();Object.defineProperty(we,"diagLogLevelFromString",{enumerable:!0,get:function(){return jmt.diagLogLevelFromString}});var zmt=Hbe();we.internal={_export:zmt._export}});var Kbe=M(QU=>{"use strict";A();Object.defineProperty(QU,"__esModule",{value:!0});QU.VERSION=void 0;QU.VERSION="0.214.0"});var Jbe=M(bw=>{"use strict";A();Object.defineProperty(bw,"__esModule",{value:!0});bw.SeverityNumber=void 0;var Hmt;(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"})(Hmt=bw.SeverityNumber||(bw.SeverityNumber={}))});var GU=M(zC=>{"use strict";A();Object.defineProperty(zC,"__esModule",{value:!0});zC.NOOP_LOGGER=zC.NoopLogger=void 0;var FU=class{emit(t){}};zC.NoopLogger=FU;zC.NOOP_LOGGER=new FU});var Zbe=M(Bm=>{"use strict";A();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.API_BACKWARDS_COMPATIBILITY_VERSION=Bm.makeGetter=Bm._global=Bm.GLOBAL_LOGS_API_KEY=void 0;Bm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Bm._global=globalThis;function $mt(e,t,n){return r=>r===e?t:n}Bm.makeGetter=$mt;Bm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var r7=M(HC=>{"use strict";A();Object.defineProperty(HC,"__esModule",{value:!0});HC.NOOP_LOGGER_PROVIDER=HC.NoopLoggerProvider=void 0;var qmt=GU(),jU=class{getLogger(t,n,r){return new qmt.NoopLogger}};HC.NoopLoggerProvider=jU;HC.NOOP_LOGGER_PROVIDER=new jU});var Wbe=M(zU=>{"use strict";A();Object.defineProperty(zU,"__esModule",{value:!0});zU.ProxyLogger=void 0;var Vmt=GU(),o7=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):Vmt.NOOP_LOGGER}};zU.ProxyLogger=o7});var Xbe=M(HU=>{"use strict";A();Object.defineProperty(HU,"__esModule",{value:!0});HU.ProxyLoggerProvider=void 0;var Ymt=r7(),Kmt=Wbe(),i7=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new Kmt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Ymt.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)}};HU.ProxyLoggerProvider=i7});var tIe=M($U=>{"use strict";A();Object.defineProperty($U,"__esModule",{value:!0});$U.LogsAPI=void 0;var Jd=Zbe(),Jmt=r7(),eIe=Xbe(),s7=class e{constructor(){this._proxyLoggerProvider=new eIe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Jd._global[Jd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Jd._global[Jd.GLOBAL_LOGS_API_KEY]=(0,Jd.makeGetter)(Jd.API_BACKWARDS_COMPATIBILITY_VERSION,t,Jmt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Jd._global[Jd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Jd._global,Jd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Jd._global[Jd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new eIe.ProxyLoggerProvider}};$U.LogsAPI=s7});var a7=M(km=>{"use strict";A();Object.defineProperty(km,"__esModule",{value:!0});km.logs=km.NoopLogger=km.NOOP_LOGGER=km.SeverityNumber=void 0;var Zmt=Jbe();Object.defineProperty(km,"SeverityNumber",{enumerable:!0,get:function(){return Zmt.SeverityNumber}});var nIe=GU();Object.defineProperty(km,"NOOP_LOGGER",{enumerable:!0,get:function(){return nIe.NOOP_LOGGER}});Object.defineProperty(km,"NoopLogger",{enumerable:!0,get:function(){return nIe.NoopLogger}});var Wmt=tIe();km.logs=Wmt.LogsAPI.getInstance()});var rIe=M($C=>{"use strict";A();Object.defineProperty($C,"__esModule",{value:!0});$C.disableInstrumentations=$C.enableInstrumentations=void 0;function Xmt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}$C.enableInstrumentations=Xmt;function eAt(e){e.forEach(t=>t.disable())}$C.disableInstrumentations=eAt});var sIe=M(qU=>{"use strict";A();Object.defineProperty(qU,"__esModule",{value:!0});qU.registerInstrumentations=void 0;var oIe=(He(),Me(tt)),tAt=a7(),iIe=rIe();function nAt(e){let t=e.tracerProvider||oIe.trace.getTracerProvider(),n=e.meterProvider||oIe.metrics.getMeterProvider(),r=e.loggerProvider||tAt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,iIe.enableInstrumentations)(o,t,n,r),()=>{(0,iIe.disableInstrumentations)(o)}}qU.registerInstrumentations=nAt});var AIe=M(VU=>{"use strict";A();Object.defineProperty(VU,"__esModule",{value:!0});VU.satisfies=void 0;var d7=(He(),Me(tt)),dIe=/^(?: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-]+)*))?$/,rAt=/^(?<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-]+)*))?$/,oAt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function iAt(e,t,n){if(!sAt(e))return d7.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=lAt(e);if(!r)return!1;let o=[],i=pIe(r,t,o,n);return i&&!n?.includePrerelease?uAt(r,o):i}VU.satisfies=iAt;function sAt(e){return typeof e=="string"&&dIe.test(e)}function pIe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(u7(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=wAt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!u7(e,i,n,r))return!1;return!0}return u7(e,t,n,r)}function u7(e,t,n,r){if(t=cAt(t,r),t.includes(" "))return pIe(e,t,n,r);{let o=dAt(t);return n.push(o),aAt(e,o)}}function aAt(e,t){if(t.invalid)return!1;if(!t.version||l7(t.version))return!0;let n=uIe(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=uIe(r,o)}return oAt[t.op]?.includes(n)}function uAt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function cAt(e,t){return e=e.trim(),e=DAt(e,t),e=xAt(e),e=NAt(e,t),e=e.trim(),e}function $u(e){return!e||e.toLowerCase()==="x"||e==="*"}function lAt(e){let t=e.match(dIe);if(!t){d7.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function dAt(e){if(!e)return{};let t=e.match(rAt);if(!t)return d7.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function l7(e){return e==="*"||e==="x"||e==="X"}function aIe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function pAt(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 fAt(e,t){if(l7(e)||l7(t))return 0;let[n,r]=pAt(aIe(e),aIe(t));return n>r?1:n<r?-1:0}function uIe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=fAt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var fIe="[a-zA-Z0-9-]",mIe="0|[1-9]\\d*",mAt=`\\d*[a-zA-Z-]${fIe}*`,AAt="((?:<|>)?=?)",cIe=`(?:${mIe}|${mAt})`,gAt=`(?:-(${cIe}(?:\\.${cIe})*))`,lIe=`${fIe}+`,hAt=`(?:\\+(${lIe}(?:\\.${lIe})*))`,c7=`${mIe}|x|X|\\*`,Iw=`[v=\\s]*(${c7})(?:\\.(${c7})(?:\\.(${c7})(?:${gAt})?${hAt}?)?)?`,_At=`^${AAt}\\s*${Iw}$`,EAt=new RegExp(_At),yAt=`^\\s*(${Iw})\\s+-\\s+(${Iw})\\s*$`,SAt=new RegExp(yAt),TAt="(?:~>?)",bAt=`^${TAt}${Iw}$`,IAt=new RegExp(bAt),CAt="(?:\\^)",vAt=`^${CAt}${Iw}$`,RAt=new RegExp(vAt);function xAt(e){let t=IAt;return e.replace(t,(n,r,o,i,s)=>{let u;return $u(r)?u="":$u(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:$u(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function DAt(e,t){let n=RAt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return $u(i)?f="":$u(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:$u(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function NAt(e,t){let n=EAt;return e.replace(n,(r,o,i,s,u,l)=>{let f=$u(i),h=f||$u(s),_=h||$u(u),E=_;return o==="="&&E&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&E?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function wAt(e,t){let n=SAt;return e.replace(n,(r,o,i,s,u,l,f,h,_,E,T,v)=>($u(i)?o="":$u(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:$u(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,$u(_)?h="":$u(E)?h=`<${+_+1}.0.0-0`:$u(T)?h=`<${_}.${+E+1}.0-0`:v?h=`<=${_}.${E}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${E}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var p7=M(Na=>{"use strict";A();Object.defineProperty(Na,"__esModule",{value:!0});Na.massUnwrap=Na.unwrap=Na.massWrap=Na.wrap=void 0;var qu=console.error.bind(console);function Cw(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 BAt=(e,t,n)=>{if(!e||!e[t]){qu("no original function "+String(t)+" to wrap");return}if(!n){qu("no wrapper function"),qu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){qu("original object and wrapper must be functions");return}let o=n(r,t);return Cw(o,"__original",r),Cw(o,"__unwrap",()=>{e[t]===o&&Cw(e,t,r)}),Cw(o,"__wrapped",!0),Cw(e,t,o),o};Na.wrap=BAt;var kAt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Na.wrap)(r,o,n)})})};Na.massWrap=kAt;var OAt=(e,t)=>{if(!e||!e[t]){qu("no function to unwrap."),qu(new Error().stack);return}let n=e[t];if(!n.__unwrap)qu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Na.unwrap=OAt;var PAt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Na.unwrap)(n,r)})})};Na.massUnwrap=PAt;function vw(e){e&&e.logger&&(typeof e.logger!="function"?qu("new logger isn't a function, not replacing"):qu=e.logger)}Na.default=vw;vw.wrap=Na.wrap;vw.massWrap=Na.massWrap;vw.unwrap=Na.unwrap;vw.massUnwrap=Na.massUnwrap});var gIe=M(KU=>{"use strict";A();Object.defineProperty(KU,"__esModule",{value:!0});KU.InstrumentationAbstract=void 0;var f7=(He(),Me(tt)),MAt=a7(),YU=p7(),m7=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=f7.diag.createComponentLogger({namespace:t}),this._tracer=f7.trace.getTracer(t,n),this._meter=f7.metrics.getMeter(t,n),this._logger=MAt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=YU.wrap;_unwrap=YU.unwrap;_massWrap=YU.massWrap;_massUnwrap=YU.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)}}};KU.InstrumentationAbstract=m7});var _Ie=M((kcn,hIe)=>{A();var qC=1e3,VC=qC*60,YC=VC*60,ES=YC*24,LAt=ES*7,UAt=ES*365.25;hIe.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return QAt(e);if(n==="number"&&isFinite(e))return t.long?GAt(e):FAt(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function QAt(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*UAt;case"weeks":case"week":case"w":return n*LAt;case"days":case"day":case"d":return n*ES;case"hours":case"hour":case"hrs":case"hr":case"h":return n*YC;case"minutes":case"minute":case"mins":case"min":case"m":return n*VC;case"seconds":case"second":case"secs":case"sec":case"s":return n*qC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function FAt(e){var t=Math.abs(e);return t>=ES?Math.round(e/ES)+"d":t>=YC?Math.round(e/YC)+"h":t>=VC?Math.round(e/VC)+"m":t>=qC?Math.round(e/qC)+"s":e+"ms"}function GAt(e){var t=Math.abs(e);return t>=ES?JU(e,t,ES,"day"):t>=YC?JU(e,t,YC,"hour"):t>=VC?JU(e,t,VC,"minute"):t>=qC?JU(e,t,qC,"second"):e+" ms"}function JU(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var A7=M((Pcn,EIe)=>{A();function jAt(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=o,n.enabled=u,n.humanize=_Ie(),n.destroy=f,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let _=0;for(let E=0;E<h.length;E++)_=(_<<5)-_+h.charCodeAt(E),_|=0;return n.colors[Math.abs(_)%n.colors.length]}n.selectColor=t;function n(h){let _,E=null,T,v;function R(...x){if(!R.enabled)return;let k=R,P=Number(new Date),j=P-(_||P);k.diff=j,k.prev=_,k.curr=P,_=P,x[0]=n.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let G=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(V,ae)=>{if(V==="%%")return"%";G++;let te=n.formatters[ae];if(typeof te=="function"){let _e=x[G];V=te.call(k,_e),x.splice(G,1),G--}return V}),n.formatArgs.call(k,x),(k.log||n.log).apply(k,x)}return R.namespace=h,R.useColors=n.useColors(),R.color=n.selectColor(h),R.extend=r,R.destroy=n.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>E!==null?E:(T!==n.namespaces&&(T=n.namespaces,v=n.enabled(h)),v),set:x=>{E=x}}),typeof n.init=="function"&&n.init(R),R}function r(h,_){let E=n(this.namespace+(typeof _>"u"?":":_)+h);return E.log=this.log,E}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let _=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let E of _)E[0]==="-"?n.skips.push(E.slice(1)):n.names.push(E)}function i(h,_){let E=0,T=0,v=-1,R=0;for(;E<h.length;)if(T<_.length&&(_[T]===h[E]||_[T]==="*"))_[T]==="*"?(v=T,R=E,T++):(E++,T++);else if(v!==-1)T=v+1,R++,E=R;else return!1;for(;T<_.length&&_[T]==="*";)T++;return T===_.length}function s(){let h=[...n.names,...n.skips.map(_=>"-"+_)].join(",");return n.enable(""),h}function u(h){for(let _ of n.skips)if(i(h,_))return!1;for(let _ of n.names)if(i(h,_))return!0;return!1}function l(h){return h instanceof Error?h.stack||h.message:h}function f(){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}EIe.exports=jAt});var yIe=M((jc,ZU)=>{A();jc.formatArgs=HAt;jc.save=$At;jc.load=qAt;jc.useColors=zAt;jc.storage=VAt();jc.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`."))}})();jc.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 zAt(){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 HAt(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+ZU.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)}jc.log=console.debug||console.log||(()=>{});function $At(e){try{e?jc.storage.setItem("debug",e):jc.storage.removeItem("debug")}catch{}}function qAt(){let e;try{e=jc.storage.getItem("debug")||jc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function VAt(){try{return localStorage}catch{}}ZU.exports=A7()(jc);var{formatters:YAt}=ZU.exports;YAt.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var TIe=M((Ucn,SIe)=>{"use strict";A();SIe.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 CIe=M((Fcn,IIe)=>{"use strict";A();var KAt=Ue("os"),bIe=Ue("tty"),Zd=TIe(),{env:ea}=process,N_;Zd("no-color")||Zd("no-colors")||Zd("color=false")||Zd("color=never")?N_=0:(Zd("color")||Zd("colors")||Zd("color=true")||Zd("color=always"))&&(N_=1);"FORCE_COLOR"in ea&&(ea.FORCE_COLOR==="true"?N_=1:ea.FORCE_COLOR==="false"?N_=0:N_=ea.FORCE_COLOR.length===0?1:Math.min(parseInt(ea.FORCE_COLOR,10),3));function g7(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function h7(e,t){if(N_===0)return 0;if(Zd("color=16m")||Zd("color=full")||Zd("color=truecolor"))return 3;if(Zd("color=256"))return 2;if(e&&!t&&N_===void 0)return 0;let n=N_||0;if(ea.TERM==="dumb")return n;if(process.platform==="win32"){let r=KAt.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in ea)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in ea)||ea.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in ea)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ea.TEAMCITY_VERSION)?1:0;if(ea.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ea){let r=parseInt((ea.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ea.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ea.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ea.TERM)||"COLORTERM"in ea?1:n}function JAt(e){let t=h7(e,e&&e.isTTY);return g7(t)}IIe.exports={supportsColor:JAt,stdout:g7(h7(!0,bIe.isatty(1))),stderr:g7(h7(!0,bIe.isatty(2)))}});var RIe=M((ta,XU)=>{A();var ZAt=Ue("tty"),WU=Ue("util");ta.init=ogt;ta.log=tgt;ta.formatArgs=XAt;ta.save=ngt;ta.load=rgt;ta.useColors=WAt;ta.destroy=WU.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ta.colors=[6,2,3,4,5,1];try{let e=CIe();e&&(e.stderr||e).level>=2&&(ta.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{}ta.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 WAt(){return"colors"in ta.inspectOpts?!!ta.inspectOpts.colors:ZAt.isatty(process.stderr.fd)}function XAt(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+"+XU.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=egt()+t+" "+e[0]}function egt(){return ta.inspectOpts.hideDate?"":new Date().toISOString()+" "}function tgt(...e){return process.stderr.write(WU.formatWithOptions(ta.inspectOpts,...e)+`
|
|
6
6
|
`)}function ngt(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function rgt(){return process.env.DEBUG}function ogt(e){e.inspectOpts={};let t=Object.keys(ta.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=ta.inspectOpts[t[n]]}XU.exports=A7()(ta);var{formatters:vIe}=XU.exports;vIe.o=function(e){return this.inspectOpts.colors=this.useColors,WU.inspect(e,this.inspectOpts).split(`
|
|
@@ -35,7 +35,7 @@ Url: ${cF(e)}`),!0}return!1}function yEt(e,t){return t?.length?oF(e).some(n=>F_(
|
|
|
35
35
|
`);for(let o of r){if(!o)continue;let i=o.indexOf(":");if(i===-1)continue;let s=o.substring(0,i).toLowerCase(),u=o.substring(i+1).trim(),l=n.get(s);l&&Array.isArray(l)?l.push(u):l?n.set(s,[l,u]):n.set(s,u)}}return n}onRequestCreated({request:t}){let n=this.getConfig(),r=n.enabled!==!1;if((0,jB.safeExecuteInTheMiddle)(()=>!r||t.method==="CONNECT"||n.ignoreRequestHook?.(t),V=>V&&this._diag.error("caught ignoreRequestHook error: ",V),!0))return;let i=(0,W4.hrTime)(),s;try{s=new ICt.URL(t.path,t.origin)}catch(V){this._diag.warn("could not determine url.full:",V);return}let u=s.protocol.replace(":",""),l=this.getRequestMethod(t.method),f={[ss.ATTR_HTTP_REQUEST_METHOD]:l,[ss.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:t.method,[ss.ATTR_URL_FULL]:s.toString(),[ss.ATTR_URL_PATH]:s.pathname,[ss.ATTR_URL_QUERY]:s.search,[ss.ATTR_URL_SCHEME]:u},h={https:"443",http:"80"},_=s.hostname,E=s.port||h[u];f[ss.ATTR_SERVER_ADDRESS]=_,E&&!isNaN(Number(E))&&(f[ss.ATTR_SERVER_PORT]=Number(E));let v=this.parseRequestHeaders(t).get("user-agent");if(v){let V=Array.isArray(v)?v[v.length-1]:v;f[ss.ATTR_USER_AGENT_ORIGINAL]=V}let R=(0,jB.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(t),V=>V&&this._diag.error("caught startSpanHook error: ",V),!0);R&&Object.entries(R).forEach(([V,ae])=>{f[V]=ae});let x=td.context.active(),k=td.trace.getSpan(x),P;n.requireParentforSpans&&(!k||!td.trace.isSpanContextValid(k.spanContext()))?P=td.trace.wrapSpanContext(td.INVALID_SPAN_CONTEXT):P=this.tracer.startSpan(l==="_OTHER"?"HTTP":l,{kind:td.SpanKind.CLIENT,attributes:f},x),(0,jB.safeExecuteInTheMiddle)(()=>n.requestHook?.(P,t),V=>V&&this._diag.error("caught requestHook error: ",V),!0);let j=td.trace.setSpan(td.context.active(),P),G={};td.propagation.inject(j,G);let $=Object.entries(G);for(let V=0;V<$.length;V++){let[ae,te]=$[V];typeof t.addHeader=="function"?t.addHeader(ae,te):typeof t.headers=="string"?t.headers+=`${ae}: ${te}\r
|
|
36
36
|
`:Array.isArray(t.headers)&&t.headers.push(ae,te)}this._recordFromReq.set(t,{span:P,attributes:f,startTime:i})}onRequestHeaders({request:t,socket:n}){let r=this._recordFromReq.get(t);if(!r)return;let o=this.getConfig(),{span:i}=r,{remoteAddress:s,remotePort:u}=n,l={[ss.ATTR_NETWORK_PEER_ADDRESS]:s,[ss.ATTR_NETWORK_PEER_PORT]:u};if(o.headersToSpanAttributes?.requestHeaders){let f=new Set(o.headersToSpanAttributes.requestHeaders.map(_=>_.toLowerCase())),h=this.parseRequestHeaders(t);for(let[_,E]of h.entries())if(f.has(_)){let T=Array.isArray(E)?E:[E];l[`http.request.header.${_}`]=T}}i.setAttributes(l)}onResponseHeaders({request:t,response:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i}=r,s={[ss.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},u=this.getConfig();if((0,jB.safeExecuteInTheMiddle)(()=>u.responseHook?.(o,{request:t,response:n}),l=>l&&this._diag.error("caught responseHook error: ",l),!0),u.headersToSpanAttributes?.responseHeaders){let l=new Set;u.headersToSpanAttributes?.responseHeaders.forEach(f=>l.add(f.toLowerCase()));for(let f=0;f<n.headers.length;f=f+2){let h=n.headers[f].toString().toLowerCase(),_=n.headers[f+1];if(l.has(h)){let E=`http.response.header.${h}`;Object.hasOwn(s,E)?s[E].push(_.toString()):s[E]=[_.toString()]}}}o.setAttributes(s),o.setStatus({code:n.statusCode>=400?td.SpanStatusCode.ERROR:td.SpanStatusCode.UNSET}),r.attributes=Object.assign(i,s)}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:s}=r;o.recordException(n),o.setStatus({code:td.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(t),i[ss.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(i,s)}recordRequestDuration(t,n){let r={};[ss.ATTR_HTTP_RESPONSE_STATUS_CODE,ss.ATTR_HTTP_REQUEST_METHOD,ss.ATTR_SERVER_ADDRESS,ss.ATTR_SERVER_PORT,ss.ATTR_URL_SCHEME,ss.ATTR_ERROR_TYPE].forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,W4.hrTimeToMilliseconds)((0,W4.hrTimeDuration)(n,(0,W4.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"}};X4.UndiciInstrumentation=ZZ});var NBe=M(e3=>{"use strict";A();Object.defineProperty(e3,"__esModule",{value:!0});e3.UndiciInstrumentation=void 0;var CCt=DBe();Object.defineProperty(e3,"UndiciInstrumentation",{enumerable:!0,get:function(){return CCt.UndiciInstrumentation}})});function wBe(e,t="/"){let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}function DCt(e,t={}){return typeof e.spans=="boolean"?e.spans:!t.skipOpenTelemetrySetup&&Qi(t)}function NCt(e={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=wBe(n.origin,n.path),o=e.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=wBe(n.origin,n.path);if(r.startsWith("data:")){let o=vv(r);return{[Lt]:"auto.http.otel.node_fetch","http.url":o,[$_]:o,[tp]:`${n.method||"GET"} ${o}`}}return{[Lt]:"auto.http.otel.node_fetch"}},requestHook:e.requestHook,responseHook:e.responseHook,headersToSpanAttributes:e.headersToSpanAttributes}}var BBe,kBe,vCt,RCt,xCt,OBe,PBe=B(()=>{A();BBe=ue(NBe(),1);mt();_r();kBe="NodeFetch",vCt=ct(kBe,BBe.UndiciInstrumentation,e=>NCt(e)),RCt=ct(`${kBe}.sentry`,jS,e=>e),xCt=((e={})=>({name:"NodeFetch",setupOnce(){DCt(e,Et()?.getOptions())&&vCt(e),RCt(e)}})),OBe=xCt});var t3=M(zB=>{"use strict";A();Object.defineProperty(zB,"__esModule",{value:!0});zB.ExpressLayerType=void 0;var wCt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(wCt=zB.ExpressLayerType||(zB.ExpressLayerType={}))});var n3=M(HB=>{"use strict";A();Object.defineProperty(HB,"__esModule",{value:!0});HB.AttributeNames=void 0;var BCt;(function(e){e.EXPRESS_TYPE="express.type",e.EXPRESS_NAME="express.name"})(BCt=HB.AttributeNames||(HB.AttributeNames={}))});var WZ=M(rR=>{"use strict";A();Object.defineProperty(rR,"__esModule",{value:!0});rR._LAYERS_STORE_PROPERTY=rR.kLayerPatched=void 0;rR.kLayerPatched=Symbol("express-layer-patched");rR._LAYERS_STORE_PROPERTY="__ot_middlewares"});var UBe=M(as=>{"use strict";A();Object.defineProperty(as,"__esModule",{value:!0});as.getActualMatchedRoute=as.getConstructedRoute=as.getLayerPath=as.asErrorAndMessage=as.isLayerIgnored=as.getLayerMetadata=as.getRouterPath=as.storeLayerPath=void 0;var XZ=t3(),oR=n3(),YS=WZ(),kCt=(e,t)=>(Array.isArray(e[YS._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,YS._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t===void 0?{isLayerPathStored:!1}:(e[YS._LAYERS_STORE_PROPERTY].push(t),{isLayerPathStored:!0}));as.storeLayerPath=kCt;var OCt=(e,t)=>{let n=t.handle?.stack?.[0];return n?.route?.path?`${e}${n.route.path}`:n?.handle?.stack?(0,as.getRouterPath)(e,n):e};as.getRouterPath=OCt;var PCt=(e,t,n)=>{if(t.name==="router"){let r=(0,as.getRouterPath)("",t),o=r||n||e||"/";return{attributes:{[oR.AttributeNames.EXPRESS_NAME]:o,[oR.AttributeNames.EXPRESS_TYPE]:XZ.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return t.name==="bound dispatch"||t.name==="handle"?{attributes:{[oR.AttributeNames.EXPRESS_NAME]:(e||n)??"request handler",[oR.AttributeNames.EXPRESS_TYPE]:XZ.ExpressLayerType.REQUEST_HANDLER},name:`request handler${t.path?` - ${e||n}`:""}`}:{attributes:{[oR.AttributeNames.EXPRESS_NAME]:t.name,[oR.AttributeNames.EXPRESS_TYPE]:XZ.ExpressLayerType.MIDDLEWARE},name:`middleware - ${t.name}`}};as.getLayerMetadata=PCt;var MCt=(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")},LCt=(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(MCt(e,r))return!0}catch{}return!1};as.isLayerIgnored=LCt;var UCt=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];as.asErrorAndMessage=UCt;var QCt=e=>{let t=e[0];return Array.isArray(t)?t.map(n=>MBe(n)||"").join(","):MBe(t)};as.getLayerPath=QCt;var MBe=e=>{if(typeof e=="string")return e;if(e instanceof RegExp||typeof e=="number")return e.toString()};function LBe(e){let n=(Array.isArray(e[YS._LAYERS_STORE_PROPERTY])?e[YS._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}as.getConstructedRoute=LBe;function FCt(e){let t=Array.isArray(e[YS._LAYERS_STORE_PROPERTY])?e[YS._LAYERS_STORE_PROPERTY]:[];if(t.length===0)return;if(t.every(i=>i==="/"))return e.originalUrl==="/"?"/":void 0;let n=LBe(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)||GCt(r))?r:void 0}as.getActualMatchedRoute=FCt;function GCt(e){return e.includes(":")||e.includes("*")}});var QBe=M(iR=>{"use strict";A();Object.defineProperty(iR,"__esModule",{value:!0});iR.PACKAGE_NAME=iR.PACKAGE_VERSION=void 0;iR.PACKAGE_VERSION="0.62.0";iR.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var HBe=M(o3=>{"use strict";A();Object.defineProperty(o3,"__esModule",{value:!0});o3.ExpressInstrumentation=void 0;var FBe=Rr(),Kc=(He(),Me(tt)),GBe=t3(),jBe=n3(),Xm=UBe(),zBe=QBe(),sR=cn(),jCt=(Xn(),Me(qr)),r3=WZ(),eW=class extends sR.InstrumentationBase{constructor(t={}){super(zBe.PACKAGE_NAME,zBe.PACKAGE_VERSION,t)}init(){return[new sR.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],t=>{let n=typeof t?.Router?.prototype?.route=="function",r=n?t.Router.prototype:t.Router;return(0,sR.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,sR.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,sR.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),s=this.stack[this.stack.length-1];return t._applyPatch(s,(0,Xm.getLayerPath)(o)),i}}}_getRouterUsePatch(){let t=this;return function(n){return function(...o){let i=n.apply(this,o),s=this.stack[this.stack.length-1];return t._applyPatch(s,(0,Xm.getLayerPath)(o)),i}}}_getAppUsePatch(t){let n=this;return function(r){return function(...i){let s=t?this.router:this._router,u=r.apply(this,i);if(s){let l=s.stack[s.stack.length-1];n._applyPatch(l,(0,Xm.getLayerPath)(i))}return u}}}_applyPatch(t,n){let r=this;t[r3.kLayerPatched]!==!0&&(t[r3.kLayerPatched]=!0,this._wrap(t,"handle",o=>{if(o.length===4)return o;let i=function(s,u){let{isLayerPathStored:l}=(0,Xm.storeLayerPath)(s,n),f=(0,Xm.getConstructedRoute)(s),h=(0,Xm.getActualMatchedRoute)(s),_={[jCt.ATTR_HTTP_ROUTE]:h},E=(0,Xm.getLayerMetadata)(f,t,n),T=E.attributes[jBe.AttributeNames.EXPRESS_TYPE],v=(0,FBe.getRPCMetadata)(Kc.context.active());if(v?.type===FBe.RPCType.HTTP&&(v.route=h),(0,Xm.isLayerIgnored)(E.name,T,r.getConfig()))return T===GBe.ExpressLayerType.MIDDLEWARE&&s[r3._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Kc.trace.getSpan(Kc.context.active())===void 0)return o.apply(this,arguments);let R=r._getSpanName({request:s,layerType:T,route:f},E.name),x=r.tracer.startSpan(R,{attributes:Object.assign(_,E.attributes)}),k=Kc.context.active(),P=Kc.trace.setSpan(k,x),{requestHook:j}=r.getConfig();j&&(0,sR.safeExecuteInTheMiddle)(()=>j(x,{request:s,layerType:T,route:f}),te=>{te&&Kc.diag.error("express instrumentation: request hook failed",te)},!0);let G=!1;E.attributes[jBe.AttributeNames.EXPRESS_TYPE]===GBe.ExpressLayerType.ROUTER&&(x.end(),G=!0,P=k);let $=()=>{G===!1&&(G=!0,x.end())},V=Array.from(arguments),ae=V.findIndex(te=>typeof te=="function");ae>=0&&(arguments[ae]=function(){let te=arguments[0],_e=![void 0,null,"route","router"].includes(te);if(!G&&_e){let[un,Se]=(0,Xm.asErrorAndMessage)(te);x.recordException(un),x.setStatus({code:Kc.SpanStatusCode.ERROR,message:Se})}G===!1&&(G=!0,s.res?.removeListener("finish",$),x.end()),!(s.route&&_e)&&l&&s[r3._LAYERS_STORE_PROPERTY].pop();let Ve=V[ae],nt=Kc.context.active(),Fe=Kc.trace.getSpan(k),Mt=Fe?Kc.trace.setSpan(nt,Fe):nt;return Kc.context.bind(Mt,Ve).apply(this,arguments)});try{return Kc.context.bind(P,o).apply(this,arguments)}catch(te){let[_e,Ve]=(0,Xm.asErrorAndMessage)(te);throw x.recordException(_e),x.setStatus({code:Kc.SpanStatusCode.ERROR,message:Ve}),te}finally{G||u.once("finish",$)}};for(let s in o)Object.defineProperty(i,s,{get(){return o[s]},set(u){o[s]=u}});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 Kc.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};o3.ExpressInstrumentation=eW});var $Be=M(fE=>{"use strict";A();Object.defineProperty(fE,"__esModule",{value:!0});fE.AttributeNames=fE.ExpressLayerType=fE.ExpressInstrumentation=void 0;var zCt=HBe();Object.defineProperty(fE,"ExpressInstrumentation",{enumerable:!0,get:function(){return zCt.ExpressInstrumentation}});var HCt=t3();Object.defineProperty(fE,"ExpressLayerType",{enumerable:!0,get:function(){return HCt.ExpressLayerType}});var $Ct=n3();Object.defineProperty(fE,"AttributeNames",{enumerable:!0,get:function(){return $Ct.AttributeNames}})});var ws,KS=B(()=>{A();ws=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__});function qCt(e){Yr(e,"auto.http.otel.express");let t=Pt(e).data,n=t["express.type"];n&&e.setAttribute(rn,`${n}.express`);let r=t["express.name"];typeof r=="string"&&e.updateName(r)}function VCt(e,t){if(xn()===ep())return ws&&W.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";xn().setTransactionName(`${r} ${e.route}`)}return t}var qBe,VBe,YBe,YCt,KBe,JBe=B(()=>{A();qBe=ue($Be(),1);mt();_r();KS();VBe="Express";YBe=ct(VBe,()=>new qBe.ExpressInstrumentation({requestHook:e=>qCt(e),spanNameHook:(e,t)=>VCt(e,t)})),YCt=(()=>({name:VBe,setupOnce(){YBe()}})),KBe=YCt});var ZBe=M($B=>{"use strict";A();Object.defineProperty($B,"__esModule",{value:!0});$B.SeverityNumber=void 0;var KCt;(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"})(KCt=$B.SeverityNumber||($B.SeverityNumber={}))});var a3=M(aR=>{"use strict";A();Object.defineProperty(aR,"__esModule",{value:!0});aR.NOOP_LOGGER=aR.NoopLogger=void 0;var s3=class{emit(t){}};aR.NoopLogger=s3;aR.NOOP_LOGGER=new s3});var WBe=M(eA=>{"use strict";A();Object.defineProperty(eA,"__esModule",{value:!0});eA.API_BACKWARDS_COMPATIBILITY_VERSION=eA.makeGetter=eA._global=eA.GLOBAL_LOGS_API_KEY=void 0;eA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");eA._global=globalThis;function JCt(e,t,n){return r=>r===e?t:n}eA.makeGetter=JCt;eA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var tW=M(uR=>{"use strict";A();Object.defineProperty(uR,"__esModule",{value:!0});uR.NOOP_LOGGER_PROVIDER=uR.NoopLoggerProvider=void 0;var ZCt=a3(),u3=class{getLogger(t,n,r){return new ZCt.NoopLogger}};uR.NoopLoggerProvider=u3;uR.NOOP_LOGGER_PROVIDER=new u3});var XBe=M(c3=>{"use strict";A();Object.defineProperty(c3,"__esModule",{value:!0});c3.ProxyLogger=void 0;var WCt=a3(),nW=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):WCt.NOOP_LOGGER}};c3.ProxyLogger=nW});var eke=M(l3=>{"use strict";A();Object.defineProperty(l3,"__esModule",{value:!0});l3.ProxyLoggerProvider=void 0;var XCt=tW(),evt=XBe(),rW=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new evt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:XCt.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)}};l3.ProxyLoggerProvider=rW});var nke=M(d3=>{"use strict";A();Object.defineProperty(d3,"__esModule",{value:!0});d3.LogsAPI=void 0;var ap=WBe(),tvt=tW(),tke=eke(),oW=class e{constructor(){this._proxyLoggerProvider=new tke.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return ap._global[ap.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(ap._global[ap.GLOBAL_LOGS_API_KEY]=(0,ap.makeGetter)(ap.API_BACKWARDS_COMPATIBILITY_VERSION,t,tvt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=ap._global[ap.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(ap._global,ap.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete ap._global[ap.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new tke.ProxyLoggerProvider}};d3.LogsAPI=oW});var iW=M(tA=>{"use strict";A();Object.defineProperty(tA,"__esModule",{value:!0});tA.logs=tA.NoopLogger=tA.NOOP_LOGGER=tA.SeverityNumber=void 0;var nvt=ZBe();Object.defineProperty(tA,"SeverityNumber",{enumerable:!0,get:function(){return nvt.SeverityNumber}});var rke=a3();Object.defineProperty(tA,"NOOP_LOGGER",{enumerable:!0,get:function(){return rke.NOOP_LOGGER}});Object.defineProperty(tA,"NoopLogger",{enumerable:!0,get:function(){return rke.NoopLogger}});var rvt=nke();tA.logs=rvt.LogsAPI.getInstance()});var oke=M(cR=>{"use strict";A();Object.defineProperty(cR,"__esModule",{value:!0});cR.disableInstrumentations=cR.enableInstrumentations=void 0;function ovt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}cR.enableInstrumentations=ovt;function ivt(e){e.forEach(t=>t.disable())}cR.disableInstrumentations=ivt});var ake=M(p3=>{"use strict";A();Object.defineProperty(p3,"__esModule",{value:!0});p3.registerInstrumentations=void 0;var ike=(He(),Me(tt)),svt=iW(),ske=oke();function avt(e){let t=e.tracerProvider||ike.trace.getTracerProvider(),n=e.meterProvider||ike.metrics.getMeterProvider(),r=e.loggerProvider||svt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,ske.enableInstrumentations)(o,t,n,r),()=>{(0,ske.disableInstrumentations)(o)}}p3.registerInstrumentations=avt});var gke=M(f3=>{"use strict";A();Object.defineProperty(f3,"__esModule",{value:!0});f3.satisfies=void 0;var cW=(He(),Me(tt)),pke=/^(?: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-]+)*))?$/,uvt=/^(?<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-]+)*))?$/,cvt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function lvt(e,t,n){if(!dvt(e))return cW.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Avt(e);if(!r)return!1;let o=[],i=fke(r,t,o,n);return i&&!n?.includePrerelease?fvt(r,o):i}f3.satisfies=lvt;function dvt(e){return typeof e=="string"&&pke.test(e)}function fke(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(sW(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=Mvt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!sW(e,i,n,r))return!1;return!0}return sW(e,t,n,r)}function sW(e,t,n,r){if(t=mvt(t,r),t.includes(" "))return fke(e,t,n,r);{let o=gvt(t);return n.push(o),pvt(e,o)}}function pvt(e,t){if(t.invalid)return!1;if(!t.version||uW(t.version))return!0;let n=cke(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=cke(r,o)}return cvt[t.op]?.includes(n)}function fvt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function mvt(e,t){return e=e.trim(),e=Ovt(e,t),e=kvt(e),e=Pvt(e,t),e=e.trim(),e}function Xu(e){return!e||e.toLowerCase()==="x"||e==="*"}function Avt(e){let t=e.match(pke);if(!t){cW.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function gvt(e){if(!e)return{};let t=e.match(uvt);if(!t)return cW.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function uW(e){return e==="*"||e==="x"||e==="X"}function uke(e){let t=parseInt(e,10);return isNaN(t)?e:t}function hvt(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 _vt(e,t){if(uW(e)||uW(t))return 0;let[n,r]=hvt(uke(e),uke(t));return n>r?1:n<r?-1:0}function cke(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=_vt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var mke="[a-zA-Z0-9-]",Ake="0|[1-9]\\d*",Evt=`\\d*[a-zA-Z-]${mke}*`,yvt="((?:<|>)?=?)",lke=`(?:${Ake}|${Evt})`,Svt=`(?:-(${lke}(?:\\.${lke})*))`,dke=`${mke}+`,Tvt=`(?:\\+(${dke}(?:\\.${dke})*))`,aW=`${Ake}|x|X|\\*`,qB=`[v=\\s]*(${aW})(?:\\.(${aW})(?:\\.(${aW})(?:${Svt})?${Tvt}?)?)?`,bvt=`^${yvt}\\s*${qB}$`,Ivt=new RegExp(bvt),Cvt=`^\\s*(${qB})\\s+-\\s+(${qB})\\s*$`,vvt=new RegExp(Cvt),Rvt="(?:~>?)",xvt=`^${Rvt}${qB}$`,Dvt=new RegExp(xvt),Nvt="(?:\\^)",wvt=`^${Nvt}${qB}$`,Bvt=new RegExp(wvt);function kvt(e){let t=Dvt;return e.replace(t,(n,r,o,i,s)=>{let u;return Xu(r)?u="":Xu(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:Xu(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function Ovt(e,t){let n=Bvt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return Xu(i)?f="":Xu(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Xu(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function Pvt(e,t){let n=Ivt;return e.replace(n,(r,o,i,s,u,l)=>{let f=Xu(i),h=f||Xu(s),_=h||Xu(u),E=_;return o==="="&&E&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&E?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function Mvt(e,t){let n=vvt;return e.replace(n,(r,o,i,s,u,l,f,h,_,E,T,v)=>(Xu(i)?o="":Xu(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Xu(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Xu(_)?h="":Xu(E)?h=`<${+_+1}.0.0-0`:Xu(T)?h=`<${_}.${+E+1}.0-0`:v?h=`<=${_}.${E}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${E}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var lW=M(Ua=>{"use strict";A();Object.defineProperty(Ua,"__esModule",{value:!0});Ua.massUnwrap=Ua.unwrap=Ua.massWrap=Ua.wrap=void 0;var ec=console.error.bind(console);function VB(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 Lvt=(e,t,n)=>{if(!e||!e[t]){ec("no original function "+String(t)+" to wrap");return}if(!n){ec("no wrapper function"),ec(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){ec("original object and wrapper must be functions");return}let o=n(r,t);return VB(o,"__original",r),VB(o,"__unwrap",()=>{e[t]===o&&VB(e,t,r)}),VB(o,"__wrapped",!0),VB(e,t,o),o};Ua.wrap=Lvt;var Uvt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{ec("must provide one or more modules to patch"),ec(new Error().stack);return}if(!(t&&Array.isArray(t))){ec("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ua.wrap)(r,o,n)})})};Ua.massWrap=Uvt;var Qvt=(e,t)=>{if(!e||!e[t]){ec("no function to unwrap."),ec(new Error().stack);return}let n=e[t];if(!n.__unwrap)ec("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ua.unwrap=Qvt;var Fvt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{ec("must provide one or more modules to patch"),ec(new Error().stack);return}if(!(t&&Array.isArray(t))){ec("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ua.unwrap)(n,r)})})};Ua.massUnwrap=Fvt;function YB(e){e&&e.logger&&(typeof e.logger!="function"?ec("new logger isn't a function, not replacing"):ec=e.logger)}Ua.default=YB;YB.wrap=Ua.wrap;YB.massWrap=Ua.massWrap;YB.unwrap=Ua.unwrap;YB.massUnwrap=Ua.massUnwrap});var hke=M(A3=>{"use strict";A();Object.defineProperty(A3,"__esModule",{value:!0});A3.InstrumentationAbstract=void 0;var dW=(He(),Me(tt)),Gvt=iW(),m3=lW(),pW=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=dW.diag.createComponentLogger({namespace:t}),this._tracer=dW.trace.getTracer(t,n),this._meter=dW.metrics.getMeter(t,n),this._logger=Gvt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=m3.wrap;_unwrap=m3.unwrap;_massWrap=m3.massWrap;_massUnwrap=m3.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)}}};A3.InstrumentationAbstract=pW});var _ke=M(mE=>{"use strict";A();Object.defineProperty(mE,"__esModule",{value:!0});mE.ModuleNameTrie=mE.ModuleNameSeparator=void 0;mE.ModuleNameSeparator="/";var g3=class{hooks=[];children=new Map},fW=class{_trie=new g3;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(mE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new g3,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=[],s=!0;for(let u of t.split(mE.ModuleNameSeparator)){let l=o.children.get(u);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};mE.ModuleNameTrie=fW});var yke=M(h3=>{"use strict";A();Object.defineProperty(h3,"__esModule",{value:!0});h3.RequireInTheMiddleSingleton=void 0;var jvt=yS(),Eke=Ue("path"),mW=_ke(),zvt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),AW=class e{_moduleNameTrie=new mW.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new jvt.Hook(null,{internals:!0},(t,n,r)=>{let o=Hvt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return zvt?new e:this._instance=this._instance??new e}};h3.RequireInTheMiddleSingleton=AW;function Hvt(e){return Eke.sep!==mW.ModuleNameSeparator?e.split(Eke.sep).join(mW.ModuleNameSeparator):e}});var Cke=M(KB=>{A();var Ske=[],gW=new WeakMap,Tke=new WeakMap,bke=new Map,Ike=[],$vt={set(e,t,n){let r=gW.get(e),o=r&&r[t];return typeof o=="function"?o(n):!0},get(e,t){if(t===Symbol.toStringTag)return"Module";let n=Tke.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=gW.get(e),o=r&&r[t];return typeof o=="function"?o(n.value):!0}};function qvt(e,t,n,r,o){bke.set(e,o),gW.set(t,n),Tke.set(t,r);let i=new Proxy(t,$vt);Ske.forEach(s=>s(e,i,o)),Ike.push([e,i,o])}KB.register=qvt;KB.importHooks=Ske;KB.specifiers=bke;KB.toHook=Ike});var yW=M((J1n,dR)=>{A();var vke=Ue("path"),Vvt=eQ(),{fileURLToPath:Yvt}=Ue("url"),{MessageChannel:Kvt}=Ue("worker_threads"),{isBuiltin:hW}=Ue("module");hW||(hW=()=>!0);var{importHooks:_W,specifiers:Jvt,toHook:Zvt}=Cke();function Rke(e){_W.push(e),Zvt.forEach(([t,n,r])=>e(t,n,r))}function xke(e){let t=_W.indexOf(e);t>-1&&_W.splice(t,1)}function lR(e,t,n,r){let o=e(t,n,r);o&&o!==t&&"default"in t&&(t.default=o)}var EW;function Wvt(){let{port1:e,port2:t}=new Kvt,n=0,r;EW=u=>{n++,e.postMessage(u)},e.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let u=setInterval(()=>{},1e3),l=new Promise(f=>{r=f}).then(()=>{clearInterval(u)});return n===0&&r(),l}let i=t;return{registerOptions:{data:{addHookMessagePort:i,include:[]},transferList:[i]},addHookMessagePort:i,waitForAllMessagesAcknowledged:o}}function JB(e,t,n){if(!(this instanceof JB))return new JB(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;EW&&Array.isArray(e)&&EW(e),this._iitmHook=(o,i,s)=>{let u=o,l=u.startsWith("node:"),f,h;if(l){let _=o.slice(5);hW(_)&&(o=_)}else if(u.startsWith("file://")){let _=Error.stackTraceLimit;Error.stackTraceLimit=0;try{f=Yvt(o),o=f}catch{}if(Error.stackTraceLimit=_,f){let E=Vvt(f);E&&(o=E.name,h=E.basedir)}}if(e)for(let _ of e)if(f&&_===f)lR(n,i,f,void 0);else if(_===o){if(!h)lR(n,i,o,h);else if(h.endsWith(Jvt.get(u)))lR(n,i,o,h);else if(r){let E=o+vke.sep+vke.relative(h,f);lR(n,i,E,h)}}else _===s&&lR(n,i,s,h);else lR(n,i,o,h)},Rke(this._iitmHook)}JB.prototype.unhook=function(){xke(this._iitmHook)};dR.exports=JB;dR.exports.Hook=JB;dR.exports.addHook=Rke;dR.exports.removeHook=xke;dR.exports.createAddHookMessageChannel=Wvt});var SW=M(AE=>{"use strict";A();Object.defineProperty(AE,"__esModule",{value:!0});AE.isWrapped=AE.safeExecuteInTheMiddleAsync=AE.safeExecuteInTheMiddle=void 0;function Xvt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}AE.safeExecuteInTheMiddle=Xvt;async function eRt(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}}AE.safeExecuteInTheMiddleAsync=eRt;function tRt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}AE.isWrapped=tRt});var wke=M(_3=>{"use strict";A();Object.defineProperty(_3,"__esModule",{value:!0});_3.InstrumentationBase=void 0;var ZB=Ue("path"),Dke=Ue("util"),nRt=gke(),TW=lW(),rRt=hke(),oRt=yke(),iRt=yW(),WB=(He(),Me(tt)),sRt=yS(),aRt=Ue("fs"),uRt=SW(),bW=class extends rRt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=oRt.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,uRt.isWrapped)(t[n])&&this._unwrap(t,n),Dke.types.isProxy(t)){let o=(0,TW.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,TW.wrap)(t,n,r)};_unwrap=(t,n)=>Dke.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,TW.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{WB.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){WB.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{WB.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){WB.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=Ue.resolve(n);Ue.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,aRt.readFileSync)(ZB.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{WB.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 Nke(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 s=t.files??[],u=ZB.normalize(r);return s.filter(f=>f.name===u&&Nke(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,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(f,t.moduleVersion)):f),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=(s,u,l)=>{if(!l&&ZB.isAbsolute(u)){let f=ZB.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=ZB.isAbsolute(t.name)?new sRt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new iRt.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}};_3.InstrumentationBase=bW;function Nke(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,nRt.satisfies)(t,r,{includePrerelease:n}))}});var Bke=M(E3=>{"use strict";A();Object.defineProperty(E3,"__esModule",{value:!0});E3.normalize=void 0;var cRt=Ue("path");Object.defineProperty(E3,"normalize",{enumerable:!0,get:function(){return cRt.normalize}})});var kke=M(pR=>{"use strict";A();Object.defineProperty(pR,"__esModule",{value:!0});pR.normalize=pR.InstrumentationBase=void 0;var lRt=wke();Object.defineProperty(pR,"InstrumentationBase",{enumerable:!0,get:function(){return lRt.InstrumentationBase}});var dRt=Bke();Object.defineProperty(pR,"normalize",{enumerable:!0,get:function(){return dRt.normalize}})});var IW=M(fR=>{"use strict";A();Object.defineProperty(fR,"__esModule",{value:!0});fR.normalize=fR.InstrumentationBase=void 0;var Oke=kke();Object.defineProperty(fR,"InstrumentationBase",{enumerable:!0,get:function(){return Oke.InstrumentationBase}});Object.defineProperty(fR,"normalize",{enumerable:!0,get:function(){return Oke.normalize}})});var Pke=M(y3=>{"use strict";A();Object.defineProperty(y3,"__esModule",{value:!0});y3.InstrumentationNodeModuleDefinition=void 0;var CW=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}};y3.InstrumentationNodeModuleDefinition=CW});var Mke=M(S3=>{"use strict";A();Object.defineProperty(S3,"__esModule",{value:!0});S3.InstrumentationNodeModuleFile=void 0;var pRt=IW(),vW=class{name;supportedVersions;patch;unpatch;constructor(t,n,r,o){this.name=(0,pRt.normalize)(t),this.supportedVersions=n,this.patch=r,this.unpatch=o}};S3.InstrumentationNodeModuleFile=vW});var Lke=M(JS=>{"use strict";A();Object.defineProperty(JS,"__esModule",{value:!0});JS.semconvStabilityFromStr=JS.SemconvStability=void 0;var T3;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(T3=JS.SemconvStability||(JS.SemconvStability={}));function fRt(e,t){let n=T3.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=T3.DUPLICATE;break}else o.toLowerCase()===e&&(n=T3.STABLE);return n}JS.semconvStabilityFromStr=fRt});var Qke=M(us=>{"use strict";A();Object.defineProperty(us,"__esModule",{value:!0});us.semconvStabilityFromStr=us.SemconvStability=us.safeExecuteInTheMiddleAsync=us.safeExecuteInTheMiddle=us.isWrapped=us.InstrumentationNodeModuleFile=us.InstrumentationNodeModuleDefinition=us.InstrumentationBase=us.registerInstrumentations=void 0;var mRt=ake();Object.defineProperty(us,"registerInstrumentations",{enumerable:!0,get:function(){return mRt.registerInstrumentations}});var ARt=IW();Object.defineProperty(us,"InstrumentationBase",{enumerable:!0,get:function(){return ARt.InstrumentationBase}});var gRt=Pke();Object.defineProperty(us,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return gRt.InstrumentationNodeModuleDefinition}});var hRt=Mke();Object.defineProperty(us,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return hRt.InstrumentationNodeModuleFile}});var RW=SW();Object.defineProperty(us,"isWrapped",{enumerable:!0,get:function(){return RW.isWrapped}});Object.defineProperty(us,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return RW.safeExecuteInTheMiddle}});Object.defineProperty(us,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return RW.safeExecuteInTheMiddleAsync}});var Uke=Lke();Object.defineProperty(us,"SemconvStability",{enumerable:!0,get:function(){return Uke.SemconvStability}});Object.defineProperty(us,"semconvStabilityFromStr",{enumerable:!0,get:function(){return Uke.semconvStabilityFromStr}})});var Fke=M((hNn,_Rt)=>{_Rt.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 jke=M(ZS=>{"use strict";A();Object.defineProperty(ZS,"__esModule",{value:!0});ZS.range=ZS.balanced=void 0;var ERt=(e,t,n)=>{let r=e instanceof RegExp?Gke(e,n):e,o=t instanceof RegExp?Gke(t,n):t,i=r!==null&&o!=null&&(0,ZS.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)}};ZS.balanced=ERt;var Gke=(e,t)=>{let n=t.match(e);return n?n[0]:null},yRt=(e,t,n)=>{let r,o,i,s,u,l=n.indexOf(e),f=n.indexOf(t,l+1),h=l;if(l>=0&&f>0){if(e===t)return[l,f];for(r=[],i=n.length;h>=0&&!u;){if(h===l)r.push(h),l=n.indexOf(e,h+1);else if(r.length===1){let _=r.pop();_!==void 0&&(u=[_,f])}else o=r.pop(),o!==void 0&&o<i&&(i=o,s=f),f=n.indexOf(t,h+1);h=l<f&&l>=0?l:f}r.length&&s!==void 0&&(u=[i,s])}return u};ZS.range=yRt});var Kke=M(mR=>{"use strict";A();Object.defineProperty(mR,"__esModule",{value:!0});mR.EXPANSION_MAX=void 0;mR.expand=kRt;var zke=jke(),Hke="\0SLASH"+Math.random()+"\0",$ke="\0OPEN"+Math.random()+"\0",DW="\0CLOSE"+Math.random()+"\0",qke="\0COMMA"+Math.random()+"\0",Vke="\0PERIOD"+Math.random()+"\0",SRt=new RegExp(Hke,"g"),TRt=new RegExp($ke,"g"),bRt=new RegExp(DW,"g"),IRt=new RegExp(qke,"g"),CRt=new RegExp(Vke,"g"),vRt=/\\\\/g,RRt=/\\{/g,xRt=/\\}/g,DRt=/\\,/g,NRt=/\\\./g;mR.EXPANSION_MAX=1e5;function xW(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function wRt(e){return e.replace(vRt,Hke).replace(RRt,$ke).replace(xRt,DW).replace(DRt,qke).replace(NRt,Vke)}function BRt(e){return e.replace(SRt,"\\").replace(TRt,"{").replace(bRt,"}").replace(IRt,",").replace(CRt,".")}function Yke(e){if(!e)return[""];let t=[],n=(0,zke.balanced)("{","}",e);if(!n)return e.split(",");let{pre:r,body:o,post:i}=n,s=r.split(",");s[s.length-1]+="{"+o+"}";let u=Yke(i);return i.length&&(s[s.length-1]+=u.shift(),s.push.apply(s,u)),t.push.apply(t,s),t}function kRt(e,t={}){if(!e)return[];let{max:n=mR.EXPANSION_MAX}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),XB(wRt(e),n,!0).map(BRt)}function ORt(e){return"{"+e+"}"}function PRt(e){return/^-?0\d/.test(e)}function MRt(e,t){return e<=t}function LRt(e,t){return e>=t}function XB(e,t,n){let r=[],o=(0,zke.balanced)("{","}",e);if(!o)return[e];let i=o.pre,s=o.post.length?XB(o.post,t,!1):[""];if(/\$$/.test(o.pre))for(let u=0;u<s.length&&u<t;u++){let l=i+"{"+o.body+"}"+s[u];r.push(l)}else{let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=u||l,h=o.body.indexOf(",")>=0;if(!f&&!h)return o.post.match(/,(?!,).*\}/)?(e=o.pre+"{"+o.body+DW+o.post,XB(e,t,!0)):[e];let _;if(f)_=o.body.split(/\.\./);else if(_=Yke(o.body),_.length===1&&_[0]!==void 0&&(_=XB(_[0],t,!1).map(ORt),_.length===1))return s.map(T=>o.pre+_[0]+T);let E;if(f&&_[0]!==void 0&&_[1]!==void 0){let T=xW(_[0]),v=xW(_[1]),R=Math.max(_[0].length,_[1].length),x=_.length===3&&_[2]!==void 0?Math.max(Math.abs(xW(_[2])),1):1,k=MRt;v<T&&(x*=-1,k=LRt);let j=_.some(PRt);E=[];for(let G=T;k(G,v)&&E.length<t;G+=x){let $;if(l)$=String.fromCharCode(G),$==="\\"&&($="");else if($=String(G),j){let V=R-$.length;if(V>0){let ae=new Array(V+1).join("0");G<0?$="-"+ae+$.slice(1):$=ae+$}}E.push($)}}else{E=[];for(let T=0;T<_.length;T++)E.push.apply(E,XB(_[T],t,!1))}for(let T=0;T<E.length;T++)for(let v=0;v<s.length&&r.length<t;v++){let R=i+E[T]+s[v];(!n||f||R)&&r.push(R)}}return r}});var Jke=M(b3=>{"use strict";A();Object.defineProperty(b3,"__esModule",{value:!0});b3.assertValidPattern=void 0;var URt=1024*64,QRt=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>URt)throw new TypeError("pattern is too long")};b3.assertValidPattern=QRt});var Wke=M(I3=>{"use strict";A();Object.defineProperty(I3,"__esModule",{value:!0});I3.parseClass=void 0;var FRt={"[: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]},ek=e=>e.replace(/[[\]\\-]/g,"\\$&"),GRt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Zke=e=>e.join(""),jRt=(e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],i=n+1,s=!1,u=!1,l=!1,f=!1,h=n,_="";e:for(;i<e.length;){let R=e.charAt(i);if((R==="!"||R==="^")&&i===n+1){f=!0,i++;continue}if(R==="]"&&s&&!l){h=i+1;break}if(s=!0,R==="\\"&&!l){l=!0,i++;continue}if(R==="["&&!l){for(let[x,[k,P,j]]of Object.entries(FRt))if(e.startsWith(x,i)){if(_)return["$.",!1,e.length-n,!0];i+=x.length,j?o.push(k):r.push(k),u=u||P;continue e}}if(l=!1,_){R>_?r.push(ek(_)+"-"+ek(R)):R===_&&r.push(ek(R)),_="",i++;continue}if(e.startsWith("-]",i+1)){r.push(ek(R+"-")),i+=2;continue}if(e.startsWith("-",i+1)){_=R,i+=2;continue}r.push(ek(R)),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])&&!f){let R=r[0].length===2?r[0].slice(-1):r[0];return[GRt(R),!1,h-n,!1]}let E="["+(f?"^":"")+Zke(r)+"]",T="["+(f?"":"^")+Zke(o)+"]";return[r.length&&o.length?"("+E+"|"+T+")":r.length?E:T,u,h-n,!0]};I3.parseClass=jRt});var v3=M(C3=>{"use strict";A();Object.defineProperty(C3,"__esModule",{value:!0});C3.unescape=void 0;var zRt=(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");C3.unescape=zRt});var BW=M(N3=>{"use strict";A();var Jc;Object.defineProperty(N3,"__esModule",{value:!0});N3.AST=void 0;var HRt=Wke(),R3=v3(),$Rt=new Set(["!","?","+","*","@"]),NW=e=>$Rt.has(e),Xke=e=>NW(e.type),qRt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),VRt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),YRt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),eOe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),KRt="(?!(?:^|/)\\.\\.?(?:$|/))",x3="(?!\\.)",JRt=new Set(["[","."]),ZRt=new Set(["..","."]),WRt=new Set("().*{}+?[]^$\\!"),XRt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),wW="[^/]",tOe=wW+"*?",nOe=wW+"+?",ext=0,D3=class{type;#n;#r;#o=!1;#e=[];#t;#a;#c;#u=!1;#i;#s;#l=!1;id=++ext;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.#a=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.#s!==void 0?this.#s:this.type?this.#s=this.type+"("+this.#e.map(t=>String(t)).join("|")+")":this.#s=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.#a+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 Jc&&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.#a===0)return!0;let t=this.#t;for(let n=0;n<this.#a;n++){let r=t.#e[n];if(!(r instanceof Jc&&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.#a===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new Jc(this.type,t);for(let r of this.#e)n.copyIn(r);return n}static#d(t,n,r,o,i){let s=o.maxExtglobRecursion??2,u=!1,l=!1,f=-1,h=!1;if(n.type===null){let R=r,x="";for(;R<t.length;){let k=t.charAt(R++);if(u||k==="\\"){u=!u,x+=k;continue}if(l){R===f+1?(k==="^"||k==="!")&&(h=!0):k==="]"&&!(R===f+2&&h)&&(l=!1),x+=k;continue}else if(k==="["){l=!0,f=R,h=!1,x+=k;continue}if(!o.noext&&NW(k)&&t.charAt(R)==="("&&i<=s){n.push(x),x="";let j=new Jc(k,n);R=Jc.#d(t,j,R,o,i+1),n.push(j);continue}x+=k}return n.push(x),R}let _=r+1,E=new Jc(null,n),T=[],v="";for(;_<t.length;){let R=t.charAt(_++);if(u||R==="\\"){u=!u,v+=R;continue}if(l){_===f+1?(R==="^"||R==="!")&&(h=!0):R==="]"&&!(_===f+2&&h)&&(l=!1),v+=R;continue}else if(R==="["){l=!0,f=_,h=!1,v+=R;continue}if(!o.noext&&NW(R)&&t.charAt(_)==="("&&(i<=s||n&&n.#p(R))){let k=n&&n.#p(R)?0:1;E.push(v),v="";let P=new Jc(R,E);E.push(P),_=Jc.#d(t,P,_,o,i+k);continue}if(R==="|"){E.push(v),v="",T.push(E),E=new Jc(null,n);continue}if(R===")")return v===""&&n.#e.length===0&&(n.#l=!0),E.push(v),v="",n.push(...T,E),_;v+=R}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],_}#_(t){return this.#m(t,VRt)}#m(t,n=qRt){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=YRt){return!!n.get(this.type)?.includes(t)}#E(t,n){let r=t.#e[0],o=new Jc(null,r,this.options);o.#e.push(""),r.push(o),this.#A(t,n)}#A(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.#s=void 0}#y(t){return!!eOe.get(this.type)?.has(t)}#S(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.#y(n.type)}#T(t){let n=eOe.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.#s=void 0,this.#l=!1}static fromGlob(t,n={}){let r=new Jc(null,void 0,n);return Jc.#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 u=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,u),{_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()),!Xke(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(T=>typeof T!="string"),f=this.#e.map(T=>{let[v,R,x,k]=typeof T=="string"?Jc.#b(T,this.#r,l):T.toRegExpSource(t);return this.#r=this.#r||x,this.#o=this.#o||k,v}).join(""),h="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&ZRt.has(this.#e[0]))){let v=JRt,R=n&&v.has(f.charAt(0))||f.startsWith("\\.")&&v.has(f.charAt(2))||f.startsWith("\\.\\.")&&v.has(f.charAt(4)),x=!n&&!t&&v.has(f.charAt(0));h=R?KRt:x?x3:""}let _="";return this.isEnd()&&this.#n.#u&&this.#t?.type==="!"&&(_="(?:$|\\/)"),[h+f+_,(0,R3.unescape)(f),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 l=this.toString(),f=this;return f.#e=[l],f.type=null,f.#r=void 0,[l,(0,R3.unescape)(this.toString()),!1,!1]}let s=!r||t||n||!x3?"":this.#g(!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let u="";if(this.type==="!"&&this.#l)u=(this.isStart()&&!n?x3:"")+nOe;else{let l=this.type==="!"?"))"+(this.isStart()&&!n&&!t?x3:"")+tOe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;u=o+i+l}return[u,(0,R3.unescape)(i),this.#r=!!this.#r,this.#o]}#f(){if(Xke(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.#m(o)?(n=!1,this.#A(o,r)):this.#_(o)?(n=!1,this.#E(o,r)):this.#S(o)&&(n=!1,this.#T(o)))}}while(!n&&++t<10)}else for(let t of this.#e)typeof t=="object"&&t.#f();this.#s=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,s]=n.toRegExpSource(t);return this.#o=this.#o||s,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#b(t,n,r=!1){let o=!1,i="",s=!1,u=!1;for(let l=0;l<t.length;l++){let f=t.charAt(l);if(o){o=!1,i+=(WRt.has(f)?"\\":"")+f;continue}if(f==="*"){if(u)continue;u=!0,i+=r&&/^[*]+$/.test(t)?nOe:tOe,n=!0;continue}else u=!1;if(f==="\\"){l===t.length-1?i+="\\\\":o=!0;continue}if(f==="["){let[h,_,E,T]=(0,HRt.parseClass)(t,l);if(E){i+=h,s=s||_,l+=E-1,n=n||T;continue}}if(f==="?"){i+=wW,n=!0;continue}i+=XRt(f)}return[i,(0,R3.unescape)(t),!!n,s]}};N3.AST=D3;Jc=D3});var kW=M(w3=>{"use strict";A();Object.defineProperty(w3,"__esModule",{value:!0});w3.escape=void 0;var txt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");w3.escape=txt});var cOe=M(gt=>{"use strict";A();Object.defineProperty(gt,"__esModule",{value:!0});gt.unescape=gt.escape=gt.AST=gt.Minimatch=gt.match=gt.makeRe=gt.braceExpand=gt.defaults=gt.filter=gt.GLOBSTAR=gt.sep=gt.minimatch=void 0;var nxt=Kke(),B3=Jke(),iOe=BW(),rxt=kW(),oxt=v3(),ixt=(e,t,n={})=>((0,B3.assertValidPattern)(t),!n.nocomment&&t.charAt(0)==="#"?!1:new WS(t,n).match(e));gt.minimatch=ixt;var sxt=/^\*+([^+@!?\*\[\(]*)$/,axt=e=>t=>!t.startsWith(".")&&t.endsWith(e),uxt=e=>t=>t.endsWith(e),cxt=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),lxt=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),dxt=/^\*+\.\*+$/,pxt=e=>!e.startsWith(".")&&e.includes("."),fxt=e=>e!=="."&&e!==".."&&e.includes("."),mxt=/^\.\*+$/,Axt=e=>e!=="."&&e!==".."&&e.startsWith("."),gxt=/^\*+$/,hxt=e=>e.length!==0&&!e.startsWith("."),_xt=e=>e.length!==0&&e!=="."&&e!=="..",Ext=/^\?+([^+@!?\*\[\(]*)?$/,yxt=([e,t=""])=>{let n=sOe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},Sxt=([e,t=""])=>{let n=aOe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},Txt=([e,t=""])=>{let n=aOe([e]);return t?r=>n(r)&&r.endsWith(t):n},bxt=([e,t=""])=>{let n=sOe([e]);return t?r=>n(r)&&r.endsWith(t):n},sOe=([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},aOe=([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},uOe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",rOe={win32:{sep:"\\"},posix:{sep:"/"}};gt.sep=uOe==="win32"?rOe.win32.sep:rOe.posix.sep;gt.minimatch.sep=gt.sep;gt.GLOBSTAR=Symbol("globstar **");gt.minimatch.GLOBSTAR=gt.GLOBSTAR;var Ixt="[^/]",Cxt=Ixt+"*?",vxt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Rxt="(?:(?!(?:\\/|^)\\.).)*?",xxt=(e,t={})=>n=>(0,gt.minimatch)(n,e,t);gt.filter=xxt;gt.minimatch.filter=gt.filter;var up=(e,t={})=>Object.assign({},e,t),Dxt=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return gt.minimatch;let t=gt.minimatch;return Object.assign((r,o,i={})=>t(r,o,up(e,i)),{Minimatch:class extends t.Minimatch{constructor(o,i={}){super(o,up(e,i))}static defaults(o){return t.defaults(up(e,o)).Minimatch}},AST:class extends t.AST{constructor(o,i,s={}){super(o,i,up(e,s))}static fromGlob(o,i={}){return t.AST.fromGlob(o,up(e,i))}},unescape:(r,o={})=>t.unescape(r,up(e,o)),escape:(r,o={})=>t.escape(r,up(e,o)),filter:(r,o={})=>t.filter(r,up(e,o)),defaults:r=>t.defaults(up(e,r)),makeRe:(r,o={})=>t.makeRe(r,up(e,o)),braceExpand:(r,o={})=>t.braceExpand(r,up(e,o)),match:(r,o,i={})=>t.match(r,o,up(e,i)),sep:t.sep,GLOBSTAR:gt.GLOBSTAR})};gt.defaults=Dxt;gt.minimatch.defaults=gt.defaults;var Nxt=(e,t={})=>((0,B3.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,nxt.expand)(e,{max:t.braceExpandMax}));gt.braceExpand=Nxt;gt.minimatch.braceExpand=gt.braceExpand;var wxt=(e,t={})=>new WS(e,t).makeRe();gt.makeRe=wxt;gt.minimatch.makeRe=gt.makeRe;var Bxt=(e,t,n={})=>{let r=new WS(t,n);return e=e.filter(o=>r.match(o)),r.options.nonull&&!e.length&&e.push(t),e};gt.match=Bxt;gt.minimatch.match=gt.match;var oOe=/[?*]|[+@!]\(.*?\)|\[|\]/,kxt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),WS=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){(0,B3.assertValidPattern)(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||uOe,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,s,u)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=i[0]===""&&i[1]===""&&(i[2]==="?"||!oOe.test(i[2]))&&!oOe.test(i[3]),f=/^[a-z]:/i.test(i[0]);if(l)return[...i.slice(0,4),...i.slice(4).map(h=>this.parse(h))];if(f)return[i[0],...i.slice(1).map(h=>this.parse(h))]}return i.map(l=>this.parse(l))});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 s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[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 s=o;for(;r[s+1]==="**";)s++;s>o&&r.splice(o+1,s-o);let u=r[o+1],l=r[o+2],f=r[o+3];if(u!==".."||!l||l==="."||l===".."||!f||f==="."||f==="..")continue;n=!0,r.splice(o,1);let h=r.slice(0);h[o]="**",t.push(h),o--}if(!this.preserveMultipleSlashes){for(let s=1;s<r.length-1;s++){let u=r[s];s===1&&u===""&&r[0]===""||(u==="."||u==="")&&(n=!0,r.splice(s,1),s--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let s=r[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;let l=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...l),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,s=[],u="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])s.push(u==="b"?n[i]:t[o]),o++,i++;else if(r&&t[o]==="**"&&n[i]===t[o+1])s.push(t[o]),o++;else if(r&&n[i]==="**"&&t[o]===n[i+1])s.push(n[i]),i++;else if(t[o]==="*"&&n[i]&&(this.options.dot||!n[i].startsWith("."))&&n[i]!=="**"){if(u==="b")return!1;u="a",s.push(t[o]),o++,i++}else if(n[i]==="*"&&t[o]&&(this.options.dot||!t[o].startsWith("."))&&t[o]!=="**"){if(u==="a")return!1;u="b",s.push(n[i]),o++,i++}else return!1;return t.length===n.length&&s}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 u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),f=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),h=!f&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),_=l?3:u?0:void 0,E=h?3:f?0:void 0;if(typeof _=="number"&&typeof E=="number"){let[T,v]=[t[_],n[E]];T.toLowerCase()===v.toLowerCase()&&(n[E]=T,i=E,o=_)}}let{optimizationLevel:s=1}=this.options;return s>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(gt.GLOBSTAR)?this.#n(t,n,r,o,i):this.#o(t,n,r,o,i)}#n(t,n,r,o,i){let s=n.indexOf(gt.GLOBSTAR,i),u=n.lastIndexOf(gt.GLOBSTAR),[l,f,h]=r?[n.slice(i,s),n.slice(s+1),[]]:[n.slice(i,s),n.slice(s+1,u),n.slice(u+1)];if(l.length){let P=t.slice(o,o+l.length);if(!this.#o(P,l,r,0,0))return!1;o+=l.length,i+=l.length}let _=0;if(h.length){if(h.length+o>t.length)return!1;let P=t.length-h.length;if(this.#o(t,h,r,P,0))_=h.length;else{if(t[t.length-1]!==""||o+h.length===t.length||(P--,!this.#o(t,h,r,P,0)))return!1;_=h.length+1}}if(!f.length){let P=!!_;for(let j=o;j<t.length-_;j++){let G=String(t[j]);if(P=!0,G==="."||G===".."||!this.options.dot&&G.startsWith("."))return!1}return r||P}let E=[[[],0]],T=E[0],v=0,R=[0];for(let P of f)P===gt.GLOBSTAR?(R.push(v),T=[[],0],E.push(T)):(T[0].push(P),v++);let x=E.length-1,k=t.length-_;for(let P of E)P[1]=k-(R[x--]+P[0].length);return!!this.#r(t,E,o,0,r,0,!!_)}#r(t,n,r,o,i,s,u){let l=n[o];if(!l){for(let _=r;_<t.length;_++){u=!0;let E=t[_];if(E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return u}let[f,h]=l;for(;r<=h;){if(this.#o(t.slice(0,r+f.length),f,i,r,0)&&s<this.maxGlobstarRecursion){let T=this.#r(t,n,r+f.length,o+1,i,s+1,u);if(T!==!1)return T}let E=t[r];if(E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1;r++}return i||null}#o(t,n,r,o,i){let s,u,l,f;for(s=o,u=i,f=t.length,l=n.length;s<f&&u<l;s++,u++){this.debug("matchOne loop");let h=n[u],_=t[s];if(this.debug(n,h,_),h===!1||h===gt.GLOBSTAR)return!1;let E;if(typeof h=="string"?(E=_===h,this.debug("string match",h,_,E)):(E=h.test(_),this.debug("pattern match",h,_,E)),!E)return!1}if(s===f&&u===l)return!0;if(s===f)return r;if(u===l)return s===f-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return(0,gt.braceExpand)(this.pattern,this.options)}parse(t){(0,B3.assertValidPattern)(t);let n=this.options;if(t==="**")return gt.GLOBSTAR;if(t==="")return"";let r,o=null;(r=t.match(gxt))?o=n.dot?_xt:hxt:(r=t.match(sxt))?o=(n.nocase?n.dot?lxt:cxt:n.dot?uxt:axt)(r[1]):(r=t.match(Ext))?o=(n.nocase?n.dot?Sxt:yxt:n.dot?Txt:bxt)(r):(r=t.match(dxt))?o=n.dot?fxt:pxt:(r=t.match(mxt))&&(o=Axt);let i=iOe.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?Cxt:n.dot?vxt:Rxt,o=new Set(n.nocase?["i"]:[]),i=t.map(l=>{let f=l.map(_=>{if(_ instanceof RegExp)for(let E of _.flags.split(""))o.add(E);return typeof _=="string"?kxt(_):_===gt.GLOBSTAR?gt.GLOBSTAR:_._src});f.forEach((_,E)=>{let T=f[E+1],v=f[E-1];_!==gt.GLOBSTAR||v===gt.GLOBSTAR||(v===void 0?T!==void 0&&T!==gt.GLOBSTAR?f[E+1]="(?:\\/|"+r+"\\/)?"+T:f[E]=r:T===void 0?f[E-1]=v+"(?:\\/|\\/"+r+")?":T!==gt.GLOBSTAR&&(f[E-1]=v+"(?:\\/|\\/"+r+"\\/)"+T,f[E+1]=gt.GLOBSTAR))});let h=f.filter(_=>_!==gt.GLOBSTAR);if(this.partial&&h.length>=1){let _=[];for(let E=1;E<=h.length;E++)_.push(h.slice(0,E).join("/"));return"(?:"+_.join("|")+")"}return h.join("/")}).join("|"),[s,u]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+u+"$",this.partial&&(i="^(?:\\/|"+s+i.slice(1,-1)+u+")$"),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 s=o[o.length-1];if(!s)for(let u=o.length-2;!s&&u>=0;u--)s=o[u];for(let u=0;u<i.length;u++){let l=i[u],f=o;if(r.matchBase&&l.length===1&&(f=[s]),this.matchOne(f,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return gt.minimatch.defaults(t).Minimatch}};gt.Minimatch=WS;var Oxt=BW();Object.defineProperty(gt,"AST",{enumerable:!0,get:function(){return Oxt.AST}});var Pxt=kW();Object.defineProperty(gt,"escape",{enumerable:!0,get:function(){return Pxt.escape}});var Mxt=v3();Object.defineProperty(gt,"unescape",{enumerable:!0,get:function(){return Mxt.unescape}});gt.minimatch.AST=iOe.AST;gt.minimatch.Minimatch=WS;gt.minimatch.escape=rxt.escape;gt.minimatch.unescape=oxt.unescape});var gOe=M((MNn,MW)=>{"use strict";A();var lOe=Ue("node:diagnostics_channel"),{context:k3,trace:OW,SpanStatusCode:O3,propagation:PW,diag:Lxt}=(He(),Me(tt)),{getRPCMetadata:Uxt,RPCType:Qxt}=Rr(),{ATTR_HTTP_ROUTE:P3,ATTR_HTTP_RESPONSE_STATUS_CODE:dOe,ATTR_HTTP_REQUEST_METHOD:Fxt,ATTR_URL_PATH:Gxt}=(Xn(),Me(qr)),{InstrumentationBase:jxt}=Qke(),{version:zxt,name:pOe}=Fke(),Hxt=">=4.0.0 <6",fOe=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],vo={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},gE={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Vg="anonymous",hE=Symbol("fastify otel instance"),_E=Symbol("fastify otel request spans"),tk=Symbol("fastify otel request context"),mOe=Symbol("fastify otel addhook original"),AOe=Symbol("fastify otel setnotfound original"),nk=Symbol("fastify otel ignore path"),rk=Symbol("fastify otel record exceptions"),M3=class extends jxt{logger=null;_requestHook=null;_lifecycleHook=null;constructor(t){if(super(pOe,zxt,t),this.logger=Lxt.createComponentLogger({namespace:pOe}),this[nk]=null,this[rk]=!0,t?.recordExceptions!=null){if(typeof t.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[rk]=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[nk]=o=>typeof n=="function"?n(o):(r==null&&(r=cOe().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)},lOe.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(lOe.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:Hxt,name:"@fastify/otel"},n;function n(r,o,i){r.decorate(hE,t),r.decorate(mOe,r.addHook),r.decorate(AOe,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let T=this[tk],v=this[_E];return{enabled:this.routeOptions.config?.otel!==!1,span:v,tracer:t.tracer,context:T,inject:(R,x)=>PW.inject(T,R,x),extract:(R,x)=>PW.extract(T,R,x)}}),r.decorateRequest(_E,null),r.decorateRequest(tk,null),r.addHook("onRoute",function(T){if(t[nk]?.(T)===!0){t.logger.debug(`Ignoring route instrumentation ${T.method} ${T.url} because it matches the ignore path`);return}if(T.config?.otel===!1){t.logger.debug(`Ignoring route instrumentation ${T.method} ${T.url} because it is disabled`);return}for(let v of fOe)if(T[v]!=null){let R=T[v];if(typeof R=="function")T[v]=_(R,v,{[vo.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[vo.FASTIFY_TYPE]:gE.ROUTE,[P3]:T.url,[vo.HOOK_CALLBACK_NAME]:R.name?.length>0?R.name:Vg});else if(Array.isArray(R)){let x=[];for(let k of R)x.push(_(k,v,{[vo.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[vo.FASTIFY_TYPE]:gE.ROUTE,[P3]:T.url,[vo.HOOK_CALLBACK_NAME]:k.name?.length>0?k.name:Vg}));T[v]=x}}T.onSend!=null?T.onSend=Array.isArray(T.onSend)?[...T.onSend,s]:[T.onSend,s]:T.onSend=s,T.onError!=null?T.onError=Array.isArray(T.onError)?[...T.onError,u]:[T.onError,u]:T.onError=u,T.handler=_(T.handler,"handler",{[vo.HOOK_NAME]:`${this.pluginName} - route-handler`,[vo.FASTIFY_TYPE]:gE.HANDLER,[P3]:T.url,[vo.HOOK_CALLBACK_NAME]:T.handler.name.length>0?T.handler.name:Vg})}),r.addHook("onRequest",function(T,v,R){if(this[hE].isEnabled()===!1||T.routeOptions.config?.otel===!1)return R();if(this[hE][nk]?.({url:T.url,method:T.method})===!0)return this[hE].logger.debug(`Ignoring request ${T.method} ${T.url} because it matches the ignore path`),R();let x=k3.active();OW.getSpan(x)==null&&(x=PW.extract(x,T.headers));let k=Uxt(x);T.routeOptions.url!=null&&k?.type===Qxt.HTTP&&(k.route=T.routeOptions.url);let P={[vo.ROOT]:"@fastify/otel",[Fxt]:T.method,[Gxt]:T.url};T.routeOptions.url!=null&&(P[P3]=T.routeOptions.url);let j=this[hE].tracer.startSpan("request",{attributes:P},x);try{this[hE]._requestHook?.(j,T)}catch(G){this[hE].logger.error({err:G},"requestHook threw")}T[tk]=OW.setSpan(x,j),T[_E]=j,k3.with(T[tk],()=>{R()})}),r.addHook("onResponse",function(T,v,R){let x=T[_E];x!=null&&(x.setAttributes({[dOe]:v.statusCode}),x.end()),T[_E]=null,R()}),r.addHook=l,r.setNotFoundHandler=f,i();function s(E,T,v,R){let x=E[_E];x!=null&&(T.statusCode>=500&&x.setStatus({code:O3.ERROR}),x.setAttributes({[dOe]:T.statusCode}),x.end()),E[_E]=null,R(null,v)}function u(E,T,v,R){let x=E[_E];x!=null&&(x.setStatus({code:O3.ERROR,message:v.message}),t[rk]!==!1&&x.recordException(v)),R()}function l(E,T){let v=this[mOe];return fOe.includes(E)?v.call(this,E,_(T,E,{[vo.HOOK_NAME]:`${this.pluginName} - ${E}`,[vo.FASTIFY_TYPE]:gE.INSTANCE,[vo.HOOK_CALLBACK_NAME]:T.name?.length>0?T.name:Vg})):v.call(this,E,T)}function f(E,T){let v=this[AOe];typeof E=="function"?(T=_(E,"notFoundHandler",{[vo.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[vo.FASTIFY_TYPE]:gE.INSTANCE,[vo.HOOK_CALLBACK_NAME]:E.name?.length>0?E.name:Vg}),v.call(this,T)):(E.preValidation!=null&&(E.preValidation=_(E.preValidation,"notFoundHandler - preValidation",{[vo.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[vo.FASTIFY_TYPE]:gE.INSTANCE,[vo.HOOK_CALLBACK_NAME]:E.preValidation.name?.length>0?E.preValidation.name:Vg})),E.preHandler!=null&&(E.preHandler=_(E.preHandler,"notFoundHandler - preHandler",{[vo.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[vo.FASTIFY_TYPE]:gE.INSTANCE,[vo.HOOK_CALLBACK_NAME]:E.preHandler.name?.length>0?E.preHandler.name:Vg})),T=_(T,"notFoundHandler",{[vo.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[vo.FASTIFY_TYPE]:gE.INSTANCE,[vo.HOOK_CALLBACK_NAME]:T.name?.length>0?T.name:Vg}),v.call(this,E,T))}function h(E){for(let T of E)if(T?.routeOptions&&T.url&&T.method)return T;return null}function _(E,T,v={}){return function(...x){let k=this[hE],P=h(x);if(P===null)return k.logger.debug(`Ignoring route instrumentation because ${T} was called without a Fastify request argument`),E.call(this,...x);if(k.isEnabled()===!1||P.routeOptions.config?.otel===!1)return k.logger.debug(`Ignoring route instrumentation ${P.routeOptions.method} ${P.routeOptions.url} because it is disabled`),E.call(this,...x);if(k[nk]?.({url:P.url,method:P.method})===!0)return k.logger.debug(`Ignoring route instrumentation ${P.routeOptions.method} ${P.routeOptions.url} because it matches the ignore path`),E.call(this,...x);let j=P[tk]??k3.active(),G=E.name?.length>0?E.name:this.pluginName??Vg,$=k.tracer.startSpan(`${T} - ${G}`,{attributes:v},j);if(k._lifecycleHook!=null)try{k._lifecycleHook($,{hookName:T,request:P,handler:G})}catch(V){k.logger.error({err:V},"Execution of lifecycleHook failed")}return k3.with(OW.setSpan(j,$),function(){try{let V=E.call(this,...x);return typeof V?.then=="function"?V.then(ae=>($.end(),ae),ae=>($.setStatus({code:O3.ERROR,message:ae.message}),k[rk]!==!1&&$.recordException(ae),$.end(),Promise.reject(ae))):($.end(),V)}catch(V){throw $.setStatus({code:O3.ERROR,message:V.message}),k[rk]!==!1&&$.recordException(V),$.end(),V}},this)}}}}};MW.exports=M3;MW.exports.FastifyOtelInstrumentation=M3});var Yg,ok,ik,hOe=B(()=>{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})(Yg||(Yg={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request_handler";e.REQUEST_HANDLER=n})(ok||(ok={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request handler";e.REQUEST_HANDLER=n})(ik||(ik={}))});var sk,_Oe=B(()=>{A();sk=Symbol("opentelemetry.instrumentation.fastify.request_active_span")});function LW(e,t,n,r={}){let o=t.startSpan(n,{attributes:r}),i=e[sk]||[];return i.push(o),Object.defineProperty(e,sk,{enumerable:!1,configurable:!0,value:i}),o}function L3(e,t){let n=e[sk]||[];n.length&&(n.forEach(r=>{t&&(r.setStatus({code:gi.ERROR,message:t.message}),r.recordException(t)),r.end()}),delete e[sk])}function yOe(e,t,n){let r,o;try{o=e(),EOe(o)&&o.then(i=>t(void 0,i),i=>t(i))}catch(i){r=i}finally{if(!EOe(o)&&(t(r,o),r))throw r;return o}}function EOe(e){return typeof e=="object"&&e&&typeof Object.getOwnPropertyDescriptor(e,"then")?.value=="function"||!1}var SOe=B(()=>{A();He();_Oe()});function Yxt(){let e=Et();e&&e.on("spanStart",t=>{bOe(t)})}function bOe(e){let t=Pt(e).data,n=t["fastify.type"];if(t[rn]||!n)return;e.setAttributes({[Lt]:"auto.http.otel.fastify",[rn]:`${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 Q3,XS,$xt,qxt,TOe,Vxt,U3,IOe=B(()=>{A();He();Q3=ue(Rr(),1),XS=ue(cn(),1);Xn();mt();hOe();SOe();$xt="0.1.0",qxt="@sentry/instrumentation-fastify-v3",TOe="anonymous",Vxt=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),U3=class extends XS.InstrumentationBase{constructor(t={}){super(qxt,$xt,t)}init(){return[new XS.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 s=r,u=(0,Q3.getRPCMetadata)(We.active()),l=s.routeOptions?s.routeOptions.url:r.routerPath;l&&u?.type===Q3.RPCType.HTTP&&(u.route=l);let f=r.method||"GET";xn().setTransactionName(`${f} ${l}`),i()}}_wrapHandler(t,n,r,o){let i=this;return this._diag.debug("Patching fastify route.handler function"),function(...s){if(!i.isEnabled())return r.apply(this,s);let u=r.name||t||TOe,l=`${ik.MIDDLEWARE} - ${u}`,f=s[1],h=LW(f,i.tracer,l,{[Yg.FASTIFY_TYPE]:ok.MIDDLEWARE,[Yg.PLUGIN_NAME]:t,[Yg.HOOK_NAME]:n}),_=o&&s[s.length-1];return _&&(s[s.length-1]=function(...E){L3(f),_.apply(this,E)}),We.with(Jt.setSpan(We.active(),h),()=>yOe(()=>r.apply(this,s),E=>{E instanceof Error&&(h.setStatus({code:gi.ERROR,message:E.message}),h.recordException(E)),o||L3(f)}))}}_wrapAddHook(){let t=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let i=o[0],s=o[1],u=this.pluginName;if(!Vxt.has(i))return n.apply(this,o);let l=typeof o[o.length-1]=="function"&&s.constructor.name!=="AsyncFunction";return n.apply(this,[i,t._wrapHandler(u,i,s,l)])}}}_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()),Yxt(),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 s=i[0];return t.isEnabled()?(0,XS.safeExecuteInTheMiddle)(()=>r.apply(this,i),u=>{!u&&s instanceof Error&&(u=s),L3(this,u)}):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 s=r,u=s.routeOptions?.handler||s.context?.handler,l=u?.name.startsWith("bound ")?u.name.substring(6):u?.name,f=`${ik.REQUEST_HANDLER} - ${l||this.pluginName||TOe}`,h={[Yg.PLUGIN_NAME]:this.pluginName,[Yg.FASTIFY_TYPE]:ok.REQUEST_HANDLER,[vV]:s.routeOptions?s.routeOptions.url:r.routerPath};l&&(h[Yg.FASTIFY_NAME]=l);let _=LW(o,t.tracer,f,h);bOe(_);let{requestHook:E}=t.getConfig();return E&&(0,XS.safeExecuteInTheMiddle)(()=>E(_,{request:r}),T=>{T&&t._diag.error("request hook failed",T)},!0),We.with(Jt.setSpan(We.active(),_),()=>{i()})}}}});import*as UW from"node:diagnostics_channel";function Kxt(){let e=Et();if(e)return e.getIntegrationByName(F3)}function COe(e,t,n,r){let o=Kxt()?.getShouldHandleError()||NOe;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){ws&&W.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)&&an(e,{mechanism:{handled:!1,type:"auto.function.fastify"}})}function NOe(e,t,n){let r=n.statusCode;return r>=500||r<=299}function wOe(e){let t=Pt(e),n=t.description,r=t.data,o=r["fastify.type"],i=o==="hook",s=o===n?.startsWith("handler -"),u=n==="request"||o==="request-handler";if(r[rn]||!s&&!u&&!i)return;let l=i?"hook":s?"middleware":u?"request_handler":"<unknown>";e.setAttributes({[Lt]:"auto.http.otel.fastify",[rn]:`${l}.fastify`});let f=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof f=="string"){let h=f.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(h)}}function Zxt(){let e=Et();e&&e.on("spanStart",t=>{wOe(t)})}function Wxt(e){e.addHook("onRequest",async(t,n)=>{if(t.opentelemetry){let{span:i}=t.opentelemetry();i&&wOe(i)}let r=t.routeOptions?.url,o=t.method||"GET";xn().setTransactionName(`${o} ${r}`)})}var vOe,F3,ROe,xOe,Jxt,DOe,BOe=B(()=>{A();vOe=ue(gOe(),1);mt();_r();KS();IOe();F3="Fastify",ROe=ct(`${F3}.v3`,()=>new U3);xOe=ct(`${F3}.v5`,()=>{let e=new vOe.FastifyOtelInstrumentation,t=e.plugin();return UW.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(t).after(o=>{o?ws&&W.error("Failed to setup Fastify instrumentation",o):(Zxt(),r&&Wxt(r))})}),UW.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:i}=n;COe.call(COe,r,o,i,"diagnostics-channel")}),e}),Jxt=(({shouldHandleError:e})=>{let t;return{name:F3,setupOnce(){t=e||NOe,ROe(),xOe()},getShouldHandleError(){return t},setShouldHandleError(n){t=n}}}),DOe=(e={})=>Jxt(e)});var QW=M(xf=>{"use strict";A();Object.defineProperty(xf,"__esModule",{value:!0});xf.SpanNames=xf.TokenKind=xf.AllowedOperationTypes=void 0;var Xxt;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(Xxt=xf.AllowedOperationTypes||(xf.AllowedOperationTypes={}));var eDt;(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"})(eDt=xf.TokenKind||(xf.TokenKind={}));var tDt;(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"})(tDt=xf.SpanNames||(xf.SpanNames={}))});var FW=M(ak=>{"use strict";A();Object.defineProperty(ak,"__esModule",{value:!0});ak.AttributeNames=void 0;var nDt;(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"})(nDt=ak.AttributeNames||(ak.AttributeNames={}))});var G3=M(AR=>{"use strict";A();Object.defineProperty(AR,"__esModule",{value:!0});AR.OTEL_GRAPHQL_DATA_SYMBOL=AR.OTEL_PATCHED_SYMBOL=void 0;AR.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");AR.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var kOe=M(j3=>{"use strict";A();Object.defineProperty(j3,"__esModule",{value:!0});j3.OPERATION_NOT_SUPPORTED=void 0;var dwn=G3();j3.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var VOe=M(Bs=>{"use strict";A();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.wrapFieldResolver=Bs.wrapFields=Bs.getSourceFromLocation=Bs.getOperation=Bs.endSpan=Bs.addSpanSource=Bs.addInputVariableAttributes=Bs.isPromise=void 0;var gR=(He(),Me(tt)),EE=QW(),eT=FW(),Kg=G3(),OOe=Object.values(EE.AllowedOperationTypes),rDt=e=>typeof e?.then=="function";Bs.isPromise=rDt;var oDt=e=>typeof e=="object"&&e!==null;function GW(e,t,n){Array.isArray(n)?n.forEach((r,o)=>{GW(e,`${t}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{GW(e,`${t}.${r}`,o)}):e.setAttribute(`${eT.AttributeNames.VARIABLES}${String(t)}`,n)}function iDt(e,t){Object.entries(t).forEach(([n,r])=>{GW(e,n,r)})}Bs.addInputVariableAttributes=iDt;function UOe(e,t,n,r,o){let i=zOe(t,n,r,o);e.setAttribute(eT.AttributeNames.SOURCE,i)}Bs.addSpanSource=UOe;function sDt(e,t,n,r,o){let i=QOe(n,o);if(i)return{field:i,spanAdded:!1};let u=t().flatResolveSpans?GOe(n):FOe(n,o);return i={span:aDt(e,t,n,r,o,u)},lDt(n,o,i),{field:i,spanAdded:!0}}function aDt(e,t,n,r,o,i){let s={[eT.AttributeNames.FIELD_NAME]:r.fieldName,[eT.AttributeNames.FIELD_PATH]:o.join("."),[eT.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[eT.AttributeNames.PARENT_NAME]:r.parentType.name},u=e.startSpan(`${EE.SpanNames.RESOLVE} ${s[eT.AttributeNames.FIELD_PATH]}`,{attributes:s},i?gR.trace.setSpan(gR.context.active(),i):void 0),l=n[Kg.OTEL_GRAPHQL_DATA_SYMBOL].source,f=r.fieldNodes.find(h=>h.kind==="Field");return f&&UOe(u,l.loc,t().allowValues,f.loc?.start,f.loc?.end),u}function uDt(e,t){t&&e.recordException(t),e.end()}Bs.endSpan=uDt;function cDt(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(n=>OOe.indexOf(n?.operation)!==-1).find(n=>t===n?.name?.value):e.definitions.find(n=>OOe.indexOf(n?.operation)!==-1)}Bs.getOperation=cDt;function lDt(e,t,n){return e[Kg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]=n}function QOe(e,t){return e[Kg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]}function FOe(e,t){for(let n=t.length-1;n>0;n--){let r=QOe(e,t.slice(0,n));if(r)return r.span}return GOe(e)}function GOe(e){return e[Kg.OTEL_GRAPHQL_DATA_SYMBOL].span}function dDt(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 pDt(e){return jOe(`
|
|
37
37
|
`,e)}function POe(e){return jOe(" ",e)}function jOe(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}var fDt=[EE.TokenKind.FLOAT,EE.TokenKind.STRING,EE.TokenKind.INT,EE.TokenKind.BLOCK_STRING];function zOe(e,t=!1,n,r){let o="";if(e?.startToken){let i=typeof n=="number"?n:e.start,s=typeof r=="number"?r:e.end,u=e.startToken.next,l=1;for(;u;){if(u.start<i){u=u.next,l=u?.line;continue}if(u.end>s){u=u.next,l=u?.line;continue}let f=u.value||u.kind,h="";!t&&fDt.indexOf(u.kind)>=0&&(f="*"),u.kind===EE.TokenKind.STRING&&(f=`"${f}"`),u.kind===EE.TokenKind.EOF&&(f=""),u.line>l?(o+=pDt(u.line-l),l=u.line,h=POe(u.column-1)):u.line===u.prev?.line&&(h=POe(u.start-(u.prev?.end||0))),o+=h+f,u&&(u=u.next)}}return o}Bs.getSourceFromLocation=zOe;function HOe(e,t,n){if(!e||e[Kg.OTEL_PATCHED_SYMBOL])return;let r=e.getFields();e[Kg.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let i=r[o];if(i&&(i.resolve&&(i.resolve=qOe(t,n,i.resolve)),i.type)){let s=$Oe(i.type);for(let u of s)HOe(u,t,n)}})}Bs.wrapFields=HOe;function $Oe(e){return"ofType"in e?$Oe(e.ofType):mDt(e)?e.getTypes():ADt(e)?[e]:[]}function mDt(e){return"getTypes"in e&&typeof e.getTypes=="function"}function ADt(e){return"getFields"in e&&typeof e.getFields=="function"}var MOe=(e,t,n)=>{n&&(e.recordException(t),e.setStatus({code:gR.SpanStatusCode.ERROR,message:t.message}),e.end())},LOe=(e,t)=>{t&&e.end()};function qOe(e,t,n,r=!1){if(o[Kg.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(i,s,u,l){if(!n)return;let f=t();if(f.ignoreTrivialResolveSpans&&r&&(oDt(i)||typeof i=="function")&&typeof i[l.fieldName]!="function")return n.call(this,i,s,u,l);if(!u[Kg.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,i,s,u,l);let h=dDt(f.mergeItems,l&&l.path),_=h.filter(v=>typeof v=="string").length,E,T=!1;if(f.depth>=0&&f.depth<_)E=FOe(u,h);else{let{field:v,spanAdded:R}=sDt(e,t,u,l,h);E=v.span,T=R}return gR.context.with(gR.trace.setSpan(gR.context.active(),E),()=>{try{let v=n.call(this,i,s,u,l);return(0,Bs.isPromise)(v)?v.then(R=>(LOe(E,T),R),R=>{throw MOe(E,R,T),R}):(LOe(E,T),v)}catch(v){throw MOe(E,v,T),v}})}return o[Kg.OTEL_PATCHED_SYMBOL]=!0,o}Bs.wrapFieldResolver=qOe});var YOe=M(hR=>{"use strict";A();Object.defineProperty(hR,"__esModule",{value:!0});hR.PACKAGE_NAME=hR.PACKAGE_VERSION=void 0;hR.PACKAGE_VERSION="0.62.0";hR.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var ZOe=M($3=>{"use strict";A();Object.defineProperty($3,"__esModule",{value:!0});$3.GraphQLInstrumentation=void 0;var Jg=(He(),Me(tt)),cp=cn(),uk=QW(),z3=FW(),jW=G3(),gDt=kOe(),fu=VOe(),KOe=YOe(),JOe={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},H3=[">=14.0.0 <17"],zW=class extends cp.InstrumentationBase{constructor(t={}){super(KOe.PACKAGE_NAME,KOe.PACKAGE_VERSION,{...JOe,...t})}setConfig(t={}){super.setConfig({...JOe,...t})}init(){let t=new cp.InstrumentationNodeModuleDefinition("graphql",H3);return t.files.push(this._addPatchingExecute()),t.files.push(this._addPatchingParser()),t.files.push(this._addPatchingValidate()),t}_addPatchingExecute(){return new cp.InstrumentationNodeModuleFile("graphql/execution/execute.js",H3,t=>((0,cp.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 cp.InstrumentationNodeModuleFile("graphql/language/parser.js",H3,t=>((0,cp.isWrapped)(t.parse)&&this._unwrap(t,"parse"),this._wrap(t,"parse",this._patchParse()),t),t=>{t&&this._unwrap(t,"parse")})}_addPatchingValidate(){return new cp.InstrumentationNodeModuleFile("graphql/validation/validate.js",H3,t=>((0,cp.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 s;if(arguments.length>=2){let f=arguments;s=n._wrapExecuteArgs(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],t)}else{let f=arguments[0];s=n._wrapExecuteArgs(f.schema,f.document,f.rootValue,f.contextValue,f.variableValues,f.operationName,f.fieldResolver,f.typeResolver,t)}let u=(0,fu.getOperation)(s.document,s.operationName),l=n._createExecuteSpan(u,s);return s.contextValue[jW.OTEL_GRAPHQL_DATA_SYMBOL]={source:s.document?s.document||s.document[jW.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:l,fields:{}},Jg.context.with(Jg.trace.setSpan(Jg.context.active(),l),()=>(0,cp.safeExecuteInTheMiddle)(()=>o.apply(this,[s]),(f,h)=>{n._handleExecutionResult(l,f,h)}))}}}_handleExecutionResult(t,n,r){let o=this.getConfig();if(r===void 0||n){(0,fu.endSpan)(t,n);return}if((0,fu.isPromise)(r))r.then(i=>{if(typeof o.responseHook!="function"){(0,fu.endSpan)(t);return}this._executeResponseHook(t,i)},i=>{(0,fu.endSpan)(t,i)});else{if(typeof o.responseHook!="function"){(0,fu.endSpan)(t);return}this._executeResponseHook(t,r)}}_executeResponseHook(t,n){let{responseHook:r}=this.getConfig();r&&(0,cp.safeExecuteInTheMiddle)(()=>{r(t,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,fu.endSpan)(t,void 0)},!0)}_patchParse(){let t=this;return function(r){return function(i,s){return t._parse(this,r,i,s)}}}_patchValidate(){let t=this;return function(r){return function(i,s,u,l,f){return t._validate(this,r,i,s,u,f,l)}}}_parse(t,n,r,o){let i=this.getConfig(),s=this.tracer.startSpan(uk.SpanNames.PARSE);return Jg.context.with(Jg.trace.setSpan(Jg.context.active(),s),()=>(0,cp.safeExecuteInTheMiddle)(()=>n.call(t,r,o),(u,l)=>{l&&((0,fu.getOperation)(l)?l.loc&&(0,fu.addSpanSource)(s,l.loc,i.allowValues):s.updateName(uk.SpanNames.SCHEMA_PARSE)),(0,fu.endSpan)(s,u)}))}_validate(t,n,r,o,i,s,u){let l=this.tracer.startSpan(uk.SpanNames.VALIDATE,{});return Jg.context.with(Jg.trace.setSpan(Jg.context.active(),l),()=>(0,cp.safeExecuteInTheMiddle)(()=>n.call(t,r,o,i,u,s),(f,h)=>{o.loc||l.updateName(uk.SpanNames.SCHEMA_VALIDATE),h&&h.length&&l.recordException({name:z3.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(h)}),(0,fu.endSpan)(l,f)}))}_createExecuteSpan(t,n){let r=this.getConfig(),o=this.tracer.startSpan(uk.SpanNames.EXECUTE,{});if(t){let{operation:i,name:s}=t;o.setAttribute(z3.AttributeNames.OPERATION_TYPE,i);let u=s?.value;u?(o.setAttribute(z3.AttributeNames.OPERATION_NAME,u),o.updateName(`${i} ${u}`)):o.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=gDt.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),o.setAttribute(z3.AttributeNames.OPERATION_NAME,i)}return n.document?.loc&&(0,fu.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,fu.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(t,n,r,o,i,s,u,l,f){if(o||(o={}),o[jW.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:s,fieldResolver:u,typeResolver:l};let h=u==null,_=u??f;return u=(0,fu.wrapFieldResolver)(this.tracer,()=>this.getConfig(),_,h),t&&((0,fu.wrapFields)(t.getQueryType(),this.tracer,()=>this.getConfig()),(0,fu.wrapFields)(t.getMutationType(),this.tracer,()=>this.getConfig())),{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:s,fieldResolver:u,typeResolver:l}}};$3.GraphQLInstrumentation=zW});var WOe=M(q3=>{"use strict";A();Object.defineProperty(q3,"__esModule",{value:!0});q3.GraphQLInstrumentation=void 0;var hDt=ZOe();Object.defineProperty(q3,"GraphQLInstrumentation",{enumerable:!0,get:function(){return hDt.GraphQLInstrumentation}})});function rPe(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}function EDt(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 XOe,ePe,tPe,_Dt,nPe,oPe=B(()=>{A();He();XOe=ue(WOe(),1);mt();_r();tR();ePe="Graphql",tPe=ct(ePe,XOe.GraphQLInstrumentation,e=>{let t=rPe(e);return{...t,responseHook(n,r){Yr(n,"auto.graphql.otel.graphql"),r.errors?.length&&!Pt(n).status&&n.setStatus({code:gi.ERROR});let i=Pt(n).data,s=i["graphql.operation.type"],u=i["graphql.operation.name"];if(t.useOperationNameForRootSpan&&s){let l=hi(n),h=Pt(l).data[Xv]||[],_=u?`${s} ${u}`:`${s}`;Array.isArray(h)?(h.push(_),l.setAttribute(Xv,h)):typeof h=="string"?l.setAttribute(Xv,[h,_]):l.setAttribute(Xv,_),Pt(l).data["original-description"]||l.setAttribute("original-description",Pt(l).description),l.updateName(`${Pt(l).data["original-description"]} (${EDt(h)})`)}}}}),_Dt=((e={})=>({name:ePe,setupOnce(){tPe(rPe(e))}})),nPe=_Dt});var iPe=M(V3=>{"use strict";A();Object.defineProperty(V3,"__esModule",{value:!0});V3.EVENT_LISTENERS_SET=void 0;V3.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var sPe=M(Y3=>{"use strict";A();Object.defineProperty(Y3,"__esModule",{value:!0});Y3.bufferTextMapGetter=void 0;Y3.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 aPe=M(or=>{"use strict";A();Object.defineProperty(or,"__esModule",{value:!0});or.METRIC_MESSAGING_PROCESS_DURATION=or.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=or.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=or.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=or.MESSAGING_SYSTEM_VALUE_KAFKA=or.MESSAGING_OPERATION_TYPE_VALUE_SEND=or.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=or.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=or.ATTR_MESSAGING_SYSTEM=or.ATTR_MESSAGING_OPERATION_TYPE=or.ATTR_MESSAGING_OPERATION_NAME=or.ATTR_MESSAGING_KAFKA_OFFSET=or.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=or.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=or.ATTR_MESSAGING_DESTINATION_PARTITION_ID=or.ATTR_MESSAGING_DESTINATION_NAME=or.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;or.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";or.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";or.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";or.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";or.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";or.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";or.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";or.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";or.ATTR_MESSAGING_SYSTEM="messaging.system";or.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";or.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";or.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";or.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";or.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";or.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";or.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";or.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var uPe=M(_R=>{"use strict";A();Object.defineProperty(_R,"__esModule",{value:!0});_R.PACKAGE_NAME=_R.PACKAGE_VERSION=void 0;_R.PACKAGE_VERSION="0.23.0";_R.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var mPe=M(J3=>{"use strict";A();Object.defineProperty(J3,"__esModule",{value:!0});J3.KafkaJsInstrumentation=void 0;var Kr=(He(),Me(tt)),lp=cn(),ER=(Xn(),Me(qr)),cPe=iPe(),lPe=sPe(),ht=aPe(),dPe=uPe();function K3(e,t,n){return r=>{e.add(t,{...n,...r?{[ER.ATTR_ERROR_TYPE]:r}:{}})}}function pPe(e,t,n){return r=>{e.record((Date.now()-t)/1e3,{...n,...r?{[ER.ATTR_ERROR_TYPE]:r}:{}})}}var fPe=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],HW=class extends lp.InstrumentationBase{constructor(t={}){super(dPe.PACKAGE_NAME,dPe.PACKAGE_VERSION,t)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(ht.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:fPe}}),this._sentMessages=this.meter.createCounter(ht.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(ht.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(ht.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:fPe}})}init(){let t=r=>{(0,lp.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,lp.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new lp.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,lp.isWrapped)(i.run)&&t._unwrap(i,"run"),t._wrap(i,"run",t._getConsumerRunPatch()),t._setKafkaEventListeners(i),i}}_setKafkaEventListeners(t){t[cPe.EVENT_LISTENERS_SET]||(t.events?.REQUEST&&t.on(t.events.REQUEST,this._recordClientDurationMetric.bind(this)),t[cPe.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(t){let[n,r]=t.payload.broker.split(":");this._clientDuration.record(t.payload.duration/1e3,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:`${t.payload.apiName}`,[ER.ATTR_SERVER_ADDRESS]:n,[ER.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,lp.isWrapped)(i.sendBatch)&&t._unwrap(i,"sendBatch"),t._wrap(i,"sendBatch",t._getSendBatchPatch()),(0,lp.isWrapped)(i.send)&&t._unwrap(i,"send"),t._wrap(i,"send",t._getSendPatch()),(0,lp.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,lp.isWrapped)(i.eachMessage)&&t._unwrap(i,"eachMessage"),t._wrap(i,"eachMessage",t._getConsumerEachMessagePatch())),i?.eachBatch&&((0,lp.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],s=Kr.propagation.extract(Kr.ROOT_CONTEXT,i.message.headers,lPe.bufferTextMapGetter),u=t._startConsumerSpan({topic:i.topic,message:i.message,operationType:ht.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:s,attributes:{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}}),l=[pPe(t._processDuration,Date.now(),{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}),K3(t._consumedMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)})],f=Kr.context.with(Kr.trace.setSpan(s,u),()=>n.apply(this,o));return t._endSpansOnPromise([u],l,f)}}_getConsumerEachBatchPatch(){return t=>{let n=this;return function(...o){let i=o[0],s=n._startConsumerSpan({topic:i.batch.topic,message:void 0,operationType:ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:Kr.ROOT_CONTEXT,attributes:{[ht.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:i.batch.messages.length,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}});return Kr.context.with(Kr.trace.setSpan(Kr.context.active(),s),()=>{let u=Date.now(),l=[],f=[K3(n._consumedMessages,i.batch.messages.length,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)})];i.batch.messages.forEach(_=>{let E=Kr.propagation.extract(Kr.ROOT_CONTEXT,_.headers,lPe.bufferTextMapGetter),T=Kr.trace.getSpan(E)?.spanContext(),v;T&&(v={context:T}),l.push(n._startConsumerSpan({topic:i.batch.topic,message:_,operationType:ht.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:v,attributes:{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}})),f.push(pPe(n._processDuration,u,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}))});let h=t.apply(this,o);return l.unshift(s),n._endSpansOnPromise(l,f,h)})}}}_getProducerTransactionPatch(){let t=this;return n=>function(...o){let i=t.tracer.startSpan("transaction"),s=n.apply(this,o);return s.then(u=>{let l=u.send;u.send=function(...T){return Kr.context.with(Kr.trace.setSpan(Kr.context.active(),i),()=>t._getSendPatch()(l).apply(this,T).catch(R=>{throw i.setStatus({code:Kr.SpanStatusCode.ERROR,message:R?.message}),i.recordException(R),R}))};let f=u.sendBatch;u.sendBatch=function(...T){return Kr.context.with(Kr.trace.setSpan(Kr.context.active(),i),()=>t._getSendBatchPatch()(f).apply(this,T).catch(R=>{throw i.setStatus({code:Kr.SpanStatusCode.ERROR,message:R?.message}),i.recordException(R),R}))};let h=u.commit;u.commit=function(...T){let v=h.apply(this,T).then(()=>{i.setStatus({code:Kr.SpanStatusCode.OK})});return t._endSpansOnPromise([i],[],v)};let _=u.abort;u.abort=function(...T){let v=_.apply(this,T);return t._endSpansOnPromise([i],[],v)}}).catch(u=>{i.setStatus({code:Kr.SpanStatusCode.ERROR,message:u?.message}),i.recordException(u),i.end()}),s}}_getSendBatchPatch(){let t=this;return n=>function(...o){let s=o[0].topicMessages||[],u=[],l=[];s.forEach(h=>{h.messages.forEach(_=>{u.push(t._startProducerSpan(h.topic,_)),l.push(K3(t._sentMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_DESTINATION_NAME]:h.topic,..._.partition!==void 0?{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(_.partition)}:{}}))})});let f=n.apply(this,o);return t._endSpansOnPromise(u,l,f)}}_getSendPatch(){let t=this;return n=>function(...o){let i=o[0],s=i.messages.map(f=>t._startProducerSpan(i.topic,f)),u=i.messages.map(f=>K3(t._sentMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,...f.partition!==void 0?{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(f.partition)}:{}})),l=n.apply(this,o);return t._endSpansOnPromise(s,u,l)}}_endSpansOnPromise(t,n,r){return Promise.resolve(r).then(o=>(n.forEach(i=>i()),o)).catch(o=>{let i,s=ER.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,s=o.constructor.name),n.forEach(u=>u(s)),t.forEach(u=>{u.setAttribute(ER.ATTR_ERROR_TYPE,s),u.setStatus({code:Kr.SpanStatusCode.ERROR,message:i})}),o}).finally(()=>{t.forEach(o=>o.end())})}_startConsumerSpan({topic:t,message:n,operationType:r,ctx:o,link:i,attributes:s}){let u=r===ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,l=this.tracer.startSpan(`${u} ${t}`,{kind:r===ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?Kr.SpanKind.CLIENT:Kr.SpanKind.CONSUMER,attributes:{...s,[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_DESTINATION_NAME]:t,[ht.ATTR_MESSAGING_OPERATION_TYPE]:r,[ht.ATTR_MESSAGING_OPERATION_NAME]:u,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[ht.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:i?[i]:[]},o),{consumerHook:f}=this.getConfig();return f&&n&&(0,lp.safeExecuteInTheMiddle)(()=>f(l,{topic:t,message:n}),h=>{h&&this._diag.error("consumerHook error",h)},!0),l}_startProducerSpan(t,n){let r=this.tracer.startSpan(`send ${t}`,{kind:Kr.SpanKind.PRODUCER,attributes:{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_DESTINATION_NAME]:t,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_OPERATION_TYPE]:ht.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},Kr.propagation.inject(Kr.trace.setSpan(Kr.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,lp.safeExecuteInTheMiddle)(()=>o(r,{topic:t,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),r}};J3.KafkaJsInstrumentation=HW});var APe=M(Z3=>{"use strict";A();Object.defineProperty(Z3,"__esModule",{value:!0});Z3.KafkaJsInstrumentation=void 0;var yDt=mPe();Object.defineProperty(Z3,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return yDt.KafkaJsInstrumentation}})});var gPe,hPe,_Pe,SDt,EPe,yPe=B(()=>{A();gPe=ue(APe(),1);_r();hPe="Kafka",_Pe=ct(hPe,()=>new gPe.KafkaJsInstrumentation({consumerHook(e){Yr(e,"auto.kafkajs.otel.consumer")},producerHook(e){Yr(e,"auto.kafkajs.otel.producer")}})),SDt=(()=>({name:hPe,setupOnce(){_Pe()}})),EPe=SDt});var SPe=M(yR=>{"use strict";A();Object.defineProperty(yR,"__esModule",{value:!0});yR.PACKAGE_NAME=yR.PACKAGE_VERSION=void 0;yR.PACKAGE_VERSION="0.58.0";yR.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var CPe=M(W3=>{"use strict";A();Object.defineProperty(W3,"__esModule",{value:!0});W3.LruMemoizerInstrumentation=void 0;var TPe=(He(),Me(tt)),bPe=cn(),IPe=SPe(),$W=class extends bPe.InstrumentationBase{constructor(t={}){super(IPe.PACKAGE_NAME,IPe.PACKAGE_VERSION,t)}init(){return[new bPe.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],t=>{let n=function(){let r=t.apply(this,arguments);return function(){let o=[...arguments],i=o.pop(),s=typeof i=="function"?TPe.context.bind(TPe.context.active(),i):i;return o.push(s),r.apply(this,o)}};return n.sync=t.sync,n},void 0)]}};W3.LruMemoizerInstrumentation=$W});var vPe=M(X3=>{"use strict";A();Object.defineProperty(X3,"__esModule",{value:!0});X3.LruMemoizerInstrumentation=void 0;var TDt=CPe();Object.defineProperty(X3,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return TDt.LruMemoizerInstrumentation}})});var RPe,xPe,DPe,bDt,NPe,wPe=B(()=>{A();RPe=ue(vPe(),1);_r();xPe="LruMemoizer",DPe=ct(xPe,()=>new RPe.LruMemoizerInstrumentation),bDt=(()=>({name:xPe,setupOnce(){DPe()}})),NPe=bDt});var BPe=M(Uo=>{"use strict";A();Object.defineProperty(Uo,"__esModule",{value:!0});Uo.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Uo.DB_SYSTEM_VALUE_MONGODB=Uo.DB_SYSTEM_NAME_VALUE_MONGODB=Uo.ATTR_NET_PEER_PORT=Uo.ATTR_NET_PEER_NAME=Uo.ATTR_DB_SYSTEM=Uo.ATTR_DB_STATEMENT=Uo.ATTR_DB_OPERATION=Uo.ATTR_DB_NAME=Uo.ATTR_DB_MONGODB_COLLECTION=Uo.ATTR_DB_CONNECTION_STRING=void 0;Uo.ATTR_DB_CONNECTION_STRING="db.connection_string";Uo.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Uo.ATTR_DB_NAME="db.name";Uo.ATTR_DB_OPERATION="db.operation";Uo.ATTR_DB_STATEMENT="db.statement";Uo.ATTR_DB_SYSTEM="db.system";Uo.ATTR_NET_PEER_NAME="net.peer.name";Uo.ATTR_NET_PEER_PORT="net.peer.port";Uo.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";Uo.DB_SYSTEM_VALUE_MONGODB="mongodb";Uo.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var kPe=M(ck=>{"use strict";A();Object.defineProperty(ck,"__esModule",{value:!0});ck.MongodbCommandType=void 0;var IDt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.AGGREGATE="aggregate",e.UNKNOWN="unknown"})(IDt=ck.MongodbCommandType||(ck.MongodbCommandType={}))});var OPe=M(SR=>{"use strict";A();Object.defineProperty(SR,"__esModule",{value:!0});SR.PACKAGE_NAME=SR.PACKAGE_VERSION=void 0;SR.PACKAGE_VERSION="0.67.0";SR.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var LPe=M(e6=>{"use strict";A();Object.defineProperty(e6,"__esModule",{value:!0});e6.MongoDBInstrumentation=void 0;var ni=(He(),Me(tt)),ir=cn(),Zg=(Xn(),Me(qr)),nd=BPe(),tT=kPe(),PPe=OPe(),MPe={requireParentSpan:!0},qW=class e extends ir.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(PPe.PACKAGE_NAME,PPe.PACKAGE_VERSION,{...MPe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ir.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ir.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...MPe,...t})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(nd.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:s,v4UnpatchConnection:u}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:l,v4UnpatchConnectionPool:f}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:h,v4UnpatchSessions:_}=this._getV4SessionsPatches();return[new ir.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new ir.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],t,n)]),new ir.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],i,u),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],s,u),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],l,f),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new ir.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],h,_)])]}_getV3ConnectionPatches(){return{v3PatchConnection:t=>((0,ir.isWrapped)(t.insert)&&this._unwrap(t,"insert"),this._wrap(t,"insert",this._getV3PatchOperation("insert")),(0,ir.isWrapped)(t.remove)&&this._unwrap(t,"remove"),this._wrap(t,"remove",this._getV3PatchOperation("remove")),(0,ir.isWrapped)(t.update)&&this._unwrap(t,"update"),this._wrap(t,"update",this._getV3PatchOperation("update")),(0,ir.isWrapped)(t.command)&&this._unwrap(t,"command"),this._wrap(t,"command",this._getV3PatchCommand()),(0,ir.isWrapped)(t.query)&&this._unwrap(t,"query"),this._wrap(t,"query",this._getV3PatchFind()),(0,ir.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,ir.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),this._wrap(t.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,ir.isWrapped)(t.release)&&this._unwrap(t,"release"),this._wrap(t.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),t),v4UnpatchSessions:t=>{t!==void 0&&((0,ir.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),(0,ir.isWrapped)(t.release)&&this._unwrap(t,"release"))}}}_getV4AcquireCommand(){let t=this;return n=>function(){let o=this.sessions.length,i=n.call(this),s=this.sessions.length;return o===s?t._connCountAdd(1,t._poolName,"used"):o-1===s&&(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,ir.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,ir.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=ni.context.bind(ni.context.active(),r);return t.call(this,o)}}_getV4ConnectCommand(){let t=this;return n=>function(o,i){if(n.length===1){let u=n.call(this,o);return u&&typeof u.then=="function"&&u.then(()=>t.setPoolName(o),()=>{}),u}let s=function(u,l){if(u||!l){i(u,l);return}t.setPoolName(o),i(u,l)};return n.call(this,o,s)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:t=>((0,ir.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandCallback()),t),v4PatchConnectionPromise:t=>((0,ir.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,s,u,l,f){let h=ni.trace.getSpan(ni.context.active()),_=n._checkSkipInstrumentation(h),E=typeof l=="function"?l:f;if(_||typeof E!="function"||typeof u!="object")return typeof l=="function"?r.call(this,i,s,u,l):r.call(this,i,s,u,l,f);let T=n._getV3SpanAttributes(s,i,u[0],t),v=n._spanNameFromAttrs(T),R=n.tracer.startSpan(v,{kind:ni.SpanKind.CLIENT,attributes:T}),x=n._patchEnd(R,E);return typeof l=="function"?r.call(this,i,s,u,x):r.call(this,i,s,u,l,x)}}_getV3PatchCommand(){let t=this;return n=>function(o,i,s,u,l){let f=ni.trace.getSpan(ni.context.active()),h=t._checkSkipInstrumentation(f),_=typeof u=="function"?u:l;if(h||typeof _!="function"||typeof s!="object")return typeof u=="function"?n.call(this,o,i,s,u):n.call(this,o,i,s,u,l);let E=e._getCommandType(s),T=E===tT.MongodbCommandType.UNKNOWN?void 0:E,v=t._getV3SpanAttributes(i,o,s,T),R=t._spanNameFromAttrs(v),x=t.tracer.startSpan(R,{kind:ni.SpanKind.CLIENT,attributes:v}),k=t._patchEnd(x,_);return typeof u=="function"?n.call(this,o,i,s,k):n.call(this,o,i,s,u,k)}}_getV4PatchCommandCallback(){let t=this;return n=>function(o,i,s,u){let l=ni.trace.getSpan(ni.context.active()),f=t._checkSkipInstrumentation(l),h=u,_=Object.keys(i)[0];if(typeof i!="object"||i.ismaster||i.hello)return n.call(this,o,i,s,u);let E;if(!f){let v=t._getV4SpanAttributes(this,o,i,_),R=t._spanNameFromAttrs(v);E=t.tracer.startSpan(R,{kind:ni.SpanKind.CLIENT,attributes:v})}let T=t._patchEnd(E,h,this.id,_);return n.call(this,o,i,s,T)}}_getV4PatchCommandPromise(){let t=this;return n=>function(...o){let[i,s]=o,u=ni.trace.getSpan(ni.context.active()),l=t._checkSkipInstrumentation(u),f=Object.keys(s)[0],h=()=>{};if(typeof s!="object"||s.ismaster||s.hello)return n.apply(this,o);let _;if(!l){let v=t._getV4SpanAttributes(this,i,s,f),R=t._spanNameFromAttrs(v);_=t.tracer.startSpan(R,{kind:ni.SpanKind.CLIENT,attributes:v})}let E=t._patchEnd(_,h,this.id,f),T=n.apply(this,o);return T.then(v=>E(null,v),v=>E(v)),T}}_getV3PatchFind(){let t=this;return n=>function(o,i,s,u,l,f){let h=ni.trace.getSpan(ni.context.active()),_=t._checkSkipInstrumentation(h),E=typeof l=="function"?l:f;if(_||typeof E!="function"||typeof s!="object")return typeof l=="function"?n.call(this,o,i,s,u,l):n.call(this,o,i,s,u,l,f);let T=t._getV3SpanAttributes(i,o,s,"find"),v=t._spanNameFromAttrs(T),R=t.tracer.startSpan(v,{kind:ni.SpanKind.CLIENT,attributes:T}),x=t._patchEnd(R,E);return typeof l=="function"?n.call(this,o,i,s,u,x):n.call(this,o,i,s,u,l,x)}}_getV3PatchCursor(){let t=this;return n=>function(o,i,s,u,l,f){let h=ni.trace.getSpan(ni.context.active()),_=t._checkSkipInstrumentation(h),E=typeof l=="function"?l:f;if(_||typeof E!="function")return typeof l=="function"?n.call(this,o,i,s,u,l):n.call(this,o,i,s,u,l,f);let T=t._getV3SpanAttributes(i,o,s.cmd,"getMore"),v=t._spanNameFromAttrs(T),R=t.tracer.startSpan(v,{kind:ni.SpanKind.CLIENT,attributes:T}),x=t._patchEnd(R,E);return typeof l=="function"?n.call(this,o,i,s,u,x):n.call(this,o,i,s,u,l,x)}}static _getCommandType(t){return t.createIndexes!==void 0?tT.MongodbCommandType.CREATE_INDEXES:t.findandmodify!==void 0?tT.MongodbCommandType.FIND_AND_MODIFY:t.ismaster!==void 0?tT.MongodbCommandType.IS_MASTER:t.count!==void 0?tT.MongodbCommandType.COUNT:t.aggregate!==void 0?tT.MongodbCommandType.AGGREGATE:tT.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(t,n,r,o){let i,s;if(t){let l=typeof t.address=="string"?t.address.split(":"):"";l.length===2&&(i=l[0],s=l[1])}let u;return r?.documents&&r.documents[0]?u=r.documents[0]:r?.cursors?u=r.cursors:u=r,this._getSpanAttributes(n.db,n.collection,i,s,u,o)}_getV3SpanAttributes(t,n,r,o){let i,s;if(n&&n.s&&(i=n.s.options?.host??n.s.host,s=(n.s.options?.port??n.s.port)?.toString(),i==null||s==null)){let h=n.description?.address;if(h){let _=h.split(":");i=_[0],s=_[1]}}let[u,l]=t.toString().split("."),f=r?.query??r?.q??r;return this._getSpanAttributes(u,l,i,s,f,o)}_getSpanAttributes(t,n,r,o,i,s){let u={};if(this._dbSemconvStability&ir.SemconvStability.OLD&&(u[nd.ATTR_DB_SYSTEM]=nd.DB_SYSTEM_VALUE_MONGODB,u[nd.ATTR_DB_NAME]=t,u[nd.ATTR_DB_MONGODB_COLLECTION]=n,u[nd.ATTR_DB_OPERATION]=s,u[nd.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${t}`),this._dbSemconvStability&ir.SemconvStability.STABLE&&(u[Zg.ATTR_DB_SYSTEM_NAME]=nd.DB_SYSTEM_NAME_VALUE_MONGODB,u[Zg.ATTR_DB_NAMESPACE]=t,u[Zg.ATTR_DB_OPERATION_NAME]=s,u[Zg.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&ir.SemconvStability.OLD&&(u[nd.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&ir.SemconvStability.STABLE&&(u[Zg.ATTR_SERVER_ADDRESS]=r);let l=parseInt(o,10);isNaN(l)||(this._netSemconvStability&ir.SemconvStability.OLD&&(u[nd.ATTR_NET_PEER_PORT]=l),this._netSemconvStability&ir.SemconvStability.STABLE&&(u[Zg.ATTR_SERVER_PORT]=l))}if(i){let{dbStatementSerializer:l}=this.getConfig(),f=typeof l=="function"?l:this._defaultDbStatementSerializer.bind(this);(0,ir.safeExecuteInTheMiddle)(()=>{let h=f(i);this._dbSemconvStability&ir.SemconvStability.OLD&&(u[nd.ATTR_DB_STATEMENT]=h),this._dbSemconvStability&ir.SemconvStability.STABLE&&(u[Zg.ATTR_DB_QUERY_TEXT]=h)},h=>{h&&this._diag.error("Error running dbStatementSerializer hook",h)},!0)}return u}_spanNameFromAttrs(t){let n;return this._dbSemconvStability&ir.SemconvStability.STABLE?n=[t[Zg.ATTR_DB_OPERATION_NAME],t[Zg.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||nd.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${t[nd.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,ir.safeExecuteInTheMiddle)(()=>{r(t,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(t,n,r,o){let i=ni.context.active(),s=this,u=!1;return function(...f){if(!u){u=!0;let h=f[0];if(t){if(h instanceof Error)t.setStatus({code:ni.SpanStatusCode.ERROR,message:h.message});else{let _=f[1];s._handleExecutionResult(t,_)}t.end()}o==="endSessions"&&s._connCountAdd(-1,s._poolName,"idle")}return ni.context.with(i,()=>n.apply(this,f))}}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}};e6.MongoDBInstrumentation=qW});var UPe=M(lk=>{"use strict";A();Object.defineProperty(lk,"__esModule",{value:!0});lk.MongodbCommandType=void 0;var CDt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.UNKNOWN="unknown"})(CDt=lk.MongodbCommandType||(lk.MongodbCommandType={}))});var QPe=M(TR=>{"use strict";A();Object.defineProperty(TR,"__esModule",{value:!0});TR.MongodbCommandType=TR.MongoDBInstrumentation=void 0;var vDt=LPe();Object.defineProperty(TR,"MongoDBInstrumentation",{enumerable:!0,get:function(){return vDt.MongoDBInstrumentation}});var RDt=UPe();Object.defineProperty(TR,"MongodbCommandType",{enumerable:!0,get:function(){return RDt.MongodbCommandType}})});function xDt(e){let t=VW(e);return JSON.stringify(t)}function VW(e){if(Array.isArray(e))return e.map(t=>VW(t));if(DDt(e)){let t={};return Object.entries(e).map(([n,r])=>[n,VW(r)]).reduce((n,r)=>(wDt(r)&&(n[r[0]]=r[1]),n),t)}return"?"}function DDt(e){return typeof e=="object"&&e!==null&&!NDt(e)}function NDt(e){let t=!1;return typeof Buffer<"u"&&(t=Buffer.isBuffer(e)),t}function wDt(e){return Array.isArray(e)}var FPe,GPe,jPe,BDt,zPe,HPe=B(()=>{A();FPe=ue(QPe(),1);_r();GPe="Mongo",jPe=ct(GPe,()=>new FPe.MongoDBInstrumentation({dbStatementSerializer:xDt,responseHook(e){Yr(e,"auto.db.otel.mongo")}}));BDt=(()=>({name:GPe,setupOnce(){jPe()}})),zPe=BDt});var YW=M(cs=>{"use strict";A();Object.defineProperty(cs,"__esModule",{value:!0});cs.DB_SYSTEM_NAME_VALUE_MONGODB=cs.ATTR_NET_PEER_PORT=cs.ATTR_NET_PEER_NAME=cs.ATTR_DB_USER=cs.ATTR_DB_SYSTEM=cs.ATTR_DB_STATEMENT=cs.ATTR_DB_OPERATION=cs.ATTR_DB_NAME=cs.ATTR_DB_MONGODB_COLLECTION=void 0;cs.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";cs.ATTR_DB_NAME="db.name";cs.ATTR_DB_OPERATION="db.operation";cs.ATTR_DB_STATEMENT="db.statement";cs.ATTR_DB_SYSTEM="db.system";cs.ATTR_DB_USER="db.user";cs.ATTR_NET_PEER_NAME="net.peer.name";cs.ATTR_NET_PEER_PORT="net.peer.port";cs.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var VPe=M(yE=>{"use strict";A();Object.defineProperty(yE,"__esModule",{value:!0});yE.handleCallbackResponse=yE.handlePromiseResponse=yE.getAttributesFromCollection=void 0;var $Pe=(He(),Me(tt)),pk=cn(),dk=YW(),t6=(Xn(),Me(qr));function kDt(e,t,n){let r={};return t&pk.SemconvStability.OLD&&(r[dk.ATTR_DB_MONGODB_COLLECTION]=e.name,r[dk.ATTR_DB_NAME]=e.conn.name,r[dk.ATTR_DB_USER]=e.conn.user),t&pk.SemconvStability.STABLE&&(r[t6.ATTR_DB_COLLECTION_NAME]=e.name,r[t6.ATTR_DB_NAMESPACE]=e.conn.name),n&pk.SemconvStability.OLD&&(r[dk.ATTR_NET_PEER_NAME]=e.conn.host,r[dk.ATTR_NET_PEER_PORT]=e.conn.port),n&pk.SemconvStability.STABLE&&(r[t6.ATTR_SERVER_ADDRESS]=e.conn.host,r[t6.ATTR_SERVER_PORT]=e.conn.port),r}yE.getAttributesFromCollection=kDt;function qPe(e,t={}){e.recordException(t),e.setStatus({code:$Pe.SpanStatusCode.ERROR,message:`${t.message} ${t.code?`
|
|
38
|
-
Mongoose Error Code: ${t.code}`:""}`})}function KW(e,t,n,r=void 0){n&&(0,pk.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&$Pe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function ODt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(KW(t,o,n,r),o)).catch(o=>{throw qPe(t,o),o}).finally(()=>t.end()):(KW(t,e,n,r),t.end(),e)}yE.handlePromiseResponse=ODt;function PDt(e,t,n,r,o,i,s=void 0){let u=0;return o.length===2?u=1:o.length===3&&(u=2),o[u]=(l,f)=>(l?qPe(r,l):KW(r,f,i,s),r.end(),e(l,f)),t.apply(n,o)}yE.handleCallbackResponse=PDt});var YPe=M(bR=>{"use strict";A();Object.defineProperty(bR,"__esModule",{value:!0});bR.PACKAGE_NAME=bR.PACKAGE_VERSION=void 0;bR.PACKAGE_VERSION="0.60.0";bR.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var XPe=M(Zc=>{"use strict";A();Object.defineProperty(Zc,"__esModule",{value:!0});Zc.MongooseInstrumentation=Zc._ALREADY_INSTRUMENTED=Zc._STORED_PARENT_SPAN=void 0;var ks=(He(),Me(tt)),MDt=Rr(),JW=VPe(),Qa=cn(),KPe=YPe(),SE=YW(),nT=(Xn(),Me(qr)),n6=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],LDt=["remove","count","findOneAndRemove",...n6],UDt=["count","findOneAndRemove",...n6],QDt=[...n6];function JPe(e){return e?e.startsWith("6.")||e.startsWith("5.")?LDt:e.startsWith("7.")?UDt:QDt:n6}function ZPe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function WPe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Zc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Zc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var ZW=class extends Qa.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(KPe.PACKAGE_NAME,KPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Qa.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Qa.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Qa.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,ZPe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),WPe(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)),JPe(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=JPe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,ZPe(n)&&this._unwrap(r.Model.prototype,"remove"),WPe(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&&ks.trace.getSpan(ks.context.active())===void 0)return r.apply(this,arguments);let s=this[Zc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Qa.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Qa.SemconvStability.STABLE&&(u[nT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Zc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&ks.trace.getSpan(ks.context.active())===void 0)return r.apply(this,arguments);let s=this[Zc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Qa.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Qa.SemconvStability.STABLE&&(u[nT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(s,u){if(r.getConfig().requireParentSpan&&ks.trace.getSpan(ks.context.active())===void 0)return o.apply(this,arguments);let l={document:this};s&&!(s instanceof Function)&&(l.options=s);let f={},{dbStatementSerializer:h}=r.getConfig();if(h){let E=h(t,l);r._dbSemconvStability&Qa.SemconvStability.OLD&&(f[SE.ATTR_DB_STATEMENT]=E),r._dbSemconvStability&Qa.SemconvStability.STABLE&&(f[nT.ATTR_DB_QUERY_TEXT]=E)}let _=r._startSpan(this.constructor.collection,this.constructor.modelName,t,f);return s instanceof Function&&(u=s,s=void 0),r._handleResponse(_,o,this,arguments,u,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&ks.trace.getSpan(ks.context.active())===void 0)return o.apply(this,arguments);let f=l,h=s,_=u;typeof s=="function"?(f=s,h=void 0,_=void 0):typeof u=="function"&&(f=u,_=void 0);let E={},T=r.getConfig().dbStatementSerializer;if(T){let x=T(t,{condition:{_id:this._id},updates:h,options:_});r._dbSemconvStability&Qa.SemconvStability.OLD&&(E[SE.ATTR_DB_STATEMENT]=x),r._dbSemconvStability&Qa.SemconvStability.STABLE&&(E[nT.ATTR_DB_QUERY_TEXT]=x)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,E),R=r._handleResponse(v,o,this,arguments,f,n);return R&&typeof R=="object"&&(R[Zc._ALREADY_INSTRUMENTED]=!0),R}}patchModelStatic(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&ks.trace.getSpan(ks.context.active())===void 0)return o.apply(this,arguments);typeof u=="function"&&(l=u,u=void 0);let f={};switch(t){case"insertMany":f.documents=s;break;case"bulkWrite":f.operations=s;break;default:f.document=s;break}u!==void 0&&(f.options=u);let h={},{dbStatementSerializer:_}=r.getConfig();if(_){let T=_(t,f);r._dbSemconvStability&Qa.SemconvStability.OLD&&(h[SE.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&Qa.SemconvStability.STABLE&&(h[nT.ATTR_DB_QUERY_TEXT]=T)}let E=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(E,o,this,arguments,l,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=ks.trace.getSpan(ks.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Zc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Zc._STORED_PARENT_SPAN]=ks.trace.getSpan(ks.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let s={...o,...(0,JW.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Qa.SemconvStability.OLD&&(s[SE.ATTR_DB_OPERATION]=r,s[SE.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Qa.SemconvStability.STABLE&&(s[nT.ATTR_DB_OPERATION_NAME]=r,s[nT.ATTR_DB_SYSTEM_NAME]=SE.DB_SYSTEM_NAME_VALUE_MONGODB);let u=this._dbSemconvStability&Qa.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(u,{kind:ks.SpanKind.CLIENT,attributes:s},i?ks.trace.setSpan(ks.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,s=void 0){let u=this;if(i instanceof Function)return u._callOriginalFunction(()=>(0,JW.handleCallbackResponse)(i,n,r,t,o,u.getConfig().responseHook,s));{let l=u._callOriginalFunction(()=>n.apply(r,o));return(0,JW.handlePromiseResponse)(l,t,u.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?ks.context.with((0,MDt.suppressTracing)(ks.context.active()),t):t()}};Zc.MongooseInstrumentation=ZW});var eMe=M(r6=>{"use strict";A();Object.defineProperty(r6,"__esModule",{value:!0});r6.MongooseInstrumentation=void 0;var FDt=XPe();Object.defineProperty(r6,"MongooseInstrumentation",{enumerable:!0,get:function(){return FDt.MongooseInstrumentation}})});var tMe,nMe,rMe,GDt,oMe,iMe=B(()=>{A();tMe=ue(eMe(),1);_r();nMe="Mongoose",rMe=ct(nMe,()=>new tMe.MongooseInstrumentation({responseHook(e){Yr(e,"auto.db.otel.mongoose")}})),GDt=(()=>({name:nMe,setupOnce(){rMe()}})),oMe=GDt});var sMe=M(ls=>{"use strict";A();Object.defineProperty(ls,"__esModule",{value:!0});ls.METRIC_DB_CLIENT_CONNECTIONS_USAGE=ls.DB_SYSTEM_VALUE_MYSQL=ls.ATTR_NET_PEER_PORT=ls.ATTR_NET_PEER_NAME=ls.ATTR_DB_USER=ls.ATTR_DB_SYSTEM=ls.ATTR_DB_STATEMENT=ls.ATTR_DB_NAME=ls.ATTR_DB_CONNECTION_STRING=void 0;ls.ATTR_DB_CONNECTION_STRING="db.connection_string";ls.ATTR_DB_NAME="db.name";ls.ATTR_DB_STATEMENT="db.statement";ls.ATTR_DB_SYSTEM="db.system";ls.ATTR_DB_USER="db.user";ls.ATTR_NET_PEER_NAME="net.peer.name";ls.ATTR_NET_PEER_PORT="net.peer.port";ls.DB_SYSTEM_VALUE_MYSQL="mysql";ls.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var aMe=M(fk=>{"use strict";A();Object.defineProperty(fk,"__esModule",{value:!0});fk.AttributeNames=void 0;var jDt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(jDt=fk.AttributeNames||(fk.AttributeNames={}))});var uMe=M(mu=>{"use strict";A();Object.defineProperty(mu,"__esModule",{value:!0});mu.getPoolNameOld=mu.arrayStringifyHelper=mu.getSpanName=mu.getDbValues=mu.getDbQueryText=mu.getJDBCString=mu.getConfig=void 0;function zDt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}mu.getConfig=zDt;function HDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}mu.getJDBCString=HDt;function $Dt(e){return typeof e=="string"?e:e.sql}mu.getDbQueryText=$Dt;function qDt(e,t){return WW(typeof e=="string"?t:t||e.values)}mu.getDbValues=qDt;function VDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}mu.getSpanName=VDt;function WW(e){return e?`[${e.toString()}]`:""}mu.arrayStringifyHelper=WW;function YDt(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()}mu.getPoolNameOld=YDt});var cMe=M(IR=>{"use strict";A();Object.defineProperty(IR,"__esModule",{value:!0});IR.PACKAGE_NAME=IR.PACKAGE_VERSION=void 0;IR.PACKAGE_VERSION="0.60.0";IR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var dMe=M(o6=>{"use strict";A();Object.defineProperty(o6,"__esModule",{value:!0});o6.MySQLInstrumentation=void 0;var Wc=(He(),Me(tt)),dp=cn(),CR=(Xn(),Me(qr)),Wg=sMe(),KDt=aMe(),rT=uMe(),lMe=cMe(),XW=class extends dp.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(lMe.PACKAGE_NAME,lMe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,dp.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,dp.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Wg.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 dp.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,dp.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,dp.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,dp.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 s=t._allConnections.length,u=t._freeConnections.length,l=s-u,f=(0,rT.getPoolNameOld)(t);r._connCountAdd(-l,f,"used"),r._connCountAdd(-u,f,"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,s){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let u=t._nodes;if(u){let l=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),f=u[l].pool;r._setPoolCallbacks(f,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,s,u){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let l=r._getConnectionCallbackPatchFn(i);return n.call(t,l)}if(arguments.length===2&&typeof s=="function"){let l=r._getConnectionCallbackPatchFn(s);return n.call(t,i,l)}if(arguments.length===3&&typeof u=="function"){let l=r._getConnectionCallbackPatchFn(u);return n.call(t,i,s,l)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=Wc.context.active();return function(o,i){i&&((0,dp.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&Wc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,s){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let u={},{host:l,port:f,database:h,user:_}=(0,rT.getConfig)(t.config),E=parseInt(f,10),T=(0,rT.getDbQueryText)(o);r._dbSemconvStability&dp.SemconvStability.OLD&&(u[Wg.ATTR_DB_SYSTEM]=Wg.DB_SYSTEM_VALUE_MYSQL,u[Wg.ATTR_DB_CONNECTION_STRING]=(0,rT.getJDBCString)(l,f,h),u[Wg.ATTR_DB_NAME]=h,u[Wg.ATTR_DB_USER]=_,u[Wg.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&dp.SemconvStability.STABLE&&(u[CR.ATTR_DB_SYSTEM_NAME]=CR.DB_SYSTEM_NAME_VALUE_MYSQL,u[CR.ATTR_DB_NAMESPACE]=h,u[CR.ATTR_DB_QUERY_TEXT]=T),r._netSemconvStability&dp.SemconvStability.OLD&&(u[Wg.ATTR_NET_PEER_NAME]=l,isNaN(E)||(u[Wg.ATTR_NET_PEER_PORT]=E)),r._netSemconvStability&dp.SemconvStability.STABLE&&(u[CR.ATTR_SERVER_ADDRESS]=l,isNaN(E)||(u[CR.ATTR_SERVER_PORT]=E));let v=r.tracer.startSpan((0,rT.getSpanName)(o),{kind:Wc.SpanKind.CLIENT,attributes:u});if(r.getConfig().enhancedDatabaseReporting){let k;Array.isArray(i)?k=i:arguments[2]&&(k=[i]),v.setAttribute(KDt.AttributeNames.MYSQL_VALUES,(0,rT.getDbValues)(o,k))}let R=Array.from(arguments).findIndex(k=>typeof k=="function"),x=Wc.context.active();if(R===-1){let k=Wc.context.with(Wc.trace.setSpan(Wc.context.active(),v),()=>n.apply(t,arguments));return Wc.context.bind(x,k),k.on("error",P=>v.setStatus({code:Wc.SpanStatusCode.ERROR,message:P.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,R,r._patchCallbackQuery(v,x)),Wc.context.with(Wc.trace.setSpan(Wc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,s){return o&&t.setStatus({code:Wc.SpanStatusCode.ERROR,message:o.message}),t.end(),Wc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,rT.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")})}};o6.MySQLInstrumentation=XW});var pMe=M(i6=>{"use strict";A();Object.defineProperty(i6,"__esModule",{value:!0});i6.MySQLInstrumentation=void 0;var JDt=dMe();Object.defineProperty(i6,"MySQLInstrumentation",{enumerable:!0,get:function(){return JDt.MySQLInstrumentation}})});var fMe,mMe,AMe,ZDt,gMe,hMe=B(()=>{A();fMe=ue(pMe(),1);_r();mMe="Mysql",AMe=ct(mMe,()=>new fMe.MySQLInstrumentation({})),ZDt=(()=>({name:mMe,setupOnce(){AMe()}})),gMe=ZDt});var eX=M(ca=>{"use strict";A();Object.defineProperty(ca,"__esModule",{value:!0});ca.DB_SYSTEM_VALUE_MYSQL=ca.ATTR_NET_PEER_PORT=ca.ATTR_NET_PEER_NAME=ca.ATTR_DB_USER=ca.ATTR_DB_SYSTEM=ca.ATTR_DB_STATEMENT=ca.ATTR_DB_NAME=ca.ATTR_DB_CONNECTION_STRING=void 0;ca.ATTR_DB_CONNECTION_STRING="db.connection_string";ca.ATTR_DB_NAME="db.name";ca.ATTR_DB_STATEMENT="db.statement";ca.ATTR_DB_SYSTEM="db.system";ca.ATTR_DB_USER="db.user";ca.ATTR_NET_PEER_NAME="net.peer.name";ca.ATTR_NET_PEER_PORT="net.peer.port";ca.DB_SYSTEM_VALUE_MYSQL="mysql"});var nX=M(s6=>{"use strict";A();Object.defineProperty(s6,"__esModule",{value:!0});s6.addSqlCommenterComment=void 0;var tX=(He(),Me(tt)),WDt=Rr();function XDt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function e1t(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function t1t(e,t){if(typeof t!="string"||t.length===0||XDt(t))return t;let n=new WDt.W3CTraceContextPropagator,r={};n.inject(tX.trace.setSpan(tX.ROOT_CONTEXT,e),r,tX.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(s=>{let u=e1t(r[s]);return`${s}='${u}'`}).join(",");return`${t} /*${i}*/`}s6.addSqlCommenterComment=t1t});var _Me=M(pp=>{"use strict";A();Object.defineProperty(pp,"__esModule",{value:!0});pp.getConnectionPrototypeToInstrument=pp.once=pp.getSpanName=pp.getQueryText=pp.getConnectionAttributes=void 0;var mk=eX(),a6=cn(),rX=(Xn(),Me(qr));function n1t(e,t,n){let{host:r,port:o,database:i,user:s}=r1t(e),u={};t&a6.SemconvStability.OLD&&(u[mk.ATTR_DB_CONNECTION_STRING]=o1t(r,o,i),u[mk.ATTR_DB_NAME]=i,u[mk.ATTR_DB_USER]=s),t&a6.SemconvStability.STABLE&&(u[rX.ATTR_DB_NAMESPACE]=i);let l=parseInt(o,10);return n&a6.SemconvStability.OLD&&(u[mk.ATTR_NET_PEER_NAME]=r,isNaN(l)||(u[mk.ATTR_NET_PEER_PORT]=l)),n&a6.SemconvStability.STABLE&&(u[rX.ATTR_SERVER_ADDRESS]=r,isNaN(l)||(u[rX.ATTR_SERVER_PORT]=l)),u}pp.getConnectionAttributes=n1t;function r1t(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function o1t(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function i1t(e,t,n,r=!1,o=s1t){let[i,s]=typeof e=="string"?[e,n]:[e.sql,a1t(e)?n||e.values:n];try{return r?o(i):t&&s?t(i,s):i}catch{return"Could not determine the query due to an error in masking or formatting"}}pp.getQueryText=i1t;function s1t(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function a1t(e){return"values"in e}function u1t(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}pp.getSpanName=u1t;var c1t=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};pp.once=c1t;function l1t(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}pp.getConnectionPrototypeToInstrument=l1t});var EMe=M(vR=>{"use strict";A();Object.defineProperty(vR,"__esModule",{value:!0});vR.PACKAGE_NAME=vR.PACKAGE_VERSION=void 0;vR.PACKAGE_VERSION="0.60.0";vR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var bMe=M(u6=>{"use strict";A();Object.defineProperty(u6,"__esModule",{value:!0});u6.MySQL2Instrumentation=void 0;var yMe=(He(),Me(tt)),Df=cn(),oX=eX(),SMe=nX(),RR=_Me(),TMe=EMe(),iX=(Xn(),Me(qr)),sX=[">=1.4.2 <4"],aX=class extends Df.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(TMe.PACKAGE_NAME,TMe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Df.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Df.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,Df.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,Df.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 Df.InstrumentationNodeModuleDefinition("mysql2",sX,i=>(n(i),i),()=>{},[new Df.InstrumentationNodeModuleFile("mysql2/promise.js",sX,i=>(n(i),i),()=>{}),new Df.InstrumentationNodeModuleFile("mysql2/lib/connection.js",sX,i=>{let s=(0,RR.getConnectionPrototypeToInstrument)(i);return r(s),i},i=>{if(i===void 0)return;let s=(0,RR.getConnectionPrototypeToInstrument)(i);o(s)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,s,u){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]);let{maskStatement:f,maskStatementHook:h,responseHook:_}=o.getConfig(),E=(0,RR.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),T=(0,RR.getQueryText)(i,t,l,f,h);o._dbSemconvStability&Df.SemconvStability.OLD&&(E[oX.ATTR_DB_SYSTEM]=oX.DB_SYSTEM_VALUE_MYSQL,E[oX.ATTR_DB_STATEMENT]=T),o._dbSemconvStability&Df.SemconvStability.STABLE&&(E[iX.ATTR_DB_SYSTEM_NAME]=iX.DB_SYSTEM_NAME_VALUE_MYSQL,E[iX.ATTR_DB_QUERY_TEXT]=T);let v=o.tracer.startSpan((0,RR.getSpanName)(i),{kind:yMe.SpanKind.CLIENT,attributes:E});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,SMe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,SMe.addSqlCommenterComment)(v,i.sql)}));let R=(0,RR.once)((x,k)=>{x?v.setStatus({code:yMe.SpanStatusCode.ERROR,message:x.message}):typeof _=="function"&&(0,Df.safeExecuteInTheMiddle)(()=>{_(v,{queryResults:k})},P=>{P&&o._diag.warn("Failed executing responseHook",P)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(R));let x=r.apply(this,arguments);return x.once("error",k=>{R(k)}).once("result",k=>{R(void 0,k)}),x}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(R)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(R)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};u6.MySQL2Instrumentation=aX});var IMe=M(c6=>{"use strict";A();Object.defineProperty(c6,"__esModule",{value:!0});c6.MySQL2Instrumentation=void 0;var d1t=bMe();Object.defineProperty(c6,"MySQL2Instrumentation",{enumerable:!0,get:function(){return d1t.MySQL2Instrumentation}})});var CMe,vMe,RMe,p1t,xMe,DMe=B(()=>{A();CMe=ue(IMe(),1);_r();vMe="Mysql2",RMe=ct(vMe,()=>new CMe.MySQL2Instrumentation({responseHook(e){Yr(e,"auto.db.otel.mysql2")}})),p1t=(()=>({name:vMe,setupOnce(){RMe()}})),xMe=p1t});var NMe=M(Au=>{"use strict";A();Object.defineProperty(Au,"__esModule",{value:!0});Au.DB_SYSTEM_VALUE_REDIS=Au.DB_SYSTEM_NAME_VALUE_REDIS=Au.ATTR_NET_PEER_PORT=Au.ATTR_NET_PEER_NAME=Au.ATTR_DB_SYSTEM=Au.ATTR_DB_STATEMENT=Au.ATTR_DB_CONNECTION_STRING=void 0;Au.ATTR_DB_CONNECTION_STRING="db.connection_string";Au.ATTR_DB_STATEMENT="db.statement";Au.ATTR_DB_SYSTEM="db.system";Au.ATTR_NET_PEER_NAME="net.peer.name";Au.ATTR_NET_PEER_PORT="net.peer.port";Au.DB_SYSTEM_NAME_VALUE_REDIS="redis";Au.DB_SYSTEM_VALUE_REDIS="redis"});var wMe=M(l6=>{"use strict";A();Object.defineProperty(l6,"__esModule",{value:!0});l6.endSpan=void 0;var f1t=(He(),Me(tt)),m1t=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:f1t.SpanStatusCode.ERROR,message:t.message})),e.end()};l6.endSpan=m1t});var p6=M(d6=>{"use strict";A();Object.defineProperty(d6,"__esModule",{value:!0});d6.defaultDbStatementSerializer=void 0;var A1t=[{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}],g1t=(e,t)=>{if(Array.isArray(t)&&t.length){let n=A1t.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};d6.defaultDbStatementSerializer=g1t});var BMe=M(xR=>{"use strict";A();Object.defineProperty(xR,"__esModule",{value:!0});xR.PACKAGE_NAME=xR.PACKAGE_VERSION=void 0;xR.PACKAGE_VERSION="0.62.0";xR.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var MMe=M(f6=>{"use strict";A();Object.defineProperty(f6,"__esModule",{value:!0});f6.IORedisInstrumentation=void 0;var TE=(He(),Me(tt)),Xc=cn(),bE=(Xn(),Me(qr)),el=NMe(),kMe=cn(),Ak=wMe(),h1t=p6(),OMe=BMe(),PMe={requireParentSpan:!0},uX=class extends Xc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(OMe.PACKAGE_NAME,OMe.PACKAGE_VERSION,{...PMe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Xc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Xc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...PMe,...t})}init(){return[new Xc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Xc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Xc.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(),s=i.dbStatementSerializer||h1t.defaultDbStatementSerializer,u=TE.trace.getSpan(TE.context.active())===void 0;if(i.requireParentSpan===!0&&u)return t.apply(this,arguments);let l={},{host:f,port:h}=this.options,_=s(o.name,o.args);r._dbSemconvStability&Xc.SemconvStability.OLD&&(l[el.ATTR_DB_SYSTEM]=el.DB_SYSTEM_VALUE_REDIS,l[el.ATTR_DB_STATEMENT]=_,l[el.ATTR_DB_CONNECTION_STRING]=`redis://${f}:${h}`),r._dbSemconvStability&Xc.SemconvStability.STABLE&&(l[bE.ATTR_DB_SYSTEM_NAME]=el.DB_SYSTEM_NAME_VALUE_REDIS,l[bE.ATTR_DB_QUERY_TEXT]=_),r._netSemconvStability&Xc.SemconvStability.OLD&&(l[el.ATTR_NET_PEER_NAME]=f,l[el.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Xc.SemconvStability.STABLE&&(l[bE.ATTR_SERVER_ADDRESS]=f,l[bE.ATTR_SERVER_PORT]=h);let E=r.tracer.startSpan(o.name,{kind:TE.SpanKind.CLIENT,attributes:l}),{requestHook:T}=i;T&&(0,kMe.safeExecuteInTheMiddle)(()=>T(E,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&TE.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),R=o.resolve;o.resolve=function(k){(0,kMe.safeExecuteInTheMiddle)(()=>i.responseHook?.(E,o.name,o.args,k),P=>{P&&TE.diag.error("ioredis instrumentation: response hook failed",P)},!0),(0,Ak.endSpan)(E,null),R(k)};let x=o.reject;return o.reject=function(k){(0,Ak.endSpan)(E,k),x(k)},v}catch(v){throw(0,Ak.endSpan)(E,v),v}}}_traceConnection(t){let n=this;return function(){let r=TE.trace.getSpan(TE.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:s}=this.options;n._dbSemconvStability&Xc.SemconvStability.OLD&&(o[el.ATTR_DB_SYSTEM]=el.DB_SYSTEM_VALUE_REDIS,o[el.ATTR_DB_STATEMENT]="connect",o[el.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${s}`),n._dbSemconvStability&Xc.SemconvStability.STABLE&&(o[bE.ATTR_DB_SYSTEM_NAME]=el.DB_SYSTEM_NAME_VALUE_REDIS,o[bE.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Xc.SemconvStability.OLD&&(o[el.ATTR_NET_PEER_NAME]=i,o[el.ATTR_NET_PEER_PORT]=s),n._netSemconvStability&Xc.SemconvStability.STABLE&&(o[bE.ATTR_SERVER_ADDRESS]=i,o[bE.ATTR_SERVER_PORT]=s);let u=n.tracer.startSpan("connect",{kind:TE.SpanKind.CLIENT,attributes:o});try{let l=t.apply(this,arguments);return(0,Ak.endSpan)(u,null),l}catch(l){throw(0,Ak.endSpan)(u,l),l}}}};f6.IORedisInstrumentation=uX});var LMe=M(m6=>{"use strict";A();Object.defineProperty(m6,"__esModule",{value:!0});m6.IORedisInstrumentation=void 0;var _1t=MMe();Object.defineProperty(m6,"IORedisInstrumentation",{enumerable:!0,get:function(){return _1t.IORedisInstrumentation}})});var A6=M(DR=>{"use strict";A();Object.defineProperty(DR,"__esModule",{value:!0});DR.PACKAGE_NAME=DR.PACKAGE_VERSION=void 0;DR.PACKAGE_VERSION="0.62.0";DR.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var UMe=M(IE=>{"use strict";A();Object.defineProperty(IE,"__esModule",{value:!0});IE.getTracedCreateStreamTrace=IE.getTracedCreateClient=IE.endSpan=void 0;var gk=(He(),Me(tt)),E1t=(e,t)=>{t&&e.setStatus({code:gk.SpanStatusCode.ERROR,message:t.message}),e.end()};IE.endSpan=E1t;var y1t=e=>function(){let n=e.apply(this,arguments);return gk.context.bind(gk.context.active(),n)};IE.getTracedCreateClient=y1t;var S1t=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){gk.context.bind(gk.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};IE.getTracedCreateStreamTrace=S1t});var g6=M(gu=>{"use strict";A();Object.defineProperty(gu,"__esModule",{value:!0});gu.DB_SYSTEM_VALUE_REDIS=gu.DB_SYSTEM_NAME_VALUE_REDIS=gu.ATTR_NET_PEER_PORT=gu.ATTR_NET_PEER_NAME=gu.ATTR_DB_SYSTEM=gu.ATTR_DB_STATEMENT=gu.ATTR_DB_CONNECTION_STRING=void 0;gu.ATTR_DB_CONNECTION_STRING="db.connection_string";gu.ATTR_DB_STATEMENT="db.statement";gu.ATTR_DB_SYSTEM="db.system";gu.ATTR_NET_PEER_NAME="net.peer.name";gu.ATTR_NET_PEER_PORT="net.peer.port";gu.DB_SYSTEM_NAME_VALUE_REDIS="redis";gu.DB_SYSTEM_VALUE_REDIS="redis"});var FMe=M(_6=>{"use strict";A();Object.defineProperty(_6,"__esModule",{value:!0});_6.RedisInstrumentationV2_V3=void 0;var rd=cn(),h6=UMe(),QMe=A6(),hk=(He(),Me(tt)),_k=(Xn(),Me(qr)),oT=g6(),T1t=p6(),cX=class e extends rd.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(QMe.PACKAGE_NAME,QMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,rd.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,rd.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new rd.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,rd.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,rd.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,rd.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 s=t.getConfig(),u=hk.trace.getSpan(hk.context.active())===void 0;if(s.requireParentSpan===!0&&u)return r.apply(this,arguments);let l=s?.dbStatementSerializer||T1t.defaultDbStatementSerializer,f={};t._semconvStability&rd.SemconvStability.OLD&&Object.assign(f,{[oT.ATTR_DB_SYSTEM]:oT.DB_SYSTEM_VALUE_REDIS,[oT.ATTR_DB_STATEMENT]:l(i.command,i.args)}),t._semconvStability&rd.SemconvStability.STABLE&&Object.assign(f,{[_k.ATTR_DB_SYSTEM_NAME]:oT.DB_SYSTEM_NAME_VALUE_REDIS,[_k.ATTR_DB_OPERATION_NAME]:i.command,[_k.ATTR_DB_QUERY_TEXT]:l(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:hk.SpanKind.CLIENT,attributes:f});if(this.connection_options){let E={};t._semconvStability&rd.SemconvStability.OLD&&Object.assign(E,{[oT.ATTR_NET_PEER_NAME]:this.connection_options.host,[oT.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&rd.SemconvStability.STABLE&&Object.assign(E,{[_k.ATTR_SERVER_ADDRESS]:this.connection_options.host,[_k.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(E)}this.address&&t._semconvStability&rd.SemconvStability.OLD&&h.setAttribute(oT.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let _=arguments[0].callback;if(_){let E=hk.context.active();arguments[0].callback=function(v,R){if(s?.responseHook){let x=s.responseHook;(0,rd.safeExecuteInTheMiddle)(()=>{x(h,i.command,i.args,R)},k=>{k&&t._diag.error("Error executing responseHook",k)},!0)}return(0,h6.endSpan)(h,v),hk.context.with(E,_,this,...arguments)}}try{return r.apply(this,arguments)}catch(E){throw(0,h6.endSpan)(h,E),E}}}}_getPatchCreateClient(){return function(n){return(0,h6.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,h6.getTracedCreateStreamTrace)(n)}}};_6.RedisInstrumentationV2_V3=cX});var jMe=M(E6=>{"use strict";A();Object.defineProperty(E6,"__esModule",{value:!0});E6.getClientAttributes=void 0;var lX=(Xn(),Me(qr)),NR=g6(),GMe=cn();function b1t(e,t,n){let r={};return n&GMe.SemconvStability.OLD&&Object.assign(r,{[NR.ATTR_DB_SYSTEM]:NR.DB_SYSTEM_VALUE_REDIS,[NR.ATTR_NET_PEER_NAME]:t?.socket?.host,[NR.ATTR_NET_PEER_PORT]:t?.socket?.port,[NR.ATTR_DB_CONNECTION_STRING]:I1t(e,t?.url)}),n&GMe.SemconvStability.STABLE&&Object.assign(r,{[lX.ATTR_DB_SYSTEM_NAME]:NR.DB_SYSTEM_NAME_VALUE_REDIS,[lX.ATTR_SERVER_ADDRESS]:t?.socket?.host,[lX.ATTR_SERVER_PORT]:t?.socket?.port}),r}E6.getClientAttributes=b1t;function I1t(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 qMe=M(y6=>{"use strict";A();Object.defineProperty(y6,"__esModule",{value:!0});y6.RedisInstrumentationV4_V5=void 0;var fp=(He(),Me(tt)),Ro=cn(),zMe=jMe(),C1t=p6(),HMe=A6(),dX=(Xn(),Me(qr)),v1t=g6(),Ek=Symbol("opentelemetry.instrumentation.redis.open_spans"),$Me=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),pX=class e extends Ro.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(HMe.PACKAGE_NAME,HMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ro.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ro.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 Ro.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let u=i.transformCommandArguments;if(!u)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let l=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Ro.isWrapped)(i?.[l])&&this._unwrap(i,l),this._wrap(i,l,this._getPatchExtendWithCommands(u)),i},i=>{(0,Ro.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Ro.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Ro.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return(0,Ro.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Ro.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Ro.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Ro.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Ro.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),o=new Ro.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Ro.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Ro.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Ro.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(s,"connect",this._getPatchedClientConnect()),i},i=>{let s=i?.default?.prototype;(0,Ro.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Ro.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Ro.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new Ro.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(s){if(s?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let u=s.executor;return s.executor=function(l,f){let h=t(l,f).args;return n._traceClientCommand(u,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let s=o.apply(this,arguments);return typeof s?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),s):s.then(u=>{let l=this[Ek];return n._endSpansWithRedisReplies(l,u,t),u}).catch(u=>{let l=this[Ek];if(!l)n._diag.error("cannot find open spans to end for multi/pipeline");else{let f=u.constructor.name==="MultiErrorReply"?u.replies:new Array(l.length).fill(u);n._endSpansWithRedisReplies(l,f,t)}return Promise.reject(u)})}}}_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[$Me]=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,s=(0,zMe.getClientAttributes)(t._diag,i,t._semconvStability),u=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:fp.SpanKind.CLIENT,attributes:s});return fp.context.with(fp.trace.setSpan(fp.context.active(),u),()=>r.apply(this)).then(f=>(u.end(),f)).catch(f=>(u.recordException(f),u.setStatus({code:fp.SpanStatusCode.ERROR,message:f.message}),u.end(),Promise.reject(f)))}}}_traceClientCommand(t,n,r,o){if(fp.trace.getSpan(fp.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let s=n.options||n[$Me],u=o[0],l=o.slice(1),f=this.getConfig().dbStatementSerializer||C1t.defaultDbStatementSerializer,h=(0,zMe.getClientAttributes)(this._diag,s,this._semconvStability);this._semconvStability&Ro.SemconvStability.STABLE&&(h[dX.ATTR_DB_OPERATION_NAME]=u);try{let T=f(u,l);T!=null&&(this._semconvStability&Ro.SemconvStability.OLD&&(h[v1t.ATTR_DB_STATEMENT]=T),this._semconvStability&Ro.SemconvStability.STABLE&&(h[dX.ATTR_DB_QUERY_TEXT]=T))}catch(T){this._diag.error("dbStatementSerializer throw an exception",T,{commandName:u})}let _=this.tracer.startSpan(`${e.COMPONENT}-${u}`,{kind:fp.SpanKind.CLIENT,attributes:h}),E=fp.context.with(fp.trace.setSpan(fp.context.active(),_),()=>t.apply(n,r));if(typeof E?.then=="function")E.then(T=>{this._endSpanWithResponse(_,u,l,T,void 0)},T=>{this._endSpanWithResponse(_,u,l,null,T)});else{let T=E;T[Ek]=T[Ek]||[],T[Ek].push({span:_,commandName:u,commandArgs:l})}return E}_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(u=>u.commandName),s=o.every(u=>u===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let u=0;u<t.length;u++){let{span:l,commandArgs:f}=t[u],h=n[u],[_,E]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Ro.SemconvStability.STABLE&&l.setAttribute(dX.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(l,o[u],f,_,E)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,r,o)}catch(u){this._diag.error("responseHook throw an exception",u)}i&&(t.recordException(i),t.setStatus({code:fp.SpanStatusCode.ERROR,message:i?.message})),t.end()}};y6.RedisInstrumentationV4_V5=pX});var KMe=M(S6=>{"use strict";A();Object.defineProperty(S6,"__esModule",{value:!0});S6.RedisInstrumentation=void 0;var R1t=cn(),VMe=A6(),x1t=FMe(),D1t=qMe(),YMe={requireParentSpan:!1},fX=class extends R1t.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...YMe,...t};super(VMe.PACKAGE_NAME,VMe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new x1t.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new D1t.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...YMe,...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())}};S6.RedisInstrumentation=fX});var JMe=M(T6=>{"use strict";A();Object.defineProperty(T6,"__esModule",{value:!0});T6.RedisInstrumentation=void 0;var N1t=KMe();Object.defineProperty(T6,"RedisInstrumentation",{enumerable:!0,get:function(){return N1t.RedisInstrumentation}})});function yk(e,t){return e.includes(t.toLowerCase())}function AX(e){return yk(mX,e)?"cache.get":yk(B1t,e)?"cache.put":void 0}function k1t(e,t){return t.some(n=>e.startsWith(n))}function WMe(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)?ZMe(o.map(i=>n(i))):["<unknown>"],r=t[0];return yk(w1t,e)&&r!=null?n(r):ZMe(t.map(o=>n(o)))}catch{return}}function XMe(e,t,n){if(!AX(e))return!1;for(let r of t)if(k1t(r,n))return!0;return!1}function e2e(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 ZMe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var w1t,mX,B1t,t2e=B(()=>{A();w1t=["get","set","setex"],mX=["get","mget"],B1t=["set","setex"]});var n2e,r2e,b6,Sk,o2e,O1t,P1t,i2e,M1t,s2e,a2e=B(()=>{A();n2e=ue(LMe(),1),r2e=ue(JMe(),1);mt();_r();t2e();b6="Redis",Sk={},o2e=(e,t,n,r)=>{e.setAttribute(Lt,"auto.db.otel.redis");let o=WMe(t,n),i=AX(t);if(!o||!i||!Sk.cachePrefixes||!XMe(t,o,Sk.cachePrefixes))return;let s=Pt(e).data["net.peer.name"],u=Pt(e).data["net.peer.port"];u&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":u});let l=e2e(r);l&&e.setAttribute(EY,l),yk(mX,t)&&l!==void 0&&e.setAttribute(hY,l>0),e.setAttributes({[rn]:i,[_Y]:o});let f=o.join(", ");e.updateName(Sk.maxCacheKeyLength?Q_(f,Sk.maxCacheKeyLength):f)},O1t=ct(`${b6}.IORedis`,()=>new n2e.IORedisInstrumentation({responseHook:o2e})),P1t=ct(`${b6}.Redis`,()=>new r2e.RedisInstrumentation({responseHook:o2e})),i2e=Object.assign(()=>{O1t(),P1t()},{id:b6}),M1t=((e={})=>({name:b6,setupOnce(){Sk=e,i2e()}})),s2e=M1t});var u2e=M(I6=>{"use strict";A();Object.defineProperty(I6,"__esModule",{value:!0});I6.EVENT_LISTENERS_SET=void 0;I6.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var gX=M(Tk=>{"use strict";A();Object.defineProperty(Tk,"__esModule",{value:!0});Tk.AttributeNames=void 0;var L1t;(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"})(L1t=Tk.AttributeNames||(Tk.AttributeNames={}))});var hX=M(Or=>{"use strict";A();Object.defineProperty(Or,"__esModule",{value:!0});Or.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Or.METRIC_DB_CLIENT_CONNECTION_COUNT=Or.DB_SYSTEM_VALUE_POSTGRESQL=Or.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Or.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Or.ATTR_NET_PEER_PORT=Or.ATTR_NET_PEER_NAME=Or.ATTR_DB_USER=Or.ATTR_DB_SYSTEM=Or.ATTR_DB_STATEMENT=Or.ATTR_DB_NAME=Or.ATTR_DB_CONNECTION_STRING=Or.ATTR_DB_CLIENT_CONNECTION_STATE=Or.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Or.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Or.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Or.ATTR_DB_CONNECTION_STRING="db.connection_string";Or.ATTR_DB_NAME="db.name";Or.ATTR_DB_STATEMENT="db.statement";Or.ATTR_DB_SYSTEM="db.system";Or.ATTR_DB_USER="db.user";Or.ATTR_NET_PEER_NAME="net.peer.name";Or.ATTR_NET_PEER_PORT="net.peer.port";Or.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Or.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Or.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Or.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Or.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var _X=M(bk=>{"use strict";A();Object.defineProperty(bk,"__esModule",{value:!0});bk.SpanNames=void 0;var U1t;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(U1t=bk.SpanNames||(bk.SpanNames={}))});var A2e=M(sr=>{"use strict";A();Object.defineProperty(sr,"__esModule",{value:!0});sr.sanitizedErrorMessage=sr.isObjectWithTextString=sr.getErrorMessage=sr.patchClientConnectCallback=sr.patchCallbackPGPool=sr.updateCounter=sr.getPoolName=sr.patchCallback=sr.handleExecutionResult=sr.handleConfigQuery=sr.shouldSkipInstrumentation=sr.getSemanticAttributesFromPoolConnection=sr.getSemanticAttributesFromConnection=sr.getConnectionString=sr.parseAndMaskConnectionString=sr.parseNormalizedOperationName=sr.getQuerySpanName=void 0;var CE=(He(),Me(tt)),C6=gX(),mp=(Xn(),Me(qr)),yi=hX(),iT=cn(),c2e=_X();function l2e(e,t){if(!t)return c2e.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:d2e(t.text);return`${c2e.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}sr.getQuerySpanName=l2e;function d2e(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}sr.parseNormalizedOperationName=d2e;function p2e(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}sr.parseAndMaskConnectionString=p2e;function EX(e){if("connectionString"in e&&e.connectionString)return p2e(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}sr.getConnectionString=EX;function v6(e){if(Number.isInteger(e))return e}function f2e(e,t){let n={};return t&iT.SemconvStability.OLD&&(n={...n,[yi.ATTR_DB_SYSTEM]:yi.DB_SYSTEM_VALUE_POSTGRESQL,[yi.ATTR_DB_NAME]:e.database,[yi.ATTR_DB_CONNECTION_STRING]:EX(e),[yi.ATTR_DB_USER]:e.user,[yi.ATTR_NET_PEER_NAME]:e.host,[yi.ATTR_NET_PEER_PORT]:v6(e.port)}),t&iT.SemconvStability.STABLE&&(n={...n,[mp.ATTR_DB_SYSTEM_NAME]:mp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[mp.ATTR_DB_NAMESPACE]:e.namespace,[mp.ATTR_SERVER_ADDRESS]:e.host,[mp.ATTR_SERVER_PORT]:v6(e.port)}),n}sr.getSemanticAttributesFromConnection=f2e;function Q1t(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[C6.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[C6.AttributeNames.MAX_CLIENT]:e.maxClient};return t&iT.SemconvStability.OLD&&(r={...r,[yi.ATTR_DB_SYSTEM]:yi.DB_SYSTEM_VALUE_POSTGRESQL,[yi.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[yi.ATTR_DB_CONNECTION_STRING]:EX(e),[yi.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[yi.ATTR_NET_PEER_PORT]:Number(n?.port)||v6(e.port),[yi.ATTR_DB_USER]:n?.username??e.user}),t&iT.SemconvStability.STABLE&&(r={...r,[mp.ATTR_DB_SYSTEM_NAME]:mp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[mp.ATTR_DB_NAMESPACE]:e.namespace,[mp.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[mp.ATTR_SERVER_PORT]:Number(n?.port)||v6(e.port)}),r}sr.getSemanticAttributesFromPoolConnection=Q1t;function F1t(e){return e.requireParentSpan===!0&&CE.trace.getSpan(CE.context.active())===void 0}sr.shouldSkipInstrumentation=F1t;function G1t(e,t,n,r){let{connectionParameters:o}=this,i=o.database,s=l2e(i,r),u=e.startSpan(s,{kind:CE.SpanKind.CLIENT,attributes:f2e(o,n)});if(!r)return u;if(r.text&&(n&iT.SemconvStability.OLD&&u.setAttribute(yi.ATTR_DB_STATEMENT,r.text),n&iT.SemconvStability.STABLE&&u.setAttribute(mp.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let l=r.values.map(f=>f==null?"null":f instanceof Buffer?f.toString():typeof f=="object"?typeof f.toPostgres=="function"?f.toPostgres():JSON.stringify(f):f.toString());u.setAttribute(C6.AttributeNames.PG_VALUES,l)}catch(l){CE.diag.error("failed to stringify ",r.values,l)}return typeof r.name=="string"&&u.setAttribute(C6.AttributeNames.PG_PLAN,r.name),u}sr.handleConfigQuery=G1t;function m2e(e,t,n){typeof e.responseHook=="function"&&(0,iT.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&CE.diag.error("Error running response hook",r)},!0)}sr.handleExecutionResult=m2e;function j1t(e,t,n,r,o){return function(s,u){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(r[mp.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(R6(s)),t.setStatus({code:CE.SpanStatusCode.ERROR,message:s.message})):m2e(e,t,u),o(),t.end(),n.call(this,s,u)}}sr.patchCallback=j1t;function z1t(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()}sr.getPoolName=z1t;function H1t(e,t,n,r,o){let i=t.totalCount,s=t.waitingCount,u=t.idleCount,l=i-u;return n.add(l-o.used,{[yi.ATTR_DB_CLIENT_CONNECTION_STATE]:yi.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[yi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(u-o.idle,{[yi.ATTR_DB_CLIENT_CONNECTION_STATE]:yi.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[yi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-o.pending,{[yi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:u,pending:s}}sr.updateCounter=H1t;function $1t(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(R6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}sr.patchCallbackPGPool=$1t;function q1t(e,t){return function(r){r&&(r instanceof Error&&e.recordException(R6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}sr.patchClientConnectCallback=q1t;function V1t(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}sr.getErrorMessage=V1t;function Y1t(e){return typeof e=="object"&&typeof e?.text=="string"}sr.isObjectWithTextString=Y1t;function R6(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}sr.sanitizedErrorMessage=R6});var g2e=M(wR=>{"use strict";A();Object.defineProperty(wR,"__esModule",{value:!0});wR.PACKAGE_NAME=wR.PACKAGE_VERSION=void 0;wR.PACKAGE_VERSION="0.66.0";wR.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var T2e=M(D6=>{"use strict";A();Object.defineProperty(D6,"__esModule",{value:!0});D6.PgInstrumentation=void 0;var tc=cn(),Jr=(He(),Me(tt)),h2e=u2e(),ri=A2e(),_2e=nX(),E2e=g2e(),y2e=_X(),x6=Rr(),Nf=(Xn(),Me(qr)),Ik=hX();function BR(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var yX=class extends tc.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(E2e.PACKAGE_NAME,E2e.PACKAGE_VERSION,t),this._semconvStability=(0,tc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(Nf.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Jr.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(Ik.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(Ik.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 tc.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new tc.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new tc.InstrumentationNodeModuleDefinition("pg",t,u=>{let l=BR(u);return this._patchPgClient(l.Client),u},u=>{let l=BR(u);return this._unpatchPgClient(l.Client),u},[o,r]),s=new tc.InstrumentationNodeModuleDefinition("pg-pool",n,u=>{let l=BR(u);return(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect"),this._wrap(l.prototype,"connect",this._getPoolConnectPatch()),l},u=>{let l=BR(u);(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=BR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.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=BR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ri.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(y2e.SpanNames.CONNECT,{kind:Jr.SpanKind.CLIENT,attributes:ri.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let l=Jr.trace.getSpan(Jr.context.active());o=ri.patchClientConnectCallback(s,o),l&&(o=Jr.context.bind(Jr.context.active(),o))}let u=Jr.context.with(Jr.trace.setSpan(Jr.context.active(),s),()=>n.call(this,o));return S2e(s,u)}}recordOperationDuration(t,n){let r={},o=[Nf.ATTR_DB_NAMESPACE,Nf.ATTR_ERROR_TYPE,Nf.ATTR_SERVER_PORT,Nf.ATTR_SERVER_ADDRESS,Nf.ATTR_DB_OPERATION_NAME];this._semconvStability&tc.SemconvStability.OLD&&o.push(Ik.ATTR_DB_SYSTEM),this._semconvStability&tc.SemconvStability.STABLE&&o.push(Nf.ATTR_DB_SYSTEM_NAME),o.forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,x6.hrTimeToMilliseconds)((0,x6.hrTimeDuration)(n,(0,x6.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ri.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,x6.hrTime)(),s=o[0],u=typeof s=="string",l=ri.isObjectWithTextString(s),f=u?{text:s,values:Array.isArray(o[1])?o[1]:void 0}:l?{...s,name:s.name,text:s.text,values:s.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[Ik.ATTR_DB_SYSTEM]:Ik.DB_SYSTEM_VALUE_POSTGRESQL,[Nf.ATTR_DB_NAMESPACE]:this.database,[Nf.ATTR_SERVER_PORT]:this.connectionParameters.port,[Nf.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};f?.text&&(h[Nf.ATTR_DB_OPERATION_NAME]=ri.parseNormalizedOperationName(f?.text));let _=()=>{t.recordOperationDuration(h,i)},E=t.getConfig(),T=ri.handleConfigQuery.call(this,t.tracer,E,t._semconvStability,f);if(E.addSqlCommenterCommentToQueries&&(u?o[0]=(0,_2e.addSqlCommenterComment)(T,s):l&&!("name"in s)&&(o[0]={...s,text:(0,_2e.addSqlCommenterComment)(T,s.text)})),o.length>0){let x=Jr.trace.getSpan(Jr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ri.patchCallback(E,T,o[o.length-1],h,_),x&&(o[o.length-1]=Jr.context.bind(Jr.context.active(),o[o.length-1]));else if(typeof f?.callback=="function"){let k=ri.patchCallback(t.getConfig(),T,f.callback,h,_);x&&(k=Jr.context.bind(Jr.context.active(),k)),o[0].callback=k}}let{requestHook:v}=E;typeof v=="function"&&f&&(0,tc.safeExecuteInTheMiddle)(()=>{let{database:x,host:k,port:P,user:j}=this.connectionParameters;v(T,{connection:{database:x,host:k,port:P,user:j},query:{text:f.text,values:f.values,name:f.name}})},x=>{x&&t._diag.error("Error running query hook",x)},!0);let R;try{R=n.apply(this,o)}catch(x){throw x instanceof Error&&T.recordException(ri.sanitizedErrorMessage(x)),T.setStatus({code:Jr.SpanStatusCode.ERROR,message:ri.getErrorMessage(x)}),T.end(),x}return R instanceof Promise?R.then(x=>new Promise(k=>{ri.handleExecutionResult(t.getConfig(),T,x),_(),T.end(),k(x)})).catch(x=>new Promise((k,P)=>{x instanceof Error&&T.recordException(ri.sanitizedErrorMessage(x)),T.setStatus({code:Jr.SpanStatusCode.ERROR,message:x.message}),_(),T.end(),P(x)})):R})}_setPoolConnectEventListeners(t){if(t[h2e.EVENT_LISTENERS_SET])return;let n=ri.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=ri.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=ri.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=ri.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=ri.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[h2e.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ri.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(y2e.SpanNames.POOL_CONNECT,{kind:Jr.SpanKind.CLIENT,attributes:ri.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let l=Jr.trace.getSpan(Jr.context.active());o=ri.patchCallbackPGPool(s,o),l&&(o=Jr.context.bind(Jr.context.active(),o))}let u=Jr.context.with(Jr.trace.setSpan(Jr.context.active(),s),()=>n.call(this,o));return S2e(s,u)}}};D6.PgInstrumentation=yX;function S2e(e,t){if(!(t instanceof Promise))return t;let n=t;return Jr.context.bind(Jr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(ri.sanitizedErrorMessage(r)),e.setStatus({code:Jr.SpanStatusCode.ERROR,message:ri.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var b2e=M(kR=>{"use strict";A();Object.defineProperty(kR,"__esModule",{value:!0});kR.AttributeNames=kR.PgInstrumentation=void 0;var K1t=T2e();Object.defineProperty(kR,"PgInstrumentation",{enumerable:!0,get:function(){return K1t.PgInstrumentation}});var J1t=gX();Object.defineProperty(kR,"AttributeNames",{enumerable:!0,get:function(){return J1t.AttributeNames}})});var I2e,C2e,v2e,Z1t,R2e,x2e=B(()=>{A();I2e=ue(b2e(),1);_r();C2e="Postgres",v2e=ct(C2e,I2e.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){Yr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),Z1t=(e=>({name:C2e,setupOnce(){v2e(e)}})),R2e=Z1t});var vE,TX,D2e,W1t,X1t,N2e,SX,eNt,w2e,B2e=B(()=>{A();He();vE=ue(cn(),1);Xn();mt();_r();KS();TX="PostgresJs",D2e=[">=3.0.0 <4"],W1t=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,X1t=Symbol.for("sentry.query.from.instrumented.sql"),N2e=ct(TX,e=>new SX({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),SX=class extends vE.InstrumentationBase{constructor(t){super("sentry-postgres-js",er,t)}init(){let t=new vE.InstrumentationNodeModuleDefinition("postgres",D2e,n=>{try{return this._patchPostgres(n)}catch(r){return ws&&W.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new vE.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,D2e,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 ws&&W.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...s){let u=Reflect.construct(r,s);if(!u||typeof u!="function")return ws&&W.warn("postgres() did not return a valid instance"),u;let l=o.getConfig();return SK(u,{requireParentSpan:l.requireParentSpan,requestHook:l.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}return n?i:(EB(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return Jt.getSpan(We.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(QC,r);return}let o=n?.match(W1t);o?.[1]&&t.setAttribute(QC,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[X1t])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return ia({name:s||"postgresjs.query",op:"db"},u=>{Yr(u,"auto.db.postgresjs"),u.setAttributes({[mS]:"postgres",[kV]:s});let l=n.getConfig(),{requestHook:f}=l;f&&(0,vE.safeExecuteInTheMiddle)(()=>f(u,s,void 0),E=>{E&&(u.setAttribute("sentry.hook.error","requestHook failed"),ws&&W.error(`Error in requestHook for ${TX} integration:`,E))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(E,T,v)=>{try{n._setOperationName(u,s,v?.[0]?.command),u.end()}catch(R){ws&&W.error("Error ending span in resolve callback:",R)}return Reflect.apply(E,T,v)}});let _=this.reject;this.reject=new Proxy(_,{apply:(E,T,v)=>{try{u.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),u.setAttribute(OV,v?.[0]?.code||"unknown"),u.setAttribute(PV,v?.[0]?.name||"unknown"),n._setOperationName(u,s),u.end()}catch(R){ws&&W.error("Error ending span in reject callback:",R)}return Reflect.apply(E,T,v)}});try{return r.apply(this,o)}catch(E){throw u.setStatus({code:2,message:E instanceof Error?E.message:"unknown_error"}),u.end(),E}})},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}},eNt=(e=>({name:TX,setupOnce(){N2e(e)}})),w2e=eNt});var k2e=M(Ck=>{"use strict";A();Object.defineProperty(Ck,"__esModule",{value:!0});Ck.SeverityNumber=void 0;var tNt;(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"})(tNt=Ck.SeverityNumber||(Ck.SeverityNumber={}))});var w6=M(OR=>{"use strict";A();Object.defineProperty(OR,"__esModule",{value:!0});OR.NOOP_LOGGER=OR.NoopLogger=void 0;var N6=class{emit(t){}};OR.NoopLogger=N6;OR.NOOP_LOGGER=new N6});var k6=M(PR=>{"use strict";A();Object.defineProperty(PR,"__esModule",{value:!0});PR.NOOP_LOGGER_PROVIDER=PR.NoopLoggerProvider=void 0;var nNt=w6(),B6=class{getLogger(t,n,r){return new nNt.NoopLogger}};PR.NoopLoggerProvider=B6;PR.NOOP_LOGGER_PROVIDER=new B6});var IX=M(O6=>{"use strict";A();Object.defineProperty(O6,"__esModule",{value:!0});O6.ProxyLogger=void 0;var rNt=w6(),bX=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):rNt.NOOP_LOGGER}};O6.ProxyLogger=bX});var vX=M(P6=>{"use strict";A();Object.defineProperty(P6,"__esModule",{value:!0});P6.ProxyLoggerProvider=void 0;var oNt=k6(),iNt=IX(),CX=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new iNt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:oNt.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)}};P6.ProxyLoggerProvider=CX});var O2e=M(M6=>{"use strict";A();Object.defineProperty(M6,"__esModule",{value:!0});M6._globalThis=void 0;M6._globalThis=typeof globalThis=="object"?globalThis:global});var P2e=M(L6=>{"use strict";A();Object.defineProperty(L6,"__esModule",{value:!0});L6._globalThis=void 0;var sNt=O2e();Object.defineProperty(L6,"_globalThis",{enumerable:!0,get:function(){return sNt._globalThis}})});var M2e=M(U6=>{"use strict";A();Object.defineProperty(U6,"__esModule",{value:!0});U6._globalThis=void 0;var aNt=P2e();Object.defineProperty(U6,"_globalThis",{enumerable:!0,get:function(){return aNt._globalThis}})});var L2e=M(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;var uNt=M2e();nA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");nA._global=uNt._globalThis;function cNt(e,t,n){return r=>r===e?t:n}nA.makeGetter=cNt;nA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var Q2e=M(Q6=>{"use strict";A();Object.defineProperty(Q6,"__esModule",{value:!0});Q6.LogsAPI=void 0;var Ap=L2e(),lNt=k6(),U2e=vX(),RX=class e{constructor(){this._proxyLoggerProvider=new U2e.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Ap._global[Ap.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Ap._global[Ap.GLOBAL_LOGS_API_KEY]=(0,Ap.makeGetter)(Ap.API_BACKWARDS_COMPATIBILITY_VERSION,t,lNt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Ap._global[Ap.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Ap._global,Ap.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Ap._global[Ap.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new U2e.ProxyLoggerProvider}};Q6.LogsAPI=RX});var xX=M(la=>{"use strict";A();Object.defineProperty(la,"__esModule",{value:!0});la.logs=la.ProxyLoggerProvider=la.ProxyLogger=la.NoopLoggerProvider=la.NOOP_LOGGER_PROVIDER=la.NoopLogger=la.NOOP_LOGGER=la.SeverityNumber=void 0;var dNt=k2e();Object.defineProperty(la,"SeverityNumber",{enumerable:!0,get:function(){return dNt.SeverityNumber}});var F2e=w6();Object.defineProperty(la,"NOOP_LOGGER",{enumerable:!0,get:function(){return F2e.NOOP_LOGGER}});Object.defineProperty(la,"NoopLogger",{enumerable:!0,get:function(){return F2e.NoopLogger}});var G2e=k6();Object.defineProperty(la,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return G2e.NOOP_LOGGER_PROVIDER}});Object.defineProperty(la,"NoopLoggerProvider",{enumerable:!0,get:function(){return G2e.NoopLoggerProvider}});var pNt=IX();Object.defineProperty(la,"ProxyLogger",{enumerable:!0,get:function(){return pNt.ProxyLogger}});var fNt=vX();Object.defineProperty(la,"ProxyLoggerProvider",{enumerable:!0,get:function(){return fNt.ProxyLoggerProvider}});var mNt=Q2e();la.logs=mNt.LogsAPI.getInstance()});var j2e=M(MR=>{"use strict";A();Object.defineProperty(MR,"__esModule",{value:!0});MR.disableInstrumentations=MR.enableInstrumentations=void 0;function ANt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}MR.enableInstrumentations=ANt;function gNt(e){e.forEach(t=>t.disable())}MR.disableInstrumentations=gNt});var $2e=M(F6=>{"use strict";A();Object.defineProperty(F6,"__esModule",{value:!0});F6.registerInstrumentations=void 0;var z2e=(He(),Me(tt)),hNt=xX(),H2e=j2e();function _Nt(e){let t=e.tracerProvider||z2e.trace.getTracerProvider(),n=e.meterProvider||z2e.metrics.getMeterProvider(),r=e.loggerProvider||hNt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,H2e.enableInstrumentations)(o,t,n,r),()=>{(0,H2e.disableInstrumentations)(o)}}F6.registerInstrumentations=_Nt});var eLe=M(G6=>{"use strict";A();Object.defineProperty(G6,"__esModule",{value:!0});G6.satisfies=void 0;var BX=(He(),Me(tt)),J2e=/^(?: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-]+)*))?$/,ENt=/^(?<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-]+)*))?$/,yNt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function SNt(e,t,n){if(!TNt(e))return BX.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=vNt(e);if(!r)return!1;let o=[],i=Z2e(r,t,o,n);return i&&!n?.includePrerelease?INt(r,o):i}G6.satisfies=SNt;function TNt(e){return typeof e=="string"&&J2e.test(e)}function Z2e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(DX(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=VNt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!DX(e,i,n,r))return!1;return!0}return DX(e,t,n,r)}function DX(e,t,n,r){if(t=CNt(t,r),t.includes(" "))return Z2e(e,t,n,r);{let o=RNt(t);return n.push(o),bNt(e,o)}}function bNt(e,t){if(t.invalid)return!1;if(!t.version||wX(t.version))return!0;let n=V2e(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=V2e(r,o)}return yNt[t.op]?.includes(n)}function INt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function CNt(e,t){return e=e.trim(),e=$Nt(e,t),e=HNt(e),e=qNt(e,t),e=e.trim(),e}function nc(e){return!e||e.toLowerCase()==="x"||e==="*"}function vNt(e){let t=e.match(J2e);if(!t){BX.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function RNt(e){if(!e)return{};let t=e.match(ENt);if(!t)return BX.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function wX(e){return e==="*"||e==="x"||e==="X"}function q2e(e){let t=parseInt(e,10);return isNaN(t)?e:t}function xNt(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 DNt(e,t){if(wX(e)||wX(t))return 0;let[n,r]=xNt(q2e(e),q2e(t));return n>r?1:n<r?-1:0}function V2e(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=DNt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var W2e="[a-zA-Z0-9-]",X2e="0|[1-9]\\d*",NNt=`\\d*[a-zA-Z-]${W2e}*`,wNt="((?:<|>)?=?)",Y2e=`(?:${X2e}|${NNt})`,BNt=`(?:-(${Y2e}(?:\\.${Y2e})*))`,K2e=`${W2e}+`,kNt=`(?:\\+(${K2e}(?:\\.${K2e})*))`,NX=`${X2e}|x|X|\\*`,vk=`[v=\\s]*(${NX})(?:\\.(${NX})(?:\\.(${NX})(?:${BNt})?${kNt}?)?)?`,ONt=`^${wNt}\\s*${vk}$`,PNt=new RegExp(ONt),MNt=`^\\s*(${vk})\\s+-\\s+(${vk})\\s*$`,LNt=new RegExp(MNt),UNt="(?:~>?)",QNt=`^${UNt}${vk}$`,FNt=new RegExp(QNt),GNt="(?:\\^)",jNt=`^${GNt}${vk}$`,zNt=new RegExp(jNt);function HNt(e){let t=FNt;return e.replace(t,(n,r,o,i,s)=>{let u;return nc(r)?u="":nc(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:nc(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function $Nt(e,t){let n=zNt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return nc(i)?f="":nc(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:nc(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function qNt(e,t){let n=PNt;return e.replace(n,(r,o,i,s,u,l)=>{let f=nc(i),h=f||nc(s),_=h||nc(u),E=_;return o==="="&&E&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&E?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function VNt(e,t){let n=LNt;return e.replace(n,(r,o,i,s,u,l,f,h,_,E,T,v)=>(nc(i)?o="":nc(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:nc(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,nc(_)?h="":nc(E)?h=`<${+_+1}.0.0-0`:nc(T)?h=`<${_}.${+E+1}.0-0`:v?h=`<=${_}.${E}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${E}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var kX=M(Fa=>{"use strict";A();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.massUnwrap=Fa.unwrap=Fa.massWrap=Fa.wrap=void 0;var rc=console.error.bind(console);function Rk(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 YNt=(e,t,n)=>{if(!e||!e[t]){rc("no original function "+String(t)+" to wrap");return}if(!n){rc("no wrapper function"),rc(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){rc("original object and wrapper must be functions");return}let o=n(r,t);return Rk(o,"__original",r),Rk(o,"__unwrap",()=>{e[t]===o&&Rk(e,t,r)}),Rk(o,"__wrapped",!0),Rk(e,t,o),o};Fa.wrap=YNt;var KNt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Fa.wrap)(r,o,n)})})};Fa.massWrap=KNt;var JNt=(e,t)=>{if(!e||!e[t]){rc("no function to unwrap."),rc(new Error().stack);return}let n=e[t];if(!n.__unwrap)rc("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Fa.unwrap=JNt;var ZNt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Fa.unwrap)(n,r)})})};Fa.massUnwrap=ZNt;function xk(e){e&&e.logger&&(typeof e.logger!="function"?rc("new logger isn't a function, not replacing"):rc=e.logger)}Fa.default=xk;xk.wrap=Fa.wrap;xk.massWrap=Fa.massWrap;xk.unwrap=Fa.unwrap;xk.massUnwrap=Fa.massUnwrap});var tLe=M(z6=>{"use strict";A();Object.defineProperty(z6,"__esModule",{value:!0});z6.InstrumentationAbstract=void 0;var OX=(He(),Me(tt)),WNt=xX(),j6=kX(),PX=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=OX.diag.createComponentLogger({namespace:t}),this._tracer=OX.trace.getTracer(t,n),this._meter=OX.metrics.getMeter(t,n),this._logger=WNt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=j6.wrap;_unwrap=j6.unwrap;_massWrap=j6.massWrap;_massUnwrap=j6.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)}}};z6.InstrumentationAbstract=PX});var nLe=M(RE=>{"use strict";A();Object.defineProperty(RE,"__esModule",{value:!0});RE.ModuleNameTrie=RE.ModuleNameSeparator=void 0;RE.ModuleNameSeparator="/";var H6=class{hooks=[];children=new Map},MX=class{_trie=new H6;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(RE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new H6,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=[],s=!0;for(let u of t.split(RE.ModuleNameSeparator)){let l=o.children.get(u);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};RE.ModuleNameTrie=MX});var oLe=M($6=>{"use strict";A();Object.defineProperty($6,"__esModule",{value:!0});$6.RequireInTheMiddleSingleton=void 0;var XNt=yS(),rLe=Ue("path"),LX=nLe(),ewt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),UX=class e{_moduleNameTrie=new LX.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new XNt.Hook(null,{internals:!0},(t,n,r)=>{let o=twt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return ewt?new e:this._instance=this._instance??new e}};$6.RequireInTheMiddleSingleton=UX;function twt(e){return rLe.sep!==LX.ModuleNameSeparator?e.split(rLe.sep).join(LX.ModuleNameSeparator):e}});var QX=M(xE=>{"use strict";A();Object.defineProperty(xE,"__esModule",{value:!0});xE.isWrapped=xE.safeExecuteInTheMiddleAsync=xE.safeExecuteInTheMiddle=void 0;function nwt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}xE.safeExecuteInTheMiddle=nwt;async function rwt(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}}xE.safeExecuteInTheMiddleAsync=rwt;function owt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}xE.isWrapped=owt});var aLe=M(q6=>{"use strict";A();Object.defineProperty(q6,"__esModule",{value:!0});q6.InstrumentationBase=void 0;var Dk=Ue("path"),iLe=Ue("util"),iwt=eLe(),FX=kX(),swt=tLe(),awt=oLe(),uwt=yW(),Nk=(He(),Me(tt)),cwt=yS(),lwt=Ue("fs"),dwt=QX(),GX=class extends swt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=awt.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,dwt.isWrapped)(t[n])&&this._unwrap(t,n),iLe.types.isProxy(t)){let o=(0,FX.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,FX.wrap)(t,n,r)};_unwrap=(t,n)=>iLe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,FX.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{Nk.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Nk.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{Nk.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Nk.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=Ue.resolve(n);Ue.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,lwt.readFileSync)(Dk.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{Nk.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 sLe(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 s=t.files??[],u=Dk.normalize(r);return s.filter(f=>f.name===u).filter(f=>sLe(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,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(f,t.moduleVersion)):f),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=(s,u,l)=>{if(!l&&Dk.isAbsolute(u)){let f=Dk.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=Dk.isAbsolute(t.name)?new cwt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new uwt.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}};q6.InstrumentationBase=GX;function sLe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,iwt.satisfies)(t,r,{includePrerelease:n}))}});var uLe=M(V6=>{"use strict";A();Object.defineProperty(V6,"__esModule",{value:!0});V6.normalize=void 0;var pwt=Ue("path");Object.defineProperty(V6,"normalize",{enumerable:!0,get:function(){return pwt.normalize}})});var cLe=M(LR=>{"use strict";A();Object.defineProperty(LR,"__esModule",{value:!0});LR.normalize=LR.InstrumentationBase=void 0;var fwt=aLe();Object.defineProperty(LR,"InstrumentationBase",{enumerable:!0,get:function(){return fwt.InstrumentationBase}});var mwt=uLe();Object.defineProperty(LR,"normalize",{enumerable:!0,get:function(){return mwt.normalize}})});var jX=M(UR=>{"use strict";A();Object.defineProperty(UR,"__esModule",{value:!0});UR.normalize=UR.InstrumentationBase=void 0;var lLe=cLe();Object.defineProperty(UR,"InstrumentationBase",{enumerable:!0,get:function(){return lLe.InstrumentationBase}});Object.defineProperty(UR,"normalize",{enumerable:!0,get:function(){return lLe.normalize}})});var dLe=M(Y6=>{"use strict";A();Object.defineProperty(Y6,"__esModule",{value:!0});Y6.InstrumentationNodeModuleDefinition=void 0;var zX=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||[]}};Y6.InstrumentationNodeModuleDefinition=zX});var pLe=M(K6=>{"use strict";A();Object.defineProperty(K6,"__esModule",{value:!0});K6.InstrumentationNodeModuleFile=void 0;var Awt=jX(),HX=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,Awt.normalize)(t)}};K6.InstrumentationNodeModuleFile=HX});var fLe=M(sT=>{"use strict";A();Object.defineProperty(sT,"__esModule",{value:!0});sT.semconvStabilityFromStr=sT.SemconvStability=void 0;var J6;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(J6=sT.SemconvStability||(sT.SemconvStability={}));function gwt(e,t){let n=J6.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=J6.DUPLICATE;break}else o.toLowerCase()===e&&(n=J6.STABLE);return n}sT.semconvStabilityFromStr=gwt});var ALe=M(ds=>{"use strict";A();Object.defineProperty(ds,"__esModule",{value:!0});ds.semconvStabilityFromStr=ds.SemconvStability=ds.safeExecuteInTheMiddleAsync=ds.safeExecuteInTheMiddle=ds.isWrapped=ds.InstrumentationNodeModuleFile=ds.InstrumentationNodeModuleDefinition=ds.InstrumentationBase=ds.registerInstrumentations=void 0;var hwt=$2e();Object.defineProperty(ds,"registerInstrumentations",{enumerable:!0,get:function(){return hwt.registerInstrumentations}});var _wt=jX();Object.defineProperty(ds,"InstrumentationBase",{enumerable:!0,get:function(){return _wt.InstrumentationBase}});var Ewt=dLe();Object.defineProperty(ds,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return Ewt.InstrumentationNodeModuleDefinition}});var ywt=pLe();Object.defineProperty(ds,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return ywt.InstrumentationNodeModuleFile}});var $X=QX();Object.defineProperty(ds,"isWrapped",{enumerable:!0,get:function(){return $X.isWrapped}});Object.defineProperty(ds,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return $X.safeExecuteInTheMiddle}});Object.defineProperty(ds,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return $X.safeExecuteInTheMiddleAsync}});var mLe=fLe();Object.defineProperty(ds,"SemconvStability",{enumerable:!0,get:function(){return mLe.SemconvStability}});Object.defineProperty(ds,"semconvStabilityFromStr",{enumerable:!0,get:function(){return mLe.semconvStabilityFromStr}})});function bwt(){let e=QR[VX];return e?.helper?e.helper:QR[qX]?.helper}function Iwt(e){let t={helper:e};QR[VX]=t,QR[qX]=t}function Cwt(){delete QR[VX],delete QR[qX]}function xwt(e){return e==="client"?mo.CLIENT:mo.INTERNAL}function _Le(e,t,n,r,o){if(ELe(t.name,o))return;let i={attributes:t.attributes,kind:xwt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,s=>{r.set(t.id,s.spanContext().spanId),t.links&&s.addLinks(t.links.flatMap(l=>{let f=r.get(l);return f?{context:{spanId:f,traceId:s.spanContext().traceId,traceFlags:s.spanContext().traceFlags}}:[]}));let u=n.filter(l=>l.parentId===t.id);for(let l of u)_Le(e,l,n,r,o);s.end(t.endTime)})}function gLe(e,t){return Nwt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function Nwt(e){return e!=null&&typeof e.then=="function"}function ELe(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var Z6,Swt,Twt,qX,VX,QR,vwt,Rwt,Dwt,yLe,hLe,wwt,Bwt,SLe,TLe=B(()=>{A();He();Z6=ue(ALe(),1);He();Swt={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"}},Twt=Swt.version.split(".")[0],qX="PRISMA_INSTRUMENTATION",VX=`V${Twt}_PRISMA_INSTRUMENTATION`,QR=globalThis;vwt=process.env.PRISMA_SHOW_ALL_TRACES==="true",Rwt="00-10-10-00";Dwt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=Jt.getSpanContext(e??We.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:Rwt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)_Le(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return We.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!vwt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(ELe(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return gLe(i,t(i,r))}return n.startActiveSpan(o,e,i=>gLe(i,t(i,r)))}};yLe={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},hLe=yLe.version,wwt=yLe.name,Bwt="@prisma/client",SLe=class extends Z6.InstrumentationBase{tracerProvider;constructor(e={}){super(wwt,hLe,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new Z6.InstrumentationNodeModuleDefinition(Bwt,[hLe])]}enable(){let e=this._config;Iwt(new Dwt({tracerProvider:this.tracerProvider??Jt.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){Cwt()}isEnabled(){return bwt()!==void 0}}});function kwt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function ILe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function Owt(e){return e==="client"?mo.CLIENT:mo.INTERNAL}var bLe,YX,Pwt,CLe,vLe=B(()=>{A();He();TLe();mt();_r();bLe="Prisma";YX=class extends SLe{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=ILe();kwt(t)&&(t.createEngineSpan=n=>{let r=Jt.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){ei(()=>{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 s=Owt(i.kind),u=i.parent_span_id,l=i.span_id,f=i.trace_id,h=i.links?.map(E=>({context:{traceId:E.trace_id,spanId:E.span_id,traceFlags:ou.SAMPLED}})),_=Jt.setSpanContext(We.active(),{traceId:f,spanId:u,traceFlags:ou.SAMPLED});We.with(_,()=>{let E={generateTraceId:()=>f,generateSpanId:()=>l};r._idGenerator=E,r.startSpan(i.name,{kind:s,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};Pwt=ct(bLe,e=>new YX(e)),CLe=e=>({name:bLe,setupOnce(){Pwt(e)},setup(t){ILe()&&t.on("spanStart",n=>{let r=Pt(n);r.description?.startsWith("prisma:")&&n.setAttribute(Lt,"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 RLe=M(FR=>{"use strict";A();Object.defineProperty(FR,"__esModule",{value:!0});FR.PACKAGE_NAME=FR.PACKAGE_VERSION=void 0;FR.PACKAGE_VERSION="0.60.0";FR.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var KX=M(rA=>{"use strict";A();Object.defineProperty(rA,"__esModule",{value:!0});rA.HapiLifecycleMethodNames=rA.HapiLayerType=rA.handlerPatched=rA.HapiComponentName=void 0;rA.HapiComponentName="@hapi/hapi";rA.handlerPatched=Symbol("hapi-handler-patched");rA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};rA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var xLe=M(W6=>{"use strict";A();Object.defineProperty(W6,"__esModule",{value:!0});W6.ATTR_HTTP_METHOD=void 0;W6.ATTR_HTTP_METHOD="http.method"});var JX=M(wk=>{"use strict";A();Object.defineProperty(wk,"__esModule",{value:!0});wk.AttributeNames=void 0;var Mwt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(Mwt=wk.AttributeNames||(wk.AttributeNames={}))});var wLe=M(ps=>{"use strict";A();Object.defineProperty(ps,"__esModule",{value:!0});ps.getPluginFromInput=ps.getExtMetadata=ps.getRouteMetadata=ps.isPatchableExtMethod=ps.isDirectExtInput=ps.isLifecycleExtEventObj=ps.isLifecycleExtType=ps.getPluginName=void 0;var DLe=(Xn(),Me(qr)),Lwt=xLe(),Bk=KX(),DE=JX(),NLe=cn();function Uwt(e){return e.name?e.name:e.pkg.name}ps.getPluginName=Uwt;var Qwt=e=>typeof e=="string"&&Bk.HapiLifecycleMethodNames.has(e);ps.isLifecycleExtType=Qwt;var Fwt=e=>{let t=e?.type;return t!==void 0&&(0,ps.isLifecycleExtType)(t)};ps.isLifecycleExtEventObj=Fwt;var Gwt=e=>Array.isArray(e)&&e.length<=3&&(0,ps.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ps.isDirectExtInput=Gwt;var jwt=e=>!Array.isArray(e);ps.isPatchableExtMethod=jwt;var zwt=(e,t,n)=>{let r={[DLe.ATTR_HTTP_ROUTE]:e.path};t&NLe.SemconvStability.OLD&&(r[Lwt.ATTR_HTTP_METHOD]=e.method),t&NLe.SemconvStability.STABLE&&(r[DLe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[DE.AttributeNames.HAPI_TYPE]=Bk.HapiLayerType.PLUGIN,r[DE.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[DE.AttributeNames.HAPI_TYPE]=Bk.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ps.getRouteMetadata=zwt;var Hwt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:Bk.HapiLayerType.EXT,[DE.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:Bk.HapiLayerType.EXT},name:r}};ps.getExtMetadata=Hwt;var $wt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ps.getPluginFromInput=$wt});var OLe=M(X6=>{"use strict";A();Object.defineProperty(X6,"__esModule",{value:!0});X6.HapiInstrumentation=void 0;var od=(He(),Me(tt)),BLe=Rr(),kk=cn(),kLe=RLe(),Ok=KX(),Xg=wLe(),ZX=class extends kk.InstrumentationBase{_semconvStability;constructor(t={}){super(kLe.PACKAGE_NAME,kLe.PACKAGE_VERSION,t),this._semconvStability=(0,kk.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new kk.InstrumentationNodeModuleDefinition(Ok.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,kk.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,kk.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 s=t.apply(this,[i]);return r._wrap(s,"route",u=>n._getServerRoutePatch.bind(n)(u)),r._wrap(s,"ext",u=>n._getServerExtPatch.bind(n)(u)),r._wrap(s,"register",n._getServerRegisterPatch.bind(n)),s}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let s of o){let u=(0,Xg.getPluginFromInput)(s);n._wrapRegisterHandler(u)}else{let s=(0,Xg.getPluginFromInput)(o);n._wrapRegisterHandler(s)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let s=i[0];for(let u=0;u<s.length;u++){let l=s[u];if((0,Xg.isLifecycleExtType)(l.type)){let f=l,h=r._wrapExtMethods(f.method,l.type,n);f.method=h,s[u]=f}}return t.apply(this,i)}else if((0,Xg.isDirectExtInput)(i)){let s=i,u=s[1],l=r._wrapExtMethods(u,s[0],n);return t.apply(this,[s[0],l,s[2]])}else if((0,Xg.isLifecycleExtEventObj)(i[0])){let s=i[0],u=r._wrapExtMethods(s.method,s.type,n);return s.method=u,t.call(this,s)}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 s=r._wrapRouteHandler.call(r,o[i],n);o[i]=s}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,Xg.getPluginName)(t),o=t.register,i=this,s=function(u,l){return i._wrap(u,"route",f=>n._getServerRoutePatch.bind(n)(f,r)),i._wrap(u,"ext",f=>n._getServerExtPatch.bind(n)(f,r)),o.call(this,u,l)};t.register=s}_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,Xg.isPatchableExtMethod)(t))return t[Ok.handlerPatched]===!0?t:(t[Ok.handlerPatched]=!0,async function(...s){if(od.trace.getSpan(od.context.active())===void 0)return await t.apply(this,s);let u=(0,Xg.getExtMetadata)(n,r,t.name),l=o.tracer.startSpan(u.name,{attributes:u.attributes});try{return await od.context.with(od.trace.setSpan(od.context.active(),l),t,void 0,...s)}catch(f){throw l.recordException(f),l.setStatus({code:od.SpanStatusCode.ERROR,message:f.message}),f}finally{l.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[Ok.handlerPatched]===!0)return t;t[Ok.handlerPatched]=!0;let o=i=>async function(...s){if(od.trace.getSpan(od.context.active())===void 0)return await i.call(this,...s);let u=(0,BLe.getRPCMetadata)(od.context.active());u?.type===BLe.RPCType.HTTP&&(u.route=t.path);let l=(0,Xg.getRouteMetadata)(t,r._semconvStability,n),f=r.tracer.startSpan(l.name,{attributes:l.attributes});try{return await od.context.with(od.trace.setSpan(od.context.active(),f),()=>i.call(this,...s))}catch(h){throw f.recordException(h),f.setStatus({code:od.SpanStatusCode.ERROR,message:h.message}),h}finally{f.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(s){let u=i(s);return typeof u.handler=="function"&&(u.handler=o(u.handler)),u}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};X6.HapiInstrumentation=ZX});var PLe=M(GR=>{"use strict";A();Object.defineProperty(GR,"__esModule",{value:!0});GR.AttributeNames=GR.HapiInstrumentation=void 0;var qwt=OLe();Object.defineProperty(GR,"HapiInstrumentation",{enumerable:!0,get:function(){return qwt.HapiInstrumentation}});var Vwt=JX();Object.defineProperty(GR,"AttributeNames",{enumerable:!0,get:function(){return Vwt.AttributeNames}})});var MLe,LLe,ULe,Ywt,QLe,FLe=B(()=>{A();MLe=ue(PLe(),1);_r();LLe="Hapi",ULe=ct(LLe,()=>new MLe.HapiInstrumentation),Ywt=(()=>({name:LLe,setupOnce(){ULe()}})),QLe=Ywt});var NE,Pk,WX=B(()=>{A();NE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Pk={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var tG,Kwt,Jwt,eG,GLe=B(()=>{A();He();tG=ue(cn(),1);mt();WX();Kwt="@sentry/instrumentation-hono",Jwt="0.0.1",eG=class extends tG.InstrumentationBase{constructor(t={}){super(Kwt,Jwt,t)}init(){return[new tG.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 s=o.slice(1);return n.apply(this,[i,...s.map(u=>t._wrapHandler(u))])}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(s=>t._wrapHandler(s))])}}}_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 s=o.slice(1);return n.apply(this,[i,...s.map(u=>t._wrapHandler(u))])}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,s=n.tracer.startSpan(i);return We.with(Jt.setSpan(We.active(),s),()=>n._safeExecute(()=>{let u=t.apply(this,[r,o]);if(wa(u))return u.then(l=>{let f=n._determineHandlerType(l);return s.setAttributes({[NE.HONO_TYPE]:f,[NE.HONO_NAME]:f===Pk.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),l});{let l=n._determineHandlerType(u);return s.setAttributes({[NE.HONO_TYPE]:l,[NE.HONO_NAME]:l===Pk.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),u}},()=>s.end(),u=>{n._handleError(s,u),s.end()}))}}_safeExecute(t,n,r){try{let o=t();return wa(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?Pk.MIDDLEWARE:Pk.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:gi.ERROR,message:n.message}),t.recordException(n))}}});function Zwt(e){let t=Pt(e).data,n=t[NE.HONO_TYPE];if(t[rn]||!n)return;e.setAttributes({[Lt]:"auto.http.otel.hono",[rn]:`${n}.hono`});let r=t[NE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),xn()===ep()){ws&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[vg],i=t[AS];typeof o=="string"&&typeof i=="string"&&xn().setTransactionName(`${i} ${o}`)}var jLe,zLe,Wwt,HLe,$Le=B(()=>{A();Xn();mt();_r();KS();WX();GLe();jLe="Hono";zLe=ct(jLe,()=>new eG({responseHook:e=>{Zwt(e)}})),Wwt=(()=>({name:jLe,setupOnce(){zLe()}})),HLe=Wwt});var nG=M(Mk=>{"use strict";A();Object.defineProperty(Mk,"__esModule",{value:!0});Mk.KoaLayerType=void 0;var Xwt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(Xwt=Mk.KoaLayerType||(Mk.KoaLayerType={}))});var qLe=M(jR=>{"use strict";A();Object.defineProperty(jR,"__esModule",{value:!0});jR.PACKAGE_NAME=jR.PACKAGE_VERSION=void 0;jR.PACKAGE_VERSION="0.62.0";jR.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var XX=M(Lk=>{"use strict";A();Object.defineProperty(Lk,"__esModule",{value:!0});Lk.AttributeNames=void 0;var eBt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(eBt=Lk.AttributeNames||(Lk.AttributeNames={}))});var YLe=M(zR=>{"use strict";A();Object.defineProperty(zR,"__esModule",{value:!0});zR.isLayerIgnored=zR.getMiddlewareMetadata=void 0;var VLe=nG(),rG=XX(),tBt=(Xn(),Me(qr)),nBt=(e,t,n,r)=>n?{attributes:{[rG.AttributeNames.KOA_NAME]:r?.toString(),[rG.AttributeNames.KOA_TYPE]:VLe.KoaLayerType.ROUTER,[tBt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[rG.AttributeNames.KOA_NAME]:t.name??"middleware",[rG.AttributeNames.KOA_TYPE]:VLe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};zR.getMiddlewareMetadata=nBt;var rBt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));zR.isLayerIgnored=rBt});var KLe=M(oG=>{"use strict";A();Object.defineProperty(oG,"__esModule",{value:!0});oG.kLayerPatched=void 0;oG.kLayerPatched=Symbol("koa-layer-patched")});var tUe=M(iG=>{"use strict";A();Object.defineProperty(iG,"__esModule",{value:!0});iG.KoaInstrumentation=void 0;var oA=(He(),Me(tt)),Uk=cn(),JLe=nG(),ZLe=qLe(),WLe=YLe(),XLe=Rr(),eUe=KLe(),eee=class extends Uk.InstrumentationBase{constructor(t={}){super(ZLe.PACKAGE_NAME,ZLe.PACKAGE_VERSION,t)}init(){return new Uk.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,Uk.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,Uk.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){oA.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,s=o.stack;for(let u=0;u<s.length;u++){let l=s[u];s[u]=this._patchLayer(l,!0,i)}}return t}_patchLayer(t,n,r){let o=n?JLe.KoaLayerType.ROUTER:JLe.KoaLayerType.MIDDLEWARE;return t[eUe.kLayerPatched]===!0||(0,WLe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(oA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[eUe.kLayerPatched]=!0,oA.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(oA.trace.getSpan(oA.context.active())===void 0)return t(i,s);let l=(0,WLe.getMiddlewareMetadata)(i,t,n,r),f=this.tracer.startSpan(l.name,{attributes:l.attributes}),h=(0,XLe.getRPCMetadata)(oA.context.active());h?.type===XLe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:_}=this.getConfig();_&&(0,Uk.safeExecuteInTheMiddle)(()=>_(f,{context:i,middlewareLayer:t,layerType:o}),T=>{T&&oA.diag.error("koa instrumentation: request hook failed",T)},!0);let E=oA.trace.setSpan(oA.context.active(),f);return oA.context.with(E,async()=>{try{return await t(i,s)}catch(T){throw f.recordException(T),T}finally{f.end()}})})}};iG.KoaInstrumentation=eee});var nUe=M(wE=>{"use strict";A();Object.defineProperty(wE,"__esModule",{value:!0});wE.KoaLayerType=wE.AttributeNames=wE.KoaInstrumentation=void 0;var oBt=tUe();Object.defineProperty(wE,"KoaInstrumentation",{enumerable:!0,get:function(){return oBt.KoaInstrumentation}});var iBt=XX();Object.defineProperty(wE,"AttributeNames",{enumerable:!0,get:function(){return iBt.AttributeNames}});var sBt=nG();Object.defineProperty(wE,"KoaLayerType",{enumerable:!0,get:function(){return sBt.KoaLayerType}})});var rUe,oUe,iUe,aBt,sUe,aUe=B(()=>{A();rUe=ue(nUe(),1);Xn();mt();_r();KS();oUe="Koa",iUe=ct(oUe,rUe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){Yr(t,"auto.http.otel.koa");let r=Pt(t).data,o=r["koa.type"];o&&t.setAttribute(rn,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),xn()===ep()){ws&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=r[vg],u=n.context?.request?.method?.toUpperCase()||"GET";s&&xn().setTransactionName(`${u} ${s}`)}})),aBt=((e={})=>({name:oUe,setupOnce(){iUe(e)}})),sUe=aBt});var tee=M(wf=>{"use strict";A();Object.defineProperty(wf,"__esModule",{value:!0});wf.ConnectNames=wf.ConnectTypes=wf.AttributeNames=void 0;var uBt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(uBt=wf.AttributeNames||(wf.AttributeNames={}));var cBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(cBt=wf.ConnectTypes||(wf.ConnectTypes={}));var lBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(lBt=wf.ConnectNames||(wf.ConnectNames={}))});var uUe=M(HR=>{"use strict";A();Object.defineProperty(HR,"__esModule",{value:!0});HR.PACKAGE_NAME=HR.PACKAGE_VERSION=void 0;HR.PACKAGE_VERSION="0.57.0";HR.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var cUe=M(sG=>{"use strict";A();Object.defineProperty(sG,"__esModule",{value:!0});sG._LAYERS_STORE_PROPERTY=void 0;sG._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var lUe=M(kE=>{"use strict";A();Object.defineProperty(kE,"__esModule",{value:!0});kE.generateRoute=kE.replaceCurrentStackRoute=kE.addNewStackLayer=void 0;var dBt=(He(),Me(tt)),BE=cUe(),pBt=e=>{Array.isArray(e[BE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,BE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[BE._LAYERS_STORE_PROPERTY].push("/");let t=e[BE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[BE._LAYERS_STORE_PROPERTY].length?e[BE._LAYERS_STORE_PROPERTY].pop():dBt.diag.warn("Connect: Trying to pop the stack multiple time")}};kE.addNewStackLayer=pBt;var fBt=(e,t)=>{t&&e[BE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};kE.replaceCurrentStackRoute=fBt;var mBt=e=>e[BE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);kE.generateRoute=mBt});var fUe=M(OE=>{"use strict";A();Object.defineProperty(OE,"__esModule",{value:!0});OE.ConnectInstrumentation=OE.ANONYMOUS_NAME=void 0;var ABt=(He(),Me(tt)),dUe=Rr(),$R=tee(),pUe=uUe(),aG=cn(),gBt=(Xn(),Me(qr)),nee=lUe();OE.ANONYMOUS_NAME="anonymous";var ree=class extends aG.InstrumentationBase{constructor(t={}){super(pUe.PACKAGE_NAME,pUe.PACKAGE_VERSION,t)}init(){return[new aG.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,aG.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,aG.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=$R.ConnectTypes.REQUEST_HANDLER,i=$R.ConnectNames.REQUEST_HANDLER,o=t):(r=$R.ConnectTypes.MIDDLEWARE,i=$R.ConnectNames.MIDDLEWARE,o=n.name||OE.ANONYMOUS_NAME);let s=`${i} - ${o}`,u={attributes:{[gBt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[$R.AttributeNames.CONNECT_TYPE]:r,[$R.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(s,u)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[s,u,l]=o?[1,2,3]:[0,1,2],f=arguments[s],h=arguments[u],_=arguments[l];(0,nee.replaceCurrentStackRoute)(f,t);let E=(0,dUe.getRPCMetadata)(ABt.context.active());t&&E?.type===dUe.RPCType.HTTP&&(E.route=(0,nee.generateRoute)(f));let T="";t?T=`request handler - ${t}`:T=`middleware - ${n.name||OE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",T);let R=!1;function x(){R?r._diag.debug(`span ${v.name} - already finished`):(R=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",x)}return h.addListener("close",x),arguments[l]=r._patchNext(_,x),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],s=arguments[o],u=(0,nee.addNewStackLayer)(i);return typeof s=="function"&&(arguments[o]=n._patchOut(s,u)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};OE.ConnectInstrumentation=ree});var AUe=M(gp=>{"use strict";A();Object.defineProperty(gp,"__esModule",{value:!0});gp.ConnectTypes=gp.ConnectNames=gp.AttributeNames=gp.ANONYMOUS_NAME=gp.ConnectInstrumentation=void 0;var mUe=fUe();Object.defineProperty(gp,"ConnectInstrumentation",{enumerable:!0,get:function(){return mUe.ConnectInstrumentation}});Object.defineProperty(gp,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return mUe.ANONYMOUS_NAME}});var oee=tee();Object.defineProperty(gp,"AttributeNames",{enumerable:!0,get:function(){return oee.AttributeNames}});Object.defineProperty(gp,"ConnectNames",{enumerable:!0,get:function(){return oee.ConnectNames}});Object.defineProperty(gp,"ConnectTypes",{enumerable:!0,get:function(){return oee.ConnectTypes}})});var gUe,hUe,_Ue,hBt,EUe,yUe=B(()=>{A();gUe=ue(AUe(),1);_r();hUe="Connect",_Ue=ct(hUe,()=>new gUe.ConnectInstrumentation),hBt=(()=>({name:hUe,setupOnce(){_Ue()}})),EUe=hBt});var SUe=M(da=>{"use strict";A();Object.defineProperty(da,"__esModule",{value:!0});da.DB_SYSTEM_VALUE_MSSQL=da.ATTR_NET_PEER_PORT=da.ATTR_NET_PEER_NAME=da.ATTR_DB_USER=da.ATTR_DB_SYSTEM=da.ATTR_DB_STATEMENT=da.ATTR_DB_SQL_TABLE=da.ATTR_DB_NAME=void 0;da.ATTR_DB_NAME="db.name";da.ATTR_DB_SQL_TABLE="db.sql.table";da.ATTR_DB_STATEMENT="db.statement";da.ATTR_DB_SYSTEM="db.system";da.ATTR_DB_USER="db.user";da.ATTR_NET_PEER_NAME="net.peer.name";da.ATTR_NET_PEER_PORT="net.peer.port";da.DB_SYSTEM_VALUE_MSSQL="mssql"});var TUe=M(qR=>{"use strict";A();Object.defineProperty(qR,"__esModule",{value:!0});qR.once=qR.getSpanName=void 0;function _Bt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}qR.getSpanName=_Bt;var EBt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};qR.once=EBt});var bUe=M(VR=>{"use strict";A();Object.defineProperty(VR,"__esModule",{value:!0});VR.PACKAGE_NAME=VR.PACKAGE_VERSION=void 0;VR.PACKAGE_VERSION="0.33.0";VR.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var xUe=M(ME=>{"use strict";A();Object.defineProperty(ME,"__esModule",{value:!0});ME.TediousInstrumentation=ME.INJECTED_CTX=void 0;var YR=(He(),Me(tt)),yBt=Ue("events"),iA=cn(),aT=(Xn(),Me(qr)),PE=SUe(),IUe=TUe(),CUe=bUe(),RUe=Symbol("opentelemetry.instrumentation-tedious.current-database");ME.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var vUe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function uG(e){Object.defineProperty(this,RUe,{value:e,writable:!0})}var iee=class e extends iA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(CUe.PACKAGE_NAME,CUe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,iA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,iA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new iA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of vUe)(0,iA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,iA.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 vUe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return uG.call(this,this.config?.options?.database),this.removeListener("databaseChange",uG),this.on("databaseChange",uG),this.once("end",()=>{this.removeListener("databaseChange",uG)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||YR.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",s=new n.Request(i,l=>{o()});Object.defineProperty(s,ME.INJECTED_CTX,{value:!0});let u=Buffer.from(r,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,u,{length:u.length}),t.execSql(s)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(s){if(s?.[ME.INJECTED_CTX])return r.apply(this,arguments);if(!(s instanceof yBt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let u=0,l=0,f=()=>l++,h=()=>u++,_=this[RUe],E=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(s),T={};o._dbSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_DB_SYSTEM]=PE.DB_SYSTEM_VALUE_MSSQL,T[PE.ATTR_DB_NAME]=_,T[PE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,T[PE.ATTR_DB_STATEMENT]=E,T[PE.ATTR_DB_SQL_TABLE]=s.table),o._dbSemconvStability&iA.SemconvStability.STABLE&&(T[aT.ATTR_DB_NAMESPACE]=_,T[aT.ATTR_DB_SYSTEM_NAME]=aT.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,T[aT.ATTR_DB_QUERY_TEXT]=E,T[aT.ATTR_DB_COLLECTION_NAME]=s.table),o._netSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_NET_PEER_NAME]=this.config?.server,T[PE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&iA.SemconvStability.STABLE&&(T[aT.ATTR_SERVER_ADDRESS]=this.config?.server,T[aT.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,IUe.getSpanName)(t,_,E,s.table),{kind:YR.SpanKind.CLIENT,attributes:T}),R=(0,IUe.once)(G=>{s.removeListener("done",f),s.removeListener("doneInProc",f),s.removeListener("doneProc",h),s.removeListener("error",R),this.removeListener("end",R),v.setAttribute("tedious.procedure_count",u),v.setAttribute("tedious.statement_count",l),G&&v.setStatus({code:YR.SpanStatusCode.ERROR,message:G.message}),v.end()});s.on("done",f),s.on("doneInProc",f),s.on("doneProc",h),s.once("error",R),this.on("end",R),typeof s.callback=="function"?o._wrap(s,"callback",o._patchCallbackQuery(R)):o._diag.error("Expected request.callback to be a function");let x=()=>YR.context.with(YR.trace.setSpan(YR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return x();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(x)}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)}}};ME.TediousInstrumentation=iee});var DUe=M(cG=>{"use strict";A();Object.defineProperty(cG,"__esModule",{value:!0});cG.TediousInstrumentation=void 0;var SBt=xUe();Object.defineProperty(cG,"TediousInstrumentation",{enumerable:!0,get:function(){return SBt.TediousInstrumentation}})});var NUe,TBt,wUe,BUe,bBt,kUe,OUe=B(()=>{A();NUe=ue(DUe(),1);mt();_r();TBt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),wUe="Tedious",BUe=ct(wUe,()=>new NUe.TediousInstrumentation({})),bBt=(()=>{let e;return{name:wUe,setupOnce(){let t=BUe();e=SB(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=Pt(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";TBt.has(i)&&n.setAttribute(Lt,"auto.db.otel.tedious")}))}}}),kUe=bBt});var PUe=M(KR=>{"use strict";A();Object.defineProperty(KR,"__esModule",{value:!0});KR.PACKAGE_NAME=KR.PACKAGE_VERSION=void 0;KR.PACKAGE_VERSION="0.57.0";KR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var LUe=M(lG=>{"use strict";A();Object.defineProperty(lG,"__esModule",{value:!0});lG.GenericPoolInstrumentation=void 0;var JR=(He(),Me(tt)),uT=cn(),MUe=PUe(),see="generic-pool",aee=class extends uT.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(MUe.PACKAGE_NAME,MUe.PACKAGE_VERSION,t)}init(){return[new uT.InstrumentationNodeModuleDefinition(see,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,uT.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 uT.InstrumentationNodeModuleDefinition(see,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,uT.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 uT.InstrumentationNodeModuleDefinition(see,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,uT.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=JR.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return JR.context.with(JR.trace.setSpan(i,s),()=>t.call(this,...o).then(u=>(s.end(),u),u=>{throw s.recordException(u),s.end(),u}))}}_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 s=JR.context.active(),u=n.tracer.startSpan("generic-pool.acquire",{},s);return JR.context.with(JR.trace.setSpan(s,u),()=>{t.call(this,(l,f)=>{if(u.end(),o)return o(l,f)},i)})}}};lG.GenericPoolInstrumentation=aee});var UUe=M(dG=>{"use strict";A();Object.defineProperty(dG,"__esModule",{value:!0});dG.GenericPoolInstrumentation=void 0;var IBt=LUe();Object.defineProperty(dG,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return IBt.GenericPoolInstrumentation}})});var QUe,FUe,GUe,CBt,jUe,zUe=B(()=>{A();QUe=ue(UUe(),1);mt();_r();FUe="GenericPool",GUe=ct(FUe,()=>new QUe.GenericPoolInstrumentation({})),CBt=(()=>{let e;return{name:FUe,setupOnce(){let t=GUe();e=SB(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=Pt(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Lt,"auto.db.otel.generic_pool")}))}}}),jUe=CBt});var uee=M(sA=>{"use strict";A();Object.defineProperty(sA,"__esModule",{value:!0});sA.ATTR_NET_PEER_PORT=sA.ATTR_NET_PEER_NAME=sA.ATTR_MESSAGING_SYSTEM=sA.ATTR_MESSAGING_OPERATION=void 0;sA.ATTR_MESSAGING_OPERATION="messaging.operation";sA.ATTR_MESSAGING_SYSTEM="messaging.system";sA.ATTR_NET_PEER_NAME="net.peer.name";sA.ATTR_NET_PEER_PORT="net.peer.port"});var cee=M(Si=>{"use strict";A();Object.defineProperty(Si,"__esModule",{value:!0});Si.ATTR_MESSAGING_CONVERSATION_ID=Si.OLD_ATTR_MESSAGING_MESSAGE_ID=Si.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=Si.ATTR_MESSAGING_URL=Si.ATTR_MESSAGING_PROTOCOL_VERSION=Si.ATTR_MESSAGING_PROTOCOL=Si.MESSAGING_OPERATION_VALUE_PROCESS=Si.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=Si.ATTR_MESSAGING_DESTINATION_KIND=Si.ATTR_MESSAGING_DESTINATION=void 0;Si.ATTR_MESSAGING_DESTINATION="messaging.destination";Si.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";Si.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";Si.MESSAGING_OPERATION_VALUE_PROCESS="process";Si.ATTR_MESSAGING_PROTOCOL="messaging.protocol";Si.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";Si.ATTR_MESSAGING_URL="messaging.url";Si.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";Si.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";Si.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var lee=M(cT=>{"use strict";A();Object.defineProperty(cT,"__esModule",{value:!0});cT.DEFAULT_CONFIG=cT.EndOperation=void 0;var vBt;(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"})(vBt=cT.EndOperation||(cT.EndOperation={}));cT.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var VUe=M(Ti=>{"use strict";A();Object.defineProperty(Ti,"__esModule",{value:!0});Ti.isConfirmChannelTracing=Ti.unmarkConfirmChannelTracing=Ti.markConfirmChannelTracing=Ti.getConnectionAttributesFromUrl=Ti.getConnectionAttributesFromServer=Ti.normalizeExchange=Ti.CONNECTION_ATTRIBUTES=Ti.CHANNEL_CONSUME_TIMEOUT_TIMER=Ti.CHANNEL_SPANS_NOT_ENDED=Ti.MESSAGE_STORED_SPAN=void 0;var dee=(He(),Me(tt)),LE=cn(),pG=(Xn(),Me(qr)),Qk=uee(),fG=cee();Ti.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Ti.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Ti.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Ti.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var pee=(0,dee.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),RBt=e=>e!==""?e:"<default>";Ti.normalizeExchange=RBt;var xBt=e=>e.replace(/:[^:@/]*@/,":***@"),HUe=(e,t)=>e||(t==="AMQP"?5672:5671),$Ue=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},qUe=e=>e||"localhost",aA=(e,t,n,r)=>n?{[t]:n}:(dee.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),DBt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[Qk.ATTR_MESSAGING_SYSTEM]:t}:{}};Ti.getConnectionAttributesFromServer=DBt;var NBt=(e,t)=>{let n={[fG.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=$Ue(r?.protocol);Object.assign(n,{...aA(e,fG.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=qUe(r?.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(e,Qk.ATTR_NET_PEER_NAME,i,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(e,pG.ATTR_SERVER_ADDRESS,i,"hostname")});let s=HUe(r.port,o);t&LE.SemconvStability.OLD&&Object.assign(n,aA(e,Qk.ATTR_NET_PEER_PORT,s,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(e,pG.ATTR_SERVER_PORT,s,"port"))}else{let r=xBt(e);n[fG.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=$Ue(o.protocol);Object.assign(n,{...aA(r,fG.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=qUe(o.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(r,Qk.ATTR_NET_PEER_NAME,s,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(r,pG.ATTR_SERVER_ADDRESS,s,"hostname")});let u=HUe(o.port?parseInt(o.port):void 0,i);t&LE.SemconvStability.OLD&&Object.assign(n,aA(r,Qk.ATTR_NET_PEER_PORT,u,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(r,pG.ATTR_SERVER_PORT,u,"port"))}catch(o){dee.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Ti.getConnectionAttributesFromUrl=NBt;var wBt=e=>e.setValue(pee,!0);Ti.markConfirmChannelTracing=wBt;var BBt=e=>e.deleteValue(pee);Ti.unmarkConfirmChannelTracing=BBt;var kBt=e=>e.getValue(pee)===!0;Ti.isConfirmChannelTracing=kBt});var YUe=M(ZR=>{"use strict";A();Object.defineProperty(ZR,"__esModule",{value:!0});ZR.PACKAGE_NAME=ZR.PACKAGE_VERSION=void 0;ZR.PACKAGE_VERSION="0.61.0";ZR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var JUe=M(gG=>{"use strict";A();Object.defineProperty(gG,"__esModule",{value:!0});gG.AmqplibInstrumentation=void 0;var oi=(He(),Me(tt)),mG=Rr(),Dr=cn(),OBt=uee(),id=cee(),oc=lee(),bi=VUe(),KUe=YUe(),AG=[">=0.5.5 <1"],fee=class extends Dr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(KUe.PACKAGE_NAME,KUe.PACKAGE_VERSION,{...oc.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Dr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...oc.DEFAULT_CONFIG,...t})}init(){let t=new Dr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",AG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Dr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",AG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Dr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",AG,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new Dr.InstrumentationNodeModuleDefinition("amqplib",AG,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,Dr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,Dr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,Dr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,Dr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,Dr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,oc.EndOperation.Ack)),(0,Dr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,oc.EndOperation.Nack)),(0,Dr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,oc.EndOperation.Reject)),(0,Dr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,oc.EndOperation.AckAll)),(0,Dr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,oc.EndOperation.NackAll)),(0,Dr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,Dr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,Dr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,Dr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,Dr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,Dr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,Dr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,Dr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,Dr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,Dr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,Dr.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,s){return t.call(this,o,i,function(u,l){if(u==null){let f=(0,bi.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,bi.getConnectionAttributesFromServer)(l);l[bi.CONNECTION_ATTRIBUTES]={...f,...h}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelClosed,void 0);let i=this[bi.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[bi.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(s){return o.endAllSpansOnChannel(this,t,n,s),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(s,u,l){let f=this,h=n===oc.EndOperation.Reject?u:l,_=f[bi.CHANNEL_SPANS_NOT_ENDED]??[],E=_.findIndex(T=>T.msg===s);if(E<0)o.endConsumerSpan(s,t,n,h);else if(n!==oc.EndOperation.Reject&&u){for(let T=0;T<=E;T++)o.endConsumerSpan(_[T].msg,t,n,h);_.splice(0,E+1)}else o.endConsumerSpan(s,t,n,h),_.splice(E,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,s,u){let l=this;if(!Object.prototype.hasOwnProperty.call(l,bi.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let _=setInterval(()=>{r.checkConsumeTimeoutOnChannel(l)},h);_.unref(),l[bi.CHANNEL_CONSUME_TIMEOUT_TIMER]=_}l[bi.CHANNEL_SPANS_NOT_ENDED]=[]}let f=function(h){if(!h)return s.call(this,h);let _=h.properties.headers??{},E=oi.propagation.extract(oi.ROOT_CONTEXT,_),T=h.fields?.exchange,v;if(r._config.useLinksForConsume){let P=E?oi.trace.getSpan(E)?.spanContext():void 0;E=void 0,P&&(v=[{context:P}])}let R=r.tracer.startSpan(`${i} process`,{kind:oi.SpanKind.CONSUMER,attributes:{...l?.connection?.[bi.CONNECTION_ATTRIBUTES],[id.ATTR_MESSAGING_DESTINATION]:T,[id.ATTR_MESSAGING_DESTINATION_KIND]:id.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[id.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[OBt.ATTR_MESSAGING_OPERATION]:id.MESSAGING_OPERATION_VALUE_PROCESS,[id.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[id.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},E),{consumeHook:x}=r.getConfig();x&&(0,Dr.safeExecuteInTheMiddle)(()=>x(R,{moduleVersion:t,msg:h}),P=>{P&&oi.diag.error("amqplib instrumentation: consumerHook error",P)},!0),u?.noAck||(l[bi.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,mG.hrTime)()}),h[bi.MESSAGE_STORED_SPAN]=R);let k=E||oi.ROOT_CONTEXT;oi.context.with(oi.trace.setSpan(k,R),()=>{s.call(this,h)}),u?.noAck&&(r.callConsumeEndHook(R,h,!1,oc.EndOperation.AutoAck),R.end())};return arguments[1]=f,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,s,u,l,f){let h=this,{span:_,modifiedOptions:E}=r.createPublishSpan(r,i,s,h,l),{publishHook:T}=r.getConfig();T&&(0,Dr.safeExecuteInTheMiddle)(()=>T(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:E,isConfirmChannel:!0}),k=>{k&&oi.diag.error("amqplib instrumentation: publishHook error",k)},!0);let v=function(k,P){try{f?.call(this,k,P)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,Dr.safeExecuteInTheMiddle)(()=>j(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:l,isConfirmChannel:!0,confirmError:k}),G=>{G&&oi.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),k&&_.setStatus({code:oi.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),_.end()}},R=(0,bi.markConfirmChannelTracing)(oi.context.active()),x=[...arguments];return x[3]=E,x[4]=oi.context.bind((0,bi.unmarkConfirmChannelTracing)(oi.trace.setSpan(R,_)),v),oi.context.with(R,n.bind(this,...x))}}getPublishPatch(t,n){let r=this;return function(i,s,u,l){if((0,bi.isConfirmChannelTracing)(oi.context.active()))return n.apply(this,arguments);{let f=this,{span:h,modifiedOptions:_}=r.createPublishSpan(r,i,s,f,l),{publishHook:E}=r.getConfig();E&&(0,Dr.safeExecuteInTheMiddle)(()=>E(h,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:_,isConfirmChannel:!1}),R=>{R&&oi.diag.error("amqplib instrumentation: publishHook error",R)},!0);let T=[...arguments];T[3]=_;let v=n.apply(this,T);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let s=(0,bi.normalizeExchange)(n),u=t.tracer.startSpan(`publish ${s}`,{kind:oi.SpanKind.PRODUCER,attributes:{...o.connection[bi.CONNECTION_ATTRIBUTES],[id.ATTR_MESSAGING_DESTINATION]:n,[id.ATTR_MESSAGING_DESTINATION_KIND]:id.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[id.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[id.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[id.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),l=i??{};return l.headers=l.headers??{},oi.propagation.inject(oi.trace.setSpan(oi.context.active(),u),l.headers),{span:u,modifiedOptions:l}}endConsumerSpan(t,n,r,o){let i=t[bi.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:oi.SpanStatusCode.ERROR,message:r!==oc.EndOperation.ChannelClosed&&r!==oc.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[bi.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[bi.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,r,o)}),t[bi.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,Dr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),s=>{s&&oi.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,mG.hrTime)(),r=t[bi.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let s=r[o],u=(0,mG.hrTimeDuration)(s.timeOfConsume,n);if((0,mG.hrTimeToMilliseconds)(u)<i)break;this.endConsumerSpan(s.msg,null,oc.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};gG.AmqplibInstrumentation=fee});var WUe=M(UE=>{"use strict";A();Object.defineProperty(UE,"__esModule",{value:!0});UE.EndOperation=UE.DEFAULT_CONFIG=UE.AmqplibInstrumentation=void 0;var PBt=JUe();Object.defineProperty(UE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return PBt.AmqplibInstrumentation}});var ZUe=lee();Object.defineProperty(UE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return ZUe.DEFAULT_CONFIG}});Object.defineProperty(UE,"EndOperation",{enumerable:!0,get:function(){return ZUe.EndOperation}})});var XUe,eQe,MBt,tQe,LBt,nQe,rQe=B(()=>{A();XUe=ue(WUe(),1);_r();eQe="Amqplib",MBt={consumeEndHook:e=>{Yr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{Yr(e,"auto.amqplib.otel.publisher")}},tQe=ct(eQe,()=>new XUe.AmqplibInstrumentation(MBt)),LBt=(()=>({name:eQe,setupOnce(){tQe()}})),nQe=LBt});var Fk,mee=B(()=>{A();Fk="VercelAI"});function QBt(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 FBt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(GBt(t.content),jBt(t.content))}function GBt(e){for(let t of e){if(!QBt(t))continue;let n=HK(t.toolCallId);n?Vl(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"),an(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):Vl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),an(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function jBt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&$K(t.toolCallId)}function zBt(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 _G,UBt,oQe,hG,iQe=B(()=>{A();_G=ue(cn(),1);mt();mee();UBt=[">=3.0.0 <7"],oQe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];hG=class e extends _G.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",er,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new _G.InstrumentationNodeModuleDefinition("ai",UBt,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,s)=>{let u=s[0].experimental_telemetry||{},l=u.isEnabled,f=Et(),h=f?.getIntegrationByName(Fk),_=h?.options,E=h?!!f?.getOptions().sendDefaultPii:!1,{recordInputs:T,recordOutputs:v}=zBt(_,u,l,E);return s[0].experimental_telemetry={...u,isEnabled:l!==void 0?l:!0,recordInputs:T,recordOutputs:v},Cf(()=>Reflect.apply(o,i,s),R=>{R&&typeof R=="object"&&os(R,"_sentry_active_span",$c())},()=>{},R=>{FBt(R)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of oQe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=oQe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function HBt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var sQe,$Bt,aQe,uQe=B(()=>{A();mt();_r();mee();iQe();sQe=ct(Fk,()=>new hG({}));$Bt=((e={})=>{let t;return{name:Fk,options:e,setupOnce(){t=sQe()},afterAllSetup(n){e.force??HBt(n)?bF(n):t?.callWhenPatched(()=>bF(n))}}}),aQe=$Bt});var yG,qBt,EG,cQe=B(()=>{A();yG=ue(cn(),1);mt();qBt=[">=4.0.0 <7"],EG=class extends yG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",er,t)}init(){return new yG.InstrumentationNodeModuleDefinition("openai",qBt,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(...s){if(BS(uE))return Reflect.construct(r,s);let u=Reflect.construct(r,s);return vF(u,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}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 lQe,VBt,dQe,pQe=B(()=>{A();mt();_r();cQe();lQe=ct(uE,e=>new EG(e)),VBt=((e={})=>({name:uE,setupOnce(){lQe(e)}})),dQe=VBt});var TG,YBt,SG,fQe=B(()=>{A();TG=ue(cn(),1);mt();YBt=[">=0.19.2 <1.0.0"],SG=class extends TG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",er,t)}init(){return new TG.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",YBt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(BS(cE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return RF(s,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 s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}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 mQe,KBt,AQe,gQe=B(()=>{A();mt();_r();fQe();mQe=ct(cE,e=>new SG(e)),KBt=((e={})=>({name:cE,options:e,setupOnce(){mQe(e)}})),AQe=KBt});var WR,hQe,bG,_Qe=B(()=>{A();WR=ue(cn(),1);mt();hQe=[">=0.10.0 <2"],bG=class extends WR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",er,t)}init(){return new WR.InstrumentationNodeModuleDefinition("@google/genai",hQe,n=>this._patch(n),n=>n,[new WR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",hQe,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(BS(lE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return xF(s,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 s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}return EB(t,"GoogleGenAI",o),t}}});var EQe,JBt,yQe,SQe=B(()=>{A();mt();_r();_Qe();EQe=ct(lE,e=>new bG(e)),JBt=((e={})=>({name:lE,setupOnce(){EQe(e)}})),yQe=JBt});function ZBt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function WBt(e,t,n){return new Proxy(e,{apply(r,o,i){let u=i[1];(!u||typeof u!="object"||Array.isArray(u))&&(u={},i[1]=u);let l=u.callbacks,f=ZBt(l,t);return u.callbacks=f,Reflect.apply(r,o,i)}})}var QE,IG,CG,TQe=B(()=>{A();QE=ue(cn(),1);mt();IG=[">=0.1.0 <2.0.0"];CG=class extends QE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",er,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 QE.InstrumentationNodeModuleDefinition(r,IG,this._patch.bind(this),o=>o,[new QE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,IG,this._patch.bind(this),o=>o)]));return t.push(new QE.InstrumentationNodeModuleDefinition("langchain",IG,this._patch.bind(this),r=>r,[new QE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",IG,this._patch.bind(this),r=>r)])),t}_patch(t){aK([uE,cE,lE]);let n=BF(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(l=>typeof l=="function"&&r.includes(l.name));if(!i)return;let s=i.prototype;if(s.__sentry_patched__)return;s.__sentry_patched__=!0;let u=["invoke","stream","batch"];for(let l of u){let f=s[l];typeof f=="function"&&(s[l]=WBt(f,n))}}}});var bQe,XBt,IQe,CQe=B(()=>{A();mt();_r();TQe();bQe=ct(DF,e=>new CG(e)),XBt=((e={})=>({name:DF,setupOnce(){bQe(e)}})),IQe=XBt});var XR,vQe,vG,RQe=B(()=>{A();XR=ue(cn(),1);mt();vQe=[">=0.0.0 <2.0.0"],vG=class extends XR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",er,t)}init(){return new XR.InstrumentationNodeModuleDefinition("@langchain/langgraph",vQe,this._patch.bind(this),n=>n,[new XR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",vQe,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&OF(t.StateGraph.prototype,this.getConfig()),t}}});var xQe,ekt,DQe,NQe=B(()=>{A();mt();_r();RQe();xQe=ct(kF,e=>new vG(e)),ekt=((e={})=>({name:kF,setupOnce(){xQe(e)}})),DQe=ekt});import*as BQe from"node:net";function kQe(e,t,n,r,o){let s=()=>{},u=o.firestoreSpanCreationHook;typeof u=="function"&&(s=h=>{(0,eh.safeExecuteInTheMiddle)(()=>u(h),_=>{_&&Hl.error(_?.message)},!0)});let l=new eh.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>wQe(h,n,r,e,s)),f=["@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 f)l.files.push(new eh.InstrumentationNodeModuleFile(h,t,_=>wQe(_,n,r,e,s),_=>OQe(_,r)));return l}function wQe(e,t,n,r,o){return OQe(e,n),t(e,"addDoc",tkt(r,o)),t(e,"getDocs",rkt(r,o)),t(e,"setDoc",okt(r,o)),t(e,"deleteDoc",nkt(r,o)),e}function OQe(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,eh.isWrapped)(e[n])&&t(e,n);return e}function tkt(e,t){return function(r){return function(o,i){let s=xG(e,"addDoc",o);return t(s),RG(s,()=>r(o,i))}}}function nkt(e,t){return function(r){return function(o){let i=xG(e,"deleteDoc",o.parent||o);return t(i),RG(i,()=>r(o))}}}function rkt(e,t){return function(r){return function(o){let i=xG(e,"getDocs",o);return t(i),RG(i,()=>r(o))}}}function okt(e,t){return function(r){return function(o,i,s){let u=xG(e,"setDoc",o.parent||o);return t(u),RG(u,()=>typeof s<"u"?r(o,i,s):r(o,i))}}}function RG(e,t){return We.with(Jt.setSpan(We.active(),e),()=>(0,eh.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function xG(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:mo.CLIENT});return skt(r,n),r.setAttribute(QC,t),r}function ikt(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(BQe.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 skt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[wV]:t.path,[BV]:n.name,[mS]:"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:u,port:l}=ikt(i);u&&(s[FV]=u),l&&(s[GV]=l),e.setAttributes(s)}var eh,PQe=B(()=>{A();He();eh=ue(cn(),1);Xn()});function MQe(e,t,n,r,o){let i=()=>{},s=()=>{},u=o.functions?.errorHook,l=o.functions?.requestHook,f=o.functions?.responseHook;typeof f=="function"&&(s=(E,T)=>{(0,th.safeExecuteInTheMiddle)(()=>f(E,T),v=>{v&&Hl.error(v?.message)},!0)}),typeof l=="function"&&(i=E=>{(0,th.safeExecuteInTheMiddle)(()=>l(E),T=>{T&&Hl.error(T?.message)},!0)});let h=new th.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:E,triggerType:T})=>{h.files.push(new th.InstrumentationNodeModuleFile(E,t,v=>akt(v,n,r,e,{requestHook:i,responseHook:s,errorHook:u},T),v=>LQe(v,r)))}),h}function ic(e,t,n){return function(o){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],u=typeof i[0]=="function"?void 0:i[0];if(!s)return o.call(this,...i);let l=async function(...f){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",_=e.startSpan(`firebase.function.${n}`,{kind:mo.SERVER}),E={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(E["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(E["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),_.setAttributes(E),t?.requestHook?.(_),We.with(Jt.setSpan(We.active(),_),async()=>{let T,v;try{v=await s.apply(this,f)}catch(R){T=R}if(t?.responseHook?.(_,T),T&&_.recordException(T),_.end(),T)throw await t?.errorHook?.(_,T),T;return v})};return u?o.call(this,u,l):o.call(this,l)}}}function akt(e,t,n,r,o,i){switch(LQe(e,n),i){case"function":t(e,"onRequest",ic(r,o,"http.request")),t(e,"onCall",ic(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",ic(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",ic(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",ic(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",ic(r,o,"storage.object.finalized")),t(e,"onObjectArchived",ic(r,o,"storage.object.archived")),t(e,"onObjectDeleted",ic(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",ic(r,o,"storage.object.metadataUpdated"));break}return e}function LQe(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,th.isWrapped)(e[r])&&t(e,r);return e}var th,UQe=B(()=>{A();He();th=ue(cn(),1)});var FQe,QQe,ukt,ckt,DG,GQe=B(()=>{A();FQe=ue(cn(),1);mt();PQe();UQe();QQe={},ukt=[">=3.0.0 <5"],ckt=[">=6.0.0 <7"],DG=class extends FQe.InstrumentationBase{constructor(t=QQe){super("@sentry/instrumentation-firebase",er,t)}setConfig(t={}){super.setConfig({...QQe,...t})}init(){let t=[];return t.push(kQe(this.tracer,ukt,this._wrap,this._unwrap,this.getConfig())),t.push(MQe(this.tracer,ckt,this._wrap,this._unwrap,this.getConfig())),t}}});var jQe,lkt,zQe,dkt,HQe,$Qe=B(()=>{A();mt();_r();GQe();jQe="Firebase",lkt={firestoreSpanCreationHook:e=>{Yr(e,"auto.firebase.otel.firestore"),e.setAttribute(rn,"db.query")},functions:{requestHook:e=>{Yr(e,"auto.firebase.otel.functions"),e.setAttribute(rn,"http.request")},errorHook:async(e,t)=>{t&&(an(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await bv(2e3))}}},zQe=ct(jQe,()=>new DG(lkt)),dkt=(()=>({name:jQe,setupOnce(){zQe()}})),HQe=dkt});function qQe(){return[KBe(),DOe(),nPe(),HLe(),zPe(),oMe(),gMe(),xMe(),s2e(),R2e(),CLe(),QLe(),sUe(),EUe(),kUe(),jUe(),EPe(),nQe(),NPe(),IQe(),DQe(),aQe(),dQe(),AQe(),yQe(),w2e(),HQe()]}var VQe=B(()=>{A();rQe();gQe();yUe();JBe();BOe();$Qe();zUe();SQe();oPe();FLe();$Le();yPe();aUe();CQe();NQe();wPe();HPe();iMe();hMe();DMe();pQe();x2e();B2e();vLe();a2e();OUe();uQe()});function KQe(e,t={}){e.getOptions().debug&&TZ();let[n,r]=pkt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function pkt(e,t={}){let n=new YQe.BasicTracerProvider({sampler:new F4(e),resource:(0,NG.defaultResource)().merge((0,NG.resourceFromAttributes)({[jV]:"node",[NV]:"sentry",[zV]:er})),forceFlushTimeoutMillis:500,spanProcessors:[new Q4({timeout:fkt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Jt.setGlobalTracerProvider(n),Af.setGlobalPropagator(new U4);let r=new j4;return We.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function fkt(e){if(e!=null){if(e>Aee)return ws&&W.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${Aee}`),Aee;if(e<=0||Number.isNaN(e)){ws&&W.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var NG,YQe,Aee,JQe=B(()=>{A();He();NG=ue(PJ(),1),YQe=ue(aZ(),1);Xn();mt();_r();tR();KS();Aee=1e6});function ZQe(){return K4().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(CBe(),OBe())}function WQe(e){return[...ZQe(),...Qi(e)?qQe():[]]}function gee(e={}){return mkt(e,WQe)}function mkt(e={},t){kS(e,"node");let n=YZ({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(KQe(n,{spanProcessors:e.openTelemetrySpanProcessors}),J4()),n}var XQe=B(()=>{A();mt();_r();vBe();PBe();VQe();JQe()});var ex=B(()=>{A();XQe();mt();_r()});function Zr(){return Akt}function hu(){return eFe}function tFe(){return gkt}var Akt,eFe,gkt,sc=B(()=>{"use strict";A();Akt="prod",eFe="0.1.224",gkt=`@loredotlink/cli/${eFe}`});function Skt(e=""){if(!Ekt.test(e))return e!==e.toLowerCase()}function rFe(e,t){let n=t??ykt,r=[];if(!e||typeof e!="string")return r;let o="",i,s;for(let u of e){let l=n.includes(u);if(l===!0){r.push(o),o="",i=void 0;continue}let f=Skt(u);if(s===!1){if(i===!1&&f===!0){r.push(o),o=u,i=f;continue}if(i===!0&&f===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+u,i=f;continue}}o+=u,i=f,s=l}return r.push(o),r}function Tkt(e){return e?e[0].toUpperCase()+e.slice(1):""}function bkt(e){return e?e[0].toLowerCase()+e.slice(1):""}function Ikt(e,t){return e?(Array.isArray(e)?e:rFe(e)).map(n=>Tkt(t?.normalize?n.toLowerCase():n)).join(""):""}function jk(e,t){return bkt(Ikt(e||"",t))}function wG(e,t){return e?(Array.isArray(e)?e:rFe(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function oFe(e){return wG(e||"","_")}var Ekt,ykt,iFe=B(()=>{A();Ekt=/\d/,ykt=["-","_","/","."]});import{parseArgs as Ckt}from"node:util";function PG(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function _ee(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 KW(e,t,n,r=void 0){n&&(0,pk.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&$Pe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function ODt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(KW(t,o,n,r),o)).catch(o=>{throw qPe(t,o),o}).finally(()=>t.end()):(KW(t,e,n,r),t.end(),e)}yE.handlePromiseResponse=ODt;function PDt(e,t,n,r,o,i,s=void 0){let u=0;return o.length===2?u=1:o.length===3&&(u=2),o[u]=(l,f)=>(l?qPe(r,l):KW(r,f,i,s),r.end(),e(l,f)),t.apply(n,o)}yE.handleCallbackResponse=PDt});var YPe=M(bR=>{"use strict";A();Object.defineProperty(bR,"__esModule",{value:!0});bR.PACKAGE_NAME=bR.PACKAGE_VERSION=void 0;bR.PACKAGE_VERSION="0.60.0";bR.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var XPe=M(Zc=>{"use strict";A();Object.defineProperty(Zc,"__esModule",{value:!0});Zc.MongooseInstrumentation=Zc._ALREADY_INSTRUMENTED=Zc._STORED_PARENT_SPAN=void 0;var ks=(He(),Me(tt)),MDt=Rr(),JW=VPe(),Qa=cn(),KPe=YPe(),SE=YW(),nT=(Xn(),Me(qr)),n6=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],LDt=["remove","count","findOneAndRemove",...n6],UDt=["count","findOneAndRemove",...n6],QDt=[...n6];function JPe(e){return e?e.startsWith("6.")||e.startsWith("5.")?LDt:e.startsWith("7.")?UDt:QDt:n6}function ZPe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function WPe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Zc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Zc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var ZW=class extends Qa.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(KPe.PACKAGE_NAME,KPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Qa.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Qa.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Qa.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,ZPe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),WPe(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)),JPe(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=JPe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,ZPe(n)&&this._unwrap(r.Model.prototype,"remove"),WPe(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&&ks.trace.getSpan(ks.context.active())===void 0)return r.apply(this,arguments);let s=this[Zc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Qa.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Qa.SemconvStability.STABLE&&(u[nT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Zc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&ks.trace.getSpan(ks.context.active())===void 0)return r.apply(this,arguments);let s=this[Zc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Qa.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Qa.SemconvStability.STABLE&&(u[nT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(s,u){if(r.getConfig().requireParentSpan&&ks.trace.getSpan(ks.context.active())===void 0)return o.apply(this,arguments);let l={document:this};s&&!(s instanceof Function)&&(l.options=s);let f={},{dbStatementSerializer:h}=r.getConfig();if(h){let E=h(t,l);r._dbSemconvStability&Qa.SemconvStability.OLD&&(f[SE.ATTR_DB_STATEMENT]=E),r._dbSemconvStability&Qa.SemconvStability.STABLE&&(f[nT.ATTR_DB_QUERY_TEXT]=E)}let _=r._startSpan(this.constructor.collection,this.constructor.modelName,t,f);return s instanceof Function&&(u=s,s=void 0),r._handleResponse(_,o,this,arguments,u,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&ks.trace.getSpan(ks.context.active())===void 0)return o.apply(this,arguments);let f=l,h=s,_=u;typeof s=="function"?(f=s,h=void 0,_=void 0):typeof u=="function"&&(f=u,_=void 0);let E={},T=r.getConfig().dbStatementSerializer;if(T){let x=T(t,{condition:{_id:this._id},updates:h,options:_});r._dbSemconvStability&Qa.SemconvStability.OLD&&(E[SE.ATTR_DB_STATEMENT]=x),r._dbSemconvStability&Qa.SemconvStability.STABLE&&(E[nT.ATTR_DB_QUERY_TEXT]=x)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,E),R=r._handleResponse(v,o,this,arguments,f,n);return R&&typeof R=="object"&&(R[Zc._ALREADY_INSTRUMENTED]=!0),R}}patchModelStatic(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&ks.trace.getSpan(ks.context.active())===void 0)return o.apply(this,arguments);typeof u=="function"&&(l=u,u=void 0);let f={};switch(t){case"insertMany":f.documents=s;break;case"bulkWrite":f.operations=s;break;default:f.document=s;break}u!==void 0&&(f.options=u);let h={},{dbStatementSerializer:_}=r.getConfig();if(_){let T=_(t,f);r._dbSemconvStability&Qa.SemconvStability.OLD&&(h[SE.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&Qa.SemconvStability.STABLE&&(h[nT.ATTR_DB_QUERY_TEXT]=T)}let E=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(E,o,this,arguments,l,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=ks.trace.getSpan(ks.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Zc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Zc._STORED_PARENT_SPAN]=ks.trace.getSpan(ks.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let s={...o,...(0,JW.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Qa.SemconvStability.OLD&&(s[SE.ATTR_DB_OPERATION]=r,s[SE.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Qa.SemconvStability.STABLE&&(s[nT.ATTR_DB_OPERATION_NAME]=r,s[nT.ATTR_DB_SYSTEM_NAME]=SE.DB_SYSTEM_NAME_VALUE_MONGODB);let u=this._dbSemconvStability&Qa.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(u,{kind:ks.SpanKind.CLIENT,attributes:s},i?ks.trace.setSpan(ks.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,s=void 0){let u=this;if(i instanceof Function)return u._callOriginalFunction(()=>(0,JW.handleCallbackResponse)(i,n,r,t,o,u.getConfig().responseHook,s));{let l=u._callOriginalFunction(()=>n.apply(r,o));return(0,JW.handlePromiseResponse)(l,t,u.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?ks.context.with((0,MDt.suppressTracing)(ks.context.active()),t):t()}};Zc.MongooseInstrumentation=ZW});var eMe=M(r6=>{"use strict";A();Object.defineProperty(r6,"__esModule",{value:!0});r6.MongooseInstrumentation=void 0;var FDt=XPe();Object.defineProperty(r6,"MongooseInstrumentation",{enumerable:!0,get:function(){return FDt.MongooseInstrumentation}})});var tMe,nMe,rMe,GDt,oMe,iMe=B(()=>{A();tMe=ue(eMe(),1);_r();nMe="Mongoose",rMe=ct(nMe,()=>new tMe.MongooseInstrumentation({responseHook(e){Yr(e,"auto.db.otel.mongoose")}})),GDt=(()=>({name:nMe,setupOnce(){rMe()}})),oMe=GDt});var sMe=M(ls=>{"use strict";A();Object.defineProperty(ls,"__esModule",{value:!0});ls.METRIC_DB_CLIENT_CONNECTIONS_USAGE=ls.DB_SYSTEM_VALUE_MYSQL=ls.ATTR_NET_PEER_PORT=ls.ATTR_NET_PEER_NAME=ls.ATTR_DB_USER=ls.ATTR_DB_SYSTEM=ls.ATTR_DB_STATEMENT=ls.ATTR_DB_NAME=ls.ATTR_DB_CONNECTION_STRING=void 0;ls.ATTR_DB_CONNECTION_STRING="db.connection_string";ls.ATTR_DB_NAME="db.name";ls.ATTR_DB_STATEMENT="db.statement";ls.ATTR_DB_SYSTEM="db.system";ls.ATTR_DB_USER="db.user";ls.ATTR_NET_PEER_NAME="net.peer.name";ls.ATTR_NET_PEER_PORT="net.peer.port";ls.DB_SYSTEM_VALUE_MYSQL="mysql";ls.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var aMe=M(fk=>{"use strict";A();Object.defineProperty(fk,"__esModule",{value:!0});fk.AttributeNames=void 0;var jDt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(jDt=fk.AttributeNames||(fk.AttributeNames={}))});var uMe=M(mu=>{"use strict";A();Object.defineProperty(mu,"__esModule",{value:!0});mu.getPoolNameOld=mu.arrayStringifyHelper=mu.getSpanName=mu.getDbValues=mu.getDbQueryText=mu.getJDBCString=mu.getConfig=void 0;function zDt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}mu.getConfig=zDt;function HDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}mu.getJDBCString=HDt;function $Dt(e){return typeof e=="string"?e:e.sql}mu.getDbQueryText=$Dt;function qDt(e,t){return WW(typeof e=="string"?t:t||e.values)}mu.getDbValues=qDt;function VDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}mu.getSpanName=VDt;function WW(e){return e?`[${e.toString()}]`:""}mu.arrayStringifyHelper=WW;function YDt(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()}mu.getPoolNameOld=YDt});var cMe=M(IR=>{"use strict";A();Object.defineProperty(IR,"__esModule",{value:!0});IR.PACKAGE_NAME=IR.PACKAGE_VERSION=void 0;IR.PACKAGE_VERSION="0.60.0";IR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var dMe=M(o6=>{"use strict";A();Object.defineProperty(o6,"__esModule",{value:!0});o6.MySQLInstrumentation=void 0;var Wc=(He(),Me(tt)),dp=cn(),CR=(Xn(),Me(qr)),Wg=sMe(),KDt=aMe(),rT=uMe(),lMe=cMe(),XW=class extends dp.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(lMe.PACKAGE_NAME,lMe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,dp.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,dp.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Wg.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 dp.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,dp.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,dp.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,dp.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 s=t._allConnections.length,u=t._freeConnections.length,l=s-u,f=(0,rT.getPoolNameOld)(t);r._connCountAdd(-l,f,"used"),r._connCountAdd(-u,f,"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,s){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let u=t._nodes;if(u){let l=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),f=u[l].pool;r._setPoolCallbacks(f,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,s,u){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let l=r._getConnectionCallbackPatchFn(i);return n.call(t,l)}if(arguments.length===2&&typeof s=="function"){let l=r._getConnectionCallbackPatchFn(s);return n.call(t,i,l)}if(arguments.length===3&&typeof u=="function"){let l=r._getConnectionCallbackPatchFn(u);return n.call(t,i,s,l)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=Wc.context.active();return function(o,i){i&&((0,dp.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&Wc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,s){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let u={},{host:l,port:f,database:h,user:_}=(0,rT.getConfig)(t.config),E=parseInt(f,10),T=(0,rT.getDbQueryText)(o);r._dbSemconvStability&dp.SemconvStability.OLD&&(u[Wg.ATTR_DB_SYSTEM]=Wg.DB_SYSTEM_VALUE_MYSQL,u[Wg.ATTR_DB_CONNECTION_STRING]=(0,rT.getJDBCString)(l,f,h),u[Wg.ATTR_DB_NAME]=h,u[Wg.ATTR_DB_USER]=_,u[Wg.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&dp.SemconvStability.STABLE&&(u[CR.ATTR_DB_SYSTEM_NAME]=CR.DB_SYSTEM_NAME_VALUE_MYSQL,u[CR.ATTR_DB_NAMESPACE]=h,u[CR.ATTR_DB_QUERY_TEXT]=T),r._netSemconvStability&dp.SemconvStability.OLD&&(u[Wg.ATTR_NET_PEER_NAME]=l,isNaN(E)||(u[Wg.ATTR_NET_PEER_PORT]=E)),r._netSemconvStability&dp.SemconvStability.STABLE&&(u[CR.ATTR_SERVER_ADDRESS]=l,isNaN(E)||(u[CR.ATTR_SERVER_PORT]=E));let v=r.tracer.startSpan((0,rT.getSpanName)(o),{kind:Wc.SpanKind.CLIENT,attributes:u});if(r.getConfig().enhancedDatabaseReporting){let k;Array.isArray(i)?k=i:arguments[2]&&(k=[i]),v.setAttribute(KDt.AttributeNames.MYSQL_VALUES,(0,rT.getDbValues)(o,k))}let R=Array.from(arguments).findIndex(k=>typeof k=="function"),x=Wc.context.active();if(R===-1){let k=Wc.context.with(Wc.trace.setSpan(Wc.context.active(),v),()=>n.apply(t,arguments));return Wc.context.bind(x,k),k.on("error",P=>v.setStatus({code:Wc.SpanStatusCode.ERROR,message:P.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,R,r._patchCallbackQuery(v,x)),Wc.context.with(Wc.trace.setSpan(Wc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,s){return o&&t.setStatus({code:Wc.SpanStatusCode.ERROR,message:o.message}),t.end(),Wc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,rT.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")})}};o6.MySQLInstrumentation=XW});var pMe=M(i6=>{"use strict";A();Object.defineProperty(i6,"__esModule",{value:!0});i6.MySQLInstrumentation=void 0;var JDt=dMe();Object.defineProperty(i6,"MySQLInstrumentation",{enumerable:!0,get:function(){return JDt.MySQLInstrumentation}})});var fMe,mMe,AMe,ZDt,gMe,hMe=B(()=>{A();fMe=ue(pMe(),1);_r();mMe="Mysql",AMe=ct(mMe,()=>new fMe.MySQLInstrumentation({})),ZDt=(()=>({name:mMe,setupOnce(){AMe()}})),gMe=ZDt});var eX=M(ca=>{"use strict";A();Object.defineProperty(ca,"__esModule",{value:!0});ca.DB_SYSTEM_VALUE_MYSQL=ca.ATTR_NET_PEER_PORT=ca.ATTR_NET_PEER_NAME=ca.ATTR_DB_USER=ca.ATTR_DB_SYSTEM=ca.ATTR_DB_STATEMENT=ca.ATTR_DB_NAME=ca.ATTR_DB_CONNECTION_STRING=void 0;ca.ATTR_DB_CONNECTION_STRING="db.connection_string";ca.ATTR_DB_NAME="db.name";ca.ATTR_DB_STATEMENT="db.statement";ca.ATTR_DB_SYSTEM="db.system";ca.ATTR_DB_USER="db.user";ca.ATTR_NET_PEER_NAME="net.peer.name";ca.ATTR_NET_PEER_PORT="net.peer.port";ca.DB_SYSTEM_VALUE_MYSQL="mysql"});var nX=M(s6=>{"use strict";A();Object.defineProperty(s6,"__esModule",{value:!0});s6.addSqlCommenterComment=void 0;var tX=(He(),Me(tt)),WDt=Rr();function XDt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function e1t(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function t1t(e,t){if(typeof t!="string"||t.length===0||XDt(t))return t;let n=new WDt.W3CTraceContextPropagator,r={};n.inject(tX.trace.setSpan(tX.ROOT_CONTEXT,e),r,tX.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(s=>{let u=e1t(r[s]);return`${s}='${u}'`}).join(",");return`${t} /*${i}*/`}s6.addSqlCommenterComment=t1t});var _Me=M(pp=>{"use strict";A();Object.defineProperty(pp,"__esModule",{value:!0});pp.getConnectionPrototypeToInstrument=pp.once=pp.getSpanName=pp.getQueryText=pp.getConnectionAttributes=void 0;var mk=eX(),a6=cn(),rX=(Xn(),Me(qr));function n1t(e,t,n){let{host:r,port:o,database:i,user:s}=r1t(e),u={};t&a6.SemconvStability.OLD&&(u[mk.ATTR_DB_CONNECTION_STRING]=o1t(r,o,i),u[mk.ATTR_DB_NAME]=i,u[mk.ATTR_DB_USER]=s),t&a6.SemconvStability.STABLE&&(u[rX.ATTR_DB_NAMESPACE]=i);let l=parseInt(o,10);return n&a6.SemconvStability.OLD&&(u[mk.ATTR_NET_PEER_NAME]=r,isNaN(l)||(u[mk.ATTR_NET_PEER_PORT]=l)),n&a6.SemconvStability.STABLE&&(u[rX.ATTR_SERVER_ADDRESS]=r,isNaN(l)||(u[rX.ATTR_SERVER_PORT]=l)),u}pp.getConnectionAttributes=n1t;function r1t(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function o1t(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function i1t(e,t,n,r=!1,o=s1t){let[i,s]=typeof e=="string"?[e,n]:[e.sql,a1t(e)?n||e.values:n];try{return r?o(i):t&&s?t(i,s):i}catch{return"Could not determine the query due to an error in masking or formatting"}}pp.getQueryText=i1t;function s1t(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function a1t(e){return"values"in e}function u1t(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}pp.getSpanName=u1t;var c1t=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};pp.once=c1t;function l1t(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}pp.getConnectionPrototypeToInstrument=l1t});var EMe=M(vR=>{"use strict";A();Object.defineProperty(vR,"__esModule",{value:!0});vR.PACKAGE_NAME=vR.PACKAGE_VERSION=void 0;vR.PACKAGE_VERSION="0.60.0";vR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var bMe=M(u6=>{"use strict";A();Object.defineProperty(u6,"__esModule",{value:!0});u6.MySQL2Instrumentation=void 0;var yMe=(He(),Me(tt)),Df=cn(),oX=eX(),SMe=nX(),RR=_Me(),TMe=EMe(),iX=(Xn(),Me(qr)),sX=[">=1.4.2 <4"],aX=class extends Df.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(TMe.PACKAGE_NAME,TMe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Df.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Df.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,Df.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,Df.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 Df.InstrumentationNodeModuleDefinition("mysql2",sX,i=>(n(i),i),()=>{},[new Df.InstrumentationNodeModuleFile("mysql2/promise.js",sX,i=>(n(i),i),()=>{}),new Df.InstrumentationNodeModuleFile("mysql2/lib/connection.js",sX,i=>{let s=(0,RR.getConnectionPrototypeToInstrument)(i);return r(s),i},i=>{if(i===void 0)return;let s=(0,RR.getConnectionPrototypeToInstrument)(i);o(s)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,s,u){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]);let{maskStatement:f,maskStatementHook:h,responseHook:_}=o.getConfig(),E=(0,RR.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),T=(0,RR.getQueryText)(i,t,l,f,h);o._dbSemconvStability&Df.SemconvStability.OLD&&(E[oX.ATTR_DB_SYSTEM]=oX.DB_SYSTEM_VALUE_MYSQL,E[oX.ATTR_DB_STATEMENT]=T),o._dbSemconvStability&Df.SemconvStability.STABLE&&(E[iX.ATTR_DB_SYSTEM_NAME]=iX.DB_SYSTEM_NAME_VALUE_MYSQL,E[iX.ATTR_DB_QUERY_TEXT]=T);let v=o.tracer.startSpan((0,RR.getSpanName)(i),{kind:yMe.SpanKind.CLIENT,attributes:E});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,SMe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,SMe.addSqlCommenterComment)(v,i.sql)}));let R=(0,RR.once)((x,k)=>{x?v.setStatus({code:yMe.SpanStatusCode.ERROR,message:x.message}):typeof _=="function"&&(0,Df.safeExecuteInTheMiddle)(()=>{_(v,{queryResults:k})},P=>{P&&o._diag.warn("Failed executing responseHook",P)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(R));let x=r.apply(this,arguments);return x.once("error",k=>{R(k)}).once("result",k=>{R(void 0,k)}),x}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(R)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(R)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};u6.MySQL2Instrumentation=aX});var IMe=M(c6=>{"use strict";A();Object.defineProperty(c6,"__esModule",{value:!0});c6.MySQL2Instrumentation=void 0;var d1t=bMe();Object.defineProperty(c6,"MySQL2Instrumentation",{enumerable:!0,get:function(){return d1t.MySQL2Instrumentation}})});var CMe,vMe,RMe,p1t,xMe,DMe=B(()=>{A();CMe=ue(IMe(),1);_r();vMe="Mysql2",RMe=ct(vMe,()=>new CMe.MySQL2Instrumentation({responseHook(e){Yr(e,"auto.db.otel.mysql2")}})),p1t=(()=>({name:vMe,setupOnce(){RMe()}})),xMe=p1t});var NMe=M(Au=>{"use strict";A();Object.defineProperty(Au,"__esModule",{value:!0});Au.DB_SYSTEM_VALUE_REDIS=Au.DB_SYSTEM_NAME_VALUE_REDIS=Au.ATTR_NET_PEER_PORT=Au.ATTR_NET_PEER_NAME=Au.ATTR_DB_SYSTEM=Au.ATTR_DB_STATEMENT=Au.ATTR_DB_CONNECTION_STRING=void 0;Au.ATTR_DB_CONNECTION_STRING="db.connection_string";Au.ATTR_DB_STATEMENT="db.statement";Au.ATTR_DB_SYSTEM="db.system";Au.ATTR_NET_PEER_NAME="net.peer.name";Au.ATTR_NET_PEER_PORT="net.peer.port";Au.DB_SYSTEM_NAME_VALUE_REDIS="redis";Au.DB_SYSTEM_VALUE_REDIS="redis"});var wMe=M(l6=>{"use strict";A();Object.defineProperty(l6,"__esModule",{value:!0});l6.endSpan=void 0;var f1t=(He(),Me(tt)),m1t=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:f1t.SpanStatusCode.ERROR,message:t.message})),e.end()};l6.endSpan=m1t});var p6=M(d6=>{"use strict";A();Object.defineProperty(d6,"__esModule",{value:!0});d6.defaultDbStatementSerializer=void 0;var A1t=[{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}],g1t=(e,t)=>{if(Array.isArray(t)&&t.length){let n=A1t.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};d6.defaultDbStatementSerializer=g1t});var BMe=M(xR=>{"use strict";A();Object.defineProperty(xR,"__esModule",{value:!0});xR.PACKAGE_NAME=xR.PACKAGE_VERSION=void 0;xR.PACKAGE_VERSION="0.62.0";xR.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var MMe=M(f6=>{"use strict";A();Object.defineProperty(f6,"__esModule",{value:!0});f6.IORedisInstrumentation=void 0;var TE=(He(),Me(tt)),Xc=cn(),bE=(Xn(),Me(qr)),el=NMe(),kMe=cn(),Ak=wMe(),h1t=p6(),OMe=BMe(),PMe={requireParentSpan:!0},uX=class extends Xc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(OMe.PACKAGE_NAME,OMe.PACKAGE_VERSION,{...PMe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Xc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Xc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...PMe,...t})}init(){return[new Xc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Xc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Xc.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(),s=i.dbStatementSerializer||h1t.defaultDbStatementSerializer,u=TE.trace.getSpan(TE.context.active())===void 0;if(i.requireParentSpan===!0&&u)return t.apply(this,arguments);let l={},{host:f,port:h}=this.options,_=s(o.name,o.args);r._dbSemconvStability&Xc.SemconvStability.OLD&&(l[el.ATTR_DB_SYSTEM]=el.DB_SYSTEM_VALUE_REDIS,l[el.ATTR_DB_STATEMENT]=_,l[el.ATTR_DB_CONNECTION_STRING]=`redis://${f}:${h}`),r._dbSemconvStability&Xc.SemconvStability.STABLE&&(l[bE.ATTR_DB_SYSTEM_NAME]=el.DB_SYSTEM_NAME_VALUE_REDIS,l[bE.ATTR_DB_QUERY_TEXT]=_),r._netSemconvStability&Xc.SemconvStability.OLD&&(l[el.ATTR_NET_PEER_NAME]=f,l[el.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Xc.SemconvStability.STABLE&&(l[bE.ATTR_SERVER_ADDRESS]=f,l[bE.ATTR_SERVER_PORT]=h);let E=r.tracer.startSpan(o.name,{kind:TE.SpanKind.CLIENT,attributes:l}),{requestHook:T}=i;T&&(0,kMe.safeExecuteInTheMiddle)(()=>T(E,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&TE.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),R=o.resolve;o.resolve=function(k){(0,kMe.safeExecuteInTheMiddle)(()=>i.responseHook?.(E,o.name,o.args,k),P=>{P&&TE.diag.error("ioredis instrumentation: response hook failed",P)},!0),(0,Ak.endSpan)(E,null),R(k)};let x=o.reject;return o.reject=function(k){(0,Ak.endSpan)(E,k),x(k)},v}catch(v){throw(0,Ak.endSpan)(E,v),v}}}_traceConnection(t){let n=this;return function(){let r=TE.trace.getSpan(TE.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:s}=this.options;n._dbSemconvStability&Xc.SemconvStability.OLD&&(o[el.ATTR_DB_SYSTEM]=el.DB_SYSTEM_VALUE_REDIS,o[el.ATTR_DB_STATEMENT]="connect",o[el.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${s}`),n._dbSemconvStability&Xc.SemconvStability.STABLE&&(o[bE.ATTR_DB_SYSTEM_NAME]=el.DB_SYSTEM_NAME_VALUE_REDIS,o[bE.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Xc.SemconvStability.OLD&&(o[el.ATTR_NET_PEER_NAME]=i,o[el.ATTR_NET_PEER_PORT]=s),n._netSemconvStability&Xc.SemconvStability.STABLE&&(o[bE.ATTR_SERVER_ADDRESS]=i,o[bE.ATTR_SERVER_PORT]=s);let u=n.tracer.startSpan("connect",{kind:TE.SpanKind.CLIENT,attributes:o});try{let l=t.apply(this,arguments);return(0,Ak.endSpan)(u,null),l}catch(l){throw(0,Ak.endSpan)(u,l),l}}}};f6.IORedisInstrumentation=uX});var LMe=M(m6=>{"use strict";A();Object.defineProperty(m6,"__esModule",{value:!0});m6.IORedisInstrumentation=void 0;var _1t=MMe();Object.defineProperty(m6,"IORedisInstrumentation",{enumerable:!0,get:function(){return _1t.IORedisInstrumentation}})});var A6=M(DR=>{"use strict";A();Object.defineProperty(DR,"__esModule",{value:!0});DR.PACKAGE_NAME=DR.PACKAGE_VERSION=void 0;DR.PACKAGE_VERSION="0.62.0";DR.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var UMe=M(IE=>{"use strict";A();Object.defineProperty(IE,"__esModule",{value:!0});IE.getTracedCreateStreamTrace=IE.getTracedCreateClient=IE.endSpan=void 0;var gk=(He(),Me(tt)),E1t=(e,t)=>{t&&e.setStatus({code:gk.SpanStatusCode.ERROR,message:t.message}),e.end()};IE.endSpan=E1t;var y1t=e=>function(){let n=e.apply(this,arguments);return gk.context.bind(gk.context.active(),n)};IE.getTracedCreateClient=y1t;var S1t=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){gk.context.bind(gk.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};IE.getTracedCreateStreamTrace=S1t});var g6=M(gu=>{"use strict";A();Object.defineProperty(gu,"__esModule",{value:!0});gu.DB_SYSTEM_VALUE_REDIS=gu.DB_SYSTEM_NAME_VALUE_REDIS=gu.ATTR_NET_PEER_PORT=gu.ATTR_NET_PEER_NAME=gu.ATTR_DB_SYSTEM=gu.ATTR_DB_STATEMENT=gu.ATTR_DB_CONNECTION_STRING=void 0;gu.ATTR_DB_CONNECTION_STRING="db.connection_string";gu.ATTR_DB_STATEMENT="db.statement";gu.ATTR_DB_SYSTEM="db.system";gu.ATTR_NET_PEER_NAME="net.peer.name";gu.ATTR_NET_PEER_PORT="net.peer.port";gu.DB_SYSTEM_NAME_VALUE_REDIS="redis";gu.DB_SYSTEM_VALUE_REDIS="redis"});var FMe=M(_6=>{"use strict";A();Object.defineProperty(_6,"__esModule",{value:!0});_6.RedisInstrumentationV2_V3=void 0;var rd=cn(),h6=UMe(),QMe=A6(),hk=(He(),Me(tt)),_k=(Xn(),Me(qr)),oT=g6(),T1t=p6(),cX=class e extends rd.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(QMe.PACKAGE_NAME,QMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,rd.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,rd.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new rd.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,rd.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,rd.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,rd.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 s=t.getConfig(),u=hk.trace.getSpan(hk.context.active())===void 0;if(s.requireParentSpan===!0&&u)return r.apply(this,arguments);let l=s?.dbStatementSerializer||T1t.defaultDbStatementSerializer,f={};t._semconvStability&rd.SemconvStability.OLD&&Object.assign(f,{[oT.ATTR_DB_SYSTEM]:oT.DB_SYSTEM_VALUE_REDIS,[oT.ATTR_DB_STATEMENT]:l(i.command,i.args)}),t._semconvStability&rd.SemconvStability.STABLE&&Object.assign(f,{[_k.ATTR_DB_SYSTEM_NAME]:oT.DB_SYSTEM_NAME_VALUE_REDIS,[_k.ATTR_DB_OPERATION_NAME]:i.command,[_k.ATTR_DB_QUERY_TEXT]:l(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:hk.SpanKind.CLIENT,attributes:f});if(this.connection_options){let E={};t._semconvStability&rd.SemconvStability.OLD&&Object.assign(E,{[oT.ATTR_NET_PEER_NAME]:this.connection_options.host,[oT.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&rd.SemconvStability.STABLE&&Object.assign(E,{[_k.ATTR_SERVER_ADDRESS]:this.connection_options.host,[_k.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(E)}this.address&&t._semconvStability&rd.SemconvStability.OLD&&h.setAttribute(oT.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let _=arguments[0].callback;if(_){let E=hk.context.active();arguments[0].callback=function(v,R){if(s?.responseHook){let x=s.responseHook;(0,rd.safeExecuteInTheMiddle)(()=>{x(h,i.command,i.args,R)},k=>{k&&t._diag.error("Error executing responseHook",k)},!0)}return(0,h6.endSpan)(h,v),hk.context.with(E,_,this,...arguments)}}try{return r.apply(this,arguments)}catch(E){throw(0,h6.endSpan)(h,E),E}}}}_getPatchCreateClient(){return function(n){return(0,h6.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,h6.getTracedCreateStreamTrace)(n)}}};_6.RedisInstrumentationV2_V3=cX});var jMe=M(E6=>{"use strict";A();Object.defineProperty(E6,"__esModule",{value:!0});E6.getClientAttributes=void 0;var lX=(Xn(),Me(qr)),NR=g6(),GMe=cn();function b1t(e,t,n){let r={};return n&GMe.SemconvStability.OLD&&Object.assign(r,{[NR.ATTR_DB_SYSTEM]:NR.DB_SYSTEM_VALUE_REDIS,[NR.ATTR_NET_PEER_NAME]:t?.socket?.host,[NR.ATTR_NET_PEER_PORT]:t?.socket?.port,[NR.ATTR_DB_CONNECTION_STRING]:I1t(e,t?.url)}),n&GMe.SemconvStability.STABLE&&Object.assign(r,{[lX.ATTR_DB_SYSTEM_NAME]:NR.DB_SYSTEM_NAME_VALUE_REDIS,[lX.ATTR_SERVER_ADDRESS]:t?.socket?.host,[lX.ATTR_SERVER_PORT]:t?.socket?.port}),r}E6.getClientAttributes=b1t;function I1t(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 qMe=M(y6=>{"use strict";A();Object.defineProperty(y6,"__esModule",{value:!0});y6.RedisInstrumentationV4_V5=void 0;var fp=(He(),Me(tt)),Ro=cn(),zMe=jMe(),C1t=p6(),HMe=A6(),dX=(Xn(),Me(qr)),v1t=g6(),Ek=Symbol("opentelemetry.instrumentation.redis.open_spans"),$Me=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),pX=class e extends Ro.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(HMe.PACKAGE_NAME,HMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ro.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ro.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 Ro.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let u=i.transformCommandArguments;if(!u)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let l=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Ro.isWrapped)(i?.[l])&&this._unwrap(i,l),this._wrap(i,l,this._getPatchExtendWithCommands(u)),i},i=>{(0,Ro.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Ro.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Ro.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return(0,Ro.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Ro.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Ro.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Ro.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Ro.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),o=new Ro.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Ro.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Ro.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Ro.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(s,"connect",this._getPatchedClientConnect()),i},i=>{let s=i?.default?.prototype;(0,Ro.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Ro.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Ro.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new Ro.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(s){if(s?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let u=s.executor;return s.executor=function(l,f){let h=t(l,f).args;return n._traceClientCommand(u,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let s=o.apply(this,arguments);return typeof s?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),s):s.then(u=>{let l=this[Ek];return n._endSpansWithRedisReplies(l,u,t),u}).catch(u=>{let l=this[Ek];if(!l)n._diag.error("cannot find open spans to end for multi/pipeline");else{let f=u.constructor.name==="MultiErrorReply"?u.replies:new Array(l.length).fill(u);n._endSpansWithRedisReplies(l,f,t)}return Promise.reject(u)})}}}_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[$Me]=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,s=(0,zMe.getClientAttributes)(t._diag,i,t._semconvStability),u=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:fp.SpanKind.CLIENT,attributes:s});return fp.context.with(fp.trace.setSpan(fp.context.active(),u),()=>r.apply(this)).then(f=>(u.end(),f)).catch(f=>(u.recordException(f),u.setStatus({code:fp.SpanStatusCode.ERROR,message:f.message}),u.end(),Promise.reject(f)))}}}_traceClientCommand(t,n,r,o){if(fp.trace.getSpan(fp.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let s=n.options||n[$Me],u=o[0],l=o.slice(1),f=this.getConfig().dbStatementSerializer||C1t.defaultDbStatementSerializer,h=(0,zMe.getClientAttributes)(this._diag,s,this._semconvStability);this._semconvStability&Ro.SemconvStability.STABLE&&(h[dX.ATTR_DB_OPERATION_NAME]=u);try{let T=f(u,l);T!=null&&(this._semconvStability&Ro.SemconvStability.OLD&&(h[v1t.ATTR_DB_STATEMENT]=T),this._semconvStability&Ro.SemconvStability.STABLE&&(h[dX.ATTR_DB_QUERY_TEXT]=T))}catch(T){this._diag.error("dbStatementSerializer throw an exception",T,{commandName:u})}let _=this.tracer.startSpan(`${e.COMPONENT}-${u}`,{kind:fp.SpanKind.CLIENT,attributes:h}),E=fp.context.with(fp.trace.setSpan(fp.context.active(),_),()=>t.apply(n,r));if(typeof E?.then=="function")E.then(T=>{this._endSpanWithResponse(_,u,l,T,void 0)},T=>{this._endSpanWithResponse(_,u,l,null,T)});else{let T=E;T[Ek]=T[Ek]||[],T[Ek].push({span:_,commandName:u,commandArgs:l})}return E}_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(u=>u.commandName),s=o.every(u=>u===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let u=0;u<t.length;u++){let{span:l,commandArgs:f}=t[u],h=n[u],[_,E]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Ro.SemconvStability.STABLE&&l.setAttribute(dX.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(l,o[u],f,_,E)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,r,o)}catch(u){this._diag.error("responseHook throw an exception",u)}i&&(t.recordException(i),t.setStatus({code:fp.SpanStatusCode.ERROR,message:i?.message})),t.end()}};y6.RedisInstrumentationV4_V5=pX});var KMe=M(S6=>{"use strict";A();Object.defineProperty(S6,"__esModule",{value:!0});S6.RedisInstrumentation=void 0;var R1t=cn(),VMe=A6(),x1t=FMe(),D1t=qMe(),YMe={requireParentSpan:!1},fX=class extends R1t.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...YMe,...t};super(VMe.PACKAGE_NAME,VMe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new x1t.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new D1t.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...YMe,...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())}};S6.RedisInstrumentation=fX});var JMe=M(T6=>{"use strict";A();Object.defineProperty(T6,"__esModule",{value:!0});T6.RedisInstrumentation=void 0;var N1t=KMe();Object.defineProperty(T6,"RedisInstrumentation",{enumerable:!0,get:function(){return N1t.RedisInstrumentation}})});function yk(e,t){return e.includes(t.toLowerCase())}function AX(e){return yk(mX,e)?"cache.get":yk(B1t,e)?"cache.put":void 0}function k1t(e,t){return t.some(n=>e.startsWith(n))}function WMe(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)?ZMe(o.map(i=>n(i))):["<unknown>"],r=t[0];return yk(w1t,e)&&r!=null?n(r):ZMe(t.map(o=>n(o)))}catch{return}}function XMe(e,t,n){if(!AX(e))return!1;for(let r of t)if(k1t(r,n))return!0;return!1}function e2e(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 ZMe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var w1t,mX,B1t,t2e=B(()=>{A();w1t=["get","set","setex"],mX=["get","mget"],B1t=["set","setex"]});var n2e,r2e,b6,Sk,o2e,O1t,P1t,i2e,M1t,s2e,a2e=B(()=>{A();n2e=ue(LMe(),1),r2e=ue(JMe(),1);mt();_r();t2e();b6="Redis",Sk={},o2e=(e,t,n,r)=>{e.setAttribute(Lt,"auto.db.otel.redis");let o=WMe(t,n),i=AX(t);if(!o||!i||!Sk.cachePrefixes||!XMe(t,o,Sk.cachePrefixes))return;let s=Pt(e).data["net.peer.name"],u=Pt(e).data["net.peer.port"];u&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":u});let l=e2e(r);l&&e.setAttribute(EY,l),yk(mX,t)&&l!==void 0&&e.setAttribute(hY,l>0),e.setAttributes({[rn]:i,[_Y]:o});let f=o.join(", ");e.updateName(Sk.maxCacheKeyLength?Q_(f,Sk.maxCacheKeyLength):f)},O1t=ct(`${b6}.IORedis`,()=>new n2e.IORedisInstrumentation({responseHook:o2e})),P1t=ct(`${b6}.Redis`,()=>new r2e.RedisInstrumentation({responseHook:o2e})),i2e=Object.assign(()=>{O1t(),P1t()},{id:b6}),M1t=((e={})=>({name:b6,setupOnce(){Sk=e,i2e()}})),s2e=M1t});var u2e=M(I6=>{"use strict";A();Object.defineProperty(I6,"__esModule",{value:!0});I6.EVENT_LISTENERS_SET=void 0;I6.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var gX=M(Tk=>{"use strict";A();Object.defineProperty(Tk,"__esModule",{value:!0});Tk.AttributeNames=void 0;var L1t;(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"})(L1t=Tk.AttributeNames||(Tk.AttributeNames={}))});var hX=M(Or=>{"use strict";A();Object.defineProperty(Or,"__esModule",{value:!0});Or.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Or.METRIC_DB_CLIENT_CONNECTION_COUNT=Or.DB_SYSTEM_VALUE_POSTGRESQL=Or.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Or.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Or.ATTR_NET_PEER_PORT=Or.ATTR_NET_PEER_NAME=Or.ATTR_DB_USER=Or.ATTR_DB_SYSTEM=Or.ATTR_DB_STATEMENT=Or.ATTR_DB_NAME=Or.ATTR_DB_CONNECTION_STRING=Or.ATTR_DB_CLIENT_CONNECTION_STATE=Or.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Or.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Or.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Or.ATTR_DB_CONNECTION_STRING="db.connection_string";Or.ATTR_DB_NAME="db.name";Or.ATTR_DB_STATEMENT="db.statement";Or.ATTR_DB_SYSTEM="db.system";Or.ATTR_DB_USER="db.user";Or.ATTR_NET_PEER_NAME="net.peer.name";Or.ATTR_NET_PEER_PORT="net.peer.port";Or.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Or.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Or.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Or.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Or.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var _X=M(bk=>{"use strict";A();Object.defineProperty(bk,"__esModule",{value:!0});bk.SpanNames=void 0;var U1t;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(U1t=bk.SpanNames||(bk.SpanNames={}))});var A2e=M(sr=>{"use strict";A();Object.defineProperty(sr,"__esModule",{value:!0});sr.sanitizedErrorMessage=sr.isObjectWithTextString=sr.getErrorMessage=sr.patchClientConnectCallback=sr.patchCallbackPGPool=sr.updateCounter=sr.getPoolName=sr.patchCallback=sr.handleExecutionResult=sr.handleConfigQuery=sr.shouldSkipInstrumentation=sr.getSemanticAttributesFromPoolConnection=sr.getSemanticAttributesFromConnection=sr.getConnectionString=sr.parseAndMaskConnectionString=sr.parseNormalizedOperationName=sr.getQuerySpanName=void 0;var CE=(He(),Me(tt)),C6=gX(),mp=(Xn(),Me(qr)),yi=hX(),iT=cn(),c2e=_X();function l2e(e,t){if(!t)return c2e.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:d2e(t.text);return`${c2e.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}sr.getQuerySpanName=l2e;function d2e(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}sr.parseNormalizedOperationName=d2e;function p2e(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}sr.parseAndMaskConnectionString=p2e;function EX(e){if("connectionString"in e&&e.connectionString)return p2e(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}sr.getConnectionString=EX;function v6(e){if(Number.isInteger(e))return e}function f2e(e,t){let n={};return t&iT.SemconvStability.OLD&&(n={...n,[yi.ATTR_DB_SYSTEM]:yi.DB_SYSTEM_VALUE_POSTGRESQL,[yi.ATTR_DB_NAME]:e.database,[yi.ATTR_DB_CONNECTION_STRING]:EX(e),[yi.ATTR_DB_USER]:e.user,[yi.ATTR_NET_PEER_NAME]:e.host,[yi.ATTR_NET_PEER_PORT]:v6(e.port)}),t&iT.SemconvStability.STABLE&&(n={...n,[mp.ATTR_DB_SYSTEM_NAME]:mp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[mp.ATTR_DB_NAMESPACE]:e.namespace,[mp.ATTR_SERVER_ADDRESS]:e.host,[mp.ATTR_SERVER_PORT]:v6(e.port)}),n}sr.getSemanticAttributesFromConnection=f2e;function Q1t(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[C6.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[C6.AttributeNames.MAX_CLIENT]:e.maxClient};return t&iT.SemconvStability.OLD&&(r={...r,[yi.ATTR_DB_SYSTEM]:yi.DB_SYSTEM_VALUE_POSTGRESQL,[yi.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[yi.ATTR_DB_CONNECTION_STRING]:EX(e),[yi.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[yi.ATTR_NET_PEER_PORT]:Number(n?.port)||v6(e.port),[yi.ATTR_DB_USER]:n?.username??e.user}),t&iT.SemconvStability.STABLE&&(r={...r,[mp.ATTR_DB_SYSTEM_NAME]:mp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[mp.ATTR_DB_NAMESPACE]:e.namespace,[mp.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[mp.ATTR_SERVER_PORT]:Number(n?.port)||v6(e.port)}),r}sr.getSemanticAttributesFromPoolConnection=Q1t;function F1t(e){return e.requireParentSpan===!0&&CE.trace.getSpan(CE.context.active())===void 0}sr.shouldSkipInstrumentation=F1t;function G1t(e,t,n,r){let{connectionParameters:o}=this,i=o.database,s=l2e(i,r),u=e.startSpan(s,{kind:CE.SpanKind.CLIENT,attributes:f2e(o,n)});if(!r)return u;if(r.text&&(n&iT.SemconvStability.OLD&&u.setAttribute(yi.ATTR_DB_STATEMENT,r.text),n&iT.SemconvStability.STABLE&&u.setAttribute(mp.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let l=r.values.map(f=>f==null?"null":f instanceof Buffer?f.toString():typeof f=="object"?typeof f.toPostgres=="function"?f.toPostgres():JSON.stringify(f):f.toString());u.setAttribute(C6.AttributeNames.PG_VALUES,l)}catch(l){CE.diag.error("failed to stringify ",r.values,l)}return typeof r.name=="string"&&u.setAttribute(C6.AttributeNames.PG_PLAN,r.name),u}sr.handleConfigQuery=G1t;function m2e(e,t,n){typeof e.responseHook=="function"&&(0,iT.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&CE.diag.error("Error running response hook",r)},!0)}sr.handleExecutionResult=m2e;function j1t(e,t,n,r,o){return function(s,u){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(r[mp.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(R6(s)),t.setStatus({code:CE.SpanStatusCode.ERROR,message:s.message})):m2e(e,t,u),o(),t.end(),n.call(this,s,u)}}sr.patchCallback=j1t;function z1t(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()}sr.getPoolName=z1t;function H1t(e,t,n,r,o){let i=t.totalCount,s=t.waitingCount,u=t.idleCount,l=i-u;return n.add(l-o.used,{[yi.ATTR_DB_CLIENT_CONNECTION_STATE]:yi.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[yi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(u-o.idle,{[yi.ATTR_DB_CLIENT_CONNECTION_STATE]:yi.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[yi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-o.pending,{[yi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:u,pending:s}}sr.updateCounter=H1t;function $1t(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(R6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}sr.patchCallbackPGPool=$1t;function q1t(e,t){return function(r){r&&(r instanceof Error&&e.recordException(R6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}sr.patchClientConnectCallback=q1t;function V1t(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}sr.getErrorMessage=V1t;function Y1t(e){return typeof e=="object"&&typeof e?.text=="string"}sr.isObjectWithTextString=Y1t;function R6(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}sr.sanitizedErrorMessage=R6});var g2e=M(wR=>{"use strict";A();Object.defineProperty(wR,"__esModule",{value:!0});wR.PACKAGE_NAME=wR.PACKAGE_VERSION=void 0;wR.PACKAGE_VERSION="0.66.0";wR.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var T2e=M(D6=>{"use strict";A();Object.defineProperty(D6,"__esModule",{value:!0});D6.PgInstrumentation=void 0;var tc=cn(),Jr=(He(),Me(tt)),h2e=u2e(),ri=A2e(),_2e=nX(),E2e=g2e(),y2e=_X(),x6=Rr(),Nf=(Xn(),Me(qr)),Ik=hX();function BR(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var yX=class extends tc.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(E2e.PACKAGE_NAME,E2e.PACKAGE_VERSION,t),this._semconvStability=(0,tc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(Nf.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Jr.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(Ik.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(Ik.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 tc.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new tc.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new tc.InstrumentationNodeModuleDefinition("pg",t,u=>{let l=BR(u);return this._patchPgClient(l.Client),u},u=>{let l=BR(u);return this._unpatchPgClient(l.Client),u},[o,r]),s=new tc.InstrumentationNodeModuleDefinition("pg-pool",n,u=>{let l=BR(u);return(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect"),this._wrap(l.prototype,"connect",this._getPoolConnectPatch()),l},u=>{let l=BR(u);(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=BR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.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=BR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ri.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(y2e.SpanNames.CONNECT,{kind:Jr.SpanKind.CLIENT,attributes:ri.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let l=Jr.trace.getSpan(Jr.context.active());o=ri.patchClientConnectCallback(s,o),l&&(o=Jr.context.bind(Jr.context.active(),o))}let u=Jr.context.with(Jr.trace.setSpan(Jr.context.active(),s),()=>n.call(this,o));return S2e(s,u)}}recordOperationDuration(t,n){let r={},o=[Nf.ATTR_DB_NAMESPACE,Nf.ATTR_ERROR_TYPE,Nf.ATTR_SERVER_PORT,Nf.ATTR_SERVER_ADDRESS,Nf.ATTR_DB_OPERATION_NAME];this._semconvStability&tc.SemconvStability.OLD&&o.push(Ik.ATTR_DB_SYSTEM),this._semconvStability&tc.SemconvStability.STABLE&&o.push(Nf.ATTR_DB_SYSTEM_NAME),o.forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,x6.hrTimeToMilliseconds)((0,x6.hrTimeDuration)(n,(0,x6.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ri.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,x6.hrTime)(),s=o[0],u=typeof s=="string",l=ri.isObjectWithTextString(s),f=u?{text:s,values:Array.isArray(o[1])?o[1]:void 0}:l?{...s,name:s.name,text:s.text,values:s.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[Ik.ATTR_DB_SYSTEM]:Ik.DB_SYSTEM_VALUE_POSTGRESQL,[Nf.ATTR_DB_NAMESPACE]:this.database,[Nf.ATTR_SERVER_PORT]:this.connectionParameters.port,[Nf.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};f?.text&&(h[Nf.ATTR_DB_OPERATION_NAME]=ri.parseNormalizedOperationName(f?.text));let _=()=>{t.recordOperationDuration(h,i)},E=t.getConfig(),T=ri.handleConfigQuery.call(this,t.tracer,E,t._semconvStability,f);if(E.addSqlCommenterCommentToQueries&&(u?o[0]=(0,_2e.addSqlCommenterComment)(T,s):l&&!("name"in s)&&(o[0]={...s,text:(0,_2e.addSqlCommenterComment)(T,s.text)})),o.length>0){let x=Jr.trace.getSpan(Jr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ri.patchCallback(E,T,o[o.length-1],h,_),x&&(o[o.length-1]=Jr.context.bind(Jr.context.active(),o[o.length-1]));else if(typeof f?.callback=="function"){let k=ri.patchCallback(t.getConfig(),T,f.callback,h,_);x&&(k=Jr.context.bind(Jr.context.active(),k)),o[0].callback=k}}let{requestHook:v}=E;typeof v=="function"&&f&&(0,tc.safeExecuteInTheMiddle)(()=>{let{database:x,host:k,port:P,user:j}=this.connectionParameters;v(T,{connection:{database:x,host:k,port:P,user:j},query:{text:f.text,values:f.values,name:f.name}})},x=>{x&&t._diag.error("Error running query hook",x)},!0);let R;try{R=n.apply(this,o)}catch(x){throw x instanceof Error&&T.recordException(ri.sanitizedErrorMessage(x)),T.setStatus({code:Jr.SpanStatusCode.ERROR,message:ri.getErrorMessage(x)}),T.end(),x}return R instanceof Promise?R.then(x=>new Promise(k=>{ri.handleExecutionResult(t.getConfig(),T,x),_(),T.end(),k(x)})).catch(x=>new Promise((k,P)=>{x instanceof Error&&T.recordException(ri.sanitizedErrorMessage(x)),T.setStatus({code:Jr.SpanStatusCode.ERROR,message:x.message}),_(),T.end(),P(x)})):R})}_setPoolConnectEventListeners(t){if(t[h2e.EVENT_LISTENERS_SET])return;let n=ri.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=ri.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=ri.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=ri.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=ri.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[h2e.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ri.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(y2e.SpanNames.POOL_CONNECT,{kind:Jr.SpanKind.CLIENT,attributes:ri.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let l=Jr.trace.getSpan(Jr.context.active());o=ri.patchCallbackPGPool(s,o),l&&(o=Jr.context.bind(Jr.context.active(),o))}let u=Jr.context.with(Jr.trace.setSpan(Jr.context.active(),s),()=>n.call(this,o));return S2e(s,u)}}};D6.PgInstrumentation=yX;function S2e(e,t){if(!(t instanceof Promise))return t;let n=t;return Jr.context.bind(Jr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(ri.sanitizedErrorMessage(r)),e.setStatus({code:Jr.SpanStatusCode.ERROR,message:ri.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var b2e=M(kR=>{"use strict";A();Object.defineProperty(kR,"__esModule",{value:!0});kR.AttributeNames=kR.PgInstrumentation=void 0;var K1t=T2e();Object.defineProperty(kR,"PgInstrumentation",{enumerable:!0,get:function(){return K1t.PgInstrumentation}});var J1t=gX();Object.defineProperty(kR,"AttributeNames",{enumerable:!0,get:function(){return J1t.AttributeNames}})});var I2e,C2e,v2e,Z1t,R2e,x2e=B(()=>{A();I2e=ue(b2e(),1);_r();C2e="Postgres",v2e=ct(C2e,I2e.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){Yr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),Z1t=(e=>({name:C2e,setupOnce(){v2e(e)}})),R2e=Z1t});var vE,TX,D2e,W1t,X1t,N2e,SX,eNt,w2e,B2e=B(()=>{A();He();vE=ue(cn(),1);Xn();mt();_r();KS();TX="PostgresJs",D2e=[">=3.0.0 <4"],W1t=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,X1t=Symbol.for("sentry.query.from.instrumented.sql"),N2e=ct(TX,e=>new SX({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),SX=class extends vE.InstrumentationBase{constructor(t){super("sentry-postgres-js",er,t)}init(){let t=new vE.InstrumentationNodeModuleDefinition("postgres",D2e,n=>{try{return this._patchPostgres(n)}catch(r){return ws&&W.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new vE.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,D2e,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 ws&&W.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...s){let u=Reflect.construct(r,s);if(!u||typeof u!="function")return ws&&W.warn("postgres() did not return a valid instance"),u;let l=o.getConfig();return SK(u,{requireParentSpan:l.requireParentSpan,requestHook:l.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}return n?i:(EB(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return Jt.getSpan(We.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(QC,r);return}let o=n?.match(W1t);o?.[1]&&t.setAttribute(QC,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[X1t])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return ia({name:s||"postgresjs.query",op:"db"},u=>{Yr(u,"auto.db.postgresjs"),u.setAttributes({[mS]:"postgres",[kV]:s});let l=n.getConfig(),{requestHook:f}=l;f&&(0,vE.safeExecuteInTheMiddle)(()=>f(u,s,void 0),E=>{E&&(u.setAttribute("sentry.hook.error","requestHook failed"),ws&&W.error(`Error in requestHook for ${TX} integration:`,E))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(E,T,v)=>{try{n._setOperationName(u,s,v?.[0]?.command),u.end()}catch(R){ws&&W.error("Error ending span in resolve callback:",R)}return Reflect.apply(E,T,v)}});let _=this.reject;this.reject=new Proxy(_,{apply:(E,T,v)=>{try{u.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),u.setAttribute(OV,v?.[0]?.code||"unknown"),u.setAttribute(PV,v?.[0]?.name||"unknown"),n._setOperationName(u,s),u.end()}catch(R){ws&&W.error("Error ending span in reject callback:",R)}return Reflect.apply(E,T,v)}});try{return r.apply(this,o)}catch(E){throw u.setStatus({code:2,message:E instanceof Error?E.message:"unknown_error"}),u.end(),E}})},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}},eNt=(e=>({name:TX,setupOnce(){N2e(e)}})),w2e=eNt});var k2e=M(Ck=>{"use strict";A();Object.defineProperty(Ck,"__esModule",{value:!0});Ck.SeverityNumber=void 0;var tNt;(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"})(tNt=Ck.SeverityNumber||(Ck.SeverityNumber={}))});var w6=M(OR=>{"use strict";A();Object.defineProperty(OR,"__esModule",{value:!0});OR.NOOP_LOGGER=OR.NoopLogger=void 0;var N6=class{emit(t){}};OR.NoopLogger=N6;OR.NOOP_LOGGER=new N6});var k6=M(PR=>{"use strict";A();Object.defineProperty(PR,"__esModule",{value:!0});PR.NOOP_LOGGER_PROVIDER=PR.NoopLoggerProvider=void 0;var nNt=w6(),B6=class{getLogger(t,n,r){return new nNt.NoopLogger}};PR.NoopLoggerProvider=B6;PR.NOOP_LOGGER_PROVIDER=new B6});var IX=M(O6=>{"use strict";A();Object.defineProperty(O6,"__esModule",{value:!0});O6.ProxyLogger=void 0;var rNt=w6(),bX=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):rNt.NOOP_LOGGER}};O6.ProxyLogger=bX});var vX=M(P6=>{"use strict";A();Object.defineProperty(P6,"__esModule",{value:!0});P6.ProxyLoggerProvider=void 0;var oNt=k6(),iNt=IX(),CX=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new iNt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:oNt.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)}};P6.ProxyLoggerProvider=CX});var O2e=M(M6=>{"use strict";A();Object.defineProperty(M6,"__esModule",{value:!0});M6._globalThis=void 0;M6._globalThis=typeof globalThis=="object"?globalThis:global});var P2e=M(L6=>{"use strict";A();Object.defineProperty(L6,"__esModule",{value:!0});L6._globalThis=void 0;var sNt=O2e();Object.defineProperty(L6,"_globalThis",{enumerable:!0,get:function(){return sNt._globalThis}})});var M2e=M(U6=>{"use strict";A();Object.defineProperty(U6,"__esModule",{value:!0});U6._globalThis=void 0;var aNt=P2e();Object.defineProperty(U6,"_globalThis",{enumerable:!0,get:function(){return aNt._globalThis}})});var L2e=M(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;var uNt=M2e();nA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");nA._global=uNt._globalThis;function cNt(e,t,n){return r=>r===e?t:n}nA.makeGetter=cNt;nA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var Q2e=M(Q6=>{"use strict";A();Object.defineProperty(Q6,"__esModule",{value:!0});Q6.LogsAPI=void 0;var Ap=L2e(),lNt=k6(),U2e=vX(),RX=class e{constructor(){this._proxyLoggerProvider=new U2e.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Ap._global[Ap.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Ap._global[Ap.GLOBAL_LOGS_API_KEY]=(0,Ap.makeGetter)(Ap.API_BACKWARDS_COMPATIBILITY_VERSION,t,lNt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Ap._global[Ap.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Ap._global,Ap.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Ap._global[Ap.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new U2e.ProxyLoggerProvider}};Q6.LogsAPI=RX});var xX=M(la=>{"use strict";A();Object.defineProperty(la,"__esModule",{value:!0});la.logs=la.ProxyLoggerProvider=la.ProxyLogger=la.NoopLoggerProvider=la.NOOP_LOGGER_PROVIDER=la.NoopLogger=la.NOOP_LOGGER=la.SeverityNumber=void 0;var dNt=k2e();Object.defineProperty(la,"SeverityNumber",{enumerable:!0,get:function(){return dNt.SeverityNumber}});var F2e=w6();Object.defineProperty(la,"NOOP_LOGGER",{enumerable:!0,get:function(){return F2e.NOOP_LOGGER}});Object.defineProperty(la,"NoopLogger",{enumerable:!0,get:function(){return F2e.NoopLogger}});var G2e=k6();Object.defineProperty(la,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return G2e.NOOP_LOGGER_PROVIDER}});Object.defineProperty(la,"NoopLoggerProvider",{enumerable:!0,get:function(){return G2e.NoopLoggerProvider}});var pNt=IX();Object.defineProperty(la,"ProxyLogger",{enumerable:!0,get:function(){return pNt.ProxyLogger}});var fNt=vX();Object.defineProperty(la,"ProxyLoggerProvider",{enumerable:!0,get:function(){return fNt.ProxyLoggerProvider}});var mNt=Q2e();la.logs=mNt.LogsAPI.getInstance()});var j2e=M(MR=>{"use strict";A();Object.defineProperty(MR,"__esModule",{value:!0});MR.disableInstrumentations=MR.enableInstrumentations=void 0;function ANt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}MR.enableInstrumentations=ANt;function gNt(e){e.forEach(t=>t.disable())}MR.disableInstrumentations=gNt});var $2e=M(F6=>{"use strict";A();Object.defineProperty(F6,"__esModule",{value:!0});F6.registerInstrumentations=void 0;var z2e=(He(),Me(tt)),hNt=xX(),H2e=j2e();function _Nt(e){let t=e.tracerProvider||z2e.trace.getTracerProvider(),n=e.meterProvider||z2e.metrics.getMeterProvider(),r=e.loggerProvider||hNt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,H2e.enableInstrumentations)(o,t,n,r),()=>{(0,H2e.disableInstrumentations)(o)}}F6.registerInstrumentations=_Nt});var eLe=M(G6=>{"use strict";A();Object.defineProperty(G6,"__esModule",{value:!0});G6.satisfies=void 0;var BX=(He(),Me(tt)),J2e=/^(?: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-]+)*))?$/,ENt=/^(?<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-]+)*))?$/,yNt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function SNt(e,t,n){if(!TNt(e))return BX.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=vNt(e);if(!r)return!1;let o=[],i=Z2e(r,t,o,n);return i&&!n?.includePrerelease?INt(r,o):i}G6.satisfies=SNt;function TNt(e){return typeof e=="string"&&J2e.test(e)}function Z2e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(DX(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=VNt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!DX(e,i,n,r))return!1;return!0}return DX(e,t,n,r)}function DX(e,t,n,r){if(t=CNt(t,r),t.includes(" "))return Z2e(e,t,n,r);{let o=RNt(t);return n.push(o),bNt(e,o)}}function bNt(e,t){if(t.invalid)return!1;if(!t.version||wX(t.version))return!0;let n=V2e(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=V2e(r,o)}return yNt[t.op]?.includes(n)}function INt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function CNt(e,t){return e=e.trim(),e=$Nt(e,t),e=HNt(e),e=qNt(e,t),e=e.trim(),e}function nc(e){return!e||e.toLowerCase()==="x"||e==="*"}function vNt(e){let t=e.match(J2e);if(!t){BX.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function RNt(e){if(!e)return{};let t=e.match(ENt);if(!t)return BX.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function wX(e){return e==="*"||e==="x"||e==="X"}function q2e(e){let t=parseInt(e,10);return isNaN(t)?e:t}function xNt(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 DNt(e,t){if(wX(e)||wX(t))return 0;let[n,r]=xNt(q2e(e),q2e(t));return n>r?1:n<r?-1:0}function V2e(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=DNt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var W2e="[a-zA-Z0-9-]",X2e="0|[1-9]\\d*",NNt=`\\d*[a-zA-Z-]${W2e}*`,wNt="((?:<|>)?=?)",Y2e=`(?:${X2e}|${NNt})`,BNt=`(?:-(${Y2e}(?:\\.${Y2e})*))`,K2e=`${W2e}+`,kNt=`(?:\\+(${K2e}(?:\\.${K2e})*))`,NX=`${X2e}|x|X|\\*`,vk=`[v=\\s]*(${NX})(?:\\.(${NX})(?:\\.(${NX})(?:${BNt})?${kNt}?)?)?`,ONt=`^${wNt}\\s*${vk}$`,PNt=new RegExp(ONt),MNt=`^\\s*(${vk})\\s+-\\s+(${vk})\\s*$`,LNt=new RegExp(MNt),UNt="(?:~>?)",QNt=`^${UNt}${vk}$`,FNt=new RegExp(QNt),GNt="(?:\\^)",jNt=`^${GNt}${vk}$`,zNt=new RegExp(jNt);function HNt(e){let t=FNt;return e.replace(t,(n,r,o,i,s)=>{let u;return nc(r)?u="":nc(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:nc(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function $Nt(e,t){let n=zNt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return nc(i)?f="":nc(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:nc(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function qNt(e,t){let n=PNt;return e.replace(n,(r,o,i,s,u,l)=>{let f=nc(i),h=f||nc(s),_=h||nc(u),E=_;return o==="="&&E&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&E?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function VNt(e,t){let n=LNt;return e.replace(n,(r,o,i,s,u,l,f,h,_,E,T,v)=>(nc(i)?o="":nc(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:nc(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,nc(_)?h="":nc(E)?h=`<${+_+1}.0.0-0`:nc(T)?h=`<${_}.${+E+1}.0-0`:v?h=`<=${_}.${E}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${E}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var kX=M(Fa=>{"use strict";A();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.massUnwrap=Fa.unwrap=Fa.massWrap=Fa.wrap=void 0;var rc=console.error.bind(console);function Rk(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 YNt=(e,t,n)=>{if(!e||!e[t]){rc("no original function "+String(t)+" to wrap");return}if(!n){rc("no wrapper function"),rc(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){rc("original object and wrapper must be functions");return}let o=n(r,t);return Rk(o,"__original",r),Rk(o,"__unwrap",()=>{e[t]===o&&Rk(e,t,r)}),Rk(o,"__wrapped",!0),Rk(e,t,o),o};Fa.wrap=YNt;var KNt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Fa.wrap)(r,o,n)})})};Fa.massWrap=KNt;var JNt=(e,t)=>{if(!e||!e[t]){rc("no function to unwrap."),rc(new Error().stack);return}let n=e[t];if(!n.__unwrap)rc("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Fa.unwrap=JNt;var ZNt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Fa.unwrap)(n,r)})})};Fa.massUnwrap=ZNt;function xk(e){e&&e.logger&&(typeof e.logger!="function"?rc("new logger isn't a function, not replacing"):rc=e.logger)}Fa.default=xk;xk.wrap=Fa.wrap;xk.massWrap=Fa.massWrap;xk.unwrap=Fa.unwrap;xk.massUnwrap=Fa.massUnwrap});var tLe=M(z6=>{"use strict";A();Object.defineProperty(z6,"__esModule",{value:!0});z6.InstrumentationAbstract=void 0;var OX=(He(),Me(tt)),WNt=xX(),j6=kX(),PX=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=OX.diag.createComponentLogger({namespace:t}),this._tracer=OX.trace.getTracer(t,n),this._meter=OX.metrics.getMeter(t,n),this._logger=WNt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=j6.wrap;_unwrap=j6.unwrap;_massWrap=j6.massWrap;_massUnwrap=j6.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)}}};z6.InstrumentationAbstract=PX});var nLe=M(RE=>{"use strict";A();Object.defineProperty(RE,"__esModule",{value:!0});RE.ModuleNameTrie=RE.ModuleNameSeparator=void 0;RE.ModuleNameSeparator="/";var H6=class{hooks=[];children=new Map},MX=class{_trie=new H6;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(RE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new H6,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=[],s=!0;for(let u of t.split(RE.ModuleNameSeparator)){let l=o.children.get(u);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};RE.ModuleNameTrie=MX});var oLe=M($6=>{"use strict";A();Object.defineProperty($6,"__esModule",{value:!0});$6.RequireInTheMiddleSingleton=void 0;var XNt=yS(),rLe=Ue("path"),LX=nLe(),ewt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),UX=class e{_moduleNameTrie=new LX.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new XNt.Hook(null,{internals:!0},(t,n,r)=>{let o=twt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return ewt?new e:this._instance=this._instance??new e}};$6.RequireInTheMiddleSingleton=UX;function twt(e){return rLe.sep!==LX.ModuleNameSeparator?e.split(rLe.sep).join(LX.ModuleNameSeparator):e}});var QX=M(xE=>{"use strict";A();Object.defineProperty(xE,"__esModule",{value:!0});xE.isWrapped=xE.safeExecuteInTheMiddleAsync=xE.safeExecuteInTheMiddle=void 0;function nwt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}xE.safeExecuteInTheMiddle=nwt;async function rwt(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}}xE.safeExecuteInTheMiddleAsync=rwt;function owt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}xE.isWrapped=owt});var aLe=M(q6=>{"use strict";A();Object.defineProperty(q6,"__esModule",{value:!0});q6.InstrumentationBase=void 0;var Dk=Ue("path"),iLe=Ue("util"),iwt=eLe(),FX=kX(),swt=tLe(),awt=oLe(),uwt=yW(),Nk=(He(),Me(tt)),cwt=yS(),lwt=Ue("fs"),dwt=QX(),GX=class extends swt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=awt.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,dwt.isWrapped)(t[n])&&this._unwrap(t,n),iLe.types.isProxy(t)){let o=(0,FX.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,FX.wrap)(t,n,r)};_unwrap=(t,n)=>iLe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,FX.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{Nk.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Nk.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{Nk.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Nk.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=Ue.resolve(n);Ue.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,lwt.readFileSync)(Dk.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{Nk.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 sLe(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 s=t.files??[],u=Dk.normalize(r);return s.filter(f=>f.name===u).filter(f=>sLe(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,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(f,t.moduleVersion)):f),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=(s,u,l)=>{if(!l&&Dk.isAbsolute(u)){let f=Dk.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=Dk.isAbsolute(t.name)?new cwt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new uwt.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}};q6.InstrumentationBase=GX;function sLe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,iwt.satisfies)(t,r,{includePrerelease:n}))}});var uLe=M(V6=>{"use strict";A();Object.defineProperty(V6,"__esModule",{value:!0});V6.normalize=void 0;var pwt=Ue("path");Object.defineProperty(V6,"normalize",{enumerable:!0,get:function(){return pwt.normalize}})});var cLe=M(LR=>{"use strict";A();Object.defineProperty(LR,"__esModule",{value:!0});LR.normalize=LR.InstrumentationBase=void 0;var fwt=aLe();Object.defineProperty(LR,"InstrumentationBase",{enumerable:!0,get:function(){return fwt.InstrumentationBase}});var mwt=uLe();Object.defineProperty(LR,"normalize",{enumerable:!0,get:function(){return mwt.normalize}})});var jX=M(UR=>{"use strict";A();Object.defineProperty(UR,"__esModule",{value:!0});UR.normalize=UR.InstrumentationBase=void 0;var lLe=cLe();Object.defineProperty(UR,"InstrumentationBase",{enumerable:!0,get:function(){return lLe.InstrumentationBase}});Object.defineProperty(UR,"normalize",{enumerable:!0,get:function(){return lLe.normalize}})});var dLe=M(Y6=>{"use strict";A();Object.defineProperty(Y6,"__esModule",{value:!0});Y6.InstrumentationNodeModuleDefinition=void 0;var zX=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||[]}};Y6.InstrumentationNodeModuleDefinition=zX});var pLe=M(K6=>{"use strict";A();Object.defineProperty(K6,"__esModule",{value:!0});K6.InstrumentationNodeModuleFile=void 0;var Awt=jX(),HX=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,Awt.normalize)(t)}};K6.InstrumentationNodeModuleFile=HX});var fLe=M(sT=>{"use strict";A();Object.defineProperty(sT,"__esModule",{value:!0});sT.semconvStabilityFromStr=sT.SemconvStability=void 0;var J6;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(J6=sT.SemconvStability||(sT.SemconvStability={}));function gwt(e,t){let n=J6.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=J6.DUPLICATE;break}else o.toLowerCase()===e&&(n=J6.STABLE);return n}sT.semconvStabilityFromStr=gwt});var ALe=M(ds=>{"use strict";A();Object.defineProperty(ds,"__esModule",{value:!0});ds.semconvStabilityFromStr=ds.SemconvStability=ds.safeExecuteInTheMiddleAsync=ds.safeExecuteInTheMiddle=ds.isWrapped=ds.InstrumentationNodeModuleFile=ds.InstrumentationNodeModuleDefinition=ds.InstrumentationBase=ds.registerInstrumentations=void 0;var hwt=$2e();Object.defineProperty(ds,"registerInstrumentations",{enumerable:!0,get:function(){return hwt.registerInstrumentations}});var _wt=jX();Object.defineProperty(ds,"InstrumentationBase",{enumerable:!0,get:function(){return _wt.InstrumentationBase}});var Ewt=dLe();Object.defineProperty(ds,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return Ewt.InstrumentationNodeModuleDefinition}});var ywt=pLe();Object.defineProperty(ds,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return ywt.InstrumentationNodeModuleFile}});var $X=QX();Object.defineProperty(ds,"isWrapped",{enumerable:!0,get:function(){return $X.isWrapped}});Object.defineProperty(ds,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return $X.safeExecuteInTheMiddle}});Object.defineProperty(ds,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return $X.safeExecuteInTheMiddleAsync}});var mLe=fLe();Object.defineProperty(ds,"SemconvStability",{enumerable:!0,get:function(){return mLe.SemconvStability}});Object.defineProperty(ds,"semconvStabilityFromStr",{enumerable:!0,get:function(){return mLe.semconvStabilityFromStr}})});function bwt(){let e=QR[VX];return e?.helper?e.helper:QR[qX]?.helper}function Iwt(e){let t={helper:e};QR[VX]=t,QR[qX]=t}function Cwt(){delete QR[VX],delete QR[qX]}function xwt(e){return e==="client"?mo.CLIENT:mo.INTERNAL}function _Le(e,t,n,r,o){if(ELe(t.name,o))return;let i={attributes:t.attributes,kind:xwt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,s=>{r.set(t.id,s.spanContext().spanId),t.links&&s.addLinks(t.links.flatMap(l=>{let f=r.get(l);return f?{context:{spanId:f,traceId:s.spanContext().traceId,traceFlags:s.spanContext().traceFlags}}:[]}));let u=n.filter(l=>l.parentId===t.id);for(let l of u)_Le(e,l,n,r,o);s.end(t.endTime)})}function gLe(e,t){return Nwt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function Nwt(e){return e!=null&&typeof e.then=="function"}function ELe(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var Z6,Swt,Twt,qX,VX,QR,vwt,Rwt,Dwt,yLe,hLe,wwt,Bwt,SLe,TLe=B(()=>{A();He();Z6=ue(ALe(),1);He();Swt={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"}},Twt=Swt.version.split(".")[0],qX="PRISMA_INSTRUMENTATION",VX=`V${Twt}_PRISMA_INSTRUMENTATION`,QR=globalThis;vwt=process.env.PRISMA_SHOW_ALL_TRACES==="true",Rwt="00-10-10-00";Dwt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=Jt.getSpanContext(e??We.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:Rwt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)_Le(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return We.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!vwt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(ELe(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return gLe(i,t(i,r))}return n.startActiveSpan(o,e,i=>gLe(i,t(i,r)))}};yLe={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},hLe=yLe.version,wwt=yLe.name,Bwt="@prisma/client",SLe=class extends Z6.InstrumentationBase{tracerProvider;constructor(e={}){super(wwt,hLe,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new Z6.InstrumentationNodeModuleDefinition(Bwt,[hLe])]}enable(){let e=this._config;Iwt(new Dwt({tracerProvider:this.tracerProvider??Jt.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){Cwt()}isEnabled(){return bwt()!==void 0}}});function kwt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function ILe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function Owt(e){return e==="client"?mo.CLIENT:mo.INTERNAL}var bLe,YX,Pwt,CLe,vLe=B(()=>{A();He();TLe();mt();_r();bLe="Prisma";YX=class extends SLe{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=ILe();kwt(t)&&(t.createEngineSpan=n=>{let r=Jt.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){ei(()=>{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 s=Owt(i.kind),u=i.parent_span_id,l=i.span_id,f=i.trace_id,h=i.links?.map(E=>({context:{traceId:E.trace_id,spanId:E.span_id,traceFlags:ou.SAMPLED}})),_=Jt.setSpanContext(We.active(),{traceId:f,spanId:u,traceFlags:ou.SAMPLED});We.with(_,()=>{let E={generateTraceId:()=>f,generateSpanId:()=>l};r._idGenerator=E,r.startSpan(i.name,{kind:s,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};Pwt=ct(bLe,e=>new YX(e)),CLe=e=>({name:bLe,setupOnce(){Pwt(e)},setup(t){ILe()&&t.on("spanStart",n=>{let r=Pt(n);r.description?.startsWith("prisma:")&&n.setAttribute(Lt,"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 RLe=M(FR=>{"use strict";A();Object.defineProperty(FR,"__esModule",{value:!0});FR.PACKAGE_NAME=FR.PACKAGE_VERSION=void 0;FR.PACKAGE_VERSION="0.60.0";FR.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var KX=M(rA=>{"use strict";A();Object.defineProperty(rA,"__esModule",{value:!0});rA.HapiLifecycleMethodNames=rA.HapiLayerType=rA.handlerPatched=rA.HapiComponentName=void 0;rA.HapiComponentName="@hapi/hapi";rA.handlerPatched=Symbol("hapi-handler-patched");rA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};rA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var xLe=M(W6=>{"use strict";A();Object.defineProperty(W6,"__esModule",{value:!0});W6.ATTR_HTTP_METHOD=void 0;W6.ATTR_HTTP_METHOD="http.method"});var JX=M(wk=>{"use strict";A();Object.defineProperty(wk,"__esModule",{value:!0});wk.AttributeNames=void 0;var Mwt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(Mwt=wk.AttributeNames||(wk.AttributeNames={}))});var wLe=M(ps=>{"use strict";A();Object.defineProperty(ps,"__esModule",{value:!0});ps.getPluginFromInput=ps.getExtMetadata=ps.getRouteMetadata=ps.isPatchableExtMethod=ps.isDirectExtInput=ps.isLifecycleExtEventObj=ps.isLifecycleExtType=ps.getPluginName=void 0;var DLe=(Xn(),Me(qr)),Lwt=xLe(),Bk=KX(),DE=JX(),NLe=cn();function Uwt(e){return e.name?e.name:e.pkg.name}ps.getPluginName=Uwt;var Qwt=e=>typeof e=="string"&&Bk.HapiLifecycleMethodNames.has(e);ps.isLifecycleExtType=Qwt;var Fwt=e=>{let t=e?.type;return t!==void 0&&(0,ps.isLifecycleExtType)(t)};ps.isLifecycleExtEventObj=Fwt;var Gwt=e=>Array.isArray(e)&&e.length<=3&&(0,ps.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ps.isDirectExtInput=Gwt;var jwt=e=>!Array.isArray(e);ps.isPatchableExtMethod=jwt;var zwt=(e,t,n)=>{let r={[DLe.ATTR_HTTP_ROUTE]:e.path};t&NLe.SemconvStability.OLD&&(r[Lwt.ATTR_HTTP_METHOD]=e.method),t&NLe.SemconvStability.STABLE&&(r[DLe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[DE.AttributeNames.HAPI_TYPE]=Bk.HapiLayerType.PLUGIN,r[DE.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[DE.AttributeNames.HAPI_TYPE]=Bk.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ps.getRouteMetadata=zwt;var Hwt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:Bk.HapiLayerType.EXT,[DE.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:Bk.HapiLayerType.EXT},name:r}};ps.getExtMetadata=Hwt;var $wt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ps.getPluginFromInput=$wt});var OLe=M(X6=>{"use strict";A();Object.defineProperty(X6,"__esModule",{value:!0});X6.HapiInstrumentation=void 0;var od=(He(),Me(tt)),BLe=Rr(),kk=cn(),kLe=RLe(),Ok=KX(),Xg=wLe(),ZX=class extends kk.InstrumentationBase{_semconvStability;constructor(t={}){super(kLe.PACKAGE_NAME,kLe.PACKAGE_VERSION,t),this._semconvStability=(0,kk.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new kk.InstrumentationNodeModuleDefinition(Ok.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,kk.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,kk.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 s=t.apply(this,[i]);return r._wrap(s,"route",u=>n._getServerRoutePatch.bind(n)(u)),r._wrap(s,"ext",u=>n._getServerExtPatch.bind(n)(u)),r._wrap(s,"register",n._getServerRegisterPatch.bind(n)),s}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let s of o){let u=(0,Xg.getPluginFromInput)(s);n._wrapRegisterHandler(u)}else{let s=(0,Xg.getPluginFromInput)(o);n._wrapRegisterHandler(s)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let s=i[0];for(let u=0;u<s.length;u++){let l=s[u];if((0,Xg.isLifecycleExtType)(l.type)){let f=l,h=r._wrapExtMethods(f.method,l.type,n);f.method=h,s[u]=f}}return t.apply(this,i)}else if((0,Xg.isDirectExtInput)(i)){let s=i,u=s[1],l=r._wrapExtMethods(u,s[0],n);return t.apply(this,[s[0],l,s[2]])}else if((0,Xg.isLifecycleExtEventObj)(i[0])){let s=i[0],u=r._wrapExtMethods(s.method,s.type,n);return s.method=u,t.call(this,s)}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 s=r._wrapRouteHandler.call(r,o[i],n);o[i]=s}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,Xg.getPluginName)(t),o=t.register,i=this,s=function(u,l){return i._wrap(u,"route",f=>n._getServerRoutePatch.bind(n)(f,r)),i._wrap(u,"ext",f=>n._getServerExtPatch.bind(n)(f,r)),o.call(this,u,l)};t.register=s}_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,Xg.isPatchableExtMethod)(t))return t[Ok.handlerPatched]===!0?t:(t[Ok.handlerPatched]=!0,async function(...s){if(od.trace.getSpan(od.context.active())===void 0)return await t.apply(this,s);let u=(0,Xg.getExtMetadata)(n,r,t.name),l=o.tracer.startSpan(u.name,{attributes:u.attributes});try{return await od.context.with(od.trace.setSpan(od.context.active(),l),t,void 0,...s)}catch(f){throw l.recordException(f),l.setStatus({code:od.SpanStatusCode.ERROR,message:f.message}),f}finally{l.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[Ok.handlerPatched]===!0)return t;t[Ok.handlerPatched]=!0;let o=i=>async function(...s){if(od.trace.getSpan(od.context.active())===void 0)return await i.call(this,...s);let u=(0,BLe.getRPCMetadata)(od.context.active());u?.type===BLe.RPCType.HTTP&&(u.route=t.path);let l=(0,Xg.getRouteMetadata)(t,r._semconvStability,n),f=r.tracer.startSpan(l.name,{attributes:l.attributes});try{return await od.context.with(od.trace.setSpan(od.context.active(),f),()=>i.call(this,...s))}catch(h){throw f.recordException(h),f.setStatus({code:od.SpanStatusCode.ERROR,message:h.message}),h}finally{f.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(s){let u=i(s);return typeof u.handler=="function"&&(u.handler=o(u.handler)),u}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};X6.HapiInstrumentation=ZX});var PLe=M(GR=>{"use strict";A();Object.defineProperty(GR,"__esModule",{value:!0});GR.AttributeNames=GR.HapiInstrumentation=void 0;var qwt=OLe();Object.defineProperty(GR,"HapiInstrumentation",{enumerable:!0,get:function(){return qwt.HapiInstrumentation}});var Vwt=JX();Object.defineProperty(GR,"AttributeNames",{enumerable:!0,get:function(){return Vwt.AttributeNames}})});var MLe,LLe,ULe,Ywt,QLe,FLe=B(()=>{A();MLe=ue(PLe(),1);_r();LLe="Hapi",ULe=ct(LLe,()=>new MLe.HapiInstrumentation),Ywt=(()=>({name:LLe,setupOnce(){ULe()}})),QLe=Ywt});var NE,Pk,WX=B(()=>{A();NE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Pk={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var tG,Kwt,Jwt,eG,GLe=B(()=>{A();He();tG=ue(cn(),1);mt();WX();Kwt="@sentry/instrumentation-hono",Jwt="0.0.1",eG=class extends tG.InstrumentationBase{constructor(t={}){super(Kwt,Jwt,t)}init(){return[new tG.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 s=o.slice(1);return n.apply(this,[i,...s.map(u=>t._wrapHandler(u))])}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(s=>t._wrapHandler(s))])}}}_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 s=o.slice(1);return n.apply(this,[i,...s.map(u=>t._wrapHandler(u))])}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,s=n.tracer.startSpan(i);return We.with(Jt.setSpan(We.active(),s),()=>n._safeExecute(()=>{let u=t.apply(this,[r,o]);if(wa(u))return u.then(l=>{let f=n._determineHandlerType(l);return s.setAttributes({[NE.HONO_TYPE]:f,[NE.HONO_NAME]:f===Pk.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),l});{let l=n._determineHandlerType(u);return s.setAttributes({[NE.HONO_TYPE]:l,[NE.HONO_NAME]:l===Pk.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),u}},()=>s.end(),u=>{n._handleError(s,u),s.end()}))}}_safeExecute(t,n,r){try{let o=t();return wa(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?Pk.MIDDLEWARE:Pk.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:gi.ERROR,message:n.message}),t.recordException(n))}}});function Zwt(e){let t=Pt(e).data,n=t[NE.HONO_TYPE];if(t[rn]||!n)return;e.setAttributes({[Lt]:"auto.http.otel.hono",[rn]:`${n}.hono`});let r=t[NE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),xn()===ep()){ws&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[vg],i=t[AS];typeof o=="string"&&typeof i=="string"&&xn().setTransactionName(`${i} ${o}`)}var jLe,zLe,Wwt,HLe,$Le=B(()=>{A();Xn();mt();_r();KS();WX();GLe();jLe="Hono";zLe=ct(jLe,()=>new eG({responseHook:e=>{Zwt(e)}})),Wwt=(()=>({name:jLe,setupOnce(){zLe()}})),HLe=Wwt});var nG=M(Mk=>{"use strict";A();Object.defineProperty(Mk,"__esModule",{value:!0});Mk.KoaLayerType=void 0;var Xwt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(Xwt=Mk.KoaLayerType||(Mk.KoaLayerType={}))});var qLe=M(jR=>{"use strict";A();Object.defineProperty(jR,"__esModule",{value:!0});jR.PACKAGE_NAME=jR.PACKAGE_VERSION=void 0;jR.PACKAGE_VERSION="0.62.0";jR.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var XX=M(Lk=>{"use strict";A();Object.defineProperty(Lk,"__esModule",{value:!0});Lk.AttributeNames=void 0;var eBt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(eBt=Lk.AttributeNames||(Lk.AttributeNames={}))});var YLe=M(zR=>{"use strict";A();Object.defineProperty(zR,"__esModule",{value:!0});zR.isLayerIgnored=zR.getMiddlewareMetadata=void 0;var VLe=nG(),rG=XX(),tBt=(Xn(),Me(qr)),nBt=(e,t,n,r)=>n?{attributes:{[rG.AttributeNames.KOA_NAME]:r?.toString(),[rG.AttributeNames.KOA_TYPE]:VLe.KoaLayerType.ROUTER,[tBt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[rG.AttributeNames.KOA_NAME]:t.name??"middleware",[rG.AttributeNames.KOA_TYPE]:VLe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};zR.getMiddlewareMetadata=nBt;var rBt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));zR.isLayerIgnored=rBt});var KLe=M(oG=>{"use strict";A();Object.defineProperty(oG,"__esModule",{value:!0});oG.kLayerPatched=void 0;oG.kLayerPatched=Symbol("koa-layer-patched")});var tUe=M(iG=>{"use strict";A();Object.defineProperty(iG,"__esModule",{value:!0});iG.KoaInstrumentation=void 0;var oA=(He(),Me(tt)),Uk=cn(),JLe=nG(),ZLe=qLe(),WLe=YLe(),XLe=Rr(),eUe=KLe(),eee=class extends Uk.InstrumentationBase{constructor(t={}){super(ZLe.PACKAGE_NAME,ZLe.PACKAGE_VERSION,t)}init(){return new Uk.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,Uk.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,Uk.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){oA.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,s=o.stack;for(let u=0;u<s.length;u++){let l=s[u];s[u]=this._patchLayer(l,!0,i)}}return t}_patchLayer(t,n,r){let o=n?JLe.KoaLayerType.ROUTER:JLe.KoaLayerType.MIDDLEWARE;return t[eUe.kLayerPatched]===!0||(0,WLe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(oA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[eUe.kLayerPatched]=!0,oA.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(oA.trace.getSpan(oA.context.active())===void 0)return t(i,s);let l=(0,WLe.getMiddlewareMetadata)(i,t,n,r),f=this.tracer.startSpan(l.name,{attributes:l.attributes}),h=(0,XLe.getRPCMetadata)(oA.context.active());h?.type===XLe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:_}=this.getConfig();_&&(0,Uk.safeExecuteInTheMiddle)(()=>_(f,{context:i,middlewareLayer:t,layerType:o}),T=>{T&&oA.diag.error("koa instrumentation: request hook failed",T)},!0);let E=oA.trace.setSpan(oA.context.active(),f);return oA.context.with(E,async()=>{try{return await t(i,s)}catch(T){throw f.recordException(T),T}finally{f.end()}})})}};iG.KoaInstrumentation=eee});var nUe=M(wE=>{"use strict";A();Object.defineProperty(wE,"__esModule",{value:!0});wE.KoaLayerType=wE.AttributeNames=wE.KoaInstrumentation=void 0;var oBt=tUe();Object.defineProperty(wE,"KoaInstrumentation",{enumerable:!0,get:function(){return oBt.KoaInstrumentation}});var iBt=XX();Object.defineProperty(wE,"AttributeNames",{enumerable:!0,get:function(){return iBt.AttributeNames}});var sBt=nG();Object.defineProperty(wE,"KoaLayerType",{enumerable:!0,get:function(){return sBt.KoaLayerType}})});var rUe,oUe,iUe,aBt,sUe,aUe=B(()=>{A();rUe=ue(nUe(),1);Xn();mt();_r();KS();oUe="Koa",iUe=ct(oUe,rUe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){Yr(t,"auto.http.otel.koa");let r=Pt(t).data,o=r["koa.type"];o&&t.setAttribute(rn,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),xn()===ep()){ws&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=r[vg],u=n.context?.request?.method?.toUpperCase()||"GET";s&&xn().setTransactionName(`${u} ${s}`)}})),aBt=((e={})=>({name:oUe,setupOnce(){iUe(e)}})),sUe=aBt});var tee=M(wf=>{"use strict";A();Object.defineProperty(wf,"__esModule",{value:!0});wf.ConnectNames=wf.ConnectTypes=wf.AttributeNames=void 0;var uBt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(uBt=wf.AttributeNames||(wf.AttributeNames={}));var cBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(cBt=wf.ConnectTypes||(wf.ConnectTypes={}));var lBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(lBt=wf.ConnectNames||(wf.ConnectNames={}))});var uUe=M(HR=>{"use strict";A();Object.defineProperty(HR,"__esModule",{value:!0});HR.PACKAGE_NAME=HR.PACKAGE_VERSION=void 0;HR.PACKAGE_VERSION="0.57.0";HR.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var cUe=M(sG=>{"use strict";A();Object.defineProperty(sG,"__esModule",{value:!0});sG._LAYERS_STORE_PROPERTY=void 0;sG._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var lUe=M(kE=>{"use strict";A();Object.defineProperty(kE,"__esModule",{value:!0});kE.generateRoute=kE.replaceCurrentStackRoute=kE.addNewStackLayer=void 0;var dBt=(He(),Me(tt)),BE=cUe(),pBt=e=>{Array.isArray(e[BE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,BE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[BE._LAYERS_STORE_PROPERTY].push("/");let t=e[BE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[BE._LAYERS_STORE_PROPERTY].length?e[BE._LAYERS_STORE_PROPERTY].pop():dBt.diag.warn("Connect: Trying to pop the stack multiple time")}};kE.addNewStackLayer=pBt;var fBt=(e,t)=>{t&&e[BE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};kE.replaceCurrentStackRoute=fBt;var mBt=e=>e[BE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);kE.generateRoute=mBt});var fUe=M(OE=>{"use strict";A();Object.defineProperty(OE,"__esModule",{value:!0});OE.ConnectInstrumentation=OE.ANONYMOUS_NAME=void 0;var ABt=(He(),Me(tt)),dUe=Rr(),$R=tee(),pUe=uUe(),aG=cn(),gBt=(Xn(),Me(qr)),nee=lUe();OE.ANONYMOUS_NAME="anonymous";var ree=class extends aG.InstrumentationBase{constructor(t={}){super(pUe.PACKAGE_NAME,pUe.PACKAGE_VERSION,t)}init(){return[new aG.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,aG.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,aG.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=$R.ConnectTypes.REQUEST_HANDLER,i=$R.ConnectNames.REQUEST_HANDLER,o=t):(r=$R.ConnectTypes.MIDDLEWARE,i=$R.ConnectNames.MIDDLEWARE,o=n.name||OE.ANONYMOUS_NAME);let s=`${i} - ${o}`,u={attributes:{[gBt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[$R.AttributeNames.CONNECT_TYPE]:r,[$R.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(s,u)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[s,u,l]=o?[1,2,3]:[0,1,2],f=arguments[s],h=arguments[u],_=arguments[l];(0,nee.replaceCurrentStackRoute)(f,t);let E=(0,dUe.getRPCMetadata)(ABt.context.active());t&&E?.type===dUe.RPCType.HTTP&&(E.route=(0,nee.generateRoute)(f));let T="";t?T=`request handler - ${t}`:T=`middleware - ${n.name||OE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",T);let R=!1;function x(){R?r._diag.debug(`span ${v.name} - already finished`):(R=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",x)}return h.addListener("close",x),arguments[l]=r._patchNext(_,x),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],s=arguments[o],u=(0,nee.addNewStackLayer)(i);return typeof s=="function"&&(arguments[o]=n._patchOut(s,u)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};OE.ConnectInstrumentation=ree});var AUe=M(gp=>{"use strict";A();Object.defineProperty(gp,"__esModule",{value:!0});gp.ConnectTypes=gp.ConnectNames=gp.AttributeNames=gp.ANONYMOUS_NAME=gp.ConnectInstrumentation=void 0;var mUe=fUe();Object.defineProperty(gp,"ConnectInstrumentation",{enumerable:!0,get:function(){return mUe.ConnectInstrumentation}});Object.defineProperty(gp,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return mUe.ANONYMOUS_NAME}});var oee=tee();Object.defineProperty(gp,"AttributeNames",{enumerable:!0,get:function(){return oee.AttributeNames}});Object.defineProperty(gp,"ConnectNames",{enumerable:!0,get:function(){return oee.ConnectNames}});Object.defineProperty(gp,"ConnectTypes",{enumerable:!0,get:function(){return oee.ConnectTypes}})});var gUe,hUe,_Ue,hBt,EUe,yUe=B(()=>{A();gUe=ue(AUe(),1);_r();hUe="Connect",_Ue=ct(hUe,()=>new gUe.ConnectInstrumentation),hBt=(()=>({name:hUe,setupOnce(){_Ue()}})),EUe=hBt});var SUe=M(da=>{"use strict";A();Object.defineProperty(da,"__esModule",{value:!0});da.DB_SYSTEM_VALUE_MSSQL=da.ATTR_NET_PEER_PORT=da.ATTR_NET_PEER_NAME=da.ATTR_DB_USER=da.ATTR_DB_SYSTEM=da.ATTR_DB_STATEMENT=da.ATTR_DB_SQL_TABLE=da.ATTR_DB_NAME=void 0;da.ATTR_DB_NAME="db.name";da.ATTR_DB_SQL_TABLE="db.sql.table";da.ATTR_DB_STATEMENT="db.statement";da.ATTR_DB_SYSTEM="db.system";da.ATTR_DB_USER="db.user";da.ATTR_NET_PEER_NAME="net.peer.name";da.ATTR_NET_PEER_PORT="net.peer.port";da.DB_SYSTEM_VALUE_MSSQL="mssql"});var TUe=M(qR=>{"use strict";A();Object.defineProperty(qR,"__esModule",{value:!0});qR.once=qR.getSpanName=void 0;function _Bt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}qR.getSpanName=_Bt;var EBt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};qR.once=EBt});var bUe=M(VR=>{"use strict";A();Object.defineProperty(VR,"__esModule",{value:!0});VR.PACKAGE_NAME=VR.PACKAGE_VERSION=void 0;VR.PACKAGE_VERSION="0.33.0";VR.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var xUe=M(ME=>{"use strict";A();Object.defineProperty(ME,"__esModule",{value:!0});ME.TediousInstrumentation=ME.INJECTED_CTX=void 0;var YR=(He(),Me(tt)),yBt=Ue("events"),iA=cn(),aT=(Xn(),Me(qr)),PE=SUe(),IUe=TUe(),CUe=bUe(),RUe=Symbol("opentelemetry.instrumentation-tedious.current-database");ME.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var vUe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function uG(e){Object.defineProperty(this,RUe,{value:e,writable:!0})}var iee=class e extends iA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(CUe.PACKAGE_NAME,CUe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,iA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,iA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new iA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of vUe)(0,iA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,iA.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 vUe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return uG.call(this,this.config?.options?.database),this.removeListener("databaseChange",uG),this.on("databaseChange",uG),this.once("end",()=>{this.removeListener("databaseChange",uG)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||YR.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",s=new n.Request(i,l=>{o()});Object.defineProperty(s,ME.INJECTED_CTX,{value:!0});let u=Buffer.from(r,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,u,{length:u.length}),t.execSql(s)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(s){if(s?.[ME.INJECTED_CTX])return r.apply(this,arguments);if(!(s instanceof yBt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let u=0,l=0,f=()=>l++,h=()=>u++,_=this[RUe],E=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(s),T={};o._dbSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_DB_SYSTEM]=PE.DB_SYSTEM_VALUE_MSSQL,T[PE.ATTR_DB_NAME]=_,T[PE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,T[PE.ATTR_DB_STATEMENT]=E,T[PE.ATTR_DB_SQL_TABLE]=s.table),o._dbSemconvStability&iA.SemconvStability.STABLE&&(T[aT.ATTR_DB_NAMESPACE]=_,T[aT.ATTR_DB_SYSTEM_NAME]=aT.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,T[aT.ATTR_DB_QUERY_TEXT]=E,T[aT.ATTR_DB_COLLECTION_NAME]=s.table),o._netSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_NET_PEER_NAME]=this.config?.server,T[PE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&iA.SemconvStability.STABLE&&(T[aT.ATTR_SERVER_ADDRESS]=this.config?.server,T[aT.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,IUe.getSpanName)(t,_,E,s.table),{kind:YR.SpanKind.CLIENT,attributes:T}),R=(0,IUe.once)(G=>{s.removeListener("done",f),s.removeListener("doneInProc",f),s.removeListener("doneProc",h),s.removeListener("error",R),this.removeListener("end",R),v.setAttribute("tedious.procedure_count",u),v.setAttribute("tedious.statement_count",l),G&&v.setStatus({code:YR.SpanStatusCode.ERROR,message:G.message}),v.end()});s.on("done",f),s.on("doneInProc",f),s.on("doneProc",h),s.once("error",R),this.on("end",R),typeof s.callback=="function"?o._wrap(s,"callback",o._patchCallbackQuery(R)):o._diag.error("Expected request.callback to be a function");let x=()=>YR.context.with(YR.trace.setSpan(YR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return x();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(x)}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)}}};ME.TediousInstrumentation=iee});var DUe=M(cG=>{"use strict";A();Object.defineProperty(cG,"__esModule",{value:!0});cG.TediousInstrumentation=void 0;var SBt=xUe();Object.defineProperty(cG,"TediousInstrumentation",{enumerable:!0,get:function(){return SBt.TediousInstrumentation}})});var NUe,TBt,wUe,BUe,bBt,kUe,OUe=B(()=>{A();NUe=ue(DUe(),1);mt();_r();TBt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),wUe="Tedious",BUe=ct(wUe,()=>new NUe.TediousInstrumentation({})),bBt=(()=>{let e;return{name:wUe,setupOnce(){let t=BUe();e=SB(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=Pt(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";TBt.has(i)&&n.setAttribute(Lt,"auto.db.otel.tedious")}))}}}),kUe=bBt});var PUe=M(KR=>{"use strict";A();Object.defineProperty(KR,"__esModule",{value:!0});KR.PACKAGE_NAME=KR.PACKAGE_VERSION=void 0;KR.PACKAGE_VERSION="0.57.0";KR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var LUe=M(lG=>{"use strict";A();Object.defineProperty(lG,"__esModule",{value:!0});lG.GenericPoolInstrumentation=void 0;var JR=(He(),Me(tt)),uT=cn(),MUe=PUe(),see="generic-pool",aee=class extends uT.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(MUe.PACKAGE_NAME,MUe.PACKAGE_VERSION,t)}init(){return[new uT.InstrumentationNodeModuleDefinition(see,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,uT.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 uT.InstrumentationNodeModuleDefinition(see,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,uT.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 uT.InstrumentationNodeModuleDefinition(see,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,uT.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=JR.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return JR.context.with(JR.trace.setSpan(i,s),()=>t.call(this,...o).then(u=>(s.end(),u),u=>{throw s.recordException(u),s.end(),u}))}}_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 s=JR.context.active(),u=n.tracer.startSpan("generic-pool.acquire",{},s);return JR.context.with(JR.trace.setSpan(s,u),()=>{t.call(this,(l,f)=>{if(u.end(),o)return o(l,f)},i)})}}};lG.GenericPoolInstrumentation=aee});var UUe=M(dG=>{"use strict";A();Object.defineProperty(dG,"__esModule",{value:!0});dG.GenericPoolInstrumentation=void 0;var IBt=LUe();Object.defineProperty(dG,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return IBt.GenericPoolInstrumentation}})});var QUe,FUe,GUe,CBt,jUe,zUe=B(()=>{A();QUe=ue(UUe(),1);mt();_r();FUe="GenericPool",GUe=ct(FUe,()=>new QUe.GenericPoolInstrumentation({})),CBt=(()=>{let e;return{name:FUe,setupOnce(){let t=GUe();e=SB(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=Pt(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Lt,"auto.db.otel.generic_pool")}))}}}),jUe=CBt});var uee=M(sA=>{"use strict";A();Object.defineProperty(sA,"__esModule",{value:!0});sA.ATTR_NET_PEER_PORT=sA.ATTR_NET_PEER_NAME=sA.ATTR_MESSAGING_SYSTEM=sA.ATTR_MESSAGING_OPERATION=void 0;sA.ATTR_MESSAGING_OPERATION="messaging.operation";sA.ATTR_MESSAGING_SYSTEM="messaging.system";sA.ATTR_NET_PEER_NAME="net.peer.name";sA.ATTR_NET_PEER_PORT="net.peer.port"});var cee=M(Si=>{"use strict";A();Object.defineProperty(Si,"__esModule",{value:!0});Si.ATTR_MESSAGING_CONVERSATION_ID=Si.OLD_ATTR_MESSAGING_MESSAGE_ID=Si.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=Si.ATTR_MESSAGING_URL=Si.ATTR_MESSAGING_PROTOCOL_VERSION=Si.ATTR_MESSAGING_PROTOCOL=Si.MESSAGING_OPERATION_VALUE_PROCESS=Si.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=Si.ATTR_MESSAGING_DESTINATION_KIND=Si.ATTR_MESSAGING_DESTINATION=void 0;Si.ATTR_MESSAGING_DESTINATION="messaging.destination";Si.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";Si.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";Si.MESSAGING_OPERATION_VALUE_PROCESS="process";Si.ATTR_MESSAGING_PROTOCOL="messaging.protocol";Si.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";Si.ATTR_MESSAGING_URL="messaging.url";Si.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";Si.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";Si.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var lee=M(cT=>{"use strict";A();Object.defineProperty(cT,"__esModule",{value:!0});cT.DEFAULT_CONFIG=cT.EndOperation=void 0;var vBt;(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"})(vBt=cT.EndOperation||(cT.EndOperation={}));cT.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var VUe=M(Ti=>{"use strict";A();Object.defineProperty(Ti,"__esModule",{value:!0});Ti.isConfirmChannelTracing=Ti.unmarkConfirmChannelTracing=Ti.markConfirmChannelTracing=Ti.getConnectionAttributesFromUrl=Ti.getConnectionAttributesFromServer=Ti.normalizeExchange=Ti.CONNECTION_ATTRIBUTES=Ti.CHANNEL_CONSUME_TIMEOUT_TIMER=Ti.CHANNEL_SPANS_NOT_ENDED=Ti.MESSAGE_STORED_SPAN=void 0;var dee=(He(),Me(tt)),LE=cn(),pG=(Xn(),Me(qr)),Qk=uee(),fG=cee();Ti.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Ti.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Ti.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Ti.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var pee=(0,dee.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),RBt=e=>e!==""?e:"<default>";Ti.normalizeExchange=RBt;var xBt=e=>e.replace(/:[^:@/]*@/,":***@"),HUe=(e,t)=>e||(t==="AMQP"?5672:5671),$Ue=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},qUe=e=>e||"localhost",aA=(e,t,n,r)=>n?{[t]:n}:(dee.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),DBt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[Qk.ATTR_MESSAGING_SYSTEM]:t}:{}};Ti.getConnectionAttributesFromServer=DBt;var NBt=(e,t)=>{let n={[fG.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=$Ue(r?.protocol);Object.assign(n,{...aA(e,fG.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=qUe(r?.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(e,Qk.ATTR_NET_PEER_NAME,i,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(e,pG.ATTR_SERVER_ADDRESS,i,"hostname")});let s=HUe(r.port,o);t&LE.SemconvStability.OLD&&Object.assign(n,aA(e,Qk.ATTR_NET_PEER_PORT,s,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(e,pG.ATTR_SERVER_PORT,s,"port"))}else{let r=xBt(e);n[fG.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=$Ue(o.protocol);Object.assign(n,{...aA(r,fG.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=qUe(o.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(r,Qk.ATTR_NET_PEER_NAME,s,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(r,pG.ATTR_SERVER_ADDRESS,s,"hostname")});let u=HUe(o.port?parseInt(o.port):void 0,i);t&LE.SemconvStability.OLD&&Object.assign(n,aA(r,Qk.ATTR_NET_PEER_PORT,u,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(r,pG.ATTR_SERVER_PORT,u,"port"))}catch(o){dee.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Ti.getConnectionAttributesFromUrl=NBt;var wBt=e=>e.setValue(pee,!0);Ti.markConfirmChannelTracing=wBt;var BBt=e=>e.deleteValue(pee);Ti.unmarkConfirmChannelTracing=BBt;var kBt=e=>e.getValue(pee)===!0;Ti.isConfirmChannelTracing=kBt});var YUe=M(ZR=>{"use strict";A();Object.defineProperty(ZR,"__esModule",{value:!0});ZR.PACKAGE_NAME=ZR.PACKAGE_VERSION=void 0;ZR.PACKAGE_VERSION="0.61.0";ZR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var JUe=M(gG=>{"use strict";A();Object.defineProperty(gG,"__esModule",{value:!0});gG.AmqplibInstrumentation=void 0;var oi=(He(),Me(tt)),mG=Rr(),Dr=cn(),OBt=uee(),id=cee(),oc=lee(),bi=VUe(),KUe=YUe(),AG=[">=0.5.5 <1"],fee=class extends Dr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(KUe.PACKAGE_NAME,KUe.PACKAGE_VERSION,{...oc.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Dr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...oc.DEFAULT_CONFIG,...t})}init(){let t=new Dr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",AG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Dr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",AG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Dr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",AG,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new Dr.InstrumentationNodeModuleDefinition("amqplib",AG,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,Dr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,Dr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,Dr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,Dr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,Dr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,oc.EndOperation.Ack)),(0,Dr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,oc.EndOperation.Nack)),(0,Dr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,oc.EndOperation.Reject)),(0,Dr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,oc.EndOperation.AckAll)),(0,Dr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,oc.EndOperation.NackAll)),(0,Dr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,Dr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,Dr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,Dr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,Dr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,Dr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,Dr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,Dr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,Dr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,Dr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,Dr.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,s){return t.call(this,o,i,function(u,l){if(u==null){let f=(0,bi.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,bi.getConnectionAttributesFromServer)(l);l[bi.CONNECTION_ATTRIBUTES]={...f,...h}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelClosed,void 0);let i=this[bi.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[bi.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(s){return o.endAllSpansOnChannel(this,t,n,s),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(s,u,l){let f=this,h=n===oc.EndOperation.Reject?u:l,_=f[bi.CHANNEL_SPANS_NOT_ENDED]??[],E=_.findIndex(T=>T.msg===s);if(E<0)o.endConsumerSpan(s,t,n,h);else if(n!==oc.EndOperation.Reject&&u){for(let T=0;T<=E;T++)o.endConsumerSpan(_[T].msg,t,n,h);_.splice(0,E+1)}else o.endConsumerSpan(s,t,n,h),_.splice(E,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,s,u){let l=this;if(!Object.prototype.hasOwnProperty.call(l,bi.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let _=setInterval(()=>{r.checkConsumeTimeoutOnChannel(l)},h);_.unref(),l[bi.CHANNEL_CONSUME_TIMEOUT_TIMER]=_}l[bi.CHANNEL_SPANS_NOT_ENDED]=[]}let f=function(h){if(!h)return s.call(this,h);let _=h.properties.headers??{},E=oi.propagation.extract(oi.ROOT_CONTEXT,_),T=h.fields?.exchange,v;if(r._config.useLinksForConsume){let P=E?oi.trace.getSpan(E)?.spanContext():void 0;E=void 0,P&&(v=[{context:P}])}let R=r.tracer.startSpan(`${i} process`,{kind:oi.SpanKind.CONSUMER,attributes:{...l?.connection?.[bi.CONNECTION_ATTRIBUTES],[id.ATTR_MESSAGING_DESTINATION]:T,[id.ATTR_MESSAGING_DESTINATION_KIND]:id.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[id.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[OBt.ATTR_MESSAGING_OPERATION]:id.MESSAGING_OPERATION_VALUE_PROCESS,[id.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[id.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},E),{consumeHook:x}=r.getConfig();x&&(0,Dr.safeExecuteInTheMiddle)(()=>x(R,{moduleVersion:t,msg:h}),P=>{P&&oi.diag.error("amqplib instrumentation: consumerHook error",P)},!0),u?.noAck||(l[bi.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,mG.hrTime)()}),h[bi.MESSAGE_STORED_SPAN]=R);let k=E||oi.ROOT_CONTEXT;oi.context.with(oi.trace.setSpan(k,R),()=>{s.call(this,h)}),u?.noAck&&(r.callConsumeEndHook(R,h,!1,oc.EndOperation.AutoAck),R.end())};return arguments[1]=f,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,s,u,l,f){let h=this,{span:_,modifiedOptions:E}=r.createPublishSpan(r,i,s,h,l),{publishHook:T}=r.getConfig();T&&(0,Dr.safeExecuteInTheMiddle)(()=>T(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:E,isConfirmChannel:!0}),k=>{k&&oi.diag.error("amqplib instrumentation: publishHook error",k)},!0);let v=function(k,P){try{f?.call(this,k,P)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,Dr.safeExecuteInTheMiddle)(()=>j(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:l,isConfirmChannel:!0,confirmError:k}),G=>{G&&oi.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),k&&_.setStatus({code:oi.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),_.end()}},R=(0,bi.markConfirmChannelTracing)(oi.context.active()),x=[...arguments];return x[3]=E,x[4]=oi.context.bind((0,bi.unmarkConfirmChannelTracing)(oi.trace.setSpan(R,_)),v),oi.context.with(R,n.bind(this,...x))}}getPublishPatch(t,n){let r=this;return function(i,s,u,l){if((0,bi.isConfirmChannelTracing)(oi.context.active()))return n.apply(this,arguments);{let f=this,{span:h,modifiedOptions:_}=r.createPublishSpan(r,i,s,f,l),{publishHook:E}=r.getConfig();E&&(0,Dr.safeExecuteInTheMiddle)(()=>E(h,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:_,isConfirmChannel:!1}),R=>{R&&oi.diag.error("amqplib instrumentation: publishHook error",R)},!0);let T=[...arguments];T[3]=_;let v=n.apply(this,T);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let s=(0,bi.normalizeExchange)(n),u=t.tracer.startSpan(`publish ${s}`,{kind:oi.SpanKind.PRODUCER,attributes:{...o.connection[bi.CONNECTION_ATTRIBUTES],[id.ATTR_MESSAGING_DESTINATION]:n,[id.ATTR_MESSAGING_DESTINATION_KIND]:id.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[id.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[id.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[id.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),l=i??{};return l.headers=l.headers??{},oi.propagation.inject(oi.trace.setSpan(oi.context.active(),u),l.headers),{span:u,modifiedOptions:l}}endConsumerSpan(t,n,r,o){let i=t[bi.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:oi.SpanStatusCode.ERROR,message:r!==oc.EndOperation.ChannelClosed&&r!==oc.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[bi.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[bi.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,r,o)}),t[bi.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,Dr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),s=>{s&&oi.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,mG.hrTime)(),r=t[bi.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let s=r[o],u=(0,mG.hrTimeDuration)(s.timeOfConsume,n);if((0,mG.hrTimeToMilliseconds)(u)<i)break;this.endConsumerSpan(s.msg,null,oc.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};gG.AmqplibInstrumentation=fee});var WUe=M(UE=>{"use strict";A();Object.defineProperty(UE,"__esModule",{value:!0});UE.EndOperation=UE.DEFAULT_CONFIG=UE.AmqplibInstrumentation=void 0;var PBt=JUe();Object.defineProperty(UE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return PBt.AmqplibInstrumentation}});var ZUe=lee();Object.defineProperty(UE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return ZUe.DEFAULT_CONFIG}});Object.defineProperty(UE,"EndOperation",{enumerable:!0,get:function(){return ZUe.EndOperation}})});var XUe,eQe,MBt,tQe,LBt,nQe,rQe=B(()=>{A();XUe=ue(WUe(),1);_r();eQe="Amqplib",MBt={consumeEndHook:e=>{Yr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{Yr(e,"auto.amqplib.otel.publisher")}},tQe=ct(eQe,()=>new XUe.AmqplibInstrumentation(MBt)),LBt=(()=>({name:eQe,setupOnce(){tQe()}})),nQe=LBt});var Fk,mee=B(()=>{A();Fk="VercelAI"});function QBt(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 FBt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(GBt(t.content),jBt(t.content))}function GBt(e){for(let t of e){if(!QBt(t))continue;let n=HK(t.toolCallId);n?Vl(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"),an(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):Vl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),an(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function jBt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&$K(t.toolCallId)}function zBt(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 _G,UBt,oQe,hG,iQe=B(()=>{A();_G=ue(cn(),1);mt();mee();UBt=[">=3.0.0 <7"],oQe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];hG=class e extends _G.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",er,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new _G.InstrumentationNodeModuleDefinition("ai",UBt,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,s)=>{let u=s[0].experimental_telemetry||{},l=u.isEnabled,f=Et(),h=f?.getIntegrationByName(Fk),_=h?.options,E=h?!!f?.getOptions().sendDefaultPii:!1,{recordInputs:T,recordOutputs:v}=zBt(_,u,l,E);return s[0].experimental_telemetry={...u,isEnabled:l!==void 0?l:!0,recordInputs:T,recordOutputs:v},Cf(()=>Reflect.apply(o,i,s),R=>{R&&typeof R=="object"&&os(R,"_sentry_active_span",$c())},()=>{},R=>{FBt(R)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of oQe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=oQe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function HBt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var sQe,$Bt,aQe,uQe=B(()=>{A();mt();_r();mee();iQe();sQe=ct(Fk,()=>new hG({}));$Bt=((e={})=>{let t;return{name:Fk,options:e,setupOnce(){t=sQe()},afterAllSetup(n){e.force??HBt(n)?bF(n):t?.callWhenPatched(()=>bF(n))}}}),aQe=$Bt});var yG,qBt,EG,cQe=B(()=>{A();yG=ue(cn(),1);mt();qBt=[">=4.0.0 <7"],EG=class extends yG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",er,t)}init(){return new yG.InstrumentationNodeModuleDefinition("openai",qBt,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(...s){if(BS(uE))return Reflect.construct(r,s);let u=Reflect.construct(r,s);return vF(u,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}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 lQe,VBt,dQe,pQe=B(()=>{A();mt();_r();cQe();lQe=ct(uE,e=>new EG(e)),VBt=((e={})=>({name:uE,setupOnce(){lQe(e)}})),dQe=VBt});var TG,YBt,SG,fQe=B(()=>{A();TG=ue(cn(),1);mt();YBt=[">=0.19.2 <1.0.0"],SG=class extends TG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",er,t)}init(){return new TG.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",YBt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(BS(cE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return RF(s,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 s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}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 mQe,KBt,AQe,gQe=B(()=>{A();mt();_r();fQe();mQe=ct(cE,e=>new SG(e)),KBt=((e={})=>({name:cE,options:e,setupOnce(){mQe(e)}})),AQe=KBt});var WR,hQe,bG,_Qe=B(()=>{A();WR=ue(cn(),1);mt();hQe=[">=0.10.0 <2"],bG=class extends WR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",er,t)}init(){return new WR.InstrumentationNodeModuleDefinition("@google/genai",hQe,n=>this._patch(n),n=>n,[new WR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",hQe,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(BS(lE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return xF(s,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 s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}return EB(t,"GoogleGenAI",o),t}}});var EQe,JBt,yQe,SQe=B(()=>{A();mt();_r();_Qe();EQe=ct(lE,e=>new bG(e)),JBt=((e={})=>({name:lE,setupOnce(){EQe(e)}})),yQe=JBt});function ZBt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function WBt(e,t,n){return new Proxy(e,{apply(r,o,i){let u=i[1];(!u||typeof u!="object"||Array.isArray(u))&&(u={},i[1]=u);let l=u.callbacks,f=ZBt(l,t);return u.callbacks=f,Reflect.apply(r,o,i)}})}var QE,IG,CG,TQe=B(()=>{A();QE=ue(cn(),1);mt();IG=[">=0.1.0 <2.0.0"];CG=class extends QE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",er,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 QE.InstrumentationNodeModuleDefinition(r,IG,this._patch.bind(this),o=>o,[new QE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,IG,this._patch.bind(this),o=>o)]));return t.push(new QE.InstrumentationNodeModuleDefinition("langchain",IG,this._patch.bind(this),r=>r,[new QE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",IG,this._patch.bind(this),r=>r)])),t}_patch(t){aK([uE,cE,lE]);let n=BF(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(l=>typeof l=="function"&&r.includes(l.name));if(!i)return;let s=i.prototype;if(s.__sentry_patched__)return;s.__sentry_patched__=!0;let u=["invoke","stream","batch"];for(let l of u){let f=s[l];typeof f=="function"&&(s[l]=WBt(f,n))}}}});var bQe,XBt,IQe,CQe=B(()=>{A();mt();_r();TQe();bQe=ct(DF,e=>new CG(e)),XBt=((e={})=>({name:DF,setupOnce(){bQe(e)}})),IQe=XBt});var XR,vQe,vG,RQe=B(()=>{A();XR=ue(cn(),1);mt();vQe=[">=0.0.0 <2.0.0"],vG=class extends XR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",er,t)}init(){return new XR.InstrumentationNodeModuleDefinition("@langchain/langgraph",vQe,this._patch.bind(this),n=>n,[new XR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",vQe,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&OF(t.StateGraph.prototype,this.getConfig()),t}}});var xQe,ekt,DQe,NQe=B(()=>{A();mt();_r();RQe();xQe=ct(kF,e=>new vG(e)),ekt=((e={})=>({name:kF,setupOnce(){xQe(e)}})),DQe=ekt});import*as BQe from"node:net";function kQe(e,t,n,r,o){let s=()=>{},u=o.firestoreSpanCreationHook;typeof u=="function"&&(s=h=>{(0,eh.safeExecuteInTheMiddle)(()=>u(h),_=>{_&&Hl.error(_?.message)},!0)});let l=new eh.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>wQe(h,n,r,e,s)),f=["@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 f)l.files.push(new eh.InstrumentationNodeModuleFile(h,t,_=>wQe(_,n,r,e,s),_=>OQe(_,r)));return l}function wQe(e,t,n,r,o){return OQe(e,n),t(e,"addDoc",tkt(r,o)),t(e,"getDocs",rkt(r,o)),t(e,"setDoc",okt(r,o)),t(e,"deleteDoc",nkt(r,o)),e}function OQe(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,eh.isWrapped)(e[n])&&t(e,n);return e}function tkt(e,t){return function(r){return function(o,i){let s=xG(e,"addDoc",o);return t(s),RG(s,()=>r(o,i))}}}function nkt(e,t){return function(r){return function(o){let i=xG(e,"deleteDoc",o.parent||o);return t(i),RG(i,()=>r(o))}}}function rkt(e,t){return function(r){return function(o){let i=xG(e,"getDocs",o);return t(i),RG(i,()=>r(o))}}}function okt(e,t){return function(r){return function(o,i,s){let u=xG(e,"setDoc",o.parent||o);return t(u),RG(u,()=>typeof s<"u"?r(o,i,s):r(o,i))}}}function RG(e,t){return We.with(Jt.setSpan(We.active(),e),()=>(0,eh.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function xG(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:mo.CLIENT});return skt(r,n),r.setAttribute(QC,t),r}function ikt(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(BQe.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 skt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[wV]:t.path,[BV]:n.name,[mS]:"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:u,port:l}=ikt(i);u&&(s[FV]=u),l&&(s[GV]=l),e.setAttributes(s)}var eh,PQe=B(()=>{A();He();eh=ue(cn(),1);Xn()});function MQe(e,t,n,r,o){let i=()=>{},s=()=>{},u=o.functions?.errorHook,l=o.functions?.requestHook,f=o.functions?.responseHook;typeof f=="function"&&(s=(E,T)=>{(0,th.safeExecuteInTheMiddle)(()=>f(E,T),v=>{v&&Hl.error(v?.message)},!0)}),typeof l=="function"&&(i=E=>{(0,th.safeExecuteInTheMiddle)(()=>l(E),T=>{T&&Hl.error(T?.message)},!0)});let h=new th.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:E,triggerType:T})=>{h.files.push(new th.InstrumentationNodeModuleFile(E,t,v=>akt(v,n,r,e,{requestHook:i,responseHook:s,errorHook:u},T),v=>LQe(v,r)))}),h}function ic(e,t,n){return function(o){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],u=typeof i[0]=="function"?void 0:i[0];if(!s)return o.call(this,...i);let l=async function(...f){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",_=e.startSpan(`firebase.function.${n}`,{kind:mo.SERVER}),E={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(E["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(E["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),_.setAttributes(E),t?.requestHook?.(_),We.with(Jt.setSpan(We.active(),_),async()=>{let T,v;try{v=await s.apply(this,f)}catch(R){T=R}if(t?.responseHook?.(_,T),T&&_.recordException(T),_.end(),T)throw await t?.errorHook?.(_,T),T;return v})};return u?o.call(this,u,l):o.call(this,l)}}}function akt(e,t,n,r,o,i){switch(LQe(e,n),i){case"function":t(e,"onRequest",ic(r,o,"http.request")),t(e,"onCall",ic(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",ic(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",ic(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",ic(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",ic(r,o,"storage.object.finalized")),t(e,"onObjectArchived",ic(r,o,"storage.object.archived")),t(e,"onObjectDeleted",ic(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",ic(r,o,"storage.object.metadataUpdated"));break}return e}function LQe(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,th.isWrapped)(e[r])&&t(e,r);return e}var th,UQe=B(()=>{A();He();th=ue(cn(),1)});var FQe,QQe,ukt,ckt,DG,GQe=B(()=>{A();FQe=ue(cn(),1);mt();PQe();UQe();QQe={},ukt=[">=3.0.0 <5"],ckt=[">=6.0.0 <7"],DG=class extends FQe.InstrumentationBase{constructor(t=QQe){super("@sentry/instrumentation-firebase",er,t)}setConfig(t={}){super.setConfig({...QQe,...t})}init(){let t=[];return t.push(kQe(this.tracer,ukt,this._wrap,this._unwrap,this.getConfig())),t.push(MQe(this.tracer,ckt,this._wrap,this._unwrap,this.getConfig())),t}}});var jQe,lkt,zQe,dkt,HQe,$Qe=B(()=>{A();mt();_r();GQe();jQe="Firebase",lkt={firestoreSpanCreationHook:e=>{Yr(e,"auto.firebase.otel.firestore"),e.setAttribute(rn,"db.query")},functions:{requestHook:e=>{Yr(e,"auto.firebase.otel.functions"),e.setAttribute(rn,"http.request")},errorHook:async(e,t)=>{t&&(an(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await bv(2e3))}}},zQe=ct(jQe,()=>new DG(lkt)),dkt=(()=>({name:jQe,setupOnce(){zQe()}})),HQe=dkt});function qQe(){return[KBe(),DOe(),nPe(),HLe(),zPe(),oMe(),gMe(),xMe(),s2e(),R2e(),CLe(),QLe(),sUe(),EUe(),kUe(),jUe(),EPe(),nQe(),NPe(),IQe(),DQe(),aQe(),dQe(),AQe(),yQe(),w2e(),HQe()]}var VQe=B(()=>{A();rQe();gQe();yUe();JBe();BOe();$Qe();zUe();SQe();oPe();FLe();$Le();yPe();aUe();CQe();NQe();wPe();HPe();iMe();hMe();DMe();pQe();x2e();B2e();vLe();a2e();OUe();uQe()});function KQe(e,t={}){e.getOptions().debug&&TZ();let[n,r]=pkt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function pkt(e,t={}){let n=new YQe.BasicTracerProvider({sampler:new F4(e),resource:(0,NG.defaultResource)().merge((0,NG.resourceFromAttributes)({[jV]:"node",[NV]:"sentry",[zV]:er})),forceFlushTimeoutMillis:500,spanProcessors:[new Q4({timeout:fkt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Jt.setGlobalTracerProvider(n),Af.setGlobalPropagator(new U4);let r=new j4;return We.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function fkt(e){if(e!=null){if(e>Aee)return ws&&W.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${Aee}`),Aee;if(e<=0||Number.isNaN(e)){ws&&W.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var NG,YQe,Aee,JQe=B(()=>{A();He();NG=ue(PJ(),1),YQe=ue(aZ(),1);Xn();mt();_r();tR();KS();Aee=1e6});function ZQe(){return K4().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(CBe(),OBe())}function WQe(e){return[...ZQe(),...Qi(e)?qQe():[]]}function gee(e={}){return mkt(e,WQe)}function mkt(e={},t){kS(e,"node");let n=YZ({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(KQe(n,{spanProcessors:e.openTelemetrySpanProcessors}),J4()),n}var XQe=B(()=>{A();mt();_r();vBe();PBe();VQe();JQe()});var ex=B(()=>{A();XQe();mt();_r()});function Zr(){return Akt}function hu(){return eFe}function tFe(){return gkt}var Akt,eFe,gkt,sc=B(()=>{"use strict";A();Akt="prod",eFe="0.1.225",gkt=`@loredotlink/cli/${eFe}`});function Skt(e=""){if(!Ekt.test(e))return e!==e.toLowerCase()}function rFe(e,t){let n=t??ykt,r=[];if(!e||typeof e!="string")return r;let o="",i,s;for(let u of e){let l=n.includes(u);if(l===!0){r.push(o),o="",i=void 0;continue}let f=Skt(u);if(s===!1){if(i===!1&&f===!0){r.push(o),o=u,i=f;continue}if(i===!0&&f===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+u,i=f;continue}}o+=u,i=f,s=l}return r.push(o),r}function Tkt(e){return e?e[0].toUpperCase()+e.slice(1):""}function bkt(e){return e?e[0].toLowerCase()+e.slice(1):""}function Ikt(e,t){return e?(Array.isArray(e)?e:rFe(e)).map(n=>Tkt(t?.normalize?n.toLowerCase():n)).join(""):""}function jk(e,t){return bkt(Ikt(e||"",t))}function wG(e,t){return e?(Array.isArray(e)?e:rFe(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function oFe(e){return wG(e||"","_")}var Ekt,ykt,iFe=B(()=>{A();Ekt=/\d/,ykt=["-","_","/","."]});import{parseArgs as Ckt}from"node:util";function PG(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function _ee(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 sd(e){return typeof e=="function"?e():e}function vkt(e=[],t={}){let n=new Set(t.boolean||[]),r=new Set(t.string||[]),o=t.alias||{},i=t.default||{},s=new Map,u=new Map;for(let[x,k]of Object.entries(o)){let P=k;for(let j of P)s.set(x,j),u.has(j)||u.set(j,[]),u.get(j).push(x),s.set(j,x),u.has(x)||u.set(x,[]),u.get(x).push(j)}let l={};function f(x){if(n.has(x))return"boolean";let k=u.get(x)||[];for(let P of k)if(n.has(P))return"boolean";return"string"}function h(x){if(r.has(x))return!0;let k=u.get(x)||[];for(let P of k)if(r.has(P))return!0;return!1}let _=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(i)]);for(let x of _)l[x]||(l[x]={type:f(x),default:i[x]});for(let[x,k]of s.entries())x.length===1&&l[k]&&!l[k].short&&(l[k].short=x);let E=[],T={};for(let x=0;x<e.length;x++){let k=e[x];if(k==="--"){E.push(...e.slice(x));break}if(k.startsWith("--no-")){let P=k.slice(5);T[P]=!0;continue}E.push(k)}let v;try{v=Ckt({args:E,options:Object.keys(l).length>0?l:void 0,allowPositionals:!0,strict:!1})}catch{v={values:{},positionals:E}}let R={_:[]};R._=v.positionals;for(let[x,k]of Object.entries(v.values)){let P=k;f(x)==="boolean"&&typeof k=="string"?P=k!=="false":h(x)&&typeof k=="boolean"&&(P=""),R[x]=P}for(let[x]of Object.entries(T)){R[x]=!1;let k=s.get(x);k&&(R[k]=!1);let P=u.get(x);if(P)for(let j of P)R[j]=!1}for(let[x,k]of s.entries())R[x]!==void 0&&R[k]===void 0&&(R[k]=R[x]),R[k]!==void 0&&R[x]===void 0&&(R[x]=R[k]),R[x]!==R[k]&&i[k]===R[k]&&(R[k]=R[x]);return R}function xkt(e,t){let n={boolean:[],string:[],alias:{},default:{}},r=uFe(t);for(let u of r){if(u.type==="positional")continue;u.type==="string"||u.type==="enum"?n.string.push(u.name):u.type==="boolean"&&n.boolean.push(u.name),u.default!==void 0&&(n.default[u.name]=u.default),u.alias&&(n.alias[u.name]=u.alias);let l=jk(u.name),f=wG(u.name);if(l!==u.name||f!==u.name){let h=PG(n.alias[u.name]||[]);l!==u.name&&!h.includes(l)&&h.push(l),f!==u.name&&!h.includes(f)&&h.push(f),h.length>0&&(n.alias[u.name]=h)}}let o=vkt(e,n),[...i]=o._,s=new Proxy(o,{get(u,l){return u[l]??u[jk(l)]??u[wG(l)]}});for(let[,u]of r.entries())if(u.type==="positional"){let l=i.shift();if(l!==void 0)s[u.name]=l;else{if(u.default===void 0&&u.required!==!1)throw new lT(`Missing required positional argument: ${u.name.toUpperCase()}`,"EARG");s[u.name]=u.default}}else if(u.type==="enum"){let l=s[u.name],f=u.options||[];if(l!==void 0&&f.length>0&&!f.includes(l))throw new lT(`Invalid value for argument: ${Bf(`--${u.name}`)} (${Bf(l)}). Expected one of: ${f.map(h=>Bf(h)).join(", ")}.`,"EARG")}else if(u.required&&s[u.name]===void 0)throw new lT(`Missing required argument: --${u.name}`,"EARG");return s}function uFe(e){let t=[];for(let[n,r]of Object.entries(e||{}))t.push({...r,name:n,alias:PG(r.alias)});return t}async function Dkt(e){return Promise.all(e.map(t=>sd(t)))}async function dT(e,t){let n=await sd(e.args||{}),r=xkt(t.rawArgs,n),o={rawArgs:t.rawArgs,args:r,data:t.data,cmd:e},i=await Dkt(e.plugins??[]),s,u;try{for(let h of i)await h.setup?.(o);typeof e.setup=="function"&&await e.setup(o);let f=await sd(e.subCommands);if(f&&Object.keys(f).length>0){let h=Nkt(t.rawArgs,n),_=t.rawArgs[h];if(_){let E=await sFe(f,_);if(!E)throw new lT(`Unknown command ${Bf(_)}`,"E_UNKNOWN_COMMAND");await dT(E,{rawArgs:t.rawArgs.slice(h+1)})}else{let E=await sd(e.default);if(E){if(e.run)throw new lT("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let T=await sFe(f,E);if(!T)throw new lT(`Default sub command ${Bf(E)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await dT(T,{rawArgs:t.rawArgs})}else if(!e.run)throw new lT("No command specified.","E_NO_COMMAND")}}typeof e.run=="function"&&(s=await e.run(o))}catch(f){u=f}let l=[];if(typeof e.cleanup=="function")try{await e.cleanup(o)}catch(f){l.push(f)}for(let f of[...i].reverse())try{await f.cleanup?.(o)}catch(h){l.push(h)}if(u)throw u;if(l.length===1)throw l[0];if(l.length>1)throw new Error("Multiple cleanup errors",{cause:l});return{result:s}}async function sFe(e,t){if(t in e)return sd(e[t]);for(let n of Object.values(e)){let r=await sd(n),o=await sd(r?.meta);if(o?.alias&&PG(o.alias).includes(t))return r}}function Nkt(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&wkt(r,t)&&n++;continue}return n}return-1}function wkt(e,t){let n=e.replace(/^-{1,2}/,""),r=jk(n);for(let[o,i]of Object.entries(t))if(!(i.type!=="string"&&i.type!=="enum")&&(r===jk(o)||(Array.isArray(i.alias)?i.alias:i.alias?[i.alias]:[]).includes(n)))return!0;return!1}async function yee(e,t){let n=await sd(e.meta||{}),r=uFe(await sd(e.args||{})),o=await sd(t?.meta||{}),i=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),s=[],u=[],l=[],f=[];for(let T of r)if(T.type==="positional"){let v=T.name.toUpperCase(),R=T.required!==!1&&T.default===void 0;u.push([Bf(v+Eee(T)),aFe(T,R)]),f.push(R?`<${v}>`:`[${v}]`)}else{let v=T.required===!0&&T.default===void 0,R=[...(T.alias||[]).map(x=>`-${x}`),`--${T.name}`].join(", ")+Eee(T);if(s.push([Bf(R),aFe(T,v)]),T.type==="boolean"&&(T.default===!0||T.negativeDescription)&&!Bkt.test(T.name)){let x=[...(T.alias||[]).map(k=>`--no-${k}`),`--no-${T.name}`].join(", ");s.push([Bf(x),[T.negativeDescription,v?OG("(Required)"):""].filter(Boolean).join(" ")])}v&&f.push(`--${T.name}`+Eee(T))}if(e.subCommands){let T=[],v=await sd(e.subCommands);for(let[R,x]of Object.entries(v)){let k=await sd((await sd(x))?.meta);if(k?.hidden)continue;let P=PG(k?.alias),j=[R,...P].join(", ");l.push([Bf(j),k?.description||""]),T.push(R,...P)}f.push(T.join("|"))}let h=[],_=n.version||o.version;h.push(OG(`${n.description} (${i+(_?` v${_}`:"")})`),"");let E=s.length>0||u.length>0;return h.push(`${kG(BG("USAGE"))} ${Bf(`${i}${E?" [OPTIONS]":""} ${f.join(" ")}`)}`,""),u.length>0&&(h.push(kG(BG("ARGUMENTS")),""),h.push(_ee(u," ")),h.push("")),s.length>0&&(h.push(kG(BG("OPTIONS")),""),h.push(_ee(s," ")),h.push("")),l.length>0&&(h.push(kG(BG("COMMANDS")),""),h.push(_ee(l," ")),h.push("",`Use ${Bf(`${i} <command> --help`)} for more information about a command.`)),h.filter(T=>typeof T=="string").join(`
|
|
40
40
|
`)}function Eee(e){let t=e.valueHint?`=<${e.valueHint}>`:"",n=t||`=<${oFe(e.name)}>`;return!e.type||e.type==="positional"||e.type==="boolean"?t:e.type==="enum"&&e.options?.length?`=<${e.options.join("|")}>`:n}function aFe(e,t){let n=t?OG("(Required)"):"",r=e.default===void 0?"":OG(`(Default: ${e.default})`);return[e.description,n,r].filter(Boolean).join(" ")}var lT,Rkt,MG,BG,Bf,OG,kG,Bkt,See=B(()=>{A();iFe();lT=class extends Error{code;constructor(e,t){super(e),this.name="CLIError",this.code=t}};Rkt=(()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||e.TEST||e.CI})(),MG=(e,t=39)=>n=>Rkt?n:`\x1B[${e}m${n}\x1B[${t}m`,BG=MG(1,22),Bf=MG(36),OG=MG(90),kG=MG(4,24);Bkt=/^no[-A-Z]/});var Tee,cFe,kkt,lFe,fQn,bee=B(()=>{"use strict";A();Tee=["free","creator","team"],cFe=typeof process<"u"&&process.env?.NODE_ENV!=="production",kkt={stripe:{plans:[{tier:"free",subjectType:"user",name:"Free",description:"Share any thread from Claude Code, Codex, or Cowork. Share with friends or keep private. Share skills with your team instantly.",price:0,priceId:null,features:[{name:"Share threads from Claude Code, Codex, and Cowork"},{name:"Share with friends or keep private"},{name:"Skills tab \u2014 tool usage across every thread"},{name:"Share skills with your team instantly"}],entitlements:{workspaceScope:!1,review:!1}},{tier:"creator",subjectType:"user",name:"Creator",description:"For builders who share a lot.",price:29,isFeatured:!0,priceId:cFe?"price_1TP9BSKwvRM43sh64waIrvjj":"price_1TPA2gKwvRM43sh6Kp4ZCpJZ",features:[{name:"Everything in Free"}],entitlements:{workspaceScope:!1,review:!1}},{tier:"team",subjectType:"organization",name:"Team",description:"GitHub for Prompts. Org-wide thread sharing plus the review surface.",price:19,minSeats:2,priceId:cFe?"price_1TP9MpKwvRM43sh6TBIFxVCd":"price_1TPA3CKwvRM43sh6k0bgPTsQ",features:[{name:"Everything in Creator"},{name:"Workspace-wide thread sharing"},{name:"Minimum 2 seats"},{name:"Review feature (beta)"}],entitlements:{workspaceScope:!0,review:!0}}]}},lFe=kkt.stripe.plans,fQn=Object.freeze(Object.fromEntries(lFe.map(e=>[e.tier,e])))});var dFe=B(()=>{"use strict";A();bee();bee()});function Pkt(e){AFe=e}function UG(){return AFe}function dt(e,t){let n=QG({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,UG(),zk].filter(r=>!!r)});e.common.issues.push(n)}function Dn(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:(s,u)=>s.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:o}}function qkt(e,t){return!!((t==="v4"||!t)&&zkt.test(e)||(t==="v6"||!t)&&Hkt.test(e))}function Vkt(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(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}function tx(e){if(e instanceof yu){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=kf.create(tx(r))}return new yu({...e._def,shape:()=>t})}else return e instanceof rh?new rh({...e._def,type:tx(e.element)}):e instanceof kf?kf.create(tx(e.unwrap())):e instanceof oh?oh.create(tx(e.unwrap())):e instanceof uA?uA.create(e.items.map(t=>tx(t))):e}function Dee(e,t){let n=FE(e),r=FE(t);if(e===t)return{valid:!0,data:e};if(n===ut.object&&r===ut.object){let o=br.objectKeys(t),i=br.objectKeys(e).filter(u=>o.indexOf(u)!==-1),s={...e,...t};for(let u of i){let l=Dee(e[u],t[u]);if(!l.valid)return{valid:!1};s[u]=l.data}return{valid:!0,data:s}}else if(n===ut.array&&r===ut.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],u=t[i],l=Dee(s,u);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===ut.date&&r===ut.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function hFe(e,t){return new TT({values:e,typeName:Xt.ZodEnum,...Dn(t)})}var br,vee,ut,FE,Ke,Okt,tl,zk,AFe,QG,Mkt,Eu,yn,gFe,ac,Ree,xee,Hk,FG,Qt,_p,pFe,Nn,Lkt,Ukt,Qkt,Fkt,Gkt,jkt,zkt,Hkt,$kt,GE,pT,fT,mT,AT,nx,gT,hT,jE,nh,Of,rx,rh,yu,_T,LG,GG,ET,uA,jG,ox,ix,zG,yT,ST,TT,bT,zE,ad,kf,oh,IT,sx,ax,Ykt,HG,$k,ux,_Fe,Kkt,Xt,Jkt,EFe,yFe,Zkt,Wkt,SFe,Xkt,eOt,tOt,nOt,rOt,oOt,iOt,sOt,aOt,uOt,cOt,lOt,dOt,pOt,fOt,mOt,AOt,gOt,hOt,_Ot,EOt,yOt,SOt,TOt,fFe,bOt,IOt,COt,vOt,ROt,xOt,DOt,NOt,wOt,_u,BOt,Iee,kOt,hp,Nee,xQn,DQn,NQn,TFe,OOt,POt,MOt,LOt,bFe,IFe,CFe,Cee,Su,UOt,QOt,FOt,GOt,wee,Bee,kee,jOt,mFe,zOt,HOt,$Ot,qOt,Oee,cA=B(()=>{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 s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(u=>typeof o[o[u]]!="number"),s={};for(let u of i)s[u]=o[u];return e.objectValues(s)},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 s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},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(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(br||(br={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(vee||(vee={}));ut=br.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),FE=e=>{switch(typeof e){case"undefined":return ut.undefined;case"string":return ut.string;case"number":return isNaN(e)?ut.nan:ut.number;case"boolean":return ut.boolean;case"function":return ut.function;case"bigint":return ut.bigint;case"symbol":return ut.symbol;case"object":return Array.isArray(e)?ut.array:e===null?ut.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ut.promise:typeof Map<"u"&&e instanceof Map?ut.map:typeof Set<"u"&&e instanceof Set?ut.set:typeof Date<"u"&&e instanceof Date?ut.date:ut.object;default:return ut.unknown}},Ke=br.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"]),Okt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),tl=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 s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,l=0;for(;l<s.path.length;){let f=s.path[l];l===s.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(s))):u[f]=u[f]||{_errors:[]},u=u[f],l++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,br.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()}};tl.create=e=>new tl(e);zk=(e,t)=>{let n;switch(e.code){case Ke.invalid_type:e.received===ut.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ke.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,br.jsonStringifyReplacer)}`;break;case Ke.unrecognized_keys:n=`Unrecognized key(s) in object: ${br.joinValues(e.keys,", ")}`;break;case Ke.invalid_union:n="Invalid input";break;case Ke.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${br.joinValues(e.options)}`;break;case Ke.invalid_enum_value:n=`Invalid enum value. Expected ${br.joinValues(e.options)}, received '${e.received}'`;break;case Ke.invalid_arguments:n="Invalid function arguments";break;case Ke.invalid_return_type:n="Invalid function return type";break;case Ke.invalid_date:n="Invalid date";break;case Ke.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}"`:br.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ke.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 Ke.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 Ke.custom:n="Invalid input";break;case Ke.invalid_intersection_types:n="Intersection results could not be merged";break;case Ke.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ke.not_finite:n="Number must be finite";break;default:n=t.defaultError,br.assertNever(e)}return{message:n}},AFe=zk;QG=e=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i},u="",l=r.filter(f=>!!f).slice().reverse();for(let f of l)u=f(s,{data:t,defaultError:u}).message;return{...o,path:i,message:o.message||u}},Mkt=[];Eu=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 yn;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:s}=o;if(i.status==="aborted"||s.status==="aborted")return yn;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}},yn=Object.freeze({status:"aborted"}),gFe=e=>({status:"dirty",value:e}),ac=e=>({status:"valid",value:e}),Ree=e=>e.status==="aborted",xee=e=>e.status==="dirty",Hk=e=>e.status==="valid",FG=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})(Qt||(Qt={}));_p=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}},pFe=(e,t)=>{if(Hk(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 tl(e.common.issues);return this._error=n,this._error}}};Nn=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 FE(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:FE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Eu,ctx:{common:t.parent.common,data:t.data,parsedType:FE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(FG(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:FE(t)},i=this._parseSync({data:t,path:o.path,parent:o});return pFe(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:FE(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(FG(o)?o:Promise.resolve(o));return pFe(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 s=t(o),u=()=>i.addIssue({code:Ke.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(u(),!1)):s?!0:(u(),!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 ad({schema:this,typeName:Xt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return kf.create(this,this._def)}nullable(){return oh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rh.create(this,this._def)}promise(){return zE.create(this,this._def)}or(t){return _T.create([this,t],this._def)}and(t){return ET.create(this,t,this._def)}transform(t){return new ad({...Dn(this._def),schema:this,typeName:Xt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new IT({...Dn(this._def),innerType:this,defaultValue:n,typeName:Xt.ZodDefault})}brand(){return new HG({typeName:Xt.ZodBranded,type:this,...Dn(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new sx({...Dn(this._def),innerType:this,catchValue:n,typeName:Xt.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return $k.create(this,t)}readonly(){return ux.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Lkt=/^c[^\s-]{8,}$/i,Ukt=/^[a-z][a-z0-9]*$/,Qkt=/[0-9A-HJKMNP-TV-Z]{26}/,Fkt=/^[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,Gkt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jkt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),zkt=/^(((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}))$/,Hkt=/^(([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})))$/,$kt=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$");GE=class e extends Nn{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(o=>t.test(o),{validation:n,code:Ke.invalid_string,...Qt.errToObj(r)}),this.nonempty=t=>this.min(1,Qt.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)!==ut.string){let i=this._getOrReturnCtx(t);return dt(i,{code:Ke.invalid_type,expected:ut.string,received:i.parsedType}),yn}let r=new Eu,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),dt(o,{code:Ke.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),dt(o,{code:Ke.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,u=t.data.length<i.value;(s||u)&&(o=this._getOrReturnCtx(t,o),s?dt(o,{code:Ke.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&dt(o,{code:Ke.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Gkt.test(t.data)||(o=this._getOrReturnCtx(t,o),dt(o,{validation:"email",code:Ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")jkt.test(t.data)||(o=this._getOrReturnCtx(t,o),dt(o,{validation:"emoji",code:Ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Fkt.test(t.data)||(o=this._getOrReturnCtx(t,o),dt(o,{validation:"uuid",code:Ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Lkt.test(t.data)||(o=this._getOrReturnCtx(t,o),dt(o,{validation:"cuid",code:Ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Ukt.test(t.data)||(o=this._getOrReturnCtx(t,o),dt(o,{validation:"cuid2",code:Ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Qkt.test(t.data)||(o=this._getOrReturnCtx(t,o),dt(o,{validation:"ulid",code:Ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),dt(o,{validation:"url",code:Ke.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),dt(o,{validation:"regex",code:Ke.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),dt(o,{code:Ke.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),dt(o,{code:Ke.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),dt(o,{code:Ke.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?$kt(i).test(t.data)||(o=this._getOrReturnCtx(t,o),dt(o,{code:Ke.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?qkt(t.data,i.version)||(o=this._getOrReturnCtx(t,o),dt(o,{validation:"ip",code:Ke.invalid_string,message:i.message}),r.dirty()):br.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",...Qt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Qt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Qt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Qt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Qt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Qt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Qt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Qt.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,...Qt.errToObj(t?.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Qt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Qt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Qt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Qt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Qt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Qt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Qt.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}};GE.create=e=>{var t;return new GE({checks:[],typeName:Xt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Dn(e)})};pT=class e extends Nn{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)!==ut.number){let i=this._getOrReturnCtx(t);return dt(i,{code:Ke.invalid_type,expected:ut.number,received:i.parsedType}),yn}let r,o=new Eu;for(let i of this._def.checks)i.kind==="int"?br.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),dt(r,{code:Ke.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),dt(r,{code:Ke.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),dt(r,{code:Ke.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Vkt(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),dt(r,{code:Ke.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),dt(r,{code:Ke.not_finite,message:i.message}),o.dirty()):br.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Qt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Qt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Qt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Qt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Qt.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"&&br.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)}};pT.create=e=>new pT({checks:[],typeName:Xt.ZodNumber,coerce:e?.coerce||!1,...Dn(e)});fT=class e extends Nn{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)!==ut.bigint){let i=this._getOrReturnCtx(t);return dt(i,{code:Ke.invalid_type,expected:ut.bigint,received:i.parsedType}),yn}let r,o=new Eu;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),dt(r,{code:Ke.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),dt(r,{code:Ke.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),dt(r,{code:Ke.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):br.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qt.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:Qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Qt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qt.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}};fT.create=e=>{var t;return new fT({checks:[],typeName:Xt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Dn(e)})};mT=class extends Nn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ut.boolean){let r=this._getOrReturnCtx(t);return dt(r,{code:Ke.invalid_type,expected:ut.boolean,received:r.parsedType}),yn}return ac(t.data)}};mT.create=e=>new mT({typeName:Xt.ZodBoolean,coerce:e?.coerce||!1,...Dn(e)});AT=class e extends Nn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ut.date){let i=this._getOrReturnCtx(t);return dt(i,{code:Ke.invalid_type,expected:ut.date,received:i.parsedType}),yn}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return dt(i,{code:Ke.invalid_date}),yn}let r=new Eu,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),dt(o,{code:Ke.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),dt(o,{code:Ke.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):br.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:Qt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Qt.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}};AT.create=e=>new AT({checks:[],coerce:e?.coerce||!1,typeName:Xt.ZodDate,...Dn(e)});nx=class extends Nn{_parse(t){if(this._getType(t)!==ut.symbol){let r=this._getOrReturnCtx(t);return dt(r,{code:Ke.invalid_type,expected:ut.symbol,received:r.parsedType}),yn}return ac(t.data)}};nx.create=e=>new nx({typeName:Xt.ZodSymbol,...Dn(e)});gT=class extends Nn{_parse(t){if(this._getType(t)!==ut.undefined){let r=this._getOrReturnCtx(t);return dt(r,{code:Ke.invalid_type,expected:ut.undefined,received:r.parsedType}),yn}return ac(t.data)}};gT.create=e=>new gT({typeName:Xt.ZodUndefined,...Dn(e)});hT=class extends Nn{_parse(t){if(this._getType(t)!==ut.null){let r=this._getOrReturnCtx(t);return dt(r,{code:Ke.invalid_type,expected:ut.null,received:r.parsedType}),yn}return ac(t.data)}};hT.create=e=>new hT({typeName:Xt.ZodNull,...Dn(e)});jE=class extends Nn{constructor(){super(...arguments),this._any=!0}_parse(t){return ac(t.data)}};jE.create=e=>new jE({typeName:Xt.ZodAny,...Dn(e)});nh=class extends Nn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ac(t.data)}};nh.create=e=>new nh({typeName:Xt.ZodUnknown,...Dn(e)});Of=class extends Nn{_parse(t){let n=this._getOrReturnCtx(t);return dt(n,{code:Ke.invalid_type,expected:ut.never,received:n.parsedType}),yn}};Of.create=e=>new Of({typeName:Xt.ZodNever,...Dn(e)});rx=class extends Nn{_parse(t){if(this._getType(t)!==ut.undefined){let r=this._getOrReturnCtx(t);return dt(r,{code:Ke.invalid_type,expected:ut.void,received:r.parsedType}),yn}return ac(t.data)}};rx.create=e=>new rx({typeName:Xt.ZodVoid,...Dn(e)});rh=class e extends Nn{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==ut.array)return dt(n,{code:Ke.invalid_type,expected:ut.array,received:n.parsedType}),yn;if(o.exactLength!==null){let s=n.data.length>o.exactLength.value,u=n.data.length<o.exactLength.value;(s||u)&&(dt(n,{code:s?Ke.too_big:Ke.too_small,minimum:u?o.exactLength.value:void 0,maximum:s?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&&(dt(n,{code:Ke.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&&(dt(n,{code:Ke.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((s,u)=>o.type._parseAsync(new _p(n,s,n.path,u)))).then(s=>Eu.mergeArray(r,s));let i=[...n.data].map((s,u)=>o.type._parseSync(new _p(n,s,n.path,u)));return Eu.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Qt.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Qt.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Qt.toString(n)}})}nonempty(t){return this.min(1,t)}};rh.create=(e,t)=>new rh({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Xt.ZodArray,...Dn(t)});yu=class e extends Nn{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=br.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ut.object){let f=this._getOrReturnCtx(t);return dt(f,{code:Ke.invalid_type,expected:ut.object,received:f.parsedType}),yn}let{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),u=[];if(!(this._def.catchall instanceof Of&&this._def.unknownKeys==="strip"))for(let f in o.data)s.includes(f)||u.push(f);let l=[];for(let f of s){let h=i[f],_=o.data[f];l.push({key:{status:"valid",value:f},value:h._parse(new _p(o,_,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Of){let f=this._def.unknownKeys;if(f==="passthrough")for(let h of u)l.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(f==="strict")u.length>0&&(dt(o,{code:Ke.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let h of u){let _=o.data[h];l.push({key:{status:"valid",value:h},value:f._parse(new _p(o,_,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let f=[];for(let h of l){let _=await h.key;f.push({key:_,value:await h.value,alwaysSet:h.alwaysSet})}return f}).then(f=>Eu.mergeObjectSync(r,f)):Eu.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Qt.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,u;let l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=Qt.errToObj(t).message)!==null&&u!==void 0?u:l}:{message:l}}}:{}})}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:Xt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return br.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 br.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return tx(this)}partial(t){let n={};return br.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 br.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof kf;)i=i._def.innerType;n[r]=i}}),new e({...this._def,shape:()=>n})}keyof(){return hFe(br.objectKeys(this.shape))}};yu.create=(e,t)=>new yu({shape:()=>e,unknownKeys:"strip",catchall:Of.create(),typeName:Xt.ZodObject,...Dn(t)});yu.strictCreate=(e,t)=>new yu({shape:()=>e,unknownKeys:"strict",catchall:Of.create(),typeName:Xt.ZodObject,...Dn(t)});yu.lazycreate=(e,t)=>new yu({shape:e,unknownKeys:"strip",catchall:Of.create(),typeName:Xt.ZodObject,...Dn(t)});_T=class extends Nn{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(let u of i)if(u.result.status==="valid")return u.result;for(let u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let s=i.map(u=>new tl(u.ctx.common.issues));return dt(n,{code:Ke.invalid_union,unionErrors:s}),yn}if(n.common.async)return Promise.all(r.map(async i=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of r){let f={...n,common:{...n.common,issues:[]},parent:null},h=l._parseSync({data:n.data,path:n.path,parent:f});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:f}),f.common.issues.length&&s.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let u=s.map(l=>new tl(l));return dt(n,{code:Ke.invalid_union,unionErrors:u}),yn}}get options(){return this._def.options}};_T.create=(e,t)=>new _T({options:e,typeName:Xt.ZodUnion,...Dn(t)});LG=e=>e instanceof yT?LG(e.schema):e instanceof ad?LG(e.innerType()):e instanceof ST?[e.value]:e instanceof TT?e.options:e instanceof bT?Object.keys(e.enum):e instanceof IT?LG(e._def.innerType):e instanceof gT?[void 0]:e instanceof hT?[null]:null,GG=class e extends Nn{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.object)return dt(n,{code:Ke.invalid_type,expected:ut.object,received:n.parsedType}),yn;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}):(dt(n,{code:Ke.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),yn)}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 s=LG(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of s){if(o.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);o.set(u,i)}}return new e({typeName:Xt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Dn(r)})}};ET=class extends Nn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(i,s)=>{if(Ree(i)||Ree(s))return yn;let u=Dee(i.value,s.value);return u.valid?((xee(i)||xee(s))&&n.dirty(),{status:n.value,value:u.data}):(dt(r,{code:Ke.invalid_intersection_types}),yn)};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,s])=>o(i,s)):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}))}};ET.create=(e,t,n)=>new ET({left:e,right:t,typeName:Xt.ZodIntersection,...Dn(n)});uA=class e extends Nn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ut.array)return dt(r,{code:Ke.invalid_type,expected:ut.array,received:r.parsedType}),yn;if(r.data.length<this._def.items.length)return dt(r,{code:Ke.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),yn;!this._def.rest&&r.data.length>this._def.items.length&&(dt(r,{code:Ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((s,u)=>{let l=this._def.items[u]||this._def.rest;return l?l._parse(new _p(r,s,r.path,u)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Eu.mergeArray(n,s)):Eu.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};uA.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new uA({items:e,typeName:Xt.ZodTuple,rest:null,...Dn(t)})};jG=class e extends Nn{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!==ut.object)return dt(r,{code:Ke.invalid_type,expected:ut.object,received:r.parsedType}),yn;let o=[],i=this._def.keyType,s=this._def.valueType;for(let u in r.data)o.push({key:i._parse(new _p(r,u,r.path,u)),value:s._parse(new _p(r,r.data[u],r.path,u))});return r.common.async?Eu.mergeObjectAsync(n,o):Eu.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Nn?new e({keyType:t,valueType:n,typeName:Xt.ZodRecord,...Dn(r)}):new e({keyType:GE.create(),valueType:t,typeName:Xt.ZodRecord,...Dn(n)})}},ox=class extends Nn{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!==ut.map)return dt(r,{code:Ke.invalid_type,expected:ut.map,received:r.parsedType}),yn;let o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([u,l],f)=>({key:o._parse(new _p(r,u,r.path,[f,"key"])),value:i._parse(new _p(r,l,r.path,[f,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let l of s){let f=await l.key,h=await l.value;if(f.status==="aborted"||h.status==="aborted")return yn;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let l of s){let f=l.key,h=l.value;if(f.status==="aborted"||h.status==="aborted")return yn;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}}}};ox.create=(e,t,n)=>new ox({valueType:t,keyType:e,typeName:Xt.ZodMap,...Dn(n)});ix=class e extends Nn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ut.set)return dt(r,{code:Ke.invalid_type,expected:ut.set,received:r.parsedType}),yn;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(dt(r,{code:Ke.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&&(dt(r,{code:Ke.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function s(l){let f=new Set;for(let h of l){if(h.status==="aborted")return yn;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}let u=[...r.data.values()].map((l,f)=>i._parse(new _p(r,l,r.path,f)));return r.common.async?Promise.all(u).then(l=>s(l)):s(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:Qt.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Qt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ix.create=(e,t)=>new ix({valueType:e,minSize:null,maxSize:null,typeName:Xt.ZodSet,...Dn(t)});zG=class e extends Nn{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.function)return dt(n,{code:Ke.invalid_type,expected:ut.function,received:n.parsedType}),yn;function r(u,l){return QG({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,UG(),zk].filter(f=>!!f),issueData:{code:Ke.invalid_arguments,argumentsError:l}})}function o(u,l){return QG({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,UG(),zk].filter(f=>!!f),issueData:{code:Ke.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof zE){let u=this;return ac(async function(...l){let f=new tl([]),h=await u._def.args.parseAsync(l,i).catch(T=>{throw f.addIssue(r(l,T)),f}),_=await Reflect.apply(s,this,h);return await u._def.returns._def.type.parseAsync(_,i).catch(T=>{throw f.addIssue(o(_,T)),f})})}else{let u=this;return ac(function(...l){let f=u._def.args.safeParse(l,i);if(!f.success)throw new tl([r(l,f.error)]);let h=Reflect.apply(s,this,f.data),_=u._def.returns.safeParse(h,i);if(!_.success)throw new tl([o(h,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:uA.create(t).rest(nh.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||uA.create([]).rest(nh.create()),returns:n||nh.create(),typeName:Xt.ZodFunction,...Dn(r)})}},yT=class extends Nn{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})}};yT.create=(e,t)=>new yT({getter:e,typeName:Xt.ZodLazy,...Dn(t)});ST=class extends Nn{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return dt(n,{received:n.data,code:Ke.invalid_literal,expected:this._def.value}),yn}return{status:"valid",value:t.data}}get value(){return this._def.value}};ST.create=(e,t)=>new ST({value:e,typeName:Xt.ZodLiteral,...Dn(t)});TT=class e extends Nn{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return dt(n,{expected:br.joinValues(r),received:n.parsedType,code:Ke.invalid_type}),yn}if(this._def.values.indexOf(t.data)===-1){let n=this._getOrReturnCtx(t),r=this._def.values;return dt(n,{received:n.data,code:Ke.invalid_enum_value,options:r}),yn}return ac(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)))}};TT.create=hFe;bT=class extends Nn{_parse(t){let n=br.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ut.string&&r.parsedType!==ut.number){let o=br.objectValues(n);return dt(r,{expected:br.joinValues(o),received:r.parsedType,code:Ke.invalid_type}),yn}if(n.indexOf(t.data)===-1){let o=br.objectValues(n);return dt(r,{received:r.data,code:Ke.invalid_enum_value,options:o}),yn}return ac(t.data)}get enum(){return this._def.values}};bT.create=(e,t)=>new bT({values:e,typeName:Xt.ZodNativeEnum,...Dn(t)});zE=class extends Nn{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==ut.promise&&n.common.async===!1)return dt(n,{code:Ke.invalid_type,expected:ut.promise,received:n.parsedType}),yn;let r=n.parsedType===ut.promise?n.data:Promise.resolve(n.data);return ac(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};zE.create=(e,t)=>new zE({type:e,typeName:Xt.ZodPromise,...Dn(t)});ad=class extends Nn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Xt.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:s=>{dt(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){let s=u=>{let l=o.refinement(u,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){let u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?yn:(u.status==="dirty"&&n.dirty(),s(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?yn:(u.status==="dirty"&&n.dirty(),s(u.value).then(()=>({status:n.value,value:u.value}))))}if(o.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Hk(s))return s;let u=o.transform(s.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Hk(s)?Promise.resolve(o.transform(s.value,i)).then(u=>({status:n.value,value:u})):s);br.assertNever(o)}};ad.create=(e,t,n)=>new ad({schema:e,typeName:Xt.ZodEffects,effect:t,...Dn(n)});ad.createWithPreprocess=(e,t,n)=>new ad({schema:t,effect:{type:"preprocess",transform:e},typeName:Xt.ZodEffects,...Dn(n)});kf=class extends Nn{_parse(t){return this._getType(t)===ut.undefined?ac(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};kf.create=(e,t)=>new kf({innerType:e,typeName:Xt.ZodOptional,...Dn(t)});oh=class extends Nn{_parse(t){return this._getType(t)===ut.null?ac(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};oh.create=(e,t)=>new oh({innerType:e,typeName:Xt.ZodNullable,...Dn(t)});IT=class extends Nn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===ut.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};IT.create=(e,t)=>new IT({innerType:e,typeName:Xt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Dn(t)});sx=class extends Nn{_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 FG(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new tl(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tl(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};sx.create=(e,t)=>new sx({innerType:e,typeName:Xt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Dn(t)});ax=class extends Nn{_parse(t){if(this._getType(t)!==ut.nan){let r=this._getOrReturnCtx(t);return dt(r,{code:Ke.invalid_type,expected:ut.nan,received:r.parsedType}),yn}return{status:"valid",value:t.data}}};ax.create=e=>new ax({typeName:Xt.ZodNaN,...Dn(e)});Ykt=Symbol("zod_brand"),HG=class extends Nn{_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}},$k=class e extends Nn{_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"?yn:i.status==="dirty"?(n.dirty(),gFe(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"?yn: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:Xt.ZodPipeline})}},ux=class extends Nn{_parse(t){let n=this._def.innerType._parse(t);return Hk(n)&&(n.value=Object.freeze(n.value)),n}};ux.create=(e,t)=>new ux({innerType:e,typeName:Xt.ZodReadonly,...Dn(t)});_Fe=(e,t={},n)=>e?jE.create().superRefine((r,o)=>{var i,s;if(!e(r)){let u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(i=u.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,f=typeof u=="string"?{message:u}:u;o.addIssue({code:"custom",...f,fatal:l})}}):jE.create(),Kkt={object:yu.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"})(Xt||(Xt={}));Jkt=(e,t={message:`Input not instance of ${e.name}`})=>_Fe(n=>n instanceof e,t),EFe=GE.create,yFe=pT.create,Zkt=ax.create,Wkt=fT.create,SFe=mT.create,Xkt=AT.create,eOt=nx.create,tOt=gT.create,nOt=hT.create,rOt=jE.create,oOt=nh.create,iOt=Of.create,sOt=rx.create,aOt=rh.create,uOt=yu.create,cOt=yu.strictCreate,lOt=_T.create,dOt=GG.create,pOt=ET.create,fOt=uA.create,mOt=jG.create,AOt=ox.create,gOt=ix.create,hOt=zG.create,_Ot=yT.create,EOt=ST.create,yOt=TT.create,SOt=bT.create,TOt=zE.create,fFe=ad.create,bOt=kf.create,IOt=oh.create,COt=ad.createWithPreprocess,vOt=$k.create,ROt=()=>EFe().optional(),xOt=()=>yFe().optional(),DOt=()=>SFe().optional(),NOt={string:(e=>GE.create({...e,coerce:!0})),number:(e=>pT.create({...e,coerce:!0})),boolean:(e=>mT.create({...e,coerce:!0})),bigint:(e=>fT.create({...e,coerce:!0})),date:(e=>AT.create({...e,coerce:!0}))},wOt=yn,_u=Object.freeze({__proto__:null,defaultErrorMap:zk,setErrorMap:Pkt,getErrorMap:UG,makeIssue:QG,EMPTY_PATH:Mkt,addIssueToContext:dt,ParseStatus:Eu,INVALID:yn,DIRTY:gFe,OK:ac,isAborted:Ree,isDirty:xee,isValid:Hk,isAsync:FG,get util(){return br},get objectUtil(){return vee},ZodParsedType:ut,getParsedType:FE,ZodType:Nn,ZodString:GE,ZodNumber:pT,ZodBigInt:fT,ZodBoolean:mT,ZodDate:AT,ZodSymbol:nx,ZodUndefined:gT,ZodNull:hT,ZodAny:jE,ZodUnknown:nh,ZodNever:Of,ZodVoid:rx,ZodArray:rh,ZodObject:yu,ZodUnion:_T,ZodDiscriminatedUnion:GG,ZodIntersection:ET,ZodTuple:uA,ZodRecord:jG,ZodMap:ox,ZodSet:ix,ZodFunction:zG,ZodLazy:yT,ZodLiteral:ST,ZodEnum:TT,ZodNativeEnum:bT,ZodPromise:zE,ZodEffects:ad,ZodTransformer:ad,ZodOptional:kf,ZodNullable:oh,ZodDefault:IT,ZodCatch:sx,ZodNaN:ax,BRAND:Ykt,ZodBranded:HG,ZodPipeline:$k,ZodReadonly:ux,custom:_Fe,Schema:Nn,ZodSchema:Nn,late:Kkt,get ZodFirstPartyTypeKind(){return Xt},coerce:NOt,any:rOt,array:aOt,bigint:Wkt,boolean:SFe,date:Xkt,discriminatedUnion:dOt,effect:fFe,enum:yOt,function:hOt,instanceof:Jkt,intersection:pOt,lazy:_Ot,literal:EOt,map:AOt,nan:Zkt,nativeEnum:SOt,never:iOt,null:nOt,nullable:IOt,number:yFe,object:uOt,oboolean:DOt,onumber:xOt,optional:bOt,ostring:ROt,pipeline:vOt,preprocess:COt,promise:TOt,record:mOt,set:gOt,strictObject:cOt,string:EFe,symbol:eOt,transformer:fFe,tuple:fOt,undefined:tOt,union:lOt,unknown:oOt,void:sOt,NEVER:wOt,ZodIssueCode:Ke,quotelessJson:Okt,ZodError:tl}),BOt=e=>typeof e?.safeParse=="function",Iee=e=>typeof e?.passthrough=="function",kOt=(e,t)=>Iee(e)?Iee(t)?e.merge(t):e:Iee(t)?t:Object.assign({},e,t),hp=_u.object({name:_u.literal("ZodError"),issues:_u.array(_u.object({path:_u.array(_u.union([_u.string(),_u.number()])),message:_u.string().optional(),code:_u.nativeEnum(_u.ZodIssueCode)}).catchall(_u.any()))}),Nee=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}},xQn=_u.object({message:_u.literal("Request validation failed"),pathParameterErrors:hp.nullable(),headerErrors:hp.nullable(),queryParameterErrors:hp.nullable(),bodyErrors:hp.nullable()}),DQn=_u.object({pathParameterErrors:hp.nullable(),headerErrors:hp.nullable(),queryParameterErrors:hp.nullable(),bodyErrors:hp.nullable()}),NQn=_u.object({paramsResult:hp.nullable(),headersResult:hp.nullable(),queryResult:hp.nullable(),bodyResult:hp.nullable()}),TFe="zod-ts-rest-polyfill",OOt=e=>{if(!e)return!1;let t=e?.["~standard"];return t?t.version===1&&typeof t.validate=="function":!1},POt=e=>OOt(e)?e:BOt(e)?(Object.assign(e,{"~standard":{vendor:TFe,version:1,validate:r=>{let o=e.safeParse(r);return o.success?{value:o.data}:{issues:o.error.issues}}}}),e):null,MOt=(e,t)=>e?t?e instanceof yu&&t instanceof yu?kOt(e,t):{...e,...t}:e:t,LOt=(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===TFe?{error:new tl(r.issues)}:{error:new Nee(r.issues)}:n&&typeof e=="object"&&r.value?{value:{...e,...r.value}}:{value:r.value}},bFe=Symbol("ContractNoBody"),IFe=e=>"method"in e&&"path"in e,CFe=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>{var o,i,s;return IFe(r)?[n,{...r,path:t?.pathPrefix?t.pathPrefix+r.path:r.path,headers:MOt(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,...(s=r.metadata)!==null&&s!==void 0?s:{}}:r.metadata}]:[n,CFe(r,t)]})),Cee=Symbol("ContractPlainType"),Su=()=>({router:(e,t)=>CFe(e,t),query:e=>e,mutation:e=>e,responses:e=>e,response:()=>Cee,body:()=>Cee,type:()=>Cee,otherResponse:({contentType:e,body:t})=>({contentType:e,body:t}),noBody:()=>bFe}),UOt=({path:e,params:t})=>{let n=t;return e.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},QOt=(e,t=!1)=>{let n=t?FOt(e):GOt(e);return n?.length>0?"?"+n:""},FOt=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("&"):"",GOt=e=>e?Object.keys(e).flatMap(t=>wee(t,e[t])).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(n)}`).join("&"):"",wee=(e,t)=>Array.isArray(t)?t.flatMap((n,r)=>wee(`${e}[${r}]`,n)):t instanceof Date?[[`${e}`,t.toISOString()]]:t===null?[[`${e}`,""]]:t===void 0?[]:typeof t=="object"?Object.keys(t).flatMap(n=>wee(`${e}[${n}]`,t[n])):[[`${e}`,`${t}`]],Bee=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}},kee=async({route:e,path:t,method:n,headers:r,body:o,validateResponse:i,fetchOptions:s})=>{let u=await fetch(t,{...s,method:n,headers:r,body:o}),l=u.headers.get("content-type");if(l?.includes("application/")&&l?.includes("json")){let f=e.responses[u.status],h={status:u.status,body:f===bFe?void 0:await u.json(),headers:u.headers},_=POt(f);if(_&&(i??e.validateResponseOnClient)){let E=LOt(h.body,_);if(E.error)throw E.error;return{...h,body:E.value}}return h}return l?.includes("text/")?{status:u.status,body:await u.text(),headers:u.headers}:{status:u.status,body:await u.blob(),headers:u.headers}},jOt=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},mFe=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t.toLowerCase(),n])),zOt=e=>{let{path:t,clientArgs:n,route:r,body:o,query:i,extraInputArgs:s,headers:u,fetchOptions:l}=e,f=n.api||kee,h=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([T,v])=>typeof v=="function"?[T,v(e)]:[T,v])),_={...h&&mFe(h),...mFe(u)};Object.keys(_).forEach(T=>{_[T]===void 0&&delete _[T]});let E={route:r,path:t,method:r.method,headers:_,body:void 0,rawBody:o,rawQuery:i,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...l},...l?.signal&&{signal:l.signal},...l?.cache&&{cache:l.cache},...l&&"next"in l&&!!l?.next&&{next:l.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?E={...E,contentType:"multipart/form-data",body:o instanceof FormData?o:jOt(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?E={...E,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...E.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(E={...E,contentType:"application/json",headers:{"content-type":"application/json",...E.headers},body:JSON.stringify(o)})),f({...E,...s})},HOt=(e,t,n)=>{let{query:r,params:o,body:i,headers:s,extraHeaders:u,overrideClientOptions:l,fetchOptions:f,cache:h,next:_,...E}=n||{},T={...t,...l},v=typeof o=="object"?Object.fromEntries(Object.entries(o).map(([x,k])=>[x,String(k)])):{};return{path:$Ot(r,T.baseUrl,v,e,!!T.jsonQuery),clientArgs:T,route:e,body:i,query:r,extraInputArgs:E,fetchOptions:{...h&&{cache:h},..._&&{next:_},...f},headers:{...u,...s}}},$Ot=(e,t,n,r,o)=>{let i=UOt({path:r.path,params:n}),s=QOt(e,o);return t.endsWith("/")&&i.startsWith("/")?`${t}${i.substring(1)}${s}`:`${t}${i}${s}`},qOt=(e,t)=>{let n=Object.keys(e.responses);return async r=>{let o=HOt(e,t,r),i=await zOt(o);if(!t.throwOnUnknownStatus||n.includes(i.status.toString()))return i;throw new Bee(i,n)}},Oee=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>IFe(r)?[n,qOt(r,t)]:[n,Oee(r,t)]))});function ie(e,t,n){function r(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,l);let f=s.prototype,h=Object.keys(f);for(let _=0;_<h.length;_++){let E=h[_];E in u||(u[E]=f[E].bind(u))}}let o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(u){var l;let f=n?.Parent?new i:this;r(f,u),(l=f._zod).deferred??(l.deferred=[]);for(let h of f._zod.deferred)h();return f}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Ii(e){return e&&Object.assign(CT,e),CT}var vFe,Pee,Mee,Pf,HE,CT,vT=B(()=>{A();Pee=Object.freeze({status:"aborted"});Mee=Symbol("zod_brand"),Pf=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},HE=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(vFe=globalThis).__zod_globalConfig??(vFe.__zod_globalConfig={});CT=globalThis.__zod_globalConfig});var Le={};Ws(Le,{BIGINT_FORMAT_RANGES:()=>qee,Class:()=>Uee,NUMBER_FORMAT_RANGES:()=>$ee,aborted:()=>YE,allowsEval:()=>Gee,assert:()=>ZOt,assertEqual:()=>VOt,assertIs:()=>KOt,assertNever:()=>JOt,assertNotEqual:()=>YOt,assignProp:()=>qE,base64ToUint8Array:()=>xFe,base64urlToUint8Array:()=>mPt,cached:()=>lx,captureStackTrace:()=>qG,cleanEnum:()=>fPt,cleanRegex:()=>Yk,clone:()=>uc,cloneDef:()=>XOt,createTransparentProxy:()=>iPt,defineLazy:()=>Hn,esc:()=>$G,escapeRegex:()=>Ep,explicitlyAborted:()=>Vee,extend:()=>uPt,finalizeIssue:()=>cc,floatSafeRemainder:()=>Qee,getElementAtPath:()=>ePt,getEnumValues:()=>Vk,getLengthableOrigin:()=>Zk,getParsedType:()=>oPt,getSizableOrigin:()=>Jk,hexToUint8Array:()=>gPt,isObject:()=>RT,isPlainObject:()=>VE,issue:()=>dx,joinValues:()=>de,jsonStringifyReplacer:()=>cx,merge:()=>lPt,mergeDefs:()=>ih,normalizeParams:()=>qe,nullish:()=>$E,numKeys:()=>rPt,objectClone:()=>WOt,omit:()=>aPt,optionalKeys:()=>Hee,parsedType:()=>Oe,partial:()=>dPt,pick:()=>sPt,prefixIssues:()=>nl,primitiveTypes:()=>zee,promiseAllObject:()=>tPt,propertyKeyTypes:()=>Kk,randomString:()=>nPt,required:()=>pPt,safeExtend:()=>cPt,shallowClone:()=>jee,slugify:()=>Fee,stringifyPrimitive:()=>ke,uint8ArrayToBase64:()=>DFe,uint8ArrayToBase64url:()=>APt,uint8ArrayToHex:()=>hPt,unwrapMessage:()=>qk});function VOt(e){return e}function YOt(e){return e}function KOt(e){}function JOt(e){throw new Error("Unexpected value in exhaustive check")}function ZOt(e){}function Vk(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 de(e,t="|"){return e.map(n=>ke(n)).join(t)}function cx(e,t){return typeof t=="bigint"?t.toString():t}function lx(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function $E(e){return e==null}function Yk(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Qee(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 Hn(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==RFe)return r===void 0&&(r=RFe,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function WOt(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function qE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ih(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function XOt(e){return ih(e._zod.def)}function ePt(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function tPt(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 nPt(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function $G(e){return JSON.stringify(e)}function Fee(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function RT(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function VE(e){if(RT(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(RT(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function jee(e){return VE(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function rPt(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Ep(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uc(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function qe(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 iPt(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 ke(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Hee(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function sPt(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=ih(e._zod.def,{get shape(){let s={};for(let u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(s[u]=n.shape[u])}return qE(this,"shape",s),s},checks:[]});return uc(e,i)}function aPt(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=ih(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete s[u]}return qE(this,"shape",s),s},checks:[]});return uc(e,i)}function uPt(e,t){if(!VE(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 s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=ih(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return qE(this,"shape",i),i}});return uc(e,o)}function cPt(e,t){if(!VE(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=ih(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return qE(this,"shape",r),r}});return uc(e,n)}function lPt(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=ih(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return qE(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return uc(e,n)}function dPt(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 s=ih(t._zod.def,{get shape(){let u=t._zod.def.shape,l={...u};if(n)for(let f in n){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(l[f]=e?new e({type:"optional",innerType:u[f]}):u[f])}else for(let f in u)l[f]=e?new e({type:"optional",innerType:u[f]}):u[f];return qE(this,"shape",l),l},checks:[]});return uc(t,s)}function pPt(e,t,n){let r=ih(t._zod.def,{get shape(){let o=t._zod.def.shape,i={...o};if(n)for(let s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(let s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return qE(this,"shape",i),i}});return uc(t,r)}function YE(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 Vee(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 nl(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function qk(e){return typeof e=="string"?e:e?.message}function cc(e,t,n){let r=e.message?e.message:qk(e.inst?._zod.def?.error?.(e))??qk(t?.error?.(e))??qk(n.customError?.(e))??qk(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...u}=e;return u.path??(u.path=[]),u.message=r,t?.reportInput&&(u.input=s),u}function Jk(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Zk(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Oe(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 dx(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function fPt(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function xFe(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 DFe(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function mPt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return xFe(t+n)}function APt(e){return DFe(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function gPt(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 hPt(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var RFe,qG,Gee,oPt,Kk,zee,$ee,qee,Uee,St=B(()=>{A();vT();RFe=Symbol("evaluating");qG="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Gee=lx(()=>{if(CT.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});oPt=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}`)}},Kk=new Set(["string","number","symbol"]),zee=new Set(["string","number","bigint","boolean","symbol","undefined"]);$ee={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]},qee={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Uee=class{constructor(...t){}}});function Xk(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 eO(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>r({issues:u},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{let u=[...i,...s.path];if(u.length===0)n._errors.push(t(s));else{let l=n,f=0;for(;f<u.length;){let h=u[f];f===u.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(s))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}}};return r(e),n}function Yee(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var s,u;for(let l of o.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(f=>r({issues:f},[...i,...l.path]));else if(l.code==="invalid_key")r({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")r({issues:l.issues},[...i,...l.path]);else{let f=[...i,...l.path];if(f.length===0){n.errors.push(t(l));continue}let h=n,_=0;for(;_<f.length;){let E=f[_],T=_===f.length-1;typeof E=="string"?(h.properties??(h.properties={}),(s=h.properties)[E]??(s[E]={errors:[]}),h=h.properties[E]):(h.items??(h.items=[]),(u=h.items)[E]??(u[E]={errors:[]}),h=h.items[E]),T&&h.errors.push(t(l)),_++}}};return r(e),n}function wFe(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 Kee(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 ${wFe(r.path)}`);return t.join(`
|
|
41
41
|
`)}var NFe,Wk,rl,Jee=B(()=>{A();vT();St();NFe=(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,cx,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Wk=ie("$ZodError",NFe),rl=ie("$ZodError",NFe,{Parent:Error})});var px,VG,fx,YG,mx,Zee,Ax,Wee,KG,EPt,JG,yPt,ZG,SPt,WG,TPt,XG,bPt,ej,IPt,tj,CPt,nj,vPt,Xee=B(()=>{A();vT();Jee();St();px=e=>(t,n,r,o)=>{let i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Pf;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(l=>cc(l,i,Ii())));throw qG(u,o?.callee),u}return s.value},VG=px(rl),fx=e=>async(t,n,r,o)=>{let i=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(o?.Err??e)(s.issues.map(l=>cc(l,i,Ii())));throw qG(u,o?.callee),u}return s.value},YG=fx(rl),mx=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??Wk)(i.issues.map(s=>cc(s,o,Ii())))}:{success:!0,data:i.value}},Zee=mx(rl),Ax=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(s=>cc(s,o,Ii())))}:{success:!0,data:i.value}},Wee=Ax(rl),KG=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return px(e)(t,n,o)},EPt=KG(rl),JG=e=>(t,n,r)=>px(e)(t,n,r),yPt=JG(rl),ZG=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return fx(e)(t,n,o)},SPt=ZG(rl),WG=e=>async(t,n,r)=>fx(e)(t,n,r),TPt=WG(rl),XG=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return mx(e)(t,n,o)},bPt=XG(rl),ej=e=>(t,n,r)=>mx(e)(t,n,r),IPt=ej(rl),tj=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return Ax(e)(t,n,o)},CPt=tj(rl),nj=e=>async(t,n,r)=>Ax(e)(t,n,r),vPt=nj(rl)});var ud={};Ws(ud,{base64:()=>Ate,base64url:()=>rj,bigint:()=>Tte,boolean:()=>Ite,browserEmail:()=>OPt,cidrv4:()=>fte,cidrv6:()=>mte,cuid:()=>ete,cuid2:()=>tte,date:()=>_te,datetime:()=>yte,domain:()=>LPt,duration:()=>ste,e164:()=>hte,email:()=>ute,emoji:()=>cte,extendedDuration:()=>RPt,guid:()=>ate,hex:()=>UPt,hostname:()=>MPt,html5Email:()=>wPt,httpProtocol:()=>gte,idnEmail:()=>kPt,integer:()=>bte,ipv4:()=>lte,ipv6:()=>dte,ksuid:()=>ote,lowercase:()=>Rte,mac:()=>pte,md5_base64:()=>FPt,md5_base64url:()=>GPt,md5_hex:()=>QPt,nanoid:()=>ite,null:()=>Cte,number:()=>oj,rfc5322Email:()=>BPt,sha1_base64:()=>zPt,sha1_base64url:()=>HPt,sha1_hex:()=>jPt,sha256_base64:()=>qPt,sha256_base64url:()=>VPt,sha256_hex:()=>$Pt,sha384_base64:()=>KPt,sha384_base64url:()=>JPt,sha384_hex:()=>YPt,sha512_base64:()=>WPt,sha512_base64url:()=>XPt,sha512_hex:()=>ZPt,string:()=>Ste,time:()=>Ete,ulid:()=>nte,undefined:()=>vte,unicodeEmail:()=>BFe,uppercase:()=>xte,uuid:()=>xT,uuid4:()=>xPt,uuid6:()=>DPt,uuid7:()=>NPt,xid:()=>rte});function cte(){return new RegExp(PPt,"u")}function OFe(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 Ete(e){return new RegExp(`^${OFe(e)}$`)}function yte(e){let t=OFe({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(`^${kFe}T(?:${r})$`)}function tO(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function nO(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var ete,tte,nte,rte,ote,ite,ste,RPt,ate,xT,xPt,DPt,NPt,ute,wPt,BPt,BFe,kPt,OPt,PPt,lte,dte,pte,fte,mte,Ate,rj,MPt,LPt,gte,hte,kFe,_te,Ste,Tte,bte,oj,Ite,Cte,vte,Rte,xte,UPt,QPt,FPt,GPt,jPt,zPt,HPt,$Pt,qPt,VPt,YPt,KPt,JPt,ZPt,WPt,XPt,ij=B(()=>{A();St();ete=/^[cC][0-9a-z]{6,}$/,tte=/^[0-9a-z]+$/,nte=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rte=/^[0-9a-vA-V]{20}$/,ote=/^[A-Za-z0-9]{27}$/,ite=/^[a-zA-Z0-9_-]{21}$/,ste=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,RPt=/^[-+]?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)?)??$/,ate=/^([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})$/,xT=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)$/,xPt=xT(4),DPt=xT(6),NPt=xT(7),ute=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wPt=/^[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])?)*$/,BPt=/^(([^<>()\[\]\\.,;:\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,}))$/,BFe=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,kPt=BFe,OPt=/^[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])?)*$/,PPt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";lte=/^(?:(?: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])$/,dte=/^(([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}|:))$/,pte=e=>{let t=Ep(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},fte=/^((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])$/,mte=/^(([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])$/,Ate=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rj=/^[A-Za-z0-9_-]*$/,MPt=/^(?=.{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])?)*\.?$/,LPt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,gte=/^https?$/,hte=/^\+[1-9]\d{6,14}$/,kFe="(?:(?:\\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])))",_te=new RegExp(`^${kFe}$`);Ste=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Tte=/^-?\d+n?$/,bte=/^-?\d+$/,oj=/^-?\d+(?:\.\d+)?$/,Ite=/^(?:true|false)$/i,Cte=/^null$/i,vte=/^undefined$/i,Rte=/^[^A-Z]*$/,xte=/^[^a-z]*$/,UPt=/^[0-9a-fA-F]*$/;QPt=/^[0-9a-fA-F]{32}$/,FPt=tO(22,"=="),GPt=nO(22),jPt=/^[0-9a-fA-F]{40}$/,zPt=tO(27,"="),HPt=nO(27),$Pt=/^[0-9a-fA-F]{64}$/,qPt=tO(43,"="),VPt=nO(43),YPt=/^[0-9a-fA-F]{96}$/,KPt=tO(64,""),JPt=nO(64),ZPt=/^[0-9a-fA-F]{128}$/,WPt=tO(86,"=="),XPt=nO(86)});function PFe(e,t,n){e.issues.length&&t.issues.push(...nl(n,e.issues))}var ro,MFe,sj,aj,Dte,Nte,wte,Bte,kte,Ote,Pte,Mte,Lte,gx,Ute,Qte,Fte,Gte,jte,zte,Hte,$te,qte,uj=B(()=>{A();vT();ij();St();ro=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),MFe={number:"number",bigint:"bigint",object:"date"},sj=ie("$ZodCheckLessThan",(e,t)=>{ro.init(e,t);let n=MFe[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})}}),aj=ie("$ZodCheckGreaterThan",(e,t)=>{ro.init(e,t);let n=MFe[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})}}),Dte=ie("$ZodCheckMultipleOf",(e,t)=>{ro.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):Qee(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})}}),Nte=ie("$ZodCheckNumberFormat",(e,t)=>{ro.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=$ee[t.format];e._zod.onattach.push(s=>{let u=s._zod.bag;u.format=t.format,u.minimum=o,u.maximum=i,n&&(u.pattern=bte)}),e._zod.check=s=>{let u=s.value;if(n){if(!Number.isInteger(u)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,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}):s.issues.push({input:u,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}}u<o&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>i&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),wte=ie("$ZodCheckBigIntFormat",(e,t)=>{ro.init(e,t);let[n,r]=qee[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})}}),Bte=ie("$ZodCheckMaxSize",(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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:Jk(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),kte=ie("$ZodCheckMinSize",(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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:Jk(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ote=ie("$ZodCheckSizeEquals",(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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 s=i>t.size;r.issues.push({origin:Jk(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Pte=ie("$ZodCheckMaxLength",(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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 s=Zk(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Mte=ie("$ZodCheckMinLength",(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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 s=Zk(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Lte=ie("$ZodCheckLengthEquals",(e,t)=>{var n;ro.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(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 s=Zk(o),u=i>t.length;r.issues.push({origin:s,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),gx=ie("$ZodCheckStringFormat",(e,t)=>{var n,r;ro.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=()=>{})}),Ute=ie("$ZodCheckRegex",(e,t)=>{gx.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})}}),Qte=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Rte),gx.init(e,t)}),Fte=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xte),gx.init(e,t)}),Gte=ie("$ZodCheckIncludes",(e,t)=>{ro.init(e,t);let n=Ep(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})}}),jte=ie("$ZodCheckStartsWith",(e,t)=>{ro.init(e,t);let n=new RegExp(`^${Ep(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})}}),zte=ie("$ZodCheckEndsWith",(e,t)=>{ro.init(e,t);let n=new RegExp(`.*${Ep(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})}});Hte=ie("$ZodCheckProperty",(e,t)=>{ro.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=>PFe(o,n,t.property));PFe(r,n,t.property)}}),$te=ie("$ZodCheckMimeType",(e,t)=>{ro.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})}}),qte=ie("$ZodCheckOverwrite",(e,t)=>{ro.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var rO,Vte=B(()=>{A();rO=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(`
|
|
@@ -628,7 +628,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
628
628
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
629
629
|
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let r=!this.onKeyLine&&this.indent===t.indent,o=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(o&&n.sep&&!n.value){let s=[];for(let u=0;u<n.sep.length;++u){let l=n.sep[u];switch(l.type){case"newline":s.push(u);break;case"space":break;case"comment":l.indent>t.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(i=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(My(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(wXe(n.key)&&!My(n.sep,"newline")){let s=l1(n.start),u=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:u,sep:l}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(My(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=l1(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:i,key:null,sep:[this.sourceToken]}):My(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);o||n.value?(t.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!My(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:i});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||My(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:o,sep:[]}):n.sep?this.stack.push(o):Object.assign(n,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let o=O9(r),i=l1(o);NXe(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
630
630
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
631
|
-
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=O9(t),r=l1(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=O9(t),r=l1(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};BXe.Parser=hfe});var LXe=M(UM=>{"use strict";A();var kXe=ofe(),FXt=DM(),LM=BM(),GXt=npe(),jXt=gr(),zXt=gfe(),OXe=_fe();function PXe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new zXt.LineCounter||null,prettyErrors:t}}function HXt(e,t={}){let{lineCounter:n,prettyErrors:r}=PXe(t),o=new OXe.Parser(n?.addNewLine),i=new kXe.Composer(t),s=Array.from(i.compose(o.parse(e)));if(r&&n)for(let u of s)u.errors.forEach(LM.prettifyError(e,n)),u.warnings.forEach(LM.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function MXe(e,t={}){let{lineCounter:n,prettyErrors:r}=PXe(t),o=new OXe.Parser(n?.addNewLine),i=new kXe.Composer(t),s=null;for(let u of i.compose(o.parse(e),!0,e.length))if(!s)s=u;else if(s.options.logLevel!=="silent"){s.errors.push(new LM.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(LM.prettifyError(e,n)),s.warnings.forEach(LM.prettifyError(e,n))),s}function $Xt(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let o=MXe(e,n);if(!o)return null;if(o.warnings.forEach(i=>GXt.warn(o.options.logLevel,i)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function qXt(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let o=Math.round(n);n=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){let{keepUndefined:o}=n??t??{};if(!o)return}return jXt.isDocument(e)&&!r?e.toString(n):new FXt.Document(e,r,n).toString(n)}UM.parse=$Xt;UM.parseAllDocuments=HXt;UM.parseDocument=MXe;UM.stringify=qXt});var QXe=M(Qr=>{"use strict";A();var VXt=ofe(),YXt=DM(),KXt=Upe(),Efe=BM(),JXt=pM(),Ly=gr(),ZXt=By(),WXt=ms(),XXt=Oy(),een=Py(),ten=B9(),nen=mfe(),ren=gfe(),oen=_fe(),P9=LXe(),UXe=uM();Qr.Composer=VXt.Composer;Qr.Document=YXt.Document;Qr.Schema=KXt.Schema;Qr.YAMLError=Efe.YAMLError;Qr.YAMLParseError=Efe.YAMLParseError;Qr.YAMLWarning=Efe.YAMLWarning;Qr.Alias=JXt.Alias;Qr.isAlias=Ly.isAlias;Qr.isCollection=Ly.isCollection;Qr.isDocument=Ly.isDocument;Qr.isMap=Ly.isMap;Qr.isNode=Ly.isNode;Qr.isPair=Ly.isPair;Qr.isScalar=Ly.isScalar;Qr.isSeq=Ly.isSeq;Qr.Pair=ZXt.Pair;Qr.Scalar=WXt.Scalar;Qr.YAMLMap=XXt.YAMLMap;Qr.YAMLSeq=een.YAMLSeq;Qr.CST=ten;Qr.Lexer=nen.Lexer;Qr.LineCounter=ren.LineCounter;Qr.Parser=oen.Parser;Qr.parse=P9.parse;Qr.parseAllDocuments=P9.parseAllDocuments;Qr.parseDocument=P9.parseDocument;Qr.stringify=P9.stringify;Qr.visit=UXe.visit;Qr.visitAsync=UXe.visitAsync});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]="
|
|
631
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=O9(t),r=l1(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=O9(t),r=l1(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};BXe.Parser=hfe});var LXe=M(UM=>{"use strict";A();var kXe=ofe(),FXt=DM(),LM=BM(),GXt=npe(),jXt=gr(),zXt=gfe(),OXe=_fe();function PXe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new zXt.LineCounter||null,prettyErrors:t}}function HXt(e,t={}){let{lineCounter:n,prettyErrors:r}=PXe(t),o=new OXe.Parser(n?.addNewLine),i=new kXe.Composer(t),s=Array.from(i.compose(o.parse(e)));if(r&&n)for(let u of s)u.errors.forEach(LM.prettifyError(e,n)),u.warnings.forEach(LM.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function MXe(e,t={}){let{lineCounter:n,prettyErrors:r}=PXe(t),o=new OXe.Parser(n?.addNewLine),i=new kXe.Composer(t),s=null;for(let u of i.compose(o.parse(e),!0,e.length))if(!s)s=u;else if(s.options.logLevel!=="silent"){s.errors.push(new LM.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(LM.prettifyError(e,n)),s.warnings.forEach(LM.prettifyError(e,n))),s}function $Xt(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let o=MXe(e,n);if(!o)return null;if(o.warnings.forEach(i=>GXt.warn(o.options.logLevel,i)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function qXt(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let o=Math.round(n);n=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){let{keepUndefined:o}=n??t??{};if(!o)return}return jXt.isDocument(e)&&!r?e.toString(n):new FXt.Document(e,r,n).toString(n)}UM.parse=$Xt;UM.parseAllDocuments=HXt;UM.parseDocument=MXe;UM.stringify=qXt});var QXe=M(Qr=>{"use strict";A();var VXt=ofe(),YXt=DM(),KXt=Upe(),Efe=BM(),JXt=pM(),Ly=gr(),ZXt=By(),WXt=ms(),XXt=Oy(),een=Py(),ten=B9(),nen=mfe(),ren=gfe(),oen=_fe(),P9=LXe(),UXe=uM();Qr.Composer=VXt.Composer;Qr.Document=YXt.Document;Qr.Schema=KXt.Schema;Qr.YAMLError=Efe.YAMLError;Qr.YAMLParseError=Efe.YAMLParseError;Qr.YAMLWarning=Efe.YAMLWarning;Qr.Alias=JXt.Alias;Qr.isAlias=Ly.isAlias;Qr.isCollection=Ly.isCollection;Qr.isDocument=Ly.isDocument;Qr.isMap=Ly.isMap;Qr.isNode=Ly.isNode;Qr.isPair=Ly.isPair;Qr.isScalar=Ly.isScalar;Qr.isSeq=Ly.isSeq;Qr.Pair=ZXt.Pair;Qr.Scalar=WXt.Scalar;Qr.YAMLMap=XXt.YAMLMap;Qr.YAMLSeq=een.YAMLSeq;Qr.CST=ten;Qr.Lexer=nen.Lexer;Qr.LineCounter=ren.LineCounter;Qr.Parser=oen.Parser;Qr.parse=P9.parse;Qr.parseAllDocuments=P9.parseAllDocuments;Qr.parseDocument=P9.parseDocument;Qr.stringify=P9.stringify;Qr.visit=UXe.visit;Qr.visitAsync=UXe.visitAsync});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]="3446192c-1856-49a1-91d1-c78f453da342",e._sentryDebugIdIdentifier="sentry-dbid-3446192c-1856-49a1-91d1-c78f453da342")}catch{}})();A();A();A();function wAe(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 BAe=wAe();BAe.ok||(process.stderr.write(`lore: ${BAe.message}.
|
|
632
632
|
Upgrade Node (e.g. \`nvm install 20\`) and re-run.
|
|
633
633
|
`),process.exit(1));A();ex();sc();function hkt(){let e=process.env.SENTRY_SPOTLIGHT?.trim();return!e||e==="0"||e==="false"?!1:e==="1"||e==="true"?!0:e}var _kt=hkt(),nFe=Zr(),hee=nFe!=="dev";gee({dsn:hee?"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088":void 0,environment:nFe,release:hu(),sendDefaultPii:!0,enableLogs:hee,spotlight:_kt,tracesSampleRate:hee?1:0});YQ("service_name","lore-cli");ex();See();import{realpathSync as Krn}from"node:fs";import{fileURLToPath as Jrn,pathToFileURL as Ktt}from"node:url";A();A();wO();yr();zt();Sn();A();function HO(e){let t=e;return t._def??t.def??{}}function C6t(e){let t=HO(e);return typeof t.typeName=="string"?t.typeName:typeof t.type=="string"?t.type:void 0}function ul(e,t,n){let r=C6t(e);return r===t||r===n}function cze(e){let t=HO(e);if(t.element)return t.element;if(typeof t.type=="object"&&t.type!==null)return t.type}function v6t(e){let t=e.options;if(Array.isArray(t))return[...t];let n=HO(e);return Array.isArray(n.values)?[...n.values]:n.entries&&typeof n.entries=="object"?Object.values(n.entries):[]}function kse(e){if(!e||!ul(e,"ZodObject","object"))return;let t=e.shape;if(typeof t=="function")return t();if(t&&typeof t=="object")return t;let n=HO(e).shape;if(typeof n=="function")return n();if(n&&typeof n=="object")return n}function lze(e){let t=e,n=!1,r,o=e.description;for(;;){o=t.description??o;let i=HO(t);if(ul(t,"ZodOptional","optional"))n=!0,t=i.innerType;else if(ul(t,"ZodNullable","nullable"))n=!0,t=i.innerType;else if(ul(t,"ZodDefault","default"))r=typeof i.defaultValue=="function"?i.defaultValue():i.defaultValue,t=i.innerType;else if(ul(t,"ZodEffects","effects"))t=i.schema;else if(ul(t,"ZodPipeline","pipe"))t=i.in;else break}return{inner:t,optional:n,defaultValue:r,description:o}}function R6t(e,t={}){let{inner:n,optional:r,defaultValue:o,description:i}=lze(e),s=!1,u=n;ul(u,"ZodArray","array")&&(s=!0,u=cze(u)??u);let l=!r&&o===void 0;return t.positional?{arg:{type:"positional",description:i,required:l,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:s}:ul(u,"ZodEnum","enum")?{arg:{type:"enum",description:i,options:v6t(u),required:l,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:s}:ul(u,"ZodBoolean","boolean")?{arg:{type:"boolean",description:i,required:l,...typeof o=="boolean"?{default:o}:{}},optional:r,isArray:s}:{arg:{type:"string",description:s?`${i??""}${i?" ":""}(comma-separated)`.trim()||void 0:i,required:l,...o!==void 0?{default:String(o)}:{},...s?{valueHint:"a,b,c"}:{}},optional:r,isArray:s}}function Ose(e,t={}){let n={},r={};for(let[o,i]of Object.entries(e)){let{arg:s,isArray:u}=R6t(i,t);n[o]=s,r[o]={isArray:u,leafKind:x6t(i)}}return{args:n,fields:r}}function Pse(e,t={}){let n=kse(e);return n?Ose(n,t):{args:{},fields:{}}}function x6t(e){let{inner:t}=lze(e),n=t;return ul(n,"ZodArray","array")&&(n=cze(n)??n),ul(n,"ZodNumber","number")?"number":ul(n,"ZodBoolean","boolean")?"boolean":ul(n,"ZodEnum","enum")?"enum":ul(n,"ZodString","string")?"string":"other"}function D6t(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 N6t(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 Mse(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 w6t(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 B6t(e,t){let n=t.path.map(o=>String(o)).join(".");return` ${n?`${e}.${n}`:e}: ${t.message}`}function Lse(e,t,n){if(!e)return[];let r=t??{},o=e.safeParse(r);return o.success?[]:(o.error.issues??[]).map(s=>B6t(n,s))}function k6t(e,t,n){return e.resource==="threads"&&t==="id"?w6t(n):n}function dze(e){let t=D6t($z,e.path),n=kse(t.pathParams),r=e.positional??(n?Object.keys(n):[]),o=new Set(r),i=Ose(n?Object.fromEntries(r.map(h=>[h,n[h]])):{},{positional:!0}),s=Pse(t.query),u=t.method==="GET"||t.method==="DELETE"?{args:{},fields:{}}:Pse(t.body);for(let h of Object.keys(u.args))if(s.args[h]!==void 0||o.has(h))throw new Error(`route [${e.path.join(".")}] has overlapping field "${h}" across path/query/body`);let l={...i.args,...s.args,...u.args},f=e.description??t.summary??`${t.method} ${t.path}`;return{meta:{name:e.op,description:f},args:l,async run({args:h,data:_}){z.info("command_start",{command:`${e.resource} ${e.op}`,route:e.path.join(".")});let E=_;if(!await(E?.getAccessToken??jt)())throw new Re("not logged in \u2014 run 'lore login' first");let v={};for(let ae of r){let te=h[ae],_e=Mse(te,i.fields[ae])??te;v[ae]=k6t(e,ae,_e)}let R={};for(let[ae,te]of Object.entries(s.fields)){let _e=Mse(h[ae],te);_e!==void 0&&(R[ae]=_e)}let x={};for(let[ae,te]of Object.entries(u.fields)){let _e=Mse(h[ae],te);_e!==void 0&&(x[ae]=_e)}let k=[...Lse(t.pathParams,v,"path"),...Lse(t.query,R,"query"),...t.method==="GET"||t.method==="DELETE"?[]:Lse(t.body,x,"body")];if(k.length>0)throw new Re(`Invalid request for \`lore ${e.resource} ${e.op}\`:
|
|
634
634
|
${k.join(`
|
|
@@ -653,9 +653,9 @@ The held transcript is never uploaded, and secret values are never shown.`)}},cK
|
|
|
653
653
|
`)}async function EKt(){await B$(new Date);let e=(await XD()).length,t=DJe(),n=t.source?`v${t.schemaVersion} (bundled, ${t.source.tool} ${t.source.ref})`:`v${t.schemaVersion} (bundled)`;return{quarantined:e,ruleset:n}}function GJe(e){return`Scrubber: ${e.quarantined===0?"no quarantined threads":`${e.quarantined} quarantined thread(s) \u2014 run \`lore quarantine\``}; ruleset ${e.ruleset}`}var HJe={meta:{name:"status",description:"Show background upload status"},args:{json:{type:"boolean",description:"Output status as JSON"}},async run({args:e,data:t}){let r=await(t?.getLaunchAgentStatusReport??f$)(),o=await EKt();if(e.json){if(console.log(JSON.stringify({...r,scrubber:o},null,2)),!r.healthy)throw new Re(`Lore background uploads are not healthy: ${r.health}`);return}if(Cu()){if(await QJe(r),console.log(GJe(o)),!r.healthy)throw new Re("");return}if(console.log(_Kt(r)),console.log(GJe(o)),!r.healthy)throw new Re(`Lore background uploads are not healthy: ${r.health}`)}};var sM="@loredotlink/cli",Q$={command:"npm",args:["uninstall","-g",sM]};function IKt(e){switch(e){case"yarn":return{command:"yarn",args:["global","remove",sM]};case"pnpm":return{command:"pnpm",args:["remove","-g",sM]};case"npm":case"unknown":return Q$}}async function CKt(){if(!$Je.isTTY)return"";let e=bKt({input:$Je,output:TKt});try{return await e.question("Why are you uninstalling Lore? (optional) ")}finally{e.close()}}async function vKt({promptForReason:e=CKt,track:t=Ch,detectPackageManager:n=l$,runDisable:r=xKt,runPackageCommand:o=DKt,log:i=console.log}={}){let s=(await e()).trim();s&&await Qde({log:i,startMessage:"Recording uninstall feedback...",failureAction:"record uninstall feedback",manualInstruction:"You can send feedback to support@tanagram.ai.",run:()=>t("lore.cli.uninstall.feedback",{reason:s})}),await Qde({log:i,startMessage:"Stopping background uploads...",failureAction:"stop background uploads",manualInstruction:"You can run `lore disable` manually.",run:r});let u=await RKt(n,i),l=qJe(u.command,u.args);await Qde({log:i,startMessage:`Uninstalling ${sM} with ${u.command}...`,failureAction:`uninstall ${sM}`,manualInstruction:`You can run \`${l}\` manually.`,run:()=>o(u.command,u.args)}),i("goodbye")}async function RKt(e,t){try{let{packageManager:n}=await e();return IKt(n)}catch(n){return t(`Could not detect package manager: ${Gt(n)}`),t(`Falling back to \`${qJe(Q$.command,Q$.args)}\`.`),Q$}}async function Qde({log:e,startMessage:t,failureAction:n,manualInstruction:r,run:o}){e(t);try{await o()}catch(i){e(`Could not ${n}: ${Gt(i)}`),e(r)}}function qJe(e,t){return[e,...t].join(" ")}async function xKt(){await dT(U$,{rawArgs:[]})}function DKt(e,t){return new Promise((n,r)=>{let o=SKt(e,t,{stdio:"inherit"});o.on("error",r),o.on("close",(i,s)=>{if(i===0){n();return}let u=s?`signal ${s}`:`exit code ${i??"unknown"}`;r(new Error(`${e} ${t.join(" ")} failed with ${u}`))})})}var VJe={meta:{name:"uninstall",description:"Uninstall Lore and remove local integrations",skipAutoupdate:!0},async run(){await vKt()}};A();qP();zt();var aM="@loredotlink/cli";async function NKt({runUpdate:e=UYe,log:t=console.log}={}){t("Checking for Lore CLI updates...");let n=await e();if(wKt(n,t))throw new Re("")}function wKt(e,t){return e?e.error?(t(`Update failed: ${e.error}`),!0):e.newVersion?(t(`Updated ${aM} from ${e.oldVersion} to ${e.newVersion}.`),!1):e.latestVersion===e.oldVersion?(t(`Lore CLI is already up to date (${e.oldVersion}).`),!1):e.pnpmUpdateMessage?(t(e.pnpmUpdateMessage),!1):e.packageManager==="unknown"?(t(`Could not determine how Lore was installed. Run \`npm install -g ${aM}\` to update manually.`),!1):e.latestVersion?(t(`A newer version of ${aM} is available (${e.latestVersion}). Run \`npm install -g ${aM}\` to update manually.`),!1):(t("No update was applied."),!1):(t(`This CLI build cannot be updated automatically. Install ${aM} with npm to update.`),!1)}var YJe={meta:{name:"update",description:"Update the Lore CLI in the foreground",skipAutoupdate:!0},async run(){await NKt()}};A();sc();var KJe={meta:{name:"version",description:"Print the Lore CLI version"},run(){console.log(hu())}};A();A();yr();zt();async function JJe(){if(!await jt())throw new Re("not logged in \u2014 run 'lore login' first")}zt();Sn();Du();iy();await pde();var ZJe={meta:{name:"configure",description:"Re-run the guided setup for which directories Lore auto-uploads from."},args:{json:{type:"boolean",description:"Print the upload filter allowlist as JSON and exit."},set:{type:"string",description:"Replace the upload filter allowlist with the given JSON document (the same shape `--json` prints). Prints the normalized result as JSON."}},async run({args:e,data:t}){if(z.info("command_start",{command:"configure"}),await JJe(),typeof e.set=="string"){let n;try{n=JSON.parse(e.set)}catch(o){let i=o instanceof Error?o.message:String(o);throw new Re(`--set must be valid JSON: ${i}`)}let r;try{r=Mle(n,"from --set")}catch(o){let i=o instanceof Error?o.message:String(o);throw new Re(i)}await Ad(r),console.log(JSON.stringify(s$(r),null,2));return}if(e.json){let n=await xi();console.log(JSON.stringify(s$(n),null,2));return}if(!Cu())throw new Re("lore configure needs an interactive terminal \u2014 use `lore configure --json` / `lore configure --set <json>` or `lore listen create <path>` to manage upload filters non-interactively.");await v$({client:t?.client})}};A();yr();zt();A();zt();Sn();go();import Tfe from"node:fs";import ZXe from"node:fs/promises";import{watch as WXe}from"node:fs/promises";import vb from"node:path";import{setTimeout as F9}from"node:timers/promises";A();var jXe=ue(QXe(),1);import Dh from"node:fs/promises";import GXe from"node:os";import si from"node:path";var QM="SKILL.md",zXe=()=>si.join(GXe.homedir(),".claude","skills"),HXe=()=>si.join(GXe.homedir(),".config","agents","skills"),d1=(e=process.cwd())=>si.join(e,".claude","skills"),p1=(e=process.cwd())=>si.join(e,".agents","skills"),ien=(e,t=process.cwd())=>{switch(e){case"claude_global":return zXe();case"agents_global":return HXe();case"claude_project":return d1(t);case"agents_project":return p1(t)}};function L9(e){return e==="claude_project"?"claude_global":e==="agents_project"?"agents_global":e}var yfe=(e,t=[],n={})=>{let r=n.includeCwdProject===!1?t:[e,...t];return[...[...new Set(r.map(i=>si.resolve(i)))].flatMap(i=>[{kind:"claude_project",dir:d1(i)},{kind:"agents_project",dir:p1(i)}]),{kind:"claude_global",dir:zXe()},{kind:"agents_global",dir:HXe()}]};var sen=/^[A-Za-z0-9_][A-Za-z0-9._:-]*$/,FM=e=>{if(typeof e!="string"||e.length===0||e.length>200||e==="."||e===".."||e.includes("/")||e.includes("\\")||/[\x00-\x1f]/.test(e)||!sen.test(e))return!1;for(let t of e.split(":"))if(t===""||t==="."||t==="..")return!1;return!0},M9=(e,t)=>{let n=si.resolve(e),r=si.resolve(t),o=si.relative(n,r);if(o===""||o.startsWith("..")||si.isAbsolute(o))throw new Error(`refused to use a skill path outside ${n}: ${r}`);return r},aen=(e,t)=>FM(e)?yfe(t).map(n=>M9(n.dir,si.join(n.dir,e,QM))):[],Sfe=async e=>{try{return await Dh.access(e),!0}catch{return!1}},$Xe=async(e,t=process.cwd())=>{for(let n of aen(e,t))if(await Sfe(n))return VXe(n,e,t);return null},qXe=async(e,t=process.cwd(),n)=>{let r=si.resolve(e),o=r;try{(await Dh.stat(r)).isDirectory()&&(o=si.join(r,QM))}catch{return null}return si.basename(o)!==QM||!await Sfe(o)?null:VXe(o,si.basename(si.dirname(o)),t,n)},VXe=async(e,t,n,r)=>{let o=await Dh.readFile(e,"utf8"),i=YXe(o);return{name:i.name??t,description:i.description??null,bodyMd:o,filePath:e,rootKind:r??uen(e,n)}},uen=(e,t)=>{for(let n of yfe(t)){let r=si.relative(si.resolve(n.dir),si.resolve(e));if(r!==""&&!r.startsWith("..")&&!si.isAbsolute(r))return n.kind}return"claude_global"},cen=/^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/,FXe=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},YXe=e=>{let t=cen.exec(e);if(!t)return{name:null,description:null};let n=t[1];if(!n)return{name:null,description:null};let r;try{r=(0,jXe.parse)(n)}catch{return{name:null,description:null}}if(!r||typeof r!="object"||Array.isArray(r))return{name:null,description:null};let o=r;return{name:FXe(o.name),description:FXe(o.description)}};var GM=(e,t,n=process.cwd())=>{if(!FM(t))throw new Error(`refusing to install skill with invalid name: ${JSON.stringify(t)}`);let r=ien(e,n),o=M9(r,si.join(r,t));return M9(r,si.join(o,QM))},len=async(e,t)=>{let n=`${e}.tmp.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}`;try{let r=await Dh.open(n,"w");try{await r.writeFile(t,"utf8"),await r.sync()}finally{await r.close()}await Dh.rename(n,e)}catch(r){throw await Dh.unlink(n).catch(()=>{}),r}},U9=async(e,t,n,r=process.cwd())=>{let o=GM(e,t,r),i=si.dirname(o);return await Dh.mkdir(i,{recursive:!0}),await len(o,n),o};var KXe=async({cwd:e=process.cwd(),projectCwds:t=[],includeCwdProject:n=!0}={})=>{let r=new Set,o=[];for(let i of yfe(e,t,{includeCwdProject:n}))try{let s=await Dh.readdir(i.dir,{withFileTypes:!0});for(let u of s){if(!u.isDirectory()||!FM(u.name))continue;let l=M9(i.dir,si.join(i.dir,u.name,QM)),f=`${i.kind}:${l}`;if(r.has(f)||!await Sfe(l))continue;r.add(f);let h=await Dh.readFile(l,"utf8"),_=YXe(h);o.push({name:_.name??u.name,description:_.description??null,bodyMd:h,filePath:l,rootKind:i.kind})}}catch{}return o.sort((i,s)=>i.rootKind.localeCompare(s.rootKind)||i.name.localeCompare(s.name)||i.filePath.localeCompare(s.filePath))};async function bfe(e){let t=await e.listSkillInstallationSync({});if(t.status!==200){let s=t.body?.message??`listSkillInstallationSync returned ${t.status}`;throw new Re(s)}z.info("skill_installation_sync_listed",{remote_count:t.body.objects.length});let n=0,r=0,o=new Map;for(let s of t.body.objects){o.set(s.skill_id,s);let u=await JD(s.skill_id),l=u?.rootKind??L9(s.root_kind),f=u?.installPath??GM(l,s.name),h=await tet(f),_=h===null?null:gd(h);if(h!==null&&!u){z.warn("skill_installation_conflict_detected",{skill_id:s.skill_id,installation_id:s.id,name:s.name,install_path:f,reason:"unmanaged_local_file"}),await ll(ben(s,l,f)),r+=1;continue}if(u&&_!==null&&_!==u.lastInstalledHash&&_!==s.latest_content_hash&&s.latest_version!==u.lastInstalledVersion){z.warn("skill_installation_conflict_detected",{skill_id:s.skill_id,installation_id:s.id,name:s.name,install_path:f,reason:"local_and_remote_changed"}),await ll({...u,lastSyncStatus:"conflict"}),r+=1;continue}if(u&&_===s.latest_content_hash){s.installed_version!==s.latest_version&&(await Q9(e,s.id,s.latest_version),z.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version})),await ll({...u,installationId:s.id,baseVersion:s.latest_version,baseContentHash:s.latest_content_hash,lastInstalledVersion:s.latest_version,lastInstalledHash:s.latest_content_hash,lastSyncStatus:"current"});continue}if(u?.lastSyncStatus==="proposed"&&_===u.lastInstalledHash)continue;if(u?.lastInstalledVersion===s.latest_version&&h!==null){s.installed_version!==s.latest_version&&(await Q9(e,s.id,s.latest_version),z.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await ll({...u,installationId:s.id}));continue}z.info("skill_installation_download_started",{skill_id:s.skill_id,installation_id:s.id,name:s.name,version:s.latest_version,root_kind:s.root_kind,install_path:f});let E=await Ten(e,s.skill_id,s.latest_version);if(gd(E)!==s.latest_content_hash)throw new Re(`downloaded SKILL.md hash did not match metadata for ${s.skill_id}`);let v=await U9(l,s.name,E);await Q9(e,s.id,s.latest_version),z.info("skill_installation_cursor_updated",{skill_id:s.skill_id,installation_id:s.id,installed_version:s.latest_version}),await ll({installationId:s.id,skillId:s.skill_id,name:s.name,rootKind:l,installPath:v,baseVersion:s.latest_version,baseContentHash:s.latest_content_hash,lastInstalledVersion:s.latest_version,lastInstalledHash:s.latest_content_hash,lastSyncStatus:"current"}),z.info("skill_installation_download_applied",{skill_id:s.skill_id,installation_id:s.id,name:s.name,version:s.latest_version,root_kind:s.root_kind,install_path:v}),n+=1}let i=await Een(e,o);return{installedUpdated:n,localEditsUploaded:i,conflicts:r}}async function j9(e){if(e.signal?.aborted)return;let t=e.sleep??eet;z.info("skill_sync_daemon_start",{watch:!!e.watch,poll_interval_ms:e.pollIntervalMs,watch_debounce_ms:e.watchDebounceMs});let n=Promise.resolve(),r=async(l,f)=>{n=n.then(async()=>{if(e.signal?.aborted)return;let h=Date.now();z.info("skill_sync_pass_started",{reason:l,event_type:f?.type,event_id_present:!!f?.id});try{let _=await(e.syncPublishedLocalSkills??dJe)(e.client),E=await bfe(e.client),T={publishedLocalPushed:_.pushed.length,installedUpdated:E.installedUpdated,localEditsUploaded:E.localEditsUploaded,conflicts:E.conflicts};z.info("skill_sync_pass_completed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,published_local_pushed:_.pushed.length,published_local_unchanged:_.unchanged.length,published_local_skipped:_.skipped.length,installed_updated:E.installedUpdated,local_edits_uploaded:E.localEditsUploaded,conflicts:E.conflicts,duration_ms:Date.now()-h}),await e.onSyncPass?.({reason:l,event:f,result:T}),f?.id&&await Ide(f.id)}catch(_){throw z.error("skill_sync_pass_failed",{reason:l,event_type:f?.type,event_id_present:!!f?.id,error:Gt(_),duration_ms:Date.now()-h}),_}}),await n},o=async l=>{let f=l.id;f&&(n=n.then(async()=>{e.signal?.aborted||await Ide(f)}),await n)};await r("startup");let i=(async()=>{for await(let l of e.events??hen()){if(e.signal?.aborted)return;if(l.type==="stream.reconnected"){await r("reconnect",l);continue}if(!_en(l)){await o(l);continue}await r(l.type==="stream.catchup_truncated"?"catchup_truncated":"event",l)}})(),s=e.watch?den({signal:e.signal,debounceMs:e.watchDebounceMs,sleep:t,watchRoots:e.watchRoots,watchEventSource:e.watchEventSource,runPass:()=>r("fs_event")}):Promise.resolve(),u=(async()=>{if(e.pollIntervalMs!==void 0)for(;!e.signal?.aborted;){if(await t(e.pollIntervalMs,e.signal),e.signal?.aborted)return;await r("poll")}})();if(e.pollIntervalMs===void 0){await i;return}await Promise.race([i,u,s])}async function den(e){let t=e.debounceMs??2e3,n=!1,r=!1,o,i=async()=>{if(n){r=!0;return}n=!0;try{do r=!1,e.signal?.aborted||await e.runPass();while(r&&!e.signal?.aborted)}finally{n=!1}},s=()=>{z.info("skill_watch_pass_scheduled",{debounce_ms:t}),o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,i()},t),o.unref?.()},u=async(h,_=e.signal)=>{for(;!_?.aborted;)try{let E=e.watchEventSource?.(h,_)??WXe(h,{signal:_});for await(let T of E){if(_?.aborted)break;let v=T.filename?String(T.filename):null,R=!v||v.endsWith("SKILL.md");z.info("skill_watch_event",{root:h,filename:v,filename_is_skill_md:R}),R&&s()}}catch(E){if(_?.aborted||E?.name==="AbortError")break;if(!e.watchEventSource&&XXe(E)){z.warn("skill_watch_polling_fallback_started",{root:h,error:Gt(E)}),await Aen(h,_,s);break}z.warn("skill_watch_retry",{root:h,retry_ms:3e4,error:Gt(E)}),await e.sleep(3e4,_)}};if(e.watchRoots){let h=JXe(e.watchRoots);if(h.length===0)return z.info("skill_watch_no_roots",{configured_watch_root_count:e.watchRoots.length}),gen(e.signal);z.info("skill_watch_started",{watch_root_count:h.length,debounce_ms:t});try{await Promise.all(h.map(_=>u(_)))}finally{for(o&&clearTimeout(o);n;)await F9(50).catch(()=>{})}return}let l=new Map,f=async()=>{let h=await men(),_=new Set(JXe(h));_.size===0&&z.info("skill_watch_no_roots",{configured_watch_root_count:h.length});for(let[E,T]of l)_.has(E)||(T.controller.abort(),l.delete(E));for(let E of _){if(l.has(E))continue;let T=new AbortController,v=u(E,T.signal);l.set(E,{controller:T,done:v}),z.info("skill_watch_started",{watch_root_count:l.size,debounce_ms:t})}};e.signal?.addEventListener("abort",()=>{for(let h of l.values())h.controller.abort()},{once:!0});try{await f(),await pen(e.signal,f)}finally{for(let h of l.values())h.controller.abort();for(await Promise.allSettled([...l.values()].map(h=>h.done)),o&&clearTimeout(o);n;)await F9(50).catch(()=>{})}}function JXe(e){return e.filter(t=>{try{return Tfe.existsSync(t)&&Tfe.statSync(t).isDirectory()}catch{return!1}})}async function pen(e,t){let n=ch(),r=vb.dirname(n),o=vb.basename(n);for(await ZXe.mkdir(r,{recursive:!0});!e?.aborted;)try{for await(let i of WXe(r,{signal:e})){if(e?.aborted)break;let s=i.filename?String(i.filename):null;(!s||s===o)&&await t()}}catch(i){if(e?.aborted||i?.name==="AbortError")break;if(XXe(i)){z.warn("skill_state_watch_polling_fallback_started",{error:Gt(i)}),await fen(n,e,t);break}z.warn("skill_state_watch_retry",{retry_ms:3e4,error:Gt(i)}),await eet(3e4,e)}}async function fen(e,t,n){let r=G9(e);for(;!t?.aborted&&(await F9(500,void 0,{signal:t}).catch(()=>{}),!t?.aborted);){let o=G9(e);o!==null&&o!==r&&await n(),r=o}}async function men(){let e=await ii(),t=new Set;for(let n of Object.values(e.publishedLocal))t.add(vb.dirname(vb.resolve(n.filePath)));for(let n of Object.values(e.installed))e.publishedLocal[n.skillId]&&t.add(vb.dirname(vb.resolve(n.installPath)));return[...t].sort((n,r)=>n.localeCompare(r))}function XXe(e){let t=e?.code;return t==="EMFILE"||t==="ENOSPC"}async function Aen(e,t,n){let r=vb.join(e,"SKILL.md"),o=G9(r);for(;!t?.aborted&&(await F9(2e3,void 0,{signal:t}).catch(()=>{}),!t?.aborted);){let i=G9(r);i!==null&&i!==o&&(z.info("skill_watch_event",{root:e,filename:"SKILL.md",filename_is_skill_md:!0,source:"polling_fallback"}),n()),o=i}}function G9(e){try{return Tfe.statSync(e).mtimeMs}catch{return null}}async function gen(e){e?.aborted||await new Promise(t=>e?.addEventListener("abort",()=>t(),{once:!0}))}async function*hen(){}function _en(e){return e.type.startsWith("skill.version.")||e.type==="skill.published"||e.type==="stream.catchup_truncated"}function eet(e,t){return t?.aborted?Promise.resolve():new Promise(n=>{let r=setTimeout(n,e);r.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(r),n()},{once:!0})})}async function Een(e,t){let n=0,r,o=await ii();for(let i of await rJe()){if(i.lastSyncStatus==="conflict")continue;let s=o.publishedLocal[i.skillId];if(!s)continue;let u=await tet(i.installPath);if(u===null)continue;let l=gd(u);if(l===i.lastInstalledHash||l===s.lastPublishedHash)continue;z.info("skill_local_edit_detected",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,base_version:i.baseVersion,last_sync_status:i.lastSyncStatus});let f=t.get(i.skillId);if(f&&f.latest_version!==i.baseVersion){z.warn("skill_installation_conflict_detected",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,reason:"remote_advanced_before_upload",base_version:i.baseVersion,remote_version:f.latest_version}),await ll({...i,lastSyncStatus:"conflict"});continue}r??=await yen(e);let h=await Sen(e,i.skillId);if(!h||h!==r){z.info("skill_local_edit_skipped_not_owner",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath});continue}let _="owner_update",E=f?.root_kind??s.rootKind,T;try{T=await ZD(e,{skillId:i.skillId,name:i.name,description:null,bodyMd:u,filePath:i.installPath,rootKind:E},{syncAction:_,baseVersion:i.baseVersion})}catch(v){throw z.warn("skill_local_edit_upload_failed",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,sync_action:_,base_version:i.baseVersion,error:Gt(v)}),v}z.info("skill_local_edit_uploaded",{skill_id:i.skillId,installation_id:i.installationId,name:i.name,install_path:i.installPath,sync_action:_,version:T.version,version_status:T.version_status}),T.version_status==="accepted"&&(await Q9(e,i.installationId,T.version),await ll({...i,baseVersion:T.version,baseContentHash:T.content_hash,lastInstalledVersion:T.version,lastInstalledHash:T.content_hash,lastSyncStatus:"current"}),await WD({name:i.name,bodyMd:u,filePath:i.installPath,rootKind:E},{skillId:i.skillId,version:T.version})),n+=1}return n}async function Q9(e,t,n){let r=await e.updateSkillInstallation({params:{id:t},body:{installed_version:n}});if(r.status!==200){let o=r.body?.message??`updateSkillInstallation returned ${r.status}`;throw new Re(`wrote skill locally, but failed to record installed version: ${o}`)}}async function yen(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}async function Sen(e,t){let n=await e.getSkillDetail({params:{id:t}});return n.status!==200?null:n.body.owner?.id??null}async function Ten(e,t,n){let r=await e.getSkillRaw({params:{id:t},query:{version:n}});if(r.status!==200){let o=r.body?.message??`getSkillRaw returned ${r.status}`;throw new Re(o)}return typeof r.body=="string"?r.body:String(r.body)}function ben(e,t,n){return{installationId:e.id,skillId:e.skill_id,name:e.name,rootKind:t,installPath:n,baseVersion:e.installed_version??0,baseContentHash:"",lastInstalledVersion:e.installed_version??0,lastInstalledHash:"",lastSyncStatus:"conflict"}}async function tet(e){try{return await ZXe.readFile(e,"utf8")}catch{return null}}A();yr();zt();Sn();import{setTimeout as Ien}from"node:timers/promises";var Cen=75e3,ven=1e3,Ren=6e4,xen=250,z9=class extends Re{constructor(t){super(`skill sync event stream returned ${t}; login is required`),this.name="SkillSyncEventStreamAuthError"}};async function*H9(e){if(!e.userId)throw new Re("workspace skill sync daemon needs a user subject to subscribe to");if(e.organizationIds.length===0)throw new Re("workspace skill sync daemon needs at least one workspace to subscribe to");let t=e.reconnect??!1,n=Ben(e.backoff),r=e.lastEventId,o=!1;for(;!e.signal?.aborted;)try{o&&(yield{type:"stream.reconnected"});let i=!1;for await(let s of Den({...e,lastEventId:r}))i=!0,s.id&&(r=s.id),z.info("skill_event_stream_event_received",{event_type:s.type,event_id_present:!!s.id}),yield s;if(!t||e.signal?.aborted)return;o=!0,z.warn("skill_event_stream_disconnected",{saw_frame:i,will_reconnect:!0}),i&&n.reset(),z.info("skill_event_stream_reconnect_scheduled",{reason:"eof"}),await n.sleep(e.signal)}catch(i){if(e.signal?.aborted||i?.name==="AbortError")return;if(i instanceof z9||!t)throw i;o=!0,z.warn("skill_event_stream_disconnected",{saw_frame:!1,will_reconnect:!0,error:Gt(i)}),z.info("skill_event_stream_reconnect_scheduled",{reason:"error"}),await n.sleep(e.signal)}}async function*Den(e){let t=e.token??await(e.getAccessToken??jt)();if(!t)throw new Re("workspace skill sync daemon requires login \u2014 run 'lore login' first");let n=new URL("/api/events/stream",e.apiBaseUrl??al());n.searchParams.append("subject",`user:${e.userId}`);for(let i of e.organizationIds)n.searchParams.append("subject",`org:${i}`);let r={accept:"text/event-stream",authorization:`Bearer ${t}`};e.lastEventId&&(r["Last-Event-ID"]=e.lastEventId),z.info("skill_event_stream_connecting",{organization_count:e.organizationIds.length,last_event_id_present:!!e.lastEventId});let o=await(e.fetch??fetch)(n,{headers:r,signal:e.signal});if(o.status===401||o.status===403)throw z.warn("skill_event_stream_auth_failed",{status:o.status}),new z9(o.status);if(!o.ok)throw new Re(`skill sync event stream returned ${o.status}`);if(!o.body)throw new Re("skill sync event stream returned no response body");z.info("skill_event_stream_connected",{status:o.status,organization_count:e.organizationIds.length,last_event_id_present:!!e.lastEventId});for await(let i of Nen(o.body,{signal:e.signal,heartbeatTimeoutMs:e.heartbeatTimeoutMs??Cen}))yield{id:i.id,type:i.event??"message"}}async function*Nen(e,t={}){let n=new TextDecoder,r=e.getReader(),o="";try{for(;;){let{done:s,value:u}=await wen(r,t.heartbeatTimeoutMs,t.signal);if(s)break;o+=n.decode(u,{stream:!0});let l=o.split(/\r?\n\r?\n/);o=l.pop()??"";for(let f of l){let h=net(f);h&&(yield h)}}o+=n.decode();let i=net(o);i&&(yield i)}finally{r.releaseLock()}}async function wen(e,t,n){if(t===void 0||t<=0)return e.read();let r,o;try{return await Promise.race([e.read(),new Promise((i,s)=>{r=setTimeout(()=>s(new Re("skill sync event stream heartbeat stalled")),t),r.unref?.(),o=()=>s(new DOMException("Aborted","AbortError")),n?.addEventListener("abort",o,{once:!0})})])}finally{r&&clearTimeout(r),o&&n?.removeEventListener("abort",o)}}function net(e){let t={data:""};for(let n of e.split(/\r?\n/)){if(!n||n.startsWith(":"))continue;let r=n.indexOf(":"),o=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r+1).replace(/^ /,"");o==="id"&&(t.id=i),o==="event"&&(t.event=i),o==="data"&&(t.data+=`${i}
|
|
654
654
|
`)}return!t.id&&!t.event&&!t.data?null:(t.data.endsWith(`
|
|
655
655
|
`)&&(t.data=t.data.slice(0,-1)),t)}function Ben(e={}){let t=e.initialMs??ven,n=e.maxMs??Ren,r=e.jitterMs??xen,o=e.random??Math.random,i=e.sleep??((u,l)=>Ien(u,void 0,{signal:l}).catch(()=>{})),s=t;return{async sleep(u){let l=Math.min(n,s)+Math.floor(o()*r);s=Math.min(n,Math.max(t,s*2)),await i(l,u)},reset(){s=t}}}A();oy();yr();sc();zt();Sn();Du();QD();var ken=5,Oen=1e3;async function $9(e={}){(e.environment??Zr())!=="dev"||!await Pen({fetchFn:e.fetchFn})||await Men({client:e.client})}async function Pen(e={}){let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return z.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??ken,o=e.retryDelayMs??Oen,i=`${al()}/api/cli-auth/dev-token`;for(let s=1;s<=r;s+=1)try{let u=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(u.status===404){let f=await ret(u);return dh(),z.warn("dev_preflight_token_rejected",{status:u.status,email:t,detail:f,url:i}),!1}if(!u.ok){let f=await ret(u);return dh(),z.warn("dev_preflight_token_rejected",{status:u.status,email:t,detail:f}),!1}let l=await u.json();return l.access_token?(Kje(l.access_token),z.info("dev_preflight_token_minted",{email:t,expiresIn:l.expires_in}),!0):(dh(),z.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(u){if(s===r)return dh(),z.warn("dev_preflight_token_unreachable",{url:i,error:Gt(u)}),!1;await Len(o)}return!1}async function Men(e={}){await Ih();let t=await xi();if(t.include.cwd.length>0||t.include.repo.length>0)return;let n=Hi(process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd()),r=e.client??Ct();try{let o=await r.whoAmI({headers:{}});if(o.status!==200){z.warn("dev_preflight_whoami_failed",{status:o.status});return}}catch(o){z.warn("dev_preflight_whoami_error",{error:Gt(o)});return}await Ad({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),z.info("dev_preflight_upload_dir_seeded",{path:n})}async function ret(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 Len(e){return new Promise(t=>{setTimeout(t,e)})}A();u$();zt();Sn();go();import Db from"node:fs";import{watch as Btn}from"node:fs/promises";import Mfe from"node:path";import{setTimeout as zM}from"node:timers/promises";A();yr();Sn();var Uen=6e4,q9=class{client;now;minIntervalMs;lastBeatAt=Number.NEGATIVE_INFINITY;constructor(t={}){this.client=t.client??Ct(),this.now=t.now??Date.now,this.minIntervalMs=t.minIntervalMs??Uen}async beat(){let t=this.now();t-this.lastBeatAt<this.minIntervalMs||(this.lastBeatAt=t,await this.post({}))}async uploadCompleted(){this.lastBeatAt=this.now(),await this.post({upload_completed:!0})}async post(t){try{await this.client.recordCliHeartbeat({body:t})}catch(n){z.warn("cli_heartbeat_failed",{error:n instanceof Error?n.message:String(n)})}}};A();u$();yr();Sn();Du();import{setTimeout as Net}from"node:timers/promises";A();import Al from"node:fs/promises";import fet from"node:os";import As from"node:path";A();A();import Qen from"node:os";import oet from"node:path";function iet(e){return e.replace(/[^A-Za-z0-9_-]/g,"-")}function set(e=Qen.homedir(),t=process.env.CLAUDE_CONFIG_DIR){let n=t?.trim();return n?oet.join(n,"projects"):oet.join(e,".claude","projects")}A();import ml from"node:fs";import Fen from"node:os";import Rb from"node:path";var Ife="local-agent-mode-sessions",Cfe=["audit.jsonl","transcript.jsonl"];function aet(e=Fen.homedir()){return Rb.join(e,"Library","Application Support","Claude",Ife)}function uet(e){if(!ml.existsSync(e))return[];let t=[];for(let n of ml.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=Rb.join(e,n.name);for(let o of ml.readdirSync(r,{withFileTypes:!0})){if(!o.isDirectory())continue;let i=Rb.join(r,o.name);for(let s of ml.readdirSync(i,{withFileTypes:!0})){if(!s.isDirectory()||!s.name.startsWith("local_"))continue;let u=s.name.replace(/^local_/,"");if(!u)continue;let l=Rb.join(i,s.name),f=Y9(l),h=f?ml.statSync(f):ml.statSync(l);t.push({accountId:n.name,orgId:o.name,sessionId:u,sessionDir:i,localDir:l,mtimeMs:h.mtimeMs})}}}return t.sort((n,r)=>r.mtimeMs-n.mtimeMs),t}function V9(e){if(!ml.existsSync(e))return null;let t=null;for(let n of ml.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory()||!n.name.startsWith("local_"))continue;let r=Rb.join(e,n.name),o=Y9(r),i=o!==null,s=o?ml.statSync(o).mtimeMs:ml.statSync(r).mtimeMs;(t===null||i&&!t.hasTranscript||i===t.hasTranscript&&s>t.mtimeMs)&&(t={dir:r,mtimeMs:s,hasTranscript:i})}return t?.dir??null}function Y9(e){for(let t of Cfe){let n=Rb.join(e,t);if(ml.existsSync(n)&&ml.statSync(n).isFile())return n}return null}function vfe(e,t){let n=Rb.join(e,t);return ml.existsSync(n)?ml.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}zt();g$();Sn();Du();Th();A();zt();import{createReadStream as Gen}from"node:fs";import jen from"node:fs/promises";import{createInterface as zen}from"node:readline";var Hen=50;async function cet(e,t={}){let n=t.maxLines??Hen;try{await jen.stat(e)}catch(o){if(Lr(o,"ENOENT"))return null;throw o}let r=Gen(e,{encoding:"utf8"});return await new Promise((o,i)=>{let s=!1,u=0,l=_=>{s||(s=!0,f.close(),r.destroy(),o(_))},f=zen({input:r,crlfDelay:Number.POSITIVE_INFINITY});f.on("line",_=>{if(s)return;let E=_.trim();if(E){u+=1;try{let T=JSON.parse(E);if(typeof T=="object"&&T!==null&&"cwd"in T&&typeof T.cwd=="string"){let v=T.cwd.trim();if(v){l(v);return}}}catch{}u>=n&&l(null)}}),f.on("close",()=>l(null));let h=_=>{if(!s){if(s=!0,Lr(_,"ENOENT")){o(null);return}i(_)}};f.on("error",h),r.on("error",h)})}var $en=3600*1e3,qen=336*60*60*1e3,K9=Symbol("missingSessionID"),met={name:"claudeCode",historyFilePath:J9,readUnuploadedEntries:Aet,collectLocalFiles:Ken,buildPendingTranscriptWatches:Jen};async function Aet(e){let t=J9(),n=Date.now()-qen,r;try{r=await Al.readdir(t,{withFileTypes:!0})}catch(i){if(Lr(i,"ENOENT"))return[];throw new Error(`readdir ${t}: ${String(i)}`)}let o=[];for(let i of r){if(!i.isDirectory())continue;let s=As.join(t,i.name),u;try{u=await Al.readdir(s,{withFileTypes:!0})}catch{continue}for(let l of u){if(!l.isFile()||!l.name.endsWith(".jsonl"))continue;let f=As.join(s,l.name),h;try{h=await Al.stat(f)}catch{continue}!h.isFile()||h.mtimeMs<n||o.push({sessionId:l.name.slice(0,-6),project:"",timestamp:h.mtimeMs,resolvedTranscriptPath:f})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}async function get(){let e=new Map,t;try{t=await Al.readFile(yy(),"utf8")}catch{return e}for(let n of JP(t)){let r=n.sessionId?.trim(),o=n.project?.trim();r&&o&&!e.has(r)&&e.set(r,o)}return e}async function het(e,t,n){let r=await cet(e);return r||((await n()).get(t)??null)}async function Ven(){let e=yy(),t;try{t=await Al.readFile(e,"utf8")}catch(n){if(Lr(n,"ENOENT"))return[];throw n}return JP(t,e)}async function _et(e){let t=await Ven(),n=e.sessionId.trim();if(n){for(let u=t.length-1;u>=0;u-=1){let l=t[u];if(l?.sessionId?.trim()===n)return l}let s=await Yen(n);if(s){let u=e.project.trim()||process.cwd();return{sessionId:n,project:u,timestamp:s.mtimeMs,resolvedTranscriptPath:s.fullPath}}throw new Re(`no history entry or transcript file found for session-id "${n}" \u2014 check ~/.claude/history.jsonl and ~/.claude/projects/`)}let r=As.normalize(e.project.trim());if(!r)throw new Re("export requires either --session-id or a project path");let o=await LD(r),i=[...t].sort((s,u)=>u.timestamp-s.timestamp);for(let s of i){if(!s.sessionId?.trim())continue;let u=As.normalize(s.project.trim());if(!u||u===".")continue;if(u===r)return s;if(!o)continue;let l=await LD(u);if(l&&l===o)return s}throw new Re(`no history entry found for project "${r}" \u2014 pass --session-id to pick a specific session, or cd into the repo where the Claude Code session ran`)}async function Yen(e){let t=e.trim();if(!t)return null;let n=J9(),r;try{r=await Al.readdir(n,{withFileTypes:!0})}catch(o){if(Lr(o,"ENOENT"))return null;throw new Error(`readdir ${n}: ${String(o)}`)}for(let o of r){if(!o.isDirectory())continue;let i=As.join(n,o.name,`${t}.jsonl`);try{let s=await Al.stat(i);if(s.isFile())return{fullPath:i,mtimeMs:s.mtimeMs}}catch(s){if(!Lr(s,"ENOENT")&&!Lr(s,"ENOTDIR"))throw new Error(`stat ${i}: ${String(s)}`)}}return null}async function Eet(e){let t=await Rfe(e);if(t===K9)throw new Error("history entry is missing sessionId");return t}async function Ken(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=null,f=async()=>(l??=await get(),l);try{for(let h=0;h<e.length;h+=1){let _=e[h],E=await Rfe(_);if(E===K9){let V=`__missing_session__:${_.project}:${_.timestamp}:${h}`;r[h]=V,o.add(V),s.add(V);continue}if(r[h]=E.key,s.has(E.key))continue;let T=await qi(E.fullPath);if(!T.exists){o.add(E.key),s.add(E.key);continue}if(t.isUnchanged?.(E.key,T)){o.add(E.key),s.add(E.key);continue}if(t.isThrottled?.(E.key)){i.add(E.key),s.add(E.key);continue}let v=_.project.trim()||await het(E.fullPath,_.sessionId??"",f);if(!v){z.info("upload_filter_session_excluded",{filename:E.relativeFilename,transcript_path:E.fullPath,cwd:"<unresolved>",reason:"no_resolvable_cwd"}),o.add(E.key),s.add(E.key);continue}let R=await Dp(v),x=null,k=async()=>(x!==null||(x=await Al.readFile(E.fullPath,"utf8")),x),P=await bh(t.uploadFilterConfig??CA(),{cwd:v,repoOriginPath:R,transcriptPath:E.fullPath,readTranscript:k});if(!P.shouldUpload){z.info("upload_filter_session_excluded",{filename:E.relativeFilename,transcript_path:E.fullPath,cwd:v,repo_origin_path:R||"<none>",reason:P.reason}),o.add(E.key),s.add(E.key);continue}z.info("upload_filter_session_included",{filename:E.relativeFilename,transcript_path:E.fullPath,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let j;try{j=await dl(E.fullPath)}catch(V){if(Lr(V,"ENOENT")){o.add(E.key),s.add(E.key);continue}throw new Error(`read session transcript ${E.fullPath}: ${String(V)}`)}u.push(j.tempPath),n.push({key:E.key,filename:E.relativeFilename,sourcePath:E.fullPath,repoOriginPath:R,tempPath:j.tempPath,md5:j.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:_.sessionId?.trim()??"",watchedState:T}),s.add(E.key);let G=await Al.readFile(j.tempPath,"utf8"),$=etn(G);for(let V of $){let ae;try{ae=await ttn(V)}catch{continue}let te=`${E.key}::plan:${ae}`;if(s.has(te))continue;let _e=await qi(ae),Ve;try{Ve=await dl(ae)}catch(nt){if(Lr(nt,"ENOENT"))continue;throw new Error(`read plan file ${ae}: ${String(nt)}`)}u.push(Ve.tempPath),n.push({key:te,filename:ae,sourcePath:ae,repoOriginPath:R,tempPath:Ve.tempPath,md5:Ve.md5,fileType:"plan",harness:"claudeCode",harnessInternalId:ae,watchedState:_e}),s.add(te)}}}catch(h){throw await Promise.all(u.map(_=>Al.rm(As.dirname(_),{recursive:!0,force:!0}))),h}return{entries:e,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function Jen(e,t,n={}){let r=await Aet(e),o=Date.now(),i=[],s=new Set,u=null,l=async()=>(u??=await get(),u);for(let f of r){let h=await Rfe(f);if(h===K9||s.has(h.fullPath))continue;s.add(h.fullPath);let _=await qi(h.fullPath);if(!_.exists)continue;let E=f.project.trim()||await het(h.fullPath,f.sessionId??"",l);if(!E)continue;let T=await Dp(E),v=await bh(n.uploadFilterConfig??CA(),{cwd:E,repoOriginPath:T,transcriptPath:h.fullPath,readTranscript:()=>Al.readFile(h.fullPath,"utf8")},{ignoreSkillRules:!0});if(!v.shouldUpload){z.info("upload_filter_watch_excluded",{filename:h.relativeFilename,transcript_path:h.fullPath,cwd:E,repo_origin_path:T||"<none>",reason:v.reason});continue}i.push({sessionId:f.sessionId?.trim()??"",project:E,transcriptPath:h.fullPath,expiresAt:new Date(o+$en),baseline:t.get(h.fullPath)??_})}return i.sort((f,h)=>f.transcriptPath.localeCompare(h.transcriptPath))}async function Rfe(e){let t=e.sessionId?.trim();if(!t)return K9;let n=J9(),r=e.resolvedTranscriptPath?.trim();if(r){let s=As.relative(n,r).split(As.sep).join("/");return{fullPath:r,relativeFilename:s,key:s}}let o=await Zen(e.project),i=null;for(let s of o){let u=Wen(s),l=As.posix.join(u,`${t}.jsonl`),f=As.join(n,...l.split("/")),h={fullPath:f,relativeFilename:l,key:l};i??=h;try{return await Al.stat(f),h}catch(_){if(!Lr(_,"ENOENT"))throw new Error(`stat session transcript ${f}: ${String(_)}`)}}if(!i)throw new Error("history entry is missing project path");return i}async function Zen(e){let t=As.normalize(e.trim());if(!t||t===".")throw new Error("history entry is missing project path");let n=[t],r=await LD(t);if(!r||r===t)return n;for(let o=As.dirname(t);o!==t&&(n.push(o),o!==r);)t=o,o=As.dirname(o);return n}function Wen(e){let t=As.normalize(e.trim());if(!t||t===".")throw new Error("history entry is missing project path");return iet(t)}function J9(){return set()}function Xen(){return As.join(fet.homedir(),".claude","plans")}function etn(e){let t=[],n=new Set;for(let r of e.split(`
|
|
656
|
-
`)){let o=r.trim();if(!o)continue;let i;try{i=JSON.parse(o)}catch{break}if(i.type!=="assistant")continue;let s=i.message?.content;if(Array.isArray(s))for(let u of s){if(!pet(u)||u.type!=="tool_use"||u.name!=="ExitPlanMode"||!pet(u.input))continue;let l=u.input.planFilePath;if(typeof l!="string")continue;let f=l.trim();!f||n.has(f)||(t.push(f),n.add(f))}}return t}async function ttn(e){let t=e.trim();if(!t)throw new Error("plan file path is empty");let n=Xen(),r=n;try{r=await Al.realpath(n)}catch{}if(t.startsWith("~/")&&(t=As.join(fet.homedir(),t.slice(2))),!As.isAbsolute(t))throw new Error(`plan file path must stay under ${n}`);if(t=As.normalize(t),!det(t,n))throw new Error(`plan file path must stay under ${n}`);try{let o=await Al.realpath(t);if(!det(o,r))throw new Error(`plan file path must resolve under ${n}`)}catch(o){if(!Lr(o,"ENOENT"))throw o}return t}function det(e,t){let n=As.relative(t,e);return n===""||n!==".."&&!n.startsWith(`..${As.sep}`)}function pet(e){return e!==null&&typeof e=="object"}A();zt();Sn();Du();import{createReadStream as ntn}from"node:fs";import Uy from"node:fs/promises";import rtn from"node:os";import Yf from"node:path";import{createInterface as otn}from"node:readline";Th();var itn=3600*1e3,Tet={name:"codex",historyFilePath:xfe,readUnuploadedEntries:bet,collectLocalFiles:atn,buildPendingTranscriptWatches:utn};function xfe(){return process.env.LORE_CODEX_SESSIONS_DIR??Yf.join(rtn.homedir(),".codex","sessions")}async function bet(e){let t=xfe(),n;try{n=await Uy.readdir(t,{withFileTypes:!0})}catch(o){if(Lr(o,"ENOENT"))return[];throw o}let r=[];for(let o of n){if(!o.isDirectory())continue;let i=Yf.join(t,o.name),s;try{s=await Uy.readdir(i,{withFileTypes:!0})}catch{continue}for(let u of s){if(!u.isDirectory())continue;let l=Yf.join(i,u.name),f;try{f=await Uy.readdir(l,{withFileTypes:!0})}catch{continue}for(let h of f){if(!h.isDirectory())continue;let _=Yf.join(l,h.name),E;try{E=await Uy.readdir(_,{withFileTypes:!0})}catch{continue}for(let T of E){if(!T.isFile()||!T.name.startsWith("rollout-")||!T.name.endsWith(".jsonl"))continue;let v=Yf.join(_,T.name),R;try{R=await Uy.stat(v)}catch{continue}if(R.mtimeMs<=e)continue;let x=await stn(v);x!==null&&r.push({timestamp:R.mtimeMs,sessionId:x.id,project:x.cwd,transcriptPath:v})}}}}return r.sort((o,i)=>o.timestamp-i.timestamp)}async function stn(e){let t,n=ntn(e,{encoding:"utf8"});try{t=await new Promise((u,l)=>{let f=otn({input:n,crlfDelay:Number.POSITIVE_INFINITY}),h=!1;f.on("line",_=>{if(h)return;let E=_.trim();E&&(h=!0,f.close(),n.destroy(),u(E))}),f.on("close",()=>{h||u("")}),f.on("error",l),n.on("error",l)})}finally{n.destroy()}if(!t)return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"empty_first_line"}),null;let r;try{r=JSON.parse(t)}catch{return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"unparseable_json"}),null}if(!yet(r))return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;if(r.type!=="session_meta")return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;let o=r.payload;if(!yet(o))return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_payload"}),null;let i=typeof o.id=="string"?o.id.trim():"",s=typeof o.cwd=="string"?o.cwd.trim():"";return!i||!s?(z.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_id_or_cwd"}),null):{id:i,cwd:s}}async function atn(e,t={}){let n=xfe(),r=[],o=new Array(e.length),i=new Set,s=new Set,u=new Set,l=[];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=Yf.relative(n,h.transcriptPath).split(Yf.sep).join("/");if(o[f]=_,u.has(_))continue;let E=await qi(h.transcriptPath);if(!E.exists){i.add(_),u.add(_);continue}if(t.isUnchanged?.(_,E)){i.add(_),u.add(_);continue}if(t.isThrottled?.(_)){s.add(_),u.add(_);continue}let T=await Dp(h.project),v=()=>Uy.readFile(h.transcriptPath,"utf8"),R=await bh(t.uploadFilterConfig??CA(),{cwd:h.project,repoOriginPath:T,transcriptPath:h.transcriptPath,readTranscript:v});if(!R.shouldUpload){z.info("upload_filter_session_excluded",{filename:Yf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:R.reason}),i.add(_),u.add(_);continue}z.info("upload_filter_session_included",{filename:Yf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:"matched"});let x;try{x=await dl(h.transcriptPath)}catch(k){if(Lr(k,"ENOENT")){i.add(_),u.add(_);continue}throw new Error(`read codex rollout ${h.transcriptPath}: ${String(k)}`)}l.push(x.tempPath),r.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:T,tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"codex",harnessInternalId:h.sessionId,watchedState:E}),u.add(_)}}catch(f){throw await Promise.all(l.map(h=>Uy.rm(Yf.dirname(h),{recursive:!0,force:!0}))),f}return{entries:e,localFiles:r,entryFileKeys:o,skippedFileKeys:i,deferredFileKeys:s}}async function utn(e,t,n={}){let r=await bet(e),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await qi(u.transcriptPath);if(!l.exists)continue;let f=await Dp(u.project),h=await bh(n.uploadFilterConfig??CA(),{cwd:u.project,repoOriginPath:f,transcriptPath:u.transcriptPath,readTranscript:()=>Uy.readFile(u.transcriptPath,"utf8")},{ignoreSkillRules:!0});if(!h.shouldUpload){z.info("upload_filter_watch_excluded",{filename:Yf.basename(u.transcriptPath),transcript_path:u.transcriptPath,cwd:u.project,repo_origin_path:f||"<none>",reason:h.reason});continue}i.push({sessionId:u.sessionId,project:u.project,transcriptPath:u.transcriptPath,expiresAt:new Date(o+itn),baseline:t.get(u.transcriptPath)??l})}return i}function yet(e){return e!==null&&typeof e=="object"}A();zt();Sn();Du();import W9 from"node:fs";import Nfe from"node:fs/promises";import xb from"node:path";A();import ctn from"node:fs";var ltn=V9,Dfe=Y9;function Iet(e){let t=ltn(e);if(!t)throw new Error(`Session ${e} has no local_* subdirectory \u2014 is this a Cowork session?`);let n=Dfe(t);if(!n)throw new Error(`Session ${e} has no transcript file under ${t} (looked for ${Cfe.join(", ")})`);let r=ctn.readFileSync(n,"utf8"),o=vfe(t,"uploads"),i=vfe(t,"outputs");return{transcriptPath:n,transcript:r,uploads:o,outputs:i}}A();import jM from"node:path";var Z9=aet;function Cet(e){let t=jM.resolve(e).split(jM.sep),n=t.lastIndexOf(Ife);if(n<0)return null;let r=t[n+1],o=t[n+2];if(!r||!o)return null;let i=t.slice(0,n+1).join(jM.sep),s=jM.join(i,r,o),l=t.slice(n+3).find(h=>h.startsWith("local_"))??jM.basename(V9(s)??""),f=l.startsWith("local_")?l.replace(/^local_/,""):"";return{accountId:r,orgId:o,sessionId:f,sessionDir:s,sessionsRoot:i}}function Qy(e){return uet(e)}function vet(e){return Qy(e)[0]??null}Th();var dtn=3600*1e3,xet={name:"cowork",historyFilePath:X9,readUnuploadedEntries:ptn,collectLocalFiles:htn,buildPendingTranscriptWatches:_tn};function X9(){return process.env.LORE_COWORK_SESSIONS_DIR??Z9()}async function ptn(e){return Det(e,{includeWatermark:!1})}async function Det(e,t){let n=X9(),r=Qy(n),o=[];for(let i of r){let s=i.localDir,u=Dfe(s);if(!u)continue;let l=xb.basename(s),f=xb.join(i.sessionDir,`${l}.json`),h=ftn(f,i.sessionDir);if(h!==null){if(t.includeWatermark){if(h.lastActivityAt<e)continue}else if(h.lastActivityAt<=e)continue;o.push({timestamp:h.lastActivityAt,sessionId:h.sessionId,accountId:i.accountId,orgId:i.orgId,project:"",userSelectedFolders:h.userSelectedFolders,transcriptPath:u})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}function ftn(e,t){let n;try{n=W9.readFileSync(e,"utf8")}catch{return z.warn("cowork_manifest_missing",{session_dir:t,manifest_path:e}),null}let r;try{r=JSON.parse(n)}catch{return z.warn("cowork_manifest_unparseable",{session_dir:t,manifest_path:e}),null}if(!Etn(r))return z.warn("cowork_manifest_not_object",{session_dir:t,manifest_path:e}),null;let o=typeof r.sessionId=="string"?r.sessionId.trim():"";if(!o)return z.warn("cowork_manifest_missing_session_id",{session_dir:t,manifest_path:e}),null;let i=typeof r.lastActivityAt=="number"?r.lastActivityAt:0,s=typeof r.cwd=="string"?r.cwd.trim():"",u=Array.isArray(r.userSelectedFolders)?r.userSelectedFolders.filter(l=>typeof l=="string"&&l.trim().length>0):[];return u.length===0&&z.info("cowork_no_user_folders",{session_dir:t,manifest_path:e,cwd:s||"<none>"}),{sessionId:o,cwd:s,userSelectedFolders:u,lastActivityAt:i}}function mtn(e){return{uploads:wfe(e,"uploads"),outputs:wfe(e,"outputs")}}function wfe(e,t){let n=xb.join(e,t);return W9.existsSync(n)?W9.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}var Ret=25*1024*1024,Atn={".txt":"text/plain",".md":"text/markdown",".json":"application/json",".csv":"text/csv",".html":"text/html",".js":"text/javascript",".ts":"text/plain",".py":"text/plain",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".zip":"application/zip"};function gtn(e){return Atn[xb.extname(e).toLowerCase()]??null}async function Bfe(e){let t=[],n=[],r=["upload","output"];for(let o of r){let i=o==="upload"?"uploads":"outputs";for(let s of wfe(e,i)){let u=xb.join(e,i,s),l;try{l=W9.statSync(u).size}catch(f){z.warn("cowork_artifact_stat_failed",{file:u,error:String(f)});continue}if(l>Ret){z.info("cowork_artifact_skipped_too_large",{file:u,size_in_bytes:l,max_bytes:Ret});continue}try{let f=await dl(u);n.push(f.tempPath),t.push({kind:o,fileName:s,tempPath:f.tempPath,md5:f.md5,sizeInBytes:l,contentType:gtn(s)})}catch(f){z.warn("cowork_artifact_snapshot_failed",{file:u,error:String(f)})}}}return{artifactFiles:t,tempPaths:n}}async function htn(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=[...e];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=`${h.accountId}/${h.orgId}/${h.sessionId}/audit.jsonl`;if(r[f]=_,s.has(_))continue;let E=await qi(h.transcriptPath);if(!E.exists){o.add(_),s.add(_);continue}if(t.isUnchanged?.(_,E)){o.add(_),s.add(_);continue}if(t.isThrottled?.(_)){i.add(_),s.add(_);continue}let T=()=>Nfe.readFile(h.transcriptPath,"utf8"),v=null,R=null;for(let[$,V]of h.userSelectedFolders.entries()){let ae=await Dp(V),te=await bh(t.uploadFilterConfig??CA(),{cwd:V,repoOriginPath:ae,transcriptPath:h.transcriptPath,readTranscript:T});if(z.info("cowork_upload_filter_folder_evaluated",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,folder_index:$,folder:V,repo_origin_path:ae||"<none>",should_upload:te.shouldUpload,reason:te.shouldUpload?"matched":te.reason}),te.shouldUpload){v=V,R=ae;break}}if(v===null){z.info("upload_filter_session_excluded",{filename:"audit.jsonl",transcript_path:h.transcriptPath,user_selected_folders:h.userSelectedFolders,reason:h.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"}),o.add(_),s.add(_);continue}l[f]={...h,project:v},z.info("cowork_upload_filter_session_accepted",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,matched_project:v,repo_origin_path:R||"<none>",user_selected_folders:h.userSelectedFolders}),z.info("upload_filter_session_included",{filename:"audit.jsonl",transcript_path:h.transcriptPath,session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let x;try{x=await dl(h.transcriptPath)}catch($){if(Lr($,"ENOENT")){o.add(_),s.add(_);continue}throw new Error(`read cowork audit ${h.transcriptPath}: ${String($)}`)}u.push(x.tempPath);let k=xb.dirname(h.transcriptPath),P=mtn(k),{artifactFiles:j,tempPaths:G}=await Bfe(k);u.push(...G),n.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:R??"",tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"cowork",harnessInternalId:h.sessionId,watchedState:E,artifactMetadata:P,artifactFiles:j}),s.add(_)}}catch(f){throw await Promise.all(u.map(h=>Nfe.rm(xb.dirname(h),{recursive:!0,force:!0}))),f}return{entries:l,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function _tn(e,t,n={}){let r=await Det(e,{includeWatermark:!0}),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await qi(u.transcriptPath);if(!l.exists)continue;let f=()=>Nfe.readFile(u.transcriptPath,"utf8"),h=null,_=null;for(let[E,T]of u.userSelectedFolders.entries()){let v=await Dp(T),R=await bh(n.uploadFilterConfig??CA(),{cwd:T,repoOriginPath:v,transcriptPath:u.transcriptPath,readTranscript:f},{ignoreSkillRules:!0});if(z.info("cowork_upload_filter_watch_folder_evaluated",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,folder_index:E,folder:T,repo_origin_path:v||"<none>",should_upload:R.shouldUpload,reason:R.shouldUpload?"matched":R.reason}),R.shouldUpload){h=T,_=v;break}}if(h===null){z.info("upload_filter_watch_excluded",{filename:"audit.jsonl",transcript_path:u.transcriptPath,user_selected_folders:u.userSelectedFolders,reason:u.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"});continue}i.push({sessionId:u.sessionId,project:h,transcriptPath:u.transcriptPath,expiresAt:new Date(o+dtn),baseline:t.get(u.transcriptPath)??l}),z.info("cowork_upload_filter_watch_accepted",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,matched_project:h,repo_origin_path:_||"<none>",user_selected_folders:u.userSelectedFolders})}return i}function Etn(e){return e!==null&&typeof e=="object"}Xle();var ytn=1e3,Stn=250,Ttn=2,btn=5e3,Ofe=[met,Tet,xet],f1=class extends Error{constructor(){super("lore is logged out")}};function Itn(e){return e.adapters!==void 0?e.adapters:e.adapter!==void 0?[e.adapter]:Ofe}async function Bet(e={}){return(await Pfe(e)).threadIDs}async function Pfe(e={}){Fy(e.signal);let t=await h$(),n=e.recorder??new FD,r=Itn(e),o=e.client??Ct();z.info("run_upload_start",{adapters:r.map(h=>h.name),hasInjectedClient:!!e.client,hasInjectedRecorder:!!e.recorder}),await n.markRunning();let i=[],s=0,u=t,l=new Map,f=!1;try{let h=e.uploadFilterConfig??await xi(),_=await ket({syncState:t,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,minReuploadIntervalMs:e.minReuploadIntervalMs,now:e.now,signal:e.signal});i=_.threadIDs,s=_.deferredCount,u=_.syncState,l=_.watchBaselineOverrides,f=_.loggedOut,Fy(e.signal),f||(await n.markSyncSuccess(i),i.length>0&&e.onUploadCompleted?.());let E=e.tailActiveSessions!==!1;if(!f&&E&&i.length>0){let T=await Ctn({syncState:u,baselineOverrides:l,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});i=[...i,...T.threadIDs],u=T.syncState,f=T.loggedOut,Fy(e.signal)}return f?(z.warn("run_upload_marking_logged_out",{threadIDs:i.length,adapters:r.map(T=>T.name)}),await n.markLoggedOut()):await n.markSuccess(i),{threadIDs:i,deferredCount:s}}catch(h){throw Oet(h)||await n.markError(h),h}}function kfe(e){if(e==="claudeCode"||e==="codex"||e==="cowork")return e;throw new Error(`runUpload: adapter.name "${e}" is not a known HarnessKey. Expected one of: claudeCode, codex, cowork. Custom adapters must use one of these names or the per-harness watermark cannot be persisted.`)}async function ket(e){let t=[],n=0,r=e.syncState,o=new Map,i=await Dtn(e.adapters,xtn(e.adapterConcurrency,e.adapters.length),async h=>{Fy(e.signal);let _=kfe(h.name),E=E$(e.syncState,_),T=e.syncState.harnesses[_]?.cursors??{};try{let v=await vtn({...e,adapter:h,harnessKey:_,floor:E,cursors:T});return{adapter:h,harnessKey:_,uploadResult:v}}catch(v){return{adapter:h,harnessKey:_,error:v}}}),s=[],u=0,l,f;for(let h of i)if(Fy(e.signal),!!h){if("error"in h){if(h.error instanceof f1){l=h.adapter.name;continue}if(Oet(h.error)){f??=h.error;continue}s.push(h.error),z.error("run_upload_adapter_failed",{adapter:h.adapter.name,error:h.error instanceof Error?h.error.message:String(h.error)});continue}u+=1,t=[...t,...h.uploadResult.threadIDs],n+=h.uploadResult.deferredCount;for(let[_,E]of h.uploadResult.cursorUpdates)r=cKe(r,h.harnessKey,_,E);r=lKe(r,h.harnessKey,btn),r=uKe(r,h.harnessKey,h.uploadResult.newFloor);for(let[_,E]of h.uploadResult.watchBaselineOverrides)o.set(_,E);await _$(r)}if(f)throw f;if(u===0&&s.length>0)throw s.length===1?s[0]:new AggregateError(s,"all upload adapters failed");return l?(z.warn("run_upload_logged_out_short_circuit",{adapter:l,threadIDs:t.length}),{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!0}):{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!1}}async function Ctn(e){let t=new Map;for(let i of e.adapters){let s=i.historyFilePath();t.set(s,await qi(s))}let n=[];for(let i of e.adapters){let s=kfe(i.name),u=await i.buildPendingTranscriptWatches(E$(e.syncState,s),e.baselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...u]}if(await e.recorder.setPendingWatchers(n),n.length===0)return await e.recorder.setPendingWatchers([]),{threadIDs:[],syncState:e.syncState,loggedOut:!1};let r=[],o=e.syncState;try{for(;;){await Net(ytn,void 0,{signal:e.signal}),Fy(e.signal),await e.recorder.heartbeat();let i=new Date,s=!1;for(let l of e.adapters){let f=l.historyFilePath(),h=t.get(f),_=await qi(f);h!==void 0&&k$(h,_)&&(s=!0),t.set(f,_)}if(s||(s=await Ntn(n)),!s){let l=wtn(n,i);if(n=l.watchers,l.changed&&await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};continue}await Net(Stn,void 0,{signal:e.signal});let u=await ket({syncState:o,adapters:e.adapters,client:e.client,recorder:e.recorder,uploadFilterConfig:e.uploadFilterConfig,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});if(o=u.syncState,u.loggedOut)return{threadIDs:r,syncState:o,loggedOut:!0};if(r.push(...u.threadIDs),await e.recorder.markSyncSuccess(u.threadIDs),u.threadIDs.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};for(let l of e.adapters){let f=l.historyFilePath();t.set(f,await qi(f))}n=[];for(let l of e.adapters){let f=kfe(l.name),h=await l.buildPendingTranscriptWatches(E$(o,f),u.watchBaselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...h]}if(await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1}}}finally{await e.recorder.setPendingWatchers([])}}async function vtn(e){let t=new Map,n=(_,E)=>{let T=e.cursors[_];return T===void 0?!1:!k$({exists:!0,size:T.sizeBytes,modTimeUnixMs:T.modTimeUnixMs},E)},r=e.minReuploadIntervalMs??0,o=e.now??Date.now,i=o(),s=_=>{if(r<=0)return!1;let E=e.cursors[_];return E===void 0?!1:i-E.lastUploadedAtMs<r};Fy(e.signal);let u=await e.adapter.readUnuploadedEntries(e.floor);if(z.info("run_upload_adapter_entries_read",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),u.length===0)return{threadIDs:[],cursorUpdates:t,newFloor:e.floor,watchBaselineOverrides:new Map,deferredCount:0};if(!await jt())throw z.warn("run_upload_no_access_token_for_entries",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),new f1;z.info("run_upload_access_token_available",{adapter:e.adapter.name,entryCount:u.length}),await e.recorder.markAuthenticated();let f=await e.adapter.collectLocalFiles(u,{uploadFilterConfig:e.uploadFilterConfig,isUnchanged:n,isThrottled:s}),h=f.deferredFileKeys?.size??0;try{if(f.localFiles.length===0){let k=wet(e.floor,f.entries,f.entryFileKeys,f.skippedFileKeys);return{threadIDs:[],cursorUpdates:t,newFloor:k,watchBaselineOverrides:new Map,deferredCount:h}}let _=await kA(e.client,f.localFiles,{networkTimeoutMs:e.uploadNetworkTimeoutMs}),E=[],T=new Map,v=new Set(f.skippedFileKeys),R=k=>{t.set(k.key,{sizeBytes:k.watchedState.size,modTimeUnixMs:k.watchedState.modTimeUnixMs,md5:k.md5,lastUploadedAtMs:o()})};for(let k of _){let{localFile:P}=k;if(k.status==="quarantined"){z.info("run_upload_quarantine",{filename:P.filename,reason:k.reason,findings:k.findingCount}),v.add(P.key);continue}if(k.status!=="uploaded"){let G=(k.status==="no_upload"?k.error?.trim():"")||`upload session response missing presigned_url for ${P.filename}`;z.info("run_upload_skip",{filename:P.filename,reason:G}),v.add(P.key),R(P);continue}await e.recorder.heartbeat(),Fy(e.signal);let j=k.thread?.id?.trim()??"";if(!j){if(P.fileType==="plan"){v.add(P.key),R(P);continue}throw new Error(`complete upload session response missing thread for ${P.filename}`)}E.push(j);try{await Rtn(e.client,j,e.recorder,{timeoutMs:e.parseTimeoutMs,signal:e.signal})}catch(G){if(G instanceof Error&&(G.message.includes("timed out waiting for thread")||G.message.includes("parsing failed permanently")||G.message.includes("unexpected transcript parsing state")))z.warn("parse_wait_soft_failure",{threadID:j,filename:P.filename,message:G.message});else throw G}v.add(P.key),R(P),P.sourcePath&&T.set(P.sourcePath,P.watchedState)}let x=wet(e.floor,f.entries,f.entryFileKeys,v);return{threadIDs:E,cursorUpdates:t,newFloor:x,watchBaselineOverrides:T,deferredCount:h}}finally{await Promise.all([...f.localFiles.map(_=>Ac(_.tempPath)),...f.localFiles.flatMap(_=>(_.artifactFiles??[]).map(E=>Ac(E.tempPath)))])}}async function Rtn(e,t,n,r={}){let o={...r,onPoll:()=>n.heartbeat()};await YD(e,t,o)}function Fy(e){if(e?.aborted)throw new DOMException("The operation was aborted","AbortError")}function Oet(e){return e instanceof Error&&e.name==="AbortError"}function xtn(e,t){return t<=0?1:e===void 0?Math.min(Ttn,t):!Number.isFinite(e)||e<1?1:Math.min(Math.floor(e),t)}async function Dtn(e,t,n){let r=new Array(e.length),o=0,i=Math.min(t,e.length),s=Array.from({length:i},async()=>{for(;;){let u=o;if(o+=1,u>=e.length)return;let l=e[u];if(l===void 0)return;r[u]=await n(l)}});return await Promise.all(s),r}function wet(e,t,n,r){let o=Number.POSITIVE_INFINITY;for(let s=0;s<t.length;s+=1){let u=n[s];u&&r.has(u)||(o=Math.min(o,t[s]?.timestamp??o))}let i=e;for(let s=0;s<t.length;s+=1){let u=n[s];if(!u||!r.has(u))continue;let l=t[s]?.timestamp??i;l<o&&(i=Math.max(i,l))}return i}async function Ntn(e){for(let t of e){let n=await qi(t.transcriptPath);if(k$(t.baseline,n))return!0}return!1}function wtn(e,t){let n=e.filter(r=>t<r.expiresAt);return{watchers:n,changed:n.length!==e.length}}var ktn=2e3,Otn=6e4,Ptn=5e3,Mtn=yde*3,Ltn=5e3,Utn=5*6e4,Qtn=.2,Ftn=15e3;function Gtn(e){return Array.isArray(e)?{threadIDs:e,deferredCount:0}:e}var e5=class extends Error{constructor(t){super(t),this.name="SyncPassDeadlineError"}};function jtn(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??Ofe).map(n=>n.historyFilePath())}async function t5(e={}){let t=e.debounceMs??ktn,n=e.pollIntervalMs,r=n??e.idlePollIntervalMs??Otn,o=n??e.activePollIntervalMs??Ptn,i=e.syncDeadlineMs??Mtn,s=e.failureBackoffBaseMs??Ltn,u=e.failureBackoffMaxMs??Utn,l=e.failureBackoffJitterRatio??Qtn,f=e.random??Math.random,h=jtn(e),_=e.runUploadFn??Pfe,E=e.uploadOptions?.minReuploadIntervalMs??e.minReuploadIntervalMs??Ftn,T=e.uploadOptions?.recorder??new FD,v=e.heartbeatReporter??new q9,R={...e.uploadOptions,recorder:T,tailActiveSessions:!1,onUploadCompleted:()=>{v.uploadCompleted()},minReuploadIntervalMs:E},x=e.signal?void 0:new AbortController,k=e.signal??x.signal,P=()=>x?.abort();x&&(process.once("SIGINT",P),process.once("SIGTERM",P));let j=()=>{x&&(process.removeListener("SIGINT",P),process.removeListener("SIGTERM",P))},G=e.lockFilePath??Mje(),$;for(;;){let Se=await Htn(G);if(Se.acquired){$=Se.release;break}if(z.info("watch_skip_already_running",{pid:Se.pid}),e.lockBusyRetryIntervalMs===void 0){j();return}try{await zM(e.lockBusyRetryIntervalMs,void 0,{signal:k})}catch{j();return}if(k.aborted){j();return}}let V=!1,ae=!1,te=0,_e=r,Ve=async Se=>{if(V){ae=!0;return}V=!0;try{do{if(ae=!1,k.aborted)break;if(te>0){let ze=ztn({consecutiveFailures:te,baseMs:s,maxMs:u,jitterRatio:l,random:f});if(z.warn("watch_sync_backoff",{reason:Se,consecutiveFailures:te,backoffMs:ze}),await zM(ze,void 0,{signal:k}).catch(()=>{}),k.aborted)break}try{let ze=new AbortController,rt=()=>ze.abort();k.addEventListener("abort",rt,{once:!0});let lt=`sync pass exceeded ${i}ms deadline`,kt,Nr=new Promise((At,$t)=>{kt=setTimeout(()=>{z.error("watch_sync_stuck",{reason:Se,syncDeadlineMs:i}),T.markStuck(lt).catch(An=>z.warn("watch_mark_stuck_failed",{error:Gt(An)})),ze.abort(),$t(new e5(lt))},i),kt.unref?.()}),be=_({...R,signal:ze.signal});try{let{threadIDs:At,deferredCount:$t}=Gtn(await Promise.race([be,Nr]));te=0,_e=At.length>0||$t>0?o:r,z.info("watch_sync_complete",{reason:Se,uploaded:At.length,deferred:$t,nextPollIntervalMs:_e})}finally{kt&&clearTimeout(kt),k.removeEventListener("abort",rt),await be.catch(()=>{})}}catch(ze){if(k.aborted&&ze?.name==="AbortError")break;te+=1,!(ze instanceof e5)&&ze?.name!=="AbortError"&&await T.markDegraded(ze).catch(rt=>z.warn("watch_mark_degraded_failed",{error:Gt(rt)})),z.error("watch_sync_failed",{reason:Se,consecutiveFailures:te,error:Gt(ze)})}}while(ae&&!k.aborted)}finally{V=!1}},nt,Fe=Se=>{nt&&clearTimeout(nt),nt=setTimeout(()=>{nt=void 0,Ve(Se)},t),nt.unref?.()};z.info("watch_start",{watchPaths:h,debounceMs:t,idlePollIntervalMs:r,activePollIntervalMs:o,syncDeadlineMs:i}),v.beat(),Ve("startup");let Mt=async Se=>{for(;!k.aborted;)try{let ze=Db.existsSync(Se)&&Db.statSync(Se).isDirectory(),rt=ze?Se:Mfe.dirname(Se),lt=ze?void 0:Mfe.basename(Se),kt=e.watchEventSource?.({watchDir:rt,watchPath:Se,recursive:ze,signal:k})??Btn(rt,{signal:k,recursive:ze});for await(let Nr of kt){if(k.aborted)break;(lt===void 0||!Nr.filename||Nr.filename===lt)&&Fe("fs-event")}}catch(ze){if(k.aborted||ze?.name==="AbortError")break;z.warn("watch_fs_retry",{path:Se,error:Gt(ze)}),await zM(r,void 0,{signal:k}).catch(()=>{})}},un=async()=>{for(;!k.aborted;){try{await zM(_e,void 0,{signal:k})}catch{break}if(k.aborted)break;v.beat(),await Ve("poll")}};try{await Promise.all([...h.map(Mt),un()])}finally{for(nt&&clearTimeout(nt),j();V;)await zM(50).catch(()=>{});await $(),z.info("watch_stop",{})}}function ztn(e){let t=e.baseMs*2**Math.max(0,e.consecutiveFailures-1),n=Math.min(e.maxMs,t),r=n*e.jitterRatio,o=r===0?0:(e.random()*2-1)*r;return Math.max(0,Math.round(n+o))}async function Htn(e){if(z.info("upload_daemon_lock_check",{lockFilePath:e}),e===!1)return{acquired:!0,release:async()=>{}};for(await Db.promises.mkdir(Mfe.dirname(e),{recursive:!0,mode:448});;)try{let t=await Db.promises.open(e,"wx",384);return await t.writeFile(JSON.stringify({pid:process.pid,started_at:new Date().toISOString()})),await t.close(),{acquired:!0,release:async()=>{(await Pet(e))?.pid===process.pid&&await Db.promises.rm(e,{force:!0})}}}catch(t){if(!qtn(t))throw t;let n=await Pet(e);if(n?.pid&&$tn(n.pid))return{acquired:!1,pid:n.pid};await Db.promises.rm(e,{force:!0})}}async function Pet(e){try{let t=JSON.parse(await Db.promises.readFile(e,"utf8"));return typeof t.pid=="number"?{pid:t.pid}:{}}catch{return}}function $tn(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}function qtn(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}A();Qle();zt();Sn();import{setTimeout as Vtn}from"node:timers/promises";var Ytn=1e3,Ktn=3e4,Met=3e4,Jtn=6e4;async function Let(e,t={}){let n=t.signal?void 0:new AbortController,r=t.signal??n.signal,o=()=>n?.abort();n&&(process.once("SIGINT",o),process.once("SIGTERM",o));let i=t.recorder??new a$;await i.markDaemonRunning();let s=setInterval(()=>{i.heartbeat().catch(u=>z.warn("daemon_status_heartbeat_failed",{error:Gt(u)}))},t.heartbeatIntervalMs??Met);s.unref?.();try{await Promise.all(e.map(u=>Ztn(u,{...t,signal:r,recorder:i})))}finally{clearInterval(s),n&&(process.removeListener("SIGINT",o),process.removeListener("SIGTERM",o))}}async function Ztn(e,t){let n=t.minRestartDelayMs??Ytn,r=t.maxRestartDelayMs??Ktn,o=t.heartbeatIntervalMs??Met,i=t.healthyAfterMs??Jtn,s=t.random??Math.random,u=t.now??Date.now,l=0;for(;!t.signal.aborted;){let f=u(),h=new AbortController,_=()=>h.abort(t.signal.reason);t.signal.addEventListener("abort",_,{once:!0});let E,T=!1,v=async()=>{T||(T=!0,await t.recorder.markChildRunning(e.name),E=setInterval(()=>{t.recorder.markChildHeartbeat(e.name).catch(R=>z.warn("daemon_child_heartbeat_failed",{child:e.name,error:Gt(R)}))},o),E.unref?.())};try{if(e.markRunning!=="manual"&&await v(),await e.run({signal:h.signal,markReady:v}),!t.signal.aborted)throw new Error(`${e.name} daemon exited unexpectedly`)}catch(R){if(t.signal.aborted||h.signal.aborted){await t.recorder.markChildStopped(e.name);return}u()-f>=i&&(l=0),l+=1;let x=Wtn(l,n,r,s),k=new Date(u()+x);await t.recorder.markChildRestarting(e.name,R,k),z.error("daemon_child_failed",{child:e.name,attempt:l,restart_delay_ms:x,error:Gt(R)});try{await Vtn(x,void 0,{signal:t.signal})}catch{await t.recorder.markChildStopped(e.name);return}}finally{E&&clearInterval(E),t.signal.removeEventListener("abort",_)}}await t.recorder.markChildStopped(e.name)}function Wtn(e,t,n,r){let o=Math.min(n,t*2**Math.max(0,e-1)),i=Math.max(t,o);return Math.floor(t+r()*(i-t))}var Xtn=3e4,enn=3e4,Qet={meta:{name:"_run_daemon",hidden:!0,skipAutoupdate:!0},args:{"skill-poll-interval-ms":{type:"string",description:"Skill sync fallback full-sync poll interval in milliseconds.",default:"1800000"},"skill-watch-debounce-ms":{type:"string",description:"Skill filesystem watcher debounce interval in milliseconds.",default:"2000"}},async run({args:e,data:t}){let n=t,r=Number(e["skill-poll-interval-ms"]);if(!Number.isFinite(r)||r<=0)throw new Re("--skill-poll-interval-ms must be a positive number");let o=Number(e["skill-watch-debounce-ms"]);if(!Number.isFinite(o)||o<=0)throw new Re("--skill-watch-debounce-ms must be a positive number");await $9(),await(n?.superviseChildren??Let)([{name:"threads",run:({signal:s})=>{let u={client:n?.client,...n?.adapters!==void 0?{adapters:n.adapters}:n?.adapter!==void 0?{adapter:n.adapter}:{},recorder:n?.recorder};return(n?.runUploadWatch??t5)({uploadOptions:u,signal:s,lockBusyRetryIntervalMs:enn})}},{name:"skills",markRunning:"manual",run:async({signal:s,markReady:u})=>{let{client:l,who:f}=await tnn({signal:s,getAccessToken:n?.getAccessToken??jt,injectedClient:n?.client,retryDelayMs:n?.authRetryDelayMs??Xtn}),h=f.body.organizations.map(v=>v.id),_=f.body.user.id,{lastEventId:E}=await ii(),T=(n?.createEventStream??H9)({userId:_,organizationIds:h,getAccessToken:n?.getAccessToken??jt,reconnect:!0,signal:s,...E?{lastEventId:E}:{}});await u(),await(n?.runSkillSyncDaemon??j9)({client:l,events:T,pollIntervalMs:r,watch:!0,watchDebounceMs:o,signal:s,onSyncPass:({reason:v,result:R})=>{console.log(`skill sync ${v}: ${R.publishedLocalPushed} published local update${R.publishedLocalPushed===1?"":"s"} uploaded, ${R.installedUpdated} updated, ${R.localEditsUploaded} local edit${R.localEditsUploaded===1?"":"s"} uploaded, ${R.conflicts} conflict${R.conflicts===1?"":"s"}`)}})}}],n?.supervisorOptions)}};async function tnn(e){for(;!e.signal.aborted;){let t=await e.getAccessToken();if(!t){await Uet(e.retryDelayMs,e.signal);continue}let n=e.injectedClient??Ct({token:t}),r=await n.whoAmI({headers:{}});if(r.status===200)return{client:n,who:r};await Uet(e.retryDelayMs,e.signal)}throw new Error("daemon auth wait aborted")}function Uet(e,t){return t.aborted?Promise.resolve():new Promise(n=>{let r=setTimeout(n,e);r.unref?.(),t.addEventListener("abort",()=>{clearTimeout(r),n()},{once:!0})})}qP();sc();zt();Sn();A();c$();var nnn=()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||!!e.CI},Fet="\x1B",n5=(e,t,n)=>r=>n?r:`${Fet}[${e}m${r}${Fet}[${t}m`,rnn=e=>({cyan:n5(36,39,e),gray:n5(90,39,e),bold:n5(1,22,e),underline:n5(4,24,e)});async function Lfe(e,t={}){let n=t.noColor??nnn(),{cyan:r,gray:o,bold:i,underline:s}=rnn(n),u=await za(e.meta),l=u?.name??"lore",f=u?.description??"",h=await za(e.subCommands),_=[];for(let[R,x]of Object.entries(h??{})){let k=await za(x),P=await za(k.meta);P?.hidden||_.push({name:R,description:P?.description??"",subDef:k})}let E=[];for(let R of _){E.push([r(R.name),R.description]);let x=await za(R.subDef.subCommands);if(x)for(let[k,P]of Object.entries(x)){let j=await za(P),G=await za(j.meta);G?.hidden||E.push([` ${r(k)}`,G?.description??""])}}let T=E.reduce((R,[x])=>Math.max(R,x.length),0),v=[];v.push(o(`${f} (${l})`),""),v.push(`${s(i("USAGE"))} ${r(`${l} ${_.map(R=>R.name).join("|")}`)}`,""),v.push(s(i("COMMANDS")),"");for(let[R,x]of E)v.push(` ${R.padEnd(T)} ${x}`);return v.push("",`Use ${r(`${l} <command> --help`)} for more information about a command.`),v.join(`
|
|
656
|
+
`)){let o=r.trim();if(!o)continue;let i;try{i=JSON.parse(o)}catch{break}if(i.type!=="assistant")continue;let s=i.message?.content;if(Array.isArray(s))for(let u of s){if(!pet(u)||u.type!=="tool_use"||u.name!=="ExitPlanMode"||!pet(u.input))continue;let l=u.input.planFilePath;if(typeof l!="string")continue;let f=l.trim();!f||n.has(f)||(t.push(f),n.add(f))}}return t}async function ttn(e){let t=e.trim();if(!t)throw new Error("plan file path is empty");let n=Xen(),r=n;try{r=await Al.realpath(n)}catch{}if(t.startsWith("~/")&&(t=As.join(fet.homedir(),t.slice(2))),!As.isAbsolute(t))throw new Error(`plan file path must stay under ${n}`);if(t=As.normalize(t),!det(t,n))throw new Error(`plan file path must stay under ${n}`);try{let o=await Al.realpath(t);if(!det(o,r))throw new Error(`plan file path must resolve under ${n}`)}catch(o){if(!Lr(o,"ENOENT"))throw o}return t}function det(e,t){let n=As.relative(t,e);return n===""||n!==".."&&!n.startsWith(`..${As.sep}`)}function pet(e){return e!==null&&typeof e=="object"}A();zt();Sn();Du();import{createReadStream as ntn}from"node:fs";import Uy from"node:fs/promises";import rtn from"node:os";import Yf from"node:path";import{createInterface as otn}from"node:readline";Th();var itn=3600*1e3,Tet={name:"codex",historyFilePath:xfe,readUnuploadedEntries:bet,collectLocalFiles:atn,buildPendingTranscriptWatches:utn};function xfe(){return process.env.LORE_CODEX_SESSIONS_DIR??Yf.join(rtn.homedir(),".codex","sessions")}async function bet(e){let t=xfe(),n;try{n=await Uy.readdir(t,{withFileTypes:!0})}catch(o){if(Lr(o,"ENOENT"))return[];throw o}let r=[];for(let o of n){if(!o.isDirectory())continue;let i=Yf.join(t,o.name),s;try{s=await Uy.readdir(i,{withFileTypes:!0})}catch{continue}for(let u of s){if(!u.isDirectory())continue;let l=Yf.join(i,u.name),f;try{f=await Uy.readdir(l,{withFileTypes:!0})}catch{continue}for(let h of f){if(!h.isDirectory())continue;let _=Yf.join(l,h.name),E;try{E=await Uy.readdir(_,{withFileTypes:!0})}catch{continue}for(let T of E){if(!T.isFile()||!T.name.startsWith("rollout-")||!T.name.endsWith(".jsonl"))continue;let v=Yf.join(_,T.name),R;try{R=await Uy.stat(v)}catch{continue}if(R.mtimeMs<=e)continue;let x=await stn(v);x!==null&&r.push({timestamp:R.mtimeMs,sessionId:x.id,project:x.cwd,transcriptPath:v})}}}}return r.sort((o,i)=>o.timestamp-i.timestamp)}async function stn(e){let t,n=ntn(e,{encoding:"utf8"});try{t=await new Promise((u,l)=>{let f=otn({input:n,crlfDelay:Number.POSITIVE_INFINITY}),h=!1;f.on("line",_=>{if(h)return;let E=_.trim();E&&(h=!0,f.close(),n.destroy(),u(E))}),f.on("close",()=>{h||u("")}),f.on("error",l),n.on("error",l)})}finally{n.destroy()}if(!t)return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"empty_first_line"}),null;let r;try{r=JSON.parse(t)}catch{return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"unparseable_json"}),null}if(!yet(r))return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;if(r.type!=="session_meta")return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;let o=r.payload;if(!yet(o))return z.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_payload"}),null;let i=typeof o.id=="string"?o.id.trim():"",s=typeof o.cwd=="string"?o.cwd.trim():"";return!i||!s?(z.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_id_or_cwd"}),null):{id:i,cwd:s}}async function atn(e,t={}){let n=xfe(),r=[],o=new Array(e.length),i=new Set,s=new Set,u=new Set,l=[];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=Yf.relative(n,h.transcriptPath).split(Yf.sep).join("/");if(o[f]=_,u.has(_))continue;let E=await qi(h.transcriptPath);if(!E.exists){i.add(_),u.add(_);continue}if(t.isUnchanged?.(_,E)){i.add(_),u.add(_);continue}if(t.isThrottled?.(_)){s.add(_),u.add(_);continue}let T=await Dp(h.project),v=()=>Uy.readFile(h.transcriptPath,"utf8"),R=await bh(t.uploadFilterConfig??CA(),{cwd:h.project,repoOriginPath:T,transcriptPath:h.transcriptPath,readTranscript:v});if(!R.shouldUpload){z.info("upload_filter_session_excluded",{filename:Yf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:R.reason}),i.add(_),u.add(_);continue}z.info("upload_filter_session_included",{filename:Yf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:"matched"});let x;try{x=await dl(h.transcriptPath)}catch(k){if(Lr(k,"ENOENT")){i.add(_),u.add(_);continue}throw new Error(`read codex rollout ${h.transcriptPath}: ${String(k)}`)}l.push(x.tempPath),r.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:T,tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"codex",harnessInternalId:h.sessionId,watchedState:E}),u.add(_)}}catch(f){throw await Promise.all(l.map(h=>Uy.rm(Yf.dirname(h),{recursive:!0,force:!0}))),f}return{entries:e,localFiles:r,entryFileKeys:o,skippedFileKeys:i,deferredFileKeys:s}}async function utn(e,t,n={}){let r=await bet(e),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await qi(u.transcriptPath);if(!l.exists)continue;let f=await Dp(u.project),h=await bh(n.uploadFilterConfig??CA(),{cwd:u.project,repoOriginPath:f,transcriptPath:u.transcriptPath,readTranscript:()=>Uy.readFile(u.transcriptPath,"utf8")},{ignoreSkillRules:!0});if(!h.shouldUpload){z.info("upload_filter_watch_excluded",{filename:Yf.basename(u.transcriptPath),transcript_path:u.transcriptPath,cwd:u.project,repo_origin_path:f||"<none>",reason:h.reason});continue}i.push({sessionId:u.sessionId,project:u.project,transcriptPath:u.transcriptPath,expiresAt:new Date(o+itn),baseline:t.get(u.transcriptPath)??l})}return i}function yet(e){return e!==null&&typeof e=="object"}A();zt();Sn();Du();import W9 from"node:fs";import Nfe from"node:fs/promises";import xb from"node:path";A();import ctn from"node:fs";var ltn=V9,Dfe=Y9;function Iet(e){let t=ltn(e);if(!t)throw new Error(`Session ${e} has no local_* subdirectory \u2014 is this a Cowork session?`);let n=Dfe(t);if(!n)throw new Error(`Session ${e} has no transcript file under ${t} (looked for ${Cfe.join(", ")})`);let r=ctn.readFileSync(n,"utf8"),o=vfe(t,"uploads"),i=vfe(t,"outputs");return{transcriptPath:n,transcript:r,uploads:o,outputs:i}}A();import jM from"node:path";var Z9=aet;function Cet(e){let t=jM.resolve(e).split(jM.sep),n=t.lastIndexOf(Ife);if(n<0)return null;let r=t[n+1],o=t[n+2];if(!r||!o)return null;let i=t.slice(0,n+1).join(jM.sep),s=jM.join(i,r,o),l=t.slice(n+3).find(h=>h.startsWith("local_"))??jM.basename(V9(s)??""),f=l.startsWith("local_")?l.replace(/^local_/,""):"";return{accountId:r,orgId:o,sessionId:f,sessionDir:s,sessionsRoot:i}}function Qy(e){return uet(e)}function vet(e){return Qy(e)[0]??null}Th();var dtn=3600*1e3,xet={name:"cowork",historyFilePath:X9,readUnuploadedEntries:ptn,collectLocalFiles:htn,buildPendingTranscriptWatches:_tn};function X9(){return process.env.LORE_COWORK_SESSIONS_DIR??Z9()}async function ptn(e){return Det(e,{includeWatermark:!1})}async function Det(e,t){let n=X9(),r=Qy(n),o=[];for(let i of r){let s=i.localDir,u=Dfe(s);if(!u)continue;let l=xb.basename(s),f=xb.join(i.sessionDir,`${l}.json`),h=ftn(f,i.sessionDir);if(h!==null){if(t.includeWatermark){if(h.lastActivityAt<e)continue}else if(h.lastActivityAt<=e)continue;o.push({timestamp:h.lastActivityAt,sessionId:h.sessionId,accountId:i.accountId,orgId:i.orgId,project:"",userSelectedFolders:h.userSelectedFolders,transcriptPath:u})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}function ftn(e,t){let n;try{n=W9.readFileSync(e,"utf8")}catch{return z.warn("cowork_manifest_missing",{session_dir:t,manifest_path:e}),null}let r;try{r=JSON.parse(n)}catch{return z.warn("cowork_manifest_unparseable",{session_dir:t,manifest_path:e}),null}if(!Etn(r))return z.warn("cowork_manifest_not_object",{session_dir:t,manifest_path:e}),null;let o=typeof r.sessionId=="string"?r.sessionId.trim():"";if(!o)return z.warn("cowork_manifest_missing_session_id",{session_dir:t,manifest_path:e}),null;let i=typeof r.lastActivityAt=="number"?r.lastActivityAt:0,s=typeof r.cwd=="string"?r.cwd.trim():"",u=Array.isArray(r.userSelectedFolders)?r.userSelectedFolders.filter(l=>typeof l=="string"&&l.trim().length>0):[];return u.length===0&&z.info("cowork_no_user_folders",{session_dir:t,manifest_path:e,cwd:s||"<none>"}),{sessionId:o,cwd:s,userSelectedFolders:u,lastActivityAt:i}}function mtn(e){return{uploads:wfe(e,"uploads"),outputs:wfe(e,"outputs")}}function wfe(e,t){let n=xb.join(e,t);return W9.existsSync(n)?W9.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}var Ret=25*1024*1024,Atn={".txt":"text/plain",".md":"text/markdown",".json":"application/json",".csv":"text/csv",".html":"text/html",".js":"text/javascript",".ts":"text/plain",".py":"text/plain",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".zip":"application/zip"};function gtn(e){return Atn[xb.extname(e).toLowerCase()]??null}async function Bfe(e){let t=[],n=[],r=["upload","output"];for(let o of r){let i=o==="upload"?"uploads":"outputs";for(let s of wfe(e,i)){let u=xb.join(e,i,s),l;try{l=W9.statSync(u).size}catch(f){z.warn("cowork_artifact_stat_failed",{file:u,error:String(f)});continue}if(l>Ret){z.info("cowork_artifact_skipped_too_large",{file:u,size_in_bytes:l,max_bytes:Ret});continue}try{let f=await dl(u);n.push(f.tempPath),t.push({kind:o,fileName:s,tempPath:f.tempPath,md5:f.md5,sizeInBytes:l,contentType:gtn(s)})}catch(f){z.warn("cowork_artifact_snapshot_failed",{file:u,error:String(f)})}}}return{artifactFiles:t,tempPaths:n}}async function htn(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=[...e];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=`${h.accountId}/${h.orgId}/${h.sessionId}/audit.jsonl`;if(r[f]=_,s.has(_))continue;let E=await qi(h.transcriptPath);if(!E.exists){o.add(_),s.add(_);continue}if(t.isUnchanged?.(_,E)){o.add(_),s.add(_);continue}if(t.isThrottled?.(_)){i.add(_),s.add(_);continue}let T=()=>Nfe.readFile(h.transcriptPath,"utf8"),v=null,R=null;for(let[$,V]of h.userSelectedFolders.entries()){let ae=await Dp(V),te=await bh(t.uploadFilterConfig??CA(),{cwd:V,repoOriginPath:ae,transcriptPath:h.transcriptPath,readTranscript:T});if(z.info("cowork_upload_filter_folder_evaluated",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,folder_index:$,folder:V,repo_origin_path:ae||"<none>",should_upload:te.shouldUpload,reason:te.shouldUpload?"matched":te.reason}),te.shouldUpload){v=V,R=ae;break}}if(v===null){z.info("upload_filter_session_excluded",{filename:"audit.jsonl",transcript_path:h.transcriptPath,user_selected_folders:h.userSelectedFolders,reason:h.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"}),o.add(_),s.add(_);continue}l[f]={...h,project:v},z.info("cowork_upload_filter_session_accepted",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,matched_project:v,repo_origin_path:R||"<none>",user_selected_folders:h.userSelectedFolders}),z.info("upload_filter_session_included",{filename:"audit.jsonl",transcript_path:h.transcriptPath,session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let x;try{x=await dl(h.transcriptPath)}catch($){if(Lr($,"ENOENT")){o.add(_),s.add(_);continue}throw new Error(`read cowork audit ${h.transcriptPath}: ${String($)}`)}u.push(x.tempPath);let k=xb.dirname(h.transcriptPath),P=mtn(k),{artifactFiles:j,tempPaths:G}=await Bfe(k);u.push(...G),n.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:R??"",tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"cowork",harnessInternalId:h.sessionId,watchedState:E,artifactMetadata:P,artifactFiles:j}),s.add(_)}}catch(f){throw await Promise.all(u.map(h=>Nfe.rm(xb.dirname(h),{recursive:!0,force:!0}))),f}return{entries:l,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function _tn(e,t,n={}){let r=await Det(e,{includeWatermark:!0}),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await qi(u.transcriptPath);if(!l.exists)continue;let f=()=>Nfe.readFile(u.transcriptPath,"utf8"),h=null,_=null;for(let[E,T]of u.userSelectedFolders.entries()){let v=await Dp(T),R=await bh(n.uploadFilterConfig??CA(),{cwd:T,repoOriginPath:v,transcriptPath:u.transcriptPath,readTranscript:f},{ignoreSkillRules:!0});if(z.info("cowork_upload_filter_watch_folder_evaluated",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,folder_index:E,folder:T,repo_origin_path:v||"<none>",should_upload:R.shouldUpload,reason:R.shouldUpload?"matched":R.reason}),R.shouldUpload){h=T,_=v;break}}if(h===null){z.info("upload_filter_watch_excluded",{filename:"audit.jsonl",transcript_path:u.transcriptPath,user_selected_folders:u.userSelectedFolders,reason:u.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"});continue}i.push({sessionId:u.sessionId,project:h,transcriptPath:u.transcriptPath,expiresAt:new Date(o+dtn),baseline:t.get(u.transcriptPath)??l}),z.info("cowork_upload_filter_watch_accepted",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,matched_project:h,repo_origin_path:_||"<none>",user_selected_folders:u.userSelectedFolders})}return i}function Etn(e){return e!==null&&typeof e=="object"}Xle();var ytn=1e3,Stn=250,Ttn=2,btn=5e3,Ofe=[met,Tet,xet],f1=class extends Error{constructor(){super("lore is logged out")}};function Itn(e){return e.adapters!==void 0?e.adapters:e.adapter!==void 0?[e.adapter]:Ofe}async function Bet(e={}){return(await Pfe(e)).threadIDs}async function Pfe(e={}){Fy(e.signal);let t=await h$(),n=e.recorder??new FD,r=Itn(e),o=e.client??Ct();z.info("run_upload_start",{adapters:r.map(h=>h.name),hasInjectedClient:!!e.client,hasInjectedRecorder:!!e.recorder}),await n.markRunning();let i=[],s=0,u=t,l=new Map,f=!1;try{let h=e.uploadFilterConfig??await xi(),_=await ket({syncState:t,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,minReuploadIntervalMs:e.minReuploadIntervalMs,now:e.now,signal:e.signal});i=_.threadIDs,s=_.deferredCount,u=_.syncState,l=_.watchBaselineOverrides,f=_.loggedOut,Fy(e.signal),f||(await n.markSyncSuccess(i),i.length>0&&e.onUploadCompleted?.());let E=e.tailActiveSessions!==!1;if(!f&&E&&i.length>0){let T=await Ctn({syncState:u,baselineOverrides:l,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});i=[...i,...T.threadIDs],u=T.syncState,f=T.loggedOut,Fy(e.signal)}return f?(z.warn("run_upload_marking_logged_out",{threadIDs:i.length,adapters:r.map(T=>T.name)}),await n.markLoggedOut()):await n.markSuccess(i),{threadIDs:i,deferredCount:s}}catch(h){throw Oet(h)||await n.markError(h),h}}function kfe(e){if(e==="claudeCode"||e==="codex"||e==="cowork")return e;throw new Error(`runUpload: adapter.name "${e}" is not a known HarnessKey. Expected one of: claudeCode, codex, cowork. Custom adapters must use one of these names or the per-harness watermark cannot be persisted.`)}async function ket(e){let t=[],n=0,r=e.syncState,o=new Map,i=await Dtn(e.adapters,xtn(e.adapterConcurrency,e.adapters.length),async h=>{Fy(e.signal);let _=kfe(h.name),E=E$(e.syncState,_),T=e.syncState.harnesses[_]?.cursors??{};try{let v=await vtn({...e,adapter:h,harnessKey:_,floor:E,cursors:T});return{adapter:h,harnessKey:_,uploadResult:v}}catch(v){return{adapter:h,harnessKey:_,error:v}}}),s=[],u=0,l,f;for(let h of i)if(Fy(e.signal),!!h){if("error"in h){if(h.error instanceof f1){l=h.adapter.name;continue}if(Oet(h.error)){f??=h.error;continue}s.push(h.error),z.error("run_upload_adapter_failed",{adapter:h.adapter.name,error:h.error instanceof Error?h.error.message:String(h.error)});continue}u+=1,t=[...t,...h.uploadResult.threadIDs],n+=h.uploadResult.deferredCount;for(let[_,E]of h.uploadResult.cursorUpdates)r=cKe(r,h.harnessKey,_,E);r=lKe(r,h.harnessKey,btn),r=uKe(r,h.harnessKey,h.uploadResult.newFloor);for(let[_,E]of h.uploadResult.watchBaselineOverrides)o.set(_,E);await _$(r)}if(f)throw f;if(u===0&&s.length>0)throw s.length===1?s[0]:new AggregateError(s,"all upload adapters failed");return l?(z.warn("run_upload_logged_out_short_circuit",{adapter:l,threadIDs:t.length}),{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!0}):{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!1}}async function Ctn(e){let t=new Map;for(let i of e.adapters){let s=i.historyFilePath();t.set(s,await qi(s))}let n=[];for(let i of e.adapters){let s=kfe(i.name),u=await i.buildPendingTranscriptWatches(E$(e.syncState,s),e.baselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...u]}if(await e.recorder.setPendingWatchers(n),n.length===0)return await e.recorder.setPendingWatchers([]),{threadIDs:[],syncState:e.syncState,loggedOut:!1};let r=[],o=e.syncState;try{for(;;){await Net(ytn,void 0,{signal:e.signal}),Fy(e.signal),await e.recorder.heartbeat();let i=new Date,s=!1;for(let l of e.adapters){let f=l.historyFilePath(),h=t.get(f),_=await qi(f);h!==void 0&&k$(h,_)&&(s=!0),t.set(f,_)}if(s||(s=await Ntn(n)),!s){let l=wtn(n,i);if(n=l.watchers,l.changed&&await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};continue}await Net(Stn,void 0,{signal:e.signal});let u=await ket({syncState:o,adapters:e.adapters,client:e.client,recorder:e.recorder,uploadFilterConfig:e.uploadFilterConfig,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});if(o=u.syncState,u.loggedOut)return{threadIDs:r,syncState:o,loggedOut:!0};if(r.push(...u.threadIDs),await e.recorder.markSyncSuccess(u.threadIDs),u.threadIDs.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};for(let l of e.adapters){let f=l.historyFilePath();t.set(f,await qi(f))}n=[];for(let l of e.adapters){let f=kfe(l.name),h=await l.buildPendingTranscriptWatches(E$(o,f),u.watchBaselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...h]}if(await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1}}}finally{await e.recorder.setPendingWatchers([])}}async function vtn(e){let t=new Map,n=(_,E)=>{let T=e.cursors[_];return T===void 0?!1:!k$({exists:!0,size:T.sizeBytes,modTimeUnixMs:T.modTimeUnixMs},E)},r=e.minReuploadIntervalMs??0,o=e.now??Date.now,i=o(),s=_=>{if(r<=0)return!1;let E=e.cursors[_];return E===void 0?!1:i-E.lastUploadedAtMs<r};Fy(e.signal);let u=await e.adapter.readUnuploadedEntries(e.floor);if(z.info("run_upload_adapter_entries_read",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),u.length===0)return{threadIDs:[],cursorUpdates:t,newFloor:e.floor,watchBaselineOverrides:new Map,deferredCount:0};if(!await jt())throw z.warn("run_upload_no_access_token_for_entries",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),new f1;z.info("run_upload_access_token_available",{adapter:e.adapter.name,entryCount:u.length}),await e.recorder.markAuthenticated();let f=await e.adapter.collectLocalFiles(u,{uploadFilterConfig:e.uploadFilterConfig,isUnchanged:n,isThrottled:s}),h=f.deferredFileKeys?.size??0;try{if(f.localFiles.length===0){let k=wet(e.floor,f.entries,f.entryFileKeys,f.skippedFileKeys);return{threadIDs:[],cursorUpdates:t,newFloor:k,watchBaselineOverrides:new Map,deferredCount:h}}let _=await kA(e.client,f.localFiles,{networkTimeoutMs:e.uploadNetworkTimeoutMs}),E=[],T=new Map,v=new Set(f.skippedFileKeys),R=k=>{t.set(k.key,{sizeBytes:k.watchedState.size,modTimeUnixMs:k.watchedState.modTimeUnixMs,md5:k.md5,lastUploadedAtMs:o()})};for(let k of _){let{localFile:P}=k;if(k.status==="quarantined"){z.info("run_upload_quarantine",{filename:P.filename,reason:k.reason,findings:k.findingCount}),v.add(P.key);continue}if(k.status!=="uploaded"){let G=(k.status==="no_upload"?k.error?.trim():"")||`upload session response missing presigned_url for ${P.filename}`;z.info("run_upload_skip",{filename:P.filename,reason:G}),v.add(P.key),R(P);continue}await e.recorder.heartbeat(),Fy(e.signal);let j=k.thread?.id?.trim()??"";if(!j){if(P.fileType==="plan"){v.add(P.key),R(P);continue}throw new Error(`complete upload session response missing thread for ${P.filename}`)}E.push(j);try{await Rtn(e.client,j,e.recorder,{timeoutMs:e.parseTimeoutMs,signal:e.signal})}catch(G){if(G instanceof Error&&(G.message.includes("timed out waiting for thread")||G.message.includes("parsing failed permanently")||G.message.includes("unexpected transcript parsing state")))z.warn("parse_wait_soft_failure",{threadID:j,filename:P.filename,message:G.message});else throw G}v.add(P.key),R(P),P.sourcePath&&T.set(P.sourcePath,P.watchedState)}let x=wet(e.floor,f.entries,f.entryFileKeys,v);return{threadIDs:E,cursorUpdates:t,newFloor:x,watchBaselineOverrides:T,deferredCount:h}}finally{await Promise.all([...f.localFiles.map(_=>Ac(_.tempPath)),...f.localFiles.flatMap(_=>(_.artifactFiles??[]).map(E=>Ac(E.tempPath)))])}}async function Rtn(e,t,n,r={}){let o={...r,onPoll:()=>n.heartbeat()};await YD(e,t,o)}function Fy(e){if(e?.aborted)throw new DOMException("The operation was aborted","AbortError")}function Oet(e){return e instanceof Error&&e.name==="AbortError"}function xtn(e,t){return t<=0?1:e===void 0?Math.min(Ttn,t):!Number.isFinite(e)||e<1?1:Math.min(Math.floor(e),t)}async function Dtn(e,t,n){let r=new Array(e.length),o=0,i=Math.min(t,e.length),s=Array.from({length:i},async()=>{for(;;){let u=o;if(o+=1,u>=e.length)return;let l=e[u];if(l===void 0)return;r[u]=await n(l)}});return await Promise.all(s),r}function wet(e,t,n,r){let o=Number.POSITIVE_INFINITY;for(let s=0;s<t.length;s+=1){let u=n[s];u&&r.has(u)||(o=Math.min(o,t[s]?.timestamp??o))}let i=e;for(let s=0;s<t.length;s+=1){let u=n[s];if(!u||!r.has(u))continue;let l=t[s]?.timestamp??i;l<o&&(i=Math.max(i,l))}return i}async function Ntn(e){for(let t of e){let n=await qi(t.transcriptPath);if(k$(t.baseline,n))return!0}return!1}function wtn(e,t){let n=e.filter(r=>t<r.expiresAt);return{watchers:n,changed:n.length!==e.length}}var ktn=2e3,Otn=6e4,Ptn=5e3,Mtn=yde*3,Ltn=5e3,Utn=5*6e4,Qtn=.2,Ftn=15e3;function Gtn(e){return Array.isArray(e)?{threadIDs:e,deferredCount:0}:e}var e5=class extends Error{constructor(t){super(t),this.name="SyncPassDeadlineError"}};function jtn(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??Ofe).map(n=>n.historyFilePath())}async function t5(e={}){let t=e.debounceMs??ktn,n=e.pollIntervalMs,r=n??e.idlePollIntervalMs??Otn,o=n??e.activePollIntervalMs??Ptn,i=e.syncDeadlineMs??Mtn,s=e.failureBackoffBaseMs??Ltn,u=e.failureBackoffMaxMs??Utn,l=e.failureBackoffJitterRatio??Qtn,f=e.random??Math.random,h=jtn(e),_=e.runUploadFn??Pfe,E=e.uploadOptions?.minReuploadIntervalMs??e.minReuploadIntervalMs??Ftn,T=e.uploadOptions?.recorder??new FD,v=e.heartbeatReporter??new q9,R={...e.uploadOptions,recorder:T,tailActiveSessions:!1,onUploadCompleted:()=>{v.uploadCompleted()},minReuploadIntervalMs:E},x=e.signal?void 0:new AbortController,k=e.signal??x.signal,P=()=>x?.abort();x&&(process.once("SIGINT",P),process.once("SIGTERM",P));let j=()=>{x&&(process.removeListener("SIGINT",P),process.removeListener("SIGTERM",P))},G=e.lockFilePath??Mje(),$;for(;;){let Se=await Htn(G);if(Se.acquired){$=Se.release;break}if(z.info("watch_skip_already_running",{pid:Se.pid}),e.lockBusyRetryIntervalMs===void 0){j();return}try{await zM(e.lockBusyRetryIntervalMs,void 0,{signal:k})}catch{j();return}if(k.aborted){j();return}}let V=!1,ae=!1,te=0,_e=r,Ve=async Se=>{if(V){ae=!0;return}V=!0;try{do{if(ae=!1,k.aborted)break;if(te>0){let ze=ztn({consecutiveFailures:te,baseMs:s,maxMs:u,jitterRatio:l,random:f});if(z.warn("watch_sync_backoff",{reason:Se,consecutiveFailures:te,backoffMs:ze}),await zM(ze,void 0,{signal:k}).catch(()=>{}),k.aborted)break}try{let ze=new AbortController,rt=()=>ze.abort();k.addEventListener("abort",rt,{once:!0});let lt=`sync pass exceeded ${i}ms deadline`,kt,Nr=new Promise((At,$t)=>{kt=setTimeout(()=>{z.error("watch_sync_stuck",{reason:Se,syncDeadlineMs:i}),T.markStuck(lt).catch(An=>z.warn("watch_mark_stuck_failed",{error:Gt(An)})),ze.abort(),$t(new e5(lt))},i),kt.unref?.()}),be=_({...R,signal:ze.signal});try{let{threadIDs:At,deferredCount:$t}=Gtn(await Promise.race([be,Nr]));te=0,_e=At.length>0||$t>0?o:r,z.info("watch_sync_complete",{reason:Se,uploaded:At.length,deferred:$t,nextPollIntervalMs:_e})}finally{kt&&clearTimeout(kt),k.removeEventListener("abort",rt),await be.catch(()=>{})}}catch(ze){if(k.aborted&&ze?.name==="AbortError")break;te+=1,!(ze instanceof e5)&&ze?.name!=="AbortError"&&await T.markDegraded(ze).catch(rt=>z.warn("watch_mark_degraded_failed",{error:Gt(rt)})),z.error("watch_sync_failed",{reason:Se,consecutiveFailures:te,error:Gt(ze)})}}while(ae&&!k.aborted)}finally{V=!1}},nt,Fe=Se=>{nt&&clearTimeout(nt),nt=setTimeout(()=>{nt=void 0,Ve(Se)},t),nt.unref?.()};z.info("watch_start",{watchPaths:h,debounceMs:t,idlePollIntervalMs:r,activePollIntervalMs:o,syncDeadlineMs:i}),v.beat(),Ve("startup");let Mt=async Se=>{for(;!k.aborted;)try{let ze=Db.existsSync(Se)&&Db.statSync(Se).isDirectory(),rt=ze?Se:Mfe.dirname(Se),lt=ze?void 0:Mfe.basename(Se),kt=e.watchEventSource?.({watchDir:rt,watchPath:Se,recursive:ze,signal:k})??Btn(rt,{signal:k,recursive:ze});for await(let Nr of kt){if(k.aborted)break;(lt===void 0||!Nr.filename||Nr.filename===lt)&&Fe("fs-event")}}catch(ze){if(k.aborted||ze?.name==="AbortError")break;z.warn("watch_fs_retry",{path:Se,error:Gt(ze)}),await zM(r,void 0,{signal:k}).catch(()=>{})}},un=async()=>{for(;!k.aborted;){try{await zM(_e,void 0,{signal:k})}catch{break}if(k.aborted)break;v.beat(),await Ve("poll")}};try{await Promise.all([...h.map(Mt),un()])}finally{for(nt&&clearTimeout(nt),j();V;)await zM(50).catch(()=>{});await $(),z.info("watch_stop",{})}}function ztn(e){let t=e.baseMs*2**Math.max(0,e.consecutiveFailures-1),n=Math.min(e.maxMs,t),r=n*e.jitterRatio,o=r===0?0:(e.random()*2-1)*r;return Math.max(0,Math.round(n+o))}async function Htn(e){if(z.info("upload_daemon_lock_check",{lockFilePath:e}),e===!1)return{acquired:!0,release:async()=>{}};for(await Db.promises.mkdir(Mfe.dirname(e),{recursive:!0,mode:448});;)try{let t=await Db.promises.open(e,"wx",384);return await t.writeFile(JSON.stringify({pid:process.pid,started_at:new Date().toISOString()})),await t.close(),{acquired:!0,release:async()=>{(await Pet(e))?.pid===process.pid&&await Db.promises.rm(e,{force:!0})}}}catch(t){if(!qtn(t))throw t;let n=await Pet(e);if(n?.pid&&$tn(n.pid))return{acquired:!1,pid:n.pid};await Db.promises.rm(e,{force:!0})}}async function Pet(e){try{let t=JSON.parse(await Db.promises.readFile(e,"utf8"));return typeof t.pid=="number"?{pid:t.pid}:{}}catch{return}}function $tn(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}function qtn(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}A();Qle();zt();Sn();import{setTimeout as Vtn}from"node:timers/promises";var Ytn=1e3,Ktn=3e4,Met=3e4,Jtn=6e4;async function Let(e,t={}){let n=t.signal?void 0:new AbortController,r=t.signal??n.signal,o=()=>n?.abort();n&&(process.once("SIGINT",o),process.once("SIGTERM",o));let i=t.recorder??new a$;await i.markDaemonRunning();let s=setInterval(()=>{i.heartbeat().catch(u=>z.warn("daemon_status_heartbeat_failed",{error:Gt(u)}))},t.heartbeatIntervalMs??Met);s.unref?.();try{await Promise.all(e.map(u=>Ztn(u,{...t,signal:r,recorder:i})))}finally{clearInterval(s),n&&(process.removeListener("SIGINT",o),process.removeListener("SIGTERM",o))}}async function Ztn(e,t){let n=t.minRestartDelayMs??Ytn,r=t.maxRestartDelayMs??Ktn,o=t.heartbeatIntervalMs??Met,i=t.healthyAfterMs??Jtn,s=t.random??Math.random,u=t.now??Date.now,l=0;for(;!t.signal.aborted;){let f=u(),h=new AbortController,_=()=>h.abort(t.signal.reason);t.signal.addEventListener("abort",_,{once:!0});let E,T=!1,v=async()=>{T||(T=!0,await t.recorder.markChildRunning(e.name),E=setInterval(()=>{t.recorder.markChildHeartbeat(e.name).catch(R=>z.warn("daemon_child_heartbeat_failed",{child:e.name,error:Gt(R)}))},o),E.unref?.())};try{if(e.markRunning!=="manual"&&await v(),await e.run({signal:h.signal,markReady:v}),!t.signal.aborted)throw new Error(`${e.name} daemon exited unexpectedly`)}catch(R){if(t.signal.aborted||h.signal.aborted){await t.recorder.markChildStopped(e.name);return}u()-f>=i&&(l=0),l+=1;let x=Wtn(l,n,r,s),k=new Date(u()+x);await t.recorder.markChildRestarting(e.name,R,k),z.error("daemon_child_failed",{child:e.name,attempt:l,restart_delay_ms:x,error:Gt(R)});try{await Vtn(x,void 0,{signal:t.signal})}catch{await t.recorder.markChildStopped(e.name);return}}finally{E&&clearInterval(E),t.signal.removeEventListener("abort",_)}}await t.recorder.markChildStopped(e.name)}function Wtn(e,t,n,r){let o=Math.min(n,t*2**Math.max(0,e-1)),i=Math.max(t,o);return Math.floor(t+r()*(i-t))}var Xtn=3e4,enn=3e4,Qet={meta:{name:"_run_daemon",hidden:!0,skipAutoupdate:!0},args:{"skill-poll-interval-ms":{type:"string",description:"Skill sync fallback full-sync poll interval in milliseconds.",default:"1800000"},"skill-watch-debounce-ms":{type:"string",description:"Skill filesystem watcher debounce interval in milliseconds.",default:"2000"}},async run({args:e,data:t}){let n=t,r=Number(e["skill-poll-interval-ms"]);if(!Number.isFinite(r)||r<=0)throw new Re("--skill-poll-interval-ms must be a positive number");let o=Number(e["skill-watch-debounce-ms"]);if(!Number.isFinite(o)||o<=0)throw new Re("--skill-watch-debounce-ms must be a positive number");await $9(),await(n?.superviseChildren??Let)([{name:"threads",run:({signal:s})=>{let u={client:n?.client,...n?.adapters!==void 0?{adapters:n.adapters}:n?.adapter!==void 0?{adapter:n.adapter}:{},recorder:n?.recorder};return(n?.runUploadWatch??t5)({uploadOptions:u,signal:s,lockBusyRetryIntervalMs:enn})}},{name:"skills",markRunning:"manual",run:async({signal:s,markReady:u})=>{let{client:l,who:f}=await tnn({signal:s,getAccessToken:n?.getAccessToken??jt,injectedClient:n?.client,retryDelayMs:n?.authRetryDelayMs??Xtn}),h=f.body.organizations.map(v=>v.id),_=f.body.user.id,{lastEventId:E}=await ii(),T=(n?.createEventStream??H9)({userId:_,organizationIds:h,getAccessToken:n?.getAccessToken??jt,reconnect:!0,signal:s,...E?{lastEventId:E}:{}});await u(),await(n?.runSkillSyncDaemon??j9)({client:l,events:T,pollIntervalMs:r,watch:!0,watchDebounceMs:o,signal:s,onSyncPass:({reason:v,event:R,result:x})=>{let k=R?` from ${R.type}${R.id?`#${R.id}`:""}`:"";console.log(`skill sync ${v}${k}: ${x.publishedLocalPushed} published local update${x.publishedLocalPushed===1?"":"s"} uploaded, ${x.installedUpdated} updated, ${x.localEditsUploaded} local edit${x.localEditsUploaded===1?"":"s"} uploaded, ${x.conflicts} conflict${x.conflicts===1?"":"s"}`)}})}}],n?.supervisorOptions)}};async function tnn(e){for(;!e.signal.aborted;){let t=await e.getAccessToken();if(!t){await Uet(e.retryDelayMs,e.signal);continue}let n=e.injectedClient??Ct({token:t}),r=await n.whoAmI({headers:{}});if(r.status===200)return{client:n,who:r};await Uet(e.retryDelayMs,e.signal)}throw new Error("daemon auth wait aborted")}function Uet(e,t){return t.aborted?Promise.resolve():new Promise(n=>{let r=setTimeout(n,e);r.unref?.(),t.addEventListener("abort",()=>{clearTimeout(r),n()},{once:!0})})}qP();sc();zt();Sn();A();c$();var nnn=()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||!!e.CI},Fet="\x1B",n5=(e,t,n)=>r=>n?r:`${Fet}[${e}m${r}${Fet}[${t}m`,rnn=e=>({cyan:n5(36,39,e),gray:n5(90,39,e),bold:n5(1,22,e),underline:n5(4,24,e)});async function Lfe(e,t={}){let n=t.noColor??nnn(),{cyan:r,gray:o,bold:i,underline:s}=rnn(n),u=await za(e.meta),l=u?.name??"lore",f=u?.description??"",h=await za(e.subCommands),_=[];for(let[R,x]of Object.entries(h??{})){let k=await za(x),P=await za(k.meta);P?.hidden||_.push({name:R,description:P?.description??"",subDef:k})}let E=[];for(let R of _){E.push([r(R.name),R.description]);let x=await za(R.subDef.subCommands);if(x)for(let[k,P]of Object.entries(x)){let j=await za(P),G=await za(j.meta);G?.hidden||E.push([` ${r(k)}`,G?.description??""])}}let T=E.reduce((R,[x])=>Math.max(R,x.length),0),v=[];v.push(o(`${f} (${l})`),""),v.push(`${s(i("USAGE"))} ${r(`${l} ${_.map(R=>R.name).join("|")}`)}`,""),v.push(s(i("COMMANDS")),"");for(let[R,x]of E)v.push(` ${R.padEnd(T)} ${x}`);return v.push("",`Use ${r(`${l} <command> --help`)} for more information about a command.`),v.join(`
|
|
657
657
|
`)}A();c$();async function Get(e,t){let n=t.filter(i=>!i.startsWith("-")),r=e,o;for(let i of n){let s=await za(r.subCommands);if(!s||!(i in s))break;let u=await za(s[i]);if(!u)break;o=r,r=u}return[r,o]}A();import onn from"node:os";zt();Sn();Du();QD();function inn(e){return[...e.include.cwd.map(t=>({kind:"cwd",value:t,workspace:"user-scoped"})),...e.include.repo.map(t=>({kind:"repo",value:t,workspace:"user-scoped"}))].sort((t,n)=>t.kind!==n.kind?t.kind.localeCompare(n.kind):t.value.localeCompare(n.value))}async function r5(){return await Ih(),xi()}function Ufe(e){let t=Hi(e);if(!t)throw new Re("path must not be empty");return t}async function jet(){let e=await r5();return inn(e)}function zet(e){return e.length>0}function snn(e){let t=Math.max(4,...e.map(o=>o.kind.length)),n=Math.max(8,...e.map(o=>o.value.length));console.log(`${"TYPE".padEnd(t)} ${"LOCATION".padEnd(n)} WORKSPACE`);for(let o of e)console.log(`${o.kind.padEnd(t)} ${o.value.padEnd(n)} ${o.workspace}`);let r=e.find(o=>o.kind==="cwd"&&o.value===onn.homedir());r&&console.log(`Warning: ${r.value} is your entire home directory. Narrow capture scope with \`lore listen delete ${r.value}\` and \`lore listen create <project-path>\`.`)}var ann={meta:{name:"create",description:"Allowlist a directory for daemon auto-uploads."},args:{path:{type:"positional",description:"Directory path to upload from (supports ~ and relative paths).",required:!0}},async run({args:e}){z.info("command_start",{command:"listen create"});let t=await r5(),n=Ufe(String(e.path));await Ad({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),console.log(`uploading from ${n}`)}},unn={meta:{name:"list",description:"Print the directories Lore is allowed to auto-upload from."},args:{json:{type:"boolean",description:"Output as JSON."}},async run({args:e}){z.info("command_start",{command:"listen list"});let t=await jet();if(e.json){console.log(JSON.stringify({version:1,locations:t},null,2));return}if(!zet(t)){console.log("no upload locations yet \u2014 run `lore configure` for the guided setup, or `lore listen create <path>` to add a directory directly.");return}snn(t)}},cnn={meta:{name:"delete",description:"Stop auto-uploading sessions from a directory."},args:{path:{type:"positional",description:"Directory path to stop uploading from.",required:!0}},async run({args:e}){z.info("command_start",{command:"listen delete"});let t=await r5(),n=Ufe(String(e.path)),r=t.include.cwd.filter(o=>o!==n);if(r.length===t.include.cwd.length)throw new Re(`no upload directory at ${n}`);await Ad({...t,include:{...t.include,cwd:r}}),console.log(`stopped uploading from ${n}`)}},lnn={meta:{name:"update",description:"Deprecated. Use delete/create to change the cwd allowlist."},args:{path:{type:"positional",description:"Directory path to update.",required:!0}},async run({args:e}){z.info("command_start",{command:"listen update"});let t=Ufe(String(e.path));throw(await r5()).include.cwd.includes(t)?new Re("`lore listen update` is no longer supported because upload filters only store cwd allowlist entries. Use `lore listen delete <path>` and `lore listen create <path>` to change the cwd allowlist."):new Re(`no upload directory at ${t}`)}},Het={meta:{name:"listen",description:"Manage the directories Lore is allowed to auto-upload from."},subCommands:{create:ann,list:unn,update:lnn,delete:cnn},async run({rawArgs:e}){let t=new Set(["create","list","update","delete"]);if(e.some(r=>t.has(r)))return;z.info("command_start",{command:"listen"});let n=await jet();if(console.log(`lore listen \u2014 locations Lore is allowed to auto-upload from
|
|
658
|
-
`),!zet(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> start uploading from a directory"),console.log(" lore listen list [--json] print the upload list"),console.log(" lore listen delete <path> stop uploading from a directory"),console.log(""),console.log(" Example: lore listen create ~/code/projectA")}};A();QD();A();zt();go();Du();Th();import dnn from"node:fs/promises";async function pnn(e){try{return await dnn.access(e),!0}catch(t){if(Lr(t,"ENOENT"))return!1;throw t}}async function fnn({uploadFilterPath:e=LT()}={}){if(!await pnn(e))return;let t=await xi(e),n=[],r=[];for(let o of t.include.cwd){let i=await Ey(o);i?n.push(i):r.push(o)}n.length===0&&r.length===t.include.cwd.length||await Ad({...t,include:{...t.include,cwd:r.sort(),repo:Array.from(new Set([...t.include.repo,...n])).sort()}},e)}var $et={id:"20260519000000-upload-filter-cwds-to-repos",run:fnn};var mnn=[gYe,$et];async function Ann(e=mnn,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 qet={meta:{name:"postinstall:migrate",hidden:!0,skipAutoupdate:!0},async run(){await Ann()}};Bse();$P();A();yr();sc();Sn();jle();import{platform as gnn,release as hnn}from"node:os";function _nn(e){return e.find(n=>!n.startsWith("-"))??"lore"}async function Vet(e){try{let t={command:_nn(e.rawArgs),rawArgs:[...e.rawArgs],cliVersion:hu(),nodeVersion:process.version,platform:gnn(),release:hnn()};(await TYe({error:e.error,context:t,logger:z,send:async r=>{let i=await Ct().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"&&z.info("error_report_sent")}catch(t){z.warn("error_report_unexpected_failure",{error:t instanceof Error?t.message:String(t)})}}A();import{setTimeout as Yet}from"node:timers/promises";yr();zt();var Enn=3e4,o5={meta:{name:"_run_skill_sync",description:"Run the workspace skill sync daemon.",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously with filesystem watchers, SSE, and fallback polling.",default:!1},"poll-interval-ms":{type:"string",description:"Fallback full-sync poll interval in milliseconds.",default:"1800000"},"watch-debounce-ms":{type:"string",description:"Filesystem watcher debounce interval in milliseconds.",default:"2000"}},async run({args:e,data:t}){let n=t,r=n?.getAccessToken??jt,o=!!e.watch,{client:i,who:s}=await ynn({watch:o,getAccessToken:r,injectedClient:n?.client,retryDelayMs:n?.authRetryDelayMs??Enn}),u=s.body.organizations.map(T=>T.id),l=s.body.user.id,{lastEventId:f}=await ii(),h=(n?.createEventStream??H9)({userId:l,organizationIds:u,getAccessToken:r,reconnect:!0,...f?{lastEventId:f}:{}}),_=Number(e["poll-interval-ms"]);if(!Number.isFinite(_)||_<=0)throw new Re("--poll-interval-ms must be a positive number");let E=Number(e["watch-debounce-ms"]);if(!Number.isFinite(E)||E<=0)throw new Re("--watch-debounce-ms must be a positive number");await(n?.runSkillSyncDaemon??j9)({client:i,events:h,pollIntervalMs:_,watch:o,watchDebounceMs:E,onSyncPass:({reason:T,result:v})=>{console.log(`skill sync ${T}: ${v.publishedLocalPushed} published local update${v.publishedLocalPushed===1?"":"s"} uploaded, ${v.installedUpdated} updated, ${v.localEditsUploaded} local edit${v.localEditsUploaded===1?"":"s"} uploaded, ${v.conflicts} conflict${v.conflicts===1?"":"s"}`)}})}};async function ynn(e){for(;;){let t=await e.getAccessToken();if(!t){if(!e.watch)throw new Re("workspace skill sync daemon requires login \u2014 run 'lore login' first");await Yet(e.retryDelayMs);continue}let n=e.injectedClient??Ct({token:t}),r=await n.whoAmI({headers:{}});if(r.status===200)return{client:n,who:r};if(!e.watch)throw new Re(`whoAmI returned ${r.status}`);await Yet(e.retryDelayMs)}}A();A();yr();zt();var Ket={meta:{name:"approve",description:"Approve a proposed skill version and make it the latest accepted version."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."},version:{type:"string",required:!0,description:"Proposed version timestamp to approve"}},async run({args:e}){if(!await jt())throw new Re("skill approval requires login \u2014 run 'lore login' first");await Snn(Ct(),{id:e.id,version:e.version})}};async function Snn(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new Re("--version must be a positive integer timestamp");let r=await e.approveSkillVersion({params:{id:t.id,version:n},body:{}});if(r.status!==200){let o=r.body?.message??`approveSkillVersion returned ${r.status}`;throw new Re(o)}console.log(`approved /${r.body.name} v${r.body.version} (${r.body.id})`)}A();import Tnn from"node:fs/promises";import Jet from"node:path";yr();zt();Sn();var Zet={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 ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("install needs a skill ID \u2014 e.g. `lore skills install sk_01j...`");if(!await jt())throw new Re("workspace skill installs require login \u2014 run 'lore login' first");let n=Ct();await bnn(n,t)}};async function bnn(e,t){z.info("skill_install_started",{skill_id:t});try{let n=await Inn(e,t);z.info("skill_install_registered",{skill_id:n.body.skill.id,installation_id:n.body.installation_id,already_registered:n.body.already_registered,name:n.body.skill.name,root_kind:n.body.skill.root_kind,latest_version:n.body.skill.latest_version});let r={skillId:n.body.skill.id,installationId:n.body.installation_id,name:n.body.skill.name,rootKind:n.body.skill.root_kind,latestVersion:n.body.skill.latest_version,contentHash:n.body.skill.content_hash,bodyMd:await vnn(n.body.body_md_url,n.body.skill.content_hash)};if(!FM(r.name))throw new Re(`refusing to install skill with invalid name: ${JSON.stringify(r.name)}`);let o=L9(r.rootKind),i=GM(o,r.name),s=await Rnn(i),u=await JD(r.skillId),l=u?.installPath!=null&&Jet.resolve(u.installPath)===Jet.resolve(i);if(s!==null&&!l)throw z.warn("skill_install_refused_unmanaged_target",{skill_id:r.skillId,name:r.name,root_kind:o,install_path:i}),new Re(`refusing to overwrite ${i}; it already exists and is not managed by Lore`);let f=await U9(o,r.name,r.bodyMd),h=r.latestVersion,_={installationId:r.installationId,skillId:r.skillId,name:r.name,rootKind:o,installPath:f,baseVersion:h,baseContentHash:r.contentHash,lastInstalledVersion:h,lastInstalledHash:r.contentHash,lastSyncStatus:"current"};await ll(_);try{await Cnn(e,r.installationId,h)}catch(E){throw await ll({..._,lastSyncStatus:"error"}),z.warn("skill_install_failed",{skill_id:r.skillId,installation_id:r.installationId,phase:"update_installed_version",error:Gt(E)}),E}z.info("skill_install_written",{skill_id:r.skillId,installation_id:r.installationId,name:r.name,root_kind:o,install_path:f,latest_version:h,already_up_to_date:s===r.bodyMd}),s===r.bodyMd?console.log(`/${r.name} is already up to date at ${f}`):console.log(`installed /${r.name} (${r.skillId}) -> ${f}`)}catch(n){throw z.warn("skill_install_failed",{skill_id:t,phase:"install",error:Gt(n)}),n}}async function Inn(e,t){let n=await e.installSkill({params:{id:t},body:{}});if(n.status!==200){let r=n.body?.message??`installSkill returned ${n.status}`;throw new Re(r)}return n}async function Cnn(e,t,n){let r=await e.updateSkillInstallation({params:{id:t},body:{installed_version:n}});if(r.status!==200){let o=r.body?.message??`updateSkillInstallation returned ${r.status}`;throw new Re(`installed ${t} locally, but failed to record installed version: ${o}`)}}async function vnn(e,t){let n=new URL(e,al()),r=await jt(),o=await fetch(n,{headers:{...r?{authorization:`Bearer ${r}`}:{}}});if(!o.ok)throw new Re(`failed to download SKILL.md from ${e}: HTTP ${o.status}`);let i=await o.text();if(gd(i)!==t)throw new Re("downloaded SKILL.md hash did not match the skill metadata");return i}async function Rnn(e){try{return await Tnn.readFile(e,"utf8")}catch{return null}}A();yr();zt();function xnn(e){return JSON.stringify(e,null,2)}var Wet={meta:{name:"list",description:"List skills available in your workspace."},async run({data:e}){let t=e;if(!await(t?.getAccessToken??jt)())throw new Re("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Ct()).listSkills({});if(o.status!==200){let i=o.body?.message??`listSkills returned ${o.status}`;throw new Re(i)}console.log(xnn(o.body))}};A();yr();zt();var Xet={meta:{name:"proposals",description:"List proposed versions awaiting owner review for a skill."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."}},async run({args:e}){if(!await jt())throw new Re("skill proposals require login \u2014 run 'lore login' first");await Dnn(Ct(),e.id)}};async function Dnn(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status!==200){let o=n.body?.message??`getSkillDetail returned ${n.status}`;throw new Re(o)}let r=n.body.versions.filter(o=>o.status==="proposed");if(r.length===0){console.log(`no proposed versions for ${t}`);return}for(let o of r){let i=o.created_by?`${o.created_by.display_name} (${o.created_by.id})`:"unknown";console.log(`${n.body.id} /${n.body.name} version=${o.version} proposer=${i} created_at=${o.created_at}`)}}A();import{readFile as Nnn}from"node:fs/promises";import i5 from"node:path";yr();zt();Sn();var ttt={meta:{name:"publish",description:"Publish a local skill to your workspace, or upload local edits for an already-published skill."},args:{target:{type:"positional",required:!0,description:"Local skill name/path or workspace published sk_* ID"}},async run({args:e}){if(!await jt())throw new Re("not logged in \u2014 run 'lore login' first");let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("pass a skill name, path, or sk_* ID to publish");let n=await wnn(Ct(),t);Unn(n)}};async function wnn(e,t){let n=t.trim();if(!n)throw new Re("pass a skill name, path, or sk_* ID to publish");let r=n.startsWith("sk_")?"skill_id":"local_name_or_path";z.info("skill_publish_started",{target_kind:r,target:n});try{if(n.startsWith("sk_"))return await ntt(e,n);let o=await lJe(),i=Bnn(n,o),s=await $Xe(n)??await qXe(n,process.cwd(),i);if(!s)throw new Re(`no SKILL.md found for ${n}`);return await knn(e,s)}catch(o){throw z.warn("skill_publish_failed",{target_kind:r,target:n,phase:"publish",error:Gt(o)}),o}}function Bnn(e,t){let n=i5.resolve(e);for(let r of t){if(ett(d1(r),n))return"claude_project";if(ett(p1(r),n))return"agents_project"}}function ett(e,t){let n=i5.relative(i5.resolve(e),t);return n!==""&&!n.startsWith("..")&&!i5.isAbsolute(n)}async function knn(e,t){let n=gd(t.bodyMd),r=await cJe(t);if(z.info("skill_publish_local_resolved",{name:t.name,file_path:t.filePath,root_kind:t.rootKind,published_local_skill_id:r,published_local_skill_id_present:!!r}),!r){let i=await ZD(e,t,{syncAction:"initial_publish"});return await WD(t,{skillId:i.skill_id,version:i.version}),z.info("skill_publish_initial_uploaded",{name:t.name,file_path:t.filePath,skill_id:i.skill_id,version:i.version,root_kind:i.root_kind}),{kind:"uploaded",skillId:i.skill_id,version:i.version,versionStatus:i.version_status==="proposed"?"proposed":"accepted"}}let o=await Onn(r)===n?await ntt(e,r):await Pnn(e,r,t);return o.kind!=="conflict"&&o.kind!=="remote_newer"&&await WD(t,{skillId:r,version:o.version}),o}async function Onn(e){return(await ii()).publishedLocal[e]?.lastPublishedHash??null}async function ntt(e,t){let n=await e.getSkillDetail({params:{id:t},query:{include_unpublished:!0}});if(n.status===200&&n.body.visibility==="workspace")return rtt(e,t,n.body);throw ott("load workspace skill before publishing local edits",n.status,n.body)}async function Pnn(e,t,n){let r=await e.getSkillDetail({params:{id:t},query:{include_unpublished:!0}});if(r.status!==200)throw ott("load skill before publishing local edits",r.status,r.body);return rtt(e,t,r.body,n)}async function rtt(e,t,n,r){let o=await ii(),i=o.installed[t]??null,s=o.publishedLocal[t]??null,u=i?.installPath??r?.filePath??s?.filePath,l=i?.rootKind??r?.rootKind??s?.rootKind??n.root_kind,f=i?.name??r?.name??s?.name??n.name;if(!u)throw new Re(`no managed local SKILL.md found for ${t}; install it or publish it from this machine first`);let h=await Nnn(u,"utf8"),_=gd(h),E=n.latest_version??0,T=n.content_hash??"",v=Mnn(i,s);if(_===T)return z.info("skill_publish_noop",{skill_id:t,version:E,reason:"local_matches_remote"}),{kind:"unchanged",skillId:t,version:E};if(v.version>0&&E>v.version)return _===v.hash?(z.info("skill_publish_noop",{skill_id:t,version:E,reason:"remote_newer_local_unchanged",local_version:v.version}),{kind:"remote_newer",skillId:t,localVersion:v.version,remoteVersion:E}):(i&&await ll({...i,lastSyncStatus:"conflict"}),z.warn("skill_publish_conflict",{skill_id:t,local_version:v.version,remote_version:E,name:f,file_path:u}),{kind:"conflict",skillId:t,localVersion:v.version,remoteVersion:E});if(_===v.hash)return z.info("skill_publish_noop",{skill_id:t,version:E,reason:"local_matches_base"}),{kind:"unchanged",skillId:t,version:E};let R=await Lnn(e),x=n.owner?.id&&n.owner.id===R?"owner_update":"subscriber_update",k=await ZD(e,{skillId:t,name:f,description:null,bodyMd:h,filePath:u,rootKind:l},{syncAction:x,...v.version>0?{baseVersion:v.version}:{}});return i&&await ll({...i,...k.version_status==="accepted"?{baseVersion:k.version,baseContentHash:k.content_hash,lastSyncStatus:"current"}:{lastSyncStatus:"proposed"},lastInstalledVersion:k.version,lastInstalledHash:k.content_hash}),await WD({name:f,bodyMd:h,filePath:u,rootKind:l},{skillId:k.skill_id,version:k.version}),z.info("skill_publish_update_uploaded",{skill_id:k.skill_id,name:f,file_path:u,sync_action:x,version:k.version,version_status:k.version_status}),{kind:"uploaded",skillId:k.skill_id,version:k.version,versionStatus:k.version_status==="proposed"?"proposed":"accepted"}}function Mnn(e,t){return e?{hash:e.baseContentHash,version:e.baseVersion}:t?{hash:t.lastPublishedHash,version:t.lastPublishedVersion}:{hash:"",version:0}}async function Lnn(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}function ott(e,t,n){let r=n?.message??`${e} returned ${t}`;return new Re(r)}function Unn(e){switch(e.kind){case"uploaded":console.log(`${e.versionStatus} ${e.skillId} (v${e.version})`);break;case"unchanged":console.log(`already up to date ${e.skillId} (v${e.version})`);break;case"remote_newer":console.log(`remote newer ${e.skillId}: local base is v${e.localVersion}, remote is v${e.remoteVersion}; run lore skills sync`);break;case"conflict":console.log(`conflict ${e.skillId}: remote advanced from v${e.localVersion} to v${e.remoteVersion}; run lore skills sync`);break}}A();yr();zt();var itt={meta:{name:"reject",description:"Reject a proposed skill version without changing the latest accepted version."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."},version:{type:"string",required:!0,description:"Proposed version timestamp to reject"},reason:{type:"string",required:!1,description:"Optional rejection reason shown with the reviewed version"}},async run({args:e}){if(!await jt())throw new Re("skill rejection requires login \u2014 run 'lore login' first");await Qnn(Ct(),{id:e.id,version:e.version,reason:e.reason})}};async function Qnn(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new Re("--version must be a positive integer timestamp");let r=t.reason?.trim(),o=await e.rejectSkillVersion({params:{id:t.id,version:n},body:r?{reason:r}:{}});if(o.status!==200){let i=o.body?.message??`rejectSkillVersion returned ${o.status}`;throw new Re(i)}console.log(`rejected /${o.body.name} v${o.body.version} (${o.body.id})`)}A();wO();import Qfe from"node:fs/promises";import stt from"node:os";import Di from"node:path";var att={meta:{name:"scan",description:"List local skills found by Lore's scanner."},async run(){await Ynn()}};function utt(e){let t=Di.resolve(e),n=Di.resolve(stt.homedir()),r=Di.relative(n,t);return r===""?"~":!r.startsWith("..")&&!Di.isAbsolute(r)?Di.join("~",r):t}function Fnn(e){return utt(Di.dirname(Di.dirname(e)))}function Gnn(e){return Di.basename(Di.dirname(e))}function jnn(e,t){let n=Di.resolve(e);for(let r of t){let o=Di.resolve(r),i=Di.relative(o,n);if(i!==""&&!i.startsWith("..")&&!Di.isAbsolute(i))return o}return null}function znn(e,t,n){return e==="claude_project"?t.map(r=>Di.join(d1(r),n)):e==="agents_project"?t.map(r=>Di.join(p1(r),n)):[]}function Hnn(){return Di.join(stt.homedir(),"Library","Application Support","Claude","local-agent-mode-sessions","skills-plugin")}async function $nn(e){let t=[];async function n(r){let o;try{o=await Qfe.readdir(r,{withFileTypes:!0})}catch{return}for(let i of o){let s=Di.join(r,i.name);i.isDirectory()?await n(s):i.isFile()&&i.name==="manifest.json"&&t.push(s)}}return await n(e),t.sort((r,o)=>r.localeCompare(o))}function s5(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function qnn(e){let t;try{t=JSON.parse(e)}catch{return[]}if(!t||typeof t!="object"||Array.isArray(t))return[];let n=t.skills;if(!Array.isArray(n))return[];let r=[];for(let o of n){if(!o||typeof o!="object"||Array.isArray(o))continue;let i=o,s=s5(i.skillId),u=s5(i.name);!s||!u||r.push({skillId:s,name:u,description:s5(i.description),creatorType:s5(i.creatorType)})}return r}async function Vnn(){let e={};for(let t of await $nn(Hnn())){let n;try{n=await Qfe.readFile(t,"utf8")}catch{continue}let r=Di.join(Di.dirname(t),"skills"),o=utt(r);for(let i of qnn(n)){if(i.creatorType==="anthropic")continue;let s=Di.join(r,i.name,"SKILL.md");try{await Qfe.access(s)}catch{continue}e[o]??=[],e[o].push({skill_id:i.skillId,name:i.name,description:i.description,file_path:s,manifest_path:t})}}for(let t of Object.values(e))t.sort((n,r)=>n.name.localeCompare(r.name)||n.file_path.localeCompare(r.file_path));return e}async function Ynn(){let e=await xde(),t=await ii(),n=e.map(l=>l.root),r=new Map(e.map(l=>[Di.resolve(l.root),l])),o=await KXe({projectCwds:n,includeCwdProject:!1}),i={},s=new Set;for(let l of o){let f=Di.resolve(l.filePath);if(s.has(f))continue;s.add(f);let h=Fnn(l.filePath),_=jnn(l.filePath,n),E=_?r.get(_)?.alsoSeenAt??[]:[],T=N$(t,{filePath:l.filePath,rootKind:l.rootKind});i[h]??=[],i[h].push({name:l.name,description:l.description,root_kind:l.rootKind,file_path:l.filePath,also_seen_at:znn(l.rootKind,E,Gnn(l.filePath)),...T?{skill_id:T.skillId}:{},local_content_hash:gd(l.bodyMd)})}let u=cje.parse({type:"local_skill_scanner_output",skills:i,cowork_skills:await Vnn()});console.log(JSON.stringify(u,null,2))}A();yr();zt();var ctt={meta:{name:"status",description:"Show local Lore-managed skill sync state."},async run(){if(!await jt())throw new Re("skill status requires login \u2014 run 'lore login' first");await Knn()}};async function Knn(){let e=await ii();console.log(JSON.stringify(e))}A();yr();zt();var ltt={meta:{name:"sync",description:"Sync installed Lore-managed skills to their latest accepted versions."},async run(){if(!await jt())throw new Re("workspace skill sync requires login \u2014 run 'lore login' first");let e=await bfe(Ct());console.log(`skill sync complete: ${e.installedUpdated} updated, ${e.localEditsUploaded} local edit${e.localEditsUploaded===1?"":"s"} uploaded, ${e.conflicts} conflict${e.conflicts===1?"":"s"}`)}};A();import dtt from"node:fs/promises";import Jnn from"node:path";yr();zt();var ptt={meta:{name:"uninstall",description:"Remove a Lore-managed skill by stable skill ID."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("uninstall needs a skill ID \u2014 e.g. `lore skills uninstall sk_01j...`");if(!await jt())throw new Re("workspace skill uninstalls require login \u2014 run 'lore login' first");let n=Ct();await Znn(n,t)}};async function Znn(e,t){let n=await JD(t);n&&(await dtt.rm(n.installPath,{force:!0}),await dtt.rmdir(Jnn.dirname(n.installPath)).catch(()=>{}));let r=await e.uninstallSkill({params:{id:t},body:{}});if(r.status!==200){let o=r.body?.message??`uninstallSkill returned ${r.status}`;throw new Re(o)}if(await nJe(t),n){console.log(`uninstalled /${n.name} (${t}) from ${n.installPath}`);return}console.log(`uninstalled ${t}`)}A();yr();zt();var ftt={meta:{name:"unpublish",description:"Remove an owned published skill from your workspace catalog."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("unpublish needs a skill ID \u2014 e.g. `lore skills unpublish sk_01j...`");if(!await jt())throw new Re("skill unpublishes require login \u2014 run 'lore login' first");await Wnn(Ct(),t)}};async function Wnn(e,t){let n=await e.unpublishSkill({params:{id:t},body:{}});if(n.status!==200){let o=n.body?.message??`unpublishSkill returned ${n.status}`;throw new Re(o)}let r=await eJe(n.body.id);if(r){console.log(`unpublished /${r.name} (${n.body.id}); local file kept at ${r.filePath}`);return}console.log(`unpublished ${n.body.id}`)}A();zt();var mtt={meta:{name:"unsync",description:"Remove local skill sync state for a skill ID.",hidden:!0},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("unsync needs a skill ID \u2014 e.g. `lore skills unsync sk_01j...`");let n=await tJe(t);if(n.installed||n.publishedLocal){let r=[n.publishedLocal?"published local":null,n.installed?"installed":null].filter(Boolean);console.log(`removed ${r.join(" and ")} sync state for ${t}`);return}console.log(`no local sync state found for ${t}`)}};var Att={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:ttt,unpublish:ftt,install:Zet,uninstall:ptt,unsync:mtt,sync:ltt,daemon:o5,approve:Ket,reject:itt,proposals:Xet,status:ctt,list:Wet,scan:att}};iy();A();await ho();var m5=ue(dn(),1);sc();await fb();A();await ho();var d5=ue(dn(),1);await RA();A();await ho();var m1=ue(dn(),1);Ps();var hd=ue(Ht(),1);function A1({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[s,u]=(0,m1.useState)(gtt(e,n)),l=(0,m1.useRef)(s);return(0,m1.useEffect)(()=>{let f=gtt(e,n);l.current=f,u(f)},[e,n]),Ru((f,h)=>{if(e.length!==0){if(h.upArrow||f==="k"){let _=Xnn(e,l.current);l.current=_,u(_);return}if(h.downArrow||f==="j"){let _=htt(e,l.current);l.current=_,u(_);return}if(h.return||f===" "){let _=e[l.current];_&&!_.disabled&&t(_)}}},{isActive:!r}),e.length===0?(0,hd.jsx)(he,{color:xe.muted,children:"no actions available"}):(0,hd.jsxs)(Ee,{flexDirection:"column",children:[e.map((f,h)=>{let _=h===s,E=f.disabled?xe.muted:_?xe.primary:xe.highlight;return(0,hd.jsxs)(Ee,{children:[(0,hd.jsx)(Ee,{width:2,flexShrink:0,children:(0,hd.jsx)(he,{color:_?xe.primary:xe.muted,children:_?"\u203A":" "})}),(0,hd.jsx)(Ee,{width:i,flexShrink:0,children:(0,hd.jsx)(he,{color:E,bold:_&&!f.disabled,children:f.label})}),f.description?(0,hd.jsx)(Ee,{flexGrow:1,flexShrink:1,children:(0,hd.jsx)(he,{color:xe.muted,children:f.description})}):null]},f.id)}),o?(0,hd.jsx)(Ee,{marginTop:1,children:(0,hd.jsx)(he,{color:xe.muted,children:o})}):null]})}function gtt(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?htt(e,n-1):n}function htt(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 Xnn(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 xA();await gb();await hb();Ps();A();yr();Du();QD();$D();async function a5(e){if(!await(e.hasAccessToken??(async()=>!!await jt()))())return{state:"logged_out"};let n=e.client??Ct();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:_tt(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 u5(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??f$;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function c5(e){if(!await(e.hasAccessToken??(async()=>!!await jt()))())return{state:"logged_out"};let n=e.client??Ct();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:_tt(r.body,`listSkills returned ${r.status}`)};let o=r.body.objects.length,i=r.body.objects.filter(s=>s.visibility==="workspace").length;return{state:"ready",count:o,published:i}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function l5(){try{await Ih();let e=await xi();return ern(e)}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function ern(e){return{state:"ready",cwd:e.include.cwd,repo:e.include.repo}}function _tt(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 Bt=ue(Ht(),1);function Gy({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=Os(),[i,s]=(0,d5.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,d5.useEffect)(()=>{if(t)return;let l=!1;return(async()=>{let[f,h,_,E]=await Promise.all([a5(n),u5(n),c5(n),l5()]);l||s({identity:f,daemon:h,skills:_,uploadDirs:E})})(),()=>{l=!0}},[]),Ru((l,f)=>{(l==="q"||f.ctrl&&l==="c"||f.escape)&&(r("quit"),o())});let u=srn(i);return(0,Bt.jsxs)(Ee,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,Bt.jsx)(Ms,{title:"lore",subtitle:nrn(i.identity),right:`v${e}`}),(0,Bt.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,Bt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Qn,{title:"Daemon",children:(0,Bt.jsx)(rrn,{daemon:i.daemon})})}),(0,Bt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Qn,{title:"Workspace",children:(0,Bt.jsx)(orn,{identity:i.identity,skills:i.skills})})})]}),(0,Bt.jsx)(Ee,{marginTop:1,children:(0,Bt.jsx)(Qn,{title:"Upload filters",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.cwd.length+i.uploadDirs.repo.length} configured`:void 0,children:(0,Bt.jsx)(trn,{uploadDirs:i.uploadDirs})})}),(0,Bt.jsx)(Ee,{marginTop:1,children:(0,Bt.jsx)(Qn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Bt.jsx)(A1,{items:u,onSelect:l=>{r(l.id),o()}})})})]})}function trn({uploadDirs:e}){return e.state==="loading"?(0,Bt.jsx)(Ha,{label:"reading ~/.lore/upload_filters.json\u2026"}):e.state==="error"?(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(he,{color:xe.danger,children:e.message})]}):e.cwd.length===0&&e.repo.length===0?(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,Bt.jsx)(Ee,{marginTop:1,children:(0,Bt.jsxs)(he,{color:xe.muted,children:["Run ",(0,Bt.jsx)(he,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[e.cwd.map(t=>(0,Bt.jsx)(en,{label:"cwd",value:t,kind:"success",labelWidth:16},`cwd:${t}`)),e.repo.map(t=>(0,Bt.jsx)(en,{label:"repo",value:t,kind:"success",labelWidth:16},`repo:${t}`))]})}function nrn(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 rrn({daemon:e}){if(e.state==="loading")return(0,Bt.jsx)(Ha,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(he,{color:xe.muted,children:"Background uploads are macOS-only today."}),(0,Bt.jsxs)(he,{color:xe.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(he,{color:xe.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:t.health,kind:n}),(0,Bt.jsx)(en,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,Bt.jsx)(en,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,Bt.jsx)(en,{label:"Heartbeat",value:Ett(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,Bt.jsx)(en,{label:"Last upload",value:Ett(t.status?.last_success_at)}),t.status?.last_error?(0,Bt.jsx)(en,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function orn({identity:e,skills:t}){return e.state==="loading"?(0,Bt.jsx)(Ha,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"signed out",kind:"warning"}),(0,Bt.jsx)(he,{color:xe.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(he,{color:xe.danger,children:e.message})]}):(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"User",value:e.email,kind:"success"}),(0,Bt.jsx)(en,{label:"Display name",value:e.displayName}),(0,Bt.jsx)(en,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,Bt.jsx)(en,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,Bt.jsx)(en,{label:"Skills",value:irn(t)})]})}function irn(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 srn(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 Ett(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 ho();await RA();await xA();Ps();var ai=ue(Ht(),1),arn=[{id:"login",label:"Sign in to Lore",description:"opens your browser for a device-code flow"},{id:"quit",label:"Quit",description:"exit without signing in"}];function p5({cliVersion:e,onSelect:t}){let{exit:n}=Os();return Ru((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,ai.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,ai.jsx)(Ms,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,ai.jsx)(Qn,{title:"What is Lore?",children:(0,ai.jsxs)(Ee,{flexDirection:"column",children:[(0,ai.jsx)(he,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,ai.jsxs)(Ee,{marginTop:1,flexDirection:"column",children:[(0,ai.jsx)(he,{color:xe.muted,children:"You'll get:"}),(0,ai.jsxs)(he,{children:[(0,ai.jsx)(he,{color:xe.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,ai.jsxs)(he,{children:[(0,ai.jsx)(he,{color:xe.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,ai.jsxs)(he,{children:[(0,ai.jsx)(he,{color:xe.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,ai.jsxs)(he,{children:[(0,ai.jsx)(he,{color:xe.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,ai.jsx)(Ee,{marginTop:1,children:(0,ai.jsx)(Qn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,ai.jsx)(A1,{items:arn,onSelect:r=>{t(r.id),n()}})})}),(0,ai.jsx)(Ee,{marginTop:1,children:(0,ai.jsxs)(he,{color:xe.muted,children:["New to Lore? Run ",(0,ai.jsx)(he,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var f5=ue(Ht(),1),urn={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 crn({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,m5.useState)(void 0),{exit:i}=Os();return(0,m5.useEffect)(()=>{let s=!1;return(async()=>{let[u,l,f,h]=await Promise.all([a5(t),u5(t),c5(t),l5()]);s||o({identity:u,daemon:l,skills:f,uploadDirs:h})})(),()=>{s=!0}},[]),r?r.identity.state==="logged_out"?(0,f5.jsx)(p5,{cliVersion:e,onSelect:s=>{n(s),i()}}):(0,f5.jsx)(Gy,{cliVersion:e,initialData:r,onSelect:n}):null}async function ytt(){let e="quit";return await cl((0,f5.jsx)(crn,{cliVersion:hu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:urn[e]}}A();await fb();A();await ho();var KM=ue(dn(),1);await RA();await xA();Ps();A();await ho();await tde();await RA();await Ab();await xA();await ode();A();await ho();Ps();var g1=ue(Ht(),1),lrn="\u2588",drn="\u2591";function Stt({value:e,width:t=24,label:n,color:r=xe.success}){let o=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=Math.round(o*t),s=Math.max(0,t-i);return(0,g1.jsxs)(Ee,{children:[(0,g1.jsx)(he,{color:r,children:lrn.repeat(i)}),(0,g1.jsx)(he,{color:xe.muted,children:drn.repeat(s)}),n?(0,g1.jsxs)(he,{color:xe.muted,children:[" ",n]}):null]})}await gb();await hb();await nde();await lde();await fde();A();await ho();await RA();await Ab();await xA();await gb();Ps();var _o=ue(Ht(),1),btt=[{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 HM(){return{steps:btt.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function A5(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?`${Ttt(n.key)} (${t.label})`:Ttt(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function Ttt(e){return btt.find(t=>t.key===e)?.label??e}function Nh({title:e,subtitle:t,state:n}){return(0,_o.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,_o.jsx)(Ms,{title:e,subtitle:t}),(0,_o.jsx)(Qn,{title:"Pipeline",children:(0,_o.jsx)(Ee,{flexDirection:"column",children:n.steps.map(r=>(0,_o.jsx)(prn,{step:r},r.key))})}),n.result?(0,_o.jsx)(Ee,{marginTop:1,flexDirection:"column",children:(0,_o.jsx)(Ls,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,_o.jsxs)(Ee,{flexDirection:"column",children:[(0,_o.jsx)(he,{children:n.result.url}),(0,_o.jsx)(Ee,{marginTop:1,children:(0,_o.jsxs)(he,{color:xe.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,_o.jsx)(Ee,{marginTop:1,children:(0,_o.jsx)(Ls,{kind:"error",title:"Failed",children:(0,_o.jsx)(he,{children:n.errorMessage})})}):null]})}function prn({step:e}){return e.status==="active"?(0,_o.jsxs)(Ee,{children:[(0,_o.jsx)(Ha,{}),(0,_o.jsx)(he,{children:" "}),(0,_o.jsx)(he,{color:xe.primary,children:e.label})]}):e.status==="done"?(0,_o.jsxs)(Ee,{children:[(0,_o.jsx)(he,{color:xe.success,children:"\u2713 "}),(0,_o.jsx)(he,{color:xe.muted,children:e.label})]}):(0,_o.jsxs)(Ee,{children:[(0,_o.jsx)(he,{color:xe.muted,children:"\u25CB "}),(0,_o.jsx)(he,{color:xe.muted,children:e.label})]})}Ps();A();var $M=Date.parse("2026-05-16T12:00:00.000Z");function qM(e){return new Date($M-e*6e4).toISOString()}var Kf={plist:"/Users/alex/Library/LaunchAgents/ai.tanagram.lore.plist",binary:"/Users/alex/.lore/bin/lore-background",logFile:"/Users/alex/.lore/cli.log.txt",status:"/Users/alex/.lore/status.json",installSource:"/opt/homebrew/bin/lore"},Itt=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:$M-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:$M-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:$M-180*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:$M-1560*6e4}],frn=["/Users/alex/code/tanagram-lore","/Users/alex/work/acme-integration"],h1={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:Kf.plist,binary_path:Kf.binary,status_path:Kf.status,daemon_status_path:"/Users/alex/.lore/daemon_status.json",install_source_path:Kf.installSource,subsystems:{threads:{name:"threads",healthy:!0,health:"running",heartbeat_fresh:!0},skills:{name:"skills",healthy:!0,health:"running",heartbeat_fresh:!0}},status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:qM(60),last_heartbeat_at:qM(1),last_success_at:qM(5),last_completed_at:qM(5),last_thread_ids:["thr_01hx_story"]}},Ctt={...h1,running:!1,healthy:!1,health:"stale",heartbeat_fresh:!1,subsystems:{threads:{name:"threads",healthy:!1,health:"stale",heartbeat_fresh:!1},skills:{name:"skills",healthy:!0,health:"running",heartbeat_fresh:!0}},status:{...h1.status,state:"error",last_heartbeat_at:qM(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},mrn={...h1,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,subsystems:{threads:{name:"threads",healthy:!1,health:"disabled",heartbeat_fresh:!1},skills:{name:"skills",healthy:!1,health:"disabled",heartbeat_fresh:!1}},status:void 0},Arn={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"},VM={identity:Arn,daemon:{state:"ready",report:h1},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",cwd:frn,repo:[]}},vtt={...VM,uploadDirs:{state:"ready",cwd:[],repo:[]}},Rtt={...VM,daemon:{state:"error",message:"launchctl print failed: service not found"}},xtt={...VM,daemon:{state:"unsupported",platform:"linux"}},Dtt={identity:{state:"logged_out"},daemon:{state:"ready",report:mrn},skills:{state:"logged_out"},uploadDirs:{state:"ready",cwd:[],repo:[]}},Ntt=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var yt=ue(Ht(),1),oo=()=>{};function jy(...e){return e.reduce(R$,XP())}function YM(...e){return e.reduce(A5,HM())}var MA=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,yt.jsx)(p5,{cliVersion:"0.1.0",onSelect:oo})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,yt.jsx)(wp,{state:XP()})},{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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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:Kf.plist,binaryPath:Kf.binary,logFile:Kf.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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wA,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:oo,onSkip:oo})},{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,yt.jsx)(wA,{state:{phase:"choose",suggestions:Itt,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:oo,onSkip:oo})},{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,yt.jsx)(wA,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:oo,onSkip:oo})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,yt.jsx)(wA,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:oo,onSkip:oo})},{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,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:oo,onSkip:oo})},{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,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:oo,onSkip:oo})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,yt.jsx)(wA,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:oo,onSkip:oo})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:VM,onSelect:oo})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:vtt,onSelect:oo})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:Rtt,onSelect:oo})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:xtt,onSelect:oo})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:Dtt,onSelect:oo})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:HM()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:YM({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,yt.jsx)(Nh,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:YM({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,yt.jsx)(Nh,{title:"lore share-codex",state:YM({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.link/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,yt.jsx)(Nh,{title:"lore share-cowork",state:YM({kind:"completed",url:"https://lore.link/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,yt.jsx)(Nh,{title:"lore export",state:YM({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,yt.jsx)(Ry,{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,yt.jsx)(Ry,{mode:"enable",state:{phase:"finished",result:{plistPath:Kf.plist,binaryPath:Kf.binary,logFile:Kf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,yt.jsx)(Ry,{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,yt.jsx)(Ry,{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,yt.jsx)(Ry,{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,yt.jsx)(rM,{report:h1})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,yt.jsx)(rM,{report:Ctt})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,yt.jsx)(Ms,{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,yt.jsx)(Qn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,yt.jsx)(he,{color:xe.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,yt.jsxs)(Qn,{title:"StatusLine",children:[(0,yt.jsx)(en,{label:"Healthy",value:"yes",kind:"success"}),(0,yt.jsx)(en,{label:"Warning",value:"needs attention",kind:"warning"}),(0,yt.jsx)(en,{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,yt.jsx)(Qn,{title:"ProgressBar",children:(0,yt.jsx)(Stt,{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,yt.jsxs)(Ee,{flexDirection:"column",children:[(0,yt.jsx)(Ls,{kind:"success",title:"Shared",children:(0,yt.jsx)(he,{children:"Copied the Lore URL to your clipboard."})}),(0,yt.jsx)(Ee,{marginTop:1,children:(0,yt.jsx)(Ls,{kind:"error",title:"Failed",children:(0,yt.jsx)(he,{color:xe.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,yt.jsx)(Qn,{title:"Spinner",children:(0,yt.jsx)(Ha,{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,yt.jsx)(Qn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,yt.jsx)(A1,{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:oo})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,yt.jsx)(Qn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,yt.jsx)(ZP,{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:oo,onAction:oo})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,yt.jsx)(Qn,{title:"TextInput",children:(0,yt.jsx)(T$,{initialValue:"~/code",onSubmit:oo,onCancel:oo})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,yt.jsx)(Qn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,yt.jsx)(b$,{initialValue:"/Users/alex/code",loadSuggestions:async()=>Ntt,onSubmit:oo,onCancel:oo})})}];function wtt(e){return MA.find(t=>t.id===e)}function _1(e){return e.path.slice(1).join(" / ")}var zr=ue(Ht(),1);function ktt({initialStoryId:e}){let t=Math.max(0,MA.findIndex(f=>f.id===e)),[n,r]=(0,KM.useState)(t),[o,i]=(0,KM.useState)("sidebar"),s=(0,KM.useRef)(o);s.current=o;let{exit:u}=Os();Ru((f,h)=>{if(h.ctrl&&f==="c"){u();return}if(s.current==="sidebar"&&f==="q"){u();return}if(h.escape){if(s.current==="preview"){s.current="sidebar",i("sidebar");return}u();return}if(s.current==="preview"&&h.tab&&h.shift){s.current="sidebar",i("sidebar");return}if(s.current==="sidebar"&&h.tab&&!h.shift){s.current="preview",i("preview");return}if(s.current==="sidebar"){if(h.upArrow||f==="k"){r(_=>Btt(_-1));return}(h.downArrow||f==="j")&&r(_=>Btt(_+1))}});let l=MA[n]??MA[0];return(0,zr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,zr.jsx)(Ms,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${MA.length}`}),(0,zr.jsx)(Ee,{marginBottom:1,children:(0,zr.jsx)(he,{color:xe.muted,children:"\u2191/\u2193 or j/k select stories \xB7 Tab focuses preview \xB7 Shift+Tab/Esc returns \xB7 q exits from sidebar"})}),(0,zr.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,zr.jsx)(Ee,{width:36,flexShrink:0,children:(0,zr.jsx)(Qn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,zr.jsx)(grn,{stories:MA,selectedIndex:n,focused:o==="sidebar"})})}),(0,zr.jsx)(Ee,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,zr.jsx)(Qn,{title:l.title,focused:o==="preview",subtitle:o==="preview"?`${_1(l)} \xB7 focused`:_1(l),children:(0,zr.jsxs)(Ee,{flexDirection:"column",children:[(0,zr.jsx)(he,{color:xe.muted,children:l.description}),o==="sidebar"?(0,zr.jsxs)(he,{color:xe.muted,children:["Press ",(0,zr.jsx)(he,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,zr.jsx)(Ee,{marginTop:1,children:l.render()})]})})})]})]})}function grn({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,s)=>{let u=i.path.slice(1),l=Srn(o,u);for(let f=l;f<u.length;f++)r.push((0,zr.jsx)(hrn,{label:u[f]??"",level:f,marginTop:yrn(u[f]??"",f,l),focused:n},`group:${u.slice(0,f+1).join("/")}`));r.push((0,zr.jsx)(_rn,{story:i,selected:s===t,focused:n},i.id)),o=u}),(0,zr.jsx)(Ee,{flexDirection:"column",children:r})}function hrn({label:e,level:t,marginTop:n,focused:r}){return(0,zr.jsx)(Ee,{marginLeft:Ott(t),marginTop:n,children:(0,zr.jsx)(he,{color:r?xe.primary:xe.muted,bold:r,wrap:"truncate-end",children:e})})}function _rn({story:e,selected:t,focused:n}){let r=n?t?xe.accent:xe.highlight:xe.muted;return(0,zr.jsxs)(Ee,{marginLeft:Ott(e.path.slice(1).length),children:[(0,zr.jsx)(he,{color:n&&t?xe.accent:xe.muted,children:t?"\u203A ":" "}),(0,zr.jsx)(he,{color:r,bold:n&&t,wrap:"truncate-end",children:Ern(e)})]})}function Ern(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function Ott(e){return Math.min(e,4)}function yrn(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Srn(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 Btt(e){let t=MA.length;return(e%t+t)%t}function Ptt({story:e}){let{exit:t}=Os();return Ru((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,zr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,zr.jsx)(Ms,{title:e.title,subtitle:_1(e),right:"Esc to exit"}),(0,zr.jsx)(Ee,{marginBottom:1,children:(0,zr.jsx)(he,{color:xe.muted,children:e.description})}),e.render()]})}var Ffe=ue(Ht(),1),Mtt={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){Trn();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=wtt(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 cl((0,Ffe.jsx)(Ptt,{story:n})).waitUntilExit();return}await cl((0,Ffe.jsx)(ktt,{})).waitUntilExit()}};function Trn(){for(let e of MA)console.log(`${e.id} ${_1(e)} ${e.title}`)}A();yr();Sn();var Ltt={meta:{name:"backfill-artifacts",description:"Upload artifact files (uploads/ and outputs/) for Cowork sessions already shared to Lore, so they show up in the Artifacts tab. Re-uploads bytes from this machine; only sessions that already have a Lore thread are touched."},args:{"dry-run":{type:"boolean",description:"List what would be uploaded without uploading anything."}},async run({args:e,data:t}){let n=!!e["dry-run"];z.info("command_start",{command:"backfill-artifacts",dry_run:n});let r=t?.client??Ct(),o=X9(),i=Qy(o);if(i.length===0){console.log(`No Cowork sessions found under ${o}`);return}let s=0,u=0,l=0,f=0;for(let h of i){let{artifactFiles:_,tempPaths:E}=await Bfe(h.localDir);try{if(_.length===0){f+=1;continue}if(n){console.log(`${h.sessionId}: ${_.length} artifact file(s) ready to upload`);continue}let T=await r.presignBackfillArtifacts({body:{harness:"cowork",harness_internal_id:h.sessionId,artifact_files:_.map(x=>({kind:x.kind,file_name:x.fileName,md5:x.md5,size_in_bytes:x.sizeInBytes,content_type:x.contentType}))}});if(T.status===404){l+=1;continue}if(T.status!==200){console.error(`${h.sessionId}: presign failed (${T.status})`);continue}let v=[];for(let x of T.body.artifact_files){let k=_.find(P=>P.kind===x.kind&&P.fileName===x.file_name);!k||!x.presigned_url||(await FKe(x.presigned_url,k.tempPath),v.push({kind:x.kind,file_name:x.file_name,storage_url:x.storage_url,md5:k.md5,size_in_bytes:k.sizeInBytes,content_type:k.contentType}))}if(v.length===0)continue;let R=await r.commitBackfillArtifacts({body:{harness:"cowork",harness_internal_id:h.sessionId,artifacts:v}});if(R.status!==200){console.error(`${h.sessionId}: commit failed (${R.status})`);continue}s+=R.body.created,u+=1,console.log(`${h.sessionId}: backfilled ${R.body.created} artifact(s)`)}finally{await Promise.all(E.map(T=>Ac(T)))}}if(n){console.log(`Dry run complete. ${f} session(s) had no artifact files.`);return}console.log(`Done. Backfilled ${s} artifact(s) across ${u} thread(s). Skipped ${l} not-yet-shared session(s) and ${f} with no artifact files.`)}};A();Sn();iy();A();await ho();var g5=ue(dn(),1);await fb();var Gfe=ue(Ht(),1);function brn({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,s]=(0,g5.useState)(HM),{exit:u}=Os();return(0,g5.useEffect)(()=>{let l=!1,f=h=>{l||s(_=>A5(_,h))};return(async()=>{try{let h=await n(f);if(l)return;r(h),setTimeout(()=>u(),100)}catch(h){if(f({kind:"error",message:h instanceof Error?h.message:String(h)}),l)return;o(h),setTimeout(()=>u(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{l=!0}},[]),(0,Gfe.jsx)(Nh,{title:e,subtitle:t,state:i})}async function E1(e){let t,n,r=!1;if(await cl((0,Gfe.jsx)(brn,{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();ex();yr();import Drn from"node:os";import Ftt from"node:path";A();import{spawn as Irn}from"node:child_process";import Crn from"node:os";async function Utt(e,t={}){let n=t.timeoutMs??2e3,r=vrn();for(let o of r)if(await Rrn(o,e,n))return!0;return!1}function vrn(){switch(Crn.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 Rrn(e,t,n){return new Promise(r=>{let o;try{o=Irn(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,s=l=>{i||(i=!0,r(l))},u=setTimeout(()=>{o.kill("SIGKILL"),s(!1)},n);o.on("error",()=>{clearTimeout(u),s(!1)}),o.on("close",l=>{clearTimeout(u),s(l===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}zt();Sn();$P();Th();A();var y1=()=>{};A();Sn();async function xrn(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw Bp(`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 h5(e,t,n){try{return await xrn(e,t,n)}catch(r){return z.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}A();zt();function Qtt(e){if(e instanceof Vx)return"billing_required";if(e instanceof eM)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof Re)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"}var Nrn=new Set(["private","workspace","public"]);function wrn(e){let t=(e??"").trim();if(!t)return"";if(!Nrn.has(t))throw new Re(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function jfe(e={}){let t=e.progress??y1,n=wrn(e.visibility),r=(e.project??process.cwd()).trim()||process.cwd(),o=(e.sessionId??"").trim(),i="resolving_session",s=null;try{t({kind:"step",step:"resolving_session"});let u=await _et({sessionId:o,project:r});i="auth",await Mrn();let l=e.client??Ct();i="collecting_local_file",s=await Brn(u),t({kind:"step",step:"uploading",label:s.filename}),i="uploading";let f=await krn(l,s);if(f.quarantined)return t({kind:"step",step:"done"}),{quarantined:!0,reason:f.reason,finding_count:f.findingCount,session_id:u.sessionId?.trim()??""};let{reused:h,thread:_}=f;z.info("export_upload_single_file_result",{filename:s.filename,reused:h,response:JSON.stringify(_)});let E=_?.id?.trim();if(!E)throw Wn().setContext("upload_single_file_response",{filename:s.filename,reused:h,response:_}),new Error(`upload session response missing thread id for ${s.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await YD(l,E);let T=_?.visibility?.trim()??"",v=T;n&&n!==T&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),v=await Orn(l,E,n));let R=Prn(E),x,k=e.highlight?.trim();if(k){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let j=await h5(l,E,k);j&&(R=j.url,x={query:k,matched:j.matched,start_block_id:j.start_block_id,end_block_id:j.end_block_id})}let P=await Utt(R);return t({kind:"completed",url:R,reused:h,visibility:v,clipboardCopied:P,sessionId:u.sessionId?.trim()??""}),t({kind:"step",step:"done"}),Ch("lore.cli.thread_exported",{thread_id:E,harness:s.harness,visibility:v,reused:h}),{thread_id:E,url:R,session_id:u.sessionId?.trim()??"",project:u.project,reused:h,visibility:v,clipboard_copied:P,...x?{highlight:x}:{}}}catch(u){throw Ch("lore.cli.upload_failed",{error_category:Qtt(u),error_message:Gt(u),step:i}),u}finally{s&&await Ac(s.tempPath)}}async function Brn(e){let t=await Eet(e),n=await qi(t.fullPath);if(!n.exists)throw new Re(`session transcript not found at ${Lrn(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await Dp(e.project),o=await dl(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 krn(e,t){let[n]=await kA(e,[t]);if(!n)throw new Error("upload session response missing thread file");if(n.status==="quarantined")return{quarantined:!0,reason:n.reason,findingCount:n.findingCount};if(n.status==="no_upload"){let r=n.error?.trim()?`: ${n.error.trim()}`:"";throw new Re(`upload session for ${t.filename} returned no upload URL and no reusable thread${r}`)}return{quarantined:!1,reused:n.status==="deduped",thread:n.thread}}async function Orn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Bp(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function Prn(e){return`${Iy().replace(/\/+$/,"")}/thread/${e}`}async function Mrn(){let e=await jt();if(!e)throw new Re("not logged in \u2014 run 'lore login' first");return e}function Lrn(e){let t=Drn.homedir();if(!t)return e;let n=Ftt.relative(t,e);return!n||n.startsWith("..")?e:Ftt.join("~",n)}var Gtt={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}){z.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(Cu()&&!t?.progress){let o=await E1({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:i=>jfe({...n,progress:i})});"quarantined"in o&&o.quarantined&&console.log(`
|
|
658
|
+
`),!zet(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> start uploading from a directory"),console.log(" lore listen list [--json] print the upload list"),console.log(" lore listen delete <path> stop uploading from a directory"),console.log(""),console.log(" Example: lore listen create ~/code/projectA")}};A();QD();A();zt();go();Du();Th();import dnn from"node:fs/promises";async function pnn(e){try{return await dnn.access(e),!0}catch(t){if(Lr(t,"ENOENT"))return!1;throw t}}async function fnn({uploadFilterPath:e=LT()}={}){if(!await pnn(e))return;let t=await xi(e),n=[],r=[];for(let o of t.include.cwd){let i=await Ey(o);i?n.push(i):r.push(o)}n.length===0&&r.length===t.include.cwd.length||await Ad({...t,include:{...t.include,cwd:r.sort(),repo:Array.from(new Set([...t.include.repo,...n])).sort()}},e)}var $et={id:"20260519000000-upload-filter-cwds-to-repos",run:fnn};var mnn=[gYe,$et];async function Ann(e=mnn,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 qet={meta:{name:"postinstall:migrate",hidden:!0,skipAutoupdate:!0},async run(){await Ann()}};Bse();$P();A();yr();sc();Sn();jle();import{platform as gnn,release as hnn}from"node:os";function _nn(e){return e.find(n=>!n.startsWith("-"))??"lore"}async function Vet(e){try{let t={command:_nn(e.rawArgs),rawArgs:[...e.rawArgs],cliVersion:hu(),nodeVersion:process.version,platform:gnn(),release:hnn()};(await TYe({error:e.error,context:t,logger:z,send:async r=>{let i=await Ct().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"&&z.info("error_report_sent")}catch(t){z.warn("error_report_unexpected_failure",{error:t instanceof Error?t.message:String(t)})}}A();import{setTimeout as Yet}from"node:timers/promises";yr();zt();var Enn=3e4,o5={meta:{name:"_run_skill_sync",description:"Run the workspace skill sync daemon.",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously with filesystem watchers, SSE, and fallback polling.",default:!1},"poll-interval-ms":{type:"string",description:"Fallback full-sync poll interval in milliseconds.",default:"1800000"},"watch-debounce-ms":{type:"string",description:"Filesystem watcher debounce interval in milliseconds.",default:"2000"}},async run({args:e,data:t}){let n=t,r=n?.getAccessToken??jt,o=!!e.watch,{client:i,who:s}=await ynn({watch:o,getAccessToken:r,injectedClient:n?.client,retryDelayMs:n?.authRetryDelayMs??Enn}),u=s.body.organizations.map(T=>T.id),l=s.body.user.id,{lastEventId:f}=await ii(),h=(n?.createEventStream??H9)({userId:l,organizationIds:u,getAccessToken:r,reconnect:!0,...f?{lastEventId:f}:{}}),_=Number(e["poll-interval-ms"]);if(!Number.isFinite(_)||_<=0)throw new Re("--poll-interval-ms must be a positive number");let E=Number(e["watch-debounce-ms"]);if(!Number.isFinite(E)||E<=0)throw new Re("--watch-debounce-ms must be a positive number");await(n?.runSkillSyncDaemon??j9)({client:i,events:h,pollIntervalMs:_,watch:o,watchDebounceMs:E,onSyncPass:({reason:T,event:v,result:R})=>{let x=v?` from ${v.type}${v.id?`#${v.id}`:""}`:"";console.log(`skill sync ${T}${x}: ${R.publishedLocalPushed} published local update${R.publishedLocalPushed===1?"":"s"} uploaded, ${R.installedUpdated} updated, ${R.localEditsUploaded} local edit${R.localEditsUploaded===1?"":"s"} uploaded, ${R.conflicts} conflict${R.conflicts===1?"":"s"}`)}})}};async function ynn(e){for(;;){let t=await e.getAccessToken();if(!t){if(!e.watch)throw new Re("workspace skill sync daemon requires login \u2014 run 'lore login' first");await Yet(e.retryDelayMs);continue}let n=e.injectedClient??Ct({token:t}),r=await n.whoAmI({headers:{}});if(r.status===200)return{client:n,who:r};if(!e.watch)throw new Re(`whoAmI returned ${r.status}`);await Yet(e.retryDelayMs)}}A();A();yr();zt();var Ket={meta:{name:"approve",description:"Approve a proposed skill version and make it the latest accepted version."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."},version:{type:"string",required:!0,description:"Proposed version timestamp to approve"}},async run({args:e}){if(!await jt())throw new Re("skill approval requires login \u2014 run 'lore login' first");await Snn(Ct(),{id:e.id,version:e.version})}};async function Snn(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new Re("--version must be a positive integer timestamp");let r=await e.approveSkillVersion({params:{id:t.id,version:n},body:{}});if(r.status!==200){let o=r.body?.message??`approveSkillVersion returned ${r.status}`;throw new Re(o)}console.log(`approved /${r.body.name} v${r.body.version} (${r.body.id})`)}A();import Tnn from"node:fs/promises";import Jet from"node:path";yr();zt();Sn();var Zet={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 ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("install needs a skill ID \u2014 e.g. `lore skills install sk_01j...`");if(!await jt())throw new Re("workspace skill installs require login \u2014 run 'lore login' first");let n=Ct();await bnn(n,t)}};async function bnn(e,t){z.info("skill_install_started",{skill_id:t});try{let n=await Inn(e,t);z.info("skill_install_registered",{skill_id:n.body.skill.id,installation_id:n.body.installation_id,already_registered:n.body.already_registered,name:n.body.skill.name,root_kind:n.body.skill.root_kind,latest_version:n.body.skill.latest_version});let r={skillId:n.body.skill.id,installationId:n.body.installation_id,name:n.body.skill.name,rootKind:n.body.skill.root_kind,latestVersion:n.body.skill.latest_version,contentHash:n.body.skill.content_hash,bodyMd:await vnn(n.body.body_md_url,n.body.skill.content_hash)};if(!FM(r.name))throw new Re(`refusing to install skill with invalid name: ${JSON.stringify(r.name)}`);let o=L9(r.rootKind),i=GM(o,r.name),s=await Rnn(i),u=await JD(r.skillId),l=u?.installPath!=null&&Jet.resolve(u.installPath)===Jet.resolve(i);if(s!==null&&!l)throw z.warn("skill_install_refused_unmanaged_target",{skill_id:r.skillId,name:r.name,root_kind:o,install_path:i}),new Re(`refusing to overwrite ${i}; it already exists and is not managed by Lore`);let f=await U9(o,r.name,r.bodyMd),h=r.latestVersion,_={installationId:r.installationId,skillId:r.skillId,name:r.name,rootKind:o,installPath:f,baseVersion:h,baseContentHash:r.contentHash,lastInstalledVersion:h,lastInstalledHash:r.contentHash,lastSyncStatus:"current"};await ll(_);try{await Cnn(e,r.installationId,h)}catch(E){throw await ll({..._,lastSyncStatus:"error"}),z.warn("skill_install_failed",{skill_id:r.skillId,installation_id:r.installationId,phase:"update_installed_version",error:Gt(E)}),E}z.info("skill_install_written",{skill_id:r.skillId,installation_id:r.installationId,name:r.name,root_kind:o,install_path:f,latest_version:h,already_up_to_date:s===r.bodyMd}),s===r.bodyMd?console.log(`/${r.name} is already up to date at ${f}`):console.log(`installed /${r.name} (${r.skillId}) -> ${f}`)}catch(n){throw z.warn("skill_install_failed",{skill_id:t,phase:"install",error:Gt(n)}),n}}async function Inn(e,t){let n=await e.installSkill({params:{id:t},body:{}});if(n.status!==200){let r=n.body?.message??`installSkill returned ${n.status}`;throw new Re(r)}return n}async function Cnn(e,t,n){let r=await e.updateSkillInstallation({params:{id:t},body:{installed_version:n}});if(r.status!==200){let o=r.body?.message??`updateSkillInstallation returned ${r.status}`;throw new Re(`installed ${t} locally, but failed to record installed version: ${o}`)}}async function vnn(e,t){let n=new URL(e,al()),r=await jt(),o=await fetch(n,{headers:{...r?{authorization:`Bearer ${r}`}:{}}});if(!o.ok)throw new Re(`failed to download SKILL.md from ${e}: HTTP ${o.status}`);let i=await o.text();if(gd(i)!==t)throw new Re("downloaded SKILL.md hash did not match the skill metadata");return i}async function Rnn(e){try{return await Tnn.readFile(e,"utf8")}catch{return null}}A();yr();zt();function xnn(e){return JSON.stringify(e,null,2)}var Wet={meta:{name:"list",description:"List skills available in your workspace."},async run({data:e}){let t=e;if(!await(t?.getAccessToken??jt)())throw new Re("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Ct()).listSkills({});if(o.status!==200){let i=o.body?.message??`listSkills returned ${o.status}`;throw new Re(i)}console.log(xnn(o.body))}};A();yr();zt();var Xet={meta:{name:"proposals",description:"List proposed versions awaiting owner review for a skill."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."}},async run({args:e}){if(!await jt())throw new Re("skill proposals require login \u2014 run 'lore login' first");await Dnn(Ct(),e.id)}};async function Dnn(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status!==200){let o=n.body?.message??`getSkillDetail returned ${n.status}`;throw new Re(o)}let r=n.body.versions.filter(o=>o.status==="proposed");if(r.length===0){console.log(`no proposed versions for ${t}`);return}for(let o of r){let i=o.created_by?`${o.created_by.display_name} (${o.created_by.id})`:"unknown";console.log(`${n.body.id} /${n.body.name} version=${o.version} proposer=${i} created_at=${o.created_at}`)}}A();import{readFile as Nnn}from"node:fs/promises";import i5 from"node:path";yr();zt();Sn();var ttt={meta:{name:"publish",description:"Publish a local skill to your workspace, or upload local edits for an already-published skill."},args:{target:{type:"positional",required:!0,description:"Local skill name/path or workspace published sk_* ID"}},async run({args:e}){if(!await jt())throw new Re("not logged in \u2014 run 'lore login' first");let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("pass a skill name, path, or sk_* ID to publish");let n=await wnn(Ct(),t);Unn(n)}};async function wnn(e,t){let n=t.trim();if(!n)throw new Re("pass a skill name, path, or sk_* ID to publish");let r=n.startsWith("sk_")?"skill_id":"local_name_or_path";z.info("skill_publish_started",{target_kind:r,target:n});try{if(n.startsWith("sk_"))return await ntt(e,n);let o=await lJe(),i=Bnn(n,o),s=await $Xe(n)??await qXe(n,process.cwd(),i);if(!s)throw new Re(`no SKILL.md found for ${n}`);return await knn(e,s)}catch(o){throw z.warn("skill_publish_failed",{target_kind:r,target:n,phase:"publish",error:Gt(o)}),o}}function Bnn(e,t){let n=i5.resolve(e);for(let r of t){if(ett(d1(r),n))return"claude_project";if(ett(p1(r),n))return"agents_project"}}function ett(e,t){let n=i5.relative(i5.resolve(e),t);return n!==""&&!n.startsWith("..")&&!i5.isAbsolute(n)}async function knn(e,t){let n=gd(t.bodyMd),r=await cJe(t);if(z.info("skill_publish_local_resolved",{name:t.name,file_path:t.filePath,root_kind:t.rootKind,published_local_skill_id:r,published_local_skill_id_present:!!r}),!r){let i=await ZD(e,t,{syncAction:"initial_publish"});return await WD(t,{skillId:i.skill_id,version:i.version}),z.info("skill_publish_initial_uploaded",{name:t.name,file_path:t.filePath,skill_id:i.skill_id,version:i.version,root_kind:i.root_kind}),{kind:"uploaded",skillId:i.skill_id,version:i.version,versionStatus:i.version_status==="proposed"?"proposed":"accepted"}}let o=await Onn(r)===n?await ntt(e,r):await Pnn(e,r,t);return o.kind!=="conflict"&&o.kind!=="remote_newer"&&await WD(t,{skillId:r,version:o.version}),o}async function Onn(e){return(await ii()).publishedLocal[e]?.lastPublishedHash??null}async function ntt(e,t){let n=await e.getSkillDetail({params:{id:t},query:{include_unpublished:!0}});if(n.status===200&&n.body.visibility==="workspace")return rtt(e,t,n.body);throw ott("load workspace skill before publishing local edits",n.status,n.body)}async function Pnn(e,t,n){let r=await e.getSkillDetail({params:{id:t},query:{include_unpublished:!0}});if(r.status!==200)throw ott("load skill before publishing local edits",r.status,r.body);return rtt(e,t,r.body,n)}async function rtt(e,t,n,r){let o=await ii(),i=o.installed[t]??null,s=o.publishedLocal[t]??null,u=i?.installPath??r?.filePath??s?.filePath,l=i?.rootKind??r?.rootKind??s?.rootKind??n.root_kind,f=i?.name??r?.name??s?.name??n.name;if(!u)throw new Re(`no managed local SKILL.md found for ${t}; install it or publish it from this machine first`);let h=await Nnn(u,"utf8"),_=gd(h),E=n.latest_version??0,T=n.content_hash??"",v=Mnn(i,s);if(_===T)return z.info("skill_publish_noop",{skill_id:t,version:E,reason:"local_matches_remote"}),{kind:"unchanged",skillId:t,version:E};if(v.version>0&&E>v.version)return _===v.hash?(z.info("skill_publish_noop",{skill_id:t,version:E,reason:"remote_newer_local_unchanged",local_version:v.version}),{kind:"remote_newer",skillId:t,localVersion:v.version,remoteVersion:E}):(i&&await ll({...i,lastSyncStatus:"conflict"}),z.warn("skill_publish_conflict",{skill_id:t,local_version:v.version,remote_version:E,name:f,file_path:u}),{kind:"conflict",skillId:t,localVersion:v.version,remoteVersion:E});if(_===v.hash)return z.info("skill_publish_noop",{skill_id:t,version:E,reason:"local_matches_base"}),{kind:"unchanged",skillId:t,version:E};let R=await Lnn(e),x=n.owner?.id&&n.owner.id===R?"owner_update":"subscriber_update",k=await ZD(e,{skillId:t,name:f,description:null,bodyMd:h,filePath:u,rootKind:l},{syncAction:x,...v.version>0?{baseVersion:v.version}:{}});return i&&await ll({...i,...k.version_status==="accepted"?{baseVersion:k.version,baseContentHash:k.content_hash,lastSyncStatus:"current"}:{lastSyncStatus:"proposed"},lastInstalledVersion:k.version,lastInstalledHash:k.content_hash}),await WD({name:f,bodyMd:h,filePath:u,rootKind:l},{skillId:k.skill_id,version:k.version}),z.info("skill_publish_update_uploaded",{skill_id:k.skill_id,name:f,file_path:u,sync_action:x,version:k.version,version_status:k.version_status}),{kind:"uploaded",skillId:k.skill_id,version:k.version,versionStatus:k.version_status==="proposed"?"proposed":"accepted"}}function Mnn(e,t){return e?{hash:e.baseContentHash,version:e.baseVersion}:t?{hash:t.lastPublishedHash,version:t.lastPublishedVersion}:{hash:"",version:0}}async function Lnn(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}function ott(e,t,n){let r=n?.message??`${e} returned ${t}`;return new Re(r)}function Unn(e){switch(e.kind){case"uploaded":console.log(`${e.versionStatus} ${e.skillId} (v${e.version})`);break;case"unchanged":console.log(`already up to date ${e.skillId} (v${e.version})`);break;case"remote_newer":console.log(`remote newer ${e.skillId}: local base is v${e.localVersion}, remote is v${e.remoteVersion}; run lore skills sync`);break;case"conflict":console.log(`conflict ${e.skillId}: remote advanced from v${e.localVersion} to v${e.remoteVersion}; run lore skills sync`);break}}A();yr();zt();var itt={meta:{name:"reject",description:"Reject a proposed skill version without changing the latest accepted version."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."},version:{type:"string",required:!0,description:"Proposed version timestamp to reject"},reason:{type:"string",required:!1,description:"Optional rejection reason shown with the reviewed version"}},async run({args:e}){if(!await jt())throw new Re("skill rejection requires login \u2014 run 'lore login' first");await Qnn(Ct(),{id:e.id,version:e.version,reason:e.reason})}};async function Qnn(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new Re("--version must be a positive integer timestamp");let r=t.reason?.trim(),o=await e.rejectSkillVersion({params:{id:t.id,version:n},body:r?{reason:r}:{}});if(o.status!==200){let i=o.body?.message??`rejectSkillVersion returned ${o.status}`;throw new Re(i)}console.log(`rejected /${o.body.name} v${o.body.version} (${o.body.id})`)}A();wO();import Qfe from"node:fs/promises";import stt from"node:os";import Di from"node:path";var att={meta:{name:"scan",description:"List local skills found by Lore's scanner."},async run(){await Ynn()}};function utt(e){let t=Di.resolve(e),n=Di.resolve(stt.homedir()),r=Di.relative(n,t);return r===""?"~":!r.startsWith("..")&&!Di.isAbsolute(r)?Di.join("~",r):t}function Fnn(e){return utt(Di.dirname(Di.dirname(e)))}function Gnn(e){return Di.basename(Di.dirname(e))}function jnn(e,t){let n=Di.resolve(e);for(let r of t){let o=Di.resolve(r),i=Di.relative(o,n);if(i!==""&&!i.startsWith("..")&&!Di.isAbsolute(i))return o}return null}function znn(e,t,n){return e==="claude_project"?t.map(r=>Di.join(d1(r),n)):e==="agents_project"?t.map(r=>Di.join(p1(r),n)):[]}function Hnn(){return Di.join(stt.homedir(),"Library","Application Support","Claude","local-agent-mode-sessions","skills-plugin")}async function $nn(e){let t=[];async function n(r){let o;try{o=await Qfe.readdir(r,{withFileTypes:!0})}catch{return}for(let i of o){let s=Di.join(r,i.name);i.isDirectory()?await n(s):i.isFile()&&i.name==="manifest.json"&&t.push(s)}}return await n(e),t.sort((r,o)=>r.localeCompare(o))}function s5(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function qnn(e){let t;try{t=JSON.parse(e)}catch{return[]}if(!t||typeof t!="object"||Array.isArray(t))return[];let n=t.skills;if(!Array.isArray(n))return[];let r=[];for(let o of n){if(!o||typeof o!="object"||Array.isArray(o))continue;let i=o,s=s5(i.skillId),u=s5(i.name);!s||!u||r.push({skillId:s,name:u,description:s5(i.description),creatorType:s5(i.creatorType)})}return r}async function Vnn(){let e={};for(let t of await $nn(Hnn())){let n;try{n=await Qfe.readFile(t,"utf8")}catch{continue}let r=Di.join(Di.dirname(t),"skills"),o=utt(r);for(let i of qnn(n)){if(i.creatorType==="anthropic")continue;let s=Di.join(r,i.name,"SKILL.md");try{await Qfe.access(s)}catch{continue}e[o]??=[],e[o].push({skill_id:i.skillId,name:i.name,description:i.description,file_path:s,manifest_path:t})}}for(let t of Object.values(e))t.sort((n,r)=>n.name.localeCompare(r.name)||n.file_path.localeCompare(r.file_path));return e}async function Ynn(){let e=await xde(),t=await ii(),n=e.map(l=>l.root),r=new Map(e.map(l=>[Di.resolve(l.root),l])),o=await KXe({projectCwds:n,includeCwdProject:!1}),i={},s=new Set;for(let l of o){let f=Di.resolve(l.filePath);if(s.has(f))continue;s.add(f);let h=Fnn(l.filePath),_=jnn(l.filePath,n),E=_?r.get(_)?.alsoSeenAt??[]:[],T=N$(t,{filePath:l.filePath,rootKind:l.rootKind});i[h]??=[],i[h].push({name:l.name,description:l.description,root_kind:l.rootKind,file_path:l.filePath,also_seen_at:znn(l.rootKind,E,Gnn(l.filePath)),...T?{skill_id:T.skillId}:{},local_content_hash:gd(l.bodyMd)})}let u=cje.parse({type:"local_skill_scanner_output",skills:i,cowork_skills:await Vnn()});console.log(JSON.stringify(u,null,2))}A();yr();zt();var ctt={meta:{name:"status",description:"Show local Lore-managed skill sync state."},async run(){if(!await jt())throw new Re("skill status requires login \u2014 run 'lore login' first");await Knn()}};async function Knn(){let e=await ii();console.log(JSON.stringify(e))}A();yr();zt();var ltt={meta:{name:"sync",description:"Sync installed Lore-managed skills to their latest accepted versions."},async run(){if(!await jt())throw new Re("workspace skill sync requires login \u2014 run 'lore login' first");let e=await bfe(Ct());console.log(`skill sync complete: ${e.installedUpdated} updated, ${e.localEditsUploaded} local edit${e.localEditsUploaded===1?"":"s"} uploaded, ${e.conflicts} conflict${e.conflicts===1?"":"s"}`)}};A();import dtt from"node:fs/promises";import Jnn from"node:path";yr();zt();var ptt={meta:{name:"uninstall",description:"Remove a Lore-managed skill by stable skill ID."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("uninstall needs a skill ID \u2014 e.g. `lore skills uninstall sk_01j...`");if(!await jt())throw new Re("workspace skill uninstalls require login \u2014 run 'lore login' first");let n=Ct();await Znn(n,t)}};async function Znn(e,t){let n=await JD(t);n&&(await dtt.rm(n.installPath,{force:!0}),await dtt.rmdir(Jnn.dirname(n.installPath)).catch(()=>{}));let r=await e.uninstallSkill({params:{id:t},body:{}});if(r.status!==200){let o=r.body?.message??`uninstallSkill returned ${r.status}`;throw new Re(o)}if(await nJe(t),n){console.log(`uninstalled /${n.name} (${t}) from ${n.installPath}`);return}console.log(`uninstalled ${t}`)}A();yr();zt();var ftt={meta:{name:"unpublish",description:"Remove an owned published skill from your workspace catalog."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("unpublish needs a skill ID \u2014 e.g. `lore skills unpublish sk_01j...`");if(!await jt())throw new Re("skill unpublishes require login \u2014 run 'lore login' first");await Wnn(Ct(),t)}};async function Wnn(e,t){let n=await e.unpublishSkill({params:{id:t},body:{}});if(n.status!==200){let o=n.body?.message??`unpublishSkill returned ${n.status}`;throw new Re(o)}let r=await eJe(n.body.id);if(r){console.log(`unpublished /${r.name} (${n.body.id}); local file kept at ${r.filePath}`);return}console.log(`unpublished ${n.body.id}`)}A();zt();var mtt={meta:{name:"unsync",description:"Remove local skill sync state for a skill ID.",hidden:!0},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Re("unsync needs a skill ID \u2014 e.g. `lore skills unsync sk_01j...`");let n=await tJe(t);if(n.installed||n.publishedLocal){let r=[n.publishedLocal?"published local":null,n.installed?"installed":null].filter(Boolean);console.log(`removed ${r.join(" and ")} sync state for ${t}`);return}console.log(`no local sync state found for ${t}`)}};var Att={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:ttt,unpublish:ftt,install:Zet,uninstall:ptt,unsync:mtt,sync:ltt,daemon:o5,approve:Ket,reject:itt,proposals:Xet,status:ctt,list:Wet,scan:att}};iy();A();await ho();var m5=ue(dn(),1);sc();await fb();A();await ho();var d5=ue(dn(),1);await RA();A();await ho();var m1=ue(dn(),1);Ps();var hd=ue(Ht(),1);function A1({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[s,u]=(0,m1.useState)(gtt(e,n)),l=(0,m1.useRef)(s);return(0,m1.useEffect)(()=>{let f=gtt(e,n);l.current=f,u(f)},[e,n]),Ru((f,h)=>{if(e.length!==0){if(h.upArrow||f==="k"){let _=Xnn(e,l.current);l.current=_,u(_);return}if(h.downArrow||f==="j"){let _=htt(e,l.current);l.current=_,u(_);return}if(h.return||f===" "){let _=e[l.current];_&&!_.disabled&&t(_)}}},{isActive:!r}),e.length===0?(0,hd.jsx)(he,{color:xe.muted,children:"no actions available"}):(0,hd.jsxs)(Ee,{flexDirection:"column",children:[e.map((f,h)=>{let _=h===s,E=f.disabled?xe.muted:_?xe.primary:xe.highlight;return(0,hd.jsxs)(Ee,{children:[(0,hd.jsx)(Ee,{width:2,flexShrink:0,children:(0,hd.jsx)(he,{color:_?xe.primary:xe.muted,children:_?"\u203A":" "})}),(0,hd.jsx)(Ee,{width:i,flexShrink:0,children:(0,hd.jsx)(he,{color:E,bold:_&&!f.disabled,children:f.label})}),f.description?(0,hd.jsx)(Ee,{flexGrow:1,flexShrink:1,children:(0,hd.jsx)(he,{color:xe.muted,children:f.description})}):null]},f.id)}),o?(0,hd.jsx)(Ee,{marginTop:1,children:(0,hd.jsx)(he,{color:xe.muted,children:o})}):null]})}function gtt(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?htt(e,n-1):n}function htt(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 Xnn(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 xA();await gb();await hb();Ps();A();yr();Du();QD();$D();async function a5(e){if(!await(e.hasAccessToken??(async()=>!!await jt()))())return{state:"logged_out"};let n=e.client??Ct();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:_tt(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 u5(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??f$;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function c5(e){if(!await(e.hasAccessToken??(async()=>!!await jt()))())return{state:"logged_out"};let n=e.client??Ct();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:_tt(r.body,`listSkills returned ${r.status}`)};let o=r.body.objects.length,i=r.body.objects.filter(s=>s.visibility==="workspace").length;return{state:"ready",count:o,published:i}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function l5(){try{await Ih();let e=await xi();return ern(e)}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function ern(e){return{state:"ready",cwd:e.include.cwd,repo:e.include.repo}}function _tt(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 Bt=ue(Ht(),1);function Gy({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=Os(),[i,s]=(0,d5.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,d5.useEffect)(()=>{if(t)return;let l=!1;return(async()=>{let[f,h,_,E]=await Promise.all([a5(n),u5(n),c5(n),l5()]);l||s({identity:f,daemon:h,skills:_,uploadDirs:E})})(),()=>{l=!0}},[]),Ru((l,f)=>{(l==="q"||f.ctrl&&l==="c"||f.escape)&&(r("quit"),o())});let u=srn(i);return(0,Bt.jsxs)(Ee,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,Bt.jsx)(Ms,{title:"lore",subtitle:nrn(i.identity),right:`v${e}`}),(0,Bt.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,Bt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Qn,{title:"Daemon",children:(0,Bt.jsx)(rrn,{daemon:i.daemon})})}),(0,Bt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Qn,{title:"Workspace",children:(0,Bt.jsx)(orn,{identity:i.identity,skills:i.skills})})})]}),(0,Bt.jsx)(Ee,{marginTop:1,children:(0,Bt.jsx)(Qn,{title:"Upload filters",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.cwd.length+i.uploadDirs.repo.length} configured`:void 0,children:(0,Bt.jsx)(trn,{uploadDirs:i.uploadDirs})})}),(0,Bt.jsx)(Ee,{marginTop:1,children:(0,Bt.jsx)(Qn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Bt.jsx)(A1,{items:u,onSelect:l=>{r(l.id),o()}})})})]})}function trn({uploadDirs:e}){return e.state==="loading"?(0,Bt.jsx)(Ha,{label:"reading ~/.lore/upload_filters.json\u2026"}):e.state==="error"?(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(he,{color:xe.danger,children:e.message})]}):e.cwd.length===0&&e.repo.length===0?(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,Bt.jsx)(Ee,{marginTop:1,children:(0,Bt.jsxs)(he,{color:xe.muted,children:["Run ",(0,Bt.jsx)(he,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[e.cwd.map(t=>(0,Bt.jsx)(en,{label:"cwd",value:t,kind:"success",labelWidth:16},`cwd:${t}`)),e.repo.map(t=>(0,Bt.jsx)(en,{label:"repo",value:t,kind:"success",labelWidth:16},`repo:${t}`))]})}function nrn(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 rrn({daemon:e}){if(e.state==="loading")return(0,Bt.jsx)(Ha,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(he,{color:xe.muted,children:"Background uploads are macOS-only today."}),(0,Bt.jsxs)(he,{color:xe.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(he,{color:xe.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:t.health,kind:n}),(0,Bt.jsx)(en,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,Bt.jsx)(en,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,Bt.jsx)(en,{label:"Heartbeat",value:Ett(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,Bt.jsx)(en,{label:"Last upload",value:Ett(t.status?.last_success_at)}),t.status?.last_error?(0,Bt.jsx)(en,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function orn({identity:e,skills:t}){return e.state==="loading"?(0,Bt.jsx)(Ha,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"signed out",kind:"warning"}),(0,Bt.jsx)(he,{color:xe.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(he,{color:xe.danger,children:e.message})]}):(0,Bt.jsxs)(Ee,{flexDirection:"column",children:[(0,Bt.jsx)(en,{label:"User",value:e.email,kind:"success"}),(0,Bt.jsx)(en,{label:"Display name",value:e.displayName}),(0,Bt.jsx)(en,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,Bt.jsx)(en,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,Bt.jsx)(en,{label:"Skills",value:irn(t)})]})}function irn(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 srn(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 Ett(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 ho();await RA();await xA();Ps();var ai=ue(Ht(),1),arn=[{id:"login",label:"Sign in to Lore",description:"opens your browser for a device-code flow"},{id:"quit",label:"Quit",description:"exit without signing in"}];function p5({cliVersion:e,onSelect:t}){let{exit:n}=Os();return Ru((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,ai.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,ai.jsx)(Ms,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,ai.jsx)(Qn,{title:"What is Lore?",children:(0,ai.jsxs)(Ee,{flexDirection:"column",children:[(0,ai.jsx)(he,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,ai.jsxs)(Ee,{marginTop:1,flexDirection:"column",children:[(0,ai.jsx)(he,{color:xe.muted,children:"You'll get:"}),(0,ai.jsxs)(he,{children:[(0,ai.jsx)(he,{color:xe.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,ai.jsxs)(he,{children:[(0,ai.jsx)(he,{color:xe.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,ai.jsxs)(he,{children:[(0,ai.jsx)(he,{color:xe.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,ai.jsxs)(he,{children:[(0,ai.jsx)(he,{color:xe.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,ai.jsx)(Ee,{marginTop:1,children:(0,ai.jsx)(Qn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,ai.jsx)(A1,{items:arn,onSelect:r=>{t(r.id),n()}})})}),(0,ai.jsx)(Ee,{marginTop:1,children:(0,ai.jsxs)(he,{color:xe.muted,children:["New to Lore? Run ",(0,ai.jsx)(he,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var f5=ue(Ht(),1),urn={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 crn({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,m5.useState)(void 0),{exit:i}=Os();return(0,m5.useEffect)(()=>{let s=!1;return(async()=>{let[u,l,f,h]=await Promise.all([a5(t),u5(t),c5(t),l5()]);s||o({identity:u,daemon:l,skills:f,uploadDirs:h})})(),()=>{s=!0}},[]),r?r.identity.state==="logged_out"?(0,f5.jsx)(p5,{cliVersion:e,onSelect:s=>{n(s),i()}}):(0,f5.jsx)(Gy,{cliVersion:e,initialData:r,onSelect:n}):null}async function ytt(){let e="quit";return await cl((0,f5.jsx)(crn,{cliVersion:hu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:urn[e]}}A();await fb();A();await ho();var KM=ue(dn(),1);await RA();await xA();Ps();A();await ho();await tde();await RA();await Ab();await xA();await ode();A();await ho();Ps();var g1=ue(Ht(),1),lrn="\u2588",drn="\u2591";function Stt({value:e,width:t=24,label:n,color:r=xe.success}){let o=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=Math.round(o*t),s=Math.max(0,t-i);return(0,g1.jsxs)(Ee,{children:[(0,g1.jsx)(he,{color:r,children:lrn.repeat(i)}),(0,g1.jsx)(he,{color:xe.muted,children:drn.repeat(s)}),n?(0,g1.jsxs)(he,{color:xe.muted,children:[" ",n]}):null]})}await gb();await hb();await nde();await lde();await fde();A();await ho();await RA();await Ab();await xA();await gb();Ps();var _o=ue(Ht(),1),btt=[{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 HM(){return{steps:btt.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function A5(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?`${Ttt(n.key)} (${t.label})`:Ttt(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function Ttt(e){return btt.find(t=>t.key===e)?.label??e}function Nh({title:e,subtitle:t,state:n}){return(0,_o.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,_o.jsx)(Ms,{title:e,subtitle:t}),(0,_o.jsx)(Qn,{title:"Pipeline",children:(0,_o.jsx)(Ee,{flexDirection:"column",children:n.steps.map(r=>(0,_o.jsx)(prn,{step:r},r.key))})}),n.result?(0,_o.jsx)(Ee,{marginTop:1,flexDirection:"column",children:(0,_o.jsx)(Ls,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,_o.jsxs)(Ee,{flexDirection:"column",children:[(0,_o.jsx)(he,{children:n.result.url}),(0,_o.jsx)(Ee,{marginTop:1,children:(0,_o.jsxs)(he,{color:xe.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,_o.jsx)(Ee,{marginTop:1,children:(0,_o.jsx)(Ls,{kind:"error",title:"Failed",children:(0,_o.jsx)(he,{children:n.errorMessage})})}):null]})}function prn({step:e}){return e.status==="active"?(0,_o.jsxs)(Ee,{children:[(0,_o.jsx)(Ha,{}),(0,_o.jsx)(he,{children:" "}),(0,_o.jsx)(he,{color:xe.primary,children:e.label})]}):e.status==="done"?(0,_o.jsxs)(Ee,{children:[(0,_o.jsx)(he,{color:xe.success,children:"\u2713 "}),(0,_o.jsx)(he,{color:xe.muted,children:e.label})]}):(0,_o.jsxs)(Ee,{children:[(0,_o.jsx)(he,{color:xe.muted,children:"\u25CB "}),(0,_o.jsx)(he,{color:xe.muted,children:e.label})]})}Ps();A();var $M=Date.parse("2026-05-16T12:00:00.000Z");function qM(e){return new Date($M-e*6e4).toISOString()}var Kf={plist:"/Users/alex/Library/LaunchAgents/ai.tanagram.lore.plist",binary:"/Users/alex/.lore/bin/lore-background",logFile:"/Users/alex/.lore/cli.log.txt",status:"/Users/alex/.lore/status.json",installSource:"/opt/homebrew/bin/lore"},Itt=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:$M-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:$M-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:$M-180*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:$M-1560*6e4}],frn=["/Users/alex/code/tanagram-lore","/Users/alex/work/acme-integration"],h1={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:Kf.plist,binary_path:Kf.binary,status_path:Kf.status,daemon_status_path:"/Users/alex/.lore/daemon_status.json",install_source_path:Kf.installSource,subsystems:{threads:{name:"threads",healthy:!0,health:"running",heartbeat_fresh:!0},skills:{name:"skills",healthy:!0,health:"running",heartbeat_fresh:!0}},status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:qM(60),last_heartbeat_at:qM(1),last_success_at:qM(5),last_completed_at:qM(5),last_thread_ids:["thr_01hx_story"]}},Ctt={...h1,running:!1,healthy:!1,health:"stale",heartbeat_fresh:!1,subsystems:{threads:{name:"threads",healthy:!1,health:"stale",heartbeat_fresh:!1},skills:{name:"skills",healthy:!0,health:"running",heartbeat_fresh:!0}},status:{...h1.status,state:"error",last_heartbeat_at:qM(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},mrn={...h1,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,subsystems:{threads:{name:"threads",healthy:!1,health:"disabled",heartbeat_fresh:!1},skills:{name:"skills",healthy:!1,health:"disabled",heartbeat_fresh:!1}},status:void 0},Arn={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"},VM={identity:Arn,daemon:{state:"ready",report:h1},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",cwd:frn,repo:[]}},vtt={...VM,uploadDirs:{state:"ready",cwd:[],repo:[]}},Rtt={...VM,daemon:{state:"error",message:"launchctl print failed: service not found"}},xtt={...VM,daemon:{state:"unsupported",platform:"linux"}},Dtt={identity:{state:"logged_out"},daemon:{state:"ready",report:mrn},skills:{state:"logged_out"},uploadDirs:{state:"ready",cwd:[],repo:[]}},Ntt=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var yt=ue(Ht(),1),oo=()=>{};function jy(...e){return e.reduce(R$,XP())}function YM(...e){return e.reduce(A5,HM())}var MA=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,yt.jsx)(p5,{cliVersion:"0.1.0",onSelect:oo})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,yt.jsx)(wp,{state:XP()})},{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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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:Kf.plist,binaryPath:Kf.binary,logFile:Kf.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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wp,{state:jy({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,yt.jsx)(wA,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:oo,onSkip:oo})},{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,yt.jsx)(wA,{state:{phase:"choose",suggestions:Itt,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:oo,onSkip:oo})},{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,yt.jsx)(wA,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:oo,onSkip:oo})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,yt.jsx)(wA,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:oo,onSkip:oo})},{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,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:oo,onSkip:oo})},{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,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:oo,onSkip:oo})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,yt.jsx)(wA,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:oo,onSkip:oo})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:VM,onSelect:oo})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:vtt,onSelect:oo})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:Rtt,onSelect:oo})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:xtt,onSelect:oo})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,yt.jsx)(Gy,{cliVersion:"0.1.0",initialData:Dtt,onSelect:oo})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:HM()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:YM({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,yt.jsx)(Nh,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:YM({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,yt.jsx)(Nh,{title:"lore share-codex",state:YM({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.link/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,yt.jsx)(Nh,{title:"lore share-cowork",state:YM({kind:"completed",url:"https://lore.link/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,yt.jsx)(Nh,{title:"lore export",state:YM({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,yt.jsx)(Ry,{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,yt.jsx)(Ry,{mode:"enable",state:{phase:"finished",result:{plistPath:Kf.plist,binaryPath:Kf.binary,logFile:Kf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,yt.jsx)(Ry,{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,yt.jsx)(Ry,{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,yt.jsx)(Ry,{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,yt.jsx)(rM,{report:h1})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,yt.jsx)(rM,{report:Ctt})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,yt.jsx)(Ms,{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,yt.jsx)(Qn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,yt.jsx)(he,{color:xe.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,yt.jsxs)(Qn,{title:"StatusLine",children:[(0,yt.jsx)(en,{label:"Healthy",value:"yes",kind:"success"}),(0,yt.jsx)(en,{label:"Warning",value:"needs attention",kind:"warning"}),(0,yt.jsx)(en,{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,yt.jsx)(Qn,{title:"ProgressBar",children:(0,yt.jsx)(Stt,{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,yt.jsxs)(Ee,{flexDirection:"column",children:[(0,yt.jsx)(Ls,{kind:"success",title:"Shared",children:(0,yt.jsx)(he,{children:"Copied the Lore URL to your clipboard."})}),(0,yt.jsx)(Ee,{marginTop:1,children:(0,yt.jsx)(Ls,{kind:"error",title:"Failed",children:(0,yt.jsx)(he,{color:xe.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,yt.jsx)(Qn,{title:"Spinner",children:(0,yt.jsx)(Ha,{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,yt.jsx)(Qn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,yt.jsx)(A1,{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:oo})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,yt.jsx)(Qn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,yt.jsx)(ZP,{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:oo,onAction:oo})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,yt.jsx)(Qn,{title:"TextInput",children:(0,yt.jsx)(T$,{initialValue:"~/code",onSubmit:oo,onCancel:oo})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,yt.jsx)(Qn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,yt.jsx)(b$,{initialValue:"/Users/alex/code",loadSuggestions:async()=>Ntt,onSubmit:oo,onCancel:oo})})}];function wtt(e){return MA.find(t=>t.id===e)}function _1(e){return e.path.slice(1).join(" / ")}var zr=ue(Ht(),1);function ktt({initialStoryId:e}){let t=Math.max(0,MA.findIndex(f=>f.id===e)),[n,r]=(0,KM.useState)(t),[o,i]=(0,KM.useState)("sidebar"),s=(0,KM.useRef)(o);s.current=o;let{exit:u}=Os();Ru((f,h)=>{if(h.ctrl&&f==="c"){u();return}if(s.current==="sidebar"&&f==="q"){u();return}if(h.escape){if(s.current==="preview"){s.current="sidebar",i("sidebar");return}u();return}if(s.current==="preview"&&h.tab&&h.shift){s.current="sidebar",i("sidebar");return}if(s.current==="sidebar"&&h.tab&&!h.shift){s.current="preview",i("preview");return}if(s.current==="sidebar"){if(h.upArrow||f==="k"){r(_=>Btt(_-1));return}(h.downArrow||f==="j")&&r(_=>Btt(_+1))}});let l=MA[n]??MA[0];return(0,zr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,zr.jsx)(Ms,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${MA.length}`}),(0,zr.jsx)(Ee,{marginBottom:1,children:(0,zr.jsx)(he,{color:xe.muted,children:"\u2191/\u2193 or j/k select stories \xB7 Tab focuses preview \xB7 Shift+Tab/Esc returns \xB7 q exits from sidebar"})}),(0,zr.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,zr.jsx)(Ee,{width:36,flexShrink:0,children:(0,zr.jsx)(Qn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,zr.jsx)(grn,{stories:MA,selectedIndex:n,focused:o==="sidebar"})})}),(0,zr.jsx)(Ee,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,zr.jsx)(Qn,{title:l.title,focused:o==="preview",subtitle:o==="preview"?`${_1(l)} \xB7 focused`:_1(l),children:(0,zr.jsxs)(Ee,{flexDirection:"column",children:[(0,zr.jsx)(he,{color:xe.muted,children:l.description}),o==="sidebar"?(0,zr.jsxs)(he,{color:xe.muted,children:["Press ",(0,zr.jsx)(he,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,zr.jsx)(Ee,{marginTop:1,children:l.render()})]})})})]})]})}function grn({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,s)=>{let u=i.path.slice(1),l=Srn(o,u);for(let f=l;f<u.length;f++)r.push((0,zr.jsx)(hrn,{label:u[f]??"",level:f,marginTop:yrn(u[f]??"",f,l),focused:n},`group:${u.slice(0,f+1).join("/")}`));r.push((0,zr.jsx)(_rn,{story:i,selected:s===t,focused:n},i.id)),o=u}),(0,zr.jsx)(Ee,{flexDirection:"column",children:r})}function hrn({label:e,level:t,marginTop:n,focused:r}){return(0,zr.jsx)(Ee,{marginLeft:Ott(t),marginTop:n,children:(0,zr.jsx)(he,{color:r?xe.primary:xe.muted,bold:r,wrap:"truncate-end",children:e})})}function _rn({story:e,selected:t,focused:n}){let r=n?t?xe.accent:xe.highlight:xe.muted;return(0,zr.jsxs)(Ee,{marginLeft:Ott(e.path.slice(1).length),children:[(0,zr.jsx)(he,{color:n&&t?xe.accent:xe.muted,children:t?"\u203A ":" "}),(0,zr.jsx)(he,{color:r,bold:n&&t,wrap:"truncate-end",children:Ern(e)})]})}function Ern(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function Ott(e){return Math.min(e,4)}function yrn(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Srn(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 Btt(e){let t=MA.length;return(e%t+t)%t}function Ptt({story:e}){let{exit:t}=Os();return Ru((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,zr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,zr.jsx)(Ms,{title:e.title,subtitle:_1(e),right:"Esc to exit"}),(0,zr.jsx)(Ee,{marginBottom:1,children:(0,zr.jsx)(he,{color:xe.muted,children:e.description})}),e.render()]})}var Ffe=ue(Ht(),1),Mtt={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){Trn();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=wtt(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 cl((0,Ffe.jsx)(Ptt,{story:n})).waitUntilExit();return}await cl((0,Ffe.jsx)(ktt,{})).waitUntilExit()}};function Trn(){for(let e of MA)console.log(`${e.id} ${_1(e)} ${e.title}`)}A();yr();Sn();var Ltt={meta:{name:"backfill-artifacts",description:"Upload artifact files (uploads/ and outputs/) for Cowork sessions already shared to Lore, so they show up in the Artifacts tab. Re-uploads bytes from this machine; only sessions that already have a Lore thread are touched."},args:{"dry-run":{type:"boolean",description:"List what would be uploaded without uploading anything."}},async run({args:e,data:t}){let n=!!e["dry-run"];z.info("command_start",{command:"backfill-artifacts",dry_run:n});let r=t?.client??Ct(),o=X9(),i=Qy(o);if(i.length===0){console.log(`No Cowork sessions found under ${o}`);return}let s=0,u=0,l=0,f=0;for(let h of i){let{artifactFiles:_,tempPaths:E}=await Bfe(h.localDir);try{if(_.length===0){f+=1;continue}if(n){console.log(`${h.sessionId}: ${_.length} artifact file(s) ready to upload`);continue}let T=await r.presignBackfillArtifacts({body:{harness:"cowork",harness_internal_id:h.sessionId,artifact_files:_.map(x=>({kind:x.kind,file_name:x.fileName,md5:x.md5,size_in_bytes:x.sizeInBytes,content_type:x.contentType}))}});if(T.status===404){l+=1;continue}if(T.status!==200){console.error(`${h.sessionId}: presign failed (${T.status})`);continue}let v=[];for(let x of T.body.artifact_files){let k=_.find(P=>P.kind===x.kind&&P.fileName===x.file_name);!k||!x.presigned_url||(await FKe(x.presigned_url,k.tempPath),v.push({kind:x.kind,file_name:x.file_name,storage_url:x.storage_url,md5:k.md5,size_in_bytes:k.sizeInBytes,content_type:k.contentType}))}if(v.length===0)continue;let R=await r.commitBackfillArtifacts({body:{harness:"cowork",harness_internal_id:h.sessionId,artifacts:v}});if(R.status!==200){console.error(`${h.sessionId}: commit failed (${R.status})`);continue}s+=R.body.created,u+=1,console.log(`${h.sessionId}: backfilled ${R.body.created} artifact(s)`)}finally{await Promise.all(E.map(T=>Ac(T)))}}if(n){console.log(`Dry run complete. ${f} session(s) had no artifact files.`);return}console.log(`Done. Backfilled ${s} artifact(s) across ${u} thread(s). Skipped ${l} not-yet-shared session(s) and ${f} with no artifact files.`)}};A();Sn();iy();A();await ho();var g5=ue(dn(),1);await fb();var Gfe=ue(Ht(),1);function brn({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,s]=(0,g5.useState)(HM),{exit:u}=Os();return(0,g5.useEffect)(()=>{let l=!1,f=h=>{l||s(_=>A5(_,h))};return(async()=>{try{let h=await n(f);if(l)return;r(h),setTimeout(()=>u(),100)}catch(h){if(f({kind:"error",message:h instanceof Error?h.message:String(h)}),l)return;o(h),setTimeout(()=>u(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{l=!0}},[]),(0,Gfe.jsx)(Nh,{title:e,subtitle:t,state:i})}async function E1(e){let t,n,r=!1;if(await cl((0,Gfe.jsx)(brn,{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();ex();yr();import Drn from"node:os";import Ftt from"node:path";A();import{spawn as Irn}from"node:child_process";import Crn from"node:os";async function Utt(e,t={}){let n=t.timeoutMs??2e3,r=vrn();for(let o of r)if(await Rrn(o,e,n))return!0;return!1}function vrn(){switch(Crn.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 Rrn(e,t,n){return new Promise(r=>{let o;try{o=Irn(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,s=l=>{i||(i=!0,r(l))},u=setTimeout(()=>{o.kill("SIGKILL"),s(!1)},n);o.on("error",()=>{clearTimeout(u),s(!1)}),o.on("close",l=>{clearTimeout(u),s(l===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}zt();Sn();$P();Th();A();var y1=()=>{};A();Sn();async function xrn(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw Bp(`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 h5(e,t,n){try{return await xrn(e,t,n)}catch(r){return z.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}A();zt();function Qtt(e){if(e instanceof Vx)return"billing_required";if(e instanceof eM)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof Re)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"}var Nrn=new Set(["private","workspace","public"]);function wrn(e){let t=(e??"").trim();if(!t)return"";if(!Nrn.has(t))throw new Re(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function jfe(e={}){let t=e.progress??y1,n=wrn(e.visibility),r=(e.project??process.cwd()).trim()||process.cwd(),o=(e.sessionId??"").trim(),i="resolving_session",s=null;try{t({kind:"step",step:"resolving_session"});let u=await _et({sessionId:o,project:r});i="auth",await Mrn();let l=e.client??Ct();i="collecting_local_file",s=await Brn(u),t({kind:"step",step:"uploading",label:s.filename}),i="uploading";let f=await krn(l,s);if(f.quarantined)return t({kind:"step",step:"done"}),{quarantined:!0,reason:f.reason,finding_count:f.findingCount,session_id:u.sessionId?.trim()??""};let{reused:h,thread:_}=f;z.info("export_upload_single_file_result",{filename:s.filename,reused:h,response:JSON.stringify(_)});let E=_?.id?.trim();if(!E)throw Wn().setContext("upload_single_file_response",{filename:s.filename,reused:h,response:_}),new Error(`upload session response missing thread id for ${s.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await YD(l,E);let T=_?.visibility?.trim()??"",v=T;n&&n!==T&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),v=await Orn(l,E,n));let R=Prn(E),x,k=e.highlight?.trim();if(k){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let j=await h5(l,E,k);j&&(R=j.url,x={query:k,matched:j.matched,start_block_id:j.start_block_id,end_block_id:j.end_block_id})}let P=await Utt(R);return t({kind:"completed",url:R,reused:h,visibility:v,clipboardCopied:P,sessionId:u.sessionId?.trim()??""}),t({kind:"step",step:"done"}),Ch("lore.cli.thread_exported",{thread_id:E,harness:s.harness,visibility:v,reused:h}),{thread_id:E,url:R,session_id:u.sessionId?.trim()??"",project:u.project,reused:h,visibility:v,clipboard_copied:P,...x?{highlight:x}:{}}}catch(u){throw Ch("lore.cli.upload_failed",{error_category:Qtt(u),error_message:Gt(u),step:i}),u}finally{s&&await Ac(s.tempPath)}}async function Brn(e){let t=await Eet(e),n=await qi(t.fullPath);if(!n.exists)throw new Re(`session transcript not found at ${Lrn(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await Dp(e.project),o=await dl(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 krn(e,t){let[n]=await kA(e,[t]);if(!n)throw new Error("upload session response missing thread file");if(n.status==="quarantined")return{quarantined:!0,reason:n.reason,findingCount:n.findingCount};if(n.status==="no_upload"){let r=n.error?.trim()?`: ${n.error.trim()}`:"";throw new Re(`upload session for ${t.filename} returned no upload URL and no reusable thread${r}`)}return{quarantined:!1,reused:n.status==="deduped",thread:n.thread}}async function Orn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Bp(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function Prn(e){return`${Iy().replace(/\/+$/,"")}/thread/${e}`}async function Mrn(){let e=await jt();if(!e)throw new Re("not logged in \u2014 run 'lore login' first");return e}function Lrn(e){let t=Drn.homedir();if(!t)return e;let n=Ftt.relative(t,e);return!n||n.startsWith("..")?e:Ftt.join("~",n)}var Gtt={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}){z.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(Cu()&&!t?.progress){let o=await E1({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:i=>jfe({...n,progress:i})});"quarantined"in o&&o.quarantined&&console.log(`
|
|
659
659
|
Held locally \u2014 not uploaded. ${o.finding_count} finding(s); reason: ${o.reason}. See \`lore quarantine\`.`);return}let r=await jfe({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};A();var jtt={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 $9(),await t5({uploadOptions:n});return}let r=await Bet(n);console.log(JSON.stringify(r))}};A();iy();A();yr();import{spawn as Urn}from"node:child_process";import ztt from"node:path";async function zfe(e){let t=e.progress??y1;if(!await jt())throw new f1;t({kind:"step",step:"resolving_session"});let r=ztt.resolve(e.sessionFile),o=ztt.basename(r),i=e.harnessInternalId?.trim()||jrn(o)||o,s=await qi(r);if(!s.exists)throw new Error(`session file does not exist: ${r}`);let u=await dl(r),l={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:u.tempPath,md5:u.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:s},f=e.client??Ct();try{t({kind:"step",step:"uploading",label:o});let[h]=await kA(f,[l]);if(!h)throw new Error("create upload session returned no thread files");if(h.status==="quarantined")return t({kind:"step",step:"done"}),{quarantined:!0,reason:h.reason,finding_count:h.findingCount,session_id:i};if(h.status==="no_upload"){let V=h.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${V}`)}let _=h.status==="deduped",E=h.thread,T=E?.id?.trim();if(!T)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await YD(f,T);let v=E?.visibility?.trim()??"",R=v,x=e.visibility;x&&x!==v&&(t({kind:"step",step:"updating_visibility"}),R=await Qrn(f,T,x));let k=`${Iy().replace(/\/+$/,"")}/thread/${T}`,P,j=e.highlight?.trim();if(j){t({kind:"step",step:"resolving_highlight"});let V=await h5(f,T,j);V&&(k=V.url,P={query:j,matched:V.matched,start_block_id:V.start_block_id,end_block_id:V.end_block_id})}let G=await zrn(k),$=Grn(R)?R:"private";return t({kind:"completed",url:k,reused:_,visibility:$,clipboardCopied:G,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:T,url:k,session_id:i,project:"",reused:_,visibility:$,clipboard_copied:G,...P?{highlight:P}:{}}}finally{await Ac(u.tempPath)}}async function Qrn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Bp(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var Frn=new Set(["private","workspace","public"]);function Grn(e){return Frn.has(e)}function jrn(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 zrn(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 Hrn(n,r,e))return!0;return!1}function Hrn(e,t,n){return new Promise(r=>{let o;try{o=Urn(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 Htt=["private","workspace","public"],$tt={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"},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=$rn(e.visibility);if(Cu()){let r=await E1({title:"lore share-codex",subtitle:"sharing this Codex session",perform:o=>zfe({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:o})});"quarantined"in r&&r.quarantined&&console.log(`
|
|
660
660
|
Held locally \u2014 not uploaded. ${r.finding_count} finding(s); reason: ${r.reason}. See \`lore quarantine\`.`)}else{let r=await zfe({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0});console.log(JSON.stringify(r))}}};function $rn(e){if(!(e==null||e==="")){if(typeof e!="string")throw new Error("--visibility must be a string");if(!Htt.includes(e))throw new Error(`--visibility must be one of: ${Htt.join(", ")}`);return e}}A();yr();Sn();iy();A();async function Hfe(e,t,n={}){let r=n.progress??y1,{contents:o,accountId:i,orgId:s,sessionId:u}=t;r({kind:"step",step:"resolving_session",label:u});let l=await O$("audit.jsonl",o.transcript),f={key:u,filename:"audit.jsonl",sourcePath:o.transcriptPath,repoOriginPath:"",tempPath:l.tempPath,md5:l.md5,fileType:"transcript",harness:"cowork",harnessInternalId:u,watchedState:{exists:!0,size:0,modTimeUnixMs:0},artifactMetadata:{uploads:o.uploads,outputs:o.outputs}};try{r({kind:"step",step:"uploading"});let[h]=await kA(e,[f]);if(!h)throw new Error("createUploadSession returned no thread files");if(h.status==="quarantined")return{quarantined:!0,reason:h.reason,findingCount:h.findingCount};if(h.status==="no_upload")throw new Error(`createUploadSession returned no presigned_url and no existing thread: ${JSON.stringify(h)}`);let _=h.thread?.id;if(!_)throw new Error(`upload session did not return a thread id: ${JSON.stringify(h)}`);return{threadId:_,duplicate:h.status==="deduped"}}finally{await Ac(l.tempPath)}}var qtt={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}){z.info("command_start",{command:"share-cowork",list:!!e.list,session:e.session??null});let n=Z9();if(e.list){let f=Qy(n);if(f.length===0){console.error(`No Cowork sessions found under ${n}`);return}for(let h of f)console.log(Vrn(h));return}let r=qrn(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
|
|
661
661
|
${n}
|