Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save sathyarajshetigar/65982a18239d316a5117fa6e2e66d161 to your computer and use it in GitHub Desktop.

Select an option

Save sathyarajshetigar/65982a18239d316a5117fa6e2e66d161 to your computer and use it in GitHub Desktop.
Auggie error
[Claude Haiku 4.5] d:\UnityProjects\SkipCardSolitaireGitLab
file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:459
Mongoose Error Code: ${t.code}`:""}`})}function Gye(e,t,r,n=void 0){r&&(0,O2n.safeExecuteInTheMiddle)(()=>r(e,{moduleVersion:n,response:t}),i=>{i&&FTt.diag.error("mongoose instrumentation: responseHook error",i)},!0)}function L2n(e,t,r,n=void 0){return e instanceof Promise?e.then(i=>(Gye(t,i,r,n),i)).catch(i=>{throw VTt(t,i),i}).finally(()=>t.end()):(Gye(t,e,r,n),t.end(),e)}j9.handlePromiseResponse=L2n;function G2n(e,t,r,n,i,a,o=void 0){let s=0;return i.length===2&&(s=1),i[s]=(c,l)=>(c?VTt(n,c):Gye(n,l,a,o),n.end(),e(c,l)),t.apply(r,i)}j9.handleCallbackResponse=G2n});var OTt=P(Ck=>{"use strict";Object.defineProperty(Ck,"__esModule",{value:!0});Ck.PACKAGE_NAME=Ck.PACKAGE_VERSION=void 0;Ck.PACKAGE_VERSION="0.46.1";Ck.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var ZTt=P(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});NS.MongooseInstrumentation=NS._STORED_PARENT_SPAN=void 0;var Th=(en(),pr(Nn)),$2n=ss(),$ye=MTt(),PTt=cs(),LTt=OTt(),jL=(Oc(),pr(Q1)),Xne=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],Z2n=["remove","count","findOneAndRemove",...Xne],X2n=["count","findOneAndRemove",...Xne],Q2n=[...Xne];function GTt(e){return e?e.startsWith("6.")||e.startsWith("5.")?Z2n:e.startsWith("7.")?X2n:Q2n:Xne}function $Tt(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}NS._STORED_PARENT_SPAN=Symbol("stored-parent-span");var Zye=class extends PTt.InstrumentationBase{constructor(t={}){super(LTt.PACKAGE_NAME,LTt.PACKAGE_VERSION,t)}init(){return new PTt.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <9"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,r){return this._wrap(t.Model.prototype,"save",this.patchOnModelMethods("save",r)),t.Model.prototype.$save=t.Model.prototype.save,$Tt(r)&&this._wrap(t.Model.prototype,"remove",this.patchOnModelMethods("remove",r)),this._wrap(t.Query.prototype,"exec",this.patchQueryExec(r)),this._wrap(t.Aggregate.prototype,"exec",this.patchAggregateExec(r)),GTt(r).forEach(i=>{this._wrap(t.Query.prototype,i,this.patchAndCaptureSpanContext(i))}),this._wrap(t.Model,"aggregate",this.patchModelAggregate()),t}unpatch(t,r){let n=GTt(r);this._unwrap(t.Model.prototype,"save"),t.Model.prototype.$save=t.Model.prototype.save,$Tt(r)&&this._unwrap(t.Model.prototype,"remove"),this._unwrap(t.Query.prototype,"exec"),this._unwrap(t.Aggregate.prototype,"exec"),n.forEach(i=>{this._unwrap(t.Query.prototype,i)}),this._unwrap(t.Model,"aggregate")}patchAggregateExec(t){let r=this;return n=>function(a){var o;if(r.getConfig().requireParentSpan&&Th.trace.getSpan(Th.context.active())===void 0)return n.apply(this,arguments);let s=this[NS._STORED_PARENT_SPAN],c={},{dbStatementSerializer:l}=r.getConfig();l&&(c[jL.SEMATTRS_DB_STATEMENT]=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline}));let d=r._startSpan(this._model.collection,(o=this._model)===null||o===void 0?void 0:o.modelName,"aggregate",c,s);return r._handleResponse(d,n,this,arguments,a,t)}}patchQueryExec(t){let r=this;return n=>function(a){if(r.getConfig().requireParentSpan&&Th.trace.getSpan(Th.context.active())===void 0)return n.apply(this,arguments);let o=this[NS._STORED_PARENT_SPAN],s={},{dbStatementSerializer:c}=r.getConfig();c&&(s[jL.SEMATTRS_DB_STATEMENT]=c(this.op,{condition:this._conditions,updates:this._update,options:this.options,fields:this._fields}));let l=r._startSpan(this.mongooseCollection,this.model.modelName,this.op,s,o);return r._handleResponse(l,n,this,arguments,a,t)}}patchOnModelMethods(t,r){let n=this;return i=>function(o,s){if(n.getConfig().requireParentSpan&&Th.trace.getSpan(Th.context.active())===void 0)return i.apply(this,arguments);let c={document:this};o&&!(o instanceof Function)&&(c.options=o);let l={},{dbStatementSerializer:d}=n.getConfig();d&&(l[jL.SEMATTRS_DB_STATEMENT]=d(t,c));let u=n._startSpan(this.constructor.collection,this.constructor.modelName,t,l);return o instanceof Function&&(s=o,o=void 0),n._handleResponse(u,i,this,arguments,s,r)}}patchModelAggregate(){let t=this;return r=>function(){let i=Th.trace.getSpan(Th.context.active()),a=t._callOriginalFunction(()=>r.apply(this,arguments));return a&&(a[NS._STORED_PARENT_SPAN]=i),a}}patchAndCaptureSpanContext(t){let r=this;return n=>function(){return this[NS._STORED_PARENT_SPAN]=Th.trace.getSpan(Th.context.active()),r._callOriginalFunction(()=>n.apply(this,arguments))}}_startSpan(t,r,n,i,a){return this.tracer.startSpan(`mongoose.${r}.${n}`,{kind:Th.SpanKind.CLIENT,attributes:Object.assign(Object.assign(Object.assign({},i),(0,$ye.getAttributesFromCollection)(t)),{[jL.SEMATTRS_DB_OPERATION]:n,[jL.SEMATTRS_DB_SYSTEM]:"mongoose"})},a?Th.trace.setSpan(Th.context.active(),a):void 0)}_handleResponse(t,r,n,i,a,o=void 0){let s=this;if(a instanceof Function)return s._callOriginalFunction(()=>(0,$ye.handleCallbackResponse)(a,r,n,t,i,s.getConfig().responseHook,o));{let c=s._callOriginalFunction(()=>r.apply(n,i));return(0,$ye.handlePromiseResponse)(c,t,s.getConfig().responseHook,o)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Th.context.with((0,$2n.suppressTracing)(Th.context.active()),t):t()}};NS.MongooseInstrumentation=Zye});var QTt=P(XTt=>{"use strict";Object.defineProperty(XTt,"__esModule",{value:!0})});var HTt=P(e8=>{"use strict";var Y2n=e8&&e8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),YTt=e8&&e8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Y2n(t,e,r)};Object.defineProperty(e8,"__esModule",{value:!0});YTt(ZTt(),e8);YTt(QTt(),e8)});var jTt=P(eG=>{"use strict";Object.defineProperty(eG,"__esModule",{value:!0});eG.AttributeNames=void 0;var J2n;(function(e){e.MYSQL_VALUES="db.mysql.values"})(J2n=eG.AttributeNames||(eG.AttributeNames={}))});var tIt=P(D2=>{"use strict";Object.defineProperty(D2,"__esModule",{value:!0});D2.getPoolName=D2.arrayStringifyHelper=D2.getSpanName=D2.getDbValues=D2.getDbStatement=D2.getConnectionAttributes=void 0;var S6=(Oc(),pr(Q1));function z2n(e){let{host:t,port:r,database:n,user:i}=K2n(e),a=parseInt(r,10);return isNaN(a)?{[S6.SEMATTRS_NET_PEER_NAME]:t,[S6.SEMATTRS_DB_CONNECTION_STRING]:eIt(t,r,n),[S6.SEMATTRS_DB_NAME]:n,[S6.SEMATTRS_DB_USER]:i}:{[S6.SEMATTRS_NET_PEER_NAME]:t,[S6.SEMATTRS_NET_PEER_PORT]:a,[S6.SEMATTRS_DB_CONNECTION_STRING]:eIt(t,r,n),[S6.SEMATTRS_DB_NAME]:n,[S6.SEMATTRS_DB_USER]:i}}D2.getConnectionAttributes=z2n;function K2n(e){let{host:t,port:r,database:n,user:i}=e&&e.connectionConfig||e||{};return{host:t,port:r,database:n,user:i}}function eIt(e,t,r){let n=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(n+=`:${t}`),typeof r=="string"&&(n+=`/${r}`),n}function q2n(e){return typeof e=="string"?e:e.sql}D2.getDbStatement=q2n;function j2n(e,t){return Xye(typeof e=="string"?t:t||e.values)}D2.getDbValues=j2n;function egn(e){let t=typeof e=="object"?e.sql:e,r=t?.indexOf(" ");return typeof r=="number"&&r!==-1?t?.substring(0,r):t}D2.getSpanName=egn;function Xye(e){return e?`[${e.toString()}]`:""}D2.arrayStringifyHelper=Xye;function tgn(e){let t=e.config.connectionConfig,r="";return r+=t.host?`host: '${t.host}', `:"",r+=t.port?`port: ${t.port}, `:"",r+=t.database?`database: '${t.database}', `:"",r+=t.user?`user: '${t.user}'`:"",t.user||(r=r.substring(0,r.length-2)),r.trim()}D2.getPoolName=tgn});var rIt=P(xk=>{"use strict";Object.defineProperty(xk,"__esModule",{value:!0});xk.PACKAGE_NAME=xk.PACKAGE_VERSION=void 0;xk.PACKAGE_VERSION="0.45.1";xk.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var iIt=P(Yne=>{"use strict";Object.defineProperty(Yne,"__esModule",{value:!0});Yne.MySQLInstrumentation=void 0;var B2=(en(),pr(Nn)),Rk=cs(),Qye=(Oc(),pr(Q1)),rgn=jTt(),Tk=tIt(),nIt=rIt(),Qne=class e extends Rk.InstrumentationBase{constructor(t={}){super(nIt.PACKAGE_NAME,nIt.PACKAGE_VERSION,t),this._setMetricInstruments()}setMeterProvider(t){super.setMeterProvider(t),this._setMetricInstruments()}_setMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter("db.client.connections.usage",{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}init(){return[new Rk.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,Rk.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,Rk.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,Rk.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 r=this;return function(i){let a=t(...arguments);return r._wrap(a,"query",r._patchQuery(a)),a}}}_patchCreatePool(){return t=>{let r=this;return function(i){let a=t(...arguments);return r._wrap(a,"query",r._patchQuery(a)),r._wrap(a,"getConnection",r._patchGetConnection(a)),r._wrap(a,"end",r._patchPoolEnd(a)),r._setPoolcallbacks(a,r,""),a}}}_patchPoolEnd(t){return r=>{let n=this;return function(a){let o=t._allConnections.length,s=t._freeConnections.length,c=o-s,l=(0,Tk.getPoolName)(t);n._connectionsUsage.add(-c,{state:"used",name:l}),n._connectionsUsage.add(-s,{state:"idle",name:l}),r.apply(t,arguments)}}}_patchCreatePoolCluster(){return t=>{let r=this;return function(i){let a=t(...arguments);return r._wrap(a,"getConnection",r._patchGetConnection(a)),r._wrap(a,"add",r._patchAdd(a)),a}}}_patchAdd(t){return r=>{let n=this;return function(a,o){if(!n._enabled)return n._unwrap(t,"add"),r.apply(t,arguments);r.apply(t,arguments);let s=t._nodes;if(s){let c=typeof a=="object"?"CLUSTER::"+t._lastId:String(a),l=s[c].pool;n._setPoolcallbacks(l,n,a)}}}}_patchGetConnection(t){return r=>{let n=this;return function(a,o,s){if(!n._enabled)return n._unwrap(t,"getConnection"),r.apply(t,arguments);if(arguments.length===1&&typeof a=="function"){let c=n._getConnectionCallbackPatchFn(a);return r.call(t,c)}if(arguments.length===2&&typeof o=="function"){let c=n._getConnectionCallbackPatchFn(o);return r.call(t,a,c)}if(arguments.length===3&&typeof s=="function"){let c=n._getConnectionCallbackPatchFn(s);return r.call(t,a,o,c)}return r.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let r=this,n=B2.context.active();return function(i,a){a&&((0,Rk.isWrapped)(a.query)||r._wrap(a,"query",r._patchQuery(a))),typeof t=="function"&&B2.context.with(n,t,this,i,a)}}_patchQuery(t){return r=>{let n=this;return function(i,a,o){if(!n._enabled)return n._unwrap(t,"query"),r.apply(t,arguments);let s=n.tracer.startSpan((0,Tk.getSpanName)(i),{kind:B2.SpanKind.CLIENT,attributes:Object.assign(Object.assign({},e.COMMON_ATTRIBUTES),(0,Tk.getConnectionAttributes)(t.config))});if(s.setAttribute(Qye.SEMATTRS_DB_STATEMENT,(0,Tk.getDbStatement)(i)),n.getConfig().enhancedDatabaseReporting){let d;Array.isArray(a)?d=a:arguments[2]&&(d=[a]),s.setAttribute(rgn.AttributeNames.MYSQL_VALUES,(0,Tk.getDbValues)(i,d))}let c=Array.from(arguments).findIndex(d=>typeof d=="function"),l=B2.context.active();if(c===-1){let d=B2.context.with(B2.trace.setSpan(B2.context.active(),s),()=>r.apply(t,arguments));return B2.context.bind(l,d),d.on("error",u=>s.setStatus({code:B2.SpanStatusCode.ERROR,message:u.message})).on("end",()=>{s.end()})}else return n._wrap(arguments,c,n._patchCallbackQuery(s,l)),B2.context.with(B2.trace.setSpan(B2.context.active(),s),()=>r.apply(t,arguments))}}}_patchCallbackQuery(t,r){return n=>function(i,a,o){return i&&t.setStatus({code:B2.SpanStatusCode.ERROR,message:i.message}),t.end(),B2.context.with(r,()=>n(...arguments))}}_setPoolcallbacks(t,r,n){let i=n||(0,Tk.getPoolName)(t);t.on("connection",a=>{r._connectionsUsage.add(1,{state:"idle",name:i})}),t.on("acquire",a=>{r._connectionsUsage.add(-1,{state:"idle",name:i}),r._connectionsUsage.add(1,{state:"used",name:i})}),t.on("release",a=>{r._connectionsUsage.add(-1,{state:"used",name:i}),r._connectionsUsage.add(1,{state:"idle",name:i})})}};Yne.MySQLInstrumentation=Qne;Qne.COMMON_ATTRIBUTES={[Qye.SEMATTRS_DB_SYSTEM]:Qye.DBSYSTEMVALUES_MYSQL}});var oIt=P(aIt=>{"use strict";Object.defineProperty(aIt,"__esModule",{value:!0})});var cIt=P(t8=>{"use strict";var ngn=t8&&t8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),sIt=t8&&t8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&ngn(t,e,r)};Object.defineProperty(t8,"__esModule",{value:!0});sIt(iIt(),t8);sIt(oIt(),t8)});var Hye=P(Hne=>{"use strict";Object.defineProperty(Hne,"__esModule",{value:!0});Hne.addSqlCommenterComment=void 0;var Yye=(en(),pr(Nn)),agn=ss();function ogn(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let n=e.indexOf("*/");return t<n}function sgn(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function cgn(e,t){if(typeof t!="string"||t.length===0||ogn(t))return t;let r=new agn.W3CTraceContextPropagator,n={};r.inject(Yye.trace.setSpan(Yye.ROOT_CONTEXT,e),n,Yye.defaultTextMapSetter);let i=Object.keys(n).sort();if(i.length===0)return t;let a=i.map(o=>{let s=sgn(n[o]);return`${o}='${s}'`}).join(",");return`${t} /*${a}*/`}Hne.addSqlCommenterComment=cgn});var mIt=P(u4=>{"use strict";Object.defineProperty(u4,"__esModule",{value:!0});u4.getConnectionPrototypeToInstrument=u4.once=u4.getSpanName=u4.getDbStatement=u4.getConnectionAttributes=void 0;var E6=(Oc(),pr(Q1));function lgn(e){let{host:t,port:r,database:n,user:i}=ugn(e),a=parseInt(r,10);return isNaN(a)?{[E6.SEMATTRS_NET_PEER_NAME]:t,[E6.SEMATTRS_DB_CONNECTION_STRING]:fIt(t,r,n),[E6.SEMATTRS_DB_NAME]:n,[E6.SEMATTRS_DB_USER]:i}:{[E6.SEMATTRS_NET_PEER_NAME]:t,[E6.SEMATTRS_NET_PEER_PORT]:a,[E6.SEMATTRS_DB_CONNECTION_STRING]:fIt(t,r,n),[E6.SEMATTRS_DB_NAME]:n,[E6.SEMATTRS_DB_USER]:i}}u4.getConnectionAttributes=lgn;function ugn(e){let{host:t,port:r,database:n,user:i}=e&&e.connectionConfig||e||{};return{host:t,port:r,database:n,user:i}}function fIt(e,t,r){let n=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(n+=`:${t}`),typeof r=="string"&&(n+=`/${r}`),n}function dgn(e,t,r){return t?typeof e=="string"?r?t(e,r):e:r||e.values?t(e.sql,r||e.values):e.sql:typeof e=="string"?e:e.sql}u4.getDbStatement=dgn;function pgn(e){let t=typeof e=="object"?e.sql:e,r=t?.indexOf(" ");return typeof r=="number"&&r!==-1?t?.substring(0,r):t}u4.getSpanName=pgn;var fgn=e=>{let t=!1;return(...r)=>{if(!t)return t=!0,e(...r)}};u4.once=fgn;function mgn(e){let t=e.prototype,r=Object.getPrototypeOf(t);return typeof r?.query=="function"&&typeof r?.execute=="function"?r:t}u4.getConnectionPrototypeToInstrument=mgn});var hIt=P(Ik=>{"use strict";Object.defineProperty(Ik,"__esModule",{value:!0});Ik.PACKAGE_NAME=Ik.PACKAGE_VERSION=void 0;Ik.PACKAGE_VERSION="0.45.2";Ik.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var bIt=P(zne=>{"use strict";Object.defineProperty(zne,"__esModule",{value:!0});zne.MySQL2Instrumentation=void 0;var gIt=(en(),pr(Nn)),zR=cs(),zye=(Oc(),pr(Q1)),AIt=Hye(),wk=mIt(),_It=hIt(),Jye=[">=1.4.2 <4"],Jne=class e extends zR.InstrumentationBase{constructor(t={}){super(_It.PACKAGE_NAME,_It.PACKAGE_VERSION,t)}init(){let t;function r(a){!t&&a.format&&(t=a.format)}let n=a=>{(0,zR.isWrapped)(a.query)&&this._unwrap(a,"query"),this._wrap(a,"query",this._patchQuery(t,!1)),(0,zR.isWrapped)(a.execute)&&this._unwrap(a,"execute"),this._wrap(a,"execute",this._patchQuery(t,!0))},i=a=>{this._unwrap(a,"query"),this._unwrap(a,"execute")};return[new zR.InstrumentationNodeModuleDefinition("mysql2",Jye,a=>(r(a),a),()=>{},[new zR.InstrumentationNodeModuleFile("mysql2/promise.js",Jye,a=>(r(a),a),()=>{}),new zR.InstrumentationNodeModuleFile("mysql2/lib/connection.js",Jye,a=>{let o=(0,wk.getConnectionPrototypeToInstrument)(a);return n(o),a},a=>{if(a===void 0)return;let o=(0,wk.getConnectionPrototypeToInstrument)(a);i(o)})])]}_patchQuery(t,r){return n=>{let i=this;return function(a,o,s){let c;Array.isArray(o)?c=o:arguments[2]&&(c=[o]);let l=i.tracer.startSpan((0,wk.getSpanName)(a),{kind:gIt.SpanKind.CLIENT,attributes:Object.assign(Object.assign(Object.assign({},e.COMMON_ATTRIBUTES),(0,wk.getConnectionAttributes)(this.config)),{[zye.SEMATTRS_DB_STATEMENT]:(0,wk.getDbStatement)(a,t,c)})});!r&&i.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=a=typeof a=="string"?(0,AIt.addSqlCommenterComment)(l,a):Object.assign(a,{sql:(0,AIt.addSqlCommenterComment)(l,a.sql)}));let d=(0,wk.once)((u,f)=>{if(u)l.setStatus({code:gIt.SpanStatusCode.ERROR,message:u.message});else{let{responseHook:p}=i.getConfig();typeof p=="function"&&(0,zR.safeExecuteInTheMiddle)(()=>{p(l,{queryResults:f})},A=>{A&&i._diag.warn("Failed executing responseHook",A)},!0)}l.end()});if(arguments.length===1){typeof a.onResult=="function"&&i._wrap(a,"onResult",i._patchCallbackQuery(d));let u=n.apply(this,arguments);return u.once("error",f=>{d(f)}).once("result",f=>{d(void 0,f)}),u}return typeof arguments[1]=="function"?i._wrap(arguments,1,i._patchCallbackQuery(d)):typeof arguments[2]=="function"&&i._wrap(arguments,2,i._patchCallbackQuery(d)),n.apply(this,arguments)}}}_patchCallbackQuery(t){return r=>function(n,i,a){return t(n,i),r(...arguments)}}};zne.MySQL2Instrumentation=Jne;Jne.COMMON_ATTRIBUTES={[zye.SEMATTRS_DB_SYSTEM]:zye.DBSYSTEMVALUES_MYSQL}});var EIt=P(SIt=>{"use strict";Object.defineProperty(SIt,"__esModule",{value:!0})});var yIt=P(r8=>{"use strict";var hgn=r8&&r8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),vIt=r8&&r8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&hgn(t,e,r)};Object.defineProperty(r8,"__esModule",{value:!0});vIt(bIt(),r8);vIt(EIt(),r8)});var IIt=P(Kne=>{"use strict";Object.defineProperty(Kne,"__esModule",{value:!0});Kne.endSpan=void 0;var Agn=(en(),pr(Nn)),_gn=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:Agn.SpanStatusCode.ERROR,message:t.message})),e.end()};Kne.endSpan=_gn});var Kye=P(qne=>{"use strict";Object.defineProperty(qne,"__esModule",{value:!0});qne.defaultDbStatementSerializer=void 0;var bgn=[{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}],Sgn=(e,t)=>{var r,n;if(Array.isArray(t)&&t.length){let i=(n=(r=bgn.find(({regex:o})=>o.test(e)))===null||r===void 0?void 0:r.args)!==null&&n!==void 0?n:0,a=i>=0?t.slice(0,i):t;return t.length>a.length&&a.push(`[${t.length-i} other arguments]`),`${e} ${a.join(" ")}`}return e};qne.defaultDbStatementSerializer=Sgn});var wIt=P(Uk=>{"use strict";Object.defineProperty(Uk,"__esModule",{value:!0});Uk.PACKAGE_NAME=Uk.PACKAGE_VERSION=void 0;Uk.PACKAGE_VERSION="0.47.1";Uk.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var kIt=P(eie=>{"use strict";Object.defineProperty(eie,"__esModule",{value:!0});eie.IORedisInstrumentation=void 0;var n8=(en(),pr(Nn)),jne=cs(),d4=(Oc(),pr(Q1)),UIt=cs(),tG=IIt(),Egn=Kye(),WIt=wIt(),NIt={requireParentSpan:!0},qye=class extends jne.InstrumentationBase{constructor(t={}){super(WIt.PACKAGE_NAME,WIt.PACKAGE_VERSION,Object.assign(Object.assign({},NIt),t))}setConfig(t={}){super.setConfig(Object.assign(Object.assign({},NIt),t))}init(){return[new jne.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,r)=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,jne.isWrapped)(n.prototype.sendCommand)&&this._unwrap(n.prototype,"sendCommand"),this._wrap(n.prototype,"sendCommand",this._patchSendCommand(r)),(0,jne.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let r=t[Symbol.toStringTag]==="Module"?t.default:t;this._unwrap(r.prototype,"sendCommand"),this._unwrap(r.prototype,"connect")})]}_patchSendCommand(t){return r=>this._traceSendCommand(r,t)}_patchConnection(){return t=>this._traceConnection(t)}_traceSendCommand(t,r){let n=this;return function(i){if(arguments.length<1||typeof i!="object")return t.apply(this,arguments);let a=n.getConfig(),o=a.dbStatementSerializer||Egn.defaultDbStatementSerializer,s=n8.trace.getSpan(n8.context.active())===void 0;if(a.requireParentSpan===!0&&s)return t.apply(this,arguments);let c=n.tracer.startSpan(i.name,{kind:n8.SpanKind.CLIENT,attributes:{[d4.SEMATTRS_DB_SYSTEM]:d4.DBSYSTEMVALUES_REDIS,[d4.SEMATTRS_DB_STATEMENT]:o(i.name,i.args)}}),{requestHook:l}=a;l&&(0,UIt.safeExecuteInTheMiddle)(()=>l(c,{moduleVersion:r,cmdName:i.name,cmdArgs:i.args}),f=>{f&&n8.diag.error("ioredis instrumentation: request hook failed",f)},!0);let{host:d,port:u}=this.options;c.setAttributes({[d4.SEMATTRS_NET_PEER_NAME]:d,[d4.SEMATTRS_NET_PEER_PORT]:u,[d4.SEMATTRS_DB_CONNECTION_STRING]:`redis://${d}:${u}`});try{let f=t.apply(this,arguments),p=i.resolve;i.resolve=function(g){(0,UIt.safeExecuteInTheMiddle)(()=>{var v;return(v=a.responseHook)===null||v===void 0?void 0:v.call(a,c,i.name,i.args,g)},v=>{v&&n8.diag.error("ioredis instrumentation: response hook failed",v)},!0),(0,tG.endSpan)(c,null),p(g)};let A=i.reject;return i.reject=function(g){(0,tG.endSpan)(c,g),A(g)},f}catch(f){throw(0,tG.endSpan)(c,f),f}}}_traceConnection(t){let r=this;return function(){let n=n8.trace.getSpan(n8.context.active())===void 0;if(r.getConfig().requireParentSpan===!0&&n)return t.apply(this,arguments);let i=r.tracer.startSpan("connect",{kind:n8.SpanKind.CLIENT,attributes:{[d4.SEMATTRS_DB_SYSTEM]:d4.DBSYSTEMVALUES_REDIS,[d4.SEMATTRS_DB_STATEMENT]:"connect"}}),{host:a,port:o}=this.options;i.setAttributes({[d4.SEMATTRS_NET_PEER_NAME]:a,[d4.SEMATTRS_NET_PEER_PORT]:o,[d4.SEMATTRS_DB_CONNECTION_STRING]:`redis://${a}:${o}`});try{let s=t.apply(this,arguments);return(0,tG.endSpan)(i,null),s}catch(s){throw(0,tG.endSpan)(i,s),s}}}};eie.IORedisInstrumentation=qye});var BIt=P(DIt=>{"use strict";Object.defineProperty(DIt,"__esModule",{value:!0})});var VIt=P(i8=>{"use strict";var vgn=i8&&i8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),FIt=i8&&i8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&vgn(t,e,r)};Object.defineProperty(i8,"__esModule",{value:!0});FIt(kIt(),i8);FIt(BIt(),i8)});var MIt=P(tie=>{"use strict";Object.defineProperty(tie,"__esModule",{value:!0});tie.getClientAttributes=void 0;var rG=(Oc(),pr(Q1));function ygn(e,t){var r,n;return{[rG.SEMATTRS_DB_SYSTEM]:rG.DBSYSTEMVALUES_REDIS,[rG.SEMATTRS_NET_PEER_NAME]:(r=t?.socket)===null||r===void 0?void 0:r.host,[rG.SEMATTRS_NET_PEER_PORT]:(n=t?.socket)===null||n===void 0?void 0:n.port,[rG.SEMATTRS_DB_CONNECTION_STRING]:Cgn(e,t?.url)}}tie.getClientAttributes=ygn;function Cgn(e,t){if(!(typeof t!="string"||!t))try{let r=new URL(t);return r.searchParams.delete("user_pwd"),r.username="",r.password="",r.href}catch(r){e.error("failed to sanitize redis connection url",r)}}});var OIt=P(Wk=>{"use strict";Object.defineProperty(Wk,"__esModule",{value:!0});Wk.PACKAGE_NAME=Wk.PACKAGE_VERSION=void 0;Wk.PACKAGE_VERSION="0.46.1";Wk.PACKAGE_NAME="@opentelemetry/instrumentation-redis-4"});var ZIt=P(nie=>{"use strict";Object.defineProperty(nie,"__esModule",{value:!0});nie.RedisInstrumentation=void 0;var p4=(en(),pr(Nn)),af=cs(),PIt=MIt(),xgn=Kye(),LIt=OIt(),Rgn=(Oc(),pr(Q1)),nG=Symbol("opentelemetry.instrumentation.redis.open_spans"),GIt=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),$It={requireParentSpan:!1},rie=class e extends af.InstrumentationBase{constructor(t={}){super(LIt.PACKAGE_NAME,LIt.PACKAGE_VERSION,Object.assign(Object.assign({},$It),t))}setConfig(t={}){super.setConfig(Object.assign(Object.assign({},$It),t))}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let r=new af.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(a,o)=>{let s=a.transformCommandArguments;if(!s)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),a;let c=o?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,af.isWrapped)(a?.[c])&&this._unwrap(a,c),this._wrap(a,c,this._getPatchExtendWithCommands(s)),a},a=>{(0,af.isWrapped)(a?.extendWithCommands)&&this._unwrap(a,"extendWithCommands"),(0,af.isWrapped)(a?.attachCommands)&&this._unwrap(a,"attachCommands")}),n=new af.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0"],a=>{var o;let s=(o=a?.default)===null||o===void 0?void 0:o.prototype;return(0,af.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec()),(0,af.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),a},a=>{var o;let s=(o=a?.default)===null||o===void 0?void 0:o.prototype;(0,af.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,af.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),i=new af.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0"],a=>{var o;let s=(o=a?.default)===null||o===void 0?void 0:o.prototype;return s?.multi&&((0,af.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,af.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,af.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(s,"connect",this._getPatchedClientConnect()),a},a=>{var o;let s=(o=a?.default)===null||o===void 0?void 0:o.prototype;(0,af.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,af.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,af.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new af.InstrumentationNodeModuleDefinition(t,["^1.0.0"],a=>a,()=>{},[r,n,i])}_getPatchExtendWithCommands(t){let r=this;return function(i){return function(o){var s;if(((s=o?.BaseClass)===null||s===void 0?void 0:s.name)!=="RedisClient")return i.apply(this,arguments);let c=o.executor;return o.executor=function(l,d){let u=t(l,d).args;return r._traceClientCommand(c,this,arguments,u)},i.apply(this,arguments)}}}_getPatchMultiCommandsExec(){let t=this;return function(n){return function(){let a=n.apply(this,arguments);return typeof a?.then!="function"?(t._diag.error("got non promise result when patching RedisClientMultiCommand.exec"),a):a.then(o=>{let s=this[nG];return t._endSpansWithRedisReplies(s,o),o}).catch(o=>{let s=this[nG];if(!s)t._diag.error("cannot find open spans to end for redis multi command");else{let c=o.constructor.name==="MultiErrorReply"?o.replies:new Array(s.length).fill(o);t._endSpansWithRedisReplies(s,c)}return Promise.reject(o)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(n){return function(a){return t._traceClientCommand(n,this,arguments,a)}}}_getPatchRedisClientMulti(){return function(r){return function(){let i=r.apply(this,arguments);return i[GIt]=this.options,i}}}_getPatchRedisClientSendCommand(){let t=this;return function(n){return function(a){return t._traceClientCommand(n,this,arguments,a)}}}_getPatchedClientConnect(){let t=this;return function(n){return function(){let a=this.options,o=(0,PIt.getClientAttributes)(t._diag,a),s=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:p4.SpanKind.CLIENT,attributes:o});return p4.context.with(p4.trace.setSpan(p4.context.active(),s),()=>n.apply(this)).then(l=>(s.end(),l)).catch(l=>(s.recordException(l),s.setStatus({code:p4.SpanStatusCode.ERROR,message:l.message}),s.end(),Promise.reject(l)))}}}_traceClientCommand(t,r,n,i){if(p4.trace.getSpan(p4.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(r,n);let o=r.options||r[GIt],s=i[0],c=i.slice(1),l=this.getConfig().dbStatementSerializer||xgn.defaultDbStatementSerializer,d=(0,PIt.getClientAttributes)(this._diag,o);try{let p=l(s,c);p!=null&&(d[Rgn.SEMATTRS_DB_STATEMENT]=p)}catch(p){this._diag.error("dbStatementSerializer throw an exception",p,{commandName:s})}let u=this.tracer.startSpan(`${e.COMPONENT}-${s}`,{kind:p4.SpanKind.CLIENT,attributes:d}),f=p4.context.with(p4.trace.setSpan(p4.context.active(),u),()=>t.apply(r,n));if(typeof f?.then=="function")f.then(p=>{this._endSpanWithResponse(u,s,c,p,void 0)},p=>{this._endSpanWithResponse(u,s,c,null,p)});else{let p=f;p[nG]=p[nG]||[],p[nG].push({span:u,commandName:s,commandArgs:c})}return f}_endSpansWithRedisReplies(t,r){if(!t)return this._diag.error("cannot find open spans to end for redis multi command");if(r.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");for(let n=0;n<t.length;n++){let{span:i,commandName:a,commandArgs:o}=t[n],s=r[n],[c,l]=s instanceof Error?[null,s]:[s,void 0];this._endSpanWithResponse(i,a,o,c,l)}}_endSpanWithResponse(t,r,n,i,a){let{responseHook:o}=this.getConfig();if(!a&&o)try{o(t,r,n,i)}catch(s){this._diag.error("responseHook throw an exception",s)}a&&(t.recordException(a),t.setStatus({code:p4.SpanStatusCode.ERROR,message:a?.message})),t.end()}};nie.RedisInstrumentation=rie;rie.COMPONENT="redis"});var QIt=P(XIt=>{"use strict";Object.defineProperty(XIt,"__esModule",{value:!0})});var HIt=P(a8=>{"use strict";var Tgn=a8&&a8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),YIt=a8&&a8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Tgn(t,e,r)};Object.defineProperty(a8,"__esModule",{value:!0});YIt(ZIt(),a8);YIt(QIt(),a8)});var awt=P(iie=>{"use strict";Object.defineProperty(iie,"__esModule",{value:!0});iie.EVENT_LISTENERS_SET=void 0;iie.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var r7e=P(aG=>{"use strict";Object.defineProperty(aG,"__esModule",{value:!0});aG.AttributeNames=void 0;var Dgn;(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"})(Dgn=aG.AttributeNames||(aG.AttributeNames={}))});var n7e=P(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.METRIC_DB_CLIENT_OPERATION_DURATION=Ad.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Ad.METRIC_DB_CLIENT_CONNECTION_COUNT=Ad.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Ad.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Ad.ATTR_DB_OPERATION_NAME=Ad.ATTR_DB_NAMESPACE=Ad.ATTR_DB_CLIENT_CONNECTION_STATE=Ad.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Ad.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Ad.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Ad.ATTR_DB_NAMESPACE="db.namespace";Ad.ATTR_DB_OPERATION_NAME="db.operation.name";Ad.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Ad.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Ad.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Ad.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests";Ad.METRIC_DB_CLIENT_OPERATION_DURATION="db.client.operation.duration"});var i7e=P(oG=>{"use strict";Object.defineProperty(oG,"__esModule",{value:!0});oG.SpanNames=void 0;var Bgn;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(Bgn=oG.SpanNames||(oG.SpanNames={}))});var pwt=P(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.isObjectWithTextString=ds.getErrorMessage=ds.patchClientConnectCallback=ds.patchCallbackPGPool=ds.updateCounter=ds.getPoolName=ds.patchCallback=ds.handleExecutionResult=ds.handleConfigQuery=ds.shouldSkipInstrumentation=ds.getSemanticAttributesFromPool=ds.getSemanticAttributesFromConnection=ds.getConnectionString=ds.parseNormalizedOperationName=ds.getQuerySpanName=void 0;var o8=(en(),pr(Nn)),aie=r7e(),ym=(Oc(),pr(Q1)),KR=n7e(),Fgn=cs(),owt=i7e();function swt(e,t){if(!t)return owt.SpanNames.QUERY_PREFIX;let r=typeof t.name=="string"&&t.name?t.name:cwt(t.text);return`${owt.SpanNames.QUERY_PREFIX}:${r}${e?` ${e}`:""}`}ds.getQuerySpanName=swt;function cwt(e){let t=e.indexOf(" "),r=t===-1?e:e.slice(0,t);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}ds.parseNormalizedOperationName=cwt;function a7e(e){let t=e.host||"localhost",r=e.port||5432,n=e.database||"";return`postgresql://${t}:${r}/${n}`}ds.getConnectionString=a7e;function lwt(e){if(Number.isInteger(e))return e}function uwt(e){return{[ym.SEMATTRS_DB_SYSTEM]:ym.DBSYSTEMVALUES_POSTGRESQL,[ym.SEMATTRS_DB_NAME]:e.database,[ym.SEMATTRS_DB_CONNECTION_STRING]:a7e(e),[ym.SEMATTRS_NET_PEER_NAME]:e.host,[ym.SEMATTRS_NET_PEER_PORT]:lwt(e.port),[ym.SEMATTRS_DB_USER]:e.user}}ds.getSemanticAttributesFromConnection=uwt;function Vgn(e){return{[ym.SEMATTRS_DB_SYSTEM]:ym.DBSYSTEMVALUES_POSTGRESQL,[ym.SEMATTRS_DB_NAME]:e.database,[ym.SEMATTRS_DB_CONNECTION_STRING]:a7e(e),[ym.SEMATTRS_NET_PEER_NAME]:e.host,[ym.SEMATTRS_NET_PEER_PORT]:lwt(e.port),[ym.SEMATTRS_DB_USER]:e.user,[aie.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[aie.AttributeNames.MAX_CLIENT]:e.maxClient}}ds.getSemanticAttributesFromPool=Vgn;function Mgn(e){return e.requireParentSpan===!0&&o8.trace.getSpan(o8.context.active())===void 0}ds.shouldSkipInstrumentation=Mgn;function Ogn(e,t,r){let{connectionParameters:n}=this,i=n.database,a=swt(i,r),o=e.startSpan(a,{kind:o8.SpanKind.CLIENT,attributes:uwt(n)});if(!r)return o;if(r.text&&o.setAttribute(ym.SEMATTRS_DB_STATEMENT,r.text),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let s=r.values.map(c=>c==null?"null":c instanceof Buffer?c.toString():typeof c=="object"?typeof c.toPostgres=="function"?c.toPostgres():JSON.stringify(c):c.toString());o.setAttribute(aie.AttributeNames.PG_VALUES,s)}catch(s){o8.diag.error("failed to stringify ",r.values,s)}return typeof r.name=="string"&&o.setAttribute(aie.AttributeNames.PG_PLAN,r.name),o}ds.handleConfigQuery=Ogn;function dwt(e,t,r){typeof e.responseHook=="function"&&(0,Fgn.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:r})},n=>{n&&o8.diag.error("Error running response hook",n)},!0)}ds.handleExecutionResult=dwt;function Pgn(e,t,r,n,i){return function(o,s){o?(Object.prototype.hasOwnProperty.call(o,"code")&&(n[ym.ATTR_ERROR_TYPE]=o.code),t.setStatus({code:o8.SpanStatusCode.ERROR,message:o.message})):dwt(e,t,s),i(),t.end(),r.call(this,o,s)}}ds.patchCallback=Pgn;function Lgn(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()}ds.getPoolName=Lgn;function Ggn(e,t,r,n,i){let a=t.totalCount,o=t.waitingCount,s=t.idleCount,c=a-s;return r.add(c-i.used,{[KR.ATTR_DB_CLIENT_CONNECTION_STATE]:KR.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[KR.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-i.idle,{[KR.ATTR_DB_CLIENT_CONNECTION_STATE]:KR.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[KR.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(o-i.pending,{[KR.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:c,idle:s,pending:o}}ds.updateCounter=Ggn;function $gn(e,t){return function(n,i,a){n&&e.setStatus({code:o8.SpanStatusCode.ERROR,message:n.message}),e.end(),t.call(this,n,i,a)}}ds.patchCallbackPGPool=$gn;function Zgn(e,t){return function(n){n&&e.setStatus({code:o8.SpanStatusCode.ERROR,message:n.message}),e.end(),t.apply(this,arguments)}}ds.patchClientConnectCallback=Zgn;function Xgn(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}ds.getErrorMessage=Xgn;function Qgn(e){var t;return typeof e=="object"&&typeof((t=e)===null||t===void 0?void 0:t.text)=="string"}ds.isObjectWithTextString=Qgn});var fwt=P(Nk=>{"use strict";Object.defineProperty(Nk,"__esModule",{value:!0});Nk.PACKAGE_NAME=Nk.PACKAGE_VERSION=void 0;Nk.PACKAGE_VERSION="0.51.1";Nk.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var bwt=P(cie=>{"use strict";Object.defineProperty(cie,"__esModule",{value:!0});cie.PgInstrumentation=void 0;var f4=cs(),bc=(en(),pr(Nn)),mwt=awt(),_d=pwt(),hwt=Hye(),gwt=fwt(),Awt=i7e(),oie=ss(),s8=(Oc(),pr(Q1)),qR=n7e();function sie(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var o7e=class extends f4.InstrumentationBase{constructor(t={}){super(gwt.PACKAGE_NAME,gwt.PACKAGE_VERSION,t),this._connectionsCounter={used:0,idle:0,pending:0}}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(qR.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:bc.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(qR.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(qR.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"],r=new f4.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),n=new f4.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new f4.InstrumentationNodeModuleDefinition("pg",t,o=>{let s=sie(o);return this._patchPgClient(s.Client),o},o=>{let s=sie(o);return this._unpatchPgClient(s.Client),o},[n,r]),a=new f4.InstrumentationNodeModuleDefinition("pg-pool",[">=2.0.0 <4"],o=>((0,f4.isWrapped)(o.prototype.connect)&&this._unwrap(o.prototype,"connect"),this._wrap(o.prototype,"connect",this._getPoolConnectPatch()),o),o=>{(0,f4.isWrapped)(o.prototype.connect)&&this._unwrap(o.prototype,"connect")});return[i,a]}_patchPgClient(t){if(!t)return;let r=sie(t);return(0,f4.isWrapped)(r.prototype.query)&&this._unwrap(r.prototype,"query"),(0,f4.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"query",this._getClientQueryPatch()),this._wrap(r.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let r=sie(t);return(0,f4.isWrapped)(r.prototype.query)&&this._unwrap(r.prototype,"query"),(0,f4.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return r=>function(i){if(_d.shouldSkipInstrumentation(t.getConfig()))return r.call(this,i);let a=t.tracer.startSpan(Awt.SpanNames.CONNECT,{kind:bc.SpanKind.CLIENT,attributes:_d.getSemanticAttributesFromConnection(this)});if(i){let s=bc.trace.getSpan(bc.context.active());i=_d.patchClientConnectCallback(a,i),s&&(i=bc.context.bind(bc.context.active(),i))}let o=bc.context.with(bc.trace.setSpan(bc.context.active(),a),()=>r.call(this,i));return _wt(a,o)}}recordOperationDuration(t,r){let n={};[s8.SEMATTRS_DB_SYSTEM,qR.ATTR_DB_NAMESPACE,s8.ATTR_ERROR_TYPE,s8.ATTR_SERVER_PORT,s8.ATTR_SERVER_ADDRESS,qR.ATTR_DB_OPERATION_NAME].forEach(o=>{o in t&&(n[o]=t[o])});let a=(0,oie.hrTimeToMilliseconds)((0,oie.hrTimeDuration)(r,(0,oie.hrTime)()))/1e3;this._operationDuration.record(a,n)}_getClientQueryPatch(){let t=this;return r=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...i){if(_d.shouldSkipInstrumentation(t.getConfig()))return r.apply(this,i);let a=(0,oie.hrTime)(),o=i[0],s=typeof o=="string",c=_d.isObjectWithTextString(o),l=s?{text:o,values:Array.isArray(i[1])?i[1]:void 0}:c?o:void 0,d={[s8.SEMATTRS_DB_SYSTEM]:s8.DBSYSTEMVALUES_POSTGRESQL,[qR.ATTR_DB_NAMESPACE]:this.database,[s8.ATTR_SERVER_PORT]:this.connectionParameters.port,[s8.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};l?.text&&(d[qR.ATTR_DB_OPERATION_NAME]=_d.parseNormalizedOperationName(l?.text));let u=()=>{t.recordOperationDuration(d,a)},f=t.getConfig(),p=_d.handleConfigQuery.call(this,t.tracer,f,l);if(f.addSqlCommenterCommentToQueries&&(s?i[0]=(0,hwt.addSqlCommenterComment)(p,o):c&&!("name"in o)&&(i[0]=Object.assign(Object.assign({},o),{text:(0,hwt.addSqlCommenterComment)(p,o.text)}))),i.length>0){let v=bc.trace.getSpan(bc.context.active());if(typeof i[i.length-1]=="function")i[i.length-1]=_d.patchCallback(f,p,i[i.length-1],d,u),v&&(i[i.length-1]=bc.context.bind(bc.context.active(),i[i.length-1]));else if(typeof l?.callback=="function"){let T=_d.patchCallback(t.getConfig(),p,l.callback,d,u);v&&(T=bc.context.bind(bc.context.active(),T)),i[0].callback=T}}let{requestHook:A}=f;typeof A=="function"&&l&&(0,f4.safeExecuteInTheMiddle)(()=>{let{database:v,host:T,port:I,user:S}=this.connectionParameters;A(p,{connection:{database:v,host:T,port:I,user:S},query:{text:l.text,values:l.values,name:l.name}})},v=>{v&&t._diag.error("Error running query hook",v)},!0);let g;try{g=r.apply(this,i)}catch(v){throw p.setStatus({code:bc.SpanStatusCode.ERROR,message:_d.getErrorMessage(v)}),p.end(),v}return g instanceof Promise?g.then(v=>new Promise(T=>{_d.handleExecutionResult(t.getConfig(),p,v),u(),p.end(),T(v)})).catch(v=>new Promise((T,I)=>{p.setStatus({code:bc.SpanStatusCode.ERROR,message:v.message}),u(),p.end(),I(v)})):g})}_setPoolConnectEventListeners(t){if(t[mwt.EVENT_LISTENERS_SET])return;let r=_d.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=_d.updateCounter(r,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=_d.updateCounter(r,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=_d.updateCounter(r,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=_d.updateCounter(r,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[mwt.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return r=>function(i){if(_d.shouldSkipInstrumentation(t.getConfig()))return r.call(this,i);let a=t.tracer.startSpan(Awt.SpanNames.POOL_CONNECT,{kind:bc.SpanKind.CLIENT,attributes:_d.getSemanticAttributesFromPool(this.options)});if(t._setPoolConnectEventListeners(this),i){let s=bc.trace.getSpan(bc.context.active());i=_d.patchCallbackPGPool(a,i),s&&(i=bc.context.bind(bc.context.active(),i))}let o=bc.context.with(bc.trace.setSpan(bc.context.active(),a),()=>r.call(this,i));return _wt(a,o)}}};cie.PgInstrumentation=o7e;function _wt(e,t){if(!(t instanceof Promise))return t;let r=t;return bc.context.bind(bc.context.active(),r.then(n=>(e.end(),n)).catch(n=>(e.setStatus({code:bc.SpanStatusCode.ERROR,message:_d.getErrorMessage(n)}),e.end(),Promise.reject(n))))}});var Ewt=P(Swt=>{"use strict";Object.defineProperty(Swt,"__esModule",{value:!0})});var vwt=P(v6=>{"use strict";var Ygn=v6&&v6.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),s7e=v6&&v6.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ygn(t,e,r)};Object.defineProperty(v6,"__esModule",{value:!0});s7e(bwt(),v6);s7e(Ewt(),v6);s7e(r7e(),v6)});var Fwt=P(kk=>{"use strict";Object.defineProperty(kk,"__esModule",{value:!0});kk.PACKAGE_NAME=kk.PACKAGE_VERSION=void 0;kk.PACKAGE_VERSION="0.45.2";kk.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var d7e=P(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});kS.HapiLifecycleMethodNames=kS.HapiLayerType=kS.handlerPatched=kS.HapiComponentName=void 0;kS.HapiComponentName="@hapi/hapi";kS.handlerPatched=Symbol("hapi-handler-patched");kS.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};kS.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var p7e=P(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});sG.AttributeNames=void 0;var a5n;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(a5n=sG.AttributeNames||(sG.AttributeNames={}))});var Vwt=P(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.getPluginFromInput=bd.getExtMetadata=bd.getRouteMetadata=bd.isPatchableExtMethod=bd.isDirectExtInput=bd.isLifecycleExtEventObj=bd.isLifecycleExtType=bd.getPluginName=void 0;var uie=(Oc(),pr(Q1)),cG=d7e(),c8=p7e();function o5n(e){return e.name?e.name:e.pkg.name}bd.getPluginName=o5n;var s5n=e=>typeof e=="string"&&cG.HapiLifecycleMethodNames.has(e);bd.isLifecycleExtType=s5n;var c5n=e=>{var t;let r=(t=e)===null||t===void 0?void 0:t.type;return r!==void 0&&(0,bd.isLifecycleExtType)(r)};bd.isLifecycleExtEventObj=c5n;var l5n=e=>Array.isArray(e)&&e.length<=3&&(0,bd.isLifecycleExtType)(e[0])&&typeof e[1]=="function";bd.isDirectExtInput=l5n;var u5n=e=>!Array.isArray(e);bd.isPatchableExtMethod=u5n;var d5n=(e,t)=>t?{attributes:{[uie.SEMATTRS_HTTP_ROUTE]:e.path,[uie.SEMATTRS_HTTP_METHOD]:e.method,[c8.AttributeNames.HAPI_TYPE]:cG.HapiLayerType.PLUGIN,[c8.AttributeNames.PLUGIN_NAME]:t},name:`${t}: route - ${e.path}`}:{attributes:{[uie.SEMATTRS_HTTP_ROUTE]:e.path,[uie.SEMATTRS_HTTP_METHOD]:e.method,[c8.AttributeNames.HAPI_TYPE]:cG.HapiLayerType.ROUTER},name:`route - ${e.path}`};bd.getRouteMetadata=d5n;var p5n=(e,t)=>t?{attributes:{[c8.AttributeNames.EXT_TYPE]:e,[c8.AttributeNames.HAPI_TYPE]:cG.HapiLayerType.EXT,[c8.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ext - ${e}`}:{attributes:{[c8.AttributeNames.EXT_TYPE]:e,[c8.AttributeNames.HAPI_TYPE]:cG.HapiLayerType.EXT},name:`ext - ${e}`};bd.getExtMetadata=p5n;var f5n=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;bd.getPluginFromInput=f5n});var Pwt=P(pie=>{"use strict";Object.defineProperty(pie,"__esModule",{value:!0});pie.HapiInstrumentation=void 0;var i5=(en(),pr(Nn)),Mwt=ss(),die=cs(),Owt=Fwt(),lG=d7e(),y6=Vwt(),f7e=class extends die.InstrumentationBase{constructor(t={}){super(Owt.PACKAGE_NAME,Owt.PACKAGE_VERSION,t)}init(){return new die.InstrumentationNodeModuleDefinition(lG.HapiComponentName,[">=17.0.0 <22"],t=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,die.isWrapped)(r.server)||this._wrap(r,"server",this._getServerPatch.bind(this)),(0,die.isWrapped)(r.Server)||this._wrap(r,"Server",this._getServerPatch.bind(this)),r},t=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([r],["server","Server"])})}_getServerPatch(t){let r=this,n=this;return function(a){let o=t.apply(this,[a]);return n._wrap(o,"route",s=>r._getServerRoutePatch.bind(r)(s)),n._wrap(o,"ext",s=>r._getServerExtPatch.bind(r)(s)),n._wrap(o,"register",r._getServerRegisterPatch.bind(r)),o}}_getServerRegisterPatch(t){let r=this;return function(i,a){if(Array.isArray(i))for(let o of i){let s=(0,y6.getPluginFromInput)(o);r._wrapRegisterHandler(s)}else{let o=(0,y6.getPluginFromInput)(i);r._wrapRegisterHandler(o)}return t.apply(this,[i,a])}}_getServerExtPatch(t,r){let n=this;return function(...a){if(Array.isArray(a[0])){let o=a[0];for(let s=0;s<o.length;s++){let c=o[s];if((0,y6.isLifecycleExtType)(c.type)){let l=c,d=n._wrapExtMethods(l.method,c.type,r);l.method=d,o[s]=l}}return t.apply(this,a)}else if((0,y6.isDirectExtInput)(a)){let o=a,s=o[1],c=n._wrapExtMethods(s,o[0],r);return t.apply(this,[o[0],c,o[2]])}else if((0,y6.isLifecycleExtEventObj)(a[0])){let o=a[0],s=n._wrapExtMethods(o.method,o.type,r);return o.method=s,t.call(this,o)}return t.apply(this,a)}}_getServerRoutePatch(t,r){let n=this;return function(i){if(Array.isArray(i))for(let a=0;a<i.length;a++){let o=n._wrapRouteHandler.call(n,i[a],r);i[a]=o}else i=n._wrapRouteHandler.call(n,i,r);return t.apply(this,[i])}}_wrapRegisterHandler(t){let r=this,n=(0,y6.getPluginName)(t),i=t.register,a=this,o=function(s,c){return a._wrap(s,"route",l=>r._getServerRoutePatch.bind(r)(l,n)),a._wrap(s,"ext",l=>r._getServerExtPatch.bind(r)(l,n)),i.call(this,s,c)};t.register=o}_wrapExtMethods(t,r,n){let i=this;if(t instanceof Array){for(let a=0;a<t.length;a++)t[a]=i._wrapExtMethods(t[a],r);return t}else if((0,y6.isPatchableExtMethod)(t))return t[lG.handlerPatched]===!0?t:(t[lG.handlerPatched]=!0,async function(...o){if(i5.trace.getSpan(i5.context.active())===void 0)return await t.apply(this,o);let s=(0,y6.getExtMetadata)(r,n),c=i.tracer.startSpan(s.name,{attributes:s.attributes});try{return await i5.context.with(i5.trace.setSpan(i5.context.active(),c),t,void 0,...o)}catch(l){throw c.recordException(l),c.setStatus({code:i5.SpanStatusCode.ERROR,message:l.message}),l}finally{c.end()}});return t}_wrapRouteHandler(t,r){var n;let i=this;if(t[lG.handlerPatched]===!0)return t;t[lG.handlerPatched]=!0;let a=o=>async function(...s){if(i5.trace.getSpan(i5.context.active())===void 0)return await o.call(this,...s);let c=(0,Mwt.getRPCMetadata)(i5.context.active());c?.type===Mwt.RPCType.HTTP&&(c.route=t.path);let l=(0,y6.getRouteMetadata)(t,r),d=i.tracer.startSpan(l.name,{attributes:l.attributes});try{return await i5.context.with(i5.trace.setSpan(i5.context.active(),d),()=>o.call(this,...s))}catch(u){throw d.recordException(u),d.setStatus({code:i5.SpanStatusCode.ERROR,message:u.message}),u}finally{d.end()}};if(typeof t.handler=="function")t.handler=a(t.handler);else if(typeof t.options=="function"){let o=t.options;t.options=function(s){let c=o(s);return typeof c.handler=="function"&&(c.handler=a(c.handler)),c}}else typeof((n=t.options)===null||n===void 0?void 0:n.handler)=="function"&&(t.options.handler=a(t.options.handler));return t}};pie.HapiInstrumentation=f7e});var Gwt=P(l8=>{"use strict";var m5n=l8&&l8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Lwt=l8&&l8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&m5n(t,e,r)};Object.defineProperty(l8,"__esModule",{value:!0});Lwt(Pwt(),l8);Lwt(p7e(),l8)});var fie=P(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});uG.KoaLayerType=void 0;var g5n;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(g5n=uG.KoaLayerType||(uG.KoaLayerType={}))});var Ywt=P(Dk=>{"use strict";Object.defineProperty(Dk,"__esModule",{value:!0});Dk.PACKAGE_NAME=Dk.PACKAGE_VERSION=void 0;Dk.PACKAGE_VERSION="0.47.1";Dk.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var m7e=P(dG=>{"use strict";Object.defineProperty(dG,"__esModule",{value:!0});dG.AttributeNames=void 0;var A5n;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(A5n=dG.AttributeNames||(dG.AttributeNames={}))});var Jwt=P(Bk=>{"use strict";Object.defineProperty(Bk,"__esModule",{value:!0});Bk.isLayerIgnored=Bk.getMiddlewareMetadata=void 0;var Hwt=fie(),mie=m7e(),_5n=(Oc(),pr(Q1)),b5n=(e,t,r,n)=>{var i;return r?{attributes:{[mie.AttributeNames.KOA_NAME]:n?.toString(),[mie.AttributeNames.KOA_TYPE]:Hwt.KoaLayerType.ROUTER,[_5n.SEMATTRS_HTTP_ROUTE]:n?.toString()},name:e._matchedRouteName||`router - ${n}`}:{attributes:{[mie.AttributeNames.KOA_NAME]:(i=t.name)!==null&&i!==void 0?i:"middleware",[mie.AttributeNames.KOA_TYPE]:Hwt.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`}};Bk.getMiddlewareMetadata=b5n;var S5n=(e,t)=>{var r;return!!(Array.isArray(t?.ignoreLayersType)&&(!((r=t?.ignoreLayersType)===null||r===void 0)&&r.includes(e)))};Bk.isLayerIgnored=S5n});var zwt=P(hie=>{"use strict";Object.defineProperty(hie,"__esModule",{value:!0});hie.kLayerPatched=void 0;hie.kLayerPatched=Symbol("koa-layer-patched")});var rUt=P(gie=>{"use strict";Object.defineProperty(gie,"__esModule",{value:!0});gie.KoaInstrumentation=void 0;var DS=(en(),pr(Nn)),pG=cs(),Kwt=fie(),qwt=Ywt(),jwt=Jwt(),eUt=ss(),tUt=zwt(),h7e=class extends pG.InstrumentationBase{constructor(t={}){super(qwt.PACKAGE_NAME,qwt.PACKAGE_VERSION,t)}init(){return new pG.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <3"],t=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return r==null?r:((0,pG.isWrapped)(r.prototype.use)&&this._unwrap(r.prototype,"use"),this._wrap(r.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;(0,pG.isWrapped)(r.prototype.use)&&this._unwrap(r.prototype,"use")})}_getKoaUsePatch(t){let r=this;return function(i){let a;return i.router?a=r._patchRouterDispatch(i):a=r._patchLayer(i,!1),t.apply(this,[a])}}_patchRouterDispatch(t){var r;DS.diag.debug("Patching @koa/router dispatch");let n=t.router,i=(r=n?.stack)!==null&&r!==void 0?r:[];for(let a of i){let o=a.path,s=a.stack;for(let c=0;c<s.length;c++){let l=s[c];s[c]=this._patchLayer(l,!0,o)}}return t}_patchLayer(t,r,n){let i=r?Kwt.KoaLayerType.ROUTER:Kwt.KoaLayerType.MIDDLEWARE;return t[tUt.kLayerPatched]===!0||(0,jwt.isLayerIgnored)(i,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(DS.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[tUt.kLayerPatched]=!0,DS.diag.debug("patching Koa middleware layer"),async(a,o)=>{if(DS.trace.getSpan(DS.context.active())===void 0)return t(a,o);let c=(0,jwt.getMiddlewareMetadata)(a,t,r,n),l=this.tracer.startSpan(c.name,{attributes:c.attributes}),d=(0,eUt.getRPCMetadata)(DS.context.active());d?.type===eUt.RPCType.HTTP&&a._matchedRoute&&(d.route=a._matchedRoute.toString());let{requestHook:u}=this.getConfig();u&&(0,pG.safeExecuteInTheMiddle)(()=>u(l,{context:a,middlewareLayer:t,layerType:i}),p=>{p&&DS.diag.error("koa instrumentation: request hook failed",p)},!0);let f=DS.trace.setSpan(DS.context.active(),l);return DS.context.with(f,async()=>{try{return await t(a,o)}catch(p){throw l.recordException(p),p}finally{l.end()}})})}};gie.KoaInstrumentation=h7e});var nUt=P(C6=>{"use strict";var E5n=C6&&C6.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),g7e=C6&&C6.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&E5n(t,e,r)};Object.defineProperty(C6,"__esModule",{value:!0});g7e(rUt(),C6);g7e(fie(),C6);g7e(m7e(),C6)});var A7e=P(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});h_.ConnectNames=h_.ConnectTypes=h_.AttributeNames=void 0;var C5n;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(C5n=h_.AttributeNames||(h_.AttributeNames={}));var x5n;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(x5n=h_.ConnectTypes||(h_.ConnectTypes={}));var R5n;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(R5n=h_.ConnectNames||(h_.ConnectNames={}))});var cUt=P(Fk=>{"use strict";Object.defineProperty(Fk,"__esModule",{value:!0});Fk.PACKAGE_NAME=Fk.PACKAGE_VERSION=void 0;Fk.PACKAGE_VERSION="0.43.1";Fk.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var lUt=P(Aie=>{"use strict";Object.defineProperty(Aie,"__esModule",{value:!0});Aie._LAYERS_STORE_PROPERTY=void 0;Aie._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var uUt=P(d8=>{"use strict";Object.defineProperty(d8,"__esModule",{value:!0});d8.generateRoute=d8.replaceCurrentStackRoute=d8.addNewStackLayer=void 0;var T5n=(en(),pr(Nn)),u8=lUt(),I5n=e=>{Array.isArray(e[u8._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,u8._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[u8._LAYERS_STORE_PROPERTY].push("/");let t=e[u8._LAYERS_STORE_PROPERTY].length;return()=>{t===e[u8._LAYERS_STORE_PROPERTY].length?e[u8._LAYERS_STORE_PROPERTY].pop():T5n.diag.warn("Connect: Trying to pop the stack multiple time")}};d8.addNewStackLayer=I5n;var w5n=(e,t)=>{t&&e[u8._LAYERS_STORE_PROPERTY].splice(-1,1,t)};d8.replaceCurrentStackRoute=w5n;var U5n=e=>e[u8._LAYERS_STORE_PROPERTY].reduce((t,r)=>t.replace(/\/+$/,"")+r);d8.generateRoute=U5n});var fUt=P(p8=>{"use strict";Object.defineProperty(p8,"__esModule",{value:!0});p8.ConnectInstrumentation=p8.ANONYMOUS_NAME=void 0;var W5n=(en(),pr(Nn)),dUt=ss(),Vk=A7e(),pUt=cUt(),_ie=cs(),N5n=(Oc(),pr(Q1)),_7e=uUt();p8.ANONYMOUS_NAME="anonymous";var b7e=class extends _ie.InstrumentationBase{constructor(t={}){super(pUt.PACKAGE_NAME,pUt.PACKAGE_VERSION,t)}init(){return[new _ie.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,_ie.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,_ie.isWrapped)(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let r=this;return function(...n){let i=t.apply(this,n);return r._patchApp(i),i}}_patchNext(t,r){return function(i){let a=t.apply(this,[i]);return r(),a}}_startSpan(t,r){let n,i,a;t?(n=Vk.ConnectTypes.REQUEST_HANDLER,a=Vk.ConnectNames.REQUEST_HANDLER,i=t):(n=Vk.ConnectTypes.MIDDLEWARE,a=Vk.ConnectNames.MIDDLEWARE,i=r.name||p8.ANONYMOUS_NAME);let o=`${a} - ${i}`,s={attributes:{[N5n.SEMATTRS_HTTP_ROUTE]:t.length>0?t:"/",[Vk.AttributeNames.CONNECT_TYPE]:n,[Vk.AttributeNames.CONNECT_NAME]:i}};return this.tracer.startSpan(o,s)}_patchMiddleware(t,r){let n=this,i=r.length===4;function a(){if(!n.isEnabled())return r.apply(this,arguments);let[o,s,c]=i?[1,2,3]:[0,1,2],l=arguments[o],d=arguments[s],u=arguments[c];(0,_7e.replaceCurrentStackRoute)(l,t);let f=(0,dUt.getRPCMetadata)(W5n.context.active());t&&f?.type===dUt.RPCType.HTTP&&(f.route=(0,_7e.generateRoute)(l));let p="";t?p=`request handler - ${t}`:p=`middleware - ${r.name||p8.ANONYMOUS_NAME}`;let A=n._startSpan(t,r);n._diag.debug("start span",p);let g=!1;function v(){g?n._diag.debug(`span ${A.name} - already finished`):(g=!0,n._diag.debug(`finishing span ${A.name}`),A.end()),d.removeListener("close",v)}return d.addListener("close",v),arguments[c]=n._patchNext(u,v),r.apply(this,arguments)}return Object.defineProperty(a,"length",{value:r.length,writable:!1,configurable:!0}),a}_patchUse(t){let r=this;return function(...n){let i=n[n.length-1],a=n[n.length-2]||"";return n[n.length-1]=r._patchMiddleware(a,i),t.apply(this,n)}}_patchHandle(t){let r=this;return function(){let[n,i]=[0,2],a=arguments[n],o=arguments[i],s=(0,_7e.addNewStackLayer)(a);return typeof o=="function"&&(arguments[i]=r._patchOut(o,s)),t.apply(this,arguments)}}_patchOut(t,r){return function(...i){return r(),Reflect.apply(t,this,i)}}};p8.ConnectInstrumentation=b7e});var hUt=P(f8=>{"use strict";var k5n=f8&&f8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),mUt=f8&&f8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&k5n(t,e,r)};Object.defineProperty(f8,"__esModule",{value:!0});mUt(A7e(),f8);mUt(fUt(),f8)});var vUt=P(Mk=>{"use strict";Object.defineProperty(Mk,"__esModule",{value:!0});Mk.once=Mk.getSpanName=void 0;function M5n(e,t,r,n){return e==="execBulkLoad"&&n&&t?`${e} ${n} ${t}`:e==="callProcedure"?t?`${e} ${r} ${t}`:`${e} ${r}`:t?`${e} ${t}`:`${e}`}Mk.getSpanName=M5n;var O5n=e=>{let t=!1;return(...r)=>{if(!t)return t=!0,e(...r)}};Mk.once=O5n});var yUt=P(Ok=>{"use strict";Object.defineProperty(Ok,"__esModule",{value:!0});Ok.PACKAGE_NAME=Ok.PACKAGE_VERSION=void 0;Ok.PACKAGE_VERSION="0.18.1";Ok.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var IUt=P(vie=>{"use strict";Object.defineProperty(vie,"__esModule",{value:!0});vie.TediousInstrumentation=void 0;var fG=(en(),pr(Nn)),P5n=Xe("events"),bie=cs(),m8=(Oc(),pr(Q1)),CUt=vUt(),xUt=yUt(),TUt=Symbol("opentelemetry.instrumentation-tedious.current-database"),RUt=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function Sie(e){Object.defineProperty(this,TUt,{value:e,writable:!0})}var Eie=class e extends bie.InstrumentationBase{constructor(t={}){super(xUt.PACKAGE_NAME,xUt.PACKAGE_VERSION,t)}init(){return[new bie.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let r=t.Connection.prototype;for(let n of RUt)(0,bie.isWrapped)(r[n])&&this._unwrap(r,n),this._wrap(r,n,this._patchQuery(n));return(0,bie.isWrapped)(r.connect)&&this._unwrap(r,"connect"),this._wrap(r,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let r=t.Connection.prototype;for(let n of RUt)this._unwrap(r,n);this._unwrap(r,"connect")})]}_patchConnect(t){return function(){var n,i;return Sie.call(this,(i=(n=this.config)===null||n===void 0?void 0:n.options)===null||i===void 0?void 0:i.database),this.removeListener("databaseChange",Sie),this.on("databaseChange",Sie),this.once("end",()=>{this.removeListener("databaseChange",Sie)}),t.apply(this,arguments)}}_patchQuery(t){return r=>{let n=this;function i(a){var o,s,c,l,d,u,f,p;if(!(a instanceof P5n.EventEmitter))return n._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let A=0,g=0,v=()=>g++,T=()=>A++,I=this[TUt],S=(U=>{var N,R;return U.sqlTextOrProcedure==="sp_prepare"&&(!((R=(N=U.parametersByName)===null||N===void 0?void 0:N.stmt)===null||R===void 0)&&R.value)?U.parametersByName.stmt.value:U.sqlTextOrProcedure})(a),x=n.tracer.startSpan((0,CUt.getSpanName)(t,I,S,a.table),{kind:fG.SpanKind.CLIENT,attributes:{[m8.SEMATTRS_DB_SYSTEM]:m8.DBSYSTEMVALUES_MSSQL,[m8.SEMATTRS_DB_NAME]:I,[m8.SEMATTRS_NET_PEER_PORT]:(s=(o=this.config)===null||o===void 0?void 0:o.options)===null||s===void 0?void 0:s.port,[m8.SEMATTRS_NET_PEER_NAME]:(c=this.config)===null||c===void 0?void 0:c.server,[m8.SEMATTRS_DB_USER]:(d=(l=this.config)===null||l===void 0?void 0:l.userName)!==null&&d!==void 0?d:(p=(f=(u=this.config)===null||u===void 0?void 0:u.authentication)===null||f===void 0?void 0:f.options)===null||p===void 0?void 0:p.userName,[m8.SEMATTRS_DB_STATEMENT]:S,[m8.SEMATTRS_DB_SQL_TABLE]:a.table}}),D=(0,CUt.once)(U=>{a.removeListener("done",v),a.removeListener("doneInProc",v),a.removeListener("doneProc",T),a.removeListener("error",D),this.removeListener("end",D),x.setAttribute("tedious.procedure_count",A),x.setAttribute("tedious.statement_count",g),U&&x.setStatus({code:fG.SpanStatusCode.ERROR,message:U.message}),x.end()});return a.on("done",v),a.on("doneInProc",v),a.on("doneProc",T),a.once("error",D),this.on("end",D),typeof a.callback=="function"?n._wrap(a,"callback",n._patchCallbackQuery(D)):n._diag.error("Expected request.callback to be a function"),fG.context.with(fG.trace.setSpan(fG.context.active(),x),r,this,...arguments)}return Object.defineProperty(i,"length",{value:r.length,writable:!1}),i}}_patchCallbackQuery(t){return r=>function(n,i,a){return t(n),r.apply(this,arguments)}}};vie.TediousInstrumentation=Eie;Eie.COMPONENT="tedious"});var UUt=P(wUt=>{"use strict";Object.defineProperty(wUt,"__esModule",{value:!0})});var NUt=P(h8=>{"use strict";var L5n=h8&&h8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),WUt=h8&&h8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&L5n(t,e,r)};Object.defineProperty(h8,"__esModule",{value:!0});WUt(IUt(),h8);WUt(UUt(),h8)});var VUt=P(Pk=>{"use strict";Object.defineProperty(Pk,"__esModule",{value:!0});Pk.PACKAGE_NAME=Pk.PACKAGE_VERSION=void 0;Pk.PACKAGE_VERSION="0.43.1";Pk.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var OUt=P(yie=>{"use strict";Object.defineProperty(yie,"__esModule",{value:!0});yie.GenericPoolInstrumentation=void 0;var Lk=(en(),pr(Nn)),jR=cs(),MUt=VUt(),E7e="generic-pool",v7e=class extends jR.InstrumentationBase{constructor(t={}){super(MUt.PACKAGE_NAME,MUt.PACKAGE_VERSION,t),this._isDisabled=!1}init(){return[new jR.InstrumentationNodeModuleDefinition(E7e,[">=3.0.0 <4"],t=>{let r=t.Pool;return(0,jR.isWrapped)(r.prototype.acquire)&&this._unwrap(r.prototype,"acquire"),this._wrap(r.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let r=t.Pool;return this._unwrap(r.prototype,"acquire"),t}),new jR.InstrumentationNodeModuleDefinition(E7e,[">=2.4.0 <3"],t=>{let r=t.Pool;return(0,jR.isWrapped)(r.prototype.acquire)&&this._unwrap(r.prototype,"acquire"),this._wrap(r.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let r=t.Pool;return this._unwrap(r.prototype,"acquire"),t}),new jR.InstrumentationNodeModuleDefinition(E7e,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,jR.isWrapped)(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){let r=this;return function(...i){let a=Lk.context.active(),o=r.tracer.startSpan("generic-pool.acquire",{},a);return Lk.context.with(Lk.trace.setSpan(a,o),()=>t.call(this,...i).then(s=>(o.end(),s),s=>{throw o.recordException(s),o.end(),s}))}}_poolWrapper(t){let r=this;return function(){let i=t.apply(this,arguments);return r._wrap(i,"acquire",r._acquireWithCallbacksPatcher.bind(r)),i}}_acquireWithCallbacksPatcher(t){let r=this;return function(i,a){if(r._isDisabled)return t.call(this,i,a);let o=Lk.context.active(),s=r.tracer.startSpan("generic-pool.acquire",{},o);return Lk.context.with(Lk.trace.setSpan(o,s),()=>{t.call(this,(c,l)=>{if(s.end(),i)return i(c,l)},a)})}}};yie.GenericPoolInstrumentation=v7e});var PUt=P(eT=>{"use strict";var Z5n=eT&&eT.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),X5n=eT&&eT.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Z5n(t,e,r)};Object.defineProperty(eT,"__esModule",{value:!0});X5n(OUt(),eT)});var y7e=P(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});tT.DEFAULT_CONFIG=tT.EndOperation=void 0;var Y5n;(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"})(Y5n=tT.EndOperation||(tT.EndOperation={}));tT.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var HUt=P(m1=>{"use strict";Object.defineProperty(m1,"__esModule",{value:!0});m1.isConfirmChannelTracing=m1.unmarkConfirmChannelTracing=m1.markConfirmChannelTracing=m1.getConnectionAttributesFromUrl=m1.getConnectionAttributesFromServer=m1.normalizeExchange=m1.CONNECTION_ATTRIBUTES=m1.CHANNEL_CONSUME_TIMEOUT_TIMER=m1.CHANNEL_SPANS_NOT_ENDED=m1.MESSAGE_STORED_SPAN=void 0;var C7e=(en(),pr(Nn)),x6=(Oc(),pr(Q1));m1.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");m1.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");m1.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");m1.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var x7e=(0,C7e.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),H5n=e=>e!==""?e:"<default>";m1.normalizeExchange=H5n;var J5n=e=>e.replace(/:[^:@/]*@/,":***@"),XUt=(e,t)=>e||(t==="AMQP"?5672:5671),QUt=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},YUt=e=>e||"localhost",Gk=(e,t,r,n)=>r?{[t]:r}:(C7e.diag.error(`amqplib instrumentation: could not extract connection attribute ${n} from user supplied url`,{url:e}),{}),z5n=e=>{var t,r;let n=(r=(t=e.serverProperties.product)===null||t===void 0?void 0:t.toLowerCase)===null||r===void 0?void 0:r.call(t);return n?{[x6.SEMATTRS_MESSAGING_SYSTEM]:n}:{}};m1.getConnectionAttributesFromServer=z5n;var K5n=e=>{let t={[x6.SEMATTRS_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,n=QUt(r?.protocol);Object.assign(t,Object.assign({},Gk(e,x6.SEMATTRS_MESSAGING_PROTOCOL,n,"protocol")));let i=YUt(r?.hostname);Object.assign(t,Object.assign({},Gk(e,x6.SEMATTRS_NET_PEER_NAME,i,"hostname")));let a=XUt(r.port,n);Object.assign(t,Object.assign({},Gk(e,x6.SEMATTRS_NET_PEER_PORT,a,"port")))}else{let r=J5n(e);t[x6.SEMATTRS_MESSAGING_URL]=r;try{let n=new URL(r),i=QUt(n.protocol);Object.assign(t,Object.assign({},Gk(r,x6.SEMATTRS_MESSAGING_PROTOCOL,i,"protocol")));let a=YUt(n.hostname);Object.assign(t,Object.assign({},Gk(r,x6.SEMATTRS_NET_PEER_NAME,a,"hostname")));let o=XUt(n.port?parseInt(n.port):void 0,i);Object.assign(t,Object.assign({},Gk(r,x6.SEMATTRS_NET_PEER_PORT,o,"port")))}catch(n){C7e.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:n})}}return t};m1.getConnectionAttributesFromUrl=K5n;var q5n=e=>e.setValue(x7e,!0);m1.markConfirmChannelTracing=q5n;var j5n=e=>e.deleteValue(x7e);m1.unmarkConfirmChannelTracing=j5n;var e3n=e=>e.getValue(x7e)===!0;m1.isConfirmChannelTracing=e3n});var JUt=P($k=>{"use strict";Object.defineProperty($k,"__esModule",{value:!0});$k.PACKAGE_NAME=$k.PACKAGE_VERSION=void 0;$k.PACKAGE_VERSION="0.46.1";$k.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var KUt=P(Rie=>{"use strict";Object.defineProperty(Rie,"__esModule",{value:!0});Rie.AmqplibInstrumentation=void 0;var Nu=(en(),pr(Nn)),Cie=ss(),$s=cs(),F2=(Oc(),pr(Q1)),Ih=y7e(),h1=HUt(),zUt=JUt(),xie=[">=0.5.5 <1"],R7e=class extends $s.InstrumentationBase{constructor(t={}){super(zUt.PACKAGE_NAME,zUt.PACKAGE_VERSION,Object.assign(Object.assign({},Ih.DEFAULT_CONFIG),t))}setConfig(t={}){super.setConfig(Object.assign(Object.assign({},Ih.DEFAULT_CONFIG),t))}init(){let t=new $s.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",xie,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new $s.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",xie,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new $s.InstrumentationNodeModuleFile("amqplib/lib/connect.js",xie,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new $s.InstrumentationNodeModuleDefinition("amqplib",xie,void 0,void 0,[t,n,r])}patchConnect(t){return t=this.unpatchConnect(t),(0,$s.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,$s.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,r){return(0,$s.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,r)),(0,$s.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,r)),(0,$s.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,Ih.EndOperation.Ack)),(0,$s.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,Ih.EndOperation.Nack)),(0,$s.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,Ih.EndOperation.Reject)),(0,$s.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,Ih.EndOperation.AckAll)),(0,$s.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,Ih.EndOperation.NackAll)),(0,$s.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,$s.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,r)),t}unpatchChannelModel(t){return(0,$s.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,$s.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,$s.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,$s.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,$s.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,$s.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,$s.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,$s.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,$s.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){return function(n,i,a){return t.call(this,n,i,function(o,s){if(o==null){let c=(0,h1.getConnectionAttributesFromUrl)(n),l=(0,h1.getConnectionAttributesFromServer)(s);s[h1.CONNECTION_ATTRIBUTES]=Object.assign(Object.assign({},c),l)}a.apply(this,arguments)})}}getChannelEmitPatch(t){let r=this;return function(i){if(i==="close"){r.endAllSpansOnChannel(this,!0,Ih.EndOperation.ChannelClosed,void 0);let a=this[h1.CHANNEL_CONSUME_TIMEOUT_TIMER];a&&clearInterval(a),this[h1.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else i==="error"&&r.endAllSpansOnChannel(this,!0,Ih.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,r,n){let i=this;return function(o){return i.endAllSpansOnChannel(this,t,r,o),n.apply(this,arguments)}}getAckPatch(t,r,n){let i=this;return function(o,s,c){var l;let d=this,u=r===Ih.EndOperation.Reject?s:c,f=(l=d[h1.CHANNEL_SPANS_NOT_ENDED])!==null&&l!==void 0?l:[],p=f.findIndex(A=>A.msg===o);if(p<0)i.endConsumerSpan(o,t,r,u);else if(r!==Ih.EndOperation.Reject&&s){for(let A=0;A<=p;A++)i.endConsumerSpan(f[A].msg,t,r,u);f.splice(0,p+1)}else i.endConsumerSpan(o,t,r,u),f.splice(p,1);return n.apply(this,arguments)}}getConsumePatch(t,r){let n=this;return function(a,o,s){let c=this;if(!Object.prototype.hasOwnProperty.call(c,h1.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:d}=n.getConfig();if(d){let u=setInterval(()=>{n.checkConsumeTimeoutOnChannel(c)},d);u.unref(),c[h1.CHANNEL_CONSUME_TIMEOUT_TIMER]=u}c[h1.CHANNEL_SPANS_NOT_ENDED]=[]}let l=function(d){var u,f,p,A,g;if(!d)return o.call(this,d);let v=(u=d.properties.headers)!==null&&u!==void 0?u:{},T=Nu.propagation.extract(Nu.ROOT_CONTEXT,v),I=(f=d.fields)===null||f===void 0?void 0:f.exchange,S;if(n._config.useLinksForConsume){let N=T?(p=Nu.trace.getSpan(T))===null||p===void 0?void 0:p.spanContext():void 0;T=void 0,N&&(S=[{context:N}])}let x=n.tracer.startSpan(`${a} process`,{kind:Nu.SpanKind.CONSUMER,attributes:Object.assign(Object.assign({},(A=c?.connection)===null||A===void 0?void 0:A[h1.CONNECTION_ATTRIBUTES]),{[F2.SEMATTRS_MESSAGING_DESTINATION]:I,[F2.SEMATTRS_MESSAGING_DESTINATION_KIND]:F2.MESSAGINGDESTINATIONKINDVALUES_TOPIC,[F2.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]:(g=d.fields)===null||g===void 0?void 0:g.routingKey,[F2.SEMATTRS_MESSAGING_OPERATION]:F2.MESSAGINGOPERATIONVALUES_PROCESS,[F2.SEMATTRS_MESSAGING_MESSAGE_ID]:d?.properties.messageId,[F2.SEMATTRS_MESSAGING_CONVERSATION_ID]:d?.properties.correlationId}),links:S},T),{consumeHook:D}=n.getConfig();D&&(0,$s.safeExecuteInTheMiddle)(()=>D(x,{moduleVersion:t,msg:d}),N=>{N&&Nu.diag.error("amqplib instrumentation: consumerHook error",N)},!0),s?.noAck||(c[h1.CHANNEL_SPANS_NOT_ENDED].push({msg:d,timeOfConsume:(0,Cie.hrTime)()}),d[h1.MESSAGE_STORED_SPAN]=x);let U=T||Nu.ROOT_CONTEXT;Nu.context.with(Nu.trace.setSpan(U,x),()=>{o.call(this,d)}),s?.noAck&&(n.callConsumeEndHook(x,d,!1,Ih.EndOperation.AutoAck),x.end())};return arguments[1]=l,r.apply(this,arguments)}}getConfirmedPublishPatch(t,r){let n=this;return function(a,o,s,c,l){let d=this,{span:u,modifiedOptions:f}=n.createPublishSpan(n,a,o,d,c),{publishHook:p}=n.getConfig();p&&(0,$s.safeExecuteInTheMiddle)(()=>p(u,{moduleVersion:t,exchange:a,routingKey:o,content:s,options:f,isConfirmChannel:!0}),T=>{T&&Nu.diag.error("amqplib instrumentation: publishHook error",T)},!0);let A=function(T,I){try{l?.call(this,T,I)}finally{let{publishConfirmHook:S}=n.getConfig();S&&(0,$s.safeExecuteInTheMiddle)(()=>S(u,{moduleVersion:t,exchange:a,routingKey:o,content:s,options:c,isConfirmChannel:!0,confirmError:T}),x=>{x&&Nu.diag.error("amqplib instrumentation: publishConfirmHook error",x)},!0),T&&u.setStatus({code:Nu.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),u.end()}},g=(0,h1.markConfirmChannelTracing)(Nu.context.active()),v=[...arguments];return v[3]=f,v[4]=Nu.context.bind((0,h1.unmarkConfirmChannelTracing)(Nu.trace.setSpan(g,u)),A),Nu.context.with(g,r.bind(this,...v))}}getPublishPatch(t,r){let n=this;return function(a,o,s,c){if((0,h1.isConfirmChannelTracing)(Nu.context.active()))return r.apply(this,arguments);{let l=this,{span:d,modifiedOptions:u}=n.createPublishSpan(n,a,o,l,c),{publishHook:f}=n.getConfig();f&&(0,$s.safeExecuteInTheMiddle)(()=>f(d,{moduleVersion:t,exchange:a,routingKey:o,content:s,options:u,isConfirmChannel:!1}),g=>{g&&Nu.diag.error("amqplib instrumentation: publishHook error",g)},!0);let p=[...arguments];p[3]=u;let A=r.apply(this,p);return d.end(),A}}}createPublishSpan(t,r,n,i,a){var o;let s=(0,h1.normalizeExchange)(r),c=t.tracer.startSpan(`publish ${s}`,{kind:Nu.SpanKind.PRODUCER,attributes:Object.assign(Object.assign({},i.connection[h1.CONNECTION_ATTRIBUTES]),{[F2.SEMATTRS_MESSAGING_DESTINATION]:r,[F2.SEMATTRS_MESSAGING_DESTINATION_KIND]:F2.MESSAGINGDESTINATIONKINDVALUES_TOPIC,[F2.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]:n,[F2.SEMATTRS_MESSAGING_MESSAGE_ID]:a?.messageId,[F2.SEMATTRS_MESSAGING_CONVERSATION_ID]:a?.correlationId})}),l=a??{};return l.headers=(o=l.headers)!==null&&o!==void 0?o:{},Nu.propagation.inject(Nu.trace.setSpan(Nu.context.active(),c),l.headers),{span:c,modifiedOptions:l}}endConsumerSpan(t,r,n,i){let a=t[h1.MESSAGE_STORED_SPAN];a&&(r!==!1&&a.setStatus({code:Nu.SpanStatusCode.ERROR,message:n!==Ih.EndOperation.ChannelClosed&&n!==Ih.EndOperation.ChannelError?`${n} called on message${i===!0?" with requeue":i===!1?" without requeue":""}`:n}),this.callConsumeEndHook(a,t,r,n),a.end(),t[h1.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,r,n,i){var a;((a=t[h1.CHANNEL_SPANS_NOT_ENDED])!==null&&a!==void 0?a:[]).forEach(s=>{this.endConsumerSpan(s.msg,r,n,i)}),t[h1.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,r,n,i){let{consumeEndHook:a}=this.getConfig();a&&(0,$s.safeExecuteInTheMiddle)(()=>a(t,{msg:r,rejected:n,endOperation:i}),o=>{o&&Nu.diag.error("amqplib instrumentation: consumerEndHook error",o)},!0)}checkConsumeTimeoutOnChannel(t){var r;let n=(0,Cie.hrTime)(),i=(r=t[h1.CHANNEL_SPANS_NOT_ENDED])!==null&&r!==void 0?r:[],a,{consumeTimeoutMs:o}=this.getConfig();for(a=0;a<i.length;a++){let s=i[a],c=(0,Cie.hrTimeDuration)(s.timeOfConsume,n);if((0,Cie.hrTimeToMilliseconds)(c)<o)break;this.endConsumerSpan(s.msg,null,Ih.EndOperation.InstrumentationTimeout,!0)}i.splice(0,a)}};Rie.AmqplibInstrumentation=R7e});var jUt=P(g8=>{"use strict";var t3n=g8&&g8.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qUt=g8&&g8.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&t3n(t,e,r)};Object.defineProperty(g8,"__esModule",{value:!0});qUt(KUt(),g8);qUt(y7e(),g8)});var w7e=P(wie=>{"use strict";Object.defineProperty(wie,"__esModule",{value:!0});wie.AbstractAsyncHooksContextManager=void 0;var c3n=Xe("events"),l3n=["addListener","on","once","prependListener","prependOnceListener"],I7e=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(t,r){return r instanceof c3n.EventEmitter?this._bindEventEmitter(t,r):typeof r=="function"?this._bindFunction(t,r):r}_bindFunction(t,r){let n=this,i=function(...a){return n.with(t,()=>r.apply(this,a))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i}_bindEventEmitter(t,r){return this._getPatchMap(r)!==void 0||(this._createPatchMap(r),l3n.forEach(i=>{r[i]!==void 0&&(r[i]=this._patchAddListener(r,r[i],t))}),typeof r.removeListener=="function"&&(r.removeListener=this._patchRemoveListener(r,r.removeListener)),typeof r.off=="function"&&(r.off=this._patchRemoveListener(r,r.off)),typeof r.removeAllListeners=="function"&&(r.removeAllListeners=this._patchRemoveAllListeners(r,r.removeAllListeners))),r}_patchRemoveListener(t,r){let n=this;return function(i,a){var o;let s=(o=n._getPatchMap(t))===null||o===void 0?void 0:o[i];if(s===void 0)return r.call(this,i,a);let c=s.get(a);return r.call(this,i,c||a)}}_patchRemoveAllListeners(t,r){let n=this;return function(i){let a=n._getPatchMap(t);return a!==void 0&&(arguments.length===0?n._createPatchMap(t):a[i]!==void 0&&delete a[i]),r.apply(this,arguments)}}_patchAddListener(t,r,n){let i=this;return function(a,o){if(i._wrapped)return r.call(this,a,o);let s=i._getPatchMap(t);s===void 0&&(s=i._createPatchMap(t));let c=s[a];c===void 0&&(c=new WeakMap,s[a]=c);let l=i.bind(n,o);c.set(o,l),i._wrapped=!0;try{return r.call(this,a,l)}finally{i._wrapped=!1}}}_createPatchMap(t){let r=Object.create(null);return t[this._kOtListeners]=r,r}_getPatchMap(t){return t[this._kOtListeners]}};wie.AbstractAsyncHooksContextManager=I7e});var lWt=P(Uie=>{"use strict";Object.defineProperty(Uie,"__esModule",{value:!0});Uie.AsyncHooksContextManager=void 0;var u3n=(en(),pr(Nn)),d3n=Xe("async_hooks"),p3n=w7e(),U7e=class extends p3n.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=d3n.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var t;return(t=this._stack[this._stack.length-1])!==null&&t!==void 0?t:u3n.ROOT_CONTEXT}with(t,r,n,...i){this._enterContext(t);try{return r.call(n,...i)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(t,r){if(r==="TIMERWRAP")return;let n=this._stack[this._stack.length-1];n!==void 0&&this._contexts.set(t,n)}_destroy(t){this._contexts.delete(t)}_before(t){let r=this._contexts.get(t);r!==void 0&&this._enterContext(r)}_after(){this._exitContext()}_enterContext(t){this._stack.push(t)}_exitContext(){this._stack.pop()}};Uie.AsyncHooksContextManager=U7e});var uWt=P(Wie=>{"use strict";Object.defineProperty(Wie,"__esModule",{value:!0});Wie.AsyncLocalStorageContextManager=void 0;var f3n=(en(),pr(Nn)),m3n=Xe("async_hooks"),h3n=w7e(),W7e=class extends h3n.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new m3n.AsyncLocalStorage}active(){var t;return(t=this._asyncLocalStorage.getStore())!==null&&t!==void 0?t:f3n.ROOT_CONTEXT}with(t,r,n,...i){let a=n==null?r:r.bind(n);return this._asyncLocalStorage.run(t,a,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};Wie.AsyncLocalStorageContextManager=W7e});var dWt=P(Zk=>{"use strict";Object.defineProperty(Zk,"__esModule",{value:!0});Zk.AsyncLocalStorageContextManager=Zk.AsyncHooksContextManager=void 0;var g3n=lWt();Object.defineProperty(Zk,"AsyncHooksContextManager",{enumerable:!0,get:function(){return g3n.AsyncHooksContextManager}});var A3n=uWt();Object.defineProperty(Zk,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return A3n.AsyncLocalStorageContextManager}})});var zNt=P((tMi,JNt)=>{"use strict";function LNt(e){return Array.isArray(e)?e:[e]}var XNt="",GNt=" ",n9e="\\",B_n=/^\s+$/,F_n=/(?:[^\\]|^)\\$/,V_n=/^\\!/,M_n=/^\\#/,O_n=/\r?\n/g,P_n=/^\.*\/|^\.+$/,i9e="/",QNt="node-ignore";typeof Symbol<"u"&&(QNt=Symbol.for("node-ignore"));var $Nt=QNt,L_n=(e,t,r)=>Object.defineProperty(e,t,{value:r}),G_n=/([0-z])-([0-z])/g,YNt=()=>!1,$_n=e=>e.replace(G_n,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:XNt),Z_n=e=>{let{length:t}=e;return e.slice(0,t-t%2)},X_n=[[/\\?\s+$/,e=>e.indexOf("\\")===0?GNt:XNt],[/\\\s/g,()=>GNt],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>n9e],[/\\\\/g,()=>n9e],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,i)=>t===n9e?`\\[${r}${Z_n(n)}${i}`:i==="]"&&n.length%2===0?`[${$_n(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],ZNt=Object.create(null),Q_n=(e,t)=>{let r=ZNt[e];return r||(r=X_n.reduce((n,i)=>n.replace(i[0],i[1].bind(e)),e),ZNt[e]=r),t?new RegExp(r,"i"):new RegExp(r)},s9e=e=>typeof e=="string",Y_n=e=>e&&s9e(e)&&!B_n.test(e)&&!F_n.test(e)&&e.indexOf("#")!==0,H_n=e=>e.split(O_n),a9e=class{constructor(t,r,n,i){this.origin=t,this.pattern=r,this.negative=n,this.regex=i}},J_n=(e,t)=>{let r=e,n=!1;e.indexOf("!")===0&&(n=!0,e=e.substr(1)),e=e.replace(V_n,"!").replace(M_n,"#");let i=Q_n(e,t);return new a9e(r,e,n,i)},z_n=(e,t)=>{throw new t(e)},I6=(e,t,r)=>s9e(e)?e?I6.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),HNt=e=>P_n.test(e);I6.isNotRelative=HNt;I6.convert=e=>e;var o9e=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){L_n(this,$Nt,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[$Nt]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(Y_n(t)){let r=J_n(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,LNt(s9e(t)?H_n(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,r){let n=!1,i=!1;return this._rules.forEach(a=>{let{negative:o}=a;if(i===o&&n!==i||o&&!n&&!i&&!r)return;a.regex.test(t)&&(n=!o,i=o)}),{ignored:n,unignored:i}}_test(t,r,n,i){let a=t&&I6.convert(t);return I6(a,t,this._allowRelativePaths?YNt:z_n),this._t(a,r,n,i)}_t(t,r,n,i){if(t in r)return r[t];if(i||(i=t.split(i9e)),i.pop(),!i.length)return r[t]=this._testOne(t,n);let a=this._t(i.join(i9e)+i9e,r,n,i);if(a.ignored)return r[t]=a;let o=this._testOne(t,n);return r[t]={ignored:o.ignored,unignored:a.unignored||o.unignored}}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return LNt(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},dae=e=>new o9e(e),K_n=e=>I6(e&&I6.convert(e),e,YNt);dae.isPathValid=K_n;dae.default=dae;JNt.exports=dae;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");I6.convert=e;let t=/^[a-z]:\//i;I6.isNotRelative=r=>t.test(r)||HNt(r)}});var tkt=P((zOi,ekt)=>{"use strict";function Du(e,r){var r=r||{};this._capacity=r.capacity,this._head=0,this._tail=0,Array.isArray(e)?this._fromArray(e):(this._capacityMask=3,this._list=new Array(4))}Du.prototype.peekAt=function(t){var r=t;if(r===(r|0)){var n=this.size();if(!(r>=n||r<-n))return r<0&&(r+=n),r=this._head+r&this._capacityMask,this._list[r]}};Du.prototype.get=function(t){return this.peekAt(t)};Du.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]};Du.prototype.peekFront=function(){return this.peek()};Du.prototype.peekBack=function(){return this.peekAt(-1)};Object.defineProperty(Du.prototype,"length",{get:function(){return this.size()}});Du.prototype.size=function(){return this._head===this._tail?0:this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)};Du.prototype.unshift=function(t){if(arguments.length===0)return this.size();var r=this._list.length;return this._head=this._head-1+r&this._capacityMask,this._list[this._head]=t,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.pop(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)};Du.prototype.shift=function(){var t=this._head;if(t!==this._tail){var r=this._list[t];return this._list[t]=void 0,this._head=t+1&this._capacityMask,t<2&&this._tail>1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),r}};Du.prototype.push=function(t){if(arguments.length===0)return this.size();var r=this._tail;return this._list[r]=t,this._tail=r+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)};Du.prototype.pop=function(){var t=this._tail;if(t!==this._head){var r=this._list.length;this._tail=t-1+r&this._capacityMask;var n=this._list[this._tail];return this._list[this._tail]=void 0,this._head<2&&t>1e4&&t<=r>>>2&&this._shrinkArray(),n}};Du.prototype.removeOne=function(t){var r=t;if(r===(r|0)&&this._head!==this._tail){var n=this.size(),i=this._list.length;if(!(r>=n||r<-n)){r<0&&(r+=n),r=this._head+r&this._capacityMask;var a=this._list[r],o;if(t<n/2){for(o=t;o>0;o--)this._list[r]=this._list[r=r-1+i&this._capacityMask];this._list[r]=void 0,this._head=this._head+1+i&this._capacityMask}else{for(o=n-1-t;o>0;o--)this._list[r]=this._list[r=r+1+i&this._capacityMask];this._list[r]=void 0,this._tail=this._tail-1+i&this._capacityMask}return a}}};Du.prototype.remove=function(t,r){var n=t,i,a=r;if(n===(n|0)&&this._head!==this._tail){var o=this.size(),s=this._list.length;if(!(n>=o||n<-o||r<1)){if(n<0&&(n+=o),r===1||!r)return i=new Array(1),i[0]=this.removeOne(n),i;if(n===0&&n+r>=o)return i=this.toArray(),this.clear(),i;n+r>o&&(r=o-n);var c;for(i=new Array(r),c=0;c<r;c++)i[c]=this._list[this._head+n+c&this._capacityMask];if(n=this._head+n&this._capacityMask,t+r===o){for(this._tail=this._tail-r+s&this._capacityMask,c=r;c>0;c--)this._list[n=n+1+s&this._capacityMask]=void 0;return i}if(t===0){for(this._head=this._head+r+s&this._capacityMask,c=r-1;c>0;c--)this._list[n=n+1+s&this._capacityMask]=void 0;return i}if(n<o/2){for(this._head=this._head+t+r+s&this._capacityMask,c=t;c>0;c--)this.unshift(this._list[n=n-1+s&this._capacityMask]);for(n=this._head-1+s&this._capacityMask;a>0;)this._list[n=n-1+s&this._capacityMask]=void 0,a--;t<0&&(this._tail=n)}else{for(this._tail=n,n=n+r+s&this._capacityMask,c=o-(r+t);c>0;c--)this.push(this._list[n++]);for(n=this._tail;a>0;)this._list[n=n+1+s&this._capacityMask]=void 0,a--}return this._head<2&&this._tail>1e4&&this._tail<=s>>>2&&this._shrinkArray(),i}}};Du.prototype.splice=function(t,r){var n=t;if(n===(n|0)){var i=this.size();if(n<0&&(n+=i),!(n>i))if(arguments.length>2){var a,o,s,c=arguments.length,l=this._list.length,d=2;if(!i||n<i/2){for(o=new Array(n),a=0;a<n;a++)o[a]=this._list[this._head+a&this._capacityMask];for(r===0?(s=[],n>0&&(this._head=this._head+n+l&this._capacityMask)):(s=this.remove(n,r),this._head=this._head+n+l&this._capacityMask);c>d;)this.unshift(arguments[--c]);for(a=n;a>0;a--)this.unshift(o[a-1])}else{o=new Array(i-(n+r));var u=o.length;for(a=0;a<u;a++)o[a]=this._list[this._head+n+r+a&this._capacityMask];for(r===0?(s=[],n!=i&&(this._tail=this._head+n+l&this._capacityMask)):(s=this.remove(n,r),this._tail=this._tail-u+l&this._capacityMask);d<c;)this.push(arguments[d++]);for(a=0;a<u;a++)this.push(o[a])}return s}else return this.remove(n,r)}};Du.prototype.clear=function(){this._list=new Array(this._list.length),this._head=0,this._tail=0};Du.prototype.isEmpty=function(){return this._head===this._tail};Du.prototype.toArray=function(){return this._copyArray(!1)};Du.prototype._fromArray=function(t){var r=t.length,n=this._nextPowerOf2(r);this._list=new Array(n),this._capacityMask=n-1,this._tail=r;for(var i=0;i<r;i++)this._list[i]=t[i]};Du.prototype._copyArray=function(t,r){var n=this._list,i=n.length,a=this.length;if(r=r|a,r==a&&this._head<this._tail)return this._list.slice(this._head,this._tail);var o=new Array(r),s=0,c;if(t||this._head>this._tail){for(c=this._head;c<i;c++)o[s++]=n[c];for(c=0;c<this._tail;c++)o[s++]=n[c]}else for(c=this._head;c<this._tail;c++)o[s++]=n[c];return o};Du.prototype._growArray=function(){if(this._head!=0){var t=this._copyArray(!0,this._list.length<<1);this._tail=this._list.length,this._head=0,this._list=t}else this._tail=this._list.length,this._list.length<<=1;this._capacityMask=this._capacityMask<<1|1};Du.prototype._shrinkArray=function(){this._list.length>>>=1,this._capacityMask>>>=1};Du.prototype._nextPowerOf2=function(t){var r=Math.log(t)/Math.log(2),n=1<<r+1;return Math.max(n,4)};ekt.exports=Du});var fkt=P(kae=>{"use strict";var _bn=Symbol.for("react.transitional.element"),bbn=Symbol.for("react.fragment");function pkt(e,t,r){var n=null;if(r!==void 0&&(n=""+r),t.key!==void 0&&(n=""+t.key),"key"in t){r={};for(var i in t)i!=="key"&&(r[i]=t[i])}else r=t;return t=r.ref,{$$typeof:_bn,type:e,key:n,ref:t!==void 0?t:null,props:r}}kae.Fragment=bbn;kae.jsx=pkt;kae.jsxs=pkt});var mkt=P(Dae=>{"use strict";process.env.NODE_ENV!=="production"&&function(){function e(K){if(K==null)return null;if(typeof K=="function")return K.$$typeof===q?null:K.displayName||K.name||null;if(typeof K=="string")return K;switch(K){case g:return"Fragment";case T:return"Profiler";case v:return"StrictMode";case D:return"Suspense";case U:return"SuspenseList";case O:return"Activity"}if(typeof K=="object")switch(typeof K.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),K.$$typeof){case A:return"Portal";case S:return(K.displayName||"Context")+".Provider";case I:return(K._context.displayName||"Context")+".Consumer";case x:var k=K.render;return K=K.displayName,K||(K=k.displayName||k.name||"",K=K!==""?"ForwardRef("+K+")":"ForwardRef"),K;case N:return k=K.displayName||null,k!==null?k:e(K.type)||"Memo";case R:k=K._payload,K=K._init;try{return e(K(k))}catch{}}return null}function t(K){return""+K}function r(K){try{t(K);var k=!1}catch{k=!0}if(k){k=console;var ne=k.error,ce=typeof Symbol=="function"&&Symbol.toStringTag&&K[Symbol.toStringTag]||K.constructor.name||"Object";return ne.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ce),t(K)}}function n(K){if(K===g)return"<>";if(typeof K=="object"&&K!==null&&K.$$typeof===R)return"<...>";try{var k=e(K);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function i(){var K=H.A;return K===null?null:K.getOwner()}function a(){return Error("react-stack-top-frame")}function o(K){if(Z.call(K,"key")){var k=Object.getOwnPropertyDescriptor(K,"key").get;if(k&&k.isReactWarning)return!1}return K.key!==void 0}function s(K,k){function ne(){se||(se=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}ne.isReactWarning=!0,Object.defineProperty(K,"key",{get:ne,configurable:!0})}function c(){var K=e(this.type);return j[K]||(j[K]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),K=this.props.ref,K!==void 0?K:null}function l(K,k,ne,ce,ie,me,ae,pe){return ne=me.ref,K={$$typeof:p,type:K,key:k,props:me,_owner:ie},(ne!==void 0?ne:null)!==null?Object.defineProperty(K,"ref",{enumerable:!1,get:c}):Object.defineProperty(K,"ref",{enumerable:!1,value:null}),K._store={},Object.defineProperty(K._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(K,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(K,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ae}),Object.defineProperty(K,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.freeze&&(Object.freeze(K.props),Object.freeze(K)),K}function d(K,k,ne,ce,ie,me,ae,pe){var fe=k.children;if(fe!==void 0)if(ce)if(L(fe)){for(ce=0;ce<fe.length;ce++)u(fe[ce]);Object.freeze&&Object.freeze(fe)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(fe);if(Z.call(k,"key")){fe=e(K);var Ae=Object.keys(k).filter(function(be){return be!=="key"});ce=0<Ae.length?"{key: someKey, "+Ae.join(": ..., ")+": ...}":"{key: someKey}",z[fe+ce]||(Ae=0<Ae.length?"{"+Ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
RangeError: path should be a `path.relative()`d string, but got ".\SkipCardSolitaire\AndroidBuilds\Skip Card Solitaire\Android\Skip Card Solitaire_BurstDebugInformation_DoNotShip\tempburstlibs\arm64-v8a\?\d:\UnityProjects\SkipCardSolitaireGitLab\SkipCardSolitaire\AndroidBuilds\Skip Card Solitaire\Android\Skip Card Solitaire_BurstDebugInformation_DoNotShip\tempburstlibs\arm64-v8a"
at z_n (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:459:85481)
at I6 (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:459:85532)
at o9e._test (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:459:86564)
at o9e.test (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:459:87059)
at e.getPathInfo (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:1885:1902)
at e.getPathInfo (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:1885:2599)
at g9e.getPathInfo (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:1892:3143)
at g9e.acceptsPath (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:1892:2852)
at yae._shouldProcessPath (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:1893:9673)
at yae._handleFileSystemEvent (file:///C:/Users/sathy/AppData/Local/nvm/v22.18.0/node_modules/@augmentcode/auggie/augment.mjs:1893:9331)
Node.js v22.18.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment