sentry 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +3 -3
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
{let e=process.emit;process.emit=function(n,...a){return n==="warning"?!1:e.apply(this,[n,...a])}}
|
|
3
|
-
var Sue=Object.create;var Ig=Object.defineProperty;var Aue=Object.getOwnPropertyDescriptor;var yue=Object.getOwnPropertyNames;var Rue=Object.getPrototypeOf,Iue=Object.prototype.hasOwnProperty;var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pn=(t,e)=>{for(var n in e)Ig(t,n,{get:e[n],enumerable:!0})},N0=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of yue(e))!Iue.call(t,o)&&o!==n&&Ig(t,o,{get:()=>e[o],enumerable:!(r=Aue(e,o))||r.enumerable});return t};var j=(t,e,n)=>(n=t!=null?Sue(Rue(t)):{},N0(e||!t||!t.__esModule?Ig(n,"default",{value:t,enumerable:!0}):n,t)),D=t=>N0(Ig({},"__esModule",{value:!0}),t);var h,u=S(()=>{"use strict";h=require("node:url").pathToFileURL(__filename).href});var Nue,l=S(()=>{Nue=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};Nue.SENTRY_RELEASE={id:"0.9.0"}});var If=y((Rze,b0)=>{"use strict";p();u();l();var bue="2.0.0",Oue=Number.MAX_SAFE_INTEGER||9007199254740991,Cue=16,Pue=250,xue=["major","premajor","minor","preminor","patch","prepatch","prerelease"];b0.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Cue,MAX_SAFE_BUILD_LENGTH:Pue,MAX_SAFE_INTEGER:Oue,RELEASE_TYPES:xue,SEMVER_SPEC_VERSION:bue,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Nf=y((Oze,O0)=>{"use strict";p();u();l();var vue=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};O0.exports=vue});var Ol=y((Rs,C0)=>{"use strict";p();u();l();var{MAX_SAFE_COMPONENT_LENGTH:AN,MAX_SAFE_BUILD_LENGTH:Mue,MAX_LENGTH:Lue}=If(),wue=Nf();Rs=C0.exports={};var Due=Rs.re=[],Uue=Rs.safeRe=[],X=Rs.src=[],kue=Rs.safeSrc=[],Q=Rs.t={},jue=0,yN="[a-zA-Z0-9-]",Gue=[["\\s",1],["\\d",Lue],[yN,Mue]],Bue=t=>{for(let[e,n]of Gue)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},Se=(t,e,n)=>{let r=Bue(e),o=jue++;wue(t,o,e),Q[t]=o,X[o]=e,kue[o]=r,Due[o]=new RegExp(e,n?"g":void 0),Uue[o]=new RegExp(r,n?"g":void 0)};Se("NUMERICIDENTIFIER","0|[1-9]\\d*");Se("NUMERICIDENTIFIERLOOSE","\\d+");Se("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${yN}*`);Se("MAINVERSION",`(${X[Q.NUMERICIDENTIFIER]})\\.(${X[Q.NUMERICIDENTIFIER]})\\.(${X[Q.NUMERICIDENTIFIER]})`);Se("MAINVERSIONLOOSE",`(${X[Q.NUMERICIDENTIFIERLOOSE]})\\.(${X[Q.NUMERICIDENTIFIERLOOSE]})\\.(${X[Q.NUMERICIDENTIFIERLOOSE]})`);Se("PRERELEASEIDENTIFIER",`(?:${X[Q.NONNUMERICIDENTIFIER]}|${X[Q.NUMERICIDENTIFIER]})`);Se("PRERELEASEIDENTIFIERLOOSE",`(?:${X[Q.NONNUMERICIDENTIFIER]}|${X[Q.NUMERICIDENTIFIERLOOSE]})`);Se("PRERELEASE",`(?:-(${X[Q.PRERELEASEIDENTIFIER]}(?:\\.${X[Q.PRERELEASEIDENTIFIER]})*))`);Se("PRERELEASELOOSE",`(?:-?(${X[Q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${X[Q.PRERELEASEIDENTIFIERLOOSE]})*))`);Se("BUILDIDENTIFIER",`${yN}+`);Se("BUILD",`(?:\\+(${X[Q.BUILDIDENTIFIER]}(?:\\.${X[Q.BUILDIDENTIFIER]})*))`);Se("FULLPLAIN",`v?${X[Q.MAINVERSION]}${X[Q.PRERELEASE]}?${X[Q.BUILD]}?`);Se("FULL",`^${X[Q.FULLPLAIN]}$`);Se("LOOSEPLAIN",`[v=\\s]*${X[Q.MAINVERSIONLOOSE]}${X[Q.PRERELEASELOOSE]}?${X[Q.BUILD]}?`);Se("LOOSE",`^${X[Q.LOOSEPLAIN]}$`);Se("GTLT","((?:<|>)?=?)");Se("XRANGEIDENTIFIERLOOSE",`${X[Q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Se("XRANGEIDENTIFIER",`${X[Q.NUMERICIDENTIFIER]}|x|X|\\*`);Se("XRANGEPLAIN",`[v=\\s]*(${X[Q.XRANGEIDENTIFIER]})(?:\\.(${X[Q.XRANGEIDENTIFIER]})(?:\\.(${X[Q.XRANGEIDENTIFIER]})(?:${X[Q.PRERELEASE]})?${X[Q.BUILD]}?)?)?`);Se("XRANGEPLAINLOOSE",`[v=\\s]*(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:${X[Q.PRERELEASELOOSE]})?${X[Q.BUILD]}?)?)?`);Se("XRANGE",`^${X[Q.GTLT]}\\s*${X[Q.XRANGEPLAIN]}$`);Se("XRANGELOOSE",`^${X[Q.GTLT]}\\s*${X[Q.XRANGEPLAINLOOSE]}$`);Se("COERCEPLAIN",`(^|[^\\d])(\\d{1,${AN}})(?:\\.(\\d{1,${AN}}))?(?:\\.(\\d{1,${AN}}))?`);Se("COERCE",`${X[Q.COERCEPLAIN]}(?:$|[^\\d])`);Se("COERCEFULL",X[Q.COERCEPLAIN]+`(?:${X[Q.PRERELEASE]})?(?:${X[Q.BUILD]})?(?:$|[^\\d])`);Se("COERCERTL",X[Q.COERCE],!0);Se("COERCERTLFULL",X[Q.COERCEFULL],!0);Se("LONETILDE","(?:~>?)");Se("TILDETRIM",`(\\s*)${X[Q.LONETILDE]}\\s+`,!0);Rs.tildeTrimReplace="$1~";Se("TILDE",`^${X[Q.LONETILDE]}${X[Q.XRANGEPLAIN]}$`);Se("TILDELOOSE",`^${X[Q.LONETILDE]}${X[Q.XRANGEPLAINLOOSE]}$`);Se("LONECARET","(?:\\^)");Se("CARETTRIM",`(\\s*)${X[Q.LONECARET]}\\s+`,!0);Rs.caretTrimReplace="$1^";Se("CARET",`^${X[Q.LONECARET]}${X[Q.XRANGEPLAIN]}$`);Se("CARETLOOSE",`^${X[Q.LONECARET]}${X[Q.XRANGEPLAINLOOSE]}$`);Se("COMPARATORLOOSE",`^${X[Q.GTLT]}\\s*(${X[Q.LOOSEPLAIN]})$|^$`);Se("COMPARATOR",`^${X[Q.GTLT]}\\s*(${X[Q.FULLPLAIN]})$|^$`);Se("COMPARATORTRIM",`(\\s*)${X[Q.GTLT]}\\s*(${X[Q.LOOSEPLAIN]}|${X[Q.XRANGEPLAIN]})`,!0);Rs.comparatorTrimReplace="$1$2$3";Se("HYPHENRANGE",`^\\s*(${X[Q.XRANGEPLAIN]})\\s+-\\s+(${X[Q.XRANGEPLAIN]})\\s*$`);Se("HYPHENRANGELOOSE",`^\\s*(${X[Q.XRANGEPLAINLOOSE]})\\s+-\\s+(${X[Q.XRANGEPLAINLOOSE]})\\s*$`);Se("STAR","(<|>)?=?\\s*\\*");Se("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Se("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ng=y((wze,P0)=>{"use strict";p();u();l();var $ue=Object.freeze({loose:!0}),Fue=Object.freeze({}),Hue=t=>t?typeof t!="object"?$ue:t:Fue;P0.exports=Hue});var RN=y((jze,M0)=>{"use strict";p();u();l();var x0=/^[0-9]+$/,v0=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=x0.test(t),r=x0.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},Vue=(t,e)=>v0(e,t);M0.exports={compareIdentifiers:v0,rcompareIdentifiers:Vue}});var xn=y((Fze,w0)=>{"use strict";p();u();l();var bg=Nf(),{MAX_LENGTH:L0,MAX_SAFE_INTEGER:Og}=If(),{safeRe:Cg,t:Pg}=Ol(),que=Ng(),{compareIdentifiers:IN}=RN(),NN=class t{constructor(e,n){if(n=que(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>L0)throw new TypeError(`version is longer than ${L0} characters`);bg("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?Cg[Pg.LOOSE]:Cg[Pg.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Og||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Og||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Og||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<Og)return s}return o}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(bg("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],o=e.prerelease[n];if(bg("prerelease compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return IN(r,o)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],o=e.build[n];if(bg("build compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return IN(r,o)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?Cg[Pg.PRERELEASELOOSE]:Cg[Pg.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let s=[n,o];r===!1&&(s=[n]),IN(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};w0.exports=NN});var Hc=y((Yze,U0)=>{"use strict";p();u();l();var D0=xn(),Yue=(t,e,n=!1)=>{if(t instanceof D0)return t;try{return new D0(t,e)}catch(r){if(!n)return null;throw r}};U0.exports=Yue});var j0=y((Xze,k0)=>{"use strict";p();u();l();var Wue=Hc(),Kue=(t,e)=>{let n=Wue(t,e);return n?n.version:null};k0.exports=Kue});var B0=y((e3e,G0)=>{"use strict";p();u();l();var zue=Hc(),Xue=(t,e)=>{let n=zue(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};G0.exports=Xue});var H0=y((o3e,F0)=>{"use strict";p();u();l();var $0=xn(),Que=(t,e,n,r,o)=>{typeof n=="string"&&(o=r,r=n,n=void 0);try{return new $0(t instanceof $0?t.version:t,n).inc(e,r,o).version}catch{return null}};F0.exports=Que});var Y0=y((c3e,q0)=>{"use strict";p();u();l();var V0=Hc(),Jue=(t,e)=>{let n=V0(t,null,!0),r=V0(e,null,!0),o=n.compare(r);if(o===0)return null;let s=o>0,i=s?n:r,a=s?r:n,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let f=c?"pre":"";return n.major!==r.major?f+"major":n.minor!==r.minor?f+"minor":n.patch!==r.patch?f+"patch":"prerelease"};q0.exports=Jue});var K0=y((d3e,W0)=>{"use strict";p();u();l();var Zue=xn(),ele=(t,e)=>new Zue(t,e).major;W0.exports=ele});var X0=y((h3e,z0)=>{"use strict";p();u();l();var tle=xn(),nle=(t,e)=>new tle(t,e).minor;z0.exports=nle});var J0=y((S3e,Q0)=>{"use strict";p();u();l();var rle=xn(),ole=(t,e)=>new rle(t,e).patch;Q0.exports=ole});var eU=y((I3e,Z0)=>{"use strict";p();u();l();var sle=Hc(),ile=(t,e)=>{let n=sle(t,e);return n&&n.prerelease.length?n.prerelease:null};Z0.exports=ile});var mo=y((C3e,nU)=>{"use strict";p();u();l();var tU=xn(),ale=(t,e,n)=>new tU(t,n).compare(new tU(e,n));nU.exports=ale});var oU=y((M3e,rU)=>{"use strict";p();u();l();var cle=mo(),ule=(t,e,n)=>cle(e,t,n);rU.exports=ule});var iU=y((U3e,sU)=>{"use strict";p();u();l();var lle=mo(),ple=(t,e)=>lle(t,e,!0);sU.exports=ple});var xg=y((B3e,cU)=>{"use strict";p();u();l();var aU=xn(),dle=(t,e,n)=>{let r=new aU(t,n),o=new aU(e,n);return r.compare(o)||r.compareBuild(o)};cU.exports=dle});var lU=y((V3e,uU)=>{"use strict";p();u();l();var fle=xg(),mle=(t,e)=>t.sort((n,r)=>fle(n,r,e));uU.exports=mle});var dU=y((K3e,pU)=>{"use strict";p();u();l();var _le=xg(),hle=(t,e)=>t.sort((n,r)=>_le(r,n,e));pU.exports=hle});var bf=y((J3e,fU)=>{"use strict";p();u();l();var gle=mo(),Ele=(t,e,n)=>gle(t,e,n)>0;fU.exports=Ele});var vg=y((n5e,mU)=>{"use strict";p();u();l();var Tle=mo(),Sle=(t,e,n)=>Tle(t,e,n)<0;mU.exports=Sle});var bN=y((i5e,_U)=>{"use strict";p();u();l();var Ale=mo(),yle=(t,e,n)=>Ale(t,e,n)===0;_U.exports=yle});var ON=y((l5e,hU)=>{"use strict";p();u();l();var Rle=mo(),Ile=(t,e,n)=>Rle(t,e,n)!==0;hU.exports=Ile});var Mg=y((m5e,gU)=>{"use strict";p();u();l();var Nle=mo(),ble=(t,e,n)=>Nle(t,e,n)>=0;gU.exports=ble});var Lg=y((E5e,EU)=>{"use strict";p();u();l();var Ole=mo(),Cle=(t,e,n)=>Ole(t,e,n)<=0;EU.exports=Cle});var CN=y((y5e,TU)=>{"use strict";p();u();l();var Ple=bN(),xle=ON(),vle=bf(),Mle=Mg(),Lle=vg(),wle=Lg(),Dle=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Ple(t,n,r);case"!=":return xle(t,n,r);case">":return vle(t,n,r);case">=":return Mle(t,n,r);case"<":return Lle(t,n,r);case"<=":return wle(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};TU.exports=Dle});var AU=y((b5e,SU)=>{"use strict";p();u();l();var Ule=xn(),kle=Hc(),{safeRe:wg,t:Dg}=Ol(),jle=(t,e)=>{if(t instanceof Ule)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?wg[Dg.COERCEFULL]:wg[Dg.COERCE]);else{let c=e.includePrerelease?wg[Dg.COERCERTLFULL]:wg[Dg.COERCERTL],d;for(;(d=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||d.index+d[0].length!==n.index+n[0].length)&&(n=d),c.lastIndex=d.index+d[1].length+d[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],o=n[3]||"0",s=n[4]||"0",i=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return kle(`${r}.${o}.${s}${i}${a}`,e)};SU.exports=jle});var RU=y((x5e,yU)=>{"use strict";p();u();l();var PN=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,n)}return this}};yU.exports=PN});var _o=y((w5e,OU)=>{"use strict";p();u();l();var Gle=/\s+/g,xN=class t{constructor(e,n){if(n=$le(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof vN)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(Gle," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(o=>!NU(o[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&Kle(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&Yle)|(this.options.loose&&Wle))+":"+e,o=IU.get(r);if(o)return o;let s=this.options.loose,i=s?Zn[vn.HYPHENRANGELOOSE]:Zn[vn.HYPHENRANGE];e=e.replace(i,ope(this.options.includePrerelease)),rt("hyphen replace",e),e=e.replace(Zn[vn.COMPARATORTRIM],Hle),rt("comparator trim",e),e=e.replace(Zn[vn.TILDETRIM],Vle),rt("tilde trim",e),e=e.replace(Zn[vn.CARETTRIM],qle),rt("caret trim",e);let a=e.split(" ").map(m=>zle(m,this.options)).join(" ").split(/\s+/).map(m=>rpe(m,this.options));s&&(a=a.filter(m=>(rt("loose invalid filter",m,this.options),!!m.match(Zn[vn.COMPARATORLOOSE])))),rt("range list",a);let c=new Map,d=a.map(m=>new vN(m,this.options));for(let m of d){if(NU(m))return[m];c.set(m.value,m)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return IU.set(r,f),f}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>bU(r,n)&&e.set.some(o=>bU(o,n)&&r.every(s=>o.every(i=>s.intersects(i,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Fle(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(spe(this.set[n],e,this.options))return!0;return!1}};OU.exports=xN;var Ble=RU(),IU=new Ble,$le=Ng(),vN=Of(),rt=Nf(),Fle=xn(),{safeRe:Zn,t:vn,comparatorTrimReplace:Hle,tildeTrimReplace:Vle,caretTrimReplace:qle}=Ol(),{FLAG_INCLUDE_PRERELEASE:Yle,FLAG_LOOSE:Wle}=If(),NU=t=>t.value==="<0.0.0-0",Kle=t=>t.value==="",bU=(t,e)=>{let n=!0,r=t.slice(),o=r.pop();for(;n&&r.length;)n=r.every(s=>o.intersects(s,e)),o=r.pop();return n},zle=(t,e)=>(t=t.replace(Zn[vn.BUILD],""),rt("comp",t,e),t=Jle(t,e),rt("caret",t),t=Xle(t,e),rt("tildes",t),t=epe(t,e),rt("xrange",t),t=npe(t,e),rt("stars",t),t),er=t=>!t||t.toLowerCase()==="x"||t==="*",Xle=(t,e)=>t.trim().split(/\s+/).map(n=>Qle(n,e)).join(" "),Qle=(t,e)=>{let n=e.loose?Zn[vn.TILDELOOSE]:Zn[vn.TILDE];return t.replace(n,(r,o,s,i,a)=>{rt("tilde",t,r,o,s,i,a);let c;return er(o)?c="":er(s)?c=`>=${o}.0.0 <${+o+1}.0.0-0`:er(i)?c=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:a?(rt("replaceTilde pr",a),c=`>=${o}.${s}.${i}-${a} <${o}.${+s+1}.0-0`):c=`>=${o}.${s}.${i} <${o}.${+s+1}.0-0`,rt("tilde return",c),c})},Jle=(t,e)=>t.trim().split(/\s+/).map(n=>Zle(n,e)).join(" "),Zle=(t,e)=>{rt("caret",t,e);let n=e.loose?Zn[vn.CARETLOOSE]:Zn[vn.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{rt("caret",t,o,s,i,a,c);let d;return er(s)?d="":er(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:er(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?(rt("replaceCaret pr",c),s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(rt("no pr"),s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),rt("caret return",d),d})},epe=(t,e)=>(rt("replaceXRanges",t,e),t.split(/\s+/).map(n=>tpe(n,e)).join(" ")),tpe=(t,e)=>{t=t.trim();let n=e.loose?Zn[vn.XRANGELOOSE]:Zn[vn.XRANGE];return t.replace(n,(r,o,s,i,a,c)=>{rt("xRange",t,r,o,s,i,a,c);let d=er(s),f=d||er(i),m=f||er(a),_=m;return o==="="&&_&&(o=""),c=e.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(f&&(i=0),a=0,o===">"?(o=">=",f?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",f?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):f?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),rt("xRange return",r),r})},npe=(t,e)=>(rt("replaceStars",t,e),t.trim().replace(Zn[vn.STAR],"")),rpe=(t,e)=>(rt("replaceGTE0",t,e),t.trim().replace(Zn[e.includePrerelease?vn.GTE0PRE:vn.GTE0],"")),ope=t=>(e,n,r,o,s,i,a,c,d,f,m,_)=>(er(r)?n="":er(o)?n=`>=${r}.0.0${t?"-0":""}`:er(s)?n=`>=${r}.${o}.0${t?"-0":""}`:i?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,er(d)?c="":er(f)?c=`<${+d+1}.0.0-0`:er(m)?c=`<${d}.${+f+1}.0-0`:_?c=`<=${d}.${f}.${m}-${_}`:t?c=`<${d}.${f}.${+m+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),spe=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(rt(t[r].semver),t[r].semver!==vN.ANY&&t[r].semver.prerelease.length>0){let o=t[r].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var Of=y((j5e,LU)=>{"use strict";p();u();l();var Cf=Symbol("SemVer ANY"),wN=class t{static get ANY(){return Cf}constructor(e,n){if(n=CU(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),LN("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===Cf?this.value="":this.value=this.operator+this.semver.version,LN("comp",this)}parse(e){let n=this.options.loose?PU[xU.COMPARATORLOOSE]:PU[xU.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new vU(r[2],this.options.loose):this.semver=Cf}toString(){return this.value}test(e){if(LN("Comparator.test",e,this.options.loose),this.semver===Cf||e===Cf)return!0;if(typeof e=="string")try{e=new vU(e,this.options)}catch{return!1}return MN(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new MU(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new MU(this.value,n).test(e.semver):(n=CU(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||MN(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||MN(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};LU.exports=wN;var CU=Ng(),{safeRe:PU,t:xU}=Ol(),MN=CN(),LN=Nf(),vU=xn(),MU=_o()});var Pf=y((F5e,wU)=>{"use strict";p();u();l();var ipe=_o(),ape=(t,e,n)=>{try{e=new ipe(e,n)}catch{return!1}return e.test(t)};wU.exports=ape});var UU=y((Y5e,DU)=>{"use strict";p();u();l();var cpe=_o(),upe=(t,e)=>new cpe(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));DU.exports=upe});var jU=y((X5e,kU)=>{"use strict";p();u();l();var lpe=xn(),ppe=_o(),dpe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new ppe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===-1)&&(r=i,o=new lpe(r,n))}),r};kU.exports=dpe});var BU=y((e9e,GU)=>{"use strict";p();u();l();var fpe=xn(),mpe=_o(),_pe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new mpe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===1)&&(r=i,o=new fpe(r,n))}),r};GU.exports=_pe});var HU=y((o9e,FU)=>{"use strict";p();u();l();var DN=xn(),hpe=_o(),$U=bf(),gpe=(t,e)=>{t=new hpe(t,e);let n=new DN("0.0.0");if(t.test(n)||(n=new DN("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null;o.forEach(i=>{let a=new DN(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||$U(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!n||$U(n,s))&&(n=s)}return n&&t.test(n)?n:null};FU.exports=gpe});var qU=y((c9e,VU)=>{"use strict";p();u();l();var Epe=_o(),Tpe=(t,e)=>{try{return new Epe(t,e).range||"*"}catch{return null}};VU.exports=Tpe});var Ug=y((d9e,zU)=>{"use strict";p();u();l();var Spe=xn(),KU=Of(),{ANY:Ape}=KU,ype=_o(),Rpe=Pf(),YU=bf(),WU=vg(),Ipe=Lg(),Npe=Mg(),bpe=(t,e,n,r)=>{t=new Spe(t,r),e=new ype(e,r);let o,s,i,a,c;switch(n){case">":o=YU,s=Ipe,i=WU,a=">",c=">=";break;case"<":o=WU,s=Npe,i=YU,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Rpe(t,e,r))return!1;for(let d=0;d<e.set.length;++d){let f=e.set[d],m=null,_=null;if(f.forEach(g=>{g.semver===Ape&&(g=new KU(">=0.0.0")),m=m||g,_=_||g,o(g.semver,m.semver,r)?m=g:i(g.semver,_.semver,r)&&(_=g)}),m.operator===a||m.operator===c||(!_.operator||_.operator===a)&&s(t,_.semver))return!1;if(_.operator===c&&i(t,_.semver))return!1}return!0};zU.exports=bpe});var QU=y((h9e,XU)=>{"use strict";p();u();l();var Ope=Ug(),Cpe=(t,e,n)=>Ope(t,e,">",n);XU.exports=Cpe});var ZU=y((S9e,JU)=>{"use strict";p();u();l();var Ppe=Ug(),xpe=(t,e,n)=>Ppe(t,e,"<",n);JU.exports=xpe});var nk=y((I9e,tk)=>{"use strict";p();u();l();var ek=_o(),vpe=(t,e,n)=>(t=new ek(t,n),e=new ek(e,n),t.intersects(e,n));tk.exports=vpe});var ok=y((C9e,rk)=>{"use strict";p();u();l();var Mpe=Pf(),Lpe=mo();rk.exports=(t,e,n)=>{let r=[],o=null,s=null,i=t.sort((f,m)=>Lpe(f,m,n));for(let f of i)Mpe(f,e,n)?(s=f,o||(o=f)):(s&&r.push([o,s]),s=null,o=null);o&&r.push([o,null]);let a=[];for(let[f,m]of r)f===m?a.push(f):!m&&f===i[0]?a.push("*"):m?f===i[0]?a.push(`<=${m}`):a.push(`${f} - ${m}`):a.push(`>=${f}`);let c=a.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return c.length<d.length?c:e}});var lk=y((M9e,uk)=>{"use strict";p();u();l();var sk=_o(),kN=Of(),{ANY:UN}=kN,xf=Pf(),jN=mo(),wpe=(t,e,n={})=>{if(t===e)return!0;t=new sk(t,n),e=new sk(e,n);let r=!1;e:for(let o of t.set){for(let s of e.set){let i=Upe(o,s,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},Dpe=[new kN(">=0.0.0-0")],ik=[new kN(">=0.0.0")],Upe=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===UN){if(e.length===1&&e[0].semver===UN)return!0;n.includePrerelease?t=Dpe:t=ik}if(e.length===1&&e[0].semver===UN){if(n.includePrerelease)return!0;e=ik}let r=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=ak(o,g,n):g.operator==="<"||g.operator==="<="?s=ck(s,g,n):r.add(g.semver);if(r.size>1)return null;let i;if(o&&s){if(i=jN(o.semver,s.semver,n),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of r){if(o&&!xf(g,String(o),n)||s&&!xf(g,String(s),n))return null;for(let T of e)if(!xf(g,String(T),n))return!1;return!0}let a,c,d,f,m=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1;m&&m.prerelease.length===1&&s.operator==="<"&&m.prerelease[0]===0&&(m=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(_&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===_.major&&g.semver.minor===_.minor&&g.semver.patch===_.patch&&(_=!1),g.operator===">"||g.operator===">="){if(a=ak(o,g,n),a===g&&a!==o)return!1}else if(o.operator===">="&&!xf(o.semver,String(g),n))return!1}if(s){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator==="<"||g.operator==="<="){if(c=ck(s,g,n),c===g&&c!==s)return!1}else if(s.operator==="<="&&!xf(s.semver,String(g),n))return!1}if(!g.operator&&(s||o)&&i!==0)return!1}return!(o&&d&&!s&&i!==0||s&&f&&!o&&i!==0||_||m)},ak=(t,e,n)=>{if(!t)return e;let r=jN(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},ck=(t,e,n)=>{if(!t)return e;let r=jN(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};uk.exports=wpe});var mk=y((U9e,fk)=>{"use strict";p();u();l();var GN=Ol(),pk=If(),kpe=xn(),dk=RN(),jpe=Hc(),Gpe=j0(),Bpe=B0(),$pe=H0(),Fpe=Y0(),Hpe=K0(),Vpe=X0(),qpe=J0(),Ype=eU(),Wpe=mo(),Kpe=oU(),zpe=iU(),Xpe=xg(),Qpe=lU(),Jpe=dU(),Zpe=bf(),ede=vg(),tde=bN(),nde=ON(),rde=Mg(),ode=Lg(),sde=CN(),ide=AU(),ade=Of(),cde=_o(),ude=Pf(),lde=UU(),pde=jU(),dde=BU(),fde=HU(),mde=qU(),_de=Ug(),hde=QU(),gde=ZU(),Ede=nk(),Tde=ok(),Sde=lk();fk.exports={parse:jpe,valid:Gpe,clean:Bpe,inc:$pe,diff:Fpe,major:Hpe,minor:Vpe,patch:qpe,prerelease:Ype,compare:Wpe,rcompare:Kpe,compareLoose:zpe,compareBuild:Xpe,sort:Qpe,rsort:Jpe,gt:Zpe,lt:ede,eq:tde,neq:nde,gte:rde,lte:ode,cmp:sde,coerce:ide,Comparator:ade,Range:cde,satisfies:ude,toComparators:lde,maxSatisfying:pde,minSatisfying:dde,minVersion:fde,validRange:mde,outside:_de,gtr:hde,ltr:gde,intersects:Ede,simplifyRange:Tde,subset:Sde,SemVer:kpe,re:GN.re,src:GN.src,tokens:GN.t,SEMVER_SPEC_VERSION:pk.SEMVER_SPEC_VERSION,RELEASE_TYPES:pk.RELEASE_TYPES,compareIdentifiers:dk.compareIdentifiers,rcompareIdentifiers:dk.rcompareIdentifiers}});function yde(t){let e=(0,tr.normalize)(t);return e.length>1&&e[e.length-1]===tr.sep&&(e=e.substring(0,e.length-1)),e}function Ek(t,e){return t.replace(Rde,e)}function Nde(t){return t==="/"||Ide.test(t)}function BN(t,e){let{resolvePaths:n,normalizePath:r,pathSeparator:o}=e,s=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=(0,tr.resolve)(t)),(r||s)&&(t=yde(t)),t===".")return"";let i=t[t.length-1]!==o;return Ek(i?t+o:t,o)}function Tk(t,e){return e+t}function bde(t,e){return function(n,r){return r.startsWith(t)?r.slice(t.length)+n:Ek((0,tr.relative)(t,r),e.pathSeparator)+e.pathSeparator+n}}function Ode(t){return t}function Cde(t,e,n){return e+t+n}function Pde(t,e){let{relativePaths:n,includeBasePath:r}=e;return n&&t?bde(t,e):r?Tk:Ode}function xde(t){return function(e,n){n.push(e.substring(t.length)||".")}}function vde(t){return function(e,n,r){let o=e.substring(t.length)||".";r.every(s=>s(o,!0))&&n.push(o)}}function Dde(t,e){let{includeDirs:n,filters:r,relativePaths:o}=e;return n?o?r&&r.length?vde(t):xde(t):r&&r.length?Lde:Mde:wde}function $de(t){let{excludeFiles:e,filters:n,onlyCounts:r}=t;return e?Bde:n&&n.length?r?Ude:kde:r?jde:Gde}function Vde(t){return t.group?Hde:Fde}function Wde(t){return t.group?qde:Yde}function Xde(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?zde:Kde}function Sk(t,e,n){if(n.options.useRealPaths)return Qde(e,n);let r=(0,tr.dirname)(t),o=1;for(;r!==n.root&&o<2;){let s=n.symlinks.get(r);!!s&&(s===e||s.startsWith(e)||e.startsWith(s))?o++:r=(0,tr.dirname)(r)}return n.symlinks.set(t,e),o>1}function Qde(t,e){return e.visited.includes(t+e.options.pathSeparator)}function kg(t,e,n,r){e(t&&!r?t:null,n)}function ife(t,e){let{onlyCounts:n,group:r,maxFiles:o}=t;return n?e?Jde:nfe:r?e?Zde:sfe:o?e?tfe:ofe:e?efe:rfe}function ufe(t){return t?cfe:afe}function ffe(t,e){return new Promise((n,r)=>{Rk(t,e,(o,s)=>{if(o)return r(o);n(s)})})}function Rk(t,e,n){new yk(t,e,n).start()}function mfe(t,e){return new yk(t,e).start()}var gk,tr,Ade,_k,Rde,Ide,Mde,Lde,wde,Ude,kde,jde,Gde,Bde,Fde,Hde,qde,Yde,Kde,zde,Jde,Zde,efe,tfe,nfe,rfe,ofe,sfe,Ak,afe,cfe,lfe,pfe,dfe,yk,hk,Ik,Nk,bk=S(()=>{p();u();l();gk=require("module"),tr=require("path"),Ade=j(require("fs"),1),_k=(0,gk.createRequire)(h);Rde=/[\\/]/g;Ide=/^[a-z]:[\\/]$/i;Mde=(t,e)=>{e.push(t||".")},Lde=(t,e,n)=>{let r=t||".";n.every(o=>o(r,!0))&&e.push(r)},wde=()=>{};Ude=(t,e,n,r)=>{r.every(o=>o(t,!1))&&n.files++},kde=(t,e,n,r)=>{r.every(o=>o(t,!1))&&e.push(t)},jde=(t,e,n,r)=>{n.files++},Gde=(t,e)=>{e.push(t)},Bde=()=>{};Fde=t=>t,Hde=()=>[""].slice(0,0);qde=(t,e,n)=>{t.push({directory:e,files:n,dir:e})},Yde=()=>{};Kde=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue(),o.realpath(t,(i,a)=>{if(i)return r.dequeue(s?null:i,e);o.stat(a,(c,d)=>{if(c)return r.dequeue(s?null:c,e);if(d.isDirectory()&&Sk(t,a,e))return r.dequeue(null,e);n(d,a),r.dequeue(null,e)})})},zde=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue();try{let i=o.realpathSync(t),a=o.statSync(i);if(a.isDirectory()&&Sk(t,i,e))return;n(a,i)}catch(i){if(!s)throw i}};Jde=t=>t.counts,Zde=t=>t.groups,efe=t=>t.paths,tfe=t=>t.paths.slice(0,t.options.maxFiles),nfe=(t,e,n)=>(kg(e,n,t.counts,t.options.suppressErrors),null),rfe=(t,e,n)=>(kg(e,n,t.paths,t.options.suppressErrors),null),ofe=(t,e,n)=>(kg(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),sfe=(t,e,n)=>(kg(e,n,t.groups,t.options.suppressErrors),null);Ak={withFileTypes:!0},afe=(t,e,n,r,o)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);let{fs:s}=t;t.visited.push(e),t.counts.directories++,s.readdir(e||".",Ak,(i,a=[])=>{o(a,n,r),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},cfe=(t,e,n,r,o)=>{let{fs:s}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=s.readdirSync(e||".",Ak)}catch(a){if(!t.options.suppressErrors)throw a}o(i,n,r)};lfe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},pfe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},dfe=class{aborted=!1;abort(){this.aborted=!0}},yk=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=ife(e,this.isSynchronous),this.root=BN(t,e),this.state={root:Nde(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new pfe,options:e,queue:new lfe((r,o)=>this.callbackInvoker(o,r,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new dfe,fs:e.fs||Ade},this.joinPath=Pde(this.root,e),this.pushDirectory=Dde(this.root,e),this.pushFile=$de(e),this.getArray=Vde(e),this.groupFiles=Wde(e),this.resolveSymlink=Xde(e,this.isSynchronous),this.walkDirectory=ufe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,n)=>{let{paths:r,options:{filters:o,resolveSymlinks:s,excludeSymlinks:i,exclude:a,maxFiles:c,signal:d,useRealPaths:f,pathSeparator:m},controller:_}=this.state;if(_.aborted||d&&d.aborted||c&&r.length>c)return;let g=this.getArray(this.state.paths);for(let T=0;T<t.length;++T){let A=t[T];if(A.isFile()||A.isSymbolicLink()&&!s&&!i){let R=this.joinPath(A.name,e);this.pushFile(R,g,this.state.counts,o)}else if(A.isDirectory()){let R=Cde(A.name,e,this.state.options.pathSeparator);if(a&&a(A.name,R))continue;this.pushDirectory(R,r,o),this.walkDirectory(this.state,R,R,n-1,this.walk)}else if(this.resolveSymlink&&A.isSymbolicLink()){let R=Tk(A.name,e);this.resolveSymlink(R,this.state,(b,I)=>{if(b.isDirectory()){if(I=BN(I,this.state.options),a&&a(A.name,f?I:R+m))return;this.walkDirectory(this.state,I,f?I:R+m,n-1,this.walk)}else{I=f?I:R;let v=(0,tr.basename)(I),O=BN((0,tr.dirname)(I),this.state.options);I=this.joinPath(v,O),this.pushFile(I,g,this.state.counts,o)}})}}this.groupFiles(this.state.groups,e,g)}};hk=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return ffe(this.root,this.options)}withCallback(t){Rk(this.root,this.options,t)}sync(){return mfe(this.root,this.options)}},Ik=null;try{_k.resolve("picomatch"),Ik=_k("picomatch")}catch{}Nk=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:tr.sep,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new hk(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new hk(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let n=this.globFunction||Ik;if(!n)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=n(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(o=>r(o)),this}}});var vf=y((X9e,vk)=>{"use strict";p();u();l();var Ok="[^\\\\/]",_fe="(?=.)",Ck="[^/]",$N="(?:\\/|$)",Pk="(?:^|\\/)",FN=`\\.{1,2}${$N}`,hfe="(?!\\.)",gfe=`(?!${Pk}${FN})`,Efe=`(?!\\.{0,1}${$N})`,Tfe=`(?!${FN})`,Sfe="[^.\\/]",Afe=`${Ck}*?`,yfe="/",xk={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:_fe,QMARK:Ck,END_ANCHOR:$N,DOTS_SLASH:FN,NO_DOT:hfe,NO_DOTS:gfe,NO_DOT_SLASH:Efe,NO_DOTS_SLASH:Tfe,QMARK_NO_DOT:Sfe,STAR:Afe,START_ANCHOR:Pk,SEP:yfe},Rfe={...xk,SLASH_LITERAL:"[\\\\/]",QMARK:Ok,STAR:`${Ok}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},Ife={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};vk.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Ife,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Rfe:xk}}});var Mf=y(Nr=>{"use strict";p();u();l();var{REGEX_BACKSLASH:Nfe,REGEX_REMOVE_BACKSLASH:bfe,REGEX_SPECIAL_CHARS:Ofe,REGEX_SPECIAL_CHARS_GLOBAL:Cfe}=vf();Nr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Nr.hasRegexChars=t=>Ofe.test(t);Nr.isRegexChar=t=>t.length===1&&Nr.hasRegexChars(t);Nr.escapeRegex=t=>t.replace(Cfe,"\\$1");Nr.toPosixSlashes=t=>t.replace(Nfe,"/");Nr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Nr.removeBackslashes=t=>t.replace(bfe,e=>e==="\\"?"":e);Nr.escapeLast=(t,e,n)=>{let r=t.lastIndexOf(e,n);return r===-1?t:t[r-1]==="\\"?Nr.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};Nr.removePrefix=(t,e={})=>{let n=t;return n.startsWith("./")&&(n=n.slice(2),e.prefix="./"),n};Nr.wrapOutput=(t,e={},n={})=>{let r=n.contains?"":"^",o=n.contains?"":"$",s=`${r}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};Nr.basename=(t,{windows:e}={})=>{let n=t.split(e?/[\\/]/:"/"),r=n[n.length-1];return r===""?n[n.length-2]:r}});var Gk=y((o6e,jk)=>{"use strict";p();u();l();var Mk=Mf(),{CHAR_ASTERISK:HN,CHAR_AT:Pfe,CHAR_BACKWARD_SLASH:Lf,CHAR_COMMA:xfe,CHAR_DOT:VN,CHAR_EXCLAMATION_MARK:qN,CHAR_FORWARD_SLASH:kk,CHAR_LEFT_CURLY_BRACE:YN,CHAR_LEFT_PARENTHESES:WN,CHAR_LEFT_SQUARE_BRACKET:vfe,CHAR_PLUS:Mfe,CHAR_QUESTION_MARK:Lk,CHAR_RIGHT_CURLY_BRACE:Lfe,CHAR_RIGHT_PARENTHESES:wk,CHAR_RIGHT_SQUARE_BRACKET:wfe}=vf(),Dk=t=>t===kk||t===Lf,Uk=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Dfe=(t,e)=>{let n=e||{},r=t.length-1,o=n.parts===!0||n.scanToEnd===!0,s=[],i=[],a=[],c=t,d=-1,f=0,m=0,_=!1,g=!1,T=!1,A=!1,R=!1,b=!1,I=!1,v=!1,O=!1,G=!1,w=0,K,k,ee={value:"",depth:0,isGlob:!1},C=()=>d>=r,Et=()=>c.charCodeAt(d+1),ze=()=>(K=k,c.charCodeAt(++d));for(;d<r;){k=ze();let ke;if(k===Lf){I=ee.backslashes=!0,k=ze(),k===YN&&(b=!0);continue}if(b===!0||k===YN){for(w++;C()!==!0&&(k=ze());){if(k===Lf){I=ee.backslashes=!0,ze();continue}if(k===YN){w++;continue}if(b!==!0&&k===VN&&(k=ze())===VN){if(_=ee.isBrace=!0,T=ee.isGlob=!0,G=!0,o===!0)continue;break}if(b!==!0&&k===xfe){if(_=ee.isBrace=!0,T=ee.isGlob=!0,G=!0,o===!0)continue;break}if(k===Lfe&&(w--,w===0)){b=!1,_=ee.isBrace=!0,G=!0;break}}if(o===!0)continue;break}if(k===kk){if(s.push(d),i.push(ee),ee={value:"",depth:0,isGlob:!1},G===!0)continue;if(K===VN&&d===f+1){f+=2;continue}m=d+1;continue}if(n.noext!==!0&&(k===Mfe||k===Pfe||k===HN||k===Lk||k===qN)===!0&&Et()===WN){if(T=ee.isGlob=!0,A=ee.isExtglob=!0,G=!0,k===qN&&d===f&&(O=!0),o===!0){for(;C()!==!0&&(k=ze());){if(k===Lf){I=ee.backslashes=!0,k=ze();continue}if(k===wk){T=ee.isGlob=!0,G=!0;break}}continue}break}if(k===HN){if(K===HN&&(R=ee.isGlobstar=!0),T=ee.isGlob=!0,G=!0,o===!0)continue;break}if(k===Lk){if(T=ee.isGlob=!0,G=!0,o===!0)continue;break}if(k===vfe){for(;C()!==!0&&(ke=ze());){if(ke===Lf){I=ee.backslashes=!0,ze();continue}if(ke===wfe){g=ee.isBracket=!0,T=ee.isGlob=!0,G=!0;break}}if(o===!0)continue;break}if(n.nonegate!==!0&&k===qN&&d===f){v=ee.negated=!0,f++;continue}if(n.noparen!==!0&&k===WN){if(T=ee.isGlob=!0,o===!0){for(;C()!==!0&&(k=ze());){if(k===WN){I=ee.backslashes=!0,k=ze();continue}if(k===wk){G=!0;break}}continue}break}if(T===!0){if(G=!0,o===!0)continue;break}}n.noext===!0&&(A=!1,T=!1);let Ce=c,P="",x="";f>0&&(P=c.slice(0,f),c=c.slice(f),m-=f),Ce&&T===!0&&m>0?(Ce=c.slice(0,m),x=c.slice(m)):T===!0?(Ce="",x=c):Ce=c,Ce&&Ce!==""&&Ce!=="/"&&Ce!==c&&Dk(Ce.charCodeAt(Ce.length-1))&&(Ce=Ce.slice(0,-1)),n.unescape===!0&&(x&&(x=Mk.removeBackslashes(x)),Ce&&I===!0&&(Ce=Mk.removeBackslashes(Ce)));let Qn={prefix:P,input:t,start:f,base:Ce,glob:x,isBrace:_,isBracket:g,isGlob:T,isExtglob:A,isGlobstar:R,negated:v,negatedExtglob:O};if(n.tokens===!0&&(Qn.maxDepth=0,Dk(k)||i.push(ee),Qn.tokens=i),n.parts===!0||n.tokens===!0){let ke;for(let Je=0;Je<s.length;Je++){let po=ke?ke+1:f,fo=s[Je],la=t.slice(po,fo);n.tokens&&(Je===0&&f!==0?(i[Je].isPrefix=!0,i[Je].value=P):i[Je].value=la,Uk(i[Je]),Qn.maxDepth+=i[Je].depth),(Je!==0||la!=="")&&a.push(la),ke=fo}if(ke&&ke+1<t.length){let Je=t.slice(ke+1);a.push(Je),n.tokens&&(i[i.length-1].value=Je,Uk(i[i.length-1]),Qn.maxDepth+=i[i.length-1].depth)}Qn.slashes=s,Qn.parts=a}return Qn};jk.exports=Dfe});var Fk=y((c6e,$k)=>{"use strict";p();u();l();var jg=vf(),Is=Mf(),{MAX_LENGTH:Gg,POSIX_REGEX_SOURCE:Ufe,REGEX_NON_SPECIAL_CHARS:kfe,REGEX_SPECIAL_CHARS_BACKREF:jfe,REPLACEMENTS:Bk}=jg,Gfe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let n=`[${t.join("-")}]`;try{new RegExp(n)}catch{return t.map(o=>Is.escapeRegex(o)).join("..")}return n},Cl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,KN=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Bk[t]||t;let n={...e},r=typeof n.maxLength=="number"?Math.min(Gg,n.maxLength):Gg,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);let s={type:"bos",value:"",output:n.prepend||""},i=[s],a=n.capture?"":"?:",c=jg.globChars(n.windows),d=jg.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:_,ONE_CHAR:g,DOTS_SLASH:T,NO_DOT:A,NO_DOT_SLASH:R,NO_DOTS_SLASH:b,QMARK:I,QMARK_NO_DOT:v,STAR:O,START_ANCHOR:G}=c,w=z=>`(${a}(?:(?!${G}${z.dot?T:f}).)*?)`,K=n.dot?"":A,k=n.dot?I:v,ee=n.bash===!0?w(n):O;n.capture&&(ee=`(${ee})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);let C={input:t,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=Is.removePrefix(t,C),o=t.length;let Et=[],ze=[],Ce=[],P=s,x,Qn=()=>C.index===o-1,ke=C.peek=(z=1)=>t[C.index+z],Je=C.advance=()=>t[++C.index]||"",po=()=>t.slice(C.index+1),fo=(z="",nt=0)=>{C.consumed+=z,C.index+=nt},la=z=>{C.output+=z.output!=null?z.output:z.value,fo(z.value)},Eue=()=>{let z=1;for(;ke()==="!"&&(ke(2)!=="("||ke(3)==="?");)Je(),C.start++,z++;return z%2===0?!1:(C.negated=!0,C.start++,!0)},Ag=z=>{C[z]++,Ce.push(z)},Fc=z=>{C[z]--,Ce.pop()},Me=z=>{if(P.type==="globstar"){let nt=C.braces>0&&(z.type==="comma"||z.type==="brace"),$=z.extglob===!0||Et.length&&(z.type==="pipe"||z.type==="paren");z.type!=="slash"&&z.type!=="paren"&&!nt&&!$&&(C.output=C.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=ee,C.output+=P.output)}if(Et.length&&z.type!=="paren"&&(Et[Et.length-1].inner+=z.value),(z.value||z.output)&&la(z),P&&P.type==="text"&&z.type==="text"){P.output=(P.output||P.value)+z.value,P.value+=z.value;return}z.prev=P,i.push(z),P=z},yg=(z,nt)=>{let $={...d[nt],conditions:1,inner:""};$.prev=P,$.parens=C.parens,$.output=C.output;let xe=(n.capture?"(":"")+$.open;Ag("parens"),Me({type:z,value:nt,output:C.output?"":g}),Me({type:"paren",extglob:!0,value:Je(),output:xe}),Et.push($)},Tue=z=>{let nt=z.close+(n.capture?")":""),$;if(z.type==="negate"){let xe=ee;if(z.inner&&z.inner.length>1&&z.inner.includes("/")&&(xe=w(n)),(xe!==ee||Qn()||/^\)+$/.test(po()))&&(nt=z.close=`)$))${xe}`),z.inner.includes("*")&&($=po())&&/^\.[^\\/.]+$/.test($)){let dt=KN($,{...e,fastpaths:!1}).output;nt=z.close=`)${dt})${xe})`}z.prev.type==="bos"&&(C.negatedExtglob=!0)}Me({type:"paren",extglob:!0,value:x,output:nt}),Fc("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let z=!1,nt=t.replace(jfe,($,xe,dt,Jn,Zt,SN)=>Jn==="\\"?(z=!0,$):Jn==="?"?xe?xe+Jn+(Zt?I.repeat(Zt.length):""):SN===0?k+(Zt?I.repeat(Zt.length):""):I.repeat(dt.length):Jn==="."?f.repeat(dt.length):Jn==="*"?xe?xe+Jn+(Zt?ee:""):ee:xe?$:`\\${$}`);return z===!0&&(n.unescape===!0?nt=nt.replace(/\\/g,""):nt=nt.replace(/\\+/g,$=>$.length%2===0?"\\\\":$?"\\":"")),nt===t&&n.contains===!0?(C.output=t,C):(C.output=Is.wrapOutput(nt,C,e),C)}for(;!Qn();){if(x=Je(),x==="\0")continue;if(x==="\\"){let $=ke();if($==="/"&&n.bash!==!0||$==="."||$===";")continue;if(!$){x+="\\",Me({type:"text",value:x});continue}let xe=/^\\+/.exec(po()),dt=0;if(xe&&xe[0].length>2&&(dt=xe[0].length,C.index+=dt,dt%2!==0&&(x+="\\")),n.unescape===!0?x=Je():x+=Je(),C.brackets===0){Me({type:"text",value:x});continue}}if(C.brackets>0&&(x!=="]"||P.value==="["||P.value==="[^")){if(n.posix!==!1&&x===":"){let $=P.value.slice(1);if($.includes("[")&&(P.posix=!0,$.includes(":"))){let xe=P.value.lastIndexOf("["),dt=P.value.slice(0,xe),Jn=P.value.slice(xe+2),Zt=Ufe[Jn];if(Zt){P.value=dt+Zt,C.backtrack=!0,Je(),!s.output&&i.indexOf(P)===1&&(s.output=g);continue}}}(x==="["&&ke()!==":"||x==="-"&&ke()==="]")&&(x=`\\${x}`),x==="]"&&(P.value==="["||P.value==="[^")&&(x=`\\${x}`),n.posix===!0&&x==="!"&&P.value==="["&&(x="^"),P.value+=x,la({value:x});continue}if(C.quotes===1&&x!=='"'){x=Is.escapeRegex(x),P.value+=x,la({value:x});continue}if(x==='"'){C.quotes=C.quotes===1?0:1,n.keepQuotes===!0&&Me({type:"text",value:x});continue}if(x==="("){Ag("parens"),Me({type:"paren",value:x});continue}if(x===")"){if(C.parens===0&&n.strictBrackets===!0)throw new SyntaxError(Cl("opening","("));let $=Et[Et.length-1];if($&&C.parens===$.parens+1){Tue(Et.pop());continue}Me({type:"paren",value:x,output:C.parens?")":"\\)"}),Fc("parens");continue}if(x==="["){if(n.nobracket===!0||!po().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(Cl("closing","]"));x=`\\${x}`}else Ag("brackets");Me({type:"bracket",value:x});continue}if(x==="]"){if(n.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){Me({type:"text",value:x,output:`\\${x}`});continue}if(C.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(Cl("opening","["));Me({type:"text",value:x,output:`\\${x}`});continue}Fc("brackets");let $=P.value.slice(1);if(P.posix!==!0&&$[0]==="^"&&!$.includes("/")&&(x=`/${x}`),P.value+=x,la({value:x}),n.literalBrackets===!1||Is.hasRegexChars($))continue;let xe=Is.escapeRegex(P.value);if(C.output=C.output.slice(0,-P.value.length),n.literalBrackets===!0){C.output+=xe,P.value=xe;continue}P.value=`(${a}${xe}|${P.value})`,C.output+=P.value;continue}if(x==="{"&&n.nobrace!==!0){Ag("braces");let $={type:"brace",value:x,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};ze.push($),Me($);continue}if(x==="}"){let $=ze[ze.length-1];if(n.nobrace===!0||!$){Me({type:"text",value:x,output:x});continue}let xe=")";if($.dots===!0){let dt=i.slice(),Jn=[];for(let Zt=dt.length-1;Zt>=0&&(i.pop(),dt[Zt].type!=="brace");Zt--)dt[Zt].type!=="dots"&&Jn.unshift(dt[Zt].value);xe=Gfe(Jn,n),C.backtrack=!0}if($.comma!==!0&&$.dots!==!0){let dt=C.output.slice(0,$.outputIndex),Jn=C.tokens.slice($.tokensIndex);$.value=$.output="\\{",x=xe="\\}",C.output=dt;for(let Zt of Jn)C.output+=Zt.output||Zt.value}Me({type:"brace",value:x,output:xe}),Fc("braces"),ze.pop();continue}if(x==="|"){Et.length>0&&Et[Et.length-1].conditions++,Me({type:"text",value:x});continue}if(x===","){let $=x,xe=ze[ze.length-1];xe&&Ce[Ce.length-1]==="braces"&&(xe.comma=!0,$="|"),Me({type:"comma",value:x,output:$});continue}if(x==="/"){if(P.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",i.pop(),P=s;continue}Me({type:"slash",value:x,output:_});continue}if(x==="."){if(C.braces>0&&P.type==="dot"){P.value==="."&&(P.output=f);let $=ze[ze.length-1];P.type="dots",P.output+=x,P.value+=x,$.dots=!0;continue}if(C.braces+C.parens===0&&P.type!=="bos"&&P.type!=="slash"){Me({type:"text",value:x,output:f});continue}Me({type:"dot",value:x,output:f});continue}if(x==="?"){if(!(P&&P.value==="(")&&n.noextglob!==!0&&ke()==="("&&ke(2)!=="?"){yg("qmark",x);continue}if(P&&P.type==="paren"){let xe=ke(),dt=x;(P.value==="("&&!/[!=<:]/.test(xe)||xe==="<"&&!/<([!=]|\w+>)/.test(po()))&&(dt=`\\${x}`),Me({type:"text",value:x,output:dt});continue}if(n.dot!==!0&&(P.type==="slash"||P.type==="bos")){Me({type:"qmark",value:x,output:v});continue}Me({type:"qmark",value:x,output:I});continue}if(x==="!"){if(n.noextglob!==!0&&ke()==="("&&(ke(2)!=="?"||!/[!=<:]/.test(ke(3)))){yg("negate",x);continue}if(n.nonegate!==!0&&C.index===0){Eue();continue}}if(x==="+"){if(n.noextglob!==!0&&ke()==="("&&ke(2)!=="?"){yg("plus",x);continue}if(P&&P.value==="("||n.regex===!1){Me({type:"plus",value:x,output:m});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||C.parens>0){Me({type:"plus",value:x});continue}Me({type:"plus",value:m});continue}if(x==="@"){if(n.noextglob!==!0&&ke()==="("&&ke(2)!=="?"){Me({type:"at",extglob:!0,value:x,output:""});continue}Me({type:"text",value:x});continue}if(x!=="*"){(x==="$"||x==="^")&&(x=`\\${x}`);let $=kfe.exec(po());$&&(x+=$[0],C.index+=$[0].length),Me({type:"text",value:x});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=x,P.output=ee,C.backtrack=!0,C.globstar=!0,fo(x);continue}let z=po();if(n.noextglob!==!0&&/^\([^?]/.test(z)){yg("star",x);continue}if(P.type==="star"){if(n.noglobstar===!0){fo(x);continue}let $=P.prev,xe=$.prev,dt=$.type==="slash"||$.type==="bos",Jn=xe&&(xe.type==="star"||xe.type==="globstar");if(n.bash===!0&&(!dt||z[0]&&z[0]!=="/")){Me({type:"star",value:x,output:""});continue}let Zt=C.braces>0&&($.type==="comma"||$.type==="brace"),SN=Et.length&&($.type==="pipe"||$.type==="paren");if(!dt&&$.type!=="paren"&&!Zt&&!SN){Me({type:"star",value:x,output:""});continue}for(;z.slice(0,3)==="/**";){let Rg=t[C.index+4];if(Rg&&Rg!=="/")break;z=z.slice(3),fo("/**",3)}if($.type==="bos"&&Qn()){P.type="globstar",P.value+=x,P.output=w(n),C.output=P.output,C.globstar=!0,fo(x);continue}if($.type==="slash"&&$.prev.type!=="bos"&&!Jn&&Qn()){C.output=C.output.slice(0,-($.output+P.output).length),$.output=`(?:${$.output}`,P.type="globstar",P.output=w(n)+(n.strictSlashes?")":"|$)"),P.value+=x,C.globstar=!0,C.output+=$.output+P.output,fo(x);continue}if($.type==="slash"&&$.prev.type!=="bos"&&z[0]==="/"){let Rg=z[1]!==void 0?"|$":"";C.output=C.output.slice(0,-($.output+P.output).length),$.output=`(?:${$.output}`,P.type="globstar",P.output=`${w(n)}${_}|${_}${Rg})`,P.value+=x,C.output+=$.output+P.output,C.globstar=!0,fo(x+Je()),Me({type:"slash",value:"/",output:""});continue}if($.type==="bos"&&z[0]==="/"){P.type="globstar",P.value+=x,P.output=`(?:^|${_}|${w(n)}${_})`,C.output=P.output,C.globstar=!0,fo(x+Je()),Me({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-P.output.length),P.type="globstar",P.output=w(n),P.value+=x,C.output+=P.output,C.globstar=!0,fo(x);continue}let nt={type:"star",value:x,output:ee};if(n.bash===!0){nt.output=".*?",(P.type==="bos"||P.type==="slash")&&(nt.output=K+nt.output),Me(nt);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&n.regex===!0){nt.output=x,Me(nt);continue}(C.index===C.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(C.output+=R,P.output+=R):n.dot===!0?(C.output+=b,P.output+=b):(C.output+=K,P.output+=K),ke()!=="*"&&(C.output+=g,P.output+=g)),Me(nt)}for(;C.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(Cl("closing","]"));C.output=Is.escapeLast(C.output,"["),Fc("brackets")}for(;C.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(Cl("closing",")"));C.output=Is.escapeLast(C.output,"("),Fc("parens")}for(;C.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(Cl("closing","}"));C.output=Is.escapeLast(C.output,"{"),Fc("braces")}if(n.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&Me({type:"maybe_slash",value:"",output:`${_}?`}),C.backtrack===!0){C.output="";for(let z of C.tokens)C.output+=z.output!=null?z.output:z.value,z.suffix&&(C.output+=z.suffix)}return C};KN.fastpaths=(t,e)=>{let n={...e},r=typeof n.maxLength=="number"?Math.min(Gg,n.maxLength):Gg,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);t=Bk[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:_,START_ANCHOR:g}=jg.globChars(n.windows),T=n.dot?f:d,A=n.dot?m:d,R=n.capture?"":"?:",b={negated:!1,prefix:""},I=n.bash===!0?".*?":_;n.capture&&(I=`(${I})`);let v=K=>K.noglobstar===!0?I:`(${R}(?:(?!${g}${K.dot?c:s}).)*?)`,O=K=>{switch(K){case"*":return`${T}${a}${I}`;case".*":return`${s}${a}${I}`;case"*.*":return`${T}${I}${s}${a}${I}`;case"*/*":return`${T}${I}${i}${a}${A}${I}`;case"**":return T+v(n);case"**/*":return`(?:${T}${v(n)}${i})?${A}${a}${I}`;case"**/*.*":return`(?:${T}${v(n)}${i})?${A}${I}${s}${a}${I}`;case"**/.*":return`(?:${T}${v(n)}${i})?${s}${a}${I}`;default:{let k=/^(.*?)\.(\w+)$/.exec(K);if(!k)return;let ee=O(k[1]);return ee?ee+s+k[2]:void 0}}},G=Is.removePrefix(t,b),w=O(G);return w&&n.strictSlashes!==!0&&(w+=`${i}?`),w};$k.exports=KN});var qk=y((d6e,Vk)=>{"use strict";p();u();l();var Bfe=Gk(),zN=Fk(),Hk=Mf(),$fe=vf(),Ffe=t=>t&&typeof t=="object"&&!Array.isArray(t),xt=(t,e,n=!1)=>{if(Array.isArray(t)){let f=t.map(_=>xt(_,e,n));return _=>{for(let g of f){let T=g(_);if(T)return T}return!1}}let r=Ffe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,i=r?xt.compileRe(t,e):xt.makeRe(t,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=xt(o.ignore,f,n)}let d=(f,m=!1)=>{let{isMatch:_,match:g,output:T}=xt.test(f,i,e,{glob:t,posix:s}),A={glob:t,state:a,regex:i,posix:s,input:f,output:T,match:g,isMatch:_};return typeof o.onResult=="function"&&o.onResult(A),_===!1?(A.isMatch=!1,m?A:!1):c(f)?(typeof o.onIgnore=="function"&&o.onIgnore(A),A.isMatch=!1,m?A:!1):(typeof o.onMatch=="function"&&o.onMatch(A),m?A:!0)};return n&&(d.state=a),d};xt.test=(t,e,n,{glob:r,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=n||{},i=s.format||(o?Hk.toPosixSlashes:null),a=t===r,c=a&&i?i(t):t;return a===!1&&(c=i?i(t):t,a=c===r),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=xt.matchBase(t,e,n,o):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};xt.matchBase=(t,e,n)=>(e instanceof RegExp?e:xt.makeRe(e,n)).test(Hk.basename(t));xt.isMatch=(t,e,n)=>xt(e,n)(t);xt.parse=(t,e)=>Array.isArray(t)?t.map(n=>xt.parse(n,e)):zN(t,{...e,fastpaths:!1});xt.scan=(t,e)=>Bfe(t,e);xt.compileRe=(t,e,n=!1,r=!1)=>{if(n===!0)return t.output;let o=e||{},s=o.contains?"":"^",i=o.contains?"":"$",a=`${s}(?:${t.output})${i}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=xt.toRegex(a,e);return r===!0&&(c.state=t),c};xt.makeRe=(t,e={},n=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=zN.fastpaths(t,e)),o.output||(o=zN(t,e)),xt.compileRe(o,e,n,r)};xt.toRegex=(t,e)=>{try{let n=e||{};return new RegExp(t,n.flags||(n.nocase?"i":""))}catch(n){if(e&&e.debug===!0)throw n;return/$^/}};xt.constants=$fe;Vk.exports=xt});var zk=y((h6e,Kk)=>{"use strict";p();u();l();var Yk=qk(),Hfe=Mf();function Wk(t,e,n=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Hfe.isWindows()}),Yk(t,e,n)}Object.assign(Wk,Yk);Kk.exports=Wk});function Yfe(t,e={}){let n=t.length,r=Array(n),o=Array(n),s=!e.noglobstar;for(let i=0;i<n;i++){let a=Zk(t[i]);r[i]=a;let c=a.length,d=Array(c);for(let f=0;f<c;f++)d[f]=(0,xl.default)(a[f],e);o[i]=d}return i=>{let a=i.split("/");if(a[0]===".."&&qfe.test(i))return!0;for(let c=0;c<t.length;c++){let d=r[c],f=o[c],m=a.length,_=Math.min(m,d.length),g=0;for(;g<_;){let T=d[g];if(T.includes("/"))return!0;if(!f[g](a[g]))break;if(s&&T==="**")return!0;g++}if(g===m)return!0}return!1}}function Xk(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){let o=Kfe(t)?t.length:t.length+1;return(s,i)=>s.slice(o,i?-1:void 0)||"."}let r=e.slice(t.length+1);return r?(o,s)=>{if(o===".")return r;let i=`${r}/${o}`;return s?i.slice(0,-1):i}:(o,s)=>s&&o!=="."?o.slice(0,-1):o}return n?r=>Jo.posix.relative(t,r)||".":r=>Jo.posix.relative(t,`${e}/${r}`)||"."}function zfe(t,e){if(e.startsWith(`${t}/`)){let n=e.slice(t.length+1);return r=>`${n}/${r}`}return n=>{let r=Jo.posix.relative(t,`${e}/${n}`);return n.endsWith("/")&&r!==""?`${r}/`:r||"."}}function Zk(t){var e;let n=xl.default.scan(t,Xfe);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}function nme(t,e){if(e?.caseSensitiveMatch===!1)return!0;let n=xl.default.scan(t);return n.isGlob||n.negated}function Pl(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function XN(t,e,n,r,o){let s=t;t.endsWith("/")&&(s=t.slice(0,-1)),!s.endsWith("*")&&e&&(s+="/**");let i=tme(n);Jo.default.isAbsolute(s.replace(ome,""))?s=Jo.posix.relative(i,s):s=Jo.posix.normalize(s);let a=rme.exec(s),c=Zk(s);if(a?.[0]){let f=(a[0].length+1)/3,m=0,_=i.split("/");for(;m<f&&c[m+f]===_[_.length+m-f];)s=s.slice(0,(f-m-1)*3)+s.slice((f-m)*3+c[m+f].length+1)||".",m++;let g=Jo.posix.join(n,a[0].slice(m*3));!g.startsWith(".")&&r.root.length>g.length&&(r.root=g,r.depthOffset=-f+m)}if(!o&&r.depthOffset>=0){var d;(d=r.commonPath)!==null&&d!==void 0||(r.commonPath=c);let f=[],m=Math.min(r.commonPath.length,c.length);for(let _=0;_<m;_++){let g=c[_];if(g==="**"&&!c[_+1]){f.pop();break}if(g!==r.commonPath[_]||nme(g)||_===c.length-1)break;f.push(g)}r.depthOffset=f.length,r.commonPath=f,r.root=f.length>0?Jo.posix.join(n,...f):n}return s}function sme({patterns:t=["**/*"],ignore:e=[],expandDirectories:n=!0},r,o){typeof t=="string"&&(t=[t]),typeof e=="string"&&(e=[e]);let s=[],i=[];for(let a of e)a&&(a[0]!=="!"||a[1]==="(")&&i.push(XN(a,n,r,o,!0));for(let a of t)a&&(a[0]!=="!"||a[1]==="("?s.push(XN(a,n,r,o,!1)):(a[1]!=="!"||a[2]==="(")&&i.push(XN(a.slice(1),n,r,o,!0)));return{match:s,ignore:i}}function ime(t,e){for(let n=t.length-1;n>=0;n--){let r=t[n];t[n]=e(r)}return t}function ame(t){return t?t instanceof URL?(0,Qk.fileURLToPath)(t).replace(Bg,"/"):Jo.default.resolve(t).replace(Bg,"/"):process.cwd().replace(Bg,"/")}function cme(t,e={}){let n=process.env.TINYGLOBBY_DEBUG?{...e,debug:!0}:e,r=ame(n.cwd);if(n.debug&&Pl("globbing with:",{patterns:t,options:n,cwd:r}),Array.isArray(t)&&t.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let o={root:r,commonPath:null,depthOffset:0},s=sme({...n,patterns:t},r,o);n.debug&&Pl("internal processing patterns:",s);let i={dot:n.dot,nobrace:n.braceExpansion===!1,nocase:n.caseSensitiveMatch===!1,noextglob:n.extglob===!1,noglobstar:n.globstar===!1,posix:!0},a=(0,xl.default)(s.match,{...i,ignore:s.ignore}),c=(0,xl.default)(s.ignore,i),d=Yfe(s.match,i),f=Xk(r,o.root,n.absolute),m=n.absolute?f:Xk(r,o.root,!0),_={filters:[n.debug?(A,R)=>{let b=f(A,R),I=a(b);return I&&Pl(`matched ${b}`),I}:(A,R)=>a(f(A,R))],exclude:n.debug?(A,R)=>{let b=m(R,!0),I=b!=="."&&!d(b)||c(b);return Pl(I?`skipped ${R}`:`crawling ${R}`),I}:(A,R)=>{let b=m(R,!0);return b!=="."&&!d(b)||c(b)},fs:n.fs?{readdir:n.fs.readdir||Vc.default.readdir,readdirSync:n.fs.readdirSync||Vc.default.readdirSync,realpath:n.fs.realpath||Vc.default.realpath,realpathSync:n.fs.realpathSync||Vc.default.realpathSync,stat:n.fs.stat||Vc.default.stat,statSync:n.fs.statSync||Vc.default.statSync}:void 0,pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0,signal:n.signal};n.deep!==void 0&&(_.maxDepth=Math.round(n.deep-o.depthOffset)),n.absolute&&(_.relativePaths=!1,_.resolvePaths=!0,_.includeBasePath=!0),n.followSymbolicLinks===!1&&(_.resolveSymlinks=!1,_.excludeSymlinks=!0),n.onlyDirectories?(_.excludeFiles=!0,_.includeDirs=!0):n.onlyFiles===!1&&(_.includeDirs=!0),o.root=o.root.replace(Bg,"");let g=o.root;n.debug&&Pl("internal properties:",o);let T=r!==g&&!n.absolute&&zfe(r,o.root);return[new Nk(_).crawl(g),T]}async function e1(t,e){if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Vfe(t)||typeof t=="string",r=n?e:t,o=n?t:t.patterns,[s,i]=cme(o,r);return i?ime(await s.withPromise(),i):s.withPromise()}var Vc,Jo,Qk,xl,Vfe,Jk,qfe,Wfe,Kfe,Xfe,Qfe,Jfe,Zfe,eme,tme,rme,ome,Bg,t1=S(()=>{p();u();l();Vc=j(require("fs"),1),Jo=j(require("path"),1),Qk=require("url");bk();xl=j(zk(),1),Vfe=Array.isArray,Jk=process.platform==="win32",qfe=/^(\/?\.\.)+$/;Wfe=/^[A-Z]:\/$/i,Kfe=Jk?t=>Wfe.test(t):t=>t==="/";Xfe={parts:!0};Qfe=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Jfe=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Zfe=t=>t.replace(Qfe,"\\$&"),eme=t=>t.replace(Jfe,"\\$&"),tme=Jk?eme:Zfe;rme=/^(\/?\.\.)+/,ome=/\\(?=[()[\]{}!*+?@|])/g,Bg=/\\/g});var $g,Fg,QN,ume,JN,n1,r1,lme,o1=S(()=>{p();u();l();$g="0123456789abcdef",Fg=class t{constructor(e){this.bytes=e}static ofInner(e){if(e.length!==16)throw new TypeError("not 128-bit length");return new t(e)}static fromFieldsV7(e,n,r,o){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||e<0||n<0||r<0||o<0||e>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw new RangeError("invalid field value");let s=new Uint8Array(16);return s[0]=e/2**40,s[1]=e/2**32,s[2]=e/2**24,s[3]=e/2**16,s[4]=e/2**8,s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=o>>>24,s[13]=o>>>16,s[14]=o>>>8,s[15]=o,new t(s)}static parse(e){var n,r,o,s;let i;switch(e.length){case 32:i=(n=/^[0-9a-f]{32}$/i.exec(e))===null||n===void 0?void 0:n[0];break;case 36:i=(r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e))===null||r===void 0?void 0:r.slice(1,6).join("");break;case 38:i=(o=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(e))===null||o===void 0?void 0:o.slice(1,6).join("");break;case 45:i=(s=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e))===null||s===void 0?void 0:s.slice(1,6).join("");break;default:break}if(i){let a=new Uint8Array(16);for(let c=0;c<16;c+=4){let d=parseInt(i.substring(2*c,2*c+8),16);a[c+0]=d>>>24,a[c+1]=d>>>16,a[c+2]=d>>>8,a[c+3]=d}return new t(a)}else throw new SyntaxError("could not parse UUID string")}toString(){let e="";for(let n=0;n<this.bytes.length;n++)e+=$g.charAt(this.bytes[n]>>>4),e+=$g.charAt(this.bytes[n]&15),(n===3||n===5||n===7||n===9)&&(e+="-");return e}toHex(){let e="";for(let n=0;n<this.bytes.length;n++)e+=$g.charAt(this.bytes[n]>>>4),e+=$g.charAt(this.bytes[n]&15);return e}toJSON(){return this.toString()}getVariant(){let e=this.bytes[8]>>>4;if(e<0)throw new Error("unreachable");if(e<=7)return this.bytes.every(n=>n===0)?"NIL":"VAR_0";if(e<=11)return"VAR_10";if(e<=13)return"VAR_110";if(e<=15)return this.bytes.every(n=>n===255)?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;n<16;n++){let r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},QN=class{constructor(e){this.timestamp_biased=0,this.counter=0,this.random=e??ume()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(e,n){let r=this.generateOrAbortCore(e,n);return r===void 0&&(this.timestamp_biased=0,r=this.generateOrAbortCore(e,n)),r}generateOrAbortCore(e,n){if(!Number.isInteger(e)||e<0||e>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit unsigned integer");if(n<0||n>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(e++,e>this.timestamp_biased)this.timestamp_biased=e,this.resetCounter();else if(e+n>=this.timestamp_biased)this.counter++,this.counter>4398046511103&&(this.timestamp_biased++,this.resetCounter());else return;return Fg.fromFieldsV7(this.timestamp_biased-1,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=this.random.nextUint32()*1024+(this.random.nextUint32()&1023)}generateV4(){let e=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return e[6]=64|e[6]>>>4,e[8]=128|e[8]>>>2,Fg.ofInner(e)}},ume=()=>{if(typeof crypto<"u"&&typeof crypto.getRandomValues<"u")return new JN;if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");return{nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}},JN=class{constructor(){this.buffer=new Uint32Array(8),this.cursor=65535}nextUint32(){return this.cursor>=this.buffer.length&&(crypto.getRandomValues(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},r1=()=>lme().toString(),lme=()=>(n1||(n1=new QN)).generate()});var Hg,Ns,s1,i1,ZN,eb,pme,dme,p=S(()=>{"use strict";Hg=require("node:child_process"),Ns=require("node:fs/promises"),s1=require("node:sqlite"),i1=j(mk(),1);t1();o1();ZN=class{stmt;constructor(e){this.stmt=e}get(...e){return this.stmt.get(...e)}all(...e){return this.stmt.all(...e)}run(...e){this.stmt.run(...e)}},eb=class{db;constructor(e){this.db=new s1.DatabaseSync(e)}exec(e){this.db.exec(e)}query(e){return new ZN(this.db.prepare(e))}close(){this.db.close()}transaction(e){return()=>{this.db.exec("BEGIN");try{let n=e();return this.db.exec("COMMIT"),n}catch(n){throw this.db.exec("ROLLBACK"),n}}}},pme={Database:eb};globalThis.__bun_sqlite_polyfill=pme;dme={file(t){return{async exists(){try{return await(0,Ns.access)(t),!0}catch{return!1}},text(){return(0,Ns.readFile)(t,"utf-8")},async json(){let e=await(0,Ns.readFile)(t,"utf-8");return JSON.parse(e)}}},async write(t,e){if(e instanceof Response){let n=await e.arrayBuffer();await(0,Ns.writeFile)(t,Buffer.from(n))}else e instanceof ArrayBuffer?await(0,Ns.writeFile)(t,Buffer.from(e)):e instanceof Uint8Array?await(0,Ns.writeFile)(t,e):await(0,Ns.writeFile)(t,e,"utf-8")},which(t){try{let n=process.platform==="win32"?`where ${t}`:`which ${t}`;return(0,Hg.execSync)(n,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
3
|
+
var Sue=Object.create;var Ig=Object.defineProperty;var Aue=Object.getOwnPropertyDescriptor;var yue=Object.getOwnPropertyNames;var Rue=Object.getPrototypeOf,Iue=Object.prototype.hasOwnProperty;var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pn=(t,e)=>{for(var n in e)Ig(t,n,{get:e[n],enumerable:!0})},N0=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of yue(e))!Iue.call(t,o)&&o!==n&&Ig(t,o,{get:()=>e[o],enumerable:!(r=Aue(e,o))||r.enumerable});return t};var j=(t,e,n)=>(n=t!=null?Sue(Rue(t)):{},N0(e||!t||!t.__esModule?Ig(n,"default",{value:t,enumerable:!0}):n,t)),D=t=>N0(Ig({},"__esModule",{value:!0}),t);var h,u=S(()=>{"use strict";h=require("node:url").pathToFileURL(__filename).href});var Nue,l=S(()=>{Nue=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};Nue.SENTRY_RELEASE={id:"0.9.1"}});var If=y((Rze,b0)=>{"use strict";p();u();l();var bue="2.0.0",Oue=Number.MAX_SAFE_INTEGER||9007199254740991,Cue=16,Pue=250,xue=["major","premajor","minor","preminor","patch","prepatch","prerelease"];b0.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Cue,MAX_SAFE_BUILD_LENGTH:Pue,MAX_SAFE_INTEGER:Oue,RELEASE_TYPES:xue,SEMVER_SPEC_VERSION:bue,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Nf=y((Oze,O0)=>{"use strict";p();u();l();var vue=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};O0.exports=vue});var Ol=y((Rs,C0)=>{"use strict";p();u();l();var{MAX_SAFE_COMPONENT_LENGTH:AN,MAX_SAFE_BUILD_LENGTH:Mue,MAX_LENGTH:Lue}=If(),wue=Nf();Rs=C0.exports={};var Due=Rs.re=[],Uue=Rs.safeRe=[],X=Rs.src=[],kue=Rs.safeSrc=[],Q=Rs.t={},jue=0,yN="[a-zA-Z0-9-]",Gue=[["\\s",1],["\\d",Lue],[yN,Mue]],Bue=t=>{for(let[e,n]of Gue)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},Se=(t,e,n)=>{let r=Bue(e),o=jue++;wue(t,o,e),Q[t]=o,X[o]=e,kue[o]=r,Due[o]=new RegExp(e,n?"g":void 0),Uue[o]=new RegExp(r,n?"g":void 0)};Se("NUMERICIDENTIFIER","0|[1-9]\\d*");Se("NUMERICIDENTIFIERLOOSE","\\d+");Se("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${yN}*`);Se("MAINVERSION",`(${X[Q.NUMERICIDENTIFIER]})\\.(${X[Q.NUMERICIDENTIFIER]})\\.(${X[Q.NUMERICIDENTIFIER]})`);Se("MAINVERSIONLOOSE",`(${X[Q.NUMERICIDENTIFIERLOOSE]})\\.(${X[Q.NUMERICIDENTIFIERLOOSE]})\\.(${X[Q.NUMERICIDENTIFIERLOOSE]})`);Se("PRERELEASEIDENTIFIER",`(?:${X[Q.NONNUMERICIDENTIFIER]}|${X[Q.NUMERICIDENTIFIER]})`);Se("PRERELEASEIDENTIFIERLOOSE",`(?:${X[Q.NONNUMERICIDENTIFIER]}|${X[Q.NUMERICIDENTIFIERLOOSE]})`);Se("PRERELEASE",`(?:-(${X[Q.PRERELEASEIDENTIFIER]}(?:\\.${X[Q.PRERELEASEIDENTIFIER]})*))`);Se("PRERELEASELOOSE",`(?:-?(${X[Q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${X[Q.PRERELEASEIDENTIFIERLOOSE]})*))`);Se("BUILDIDENTIFIER",`${yN}+`);Se("BUILD",`(?:\\+(${X[Q.BUILDIDENTIFIER]}(?:\\.${X[Q.BUILDIDENTIFIER]})*))`);Se("FULLPLAIN",`v?${X[Q.MAINVERSION]}${X[Q.PRERELEASE]}?${X[Q.BUILD]}?`);Se("FULL",`^${X[Q.FULLPLAIN]}$`);Se("LOOSEPLAIN",`[v=\\s]*${X[Q.MAINVERSIONLOOSE]}${X[Q.PRERELEASELOOSE]}?${X[Q.BUILD]}?`);Se("LOOSE",`^${X[Q.LOOSEPLAIN]}$`);Se("GTLT","((?:<|>)?=?)");Se("XRANGEIDENTIFIERLOOSE",`${X[Q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Se("XRANGEIDENTIFIER",`${X[Q.NUMERICIDENTIFIER]}|x|X|\\*`);Se("XRANGEPLAIN",`[v=\\s]*(${X[Q.XRANGEIDENTIFIER]})(?:\\.(${X[Q.XRANGEIDENTIFIER]})(?:\\.(${X[Q.XRANGEIDENTIFIER]})(?:${X[Q.PRERELEASE]})?${X[Q.BUILD]}?)?)?`);Se("XRANGEPLAINLOOSE",`[v=\\s]*(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:${X[Q.PRERELEASELOOSE]})?${X[Q.BUILD]}?)?)?`);Se("XRANGE",`^${X[Q.GTLT]}\\s*${X[Q.XRANGEPLAIN]}$`);Se("XRANGELOOSE",`^${X[Q.GTLT]}\\s*${X[Q.XRANGEPLAINLOOSE]}$`);Se("COERCEPLAIN",`(^|[^\\d])(\\d{1,${AN}})(?:\\.(\\d{1,${AN}}))?(?:\\.(\\d{1,${AN}}))?`);Se("COERCE",`${X[Q.COERCEPLAIN]}(?:$|[^\\d])`);Se("COERCEFULL",X[Q.COERCEPLAIN]+`(?:${X[Q.PRERELEASE]})?(?:${X[Q.BUILD]})?(?:$|[^\\d])`);Se("COERCERTL",X[Q.COERCE],!0);Se("COERCERTLFULL",X[Q.COERCEFULL],!0);Se("LONETILDE","(?:~>?)");Se("TILDETRIM",`(\\s*)${X[Q.LONETILDE]}\\s+`,!0);Rs.tildeTrimReplace="$1~";Se("TILDE",`^${X[Q.LONETILDE]}${X[Q.XRANGEPLAIN]}$`);Se("TILDELOOSE",`^${X[Q.LONETILDE]}${X[Q.XRANGEPLAINLOOSE]}$`);Se("LONECARET","(?:\\^)");Se("CARETTRIM",`(\\s*)${X[Q.LONECARET]}\\s+`,!0);Rs.caretTrimReplace="$1^";Se("CARET",`^${X[Q.LONECARET]}${X[Q.XRANGEPLAIN]}$`);Se("CARETLOOSE",`^${X[Q.LONECARET]}${X[Q.XRANGEPLAINLOOSE]}$`);Se("COMPARATORLOOSE",`^${X[Q.GTLT]}\\s*(${X[Q.LOOSEPLAIN]})$|^$`);Se("COMPARATOR",`^${X[Q.GTLT]}\\s*(${X[Q.FULLPLAIN]})$|^$`);Se("COMPARATORTRIM",`(\\s*)${X[Q.GTLT]}\\s*(${X[Q.LOOSEPLAIN]}|${X[Q.XRANGEPLAIN]})`,!0);Rs.comparatorTrimReplace="$1$2$3";Se("HYPHENRANGE",`^\\s*(${X[Q.XRANGEPLAIN]})\\s+-\\s+(${X[Q.XRANGEPLAIN]})\\s*$`);Se("HYPHENRANGELOOSE",`^\\s*(${X[Q.XRANGEPLAINLOOSE]})\\s+-\\s+(${X[Q.XRANGEPLAINLOOSE]})\\s*$`);Se("STAR","(<|>)?=?\\s*\\*");Se("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Se("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ng=y((wze,P0)=>{"use strict";p();u();l();var $ue=Object.freeze({loose:!0}),Fue=Object.freeze({}),Hue=t=>t?typeof t!="object"?$ue:t:Fue;P0.exports=Hue});var RN=y((jze,M0)=>{"use strict";p();u();l();var x0=/^[0-9]+$/,v0=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=x0.test(t),r=x0.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},Vue=(t,e)=>v0(e,t);M0.exports={compareIdentifiers:v0,rcompareIdentifiers:Vue}});var xn=y((Fze,w0)=>{"use strict";p();u();l();var bg=Nf(),{MAX_LENGTH:L0,MAX_SAFE_INTEGER:Og}=If(),{safeRe:Cg,t:Pg}=Ol(),que=Ng(),{compareIdentifiers:IN}=RN(),NN=class t{constructor(e,n){if(n=que(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>L0)throw new TypeError(`version is longer than ${L0} characters`);bg("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?Cg[Pg.LOOSE]:Cg[Pg.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Og||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Og||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Og||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<Og)return s}return o}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(bg("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],o=e.prerelease[n];if(bg("prerelease compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return IN(r,o)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],o=e.build[n];if(bg("build compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return IN(r,o)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?Cg[Pg.PRERELEASELOOSE]:Cg[Pg.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let s=[n,o];r===!1&&(s=[n]),IN(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};w0.exports=NN});var Hc=y((Yze,U0)=>{"use strict";p();u();l();var D0=xn(),Yue=(t,e,n=!1)=>{if(t instanceof D0)return t;try{return new D0(t,e)}catch(r){if(!n)return null;throw r}};U0.exports=Yue});var j0=y((Xze,k0)=>{"use strict";p();u();l();var Wue=Hc(),Kue=(t,e)=>{let n=Wue(t,e);return n?n.version:null};k0.exports=Kue});var B0=y((e3e,G0)=>{"use strict";p();u();l();var zue=Hc(),Xue=(t,e)=>{let n=zue(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};G0.exports=Xue});var H0=y((o3e,F0)=>{"use strict";p();u();l();var $0=xn(),Que=(t,e,n,r,o)=>{typeof n=="string"&&(o=r,r=n,n=void 0);try{return new $0(t instanceof $0?t.version:t,n).inc(e,r,o).version}catch{return null}};F0.exports=Que});var Y0=y((c3e,q0)=>{"use strict";p();u();l();var V0=Hc(),Jue=(t,e)=>{let n=V0(t,null,!0),r=V0(e,null,!0),o=n.compare(r);if(o===0)return null;let s=o>0,i=s?n:r,a=s?r:n,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let f=c?"pre":"";return n.major!==r.major?f+"major":n.minor!==r.minor?f+"minor":n.patch!==r.patch?f+"patch":"prerelease"};q0.exports=Jue});var K0=y((d3e,W0)=>{"use strict";p();u();l();var Zue=xn(),ele=(t,e)=>new Zue(t,e).major;W0.exports=ele});var X0=y((h3e,z0)=>{"use strict";p();u();l();var tle=xn(),nle=(t,e)=>new tle(t,e).minor;z0.exports=nle});var J0=y((S3e,Q0)=>{"use strict";p();u();l();var rle=xn(),ole=(t,e)=>new rle(t,e).patch;Q0.exports=ole});var eU=y((I3e,Z0)=>{"use strict";p();u();l();var sle=Hc(),ile=(t,e)=>{let n=sle(t,e);return n&&n.prerelease.length?n.prerelease:null};Z0.exports=ile});var mo=y((C3e,nU)=>{"use strict";p();u();l();var tU=xn(),ale=(t,e,n)=>new tU(t,n).compare(new tU(e,n));nU.exports=ale});var oU=y((M3e,rU)=>{"use strict";p();u();l();var cle=mo(),ule=(t,e,n)=>cle(e,t,n);rU.exports=ule});var iU=y((U3e,sU)=>{"use strict";p();u();l();var lle=mo(),ple=(t,e)=>lle(t,e,!0);sU.exports=ple});var xg=y((B3e,cU)=>{"use strict";p();u();l();var aU=xn(),dle=(t,e,n)=>{let r=new aU(t,n),o=new aU(e,n);return r.compare(o)||r.compareBuild(o)};cU.exports=dle});var lU=y((V3e,uU)=>{"use strict";p();u();l();var fle=xg(),mle=(t,e)=>t.sort((n,r)=>fle(n,r,e));uU.exports=mle});var dU=y((K3e,pU)=>{"use strict";p();u();l();var _le=xg(),hle=(t,e)=>t.sort((n,r)=>_le(r,n,e));pU.exports=hle});var bf=y((J3e,fU)=>{"use strict";p();u();l();var gle=mo(),Ele=(t,e,n)=>gle(t,e,n)>0;fU.exports=Ele});var vg=y((n5e,mU)=>{"use strict";p();u();l();var Tle=mo(),Sle=(t,e,n)=>Tle(t,e,n)<0;mU.exports=Sle});var bN=y((i5e,_U)=>{"use strict";p();u();l();var Ale=mo(),yle=(t,e,n)=>Ale(t,e,n)===0;_U.exports=yle});var ON=y((l5e,hU)=>{"use strict";p();u();l();var Rle=mo(),Ile=(t,e,n)=>Rle(t,e,n)!==0;hU.exports=Ile});var Mg=y((m5e,gU)=>{"use strict";p();u();l();var Nle=mo(),ble=(t,e,n)=>Nle(t,e,n)>=0;gU.exports=ble});var Lg=y((E5e,EU)=>{"use strict";p();u();l();var Ole=mo(),Cle=(t,e,n)=>Ole(t,e,n)<=0;EU.exports=Cle});var CN=y((y5e,TU)=>{"use strict";p();u();l();var Ple=bN(),xle=ON(),vle=bf(),Mle=Mg(),Lle=vg(),wle=Lg(),Dle=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Ple(t,n,r);case"!=":return xle(t,n,r);case">":return vle(t,n,r);case">=":return Mle(t,n,r);case"<":return Lle(t,n,r);case"<=":return wle(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};TU.exports=Dle});var AU=y((b5e,SU)=>{"use strict";p();u();l();var Ule=xn(),kle=Hc(),{safeRe:wg,t:Dg}=Ol(),jle=(t,e)=>{if(t instanceof Ule)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?wg[Dg.COERCEFULL]:wg[Dg.COERCE]);else{let c=e.includePrerelease?wg[Dg.COERCERTLFULL]:wg[Dg.COERCERTL],d;for(;(d=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||d.index+d[0].length!==n.index+n[0].length)&&(n=d),c.lastIndex=d.index+d[1].length+d[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],o=n[3]||"0",s=n[4]||"0",i=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return kle(`${r}.${o}.${s}${i}${a}`,e)};SU.exports=jle});var RU=y((x5e,yU)=>{"use strict";p();u();l();var PN=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,n)}return this}};yU.exports=PN});var _o=y((w5e,OU)=>{"use strict";p();u();l();var Gle=/\s+/g,xN=class t{constructor(e,n){if(n=$le(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof vN)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(Gle," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(o=>!NU(o[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&Kle(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&Yle)|(this.options.loose&&Wle))+":"+e,o=IU.get(r);if(o)return o;let s=this.options.loose,i=s?Zn[vn.HYPHENRANGELOOSE]:Zn[vn.HYPHENRANGE];e=e.replace(i,ope(this.options.includePrerelease)),rt("hyphen replace",e),e=e.replace(Zn[vn.COMPARATORTRIM],Hle),rt("comparator trim",e),e=e.replace(Zn[vn.TILDETRIM],Vle),rt("tilde trim",e),e=e.replace(Zn[vn.CARETTRIM],qle),rt("caret trim",e);let a=e.split(" ").map(m=>zle(m,this.options)).join(" ").split(/\s+/).map(m=>rpe(m,this.options));s&&(a=a.filter(m=>(rt("loose invalid filter",m,this.options),!!m.match(Zn[vn.COMPARATORLOOSE])))),rt("range list",a);let c=new Map,d=a.map(m=>new vN(m,this.options));for(let m of d){if(NU(m))return[m];c.set(m.value,m)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return IU.set(r,f),f}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>bU(r,n)&&e.set.some(o=>bU(o,n)&&r.every(s=>o.every(i=>s.intersects(i,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Fle(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(spe(this.set[n],e,this.options))return!0;return!1}};OU.exports=xN;var Ble=RU(),IU=new Ble,$le=Ng(),vN=Of(),rt=Nf(),Fle=xn(),{safeRe:Zn,t:vn,comparatorTrimReplace:Hle,tildeTrimReplace:Vle,caretTrimReplace:qle}=Ol(),{FLAG_INCLUDE_PRERELEASE:Yle,FLAG_LOOSE:Wle}=If(),NU=t=>t.value==="<0.0.0-0",Kle=t=>t.value==="",bU=(t,e)=>{let n=!0,r=t.slice(),o=r.pop();for(;n&&r.length;)n=r.every(s=>o.intersects(s,e)),o=r.pop();return n},zle=(t,e)=>(t=t.replace(Zn[vn.BUILD],""),rt("comp",t,e),t=Jle(t,e),rt("caret",t),t=Xle(t,e),rt("tildes",t),t=epe(t,e),rt("xrange",t),t=npe(t,e),rt("stars",t),t),er=t=>!t||t.toLowerCase()==="x"||t==="*",Xle=(t,e)=>t.trim().split(/\s+/).map(n=>Qle(n,e)).join(" "),Qle=(t,e)=>{let n=e.loose?Zn[vn.TILDELOOSE]:Zn[vn.TILDE];return t.replace(n,(r,o,s,i,a)=>{rt("tilde",t,r,o,s,i,a);let c;return er(o)?c="":er(s)?c=`>=${o}.0.0 <${+o+1}.0.0-0`:er(i)?c=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:a?(rt("replaceTilde pr",a),c=`>=${o}.${s}.${i}-${a} <${o}.${+s+1}.0-0`):c=`>=${o}.${s}.${i} <${o}.${+s+1}.0-0`,rt("tilde return",c),c})},Jle=(t,e)=>t.trim().split(/\s+/).map(n=>Zle(n,e)).join(" "),Zle=(t,e)=>{rt("caret",t,e);let n=e.loose?Zn[vn.CARETLOOSE]:Zn[vn.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{rt("caret",t,o,s,i,a,c);let d;return er(s)?d="":er(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:er(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?(rt("replaceCaret pr",c),s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(rt("no pr"),s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),rt("caret return",d),d})},epe=(t,e)=>(rt("replaceXRanges",t,e),t.split(/\s+/).map(n=>tpe(n,e)).join(" ")),tpe=(t,e)=>{t=t.trim();let n=e.loose?Zn[vn.XRANGELOOSE]:Zn[vn.XRANGE];return t.replace(n,(r,o,s,i,a,c)=>{rt("xRange",t,r,o,s,i,a,c);let d=er(s),f=d||er(i),m=f||er(a),_=m;return o==="="&&_&&(o=""),c=e.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(f&&(i=0),a=0,o===">"?(o=">=",f?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",f?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):f?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),rt("xRange return",r),r})},npe=(t,e)=>(rt("replaceStars",t,e),t.trim().replace(Zn[vn.STAR],"")),rpe=(t,e)=>(rt("replaceGTE0",t,e),t.trim().replace(Zn[e.includePrerelease?vn.GTE0PRE:vn.GTE0],"")),ope=t=>(e,n,r,o,s,i,a,c,d,f,m,_)=>(er(r)?n="":er(o)?n=`>=${r}.0.0${t?"-0":""}`:er(s)?n=`>=${r}.${o}.0${t?"-0":""}`:i?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,er(d)?c="":er(f)?c=`<${+d+1}.0.0-0`:er(m)?c=`<${d}.${+f+1}.0-0`:_?c=`<=${d}.${f}.${m}-${_}`:t?c=`<${d}.${f}.${+m+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),spe=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(rt(t[r].semver),t[r].semver!==vN.ANY&&t[r].semver.prerelease.length>0){let o=t[r].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var Of=y((j5e,LU)=>{"use strict";p();u();l();var Cf=Symbol("SemVer ANY"),wN=class t{static get ANY(){return Cf}constructor(e,n){if(n=CU(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),LN("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===Cf?this.value="":this.value=this.operator+this.semver.version,LN("comp",this)}parse(e){let n=this.options.loose?PU[xU.COMPARATORLOOSE]:PU[xU.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new vU(r[2],this.options.loose):this.semver=Cf}toString(){return this.value}test(e){if(LN("Comparator.test",e,this.options.loose),this.semver===Cf||e===Cf)return!0;if(typeof e=="string")try{e=new vU(e,this.options)}catch{return!1}return MN(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new MU(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new MU(this.value,n).test(e.semver):(n=CU(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||MN(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||MN(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};LU.exports=wN;var CU=Ng(),{safeRe:PU,t:xU}=Ol(),MN=CN(),LN=Nf(),vU=xn(),MU=_o()});var Pf=y((F5e,wU)=>{"use strict";p();u();l();var ipe=_o(),ape=(t,e,n)=>{try{e=new ipe(e,n)}catch{return!1}return e.test(t)};wU.exports=ape});var UU=y((Y5e,DU)=>{"use strict";p();u();l();var cpe=_o(),upe=(t,e)=>new cpe(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));DU.exports=upe});var jU=y((X5e,kU)=>{"use strict";p();u();l();var lpe=xn(),ppe=_o(),dpe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new ppe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===-1)&&(r=i,o=new lpe(r,n))}),r};kU.exports=dpe});var BU=y((e9e,GU)=>{"use strict";p();u();l();var fpe=xn(),mpe=_o(),_pe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new mpe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===1)&&(r=i,o=new fpe(r,n))}),r};GU.exports=_pe});var HU=y((o9e,FU)=>{"use strict";p();u();l();var DN=xn(),hpe=_o(),$U=bf(),gpe=(t,e)=>{t=new hpe(t,e);let n=new DN("0.0.0");if(t.test(n)||(n=new DN("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null;o.forEach(i=>{let a=new DN(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||$U(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!n||$U(n,s))&&(n=s)}return n&&t.test(n)?n:null};FU.exports=gpe});var qU=y((c9e,VU)=>{"use strict";p();u();l();var Epe=_o(),Tpe=(t,e)=>{try{return new Epe(t,e).range||"*"}catch{return null}};VU.exports=Tpe});var Ug=y((d9e,zU)=>{"use strict";p();u();l();var Spe=xn(),KU=Of(),{ANY:Ape}=KU,ype=_o(),Rpe=Pf(),YU=bf(),WU=vg(),Ipe=Lg(),Npe=Mg(),bpe=(t,e,n,r)=>{t=new Spe(t,r),e=new ype(e,r);let o,s,i,a,c;switch(n){case">":o=YU,s=Ipe,i=WU,a=">",c=">=";break;case"<":o=WU,s=Npe,i=YU,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Rpe(t,e,r))return!1;for(let d=0;d<e.set.length;++d){let f=e.set[d],m=null,_=null;if(f.forEach(g=>{g.semver===Ape&&(g=new KU(">=0.0.0")),m=m||g,_=_||g,o(g.semver,m.semver,r)?m=g:i(g.semver,_.semver,r)&&(_=g)}),m.operator===a||m.operator===c||(!_.operator||_.operator===a)&&s(t,_.semver))return!1;if(_.operator===c&&i(t,_.semver))return!1}return!0};zU.exports=bpe});var QU=y((h9e,XU)=>{"use strict";p();u();l();var Ope=Ug(),Cpe=(t,e,n)=>Ope(t,e,">",n);XU.exports=Cpe});var ZU=y((S9e,JU)=>{"use strict";p();u();l();var Ppe=Ug(),xpe=(t,e,n)=>Ppe(t,e,"<",n);JU.exports=xpe});var nk=y((I9e,tk)=>{"use strict";p();u();l();var ek=_o(),vpe=(t,e,n)=>(t=new ek(t,n),e=new ek(e,n),t.intersects(e,n));tk.exports=vpe});var ok=y((C9e,rk)=>{"use strict";p();u();l();var Mpe=Pf(),Lpe=mo();rk.exports=(t,e,n)=>{let r=[],o=null,s=null,i=t.sort((f,m)=>Lpe(f,m,n));for(let f of i)Mpe(f,e,n)?(s=f,o||(o=f)):(s&&r.push([o,s]),s=null,o=null);o&&r.push([o,null]);let a=[];for(let[f,m]of r)f===m?a.push(f):!m&&f===i[0]?a.push("*"):m?f===i[0]?a.push(`<=${m}`):a.push(`${f} - ${m}`):a.push(`>=${f}`);let c=a.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return c.length<d.length?c:e}});var lk=y((M9e,uk)=>{"use strict";p();u();l();var sk=_o(),kN=Of(),{ANY:UN}=kN,xf=Pf(),jN=mo(),wpe=(t,e,n={})=>{if(t===e)return!0;t=new sk(t,n),e=new sk(e,n);let r=!1;e:for(let o of t.set){for(let s of e.set){let i=Upe(o,s,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},Dpe=[new kN(">=0.0.0-0")],ik=[new kN(">=0.0.0")],Upe=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===UN){if(e.length===1&&e[0].semver===UN)return!0;n.includePrerelease?t=Dpe:t=ik}if(e.length===1&&e[0].semver===UN){if(n.includePrerelease)return!0;e=ik}let r=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=ak(o,g,n):g.operator==="<"||g.operator==="<="?s=ck(s,g,n):r.add(g.semver);if(r.size>1)return null;let i;if(o&&s){if(i=jN(o.semver,s.semver,n),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of r){if(o&&!xf(g,String(o),n)||s&&!xf(g,String(s),n))return null;for(let T of e)if(!xf(g,String(T),n))return!1;return!0}let a,c,d,f,m=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1;m&&m.prerelease.length===1&&s.operator==="<"&&m.prerelease[0]===0&&(m=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(_&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===_.major&&g.semver.minor===_.minor&&g.semver.patch===_.patch&&(_=!1),g.operator===">"||g.operator===">="){if(a=ak(o,g,n),a===g&&a!==o)return!1}else if(o.operator===">="&&!xf(o.semver,String(g),n))return!1}if(s){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator==="<"||g.operator==="<="){if(c=ck(s,g,n),c===g&&c!==s)return!1}else if(s.operator==="<="&&!xf(s.semver,String(g),n))return!1}if(!g.operator&&(s||o)&&i!==0)return!1}return!(o&&d&&!s&&i!==0||s&&f&&!o&&i!==0||_||m)},ak=(t,e,n)=>{if(!t)return e;let r=jN(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},ck=(t,e,n)=>{if(!t)return e;let r=jN(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};uk.exports=wpe});var mk=y((U9e,fk)=>{"use strict";p();u();l();var GN=Ol(),pk=If(),kpe=xn(),dk=RN(),jpe=Hc(),Gpe=j0(),Bpe=B0(),$pe=H0(),Fpe=Y0(),Hpe=K0(),Vpe=X0(),qpe=J0(),Ype=eU(),Wpe=mo(),Kpe=oU(),zpe=iU(),Xpe=xg(),Qpe=lU(),Jpe=dU(),Zpe=bf(),ede=vg(),tde=bN(),nde=ON(),rde=Mg(),ode=Lg(),sde=CN(),ide=AU(),ade=Of(),cde=_o(),ude=Pf(),lde=UU(),pde=jU(),dde=BU(),fde=HU(),mde=qU(),_de=Ug(),hde=QU(),gde=ZU(),Ede=nk(),Tde=ok(),Sde=lk();fk.exports={parse:jpe,valid:Gpe,clean:Bpe,inc:$pe,diff:Fpe,major:Hpe,minor:Vpe,patch:qpe,prerelease:Ype,compare:Wpe,rcompare:Kpe,compareLoose:zpe,compareBuild:Xpe,sort:Qpe,rsort:Jpe,gt:Zpe,lt:ede,eq:tde,neq:nde,gte:rde,lte:ode,cmp:sde,coerce:ide,Comparator:ade,Range:cde,satisfies:ude,toComparators:lde,maxSatisfying:pde,minSatisfying:dde,minVersion:fde,validRange:mde,outside:_de,gtr:hde,ltr:gde,intersects:Ede,simplifyRange:Tde,subset:Sde,SemVer:kpe,re:GN.re,src:GN.src,tokens:GN.t,SEMVER_SPEC_VERSION:pk.SEMVER_SPEC_VERSION,RELEASE_TYPES:pk.RELEASE_TYPES,compareIdentifiers:dk.compareIdentifiers,rcompareIdentifiers:dk.rcompareIdentifiers}});function yde(t){let e=(0,tr.normalize)(t);return e.length>1&&e[e.length-1]===tr.sep&&(e=e.substring(0,e.length-1)),e}function Ek(t,e){return t.replace(Rde,e)}function Nde(t){return t==="/"||Ide.test(t)}function BN(t,e){let{resolvePaths:n,normalizePath:r,pathSeparator:o}=e,s=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=(0,tr.resolve)(t)),(r||s)&&(t=yde(t)),t===".")return"";let i=t[t.length-1]!==o;return Ek(i?t+o:t,o)}function Tk(t,e){return e+t}function bde(t,e){return function(n,r){return r.startsWith(t)?r.slice(t.length)+n:Ek((0,tr.relative)(t,r),e.pathSeparator)+e.pathSeparator+n}}function Ode(t){return t}function Cde(t,e,n){return e+t+n}function Pde(t,e){let{relativePaths:n,includeBasePath:r}=e;return n&&t?bde(t,e):r?Tk:Ode}function xde(t){return function(e,n){n.push(e.substring(t.length)||".")}}function vde(t){return function(e,n,r){let o=e.substring(t.length)||".";r.every(s=>s(o,!0))&&n.push(o)}}function Dde(t,e){let{includeDirs:n,filters:r,relativePaths:o}=e;return n?o?r&&r.length?vde(t):xde(t):r&&r.length?Lde:Mde:wde}function $de(t){let{excludeFiles:e,filters:n,onlyCounts:r}=t;return e?Bde:n&&n.length?r?Ude:kde:r?jde:Gde}function Vde(t){return t.group?Hde:Fde}function Wde(t){return t.group?qde:Yde}function Xde(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?zde:Kde}function Sk(t,e,n){if(n.options.useRealPaths)return Qde(e,n);let r=(0,tr.dirname)(t),o=1;for(;r!==n.root&&o<2;){let s=n.symlinks.get(r);!!s&&(s===e||s.startsWith(e)||e.startsWith(s))?o++:r=(0,tr.dirname)(r)}return n.symlinks.set(t,e),o>1}function Qde(t,e){return e.visited.includes(t+e.options.pathSeparator)}function kg(t,e,n,r){e(t&&!r?t:null,n)}function ife(t,e){let{onlyCounts:n,group:r,maxFiles:o}=t;return n?e?Jde:nfe:r?e?Zde:sfe:o?e?tfe:ofe:e?efe:rfe}function ufe(t){return t?cfe:afe}function ffe(t,e){return new Promise((n,r)=>{Rk(t,e,(o,s)=>{if(o)return r(o);n(s)})})}function Rk(t,e,n){new yk(t,e,n).start()}function mfe(t,e){return new yk(t,e).start()}var gk,tr,Ade,_k,Rde,Ide,Mde,Lde,wde,Ude,kde,jde,Gde,Bde,Fde,Hde,qde,Yde,Kde,zde,Jde,Zde,efe,tfe,nfe,rfe,ofe,sfe,Ak,afe,cfe,lfe,pfe,dfe,yk,hk,Ik,Nk,bk=S(()=>{p();u();l();gk=require("module"),tr=require("path"),Ade=j(require("fs"),1),_k=(0,gk.createRequire)(h);Rde=/[\\/]/g;Ide=/^[a-z]:[\\/]$/i;Mde=(t,e)=>{e.push(t||".")},Lde=(t,e,n)=>{let r=t||".";n.every(o=>o(r,!0))&&e.push(r)},wde=()=>{};Ude=(t,e,n,r)=>{r.every(o=>o(t,!1))&&n.files++},kde=(t,e,n,r)=>{r.every(o=>o(t,!1))&&e.push(t)},jde=(t,e,n,r)=>{n.files++},Gde=(t,e)=>{e.push(t)},Bde=()=>{};Fde=t=>t,Hde=()=>[""].slice(0,0);qde=(t,e,n)=>{t.push({directory:e,files:n,dir:e})},Yde=()=>{};Kde=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue(),o.realpath(t,(i,a)=>{if(i)return r.dequeue(s?null:i,e);o.stat(a,(c,d)=>{if(c)return r.dequeue(s?null:c,e);if(d.isDirectory()&&Sk(t,a,e))return r.dequeue(null,e);n(d,a),r.dequeue(null,e)})})},zde=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue();try{let i=o.realpathSync(t),a=o.statSync(i);if(a.isDirectory()&&Sk(t,i,e))return;n(a,i)}catch(i){if(!s)throw i}};Jde=t=>t.counts,Zde=t=>t.groups,efe=t=>t.paths,tfe=t=>t.paths.slice(0,t.options.maxFiles),nfe=(t,e,n)=>(kg(e,n,t.counts,t.options.suppressErrors),null),rfe=(t,e,n)=>(kg(e,n,t.paths,t.options.suppressErrors),null),ofe=(t,e,n)=>(kg(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),sfe=(t,e,n)=>(kg(e,n,t.groups,t.options.suppressErrors),null);Ak={withFileTypes:!0},afe=(t,e,n,r,o)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);let{fs:s}=t;t.visited.push(e),t.counts.directories++,s.readdir(e||".",Ak,(i,a=[])=>{o(a,n,r),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},cfe=(t,e,n,r,o)=>{let{fs:s}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=s.readdirSync(e||".",Ak)}catch(a){if(!t.options.suppressErrors)throw a}o(i,n,r)};lfe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},pfe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},dfe=class{aborted=!1;abort(){this.aborted=!0}},yk=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=ife(e,this.isSynchronous),this.root=BN(t,e),this.state={root:Nde(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new pfe,options:e,queue:new lfe((r,o)=>this.callbackInvoker(o,r,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new dfe,fs:e.fs||Ade},this.joinPath=Pde(this.root,e),this.pushDirectory=Dde(this.root,e),this.pushFile=$de(e),this.getArray=Vde(e),this.groupFiles=Wde(e),this.resolveSymlink=Xde(e,this.isSynchronous),this.walkDirectory=ufe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,n)=>{let{paths:r,options:{filters:o,resolveSymlinks:s,excludeSymlinks:i,exclude:a,maxFiles:c,signal:d,useRealPaths:f,pathSeparator:m},controller:_}=this.state;if(_.aborted||d&&d.aborted||c&&r.length>c)return;let g=this.getArray(this.state.paths);for(let T=0;T<t.length;++T){let A=t[T];if(A.isFile()||A.isSymbolicLink()&&!s&&!i){let R=this.joinPath(A.name,e);this.pushFile(R,g,this.state.counts,o)}else if(A.isDirectory()){let R=Cde(A.name,e,this.state.options.pathSeparator);if(a&&a(A.name,R))continue;this.pushDirectory(R,r,o),this.walkDirectory(this.state,R,R,n-1,this.walk)}else if(this.resolveSymlink&&A.isSymbolicLink()){let R=Tk(A.name,e);this.resolveSymlink(R,this.state,(b,I)=>{if(b.isDirectory()){if(I=BN(I,this.state.options),a&&a(A.name,f?I:R+m))return;this.walkDirectory(this.state,I,f?I:R+m,n-1,this.walk)}else{I=f?I:R;let v=(0,tr.basename)(I),O=BN((0,tr.dirname)(I),this.state.options);I=this.joinPath(v,O),this.pushFile(I,g,this.state.counts,o)}})}}this.groupFiles(this.state.groups,e,g)}};hk=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return ffe(this.root,this.options)}withCallback(t){Rk(this.root,this.options,t)}sync(){return mfe(this.root,this.options)}},Ik=null;try{_k.resolve("picomatch"),Ik=_k("picomatch")}catch{}Nk=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:tr.sep,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new hk(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new hk(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let n=this.globFunction||Ik;if(!n)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=n(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(o=>r(o)),this}}});var vf=y((X9e,vk)=>{"use strict";p();u();l();var Ok="[^\\\\/]",_fe="(?=.)",Ck="[^/]",$N="(?:\\/|$)",Pk="(?:^|\\/)",FN=`\\.{1,2}${$N}`,hfe="(?!\\.)",gfe=`(?!${Pk}${FN})`,Efe=`(?!\\.{0,1}${$N})`,Tfe=`(?!${FN})`,Sfe="[^.\\/]",Afe=`${Ck}*?`,yfe="/",xk={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:_fe,QMARK:Ck,END_ANCHOR:$N,DOTS_SLASH:FN,NO_DOT:hfe,NO_DOTS:gfe,NO_DOT_SLASH:Efe,NO_DOTS_SLASH:Tfe,QMARK_NO_DOT:Sfe,STAR:Afe,START_ANCHOR:Pk,SEP:yfe},Rfe={...xk,SLASH_LITERAL:"[\\\\/]",QMARK:Ok,STAR:`${Ok}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},Ife={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};vk.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Ife,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Rfe:xk}}});var Mf=y(Nr=>{"use strict";p();u();l();var{REGEX_BACKSLASH:Nfe,REGEX_REMOVE_BACKSLASH:bfe,REGEX_SPECIAL_CHARS:Ofe,REGEX_SPECIAL_CHARS_GLOBAL:Cfe}=vf();Nr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Nr.hasRegexChars=t=>Ofe.test(t);Nr.isRegexChar=t=>t.length===1&&Nr.hasRegexChars(t);Nr.escapeRegex=t=>t.replace(Cfe,"\\$1");Nr.toPosixSlashes=t=>t.replace(Nfe,"/");Nr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Nr.removeBackslashes=t=>t.replace(bfe,e=>e==="\\"?"":e);Nr.escapeLast=(t,e,n)=>{let r=t.lastIndexOf(e,n);return r===-1?t:t[r-1]==="\\"?Nr.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};Nr.removePrefix=(t,e={})=>{let n=t;return n.startsWith("./")&&(n=n.slice(2),e.prefix="./"),n};Nr.wrapOutput=(t,e={},n={})=>{let r=n.contains?"":"^",o=n.contains?"":"$",s=`${r}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};Nr.basename=(t,{windows:e}={})=>{let n=t.split(e?/[\\/]/:"/"),r=n[n.length-1];return r===""?n[n.length-2]:r}});var Gk=y((o6e,jk)=>{"use strict";p();u();l();var Mk=Mf(),{CHAR_ASTERISK:HN,CHAR_AT:Pfe,CHAR_BACKWARD_SLASH:Lf,CHAR_COMMA:xfe,CHAR_DOT:VN,CHAR_EXCLAMATION_MARK:qN,CHAR_FORWARD_SLASH:kk,CHAR_LEFT_CURLY_BRACE:YN,CHAR_LEFT_PARENTHESES:WN,CHAR_LEFT_SQUARE_BRACKET:vfe,CHAR_PLUS:Mfe,CHAR_QUESTION_MARK:Lk,CHAR_RIGHT_CURLY_BRACE:Lfe,CHAR_RIGHT_PARENTHESES:wk,CHAR_RIGHT_SQUARE_BRACKET:wfe}=vf(),Dk=t=>t===kk||t===Lf,Uk=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Dfe=(t,e)=>{let n=e||{},r=t.length-1,o=n.parts===!0||n.scanToEnd===!0,s=[],i=[],a=[],c=t,d=-1,f=0,m=0,_=!1,g=!1,T=!1,A=!1,R=!1,b=!1,I=!1,v=!1,O=!1,G=!1,w=0,K,k,ee={value:"",depth:0,isGlob:!1},C=()=>d>=r,Et=()=>c.charCodeAt(d+1),ze=()=>(K=k,c.charCodeAt(++d));for(;d<r;){k=ze();let ke;if(k===Lf){I=ee.backslashes=!0,k=ze(),k===YN&&(b=!0);continue}if(b===!0||k===YN){for(w++;C()!==!0&&(k=ze());){if(k===Lf){I=ee.backslashes=!0,ze();continue}if(k===YN){w++;continue}if(b!==!0&&k===VN&&(k=ze())===VN){if(_=ee.isBrace=!0,T=ee.isGlob=!0,G=!0,o===!0)continue;break}if(b!==!0&&k===xfe){if(_=ee.isBrace=!0,T=ee.isGlob=!0,G=!0,o===!0)continue;break}if(k===Lfe&&(w--,w===0)){b=!1,_=ee.isBrace=!0,G=!0;break}}if(o===!0)continue;break}if(k===kk){if(s.push(d),i.push(ee),ee={value:"",depth:0,isGlob:!1},G===!0)continue;if(K===VN&&d===f+1){f+=2;continue}m=d+1;continue}if(n.noext!==!0&&(k===Mfe||k===Pfe||k===HN||k===Lk||k===qN)===!0&&Et()===WN){if(T=ee.isGlob=!0,A=ee.isExtglob=!0,G=!0,k===qN&&d===f&&(O=!0),o===!0){for(;C()!==!0&&(k=ze());){if(k===Lf){I=ee.backslashes=!0,k=ze();continue}if(k===wk){T=ee.isGlob=!0,G=!0;break}}continue}break}if(k===HN){if(K===HN&&(R=ee.isGlobstar=!0),T=ee.isGlob=!0,G=!0,o===!0)continue;break}if(k===Lk){if(T=ee.isGlob=!0,G=!0,o===!0)continue;break}if(k===vfe){for(;C()!==!0&&(ke=ze());){if(ke===Lf){I=ee.backslashes=!0,ze();continue}if(ke===wfe){g=ee.isBracket=!0,T=ee.isGlob=!0,G=!0;break}}if(o===!0)continue;break}if(n.nonegate!==!0&&k===qN&&d===f){v=ee.negated=!0,f++;continue}if(n.noparen!==!0&&k===WN){if(T=ee.isGlob=!0,o===!0){for(;C()!==!0&&(k=ze());){if(k===WN){I=ee.backslashes=!0,k=ze();continue}if(k===wk){G=!0;break}}continue}break}if(T===!0){if(G=!0,o===!0)continue;break}}n.noext===!0&&(A=!1,T=!1);let Ce=c,P="",x="";f>0&&(P=c.slice(0,f),c=c.slice(f),m-=f),Ce&&T===!0&&m>0?(Ce=c.slice(0,m),x=c.slice(m)):T===!0?(Ce="",x=c):Ce=c,Ce&&Ce!==""&&Ce!=="/"&&Ce!==c&&Dk(Ce.charCodeAt(Ce.length-1))&&(Ce=Ce.slice(0,-1)),n.unescape===!0&&(x&&(x=Mk.removeBackslashes(x)),Ce&&I===!0&&(Ce=Mk.removeBackslashes(Ce)));let Qn={prefix:P,input:t,start:f,base:Ce,glob:x,isBrace:_,isBracket:g,isGlob:T,isExtglob:A,isGlobstar:R,negated:v,negatedExtglob:O};if(n.tokens===!0&&(Qn.maxDepth=0,Dk(k)||i.push(ee),Qn.tokens=i),n.parts===!0||n.tokens===!0){let ke;for(let Je=0;Je<s.length;Je++){let po=ke?ke+1:f,fo=s[Je],la=t.slice(po,fo);n.tokens&&(Je===0&&f!==0?(i[Je].isPrefix=!0,i[Je].value=P):i[Je].value=la,Uk(i[Je]),Qn.maxDepth+=i[Je].depth),(Je!==0||la!=="")&&a.push(la),ke=fo}if(ke&&ke+1<t.length){let Je=t.slice(ke+1);a.push(Je),n.tokens&&(i[i.length-1].value=Je,Uk(i[i.length-1]),Qn.maxDepth+=i[i.length-1].depth)}Qn.slashes=s,Qn.parts=a}return Qn};jk.exports=Dfe});var Fk=y((c6e,$k)=>{"use strict";p();u();l();var jg=vf(),Is=Mf(),{MAX_LENGTH:Gg,POSIX_REGEX_SOURCE:Ufe,REGEX_NON_SPECIAL_CHARS:kfe,REGEX_SPECIAL_CHARS_BACKREF:jfe,REPLACEMENTS:Bk}=jg,Gfe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let n=`[${t.join("-")}]`;try{new RegExp(n)}catch{return t.map(o=>Is.escapeRegex(o)).join("..")}return n},Cl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,KN=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Bk[t]||t;let n={...e},r=typeof n.maxLength=="number"?Math.min(Gg,n.maxLength):Gg,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);let s={type:"bos",value:"",output:n.prepend||""},i=[s],a=n.capture?"":"?:",c=jg.globChars(n.windows),d=jg.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:_,ONE_CHAR:g,DOTS_SLASH:T,NO_DOT:A,NO_DOT_SLASH:R,NO_DOTS_SLASH:b,QMARK:I,QMARK_NO_DOT:v,STAR:O,START_ANCHOR:G}=c,w=z=>`(${a}(?:(?!${G}${z.dot?T:f}).)*?)`,K=n.dot?"":A,k=n.dot?I:v,ee=n.bash===!0?w(n):O;n.capture&&(ee=`(${ee})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);let C={input:t,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=Is.removePrefix(t,C),o=t.length;let Et=[],ze=[],Ce=[],P=s,x,Qn=()=>C.index===o-1,ke=C.peek=(z=1)=>t[C.index+z],Je=C.advance=()=>t[++C.index]||"",po=()=>t.slice(C.index+1),fo=(z="",nt=0)=>{C.consumed+=z,C.index+=nt},la=z=>{C.output+=z.output!=null?z.output:z.value,fo(z.value)},Eue=()=>{let z=1;for(;ke()==="!"&&(ke(2)!=="("||ke(3)==="?");)Je(),C.start++,z++;return z%2===0?!1:(C.negated=!0,C.start++,!0)},Ag=z=>{C[z]++,Ce.push(z)},Fc=z=>{C[z]--,Ce.pop()},Me=z=>{if(P.type==="globstar"){let nt=C.braces>0&&(z.type==="comma"||z.type==="brace"),$=z.extglob===!0||Et.length&&(z.type==="pipe"||z.type==="paren");z.type!=="slash"&&z.type!=="paren"&&!nt&&!$&&(C.output=C.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=ee,C.output+=P.output)}if(Et.length&&z.type!=="paren"&&(Et[Et.length-1].inner+=z.value),(z.value||z.output)&&la(z),P&&P.type==="text"&&z.type==="text"){P.output=(P.output||P.value)+z.value,P.value+=z.value;return}z.prev=P,i.push(z),P=z},yg=(z,nt)=>{let $={...d[nt],conditions:1,inner:""};$.prev=P,$.parens=C.parens,$.output=C.output;let xe=(n.capture?"(":"")+$.open;Ag("parens"),Me({type:z,value:nt,output:C.output?"":g}),Me({type:"paren",extglob:!0,value:Je(),output:xe}),Et.push($)},Tue=z=>{let nt=z.close+(n.capture?")":""),$;if(z.type==="negate"){let xe=ee;if(z.inner&&z.inner.length>1&&z.inner.includes("/")&&(xe=w(n)),(xe!==ee||Qn()||/^\)+$/.test(po()))&&(nt=z.close=`)$))${xe}`),z.inner.includes("*")&&($=po())&&/^\.[^\\/.]+$/.test($)){let dt=KN($,{...e,fastpaths:!1}).output;nt=z.close=`)${dt})${xe})`}z.prev.type==="bos"&&(C.negatedExtglob=!0)}Me({type:"paren",extglob:!0,value:x,output:nt}),Fc("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let z=!1,nt=t.replace(jfe,($,xe,dt,Jn,Zt,SN)=>Jn==="\\"?(z=!0,$):Jn==="?"?xe?xe+Jn+(Zt?I.repeat(Zt.length):""):SN===0?k+(Zt?I.repeat(Zt.length):""):I.repeat(dt.length):Jn==="."?f.repeat(dt.length):Jn==="*"?xe?xe+Jn+(Zt?ee:""):ee:xe?$:`\\${$}`);return z===!0&&(n.unescape===!0?nt=nt.replace(/\\/g,""):nt=nt.replace(/\\+/g,$=>$.length%2===0?"\\\\":$?"\\":"")),nt===t&&n.contains===!0?(C.output=t,C):(C.output=Is.wrapOutput(nt,C,e),C)}for(;!Qn();){if(x=Je(),x==="\0")continue;if(x==="\\"){let $=ke();if($==="/"&&n.bash!==!0||$==="."||$===";")continue;if(!$){x+="\\",Me({type:"text",value:x});continue}let xe=/^\\+/.exec(po()),dt=0;if(xe&&xe[0].length>2&&(dt=xe[0].length,C.index+=dt,dt%2!==0&&(x+="\\")),n.unescape===!0?x=Je():x+=Je(),C.brackets===0){Me({type:"text",value:x});continue}}if(C.brackets>0&&(x!=="]"||P.value==="["||P.value==="[^")){if(n.posix!==!1&&x===":"){let $=P.value.slice(1);if($.includes("[")&&(P.posix=!0,$.includes(":"))){let xe=P.value.lastIndexOf("["),dt=P.value.slice(0,xe),Jn=P.value.slice(xe+2),Zt=Ufe[Jn];if(Zt){P.value=dt+Zt,C.backtrack=!0,Je(),!s.output&&i.indexOf(P)===1&&(s.output=g);continue}}}(x==="["&&ke()!==":"||x==="-"&&ke()==="]")&&(x=`\\${x}`),x==="]"&&(P.value==="["||P.value==="[^")&&(x=`\\${x}`),n.posix===!0&&x==="!"&&P.value==="["&&(x="^"),P.value+=x,la({value:x});continue}if(C.quotes===1&&x!=='"'){x=Is.escapeRegex(x),P.value+=x,la({value:x});continue}if(x==='"'){C.quotes=C.quotes===1?0:1,n.keepQuotes===!0&&Me({type:"text",value:x});continue}if(x==="("){Ag("parens"),Me({type:"paren",value:x});continue}if(x===")"){if(C.parens===0&&n.strictBrackets===!0)throw new SyntaxError(Cl("opening","("));let $=Et[Et.length-1];if($&&C.parens===$.parens+1){Tue(Et.pop());continue}Me({type:"paren",value:x,output:C.parens?")":"\\)"}),Fc("parens");continue}if(x==="["){if(n.nobracket===!0||!po().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(Cl("closing","]"));x=`\\${x}`}else Ag("brackets");Me({type:"bracket",value:x});continue}if(x==="]"){if(n.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){Me({type:"text",value:x,output:`\\${x}`});continue}if(C.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(Cl("opening","["));Me({type:"text",value:x,output:`\\${x}`});continue}Fc("brackets");let $=P.value.slice(1);if(P.posix!==!0&&$[0]==="^"&&!$.includes("/")&&(x=`/${x}`),P.value+=x,la({value:x}),n.literalBrackets===!1||Is.hasRegexChars($))continue;let xe=Is.escapeRegex(P.value);if(C.output=C.output.slice(0,-P.value.length),n.literalBrackets===!0){C.output+=xe,P.value=xe;continue}P.value=`(${a}${xe}|${P.value})`,C.output+=P.value;continue}if(x==="{"&&n.nobrace!==!0){Ag("braces");let $={type:"brace",value:x,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};ze.push($),Me($);continue}if(x==="}"){let $=ze[ze.length-1];if(n.nobrace===!0||!$){Me({type:"text",value:x,output:x});continue}let xe=")";if($.dots===!0){let dt=i.slice(),Jn=[];for(let Zt=dt.length-1;Zt>=0&&(i.pop(),dt[Zt].type!=="brace");Zt--)dt[Zt].type!=="dots"&&Jn.unshift(dt[Zt].value);xe=Gfe(Jn,n),C.backtrack=!0}if($.comma!==!0&&$.dots!==!0){let dt=C.output.slice(0,$.outputIndex),Jn=C.tokens.slice($.tokensIndex);$.value=$.output="\\{",x=xe="\\}",C.output=dt;for(let Zt of Jn)C.output+=Zt.output||Zt.value}Me({type:"brace",value:x,output:xe}),Fc("braces"),ze.pop();continue}if(x==="|"){Et.length>0&&Et[Et.length-1].conditions++,Me({type:"text",value:x});continue}if(x===","){let $=x,xe=ze[ze.length-1];xe&&Ce[Ce.length-1]==="braces"&&(xe.comma=!0,$="|"),Me({type:"comma",value:x,output:$});continue}if(x==="/"){if(P.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",i.pop(),P=s;continue}Me({type:"slash",value:x,output:_});continue}if(x==="."){if(C.braces>0&&P.type==="dot"){P.value==="."&&(P.output=f);let $=ze[ze.length-1];P.type="dots",P.output+=x,P.value+=x,$.dots=!0;continue}if(C.braces+C.parens===0&&P.type!=="bos"&&P.type!=="slash"){Me({type:"text",value:x,output:f});continue}Me({type:"dot",value:x,output:f});continue}if(x==="?"){if(!(P&&P.value==="(")&&n.noextglob!==!0&&ke()==="("&&ke(2)!=="?"){yg("qmark",x);continue}if(P&&P.type==="paren"){let xe=ke(),dt=x;(P.value==="("&&!/[!=<:]/.test(xe)||xe==="<"&&!/<([!=]|\w+>)/.test(po()))&&(dt=`\\${x}`),Me({type:"text",value:x,output:dt});continue}if(n.dot!==!0&&(P.type==="slash"||P.type==="bos")){Me({type:"qmark",value:x,output:v});continue}Me({type:"qmark",value:x,output:I});continue}if(x==="!"){if(n.noextglob!==!0&&ke()==="("&&(ke(2)!=="?"||!/[!=<:]/.test(ke(3)))){yg("negate",x);continue}if(n.nonegate!==!0&&C.index===0){Eue();continue}}if(x==="+"){if(n.noextglob!==!0&&ke()==="("&&ke(2)!=="?"){yg("plus",x);continue}if(P&&P.value==="("||n.regex===!1){Me({type:"plus",value:x,output:m});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||C.parens>0){Me({type:"plus",value:x});continue}Me({type:"plus",value:m});continue}if(x==="@"){if(n.noextglob!==!0&&ke()==="("&&ke(2)!=="?"){Me({type:"at",extglob:!0,value:x,output:""});continue}Me({type:"text",value:x});continue}if(x!=="*"){(x==="$"||x==="^")&&(x=`\\${x}`);let $=kfe.exec(po());$&&(x+=$[0],C.index+=$[0].length),Me({type:"text",value:x});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=x,P.output=ee,C.backtrack=!0,C.globstar=!0,fo(x);continue}let z=po();if(n.noextglob!==!0&&/^\([^?]/.test(z)){yg("star",x);continue}if(P.type==="star"){if(n.noglobstar===!0){fo(x);continue}let $=P.prev,xe=$.prev,dt=$.type==="slash"||$.type==="bos",Jn=xe&&(xe.type==="star"||xe.type==="globstar");if(n.bash===!0&&(!dt||z[0]&&z[0]!=="/")){Me({type:"star",value:x,output:""});continue}let Zt=C.braces>0&&($.type==="comma"||$.type==="brace"),SN=Et.length&&($.type==="pipe"||$.type==="paren");if(!dt&&$.type!=="paren"&&!Zt&&!SN){Me({type:"star",value:x,output:""});continue}for(;z.slice(0,3)==="/**";){let Rg=t[C.index+4];if(Rg&&Rg!=="/")break;z=z.slice(3),fo("/**",3)}if($.type==="bos"&&Qn()){P.type="globstar",P.value+=x,P.output=w(n),C.output=P.output,C.globstar=!0,fo(x);continue}if($.type==="slash"&&$.prev.type!=="bos"&&!Jn&&Qn()){C.output=C.output.slice(0,-($.output+P.output).length),$.output=`(?:${$.output}`,P.type="globstar",P.output=w(n)+(n.strictSlashes?")":"|$)"),P.value+=x,C.globstar=!0,C.output+=$.output+P.output,fo(x);continue}if($.type==="slash"&&$.prev.type!=="bos"&&z[0]==="/"){let Rg=z[1]!==void 0?"|$":"";C.output=C.output.slice(0,-($.output+P.output).length),$.output=`(?:${$.output}`,P.type="globstar",P.output=`${w(n)}${_}|${_}${Rg})`,P.value+=x,C.output+=$.output+P.output,C.globstar=!0,fo(x+Je()),Me({type:"slash",value:"/",output:""});continue}if($.type==="bos"&&z[0]==="/"){P.type="globstar",P.value+=x,P.output=`(?:^|${_}|${w(n)}${_})`,C.output=P.output,C.globstar=!0,fo(x+Je()),Me({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-P.output.length),P.type="globstar",P.output=w(n),P.value+=x,C.output+=P.output,C.globstar=!0,fo(x);continue}let nt={type:"star",value:x,output:ee};if(n.bash===!0){nt.output=".*?",(P.type==="bos"||P.type==="slash")&&(nt.output=K+nt.output),Me(nt);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&n.regex===!0){nt.output=x,Me(nt);continue}(C.index===C.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(C.output+=R,P.output+=R):n.dot===!0?(C.output+=b,P.output+=b):(C.output+=K,P.output+=K),ke()!=="*"&&(C.output+=g,P.output+=g)),Me(nt)}for(;C.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(Cl("closing","]"));C.output=Is.escapeLast(C.output,"["),Fc("brackets")}for(;C.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(Cl("closing",")"));C.output=Is.escapeLast(C.output,"("),Fc("parens")}for(;C.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(Cl("closing","}"));C.output=Is.escapeLast(C.output,"{"),Fc("braces")}if(n.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&Me({type:"maybe_slash",value:"",output:`${_}?`}),C.backtrack===!0){C.output="";for(let z of C.tokens)C.output+=z.output!=null?z.output:z.value,z.suffix&&(C.output+=z.suffix)}return C};KN.fastpaths=(t,e)=>{let n={...e},r=typeof n.maxLength=="number"?Math.min(Gg,n.maxLength):Gg,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);t=Bk[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:_,START_ANCHOR:g}=jg.globChars(n.windows),T=n.dot?f:d,A=n.dot?m:d,R=n.capture?"":"?:",b={negated:!1,prefix:""},I=n.bash===!0?".*?":_;n.capture&&(I=`(${I})`);let v=K=>K.noglobstar===!0?I:`(${R}(?:(?!${g}${K.dot?c:s}).)*?)`,O=K=>{switch(K){case"*":return`${T}${a}${I}`;case".*":return`${s}${a}${I}`;case"*.*":return`${T}${I}${s}${a}${I}`;case"*/*":return`${T}${I}${i}${a}${A}${I}`;case"**":return T+v(n);case"**/*":return`(?:${T}${v(n)}${i})?${A}${a}${I}`;case"**/*.*":return`(?:${T}${v(n)}${i})?${A}${I}${s}${a}${I}`;case"**/.*":return`(?:${T}${v(n)}${i})?${s}${a}${I}`;default:{let k=/^(.*?)\.(\w+)$/.exec(K);if(!k)return;let ee=O(k[1]);return ee?ee+s+k[2]:void 0}}},G=Is.removePrefix(t,b),w=O(G);return w&&n.strictSlashes!==!0&&(w+=`${i}?`),w};$k.exports=KN});var qk=y((d6e,Vk)=>{"use strict";p();u();l();var Bfe=Gk(),zN=Fk(),Hk=Mf(),$fe=vf(),Ffe=t=>t&&typeof t=="object"&&!Array.isArray(t),xt=(t,e,n=!1)=>{if(Array.isArray(t)){let f=t.map(_=>xt(_,e,n));return _=>{for(let g of f){let T=g(_);if(T)return T}return!1}}let r=Ffe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,i=r?xt.compileRe(t,e):xt.makeRe(t,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=xt(o.ignore,f,n)}let d=(f,m=!1)=>{let{isMatch:_,match:g,output:T}=xt.test(f,i,e,{glob:t,posix:s}),A={glob:t,state:a,regex:i,posix:s,input:f,output:T,match:g,isMatch:_};return typeof o.onResult=="function"&&o.onResult(A),_===!1?(A.isMatch=!1,m?A:!1):c(f)?(typeof o.onIgnore=="function"&&o.onIgnore(A),A.isMatch=!1,m?A:!1):(typeof o.onMatch=="function"&&o.onMatch(A),m?A:!0)};return n&&(d.state=a),d};xt.test=(t,e,n,{glob:r,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=n||{},i=s.format||(o?Hk.toPosixSlashes:null),a=t===r,c=a&&i?i(t):t;return a===!1&&(c=i?i(t):t,a=c===r),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=xt.matchBase(t,e,n,o):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};xt.matchBase=(t,e,n)=>(e instanceof RegExp?e:xt.makeRe(e,n)).test(Hk.basename(t));xt.isMatch=(t,e,n)=>xt(e,n)(t);xt.parse=(t,e)=>Array.isArray(t)?t.map(n=>xt.parse(n,e)):zN(t,{...e,fastpaths:!1});xt.scan=(t,e)=>Bfe(t,e);xt.compileRe=(t,e,n=!1,r=!1)=>{if(n===!0)return t.output;let o=e||{},s=o.contains?"":"^",i=o.contains?"":"$",a=`${s}(?:${t.output})${i}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=xt.toRegex(a,e);return r===!0&&(c.state=t),c};xt.makeRe=(t,e={},n=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=zN.fastpaths(t,e)),o.output||(o=zN(t,e)),xt.compileRe(o,e,n,r)};xt.toRegex=(t,e)=>{try{let n=e||{};return new RegExp(t,n.flags||(n.nocase?"i":""))}catch(n){if(e&&e.debug===!0)throw n;return/$^/}};xt.constants=$fe;Vk.exports=xt});var zk=y((h6e,Kk)=>{"use strict";p();u();l();var Yk=qk(),Hfe=Mf();function Wk(t,e,n=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Hfe.isWindows()}),Yk(t,e,n)}Object.assign(Wk,Yk);Kk.exports=Wk});function Yfe(t,e={}){let n=t.length,r=Array(n),o=Array(n),s=!e.noglobstar;for(let i=0;i<n;i++){let a=Zk(t[i]);r[i]=a;let c=a.length,d=Array(c);for(let f=0;f<c;f++)d[f]=(0,xl.default)(a[f],e);o[i]=d}return i=>{let a=i.split("/");if(a[0]===".."&&qfe.test(i))return!0;for(let c=0;c<t.length;c++){let d=r[c],f=o[c],m=a.length,_=Math.min(m,d.length),g=0;for(;g<_;){let T=d[g];if(T.includes("/"))return!0;if(!f[g](a[g]))break;if(s&&T==="**")return!0;g++}if(g===m)return!0}return!1}}function Xk(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){let o=Kfe(t)?t.length:t.length+1;return(s,i)=>s.slice(o,i?-1:void 0)||"."}let r=e.slice(t.length+1);return r?(o,s)=>{if(o===".")return r;let i=`${r}/${o}`;return s?i.slice(0,-1):i}:(o,s)=>s&&o!=="."?o.slice(0,-1):o}return n?r=>Jo.posix.relative(t,r)||".":r=>Jo.posix.relative(t,`${e}/${r}`)||"."}function zfe(t,e){if(e.startsWith(`${t}/`)){let n=e.slice(t.length+1);return r=>`${n}/${r}`}return n=>{let r=Jo.posix.relative(t,`${e}/${n}`);return n.endsWith("/")&&r!==""?`${r}/`:r||"."}}function Zk(t){var e;let n=xl.default.scan(t,Xfe);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}function nme(t,e){if(e?.caseSensitiveMatch===!1)return!0;let n=xl.default.scan(t);return n.isGlob||n.negated}function Pl(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function XN(t,e,n,r,o){let s=t;t.endsWith("/")&&(s=t.slice(0,-1)),!s.endsWith("*")&&e&&(s+="/**");let i=tme(n);Jo.default.isAbsolute(s.replace(ome,""))?s=Jo.posix.relative(i,s):s=Jo.posix.normalize(s);let a=rme.exec(s),c=Zk(s);if(a?.[0]){let f=(a[0].length+1)/3,m=0,_=i.split("/");for(;m<f&&c[m+f]===_[_.length+m-f];)s=s.slice(0,(f-m-1)*3)+s.slice((f-m)*3+c[m+f].length+1)||".",m++;let g=Jo.posix.join(n,a[0].slice(m*3));!g.startsWith(".")&&r.root.length>g.length&&(r.root=g,r.depthOffset=-f+m)}if(!o&&r.depthOffset>=0){var d;(d=r.commonPath)!==null&&d!==void 0||(r.commonPath=c);let f=[],m=Math.min(r.commonPath.length,c.length);for(let _=0;_<m;_++){let g=c[_];if(g==="**"&&!c[_+1]){f.pop();break}if(g!==r.commonPath[_]||nme(g)||_===c.length-1)break;f.push(g)}r.depthOffset=f.length,r.commonPath=f,r.root=f.length>0?Jo.posix.join(n,...f):n}return s}function sme({patterns:t=["**/*"],ignore:e=[],expandDirectories:n=!0},r,o){typeof t=="string"&&(t=[t]),typeof e=="string"&&(e=[e]);let s=[],i=[];for(let a of e)a&&(a[0]!=="!"||a[1]==="(")&&i.push(XN(a,n,r,o,!0));for(let a of t)a&&(a[0]!=="!"||a[1]==="("?s.push(XN(a,n,r,o,!1)):(a[1]!=="!"||a[2]==="(")&&i.push(XN(a.slice(1),n,r,o,!0)));return{match:s,ignore:i}}function ime(t,e){for(let n=t.length-1;n>=0;n--){let r=t[n];t[n]=e(r)}return t}function ame(t){return t?t instanceof URL?(0,Qk.fileURLToPath)(t).replace(Bg,"/"):Jo.default.resolve(t).replace(Bg,"/"):process.cwd().replace(Bg,"/")}function cme(t,e={}){let n=process.env.TINYGLOBBY_DEBUG?{...e,debug:!0}:e,r=ame(n.cwd);if(n.debug&&Pl("globbing with:",{patterns:t,options:n,cwd:r}),Array.isArray(t)&&t.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let o={root:r,commonPath:null,depthOffset:0},s=sme({...n,patterns:t},r,o);n.debug&&Pl("internal processing patterns:",s);let i={dot:n.dot,nobrace:n.braceExpansion===!1,nocase:n.caseSensitiveMatch===!1,noextglob:n.extglob===!1,noglobstar:n.globstar===!1,posix:!0},a=(0,xl.default)(s.match,{...i,ignore:s.ignore}),c=(0,xl.default)(s.ignore,i),d=Yfe(s.match,i),f=Xk(r,o.root,n.absolute),m=n.absolute?f:Xk(r,o.root,!0),_={filters:[n.debug?(A,R)=>{let b=f(A,R),I=a(b);return I&&Pl(`matched ${b}`),I}:(A,R)=>a(f(A,R))],exclude:n.debug?(A,R)=>{let b=m(R,!0),I=b!=="."&&!d(b)||c(b);return Pl(I?`skipped ${R}`:`crawling ${R}`),I}:(A,R)=>{let b=m(R,!0);return b!=="."&&!d(b)||c(b)},fs:n.fs?{readdir:n.fs.readdir||Vc.default.readdir,readdirSync:n.fs.readdirSync||Vc.default.readdirSync,realpath:n.fs.realpath||Vc.default.realpath,realpathSync:n.fs.realpathSync||Vc.default.realpathSync,stat:n.fs.stat||Vc.default.stat,statSync:n.fs.statSync||Vc.default.statSync}:void 0,pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0,signal:n.signal};n.deep!==void 0&&(_.maxDepth=Math.round(n.deep-o.depthOffset)),n.absolute&&(_.relativePaths=!1,_.resolvePaths=!0,_.includeBasePath=!0),n.followSymbolicLinks===!1&&(_.resolveSymlinks=!1,_.excludeSymlinks=!0),n.onlyDirectories?(_.excludeFiles=!0,_.includeDirs=!0):n.onlyFiles===!1&&(_.includeDirs=!0),o.root=o.root.replace(Bg,"");let g=o.root;n.debug&&Pl("internal properties:",o);let T=r!==g&&!n.absolute&&zfe(r,o.root);return[new Nk(_).crawl(g),T]}async function e1(t,e){if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Vfe(t)||typeof t=="string",r=n?e:t,o=n?t:t.patterns,[s,i]=cme(o,r);return i?ime(await s.withPromise(),i):s.withPromise()}var Vc,Jo,Qk,xl,Vfe,Jk,qfe,Wfe,Kfe,Xfe,Qfe,Jfe,Zfe,eme,tme,rme,ome,Bg,t1=S(()=>{p();u();l();Vc=j(require("fs"),1),Jo=j(require("path"),1),Qk=require("url");bk();xl=j(zk(),1),Vfe=Array.isArray,Jk=process.platform==="win32",qfe=/^(\/?\.\.)+$/;Wfe=/^[A-Z]:\/$/i,Kfe=Jk?t=>Wfe.test(t):t=>t==="/";Xfe={parts:!0};Qfe=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Jfe=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Zfe=t=>t.replace(Qfe,"\\$&"),eme=t=>t.replace(Jfe,"\\$&"),tme=Jk?eme:Zfe;rme=/^(\/?\.\.)+/,ome=/\\(?=[()[\]{}!*+?@|])/g,Bg=/\\/g});var $g,Fg,QN,ume,JN,n1,r1,lme,o1=S(()=>{p();u();l();$g="0123456789abcdef",Fg=class t{constructor(e){this.bytes=e}static ofInner(e){if(e.length!==16)throw new TypeError("not 128-bit length");return new t(e)}static fromFieldsV7(e,n,r,o){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||e<0||n<0||r<0||o<0||e>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw new RangeError("invalid field value");let s=new Uint8Array(16);return s[0]=e/2**40,s[1]=e/2**32,s[2]=e/2**24,s[3]=e/2**16,s[4]=e/2**8,s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=o>>>24,s[13]=o>>>16,s[14]=o>>>8,s[15]=o,new t(s)}static parse(e){var n,r,o,s;let i;switch(e.length){case 32:i=(n=/^[0-9a-f]{32}$/i.exec(e))===null||n===void 0?void 0:n[0];break;case 36:i=(r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e))===null||r===void 0?void 0:r.slice(1,6).join("");break;case 38:i=(o=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(e))===null||o===void 0?void 0:o.slice(1,6).join("");break;case 45:i=(s=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e))===null||s===void 0?void 0:s.slice(1,6).join("");break;default:break}if(i){let a=new Uint8Array(16);for(let c=0;c<16;c+=4){let d=parseInt(i.substring(2*c,2*c+8),16);a[c+0]=d>>>24,a[c+1]=d>>>16,a[c+2]=d>>>8,a[c+3]=d}return new t(a)}else throw new SyntaxError("could not parse UUID string")}toString(){let e="";for(let n=0;n<this.bytes.length;n++)e+=$g.charAt(this.bytes[n]>>>4),e+=$g.charAt(this.bytes[n]&15),(n===3||n===5||n===7||n===9)&&(e+="-");return e}toHex(){let e="";for(let n=0;n<this.bytes.length;n++)e+=$g.charAt(this.bytes[n]>>>4),e+=$g.charAt(this.bytes[n]&15);return e}toJSON(){return this.toString()}getVariant(){let e=this.bytes[8]>>>4;if(e<0)throw new Error("unreachable");if(e<=7)return this.bytes.every(n=>n===0)?"NIL":"VAR_0";if(e<=11)return"VAR_10";if(e<=13)return"VAR_110";if(e<=15)return this.bytes.every(n=>n===255)?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;n<16;n++){let r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},QN=class{constructor(e){this.timestamp_biased=0,this.counter=0,this.random=e??ume()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(e,n){let r=this.generateOrAbortCore(e,n);return r===void 0&&(this.timestamp_biased=0,r=this.generateOrAbortCore(e,n)),r}generateOrAbortCore(e,n){if(!Number.isInteger(e)||e<0||e>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit unsigned integer");if(n<0||n>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(e++,e>this.timestamp_biased)this.timestamp_biased=e,this.resetCounter();else if(e+n>=this.timestamp_biased)this.counter++,this.counter>4398046511103&&(this.timestamp_biased++,this.resetCounter());else return;return Fg.fromFieldsV7(this.timestamp_biased-1,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=this.random.nextUint32()*1024+(this.random.nextUint32()&1023)}generateV4(){let e=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return e[6]=64|e[6]>>>4,e[8]=128|e[8]>>>2,Fg.ofInner(e)}},ume=()=>{if(typeof crypto<"u"&&typeof crypto.getRandomValues<"u")return new JN;if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");return{nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}},JN=class{constructor(){this.buffer=new Uint32Array(8),this.cursor=65535}nextUint32(){return this.cursor>=this.buffer.length&&(crypto.getRandomValues(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},r1=()=>lme().toString(),lme=()=>(n1||(n1=new QN)).generate()});var Hg,Ns,s1,i1,ZN,eb,pme,dme,p=S(()=>{"use strict";Hg=require("node:child_process"),Ns=require("node:fs/promises"),s1=require("node:sqlite"),i1=j(mk(),1);t1();o1();ZN=class{stmt;constructor(e){this.stmt=e}get(...e){return this.stmt.get(...e)}all(...e){return this.stmt.all(...e)}run(...e){this.stmt.run(...e)}},eb=class{db;constructor(e){this.db=new s1.DatabaseSync(e)}exec(e){this.db.exec(e)}query(e){return new ZN(this.db.prepare(e))}close(){this.db.close()}transaction(e){return()=>{this.db.exec("BEGIN");try{let n=e();return this.db.exec("COMMIT"),n}catch(n){throw this.db.exec("ROLLBACK"),n}}}},pme={Database:eb};globalThis.__bun_sqlite_polyfill=pme;dme={file(t){return{async exists(){try{return await(0,Ns.access)(t),!0}catch{return!1}},text(){return(0,Ns.readFile)(t,"utf-8")},async json(){let e=await(0,Ns.readFile)(t,"utf-8");return JSON.parse(e)}}},async write(t,e){if(e instanceof Response){let n=await e.arrayBuffer();await(0,Ns.writeFile)(t,Buffer.from(n))}else e instanceof ArrayBuffer?await(0,Ns.writeFile)(t,Buffer.from(e)):e instanceof Uint8Array?await(0,Ns.writeFile)(t,e):await(0,Ns.writeFile)(t,e,"utf-8")},which(t){try{let n=process.platform==="win32"?`where ${t}`:`which ${t}`;return(0,Hg.execSync)(n,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
|
|
4
4
|
`)[0]||null}catch{return null}},spawn(t,e){let[n,...r]=t,o=["ignore",e?.stdout??"ignore",e?.stderr??"ignore"],s=(0,Hg.spawn)(n,r,{detached:!0,stdio:o});return{unref(){s.unref()}}},sleep(t){return new Promise(e=>setTimeout(e,t))},Glob:class{pattern;constructor(e){this.pattern=e}async*scan(e){let n=await e1(this.pattern,{cwd:e?.cwd||process.cwd()});for(let r of n)yield r}},randomUUIDv7(){return r1()},semver:{order:i1.compare}};globalThis.Bun=dme});function m1(t,e){let n=t.env?.[e];return typeof n=="string"&&n!=="0"}function ib(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function Zo(t){return Array.from(t).map((e,n)=>{let r=e.toUpperCase(),o=e.toLowerCase();return n===0||r!==e||r===o?e:`-${o}`}).join("")}function fme(t){let e=new Map;return{get:(...n)=>e.get(n.join(","))??t,set:(n,...r)=>{e.set(r.join(","),n)}}}function mme(t,e,n){let{threshold:r,weights:o}=n;if(t===e)return 0;let s=Math.abs(t.length-e.length);if(typeof r=="number"&&s>r)return 1/0;let i=fme(1/0);i.set(0,-1,-1);for(let d=0;d<e.length;++d)i.set((d+1)*o.insertion,-1,d);for(let d=0;d<t.length;++d)i.set((d+1)*o.deletion,d,-1);let a=-1/0;for(let d=0;d<t.length;++d){let f=1/0;for(let m=0;m<=e.length-1;++m){let _=t[d]===e[m]?0:1,g=[i.get(d-1,m)+o.deletion,i.get(d,m-1)+o.insertion,i.get(d-1,m-1)+_*o.substitution];t[d]===e[m-1]&&t[d-1]===e[m]&&g.push(i.get(d-2,m-2)+_*o.transposition);let T=Math.min(...g);i.set(T,d,m),T<f&&(f=T)}if(f>r){if(a>r)return 1/0;a=f}else a=-1/0}let c=i.get(t.length-1,e.length-1);return c>r?1/0:c}function _me(t,e,n){let r=t[1]-e[1];if(r!==0)return r;let o=t[0].startsWith(n),s=e[0].startsWith(n);return o&&!s?-1:!o&&s?1:t[0].localeCompare(e[0])}function Df(t,e,n){let r=e.map(s=>[s,mme(t,s,n)]).filter(([,s])=>s<=n.threshold),o=Math.min(...r.map(([,s])=>s));return r.filter(([,s])=>s===o).sort((s,i)=>_me(s,i,t)).map(([s])=>s)}function Vg(t){return t instanceof Error?t.stack??String(t):String(t)}function hme(t,e){let n=[],r=Math.max(t.length,e.length);for(let o=0;o<r;++o)n[o]=Math.max(t[o],e[o]);return n}function qg(t,e){if(t.length===0)return[];let n=Array(Math.max(...t.map(o=>o.length))).fill(0,0),r=t.reduce((o,s)=>{let i=s.map(a=>a.length);return hme(o,i)},n);return t.map(o=>{let s=(o[0]??"").padEnd(r[0]);return o.slice(1).reduce((i,a,c,d)=>{let f=d.length===c+1?a:a.padEnd(r[c+1]);return[...i,e?.[c]??" ",f]},[s]).join("").trimEnd()})}function ab(t,e){if(t.length<=1)return t[0]??"";if(t.length===2)return t.join(` ${e.conjunction} `);let n=t.slice(0,t.length-1).join(", ");return e.serialComma&&(n+=","),[n,e.conjunction,t[t.length-1]].join(" ")}function gme(t,e){return t.reduce((n,r)=>{let o=e(r),s=n[o]??[];return s.push(r),n[o]=s,n},{})}function Eme(t,e){return gme(t,n=>n[e])}async function tb(t){let e=await Promise.allSettled(t),n=Eme(e,"status");return n.rejected&&n.rejected.length>0?{status:"rejected",reasons:n.rejected.map(r=>r.reason)}:{status:"fulfilled",value:n.fulfilled?.map(r=>r.value)??[]}}function yme(t,e){let n=t.constructor.name,r=e[n];return r?r(t):t.message}function Rme(t,e,n){return Object.fromEntries(Object.entries(e).map(([r,o])=>{let s=o,i=t[s];if(!i){let a=Ei(s,n);throw new wf(a,[],r)}return[r,[s,i]]}))}function nb(t,e){return t.placeholder?t.placeholder:typeof e=="number"?`arg${e}`:"args"}function Ei(t,e){return e==="allow-kebab-for-camel"?Zo(t):t}function qc(t,e,n,r){try{return e.parse.call(r,n)}catch(o){throw new sb(t,n,o)}}function u1(t){if(t.startsWith("no")&&t.length>2){if(t[2]==="-")return t.slice(4);let e=t[2],n=e.toUpperCase();return e!==n?void 0:e.toLowerCase()+t.slice(3)}}function _1(t,e,n){let r=t,o=e[r],s,i=!1;if(!o){let c=u1(r);if(c&&(o=e[c],o&&o.kind=="boolean")){if(o.withNegated!==!1)return{namedFlag:[c,o],negated:!0};s=c,o=void 0}}let a=ib(t);if(n.caseStyle==="allow-kebab-for-camel"&&!o){if(o=e[a],o)return{namedFlag:[a,o]};let c=u1(a);if(c&&(o=e[c],o&&o.kind=="boolean")){if(o.withNegated!==!1)return{namedFlag:[c,o],negated:!0};s=c,i=!0,o=void 0}}if(!o){if(s){let f=s;throw i&&t.includes("-")&&(f=Zo(s)),new wf(t,[f])}if(a in e)throw new wf(t,[a]);let c=Zo(t);if(c in e)throw new wf(t,[c]);let d=Df(r,Object.keys(e),n.distanceOptions);throw new wf(t,d)}return{namedFlag:[r,o]}}function l1(t){return t.namedFlag[1].kind==="boolean"||t.namedFlag[1].kind==="counter"}function Nme(t,e,n,r){let o=h1.exec(t);if(o){let i=o[1];return Array.from(i).map(a=>{let c=a,d=n[c];if(!d)throw new ub(c);return{namedFlag:d}})}let s=Ime.exec(t);if(s){let i=s[1];return[_1(i,e,r)]}return[]}function Pme(t,e,n,r){let o=bme.exec(t);if(o){let i=o[1],{namedFlag:a,negated:c}=_1(i,e,r),d=o[2];if(c)throw new Cme(i,d);return[a,d]}let s=Ome.exec(t);if(s){let i=s[1],a=n[i];if(!a)throw new ub(i);let c=s[2];return[a,c]}}async function xme(t,e,n,r,o){if(!n){if("default"in e&&typeof e.default<"u"){if(e.kind==="boolean")return e.default;if(e.kind==="enum"){if("variadic"in e&&e.variadic&&Array.isArray(e.default)){let i=e.default;for(let a of i)if(!e.values.includes(a)){let c=Df(a,e.values,r.distanceOptions);throw new rb(t,a,e.values,c)}return e.default}return e.default}if("variadic"in e&&e.variadic&&Array.isArray(e.default)){let i=e.default;return Promise.all(i.map(a=>qc(t,e,a,o)))}return qc(t,e,e.default,o)}if(e.optional)return;if(e.kind==="boolean")return!1;if(e.kind==="counter")return 0;throw new vl(t)}if(e.kind==="counter")return n.reduce((i,a)=>{try{return i+cb.call(o,a)}catch(c){throw new sb(t,a,c)}},0);if("variadic"in e&&e.variadic){if(e.kind==="enum"){for(let i of n)if(!e.values.includes(i)){let a=Df(i,e.values,r.distanceOptions);throw new rb(t,i,e.values,a)}return n}return Promise.all(n.map(i=>qc(t,e,i,o)))}let s=n[0];if(e.kind==="boolean")try{return Ame.call(o,s)}catch(i){throw new sb(t,s,i)}if(e.kind==="enum"){if(!e.values.includes(s)){let i=Df(s,e.values,r.distanceOptions);throw new rb(t,s,e.values,i)}return s}return qc(t,e,s,o)}function g1(t){return t.kind==="counter"?!0:"variadic"in t?!!t.variadic:!1}function gi(t,e,[n,r],o){let s=t.get(n)??[];if(s.length>0&&!g1(r)){let i=Ei(n,e);throw new vme(i,s[0],o)}if("variadic"in r&&typeof r.variadic=="string"){let i=o.split(r.variadic);t.set(n,[...s,...i])}else t.set(n,[...s,o])}function ob(t,e,n){if(e.get(n)){let o=t[n];return!g1(o)}return!1}function Mme(t,e){let{flags:n={},aliases:r={},positional:o={kind:"tuple",parameters:[]}}=t,s=Rme(n,r,e.caseStyle),i=[],a=new Map,c=0,d,f=!1;return{next:m=>{if(!f&&e.allowArgumentEscapeSequence&&m==="--"){if(d)if(d[1].kind==="parsed"&&d[1].inferEmpty)gi(a,e.caseStyle,d,""),d=void 0;else{let _=Ei(d[0],e.caseStyle);throw new vl(_)}f=!0;return}if(!f){let _=Pme(m,n,s,e);if(_){if(d)if(d[1].kind==="parsed"&&d[1].inferEmpty)gi(a,e.caseStyle,d,""),d=void 0;else{let T=Ei(d[0],e.caseStyle),A=Ei(_[0][0],e.caseStyle);throw new vl(T,A)}gi(a,e.caseStyle,..._);return}let g=Nme(m,n,s,e);if(g.length>0){if(d)if(d[1].kind==="parsed"&&d[1].inferEmpty)gi(a,e.caseStyle,d,""),d=void 0;else{let T=Ei(d[0],e.caseStyle),A=Ei(g[0].namedFlag[0],e.caseStyle);throw new vl(T,A)}if(g.every(l1))for(let T of g)T.namedFlag[1].kind==="boolean"?gi(a,e.caseStyle,T.namedFlag,T.negated?"false":"true"):gi(a,e.caseStyle,T.namedFlag,"1");else if(g.length>1){let T=g.find(R=>!l1(R)),A=Ei(T.namedFlag[0],e.caseStyle);throw new vl(A)}else d=g[0].namedFlag;return}}if(d)gi(a,e.caseStyle,d,m),d=void 0;else{if(o.kind==="tuple"){if(c>=o.parameters.length)throw new a1(o.parameters.length,m)}else if(typeof o.maximum=="number"&&c>=o.maximum)throw new a1(o.maximum,m);i[c]=m,++c}},parseArguments:async m=>{let _=[],g;o.kind==="array"?(typeof o.minimum=="number"&&c<o.minimum&&_.push(new c1(nb(o.parameter),[o.minimum,c])),g=tb(i.map(async(I,v)=>{let O=nb(o.parameter,v+1);return qc(O,o.parameter,I,m)}))):g=tb(o.parameters.map(async(I,v)=>{let O=nb(I,v+1),G=i[v];if(typeof G!="string"){if(typeof I.default=="string")return qc(O,I,I.default,m);if(I.optional)return;throw new c1(O)}return qc(O,I,G,m)})),d&&d[1].kind==="parsed"&&d[1].inferEmpty&&(gi(a,e.caseStyle,d,""),d=void 0);let T=tb(Object.entries(n).map(async I=>{let[v,O]=I,G=Ei(v,e.caseStyle);if(d&&d[0]===v)throw new vl(G);let w=a.get(v),K=await xme(G,O,w,e,m);return[v,K]})),[A,R]=await Promise.all([g,T]);if(A.status==="rejected")for(let I of A.reasons)_.push(I);if(R.status==="rejected")for(let I of R.reasons)_.push(I);if(_.length>0)return{success:!1,errors:_};if(A.status==="rejected")throw new nr("Unknown failure while scanning positional arguments");if(R.status==="rejected")throw new nr("Unknown failure while scanning flag arguments");return{success:!0,arguments:[Object.fromEntries(R.value),...A.value]}},proposeCompletions:async({partial:m,completionConfig:_,text:g,context:T,includeVersionFlag:A})=>{if(d)return E1(d[1],T,m);let R=[];if(!f){let b=h1.exec(m);if(_.includeAliases){if(m===""||m==="-"){let I=Object.entries(r).filter(v=>!ob(n,a,v[1]));for(let[v]of I){let O=s[v];O&&R.push({kind:"argument:flag",completion:`-${v}`,brief:O[1].brief})}}else if(b){let I=Array.from(b[1]);if(I.includes("h"))return[];if(A&&I.includes("v"))return[];let v=new Map(a);for(let w of I){let K=s[w];if(!K)throw new ub(w);gi(v,e.caseStyle,K,K[1].kind==="boolean"?"true":"1")}let O=I[I.length-1];if(O){let w=s[O];w&&R.push({kind:"argument:flag",completion:m,brief:w[1].brief})}let G=Object.entries(r).filter(w=>!ob(n,v,w[1]));for(let[w]of G){let K=s[w];K&&R.push({kind:"argument:flag",completion:`${m}${w}`,brief:K[1].brief})}}}if(m===""||m==="-"||m.startsWith("--")){e.allowArgumentEscapeSequence&&R.push({kind:"argument:flag",completion:"--",brief:g.briefs.argumentEscapeSequence});let I=Object.entries(n).filter(([O])=>!ob(n,a,O));e.caseStyle==="allow-kebab-for-camel"&&(I=I.map(([O,G])=>[Zo(O),G]));let v=I.map(([O,G])=>[`--${O}`,G]).filter(([O])=>O.startsWith(m));R.push(...v.map(([O,G])=>({kind:"argument:flag",completion:O,brief:G.brief})))}}if(o.kind==="array"){if(o.parameter.proposeCompletions&&(typeof o.maximum!="number"||c<o.maximum)){let b=await o.parameter.proposeCompletions.call(T,m);R.push(...b.map(I=>({kind:"argument:value",completion:I,brief:o.parameter.brief})))}}else{let b=o.parameters[c];if(b?.proposeCompletions){let I=await b.proposeCompletions.call(T,m);R.push(...I.map(v=>({kind:"argument:value",completion:v,brief:b.brief})))}}return R.filter(({completion:b})=>b.startsWith(m))}}}async function E1(t,e,n){if(typeof t.variadic=="string"&&n.endsWith(t.variadic))return E1(t,e,"");let r;return t.kind==="enum"?r=t.values:t.proposeCompletions?r=await t.proposeCompletions.call(e,n):r=[],r.map(o=>({kind:"argument:value",completion:o,brief:t.brief})).filter(({completion:o})=>o.startsWith(n))}function Lme(t,e,n){let r=e==="allow-kebab-for-camel"?"convert-camel-to-kebab":e,o=t.getAllEntries();return n.includeHiddenRoutes||(o=o.filter(s=>!s.hidden)),o.flatMap(s=>{let i=s.name[r];return n.includeAliases?[i,...s.aliases]:[i]})}function wme(t){if(t.startsWith("en"))return lb}function Os(t,e,n){return!n.disableAnsiColor&&!m1(t,"STRICLI_NO_COLOR")&&(e.getColorDepth?.(t.env)??1)>=4}async function Dme({loader:t,parameters:e},{context:n,inputs:r,scannerConfig:o,errorFormatting:s,documentationConfig:i,determineExitCode:a}){let c;try{let f=Mme(e,o);for(let _ of r)f.next(_);let m=await f.parseArguments(n);if(m.success)c=m.arguments;else{let _=Os(n.process,n.process.stderr,i);for(let g of m.errors){let T=s.exceptionWhileParsingArguments(g,_);n.process.stderr.write(_?`\x1B[1m\x1B[31m${T}\x1B[39m\x1B[22m
|
|
5
5
|
`:`${T}
|
|
6
6
|
`)}return bs.InvalidArgument}}catch(f){let m=Os(n.process,n.process.stderr,i),_=s.exceptionWhileParsingArguments(f,m);return n.process.stderr.write(m?`\x1B[1m\x1B[31m${_}\x1B[39m\x1B[22m
|
|
@@ -61,7 +61,7 @@ Url: ${WT(t)}`),!0}return!1}function mMe(t,e){return e?.length?HT(t).some(n=>Ia(
|
|
|
61
61
|
globstar while`,e,_,n,g,T),this.matchOne(e.slice(_),n.slice(g),r))return this.debug("globstar found match!",_,c,T),!0;if(T==="."||T===".."||!o.dot&&T.charAt(0)==="."){this.debug("dot detected!",e,_,n,g);break}this.debug("globstar swallow a segment, and continue"),_++}return!!(r&&(this.debug(`
|
|
62
62
|
>>> no match, partial?`,e,_,n,g),_===c))}let A;if(typeof f=="string"?(A=m===f,this.debug("string match",f,m,A)):(A=f.test(m),this.debug("pattern match",f,m,A)),!A)return!1}if(i===c&&a===d)return!0;if(i===c)return r;if(a===d)return i===c-1&&e[i]==="";throw new Error("wtf?")}braceExpand(){return SQ(this.pattern,this.options)}parse(e){G_(e);let n=this.options;if(e==="**")return vo;if(e==="")return"";let r,o=null;(r=e.match(m1e))?o=n.dot?h1e:_1e:(r=e.match(o1e))?o=(n.nocase?n.dot?c1e:a1e:n.dot?i1e:s1e)(r[1]):(r=e.match(g1e))?o=(n.nocase?n.dot?T1e:E1e:n.dot?S1e:A1e)(r):(r=e.match(u1e))?o=n.dot?p1e:l1e:(r=e.match(d1e))&&(o=f1e);let s=Xp.fromGlob(e,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?I1e:n.dot?N1e:b1e,o=new Set(n.nocase?["i"]:[]),s=e.map(c=>{let d=c.map(f=>{if(f instanceof RegExp)for(let m of f.flags.split(""))o.add(m);return typeof f=="string"?v1e(f):f===vo?vo:f._src});return d.forEach((f,m)=>{let _=d[m+1],g=d[m-1];f!==vo||g===vo||(g===void 0?_!==void 0&&_!==vo?d[m+1]="(?:\\/|"+r+"\\/)?"+_:d[m]=r:_===void 0?d[m-1]=g+"(?:\\/|"+r+")?":_!==vo&&(d[m-1]=g+"(?:\\/|\\/"+r+"\\/)"+_,d[m+1]=vo))}),d.filter(f=>f!==vo).join("/")}).join("|"),[i,a]=e.length>1?["(?:",")"]:["",""];s="^"+i+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let a=o.length-2;!i&&a>=0;a--)i=o[a];for(let a=0;a<s.length;a++){let c=s[a],d=o;if(r.matchBase&&c.length===1&&(d=[i]),this.matchOne(d,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Rn.defaults(e).Minimatch}};Rn.AST=Xp;Rn.Minimatch=Qp;Rn.escape=Zv;Rn.unescape=Za});var tM,HA,bQ,yQ,L1e,w1e,RQ,ot,ec,Fi,Er,tc,$_,IQ,NQ,$A,FA,OQ=S(()=>{p();u();l();tM=j(require("node:diagnostics_channel"),1);U();HA=j(Be(),1),bQ=j(he(),1);Le();AQ();yQ="@fastify/otel",L1e="0.8.0",w1e=">=4.0.0 <6",RQ=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],ot={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},ec={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Fi="anonymous",Er=Symbol("fastify otel instance"),tc=Symbol("fastify otel request spans"),$_=Symbol("fastify otel request context"),IQ=Symbol("fastify otel addhook original"),NQ=Symbol("fastify otel setnotfound original"),$A=Symbol("fastify otel ignore path"),FA=class extends bQ.InstrumentationBase{constructor(e){if(super(yQ,L1e,e),this.servername=e?.servername??process.env.OTEL_SERVICE_NAME??"fastify",this[$A]=null,this._logger=or.createComponentLogger({namespace:yQ}),e?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=e?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=Rn;this[$A]=o=>typeof n=="function"?n(o):r(o.url,n)}}enable(){if(this._handleInitialization===void 0&&this.getConfig().registerOnInitialization){let e=this.plugin();this._handleInitialization=n=>{n.fastify.register(e)},tM.default.subscribe("fastify.initialization",this._handleInitialization)}return super.enable()}disable(){return this._handleInitialization&&(tM.default.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let e=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:w1e,name:"@fastify/otel"},n;function n(r,o,s){r.decorate(Er,e),r.decorate(IQ,r.addHook),r.decorate(NQ,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let _=this[$_];return{span:this[tc],tracer:e.tracer,context:_,inject:(T,A)=>sr.inject(_,T,A),extract:(T,A)=>sr.extract(_,T,A)}}),r.decorateRequest(tc,null),r.decorateRequest($_,null),r.addHook("onRoute",function(m){if(e[$A]?.(m)===!0){e._logger.debug(`Ignoring route instrumentation ${m.method} ${m.url} because it matches the ignore path`);return}for(let _ of RQ)if(m[_]!=null){let g=m[_];if(typeof g=="function")m[_]=f(g,{[Yr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - route -> ${_}`,[ot.FASTIFY_TYPE]:ec.ROUTE,[br]:m.url,[ot.HOOK_CALLBACK_NAME]:g.name?.length>0?g.name:Fi});else if(Array.isArray(g)){let T=[];for(let A of g)T.push(f(A,{[Yr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - route -> ${_}`,[ot.FASTIFY_TYPE]:ec.ROUTE,[br]:m.url,[ot.HOOK_CALLBACK_NAME]:A.name?.length>0?A.name:Fi}));m[_]=T}}m.onSend!=null?m.onSend=Array.isArray(m.onSend)?[...m.onSend,i]:[m.onSend,i]:m.onSend=i,m.onError!=null?m.onError=Array.isArray(m.onError)?[...m.onError,a]:[m.onError,a]:m.onError=a,m.handler=f(m.handler,{[Yr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - route-handler`,[ot.FASTIFY_TYPE]:ec.HANDLER,[br]:m.url,[ot.HOOK_CALLBACK_NAME]:m.handler.name.length>0?m.handler.name:Fi})}),r.addHook("onRequest",function(m,_,g){if(this[Er].isEnabled()===!1)return g();if(this[Er][$A]?.({url:m.url,method:m.method})===!0)return this[Er]._logger.debug(`Ignoring request ${m.method} ${m.url} because it matches the ignore path`),g();let T=V.active();de.getSpan(T)==null&&(T=sr.extract(T,m.headers));let A=(0,HA.getRPCMetadata)(T);m.routeOptions.url!=null&&A?.type===HA.RPCType.HTTP&&(A.route=m.routeOptions.url);let R=this[Er].tracer.startSpan("request",{attributes:{[Yr]:r[Er].servername,[ot.ROOT]:"@fastify/otel",[br]:m.url,[Ai]:m.method}},T);m[$_]=de.setSpan(T,R),m[tc]=R,V.with(m[$_],()=>{g()})}),r.addHook("onResponse",function(m,_,g){let T=m[tc];T!=null&&(T.setStatus({code:it.OK,message:"OK"}),T.setAttributes({[Ls]:404}),T.end()),m[tc]=null,g()}),r.addHook=c,r.setNotFoundHandler=d,s();function i(m,_,g,T){let A=m[tc];A!=null&&(_.statusCode<500&&A.setStatus({code:it.OK,message:"OK"}),A.setAttributes({[Ls]:_.statusCode}),A.end()),m[tc]=null,T(null,g)}function a(m,_,g,T){let A=m[tc];A!=null&&(A.setStatus({code:it.ERROR,message:g.message}),A.recordException(g)),T()}function c(m,_){let g=this[IQ];return RQ.includes(m)?g.call(this,m,f(_,{[Yr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - ${m}`,[ot.FASTIFY_TYPE]:ec.INSTANCE,[ot.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:Fi})):g.call(this,m,_)}function d(m,_){let g=this[NQ];typeof m=="function"?(_=f(m,{[Yr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[ot.FASTIFY_TYPE]:ec.INSTANCE,[ot.HOOK_CALLBACK_NAME]:m.name?.length>0?m.name:Fi}),g.call(this,_)):(m.preValidation!=null&&(m.preValidation=f(m.preValidation,{[Yr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[ot.FASTIFY_TYPE]:ec.INSTANCE,[ot.HOOK_CALLBACK_NAME]:m.preValidation.name?.length>0?m.preValidation.name:Fi})),m.preHandler!=null&&(m.preHandler=f(m.preHandler,{[Yr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[ot.FASTIFY_TYPE]:ec.INSTANCE,[ot.HOOK_CALLBACK_NAME]:m.preHandler.name?.length>0?m.preHandler.name:Fi})),_=f(_,{[Yr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[ot.FASTIFY_TYPE]:ec.INSTANCE,[ot.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:Fi}),g.call(this,m,_))}function f(m,_={}){return function(...T){let A=this[Er],[R]=T;if(A.isEnabled()===!1)return m.call(this,...T);let b=R[$_]??V.active(),I=A.tracer.startSpan(`handler - ${m.name?.length>0?m.name:this.pluginName??Fi}`,{attributes:_},b);return V.with(de.setSpan(b,I),function(){try{let v=m.call(this,...T);return typeof v?.then=="function"?v.then(O=>(I.end(),O),O=>(I.setStatus({code:it.ERROR,message:O.message}),I.recordException(O),I.end(),Promise.reject(O))):(I.end(),v)}catch(v){throw I.setStatus({code:it.ERROR,message:v.message}),I.recordException(v),I.end(),v}},this)}}}}}});var Hi,F_,H_,CQ=S(()=>{p();u();l();(function(t){let e="fastify.name";t.FASTIFY_NAME=e;let n="fastify.type";t.FASTIFY_TYPE=n;let r="hook.name";t.HOOK_NAME=r;let o="plugin.name";t.PLUGIN_NAME=o})(Hi||(Hi={}));(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request_handler";t.REQUEST_HANDLER=n})(F_||(F_={}));(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request handler";t.REQUEST_HANDLER=n})(H_||(H_={}))});var V_,PQ=S(()=>{p();u();l();V_=Symbol("opentelemetry.instrumentation.fastify.request_active_span")});function nM(t,e,n,r={}){let o=e.startSpan(n,{attributes:r}),s=t[V_]||[];return s.push(o),Object.defineProperty(t,V_,{enumerable:!1,configurable:!0,value:s}),o}function VA(t,e){let n=t[V_]||[];n.length&&(n.forEach(r=>{e&&(r.setStatus({code:it.ERROR,message:e.message}),r.recordException(e)),r.end()}),delete t[V_])}function vQ(t,e,n){let r,o;try{o=t(),xQ(o)&&o.then(s=>e(void 0,s),s=>e(s))}catch(s){r=s}finally{if(!xQ(o)&&(e(r,o),r))throw r;return o}}function xQ(t){return typeof t=="object"&&t&&typeof Object.getOwnPropertyDescriptor(t,"then")?.value=="function"||!1}var MQ=S(()=>{p();u();l();U();PQ()});function j1e(){let t=F();t&&t.on("spanStart",e=>{wQ(e)})}function wQ(t){let e=ae(t).data,n=e["fastify.type"];if(e[ge]||!n)return;t.setAttributes({[fe]:"auto.http.otel.fastify",[ge]:`${n}.fastify`});let r=e["fastify.name"]||e["plugin.name"]||e["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(o)}}var YA,Uu,D1e,U1e,LQ,k1e,qA,DQ=S(()=>{p();u();l();U();YA=j(Be(),1),Uu=j(he(),1);Le();ne();CQ();MQ();D1e="0.1.0",U1e="@sentry/instrumentation-fastify-v3",LQ="anonymous",k1e=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),qA=class extends Uu.InstrumentationBase{constructor(e={}){super(U1e,D1e,e)}init(){return[new Uu.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(r,o,s){if(!e.isEnabled())return s();e._wrap(o,"send",e._patchSend());let i=r,a=(0,YA.getRPCMetadata)(V.active()),c=i.routeOptions?i.routeOptions.url:r.routerPath;c&&a?.type===YA.RPCType.HTTP&&(a.route=c);let d=r.method||"GET";Te().setTransactionName(`${d} ${c}`),s()}}_wrapHandler(e,n,r,o){let s=this;return this._diag.debug("Patching fastify route.handler function"),function(...i){if(!s.isEnabled())return r.apply(this,i);let a=r.name||e||LQ,c=`${H_.MIDDLEWARE} - ${a}`,d=i[1],f=nM(d,s.tracer,c,{[Hi.FASTIFY_TYPE]:F_.MIDDLEWARE,[Hi.PLUGIN_NAME]:e,[Hi.HOOK_NAME]:n}),m=o&&i[i.length-1];return m&&(i[i.length-1]=function(..._){VA(d),m.apply(this,_)}),V.with(de.setSpan(V.active(),f),()=>vQ(()=>r.apply(this,i),_=>{_ instanceof Error&&(f.setStatus({code:it.ERROR,message:_.message}),f.recordException(_)),o||VA(d)}))}}_wrapAddHook(){let e=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let s=o[0],i=o[1],a=this.pluginName;if(!k1e.has(s))return n.apply(this,o);let c=typeof o[o.length-1]=="function"&&i.constructor.name!=="AsyncFunction";return n.apply(this,[s,e._wrapHandler(a,s,i,c)])}}}_patchConstructor(e){let n=this;function r(...o){let s=e.fastify.apply(this,o);return s.addHook("onRequest",n._hookOnRequest()),s.addHook("preHandler",n._hookPreHandler()),j1e(),n._wrap(s,"addHook",n._wrapAddHook()),s}return e.errorCodes!==void 0&&(r.errorCodes=e.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let e=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...s){let i=s[0];return e.isEnabled()?(0,Uu.safeExecuteInTheMiddle)(()=>r.apply(this,s),a=>{!a&&i instanceof Error&&(a=i),VA(this,a)}):r.apply(this,s)}}}_hookPreHandler(){let e=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,s){if(!e.isEnabled())return s();let i=r,a=i.routeOptions?.handler||i.context?.handler,c=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,d=`${H_.REQUEST_HANDLER} - ${c||this.pluginName||LQ}`,f={[Hi.PLUGIN_NAME]:this.pluginName,[Hi.FASTIFY_TYPE]:F_.REQUEST_HANDLER,[Jb]:i.routeOptions?i.routeOptions.url:r.routerPath};c&&(f[Hi.FASTIFY_NAME]=c);let m=nM(o,e.tracer,d,f);wQ(m);let{requestHook:_}=e.getConfig();return _&&(0,Uu.safeExecuteInTheMiddle)(()=>_(m,{request:r}),g=>{g&&e._diag.error("request hook failed",g)},!0),V.with(de.setSpan(V.active(),m),()=>{s()})}}}});function G1e(){let t=F();if(t)return t.getIntegrationByName(WA)}function UQ(t,e,n,r){let o=G1e()?.getShouldHandleError()||BQ;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){It&&N.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(t,e,n)&&oe(t,{mechanism:{handled:!1,type:"auto.function.fastify"}})}function BQ(t,e,n){let r=n.statusCode;return r>=500||r<=299}function $Q(t){let e=ae(t),n=e.description,r=e.data,o=r["fastify.type"],s=o==="hook",i=o===n?.startsWith("handler -"),a=n==="request"||o==="request-handler";if(r[ge]||!i&&!a&&!s)return;let c=s?"hook":i?"middleware":a?"request-handler":"<unknown>";t.setAttributes({[fe]:"auto.http.otel.fastify",[ge]:`${c}.fastify`});let d=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof d=="string"){let f=d.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(f)}}function $1e(){let t=F();t&&t.on("spanStart",e=>{$Q(e)})}function F1e(t){t.addHook("onRequest",async(e,n)=>{if(e.opentelemetry){let{span:s}=e.opentelemetry();s&&$Q(s)}let r=e.routeOptions?.url,o=e.method||"GET";Te().setTransactionName(`${o} ${r}`)})}var rM,WA,kQ,jQ,B1e,GQ,FQ=S(()=>{p();u();l();rM=j(require("node:diagnostics_channel"),1);ne();je();Du();OQ();DQ();WA="Fastify",kQ=Z(`${WA}.v3`,()=>new qA);jQ=Z(`${WA}.v5`,()=>{let t=new FA,e=t.plugin();return rM.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(e).after(o=>{o?It&&N.error("Failed to setup Fastify instrumentation",o):($1e(),r&&F1e(r))})}),rM.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:s}=n;UQ.call(UQ,r,o,s,"diagnostics-channel")}),t}),B1e=(({shouldHandleError:t})=>{let e;return{name:WA,setupOnce(){e=t||BQ,kQ(),jQ()},getShouldHandleError(){return e},setShouldHandleError(n){e=n}}}),GQ=(t={})=>B1e(t)});var oM=y(ds=>{"use strict";p();u();l();Object.defineProperty(ds,"__esModule",{value:!0});ds.SpanNames=ds.TokenKind=ds.AllowedOperationTypes=void 0;var H1e;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(H1e=ds.AllowedOperationTypes||(ds.AllowedOperationTypes={}));var V1e;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(V1e=ds.TokenKind||(ds.TokenKind={}));var q1e;(function(t){t.EXECUTE="graphql.execute",t.PARSE="graphql.parse",t.RESOLVE="graphql.resolve",t.VALIDATE="graphql.validate",t.SCHEMA_VALIDATE="graphql.validateSchema",t.SCHEMA_PARSE="graphql.parseSchema"})(q1e=ds.SpanNames||(ds.SpanNames={}))});var sM=y(q_=>{"use strict";p();u();l();Object.defineProperty(q_,"__esModule",{value:!0});q_.AttributeNames=void 0;var Y1e;(function(t){t.SOURCE="graphql.source",t.FIELD_NAME="graphql.field.name",t.FIELD_PATH="graphql.field.path",t.FIELD_TYPE="graphql.field.type",t.OPERATION_TYPE="graphql.operation.type",t.OPERATION_NAME="graphql.operation.name",t.VARIABLES="graphql.variables.",t.ERROR_VALIDATION_NAME="graphql.validation.error"})(Y1e=q_.AttributeNames||(q_.AttributeNames={}))});var KA=y(Jp=>{"use strict";p();u();l();Object.defineProperty(Jp,"__esModule",{value:!0});Jp.OTEL_GRAPHQL_DATA_SYMBOL=Jp.OTEL_PATCHED_SYMBOL=void 0;Jp.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");Jp.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var HQ=y(zA=>{"use strict";p();u();l();Object.defineProperty(zA,"__esModule",{value:!0});zA.OPERATION_NOT_SUPPORTED=void 0;var Xwt=KA();zA.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var r8=y(rn=>{"use strict";p();u();l();Object.defineProperty(rn,"__esModule",{value:!0});rn.wrapFieldResolver=rn.wrapFields=rn.getSourceFromLocation=rn.getOperation=rn.endSpan=rn.addSpanSource=rn.addInputVariableAttributes=rn.isPromise=void 0;var ed=(U(),D(J)),nc=oM(),Zp=sM(),Vi=KA(),VQ=Object.values(nc.AllowedOperationTypes),W1e=t=>typeof t?.then=="function";rn.isPromise=W1e;var K1e=t=>typeof t=="object"&&t!==null;function iM(t,e,n){Array.isArray(n)?n.forEach((r,o)=>{iM(t,`${e}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{iM(t,`${e}.${r}`,o)}):t.setAttribute(`${Zp.AttributeNames.VARIABLES}${String(e)}`,n)}function z1e(t,e){Object.entries(e).forEach(([n,r])=>{iM(t,n,r)})}rn.addInputVariableAttributes=z1e;function KQ(t,e,n,r,o){let s=ZQ(e,n,r,o);t.setAttribute(Zp.AttributeNames.SOURCE,s)}rn.addSpanSource=KQ;function X1e(t,e,n,r,o){let s=zQ(n,o);if(s)return{field:s,spanAdded:!1};let a=e().flatResolveSpans?QQ(n):XQ(n,o);return s={span:Q1e(t,e,n,r,o,a)},eje(n,o,s),{field:s,spanAdded:!0}}function Q1e(t,e,n,r,o,s){let i={[Zp.AttributeNames.FIELD_NAME]:r.fieldName,[Zp.AttributeNames.FIELD_PATH]:o.join("."),[Zp.AttributeNames.FIELD_TYPE]:r.returnType.toString()},a=t.startSpan(`${nc.SpanNames.RESOLVE} ${i[Zp.AttributeNames.FIELD_PATH]}`,{attributes:i},s?ed.trace.setSpan(ed.context.active(),s):void 0),c=n[Vi.OTEL_GRAPHQL_DATA_SYMBOL].source,d=r.fieldNodes.find(f=>f.kind==="Field");return d&&KQ(a,c.loc,e().allowValues,d.loc?.start,d.loc?.end),a}function J1e(t,e){e&&t.recordException(e),t.end()}rn.endSpan=J1e;function Z1e(t,e){if(!(!t||!Array.isArray(t.definitions)))return e?t.definitions.filter(n=>VQ.indexOf(n?.operation)!==-1).find(n=>e===n?.name?.value):t.definitions.find(n=>VQ.indexOf(n?.operation)!==-1)}rn.getOperation=Z1e;function eje(t,e,n){return t[Vi.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]=n}function zQ(t,e){return t[Vi.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]}function XQ(t,e){for(let n=e.length-1;n>0;n--){let r=zQ(t,e.slice(0,n));if(r)return r.span}return QQ(t)}function QQ(t){return t[Vi.OTEL_GRAPHQL_DATA_SYMBOL].span}function tje(t,e){let n=[],r=e;for(;r;){let o=r.key;t&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function nje(t){return JQ(`
|
|
63
63
|
`,t)}function qQ(t){return JQ(" ",t)}function JQ(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}var rje=[nc.TokenKind.FLOAT,nc.TokenKind.STRING,nc.TokenKind.INT,nc.TokenKind.BLOCK_STRING];function ZQ(t,e=!1,n,r){let o="";if(t?.startToken){let s=typeof n=="number"?n:t.start,i=typeof r=="number"?r:t.end,a=t.startToken.next,c=1;for(;a;){if(a.start<s){a=a.next,c=a?.line;continue}if(a.end>i){a=a.next,c=a?.line;continue}let d=a.value||a.kind,f="";!e&&rje.indexOf(a.kind)>=0&&(d="*"),a.kind===nc.TokenKind.STRING&&(d=`"${d}"`),a.kind===nc.TokenKind.EOF&&(d=""),a.line>c?(o+=nje(a.line-c),c=a.line,f=qQ(a.column-1)):a.line===a.prev?.line&&(f=qQ(a.start-(a.prev?.end||0))),o+=f+d,a&&(a=a.next)}}return o}rn.getSourceFromLocation=ZQ;function e8(t,e,n){if(!t||t[Vi.OTEL_PATCHED_SYMBOL])return;let r=t.getFields();t[Vi.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let s=r[o];if(s&&(s.resolve&&(s.resolve=n8(e,n,s.resolve)),s.type)){let i=t8(s.type);for(let a of i)e8(a,e,n)}})}rn.wrapFields=e8;function t8(t){return"ofType"in t?t8(t.ofType):oje(t)?t.getTypes():sje(t)?[t]:[]}function oje(t){return"getTypes"in t&&typeof t.getTypes=="function"}function sje(t){return"getFields"in t&&typeof t.getFields=="function"}var YQ=(t,e,n)=>{n&&(t.recordException(e),t.setStatus({code:ed.SpanStatusCode.ERROR,message:e.message}),t.end())},WQ=(t,e)=>{e&&t.end()};function n8(t,e,n,r=!1){if(o[Vi.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(s,i,a,c){if(!n)return;let d=e();if(d.ignoreTrivialResolveSpans&&r&&(K1e(s)||typeof s=="function")&&typeof s[c.fieldName]!="function")return n.call(this,s,i,a,c);if(!a[Vi.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,s,i,a,c);let f=tje(d.mergeItems,c&&c.path),m=f.filter(T=>typeof T=="string").length,_,g=!1;if(d.depth>=0&&d.depth<m)_=XQ(a,f);else{let{field:T,spanAdded:A}=X1e(t,e,a,c,f);_=T.span,g=A}return ed.context.with(ed.trace.setSpan(ed.context.active(),_),()=>{try{let T=n.call(this,s,i,a,c);return(0,rn.isPromise)(T)?T.then(A=>(WQ(_,g),A),A=>{throw YQ(_,A,g),A}):(WQ(_,g),T)}catch(T){throw YQ(_,T,g),T}})}return o[Vi.OTEL_PATCHED_SYMBOL]=!0,o}rn.wrapFieldResolver=n8});var o8=y(td=>{"use strict";p();u();l();Object.defineProperty(td,"__esModule",{value:!0});td.PACKAGE_NAME=td.PACKAGE_VERSION=void 0;td.PACKAGE_VERSION="0.58.0";td.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var a8=y(JA=>{"use strict";p();u();l();Object.defineProperty(JA,"__esModule",{value:!0});JA.GraphQLInstrumentation=void 0;var qi=(U(),D(J)),Mo=he(),Y_=oM(),XA=sM(),aM=KA(),ije=HQ(),$n=r8(),s8=o8(),i8={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},QA=[">=14.0.0 <17"],cM=class extends Mo.InstrumentationBase{constructor(e={}){super(s8.PACKAGE_NAME,s8.PACKAGE_VERSION,{...i8,...e})}setConfig(e={}){super.setConfig({...i8,...e})}init(){let e=new Mo.InstrumentationNodeModuleDefinition("graphql",QA);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new Mo.InstrumentationNodeModuleFile("graphql/execution/execute.js",QA,e=>((0,Mo.isWrapped)(e.execute)&&this._unwrap(e,"execute"),this._wrap(e,"execute",this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,"execute")})}_addPatchingParser(){return new Mo.InstrumentationNodeModuleFile("graphql/language/parser.js",QA,e=>((0,Mo.isWrapped)(e.parse)&&this._unwrap(e,"parse"),this._wrap(e,"parse",this._patchParse()),e),e=>{e&&this._unwrap(e,"parse")})}_addPatchingValidate(){return new Mo.InstrumentationNodeModuleFile("graphql/validation/validate.js",QA,e=>((0,Mo.isWrapped)(e.validate)&&this._unwrap(e,"validate"),this._wrap(e,"validate",this._patchValidate()),e),e=>{e&&this._unwrap(e,"validate")})}_patchExecute(e){let n=this;return function(o){return function(){let i;if(arguments.length>=2){let d=arguments;i=n._wrapExecuteArgs(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],e)}else{let d=arguments[0];i=n._wrapExecuteArgs(d.schema,d.document,d.rootValue,d.contextValue,d.variableValues,d.operationName,d.fieldResolver,d.typeResolver,e)}let a=(0,$n.getOperation)(i.document,i.operationName),c=n._createExecuteSpan(a,i);return i.contextValue[aM.OTEL_GRAPHQL_DATA_SYMBOL]={source:i.document?i.document||i.document[aM.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:c,fields:{}},qi.context.with(qi.trace.setSpan(qi.context.active(),c),()=>(0,Mo.safeExecuteInTheMiddle)(()=>o.apply(this,[i]),(d,f)=>{n._handleExecutionResult(c,d,f)}))}}}_handleExecutionResult(e,n,r){let o=this.getConfig();if(r===void 0||n){(0,$n.endSpan)(e,n);return}if((0,$n.isPromise)(r))r.then(s=>{if(typeof o.responseHook!="function"){(0,$n.endSpan)(e);return}this._executeResponseHook(e,s)},s=>{(0,$n.endSpan)(e,s)});else{if(typeof o.responseHook!="function"){(0,$n.endSpan)(e);return}this._executeResponseHook(e,r)}}_executeResponseHook(e,n){let{responseHook:r}=this.getConfig();r&&(0,Mo.safeExecuteInTheMiddle)(()=>{r(e,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,$n.endSpan)(e,void 0)},!0)}_patchParse(){let e=this;return function(r){return function(s,i){return e._parse(this,r,s,i)}}}_patchValidate(){let e=this;return function(r){return function(s,i,a,c,d){return e._validate(this,r,s,i,a,d,c)}}}_parse(e,n,r,o){let s=this.getConfig(),i=this.tracer.startSpan(Y_.SpanNames.PARSE);return qi.context.with(qi.trace.setSpan(qi.context.active(),i),()=>(0,Mo.safeExecuteInTheMiddle)(()=>n.call(e,r,o),(a,c)=>{c&&((0,$n.getOperation)(c)?c.loc&&(0,$n.addSpanSource)(i,c.loc,s.allowValues):i.updateName(Y_.SpanNames.SCHEMA_PARSE)),(0,$n.endSpan)(i,a)}))}_validate(e,n,r,o,s,i,a){let c=this.tracer.startSpan(Y_.SpanNames.VALIDATE,{});return qi.context.with(qi.trace.setSpan(qi.context.active(),c),()=>(0,Mo.safeExecuteInTheMiddle)(()=>n.call(e,r,o,s,a,i),(d,f)=>{o.loc||c.updateName(Y_.SpanNames.SCHEMA_VALIDATE),f&&f.length&&c.recordException({name:XA.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(f)}),(0,$n.endSpan)(c,d)}))}_createExecuteSpan(e,n){let r=this.getConfig(),o=this.tracer.startSpan(Y_.SpanNames.EXECUTE,{});if(e){let{operation:s,name:i}=e;o.setAttribute(XA.AttributeNames.OPERATION_TYPE,s);let a=i?.value;a?(o.setAttribute(XA.AttributeNames.OPERATION_NAME,a),o.updateName(`${s} ${a}`)):o.updateName(s)}else{let s=" ";n.operationName&&(s=` "${n.operationName}" `),s=ije.OPERATION_NOT_SUPPORTED.replace("$operationName$",s),o.setAttribute(XA.AttributeNames.OPERATION_NAME,s)}return n.document?.loc&&(0,$n.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,$n.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(e,n,r,o,s,i,a,c,d){if(o||(o={}),o[aM.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c};let f=a==null,m=a??d;return a=(0,$n.wrapFieldResolver)(this.tracer,()=>this.getConfig(),m,f),e&&((0,$n.wrapFields)(e.getQueryType(),this.tracer,()=>this.getConfig()),(0,$n.wrapFields)(e.getMutationType(),this.tracer,()=>this.getConfig())),{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c}}};JA.GraphQLInstrumentation=cM});var c8=y(ZA=>{"use strict";p();u();l();Object.defineProperty(ZA,"__esModule",{value:!0});ZA.GraphQLInstrumentation=void 0;var aje=a8();Object.defineProperty(ZA,"GraphQLInstrumentation",{enumerable:!0,get:function(){return aje.GraphQLInstrumentation}})});function f8(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}function uje(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}var u8,l8,p8,cje,d8,m8=S(()=>{p();u();l();U();u8=j(c8(),1);ne();je();za();l8="Graphql",p8=Z(l8,u8.GraphQLInstrumentation,t=>{let e=f8(t);return{...e,responseHook(n,r){Ve(n,"auto.graphql.otel.graphql"),r.errors?.length&&!ae(n).status&&n.setStatus({code:it.ERROR});let s=ae(n).data,i=s["graphql.operation.type"],a=s["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let c=ft(n),f=ae(c).data[Bp]||[],m=a?`${i} ${a}`:`${i}`;Array.isArray(f)?(f.push(m),c.setAttribute(Bp,f)):typeof f=="string"?c.setAttribute(Bp,[f,m]):c.setAttribute(Bp,m),ae(c).data["original-description"]||c.setAttribute("original-description",ae(c).description),c.updateName(`${ae(c).data["original-description"]} (${uje(f)})`)}}}}),cje=((t={})=>({name:l8,setupOnce(){p8(f8(t))}})),d8=cje});var _8=y(ey=>{"use strict";p();u();l();Object.defineProperty(ey,"__esModule",{value:!0});ey.EVENT_LISTENERS_SET=void 0;ey.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var h8=y(ty=>{"use strict";p();u();l();Object.defineProperty(ty,"__esModule",{value:!0});ty.bufferTextMapGetter=void 0;ty.bufferTextMapGetter={get(t,e){if(!t)return;let n=Object.keys(t);for(let r of n)if(r===e||r.toLowerCase()===e)return t[r]?.toString()},keys(t){return t?Object.keys(t):[]}}});var g8=y(we=>{"use strict";p();u();l();Object.defineProperty(we,"__esModule",{value:!0});we.METRIC_MESSAGING_PROCESS_DURATION=we.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=we.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=we.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=we.MESSAGING_SYSTEM_VALUE_KAFKA=we.MESSAGING_OPERATION_TYPE_VALUE_SEND=we.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=we.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=we.ATTR_MESSAGING_SYSTEM=we.ATTR_MESSAGING_OPERATION_TYPE=we.ATTR_MESSAGING_OPERATION_NAME=we.ATTR_MESSAGING_KAFKA_OFFSET=we.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=we.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=we.ATTR_MESSAGING_DESTINATION_PARTITION_ID=we.ATTR_MESSAGING_DESTINATION_NAME=we.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;we.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";we.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";we.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";we.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";we.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";we.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";we.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";we.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";we.ATTR_MESSAGING_SYSTEM="messaging.system";we.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";we.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";we.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";we.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";we.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";we.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";we.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";we.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var E8=y(nd=>{"use strict";p();u();l();Object.defineProperty(nd,"__esModule",{value:!0});nd.PACKAGE_NAME=nd.PACKAGE_VERSION=void 0;nd.PACKAGE_VERSION="0.20.0";nd.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var I8=y(ry=>{"use strict";p();u();l();Object.defineProperty(ry,"__esModule",{value:!0});ry.KafkaJsInstrumentation=void 0;var We=(U(),D(J)),Lo=he(),rd=(Le(),D(Xe)),T8=_8(),S8=h8(),te=g8(),A8=E8();function ny(t,e,n){return r=>{t.add(e,{...n,...r?{[rd.ATTR_ERROR_TYPE]:r}:{}})}}function y8(t,e,n){return r=>{t.record((Date.now()-e)/1e3,{...n,...r?{[rd.ATTR_ERROR_TYPE]:r}:{}})}}var R8=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],uM=class extends Lo.InstrumentationBase{constructor(e={}){super(A8.PACKAGE_NAME,A8.PACKAGE_VERSION,e)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(te.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:R8}}),this._sentMessages=this.meter.createCounter(te.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(te.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(te.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:R8}})}init(){let e=r=>{(0,Lo.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,Lo.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new Lo.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],r=>(e(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),e)}_getConsumerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,Lo.isWrapped)(s.run)&&e._unwrap(s,"run"),e._wrap(s,"run",e._getConsumerRunPatch()),e._setKafkaEventListeners(s),s}}_setKafkaEventListeners(e){e[T8.EVENT_LISTENERS_SET]||(e.events?.REQUEST&&e.on(e.events.REQUEST,this._recordClientDurationMetric.bind(this)),e[T8.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(e){let[n,r]=e.payload.broker.split(":");this._clientDuration.record(e.payload.duration/1e3,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:`${e.payload.apiName}`,[rd.ATTR_SERVER_ADDRESS]:n,[rd.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,Lo.isWrapped)(s.sendBatch)&&e._unwrap(s,"sendBatch"),e._wrap(s,"sendBatch",e._getSendBatchPatch()),(0,Lo.isWrapped)(s.send)&&e._unwrap(s,"send"),e._wrap(s,"send",e._getSendPatch()),(0,Lo.isWrapped)(s.transaction)&&e._unwrap(s,"transaction"),e._wrap(s,"transaction",e._getProducerTransactionPatch()),e._setKafkaEventListeners(s),s}}_getConsumerRunPatch(){let e=this;return n=>function(...o){let s=o[0];return s?.eachMessage&&((0,Lo.isWrapped)(s.eachMessage)&&e._unwrap(s,"eachMessage"),e._wrap(s,"eachMessage",e._getConsumerEachMessagePatch())),s?.eachBatch&&((0,Lo.isWrapped)(s.eachBatch)&&e._unwrap(s,"eachBatch"),e._wrap(s,"eachBatch",e._getConsumerEachBatchPatch())),n.call(this,s)}}_getConsumerEachMessagePatch(){let e=this;return n=>function(...o){let s=o[0],i=We.propagation.extract(We.ROOT_CONTEXT,s.message.headers,S8.bufferTextMapGetter),a=e._startConsumerSpan({topic:s.topic,message:s.message,operationType:te.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:i,attributes:{[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}}),c=[y8(e._processDuration,Date.now(),{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"process",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}),ny(e._consumedMessages,1,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"process",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)})],d=We.context.with(We.trace.setSpan(i,a),()=>n.apply(this,o));return e._endSpansOnPromise([a],c,d)}}_getConsumerEachBatchPatch(){return e=>{let n=this;return function(...o){let s=o[0],i=n._startConsumerSpan({topic:s.batch.topic,message:void 0,operationType:te.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:We.ROOT_CONTEXT,attributes:{[te.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:s.batch.messages.length,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}});return We.context.with(We.trace.setSpan(We.context.active(),i),()=>{let a=Date.now(),c=[],d=[ny(n._consumedMessages,s.batch.messages.length,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"process",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)})];s.batch.messages.forEach(m=>{let _=We.propagation.extract(We.ROOT_CONTEXT,m.headers,S8.bufferTextMapGetter),g=We.trace.getSpan(_)?.spanContext(),T;g&&(T={context:g}),c.push(n._startConsumerSpan({topic:s.batch.topic,message:m,operationType:te.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:T,attributes:{[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}})),d.push(y8(n._processDuration,a,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"process",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}))});let f=e.apply(this,o);return c.unshift(i),n._endSpansOnPromise(c,d,f)})}}}_getProducerTransactionPatch(){let e=this;return n=>function(...o){let s=e.tracer.startSpan("transaction"),i=n.apply(this,o);return i.then(a=>{let c=a.send;a.send=function(...g){return We.context.with(We.trace.setSpan(We.context.active(),s),()=>e._getSendPatch()(c).apply(this,g).catch(A=>{throw s.setStatus({code:We.SpanStatusCode.ERROR,message:A?.message}),s.recordException(A),A}))};let d=a.sendBatch;a.sendBatch=function(...g){return We.context.with(We.trace.setSpan(We.context.active(),s),()=>e._getSendBatchPatch()(d).apply(this,g).catch(A=>{throw s.setStatus({code:We.SpanStatusCode.ERROR,message:A?.message}),s.recordException(A),A}))};let f=a.commit;a.commit=function(...g){let T=f.apply(this,g).then(()=>{s.setStatus({code:We.SpanStatusCode.OK})});return e._endSpansOnPromise([s],[],T)};let m=a.abort;a.abort=function(...g){let T=m.apply(this,g);return e._endSpansOnPromise([s],[],T)}}).catch(a=>{s.setStatus({code:We.SpanStatusCode.ERROR,message:a?.message}),s.recordException(a),s.end()}),i}}_getSendBatchPatch(){let e=this;return n=>function(...o){let i=o[0].topicMessages||[],a=[],c=[];i.forEach(f=>{f.messages.forEach(m=>{a.push(e._startProducerSpan(f.topic,m)),c.push(ny(e._sentMessages,1,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"send",[te.ATTR_MESSAGING_DESTINATION_NAME]:f.topic,...m.partition!==void 0?{[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(m.partition)}:{}}))})});let d=n.apply(this,o);return e._endSpansOnPromise(a,c,d)}}_getSendPatch(){let e=this;return n=>function(...o){let s=o[0],i=s.messages.map(d=>e._startProducerSpan(s.topic,d)),a=s.messages.map(d=>ny(e._sentMessages,1,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"send",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,...d.partition!==void 0?{[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(d.partition)}:{}})),c=n.apply(this,o);return e._endSpansOnPromise(i,a,c)}}_endSpansOnPromise(e,n,r){return Promise.resolve(r).then(o=>(n.forEach(s=>s()),o)).catch(o=>{let s,i=rd.ERROR_TYPE_VALUE_OTHER;throw typeof o=="string"||o===void 0?s=o:typeof o=="object"&&Object.prototype.hasOwnProperty.call(o,"message")&&(s=o.message,i=o.constructor.name),n.forEach(a=>a(i)),e.forEach(a=>{a.setAttribute(rd.ATTR_ERROR_TYPE,i),a.setStatus({code:We.SpanStatusCode.ERROR,message:s})}),o}).finally(()=>{e.forEach(o=>o.end())})}_startConsumerSpan({topic:e,message:n,operationType:r,ctx:o,link:s,attributes:i}){let a=r===te.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,c=this.tracer.startSpan(`${a} ${e}`,{kind:r===te.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?We.SpanKind.CLIENT:We.SpanKind.CONSUMER,attributes:{...i,[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_DESTINATION_NAME]:e,[te.ATTR_MESSAGING_OPERATION_TYPE]:r,[te.ATTR_MESSAGING_OPERATION_NAME]:a,[te.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[te.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[te.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:s?[s]:[]},o),{consumerHook:d}=this.getConfig();return d&&n&&(0,Lo.safeExecuteInTheMiddle)(()=>d(c,{topic:e,message:n}),f=>{f&&this._diag.error("consumerHook error",f)},!0),c}_startProducerSpan(e,n){let r=this.tracer.startSpan(`send ${e}`,{kind:We.SpanKind.PRODUCER,attributes:{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_DESTINATION_NAME]:e,[te.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[te.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[te.ATTR_MESSAGING_OPERATION_NAME]:"send",[te.ATTR_MESSAGING_OPERATION_TYPE]:te.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},We.propagation.inject(We.trace.setSpan(We.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,Lo.safeExecuteInTheMiddle)(()=>o(r,{topic:e,message:n}),s=>{s&&this._diag.error("producerHook error",s)},!0),r}};ry.KafkaJsInstrumentation=uM});var N8=y(oy=>{"use strict";p();u();l();Object.defineProperty(oy,"__esModule",{value:!0});oy.KafkaJsInstrumentation=void 0;var lje=I8();Object.defineProperty(oy,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return lje.KafkaJsInstrumentation}})});var b8,O8,C8,pje,P8,x8=S(()=>{p();u();l();b8=j(N8(),1);je();O8="Kafka",C8=Z(O8,()=>new b8.KafkaJsInstrumentation({consumerHook(t){Ve(t,"auto.kafkajs.otel.consumer")},producerHook(t){Ve(t,"auto.kafkajs.otel.producer")}})),pje=(()=>({name:O8,setupOnce(){C8()}})),P8=pje});var v8=y(od=>{"use strict";p();u();l();Object.defineProperty(od,"__esModule",{value:!0});od.PACKAGE_NAME=od.PACKAGE_VERSION=void 0;od.PACKAGE_VERSION="0.55.0";od.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var D8=y(sy=>{"use strict";p();u();l();Object.defineProperty(sy,"__esModule",{value:!0});sy.LruMemoizerInstrumentation=void 0;var M8=(U(),D(J)),L8=he(),w8=v8(),lM=class extends L8.InstrumentationBase{constructor(e={}){super(w8.PACKAGE_NAME,w8.PACKAGE_VERSION,e)}init(){return[new L8.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <3"],e=>{let n=function(){let r=e.apply(this,arguments);return function(){let o=[...arguments],s=o.pop(),i=typeof s=="function"?M8.context.bind(M8.context.active(),s):s;return o.push(i),r.apply(this,o)}};return n.sync=e.sync,n},void 0)]}};sy.LruMemoizerInstrumentation=lM});var U8=y(iy=>{"use strict";p();u();l();Object.defineProperty(iy,"__esModule",{value:!0});iy.LruMemoizerInstrumentation=void 0;var dje=D8();Object.defineProperty(iy,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return dje.LruMemoizerInstrumentation}})});var k8,j8,G8,fje,B8,$8=S(()=>{p();u();l();k8=j(U8(),1);je();j8="LruMemoizer",G8=Z(j8,()=>new k8.LruMemoizerInstrumentation),fje=(()=>({name:j8,setupOnce(){G8()}})),B8=fje});var F8=y(ct=>{"use strict";p();u();l();Object.defineProperty(ct,"__esModule",{value:!0});ct.METRIC_DB_CLIENT_CONNECTIONS_USAGE=ct.DB_SYSTEM_VALUE_MONGODB=ct.DB_SYSTEM_NAME_VALUE_MONGODB=ct.ATTR_NET_PEER_PORT=ct.ATTR_NET_PEER_NAME=ct.ATTR_DB_SYSTEM=ct.ATTR_DB_STATEMENT=ct.ATTR_DB_OPERATION=ct.ATTR_DB_NAME=ct.ATTR_DB_MONGODB_COLLECTION=ct.ATTR_DB_CONNECTION_STRING=void 0;ct.ATTR_DB_CONNECTION_STRING="db.connection_string";ct.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";ct.ATTR_DB_NAME="db.name";ct.ATTR_DB_OPERATION="db.operation";ct.ATTR_DB_STATEMENT="db.statement";ct.ATTR_DB_SYSTEM="db.system";ct.ATTR_NET_PEER_NAME="net.peer.name";ct.ATTR_NET_PEER_PORT="net.peer.port";ct.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";ct.DB_SYSTEM_VALUE_MONGODB="mongodb";ct.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var H8=y(W_=>{"use strict";p();u();l();Object.defineProperty(W_,"__esModule",{value:!0});W_.MongodbCommandType=void 0;var mje;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.AGGREGATE="aggregate",t.UNKNOWN="unknown"})(mje=W_.MongodbCommandType||(W_.MongodbCommandType={}))});var V8=y(sd=>{"use strict";p();u();l();Object.defineProperty(sd,"__esModule",{value:!0});sd.PACKAGE_NAME=sd.PACKAGE_VERSION=void 0;sd.PACKAGE_VERSION="0.64.0";sd.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var W8=y(ay=>{"use strict";p();u();l();Object.defineProperty(ay,"__esModule",{value:!0});ay.MongoDBInstrumentation=void 0;var _t=(U(),D(J)),De=he(),Yi=(Le(),D(Xe)),ro=F8(),ku=H8(),q8=V8(),Y8={requireParentSpan:!0},pM=class t extends De.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(q8.PACKAGE_NAME,q8.PACKAGE_VERSION,{...Y8,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,De.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,De.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...Y8,...e})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(ro.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsage?.add(e,{"pool.name":n,state:r})}init(){let{v3PatchConnection:e,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:s,v4PatchConnectionPromise:i,v4UnpatchConnection:a}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:c,v4UnpatchConnectionPool:d}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:f,v4UnpatchSessions:m}=this._getV4SessionsPatches();return[new De.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new De.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],e,n)]),new De.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new De.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],s,a),new De.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],i,a),new De.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],c,d),new De.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new De.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],f,m)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>((0,De.isWrapped)(e.insert)&&this._unwrap(e,"insert"),this._wrap(e,"insert",this._getV3PatchOperation("insert")),(0,De.isWrapped)(e.remove)&&this._unwrap(e,"remove"),this._wrap(e,"remove",this._getV3PatchOperation("remove")),(0,De.isWrapped)(e.update)&&this._unwrap(e,"update"),this._wrap(e,"update",this._getV3PatchOperation("update")),(0,De.isWrapped)(e.command)&&this._unwrap(e,"command"),this._wrap(e,"command",this._getV3PatchCommand()),(0,De.isWrapped)(e.query)&&this._unwrap(e,"query"),this._wrap(e,"query",this._getV3PatchFind()),(0,De.isWrapped)(e.getMore)&&this._unwrap(e,"getMore"),this._wrap(e,"getMore",this._getV3PatchCursor()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,"insert"),this._unwrap(e,"remove"),this._unwrap(e,"update"),this._unwrap(e,"command"),this._unwrap(e,"query"),this._unwrap(e,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:e=>((0,De.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),this._wrap(e.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,De.isWrapped)(e.release)&&this._unwrap(e,"release"),this._wrap(e.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),e),v4UnpatchSessions:e=>{e!==void 0&&((0,De.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),(0,De.isWrapped)(e.release)&&this._unwrap(e,"release"))}}}_getV4AcquireCommand(){let e=this;return n=>function(){let o=this.sessions.length,s=n.call(this),i=this.sessions.length;return o===i?e._connCountAdd(1,e._poolName,"used"):o-1===i&&(e._connCountAdd(-1,e._poolName,"idle"),e._connCountAdd(1,e._poolName,"used")),s}}_getV4ReleaseCommand(){let e=this;return n=>function(o){let s=n.call(this,o);return e._connCountAdd(-1,e._poolName,"used"),e._connCountAdd(1,e._poolName,"idle"),s}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let n=e.ConnectionPool.prototype;return(0,De.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:e=>((0,De.isWrapped)(e.connect)&&this._unwrap(e,"connect"),this._wrap(e,"connect",this._getV4ConnectCommand()),e),v4UnpatchConnect:e=>{e!==void 0&&this._unwrap(e,"connect")}}}_getV4ConnectionPoolCheckOut(){return e=>function(r){let o=_t.context.bind(_t.context.active(),r);return e.call(this,o)}}_getV4ConnectCommand(){let e=this;return n=>function(o,s){if(n.length===1){let a=n.call(this,o);return a&&typeof a.then=="function"&&a.then(()=>e.setPoolName(o),()=>{}),a}let i=function(a,c){if(a||!c){s(a,c);return}e.setPoolName(o),s(a,c)};return n.call(this,o,i)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>((0,De.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandCallback()),e),v4PatchConnectionPromise:e=>((0,De.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandPromise()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,"command")}}}_getV3PatchOperation(e){let n=this;return r=>function(s,i,a,c,d){let f=_t.trace.getSpan(_t.context.active()),m=n._checkSkipInstrumentation(f),_=typeof c=="function"?c:d;if(m||typeof _!="function"||typeof a!="object")return typeof c=="function"?r.call(this,s,i,a,c):r.call(this,s,i,a,c,d);let g=n._getV3SpanAttributes(i,s,a[0],e),T=n._spanNameFromAttrs(g),A=n.tracer.startSpan(T,{kind:_t.SpanKind.CLIENT,attributes:g}),R=n._patchEnd(A,_);return typeof c=="function"?r.call(this,s,i,a,R):r.call(this,s,i,a,c,R)}}_getV3PatchCommand(){let e=this;return n=>function(o,s,i,a,c){let d=_t.trace.getSpan(_t.context.active()),f=e._checkSkipInstrumentation(d),m=typeof a=="function"?a:c;if(f||typeof m!="function"||typeof i!="object")return typeof a=="function"?n.call(this,o,s,i,a):n.call(this,o,s,i,a,c);let _=t._getCommandType(i),g=_===ku.MongodbCommandType.UNKNOWN?void 0:_,T=e._getV3SpanAttributes(s,o,i,g),A=e._spanNameFromAttrs(T),R=e.tracer.startSpan(A,{kind:_t.SpanKind.CLIENT,attributes:T}),b=e._patchEnd(R,m);return typeof a=="function"?n.call(this,o,s,i,b):n.call(this,o,s,i,a,b)}}_getV4PatchCommandCallback(){let e=this;return n=>function(o,s,i,a){let c=_t.trace.getSpan(_t.context.active()),d=e._checkSkipInstrumentation(c),f=a,m=Object.keys(s)[0];if(typeof s!="object"||s.ismaster||s.hello)return n.call(this,o,s,i,a);let _;if(!d){let T=e._getV4SpanAttributes(this,o,s,m),A=e._spanNameFromAttrs(T);_=e.tracer.startSpan(A,{kind:_t.SpanKind.CLIENT,attributes:T})}let g=e._patchEnd(_,f,this.id,m);return n.call(this,o,s,i,g)}}_getV4PatchCommandPromise(){let e=this;return n=>function(...o){let[s,i]=o,a=_t.trace.getSpan(_t.context.active()),c=e._checkSkipInstrumentation(a),d=Object.keys(i)[0],f=()=>{};if(typeof i!="object"||i.ismaster||i.hello)return n.apply(this,o);let m;if(!c){let T=e._getV4SpanAttributes(this,s,i,d),A=e._spanNameFromAttrs(T);m=e.tracer.startSpan(A,{kind:_t.SpanKind.CLIENT,attributes:T})}let _=e._patchEnd(m,f,this.id,d),g=n.apply(this,o);return g.then(T=>_(null,T),T=>_(T)),g}}_getV3PatchFind(){let e=this;return n=>function(o,s,i,a,c,d){let f=_t.trace.getSpan(_t.context.active()),m=e._checkSkipInstrumentation(f),_=typeof c=="function"?c:d;if(m||typeof _!="function"||typeof i!="object")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,d);let g=e._getV3SpanAttributes(s,o,i,"find"),T=e._spanNameFromAttrs(g),A=e.tracer.startSpan(T,{kind:_t.SpanKind.CLIENT,attributes:g}),R=e._patchEnd(A,_);return typeof c=="function"?n.call(this,o,s,i,a,R):n.call(this,o,s,i,a,c,R)}}_getV3PatchCursor(){let e=this;return n=>function(o,s,i,a,c,d){let f=_t.trace.getSpan(_t.context.active()),m=e._checkSkipInstrumentation(f),_=typeof c=="function"?c:d;if(m||typeof _!="function")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,d);let g=e._getV3SpanAttributes(s,o,i.cmd,"getMore"),T=e._spanNameFromAttrs(g),A=e.tracer.startSpan(T,{kind:_t.SpanKind.CLIENT,attributes:g}),R=e._patchEnd(A,_);return typeof c=="function"?n.call(this,o,s,i,a,R):n.call(this,o,s,i,a,c,R)}}static _getCommandType(e){return e.createIndexes!==void 0?ku.MongodbCommandType.CREATE_INDEXES:e.findandmodify!==void 0?ku.MongodbCommandType.FIND_AND_MODIFY:e.ismaster!==void 0?ku.MongodbCommandType.IS_MASTER:e.count!==void 0?ku.MongodbCommandType.COUNT:e.aggregate!==void 0?ku.MongodbCommandType.AGGREGATE:ku.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(e,n,r,o){let s,i;if(e){let c=typeof e.address=="string"?e.address.split(":"):"";c.length===2&&(s=c[0],i=c[1])}let a;return r?.documents&&r.documents[0]?a=r.documents[0]:r?.cursors?a=r.cursors:a=r,this._getSpanAttributes(n.db,n.collection,s,i,a,o)}_getV3SpanAttributes(e,n,r,o){let s,i;if(n&&n.s&&(s=n.s.options?.host??n.s.host,i=(n.s.options?.port??n.s.port)?.toString(),s==null||i==null)){let f=n.description?.address;if(f){let m=f.split(":");s=m[0],i=m[1]}}let[a,c]=e.toString().split("."),d=r?.query??r?.q??r;return this._getSpanAttributes(a,c,s,i,d,o)}_getSpanAttributes(e,n,r,o,s,i){let a={};if(this._dbSemconvStability&De.SemconvStability.OLD&&(a[ro.ATTR_DB_SYSTEM]=ro.DB_SYSTEM_VALUE_MONGODB,a[ro.ATTR_DB_NAME]=e,a[ro.ATTR_DB_MONGODB_COLLECTION]=n,a[ro.ATTR_DB_OPERATION]=i,a[ro.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${e}`),this._dbSemconvStability&De.SemconvStability.STABLE&&(a[Yi.ATTR_DB_SYSTEM_NAME]=ro.DB_SYSTEM_NAME_VALUE_MONGODB,a[Yi.ATTR_DB_NAMESPACE]=e,a[Yi.ATTR_DB_OPERATION_NAME]=i,a[Yi.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&De.SemconvStability.OLD&&(a[ro.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&De.SemconvStability.STABLE&&(a[Yi.ATTR_SERVER_ADDRESS]=r);let c=parseInt(o,10);isNaN(c)||(this._netSemconvStability&De.SemconvStability.OLD&&(a[ro.ATTR_NET_PEER_PORT]=c),this._netSemconvStability&De.SemconvStability.STABLE&&(a[Yi.ATTR_SERVER_PORT]=c))}if(s){let{dbStatementSerializer:c}=this.getConfig(),d=typeof c=="function"?c:this._defaultDbStatementSerializer.bind(this);(0,De.safeExecuteInTheMiddle)(()=>{let f=d(s);this._dbSemconvStability&De.SemconvStability.OLD&&(a[ro.ATTR_DB_STATEMENT]=f),this._dbSemconvStability&De.SemconvStability.STABLE&&(a[Yi.ATTR_DB_QUERY_TEXT]=f)},f=>{f&&this._diag.error("Error running dbStatementSerializer hook",f)},!0)}return a}_spanNameFromAttrs(e){let n;return this._dbSemconvStability&De.SemconvStability.STABLE?n=[e[Yi.ATTR_DB_OPERATION_NAME],e[Yi.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||ro.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${e[ro.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let e=new WeakSet;return(n,r)=>typeof r!="object"||!r?"?":e.has(r)?"[Circular]":(e.add(r),r)}_defaultDbStatementSerializer(e){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(e):JSON.stringify(e,this._getDefaultDbStatementReplacer())}_handleExecutionResult(e,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,De.safeExecuteInTheMiddle)(()=>{r(e,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(e,n,r,o){let s=_t.context.active(),i=this,a=!1;return function(...d){if(!a){a=!0;let f=d[0];if(e){if(f instanceof Error)e.setStatus({code:_t.SpanStatusCode.ERROR,message:f.message});else{let m=d[1];i._handleExecutionResult(e,m)}e.end()}o==="endSessions"&&i._connCountAdd(-1,i._poolName,"idle")}return _t.context.with(s,()=>n.apply(this,d))}}setPoolName(e){let n=e.hostAddress?.host,r=e.hostAddress?.port,o=e.dbName,s=`mongodb://${n}:${r}/${o}`;this._poolName=s}_checkSkipInstrumentation(e){return this.getConfig().requireParentSpan===!0&&e===void 0}};ay.MongoDBInstrumentation=pM});var K8=y(K_=>{"use strict";p();u();l();Object.defineProperty(K_,"__esModule",{value:!0});K_.MongodbCommandType=void 0;var _je;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.UNKNOWN="unknown"})(_je=K_.MongodbCommandType||(K_.MongodbCommandType={}))});var z8=y(id=>{"use strict";p();u();l();Object.defineProperty(id,"__esModule",{value:!0});id.MongodbCommandType=id.MongoDBInstrumentation=void 0;var hje=W8();Object.defineProperty(id,"MongoDBInstrumentation",{enumerable:!0,get:function(){return hje.MongoDBInstrumentation}});var gje=K8();Object.defineProperty(id,"MongodbCommandType",{enumerable:!0,get:function(){return gje.MongodbCommandType}})});function Eje(t){let e=dM(t);return JSON.stringify(e)}function dM(t){if(Array.isArray(t))return t.map(e=>dM(e));if(Tje(t)){let e={};return Object.entries(t).map(([n,r])=>[n,dM(r)]).reduce((n,r)=>(Aje(r)&&(n[r[0]]=r[1]),n),e)}return"?"}function Tje(t){return typeof t=="object"&&t!==null&&!Sje(t)}function Sje(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function Aje(t){return Array.isArray(t)}var X8,Q8,J8,yje,Z8,eJ=S(()=>{p();u();l();X8=j(z8(),1);je();Q8="Mongo",J8=Z(Q8,()=>new X8.MongoDBInstrumentation({dbStatementSerializer:Eje,responseHook(t){Ve(t,"auto.db.otel.mongo")}}));yje=(()=>({name:Q8,setupOnce(){J8()}})),Z8=yje});var fM=y(Yt=>{"use strict";p();u();l();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.DB_SYSTEM_NAME_VALUE_MONGODB=Yt.ATTR_NET_PEER_PORT=Yt.ATTR_NET_PEER_NAME=Yt.ATTR_DB_USER=Yt.ATTR_DB_SYSTEM=Yt.ATTR_DB_STATEMENT=Yt.ATTR_DB_OPERATION=Yt.ATTR_DB_NAME=Yt.ATTR_DB_MONGODB_COLLECTION=void 0;Yt.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Yt.ATTR_DB_NAME="db.name";Yt.ATTR_DB_OPERATION="db.operation";Yt.ATTR_DB_STATEMENT="db.statement";Yt.ATTR_DB_SYSTEM="db.system";Yt.ATTR_DB_USER="db.user";Yt.ATTR_NET_PEER_NAME="net.peer.name";Yt.ATTR_NET_PEER_PORT="net.peer.port";Yt.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var rJ=y(rc=>{"use strict";p();u();l();Object.defineProperty(rc,"__esModule",{value:!0});rc.handleCallbackResponse=rc.handlePromiseResponse=rc.getAttributesFromCollection=void 0;var tJ=(U(),D(J)),X_=he(),z_=fM(),cy=(Le(),D(Xe));function Rje(t,e,n){let r={};return e&X_.SemconvStability.OLD&&(r[z_.ATTR_DB_MONGODB_COLLECTION]=t.name,r[z_.ATTR_DB_NAME]=t.conn.name,r[z_.ATTR_DB_USER]=t.conn.user),e&X_.SemconvStability.STABLE&&(r[cy.ATTR_DB_COLLECTION_NAME]=t.name,r[cy.ATTR_DB_NAMESPACE]=t.conn.name),n&X_.SemconvStability.OLD&&(r[z_.ATTR_NET_PEER_NAME]=t.conn.host,r[z_.ATTR_NET_PEER_PORT]=t.conn.port),n&X_.SemconvStability.STABLE&&(r[cy.ATTR_SERVER_ADDRESS]=t.conn.host,r[cy.ATTR_SERVER_PORT]=t.conn.port),r}rc.getAttributesFromCollection=Rje;function nJ(t,e={}){t.recordException(e),t.setStatus({code:tJ.SpanStatusCode.ERROR,message:`${e.message} ${e.code?`
|
|
64
|
-
Mongoose Error Code: ${e.code}`:""}`})}function mM(t,e,n,r=void 0){n&&(0,X_.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&tJ.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function Ije(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(mM(e,o,n,r),o)).catch(o=>{throw nJ(e,o),o}).finally(()=>e.end()):(mM(e,t,n,r),e.end(),t)}rc.handlePromiseResponse=Ije;function Nje(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2?a=1:o.length===3&&(a=2),o[a]=(c,d)=>(c?nJ(r,c):mM(r,d,s,i),r.end(),t(c,d)),e.apply(n,o)}rc.handleCallbackResponse=Nje});var oJ=y(ad=>{"use strict";p();u();l();Object.defineProperty(ad,"__esModule",{value:!0});ad.PACKAGE_NAME=ad.PACKAGE_VERSION=void 0;ad.PACKAGE_VERSION="0.57.0";ad.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var uJ=y(Dr=>{"use strict";p();u();l();Object.defineProperty(Dr,"__esModule",{value:!0});Dr.MongooseInstrumentation=Dr._ALREADY_INSTRUMENTED=Dr._STORED_PARENT_SPAN=void 0;var on=(U(),D(J)),bje=Be(),_M=rJ(),In=he(),sJ=oJ(),oc=fM(),ju=(Le(),D(Xe)),uy=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],Oje=["remove","count","findOneAndRemove",...uy],Cje=["count","findOneAndRemove",...uy],Pje=[...uy];function iJ(t){return t?t.startsWith("6.")||t.startsWith("5.")?Oje:t.startsWith("7.")?Cje:Pje:uy}function aJ(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}function cJ(t){return!t||!t.startsWith("8.")?!1:parseInt(t.split(".")[1],10)>=21}Dr._STORED_PARENT_SPAN=Symbol("stored-parent-span");Dr._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var hM=class extends In.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(sJ.PACKAGE_NAME,sJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,In.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,In.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new In.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <9"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,aJ(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),cJ(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),iJ(n).forEach(s=>{this._wrap(r.Query.prototype,s,this.patchAndCaptureSpanContext(s))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e,o=iJ(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,aJ(n)&&this._unwrap(r.Model.prototype,"remove"),cJ(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(s=>{this._unwrap(r.Query.prototype,s)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return r.apply(this,arguments);let i=this[Dr._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let f=c("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&In.SemconvStability.OLD&&(a[oc.ATTR_DB_STATEMENT]=f),n._dbSemconvStability&In.SemconvStability.STABLE&&(a[ju.ATTR_DB_QUERY_TEXT]=f)}let d=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(this[Dr._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return r.apply(this,arguments);let i=this[Dr._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let f=c(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&In.SemconvStability.OLD&&(a[oc.ATTR_DB_STATEMENT]=f),n._dbSemconvStability&In.SemconvStability.STABLE&&(a[ju.ATTR_DB_QUERY_TEXT]=f)}let d=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return o.apply(this,arguments);let c={document:this};i&&!(i instanceof Function)&&(c.options=i);let d={},{dbStatementSerializer:f}=r.getConfig();if(f){let _=f(e,c);r._dbSemconvStability&In.SemconvStability.OLD&&(d[oc.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&In.SemconvStability.STABLE&&(d[ju.ATTR_DB_QUERY_TEXT]=_)}let m=r._startSpan(this.constructor.collection,this.constructor.modelName,e,d);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(m,o,this,arguments,a,n)}}_patchDocumentUpdateMethods(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return o.apply(this,arguments);let d=c,f=i,m=a;typeof i=="function"?(d=i,f=void 0,m=void 0):typeof a=="function"&&(d=a,m=void 0);let _={},g=r.getConfig().dbStatementSerializer;if(g){let R=g(e,{condition:{_id:this._id},updates:f,options:m});r._dbSemconvStability&In.SemconvStability.OLD&&(_[oc.ATTR_DB_STATEMENT]=R),r._dbSemconvStability&In.SemconvStability.STABLE&&(_[ju.ATTR_DB_QUERY_TEXT]=R)}let T=r._startSpan(this.constructor.collection,this.constructor.modelName,e,_),A=r._handleResponse(T,o,this,arguments,d,n);return A&&typeof A=="object"&&(A[Dr._ALREADY_INSTRUMENTED]=!0),A}}patchModelStatic(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return o.apply(this,arguments);typeof a=="function"&&(c=a,a=void 0);let d={};switch(e){case"insertMany":d.documents=i;break;case"bulkWrite":d.operations=i;break;default:d.document=i;break}a!==void 0&&(d.options=a);let f={},{dbStatementSerializer:m}=r.getConfig();if(m){let g=m(e,d);r._dbSemconvStability&In.SemconvStability.OLD&&(f[oc.ATTR_DB_STATEMENT]=g),r._dbSemconvStability&In.SemconvStability.STABLE&&(f[ju.ATTR_DB_QUERY_TEXT]=g)}let _=r._startSpan(this.collection,this.modelName,e,f);return r._handleResponse(_,o,this,arguments,c,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=on.trace.getSpan(on.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[Dr._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[Dr._STORED_PARENT_SPAN]=on.trace.getSpan(on.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){let i={...o,...(0,_M.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&In.SemconvStability.OLD&&(i[oc.ATTR_DB_OPERATION]=r,i[oc.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&In.SemconvStability.STABLE&&(i[ju.ATTR_DB_OPERATION_NAME]=r,i[ju.ATTR_DB_SYSTEM_NAME]=oc.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&In.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(a,{kind:on.SpanKind.CLIENT,attributes:i},s?on.trace.setSpan(on.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,_M.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let c=a._callOriginalFunction(()=>n.apply(r,o));return(0,_M.handlePromiseResponse)(c,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?on.context.with((0,bje.suppressTracing)(on.context.active()),e):e()}};Dr.MongooseInstrumentation=hM});var lJ=y(ly=>{"use strict";p();u();l();Object.defineProperty(ly,"__esModule",{value:!0});ly.MongooseInstrumentation=void 0;var xje=uJ();Object.defineProperty(ly,"MongooseInstrumentation",{enumerable:!0,get:function(){return xje.MongooseInstrumentation}})});var pJ,dJ,fJ,vje,mJ,_J=S(()=>{p();u();l();pJ=j(lJ(),1);je();dJ="Mongoose",fJ=Z(dJ,()=>new pJ.MongooseInstrumentation({responseHook(t){Ve(t,"auto.db.otel.mongoose")}})),vje=(()=>({name:dJ,setupOnce(){fJ()}})),mJ=vje});var hJ=y(Wt=>{"use strict";p();u();l();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Wt.DB_SYSTEM_VALUE_MYSQL=Wt.ATTR_NET_PEER_PORT=Wt.ATTR_NET_PEER_NAME=Wt.ATTR_DB_USER=Wt.ATTR_DB_SYSTEM=Wt.ATTR_DB_STATEMENT=Wt.ATTR_DB_NAME=Wt.ATTR_DB_CONNECTION_STRING=void 0;Wt.ATTR_DB_CONNECTION_STRING="db.connection_string";Wt.ATTR_DB_NAME="db.name";Wt.ATTR_DB_STATEMENT="db.statement";Wt.ATTR_DB_SYSTEM="db.system";Wt.ATTR_DB_USER="db.user";Wt.ATTR_NET_PEER_NAME="net.peer.name";Wt.ATTR_NET_PEER_PORT="net.peer.port";Wt.DB_SYSTEM_VALUE_MYSQL="mysql";Wt.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var gJ=y(Q_=>{"use strict";p();u();l();Object.defineProperty(Q_,"__esModule",{value:!0});Q_.AttributeNames=void 0;var Mje;(function(t){t.MYSQL_VALUES="db.mysql.values"})(Mje=Q_.AttributeNames||(Q_.AttributeNames={}))});var EJ=y(Fn=>{"use strict";p();u();l();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.getPoolNameOld=Fn.arrayStringifyHelper=Fn.getSpanName=Fn.getDbValues=Fn.getDbQueryText=Fn.getJDBCString=Fn.getConfig=void 0;function Lje(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}Fn.getConfig=Lje;function wje(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}Fn.getJDBCString=wje;function Dje(t){return typeof t=="string"?t:t.sql}Fn.getDbQueryText=Dje;function Uje(t,e){return gM(typeof t=="string"?e:e||t.values)}Fn.getDbValues=Uje;function kje(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Fn.getSpanName=kje;function gM(t){return t?`[${t.toString()}]`:""}Fn.arrayStringifyHelper=gM;function jje(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}Fn.getPoolNameOld=jje});var TJ=y(cd=>{"use strict";p();u();l();Object.defineProperty(cd,"__esModule",{value:!0});cd.PACKAGE_NAME=cd.PACKAGE_VERSION=void 0;cd.PACKAGE_VERSION="0.57.0";cd.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var AJ=y(py=>{"use strict";p();u();l();Object.defineProperty(py,"__esModule",{value:!0});py.MySQLInstrumentation=void 0;var Ur=(U(),D(J)),wo=he(),ud=(Le(),D(Xe)),Wi=hJ(),Gje=gJ(),Gu=EJ(),SJ=TJ(),EM=class extends wo.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(SJ.PACKAGE_NAME,SJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,wo.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,wo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Wi.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsageOld?.add(e,{state:r,name:n})}init(){return[new wo.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,wo.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,wo.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,wo.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolCallbacks(s,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,c=i-a,d=(0,Gu.getPoolNameOld)(e);r._connCountAdd(-c,d,"used"),r._connCountAdd(-a,d,"idle"),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let c=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),d=a[c].pool;r._setPoolCallbacks(d,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let c=r._getConnectionCallbackPatchFn(s);return n.call(e,c)}if(arguments.length===2&&typeof i=="function"){let c=r._getConnectionCallbackPatchFn(i);return n.call(e,s,c)}if(arguments.length===3&&typeof a=="function"){let c=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,c)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=Ur.context.active();return function(o,s){s&&((0,wo.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&Ur.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a={},{host:c,port:d,database:f,user:m}=(0,Gu.getConfig)(e.config),_=parseInt(d,10),g=(0,Gu.getDbQueryText)(o);r._dbSemconvStability&wo.SemconvStability.OLD&&(a[Wi.ATTR_DB_SYSTEM]=Wi.DB_SYSTEM_VALUE_MYSQL,a[Wi.ATTR_DB_CONNECTION_STRING]=(0,Gu.getJDBCString)(c,d,f),a[Wi.ATTR_DB_NAME]=f,a[Wi.ATTR_DB_USER]=m,a[Wi.ATTR_DB_STATEMENT]=g),r._dbSemconvStability&wo.SemconvStability.STABLE&&(a[ud.ATTR_DB_SYSTEM_NAME]=ud.DB_SYSTEM_NAME_VALUE_MYSQL,a[ud.ATTR_DB_NAMESPACE]=f,a[ud.ATTR_DB_QUERY_TEXT]=g),r._netSemconvStability&wo.SemconvStability.OLD&&(a[Wi.ATTR_NET_PEER_NAME]=c,isNaN(_)||(a[Wi.ATTR_NET_PEER_PORT]=_)),r._netSemconvStability&wo.SemconvStability.STABLE&&(a[ud.ATTR_SERVER_ADDRESS]=c,isNaN(_)||(a[ud.ATTR_SERVER_PORT]=_));let T=r.tracer.startSpan((0,Gu.getSpanName)(o),{kind:Ur.SpanKind.CLIENT,attributes:a});if(r.getConfig().enhancedDatabaseReporting){let b;Array.isArray(s)?b=s:arguments[2]&&(b=[s]),T.setAttribute(Gje.AttributeNames.MYSQL_VALUES,(0,Gu.getDbValues)(o,b))}let A=Array.from(arguments).findIndex(b=>typeof b=="function"),R=Ur.context.active();if(A===-1){let b=Ur.context.with(Ur.trace.setSpan(Ur.context.active(),T),()=>n.apply(e,arguments));return Ur.context.bind(R,b),b.on("error",I=>T.setStatus({code:Ur.SpanStatusCode.ERROR,message:I.message})).on("end",()=>{T.end()})}else return r._wrap(arguments,A,r._patchCallbackQuery(T,R)),Ur.context.with(Ur.trace.setSpan(Ur.context.active(),T),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:Ur.SpanStatusCode.ERROR,message:o.message}),e.end(),Ur.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(e,n){let r=n||(0,Gu.getPoolNameOld)(e);e.on("connection",o=>{this._connCountAdd(1,r,"idle")}),e.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),e.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};py.MySQLInstrumentation=EM});var yJ=y(dy=>{"use strict";p();u();l();Object.defineProperty(dy,"__esModule",{value:!0});dy.MySQLInstrumentation=void 0;var Bje=AJ();Object.defineProperty(dy,"MySQLInstrumentation",{enumerable:!0,get:function(){return Bje.MySQLInstrumentation}})});var RJ,IJ,NJ,$je,bJ,OJ=S(()=>{p();u();l();RJ=j(yJ(),1);je();IJ="Mysql",NJ=Z(IJ,()=>new RJ.MySQLInstrumentation({})),$je=(()=>({name:IJ,setupOnce(){NJ()}})),bJ=$je});var TM=y(fn=>{"use strict";p();u();l();Object.defineProperty(fn,"__esModule",{value:!0});fn.DB_SYSTEM_VALUE_MYSQL=fn.ATTR_NET_PEER_PORT=fn.ATTR_NET_PEER_NAME=fn.ATTR_DB_USER=fn.ATTR_DB_SYSTEM=fn.ATTR_DB_STATEMENT=fn.ATTR_DB_NAME=fn.ATTR_DB_CONNECTION_STRING=void 0;fn.ATTR_DB_CONNECTION_STRING="db.connection_string";fn.ATTR_DB_NAME="db.name";fn.ATTR_DB_STATEMENT="db.statement";fn.ATTR_DB_SYSTEM="db.system";fn.ATTR_DB_USER="db.user";fn.ATTR_NET_PEER_NAME="net.peer.name";fn.ATTR_NET_PEER_PORT="net.peer.port";fn.DB_SYSTEM_VALUE_MYSQL="mysql"});var AM=y(fy=>{"use strict";p();u();l();Object.defineProperty(fy,"__esModule",{value:!0});fy.addSqlCommenterComment=void 0;var SM=(U(),D(J)),Fje=Be();function Hje(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function Vje(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function qje(t,e){if(typeof e!="string"||e.length===0||Hje(e))return e;let n=new Fje.W3CTraceContextPropagator,r={};n.inject(SM.trace.setSpan(SM.ROOT_CONTEXT,t),r,SM.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=Vje(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}fy.addSqlCommenterComment=qje});var CJ=y(Do=>{"use strict";p();u();l();Object.defineProperty(Do,"__esModule",{value:!0});Do.getConnectionPrototypeToInstrument=Do.once=Do.getSpanName=Do.getQueryText=Do.getConnectionAttributes=void 0;var J_=TM(),my=he(),yM=(Le(),D(Xe));function Yje(t,e,n){let{host:r,port:o,database:s,user:i}=Wje(t),a={};e&my.SemconvStability.OLD&&(a[J_.ATTR_DB_CONNECTION_STRING]=Kje(r,o,s),a[J_.ATTR_DB_NAME]=s,a[J_.ATTR_DB_USER]=i),e&my.SemconvStability.STABLE&&(a[yM.ATTR_DB_NAMESPACE]=s);let c=parseInt(o,10);return n&my.SemconvStability.OLD&&(a[J_.ATTR_NET_PEER_NAME]=r,isNaN(c)||(a[J_.ATTR_NET_PEER_PORT]=c)),n&my.SemconvStability.STABLE&&(a[yM.ATTR_SERVER_ADDRESS]=r,isNaN(c)||(a[yM.ATTR_SERVER_PORT]=c)),a}Do.getConnectionAttributes=Yje;function Wje(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function Kje(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function zje(t,e,n,r=!1,o=Xje){let[s,i]=typeof t=="string"?[t,n]:[t.sql,Qje(t)?n||t.values:n];try{return r?o(s):e&&i?e(s,i):s}catch{return"Could not determine the query due to an error in masking or formatting"}}Do.getQueryText=zje;function Xje(t){return t.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function Qje(t){return"values"in t}function Jje(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Do.getSpanName=Jje;var Zje=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Do.once=Zje;function eGe(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}Do.getConnectionPrototypeToInstrument=eGe});var PJ=y(ld=>{"use strict";p();u();l();Object.defineProperty(ld,"__esModule",{value:!0});ld.PACKAGE_NAME=ld.PACKAGE_VERSION=void 0;ld.PACKAGE_VERSION="0.57.0";ld.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var LJ=y(_y=>{"use strict";p();u();l();Object.defineProperty(_y,"__esModule",{value:!0});_y.MySQL2Instrumentation=void 0;var xJ=(U(),D(J)),fs=he(),RM=TM(),vJ=AM(),pd=CJ(),MJ=PJ(),IM=(Le(),D(Xe)),NM=[">=1.4.2 <4"],bM=class extends fs.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(MJ.PACKAGE_NAME,MJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,fs.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,fs.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,fs.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,fs.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new fs.InstrumentationNodeModuleDefinition("mysql2",NM,s=>(n(s),s),()=>{},[new fs.InstrumentationNodeModuleFile("mysql2/promise.js",NM,s=>(n(s),s),()=>{}),new fs.InstrumentationNodeModuleFile("mysql2/lib/connection.js",NM,s=>{let i=(0,pd.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,pd.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let c;Array.isArray(i)?c=i:arguments[2]&&(c=[i]);let{maskStatement:d,maskStatementHook:f,responseHook:m}=o.getConfig(),_=(0,pd.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),g=(0,pd.getQueryText)(s,e,c,d,f);o._dbSemconvStability&fs.SemconvStability.OLD&&(_[RM.ATTR_DB_SYSTEM]=RM.DB_SYSTEM_VALUE_MYSQL,_[RM.ATTR_DB_STATEMENT]=g),o._dbSemconvStability&fs.SemconvStability.STABLE&&(_[IM.ATTR_DB_SYSTEM_NAME]=IM.DB_SYSTEM_NAME_VALUE_MYSQL,_[IM.ATTR_DB_QUERY_TEXT]=g);let T=o.tracer.startSpan((0,pd.getSpanName)(s),{kind:xJ.SpanKind.CLIENT,attributes:_});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,vJ.addSqlCommenterComment)(T,s):Object.assign(s,{sql:(0,vJ.addSqlCommenterComment)(T,s.sql)}));let A=(0,pd.once)((R,b)=>{R?T.setStatus({code:xJ.SpanStatusCode.ERROR,message:R.message}):typeof m=="function"&&(0,fs.safeExecuteInTheMiddle)(()=>{m(T,{queryResults:b})},I=>{I&&o._diag.warn("Failed executing responseHook",I)},!0),T.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(A));let R=r.apply(this,arguments);return R.once("error",b=>{A(b)}).once("result",b=>{A(void 0,b)}),R}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(A)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(A)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};_y.MySQL2Instrumentation=bM});var wJ=y(hy=>{"use strict";p();u();l();Object.defineProperty(hy,"__esModule",{value:!0});hy.MySQL2Instrumentation=void 0;var tGe=LJ();Object.defineProperty(hy,"MySQL2Instrumentation",{enumerable:!0,get:function(){return tGe.MySQL2Instrumentation}})});var DJ,UJ,kJ,nGe,jJ,GJ=S(()=>{p();u();l();DJ=j(wJ(),1);je();UJ="Mysql2",kJ=Z(UJ,()=>new DJ.MySQL2Instrumentation({responseHook(t){Ve(t,"auto.db.otel.mysql2")}})),nGe=(()=>({name:UJ,setupOnce(){kJ()}})),jJ=nGe});var BJ=y(Hn=>{"use strict";p();u();l();Object.defineProperty(Hn,"__esModule",{value:!0});Hn.DB_SYSTEM_VALUE_REDIS=Hn.DB_SYSTEM_NAME_VALUE_REDIS=Hn.ATTR_NET_PEER_PORT=Hn.ATTR_NET_PEER_NAME=Hn.ATTR_DB_SYSTEM=Hn.ATTR_DB_STATEMENT=Hn.ATTR_DB_CONNECTION_STRING=void 0;Hn.ATTR_DB_CONNECTION_STRING="db.connection_string";Hn.ATTR_DB_STATEMENT="db.statement";Hn.ATTR_DB_SYSTEM="db.system";Hn.ATTR_NET_PEER_NAME="net.peer.name";Hn.ATTR_NET_PEER_PORT="net.peer.port";Hn.DB_SYSTEM_NAME_VALUE_REDIS="redis";Hn.DB_SYSTEM_VALUE_REDIS="redis"});var $J=y(gy=>{"use strict";p();u();l();Object.defineProperty(gy,"__esModule",{value:!0});gy.endSpan=void 0;var rGe=(U(),D(J)),oGe=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:rGe.SpanStatusCode.ERROR,message:e.message})),t.end()};gy.endSpan=oGe});var Ty=y(Ey=>{"use strict";p();u();l();Object.defineProperty(Ey,"__esModule",{value:!0});Ey.defaultDbStatementSerializer=void 0;var sGe=[{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}],iGe=(t,e)=>{if(Array.isArray(e)&&e.length){let n=sGe.find(({regex:o})=>o.test(t))?.args??0,r=n>=0?e.slice(0,n):e;return e.length>r.length&&r.push(`[${e.length-n} other arguments]`),`${t} ${r.join(" ")}`}return t};Ey.defaultDbStatementSerializer=iGe});var FJ=y(dd=>{"use strict";p();u();l();Object.defineProperty(dd,"__esModule",{value:!0});dd.PACKAGE_NAME=dd.PACKAGE_VERSION=void 0;dd.PACKAGE_VERSION="0.59.0";dd.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var YJ=y(Sy=>{"use strict";p();u();l();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.IORedisInstrumentation=void 0;var sc=(U(),D(J)),kr=he(),ic=(Le(),D(Xe)),jr=BJ(),HJ=he(),Z_=$J(),aGe=Ty(),VJ=FJ(),qJ={requireParentSpan:!0},OM=class extends kr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(VJ.PACKAGE_NAME,VJ.PACKAGE_VERSION,{...qJ,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,kr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,kr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...qJ,...e})}init(){return[new kr.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,kr.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,kr.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||aGe.defaultDbStatementSerializer,a=sc.trace.getSpan(sc.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let c={},{host:d,port:f}=this.options,m=i(o.name,o.args);r._dbSemconvStability&kr.SemconvStability.OLD&&(c[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_REDIS,c[jr.ATTR_DB_STATEMENT]=m,c[jr.ATTR_DB_CONNECTION_STRING]=`redis://${d}:${f}`),r._dbSemconvStability&kr.SemconvStability.STABLE&&(c[ic.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_REDIS,c[ic.ATTR_DB_QUERY_TEXT]=m),r._netSemconvStability&kr.SemconvStability.OLD&&(c[jr.ATTR_NET_PEER_NAME]=d,c[jr.ATTR_NET_PEER_PORT]=f),r._netSemconvStability&kr.SemconvStability.STABLE&&(c[ic.ATTR_SERVER_ADDRESS]=d,c[ic.ATTR_SERVER_PORT]=f);let _=r.tracer.startSpan(o.name,{kind:sc.SpanKind.CLIENT,attributes:c}),{requestHook:g}=s;g&&(0,HJ.safeExecuteInTheMiddle)(()=>g(_,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),T=>{T&&sc.diag.error("ioredis instrumentation: request hook failed",T)},!0);try{let T=e.apply(this,arguments),A=o.resolve;o.resolve=function(b){(0,HJ.safeExecuteInTheMiddle)(()=>s.responseHook?.(_,o.name,o.args,b),I=>{I&&sc.diag.error("ioredis instrumentation: response hook failed",I)},!0),(0,Z_.endSpan)(_,null),A(b)};let R=o.reject;return o.reject=function(b){(0,Z_.endSpan)(_,b),R(b)},T}catch(T){throw(0,Z_.endSpan)(_,T),T}}}_traceConnection(e){let n=this;return function(){let r=sc.trace.getSpan(sc.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o={},{host:s,port:i}=this.options;n._dbSemconvStability&kr.SemconvStability.OLD&&(o[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_REDIS,o[jr.ATTR_DB_STATEMENT]="connect",o[jr.ATTR_DB_CONNECTION_STRING]=`redis://${s}:${i}`),n._dbSemconvStability&kr.SemconvStability.STABLE&&(o[ic.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_REDIS,o[ic.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&kr.SemconvStability.OLD&&(o[jr.ATTR_NET_PEER_NAME]=s,o[jr.ATTR_NET_PEER_PORT]=i),n._netSemconvStability&kr.SemconvStability.STABLE&&(o[ic.ATTR_SERVER_ADDRESS]=s,o[ic.ATTR_SERVER_PORT]=i);let a=n.tracer.startSpan("connect",{kind:sc.SpanKind.CLIENT,attributes:o});try{let c=e.apply(this,arguments);return(0,Z_.endSpan)(a,null),c}catch(c){throw(0,Z_.endSpan)(a,c),c}}}};Sy.IORedisInstrumentation=OM});var WJ=y(Ay=>{"use strict";p();u();l();Object.defineProperty(Ay,"__esModule",{value:!0});Ay.IORedisInstrumentation=void 0;var cGe=YJ();Object.defineProperty(Ay,"IORedisInstrumentation",{enumerable:!0,get:function(){return cGe.IORedisInstrumentation}})});var yy=y(fd=>{"use strict";p();u();l();Object.defineProperty(fd,"__esModule",{value:!0});fd.PACKAGE_NAME=fd.PACKAGE_VERSION=void 0;fd.PACKAGE_VERSION="0.59.0";fd.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var KJ=y(ac=>{"use strict";p();u();l();Object.defineProperty(ac,"__esModule",{value:!0});ac.getTracedCreateStreamTrace=ac.getTracedCreateClient=ac.endSpan=void 0;var eh=(U(),D(J)),uGe=(t,e)=>{e&&t.setStatus({code:eh.SpanStatusCode.ERROR,message:e.message}),t.end()};ac.endSpan=uGe;var lGe=t=>function(){let n=t.apply(this,arguments);return eh.context.bind(eh.context.active(),n)};ac.getTracedCreateClient=lGe;var pGe=t=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){eh.context.bind(eh.context.active(),n),this._patched_redis_stream=n}}),t.apply(this,arguments)};ac.getTracedCreateStreamTrace=pGe});var Ry=y(Vn=>{"use strict";p();u();l();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.DB_SYSTEM_VALUE_REDIS=Vn.DB_SYSTEM_NAME_VALUE_REDIS=Vn.ATTR_NET_PEER_PORT=Vn.ATTR_NET_PEER_NAME=Vn.ATTR_DB_SYSTEM=Vn.ATTR_DB_STATEMENT=Vn.ATTR_DB_CONNECTION_STRING=void 0;Vn.ATTR_DB_CONNECTION_STRING="db.connection_string";Vn.ATTR_DB_STATEMENT="db.statement";Vn.ATTR_DB_SYSTEM="db.system";Vn.ATTR_NET_PEER_NAME="net.peer.name";Vn.ATTR_NET_PEER_PORT="net.peer.port";Vn.DB_SYSTEM_NAME_VALUE_REDIS="redis";Vn.DB_SYSTEM_VALUE_REDIS="redis"});var XJ=y(Ny=>{"use strict";p();u();l();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.RedisInstrumentationV2_V3=void 0;var oo=he(),Iy=KJ(),zJ=yy(),th=(U(),D(J)),nh=(Le(),D(Xe)),Bu=Ry(),dGe=Ty(),CM=class t extends oo.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(zJ.PACKAGE_NAME,zJ.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,oo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,oo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new oo.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],e=>((0,oo.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._wrap(e.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,oo.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,"create_stream"),this._wrap(e.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,oo.isWrapped)(e.createClient)&&this._unwrap(e,"createClient"),this._wrap(e,"createClient",this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._unwrap(e.RedisClient.prototype,"create_stream"),this._unwrap(e,"createClient"))})]}_getPatchInternalSendCommand(){let e=this;return function(r){return function(s){if(arguments.length!==1||typeof s!="object")return r.apply(this,arguments);let i=e.getConfig(),a=th.trace.getSpan(th.context.active())===void 0;if(i.requireParentSpan===!0&&a)return r.apply(this,arguments);let c=i?.dbStatementSerializer||dGe.defaultDbStatementSerializer,d={};e._semconvStability&oo.SemconvStability.OLD&&Object.assign(d,{[Bu.ATTR_DB_SYSTEM]:Bu.DB_SYSTEM_VALUE_REDIS,[Bu.ATTR_DB_STATEMENT]:c(s.command,s.args)}),e._semconvStability&oo.SemconvStability.STABLE&&Object.assign(d,{[nh.ATTR_DB_SYSTEM_NAME]:Bu.DB_SYSTEM_NAME_VALUE_REDIS,[nh.ATTR_DB_OPERATION_NAME]:s.command,[nh.ATTR_DB_QUERY_TEXT]:c(s.command,s.args)});let f=e.tracer.startSpan(`${t.COMPONENT}-${s.command}`,{kind:th.SpanKind.CLIENT,attributes:d});if(this.connection_options){let _={};e._semconvStability&oo.SemconvStability.OLD&&Object.assign(_,{[Bu.ATTR_NET_PEER_NAME]:this.connection_options.host,[Bu.ATTR_NET_PEER_PORT]:this.connection_options.port}),e._semconvStability&oo.SemconvStability.STABLE&&Object.assign(_,{[nh.ATTR_SERVER_ADDRESS]:this.connection_options.host,[nh.ATTR_SERVER_PORT]:this.connection_options.port}),f.setAttributes(_)}this.address&&e._semconvStability&oo.SemconvStability.OLD&&f.setAttribute(Bu.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let m=arguments[0].callback;if(m){let _=th.context.active();arguments[0].callback=function(T,A){if(i?.responseHook){let R=i.responseHook;(0,oo.safeExecuteInTheMiddle)(()=>{R(f,s.command,s.args,A)},b=>{b&&e._diag.error("Error executing responseHook",b)},!0)}return(0,Iy.endSpan)(f,T),th.context.with(_,m,this,...arguments)}}try{return r.apply(this,arguments)}catch(_){throw(0,Iy.endSpan)(f,_),_}}}}_getPatchCreateClient(){return function(n){return(0,Iy.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,Iy.getTracedCreateStreamTrace)(n)}}};Ny.RedisInstrumentationV2_V3=CM});var JJ=y(by=>{"use strict";p();u();l();Object.defineProperty(by,"__esModule",{value:!0});by.getClientAttributes=void 0;var PM=(Le(),D(Xe)),md=Ry(),QJ=he();function fGe(t,e,n){let r={};return n&QJ.SemconvStability.OLD&&Object.assign(r,{[md.ATTR_DB_SYSTEM]:md.DB_SYSTEM_VALUE_REDIS,[md.ATTR_NET_PEER_NAME]:e?.socket?.host,[md.ATTR_NET_PEER_PORT]:e?.socket?.port,[md.ATTR_DB_CONNECTION_STRING]:mGe(t,e?.url)}),n&QJ.SemconvStability.STABLE&&Object.assign(r,{[PM.ATTR_DB_SYSTEM_NAME]:md.DB_SYSTEM_NAME_VALUE_REDIS,[PM.ATTR_SERVER_ADDRESS]:e?.socket?.host,[PM.ATTR_SERVER_PORT]:e?.socket?.port}),r}by.getClientAttributes=fGe;function mGe(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var nZ=y(Oy=>{"use strict";p();u();l();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.RedisInstrumentationV4_V5=void 0;var Uo=(U(),D(J)),st=he(),ZJ=JJ(),_Ge=Ty(),eZ=yy(),xM=(Le(),D(Xe)),hGe=Ry(),rh=Symbol("opentelemetry.instrumentation.redis.open_spans"),tZ=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),vM=class t extends st.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(eZ.PACKAGE_NAME,eZ.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,st.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,st.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let c=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,st.isWrapped)(s?.[c])&&this._unwrap(s,c),this._wrap(s,c,this._getPatchExtendWithCommands(a)),s},s=>{(0,st.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,st.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return(0,st.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),this._wrap(i,"exec",this._getPatchMultiCommandsExec(!1)),(0,st.isWrapped)(i?.execAsPipeline)&&this._unwrap(i,"execAsPipeline"),this._wrap(i,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,st.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand"),this._wrap(i,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{let i=s?.default?.prototype;(0,st.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),(0,st.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand")}),o=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return i?.multi&&((0,st.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),this._wrap(i,"multi",this._getPatchRedisClientMulti())),i?.MULTI&&((0,st.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),this._wrap(i,"MULTI",this._getPatchRedisClientMulti())),(0,st.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand"),this._wrap(i,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(i,"connect",this._getPatchedClientConnect()),s},s=>{let i=s?.default?.prototype;(0,st.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),(0,st.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),(0,st.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand")});return new st.InstrumentationNodeModuleDefinition(e,["^1.0.0","^5.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){if(i?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let a=i.executor;return i.executor=function(c,d){let f=e(c,d).args;return n._traceClientCommand(a,this,arguments,f)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let n=this;return function(o){return function(){let i=o.apply(this,arguments);return typeof i?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),i):i.then(a=>{let c=this[rh];return n._endSpansWithRedisReplies(c,a,e),a}).catch(a=>{let c=this[rh];if(!c)n._diag.error("cannot find open spans to end for multi/pipeline");else{let d=a.constructor.name==="MultiErrorReply"?a.replies:new Array(c.length).fill(a);n._endSpansWithRedisReplies(c,d,e)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[tZ]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,ZJ.getClientAttributes)(e._diag,s,e._semconvStability),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:Uo.SpanKind.CLIENT,attributes:i});return Uo.context.with(Uo.trace.setSpan(Uo.context.active(),a),()=>r.apply(this)).then(d=>(a.end(),d)).catch(d=>(a.recordException(d),a.setStatus({code:Uo.SpanStatusCode.ERROR,message:d.message}),a.end(),Promise.reject(d)))}}}_traceClientCommand(e,n,r,o){if(Uo.trace.getSpan(Uo.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[tZ],a=o[0],c=o.slice(1),d=this.getConfig().dbStatementSerializer||_Ge.defaultDbStatementSerializer,f=(0,ZJ.getClientAttributes)(this._diag,i,this._semconvStability);this._semconvStability&st.SemconvStability.STABLE&&(f[xM.ATTR_DB_OPERATION_NAME]=a);try{let g=d(a,c);g!=null&&(this._semconvStability&st.SemconvStability.OLD&&(f[hGe.ATTR_DB_STATEMENT]=g),this._semconvStability&st.SemconvStability.STABLE&&(f[xM.ATTR_DB_QUERY_TEXT]=g))}catch(g){this._diag.error("dbStatementSerializer throw an exception",g,{commandName:a})}let m=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:Uo.SpanKind.CLIENT,attributes:f}),_=Uo.context.with(Uo.trace.setSpan(Uo.context.active(),m),()=>e.apply(n,r));if(typeof _?.then=="function")_.then(g=>{this._endSpanWithResponse(m,a,c,g,void 0)},g=>{this._endSpanWithResponse(m,a,c,null,g)});else{let g=_;g[rh]=g[rh]||[],g[rh].push({span:m,commandName:a,commandArgs:c})}return _}_endSpansWithRedisReplies(e,n,r=!1){if(!e)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");let o=e.map(a=>a.commandName),i=o.every(a=>a===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let a=0;a<e.length;a++){let{span:c,commandArgs:d}=e[a],f=n[a],[m,_]=f instanceof Error?[null,f]:[f,void 0];this._semconvStability&st.SemconvStability.STABLE&&c.setAttribute(xM.ATTR_DB_OPERATION_NAME,i),this._endSpanWithResponse(c,o[a],d,m,_)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:Uo.SpanStatusCode.ERROR,message:s?.message})),e.end()}};Oy.RedisInstrumentationV4_V5=vM});var sZ=y(Cy=>{"use strict";p();u();l();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.RedisInstrumentation=void 0;var gGe=he(),rZ=yy(),EGe=XJ(),TGe=nZ(),oZ={requireParentSpan:!1},MM=class extends gGe.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(e={}){let n={...oZ,...e};super(rZ.PACKAGE_NAME,rZ.PACKAGE_VERSION,n),this.instrumentationV2_V3=new EGe.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new TGe.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let n={...oZ,...e};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};Cy.RedisInstrumentation=MM});var iZ=y(Py=>{"use strict";p();u();l();Object.defineProperty(Py,"__esModule",{value:!0});Py.RedisInstrumentation=void 0;var SGe=sZ();Object.defineProperty(Py,"RedisInstrumentation",{enumerable:!0,get:function(){return SGe.RedisInstrumentation}})});function oh(t,e){return t.includes(e.toLowerCase())}function wM(t){return oh(LM,t)?"cache.get":oh(yGe,t)?"cache.put":void 0}function RGe(t,e){return e.some(n=>t.startsWith(n))}function cZ(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?aZ(o.map(s=>n(s))):["<unknown>"],r=e[0];return oh(AGe,t)&&r!=null?n(r):aZ(e.map(o=>n(o)))}catch{return}}function uZ(t,e,n){if(!wM(t))return!1;for(let r of e)if(RGe(r,n))return!0;return!1}function lZ(t){let e=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function aZ(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var AGe,LM,yGe,pZ=S(()=>{p();u();l();AGe=["get","set","setex"],LM=["get","mget"],yGe=["set","setex"]});var dZ,fZ,xy,sh,mZ,IGe,NGe,_Z,bGe,hZ,gZ=S(()=>{p();u();l();dZ=j(WJ(),1),fZ=j(iZ(),1);ne();je();pZ();xy="Redis",sh={},mZ=(t,e,n,r)=>{t.setAttribute(fe,"auto.db.otel.redis");let o=cZ(e,n),s=wM(e);if(!o||!s||!sh.cachePrefixes||!uZ(e,o,sh.cachePrefixes))return;let i=ae(t).data["net.peer.name"],a=ae(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let c=lZ(r);c&&t.setAttribute(PC,c),oh(LM,e)&&c!==void 0&&t.setAttribute(OC,c>0),t.setAttributes({[ge]:s,[CC]:o});let d=o.join(", ");t.updateName(sh.maxCacheKeyLength?Ra(d,sh.maxCacheKeyLength):d)},IGe=Z(`${xy}.IORedis`,()=>new dZ.IORedisInstrumentation({responseHook:mZ})),NGe=Z(`${xy}.Redis`,()=>new fZ.RedisInstrumentation({responseHook:mZ})),_Z=Object.assign(()=>{IGe(),NGe()},{id:xy}),bGe=((t={})=>({name:xy,setupOnce(){sh=t,_Z()}})),hZ=bGe});var EZ=y(vy=>{"use strict";p();u();l();Object.defineProperty(vy,"__esModule",{value:!0});vy.EVENT_LISTENERS_SET=void 0;vy.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var DM=y(ih=>{"use strict";p();u();l();Object.defineProperty(ih,"__esModule",{value:!0});ih.AttributeNames=void 0;var OGe;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(OGe=ih.AttributeNames||(ih.AttributeNames={}))});var UM=y(Fe=>{"use strict";p();u();l();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Fe.METRIC_DB_CLIENT_CONNECTION_COUNT=Fe.DB_SYSTEM_VALUE_POSTGRESQL=Fe.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Fe.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Fe.ATTR_NET_PEER_PORT=Fe.ATTR_NET_PEER_NAME=Fe.ATTR_DB_USER=Fe.ATTR_DB_SYSTEM=Fe.ATTR_DB_STATEMENT=Fe.ATTR_DB_NAME=Fe.ATTR_DB_CONNECTION_STRING=Fe.ATTR_DB_CLIENT_CONNECTION_STATE=Fe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Fe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Fe.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Fe.ATTR_DB_CONNECTION_STRING="db.connection_string";Fe.ATTR_DB_NAME="db.name";Fe.ATTR_DB_STATEMENT="db.statement";Fe.ATTR_DB_SYSTEM="db.system";Fe.ATTR_DB_USER="db.user";Fe.ATTR_NET_PEER_NAME="net.peer.name";Fe.ATTR_NET_PEER_PORT="net.peer.port";Fe.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Fe.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Fe.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Fe.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Fe.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var kM=y(ah=>{"use strict";p();u();l();Object.defineProperty(ah,"__esModule",{value:!0});ah.SpanNames=void 0;var CGe;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(CGe=ah.SpanNames||(ah.SpanNames={}))});var NZ=y(Ue=>{"use strict";p();u();l();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.sanitizedErrorMessage=Ue.isObjectWithTextString=Ue.getErrorMessage=Ue.patchClientConnectCallback=Ue.patchCallbackPGPool=Ue.updateCounter=Ue.getPoolName=Ue.patchCallback=Ue.handleExecutionResult=Ue.handleConfigQuery=Ue.shouldSkipInstrumentation=Ue.getSemanticAttributesFromPoolConnection=Ue.getSemanticAttributesFromConnection=Ue.getConnectionString=Ue.parseAndMaskConnectionString=Ue.parseNormalizedOperationName=Ue.getQuerySpanName=void 0;var cc=(U(),D(J)),My=DM(),ko=(Le(),D(Xe)),Nt=UM(),$u=he(),TZ=kM();function SZ(t,e){if(!e)return TZ.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:AZ(e.text);return`${TZ.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}Ue.getQuerySpanName=SZ;function AZ(t){let e=t.trim(),n=e.indexOf(" "),r=n===-1?e:e.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}Ue.parseNormalizedOperationName=AZ;function yZ(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"postgresql://localhost:5432/"}}Ue.parseAndMaskConnectionString=yZ;function jM(t){if("connectionString"in t&&t.connectionString)return yZ(t.connectionString);let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}Ue.getConnectionString=jM;function Ly(t){if(Number.isInteger(t))return t}function RZ(t,e){let n={};return e&$u.SemconvStability.OLD&&(n={...n,[Nt.ATTR_DB_SYSTEM]:Nt.DB_SYSTEM_VALUE_POSTGRESQL,[Nt.ATTR_DB_NAME]:t.database,[Nt.ATTR_DB_CONNECTION_STRING]:jM(t),[Nt.ATTR_DB_USER]:t.user,[Nt.ATTR_NET_PEER_NAME]:t.host,[Nt.ATTR_NET_PEER_PORT]:Ly(t.port)}),e&$u.SemconvStability.STABLE&&(n={...n,[ko.ATTR_DB_SYSTEM_NAME]:ko.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[ko.ATTR_DB_NAMESPACE]:t.namespace,[ko.ATTR_SERVER_ADDRESS]:t.host,[ko.ATTR_SERVER_PORT]:Ly(t.port)}),n}Ue.getSemanticAttributesFromConnection=RZ;function PGe(t,e){let n;try{n=t.connectionString?new URL(t.connectionString):void 0}catch{n=void 0}let r={[My.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[My.AttributeNames.MAX_CLIENT]:t.maxClient};return e&$u.SemconvStability.OLD&&(r={...r,[Nt.ATTR_DB_SYSTEM]:Nt.DB_SYSTEM_VALUE_POSTGRESQL,[Nt.ATTR_DB_NAME]:n?.pathname.slice(1)??t.database,[Nt.ATTR_DB_CONNECTION_STRING]:jM(t),[Nt.ATTR_NET_PEER_NAME]:n?.hostname??t.host,[Nt.ATTR_NET_PEER_PORT]:Number(n?.port)||Ly(t.port),[Nt.ATTR_DB_USER]:n?.username??t.user}),e&$u.SemconvStability.STABLE&&(r={...r,[ko.ATTR_DB_SYSTEM_NAME]:ko.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[ko.ATTR_DB_NAMESPACE]:t.namespace,[ko.ATTR_SERVER_ADDRESS]:n?.hostname??t.host,[ko.ATTR_SERVER_PORT]:Number(n?.port)||Ly(t.port)}),r}Ue.getSemanticAttributesFromPoolConnection=PGe;function xGe(t){return t.requireParentSpan===!0&&cc.trace.getSpan(cc.context.active())===void 0}Ue.shouldSkipInstrumentation=xGe;function vGe(t,e,n,r){let{connectionParameters:o}=this,s=o.database,i=SZ(s,r),a=t.startSpan(i,{kind:cc.SpanKind.CLIENT,attributes:RZ(o,n)});if(!r)return a;if(r.text&&(n&$u.SemconvStability.OLD&&a.setAttribute(Nt.ATTR_DB_STATEMENT,r.text),n&$u.SemconvStability.STABLE&&a.setAttribute(ko.ATTR_DB_QUERY_TEXT,r.text)),e.enhancedDatabaseReporting&&Array.isArray(r.values))try{let c=r.values.map(d=>d==null?"null":d instanceof Buffer?d.toString():typeof d=="object"?typeof d.toPostgres=="function"?d.toPostgres():JSON.stringify(d):d.toString());a.setAttribute(My.AttributeNames.PG_VALUES,c)}catch(c){cc.diag.error("failed to stringify ",r.values,c)}return typeof r.name=="string"&&a.setAttribute(My.AttributeNames.PG_PLAN,r.name),a}Ue.handleConfigQuery=vGe;function IZ(t,e,n){typeof t.responseHook=="function"&&(0,$u.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&cc.diag.error("Error running response hook",r)},!0)}Ue.handleExecutionResult=IZ;function MGe(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[ko.ATTR_ERROR_TYPE]=i.code),i instanceof Error&&e.recordException(wy(i)),e.setStatus({code:cc.SpanStatusCode.ERROR,message:i.message})):IZ(t,e,a),o(),e.end(),n.call(this,i,a)}}Ue.patchCallback=MGe;function LGe(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}Ue.getPoolName=LGe;function wGe(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,c=s-a;return n.add(c-o.used,{[Nt.ATTR_DB_CLIENT_CONNECTION_STATE]:Nt.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Nt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[Nt.ATTR_DB_CLIENT_CONNECTION_STATE]:Nt.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Nt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[Nt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:c,idle:a,pending:i}}Ue.updateCounter=wGe;function DGe(t,e){return function(r,o,s){r&&(r instanceof Error&&t.recordException(wy(r)),t.setStatus({code:cc.SpanStatusCode.ERROR,message:r.message})),t.end(),e.call(this,r,o,s)}}Ue.patchCallbackPGPool=DGe;function UGe(t,e){return function(r){r&&(r instanceof Error&&t.recordException(wy(r)),t.setStatus({code:cc.SpanStatusCode.ERROR,message:r.message})),t.end(),e.apply(this,arguments)}}Ue.patchClientConnectCallback=UGe;function kGe(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}Ue.getErrorMessage=kGe;function jGe(t){return typeof t=="object"&&typeof t?.text=="string"}Ue.isObjectWithTextString=jGe;function wy(t){let e=t?.name??"PostgreSQLError",n=t?.code??"UNKNOWN";return`PostgreSQL error of type '${e}' occurred (code: ${n})`}Ue.sanitizedErrorMessage=wy});var bZ=y(_d=>{"use strict";p();u();l();Object.defineProperty(_d,"__esModule",{value:!0});_d.PACKAGE_NAME=_d.PACKAGE_VERSION=void 0;_d.PACKAGE_VERSION="0.63.0";_d.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var MZ=y(Uy=>{"use strict";p();u();l();Object.defineProperty(Uy,"__esModule",{value:!0});Uy.PgInstrumentation=void 0;var Tr=he(),Ke=(U(),D(J)),OZ=EZ(),ht=NZ(),CZ=AM(),PZ=bZ(),xZ=kM(),Dy=Be(),ms=(Le(),D(Xe)),ch=UM();function hd(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var GM=class extends Tr.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(e={}){super(PZ.PACKAGE_NAME,PZ.PACKAGE_VERSION,e),this._semconvStability=(0,Tr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(ms.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Ke.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(ch.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(ch.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new Tr.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new Tr.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),s=new Tr.InstrumentationNodeModuleDefinition("pg",e,a=>{let c=hd(a);return this._patchPgClient(c.Client),a},a=>{let c=hd(a);return this._unpatchPgClient(c.Client),a},[o,r]),i=new Tr.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let c=hd(a);return(0,Tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect"),this._wrap(c.prototype,"connect",this._getPoolConnectPatch()),c},a=>{let c=hd(a);(0,Tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect")});return[s,i]}_patchPgClient(e){if(!e)return;let n=hd(e);return(0,Tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),e}_unpatchPgClient(e){let n=hd(e);return(0,Tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ht.shouldSkipInstrumentation(s)||s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(xZ.SpanNames.CONNECT,{kind:Ke.SpanKind.CLIENT,attributes:ht.getSemanticAttributesFromConnection(this,e._semconvStability)});if(o){let c=Ke.trace.getSpan(Ke.context.active());o=ht.patchClientConnectCallback(i,o),c&&(o=Ke.context.bind(Ke.context.active(),o))}let a=Ke.context.with(Ke.trace.setSpan(Ke.context.active(),i),()=>n.call(this,o));return vZ(i,a)}}recordOperationDuration(e,n){let r={},o=[ms.ATTR_DB_NAMESPACE,ms.ATTR_ERROR_TYPE,ms.ATTR_SERVER_PORT,ms.ATTR_SERVER_ADDRESS,ms.ATTR_DB_OPERATION_NAME];this._semconvStability&Tr.SemconvStability.OLD&&o.push(ch.ATTR_DB_SYSTEM),this._semconvStability&Tr.SemconvStability.STABLE&&o.push(ms.ATTR_DB_SYSTEM_NAME),o.forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,Dy.hrTimeToMilliseconds)((0,Dy.hrTimeDuration)(n,(0,Dy.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ht.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,Dy.hrTime)(),i=o[0],a=typeof i=="string",c=ht.isObjectWithTextString(i),d=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:c?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,f={[ch.ATTR_DB_SYSTEM]:ch.DB_SYSTEM_VALUE_POSTGRESQL,[ms.ATTR_DB_NAMESPACE]:this.database,[ms.ATTR_SERVER_PORT]:this.connectionParameters.port,[ms.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};d?.text&&(f[ms.ATTR_DB_OPERATION_NAME]=ht.parseNormalizedOperationName(d?.text));let m=()=>{e.recordOperationDuration(f,s)},_=e.getConfig(),g=ht.handleConfigQuery.call(this,e.tracer,_,e._semconvStability,d);if(_.addSqlCommenterCommentToQueries&&(a?o[0]=(0,CZ.addSqlCommenterComment)(g,i):c&&!("name"in i)&&(o[0]={...i,text:(0,CZ.addSqlCommenterComment)(g,i.text)})),o.length>0){let R=Ke.trace.getSpan(Ke.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ht.patchCallback(_,g,o[o.length-1],f,m),R&&(o[o.length-1]=Ke.context.bind(Ke.context.active(),o[o.length-1]));else if(typeof d?.callback=="function"){let b=ht.patchCallback(e.getConfig(),g,d.callback,f,m);R&&(b=Ke.context.bind(Ke.context.active(),b)),o[0].callback=b}}let{requestHook:T}=_;typeof T=="function"&&d&&(0,Tr.safeExecuteInTheMiddle)(()=>{let{database:R,host:b,port:I,user:v}=this.connectionParameters;T(g,{connection:{database:R,host:b,port:I,user:v},query:{text:d.text,values:d.values,name:d.name}})},R=>{R&&e._diag.error("Error running query hook",R)},!0);let A;try{A=n.apply(this,o)}catch(R){throw R instanceof Error&&g.recordException(ht.sanitizedErrorMessage(R)),g.setStatus({code:Ke.SpanStatusCode.ERROR,message:ht.getErrorMessage(R)}),g.end(),R}return A instanceof Promise?A.then(R=>new Promise(b=>{ht.handleExecutionResult(e.getConfig(),g,R),m(),g.end(),b(R)})).catch(R=>new Promise((b,I)=>{R instanceof Error&&g.recordException(ht.sanitizedErrorMessage(R)),g.setStatus({code:Ke.SpanStatusCode.ERROR,message:R.message}),m(),g.end(),I(R)})):A})}_setPoolConnectEventListeners(e){if(e[OZ.EVENT_LISTENERS_SET])return;let n=ht.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[OZ.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ht.shouldSkipInstrumentation(s))return n.call(this,o);if(e._setPoolConnectEventListeners(this),s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(xZ.SpanNames.POOL_CONNECT,{kind:Ke.SpanKind.CLIENT,attributes:ht.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(o){let c=Ke.trace.getSpan(Ke.context.active());o=ht.patchCallbackPGPool(i,o),c&&(o=Ke.context.bind(Ke.context.active(),o))}let a=Ke.context.with(Ke.trace.setSpan(Ke.context.active(),i),()=>n.call(this,o));return vZ(i,a)}}};Uy.PgInstrumentation=GM;function vZ(t,e){if(!(e instanceof Promise))return e;let n=e;return Ke.context.bind(Ke.context.active(),n.then(r=>(t.end(),r)).catch(r=>(r instanceof Error&&t.recordException(ht.sanitizedErrorMessage(r)),t.setStatus({code:Ke.SpanStatusCode.ERROR,message:ht.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var LZ=y(gd=>{"use strict";p();u();l();Object.defineProperty(gd,"__esModule",{value:!0});gd.AttributeNames=gd.PgInstrumentation=void 0;var GGe=MZ();Object.defineProperty(gd,"PgInstrumentation",{enumerable:!0,get:function(){return GGe.PgInstrumentation}});var BGe=DM();Object.defineProperty(gd,"AttributeNames",{enumerable:!0,get:function(){return BGe.AttributeNames}})});var wZ,DZ,UZ,$Ge,kZ,jZ=S(()=>{p();u();l();wZ=j(LZ(),1);je();DZ="Postgres",UZ=Z(DZ,()=>new wZ.PgInstrumentation({requireParentSpan:!0,requestHook(t){Ve(t,"auto.db.otel.postgres")}})),$Ge=(()=>({name:DZ,setupOnce(){UZ()}})),kZ=$Ge});var Ki,jy,GZ,FGe,ky,BM,BZ,$Z,$M,HGe,FZ,HZ=S(()=>{p();u();l();U();Ki=j(he(),1);Le();ne();je();Du();jy="PostgresJs",GZ=[">=3.0.0 <4"],FGe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,ky=Symbol("sentryPostgresConnectionContext"),BM=Symbol.for("sentry.instrumented.postgresjs"),BZ=Symbol.for("sentry.query.from.instrumented.sql"),$Z=Z(jy,t=>new $M({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),$M=class extends Ki.InstrumentationBase{constructor(e){super("sentry-postgres-js",Pe,e)}init(){let e=new Ki.InstrumentationNodeModuleDefinition("postgres",GZ,n=>{try{return this._patchPostgres(n)}catch(r){return It&&N.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new Ki.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,GZ,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let n=typeof e=="function",r=n?e:e.default;if(typeof r!="function")return It&&N.warn("postgres module does not export a function. Skipping instrumentation."),e;let o=this,s=function(...i){let a=Reflect.construct(r,i);return!a||typeof a!="function"?(It&&N.warn("postgres() did not return a valid instance"),a):o._instrumentSqlInstance(a)};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}return n?s:(p_(e,"default",s),e)}_wrapQueryMethod(e,n,r){let o=this;return function(...s){let i=Reflect.apply(e,n,s);return i&&typeof i=="object"&&"handle"in i&&o._wrapSingleQueryHandle(i,r),i}}_wrapCallbackMethod(e,n,r){let o=this;return function(...s){let i=r[ky];if(!(typeof s[s.length-1]=="function")){let m=Reflect.apply(e,n,s);return m&&typeof m.then=="function"?m.then(_=>o._instrumentSqlInstance(_,i)):m}let c=s.length===1?s[0]:s[1],d=function(m){let _=o._instrumentSqlInstance(m,i);return c(_)},f=s.length===1?[d]:[s[0],d];return Reflect.apply(e,n,f)}}_setConnectionAttributes(e,n){if(n&&(n.ATTR_DB_NAMESPACE&&e.setAttribute(Wf,n.ATTR_DB_NAMESPACE),n.ATTR_SERVER_ADDRESS&&e.setAttribute(Kf,n.ATTR_SERVER_ADDRESS),n.ATTR_SERVER_PORT!==void 0)){let r=parseInt(n.ATTR_SERVER_PORT,10);isNaN(r)||e.setAttribute(zf,r)}}_setOperationName(e,n,r){if(r){e.setAttribute(Ul,r);return}let o=n?.match(FGe);o?.[1]&&e.setAttribute(Ul,o[1].toUpperCase())}_attachConnectionContext(e,n){let r=e;if(!r.options||typeof r.options!="object")return;let o=r.options,s=o.host?.[0]||"localhost",i=o.port?.[0]||5432,a={ATTR_DB_NAMESPACE:typeof o.database=="string"&&o.database!==""?o.database:void 0,ATTR_SERVER_ADDRESS:s,ATTR_SERVER_PORT:String(i)};n[ky]=a}_instrumentSqlInstance(e,n){if(e[BM])return e;let r=this,o=new Proxy(e,{apply(s,i,a){let c=Reflect.apply(s,i,a);return c&&typeof c=="object"&&"handle"in c&&r._wrapSingleQueryHandle(c,o),c},get(s,i){let a=s[i];return typeof i!="string"||typeof a!="function"?a:i==="unsafe"||i==="file"?r._wrapQueryMethod(a,s,o):i==="begin"||i==="reserve"?r._wrapCallbackMethod(a,s,o):a}});return n?o[ky]=n:this._attachConnectionContext(e,o),e[BM]=!0,o[BM]=!0,o}_wrapSingleQueryHandle(e,n){if(e.handle?.__sentryWrapped)return;e[BZ]=!0;let r=e.handle,o=this,s=async function(...i){if(!o._shouldCreateSpans())return r.apply(this,i);let a=o._reconstructQuery(e.strings),c=o._sanitizeSqlQuery(a);return At({name:c||"postgresjs.query",op:"db"},d=>{Ve(d,"auto.db.postgresjs"),d.setAttributes({[_a]:"postgres",[mE]:c});let f=n?n[ky]:void 0;o._setConnectionAttributes(d,f);let m=o.getConfig(),{requestHook:_}=m;_&&(0,Ki.safeExecuteInTheMiddle)(()=>_(d,c,f),T=>{T&&(d.setAttribute("sentry.hook.error","requestHook failed"),It&&N.error(`Error in requestHook for ${jy} integration:`,T))},!0);let g=this;g.resolve=new Proxy(g.resolve,{apply:(T,A,R)=>{try{o._setOperationName(d,c,R?.[0]?.command),d.end()}catch(b){It&&N.error("Error ending span in resolve callback:",b)}return Reflect.apply(T,A,R)}}),g.reject=new Proxy(g.reject,{apply:(T,A,R)=>{try{d.setStatus({code:2,message:R?.[0]?.message||"unknown_error"}),d.setAttribute(_E,R?.[0]?.code||"unknown"),d.setAttribute(hE,R?.[0]?.name||"unknown"),o._setOperationName(d,c),d.end()}catch(b){It&&N.error("Error ending span in reject callback:",b)}return Reflect.apply(T,A,R)}});try{return r.apply(this,i)}catch(T){throw d.setStatus({code:2,message:T instanceof Error?T.message:"unknown_error"}),d.end(),T}})};s.__sentryWrapped=!0,e.handle=s}_shouldCreateSpans(){let e=this.getConfig();return de.getSpan(V.active())!==void 0||!e.requireParentSpan}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(e){let n=this,r=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...o){if(this[BZ])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let s=n._reconstructQuery(this.strings),i=n._sanitizeSqlQuery(s);return At({name:i||"postgresjs.query",op:"db"},a=>{Ve(a,"auto.db.postgresjs"),a.setAttributes({[_a]:"postgres",[mE]:i});let c=n.getConfig(),{requestHook:d}=c;d&&(0,Ki.safeExecuteInTheMiddle)(()=>d(a,i,void 0),_=>{_&&(a.setAttribute("sentry.hook.error","requestHook failed"),It&&N.error(`Error in requestHook for ${jy} integration:`,_))},!0);let f=this.resolve;this.resolve=new Proxy(f,{apply:(_,g,T)=>{try{n._setOperationName(a,i,T?.[0]?.command),a.end()}catch(A){It&&N.error("Error ending span in resolve callback:",A)}return Reflect.apply(_,g,T)}});let m=this.reject;this.reject=new Proxy(m,{apply:(_,g,T)=>{try{a.setStatus({code:2,message:T?.[0]?.message||"unknown_error"}),a.setAttribute(_E,T?.[0]?.code||"unknown"),a.setAttribute(hE,T?.[0]?.name||"unknown"),n._setOperationName(a,i),a.end()}catch(A){It&&N.error("Error ending span in reject callback:",A)}return Reflect.apply(_,g,T)}});try{return r.apply(this,o)}catch(_){throw a.setStatus({code:2,message:_ instanceof Error?_.message:"unknown_error"}),a.end(),_}})},e.Query.prototype.handle.__sentry_original__=r,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},HGe=(t=>({name:jy,setupOnce(){$Z(t)}})),FZ=HGe});var VZ=y(uh=>{"use strict";p();u();l();Object.defineProperty(uh,"__esModule",{value:!0});uh.SeverityNumber=void 0;var VGe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(VGe=uh.SeverityNumber||(uh.SeverityNumber={}))});var By=y(Ed=>{"use strict";p();u();l();Object.defineProperty(Ed,"__esModule",{value:!0});Ed.NOOP_LOGGER=Ed.NoopLogger=void 0;var Gy=class{emit(e){}};Ed.NoopLogger=Gy;Ed.NOOP_LOGGER=new Gy});var Fy=y(Td=>{"use strict";p();u();l();Object.defineProperty(Td,"__esModule",{value:!0});Td.NOOP_LOGGER_PROVIDER=Td.NoopLoggerProvider=void 0;var qGe=By(),$y=class{getLogger(e,n,r){return new qGe.NoopLogger}};Td.NoopLoggerProvider=$y;Td.NOOP_LOGGER_PROVIDER=new $y});var HM=y(Hy=>{"use strict";p();u();l();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.ProxyLogger=void 0;var YGe=By(),FM=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):YGe.NOOP_LOGGER}};Hy.ProxyLogger=FM});var qM=y(Vy=>{"use strict";p();u();l();Object.defineProperty(Vy,"__esModule",{value:!0});Vy.ProxyLoggerProvider=void 0;var WGe=Fy(),KGe=HM(),VM=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new KGe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:WGe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};Vy.ProxyLoggerProvider=VM});var qZ=y(qy=>{"use strict";p();u();l();Object.defineProperty(qy,"__esModule",{value:!0});qy._globalThis=void 0;qy._globalThis=typeof globalThis=="object"?globalThis:global});var YZ=y(Yy=>{"use strict";p();u();l();Object.defineProperty(Yy,"__esModule",{value:!0});Yy._globalThis=void 0;var zGe=qZ();Object.defineProperty(Yy,"_globalThis",{enumerable:!0,get:function(){return zGe._globalThis}})});var WZ=y(Wy=>{"use strict";p();u();l();Object.defineProperty(Wy,"__esModule",{value:!0});Wy._globalThis=void 0;var XGe=YZ();Object.defineProperty(Wy,"_globalThis",{enumerable:!0,get:function(){return XGe._globalThis}})});var KZ=y(Zs=>{"use strict";p();u();l();Object.defineProperty(Zs,"__esModule",{value:!0});Zs.API_BACKWARDS_COMPATIBILITY_VERSION=Zs.makeGetter=Zs._global=Zs.GLOBAL_LOGS_API_KEY=void 0;var QGe=WZ();Zs.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Zs._global=QGe._globalThis;function JGe(t,e,n){return r=>r===t?e:n}Zs.makeGetter=JGe;Zs.API_BACKWARDS_COMPATIBILITY_VERSION=1});var XZ=y(Ky=>{"use strict";p();u();l();Object.defineProperty(Ky,"__esModule",{value:!0});Ky.LogsAPI=void 0;var jo=KZ(),ZGe=Fy(),zZ=qM(),YM=class t{constructor(){this._proxyLoggerProvider=new zZ.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return jo._global[jo.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(jo._global[jo.GLOBAL_LOGS_API_KEY]=(0,jo.makeGetter)(jo.API_BACKWARDS_COMPATIBILITY_VERSION,e,ZGe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=jo._global[jo.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(jo._global,jo.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete jo._global[jo.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new zZ.ProxyLoggerProvider}};Ky.LogsAPI=YM});var WM=y(mn=>{"use strict";p();u();l();Object.defineProperty(mn,"__esModule",{value:!0});mn.logs=mn.ProxyLoggerProvider=mn.ProxyLogger=mn.NoopLoggerProvider=mn.NOOP_LOGGER_PROVIDER=mn.NoopLogger=mn.NOOP_LOGGER=mn.SeverityNumber=void 0;var eBe=VZ();Object.defineProperty(mn,"SeverityNumber",{enumerable:!0,get:function(){return eBe.SeverityNumber}});var QZ=By();Object.defineProperty(mn,"NOOP_LOGGER",{enumerable:!0,get:function(){return QZ.NOOP_LOGGER}});Object.defineProperty(mn,"NoopLogger",{enumerable:!0,get:function(){return QZ.NoopLogger}});var JZ=Fy();Object.defineProperty(mn,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return JZ.NOOP_LOGGER_PROVIDER}});Object.defineProperty(mn,"NoopLoggerProvider",{enumerable:!0,get:function(){return JZ.NoopLoggerProvider}});var tBe=HM();Object.defineProperty(mn,"ProxyLogger",{enumerable:!0,get:function(){return tBe.ProxyLogger}});var nBe=qM();Object.defineProperty(mn,"ProxyLoggerProvider",{enumerable:!0,get:function(){return nBe.ProxyLoggerProvider}});var rBe=XZ();mn.logs=rBe.LogsAPI.getInstance()});var ZZ=y(Sd=>{"use strict";p();u();l();Object.defineProperty(Sd,"__esModule",{value:!0});Sd.disableInstrumentations=Sd.enableInstrumentations=void 0;function oBe(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Sd.enableInstrumentations=oBe;function sBe(t){t.forEach(e=>e.disable())}Sd.disableInstrumentations=sBe});var n7=y(zy=>{"use strict";p();u();l();Object.defineProperty(zy,"__esModule",{value:!0});zy.registerInstrumentations=void 0;var e7=(U(),D(J)),iBe=WM(),t7=ZZ();function aBe(t){let e=t.tracerProvider||e7.trace.getTracerProvider(),n=t.meterProvider||e7.metrics.getMeterProvider(),r=t.loggerProvider||iBe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,t7.enableInstrumentations)(o,e,n,r),()=>{(0,t7.disableInstrumentations)(o)}}zy.registerInstrumentations=aBe});var p7=y(Xy=>{"use strict";p();u();l();Object.defineProperty(Xy,"__esModule",{value:!0});Xy.satisfies=void 0;var QM=(U(),D(J)),a7=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,cBe=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,uBe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function lBe(t,e,n){if(!pBe(t))return QM.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=_Be(t);if(!r)return!1;let o=[],s=c7(r,e,o,n);return s&&!n?.includePrerelease?fBe(r,o):s}Xy.satisfies=lBe;function pBe(t){return typeof t=="string"&&a7.test(t)}function c7(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(KM(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=UBe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!KM(t,s,n,r))return!1;return!0}return KM(t,e,n,r)}function KM(t,e,n,r){if(e=mBe(e,r),e.includes(" "))return c7(t,e,n,r);{let o=hBe(e);return n.push(o),dBe(t,o)}}function dBe(t,e){if(e.invalid)return!1;if(!e.version||XM(e.version))return!0;let n=o7(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=o7(r,o)}return uBe[e.op]?.includes(n)}function fBe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function mBe(t,e){return t=t.trim(),t=wBe(t,e),t=LBe(t),t=DBe(t,e),t=t.trim(),t}function Sr(t){return!t||t.toLowerCase()==="x"||t==="*"}function _Be(t){let e=t.match(a7);if(!e){QM.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function hBe(t){if(!t)return{};let e=t.match(cBe);if(!e)return QM.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function XM(t){return t==="*"||t==="x"||t==="X"}function r7(t){let e=parseInt(t,10);return isNaN(e)?t:e}function gBe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function EBe(t,e){if(XM(t)||XM(e))return 0;let[n,r]=gBe(r7(t),r7(e));return n>r?1:n<r?-1:0}function o7(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=EBe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var u7="[a-zA-Z0-9-]",l7="0|[1-9]\\d*",TBe=`\\d*[a-zA-Z-]${u7}*`,SBe="((?:<|>)?=?)",s7=`(?:${l7}|${TBe})`,ABe=`(?:-(${s7}(?:\\.${s7})*))`,i7=`${u7}+`,yBe=`(?:\\+(${i7}(?:\\.${i7})*))`,zM=`${l7}|x|X|\\*`,lh=`[v=\\s]*(${zM})(?:\\.(${zM})(?:\\.(${zM})(?:${ABe})?${yBe}?)?)?`,RBe=`^${SBe}\\s*${lh}$`,IBe=new RegExp(RBe),NBe=`^\\s*(${lh})\\s+-\\s+(${lh})\\s*$`,bBe=new RegExp(NBe),OBe="(?:~>?)",CBe=`^${OBe}${lh}$`,PBe=new RegExp(CBe),xBe="(?:\\^)",vBe=`^${xBe}${lh}$`,MBe=new RegExp(vBe);function LBe(t){let e=PBe;return t.replace(e,(n,r,o,s,i)=>{let a;return Sr(r)?a="":Sr(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:Sr(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function wBe(t,e){let n=MBe,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let d;return Sr(s)?d="":Sr(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Sr(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function DBe(t,e){let n=IBe;return t.replace(n,(r,o,s,i,a,c)=>{let d=Sr(s),f=d||Sr(i),m=f||Sr(a),_=m;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(f&&(i=0),a=0,o===">"?(o=">=",f?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",f?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):f?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function UBe(t,e){let n=bBe;return t.replace(n,(r,o,s,i,a,c,d,f,m,_,g,T)=>(Sr(s)?o="":Sr(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Sr(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Sr(m)?f="":Sr(_)?f=`<${+m+1}.0.0-0`:Sr(g)?f=`<${m}.${+_+1}.0-0`:T?f=`<=${m}.${_}.${g}-${T}`:e?.includePrerelease?f=`<${m}.${_}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}});var JM=y(Nn=>{"use strict";p();u();l();Object.defineProperty(Nn,"__esModule",{value:!0});Nn.massUnwrap=Nn.unwrap=Nn.massWrap=Nn.wrap=void 0;var Ar=console.error.bind(console);function ph(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var kBe=(t,e,n)=>{if(!t||!t[e]){Ar("no original function "+String(e)+" to wrap");return}if(!n){Ar("no wrapper function"),Ar(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Ar("original object and wrapper must be functions");return}let o=n(r,e);return ph(o,"__original",r),ph(o,"__unwrap",()=>{t[e]===o&&ph(t,e,r)}),ph(o,"__wrapped",!0),ph(t,e,o),o};Nn.wrap=kBe;var jBe=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Ar("must provide one or more modules to patch"),Ar(new Error().stack);return}if(!(e&&Array.isArray(e))){Ar("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Nn.wrap)(r,o,n)})})};Nn.massWrap=jBe;var GBe=(t,e)=>{if(!t||!t[e]){Ar("no function to unwrap."),Ar(new Error().stack);return}let n=t[e];if(!n.__unwrap)Ar("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Nn.unwrap=GBe;var BBe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Ar("must provide one or more modules to patch"),Ar(new Error().stack);return}if(!(e&&Array.isArray(e))){Ar("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Nn.unwrap)(n,r)})})};Nn.massUnwrap=BBe;function dh(t){t&&t.logger&&(typeof t.logger!="function"?Ar("new logger isn't a function, not replacing"):Ar=t.logger)}Nn.default=dh;dh.wrap=Nn.wrap;dh.massWrap=Nn.massWrap;dh.unwrap=Nn.unwrap;dh.massUnwrap=Nn.massUnwrap});var d7=y(Jy=>{"use strict";p();u();l();Object.defineProperty(Jy,"__esModule",{value:!0});Jy.InstrumentationAbstract=void 0;var ZM=(U(),D(J)),$Be=WM(),Qy=JM(),eL=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=ZM.diag.createComponentLogger({namespace:e}),this._tracer=ZM.trace.getTracer(e,n),this._meter=ZM.metrics.getMeter(e,n),this._logger=$Be.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=Qy.wrap;_unwrap=Qy.unwrap;_massWrap=Qy.massWrap;_massUnwrap=Qy.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};Jy.InstrumentationAbstract=eL});var f7=y(uc=>{"use strict";p();u();l();Object.defineProperty(uc,"__esModule",{value:!0});uc.ModuleNameTrie=uc.ModuleNameSeparator=void 0;uc.ModuleNameSeparator="/";var Zy=class{hooks=[];children=new Map},tL=class{_trie=new Zy;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(uc.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new Zy,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(uc.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};uc.ModuleNameTrie=tL});var _7=y(eR=>{"use strict";p();u();l();Object.defineProperty(eR,"__esModule",{value:!0});eR.RequireInTheMiddleSingleton=void 0;var FBe=om(),m7=require("path"),nL=f7(),HBe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),rL=class t{_moduleNameTrie=new nL.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new FBe.Hook(null,{internals:!0},(e,n,r)=>{let o=VBe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return HBe?new t:this._instance=this._instance??new t}};eR.RequireInTheMiddleSingleton=rL;function VBe(t){return m7.sep!==nL.ModuleNameSeparator?t.split(m7.sep).join(nL.ModuleNameSeparator):t}});var A7=y(Fu=>{p();u();l();var h7=[],oL=new WeakMap,g7=new WeakMap,E7=new Map,T7=[],qBe={set(t,e,n){let r=oL.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=g7.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=oL.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function YBe(t,e,n,r,o){E7.set(t,o),oL.set(e,n),g7.set(e,r);let s=new Proxy(e,qBe);h7.forEach(i=>i(t,s,o)),T7.push([t,s,o])}var S7=!1;function WBe(){return S7}function KBe(t){S7=t}Fu.register=YBe;Fu.importHooks=h7;Fu.specifiers=E7;Fu.toHook=T7;Fu.getExperimentalPatchInternals=WBe;Fu.setExperimentalPatchInternals=KBe});var O7=y((KGt,Ad)=>{p();u();l();var y7=require("path"),zBe=ZE(),{fileURLToPath:R7}=require("url"),{MessageChannel:XBe}=require("worker_threads"),{importHooks:sL,specifiers:QBe,toHook:JBe,getExperimentalPatchInternals:ZBe}=A7();function N7(t){sL.push(t),JBe.forEach(([e,n,r])=>t(e,n,r))}function b7(t){let e=sL.indexOf(t);e>-1&&sL.splice(e,1)}function I7(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var iL;function e$e(){let{port1:t,port2:e}=new XBe,n=0,r;iL=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(d=>{r=d}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function fh(t,e,n){if(!(this instanceof fh))return new fh(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;iL&&Array.isArray(t)&&iL(t),this._iitmHook=(o,s,i)=>{let a=o,c=o.startsWith("node:"),d;if(c)o=o.replace(/^node:/,"");else{if(o.startsWith("file://")){let m=Error.stackTraceLimit;Error.stackTraceLimit=0;try{o=R7(o)}catch{}Error.stackTraceLimit=m}let f=zBe(o);f&&(o=f.name,d=f.basedir)}if(t)for(let f of t){let m=f===o,_=f===i;if(m||_){if(d){if(r)o=o+y7.sep+y7.relative(d,R7(a));else if(!ZBe()&&!_&&!d.endsWith(QBe.get(a)))continue}I7(n,s,o,d)}}else I7(n,s,o,d)},N7(this._iitmHook)}fh.prototype.unhook=function(){b7(this._iitmHook)};Ad.exports=fh;Ad.exports.Hook=fh;Ad.exports.addHook=N7;Ad.exports.removeHook=b7;Ad.exports.createAddHookMessageChannel=e$e});var aL=y(lc=>{"use strict";p();u();l();Object.defineProperty(lc,"__esModule",{value:!0});lc.isWrapped=lc.safeExecuteInTheMiddleAsync=lc.safeExecuteInTheMiddle=void 0;function t$e(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}lc.safeExecuteInTheMiddle=t$e;async function n$e(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}lc.safeExecuteInTheMiddleAsync=n$e;function r$e(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}lc.isWrapped=r$e});var x7=y(tR=>{"use strict";p();u();l();Object.defineProperty(tR,"__esModule",{value:!0});tR.InstrumentationBase=void 0;var mh=require("path"),C7=require("util"),o$e=p7(),cL=JM(),s$e=d7(),i$e=_7(),a$e=O7(),_h=(U(),D(J)),c$e=om(),u$e=require("fs"),l$e=aL(),uL=class extends s$e.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=i$e.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,l$e.isWrapped)(e[n])&&this._unwrap(e,n),C7.types.isProxy(e)){let o=(0,cL.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,cL.wrap)(e,n,r)};_unwrap=(e,n)=>C7.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,cL.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{_h.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){_h.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{_h.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){_h.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=require.resolve(n);require.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,u$e.readFileSync)(mh.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{_h.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return P7(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=mh.normalize(r);return i.filter(d=>d.name===a).filter(d=>P7(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&mh.isAbsolute(a)){let d=mh.parse(a);a=d.name,c=d.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=mh.isAbsolute(e.name)?new c$e.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new a$e.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};tR.InstrumentationBase=uL;function P7(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,o$e.satisfies)(e,r,{includePrerelease:n}))}});var v7=y(nR=>{"use strict";p();u();l();Object.defineProperty(nR,"__esModule",{value:!0});nR.normalize=void 0;var p$e=require("path");Object.defineProperty(nR,"normalize",{enumerable:!0,get:function(){return p$e.normalize}})});var M7=y(yd=>{"use strict";p();u();l();Object.defineProperty(yd,"__esModule",{value:!0});yd.normalize=yd.InstrumentationBase=void 0;var d$e=x7();Object.defineProperty(yd,"InstrumentationBase",{enumerable:!0,get:function(){return d$e.InstrumentationBase}});var f$e=v7();Object.defineProperty(yd,"normalize",{enumerable:!0,get:function(){return f$e.normalize}})});var lL=y(Rd=>{"use strict";p();u();l();Object.defineProperty(Rd,"__esModule",{value:!0});Rd.normalize=Rd.InstrumentationBase=void 0;var L7=M7();Object.defineProperty(Rd,"InstrumentationBase",{enumerable:!0,get:function(){return L7.InstrumentationBase}});Object.defineProperty(Rd,"normalize",{enumerable:!0,get:function(){return L7.normalize}})});var w7=y(rR=>{"use strict";p();u();l();Object.defineProperty(rR,"__esModule",{value:!0});rR.InstrumentationNodeModuleDefinition=void 0;var pL=class{name;supportedVersions;patch;unpatch;files;constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};rR.InstrumentationNodeModuleDefinition=pL});var D7=y(oR=>{"use strict";p();u();l();Object.defineProperty(oR,"__esModule",{value:!0});oR.InstrumentationNodeModuleFile=void 0;var m$e=lL(),dL=class{supportedVersions;patch;unpatch;name;constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,m$e.normalize)(e)}};oR.InstrumentationNodeModuleFile=dL});var U7=y(Hu=>{"use strict";p();u();l();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.semconvStabilityFromStr=Hu.SemconvStability=void 0;var sR;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(sR=Hu.SemconvStability||(Hu.SemconvStability={}));function _$e(t,e){let n=sR.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=sR.DUPLICATE;break}else o.toLowerCase()===t&&(n=sR.STABLE);return n}Hu.semconvStabilityFromStr=_$e});var j7=y(Kt=>{"use strict";p();u();l();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.semconvStabilityFromStr=Kt.SemconvStability=Kt.safeExecuteInTheMiddleAsync=Kt.safeExecuteInTheMiddle=Kt.isWrapped=Kt.InstrumentationNodeModuleFile=Kt.InstrumentationNodeModuleDefinition=Kt.InstrumentationBase=Kt.registerInstrumentations=void 0;var h$e=n7();Object.defineProperty(Kt,"registerInstrumentations",{enumerable:!0,get:function(){return h$e.registerInstrumentations}});var g$e=lL();Object.defineProperty(Kt,"InstrumentationBase",{enumerable:!0,get:function(){return g$e.InstrumentationBase}});var E$e=w7();Object.defineProperty(Kt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return E$e.InstrumentationNodeModuleDefinition}});var T$e=D7();Object.defineProperty(Kt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return T$e.InstrumentationNodeModuleFile}});var fL=aL();Object.defineProperty(Kt,"isWrapped",{enumerable:!0,get:function(){return fL.isWrapped}});Object.defineProperty(Kt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return fL.safeExecuteInTheMiddle}});Object.defineProperty(Kt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return fL.safeExecuteInTheMiddleAsync}});var k7=U7();Object.defineProperty(Kt,"SemconvStability",{enumerable:!0,get:function(){return k7.SemconvStability}});Object.defineProperty(Kt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return k7.semconvStabilityFromStr}})});function y$e(){let t=Id[_L];return t?.helper?t.helper:Id[mL]?.helper}function R$e(t){let e={helper:t};Id[_L]=e,Id[mL]=e}function I$e(){delete Id[_L],delete Id[mL]}function O$e(t){switch(t){case"client":return Ze.CLIENT;case"internal":default:return Ze.INTERNAL}}function $7(t,e,n,r,o){if(F7(e.name,o))return;let s={attributes:e.attributes,kind:O$e(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(c=>{let d=r.get(c);return d?{context:{spanId:d,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===e.id);for(let c of a)$7(t,c,n,r,o);i.end(e.endTime)})}function G7(t,e){return P$e(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function P$e(t){return t!=null&&typeof t.then=="function"}function F7(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var iR,S$e,A$e,mL,_L,Id,N$e,b$e,C$e,H7,B7,x$e,v$e,V7,q7=S(()=>{p();u();l();U();iR=j(j7(),1);U();S$e={name:"@prisma/instrumentation-contract",version:"7.2.0",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}},A$e=S$e.version.split(".")[0],mL="PRISMA_INSTRUMENTATION",_L=`V${A$e}_PRISMA_INSTRUMENTATION`,Id=globalThis;N$e=process.env.PRISMA_SHOW_ALL_TRACES==="true",b$e="00-10-10-00";C$e=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:t,ignoreSpanTypes:e}){this.tracerProvider=t,this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(t){let e=de.getSpanContext(t??V.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:b$e}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)$7(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return V.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!N$e)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(F7(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return G7(s,e(s,r))}return n.startActiveSpan(o,t,s=>G7(s,e(s,r)))}};H7={name:"@prisma/instrumentation",version:"7.2.0",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@opentelemetry/api":"1.9.0","@prisma/instrumentation-contract":"workspace:*","@types/node":"~20.19.24",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.207.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},sideEffects:!1},B7=H7.version,x$e=H7.name,v$e="@prisma/client",V7=class extends iR.InstrumentationBase{tracerProvider;constructor(t={}){super(x$e,B7,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new iR.InstrumentationNodeModuleDefinition(v$e,[B7])]}enable(){let t=this._config;R$e(new C$e({tracerProvider:this.tracerProvider??de.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]}))}disable(){I$e()}isEnabled(){return y$e()!==void 0}}});function M$e(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function W7(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}function L$e(t){switch(t){case"client":return Ze.CLIENT;case"internal":default:return Ze.INTERNAL}}var Y7,hL,w$e,K7,z7=S(()=>{p();u();l();U();q7();ne();je();Y7="Prisma";hL=class extends V7{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=W7();M$e(e)&&(e.createEngineSpan=n=>{let r=de.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){wt(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(s=>{let i=L$e(s.kind),a=s.parent_span_id,c=s.span_id,d=s.trace_id,f=s.links?.map(_=>({context:{traceId:_.trace_id,spanId:_.span_id,traceFlags:rr.SAMPLED}})),m=de.setSpanContext(V.active(),{traceId:d,spanId:a,traceFlags:rr.SAMPLED});V.with(m,()=>{let _={generateTraceId:()=>d,generateSpanId:()=>c};r._idGenerator=_,r.startSpan(s.name,{kind:i,links:f,startTime:s.start_time,attributes:s.attributes}).end(s.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};w$e=Z(Y7,t=>new hL(t)),K7=t=>({name:Y7,setupOnce(){w$e(t)},setup(e){W7()&&e.on("spanStart",n=>{let r=ae(n);r.description?.startsWith("prisma:")&&n.setAttribute(fe,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}})});var X7=y(Nd=>{"use strict";p();u();l();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.PACKAGE_NAME=Nd.PACKAGE_VERSION=void 0;Nd.PACKAGE_VERSION="0.57.0";Nd.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var gL=y(ei=>{"use strict";p();u();l();Object.defineProperty(ei,"__esModule",{value:!0});ei.HapiLifecycleMethodNames=ei.HapiLayerType=ei.handlerPatched=ei.HapiComponentName=void 0;ei.HapiComponentName="@hapi/hapi";ei.handlerPatched=Symbol("hapi-handler-patched");ei.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};ei.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var Q7=y(aR=>{"use strict";p();u();l();Object.defineProperty(aR,"__esModule",{value:!0});aR.ATTR_HTTP_METHOD=void 0;aR.ATTR_HTTP_METHOD="http.method"});var EL=y(hh=>{"use strict";p();u();l();Object.defineProperty(hh,"__esModule",{value:!0});hh.AttributeNames=void 0;var D$e;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(D$e=hh.AttributeNames||(hh.AttributeNames={}))});var eee=y(zt=>{"use strict";p();u();l();Object.defineProperty(zt,"__esModule",{value:!0});zt.getPluginFromInput=zt.getExtMetadata=zt.getRouteMetadata=zt.isPatchableExtMethod=zt.isDirectExtInput=zt.isLifecycleExtEventObj=zt.isLifecycleExtType=zt.getPluginName=void 0;var J7=(Le(),D(Xe)),U$e=Q7(),gh=gL(),pc=EL(),Z7=he();function k$e(t){return t.name?t.name:t.pkg.name}zt.getPluginName=k$e;var j$e=t=>typeof t=="string"&&gh.HapiLifecycleMethodNames.has(t);zt.isLifecycleExtType=j$e;var G$e=t=>{let e=t?.type;return e!==void 0&&(0,zt.isLifecycleExtType)(e)};zt.isLifecycleExtEventObj=G$e;var B$e=t=>Array.isArray(t)&&t.length<=3&&(0,zt.isLifecycleExtType)(t[0])&&typeof t[1]=="function";zt.isDirectExtInput=B$e;var $$e=t=>!Array.isArray(t);zt.isPatchableExtMethod=$$e;var F$e=(t,e,n)=>{let r={[J7.ATTR_HTTP_ROUTE]:t.path};e&Z7.SemconvStability.OLD&&(r[U$e.ATTR_HTTP_METHOD]=t.method),e&Z7.SemconvStability.STABLE&&(r[J7.ATTR_HTTP_REQUEST_METHOD]=t.method);let o;return n?(r[pc.AttributeNames.HAPI_TYPE]=gh.HapiLayerType.PLUGIN,r[pc.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${t.path}`):(r[pc.AttributeNames.HAPI_TYPE]=gh.HapiLayerType.ROUTER,o=`route - ${t.path}`),{attributes:r,name:o}};zt.getRouteMetadata=F$e;var H$e=(t,e)=>e?{attributes:{[pc.AttributeNames.EXT_TYPE]:t,[pc.AttributeNames.HAPI_TYPE]:gh.HapiLayerType.EXT,[pc.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ext - ${t}`}:{attributes:{[pc.AttributeNames.EXT_TYPE]:t,[pc.AttributeNames.HAPI_TYPE]:gh.HapiLayerType.EXT},name:`ext - ${t}`};zt.getExtMetadata=H$e;var V$e=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;zt.getPluginFromInput=V$e});var ree=y(cR=>{"use strict";p();u();l();Object.defineProperty(cR,"__esModule",{value:!0});cR.HapiInstrumentation=void 0;var so=(U(),D(J)),tee=Be(),Eh=he(),nee=X7(),Th=gL(),zi=eee(),TL=class extends Eh.InstrumentationBase{_semconvStability;constructor(e={}){super(nee.PACKAGE_NAME,nee.PACKAGE_VERSION,e),this._semconvStability=(0,Eh.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Eh.InstrumentationNodeModuleDefinition(Th.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Eh.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,Eh.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,zi.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,zi.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let c=i[a];if((0,zi.isLifecycleExtType)(c.type)){let d=c,f=r._wrapExtMethods(d.method,c.type,n);d.method=f,i[a]=d}}return e.apply(this,s)}else if((0,zi.isDirectExtInput)(s)){let i=s,a=i[1],c=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],c,i[2]])}else if((0,zi.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,zi.getPluginName)(e),o=e.register,s=this,i=function(a,c){return s._wrap(a,"route",d=>n._getServerRoutePatch.bind(n)(d,r)),s._wrap(a,"ext",d=>n._getServerExtPatch.bind(n)(d,r)),o.call(this,a,c)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,zi.isPatchableExtMethod)(e))return e[Th.handlerPatched]===!0?e:(e[Th.handlerPatched]=!0,async function(...i){if(so.trace.getSpan(so.context.active())===void 0)return await e.apply(this,i);let a=(0,zi.getExtMetadata)(n,r),c=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await so.context.with(so.trace.setSpan(so.context.active(),c),e,void 0,...i)}catch(d){throw c.recordException(d),c.setStatus({code:so.SpanStatusCode.ERROR,message:d.message}),d}finally{c.end()}});return e}_wrapRouteHandler(e,n){let r=this;if(e[Th.handlerPatched]===!0)return e;e[Th.handlerPatched]=!0;let o=s=>async function(...i){if(so.trace.getSpan(so.context.active())===void 0)return await s.call(this,...i);let a=(0,tee.getRPCMetadata)(so.context.active());a?.type===tee.RPCType.HTTP&&(a.route=e.path);let c=(0,zi.getRouteMetadata)(e,r._semconvStability,n),d=r.tracer.startSpan(c.name,{attributes:c.attributes});try{return await so.context.with(so.trace.setSpan(so.context.active(),d),()=>s.call(this,...i))}catch(f){throw d.recordException(f),d.setStatus({code:so.SpanStatusCode.ERROR,message:f.message}),f}finally{d.end()}};if(typeof e.handler=="function")e.handler=o(e.handler);else if(typeof e.options=="function"){let s=e.options;e.options=function(i){let a=s(i);return typeof a.handler=="function"&&(a.handler=o(a.handler)),a}}else typeof e.options?.handler=="function"&&(e.options.handler=o(e.options.handler));return e}};cR.HapiInstrumentation=TL});var oee=y(bd=>{"use strict";p();u();l();Object.defineProperty(bd,"__esModule",{value:!0});bd.AttributeNames=bd.HapiInstrumentation=void 0;var q$e=ree();Object.defineProperty(bd,"HapiInstrumentation",{enumerable:!0,get:function(){return q$e.HapiInstrumentation}});var Y$e=EL();Object.defineProperty(bd,"AttributeNames",{enumerable:!0,get:function(){return Y$e.AttributeNames}})});var see,iee,aee,W$e,cee,uee=S(()=>{p();u();l();see=j(oee(),1);je();iee="Hapi",aee=Z(iee,()=>new see.HapiInstrumentation),W$e=(()=>({name:iee,setupOnce(){aee()}})),cee=W$e});var dc,Sh,SL=S(()=>{p();u();l();dc={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Sh={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var lR,K$e,z$e,uR,lee=S(()=>{p();u();l();U();lR=j(he(),1);ne();SL();K$e="@sentry/instrumentation-hono",z$e="0.0.1",uR=class extends lR.InstrumentationBase{constructor(e={}){super(K$e,z$e,e)}init(){return[new lR.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],e=>this._patch(e))]}_patch(e){let n=this;class r extends e.Hono{constructor(...s){super(...s),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{e.Hono=r}catch{return{...e,Hono:r}}return e}_patchHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_patchOnHandler(){let e=this;return function(n){return function(...o){let s=o.slice(2);return n.apply(this,[...o.slice(0,2),...s.map(i=>e._wrapHandler(i))])}}}_patchMiddlewareHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_wrapHandler(e){let n=this;return function(r,o){if(!n.isEnabled())return e.apply(this,[r,o]);let s=r.req.path,i=n.tracer.startSpan(s);return V.with(de.setSpan(V.active(),i),()=>n._safeExecute(()=>{let a=e.apply(this,[r,o]);if(ur(a))return a.then(c=>{let d=n._determineHandlerType(c);return i.setAttributes({[dc.HONO_TYPE]:d,[dc.HONO_NAME]:d===Sh.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),c});{let c=n._determineHandlerType(a);return i.setAttributes({[dc.HONO_TYPE]:c,[dc.HONO_NAME]:c===Sh.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),a}},()=>i.end(),a=>{n._handleError(i,a),i.end()}))}}_safeExecute(e,n,r){try{let o=e();return ur(o)?o.then(()=>n(),s=>r(s)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(e){return e===void 0?Sh.MIDDLEWARE:Sh.REQUEST_HANDLER}_handleError(e,n){n instanceof Error&&(e.setStatus({code:it.ERROR,message:n.message}),e.recordException(n))}}});function X$e(t){let e=ae(t).data,n=e[dc.HONO_TYPE];if(e[ge]||!n)return;t.setAttributes({[fe]:"auto.http.otel.hono",[ge]:`${n}.hono`});let r=e[dc.HONO_NAME];if(typeof r=="string"&&t.updateName(r),Te()===Ro()){It&&N.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=e[br],s=e[Ai];typeof o=="string"&&typeof s=="string"&&Te().setTransactionName(`${s} ${o}`)}var pee,dee,Q$e,fee,mee=S(()=>{p();u();l();Le();ne();je();Du();SL();lee();pee="Hono";dee=Z(pee,()=>new uR({responseHook:t=>{X$e(t)}})),Q$e=(()=>({name:pee,setupOnce(){dee()}})),fee=Q$e});var pR=y(Ah=>{"use strict";p();u();l();Object.defineProperty(Ah,"__esModule",{value:!0});Ah.KoaLayerType=void 0;var J$e;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(J$e=Ah.KoaLayerType||(Ah.KoaLayerType={}))});var _ee=y(Od=>{"use strict";p();u();l();Object.defineProperty(Od,"__esModule",{value:!0});Od.PACKAGE_NAME=Od.PACKAGE_VERSION=void 0;Od.PACKAGE_VERSION="0.59.0";Od.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var AL=y(yh=>{"use strict";p();u();l();Object.defineProperty(yh,"__esModule",{value:!0});yh.AttributeNames=void 0;var Z$e;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(Z$e=yh.AttributeNames||(yh.AttributeNames={}))});var gee=y(Cd=>{"use strict";p();u();l();Object.defineProperty(Cd,"__esModule",{value:!0});Cd.isLayerIgnored=Cd.getMiddlewareMetadata=void 0;var hee=pR(),dR=AL(),eFe=(Le(),D(Xe)),tFe=(t,e,n,r)=>n?{attributes:{[dR.AttributeNames.KOA_NAME]:r?.toString(),[dR.AttributeNames.KOA_TYPE]:hee.KoaLayerType.ROUTER,[eFe.ATTR_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[dR.AttributeNames.KOA_NAME]:e.name??"middleware",[dR.AttributeNames.KOA_TYPE]:hee.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`};Cd.getMiddlewareMetadata=tFe;var nFe=(t,e)=>!!(Array.isArray(e?.ignoreLayersType)&&e?.ignoreLayersType?.includes(t));Cd.isLayerIgnored=nFe});var Eee=y(fR=>{"use strict";p();u();l();Object.defineProperty(fR,"__esModule",{value:!0});fR.kLayerPatched=void 0;fR.kLayerPatched=Symbol("koa-layer-patched")});var Iee=y(mR=>{"use strict";p();u();l();Object.defineProperty(mR,"__esModule",{value:!0});mR.KoaInstrumentation=void 0;var ti=(U(),D(J)),Rh=he(),Tee=pR(),See=_ee(),Aee=gee(),yee=Be(),Ree=Eee(),yL=class extends Rh.InstrumentationBase{constructor(e={}){super(See.PACKAGE_NAME,See.PACKAGE_VERSION,e)}init(){return new Rh.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Rh.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Rh.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){ti.diag.debug("Patching @koa/router dispatch");let r=e.router?.stack??[];for(let o of r){let s=o.path,i=o.stack;for(let a=0;a<i.length;a++){let c=i[a];i[a]=this._patchLayer(c,!0,s)}}return e}_patchLayer(e,n,r){let o=n?Tee.KoaLayerType.ROUTER:Tee.KoaLayerType.MIDDLEWARE;return e[Ree.kLayerPatched]===!0||(0,Aee.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(ti.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[Ree.kLayerPatched]=!0,ti.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(ti.trace.getSpan(ti.context.active())===void 0)return e(s,i);let c=(0,Aee.getMiddlewareMetadata)(s,e,n,r),d=this.tracer.startSpan(c.name,{attributes:c.attributes}),f=(0,yee.getRPCMetadata)(ti.context.active());f?.type===yee.RPCType.HTTP&&s._matchedRoute&&(f.route=s._matchedRoute.toString());let{requestHook:m}=this.getConfig();m&&(0,Rh.safeExecuteInTheMiddle)(()=>m(d,{context:s,middlewareLayer:e,layerType:o}),g=>{g&&ti.diag.error("koa instrumentation: request hook failed",g)},!0);let _=ti.trace.setSpan(ti.context.active(),d);return ti.context.with(_,async()=>{try{return await e(s,i)}catch(g){throw d.recordException(g),g}finally{d.end()}})})}};mR.KoaInstrumentation=yL});var Nee=y(fc=>{"use strict";p();u();l();Object.defineProperty(fc,"__esModule",{value:!0});fc.KoaLayerType=fc.AttributeNames=fc.KoaInstrumentation=void 0;var rFe=Iee();Object.defineProperty(fc,"KoaInstrumentation",{enumerable:!0,get:function(){return rFe.KoaInstrumentation}});var oFe=AL();Object.defineProperty(fc,"AttributeNames",{enumerable:!0,get:function(){return oFe.AttributeNames}});var sFe=pR();Object.defineProperty(fc,"KoaLayerType",{enumerable:!0,get:function(){return sFe.KoaLayerType}})});var bee,Oee,Cee,iFe,Pee,xee=S(()=>{p();u();l();bee=j(Nee(),1);Le();ne();je();Du();Oee="Koa",Cee=Z(Oee,bee.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){Ve(e,"auto.http.otel.koa");let r=ae(e).data,o=r["koa.type"];o&&e.setAttribute(ge,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),Te()===Ro()){It&&N.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[br],a=n.context?.request?.method?.toUpperCase()||"GET";i&&Te().setTransactionName(`${a} ${i}`)}})),iFe=((t={})=>({name:Oee,setupOnce(){Cee(t)}})),Pee=iFe});var RL=y(_s=>{"use strict";p();u();l();Object.defineProperty(_s,"__esModule",{value:!0});_s.ConnectNames=_s.ConnectTypes=_s.AttributeNames=void 0;var aFe;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(aFe=_s.AttributeNames||(_s.AttributeNames={}));var cFe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(cFe=_s.ConnectTypes||(_s.ConnectTypes={}));var uFe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(uFe=_s.ConnectNames||(_s.ConnectNames={}))});var vee=y(Pd=>{"use strict";p();u();l();Object.defineProperty(Pd,"__esModule",{value:!0});Pd.PACKAGE_NAME=Pd.PACKAGE_VERSION=void 0;Pd.PACKAGE_VERSION="0.54.0";Pd.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var Mee=y(_R=>{"use strict";p();u();l();Object.defineProperty(_R,"__esModule",{value:!0});_R._LAYERS_STORE_PROPERTY=void 0;_R._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var Lee=y(_c=>{"use strict";p();u();l();Object.defineProperty(_c,"__esModule",{value:!0});_c.generateRoute=_c.replaceCurrentStackRoute=_c.addNewStackLayer=void 0;var lFe=(U(),D(J)),mc=Mee(),pFe=t=>{Array.isArray(t[mc._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,mc._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[mc._LAYERS_STORE_PROPERTY].push("/");let e=t[mc._LAYERS_STORE_PROPERTY].length;return()=>{e===t[mc._LAYERS_STORE_PROPERTY].length?t[mc._LAYERS_STORE_PROPERTY].pop():lFe.diag.warn("Connect: Trying to pop the stack multiple time")}};_c.addNewStackLayer=pFe;var dFe=(t,e)=>{e&&t[mc._LAYERS_STORE_PROPERTY].splice(-1,1,e)};_c.replaceCurrentStackRoute=dFe;var fFe=t=>t[mc._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);_c.generateRoute=fFe});var Uee=y(hc=>{"use strict";p();u();l();Object.defineProperty(hc,"__esModule",{value:!0});hc.ConnectInstrumentation=hc.ANONYMOUS_NAME=void 0;var mFe=(U(),D(J)),wee=Be(),xd=RL(),Dee=vee(),hR=he(),_Fe=(Le(),D(Xe)),IL=Lee();hc.ANONYMOUS_NAME="anonymous";var NL=class extends hR.InstrumentationBase{constructor(e={}){super(Dee.PACKAGE_NAME,Dee.PACKAGE_VERSION,e)}init(){return[new hR.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,hR.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,hR.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=xd.ConnectTypes.REQUEST_HANDLER,s=xd.ConnectNames.REQUEST_HANDLER,o=e):(r=xd.ConnectTypes.MIDDLEWARE,s=xd.ConnectNames.MIDDLEWARE,o=n.name||hc.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[_Fe.ATTR_HTTP_ROUTE]:e.length>0?e:"/",[xd.AttributeNames.CONNECT_TYPE]:r,[xd.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,c]=o?[1,2,3]:[0,1,2],d=arguments[i],f=arguments[a],m=arguments[c];(0,IL.replaceCurrentStackRoute)(d,e);let _=(0,wee.getRPCMetadata)(mFe.context.active());e&&_?.type===wee.RPCType.HTTP&&(_.route=(0,IL.generateRoute)(d));let g="";e?g=`request handler - ${e}`:g=`middleware - ${n.name||hc.ANONYMOUS_NAME}`;let T=r._startSpan(e,n);r._diag.debug("start span",g);let A=!1;function R(){A?r._diag.debug(`span ${T.name} - already finished`):(A=!0,r._diag.debug(`finishing span ${T.name}`),T.end()),f.removeListener("close",R)}return f.addListener("close",R),arguments[c]=r._patchNext(m,R),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,IL.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};hc.ConnectInstrumentation=NL});var jee=y(Go=>{"use strict";p();u();l();Object.defineProperty(Go,"__esModule",{value:!0});Go.ConnectTypes=Go.ConnectNames=Go.AttributeNames=Go.ANONYMOUS_NAME=Go.ConnectInstrumentation=void 0;var kee=Uee();Object.defineProperty(Go,"ConnectInstrumentation",{enumerable:!0,get:function(){return kee.ConnectInstrumentation}});Object.defineProperty(Go,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return kee.ANONYMOUS_NAME}});var bL=RL();Object.defineProperty(Go,"AttributeNames",{enumerable:!0,get:function(){return bL.AttributeNames}});Object.defineProperty(Go,"ConnectNames",{enumerable:!0,get:function(){return bL.ConnectNames}});Object.defineProperty(Go,"ConnectTypes",{enumerable:!0,get:function(){return bL.ConnectTypes}})});var Gee,Bee,$ee,hFe,Fee,Hee=S(()=>{p();u();l();Gee=j(jee(),1);je();Bee="Connect",$ee=Z(Bee,()=>new Gee.ConnectInstrumentation),hFe=(()=>({name:Bee,setupOnce(){$ee()}})),Fee=hFe});var Vee=y(_n=>{"use strict";p();u();l();Object.defineProperty(_n,"__esModule",{value:!0});_n.DB_SYSTEM_VALUE_MSSQL=_n.ATTR_NET_PEER_PORT=_n.ATTR_NET_PEER_NAME=_n.ATTR_DB_USER=_n.ATTR_DB_SYSTEM=_n.ATTR_DB_STATEMENT=_n.ATTR_DB_SQL_TABLE=_n.ATTR_DB_NAME=void 0;_n.ATTR_DB_NAME="db.name";_n.ATTR_DB_SQL_TABLE="db.sql.table";_n.ATTR_DB_STATEMENT="db.statement";_n.ATTR_DB_SYSTEM="db.system";_n.ATTR_DB_USER="db.user";_n.ATTR_NET_PEER_NAME="net.peer.name";_n.ATTR_NET_PEER_PORT="net.peer.port";_n.DB_SYSTEM_VALUE_MSSQL="mssql"});var qee=y(vd=>{"use strict";p();u();l();Object.defineProperty(vd,"__esModule",{value:!0});vd.once=vd.getSpanName=void 0;function gFe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}vd.getSpanName=gFe;var EFe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};vd.once=EFe});var Yee=y(Md=>{"use strict";p();u();l();Object.defineProperty(Md,"__esModule",{value:!0});Md.PACKAGE_NAME=Md.PACKAGE_VERSION=void 0;Md.PACKAGE_VERSION="0.30.0";Md.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var Qee=y(Ec=>{"use strict";p();u();l();Object.defineProperty(Ec,"__esModule",{value:!0});Ec.TediousInstrumentation=Ec.INJECTED_CTX=void 0;var Ld=(U(),D(J)),TFe=require("events"),ni=he(),Vu=(Le(),D(Xe)),gc=Vee(),Wee=qee(),Kee=Yee(),Xee=Symbol("opentelemetry.instrumentation-tedious.current-database");Ec.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var zee=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function gR(t){Object.defineProperty(this,Xee,{value:t,writable:!0})}var OL=class t extends ni.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(e={}){super(Kee.PACKAGE_NAME,Kee.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ni.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ni.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new ni.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of zee)(0,ni.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,e));return(0,ni.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of zee)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){return gR.call(this,this.config?.options?.database),this.removeListener("databaseChange",gR),this.on("databaseChange",gR),this.once("end",()=>{this.removeListener("databaseChange",gR)}),e.apply(this,arguments)}}_buildTraceparent(e){let n=e.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Ld.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,n,r){return new Promise(o=>{try{let s="set context_info @opentelemetry_traceparent",i=new n.Request(s,c=>{o()});Object.defineProperty(i,Ec.INJECTED_CTX,{value:!0});let a=Buffer.from(r,"utf8");i.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),e.execSql(i)}catch{o()}})}_shouldInjectFor(e){return e==="execSql"||e==="execSqlBatch"||e==="callProcedure"||e==="execute"}_patchQuery(e,n){return r=>{let o=this;function s(i){if(i?.[Ec.INJECTED_CTX])return r.apply(this,arguments);if(!(i instanceof TFe.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),r.apply(this,arguments);let a=0,c=0,d=()=>c++,f=()=>a++,m=this[Xee],_=(O=>O.sqlTextOrProcedure==="sp_prepare"&&O.parametersByName?.stmt?.value?O.parametersByName.stmt.value:O.sqlTextOrProcedure)(i),g={};o._dbSemconvStability&ni.SemconvStability.OLD&&(g[gc.ATTR_DB_SYSTEM]=gc.DB_SYSTEM_VALUE_MSSQL,g[gc.ATTR_DB_NAME]=m,g[gc.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,g[gc.ATTR_DB_STATEMENT]=_,g[gc.ATTR_DB_SQL_TABLE]=i.table),o._dbSemconvStability&ni.SemconvStability.STABLE&&(g[Vu.ATTR_DB_NAMESPACE]=m,g[Vu.ATTR_DB_SYSTEM_NAME]=Vu.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,g[Vu.ATTR_DB_QUERY_TEXT]=_,g[Vu.ATTR_DB_COLLECTION_NAME]=i.table),o._netSemconvStability&ni.SemconvStability.OLD&&(g[gc.ATTR_NET_PEER_NAME]=this.config?.server,g[gc.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&ni.SemconvStability.STABLE&&(g[Vu.ATTR_SERVER_ADDRESS]=this.config?.server,g[Vu.ATTR_SERVER_PORT]=this.config?.options?.port);let T=o.tracer.startSpan((0,Wee.getSpanName)(e,m,_,i.table),{kind:Ld.SpanKind.CLIENT,attributes:g}),A=(0,Wee.once)(O=>{i.removeListener("done",d),i.removeListener("doneInProc",d),i.removeListener("doneProc",f),i.removeListener("error",A),this.removeListener("end",A),T.setAttribute("tedious.procedure_count",a),T.setAttribute("tedious.statement_count",c),O&&T.setStatus({code:Ld.SpanStatusCode.ERROR,message:O.message}),T.end()});i.on("done",d),i.on("doneInProc",d),i.on("doneProc",f),i.once("error",A),this.on("end",A),typeof i.callback=="function"?o._wrap(i,"callback",o._patchCallbackQuery(A)):o._diag.error("Expected request.callback to be a function");let R=()=>Ld.context.with(Ld.trace.setSpan(Ld.context.active(),T),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return R();let v=o._buildTraceparent(T);o._injectContextInfo(this,n,v).finally(R)}return Object.defineProperty(s,"length",{value:r.length,writable:!1}),s}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};Ec.TediousInstrumentation=OL});var Jee=y(ER=>{"use strict";p();u();l();Object.defineProperty(ER,"__esModule",{value:!0});ER.TediousInstrumentation=void 0;var SFe=Qee();Object.defineProperty(ER,"TediousInstrumentation",{enumerable:!0,get:function(){return SFe.TediousInstrumentation}})});var Zee,AFe,ete,tte,yFe,nte,rte=S(()=>{p();u();l();Zee=j(Jee(),1);ne();je();AFe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),ete="Tedious",tte=Z(ete,()=>new Zee.TediousInstrumentation({})),yFe=(()=>{let t;return{name:ete,setupOnce(){let e=tte();t=f_(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=ae(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";AFe.has(s)&&n.setAttribute(fe,"auto.db.otel.tedious")}))}}}),nte=yFe});var ote=y(wd=>{"use strict";p();u();l();Object.defineProperty(wd,"__esModule",{value:!0});wd.PACKAGE_NAME=wd.PACKAGE_VERSION=void 0;wd.PACKAGE_VERSION="0.54.0";wd.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var ite=y(TR=>{"use strict";p();u();l();Object.defineProperty(TR,"__esModule",{value:!0});TR.GenericPoolInstrumentation=void 0;var Dd=(U(),D(J)),qu=he(),ste=ote(),CL="generic-pool",PL=class extends qu.InstrumentationBase{_isDisabled=!1;constructor(e={}){super(ste.PACKAGE_NAME,ste.PACKAGE_VERSION,e)}init(){return[new qu.InstrumentationNodeModuleDefinition(CL,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new qu.InstrumentationNodeModuleDefinition(CL,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new qu.InstrumentationNodeModuleDefinition(CL,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,qu.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=Dd.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return Dd.context.with(Dd.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=Dd.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return Dd.context.with(Dd.trace.setSpan(i,a),()=>{e.call(this,(c,d)=>{if(a.end(),o)return o(c,d)},s)})}}};TR.GenericPoolInstrumentation=PL});var ate=y(SR=>{"use strict";p();u();l();Object.defineProperty(SR,"__esModule",{value:!0});SR.GenericPoolInstrumentation=void 0;var RFe=ite();Object.defineProperty(SR,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return RFe.GenericPoolInstrumentation}})});var cte,ute,lte,IFe,pte,dte=S(()=>{p();u();l();cte=j(ate(),1);ne();je();ute="GenericPool",lte=Z(ute,()=>new cte.GenericPoolInstrumentation({})),IFe=(()=>{let t;return{name:ute,setupOnce(){let e=lte();t=f_(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=ae(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(fe,"auto.db.otel.generic_pool")}))}}}),pte=IFe});var xL=y(ri=>{"use strict";p();u();l();Object.defineProperty(ri,"__esModule",{value:!0});ri.ATTR_NET_PEER_PORT=ri.ATTR_NET_PEER_NAME=ri.ATTR_MESSAGING_SYSTEM=ri.ATTR_MESSAGING_OPERATION=void 0;ri.ATTR_MESSAGING_OPERATION="messaging.operation";ri.ATTR_MESSAGING_SYSTEM="messaging.system";ri.ATTR_NET_PEER_NAME="net.peer.name";ri.ATTR_NET_PEER_PORT="net.peer.port"});var vL=y(bt=>{"use strict";p();u();l();Object.defineProperty(bt,"__esModule",{value:!0});bt.ATTR_MESSAGING_CONVERSATION_ID=bt.OLD_ATTR_MESSAGING_MESSAGE_ID=bt.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=bt.ATTR_MESSAGING_URL=bt.ATTR_MESSAGING_PROTOCOL_VERSION=bt.ATTR_MESSAGING_PROTOCOL=bt.MESSAGING_OPERATION_VALUE_PROCESS=bt.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=bt.ATTR_MESSAGING_DESTINATION_KIND=bt.ATTR_MESSAGING_DESTINATION=void 0;bt.ATTR_MESSAGING_DESTINATION="messaging.destination";bt.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";bt.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";bt.MESSAGING_OPERATION_VALUE_PROCESS="process";bt.ATTR_MESSAGING_PROTOCOL="messaging.protocol";bt.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";bt.ATTR_MESSAGING_URL="messaging.url";bt.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";bt.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";bt.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var ML=y(Yu=>{"use strict";p();u();l();Object.defineProperty(Yu,"__esModule",{value:!0});Yu.DEFAULT_CONFIG=Yu.EndOperation=void 0;var NFe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(NFe=Yu.EndOperation||(Yu.EndOperation={}));Yu.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var hte=y(Ot=>{"use strict";p();u();l();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.isConfirmChannelTracing=Ot.unmarkConfirmChannelTracing=Ot.markConfirmChannelTracing=Ot.getConnectionAttributesFromUrl=Ot.getConnectionAttributesFromServer=Ot.normalizeExchange=Ot.CONNECTION_ATTRIBUTES=Ot.CHANNEL_CONSUME_TIMEOUT_TIMER=Ot.CHANNEL_SPANS_NOT_ENDED=Ot.MESSAGE_STORED_SPAN=void 0;var LL=(U(),D(J)),Tc=he(),AR=(Le(),D(Xe)),Ih=xL(),yR=vL();Ot.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Ot.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Ot.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Ot.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var wL=(0,LL.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),bFe=t=>t!==""?t:"<default>";Ot.normalizeExchange=bFe;var OFe=t=>t.replace(/:[^:@/]*@/,":***@"),fte=(t,e)=>t||(e==="AMQP"?5672:5671),mte=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},_te=t=>t||"localhost",oi=(t,e,n,r)=>n?{[e]:n}:(LL.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),CFe=t=>{let e=t.serverProperties.product?.toLowerCase?.();return e?{[Ih.ATTR_MESSAGING_SYSTEM]:e}:{}};Ot.getConnectionAttributesFromServer=CFe;var PFe=(t,e)=>{let n={[yR.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let r=t,o=mte(r?.protocol);Object.assign(n,{...oi(t,yR.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let s=_te(r?.hostname);e&Tc.SemconvStability.OLD&&Object.assign(n,{...oi(t,Ih.ATTR_NET_PEER_NAME,s,"hostname")}),e&Tc.SemconvStability.STABLE&&Object.assign(n,{...oi(t,AR.ATTR_SERVER_ADDRESS,s,"hostname")});let i=fte(r.port,o);e&Tc.SemconvStability.OLD&&Object.assign(n,oi(t,Ih.ATTR_NET_PEER_PORT,i,"port")),e&Tc.SemconvStability.STABLE&&Object.assign(n,oi(t,AR.ATTR_SERVER_PORT,i,"port"))}else{let r=OFe(t);n[yR.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),s=mte(o.protocol);Object.assign(n,{...oi(r,yR.ATTR_MESSAGING_PROTOCOL,s,"protocol")});let i=_te(o.hostname);e&Tc.SemconvStability.OLD&&Object.assign(n,{...oi(r,Ih.ATTR_NET_PEER_NAME,i,"hostname")}),e&Tc.SemconvStability.STABLE&&Object.assign(n,{...oi(r,AR.ATTR_SERVER_ADDRESS,i,"hostname")});let a=fte(o.port?parseInt(o.port):void 0,s);e&Tc.SemconvStability.OLD&&Object.assign(n,oi(r,Ih.ATTR_NET_PEER_PORT,a,"port")),e&Tc.SemconvStability.STABLE&&Object.assign(n,oi(r,AR.ATTR_SERVER_PORT,a,"port"))}catch(o){LL.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Ot.getConnectionAttributesFromUrl=PFe;var xFe=t=>t.setValue(wL,!0);Ot.markConfirmChannelTracing=xFe;var vFe=t=>t.deleteValue(wL);Ot.unmarkConfirmChannelTracing=vFe;var MFe=t=>t.getValue(wL)===!0;Ot.isConfirmChannelTracing=MFe});var gte=y(Ud=>{"use strict";p();u();l();Object.defineProperty(Ud,"__esModule",{value:!0});Ud.PACKAGE_NAME=Ud.PACKAGE_VERSION=void 0;Ud.PACKAGE_VERSION="0.58.0";Ud.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var Tte=y(NR=>{"use strict";p();u();l();Object.defineProperty(NR,"__esModule",{value:!0});NR.AmqplibInstrumentation=void 0;var gt=(U(),D(J)),RR=Be(),$e=he(),LFe=xL(),io=vL(),yr=ML(),Ct=hte(),Ete=gte(),IR=[">=0.5.5 <1"],DL=class extends $e.InstrumentationBase{_netSemconvStability;constructor(e={}){super(Ete.PACKAGE_NAME,Ete.PACKAGE_VERSION,{...yr.DEFAULT_CONFIG,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,$e.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...yr.DEFAULT_CONFIG,...e})}init(){let e=new $e.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",IR,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new $e.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",IR,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new $e.InstrumentationNodeModuleFile("amqplib/lib/connect.js",IR,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new $e.InstrumentationNodeModuleDefinition("amqplib",IR,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,$e.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,$e.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,$e.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,$e.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,$e.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,yr.EndOperation.Ack)),(0,$e.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,yr.EndOperation.Nack)),(0,$e.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,yr.EndOperation.Reject)),(0,$e.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,yr.EndOperation.AckAll)),(0,$e.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,yr.EndOperation.NackAll)),(0,$e.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,$e.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,$e.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,$e.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,$e.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,$e.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,$e.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,$e.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,$e.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,$e.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,$e.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){let n=this;return function(o,s,i){return e.call(this,o,s,function(a,c){if(a==null){let d=(0,Ct.getConnectionAttributesFromUrl)(o,n._netSemconvStability),f=(0,Ct.getConnectionAttributesFromServer)(c);c[Ct.CONNECTION_ATTRIBUTES]={...d,...f}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,yr.EndOperation.ChannelClosed,void 0);let s=this[Ct.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[Ct.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,yr.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,c){let d=this,f=n===yr.EndOperation.Reject?a:c,m=d[Ct.CHANNEL_SPANS_NOT_ENDED]??[],_=m.findIndex(g=>g.msg===i);if(_<0)o.endConsumerSpan(i,e,n,f);else if(n!==yr.EndOperation.Reject&&a){for(let g=0;g<=_;g++)o.endConsumerSpan(m[g].msg,e,n,f);m.splice(0,_+1)}else o.endConsumerSpan(i,e,n,f),m.splice(_,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,Ct.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:f}=r.getConfig();if(f){let m=setInterval(()=>{r.checkConsumeTimeoutOnChannel(c)},f);m.unref(),c[Ct.CHANNEL_CONSUME_TIMEOUT_TIMER]=m}c[Ct.CHANNEL_SPANS_NOT_ENDED]=[]}let d=function(f){if(!f)return i.call(this,f);let m=f.properties.headers??{},_=gt.propagation.extract(gt.ROOT_CONTEXT,m),g=f.fields?.exchange,T;if(r._config.useLinksForConsume){let I=_?gt.trace.getSpan(_)?.spanContext():void 0;_=void 0,I&&(T=[{context:I}])}let A=r.tracer.startSpan(`${s} process`,{kind:gt.SpanKind.CONSUMER,attributes:{...c?.connection?.[Ct.CONNECTION_ATTRIBUTES],[io.ATTR_MESSAGING_DESTINATION]:g,[io.ATTR_MESSAGING_DESTINATION_KIND]:io.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[io.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:f.fields?.routingKey,[LFe.ATTR_MESSAGING_OPERATION]:io.MESSAGING_OPERATION_VALUE_PROCESS,[io.OLD_ATTR_MESSAGING_MESSAGE_ID]:f?.properties.messageId,[io.ATTR_MESSAGING_CONVERSATION_ID]:f?.properties.correlationId},links:T},_),{consumeHook:R}=r.getConfig();R&&(0,$e.safeExecuteInTheMiddle)(()=>R(A,{moduleVersion:e,msg:f}),I=>{I&>.diag.error("amqplib instrumentation: consumerHook error",I)},!0),a?.noAck||(c[Ct.CHANNEL_SPANS_NOT_ENDED].push({msg:f,timeOfConsume:(0,RR.hrTime)()}),f[Ct.MESSAGE_STORED_SPAN]=A);let b=_||gt.ROOT_CONTEXT;gt.context.with(gt.trace.setSpan(b,A),()=>{i.call(this,f)}),a?.noAck&&(r.callConsumeEndHook(A,f,!1,yr.EndOperation.AutoAck),A.end())};return arguments[1]=d,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,c,d){let f=this,{span:m,modifiedOptions:_}=r.createPublishSpan(r,s,i,f,c),{publishHook:g}=r.getConfig();g&&(0,$e.safeExecuteInTheMiddle)(()=>g(m,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:_,isConfirmChannel:!0}),b=>{b&>.diag.error("amqplib instrumentation: publishHook error",b)},!0);let T=function(b,I){try{d?.call(this,b,I)}finally{let{publishConfirmHook:v}=r.getConfig();v&&(0,$e.safeExecuteInTheMiddle)(()=>v(m,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:c,isConfirmChannel:!0,confirmError:b}),O=>{O&>.diag.error("amqplib instrumentation: publishConfirmHook error",O)},!0),b&&m.setStatus({code:gt.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),m.end()}},A=(0,Ct.markConfirmChannelTracing)(gt.context.active()),R=[...arguments];return R[3]=_,R[4]=gt.context.bind((0,Ct.unmarkConfirmChannelTracing)(gt.trace.setSpan(A,m)),T),gt.context.with(A,n.bind(this,...R))}}getPublishPatch(e,n){let r=this;return function(s,i,a,c){if((0,Ct.isConfirmChannelTracing)(gt.context.active()))return n.apply(this,arguments);{let d=this,{span:f,modifiedOptions:m}=r.createPublishSpan(r,s,i,d,c),{publishHook:_}=r.getConfig();_&&(0,$e.safeExecuteInTheMiddle)(()=>_(f,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:m,isConfirmChannel:!1}),A=>{A&>.diag.error("amqplib instrumentation: publishHook error",A)},!0);let g=[...arguments];g[3]=m;let T=n.apply(this,g);return f.end(),T}}}createPublishSpan(e,n,r,o,s){let i=(0,Ct.normalizeExchange)(n),a=e.tracer.startSpan(`publish ${i}`,{kind:gt.SpanKind.PRODUCER,attributes:{...o.connection[Ct.CONNECTION_ATTRIBUTES],[io.ATTR_MESSAGING_DESTINATION]:n,[io.ATTR_MESSAGING_DESTINATION_KIND]:io.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[io.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[io.OLD_ATTR_MESSAGING_MESSAGE_ID]:s?.messageId,[io.ATTR_MESSAGING_CONVERSATION_ID]:s?.correlationId}}),c=s??{};return c.headers=c.headers??{},gt.propagation.inject(gt.trace.setSpan(gt.context.active(),a),c.headers),{span:a,modifiedOptions:c}}endConsumerSpan(e,n,r,o){let s=e[Ct.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:gt.SpanStatusCode.ERROR,message:r!==yr.EndOperation.ChannelClosed&&r!==yr.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[Ct.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){(e[Ct.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(i=>{this.endConsumerSpan(i.msg,n,r,o)}),e[Ct.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,$e.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&>.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){let n=(0,RR.hrTime)(),r=e[Ct.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:s}=this.getConfig();for(o=0;o<r.length;o++){let i=r[o],a=(0,RR.hrTimeDuration)(i.timeOfConsume,n);if((0,RR.hrTimeToMilliseconds)(a)<s)break;this.endConsumerSpan(i.msg,null,yr.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};NR.AmqplibInstrumentation=DL});var Ate=y(Sc=>{"use strict";p();u();l();Object.defineProperty(Sc,"__esModule",{value:!0});Sc.EndOperation=Sc.DEFAULT_CONFIG=Sc.AmqplibInstrumentation=void 0;var wFe=Tte();Object.defineProperty(Sc,"AmqplibInstrumentation",{enumerable:!0,get:function(){return wFe.AmqplibInstrumentation}});var Ste=ML();Object.defineProperty(Sc,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return Ste.DEFAULT_CONFIG}});Object.defineProperty(Sc,"EndOperation",{enumerable:!0,get:function(){return Ste.EndOperation}})});var yte,Rte,DFe,Ite,UFe,Nte,bte=S(()=>{p();u();l();yte=j(Ate(),1);je();Rte="Amqplib",DFe={consumeEndHook:t=>{Ve(t,"auto.amqplib.otel.consumer")},publishHook:t=>{Ve(t,"auto.amqplib.otel.publisher")}},Ite=Z(Rte,()=>new yte.AmqplibInstrumentation(DFe)),UFe=(()=>({name:Rte,setupOnce(){Ite()}})),Nte=UFe});var Nh,UL=S(()=>{p();u();l();Nh="VercelAI"});function jFe(t){if(typeof t!="object"||t===null)return!1;let e=t;return"type"in e&&"error"in e&&"toolName"in e&&"toolCallId"in e&&e.type==="tool-error"&&e.error instanceof Error}function GFe(t){if(typeof t!="object"||t===null||!("content"in t))return;let e=t;if(Array.isArray(e.content)){for(let n of e.content)if(jFe(n)){let r=FP(n.toolCallId);if(r){let o=r.spanContext();Wr(s=>{s.setContext("trace",{trace_id:o.traceId,span_id:o.spanId}),s.setTag("vercel.ai.tool.name",n.toolName),s.setTag("vercel.ai.tool.callId",n.toolCallId),s.setLevel("error"),oe(n.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}),HP(n.toolCallId)}else Wr(o=>{o.setTag("vercel.ai.tool.name",n.toolName),o.setTag("vercel.ai.tool.callId",n.toolCallId),o.setLevel("error"),oe(n.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}}function BFe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var OR,kFe,Ote,bR,Cte=S(()=>{p();u();l();OR=j(he(),1);ne();UL();kFe=[">=3.0.0 <7"],Ote=["generateText","streamText","generateObject","streamObject","embed","embedMany"];bR=class t extends OR.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",Pe,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new OR.InstrumentationNodeModuleDefinition("ai",kFe,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,s,i)=>{let a=i[0].experimental_telemetry||{},c=a.isEnabled,d=F(),f=d?.getIntegrationByName(Nh),m=f?.options,_=f?!!d?.getOptions().sendDefaultPii:!1,{recordInputs:g,recordOutputs:T}=BFe(m,a,c,_);return i[0].experimental_telemetry={...a,isEnabled:c!==void 0?c:!0,recordInputs:g,recordOutputs:T},Qr(()=>Reflect.apply(o,s,i),A=>{A&&typeof A=="object"&&$t(A,"_sentry_active_span",as())},()=>{},A=>{GFe(A)})}});if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of Ote)e[r]=n(e[r]);return e}else{let r=Ote.reduce((o,s)=>(o[s]=n(e[s]),o),{});return{...e,...r}}}}});function $Fe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var Pte,FFe,xte,vte=S(()=>{p();u();l();ne();je();UL();Cte();Pte=Z(Nh,()=>new bR({}));FFe=((t={})=>{let e;return{name:Nh,options:t,setupOnce(){e=Pte()},afterAllSetup(n){t.force??$Fe(n)?sS(n):e?.callWhenPatched(()=>sS(n))}}}),xte=FFe});var PR,HFe,CR,Mte=S(()=>{p();u();l();PR=j(he(),1);ne();HFe=[">=4.0.0 <7"],CR=class extends PR.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",Pe,e)}init(){return new PR.InstrumentationNodeModuleDefinition("openai",HFe,this._patch.bind(this))}_patch(e){let n=e;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(e,n){let r=e[n];if(!r)return e;let o=this.getConfig(),s=function(...i){if(Su(Va))return Reflect.construct(r,i);let a=Reflect.construct(r,i),d=!!F()?.getOptions().sendDefaultPii,f=o.recordInputs??d,m=o.recordOutputs??d;return uS(a,{recordInputs:f,recordOutputs:m})};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}try{e[n]=s}catch{Object.defineProperty(e,n,{value:s,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=s}catch{Object.defineProperty(e,"default",{value:s,writable:!0,configurable:!0,enumerable:!0})}return e}}});var Lte,VFe,wte,Dte=S(()=>{p();u();l();ne();je();Mte();Lte=Z(Va,t=>new CR(t)),VFe=((t={})=>({name:Va,setupOnce(){Lte(t)}})),wte=VFe});var vR,qFe,xR,Ute=S(()=>{p();u();l();vR=j(he(),1);ne();qFe=[">=0.19.2 <1.0.0"],xR=class extends vR.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-anthropic-ai",Pe,e)}init(){return new vR.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",qFe,this._patch.bind(this))}_patch(e){let n=e.Anthropic,r=this.getConfig(),o=function(...s){if(Su(qa))return Reflect.construct(n,s);let i=Reflect.construct(n,s),c=!!F()?.getOptions().sendDefaultPii,d=r.recordInputs??c,f=r.recordOutputs??c;return lS(i,{recordInputs:d,recordOutputs:f})};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}try{e.Anthropic=o}catch{Object.defineProperty(e,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=o}catch{Object.defineProperty(e,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return e}}});var kte,YFe,jte,Gte=S(()=>{p();u();l();ne();je();Ute();kte=Z(qa,t=>new xR(t)),YFe=((t={})=>({name:qa,options:t,setupOnce(){kte(t)}})),jte=YFe});var kd,Bte,MR,$te=S(()=>{p();u();l();kd=j(he(),1);ne();Bte=[">=0.10.0 <2"],MR=class extends kd.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-google-genai",Pe,e)}init(){return new kd.InstrumentationNodeModuleDefinition("@google/genai",Bte,n=>this._patch(n),n=>n,[new kd.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",Bte,n=>this._patch(n),n=>n)])}_patch(e){let n=e.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return e;let o=function(...s){if(Su(Ya))return Reflect.construct(n,s);let i=Reflect.construct(n,s),c=!!F()?.getOptions().sendDefaultPii,d=r,f=d?.recordInputs??c,m=d?.recordOutputs??c;return dS(i,{recordInputs:f,recordOutputs:m})};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}return p_(e,"GoogleGenAI",o),e}}});var Fte,WFe,Hte,Vte=S(()=>{p();u();l();ne();je();$te();Fte=Z(Ya,t=>new MR(t)),WFe=((t={})=>({name:Ya,setupOnce(){Fte(t)}})),Hte=WFe});function KFe(t,e){return t?Array.isArray(t)?t.includes(e)?t:[...t,e]:typeof t=="object"?[t,e]:t:[e]}function zFe(t,e,n){return new Proxy(t,{apply(r,o,s){let a=s[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},s[1]=a);let c=a.callbacks,d=KFe(c,e);return a.callbacks=d,Reflect.apply(r,o,s)}})}var Ac,LR,wR,qte=S(()=>{p();u();l();Ac=j(he(),1);ne();LR=[">=0.1.0 <2.0.0"];wR=class extends Ac.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langchain",Pe,e)}init(){let e=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)e.push(new Ac.InstrumentationNodeModuleDefinition(r,LR,this._patch.bind(this),o=>o,[new Ac.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,LR,this._patch.bind(this),o=>o)]));return e.push(new Ac.InstrumentationNodeModuleDefinition("langchain",LR,this._patch.bind(this),r=>r,[new Ac.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",LR,this._patch.bind(this),r=>r)])),e}_patch(e){hP([Va,qa,Ya]);let r=!!F()?.getOptions().sendDefaultPii,o=this.getConfig(),s=o?.recordInputs??r,i=o?.recordOutputs??r,a=hS({recordInputs:s,recordOutputs:i});return this._patchRunnableMethods(e,a),e}_patchRunnableMethods(e,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=e.universal_exports??e,s=Object.values(o).find(c=>typeof c=="function"&&r.includes(c.name));if(!s)return;let i=s.prototype,a=["invoke","stream","batch"];for(let c of a){let d=i[c];typeof d=="function"&&(i[c]=zFe(d,n))}}}});var Yte,XFe,Wte,Kte=S(()=>{p();u();l();ne();je();qte();Yte=Z(fS,t=>new wR(t)),XFe=((t={})=>({name:fS,setupOnce(){Yte(t)}})),Wte=XFe});var jd,zte,DR,Xte=S(()=>{p();u();l();jd=j(he(),1);ne();zte=[">=0.0.0 <2.0.0"],DR=class extends jd.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langgraph",Pe,e)}init(){return new jd.InstrumentationNodeModuleDefinition("@langchain/langgraph",zte,this._patch.bind(this),n=>n,[new jd.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",zte,this._patch.bind(this),n=>n)])}_patch(e){let r=!!F()?.getOptions().sendDefaultPii,o=this.getConfig(),s=o.recordInputs??r,i=o.recordOutputs??r,a={recordInputs:s,recordOutputs:i};if(e.StateGraph&&typeof e.StateGraph=="function"){let c=e.StateGraph;c.prototype.compile=ES(c.prototype.compile,a)}return e}}});var Qte,QFe,Jte,Zte=S(()=>{p();u();l();ne();je();Xte();Qte=Z(gS,t=>new DR(t)),QFe=((t={})=>({name:gS,setupOnce(){Qte(t)}})),Jte=QFe});function nne(t,e,n,r,o){let i=()=>{},a=o.firestoreSpanCreationHook;typeof a=="function"&&(i=f=>{(0,Xi.safeExecuteInTheMiddle)(()=>a(f),m=>{m&&or.error(m?.message)},!0)});let c=new Xi.InstrumentationNodeModuleDefinition("@firebase/firestore",e,f=>ene(f,n,r,t,i)),d=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let f of d)c.files.push(new Xi.InstrumentationNodeModuleFile(f,e,m=>ene(m,n,r,t,i),m=>rne(m,r)));return c}function ene(t,e,n,r,o){return rne(t,n),e(t,"addDoc",JFe(r,o)),e(t,"getDocs",eHe(r,o)),e(t,"setDoc",tHe(r,o)),e(t,"deleteDoc",ZFe(r,o)),t}function rne(t,e){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Xi.isWrapped)(t[n])&&e(t,n);return t}function JFe(t,e){return function(r){return function(o,s){let i=kR(t,"addDoc",o);return e(i),UR(i,()=>r(o,s))}}}function ZFe(t,e){return function(r){return function(o){let s=kR(t,"deleteDoc",o.parent||o);return e(s),UR(s,()=>r(o))}}}function eHe(t,e){return function(r){return function(o){let s=kR(t,"getDocs",o);return e(s),UR(s,()=>r(o))}}}function tHe(t,e){return function(r){return function(o,s,i){let a=kR(t,"setDoc",o.parent||o);return e(a),UR(a,()=>typeof i<"u"?r(o,s,i):r(o,s))}}}function UR(t,e){return V.with(de.setSpan(V.active(),t),()=>(0,Xi.safeExecuteInTheMiddle)(()=>e(),n=>{n&&t.recordException(n),t.end()},!0))}function kR(t,e,n){let r=t.startSpan(`${e} ${n.path}`,{kind:Ze.CLIENT});return rHe(r,n),r.setAttribute(Ul,e),r}function nHe(t){let e,n;if(typeof t.host=="string")if(t.host.startsWith("[")){if(t.host.endsWith("]"))e=t.host.replace(/^\[|\]$/g,"");else if(t.host.includes("]:")){let r=t.host.lastIndexOf(":");r!==-1&&(e=t.host.slice(1,r).replace(/^\[|\]$/g,""),n=t.host.slice(r+1))}}else if(tne.isIPv6(t.host))e=t.host;else{let r=t.host.lastIndexOf(":");r!==-1?(e=t.host.slice(0,r),n=t.host.slice(r+1)):e=t.host}return{address:e,port:n?parseInt(n,10):void 0}}function rHe(t,e){let n=e.firestore.app,r=n.options,s=(e.firestore.toJSON()||{}).settings||{},i={[rO]:e.path,[Wf]:n.name,[_a]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:a,port:c}=nHe(s);a&&(i[Kf]=a),c&&(i[zf]=c),t.setAttributes(i)}var tne,Xi,one=S(()=>{p();u();l();tne=j(require("node:net"),1);U();Xi=j(he(),1);Le()});function sne(t,e,n,r,o){let s=()=>{},i=()=>{},a=o.functions?.errorHook,c=o.functions?.requestHook,d=o.functions?.responseHook;typeof d=="function"&&(i=(_,g)=>{(0,Qi.safeExecuteInTheMiddle)(()=>d(_,g),T=>{T&&or.error(T?.message)},!0)}),typeof c=="function"&&(s=_=>{(0,Qi.safeExecuteInTheMiddle)(()=>c(_),g=>{g&&or.error(g?.message)},!0)});let f=new Qi.InstrumentationNodeModuleDefinition("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:_,triggerType:g})=>{f.files.push(new Qi.InstrumentationNodeModuleFile(_,e,T=>oHe(T,n,r,t,{requestHook:s,responseHook:i,errorHook:a},g),T=>ine(T,r)))}),f}function Rr(t,e,n){return function(o){return function(...s){let i=typeof s[0]=="function"?s[0]:s[1],a=typeof s[0]=="function"?void 0:s[0];if(!i)return o.call(this,...s);let c=async function(...d){let f=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",m=t.startSpan(`firebase.function.${n}`,{kind:Ze.SERVER}),_={"faas.name":f,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(_["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(_["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),m.setAttributes(_),e?.requestHook?.(m),V.with(de.setSpan(V.active(),m),async()=>{let g,T;try{T=await i.apply(this,d)}catch(A){g=A}if(e?.responseHook?.(m,g),g&&m.recordException(g),m.end(),g)throw await e?.errorHook?.(m,g),g;return T})};return a?o.call(this,a,c):o.call(this,c)}}}function oHe(t,e,n,r,o,s){switch(ine(t,n),s){case"function":e(t,"onRequest",Rr(r,o,"http.request")),e(t,"onCall",Rr(r,o,"http.call"));break;case"firestore":e(t,"onDocumentCreated",Rr(r,o,"firestore.document.created")),e(t,"onDocumentUpdated",Rr(r,o,"firestore.document.updated")),e(t,"onDocumentDeleted",Rr(r,o,"firestore.document.deleted")),e(t,"onDocumentWritten",Rr(r,o,"firestore.document.written")),e(t,"onDocumentCreatedWithAuthContext",Rr(r,o,"firestore.document.created")),e(t,"onDocumentUpdatedWithAuthContext",Rr(r,o,"firestore.document.updated")),e(t,"onDocumentDeletedWithAuthContext",Rr(r,o,"firestore.document.deleted")),e(t,"onDocumentWrittenWithAuthContext",Rr(r,o,"firestore.document.written"));break;case"scheduler":e(t,"onSchedule",Rr(r,o,"scheduler.scheduled"));break;case"storage":e(t,"onObjectFinalized",Rr(r,o,"storage.object.finalized")),e(t,"onObjectArchived",Rr(r,o,"storage.object.archived")),e(t,"onObjectDeleted",Rr(r,o,"storage.object.deleted")),e(t,"onObjectMetadataUpdated",Rr(r,o,"storage.object.metadataUpdated"));break}return t}function ine(t,e){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Qi.isWrapped)(t[r])&&e(t,r);return t}var Qi,ane=S(()=>{p();u();l();U();Qi=j(he(),1)});var une,cne,sHe,iHe,jR,lne=S(()=>{p();u();l();une=j(he(),1);ne();one();ane();cne={},sHe=[">=3.0.0 <5"],iHe=[">=6.0.0 <7"],jR=class extends une.InstrumentationBase{constructor(e=cne){super("@sentry/instrumentation-firebase",Pe,e)}setConfig(e={}){super.setConfig({...cne,...e})}init(){let e=[];return e.push(nne(this.tracer,sHe,this._wrap,this._unwrap,this.getConfig())),e.push(sne(this.tracer,iHe,this._wrap,this._unwrap,this.getConfig())),e}}});var pne,aHe,dne,cHe,fne,mne=S(()=>{p();u();l();ne();je();lne();pne="Firebase",aHe={firestoreSpanCreationHook:t=>{Ve(t,"auto.firebase.otel.firestore"),t.setAttribute(ge,"db.query")},functions:{requestHook:t=>{Ve(t,"auto.firebase.otel.functions"),t.setAttribute(ge,"http.request")},errorHook:async(t,e)=>{e&&(oe(e,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await gu(2e3))}}},dne=Z(pne,()=>new jR(aHe)),cHe=(()=>({name:pne,setupOnce(){dne()}})),fne=cHe});function _ne(){return[YX(),GQ(),d8(),fee(),Z8(),mJ(),bJ(),jJ(),hZ(),kZ(),K7(),cee(),Pee(),Fee(),nte(),pte(),P8(),Nte(),B8(),Wte(),Jte(),xte(),wte(),jte(),Hte(),FZ(),fne()]}var hne=S(()=>{p();u();l();bte();Gte();Hee();WX();FQ();mne();dte();Vte();m8();uee();mee();x8();xee();Kte();Zte();$8();eJ();_J();OJ();GJ();Dte();jZ();HZ();z7();gZ();rte();vte()});function Ene(t,e={}){t.getOptions().debug&&wv();let[n,r]=uHe(t,e);t.traceProvider=n,t.asyncLocalStorageLookup=r}function uHe(t,e={}){let n=new gne.BasicTracerProvider({sampler:new dA(t),resource:(0,GR.defaultResource)().merge((0,GR.resourceFromAttributes)({[Yr]:"node",[nO]:"sentry",[oO]:Pe})),forceFlushTimeoutMillis:500,spanProcessors:[new pA({timeout:lHe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});de.setGlobalTracerProvider(n),sr.setGlobalPropagator(new lA);let r=new RA;return V.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function lHe(t){if(t!=null){if(t>kL)return It&&N.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${kL}`),kL;if(t<=0||Number.isNaN(t)){It&&N.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}var GR,gne,kL,Tne=S(()=>{p();u();l();U();GR=j(Sx(),1),gne=j(qx(),1);Le();ne();je();za();Du();kL=1e6});function Sne(){return PA().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(yX(),vX())}function Ane(t){return[...Sne(),...Ut(t)?_ne():[]]}function jL(t={}){return pHe(t,Ane)}function pHe(t={},e){Au(t,"node");let n=Fv({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(Ene(n,{spanProcessors:t.openTelemetrySpanProcessors}),xA()),n}var yne=S(()=>{p();u();l();ne();je();RX();MX();hne();Tne()});var Ji=S(()=>{p();u();l();yne();ne();je()});var Wu,GL=S(()=>{p();u();l();Wu=class extends Error{response;request;options;constructor(e,n,r){let o=e.status||e.status===0?e.status:"",s=e.statusText??"",i=`${o} ${s}`.trim(),a=i?`status code ${i}`:"an unknown error";super(`Request failed with ${a}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=e,this.request=n,this.options=r}}});var Gd,BL=S(()=>{p();u();l();Gd=class extends Error{name="NonError";value;constructor(e){let n="Non-error value was thrown";try{typeof e=="string"?n=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(n=e.message)}catch{}super(n),this.value=e}}});var Bd,Rne=S(()=>{p();u();l();BL();Bd=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){let n=e?.cause?e.cause instanceof Error?e.cause:new Gd(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}});var $L,Ine,BR,Nne,bne,$R,dHe,One,FR,Cne,HR,bh,Pne,xne,vne,Mne,Ku=S(()=>{p();u();l();$L=(()=>{let t=!1,e=!1,n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return t&&!e})(),Ine=typeof globalThis.AbortController=="function",BR=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nne=typeof globalThis.ReadableStream=="function",bne=typeof globalThis.FormData=="function",$R=["get","post","put","patch","head","delete"],dHe=()=>{};dHe();One={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},FR=2147483647,Cne=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,HR=Symbol("stop"),bh=class{options;constructor(e){this.options=e}},Pne=t=>new bh(t),xne={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},vne={next:!0},Mne={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0}});var fHe,Lne,wne,Dne,Une=S(()=>{p();u();l();Ku();fHe=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[n,r]of t)e+=Cne,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,e+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{let e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},Lne=(t,e,n)=>{let r,o=0;return t.pipeThrough(new TransformStream({transform(s,i){if(i.enqueue(s),r){o+=r.byteLength;let a=e===0?0:o/e;a>=1&&(a=1-Number.EPSILON),n?.({percent:a,totalBytes:Math.max(e,o),transferredBytes:o},r)}r=s},flush(){r&&(o+=r.byteLength,n?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},r))}}))},wne=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});let n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(Lne(t.body,n,e),{status:t.status,statusText:t.statusText,headers:t.headers})},Dne=(t,e,n)=>{if(!t.body)return t;let r=fHe(n??t.body);return new Request(t,{duplex:"half",body:Lne(t.body,r,e)})}});var Rc,kne=S(()=>{p();u();l();Rc=t=>t!==null&&typeof t=="object"});function VR(t,e,n){return Object.hasOwn(e,n)&&e[n]===void 0?[]:VL(t[n]??[],e[n]??[])}var Oh,FL,HL,mHe,VL,qL=S(()=>{p();u();l();Ku();kne();Oh=(...t)=>{for(let e of t)if((!Rc(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return VL({},...t)},FL=(t={},e={})=>{let n=new globalThis.Headers(t),r=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(let[s,i]of o.entries())r&&i==="undefined"||i===void 0?n.delete(s):n.set(s,i);return n};HL=(t={},e={})=>({beforeRequest:VR(t,e,"beforeRequest"),beforeRetry:VR(t,e,"beforeRetry"),afterResponse:VR(t,e,"afterResponse"),beforeError:VR(t,e,"beforeError")}),mHe=(t,e)=>{let n=new URLSearchParams;for(let r of[t,e])if(r!==void 0)if(r instanceof URLSearchParams)for(let[o,s]of r.entries())n.append(o,s);else if(Array.isArray(r))for(let o of r){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(o[0]),String(o[1]))}else if(Rc(r))for(let[o,s]of Object.entries(r))s!==void 0&&n.append(o,String(s));else{let o=new URLSearchParams(r);for(let[s,i]of o.entries())n.append(s,i)}return n},VL=(...t)=>{let e={},n={},r={},o,s=[];for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(Rc(i)){for(let[a,c]of Object.entries(i)){if(a==="signal"&&c instanceof globalThis.AbortSignal){s.push(c);continue}if(a==="context"){if(c!=null&&(!Rc(c)||Array.isArray(c)))throw new TypeError("The `context` option must be an object");e={...e,context:c==null?{}:{...e.context,...c}};continue}if(a==="searchParams"){c==null?o=void 0:o=o===void 0?c:mHe(o,c);continue}Rc(c)&&a in e&&(c=VL(e[a],c)),e={...e,[a]:c}}Rc(i.hooks)&&(r=HL(r,i.hooks),e.hooks=r),Rc(i.headers)&&(n=FL(n,i.headers),e.headers=n)}return o!==void 0&&(e.searchParams=o),s.length>0&&(s.length===1?e.signal=s[0]:BR?e.signal=AbortSignal.any(s):e.signal=s.at(-1)),e.context===void 0&&(e.context={}),e}});var Gne,_He,hHe,gHe,jne,Bne,$ne=S(()=>{p();u();l();Ku();Gne=t=>$R.includes(t)?t.toUpperCase():t,_He=["get","put","head","delete","options","trace"],hHe=[408,413,429,500,502,503,504],gHe=[413,429,503],jne={limit:2,methods:_He,statusCodes:hHe,afterStatusCodes:gHe,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Bne=(t={})=>{if(typeof t=="number")return{...jne,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map(n=>n.toLowerCase()),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");let e=Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0));return{...jne,...e}}});var zu,YL=S(()=>{p();u();l();zu=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}});async function WL(t,e,n,r){return new Promise((o,s)=>{let i=setTimeout(()=>{n&&n.abort(),s(new zu(t))},r.timeout);r.fetch(t,e).then(o).catch(s).then(()=>{clearTimeout(i)})})}var Fne=S(()=>{p();u();l();YL()});async function KL(t,{signal:e}){return new Promise((n,r)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(s),r(e.reason)}let s=setTimeout(()=>{e?.removeEventListener("abort",o),n()},t)})}var Hne=S(()=>{p();u();l()});var Vne,qne,Yne=S(()=>{p();u();l();Ku();Vne=(t,e)=>{let n={};for(let r in e)Object.hasOwn(e,r)&&!(r in Mne)&&!(r in xne)&&(!(r in t)||r in vne)&&(n[r]=e[r]);return n},qne=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t});function Wne(t){return t instanceof Wu||t?.name===Wu.name}function Kne(t){return t instanceof zu||t?.name===zu.name}var zne=S(()=>{p();u();l();GL();YL()});var Ch,Xne=S(()=>{p();u();l();GL();BL();Rne();Une();qL();$ne();Fne();Hne();Yne();zne();Ku();Ch=class t{static create(e,n){let r=new t(e,n),o=async()=>{if(typeof r.#e.timeout=="number"&&r.#e.timeout>FR)throw new RangeError(`The \`timeout\` option cannot be greater than ${FR}`);await Promise.resolve();let i=await r.#_();for(let a of r.#e.hooks.afterResponse){let c=r.#p(i.clone()),d;try{d=await a(r.request,r.#m(),c,{retryCount:r.#o})}catch(m){throw r.#c(c),r.#c(i),m}if(d instanceof bh)throw r.#c(c),r.#c(i),new Bd(d.options);let f=d instanceof globalThis.Response?d:i;c!==f&&r.#c(c),i!==f&&r.#c(i),i=f}if(r.#p(i),!i.ok&&(typeof r.#e.throwHttpErrors=="function"?r.#e.throwHttpErrors(i.status):r.#e.throwHttpErrors)){let a=new Wu(i,r.request,r.#m());for(let c of r.#e.hooks.beforeError)a=await c(a,{retryCount:r.#o});throw a}if(r.#e.onDownloadProgress){if(typeof r.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nne)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let a=i.clone();return r.#c(i),wne(a,r.#e.onDownloadProgress)}return i},s=r.#f(o).finally(()=>{let i=r.#i;r.#d(i?.body??void 0),r.#d(r.request.body??void 0)});for(let[i,a]of Object.entries(One))i==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(s[i]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||a);let c=await s;if(i==="json"){if(c.status===204)return"";let d=await c.text();return d===""?"":n.parseJson?n.parseJson(d):JSON.parse(d)}return c[i]()});return s}static#n(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0)):e}request;#r;#o=0;#t;#e;#i;#s;#u;constructor(e,n={}){if(this.#t=e,this.#e={...n,headers:FL(this.#t.headers,n.headers),hooks:HL({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:Gne(n.method??this.#t.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:Bne(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}Ine&&BR&&(this.#s=this.#e.signal??this.#t.signal,this.#r=new globalThis.AbortController,this.#e.signal=this.#s?AbortSignal.any([this.#s,this.#r.signal]):this.#r.signal),$L&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(bne&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),qne(this.#e.searchParams)){let s="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(t.#n(this.#e.searchParams)).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);this.request=new globalThis.Request(i,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!$L)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#g(this.request,this.#e.body??void 0)}}#a(){let e=this.#e.retry.delay(this.#o),n=e;this.#e.retry.jitter===!0?n=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(e),(!Number.isFinite(n)||n<0)&&(n=e));let r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,n)}async#l(e){if(this.#o++,this.#o>this.#e.retry.limit)throw e;let n=e instanceof Error?e:new Gd(e);if(n instanceof Bd)return n.customDelay??this.#a();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){let r=await this.#e.retry.shouldRetry({error:n,retryCount:this.#o});if(r===!1)throw e;if(r===!0)return this.#a()}if(Kne(e)&&!this.#e.retry.retryOnTimeout)throw e;if(Wne(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;let r=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(r&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let o=Number(r)*1e3;Number.isNaN(o)?o=Date.parse(r)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());let s=this.#e.retry.maxRetryAfter??o;return o<s?o:s}if(e.response.status===413)throw e}return this.#a()}#p(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}#d(e){e&&e.cancel().catch(()=>{})}#c(e){this.#d(e.body??void 0)}async#f(e){try{return await e()}catch(n){let r=Math.min(await this.#l(n),FR);if(this.#o<1)throw n;if(await KL(r,this.#s?{signal:this.#s}:{}),n instanceof Bd&&n.customRequest){let o=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#h(o)}for(let o of this.#e.hooks.beforeRetry){let s=await o({request:this.request,options:this.#m(),error:n,retryCount:this.#o});if(s instanceof globalThis.Request){this.#h(s);break}if(s instanceof globalThis.Response)return s;if(s===HR)return}return this.#f(e)}}async#_(){this.#r?.signal.aborted&&(this.#r=new globalThis.AbortController,this.#e.signal=this.#s?AbortSignal.any([this.#s,this.#r.signal]):this.#r.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(let n of this.#e.hooks.beforeRequest){let r=await n(this.request,this.#m(),{retryCount:this.#o});if(r instanceof Response)return r;if(r instanceof globalThis.Request){this.#h(r);break}}let e=Vne(this.request,this.#e);return this.#i=this.request,this.request=this.#i.clone(),this.#e.timeout===!1?this.#e.fetch(this.#i,e):WL(this.#i,e,this.#r,this.#e)}#m(){if(!this.#u){let{hooks:e,...n}=this.#e;this.#u=Object.freeze(n)}return this.#u}#h(e){this.#u=void 0,this.request=this.#g(e)}#g(e,n){return!this.#e.onUploadProgress||!e.body?e:Dne(e,this.#e.onUploadProgress,n??this.#e.body??void 0)}}});var zL,EHe,Ph,Qne=S(()=>{p();u();l();Xne();Ku();qL();zL=t=>{let e=(n,r)=>Ch.create(n,Oh(t,r));for(let n of $R)e[n]=(r,o)=>Ch.create(r,Oh(t,o,{method:n}));return e.create=n=>zL(Oh(n)),e.extend=n=>(typeof n=="function"&&(n=n(t??{})),zL(Oh(t,n))),e.stop=HR,e.retry=Pne,e},EHe=zL(),Ph=EHe});var ve,XL,Y,si,xh=S(()=>{p();u();l();(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ve||(ve={}));(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(XL||(XL={}));Y=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),si=t=>{switch(typeof t){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return Number.isNaN(t)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":return Array.isArray(t)?Y.array:t===null?Y.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Y.promise:typeof Map<"u"&&t instanceof Map?Y.map:typeof Set<"u"&&t instanceof Set?Y.set:typeof Date<"u"&&t instanceof Date?Y.date:Y.object;default:return Y.unknown}}});var L,THe,Gr,qR=S(()=>{p();u();l();xh();L=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),THe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Gr=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let d=i.path[c];c===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(i))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Gr.create=t=>new Gr(t)});var SHe,Zi,QL=S(()=>{p();u();l();qR();xh();SHe=(t,e)=>{let n;switch(t.code){case L.invalid_type:t.received===Y.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ve.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${ve.joinValues(t.keys,", ")}`;break;case L.invalid_union:n="Invalid input";break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ve.joinValues(t.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${ve.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:n="Invalid function arguments";break;case L.invalid_return_type:n="Invalid function return type";break;case L.invalid_date:n="Invalid date";break;case L.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ve.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case L.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case L.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case L.custom:n="Invalid input";break;case L.invalid_intersection_types:n="Intersection results could not be merged";break;case L.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:n="Number must be finite";break;default:n=e.defaultError,ve.assertNever(t)}return{message:n}},Zi=SHe});function AHe(t){Jne=t}function $d(){return Jne}var Jne,YR=S(()=>{p();u();l();QL();Jne=Zi});function H(t,e){let n=$d(),r=vh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Zi?void 0:Zi].filter(o=>!!o)});t.common.issues.push(r)}var vh,yHe,bn,pe,Xu,qn,WR,KR,Ic,Fd,JL=S(()=>{p();u();l();YR();QL();vh=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(d=>!!d).slice().reverse();for(let d of c)a=d(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},yHe=[];bn=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return pe;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},pe=Object.freeze({status:"aborted"}),Xu=t=>({status:"dirty",value:t}),qn=t=>({status:"valid",value:t}),WR=t=>t.status==="aborted",KR=t=>t.status==="dirty",Ic=t=>t.status==="valid",Fd=t=>typeof Promise<"u"&&t instanceof Promise});var Zne=S(()=>{p();u();l()});var re,ere=S(()=>{p();u();l();(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(re||(re={}))});function ye(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}function ore(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function GHe(t){return new RegExp(`^${ore(t)}$`)}function sre(t){let e=`${rre}T${ore(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function BHe(t,e){return!!((e==="v4"||!e)&&MHe.test(t)||(e==="v6"||!e)&&wHe.test(t))}function $He(t,e){if(!CHe.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function FHe(t,e){return!!((e==="v4"||!e)&&LHe.test(t)||(e==="v6"||!e)&&DHe.test(t))}function HHe(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}function Hd(t){if(t instanceof Br){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Bo.create(Hd(r))}return new Br({...t._def,shape:()=>e})}else return t instanceof na?new na({...t._def,type:Hd(t.element)}):t instanceof Bo?Bo.create(Hd(t.unwrap())):t instanceof ai?ai.create(Hd(t.unwrap())):t instanceof ii?ii.create(t.items.map(e=>Hd(e))):t}function ew(t,e){let n=si(t),r=si(e);if(t===e)return{valid:!0,data:t};if(n===Y.object&&r===Y.object){let o=ve.objectKeys(e),s=ve.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=ew(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===Y.array&&r===Y.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=ew(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===Y.date&&r===Y.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function ire(t,e){return new al({values:t,typeName:me.ZodEnum,...ye(e)})}function nre(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function are(t,e={},n){return t?bc.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=nre(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=nre(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):bc.create()}var $o,tre,Ne,RHe,IHe,NHe,bHe,OHe,CHe,PHe,xHe,vHe,ZL,MHe,LHe,wHe,DHe,UHe,kHe,rre,jHe,Nc,Qu,Ju,Zu,el,Vd,tl,nl,bc,ta,hs,qd,na,Br,rl,ea,zR,ol,ii,XR,Yd,Wd,QR,sl,il,al,cl,Oc,Fo,Bo,ai,ul,ll,Kd,VHe,Mh,Lh,pl,qHe,me,YHe,cre,ure,WHe,KHe,lre,zHe,XHe,QHe,JHe,ZHe,eVe,tVe,nVe,rVe,oVe,sVe,iVe,aVe,cVe,uVe,lVe,pVe,dVe,fVe,mVe,_Ve,hVe,gVe,EVe,TVe,SVe,AVe,yVe,RVe,IVe,NVe,bVe,OVe,CVe,pre=S(()=>{p();u();l();qR();YR();ere();JL();xh();$o=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},tre=(t,e)=>{if(Ic(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Gr(t.common.issues);return this._error=n,this._error}}};Ne=class{get description(){return this._def.description}_getType(e){return si(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:si(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bn,ctx:{common:e.parent.common,data:e.data,parsedType:si(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Fd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)},o=this._parseSync({data:e,path:r.path,parent:r});return tre(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Ic(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Ic(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(Fd(o)?o:Promise.resolve(o));return tre(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:L.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new Fo({schema:this,typeName:me.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Bo.create(this,this._def)}nullable(){return ai.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return na.create(this)}promise(){return Oc.create(this,this._def)}or(e){return rl.create([this,e],this._def)}and(e){return ol.create(this,e,this._def)}transform(e){return new Fo({...ye(this._def),schema:this,typeName:me.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new ul({...ye(this._def),innerType:this,defaultValue:n,typeName:me.ZodDefault})}brand(){return new Mh({typeName:me.ZodBranded,type:this,...ye(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new ll({...ye(this._def),innerType:this,catchValue:n,typeName:me.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Lh.create(this,e)}readonly(){return pl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RHe=/^c[^\s-]{8,}$/i,IHe=/^[0-9a-z]+$/,NHe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bHe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,OHe=/^[a-z0-9_-]{21}$/i,CHe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PHe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xHe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vHe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",MHe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,LHe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,DHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UHe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,kHe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,rre="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",jHe=new RegExp(`^${rre}$`);Nc=class t extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Y.string){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:Y.string,received:s.parsedType}),pe}let r=new bn,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?H(o,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&H(o,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")xHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"email",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")ZL||(ZL=new RegExp(vHe,"u")),ZL.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"emoji",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")bHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"uuid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")OHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"nanoid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")RHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cuid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")IHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cuid2",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")NHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"ulid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),H(o,{validation:"url",code:L.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"regex",code:L.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?sre(s).test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?jHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?GHe(s).test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?PHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"duration",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?BHe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"ip",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?$He(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"jwt",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?FHe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cidr",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?UHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"base64",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?kHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"base64url",code:L.invalid_string,message:s.message}),r.dirty()):ve.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:L.invalid_string,...re.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...re.errToObj(e)})}url(e){return this._addCheck({kind:"url",...re.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...re.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...re.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...re.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...re.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...re.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...re.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...re.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...re.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...re.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...re.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...re.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...re.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...re.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...re.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...re.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...re.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...re.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...re.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...re.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...re.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...re.errToObj(n)})}nonempty(e){return this.min(1,re.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Nc.create=t=>new Nc({checks:[],typeName:me.ZodString,coerce:t?.coerce??!1,...ye(t)});Qu=class t extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Y.number){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:Y.number,received:s.parsedType}),pe}let r,o=new bn;for(let s of this._def.checks)s.kind==="int"?ve.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:L.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?HHe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:L.not_finite,message:s.message}),o.dirty()):ve.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,re.toString(n))}gt(e,n){return this.setLimit("min",e,!1,re.toString(n))}lte(e,n){return this.setLimit("max",e,!0,re.toString(n))}lt(e,n){return this.setLimit("max",e,!1,re.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:re.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:re.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:re.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ve.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Qu.create=t=>new Qu({checks:[],typeName:me.ZodNumber,coerce:t?.coerce||!1,...ye(t)});Ju=class t extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Y.bigint)return this._getInvalidInput(e);let r,o=new bn;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ve.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return H(n,{code:L.invalid_type,expected:Y.bigint,received:n.parsedType}),pe}gte(e,n){return this.setLimit("min",e,!0,re.toString(n))}gt(e,n){return this.setLimit("min",e,!1,re.toString(n))}lte(e,n){return this.setLimit("max",e,!0,re.toString(n))}lt(e,n){return this.setLimit("max",e,!1,re.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:re.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ju.create=t=>new Ju({checks:[],typeName:me.ZodBigInt,coerce:t?.coerce??!1,...ye(t)});Zu=class extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Y.boolean){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.boolean,received:r.parsedType}),pe}return qn(e.data)}};Zu.create=t=>new Zu({typeName:me.ZodBoolean,coerce:t?.coerce||!1,...ye(t)});el=class t extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Y.date){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:Y.date,received:s.parsedType}),pe}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_date}),pe}let r=new bn,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:L.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:L.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ve.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:re.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:re.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};el.create=t=>new el({checks:[],coerce:t?.coerce||!1,typeName:me.ZodDate,...ye(t)});Vd=class extends Ne{_parse(e){if(this._getType(e)!==Y.symbol){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.symbol,received:r.parsedType}),pe}return qn(e.data)}};Vd.create=t=>new Vd({typeName:me.ZodSymbol,...ye(t)});tl=class extends Ne{_parse(e){if(this._getType(e)!==Y.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.undefined,received:r.parsedType}),pe}return qn(e.data)}};tl.create=t=>new tl({typeName:me.ZodUndefined,...ye(t)});nl=class extends Ne{_parse(e){if(this._getType(e)!==Y.null){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.null,received:r.parsedType}),pe}return qn(e.data)}};nl.create=t=>new nl({typeName:me.ZodNull,...ye(t)});bc=class extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return qn(e.data)}};bc.create=t=>new bc({typeName:me.ZodAny,...ye(t)});ta=class extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return qn(e.data)}};ta.create=t=>new ta({typeName:me.ZodUnknown,...ye(t)});hs=class extends Ne{_parse(e){let n=this._getOrReturnCtx(e);return H(n,{code:L.invalid_type,expected:Y.never,received:n.parsedType}),pe}};hs.create=t=>new hs({typeName:me.ZodNever,...ye(t)});qd=class extends Ne{_parse(e){if(this._getType(e)!==Y.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.void,received:r.parsedType}),pe}return qn(e.data)}};qd.create=t=>new qd({typeName:me.ZodVoid,...ye(t)});na=class t extends Ne{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Y.array)return H(n,{code:L.invalid_type,expected:Y.array,received:n.parsedType}),pe;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(H(n,{code:i?L.too_big:L.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(H(n,{code:L.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(H(n,{code:L.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new $o(n,i,n.path,a)))).then(i=>bn.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new $o(n,i,n.path,a)));return bn.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:re.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:re.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:re.toString(n)}})}nonempty(e){return this.min(1,e)}};na.create=(t,e)=>new na({type:t,minLength:null,maxLength:null,exactLength:null,typeName:me.ZodArray,...ye(e)});Br=class t extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ve.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Y.object){let d=this._getOrReturnCtx(e);return H(d,{code:L.invalid_type,expected:Y.object,received:d.parsedType}),pe}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof hs&&this._def.unknownKeys==="strip"))for(let d in o.data)i.includes(d)||a.push(d);let c=[];for(let d of i){let f=s[d],m=o.data[d];c.push({key:{status:"valid",value:d},value:f._parse(new $o(o,m,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof hs){let d=this._def.unknownKeys;if(d==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(d==="strict")a.length>0&&(H(o,{code:L.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let f of a){let m=o.data[f];c.push({key:{status:"valid",value:f},value:d._parse(new $o(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let d=[];for(let f of c){let m=await f.key,_=await f.value;d.push({key:m,value:_,alwaysSet:f.alwaysSet})}return d}).then(d=>bn.mergeObjectSync(r,d)):bn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return re.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:re.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:me.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of ve.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of ve.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Hd(this)}partial(e){let n={};for(let r of ve.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of ve.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Bo;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return ire(ve.objectKeys(this.shape))}};Br.create=(t,e)=>new Br({shape:()=>t,unknownKeys:"strip",catchall:hs.create(),typeName:me.ZodObject,...ye(e)});Br.strictCreate=(t,e)=>new Br({shape:()=>t,unknownKeys:"strict",catchall:hs.create(),typeName:me.ZodObject,...ye(e)});Br.lazycreate=(t,e)=>new Br({shape:t,unknownKeys:"strip",catchall:hs.create(),typeName:me.ZodObject,...ye(e)});rl=class extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Gr(a.ctx.common.issues));return H(n,{code:L.invalid_union,unionErrors:i}),pe}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let d={...n,common:{...n.common,issues:[]},parent:null},f=c._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Gr(c));return H(n,{code:L.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};rl.create=(t,e)=>new rl({options:t,typeName:me.ZodUnion,...ye(e)});ea=t=>t instanceof sl?ea(t.schema):t instanceof Fo?ea(t.innerType()):t instanceof il?[t.value]:t instanceof al?t.options:t instanceof cl?ve.objectValues(t.enum):t instanceof ul?ea(t._def.innerType):t instanceof tl?[void 0]:t instanceof nl?[null]:t instanceof Bo?[void 0,...ea(t.unwrap())]:t instanceof ai?[null,...ea(t.unwrap())]:t instanceof Mh||t instanceof pl?ea(t.unwrap()):t instanceof ll?ea(t._def.innerType):[],zR=class t extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.object)return H(n,{code:L.invalid_type,expected:Y.object,received:n.parsedType}),pe;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(H(n,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=ea(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:me.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...ye(r)})}};ol=class extends Ne{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(WR(s)||WR(i))return pe;let a=ew(s.value,i.value);return a.valid?((KR(s)||KR(i))&&n.dirty(),{status:n.value,value:a.data}):(H(r,{code:L.invalid_intersection_types}),pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ol.create=(t,e,n)=>new ol({left:t,right:e,typeName:me.ZodIntersection,...ye(n)});ii=class t extends Ne{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.array)return H(r,{code:L.invalid_type,expected:Y.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return H(r,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(H(r,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new $o(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>bn.mergeArray(n,i)):bn.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ii.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ii({items:t,typeName:me.ZodTuple,rest:null,...ye(e)})};XR=class t extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.object)return H(r,{code:L.invalid_type,expected:Y.object,received:r.parsedType}),pe;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new $o(r,a,r.path,a)),value:i._parse(new $o(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?bn.mergeObjectAsync(n,o):bn.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ne?new t({keyType:e,valueType:n,typeName:me.ZodRecord,...ye(r)}):new t({keyType:Nc.create(),valueType:e,typeName:me.ZodRecord,...ye(n)})}},Yd=class extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.map)return H(r,{code:L.invalid_type,expected:Y.map,received:r.parsedType}),pe;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],d)=>({key:o._parse(new $o(r,a,r.path,[d,"key"])),value:s._parse(new $o(r,c,r.path,[d,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let d=await c.key,f=await c.value;if(d.status==="aborted"||f.status==="aborted")return pe;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let d=c.key,f=c.value;if(d.status==="aborted"||f.status==="aborted")return pe;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}}}};Yd.create=(t,e,n)=>new Yd({valueType:e,keyType:t,typeName:me.ZodMap,...ye(n)});Wd=class t extends Ne{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.set)return H(r,{code:L.invalid_type,expected:Y.set,received:r.parsedType}),pe;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(H(r,{code:L.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(H(r,{code:L.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let d=new Set;for(let f of c){if(f.status==="aborted")return pe;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}let a=[...r.data.values()].map((c,d)=>s._parse(new $o(r,c,r.path,d)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:re.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:re.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Wd.create=(t,e)=>new Wd({valueType:t,minSize:null,maxSize:null,typeName:me.ZodSet,...ye(e)});QR=class t extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.function)return H(n,{code:L.invalid_type,expected:Y.function,received:n.parsedType}),pe;function r(a,c){return vh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,$d(),Zi].filter(d=>!!d),issueData:{code:L.invalid_arguments,argumentsError:c}})}function o(a,c){return vh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,$d(),Zi].filter(d=>!!d),issueData:{code:L.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Oc){let a=this;return qn(async function(...c){let d=new Gr([]),f=await a._def.args.parseAsync(c,s).catch(g=>{throw d.addIssue(r(c,g)),d}),m=await Reflect.apply(i,this,f);return await a._def.returns._def.type.parseAsync(m,s).catch(g=>{throw d.addIssue(o(m,g)),d})})}else{let a=this;return qn(function(...c){let d=a._def.args.safeParse(c,s);if(!d.success)throw new Gr([r(c,d.error)]);let f=Reflect.apply(i,this,d.data),m=a._def.returns.safeParse(f,s);if(!m.success)throw new Gr([o(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ii.create(e).rest(ta.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||ii.create([]).rest(ta.create()),returns:n||ta.create(),typeName:me.ZodFunction,...ye(r)})}},sl=class extends Ne{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};sl.create=(t,e)=>new sl({getter:t,typeName:me.ZodLazy,...ye(e)});il=class extends Ne{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return H(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};il.create=(t,e)=>new il({value:t,typeName:me.ZodLiteral,...ye(e)});al=class t extends Ne{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return H(n,{expected:ve.joinValues(r),received:n.parsedType,code:L.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return H(n,{received:n.data,code:L.invalid_enum_value,options:r}),pe}return qn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};al.create=ire;cl=class extends Ne{_parse(e){let n=ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Y.string&&r.parsedType!==Y.number){let o=ve.objectValues(n);return H(r,{expected:ve.joinValues(o),received:r.parsedType,code:L.invalid_type}),pe}if(this._cache||(this._cache=new Set(ve.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ve.objectValues(n);return H(r,{received:r.data,code:L.invalid_enum_value,options:o}),pe}return qn(e.data)}get enum(){return this._def.values}};cl.create=(t,e)=>new cl({values:t,typeName:me.ZodNativeEnum,...ye(e)});Oc=class extends Ne{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.promise&&n.common.async===!1)return H(n,{code:L.invalid_type,expected:Y.promise,received:n.parsedType}),pe;let r=n.parsedType===Y.promise?n.data:Promise.resolve(n.data);return qn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Oc.create=(t,e)=>new Oc({type:t,typeName:me.ZodPromise,...ye(e)});Fo=class extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{H(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return pe;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?pe:c.status==="dirty"?Xu(c.value):n.value==="dirty"?Xu(c.value):c});{if(n.value==="aborted")return pe;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"?Xu(a.value):n.value==="dirty"?Xu(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ic(i))return pe;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Ic(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):pe);ve.assertNever(o)}};Fo.create=(t,e,n)=>new Fo({schema:t,typeName:me.ZodEffects,effect:e,...ye(n)});Fo.createWithPreprocess=(t,e,n)=>new Fo({schema:e,effect:{type:"preprocess",transform:t},typeName:me.ZodEffects,...ye(n)});Bo=class extends Ne{_parse(e){return this._getType(e)===Y.undefined?qn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Bo.create=(t,e)=>new Bo({innerType:t,typeName:me.ZodOptional,...ye(e)});ai=class extends Ne{_parse(e){return this._getType(e)===Y.null?qn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ai.create=(t,e)=>new ai({innerType:t,typeName:me.ZodNullable,...ye(e)});ul=class extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===Y.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ul.create=(t,e)=>new ul({innerType:t,typeName:me.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ye(e)});ll=class extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Fd(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Gr(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Gr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ll.create=(t,e)=>new ll({innerType:t,typeName:me.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ye(e)});Kd=class extends Ne{_parse(e){if(this._getType(e)!==Y.nan){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.nan,received:r.parsedType}),pe}return{status:"valid",value:e.data}}};Kd.create=t=>new Kd({typeName:me.ZodNaN,...ye(t)});VHe=Symbol("zod_brand"),Mh=class extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Lh=class t extends Ne{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"?(n.dirty(),Xu(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:me.ZodPipeline})}},pl=class extends Ne{_parse(e){let n=this._def.innerType._parse(e),r=o=>(Ic(o)&&(o.value=Object.freeze(o.value)),o);return Fd(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};pl.create=(t,e)=>new pl({innerType:t,typeName:me.ZodReadonly,...ye(e)});qHe={object:Br.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(me||(me={}));YHe=(t,e={message:`Input not instance of ${t.name}`})=>are(n=>n instanceof t,e),cre=Nc.create,ure=Qu.create,WHe=Kd.create,KHe=Ju.create,lre=Zu.create,zHe=el.create,XHe=Vd.create,QHe=tl.create,JHe=nl.create,ZHe=bc.create,eVe=ta.create,tVe=hs.create,nVe=qd.create,rVe=na.create,oVe=Br.create,sVe=Br.strictCreate,iVe=rl.create,aVe=zR.create,cVe=ol.create,uVe=ii.create,lVe=XR.create,pVe=Yd.create,dVe=Wd.create,fVe=QR.create,mVe=sl.create,_Ve=il.create,hVe=al.create,gVe=cl.create,EVe=Oc.create,TVe=Fo.create,SVe=Bo.create,AVe=ai.create,yVe=Fo.createWithPreprocess,RVe=Lh.create,IVe=()=>cre().optional(),NVe=()=>ure().optional(),bVe=()=>lre().optional(),OVe={string:(t=>Nc.create({...t,coerce:!0})),number:(t=>Qu.create({...t,coerce:!0})),boolean:(t=>Zu.create({...t,coerce:!0})),bigint:(t=>Ju.create({...t,coerce:!0})),date:(t=>el.create({...t,coerce:!0}))},CVe=pe});var E={};Pn(E,{BRAND:()=>VHe,DIRTY:()=>Xu,EMPTY_PATH:()=>yHe,INVALID:()=>pe,NEVER:()=>CVe,OK:()=>qn,ParseStatus:()=>bn,Schema:()=>Ne,ZodAny:()=>bc,ZodArray:()=>na,ZodBigInt:()=>Ju,ZodBoolean:()=>Zu,ZodBranded:()=>Mh,ZodCatch:()=>ll,ZodDate:()=>el,ZodDefault:()=>ul,ZodDiscriminatedUnion:()=>zR,ZodEffects:()=>Fo,ZodEnum:()=>al,ZodError:()=>Gr,ZodFirstPartyTypeKind:()=>me,ZodFunction:()=>QR,ZodIntersection:()=>ol,ZodIssueCode:()=>L,ZodLazy:()=>sl,ZodLiteral:()=>il,ZodMap:()=>Yd,ZodNaN:()=>Kd,ZodNativeEnum:()=>cl,ZodNever:()=>hs,ZodNull:()=>nl,ZodNullable:()=>ai,ZodNumber:()=>Qu,ZodObject:()=>Br,ZodOptional:()=>Bo,ZodParsedType:()=>Y,ZodPipeline:()=>Lh,ZodPromise:()=>Oc,ZodReadonly:()=>pl,ZodRecord:()=>XR,ZodSchema:()=>Ne,ZodSet:()=>Wd,ZodString:()=>Nc,ZodSymbol:()=>Vd,ZodTransformer:()=>Fo,ZodTuple:()=>ii,ZodType:()=>Ne,ZodUndefined:()=>tl,ZodUnion:()=>rl,ZodUnknown:()=>ta,ZodVoid:()=>qd,addIssueToContext:()=>H,any:()=>ZHe,array:()=>rVe,bigint:()=>KHe,boolean:()=>lre,coerce:()=>OVe,custom:()=>are,date:()=>zHe,datetimeRegex:()=>sre,defaultErrorMap:()=>Zi,discriminatedUnion:()=>aVe,effect:()=>TVe,enum:()=>hVe,function:()=>fVe,getErrorMap:()=>$d,getParsedType:()=>si,instanceof:()=>YHe,intersection:()=>cVe,isAborted:()=>WR,isAsync:()=>Fd,isDirty:()=>KR,isValid:()=>Ic,late:()=>qHe,lazy:()=>mVe,literal:()=>_Ve,makeIssue:()=>vh,map:()=>pVe,nan:()=>WHe,nativeEnum:()=>gVe,never:()=>tVe,null:()=>JHe,nullable:()=>AVe,number:()=>ure,object:()=>oVe,objectUtil:()=>XL,oboolean:()=>bVe,onumber:()=>NVe,optional:()=>SVe,ostring:()=>IVe,pipeline:()=>RVe,preprocess:()=>yVe,promise:()=>EVe,quotelessJson:()=>THe,record:()=>lVe,set:()=>dVe,setErrorMap:()=>AHe,strictObject:()=>sVe,string:()=>cre,symbol:()=>XHe,transformer:()=>TVe,tuple:()=>uVe,undefined:()=>QHe,union:()=>iVe,unknown:()=>eVe,util:()=>ve,void:()=>nVe});var tw=S(()=>{p();u();l();YR();JL();Zne();xh();pre();qR()});var Cc=S(()=>{p();u();l();tw();tw()});var dre,fre,JR,ZR=S(()=>{"use strict";p();u();l();Cc();dre=E.object({orgSlug:E.string(),orgName:E.string(),projectSlug:E.string(),projectName:E.string()}),fre=E.object({dsn:E.string(),projectId:E.string(),orgId:E.string().optional(),source:E.enum(["env","env_file","config","code","inferred"]),sourcePath:E.string().optional(),resolved:dre.optional(),allResolved:E.array(dre).optional(),cachedAt:E.number()}),JR=["packages","apps","libs","services","modules"]});var PVe,mre,_re,xVe,vVe,MVe,hre=S(()=>{"use strict";p();u();l();Cc();ZR();PVe=E.object({orgSlug:E.string(),orgName:E.string(),projectSlug:E.string(),projectName:E.string(),cachedAt:E.number()}),mre=E.object({orgSlug:E.string(),projectSlug:E.string()}),_re=E.object({aliases:E.record(mre),cachedAt:E.number(),dsnFingerprint:E.string().optional()}),xVe=E.object({token:E.string().optional(),refreshToken:E.string().optional(),expiresAt:E.number().optional(),issuedAt:E.number().optional()}),vVe=E.object({organization:E.string().optional(),project:E.string().optional()}),MVe=E.object({auth:xVe.optional(),defaults:vVe.optional(),projectCache:E.record(PVe).optional(),dsnCache:E.record(fre).optional(),projectAliases:_re.optional()})});var nw,eI,tI,gre=S(()=>{"use strict";p();u();l();Cc();nw=E.object({device_code:E.string(),user_code:E.string(),verification_uri:E.string(),verification_uri_complete:E.string().optional(),expires_in:E.number(),interval:E.number()}).passthrough(),eI=E.object({access_token:E.string(),token_type:E.string(),expires_in:E.number(),expires_at:E.string().optional(),refresh_token:E.string().optional(),scope:E.string().optional(),user:E.object({id:E.string(),name:E.string(),email:E.string()}).passthrough().optional()}).passthrough(),tI=E.object({error:E.string(),error_description:E.string().optional()}).passthrough()});function rw(t){return Tre.includes(t)}function wh(t){if(!t.steps)return[];for(let e of t.steps)if(e.key==="root_cause_analysis"&&e.causes)return e.causes;return[]}function VVe(t){for(let e of t)if(e.key==="solution"){let n=Sre.safeParse(e);if(n.success)return n.data}return null}function Ere(t){for(let e of t)if(e.artifacts){let n=VVe(e.artifacts);if(n)return n}return null}function nI(t){let e=t;if(e.blocks){let n=Ere(e.blocks);if(n)return n}if(e.steps){let n=Ere(e.steps);if(n)return n}return null}var Tre,LVe,wVe,DVe,UVe,kVe,jVe,GVe,BVe,P4t,$Ve,FVe,Sre,HVe,x4t,v4t,M4t,L4t,Dh=S(()=>{"use strict";p();u();l();Cc();Tre=["COMPLETED","ERROR","CANCELLED"],LVe=E.object({message:E.string(),timestamp:E.string(),type:E.string().optional()}),wVe=E.object({file_path:E.string(),repo_name:E.string()}),DVe=E.object({title:E.string(),code_snippet_and_analysis:E.string(),is_most_important_event:E.boolean().optional(),relevant_code_file:wVe.optional(),timeline_item_type:E.string().optional()}),UVe=E.object({id:E.number(),description:E.string(),relevant_repos:E.array(E.string()).optional(),reproduction_urls:E.array(E.string()).optional(),root_cause_reproduction:E.array(DVe).optional()}),kVe=E.object({cause_id:E.number(),instruction:E.string().nullable().optional()}),jVe=E.object({id:E.string(),key:E.string(),status:E.string(),title:E.string(),progress:E.array(LVe).optional(),causes:E.array(UVe).optional(),selection:kVe.optional()}).passthrough(),GVe=E.object({integration_id:E.number().optional(),url:E.string().optional(),external_id:E.string(),name:E.string(),provider:E.string().optional(),default_branch:E.string().optional(),is_readable:E.boolean().optional(),is_writeable:E.boolean().optional()}),BVe=E.object({repo_external_id:E.string(),file_changes:E.array(E.unknown()).optional(),is_readable:E.boolean().optional(),is_writeable:E.boolean().optional()}),P4t=E.object({pr_number:E.number().optional(),pr_url:E.string().optional(),repo_name:E.string().optional()}),$Ve=E.object({title:E.string(),description:E.string()}),FVe=E.object({one_line_summary:E.string(),steps:E.array($Ve)}),Sre=E.object({key:E.literal("solution"),data:FVe,reason:E.string().optional()}),HVe=E.object({run_id:E.number(),status:E.string(),updated_at:E.string().optional(),request:E.object({organization_id:E.number().optional(),project_id:E.number().optional(),repos:E.array(E.unknown()).optional()}).optional(),codebases:E.record(E.string(),BVe).optional(),steps:E.array(jVe).optional(),repositories:E.array(GVe).optional(),coding_agents:E.record(E.string(),E.unknown()).optional(),created_at:E.string().optional(),completed_at:E.string().optional()}).passthrough(),x4t=E.object({autofix:HVe.nullable()}),v4t=E.object({type:E.literal("select_root_cause"),cause_id:E.number(),stopping_point:E.enum(["solution","code_changes","open_pr"]).optional()}),M4t=E.object({type:E.literal("select_solution")}),L4t=E.object({type:E.literal("create_pr")})});var Pre={};Pn(Pre,{BreadcrumbSchema:()=>pw,BreadcrumbsEntrySchema:()=>Nre,BrowserContextSchema:()=>dw,DetailedLogsResponseSchema:()=>uI,DetailedSentryLogSchema:()=>gw,DeviceContextSchema:()=>mw,ExceptionEntrySchema:()=>Ire,ExceptionValueSchema:()=>lw,ISSUE_LEVELS:()=>Are,ISSUE_PRIORITIES:()=>yre,ISSUE_STATUSES:()=>iw,ISSUE_SUBSTATUSES:()=>qVe,LOG_SEVERITIES:()=>Cre,LogsResponseSchema:()=>cI,MechanismSchema:()=>uw,OrganizationLinksSchema:()=>sw,OsContextSchema:()=>fw,ProjectKeyDsnSchema:()=>Ore,ProjectKeySchema:()=>aI,RegionSchema:()=>ow,ReleaseSchema:()=>Uh,RepositoryProviderSchema:()=>Tw,RequestEntrySchema:()=>bre,SentryEventSchema:()=>iI,SentryIssueSchema:()=>fl,SentryLogSchema:()=>hw,SentryOrganizationSchema:()=>zd,SentryProjectSchema:()=>dl,SentryRepositorySchema:()=>pI,SentryUserSchema:()=>sI,SpanSchema:()=>Rre,StackFrameSchema:()=>cw,StacktraceSchema:()=>rI,TraceContextSchema:()=>aw,TransactionListItemSchema:()=>Ew,TransactionsResponseSchema:()=>lI,UserGeoSchema:()=>_w,UserRegionsResponseSchema:()=>oI});var ow,oI,sw,zd,sI,dl,iw,Are,yre,qVe,Uh,fl,aw,Rre,cw,rI,uw,lw,Ire,pw,Nre,bre,dw,fw,mw,_w,iI,Ore,aI,Cre,hw,cI,gw,uI,Ew,lI,Tw,pI,Sw=S(()=>{"use strict";p();u();l();Cc();ow=E.object({name:E.string(),url:E.string().url()}),oI=E.object({regions:E.array(ow)}),sw=E.object({organizationUrl:E.string(),regionUrl:E.string()}),zd=E.object({id:E.string(),slug:E.string(),name:E.string(),dateCreated:E.string().optional(),isEarlyAdopter:E.boolean().optional(),require2FA:E.boolean().optional(),avatar:E.object({avatarType:E.string(),avatarUuid:E.string().nullable()}).passthrough().optional(),features:E.array(E.string()).optional(),links:sw.optional()}).passthrough(),sI=E.object({id:E.string(),email:E.string().optional(),username:E.string().optional(),name:E.string().optional()}).passthrough(),dl=E.object({id:E.string(),slug:E.string(),name:E.string(),platform:E.string().nullable().optional(),dateCreated:E.string().optional(),isBookmarked:E.boolean().optional(),isMember:E.boolean().optional(),features:E.array(E.string()).optional(),firstEvent:E.string().nullable().optional(),firstTransactionEvent:E.boolean().optional(),access:E.array(E.string()).optional(),hasAccess:E.boolean().optional(),hasMinifiedStackTrace:E.boolean().optional(),hasMonitors:E.boolean().optional(),hasProfiles:E.boolean().optional(),hasReplays:E.boolean().optional(),hasSessions:E.boolean().optional(),isInternal:E.boolean().optional(),isPublic:E.boolean().optional(),avatar:E.object({avatarType:E.string(),avatarUuid:E.string().nullable()}).passthrough().optional(),color:E.string().optional(),status:E.string().optional(),organization:E.object({id:E.string(),slug:E.string(),name:E.string()}).passthrough().optional()}).passthrough(),iw=["resolved","unresolved","ignored"],Are=["fatal","error","warning","info","debug"],yre=["high","medium","low"],qVe=["ongoing","escalating","regressed","new","archived_until_escalating","archived_until_condition_met","archived_forever"],Uh=E.object({id:E.number().optional(),version:E.string(),shortVersion:E.string().optional(),status:E.string().optional(),dateCreated:E.string().optional(),dateReleased:E.string().nullable().optional(),ref:E.string().nullable().optional(),url:E.string().nullable().optional(),commitCount:E.number().optional(),deployCount:E.number().optional(),authors:E.array(E.unknown()).optional(),projects:E.array(E.object({id:E.union([E.string(),E.number()]),slug:E.string(),name:E.string()}).passthrough()).optional()}).passthrough(),fl=E.object({id:E.string(),shortId:E.string(),title:E.string(),culprit:E.string().optional(),permalink:E.string().optional(),logger:E.string().nullable().optional(),level:E.string().optional(),status:E.enum(iw).optional(),statusDetails:E.record(E.unknown()).optional(),substatus:E.string().optional().nullable(),priority:E.string().optional(),isPublic:E.boolean().optional(),platform:E.string().optional(),project:E.object({id:E.string(),name:E.string(),slug:E.string(),platform:E.string().nullable().optional()}).passthrough().optional(),type:E.string().optional(),metadata:E.object({value:E.string().optional(),type:E.string().optional(),filename:E.string().optional(),function:E.string().optional(),display_title_with_tree_label:E.boolean().optional()}).passthrough().optional(),numComments:E.number().optional(),assignedTo:E.object({id:E.string(),name:E.string(),type:E.string()}).passthrough().nullable().optional(),isBookmarked:E.boolean().optional(),isSubscribed:E.boolean().optional(),subscriptionDetails:E.object({reason:E.string().optional()}).passthrough().nullable().optional(),hasSeen:E.boolean().optional(),annotations:E.array(E.object({displayName:E.string(),url:E.string()}).passthrough()).optional(),isUnhandled:E.boolean().optional(),count:E.string().optional(),userCount:E.number().optional(),firstSeen:E.string().datetime({offset:!0}).optional(),lastSeen:E.string().datetime({offset:!0}).optional(),firstRelease:Uh.nullable().optional(),lastRelease:Uh.nullable().optional()}).passthrough(),aw=E.object({trace_id:E.string().optional(),span_id:E.string().optional(),parent_span_id:E.string().nullable().optional(),op:E.string().optional(),status:E.string().optional(),description:E.string().nullable().optional()}).passthrough(),Rre=E.object({span_id:E.string(),parent_span_id:E.string().nullable().optional(),trace_id:E.string().optional(),op:E.string().optional(),description:E.string().nullable().optional(),start_timestamp:E.number(),timestamp:E.number(),status:E.string().optional(),data:E.record(E.unknown()).optional(),tags:E.record(E.string()).optional()}).passthrough(),cw=E.object({filename:E.string().nullable().optional(),absPath:E.string().nullable().optional(),module:E.string().nullable().optional(),package:E.string().nullable().optional(),platform:E.string().nullable().optional(),function:E.string().nullable().optional(),rawFunction:E.string().nullable().optional(),symbol:E.string().nullable().optional(),lineNo:E.number().nullable().optional(),colNo:E.number().nullable().optional(),inApp:E.boolean().nullable().optional(),context:E.array(E.tuple([E.number(),E.string()])).nullable().optional(),vars:E.record(E.unknown()).nullable().optional(),instructionAddr:E.string().nullable().optional(),symbolAddr:E.string().nullable().optional(),trust:E.string().nullable().optional(),errors:E.array(E.unknown()).nullable().optional()}).passthrough(),rI=E.object({frames:E.array(cw).optional(),framesOmitted:E.array(E.number()).nullable().optional(),registers:E.record(E.string()).nullable().optional(),hasSystemFrames:E.boolean().optional()}).passthrough(),uw=E.object({type:E.string().optional(),handled:E.boolean().optional(),synthetic:E.boolean().optional(),description:E.string().nullable().optional(),data:E.record(E.unknown()).optional()}).passthrough(),lw=E.object({type:E.string().nullable().optional(),value:E.string().nullable().optional(),module:E.string().nullable().optional(),threadId:E.union([E.string(),E.number()]).nullable().optional(),mechanism:uw.nullable().optional(),stacktrace:rI.nullable().optional(),rawStacktrace:rI.nullable().optional()}).passthrough(),Ire=E.object({type:E.literal("exception"),data:E.object({values:E.array(lw).optional(),excOmitted:E.array(E.number()).nullable().optional(),hasSystemFrames:E.boolean().optional()}).passthrough()}),pw=E.object({type:E.string().optional(),category:E.string().nullable().optional(),level:E.string().optional(),message:E.string().nullable().optional(),timestamp:E.string().optional(),event_id:E.string().nullable().optional(),data:E.record(E.unknown()).nullable().optional()}).passthrough(),Nre=E.object({type:E.literal("breadcrumbs"),data:E.object({values:E.array(pw).optional()}).passthrough()}),bre=E.object({type:E.literal("request"),data:E.object({url:E.string().nullable().optional(),method:E.string().nullable().optional(),fragment:E.string().nullable().optional(),query:E.union([E.array(E.tuple([E.string(),E.string()])),E.string(),E.record(E.string())]).nullable().optional(),data:E.unknown().nullable().optional(),headers:E.array(E.tuple([E.string(),E.string()])).nullable().optional(),cookies:E.union([E.array(E.tuple([E.string(),E.string()])),E.record(E.string())]).nullable().optional(),env:E.record(E.string()).nullable().optional(),inferredContentType:E.string().nullable().optional(),apiTarget:E.string().nullable().optional()}).passthrough()}),dw=E.object({name:E.string().optional(),version:E.string().optional(),type:E.literal("browser").optional()}).passthrough(),fw=E.object({name:E.string().optional(),version:E.string().optional(),type:E.literal("os").optional()}).passthrough(),mw=E.object({family:E.string().optional(),model:E.string().optional(),brand:E.string().optional(),type:E.literal("device").optional()}).passthrough(),_w=E.object({country_code:E.string().optional(),city:E.string().optional(),region:E.string().optional()}).passthrough(),iI=E.object({eventID:E.string(),id:E.string().optional(),projectID:E.string().optional(),context:E.record(E.unknown()).optional(),contexts:E.object({trace:aw.optional(),browser:dw.optional(),os:fw.optional(),device:mw.optional()}).passthrough().optional(),dateCreated:E.string().optional(),dateReceived:E.string().optional(),entries:E.array(E.unknown()).optional(),errors:E.array(E.unknown()).optional(),fingerprints:E.array(E.string()).optional(),groupID:E.string().optional(),message:E.string().optional(),metadata:E.record(E.unknown()).optional(),platform:E.string().optional(),location:E.string().nullable().optional(),culprit:E.string().nullable().optional(),sdk:E.object({name:E.string().nullable().optional(),version:E.string().nullable().optional()}).passthrough().nullable().optional(),tags:E.array(E.object({key:E.string(),value:E.string()})).optional(),title:E.string().optional(),type:E.string().optional(),user:E.object({id:E.string().nullable().optional(),email:E.string().nullable().optional(),username:E.string().nullable().optional(),ip_address:E.string().nullable().optional(),name:E.string().nullable().optional(),geo:_w.nullable().optional(),data:E.record(E.unknown()).nullable().optional()}).passthrough().nullable().optional(),release:Uh.nullable().optional(),sdkUpdates:E.array(E.object({type:E.string().optional(),sdkName:E.string().optional(),newSdkVersion:E.string().optional(),sdkUrl:E.string().optional()}).passthrough()).optional()}).passthrough(),Ore=E.object({public:E.string(),secret:E.string().optional()}),aI=E.object({id:E.string(),name:E.string(),dsn:Ore,isActive:E.boolean(),dateCreated:E.string().optional()}).passthrough(),Cre=["fatal","error","warning","warn","info","debug","trace"],hw=E.object({"sentry.item_id":E.string(),timestamp:E.string(),timestamp_precise:E.number(),message:E.string().nullable().optional(),severity:E.string().nullable().optional(),trace:E.string().nullable().optional()}).passthrough(),cI=E.object({data:E.array(hw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),gw=E.object({"sentry.item_id":E.string(),timestamp:E.string(),timestamp_precise:E.number(),message:E.string().nullable().optional(),severity:E.string().nullable().optional(),trace:E.string().nullable().optional(),project:E.string().nullable().optional(),environment:E.string().nullable().optional(),release:E.string().nullable().optional(),"sdk.name":E.string().nullable().optional(),"sdk.version":E.string().nullable().optional(),span_id:E.string().nullable().optional(),"code.function":E.string().nullable().optional(),"code.file.path":E.string().nullable().optional(),"code.line.number":E.string().nullable().optional(),"sentry.otel.kind":E.string().nullable().optional(),"sentry.otel.status_code":E.string().nullable().optional(),"sentry.otel.instrumentation_scope.name":E.string().nullable().optional()}).passthrough(),uI=E.object({data:E.array(gw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),Ew=E.object({trace:E.string(),id:E.string(),transaction:E.string(),timestamp:E.string(),"transaction.duration":E.number(),project:E.string()}).passthrough(),lI=E.object({data:E.array(Ew),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),Tw=E.object({id:E.string(),name:E.string()}),pI=E.object({id:E.string(),name:E.string(),url:E.string().nullable(),provider:Tw,status:E.string(),dateCreated:E.string().optional(),integrationId:E.string().optional(),externalSlug:E.string().nullable().optional(),externalId:E.string().nullable().optional()}).passthrough()});var Aw=S(()=>{"use strict";p();u();l();hre();gre();Dh();Sw()});function ml(){let t=typeof process.versions.bun<"u"?`bun/${process.versions.bun}`:`node/${process.versions.node}`;return`sentry-cli/${hn} (${process.platform}-${process.arch}) ${t}`}var ra,kh,hn,xre,ao=S(()=>{"use strict";p();u();l();ra="sentry.io",kh=`https://${ra}`,hn="0.9.0";xre="https://1188a86f3f8168f089450587b00bca66@o1.ingest.us.sentry.io/4510776311808000"});var YVe,vre,Mre=S(()=>{p();u();l();YVe=globalThis.__bun_sqlite_polyfill,vre=YVe.Database});function WVe(t){return t.query("SELECT value FROM metadata WHERE key = ?").get(wre)?.value==="true"}function yw(t){t.query("INSERT OR REPLACE INTO metadata (key, value) VALUES (?, ?)").run(wre,"true")}function KVe(){let t=(0,dI.join)(oa(),Rw),{existsSync:e}=require("node:fs");return e(t)}function zVe(){let t=(0,dI.join)(oa(),Rw);try{let{readFileSync:e}=require("node:fs"),n=e(t,"utf-8");return JSON.parse(n)}catch{return null}}function XVe(){let t=(0,dI.join)(oa(),Rw);try{return(0,Lre.rmSync)(t),!0}catch(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"?!0:(console.error("Warning: Could not delete old config.json:",e),!1)}}function Dre(t){if(WVe(t))return;if(!KVe()){yw(t);return}let e=zVe();if(!e){yw(t);return}console.error("Migrating config to SQLite..."),t.exec("BEGIN TRANSACTION");try{if(e.auth?.token&&t.query(`
|
|
64
|
+
Mongoose Error Code: ${e.code}`:""}`})}function mM(t,e,n,r=void 0){n&&(0,X_.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&tJ.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function Ije(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(mM(e,o,n,r),o)).catch(o=>{throw nJ(e,o),o}).finally(()=>e.end()):(mM(e,t,n,r),e.end(),t)}rc.handlePromiseResponse=Ije;function Nje(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2?a=1:o.length===3&&(a=2),o[a]=(c,d)=>(c?nJ(r,c):mM(r,d,s,i),r.end(),t(c,d)),e.apply(n,o)}rc.handleCallbackResponse=Nje});var oJ=y(ad=>{"use strict";p();u();l();Object.defineProperty(ad,"__esModule",{value:!0});ad.PACKAGE_NAME=ad.PACKAGE_VERSION=void 0;ad.PACKAGE_VERSION="0.57.0";ad.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var uJ=y(Dr=>{"use strict";p();u();l();Object.defineProperty(Dr,"__esModule",{value:!0});Dr.MongooseInstrumentation=Dr._ALREADY_INSTRUMENTED=Dr._STORED_PARENT_SPAN=void 0;var on=(U(),D(J)),bje=Be(),_M=rJ(),In=he(),sJ=oJ(),oc=fM(),ju=(Le(),D(Xe)),uy=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],Oje=["remove","count","findOneAndRemove",...uy],Cje=["count","findOneAndRemove",...uy],Pje=[...uy];function iJ(t){return t?t.startsWith("6.")||t.startsWith("5.")?Oje:t.startsWith("7.")?Cje:Pje:uy}function aJ(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}function cJ(t){return!t||!t.startsWith("8.")?!1:parseInt(t.split(".")[1],10)>=21}Dr._STORED_PARENT_SPAN=Symbol("stored-parent-span");Dr._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var hM=class extends In.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(sJ.PACKAGE_NAME,sJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,In.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,In.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new In.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <9"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,aJ(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),cJ(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),iJ(n).forEach(s=>{this._wrap(r.Query.prototype,s,this.patchAndCaptureSpanContext(s))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e,o=iJ(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,aJ(n)&&this._unwrap(r.Model.prototype,"remove"),cJ(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(s=>{this._unwrap(r.Query.prototype,s)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return r.apply(this,arguments);let i=this[Dr._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let f=c("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&In.SemconvStability.OLD&&(a[oc.ATTR_DB_STATEMENT]=f),n._dbSemconvStability&In.SemconvStability.STABLE&&(a[ju.ATTR_DB_QUERY_TEXT]=f)}let d=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(this[Dr._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return r.apply(this,arguments);let i=this[Dr._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let f=c(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&In.SemconvStability.OLD&&(a[oc.ATTR_DB_STATEMENT]=f),n._dbSemconvStability&In.SemconvStability.STABLE&&(a[ju.ATTR_DB_QUERY_TEXT]=f)}let d=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return o.apply(this,arguments);let c={document:this};i&&!(i instanceof Function)&&(c.options=i);let d={},{dbStatementSerializer:f}=r.getConfig();if(f){let _=f(e,c);r._dbSemconvStability&In.SemconvStability.OLD&&(d[oc.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&In.SemconvStability.STABLE&&(d[ju.ATTR_DB_QUERY_TEXT]=_)}let m=r._startSpan(this.constructor.collection,this.constructor.modelName,e,d);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(m,o,this,arguments,a,n)}}_patchDocumentUpdateMethods(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return o.apply(this,arguments);let d=c,f=i,m=a;typeof i=="function"?(d=i,f=void 0,m=void 0):typeof a=="function"&&(d=a,m=void 0);let _={},g=r.getConfig().dbStatementSerializer;if(g){let R=g(e,{condition:{_id:this._id},updates:f,options:m});r._dbSemconvStability&In.SemconvStability.OLD&&(_[oc.ATTR_DB_STATEMENT]=R),r._dbSemconvStability&In.SemconvStability.STABLE&&(_[ju.ATTR_DB_QUERY_TEXT]=R)}let T=r._startSpan(this.constructor.collection,this.constructor.modelName,e,_),A=r._handleResponse(T,o,this,arguments,d,n);return A&&typeof A=="object"&&(A[Dr._ALREADY_INSTRUMENTED]=!0),A}}patchModelStatic(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&on.trace.getSpan(on.context.active())===void 0)return o.apply(this,arguments);typeof a=="function"&&(c=a,a=void 0);let d={};switch(e){case"insertMany":d.documents=i;break;case"bulkWrite":d.operations=i;break;default:d.document=i;break}a!==void 0&&(d.options=a);let f={},{dbStatementSerializer:m}=r.getConfig();if(m){let g=m(e,d);r._dbSemconvStability&In.SemconvStability.OLD&&(f[oc.ATTR_DB_STATEMENT]=g),r._dbSemconvStability&In.SemconvStability.STABLE&&(f[ju.ATTR_DB_QUERY_TEXT]=g)}let _=r._startSpan(this.collection,this.modelName,e,f);return r._handleResponse(_,o,this,arguments,c,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=on.trace.getSpan(on.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[Dr._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[Dr._STORED_PARENT_SPAN]=on.trace.getSpan(on.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){let i={...o,...(0,_M.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&In.SemconvStability.OLD&&(i[oc.ATTR_DB_OPERATION]=r,i[oc.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&In.SemconvStability.STABLE&&(i[ju.ATTR_DB_OPERATION_NAME]=r,i[ju.ATTR_DB_SYSTEM_NAME]=oc.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&In.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(a,{kind:on.SpanKind.CLIENT,attributes:i},s?on.trace.setSpan(on.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,_M.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let c=a._callOriginalFunction(()=>n.apply(r,o));return(0,_M.handlePromiseResponse)(c,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?on.context.with((0,bje.suppressTracing)(on.context.active()),e):e()}};Dr.MongooseInstrumentation=hM});var lJ=y(ly=>{"use strict";p();u();l();Object.defineProperty(ly,"__esModule",{value:!0});ly.MongooseInstrumentation=void 0;var xje=uJ();Object.defineProperty(ly,"MongooseInstrumentation",{enumerable:!0,get:function(){return xje.MongooseInstrumentation}})});var pJ,dJ,fJ,vje,mJ,_J=S(()=>{p();u();l();pJ=j(lJ(),1);je();dJ="Mongoose",fJ=Z(dJ,()=>new pJ.MongooseInstrumentation({responseHook(t){Ve(t,"auto.db.otel.mongoose")}})),vje=(()=>({name:dJ,setupOnce(){fJ()}})),mJ=vje});var hJ=y(Wt=>{"use strict";p();u();l();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Wt.DB_SYSTEM_VALUE_MYSQL=Wt.ATTR_NET_PEER_PORT=Wt.ATTR_NET_PEER_NAME=Wt.ATTR_DB_USER=Wt.ATTR_DB_SYSTEM=Wt.ATTR_DB_STATEMENT=Wt.ATTR_DB_NAME=Wt.ATTR_DB_CONNECTION_STRING=void 0;Wt.ATTR_DB_CONNECTION_STRING="db.connection_string";Wt.ATTR_DB_NAME="db.name";Wt.ATTR_DB_STATEMENT="db.statement";Wt.ATTR_DB_SYSTEM="db.system";Wt.ATTR_DB_USER="db.user";Wt.ATTR_NET_PEER_NAME="net.peer.name";Wt.ATTR_NET_PEER_PORT="net.peer.port";Wt.DB_SYSTEM_VALUE_MYSQL="mysql";Wt.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var gJ=y(Q_=>{"use strict";p();u();l();Object.defineProperty(Q_,"__esModule",{value:!0});Q_.AttributeNames=void 0;var Mje;(function(t){t.MYSQL_VALUES="db.mysql.values"})(Mje=Q_.AttributeNames||(Q_.AttributeNames={}))});var EJ=y(Fn=>{"use strict";p();u();l();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.getPoolNameOld=Fn.arrayStringifyHelper=Fn.getSpanName=Fn.getDbValues=Fn.getDbQueryText=Fn.getJDBCString=Fn.getConfig=void 0;function Lje(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}Fn.getConfig=Lje;function wje(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}Fn.getJDBCString=wje;function Dje(t){return typeof t=="string"?t:t.sql}Fn.getDbQueryText=Dje;function Uje(t,e){return gM(typeof t=="string"?e:e||t.values)}Fn.getDbValues=Uje;function kje(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Fn.getSpanName=kje;function gM(t){return t?`[${t.toString()}]`:""}Fn.arrayStringifyHelper=gM;function jje(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}Fn.getPoolNameOld=jje});var TJ=y(cd=>{"use strict";p();u();l();Object.defineProperty(cd,"__esModule",{value:!0});cd.PACKAGE_NAME=cd.PACKAGE_VERSION=void 0;cd.PACKAGE_VERSION="0.57.0";cd.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var AJ=y(py=>{"use strict";p();u();l();Object.defineProperty(py,"__esModule",{value:!0});py.MySQLInstrumentation=void 0;var Ur=(U(),D(J)),wo=he(),ud=(Le(),D(Xe)),Wi=hJ(),Gje=gJ(),Gu=EJ(),SJ=TJ(),EM=class extends wo.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(SJ.PACKAGE_NAME,SJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,wo.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,wo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Wi.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsageOld?.add(e,{state:r,name:n})}init(){return[new wo.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,wo.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,wo.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,wo.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolCallbacks(s,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,c=i-a,d=(0,Gu.getPoolNameOld)(e);r._connCountAdd(-c,d,"used"),r._connCountAdd(-a,d,"idle"),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let c=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),d=a[c].pool;r._setPoolCallbacks(d,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let c=r._getConnectionCallbackPatchFn(s);return n.call(e,c)}if(arguments.length===2&&typeof i=="function"){let c=r._getConnectionCallbackPatchFn(i);return n.call(e,s,c)}if(arguments.length===3&&typeof a=="function"){let c=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,c)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=Ur.context.active();return function(o,s){s&&((0,wo.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&Ur.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a={},{host:c,port:d,database:f,user:m}=(0,Gu.getConfig)(e.config),_=parseInt(d,10),g=(0,Gu.getDbQueryText)(o);r._dbSemconvStability&wo.SemconvStability.OLD&&(a[Wi.ATTR_DB_SYSTEM]=Wi.DB_SYSTEM_VALUE_MYSQL,a[Wi.ATTR_DB_CONNECTION_STRING]=(0,Gu.getJDBCString)(c,d,f),a[Wi.ATTR_DB_NAME]=f,a[Wi.ATTR_DB_USER]=m,a[Wi.ATTR_DB_STATEMENT]=g),r._dbSemconvStability&wo.SemconvStability.STABLE&&(a[ud.ATTR_DB_SYSTEM_NAME]=ud.DB_SYSTEM_NAME_VALUE_MYSQL,a[ud.ATTR_DB_NAMESPACE]=f,a[ud.ATTR_DB_QUERY_TEXT]=g),r._netSemconvStability&wo.SemconvStability.OLD&&(a[Wi.ATTR_NET_PEER_NAME]=c,isNaN(_)||(a[Wi.ATTR_NET_PEER_PORT]=_)),r._netSemconvStability&wo.SemconvStability.STABLE&&(a[ud.ATTR_SERVER_ADDRESS]=c,isNaN(_)||(a[ud.ATTR_SERVER_PORT]=_));let T=r.tracer.startSpan((0,Gu.getSpanName)(o),{kind:Ur.SpanKind.CLIENT,attributes:a});if(r.getConfig().enhancedDatabaseReporting){let b;Array.isArray(s)?b=s:arguments[2]&&(b=[s]),T.setAttribute(Gje.AttributeNames.MYSQL_VALUES,(0,Gu.getDbValues)(o,b))}let A=Array.from(arguments).findIndex(b=>typeof b=="function"),R=Ur.context.active();if(A===-1){let b=Ur.context.with(Ur.trace.setSpan(Ur.context.active(),T),()=>n.apply(e,arguments));return Ur.context.bind(R,b),b.on("error",I=>T.setStatus({code:Ur.SpanStatusCode.ERROR,message:I.message})).on("end",()=>{T.end()})}else return r._wrap(arguments,A,r._patchCallbackQuery(T,R)),Ur.context.with(Ur.trace.setSpan(Ur.context.active(),T),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:Ur.SpanStatusCode.ERROR,message:o.message}),e.end(),Ur.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(e,n){let r=n||(0,Gu.getPoolNameOld)(e);e.on("connection",o=>{this._connCountAdd(1,r,"idle")}),e.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),e.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};py.MySQLInstrumentation=EM});var yJ=y(dy=>{"use strict";p();u();l();Object.defineProperty(dy,"__esModule",{value:!0});dy.MySQLInstrumentation=void 0;var Bje=AJ();Object.defineProperty(dy,"MySQLInstrumentation",{enumerable:!0,get:function(){return Bje.MySQLInstrumentation}})});var RJ,IJ,NJ,$je,bJ,OJ=S(()=>{p();u();l();RJ=j(yJ(),1);je();IJ="Mysql",NJ=Z(IJ,()=>new RJ.MySQLInstrumentation({})),$je=(()=>({name:IJ,setupOnce(){NJ()}})),bJ=$je});var TM=y(fn=>{"use strict";p();u();l();Object.defineProperty(fn,"__esModule",{value:!0});fn.DB_SYSTEM_VALUE_MYSQL=fn.ATTR_NET_PEER_PORT=fn.ATTR_NET_PEER_NAME=fn.ATTR_DB_USER=fn.ATTR_DB_SYSTEM=fn.ATTR_DB_STATEMENT=fn.ATTR_DB_NAME=fn.ATTR_DB_CONNECTION_STRING=void 0;fn.ATTR_DB_CONNECTION_STRING="db.connection_string";fn.ATTR_DB_NAME="db.name";fn.ATTR_DB_STATEMENT="db.statement";fn.ATTR_DB_SYSTEM="db.system";fn.ATTR_DB_USER="db.user";fn.ATTR_NET_PEER_NAME="net.peer.name";fn.ATTR_NET_PEER_PORT="net.peer.port";fn.DB_SYSTEM_VALUE_MYSQL="mysql"});var AM=y(fy=>{"use strict";p();u();l();Object.defineProperty(fy,"__esModule",{value:!0});fy.addSqlCommenterComment=void 0;var SM=(U(),D(J)),Fje=Be();function Hje(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function Vje(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function qje(t,e){if(typeof e!="string"||e.length===0||Hje(e))return e;let n=new Fje.W3CTraceContextPropagator,r={};n.inject(SM.trace.setSpan(SM.ROOT_CONTEXT,t),r,SM.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=Vje(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}fy.addSqlCommenterComment=qje});var CJ=y(Do=>{"use strict";p();u();l();Object.defineProperty(Do,"__esModule",{value:!0});Do.getConnectionPrototypeToInstrument=Do.once=Do.getSpanName=Do.getQueryText=Do.getConnectionAttributes=void 0;var J_=TM(),my=he(),yM=(Le(),D(Xe));function Yje(t,e,n){let{host:r,port:o,database:s,user:i}=Wje(t),a={};e&my.SemconvStability.OLD&&(a[J_.ATTR_DB_CONNECTION_STRING]=Kje(r,o,s),a[J_.ATTR_DB_NAME]=s,a[J_.ATTR_DB_USER]=i),e&my.SemconvStability.STABLE&&(a[yM.ATTR_DB_NAMESPACE]=s);let c=parseInt(o,10);return n&my.SemconvStability.OLD&&(a[J_.ATTR_NET_PEER_NAME]=r,isNaN(c)||(a[J_.ATTR_NET_PEER_PORT]=c)),n&my.SemconvStability.STABLE&&(a[yM.ATTR_SERVER_ADDRESS]=r,isNaN(c)||(a[yM.ATTR_SERVER_PORT]=c)),a}Do.getConnectionAttributes=Yje;function Wje(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function Kje(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function zje(t,e,n,r=!1,o=Xje){let[s,i]=typeof t=="string"?[t,n]:[t.sql,Qje(t)?n||t.values:n];try{return r?o(s):e&&i?e(s,i):s}catch{return"Could not determine the query due to an error in masking or formatting"}}Do.getQueryText=zje;function Xje(t){return t.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function Qje(t){return"values"in t}function Jje(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Do.getSpanName=Jje;var Zje=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Do.once=Zje;function eGe(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}Do.getConnectionPrototypeToInstrument=eGe});var PJ=y(ld=>{"use strict";p();u();l();Object.defineProperty(ld,"__esModule",{value:!0});ld.PACKAGE_NAME=ld.PACKAGE_VERSION=void 0;ld.PACKAGE_VERSION="0.57.0";ld.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var LJ=y(_y=>{"use strict";p();u();l();Object.defineProperty(_y,"__esModule",{value:!0});_y.MySQL2Instrumentation=void 0;var xJ=(U(),D(J)),fs=he(),RM=TM(),vJ=AM(),pd=CJ(),MJ=PJ(),IM=(Le(),D(Xe)),NM=[">=1.4.2 <4"],bM=class extends fs.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(MJ.PACKAGE_NAME,MJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,fs.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,fs.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,fs.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,fs.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new fs.InstrumentationNodeModuleDefinition("mysql2",NM,s=>(n(s),s),()=>{},[new fs.InstrumentationNodeModuleFile("mysql2/promise.js",NM,s=>(n(s),s),()=>{}),new fs.InstrumentationNodeModuleFile("mysql2/lib/connection.js",NM,s=>{let i=(0,pd.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,pd.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let c;Array.isArray(i)?c=i:arguments[2]&&(c=[i]);let{maskStatement:d,maskStatementHook:f,responseHook:m}=o.getConfig(),_=(0,pd.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),g=(0,pd.getQueryText)(s,e,c,d,f);o._dbSemconvStability&fs.SemconvStability.OLD&&(_[RM.ATTR_DB_SYSTEM]=RM.DB_SYSTEM_VALUE_MYSQL,_[RM.ATTR_DB_STATEMENT]=g),o._dbSemconvStability&fs.SemconvStability.STABLE&&(_[IM.ATTR_DB_SYSTEM_NAME]=IM.DB_SYSTEM_NAME_VALUE_MYSQL,_[IM.ATTR_DB_QUERY_TEXT]=g);let T=o.tracer.startSpan((0,pd.getSpanName)(s),{kind:xJ.SpanKind.CLIENT,attributes:_});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,vJ.addSqlCommenterComment)(T,s):Object.assign(s,{sql:(0,vJ.addSqlCommenterComment)(T,s.sql)}));let A=(0,pd.once)((R,b)=>{R?T.setStatus({code:xJ.SpanStatusCode.ERROR,message:R.message}):typeof m=="function"&&(0,fs.safeExecuteInTheMiddle)(()=>{m(T,{queryResults:b})},I=>{I&&o._diag.warn("Failed executing responseHook",I)},!0),T.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(A));let R=r.apply(this,arguments);return R.once("error",b=>{A(b)}).once("result",b=>{A(void 0,b)}),R}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(A)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(A)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};_y.MySQL2Instrumentation=bM});var wJ=y(hy=>{"use strict";p();u();l();Object.defineProperty(hy,"__esModule",{value:!0});hy.MySQL2Instrumentation=void 0;var tGe=LJ();Object.defineProperty(hy,"MySQL2Instrumentation",{enumerable:!0,get:function(){return tGe.MySQL2Instrumentation}})});var DJ,UJ,kJ,nGe,jJ,GJ=S(()=>{p();u();l();DJ=j(wJ(),1);je();UJ="Mysql2",kJ=Z(UJ,()=>new DJ.MySQL2Instrumentation({responseHook(t){Ve(t,"auto.db.otel.mysql2")}})),nGe=(()=>({name:UJ,setupOnce(){kJ()}})),jJ=nGe});var BJ=y(Hn=>{"use strict";p();u();l();Object.defineProperty(Hn,"__esModule",{value:!0});Hn.DB_SYSTEM_VALUE_REDIS=Hn.DB_SYSTEM_NAME_VALUE_REDIS=Hn.ATTR_NET_PEER_PORT=Hn.ATTR_NET_PEER_NAME=Hn.ATTR_DB_SYSTEM=Hn.ATTR_DB_STATEMENT=Hn.ATTR_DB_CONNECTION_STRING=void 0;Hn.ATTR_DB_CONNECTION_STRING="db.connection_string";Hn.ATTR_DB_STATEMENT="db.statement";Hn.ATTR_DB_SYSTEM="db.system";Hn.ATTR_NET_PEER_NAME="net.peer.name";Hn.ATTR_NET_PEER_PORT="net.peer.port";Hn.DB_SYSTEM_NAME_VALUE_REDIS="redis";Hn.DB_SYSTEM_VALUE_REDIS="redis"});var $J=y(gy=>{"use strict";p();u();l();Object.defineProperty(gy,"__esModule",{value:!0});gy.endSpan=void 0;var rGe=(U(),D(J)),oGe=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:rGe.SpanStatusCode.ERROR,message:e.message})),t.end()};gy.endSpan=oGe});var Ty=y(Ey=>{"use strict";p();u();l();Object.defineProperty(Ey,"__esModule",{value:!0});Ey.defaultDbStatementSerializer=void 0;var sGe=[{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}],iGe=(t,e)=>{if(Array.isArray(e)&&e.length){let n=sGe.find(({regex:o})=>o.test(t))?.args??0,r=n>=0?e.slice(0,n):e;return e.length>r.length&&r.push(`[${e.length-n} other arguments]`),`${t} ${r.join(" ")}`}return t};Ey.defaultDbStatementSerializer=iGe});var FJ=y(dd=>{"use strict";p();u();l();Object.defineProperty(dd,"__esModule",{value:!0});dd.PACKAGE_NAME=dd.PACKAGE_VERSION=void 0;dd.PACKAGE_VERSION="0.59.0";dd.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var YJ=y(Sy=>{"use strict";p();u();l();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.IORedisInstrumentation=void 0;var sc=(U(),D(J)),kr=he(),ic=(Le(),D(Xe)),jr=BJ(),HJ=he(),Z_=$J(),aGe=Ty(),VJ=FJ(),qJ={requireParentSpan:!0},OM=class extends kr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(VJ.PACKAGE_NAME,VJ.PACKAGE_VERSION,{...qJ,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,kr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,kr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...qJ,...e})}init(){return[new kr.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,kr.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,kr.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||aGe.defaultDbStatementSerializer,a=sc.trace.getSpan(sc.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let c={},{host:d,port:f}=this.options,m=i(o.name,o.args);r._dbSemconvStability&kr.SemconvStability.OLD&&(c[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_REDIS,c[jr.ATTR_DB_STATEMENT]=m,c[jr.ATTR_DB_CONNECTION_STRING]=`redis://${d}:${f}`),r._dbSemconvStability&kr.SemconvStability.STABLE&&(c[ic.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_REDIS,c[ic.ATTR_DB_QUERY_TEXT]=m),r._netSemconvStability&kr.SemconvStability.OLD&&(c[jr.ATTR_NET_PEER_NAME]=d,c[jr.ATTR_NET_PEER_PORT]=f),r._netSemconvStability&kr.SemconvStability.STABLE&&(c[ic.ATTR_SERVER_ADDRESS]=d,c[ic.ATTR_SERVER_PORT]=f);let _=r.tracer.startSpan(o.name,{kind:sc.SpanKind.CLIENT,attributes:c}),{requestHook:g}=s;g&&(0,HJ.safeExecuteInTheMiddle)(()=>g(_,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),T=>{T&&sc.diag.error("ioredis instrumentation: request hook failed",T)},!0);try{let T=e.apply(this,arguments),A=o.resolve;o.resolve=function(b){(0,HJ.safeExecuteInTheMiddle)(()=>s.responseHook?.(_,o.name,o.args,b),I=>{I&&sc.diag.error("ioredis instrumentation: response hook failed",I)},!0),(0,Z_.endSpan)(_,null),A(b)};let R=o.reject;return o.reject=function(b){(0,Z_.endSpan)(_,b),R(b)},T}catch(T){throw(0,Z_.endSpan)(_,T),T}}}_traceConnection(e){let n=this;return function(){let r=sc.trace.getSpan(sc.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o={},{host:s,port:i}=this.options;n._dbSemconvStability&kr.SemconvStability.OLD&&(o[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_REDIS,o[jr.ATTR_DB_STATEMENT]="connect",o[jr.ATTR_DB_CONNECTION_STRING]=`redis://${s}:${i}`),n._dbSemconvStability&kr.SemconvStability.STABLE&&(o[ic.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_REDIS,o[ic.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&kr.SemconvStability.OLD&&(o[jr.ATTR_NET_PEER_NAME]=s,o[jr.ATTR_NET_PEER_PORT]=i),n._netSemconvStability&kr.SemconvStability.STABLE&&(o[ic.ATTR_SERVER_ADDRESS]=s,o[ic.ATTR_SERVER_PORT]=i);let a=n.tracer.startSpan("connect",{kind:sc.SpanKind.CLIENT,attributes:o});try{let c=e.apply(this,arguments);return(0,Z_.endSpan)(a,null),c}catch(c){throw(0,Z_.endSpan)(a,c),c}}}};Sy.IORedisInstrumentation=OM});var WJ=y(Ay=>{"use strict";p();u();l();Object.defineProperty(Ay,"__esModule",{value:!0});Ay.IORedisInstrumentation=void 0;var cGe=YJ();Object.defineProperty(Ay,"IORedisInstrumentation",{enumerable:!0,get:function(){return cGe.IORedisInstrumentation}})});var yy=y(fd=>{"use strict";p();u();l();Object.defineProperty(fd,"__esModule",{value:!0});fd.PACKAGE_NAME=fd.PACKAGE_VERSION=void 0;fd.PACKAGE_VERSION="0.59.0";fd.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var KJ=y(ac=>{"use strict";p();u();l();Object.defineProperty(ac,"__esModule",{value:!0});ac.getTracedCreateStreamTrace=ac.getTracedCreateClient=ac.endSpan=void 0;var eh=(U(),D(J)),uGe=(t,e)=>{e&&t.setStatus({code:eh.SpanStatusCode.ERROR,message:e.message}),t.end()};ac.endSpan=uGe;var lGe=t=>function(){let n=t.apply(this,arguments);return eh.context.bind(eh.context.active(),n)};ac.getTracedCreateClient=lGe;var pGe=t=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){eh.context.bind(eh.context.active(),n),this._patched_redis_stream=n}}),t.apply(this,arguments)};ac.getTracedCreateStreamTrace=pGe});var Ry=y(Vn=>{"use strict";p();u();l();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.DB_SYSTEM_VALUE_REDIS=Vn.DB_SYSTEM_NAME_VALUE_REDIS=Vn.ATTR_NET_PEER_PORT=Vn.ATTR_NET_PEER_NAME=Vn.ATTR_DB_SYSTEM=Vn.ATTR_DB_STATEMENT=Vn.ATTR_DB_CONNECTION_STRING=void 0;Vn.ATTR_DB_CONNECTION_STRING="db.connection_string";Vn.ATTR_DB_STATEMENT="db.statement";Vn.ATTR_DB_SYSTEM="db.system";Vn.ATTR_NET_PEER_NAME="net.peer.name";Vn.ATTR_NET_PEER_PORT="net.peer.port";Vn.DB_SYSTEM_NAME_VALUE_REDIS="redis";Vn.DB_SYSTEM_VALUE_REDIS="redis"});var XJ=y(Ny=>{"use strict";p();u();l();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.RedisInstrumentationV2_V3=void 0;var oo=he(),Iy=KJ(),zJ=yy(),th=(U(),D(J)),nh=(Le(),D(Xe)),Bu=Ry(),dGe=Ty(),CM=class t extends oo.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(zJ.PACKAGE_NAME,zJ.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,oo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,oo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new oo.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],e=>((0,oo.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._wrap(e.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,oo.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,"create_stream"),this._wrap(e.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,oo.isWrapped)(e.createClient)&&this._unwrap(e,"createClient"),this._wrap(e,"createClient",this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._unwrap(e.RedisClient.prototype,"create_stream"),this._unwrap(e,"createClient"))})]}_getPatchInternalSendCommand(){let e=this;return function(r){return function(s){if(arguments.length!==1||typeof s!="object")return r.apply(this,arguments);let i=e.getConfig(),a=th.trace.getSpan(th.context.active())===void 0;if(i.requireParentSpan===!0&&a)return r.apply(this,arguments);let c=i?.dbStatementSerializer||dGe.defaultDbStatementSerializer,d={};e._semconvStability&oo.SemconvStability.OLD&&Object.assign(d,{[Bu.ATTR_DB_SYSTEM]:Bu.DB_SYSTEM_VALUE_REDIS,[Bu.ATTR_DB_STATEMENT]:c(s.command,s.args)}),e._semconvStability&oo.SemconvStability.STABLE&&Object.assign(d,{[nh.ATTR_DB_SYSTEM_NAME]:Bu.DB_SYSTEM_NAME_VALUE_REDIS,[nh.ATTR_DB_OPERATION_NAME]:s.command,[nh.ATTR_DB_QUERY_TEXT]:c(s.command,s.args)});let f=e.tracer.startSpan(`${t.COMPONENT}-${s.command}`,{kind:th.SpanKind.CLIENT,attributes:d});if(this.connection_options){let _={};e._semconvStability&oo.SemconvStability.OLD&&Object.assign(_,{[Bu.ATTR_NET_PEER_NAME]:this.connection_options.host,[Bu.ATTR_NET_PEER_PORT]:this.connection_options.port}),e._semconvStability&oo.SemconvStability.STABLE&&Object.assign(_,{[nh.ATTR_SERVER_ADDRESS]:this.connection_options.host,[nh.ATTR_SERVER_PORT]:this.connection_options.port}),f.setAttributes(_)}this.address&&e._semconvStability&oo.SemconvStability.OLD&&f.setAttribute(Bu.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let m=arguments[0].callback;if(m){let _=th.context.active();arguments[0].callback=function(T,A){if(i?.responseHook){let R=i.responseHook;(0,oo.safeExecuteInTheMiddle)(()=>{R(f,s.command,s.args,A)},b=>{b&&e._diag.error("Error executing responseHook",b)},!0)}return(0,Iy.endSpan)(f,T),th.context.with(_,m,this,...arguments)}}try{return r.apply(this,arguments)}catch(_){throw(0,Iy.endSpan)(f,_),_}}}}_getPatchCreateClient(){return function(n){return(0,Iy.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,Iy.getTracedCreateStreamTrace)(n)}}};Ny.RedisInstrumentationV2_V3=CM});var JJ=y(by=>{"use strict";p();u();l();Object.defineProperty(by,"__esModule",{value:!0});by.getClientAttributes=void 0;var PM=(Le(),D(Xe)),md=Ry(),QJ=he();function fGe(t,e,n){let r={};return n&QJ.SemconvStability.OLD&&Object.assign(r,{[md.ATTR_DB_SYSTEM]:md.DB_SYSTEM_VALUE_REDIS,[md.ATTR_NET_PEER_NAME]:e?.socket?.host,[md.ATTR_NET_PEER_PORT]:e?.socket?.port,[md.ATTR_DB_CONNECTION_STRING]:mGe(t,e?.url)}),n&QJ.SemconvStability.STABLE&&Object.assign(r,{[PM.ATTR_DB_SYSTEM_NAME]:md.DB_SYSTEM_NAME_VALUE_REDIS,[PM.ATTR_SERVER_ADDRESS]:e?.socket?.host,[PM.ATTR_SERVER_PORT]:e?.socket?.port}),r}by.getClientAttributes=fGe;function mGe(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var nZ=y(Oy=>{"use strict";p();u();l();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.RedisInstrumentationV4_V5=void 0;var Uo=(U(),D(J)),st=he(),ZJ=JJ(),_Ge=Ty(),eZ=yy(),xM=(Le(),D(Xe)),hGe=Ry(),rh=Symbol("opentelemetry.instrumentation.redis.open_spans"),tZ=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),vM=class t extends st.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(eZ.PACKAGE_NAME,eZ.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,st.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,st.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let c=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,st.isWrapped)(s?.[c])&&this._unwrap(s,c),this._wrap(s,c,this._getPatchExtendWithCommands(a)),s},s=>{(0,st.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,st.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return(0,st.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),this._wrap(i,"exec",this._getPatchMultiCommandsExec(!1)),(0,st.isWrapped)(i?.execAsPipeline)&&this._unwrap(i,"execAsPipeline"),this._wrap(i,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,st.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand"),this._wrap(i,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{let i=s?.default?.prototype;(0,st.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),(0,st.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand")}),o=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return i?.multi&&((0,st.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),this._wrap(i,"multi",this._getPatchRedisClientMulti())),i?.MULTI&&((0,st.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),this._wrap(i,"MULTI",this._getPatchRedisClientMulti())),(0,st.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand"),this._wrap(i,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(i,"connect",this._getPatchedClientConnect()),s},s=>{let i=s?.default?.prototype;(0,st.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),(0,st.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),(0,st.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand")});return new st.InstrumentationNodeModuleDefinition(e,["^1.0.0","^5.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){if(i?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let a=i.executor;return i.executor=function(c,d){let f=e(c,d).args;return n._traceClientCommand(a,this,arguments,f)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let n=this;return function(o){return function(){let i=o.apply(this,arguments);return typeof i?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),i):i.then(a=>{let c=this[rh];return n._endSpansWithRedisReplies(c,a,e),a}).catch(a=>{let c=this[rh];if(!c)n._diag.error("cannot find open spans to end for multi/pipeline");else{let d=a.constructor.name==="MultiErrorReply"?a.replies:new Array(c.length).fill(a);n._endSpansWithRedisReplies(c,d,e)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[tZ]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,ZJ.getClientAttributes)(e._diag,s,e._semconvStability),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:Uo.SpanKind.CLIENT,attributes:i});return Uo.context.with(Uo.trace.setSpan(Uo.context.active(),a),()=>r.apply(this)).then(d=>(a.end(),d)).catch(d=>(a.recordException(d),a.setStatus({code:Uo.SpanStatusCode.ERROR,message:d.message}),a.end(),Promise.reject(d)))}}}_traceClientCommand(e,n,r,o){if(Uo.trace.getSpan(Uo.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[tZ],a=o[0],c=o.slice(1),d=this.getConfig().dbStatementSerializer||_Ge.defaultDbStatementSerializer,f=(0,ZJ.getClientAttributes)(this._diag,i,this._semconvStability);this._semconvStability&st.SemconvStability.STABLE&&(f[xM.ATTR_DB_OPERATION_NAME]=a);try{let g=d(a,c);g!=null&&(this._semconvStability&st.SemconvStability.OLD&&(f[hGe.ATTR_DB_STATEMENT]=g),this._semconvStability&st.SemconvStability.STABLE&&(f[xM.ATTR_DB_QUERY_TEXT]=g))}catch(g){this._diag.error("dbStatementSerializer throw an exception",g,{commandName:a})}let m=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:Uo.SpanKind.CLIENT,attributes:f}),_=Uo.context.with(Uo.trace.setSpan(Uo.context.active(),m),()=>e.apply(n,r));if(typeof _?.then=="function")_.then(g=>{this._endSpanWithResponse(m,a,c,g,void 0)},g=>{this._endSpanWithResponse(m,a,c,null,g)});else{let g=_;g[rh]=g[rh]||[],g[rh].push({span:m,commandName:a,commandArgs:c})}return _}_endSpansWithRedisReplies(e,n,r=!1){if(!e)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");let o=e.map(a=>a.commandName),i=o.every(a=>a===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let a=0;a<e.length;a++){let{span:c,commandArgs:d}=e[a],f=n[a],[m,_]=f instanceof Error?[null,f]:[f,void 0];this._semconvStability&st.SemconvStability.STABLE&&c.setAttribute(xM.ATTR_DB_OPERATION_NAME,i),this._endSpanWithResponse(c,o[a],d,m,_)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:Uo.SpanStatusCode.ERROR,message:s?.message})),e.end()}};Oy.RedisInstrumentationV4_V5=vM});var sZ=y(Cy=>{"use strict";p();u();l();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.RedisInstrumentation=void 0;var gGe=he(),rZ=yy(),EGe=XJ(),TGe=nZ(),oZ={requireParentSpan:!1},MM=class extends gGe.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(e={}){let n={...oZ,...e};super(rZ.PACKAGE_NAME,rZ.PACKAGE_VERSION,n),this.instrumentationV2_V3=new EGe.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new TGe.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let n={...oZ,...e};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};Cy.RedisInstrumentation=MM});var iZ=y(Py=>{"use strict";p();u();l();Object.defineProperty(Py,"__esModule",{value:!0});Py.RedisInstrumentation=void 0;var SGe=sZ();Object.defineProperty(Py,"RedisInstrumentation",{enumerable:!0,get:function(){return SGe.RedisInstrumentation}})});function oh(t,e){return t.includes(e.toLowerCase())}function wM(t){return oh(LM,t)?"cache.get":oh(yGe,t)?"cache.put":void 0}function RGe(t,e){return e.some(n=>t.startsWith(n))}function cZ(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?aZ(o.map(s=>n(s))):["<unknown>"],r=e[0];return oh(AGe,t)&&r!=null?n(r):aZ(e.map(o=>n(o)))}catch{return}}function uZ(t,e,n){if(!wM(t))return!1;for(let r of e)if(RGe(r,n))return!0;return!1}function lZ(t){let e=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function aZ(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var AGe,LM,yGe,pZ=S(()=>{p();u();l();AGe=["get","set","setex"],LM=["get","mget"],yGe=["set","setex"]});var dZ,fZ,xy,sh,mZ,IGe,NGe,_Z,bGe,hZ,gZ=S(()=>{p();u();l();dZ=j(WJ(),1),fZ=j(iZ(),1);ne();je();pZ();xy="Redis",sh={},mZ=(t,e,n,r)=>{t.setAttribute(fe,"auto.db.otel.redis");let o=cZ(e,n),s=wM(e);if(!o||!s||!sh.cachePrefixes||!uZ(e,o,sh.cachePrefixes))return;let i=ae(t).data["net.peer.name"],a=ae(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let c=lZ(r);c&&t.setAttribute(PC,c),oh(LM,e)&&c!==void 0&&t.setAttribute(OC,c>0),t.setAttributes({[ge]:s,[CC]:o});let d=o.join(", ");t.updateName(sh.maxCacheKeyLength?Ra(d,sh.maxCacheKeyLength):d)},IGe=Z(`${xy}.IORedis`,()=>new dZ.IORedisInstrumentation({responseHook:mZ})),NGe=Z(`${xy}.Redis`,()=>new fZ.RedisInstrumentation({responseHook:mZ})),_Z=Object.assign(()=>{IGe(),NGe()},{id:xy}),bGe=((t={})=>({name:xy,setupOnce(){sh=t,_Z()}})),hZ=bGe});var EZ=y(vy=>{"use strict";p();u();l();Object.defineProperty(vy,"__esModule",{value:!0});vy.EVENT_LISTENERS_SET=void 0;vy.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var DM=y(ih=>{"use strict";p();u();l();Object.defineProperty(ih,"__esModule",{value:!0});ih.AttributeNames=void 0;var OGe;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(OGe=ih.AttributeNames||(ih.AttributeNames={}))});var UM=y(Fe=>{"use strict";p();u();l();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Fe.METRIC_DB_CLIENT_CONNECTION_COUNT=Fe.DB_SYSTEM_VALUE_POSTGRESQL=Fe.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Fe.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Fe.ATTR_NET_PEER_PORT=Fe.ATTR_NET_PEER_NAME=Fe.ATTR_DB_USER=Fe.ATTR_DB_SYSTEM=Fe.ATTR_DB_STATEMENT=Fe.ATTR_DB_NAME=Fe.ATTR_DB_CONNECTION_STRING=Fe.ATTR_DB_CLIENT_CONNECTION_STATE=Fe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Fe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Fe.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Fe.ATTR_DB_CONNECTION_STRING="db.connection_string";Fe.ATTR_DB_NAME="db.name";Fe.ATTR_DB_STATEMENT="db.statement";Fe.ATTR_DB_SYSTEM="db.system";Fe.ATTR_DB_USER="db.user";Fe.ATTR_NET_PEER_NAME="net.peer.name";Fe.ATTR_NET_PEER_PORT="net.peer.port";Fe.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Fe.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Fe.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Fe.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Fe.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var kM=y(ah=>{"use strict";p();u();l();Object.defineProperty(ah,"__esModule",{value:!0});ah.SpanNames=void 0;var CGe;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(CGe=ah.SpanNames||(ah.SpanNames={}))});var NZ=y(Ue=>{"use strict";p();u();l();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.sanitizedErrorMessage=Ue.isObjectWithTextString=Ue.getErrorMessage=Ue.patchClientConnectCallback=Ue.patchCallbackPGPool=Ue.updateCounter=Ue.getPoolName=Ue.patchCallback=Ue.handleExecutionResult=Ue.handleConfigQuery=Ue.shouldSkipInstrumentation=Ue.getSemanticAttributesFromPoolConnection=Ue.getSemanticAttributesFromConnection=Ue.getConnectionString=Ue.parseAndMaskConnectionString=Ue.parseNormalizedOperationName=Ue.getQuerySpanName=void 0;var cc=(U(),D(J)),My=DM(),ko=(Le(),D(Xe)),Nt=UM(),$u=he(),TZ=kM();function SZ(t,e){if(!e)return TZ.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:AZ(e.text);return`${TZ.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}Ue.getQuerySpanName=SZ;function AZ(t){let e=t.trim(),n=e.indexOf(" "),r=n===-1?e:e.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}Ue.parseNormalizedOperationName=AZ;function yZ(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"postgresql://localhost:5432/"}}Ue.parseAndMaskConnectionString=yZ;function jM(t){if("connectionString"in t&&t.connectionString)return yZ(t.connectionString);let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}Ue.getConnectionString=jM;function Ly(t){if(Number.isInteger(t))return t}function RZ(t,e){let n={};return e&$u.SemconvStability.OLD&&(n={...n,[Nt.ATTR_DB_SYSTEM]:Nt.DB_SYSTEM_VALUE_POSTGRESQL,[Nt.ATTR_DB_NAME]:t.database,[Nt.ATTR_DB_CONNECTION_STRING]:jM(t),[Nt.ATTR_DB_USER]:t.user,[Nt.ATTR_NET_PEER_NAME]:t.host,[Nt.ATTR_NET_PEER_PORT]:Ly(t.port)}),e&$u.SemconvStability.STABLE&&(n={...n,[ko.ATTR_DB_SYSTEM_NAME]:ko.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[ko.ATTR_DB_NAMESPACE]:t.namespace,[ko.ATTR_SERVER_ADDRESS]:t.host,[ko.ATTR_SERVER_PORT]:Ly(t.port)}),n}Ue.getSemanticAttributesFromConnection=RZ;function PGe(t,e){let n;try{n=t.connectionString?new URL(t.connectionString):void 0}catch{n=void 0}let r={[My.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[My.AttributeNames.MAX_CLIENT]:t.maxClient};return e&$u.SemconvStability.OLD&&(r={...r,[Nt.ATTR_DB_SYSTEM]:Nt.DB_SYSTEM_VALUE_POSTGRESQL,[Nt.ATTR_DB_NAME]:n?.pathname.slice(1)??t.database,[Nt.ATTR_DB_CONNECTION_STRING]:jM(t),[Nt.ATTR_NET_PEER_NAME]:n?.hostname??t.host,[Nt.ATTR_NET_PEER_PORT]:Number(n?.port)||Ly(t.port),[Nt.ATTR_DB_USER]:n?.username??t.user}),e&$u.SemconvStability.STABLE&&(r={...r,[ko.ATTR_DB_SYSTEM_NAME]:ko.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[ko.ATTR_DB_NAMESPACE]:t.namespace,[ko.ATTR_SERVER_ADDRESS]:n?.hostname??t.host,[ko.ATTR_SERVER_PORT]:Number(n?.port)||Ly(t.port)}),r}Ue.getSemanticAttributesFromPoolConnection=PGe;function xGe(t){return t.requireParentSpan===!0&&cc.trace.getSpan(cc.context.active())===void 0}Ue.shouldSkipInstrumentation=xGe;function vGe(t,e,n,r){let{connectionParameters:o}=this,s=o.database,i=SZ(s,r),a=t.startSpan(i,{kind:cc.SpanKind.CLIENT,attributes:RZ(o,n)});if(!r)return a;if(r.text&&(n&$u.SemconvStability.OLD&&a.setAttribute(Nt.ATTR_DB_STATEMENT,r.text),n&$u.SemconvStability.STABLE&&a.setAttribute(ko.ATTR_DB_QUERY_TEXT,r.text)),e.enhancedDatabaseReporting&&Array.isArray(r.values))try{let c=r.values.map(d=>d==null?"null":d instanceof Buffer?d.toString():typeof d=="object"?typeof d.toPostgres=="function"?d.toPostgres():JSON.stringify(d):d.toString());a.setAttribute(My.AttributeNames.PG_VALUES,c)}catch(c){cc.diag.error("failed to stringify ",r.values,c)}return typeof r.name=="string"&&a.setAttribute(My.AttributeNames.PG_PLAN,r.name),a}Ue.handleConfigQuery=vGe;function IZ(t,e,n){typeof t.responseHook=="function"&&(0,$u.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&cc.diag.error("Error running response hook",r)},!0)}Ue.handleExecutionResult=IZ;function MGe(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[ko.ATTR_ERROR_TYPE]=i.code),i instanceof Error&&e.recordException(wy(i)),e.setStatus({code:cc.SpanStatusCode.ERROR,message:i.message})):IZ(t,e,a),o(),e.end(),n.call(this,i,a)}}Ue.patchCallback=MGe;function LGe(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}Ue.getPoolName=LGe;function wGe(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,c=s-a;return n.add(c-o.used,{[Nt.ATTR_DB_CLIENT_CONNECTION_STATE]:Nt.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Nt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[Nt.ATTR_DB_CLIENT_CONNECTION_STATE]:Nt.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Nt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[Nt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:c,idle:a,pending:i}}Ue.updateCounter=wGe;function DGe(t,e){return function(r,o,s){r&&(r instanceof Error&&t.recordException(wy(r)),t.setStatus({code:cc.SpanStatusCode.ERROR,message:r.message})),t.end(),e.call(this,r,o,s)}}Ue.patchCallbackPGPool=DGe;function UGe(t,e){return function(r){r&&(r instanceof Error&&t.recordException(wy(r)),t.setStatus({code:cc.SpanStatusCode.ERROR,message:r.message})),t.end(),e.apply(this,arguments)}}Ue.patchClientConnectCallback=UGe;function kGe(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}Ue.getErrorMessage=kGe;function jGe(t){return typeof t=="object"&&typeof t?.text=="string"}Ue.isObjectWithTextString=jGe;function wy(t){let e=t?.name??"PostgreSQLError",n=t?.code??"UNKNOWN";return`PostgreSQL error of type '${e}' occurred (code: ${n})`}Ue.sanitizedErrorMessage=wy});var bZ=y(_d=>{"use strict";p();u();l();Object.defineProperty(_d,"__esModule",{value:!0});_d.PACKAGE_NAME=_d.PACKAGE_VERSION=void 0;_d.PACKAGE_VERSION="0.63.0";_d.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var MZ=y(Uy=>{"use strict";p();u();l();Object.defineProperty(Uy,"__esModule",{value:!0});Uy.PgInstrumentation=void 0;var Tr=he(),Ke=(U(),D(J)),OZ=EZ(),ht=NZ(),CZ=AM(),PZ=bZ(),xZ=kM(),Dy=Be(),ms=(Le(),D(Xe)),ch=UM();function hd(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var GM=class extends Tr.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(e={}){super(PZ.PACKAGE_NAME,PZ.PACKAGE_VERSION,e),this._semconvStability=(0,Tr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(ms.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Ke.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(ch.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(ch.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new Tr.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new Tr.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),s=new Tr.InstrumentationNodeModuleDefinition("pg",e,a=>{let c=hd(a);return this._patchPgClient(c.Client),a},a=>{let c=hd(a);return this._unpatchPgClient(c.Client),a},[o,r]),i=new Tr.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let c=hd(a);return(0,Tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect"),this._wrap(c.prototype,"connect",this._getPoolConnectPatch()),c},a=>{let c=hd(a);(0,Tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect")});return[s,i]}_patchPgClient(e){if(!e)return;let n=hd(e);return(0,Tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),e}_unpatchPgClient(e){let n=hd(e);return(0,Tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ht.shouldSkipInstrumentation(s)||s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(xZ.SpanNames.CONNECT,{kind:Ke.SpanKind.CLIENT,attributes:ht.getSemanticAttributesFromConnection(this,e._semconvStability)});if(o){let c=Ke.trace.getSpan(Ke.context.active());o=ht.patchClientConnectCallback(i,o),c&&(o=Ke.context.bind(Ke.context.active(),o))}let a=Ke.context.with(Ke.trace.setSpan(Ke.context.active(),i),()=>n.call(this,o));return vZ(i,a)}}recordOperationDuration(e,n){let r={},o=[ms.ATTR_DB_NAMESPACE,ms.ATTR_ERROR_TYPE,ms.ATTR_SERVER_PORT,ms.ATTR_SERVER_ADDRESS,ms.ATTR_DB_OPERATION_NAME];this._semconvStability&Tr.SemconvStability.OLD&&o.push(ch.ATTR_DB_SYSTEM),this._semconvStability&Tr.SemconvStability.STABLE&&o.push(ms.ATTR_DB_SYSTEM_NAME),o.forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,Dy.hrTimeToMilliseconds)((0,Dy.hrTimeDuration)(n,(0,Dy.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ht.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,Dy.hrTime)(),i=o[0],a=typeof i=="string",c=ht.isObjectWithTextString(i),d=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:c?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,f={[ch.ATTR_DB_SYSTEM]:ch.DB_SYSTEM_VALUE_POSTGRESQL,[ms.ATTR_DB_NAMESPACE]:this.database,[ms.ATTR_SERVER_PORT]:this.connectionParameters.port,[ms.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};d?.text&&(f[ms.ATTR_DB_OPERATION_NAME]=ht.parseNormalizedOperationName(d?.text));let m=()=>{e.recordOperationDuration(f,s)},_=e.getConfig(),g=ht.handleConfigQuery.call(this,e.tracer,_,e._semconvStability,d);if(_.addSqlCommenterCommentToQueries&&(a?o[0]=(0,CZ.addSqlCommenterComment)(g,i):c&&!("name"in i)&&(o[0]={...i,text:(0,CZ.addSqlCommenterComment)(g,i.text)})),o.length>0){let R=Ke.trace.getSpan(Ke.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ht.patchCallback(_,g,o[o.length-1],f,m),R&&(o[o.length-1]=Ke.context.bind(Ke.context.active(),o[o.length-1]));else if(typeof d?.callback=="function"){let b=ht.patchCallback(e.getConfig(),g,d.callback,f,m);R&&(b=Ke.context.bind(Ke.context.active(),b)),o[0].callback=b}}let{requestHook:T}=_;typeof T=="function"&&d&&(0,Tr.safeExecuteInTheMiddle)(()=>{let{database:R,host:b,port:I,user:v}=this.connectionParameters;T(g,{connection:{database:R,host:b,port:I,user:v},query:{text:d.text,values:d.values,name:d.name}})},R=>{R&&e._diag.error("Error running query hook",R)},!0);let A;try{A=n.apply(this,o)}catch(R){throw R instanceof Error&&g.recordException(ht.sanitizedErrorMessage(R)),g.setStatus({code:Ke.SpanStatusCode.ERROR,message:ht.getErrorMessage(R)}),g.end(),R}return A instanceof Promise?A.then(R=>new Promise(b=>{ht.handleExecutionResult(e.getConfig(),g,R),m(),g.end(),b(R)})).catch(R=>new Promise((b,I)=>{R instanceof Error&&g.recordException(ht.sanitizedErrorMessage(R)),g.setStatus({code:Ke.SpanStatusCode.ERROR,message:R.message}),m(),g.end(),I(R)})):A})}_setPoolConnectEventListeners(e){if(e[OZ.EVENT_LISTENERS_SET])return;let n=ht.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[OZ.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ht.shouldSkipInstrumentation(s))return n.call(this,o);if(e._setPoolConnectEventListeners(this),s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(xZ.SpanNames.POOL_CONNECT,{kind:Ke.SpanKind.CLIENT,attributes:ht.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(o){let c=Ke.trace.getSpan(Ke.context.active());o=ht.patchCallbackPGPool(i,o),c&&(o=Ke.context.bind(Ke.context.active(),o))}let a=Ke.context.with(Ke.trace.setSpan(Ke.context.active(),i),()=>n.call(this,o));return vZ(i,a)}}};Uy.PgInstrumentation=GM;function vZ(t,e){if(!(e instanceof Promise))return e;let n=e;return Ke.context.bind(Ke.context.active(),n.then(r=>(t.end(),r)).catch(r=>(r instanceof Error&&t.recordException(ht.sanitizedErrorMessage(r)),t.setStatus({code:Ke.SpanStatusCode.ERROR,message:ht.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var LZ=y(gd=>{"use strict";p();u();l();Object.defineProperty(gd,"__esModule",{value:!0});gd.AttributeNames=gd.PgInstrumentation=void 0;var GGe=MZ();Object.defineProperty(gd,"PgInstrumentation",{enumerable:!0,get:function(){return GGe.PgInstrumentation}});var BGe=DM();Object.defineProperty(gd,"AttributeNames",{enumerable:!0,get:function(){return BGe.AttributeNames}})});var wZ,DZ,UZ,$Ge,kZ,jZ=S(()=>{p();u();l();wZ=j(LZ(),1);je();DZ="Postgres",UZ=Z(DZ,()=>new wZ.PgInstrumentation({requireParentSpan:!0,requestHook(t){Ve(t,"auto.db.otel.postgres")}})),$Ge=(()=>({name:DZ,setupOnce(){UZ()}})),kZ=$Ge});var Ki,jy,GZ,FGe,ky,BM,BZ,$Z,$M,HGe,FZ,HZ=S(()=>{p();u();l();U();Ki=j(he(),1);Le();ne();je();Du();jy="PostgresJs",GZ=[">=3.0.0 <4"],FGe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,ky=Symbol("sentryPostgresConnectionContext"),BM=Symbol.for("sentry.instrumented.postgresjs"),BZ=Symbol.for("sentry.query.from.instrumented.sql"),$Z=Z(jy,t=>new $M({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),$M=class extends Ki.InstrumentationBase{constructor(e){super("sentry-postgres-js",Pe,e)}init(){let e=new Ki.InstrumentationNodeModuleDefinition("postgres",GZ,n=>{try{return this._patchPostgres(n)}catch(r){return It&&N.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new Ki.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,GZ,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let n=typeof e=="function",r=n?e:e.default;if(typeof r!="function")return It&&N.warn("postgres module does not export a function. Skipping instrumentation."),e;let o=this,s=function(...i){let a=Reflect.construct(r,i);return!a||typeof a!="function"?(It&&N.warn("postgres() did not return a valid instance"),a):o._instrumentSqlInstance(a)};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}return n?s:(p_(e,"default",s),e)}_wrapQueryMethod(e,n,r){let o=this;return function(...s){let i=Reflect.apply(e,n,s);return i&&typeof i=="object"&&"handle"in i&&o._wrapSingleQueryHandle(i,r),i}}_wrapCallbackMethod(e,n,r){let o=this;return function(...s){let i=r[ky];if(!(typeof s[s.length-1]=="function")){let m=Reflect.apply(e,n,s);return m&&typeof m.then=="function"?m.then(_=>o._instrumentSqlInstance(_,i)):m}let c=s.length===1?s[0]:s[1],d=function(m){let _=o._instrumentSqlInstance(m,i);return c(_)},f=s.length===1?[d]:[s[0],d];return Reflect.apply(e,n,f)}}_setConnectionAttributes(e,n){if(n&&(n.ATTR_DB_NAMESPACE&&e.setAttribute(Wf,n.ATTR_DB_NAMESPACE),n.ATTR_SERVER_ADDRESS&&e.setAttribute(Kf,n.ATTR_SERVER_ADDRESS),n.ATTR_SERVER_PORT!==void 0)){let r=parseInt(n.ATTR_SERVER_PORT,10);isNaN(r)||e.setAttribute(zf,r)}}_setOperationName(e,n,r){if(r){e.setAttribute(Ul,r);return}let o=n?.match(FGe);o?.[1]&&e.setAttribute(Ul,o[1].toUpperCase())}_attachConnectionContext(e,n){let r=e;if(!r.options||typeof r.options!="object")return;let o=r.options,s=o.host?.[0]||"localhost",i=o.port?.[0]||5432,a={ATTR_DB_NAMESPACE:typeof o.database=="string"&&o.database!==""?o.database:void 0,ATTR_SERVER_ADDRESS:s,ATTR_SERVER_PORT:String(i)};n[ky]=a}_instrumentSqlInstance(e,n){if(e[BM])return e;let r=this,o=new Proxy(e,{apply(s,i,a){let c=Reflect.apply(s,i,a);return c&&typeof c=="object"&&"handle"in c&&r._wrapSingleQueryHandle(c,o),c},get(s,i){let a=s[i];return typeof i!="string"||typeof a!="function"?a:i==="unsafe"||i==="file"?r._wrapQueryMethod(a,s,o):i==="begin"||i==="reserve"?r._wrapCallbackMethod(a,s,o):a}});return n?o[ky]=n:this._attachConnectionContext(e,o),e[BM]=!0,o[BM]=!0,o}_wrapSingleQueryHandle(e,n){if(e.handle?.__sentryWrapped)return;e[BZ]=!0;let r=e.handle,o=this,s=async function(...i){if(!o._shouldCreateSpans())return r.apply(this,i);let a=o._reconstructQuery(e.strings),c=o._sanitizeSqlQuery(a);return At({name:c||"postgresjs.query",op:"db"},d=>{Ve(d,"auto.db.postgresjs"),d.setAttributes({[_a]:"postgres",[mE]:c});let f=n?n[ky]:void 0;o._setConnectionAttributes(d,f);let m=o.getConfig(),{requestHook:_}=m;_&&(0,Ki.safeExecuteInTheMiddle)(()=>_(d,c,f),T=>{T&&(d.setAttribute("sentry.hook.error","requestHook failed"),It&&N.error(`Error in requestHook for ${jy} integration:`,T))},!0);let g=this;g.resolve=new Proxy(g.resolve,{apply:(T,A,R)=>{try{o._setOperationName(d,c,R?.[0]?.command),d.end()}catch(b){It&&N.error("Error ending span in resolve callback:",b)}return Reflect.apply(T,A,R)}}),g.reject=new Proxy(g.reject,{apply:(T,A,R)=>{try{d.setStatus({code:2,message:R?.[0]?.message||"unknown_error"}),d.setAttribute(_E,R?.[0]?.code||"unknown"),d.setAttribute(hE,R?.[0]?.name||"unknown"),o._setOperationName(d,c),d.end()}catch(b){It&&N.error("Error ending span in reject callback:",b)}return Reflect.apply(T,A,R)}});try{return r.apply(this,i)}catch(T){throw d.setStatus({code:2,message:T instanceof Error?T.message:"unknown_error"}),d.end(),T}})};s.__sentryWrapped=!0,e.handle=s}_shouldCreateSpans(){let e=this.getConfig();return de.getSpan(V.active())!==void 0||!e.requireParentSpan}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(e){let n=this,r=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...o){if(this[BZ])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let s=n._reconstructQuery(this.strings),i=n._sanitizeSqlQuery(s);return At({name:i||"postgresjs.query",op:"db"},a=>{Ve(a,"auto.db.postgresjs"),a.setAttributes({[_a]:"postgres",[mE]:i});let c=n.getConfig(),{requestHook:d}=c;d&&(0,Ki.safeExecuteInTheMiddle)(()=>d(a,i,void 0),_=>{_&&(a.setAttribute("sentry.hook.error","requestHook failed"),It&&N.error(`Error in requestHook for ${jy} integration:`,_))},!0);let f=this.resolve;this.resolve=new Proxy(f,{apply:(_,g,T)=>{try{n._setOperationName(a,i,T?.[0]?.command),a.end()}catch(A){It&&N.error("Error ending span in resolve callback:",A)}return Reflect.apply(_,g,T)}});let m=this.reject;this.reject=new Proxy(m,{apply:(_,g,T)=>{try{a.setStatus({code:2,message:T?.[0]?.message||"unknown_error"}),a.setAttribute(_E,T?.[0]?.code||"unknown"),a.setAttribute(hE,T?.[0]?.name||"unknown"),n._setOperationName(a,i),a.end()}catch(A){It&&N.error("Error ending span in reject callback:",A)}return Reflect.apply(_,g,T)}});try{return r.apply(this,o)}catch(_){throw a.setStatus({code:2,message:_ instanceof Error?_.message:"unknown_error"}),a.end(),_}})},e.Query.prototype.handle.__sentry_original__=r,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},HGe=(t=>({name:jy,setupOnce(){$Z(t)}})),FZ=HGe});var VZ=y(uh=>{"use strict";p();u();l();Object.defineProperty(uh,"__esModule",{value:!0});uh.SeverityNumber=void 0;var VGe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(VGe=uh.SeverityNumber||(uh.SeverityNumber={}))});var By=y(Ed=>{"use strict";p();u();l();Object.defineProperty(Ed,"__esModule",{value:!0});Ed.NOOP_LOGGER=Ed.NoopLogger=void 0;var Gy=class{emit(e){}};Ed.NoopLogger=Gy;Ed.NOOP_LOGGER=new Gy});var Fy=y(Td=>{"use strict";p();u();l();Object.defineProperty(Td,"__esModule",{value:!0});Td.NOOP_LOGGER_PROVIDER=Td.NoopLoggerProvider=void 0;var qGe=By(),$y=class{getLogger(e,n,r){return new qGe.NoopLogger}};Td.NoopLoggerProvider=$y;Td.NOOP_LOGGER_PROVIDER=new $y});var HM=y(Hy=>{"use strict";p();u();l();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.ProxyLogger=void 0;var YGe=By(),FM=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):YGe.NOOP_LOGGER}};Hy.ProxyLogger=FM});var qM=y(Vy=>{"use strict";p();u();l();Object.defineProperty(Vy,"__esModule",{value:!0});Vy.ProxyLoggerProvider=void 0;var WGe=Fy(),KGe=HM(),VM=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new KGe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:WGe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};Vy.ProxyLoggerProvider=VM});var qZ=y(qy=>{"use strict";p();u();l();Object.defineProperty(qy,"__esModule",{value:!0});qy._globalThis=void 0;qy._globalThis=typeof globalThis=="object"?globalThis:global});var YZ=y(Yy=>{"use strict";p();u();l();Object.defineProperty(Yy,"__esModule",{value:!0});Yy._globalThis=void 0;var zGe=qZ();Object.defineProperty(Yy,"_globalThis",{enumerable:!0,get:function(){return zGe._globalThis}})});var WZ=y(Wy=>{"use strict";p();u();l();Object.defineProperty(Wy,"__esModule",{value:!0});Wy._globalThis=void 0;var XGe=YZ();Object.defineProperty(Wy,"_globalThis",{enumerable:!0,get:function(){return XGe._globalThis}})});var KZ=y(Zs=>{"use strict";p();u();l();Object.defineProperty(Zs,"__esModule",{value:!0});Zs.API_BACKWARDS_COMPATIBILITY_VERSION=Zs.makeGetter=Zs._global=Zs.GLOBAL_LOGS_API_KEY=void 0;var QGe=WZ();Zs.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Zs._global=QGe._globalThis;function JGe(t,e,n){return r=>r===t?e:n}Zs.makeGetter=JGe;Zs.API_BACKWARDS_COMPATIBILITY_VERSION=1});var XZ=y(Ky=>{"use strict";p();u();l();Object.defineProperty(Ky,"__esModule",{value:!0});Ky.LogsAPI=void 0;var jo=KZ(),ZGe=Fy(),zZ=qM(),YM=class t{constructor(){this._proxyLoggerProvider=new zZ.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return jo._global[jo.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(jo._global[jo.GLOBAL_LOGS_API_KEY]=(0,jo.makeGetter)(jo.API_BACKWARDS_COMPATIBILITY_VERSION,e,ZGe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=jo._global[jo.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(jo._global,jo.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete jo._global[jo.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new zZ.ProxyLoggerProvider}};Ky.LogsAPI=YM});var WM=y(mn=>{"use strict";p();u();l();Object.defineProperty(mn,"__esModule",{value:!0});mn.logs=mn.ProxyLoggerProvider=mn.ProxyLogger=mn.NoopLoggerProvider=mn.NOOP_LOGGER_PROVIDER=mn.NoopLogger=mn.NOOP_LOGGER=mn.SeverityNumber=void 0;var eBe=VZ();Object.defineProperty(mn,"SeverityNumber",{enumerable:!0,get:function(){return eBe.SeverityNumber}});var QZ=By();Object.defineProperty(mn,"NOOP_LOGGER",{enumerable:!0,get:function(){return QZ.NOOP_LOGGER}});Object.defineProperty(mn,"NoopLogger",{enumerable:!0,get:function(){return QZ.NoopLogger}});var JZ=Fy();Object.defineProperty(mn,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return JZ.NOOP_LOGGER_PROVIDER}});Object.defineProperty(mn,"NoopLoggerProvider",{enumerable:!0,get:function(){return JZ.NoopLoggerProvider}});var tBe=HM();Object.defineProperty(mn,"ProxyLogger",{enumerable:!0,get:function(){return tBe.ProxyLogger}});var nBe=qM();Object.defineProperty(mn,"ProxyLoggerProvider",{enumerable:!0,get:function(){return nBe.ProxyLoggerProvider}});var rBe=XZ();mn.logs=rBe.LogsAPI.getInstance()});var ZZ=y(Sd=>{"use strict";p();u();l();Object.defineProperty(Sd,"__esModule",{value:!0});Sd.disableInstrumentations=Sd.enableInstrumentations=void 0;function oBe(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Sd.enableInstrumentations=oBe;function sBe(t){t.forEach(e=>e.disable())}Sd.disableInstrumentations=sBe});var n7=y(zy=>{"use strict";p();u();l();Object.defineProperty(zy,"__esModule",{value:!0});zy.registerInstrumentations=void 0;var e7=(U(),D(J)),iBe=WM(),t7=ZZ();function aBe(t){let e=t.tracerProvider||e7.trace.getTracerProvider(),n=t.meterProvider||e7.metrics.getMeterProvider(),r=t.loggerProvider||iBe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,t7.enableInstrumentations)(o,e,n,r),()=>{(0,t7.disableInstrumentations)(o)}}zy.registerInstrumentations=aBe});var p7=y(Xy=>{"use strict";p();u();l();Object.defineProperty(Xy,"__esModule",{value:!0});Xy.satisfies=void 0;var QM=(U(),D(J)),a7=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,cBe=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,uBe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function lBe(t,e,n){if(!pBe(t))return QM.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=_Be(t);if(!r)return!1;let o=[],s=c7(r,e,o,n);return s&&!n?.includePrerelease?fBe(r,o):s}Xy.satisfies=lBe;function pBe(t){return typeof t=="string"&&a7.test(t)}function c7(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(KM(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=UBe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!KM(t,s,n,r))return!1;return!0}return KM(t,e,n,r)}function KM(t,e,n,r){if(e=mBe(e,r),e.includes(" "))return c7(t,e,n,r);{let o=hBe(e);return n.push(o),dBe(t,o)}}function dBe(t,e){if(e.invalid)return!1;if(!e.version||XM(e.version))return!0;let n=o7(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=o7(r,o)}return uBe[e.op]?.includes(n)}function fBe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function mBe(t,e){return t=t.trim(),t=wBe(t,e),t=LBe(t),t=DBe(t,e),t=t.trim(),t}function Sr(t){return!t||t.toLowerCase()==="x"||t==="*"}function _Be(t){let e=t.match(a7);if(!e){QM.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function hBe(t){if(!t)return{};let e=t.match(cBe);if(!e)return QM.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function XM(t){return t==="*"||t==="x"||t==="X"}function r7(t){let e=parseInt(t,10);return isNaN(e)?t:e}function gBe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function EBe(t,e){if(XM(t)||XM(e))return 0;let[n,r]=gBe(r7(t),r7(e));return n>r?1:n<r?-1:0}function o7(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=EBe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var u7="[a-zA-Z0-9-]",l7="0|[1-9]\\d*",TBe=`\\d*[a-zA-Z-]${u7}*`,SBe="((?:<|>)?=?)",s7=`(?:${l7}|${TBe})`,ABe=`(?:-(${s7}(?:\\.${s7})*))`,i7=`${u7}+`,yBe=`(?:\\+(${i7}(?:\\.${i7})*))`,zM=`${l7}|x|X|\\*`,lh=`[v=\\s]*(${zM})(?:\\.(${zM})(?:\\.(${zM})(?:${ABe})?${yBe}?)?)?`,RBe=`^${SBe}\\s*${lh}$`,IBe=new RegExp(RBe),NBe=`^\\s*(${lh})\\s+-\\s+(${lh})\\s*$`,bBe=new RegExp(NBe),OBe="(?:~>?)",CBe=`^${OBe}${lh}$`,PBe=new RegExp(CBe),xBe="(?:\\^)",vBe=`^${xBe}${lh}$`,MBe=new RegExp(vBe);function LBe(t){let e=PBe;return t.replace(e,(n,r,o,s,i)=>{let a;return Sr(r)?a="":Sr(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:Sr(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function wBe(t,e){let n=MBe,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let d;return Sr(s)?d="":Sr(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Sr(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function DBe(t,e){let n=IBe;return t.replace(n,(r,o,s,i,a,c)=>{let d=Sr(s),f=d||Sr(i),m=f||Sr(a),_=m;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(f&&(i=0),a=0,o===">"?(o=">=",f?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",f?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):f?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function UBe(t,e){let n=bBe;return t.replace(n,(r,o,s,i,a,c,d,f,m,_,g,T)=>(Sr(s)?o="":Sr(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Sr(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Sr(m)?f="":Sr(_)?f=`<${+m+1}.0.0-0`:Sr(g)?f=`<${m}.${+_+1}.0-0`:T?f=`<=${m}.${_}.${g}-${T}`:e?.includePrerelease?f=`<${m}.${_}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}});var JM=y(Nn=>{"use strict";p();u();l();Object.defineProperty(Nn,"__esModule",{value:!0});Nn.massUnwrap=Nn.unwrap=Nn.massWrap=Nn.wrap=void 0;var Ar=console.error.bind(console);function ph(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var kBe=(t,e,n)=>{if(!t||!t[e]){Ar("no original function "+String(e)+" to wrap");return}if(!n){Ar("no wrapper function"),Ar(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Ar("original object and wrapper must be functions");return}let o=n(r,e);return ph(o,"__original",r),ph(o,"__unwrap",()=>{t[e]===o&&ph(t,e,r)}),ph(o,"__wrapped",!0),ph(t,e,o),o};Nn.wrap=kBe;var jBe=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Ar("must provide one or more modules to patch"),Ar(new Error().stack);return}if(!(e&&Array.isArray(e))){Ar("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Nn.wrap)(r,o,n)})})};Nn.massWrap=jBe;var GBe=(t,e)=>{if(!t||!t[e]){Ar("no function to unwrap."),Ar(new Error().stack);return}let n=t[e];if(!n.__unwrap)Ar("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Nn.unwrap=GBe;var BBe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Ar("must provide one or more modules to patch"),Ar(new Error().stack);return}if(!(e&&Array.isArray(e))){Ar("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Nn.unwrap)(n,r)})})};Nn.massUnwrap=BBe;function dh(t){t&&t.logger&&(typeof t.logger!="function"?Ar("new logger isn't a function, not replacing"):Ar=t.logger)}Nn.default=dh;dh.wrap=Nn.wrap;dh.massWrap=Nn.massWrap;dh.unwrap=Nn.unwrap;dh.massUnwrap=Nn.massUnwrap});var d7=y(Jy=>{"use strict";p();u();l();Object.defineProperty(Jy,"__esModule",{value:!0});Jy.InstrumentationAbstract=void 0;var ZM=(U(),D(J)),$Be=WM(),Qy=JM(),eL=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=ZM.diag.createComponentLogger({namespace:e}),this._tracer=ZM.trace.getTracer(e,n),this._meter=ZM.metrics.getMeter(e,n),this._logger=$Be.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=Qy.wrap;_unwrap=Qy.unwrap;_massWrap=Qy.massWrap;_massUnwrap=Qy.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};Jy.InstrumentationAbstract=eL});var f7=y(uc=>{"use strict";p();u();l();Object.defineProperty(uc,"__esModule",{value:!0});uc.ModuleNameTrie=uc.ModuleNameSeparator=void 0;uc.ModuleNameSeparator="/";var Zy=class{hooks=[];children=new Map},tL=class{_trie=new Zy;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(uc.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new Zy,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(uc.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};uc.ModuleNameTrie=tL});var _7=y(eR=>{"use strict";p();u();l();Object.defineProperty(eR,"__esModule",{value:!0});eR.RequireInTheMiddleSingleton=void 0;var FBe=om(),m7=require("path"),nL=f7(),HBe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),rL=class t{_moduleNameTrie=new nL.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new FBe.Hook(null,{internals:!0},(e,n,r)=>{let o=VBe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return HBe?new t:this._instance=this._instance??new t}};eR.RequireInTheMiddleSingleton=rL;function VBe(t){return m7.sep!==nL.ModuleNameSeparator?t.split(m7.sep).join(nL.ModuleNameSeparator):t}});var A7=y(Fu=>{p();u();l();var h7=[],oL=new WeakMap,g7=new WeakMap,E7=new Map,T7=[],qBe={set(t,e,n){let r=oL.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=g7.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=oL.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function YBe(t,e,n,r,o){E7.set(t,o),oL.set(e,n),g7.set(e,r);let s=new Proxy(e,qBe);h7.forEach(i=>i(t,s,o)),T7.push([t,s,o])}var S7=!1;function WBe(){return S7}function KBe(t){S7=t}Fu.register=YBe;Fu.importHooks=h7;Fu.specifiers=E7;Fu.toHook=T7;Fu.getExperimentalPatchInternals=WBe;Fu.setExperimentalPatchInternals=KBe});var O7=y((KGt,Ad)=>{p();u();l();var y7=require("path"),zBe=ZE(),{fileURLToPath:R7}=require("url"),{MessageChannel:XBe}=require("worker_threads"),{importHooks:sL,specifiers:QBe,toHook:JBe,getExperimentalPatchInternals:ZBe}=A7();function N7(t){sL.push(t),JBe.forEach(([e,n,r])=>t(e,n,r))}function b7(t){let e=sL.indexOf(t);e>-1&&sL.splice(e,1)}function I7(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var iL;function e$e(){let{port1:t,port2:e}=new XBe,n=0,r;iL=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(d=>{r=d}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function fh(t,e,n){if(!(this instanceof fh))return new fh(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;iL&&Array.isArray(t)&&iL(t),this._iitmHook=(o,s,i)=>{let a=o,c=o.startsWith("node:"),d;if(c)o=o.replace(/^node:/,"");else{if(o.startsWith("file://")){let m=Error.stackTraceLimit;Error.stackTraceLimit=0;try{o=R7(o)}catch{}Error.stackTraceLimit=m}let f=zBe(o);f&&(o=f.name,d=f.basedir)}if(t)for(let f of t){let m=f===o,_=f===i;if(m||_){if(d){if(r)o=o+y7.sep+y7.relative(d,R7(a));else if(!ZBe()&&!_&&!d.endsWith(QBe.get(a)))continue}I7(n,s,o,d)}}else I7(n,s,o,d)},N7(this._iitmHook)}fh.prototype.unhook=function(){b7(this._iitmHook)};Ad.exports=fh;Ad.exports.Hook=fh;Ad.exports.addHook=N7;Ad.exports.removeHook=b7;Ad.exports.createAddHookMessageChannel=e$e});var aL=y(lc=>{"use strict";p();u();l();Object.defineProperty(lc,"__esModule",{value:!0});lc.isWrapped=lc.safeExecuteInTheMiddleAsync=lc.safeExecuteInTheMiddle=void 0;function t$e(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}lc.safeExecuteInTheMiddle=t$e;async function n$e(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}lc.safeExecuteInTheMiddleAsync=n$e;function r$e(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}lc.isWrapped=r$e});var x7=y(tR=>{"use strict";p();u();l();Object.defineProperty(tR,"__esModule",{value:!0});tR.InstrumentationBase=void 0;var mh=require("path"),C7=require("util"),o$e=p7(),cL=JM(),s$e=d7(),i$e=_7(),a$e=O7(),_h=(U(),D(J)),c$e=om(),u$e=require("fs"),l$e=aL(),uL=class extends s$e.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=i$e.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,l$e.isWrapped)(e[n])&&this._unwrap(e,n),C7.types.isProxy(e)){let o=(0,cL.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,cL.wrap)(e,n,r)};_unwrap=(e,n)=>C7.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,cL.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{_h.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){_h.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{_h.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){_h.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=require.resolve(n);require.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,u$e.readFileSync)(mh.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{_h.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return P7(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=mh.normalize(r);return i.filter(d=>d.name===a).filter(d=>P7(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&mh.isAbsolute(a)){let d=mh.parse(a);a=d.name,c=d.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=mh.isAbsolute(e.name)?new c$e.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new a$e.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};tR.InstrumentationBase=uL;function P7(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,o$e.satisfies)(e,r,{includePrerelease:n}))}});var v7=y(nR=>{"use strict";p();u();l();Object.defineProperty(nR,"__esModule",{value:!0});nR.normalize=void 0;var p$e=require("path");Object.defineProperty(nR,"normalize",{enumerable:!0,get:function(){return p$e.normalize}})});var M7=y(yd=>{"use strict";p();u();l();Object.defineProperty(yd,"__esModule",{value:!0});yd.normalize=yd.InstrumentationBase=void 0;var d$e=x7();Object.defineProperty(yd,"InstrumentationBase",{enumerable:!0,get:function(){return d$e.InstrumentationBase}});var f$e=v7();Object.defineProperty(yd,"normalize",{enumerable:!0,get:function(){return f$e.normalize}})});var lL=y(Rd=>{"use strict";p();u();l();Object.defineProperty(Rd,"__esModule",{value:!0});Rd.normalize=Rd.InstrumentationBase=void 0;var L7=M7();Object.defineProperty(Rd,"InstrumentationBase",{enumerable:!0,get:function(){return L7.InstrumentationBase}});Object.defineProperty(Rd,"normalize",{enumerable:!0,get:function(){return L7.normalize}})});var w7=y(rR=>{"use strict";p();u();l();Object.defineProperty(rR,"__esModule",{value:!0});rR.InstrumentationNodeModuleDefinition=void 0;var pL=class{name;supportedVersions;patch;unpatch;files;constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};rR.InstrumentationNodeModuleDefinition=pL});var D7=y(oR=>{"use strict";p();u();l();Object.defineProperty(oR,"__esModule",{value:!0});oR.InstrumentationNodeModuleFile=void 0;var m$e=lL(),dL=class{supportedVersions;patch;unpatch;name;constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,m$e.normalize)(e)}};oR.InstrumentationNodeModuleFile=dL});var U7=y(Hu=>{"use strict";p();u();l();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.semconvStabilityFromStr=Hu.SemconvStability=void 0;var sR;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(sR=Hu.SemconvStability||(Hu.SemconvStability={}));function _$e(t,e){let n=sR.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=sR.DUPLICATE;break}else o.toLowerCase()===t&&(n=sR.STABLE);return n}Hu.semconvStabilityFromStr=_$e});var j7=y(Kt=>{"use strict";p();u();l();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.semconvStabilityFromStr=Kt.SemconvStability=Kt.safeExecuteInTheMiddleAsync=Kt.safeExecuteInTheMiddle=Kt.isWrapped=Kt.InstrumentationNodeModuleFile=Kt.InstrumentationNodeModuleDefinition=Kt.InstrumentationBase=Kt.registerInstrumentations=void 0;var h$e=n7();Object.defineProperty(Kt,"registerInstrumentations",{enumerable:!0,get:function(){return h$e.registerInstrumentations}});var g$e=lL();Object.defineProperty(Kt,"InstrumentationBase",{enumerable:!0,get:function(){return g$e.InstrumentationBase}});var E$e=w7();Object.defineProperty(Kt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return E$e.InstrumentationNodeModuleDefinition}});var T$e=D7();Object.defineProperty(Kt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return T$e.InstrumentationNodeModuleFile}});var fL=aL();Object.defineProperty(Kt,"isWrapped",{enumerable:!0,get:function(){return fL.isWrapped}});Object.defineProperty(Kt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return fL.safeExecuteInTheMiddle}});Object.defineProperty(Kt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return fL.safeExecuteInTheMiddleAsync}});var k7=U7();Object.defineProperty(Kt,"SemconvStability",{enumerable:!0,get:function(){return k7.SemconvStability}});Object.defineProperty(Kt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return k7.semconvStabilityFromStr}})});function y$e(){let t=Id[_L];return t?.helper?t.helper:Id[mL]?.helper}function R$e(t){let e={helper:t};Id[_L]=e,Id[mL]=e}function I$e(){delete Id[_L],delete Id[mL]}function O$e(t){switch(t){case"client":return Ze.CLIENT;case"internal":default:return Ze.INTERNAL}}function $7(t,e,n,r,o){if(F7(e.name,o))return;let s={attributes:e.attributes,kind:O$e(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(c=>{let d=r.get(c);return d?{context:{spanId:d,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===e.id);for(let c of a)$7(t,c,n,r,o);i.end(e.endTime)})}function G7(t,e){return P$e(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function P$e(t){return t!=null&&typeof t.then=="function"}function F7(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var iR,S$e,A$e,mL,_L,Id,N$e,b$e,C$e,H7,B7,x$e,v$e,V7,q7=S(()=>{p();u();l();U();iR=j(j7(),1);U();S$e={name:"@prisma/instrumentation-contract",version:"7.2.0",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}},A$e=S$e.version.split(".")[0],mL="PRISMA_INSTRUMENTATION",_L=`V${A$e}_PRISMA_INSTRUMENTATION`,Id=globalThis;N$e=process.env.PRISMA_SHOW_ALL_TRACES==="true",b$e="00-10-10-00";C$e=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:t,ignoreSpanTypes:e}){this.tracerProvider=t,this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(t){let e=de.getSpanContext(t??V.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:b$e}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)$7(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return V.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!N$e)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(F7(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return G7(s,e(s,r))}return n.startActiveSpan(o,t,s=>G7(s,e(s,r)))}};H7={name:"@prisma/instrumentation",version:"7.2.0",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@opentelemetry/api":"1.9.0","@prisma/instrumentation-contract":"workspace:*","@types/node":"~20.19.24",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.207.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},sideEffects:!1},B7=H7.version,x$e=H7.name,v$e="@prisma/client",V7=class extends iR.InstrumentationBase{tracerProvider;constructor(t={}){super(x$e,B7,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new iR.InstrumentationNodeModuleDefinition(v$e,[B7])]}enable(){let t=this._config;R$e(new C$e({tracerProvider:this.tracerProvider??de.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]}))}disable(){I$e()}isEnabled(){return y$e()!==void 0}}});function M$e(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function W7(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}function L$e(t){switch(t){case"client":return Ze.CLIENT;case"internal":default:return Ze.INTERNAL}}var Y7,hL,w$e,K7,z7=S(()=>{p();u();l();U();q7();ne();je();Y7="Prisma";hL=class extends V7{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=W7();M$e(e)&&(e.createEngineSpan=n=>{let r=de.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){wt(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(s=>{let i=L$e(s.kind),a=s.parent_span_id,c=s.span_id,d=s.trace_id,f=s.links?.map(_=>({context:{traceId:_.trace_id,spanId:_.span_id,traceFlags:rr.SAMPLED}})),m=de.setSpanContext(V.active(),{traceId:d,spanId:a,traceFlags:rr.SAMPLED});V.with(m,()=>{let _={generateTraceId:()=>d,generateSpanId:()=>c};r._idGenerator=_,r.startSpan(s.name,{kind:i,links:f,startTime:s.start_time,attributes:s.attributes}).end(s.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};w$e=Z(Y7,t=>new hL(t)),K7=t=>({name:Y7,setupOnce(){w$e(t)},setup(e){W7()&&e.on("spanStart",n=>{let r=ae(n);r.description?.startsWith("prisma:")&&n.setAttribute(fe,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}})});var X7=y(Nd=>{"use strict";p();u();l();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.PACKAGE_NAME=Nd.PACKAGE_VERSION=void 0;Nd.PACKAGE_VERSION="0.57.0";Nd.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var gL=y(ei=>{"use strict";p();u();l();Object.defineProperty(ei,"__esModule",{value:!0});ei.HapiLifecycleMethodNames=ei.HapiLayerType=ei.handlerPatched=ei.HapiComponentName=void 0;ei.HapiComponentName="@hapi/hapi";ei.handlerPatched=Symbol("hapi-handler-patched");ei.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};ei.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var Q7=y(aR=>{"use strict";p();u();l();Object.defineProperty(aR,"__esModule",{value:!0});aR.ATTR_HTTP_METHOD=void 0;aR.ATTR_HTTP_METHOD="http.method"});var EL=y(hh=>{"use strict";p();u();l();Object.defineProperty(hh,"__esModule",{value:!0});hh.AttributeNames=void 0;var D$e;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(D$e=hh.AttributeNames||(hh.AttributeNames={}))});var eee=y(zt=>{"use strict";p();u();l();Object.defineProperty(zt,"__esModule",{value:!0});zt.getPluginFromInput=zt.getExtMetadata=zt.getRouteMetadata=zt.isPatchableExtMethod=zt.isDirectExtInput=zt.isLifecycleExtEventObj=zt.isLifecycleExtType=zt.getPluginName=void 0;var J7=(Le(),D(Xe)),U$e=Q7(),gh=gL(),pc=EL(),Z7=he();function k$e(t){return t.name?t.name:t.pkg.name}zt.getPluginName=k$e;var j$e=t=>typeof t=="string"&&gh.HapiLifecycleMethodNames.has(t);zt.isLifecycleExtType=j$e;var G$e=t=>{let e=t?.type;return e!==void 0&&(0,zt.isLifecycleExtType)(e)};zt.isLifecycleExtEventObj=G$e;var B$e=t=>Array.isArray(t)&&t.length<=3&&(0,zt.isLifecycleExtType)(t[0])&&typeof t[1]=="function";zt.isDirectExtInput=B$e;var $$e=t=>!Array.isArray(t);zt.isPatchableExtMethod=$$e;var F$e=(t,e,n)=>{let r={[J7.ATTR_HTTP_ROUTE]:t.path};e&Z7.SemconvStability.OLD&&(r[U$e.ATTR_HTTP_METHOD]=t.method),e&Z7.SemconvStability.STABLE&&(r[J7.ATTR_HTTP_REQUEST_METHOD]=t.method);let o;return n?(r[pc.AttributeNames.HAPI_TYPE]=gh.HapiLayerType.PLUGIN,r[pc.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${t.path}`):(r[pc.AttributeNames.HAPI_TYPE]=gh.HapiLayerType.ROUTER,o=`route - ${t.path}`),{attributes:r,name:o}};zt.getRouteMetadata=F$e;var H$e=(t,e)=>e?{attributes:{[pc.AttributeNames.EXT_TYPE]:t,[pc.AttributeNames.HAPI_TYPE]:gh.HapiLayerType.EXT,[pc.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ext - ${t}`}:{attributes:{[pc.AttributeNames.EXT_TYPE]:t,[pc.AttributeNames.HAPI_TYPE]:gh.HapiLayerType.EXT},name:`ext - ${t}`};zt.getExtMetadata=H$e;var V$e=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;zt.getPluginFromInput=V$e});var ree=y(cR=>{"use strict";p();u();l();Object.defineProperty(cR,"__esModule",{value:!0});cR.HapiInstrumentation=void 0;var so=(U(),D(J)),tee=Be(),Eh=he(),nee=X7(),Th=gL(),zi=eee(),TL=class extends Eh.InstrumentationBase{_semconvStability;constructor(e={}){super(nee.PACKAGE_NAME,nee.PACKAGE_VERSION,e),this._semconvStability=(0,Eh.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Eh.InstrumentationNodeModuleDefinition(Th.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Eh.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,Eh.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,zi.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,zi.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let c=i[a];if((0,zi.isLifecycleExtType)(c.type)){let d=c,f=r._wrapExtMethods(d.method,c.type,n);d.method=f,i[a]=d}}return e.apply(this,s)}else if((0,zi.isDirectExtInput)(s)){let i=s,a=i[1],c=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],c,i[2]])}else if((0,zi.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,zi.getPluginName)(e),o=e.register,s=this,i=function(a,c){return s._wrap(a,"route",d=>n._getServerRoutePatch.bind(n)(d,r)),s._wrap(a,"ext",d=>n._getServerExtPatch.bind(n)(d,r)),o.call(this,a,c)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,zi.isPatchableExtMethod)(e))return e[Th.handlerPatched]===!0?e:(e[Th.handlerPatched]=!0,async function(...i){if(so.trace.getSpan(so.context.active())===void 0)return await e.apply(this,i);let a=(0,zi.getExtMetadata)(n,r),c=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await so.context.with(so.trace.setSpan(so.context.active(),c),e,void 0,...i)}catch(d){throw c.recordException(d),c.setStatus({code:so.SpanStatusCode.ERROR,message:d.message}),d}finally{c.end()}});return e}_wrapRouteHandler(e,n){let r=this;if(e[Th.handlerPatched]===!0)return e;e[Th.handlerPatched]=!0;let o=s=>async function(...i){if(so.trace.getSpan(so.context.active())===void 0)return await s.call(this,...i);let a=(0,tee.getRPCMetadata)(so.context.active());a?.type===tee.RPCType.HTTP&&(a.route=e.path);let c=(0,zi.getRouteMetadata)(e,r._semconvStability,n),d=r.tracer.startSpan(c.name,{attributes:c.attributes});try{return await so.context.with(so.trace.setSpan(so.context.active(),d),()=>s.call(this,...i))}catch(f){throw d.recordException(f),d.setStatus({code:so.SpanStatusCode.ERROR,message:f.message}),f}finally{d.end()}};if(typeof e.handler=="function")e.handler=o(e.handler);else if(typeof e.options=="function"){let s=e.options;e.options=function(i){let a=s(i);return typeof a.handler=="function"&&(a.handler=o(a.handler)),a}}else typeof e.options?.handler=="function"&&(e.options.handler=o(e.options.handler));return e}};cR.HapiInstrumentation=TL});var oee=y(bd=>{"use strict";p();u();l();Object.defineProperty(bd,"__esModule",{value:!0});bd.AttributeNames=bd.HapiInstrumentation=void 0;var q$e=ree();Object.defineProperty(bd,"HapiInstrumentation",{enumerable:!0,get:function(){return q$e.HapiInstrumentation}});var Y$e=EL();Object.defineProperty(bd,"AttributeNames",{enumerable:!0,get:function(){return Y$e.AttributeNames}})});var see,iee,aee,W$e,cee,uee=S(()=>{p();u();l();see=j(oee(),1);je();iee="Hapi",aee=Z(iee,()=>new see.HapiInstrumentation),W$e=(()=>({name:iee,setupOnce(){aee()}})),cee=W$e});var dc,Sh,SL=S(()=>{p();u();l();dc={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Sh={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var lR,K$e,z$e,uR,lee=S(()=>{p();u();l();U();lR=j(he(),1);ne();SL();K$e="@sentry/instrumentation-hono",z$e="0.0.1",uR=class extends lR.InstrumentationBase{constructor(e={}){super(K$e,z$e,e)}init(){return[new lR.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],e=>this._patch(e))]}_patch(e){let n=this;class r extends e.Hono{constructor(...s){super(...s),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{e.Hono=r}catch{return{...e,Hono:r}}return e}_patchHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_patchOnHandler(){let e=this;return function(n){return function(...o){let s=o.slice(2);return n.apply(this,[...o.slice(0,2),...s.map(i=>e._wrapHandler(i))])}}}_patchMiddlewareHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_wrapHandler(e){let n=this;return function(r,o){if(!n.isEnabled())return e.apply(this,[r,o]);let s=r.req.path,i=n.tracer.startSpan(s);return V.with(de.setSpan(V.active(),i),()=>n._safeExecute(()=>{let a=e.apply(this,[r,o]);if(ur(a))return a.then(c=>{let d=n._determineHandlerType(c);return i.setAttributes({[dc.HONO_TYPE]:d,[dc.HONO_NAME]:d===Sh.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),c});{let c=n._determineHandlerType(a);return i.setAttributes({[dc.HONO_TYPE]:c,[dc.HONO_NAME]:c===Sh.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),a}},()=>i.end(),a=>{n._handleError(i,a),i.end()}))}}_safeExecute(e,n,r){try{let o=e();return ur(o)?o.then(()=>n(),s=>r(s)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(e){return e===void 0?Sh.MIDDLEWARE:Sh.REQUEST_HANDLER}_handleError(e,n){n instanceof Error&&(e.setStatus({code:it.ERROR,message:n.message}),e.recordException(n))}}});function X$e(t){let e=ae(t).data,n=e[dc.HONO_TYPE];if(e[ge]||!n)return;t.setAttributes({[fe]:"auto.http.otel.hono",[ge]:`${n}.hono`});let r=e[dc.HONO_NAME];if(typeof r=="string"&&t.updateName(r),Te()===Ro()){It&&N.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=e[br],s=e[Ai];typeof o=="string"&&typeof s=="string"&&Te().setTransactionName(`${s} ${o}`)}var pee,dee,Q$e,fee,mee=S(()=>{p();u();l();Le();ne();je();Du();SL();lee();pee="Hono";dee=Z(pee,()=>new uR({responseHook:t=>{X$e(t)}})),Q$e=(()=>({name:pee,setupOnce(){dee()}})),fee=Q$e});var pR=y(Ah=>{"use strict";p();u();l();Object.defineProperty(Ah,"__esModule",{value:!0});Ah.KoaLayerType=void 0;var J$e;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(J$e=Ah.KoaLayerType||(Ah.KoaLayerType={}))});var _ee=y(Od=>{"use strict";p();u();l();Object.defineProperty(Od,"__esModule",{value:!0});Od.PACKAGE_NAME=Od.PACKAGE_VERSION=void 0;Od.PACKAGE_VERSION="0.59.0";Od.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var AL=y(yh=>{"use strict";p();u();l();Object.defineProperty(yh,"__esModule",{value:!0});yh.AttributeNames=void 0;var Z$e;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(Z$e=yh.AttributeNames||(yh.AttributeNames={}))});var gee=y(Cd=>{"use strict";p();u();l();Object.defineProperty(Cd,"__esModule",{value:!0});Cd.isLayerIgnored=Cd.getMiddlewareMetadata=void 0;var hee=pR(),dR=AL(),eFe=(Le(),D(Xe)),tFe=(t,e,n,r)=>n?{attributes:{[dR.AttributeNames.KOA_NAME]:r?.toString(),[dR.AttributeNames.KOA_TYPE]:hee.KoaLayerType.ROUTER,[eFe.ATTR_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[dR.AttributeNames.KOA_NAME]:e.name??"middleware",[dR.AttributeNames.KOA_TYPE]:hee.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`};Cd.getMiddlewareMetadata=tFe;var nFe=(t,e)=>!!(Array.isArray(e?.ignoreLayersType)&&e?.ignoreLayersType?.includes(t));Cd.isLayerIgnored=nFe});var Eee=y(fR=>{"use strict";p();u();l();Object.defineProperty(fR,"__esModule",{value:!0});fR.kLayerPatched=void 0;fR.kLayerPatched=Symbol("koa-layer-patched")});var Iee=y(mR=>{"use strict";p();u();l();Object.defineProperty(mR,"__esModule",{value:!0});mR.KoaInstrumentation=void 0;var ti=(U(),D(J)),Rh=he(),Tee=pR(),See=_ee(),Aee=gee(),yee=Be(),Ree=Eee(),yL=class extends Rh.InstrumentationBase{constructor(e={}){super(See.PACKAGE_NAME,See.PACKAGE_VERSION,e)}init(){return new Rh.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Rh.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Rh.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){ti.diag.debug("Patching @koa/router dispatch");let r=e.router?.stack??[];for(let o of r){let s=o.path,i=o.stack;for(let a=0;a<i.length;a++){let c=i[a];i[a]=this._patchLayer(c,!0,s)}}return e}_patchLayer(e,n,r){let o=n?Tee.KoaLayerType.ROUTER:Tee.KoaLayerType.MIDDLEWARE;return e[Ree.kLayerPatched]===!0||(0,Aee.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(ti.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[Ree.kLayerPatched]=!0,ti.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(ti.trace.getSpan(ti.context.active())===void 0)return e(s,i);let c=(0,Aee.getMiddlewareMetadata)(s,e,n,r),d=this.tracer.startSpan(c.name,{attributes:c.attributes}),f=(0,yee.getRPCMetadata)(ti.context.active());f?.type===yee.RPCType.HTTP&&s._matchedRoute&&(f.route=s._matchedRoute.toString());let{requestHook:m}=this.getConfig();m&&(0,Rh.safeExecuteInTheMiddle)(()=>m(d,{context:s,middlewareLayer:e,layerType:o}),g=>{g&&ti.diag.error("koa instrumentation: request hook failed",g)},!0);let _=ti.trace.setSpan(ti.context.active(),d);return ti.context.with(_,async()=>{try{return await e(s,i)}catch(g){throw d.recordException(g),g}finally{d.end()}})})}};mR.KoaInstrumentation=yL});var Nee=y(fc=>{"use strict";p();u();l();Object.defineProperty(fc,"__esModule",{value:!0});fc.KoaLayerType=fc.AttributeNames=fc.KoaInstrumentation=void 0;var rFe=Iee();Object.defineProperty(fc,"KoaInstrumentation",{enumerable:!0,get:function(){return rFe.KoaInstrumentation}});var oFe=AL();Object.defineProperty(fc,"AttributeNames",{enumerable:!0,get:function(){return oFe.AttributeNames}});var sFe=pR();Object.defineProperty(fc,"KoaLayerType",{enumerable:!0,get:function(){return sFe.KoaLayerType}})});var bee,Oee,Cee,iFe,Pee,xee=S(()=>{p();u();l();bee=j(Nee(),1);Le();ne();je();Du();Oee="Koa",Cee=Z(Oee,bee.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){Ve(e,"auto.http.otel.koa");let r=ae(e).data,o=r["koa.type"];o&&e.setAttribute(ge,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),Te()===Ro()){It&&N.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[br],a=n.context?.request?.method?.toUpperCase()||"GET";i&&Te().setTransactionName(`${a} ${i}`)}})),iFe=((t={})=>({name:Oee,setupOnce(){Cee(t)}})),Pee=iFe});var RL=y(_s=>{"use strict";p();u();l();Object.defineProperty(_s,"__esModule",{value:!0});_s.ConnectNames=_s.ConnectTypes=_s.AttributeNames=void 0;var aFe;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(aFe=_s.AttributeNames||(_s.AttributeNames={}));var cFe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(cFe=_s.ConnectTypes||(_s.ConnectTypes={}));var uFe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(uFe=_s.ConnectNames||(_s.ConnectNames={}))});var vee=y(Pd=>{"use strict";p();u();l();Object.defineProperty(Pd,"__esModule",{value:!0});Pd.PACKAGE_NAME=Pd.PACKAGE_VERSION=void 0;Pd.PACKAGE_VERSION="0.54.0";Pd.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var Mee=y(_R=>{"use strict";p();u();l();Object.defineProperty(_R,"__esModule",{value:!0});_R._LAYERS_STORE_PROPERTY=void 0;_R._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var Lee=y(_c=>{"use strict";p();u();l();Object.defineProperty(_c,"__esModule",{value:!0});_c.generateRoute=_c.replaceCurrentStackRoute=_c.addNewStackLayer=void 0;var lFe=(U(),D(J)),mc=Mee(),pFe=t=>{Array.isArray(t[mc._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,mc._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[mc._LAYERS_STORE_PROPERTY].push("/");let e=t[mc._LAYERS_STORE_PROPERTY].length;return()=>{e===t[mc._LAYERS_STORE_PROPERTY].length?t[mc._LAYERS_STORE_PROPERTY].pop():lFe.diag.warn("Connect: Trying to pop the stack multiple time")}};_c.addNewStackLayer=pFe;var dFe=(t,e)=>{e&&t[mc._LAYERS_STORE_PROPERTY].splice(-1,1,e)};_c.replaceCurrentStackRoute=dFe;var fFe=t=>t[mc._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);_c.generateRoute=fFe});var Uee=y(hc=>{"use strict";p();u();l();Object.defineProperty(hc,"__esModule",{value:!0});hc.ConnectInstrumentation=hc.ANONYMOUS_NAME=void 0;var mFe=(U(),D(J)),wee=Be(),xd=RL(),Dee=vee(),hR=he(),_Fe=(Le(),D(Xe)),IL=Lee();hc.ANONYMOUS_NAME="anonymous";var NL=class extends hR.InstrumentationBase{constructor(e={}){super(Dee.PACKAGE_NAME,Dee.PACKAGE_VERSION,e)}init(){return[new hR.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,hR.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,hR.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=xd.ConnectTypes.REQUEST_HANDLER,s=xd.ConnectNames.REQUEST_HANDLER,o=e):(r=xd.ConnectTypes.MIDDLEWARE,s=xd.ConnectNames.MIDDLEWARE,o=n.name||hc.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[_Fe.ATTR_HTTP_ROUTE]:e.length>0?e:"/",[xd.AttributeNames.CONNECT_TYPE]:r,[xd.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,c]=o?[1,2,3]:[0,1,2],d=arguments[i],f=arguments[a],m=arguments[c];(0,IL.replaceCurrentStackRoute)(d,e);let _=(0,wee.getRPCMetadata)(mFe.context.active());e&&_?.type===wee.RPCType.HTTP&&(_.route=(0,IL.generateRoute)(d));let g="";e?g=`request handler - ${e}`:g=`middleware - ${n.name||hc.ANONYMOUS_NAME}`;let T=r._startSpan(e,n);r._diag.debug("start span",g);let A=!1;function R(){A?r._diag.debug(`span ${T.name} - already finished`):(A=!0,r._diag.debug(`finishing span ${T.name}`),T.end()),f.removeListener("close",R)}return f.addListener("close",R),arguments[c]=r._patchNext(m,R),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,IL.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};hc.ConnectInstrumentation=NL});var jee=y(Go=>{"use strict";p();u();l();Object.defineProperty(Go,"__esModule",{value:!0});Go.ConnectTypes=Go.ConnectNames=Go.AttributeNames=Go.ANONYMOUS_NAME=Go.ConnectInstrumentation=void 0;var kee=Uee();Object.defineProperty(Go,"ConnectInstrumentation",{enumerable:!0,get:function(){return kee.ConnectInstrumentation}});Object.defineProperty(Go,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return kee.ANONYMOUS_NAME}});var bL=RL();Object.defineProperty(Go,"AttributeNames",{enumerable:!0,get:function(){return bL.AttributeNames}});Object.defineProperty(Go,"ConnectNames",{enumerable:!0,get:function(){return bL.ConnectNames}});Object.defineProperty(Go,"ConnectTypes",{enumerable:!0,get:function(){return bL.ConnectTypes}})});var Gee,Bee,$ee,hFe,Fee,Hee=S(()=>{p();u();l();Gee=j(jee(),1);je();Bee="Connect",$ee=Z(Bee,()=>new Gee.ConnectInstrumentation),hFe=(()=>({name:Bee,setupOnce(){$ee()}})),Fee=hFe});var Vee=y(_n=>{"use strict";p();u();l();Object.defineProperty(_n,"__esModule",{value:!0});_n.DB_SYSTEM_VALUE_MSSQL=_n.ATTR_NET_PEER_PORT=_n.ATTR_NET_PEER_NAME=_n.ATTR_DB_USER=_n.ATTR_DB_SYSTEM=_n.ATTR_DB_STATEMENT=_n.ATTR_DB_SQL_TABLE=_n.ATTR_DB_NAME=void 0;_n.ATTR_DB_NAME="db.name";_n.ATTR_DB_SQL_TABLE="db.sql.table";_n.ATTR_DB_STATEMENT="db.statement";_n.ATTR_DB_SYSTEM="db.system";_n.ATTR_DB_USER="db.user";_n.ATTR_NET_PEER_NAME="net.peer.name";_n.ATTR_NET_PEER_PORT="net.peer.port";_n.DB_SYSTEM_VALUE_MSSQL="mssql"});var qee=y(vd=>{"use strict";p();u();l();Object.defineProperty(vd,"__esModule",{value:!0});vd.once=vd.getSpanName=void 0;function gFe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}vd.getSpanName=gFe;var EFe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};vd.once=EFe});var Yee=y(Md=>{"use strict";p();u();l();Object.defineProperty(Md,"__esModule",{value:!0});Md.PACKAGE_NAME=Md.PACKAGE_VERSION=void 0;Md.PACKAGE_VERSION="0.30.0";Md.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var Qee=y(Ec=>{"use strict";p();u();l();Object.defineProperty(Ec,"__esModule",{value:!0});Ec.TediousInstrumentation=Ec.INJECTED_CTX=void 0;var Ld=(U(),D(J)),TFe=require("events"),ni=he(),Vu=(Le(),D(Xe)),gc=Vee(),Wee=qee(),Kee=Yee(),Xee=Symbol("opentelemetry.instrumentation-tedious.current-database");Ec.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var zee=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function gR(t){Object.defineProperty(this,Xee,{value:t,writable:!0})}var OL=class t extends ni.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(e={}){super(Kee.PACKAGE_NAME,Kee.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ni.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ni.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new ni.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of zee)(0,ni.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,e));return(0,ni.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of zee)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){return gR.call(this,this.config?.options?.database),this.removeListener("databaseChange",gR),this.on("databaseChange",gR),this.once("end",()=>{this.removeListener("databaseChange",gR)}),e.apply(this,arguments)}}_buildTraceparent(e){let n=e.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Ld.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,n,r){return new Promise(o=>{try{let s="set context_info @opentelemetry_traceparent",i=new n.Request(s,c=>{o()});Object.defineProperty(i,Ec.INJECTED_CTX,{value:!0});let a=Buffer.from(r,"utf8");i.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),e.execSql(i)}catch{o()}})}_shouldInjectFor(e){return e==="execSql"||e==="execSqlBatch"||e==="callProcedure"||e==="execute"}_patchQuery(e,n){return r=>{let o=this;function s(i){if(i?.[Ec.INJECTED_CTX])return r.apply(this,arguments);if(!(i instanceof TFe.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),r.apply(this,arguments);let a=0,c=0,d=()=>c++,f=()=>a++,m=this[Xee],_=(O=>O.sqlTextOrProcedure==="sp_prepare"&&O.parametersByName?.stmt?.value?O.parametersByName.stmt.value:O.sqlTextOrProcedure)(i),g={};o._dbSemconvStability&ni.SemconvStability.OLD&&(g[gc.ATTR_DB_SYSTEM]=gc.DB_SYSTEM_VALUE_MSSQL,g[gc.ATTR_DB_NAME]=m,g[gc.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,g[gc.ATTR_DB_STATEMENT]=_,g[gc.ATTR_DB_SQL_TABLE]=i.table),o._dbSemconvStability&ni.SemconvStability.STABLE&&(g[Vu.ATTR_DB_NAMESPACE]=m,g[Vu.ATTR_DB_SYSTEM_NAME]=Vu.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,g[Vu.ATTR_DB_QUERY_TEXT]=_,g[Vu.ATTR_DB_COLLECTION_NAME]=i.table),o._netSemconvStability&ni.SemconvStability.OLD&&(g[gc.ATTR_NET_PEER_NAME]=this.config?.server,g[gc.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&ni.SemconvStability.STABLE&&(g[Vu.ATTR_SERVER_ADDRESS]=this.config?.server,g[Vu.ATTR_SERVER_PORT]=this.config?.options?.port);let T=o.tracer.startSpan((0,Wee.getSpanName)(e,m,_,i.table),{kind:Ld.SpanKind.CLIENT,attributes:g}),A=(0,Wee.once)(O=>{i.removeListener("done",d),i.removeListener("doneInProc",d),i.removeListener("doneProc",f),i.removeListener("error",A),this.removeListener("end",A),T.setAttribute("tedious.procedure_count",a),T.setAttribute("tedious.statement_count",c),O&&T.setStatus({code:Ld.SpanStatusCode.ERROR,message:O.message}),T.end()});i.on("done",d),i.on("doneInProc",d),i.on("doneProc",f),i.once("error",A),this.on("end",A),typeof i.callback=="function"?o._wrap(i,"callback",o._patchCallbackQuery(A)):o._diag.error("Expected request.callback to be a function");let R=()=>Ld.context.with(Ld.trace.setSpan(Ld.context.active(),T),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return R();let v=o._buildTraceparent(T);o._injectContextInfo(this,n,v).finally(R)}return Object.defineProperty(s,"length",{value:r.length,writable:!1}),s}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};Ec.TediousInstrumentation=OL});var Jee=y(ER=>{"use strict";p();u();l();Object.defineProperty(ER,"__esModule",{value:!0});ER.TediousInstrumentation=void 0;var SFe=Qee();Object.defineProperty(ER,"TediousInstrumentation",{enumerable:!0,get:function(){return SFe.TediousInstrumentation}})});var Zee,AFe,ete,tte,yFe,nte,rte=S(()=>{p();u();l();Zee=j(Jee(),1);ne();je();AFe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),ete="Tedious",tte=Z(ete,()=>new Zee.TediousInstrumentation({})),yFe=(()=>{let t;return{name:ete,setupOnce(){let e=tte();t=f_(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=ae(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";AFe.has(s)&&n.setAttribute(fe,"auto.db.otel.tedious")}))}}}),nte=yFe});var ote=y(wd=>{"use strict";p();u();l();Object.defineProperty(wd,"__esModule",{value:!0});wd.PACKAGE_NAME=wd.PACKAGE_VERSION=void 0;wd.PACKAGE_VERSION="0.54.0";wd.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var ite=y(TR=>{"use strict";p();u();l();Object.defineProperty(TR,"__esModule",{value:!0});TR.GenericPoolInstrumentation=void 0;var Dd=(U(),D(J)),qu=he(),ste=ote(),CL="generic-pool",PL=class extends qu.InstrumentationBase{_isDisabled=!1;constructor(e={}){super(ste.PACKAGE_NAME,ste.PACKAGE_VERSION,e)}init(){return[new qu.InstrumentationNodeModuleDefinition(CL,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new qu.InstrumentationNodeModuleDefinition(CL,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new qu.InstrumentationNodeModuleDefinition(CL,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,qu.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=Dd.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return Dd.context.with(Dd.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=Dd.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return Dd.context.with(Dd.trace.setSpan(i,a),()=>{e.call(this,(c,d)=>{if(a.end(),o)return o(c,d)},s)})}}};TR.GenericPoolInstrumentation=PL});var ate=y(SR=>{"use strict";p();u();l();Object.defineProperty(SR,"__esModule",{value:!0});SR.GenericPoolInstrumentation=void 0;var RFe=ite();Object.defineProperty(SR,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return RFe.GenericPoolInstrumentation}})});var cte,ute,lte,IFe,pte,dte=S(()=>{p();u();l();cte=j(ate(),1);ne();je();ute="GenericPool",lte=Z(ute,()=>new cte.GenericPoolInstrumentation({})),IFe=(()=>{let t;return{name:ute,setupOnce(){let e=lte();t=f_(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=ae(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(fe,"auto.db.otel.generic_pool")}))}}}),pte=IFe});var xL=y(ri=>{"use strict";p();u();l();Object.defineProperty(ri,"__esModule",{value:!0});ri.ATTR_NET_PEER_PORT=ri.ATTR_NET_PEER_NAME=ri.ATTR_MESSAGING_SYSTEM=ri.ATTR_MESSAGING_OPERATION=void 0;ri.ATTR_MESSAGING_OPERATION="messaging.operation";ri.ATTR_MESSAGING_SYSTEM="messaging.system";ri.ATTR_NET_PEER_NAME="net.peer.name";ri.ATTR_NET_PEER_PORT="net.peer.port"});var vL=y(bt=>{"use strict";p();u();l();Object.defineProperty(bt,"__esModule",{value:!0});bt.ATTR_MESSAGING_CONVERSATION_ID=bt.OLD_ATTR_MESSAGING_MESSAGE_ID=bt.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=bt.ATTR_MESSAGING_URL=bt.ATTR_MESSAGING_PROTOCOL_VERSION=bt.ATTR_MESSAGING_PROTOCOL=bt.MESSAGING_OPERATION_VALUE_PROCESS=bt.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=bt.ATTR_MESSAGING_DESTINATION_KIND=bt.ATTR_MESSAGING_DESTINATION=void 0;bt.ATTR_MESSAGING_DESTINATION="messaging.destination";bt.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";bt.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";bt.MESSAGING_OPERATION_VALUE_PROCESS="process";bt.ATTR_MESSAGING_PROTOCOL="messaging.protocol";bt.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";bt.ATTR_MESSAGING_URL="messaging.url";bt.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";bt.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";bt.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var ML=y(Yu=>{"use strict";p();u();l();Object.defineProperty(Yu,"__esModule",{value:!0});Yu.DEFAULT_CONFIG=Yu.EndOperation=void 0;var NFe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(NFe=Yu.EndOperation||(Yu.EndOperation={}));Yu.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var hte=y(Ot=>{"use strict";p();u();l();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.isConfirmChannelTracing=Ot.unmarkConfirmChannelTracing=Ot.markConfirmChannelTracing=Ot.getConnectionAttributesFromUrl=Ot.getConnectionAttributesFromServer=Ot.normalizeExchange=Ot.CONNECTION_ATTRIBUTES=Ot.CHANNEL_CONSUME_TIMEOUT_TIMER=Ot.CHANNEL_SPANS_NOT_ENDED=Ot.MESSAGE_STORED_SPAN=void 0;var LL=(U(),D(J)),Tc=he(),AR=(Le(),D(Xe)),Ih=xL(),yR=vL();Ot.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Ot.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Ot.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Ot.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var wL=(0,LL.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),bFe=t=>t!==""?t:"<default>";Ot.normalizeExchange=bFe;var OFe=t=>t.replace(/:[^:@/]*@/,":***@"),fte=(t,e)=>t||(e==="AMQP"?5672:5671),mte=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},_te=t=>t||"localhost",oi=(t,e,n,r)=>n?{[e]:n}:(LL.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),CFe=t=>{let e=t.serverProperties.product?.toLowerCase?.();return e?{[Ih.ATTR_MESSAGING_SYSTEM]:e}:{}};Ot.getConnectionAttributesFromServer=CFe;var PFe=(t,e)=>{let n={[yR.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let r=t,o=mte(r?.protocol);Object.assign(n,{...oi(t,yR.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let s=_te(r?.hostname);e&Tc.SemconvStability.OLD&&Object.assign(n,{...oi(t,Ih.ATTR_NET_PEER_NAME,s,"hostname")}),e&Tc.SemconvStability.STABLE&&Object.assign(n,{...oi(t,AR.ATTR_SERVER_ADDRESS,s,"hostname")});let i=fte(r.port,o);e&Tc.SemconvStability.OLD&&Object.assign(n,oi(t,Ih.ATTR_NET_PEER_PORT,i,"port")),e&Tc.SemconvStability.STABLE&&Object.assign(n,oi(t,AR.ATTR_SERVER_PORT,i,"port"))}else{let r=OFe(t);n[yR.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),s=mte(o.protocol);Object.assign(n,{...oi(r,yR.ATTR_MESSAGING_PROTOCOL,s,"protocol")});let i=_te(o.hostname);e&Tc.SemconvStability.OLD&&Object.assign(n,{...oi(r,Ih.ATTR_NET_PEER_NAME,i,"hostname")}),e&Tc.SemconvStability.STABLE&&Object.assign(n,{...oi(r,AR.ATTR_SERVER_ADDRESS,i,"hostname")});let a=fte(o.port?parseInt(o.port):void 0,s);e&Tc.SemconvStability.OLD&&Object.assign(n,oi(r,Ih.ATTR_NET_PEER_PORT,a,"port")),e&Tc.SemconvStability.STABLE&&Object.assign(n,oi(r,AR.ATTR_SERVER_PORT,a,"port"))}catch(o){LL.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Ot.getConnectionAttributesFromUrl=PFe;var xFe=t=>t.setValue(wL,!0);Ot.markConfirmChannelTracing=xFe;var vFe=t=>t.deleteValue(wL);Ot.unmarkConfirmChannelTracing=vFe;var MFe=t=>t.getValue(wL)===!0;Ot.isConfirmChannelTracing=MFe});var gte=y(Ud=>{"use strict";p();u();l();Object.defineProperty(Ud,"__esModule",{value:!0});Ud.PACKAGE_NAME=Ud.PACKAGE_VERSION=void 0;Ud.PACKAGE_VERSION="0.58.0";Ud.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var Tte=y(NR=>{"use strict";p();u();l();Object.defineProperty(NR,"__esModule",{value:!0});NR.AmqplibInstrumentation=void 0;var gt=(U(),D(J)),RR=Be(),$e=he(),LFe=xL(),io=vL(),yr=ML(),Ct=hte(),Ete=gte(),IR=[">=0.5.5 <1"],DL=class extends $e.InstrumentationBase{_netSemconvStability;constructor(e={}){super(Ete.PACKAGE_NAME,Ete.PACKAGE_VERSION,{...yr.DEFAULT_CONFIG,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,$e.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...yr.DEFAULT_CONFIG,...e})}init(){let e=new $e.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",IR,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new $e.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",IR,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new $e.InstrumentationNodeModuleFile("amqplib/lib/connect.js",IR,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new $e.InstrumentationNodeModuleDefinition("amqplib",IR,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,$e.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,$e.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,$e.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,$e.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,$e.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,yr.EndOperation.Ack)),(0,$e.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,yr.EndOperation.Nack)),(0,$e.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,yr.EndOperation.Reject)),(0,$e.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,yr.EndOperation.AckAll)),(0,$e.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,yr.EndOperation.NackAll)),(0,$e.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,$e.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,$e.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,$e.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,$e.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,$e.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,$e.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,$e.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,$e.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,$e.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,$e.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){let n=this;return function(o,s,i){return e.call(this,o,s,function(a,c){if(a==null){let d=(0,Ct.getConnectionAttributesFromUrl)(o,n._netSemconvStability),f=(0,Ct.getConnectionAttributesFromServer)(c);c[Ct.CONNECTION_ATTRIBUTES]={...d,...f}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,yr.EndOperation.ChannelClosed,void 0);let s=this[Ct.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[Ct.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,yr.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,c){let d=this,f=n===yr.EndOperation.Reject?a:c,m=d[Ct.CHANNEL_SPANS_NOT_ENDED]??[],_=m.findIndex(g=>g.msg===i);if(_<0)o.endConsumerSpan(i,e,n,f);else if(n!==yr.EndOperation.Reject&&a){for(let g=0;g<=_;g++)o.endConsumerSpan(m[g].msg,e,n,f);m.splice(0,_+1)}else o.endConsumerSpan(i,e,n,f),m.splice(_,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,Ct.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:f}=r.getConfig();if(f){let m=setInterval(()=>{r.checkConsumeTimeoutOnChannel(c)},f);m.unref(),c[Ct.CHANNEL_CONSUME_TIMEOUT_TIMER]=m}c[Ct.CHANNEL_SPANS_NOT_ENDED]=[]}let d=function(f){if(!f)return i.call(this,f);let m=f.properties.headers??{},_=gt.propagation.extract(gt.ROOT_CONTEXT,m),g=f.fields?.exchange,T;if(r._config.useLinksForConsume){let I=_?gt.trace.getSpan(_)?.spanContext():void 0;_=void 0,I&&(T=[{context:I}])}let A=r.tracer.startSpan(`${s} process`,{kind:gt.SpanKind.CONSUMER,attributes:{...c?.connection?.[Ct.CONNECTION_ATTRIBUTES],[io.ATTR_MESSAGING_DESTINATION]:g,[io.ATTR_MESSAGING_DESTINATION_KIND]:io.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[io.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:f.fields?.routingKey,[LFe.ATTR_MESSAGING_OPERATION]:io.MESSAGING_OPERATION_VALUE_PROCESS,[io.OLD_ATTR_MESSAGING_MESSAGE_ID]:f?.properties.messageId,[io.ATTR_MESSAGING_CONVERSATION_ID]:f?.properties.correlationId},links:T},_),{consumeHook:R}=r.getConfig();R&&(0,$e.safeExecuteInTheMiddle)(()=>R(A,{moduleVersion:e,msg:f}),I=>{I&>.diag.error("amqplib instrumentation: consumerHook error",I)},!0),a?.noAck||(c[Ct.CHANNEL_SPANS_NOT_ENDED].push({msg:f,timeOfConsume:(0,RR.hrTime)()}),f[Ct.MESSAGE_STORED_SPAN]=A);let b=_||gt.ROOT_CONTEXT;gt.context.with(gt.trace.setSpan(b,A),()=>{i.call(this,f)}),a?.noAck&&(r.callConsumeEndHook(A,f,!1,yr.EndOperation.AutoAck),A.end())};return arguments[1]=d,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,c,d){let f=this,{span:m,modifiedOptions:_}=r.createPublishSpan(r,s,i,f,c),{publishHook:g}=r.getConfig();g&&(0,$e.safeExecuteInTheMiddle)(()=>g(m,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:_,isConfirmChannel:!0}),b=>{b&>.diag.error("amqplib instrumentation: publishHook error",b)},!0);let T=function(b,I){try{d?.call(this,b,I)}finally{let{publishConfirmHook:v}=r.getConfig();v&&(0,$e.safeExecuteInTheMiddle)(()=>v(m,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:c,isConfirmChannel:!0,confirmError:b}),O=>{O&>.diag.error("amqplib instrumentation: publishConfirmHook error",O)},!0),b&&m.setStatus({code:gt.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),m.end()}},A=(0,Ct.markConfirmChannelTracing)(gt.context.active()),R=[...arguments];return R[3]=_,R[4]=gt.context.bind((0,Ct.unmarkConfirmChannelTracing)(gt.trace.setSpan(A,m)),T),gt.context.with(A,n.bind(this,...R))}}getPublishPatch(e,n){let r=this;return function(s,i,a,c){if((0,Ct.isConfirmChannelTracing)(gt.context.active()))return n.apply(this,arguments);{let d=this,{span:f,modifiedOptions:m}=r.createPublishSpan(r,s,i,d,c),{publishHook:_}=r.getConfig();_&&(0,$e.safeExecuteInTheMiddle)(()=>_(f,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:m,isConfirmChannel:!1}),A=>{A&>.diag.error("amqplib instrumentation: publishHook error",A)},!0);let g=[...arguments];g[3]=m;let T=n.apply(this,g);return f.end(),T}}}createPublishSpan(e,n,r,o,s){let i=(0,Ct.normalizeExchange)(n),a=e.tracer.startSpan(`publish ${i}`,{kind:gt.SpanKind.PRODUCER,attributes:{...o.connection[Ct.CONNECTION_ATTRIBUTES],[io.ATTR_MESSAGING_DESTINATION]:n,[io.ATTR_MESSAGING_DESTINATION_KIND]:io.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[io.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[io.OLD_ATTR_MESSAGING_MESSAGE_ID]:s?.messageId,[io.ATTR_MESSAGING_CONVERSATION_ID]:s?.correlationId}}),c=s??{};return c.headers=c.headers??{},gt.propagation.inject(gt.trace.setSpan(gt.context.active(),a),c.headers),{span:a,modifiedOptions:c}}endConsumerSpan(e,n,r,o){let s=e[Ct.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:gt.SpanStatusCode.ERROR,message:r!==yr.EndOperation.ChannelClosed&&r!==yr.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[Ct.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){(e[Ct.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(i=>{this.endConsumerSpan(i.msg,n,r,o)}),e[Ct.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,$e.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&>.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){let n=(0,RR.hrTime)(),r=e[Ct.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:s}=this.getConfig();for(o=0;o<r.length;o++){let i=r[o],a=(0,RR.hrTimeDuration)(i.timeOfConsume,n);if((0,RR.hrTimeToMilliseconds)(a)<s)break;this.endConsumerSpan(i.msg,null,yr.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};NR.AmqplibInstrumentation=DL});var Ate=y(Sc=>{"use strict";p();u();l();Object.defineProperty(Sc,"__esModule",{value:!0});Sc.EndOperation=Sc.DEFAULT_CONFIG=Sc.AmqplibInstrumentation=void 0;var wFe=Tte();Object.defineProperty(Sc,"AmqplibInstrumentation",{enumerable:!0,get:function(){return wFe.AmqplibInstrumentation}});var Ste=ML();Object.defineProperty(Sc,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return Ste.DEFAULT_CONFIG}});Object.defineProperty(Sc,"EndOperation",{enumerable:!0,get:function(){return Ste.EndOperation}})});var yte,Rte,DFe,Ite,UFe,Nte,bte=S(()=>{p();u();l();yte=j(Ate(),1);je();Rte="Amqplib",DFe={consumeEndHook:t=>{Ve(t,"auto.amqplib.otel.consumer")},publishHook:t=>{Ve(t,"auto.amqplib.otel.publisher")}},Ite=Z(Rte,()=>new yte.AmqplibInstrumentation(DFe)),UFe=(()=>({name:Rte,setupOnce(){Ite()}})),Nte=UFe});var Nh,UL=S(()=>{p();u();l();Nh="VercelAI"});function jFe(t){if(typeof t!="object"||t===null)return!1;let e=t;return"type"in e&&"error"in e&&"toolName"in e&&"toolCallId"in e&&e.type==="tool-error"&&e.error instanceof Error}function GFe(t){if(typeof t!="object"||t===null||!("content"in t))return;let e=t;if(Array.isArray(e.content)){for(let n of e.content)if(jFe(n)){let r=FP(n.toolCallId);if(r){let o=r.spanContext();Wr(s=>{s.setContext("trace",{trace_id:o.traceId,span_id:o.spanId}),s.setTag("vercel.ai.tool.name",n.toolName),s.setTag("vercel.ai.tool.callId",n.toolCallId),s.setLevel("error"),oe(n.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}),HP(n.toolCallId)}else Wr(o=>{o.setTag("vercel.ai.tool.name",n.toolName),o.setTag("vercel.ai.tool.callId",n.toolCallId),o.setLevel("error"),oe(n.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}}function BFe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var OR,kFe,Ote,bR,Cte=S(()=>{p();u();l();OR=j(he(),1);ne();UL();kFe=[">=3.0.0 <7"],Ote=["generateText","streamText","generateObject","streamObject","embed","embedMany"];bR=class t extends OR.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",Pe,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new OR.InstrumentationNodeModuleDefinition("ai",kFe,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,s,i)=>{let a=i[0].experimental_telemetry||{},c=a.isEnabled,d=F(),f=d?.getIntegrationByName(Nh),m=f?.options,_=f?!!d?.getOptions().sendDefaultPii:!1,{recordInputs:g,recordOutputs:T}=BFe(m,a,c,_);return i[0].experimental_telemetry={...a,isEnabled:c!==void 0?c:!0,recordInputs:g,recordOutputs:T},Qr(()=>Reflect.apply(o,s,i),A=>{A&&typeof A=="object"&&$t(A,"_sentry_active_span",as())},()=>{},A=>{GFe(A)})}});if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of Ote)e[r]=n(e[r]);return e}else{let r=Ote.reduce((o,s)=>(o[s]=n(e[s]),o),{});return{...e,...r}}}}});function $Fe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var Pte,FFe,xte,vte=S(()=>{p();u();l();ne();je();UL();Cte();Pte=Z(Nh,()=>new bR({}));FFe=((t={})=>{let e;return{name:Nh,options:t,setupOnce(){e=Pte()},afterAllSetup(n){t.force??$Fe(n)?sS(n):e?.callWhenPatched(()=>sS(n))}}}),xte=FFe});var PR,HFe,CR,Mte=S(()=>{p();u();l();PR=j(he(),1);ne();HFe=[">=4.0.0 <7"],CR=class extends PR.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",Pe,e)}init(){return new PR.InstrumentationNodeModuleDefinition("openai",HFe,this._patch.bind(this))}_patch(e){let n=e;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(e,n){let r=e[n];if(!r)return e;let o=this.getConfig(),s=function(...i){if(Su(Va))return Reflect.construct(r,i);let a=Reflect.construct(r,i),d=!!F()?.getOptions().sendDefaultPii,f=o.recordInputs??d,m=o.recordOutputs??d;return uS(a,{recordInputs:f,recordOutputs:m})};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}try{e[n]=s}catch{Object.defineProperty(e,n,{value:s,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=s}catch{Object.defineProperty(e,"default",{value:s,writable:!0,configurable:!0,enumerable:!0})}return e}}});var Lte,VFe,wte,Dte=S(()=>{p();u();l();ne();je();Mte();Lte=Z(Va,t=>new CR(t)),VFe=((t={})=>({name:Va,setupOnce(){Lte(t)}})),wte=VFe});var vR,qFe,xR,Ute=S(()=>{p();u();l();vR=j(he(),1);ne();qFe=[">=0.19.2 <1.0.0"],xR=class extends vR.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-anthropic-ai",Pe,e)}init(){return new vR.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",qFe,this._patch.bind(this))}_patch(e){let n=e.Anthropic,r=this.getConfig(),o=function(...s){if(Su(qa))return Reflect.construct(n,s);let i=Reflect.construct(n,s),c=!!F()?.getOptions().sendDefaultPii,d=r.recordInputs??c,f=r.recordOutputs??c;return lS(i,{recordInputs:d,recordOutputs:f})};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}try{e.Anthropic=o}catch{Object.defineProperty(e,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=o}catch{Object.defineProperty(e,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return e}}});var kte,YFe,jte,Gte=S(()=>{p();u();l();ne();je();Ute();kte=Z(qa,t=>new xR(t)),YFe=((t={})=>({name:qa,options:t,setupOnce(){kte(t)}})),jte=YFe});var kd,Bte,MR,$te=S(()=>{p();u();l();kd=j(he(),1);ne();Bte=[">=0.10.0 <2"],MR=class extends kd.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-google-genai",Pe,e)}init(){return new kd.InstrumentationNodeModuleDefinition("@google/genai",Bte,n=>this._patch(n),n=>n,[new kd.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",Bte,n=>this._patch(n),n=>n)])}_patch(e){let n=e.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return e;let o=function(...s){if(Su(Ya))return Reflect.construct(n,s);let i=Reflect.construct(n,s),c=!!F()?.getOptions().sendDefaultPii,d=r,f=d?.recordInputs??c,m=d?.recordOutputs??c;return dS(i,{recordInputs:f,recordOutputs:m})};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}return p_(e,"GoogleGenAI",o),e}}});var Fte,WFe,Hte,Vte=S(()=>{p();u();l();ne();je();$te();Fte=Z(Ya,t=>new MR(t)),WFe=((t={})=>({name:Ya,setupOnce(){Fte(t)}})),Hte=WFe});function KFe(t,e){return t?Array.isArray(t)?t.includes(e)?t:[...t,e]:typeof t=="object"?[t,e]:t:[e]}function zFe(t,e,n){return new Proxy(t,{apply(r,o,s){let a=s[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},s[1]=a);let c=a.callbacks,d=KFe(c,e);return a.callbacks=d,Reflect.apply(r,o,s)}})}var Ac,LR,wR,qte=S(()=>{p();u();l();Ac=j(he(),1);ne();LR=[">=0.1.0 <2.0.0"];wR=class extends Ac.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langchain",Pe,e)}init(){let e=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)e.push(new Ac.InstrumentationNodeModuleDefinition(r,LR,this._patch.bind(this),o=>o,[new Ac.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,LR,this._patch.bind(this),o=>o)]));return e.push(new Ac.InstrumentationNodeModuleDefinition("langchain",LR,this._patch.bind(this),r=>r,[new Ac.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",LR,this._patch.bind(this),r=>r)])),e}_patch(e){hP([Va,qa,Ya]);let r=!!F()?.getOptions().sendDefaultPii,o=this.getConfig(),s=o?.recordInputs??r,i=o?.recordOutputs??r,a=hS({recordInputs:s,recordOutputs:i});return this._patchRunnableMethods(e,a),e}_patchRunnableMethods(e,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=e.universal_exports??e,s=Object.values(o).find(c=>typeof c=="function"&&r.includes(c.name));if(!s)return;let i=s.prototype,a=["invoke","stream","batch"];for(let c of a){let d=i[c];typeof d=="function"&&(i[c]=zFe(d,n))}}}});var Yte,XFe,Wte,Kte=S(()=>{p();u();l();ne();je();qte();Yte=Z(fS,t=>new wR(t)),XFe=((t={})=>({name:fS,setupOnce(){Yte(t)}})),Wte=XFe});var jd,zte,DR,Xte=S(()=>{p();u();l();jd=j(he(),1);ne();zte=[">=0.0.0 <2.0.0"],DR=class extends jd.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langgraph",Pe,e)}init(){return new jd.InstrumentationNodeModuleDefinition("@langchain/langgraph",zte,this._patch.bind(this),n=>n,[new jd.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",zte,this._patch.bind(this),n=>n)])}_patch(e){let r=!!F()?.getOptions().sendDefaultPii,o=this.getConfig(),s=o.recordInputs??r,i=o.recordOutputs??r,a={recordInputs:s,recordOutputs:i};if(e.StateGraph&&typeof e.StateGraph=="function"){let c=e.StateGraph;c.prototype.compile=ES(c.prototype.compile,a)}return e}}});var Qte,QFe,Jte,Zte=S(()=>{p();u();l();ne();je();Xte();Qte=Z(gS,t=>new DR(t)),QFe=((t={})=>({name:gS,setupOnce(){Qte(t)}})),Jte=QFe});function nne(t,e,n,r,o){let i=()=>{},a=o.firestoreSpanCreationHook;typeof a=="function"&&(i=f=>{(0,Xi.safeExecuteInTheMiddle)(()=>a(f),m=>{m&&or.error(m?.message)},!0)});let c=new Xi.InstrumentationNodeModuleDefinition("@firebase/firestore",e,f=>ene(f,n,r,t,i)),d=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let f of d)c.files.push(new Xi.InstrumentationNodeModuleFile(f,e,m=>ene(m,n,r,t,i),m=>rne(m,r)));return c}function ene(t,e,n,r,o){return rne(t,n),e(t,"addDoc",JFe(r,o)),e(t,"getDocs",eHe(r,o)),e(t,"setDoc",tHe(r,o)),e(t,"deleteDoc",ZFe(r,o)),t}function rne(t,e){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Xi.isWrapped)(t[n])&&e(t,n);return t}function JFe(t,e){return function(r){return function(o,s){let i=kR(t,"addDoc",o);return e(i),UR(i,()=>r(o,s))}}}function ZFe(t,e){return function(r){return function(o){let s=kR(t,"deleteDoc",o.parent||o);return e(s),UR(s,()=>r(o))}}}function eHe(t,e){return function(r){return function(o){let s=kR(t,"getDocs",o);return e(s),UR(s,()=>r(o))}}}function tHe(t,e){return function(r){return function(o,s,i){let a=kR(t,"setDoc",o.parent||o);return e(a),UR(a,()=>typeof i<"u"?r(o,s,i):r(o,s))}}}function UR(t,e){return V.with(de.setSpan(V.active(),t),()=>(0,Xi.safeExecuteInTheMiddle)(()=>e(),n=>{n&&t.recordException(n),t.end()},!0))}function kR(t,e,n){let r=t.startSpan(`${e} ${n.path}`,{kind:Ze.CLIENT});return rHe(r,n),r.setAttribute(Ul,e),r}function nHe(t){let e,n;if(typeof t.host=="string")if(t.host.startsWith("[")){if(t.host.endsWith("]"))e=t.host.replace(/^\[|\]$/g,"");else if(t.host.includes("]:")){let r=t.host.lastIndexOf(":");r!==-1&&(e=t.host.slice(1,r).replace(/^\[|\]$/g,""),n=t.host.slice(r+1))}}else if(tne.isIPv6(t.host))e=t.host;else{let r=t.host.lastIndexOf(":");r!==-1?(e=t.host.slice(0,r),n=t.host.slice(r+1)):e=t.host}return{address:e,port:n?parseInt(n,10):void 0}}function rHe(t,e){let n=e.firestore.app,r=n.options,s=(e.firestore.toJSON()||{}).settings||{},i={[rO]:e.path,[Wf]:n.name,[_a]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:a,port:c}=nHe(s);a&&(i[Kf]=a),c&&(i[zf]=c),t.setAttributes(i)}var tne,Xi,one=S(()=>{p();u();l();tne=j(require("node:net"),1);U();Xi=j(he(),1);Le()});function sne(t,e,n,r,o){let s=()=>{},i=()=>{},a=o.functions?.errorHook,c=o.functions?.requestHook,d=o.functions?.responseHook;typeof d=="function"&&(i=(_,g)=>{(0,Qi.safeExecuteInTheMiddle)(()=>d(_,g),T=>{T&&or.error(T?.message)},!0)}),typeof c=="function"&&(s=_=>{(0,Qi.safeExecuteInTheMiddle)(()=>c(_),g=>{g&&or.error(g?.message)},!0)});let f=new Qi.InstrumentationNodeModuleDefinition("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:_,triggerType:g})=>{f.files.push(new Qi.InstrumentationNodeModuleFile(_,e,T=>oHe(T,n,r,t,{requestHook:s,responseHook:i,errorHook:a},g),T=>ine(T,r)))}),f}function Rr(t,e,n){return function(o){return function(...s){let i=typeof s[0]=="function"?s[0]:s[1],a=typeof s[0]=="function"?void 0:s[0];if(!i)return o.call(this,...s);let c=async function(...d){let f=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",m=t.startSpan(`firebase.function.${n}`,{kind:Ze.SERVER}),_={"faas.name":f,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(_["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(_["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),m.setAttributes(_),e?.requestHook?.(m),V.with(de.setSpan(V.active(),m),async()=>{let g,T;try{T=await i.apply(this,d)}catch(A){g=A}if(e?.responseHook?.(m,g),g&&m.recordException(g),m.end(),g)throw await e?.errorHook?.(m,g),g;return T})};return a?o.call(this,a,c):o.call(this,c)}}}function oHe(t,e,n,r,o,s){switch(ine(t,n),s){case"function":e(t,"onRequest",Rr(r,o,"http.request")),e(t,"onCall",Rr(r,o,"http.call"));break;case"firestore":e(t,"onDocumentCreated",Rr(r,o,"firestore.document.created")),e(t,"onDocumentUpdated",Rr(r,o,"firestore.document.updated")),e(t,"onDocumentDeleted",Rr(r,o,"firestore.document.deleted")),e(t,"onDocumentWritten",Rr(r,o,"firestore.document.written")),e(t,"onDocumentCreatedWithAuthContext",Rr(r,o,"firestore.document.created")),e(t,"onDocumentUpdatedWithAuthContext",Rr(r,o,"firestore.document.updated")),e(t,"onDocumentDeletedWithAuthContext",Rr(r,o,"firestore.document.deleted")),e(t,"onDocumentWrittenWithAuthContext",Rr(r,o,"firestore.document.written"));break;case"scheduler":e(t,"onSchedule",Rr(r,o,"scheduler.scheduled"));break;case"storage":e(t,"onObjectFinalized",Rr(r,o,"storage.object.finalized")),e(t,"onObjectArchived",Rr(r,o,"storage.object.archived")),e(t,"onObjectDeleted",Rr(r,o,"storage.object.deleted")),e(t,"onObjectMetadataUpdated",Rr(r,o,"storage.object.metadataUpdated"));break}return t}function ine(t,e){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Qi.isWrapped)(t[r])&&e(t,r);return t}var Qi,ane=S(()=>{p();u();l();U();Qi=j(he(),1)});var une,cne,sHe,iHe,jR,lne=S(()=>{p();u();l();une=j(he(),1);ne();one();ane();cne={},sHe=[">=3.0.0 <5"],iHe=[">=6.0.0 <7"],jR=class extends une.InstrumentationBase{constructor(e=cne){super("@sentry/instrumentation-firebase",Pe,e)}setConfig(e={}){super.setConfig({...cne,...e})}init(){let e=[];return e.push(nne(this.tracer,sHe,this._wrap,this._unwrap,this.getConfig())),e.push(sne(this.tracer,iHe,this._wrap,this._unwrap,this.getConfig())),e}}});var pne,aHe,dne,cHe,fne,mne=S(()=>{p();u();l();ne();je();lne();pne="Firebase",aHe={firestoreSpanCreationHook:t=>{Ve(t,"auto.firebase.otel.firestore"),t.setAttribute(ge,"db.query")},functions:{requestHook:t=>{Ve(t,"auto.firebase.otel.functions"),t.setAttribute(ge,"http.request")},errorHook:async(t,e)=>{e&&(oe(e,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await gu(2e3))}}},dne=Z(pne,()=>new jR(aHe)),cHe=(()=>({name:pne,setupOnce(){dne()}})),fne=cHe});function _ne(){return[YX(),GQ(),d8(),fee(),Z8(),mJ(),bJ(),jJ(),hZ(),kZ(),K7(),cee(),Pee(),Fee(),nte(),pte(),P8(),Nte(),B8(),Wte(),Jte(),xte(),wte(),jte(),Hte(),FZ(),fne()]}var hne=S(()=>{p();u();l();bte();Gte();Hee();WX();FQ();mne();dte();Vte();m8();uee();mee();x8();xee();Kte();Zte();$8();eJ();_J();OJ();GJ();Dte();jZ();HZ();z7();gZ();rte();vte()});function Ene(t,e={}){t.getOptions().debug&&wv();let[n,r]=uHe(t,e);t.traceProvider=n,t.asyncLocalStorageLookup=r}function uHe(t,e={}){let n=new gne.BasicTracerProvider({sampler:new dA(t),resource:(0,GR.defaultResource)().merge((0,GR.resourceFromAttributes)({[Yr]:"node",[nO]:"sentry",[oO]:Pe})),forceFlushTimeoutMillis:500,spanProcessors:[new pA({timeout:lHe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});de.setGlobalTracerProvider(n),sr.setGlobalPropagator(new lA);let r=new RA;return V.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function lHe(t){if(t!=null){if(t>kL)return It&&N.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${kL}`),kL;if(t<=0||Number.isNaN(t)){It&&N.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}var GR,gne,kL,Tne=S(()=>{p();u();l();U();GR=j(Sx(),1),gne=j(qx(),1);Le();ne();je();za();Du();kL=1e6});function Sne(){return PA().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(yX(),vX())}function Ane(t){return[...Sne(),...Ut(t)?_ne():[]]}function jL(t={}){return pHe(t,Ane)}function pHe(t={},e){Au(t,"node");let n=Fv({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(Ene(n,{spanProcessors:t.openTelemetrySpanProcessors}),xA()),n}var yne=S(()=>{p();u();l();ne();je();RX();MX();hne();Tne()});var Ji=S(()=>{p();u();l();yne();ne();je()});var Wu,GL=S(()=>{p();u();l();Wu=class extends Error{response;request;options;constructor(e,n,r){let o=e.status||e.status===0?e.status:"",s=e.statusText??"",i=`${o} ${s}`.trim(),a=i?`status code ${i}`:"an unknown error";super(`Request failed with ${a}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=e,this.request=n,this.options=r}}});var Gd,BL=S(()=>{p();u();l();Gd=class extends Error{name="NonError";value;constructor(e){let n="Non-error value was thrown";try{typeof e=="string"?n=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(n=e.message)}catch{}super(n),this.value=e}}});var Bd,Rne=S(()=>{p();u();l();BL();Bd=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){let n=e?.cause?e.cause instanceof Error?e.cause:new Gd(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}});var $L,Ine,BR,Nne,bne,$R,dHe,One,FR,Cne,HR,bh,Pne,xne,vne,Mne,Ku=S(()=>{p();u();l();$L=(()=>{let t=!1,e=!1,n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return t&&!e})(),Ine=typeof globalThis.AbortController=="function",BR=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nne=typeof globalThis.ReadableStream=="function",bne=typeof globalThis.FormData=="function",$R=["get","post","put","patch","head","delete"],dHe=()=>{};dHe();One={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},FR=2147483647,Cne=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,HR=Symbol("stop"),bh=class{options;constructor(e){this.options=e}},Pne=t=>new bh(t),xne={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},vne={next:!0},Mne={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0}});var fHe,Lne,wne,Dne,Une=S(()=>{p();u();l();Ku();fHe=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[n,r]of t)e+=Cne,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,e+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{let e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},Lne=(t,e,n)=>{let r,o=0;return t.pipeThrough(new TransformStream({transform(s,i){if(i.enqueue(s),r){o+=r.byteLength;let a=e===0?0:o/e;a>=1&&(a=1-Number.EPSILON),n?.({percent:a,totalBytes:Math.max(e,o),transferredBytes:o},r)}r=s},flush(){r&&(o+=r.byteLength,n?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},r))}}))},wne=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});let n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(Lne(t.body,n,e),{status:t.status,statusText:t.statusText,headers:t.headers})},Dne=(t,e,n)=>{if(!t.body)return t;let r=fHe(n??t.body);return new Request(t,{duplex:"half",body:Lne(t.body,r,e)})}});var Rc,kne=S(()=>{p();u();l();Rc=t=>t!==null&&typeof t=="object"});function VR(t,e,n){return Object.hasOwn(e,n)&&e[n]===void 0?[]:VL(t[n]??[],e[n]??[])}var Oh,FL,HL,mHe,VL,qL=S(()=>{p();u();l();Ku();kne();Oh=(...t)=>{for(let e of t)if((!Rc(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return VL({},...t)},FL=(t={},e={})=>{let n=new globalThis.Headers(t),r=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(let[s,i]of o.entries())r&&i==="undefined"||i===void 0?n.delete(s):n.set(s,i);return n};HL=(t={},e={})=>({beforeRequest:VR(t,e,"beforeRequest"),beforeRetry:VR(t,e,"beforeRetry"),afterResponse:VR(t,e,"afterResponse"),beforeError:VR(t,e,"beforeError")}),mHe=(t,e)=>{let n=new URLSearchParams;for(let r of[t,e])if(r!==void 0)if(r instanceof URLSearchParams)for(let[o,s]of r.entries())n.append(o,s);else if(Array.isArray(r))for(let o of r){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(o[0]),String(o[1]))}else if(Rc(r))for(let[o,s]of Object.entries(r))s!==void 0&&n.append(o,String(s));else{let o=new URLSearchParams(r);for(let[s,i]of o.entries())n.append(s,i)}return n},VL=(...t)=>{let e={},n={},r={},o,s=[];for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(Rc(i)){for(let[a,c]of Object.entries(i)){if(a==="signal"&&c instanceof globalThis.AbortSignal){s.push(c);continue}if(a==="context"){if(c!=null&&(!Rc(c)||Array.isArray(c)))throw new TypeError("The `context` option must be an object");e={...e,context:c==null?{}:{...e.context,...c}};continue}if(a==="searchParams"){c==null?o=void 0:o=o===void 0?c:mHe(o,c);continue}Rc(c)&&a in e&&(c=VL(e[a],c)),e={...e,[a]:c}}Rc(i.hooks)&&(r=HL(r,i.hooks),e.hooks=r),Rc(i.headers)&&(n=FL(n,i.headers),e.headers=n)}return o!==void 0&&(e.searchParams=o),s.length>0&&(s.length===1?e.signal=s[0]:BR?e.signal=AbortSignal.any(s):e.signal=s.at(-1)),e.context===void 0&&(e.context={}),e}});var Gne,_He,hHe,gHe,jne,Bne,$ne=S(()=>{p();u();l();Ku();Gne=t=>$R.includes(t)?t.toUpperCase():t,_He=["get","put","head","delete","options","trace"],hHe=[408,413,429,500,502,503,504],gHe=[413,429,503],jne={limit:2,methods:_He,statusCodes:hHe,afterStatusCodes:gHe,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Bne=(t={})=>{if(typeof t=="number")return{...jne,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map(n=>n.toLowerCase()),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");let e=Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0));return{...jne,...e}}});var zu,YL=S(()=>{p();u();l();zu=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}});async function WL(t,e,n,r){return new Promise((o,s)=>{let i=setTimeout(()=>{n&&n.abort(),s(new zu(t))},r.timeout);r.fetch(t,e).then(o).catch(s).then(()=>{clearTimeout(i)})})}var Fne=S(()=>{p();u();l();YL()});async function KL(t,{signal:e}){return new Promise((n,r)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(s),r(e.reason)}let s=setTimeout(()=>{e?.removeEventListener("abort",o),n()},t)})}var Hne=S(()=>{p();u();l()});var Vne,qne,Yne=S(()=>{p();u();l();Ku();Vne=(t,e)=>{let n={};for(let r in e)Object.hasOwn(e,r)&&!(r in Mne)&&!(r in xne)&&(!(r in t)||r in vne)&&(n[r]=e[r]);return n},qne=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t});function Wne(t){return t instanceof Wu||t?.name===Wu.name}function Kne(t){return t instanceof zu||t?.name===zu.name}var zne=S(()=>{p();u();l();GL();YL()});var Ch,Xne=S(()=>{p();u();l();GL();BL();Rne();Une();qL();$ne();Fne();Hne();Yne();zne();Ku();Ch=class t{static create(e,n){let r=new t(e,n),o=async()=>{if(typeof r.#e.timeout=="number"&&r.#e.timeout>FR)throw new RangeError(`The \`timeout\` option cannot be greater than ${FR}`);await Promise.resolve();let i=await r.#_();for(let a of r.#e.hooks.afterResponse){let c=r.#p(i.clone()),d;try{d=await a(r.request,r.#m(),c,{retryCount:r.#o})}catch(m){throw r.#c(c),r.#c(i),m}if(d instanceof bh)throw r.#c(c),r.#c(i),new Bd(d.options);let f=d instanceof globalThis.Response?d:i;c!==f&&r.#c(c),i!==f&&r.#c(i),i=f}if(r.#p(i),!i.ok&&(typeof r.#e.throwHttpErrors=="function"?r.#e.throwHttpErrors(i.status):r.#e.throwHttpErrors)){let a=new Wu(i,r.request,r.#m());for(let c of r.#e.hooks.beforeError)a=await c(a,{retryCount:r.#o});throw a}if(r.#e.onDownloadProgress){if(typeof r.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nne)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let a=i.clone();return r.#c(i),wne(a,r.#e.onDownloadProgress)}return i},s=r.#f(o).finally(()=>{let i=r.#i;r.#d(i?.body??void 0),r.#d(r.request.body??void 0)});for(let[i,a]of Object.entries(One))i==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(s[i]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||a);let c=await s;if(i==="json"){if(c.status===204)return"";let d=await c.text();return d===""?"":n.parseJson?n.parseJson(d):JSON.parse(d)}return c[i]()});return s}static#n(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0)):e}request;#r;#o=0;#t;#e;#i;#s;#u;constructor(e,n={}){if(this.#t=e,this.#e={...n,headers:FL(this.#t.headers,n.headers),hooks:HL({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:Gne(n.method??this.#t.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:Bne(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}Ine&&BR&&(this.#s=this.#e.signal??this.#t.signal,this.#r=new globalThis.AbortController,this.#e.signal=this.#s?AbortSignal.any([this.#s,this.#r.signal]):this.#r.signal),$L&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(bne&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),qne(this.#e.searchParams)){let s="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(t.#n(this.#e.searchParams)).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);this.request=new globalThis.Request(i,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!$L)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#g(this.request,this.#e.body??void 0)}}#a(){let e=this.#e.retry.delay(this.#o),n=e;this.#e.retry.jitter===!0?n=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(e),(!Number.isFinite(n)||n<0)&&(n=e));let r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,n)}async#l(e){if(this.#o++,this.#o>this.#e.retry.limit)throw e;let n=e instanceof Error?e:new Gd(e);if(n instanceof Bd)return n.customDelay??this.#a();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){let r=await this.#e.retry.shouldRetry({error:n,retryCount:this.#o});if(r===!1)throw e;if(r===!0)return this.#a()}if(Kne(e)&&!this.#e.retry.retryOnTimeout)throw e;if(Wne(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;let r=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(r&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let o=Number(r)*1e3;Number.isNaN(o)?o=Date.parse(r)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());let s=this.#e.retry.maxRetryAfter??o;return o<s?o:s}if(e.response.status===413)throw e}return this.#a()}#p(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}#d(e){e&&e.cancel().catch(()=>{})}#c(e){this.#d(e.body??void 0)}async#f(e){try{return await e()}catch(n){let r=Math.min(await this.#l(n),FR);if(this.#o<1)throw n;if(await KL(r,this.#s?{signal:this.#s}:{}),n instanceof Bd&&n.customRequest){let o=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#h(o)}for(let o of this.#e.hooks.beforeRetry){let s=await o({request:this.request,options:this.#m(),error:n,retryCount:this.#o});if(s instanceof globalThis.Request){this.#h(s);break}if(s instanceof globalThis.Response)return s;if(s===HR)return}return this.#f(e)}}async#_(){this.#r?.signal.aborted&&(this.#r=new globalThis.AbortController,this.#e.signal=this.#s?AbortSignal.any([this.#s,this.#r.signal]):this.#r.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(let n of this.#e.hooks.beforeRequest){let r=await n(this.request,this.#m(),{retryCount:this.#o});if(r instanceof Response)return r;if(r instanceof globalThis.Request){this.#h(r);break}}let e=Vne(this.request,this.#e);return this.#i=this.request,this.request=this.#i.clone(),this.#e.timeout===!1?this.#e.fetch(this.#i,e):WL(this.#i,e,this.#r,this.#e)}#m(){if(!this.#u){let{hooks:e,...n}=this.#e;this.#u=Object.freeze(n)}return this.#u}#h(e){this.#u=void 0,this.request=this.#g(e)}#g(e,n){return!this.#e.onUploadProgress||!e.body?e:Dne(e,this.#e.onUploadProgress,n??this.#e.body??void 0)}}});var zL,EHe,Ph,Qne=S(()=>{p();u();l();Xne();Ku();qL();zL=t=>{let e=(n,r)=>Ch.create(n,Oh(t,r));for(let n of $R)e[n]=(r,o)=>Ch.create(r,Oh(t,o,{method:n}));return e.create=n=>zL(Oh(n)),e.extend=n=>(typeof n=="function"&&(n=n(t??{})),zL(Oh(t,n))),e.stop=HR,e.retry=Pne,e},EHe=zL(),Ph=EHe});var ve,XL,Y,si,xh=S(()=>{p();u();l();(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ve||(ve={}));(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(XL||(XL={}));Y=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),si=t=>{switch(typeof t){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return Number.isNaN(t)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":return Array.isArray(t)?Y.array:t===null?Y.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Y.promise:typeof Map<"u"&&t instanceof Map?Y.map:typeof Set<"u"&&t instanceof Set?Y.set:typeof Date<"u"&&t instanceof Date?Y.date:Y.object;default:return Y.unknown}}});var L,THe,Gr,qR=S(()=>{p();u();l();xh();L=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),THe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Gr=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let d=i.path[c];c===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(i))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Gr.create=t=>new Gr(t)});var SHe,Zi,QL=S(()=>{p();u();l();qR();xh();SHe=(t,e)=>{let n;switch(t.code){case L.invalid_type:t.received===Y.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ve.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${ve.joinValues(t.keys,", ")}`;break;case L.invalid_union:n="Invalid input";break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ve.joinValues(t.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${ve.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:n="Invalid function arguments";break;case L.invalid_return_type:n="Invalid function return type";break;case L.invalid_date:n="Invalid date";break;case L.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ve.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case L.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case L.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case L.custom:n="Invalid input";break;case L.invalid_intersection_types:n="Intersection results could not be merged";break;case L.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:n="Number must be finite";break;default:n=e.defaultError,ve.assertNever(t)}return{message:n}},Zi=SHe});function AHe(t){Jne=t}function $d(){return Jne}var Jne,YR=S(()=>{p();u();l();QL();Jne=Zi});function H(t,e){let n=$d(),r=vh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Zi?void 0:Zi].filter(o=>!!o)});t.common.issues.push(r)}var vh,yHe,bn,pe,Xu,qn,WR,KR,Ic,Fd,JL=S(()=>{p();u();l();YR();QL();vh=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(d=>!!d).slice().reverse();for(let d of c)a=d(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},yHe=[];bn=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return pe;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},pe=Object.freeze({status:"aborted"}),Xu=t=>({status:"dirty",value:t}),qn=t=>({status:"valid",value:t}),WR=t=>t.status==="aborted",KR=t=>t.status==="dirty",Ic=t=>t.status==="valid",Fd=t=>typeof Promise<"u"&&t instanceof Promise});var Zne=S(()=>{p();u();l()});var re,ere=S(()=>{p();u();l();(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(re||(re={}))});function ye(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}function ore(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function GHe(t){return new RegExp(`^${ore(t)}$`)}function sre(t){let e=`${rre}T${ore(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function BHe(t,e){return!!((e==="v4"||!e)&&MHe.test(t)||(e==="v6"||!e)&&wHe.test(t))}function $He(t,e){if(!CHe.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function FHe(t,e){return!!((e==="v4"||!e)&&LHe.test(t)||(e==="v6"||!e)&&DHe.test(t))}function HHe(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}function Hd(t){if(t instanceof Br){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Bo.create(Hd(r))}return new Br({...t._def,shape:()=>e})}else return t instanceof na?new na({...t._def,type:Hd(t.element)}):t instanceof Bo?Bo.create(Hd(t.unwrap())):t instanceof ai?ai.create(Hd(t.unwrap())):t instanceof ii?ii.create(t.items.map(e=>Hd(e))):t}function ew(t,e){let n=si(t),r=si(e);if(t===e)return{valid:!0,data:t};if(n===Y.object&&r===Y.object){let o=ve.objectKeys(e),s=ve.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=ew(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===Y.array&&r===Y.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=ew(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===Y.date&&r===Y.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function ire(t,e){return new al({values:t,typeName:me.ZodEnum,...ye(e)})}function nre(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function are(t,e={},n){return t?bc.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=nre(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=nre(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):bc.create()}var $o,tre,Ne,RHe,IHe,NHe,bHe,OHe,CHe,PHe,xHe,vHe,ZL,MHe,LHe,wHe,DHe,UHe,kHe,rre,jHe,Nc,Qu,Ju,Zu,el,Vd,tl,nl,bc,ta,hs,qd,na,Br,rl,ea,zR,ol,ii,XR,Yd,Wd,QR,sl,il,al,cl,Oc,Fo,Bo,ai,ul,ll,Kd,VHe,Mh,Lh,pl,qHe,me,YHe,cre,ure,WHe,KHe,lre,zHe,XHe,QHe,JHe,ZHe,eVe,tVe,nVe,rVe,oVe,sVe,iVe,aVe,cVe,uVe,lVe,pVe,dVe,fVe,mVe,_Ve,hVe,gVe,EVe,TVe,SVe,AVe,yVe,RVe,IVe,NVe,bVe,OVe,CVe,pre=S(()=>{p();u();l();qR();YR();ere();JL();xh();$o=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},tre=(t,e)=>{if(Ic(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Gr(t.common.issues);return this._error=n,this._error}}};Ne=class{get description(){return this._def.description}_getType(e){return si(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:si(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bn,ctx:{common:e.parent.common,data:e.data,parsedType:si(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Fd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)},o=this._parseSync({data:e,path:r.path,parent:r});return tre(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Ic(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Ic(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:si(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(Fd(o)?o:Promise.resolve(o));return tre(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:L.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new Fo({schema:this,typeName:me.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Bo.create(this,this._def)}nullable(){return ai.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return na.create(this)}promise(){return Oc.create(this,this._def)}or(e){return rl.create([this,e],this._def)}and(e){return ol.create(this,e,this._def)}transform(e){return new Fo({...ye(this._def),schema:this,typeName:me.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new ul({...ye(this._def),innerType:this,defaultValue:n,typeName:me.ZodDefault})}brand(){return new Mh({typeName:me.ZodBranded,type:this,...ye(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new ll({...ye(this._def),innerType:this,catchValue:n,typeName:me.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Lh.create(this,e)}readonly(){return pl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RHe=/^c[^\s-]{8,}$/i,IHe=/^[0-9a-z]+$/,NHe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bHe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,OHe=/^[a-z0-9_-]{21}$/i,CHe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PHe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xHe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vHe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",MHe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,LHe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,DHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UHe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,kHe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,rre="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",jHe=new RegExp(`^${rre}$`);Nc=class t extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Y.string){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:Y.string,received:s.parsedType}),pe}let r=new bn,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?H(o,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&H(o,{code:L.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")xHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"email",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")ZL||(ZL=new RegExp(vHe,"u")),ZL.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"emoji",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")bHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"uuid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")OHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"nanoid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")RHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cuid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")IHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cuid2",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")NHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"ulid",code:L.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),H(o,{validation:"url",code:L.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"regex",code:L.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?sre(s).test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?jHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?GHe(s).test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:L.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?PHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"duration",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?BHe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"ip",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?$He(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"jwt",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?FHe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cidr",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?UHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"base64",code:L.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?kHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"base64url",code:L.invalid_string,message:s.message}),r.dirty()):ve.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:L.invalid_string,...re.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...re.errToObj(e)})}url(e){return this._addCheck({kind:"url",...re.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...re.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...re.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...re.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...re.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...re.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...re.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...re.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...re.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...re.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...re.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...re.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...re.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...re.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...re.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...re.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...re.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...re.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...re.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...re.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...re.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...re.errToObj(n)})}nonempty(e){return this.min(1,re.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Nc.create=t=>new Nc({checks:[],typeName:me.ZodString,coerce:t?.coerce??!1,...ye(t)});Qu=class t extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Y.number){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:Y.number,received:s.parsedType}),pe}let r,o=new bn;for(let s of this._def.checks)s.kind==="int"?ve.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:L.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?HHe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:L.not_finite,message:s.message}),o.dirty()):ve.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,re.toString(n))}gt(e,n){return this.setLimit("min",e,!1,re.toString(n))}lte(e,n){return this.setLimit("max",e,!0,re.toString(n))}lt(e,n){return this.setLimit("max",e,!1,re.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:re.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:re.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:re.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ve.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Qu.create=t=>new Qu({checks:[],typeName:me.ZodNumber,coerce:t?.coerce||!1,...ye(t)});Ju=class t extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Y.bigint)return this._getInvalidInput(e);let r,o=new bn;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),H(r,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ve.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return H(n,{code:L.invalid_type,expected:Y.bigint,received:n.parsedType}),pe}gte(e,n){return this.setLimit("min",e,!0,re.toString(n))}gt(e,n){return this.setLimit("min",e,!1,re.toString(n))}lte(e,n){return this.setLimit("max",e,!0,re.toString(n))}lt(e,n){return this.setLimit("max",e,!1,re.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:re.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ju.create=t=>new Ju({checks:[],typeName:me.ZodBigInt,coerce:t?.coerce??!1,...ye(t)});Zu=class extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Y.boolean){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.boolean,received:r.parsedType}),pe}return qn(e.data)}};Zu.create=t=>new Zu({typeName:me.ZodBoolean,coerce:t?.coerce||!1,...ye(t)});el=class t extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Y.date){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_type,expected:Y.date,received:s.parsedType}),pe}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return H(s,{code:L.invalid_date}),pe}let r=new bn,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:L.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:L.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ve.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:re.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:re.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};el.create=t=>new el({checks:[],coerce:t?.coerce||!1,typeName:me.ZodDate,...ye(t)});Vd=class extends Ne{_parse(e){if(this._getType(e)!==Y.symbol){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.symbol,received:r.parsedType}),pe}return qn(e.data)}};Vd.create=t=>new Vd({typeName:me.ZodSymbol,...ye(t)});tl=class extends Ne{_parse(e){if(this._getType(e)!==Y.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.undefined,received:r.parsedType}),pe}return qn(e.data)}};tl.create=t=>new tl({typeName:me.ZodUndefined,...ye(t)});nl=class extends Ne{_parse(e){if(this._getType(e)!==Y.null){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.null,received:r.parsedType}),pe}return qn(e.data)}};nl.create=t=>new nl({typeName:me.ZodNull,...ye(t)});bc=class extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return qn(e.data)}};bc.create=t=>new bc({typeName:me.ZodAny,...ye(t)});ta=class extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return qn(e.data)}};ta.create=t=>new ta({typeName:me.ZodUnknown,...ye(t)});hs=class extends Ne{_parse(e){let n=this._getOrReturnCtx(e);return H(n,{code:L.invalid_type,expected:Y.never,received:n.parsedType}),pe}};hs.create=t=>new hs({typeName:me.ZodNever,...ye(t)});qd=class extends Ne{_parse(e){if(this._getType(e)!==Y.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.void,received:r.parsedType}),pe}return qn(e.data)}};qd.create=t=>new qd({typeName:me.ZodVoid,...ye(t)});na=class t extends Ne{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Y.array)return H(n,{code:L.invalid_type,expected:Y.array,received:n.parsedType}),pe;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(H(n,{code:i?L.too_big:L.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(H(n,{code:L.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(H(n,{code:L.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new $o(n,i,n.path,a)))).then(i=>bn.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new $o(n,i,n.path,a)));return bn.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:re.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:re.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:re.toString(n)}})}nonempty(e){return this.min(1,e)}};na.create=(t,e)=>new na({type:t,minLength:null,maxLength:null,exactLength:null,typeName:me.ZodArray,...ye(e)});Br=class t extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ve.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Y.object){let d=this._getOrReturnCtx(e);return H(d,{code:L.invalid_type,expected:Y.object,received:d.parsedType}),pe}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof hs&&this._def.unknownKeys==="strip"))for(let d in o.data)i.includes(d)||a.push(d);let c=[];for(let d of i){let f=s[d],m=o.data[d];c.push({key:{status:"valid",value:d},value:f._parse(new $o(o,m,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof hs){let d=this._def.unknownKeys;if(d==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(d==="strict")a.length>0&&(H(o,{code:L.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let f of a){let m=o.data[f];c.push({key:{status:"valid",value:f},value:d._parse(new $o(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let d=[];for(let f of c){let m=await f.key,_=await f.value;d.push({key:m,value:_,alwaysSet:f.alwaysSet})}return d}).then(d=>bn.mergeObjectSync(r,d)):bn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return re.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:re.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:me.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of ve.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of ve.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Hd(this)}partial(e){let n={};for(let r of ve.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of ve.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Bo;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return ire(ve.objectKeys(this.shape))}};Br.create=(t,e)=>new Br({shape:()=>t,unknownKeys:"strip",catchall:hs.create(),typeName:me.ZodObject,...ye(e)});Br.strictCreate=(t,e)=>new Br({shape:()=>t,unknownKeys:"strict",catchall:hs.create(),typeName:me.ZodObject,...ye(e)});Br.lazycreate=(t,e)=>new Br({shape:t,unknownKeys:"strip",catchall:hs.create(),typeName:me.ZodObject,...ye(e)});rl=class extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Gr(a.ctx.common.issues));return H(n,{code:L.invalid_union,unionErrors:i}),pe}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let d={...n,common:{...n.common,issues:[]},parent:null},f=c._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Gr(c));return H(n,{code:L.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};rl.create=(t,e)=>new rl({options:t,typeName:me.ZodUnion,...ye(e)});ea=t=>t instanceof sl?ea(t.schema):t instanceof Fo?ea(t.innerType()):t instanceof il?[t.value]:t instanceof al?t.options:t instanceof cl?ve.objectValues(t.enum):t instanceof ul?ea(t._def.innerType):t instanceof tl?[void 0]:t instanceof nl?[null]:t instanceof Bo?[void 0,...ea(t.unwrap())]:t instanceof ai?[null,...ea(t.unwrap())]:t instanceof Mh||t instanceof pl?ea(t.unwrap()):t instanceof ll?ea(t._def.innerType):[],zR=class t extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.object)return H(n,{code:L.invalid_type,expected:Y.object,received:n.parsedType}),pe;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(H(n,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=ea(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:me.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...ye(r)})}};ol=class extends Ne{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(WR(s)||WR(i))return pe;let a=ew(s.value,i.value);return a.valid?((KR(s)||KR(i))&&n.dirty(),{status:n.value,value:a.data}):(H(r,{code:L.invalid_intersection_types}),pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ol.create=(t,e,n)=>new ol({left:t,right:e,typeName:me.ZodIntersection,...ye(n)});ii=class t extends Ne{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.array)return H(r,{code:L.invalid_type,expected:Y.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return H(r,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(H(r,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new $o(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>bn.mergeArray(n,i)):bn.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ii.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ii({items:t,typeName:me.ZodTuple,rest:null,...ye(e)})};XR=class t extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.object)return H(r,{code:L.invalid_type,expected:Y.object,received:r.parsedType}),pe;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new $o(r,a,r.path,a)),value:i._parse(new $o(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?bn.mergeObjectAsync(n,o):bn.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ne?new t({keyType:e,valueType:n,typeName:me.ZodRecord,...ye(r)}):new t({keyType:Nc.create(),valueType:e,typeName:me.ZodRecord,...ye(n)})}},Yd=class extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.map)return H(r,{code:L.invalid_type,expected:Y.map,received:r.parsedType}),pe;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],d)=>({key:o._parse(new $o(r,a,r.path,[d,"key"])),value:s._parse(new $o(r,c,r.path,[d,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let d=await c.key,f=await c.value;if(d.status==="aborted"||f.status==="aborted")return pe;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let d=c.key,f=c.value;if(d.status==="aborted"||f.status==="aborted")return pe;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}}}};Yd.create=(t,e,n)=>new Yd({valueType:e,keyType:t,typeName:me.ZodMap,...ye(n)});Wd=class t extends Ne{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.set)return H(r,{code:L.invalid_type,expected:Y.set,received:r.parsedType}),pe;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(H(r,{code:L.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(H(r,{code:L.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let d=new Set;for(let f of c){if(f.status==="aborted")return pe;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}let a=[...r.data.values()].map((c,d)=>s._parse(new $o(r,c,r.path,d)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:re.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:re.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Wd.create=(t,e)=>new Wd({valueType:t,minSize:null,maxSize:null,typeName:me.ZodSet,...ye(e)});QR=class t extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.function)return H(n,{code:L.invalid_type,expected:Y.function,received:n.parsedType}),pe;function r(a,c){return vh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,$d(),Zi].filter(d=>!!d),issueData:{code:L.invalid_arguments,argumentsError:c}})}function o(a,c){return vh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,$d(),Zi].filter(d=>!!d),issueData:{code:L.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Oc){let a=this;return qn(async function(...c){let d=new Gr([]),f=await a._def.args.parseAsync(c,s).catch(g=>{throw d.addIssue(r(c,g)),d}),m=await Reflect.apply(i,this,f);return await a._def.returns._def.type.parseAsync(m,s).catch(g=>{throw d.addIssue(o(m,g)),d})})}else{let a=this;return qn(function(...c){let d=a._def.args.safeParse(c,s);if(!d.success)throw new Gr([r(c,d.error)]);let f=Reflect.apply(i,this,d.data),m=a._def.returns.safeParse(f,s);if(!m.success)throw new Gr([o(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ii.create(e).rest(ta.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||ii.create([]).rest(ta.create()),returns:n||ta.create(),typeName:me.ZodFunction,...ye(r)})}},sl=class extends Ne{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};sl.create=(t,e)=>new sl({getter:t,typeName:me.ZodLazy,...ye(e)});il=class extends Ne{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return H(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};il.create=(t,e)=>new il({value:t,typeName:me.ZodLiteral,...ye(e)});al=class t extends Ne{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return H(n,{expected:ve.joinValues(r),received:n.parsedType,code:L.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return H(n,{received:n.data,code:L.invalid_enum_value,options:r}),pe}return qn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};al.create=ire;cl=class extends Ne{_parse(e){let n=ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Y.string&&r.parsedType!==Y.number){let o=ve.objectValues(n);return H(r,{expected:ve.joinValues(o),received:r.parsedType,code:L.invalid_type}),pe}if(this._cache||(this._cache=new Set(ve.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ve.objectValues(n);return H(r,{received:r.data,code:L.invalid_enum_value,options:o}),pe}return qn(e.data)}get enum(){return this._def.values}};cl.create=(t,e)=>new cl({values:t,typeName:me.ZodNativeEnum,...ye(e)});Oc=class extends Ne{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.promise&&n.common.async===!1)return H(n,{code:L.invalid_type,expected:Y.promise,received:n.parsedType}),pe;let r=n.parsedType===Y.promise?n.data:Promise.resolve(n.data);return qn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Oc.create=(t,e)=>new Oc({type:t,typeName:me.ZodPromise,...ye(e)});Fo=class extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{H(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return pe;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?pe:c.status==="dirty"?Xu(c.value):n.value==="dirty"?Xu(c.value):c});{if(n.value==="aborted")return pe;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"?Xu(a.value):n.value==="dirty"?Xu(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ic(i))return pe;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Ic(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):pe);ve.assertNever(o)}};Fo.create=(t,e,n)=>new Fo({schema:t,typeName:me.ZodEffects,effect:e,...ye(n)});Fo.createWithPreprocess=(t,e,n)=>new Fo({schema:e,effect:{type:"preprocess",transform:t},typeName:me.ZodEffects,...ye(n)});Bo=class extends Ne{_parse(e){return this._getType(e)===Y.undefined?qn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Bo.create=(t,e)=>new Bo({innerType:t,typeName:me.ZodOptional,...ye(e)});ai=class extends Ne{_parse(e){return this._getType(e)===Y.null?qn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ai.create=(t,e)=>new ai({innerType:t,typeName:me.ZodNullable,...ye(e)});ul=class extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===Y.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ul.create=(t,e)=>new ul({innerType:t,typeName:me.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ye(e)});ll=class extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Fd(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Gr(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Gr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ll.create=(t,e)=>new ll({innerType:t,typeName:me.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ye(e)});Kd=class extends Ne{_parse(e){if(this._getType(e)!==Y.nan){let r=this._getOrReturnCtx(e);return H(r,{code:L.invalid_type,expected:Y.nan,received:r.parsedType}),pe}return{status:"valid",value:e.data}}};Kd.create=t=>new Kd({typeName:me.ZodNaN,...ye(t)});VHe=Symbol("zod_brand"),Mh=class extends Ne{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Lh=class t extends Ne{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"?(n.dirty(),Xu(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:me.ZodPipeline})}},pl=class extends Ne{_parse(e){let n=this._def.innerType._parse(e),r=o=>(Ic(o)&&(o.value=Object.freeze(o.value)),o);return Fd(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};pl.create=(t,e)=>new pl({innerType:t,typeName:me.ZodReadonly,...ye(e)});qHe={object:Br.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(me||(me={}));YHe=(t,e={message:`Input not instance of ${t.name}`})=>are(n=>n instanceof t,e),cre=Nc.create,ure=Qu.create,WHe=Kd.create,KHe=Ju.create,lre=Zu.create,zHe=el.create,XHe=Vd.create,QHe=tl.create,JHe=nl.create,ZHe=bc.create,eVe=ta.create,tVe=hs.create,nVe=qd.create,rVe=na.create,oVe=Br.create,sVe=Br.strictCreate,iVe=rl.create,aVe=zR.create,cVe=ol.create,uVe=ii.create,lVe=XR.create,pVe=Yd.create,dVe=Wd.create,fVe=QR.create,mVe=sl.create,_Ve=il.create,hVe=al.create,gVe=cl.create,EVe=Oc.create,TVe=Fo.create,SVe=Bo.create,AVe=ai.create,yVe=Fo.createWithPreprocess,RVe=Lh.create,IVe=()=>cre().optional(),NVe=()=>ure().optional(),bVe=()=>lre().optional(),OVe={string:(t=>Nc.create({...t,coerce:!0})),number:(t=>Qu.create({...t,coerce:!0})),boolean:(t=>Zu.create({...t,coerce:!0})),bigint:(t=>Ju.create({...t,coerce:!0})),date:(t=>el.create({...t,coerce:!0}))},CVe=pe});var E={};Pn(E,{BRAND:()=>VHe,DIRTY:()=>Xu,EMPTY_PATH:()=>yHe,INVALID:()=>pe,NEVER:()=>CVe,OK:()=>qn,ParseStatus:()=>bn,Schema:()=>Ne,ZodAny:()=>bc,ZodArray:()=>na,ZodBigInt:()=>Ju,ZodBoolean:()=>Zu,ZodBranded:()=>Mh,ZodCatch:()=>ll,ZodDate:()=>el,ZodDefault:()=>ul,ZodDiscriminatedUnion:()=>zR,ZodEffects:()=>Fo,ZodEnum:()=>al,ZodError:()=>Gr,ZodFirstPartyTypeKind:()=>me,ZodFunction:()=>QR,ZodIntersection:()=>ol,ZodIssueCode:()=>L,ZodLazy:()=>sl,ZodLiteral:()=>il,ZodMap:()=>Yd,ZodNaN:()=>Kd,ZodNativeEnum:()=>cl,ZodNever:()=>hs,ZodNull:()=>nl,ZodNullable:()=>ai,ZodNumber:()=>Qu,ZodObject:()=>Br,ZodOptional:()=>Bo,ZodParsedType:()=>Y,ZodPipeline:()=>Lh,ZodPromise:()=>Oc,ZodReadonly:()=>pl,ZodRecord:()=>XR,ZodSchema:()=>Ne,ZodSet:()=>Wd,ZodString:()=>Nc,ZodSymbol:()=>Vd,ZodTransformer:()=>Fo,ZodTuple:()=>ii,ZodType:()=>Ne,ZodUndefined:()=>tl,ZodUnion:()=>rl,ZodUnknown:()=>ta,ZodVoid:()=>qd,addIssueToContext:()=>H,any:()=>ZHe,array:()=>rVe,bigint:()=>KHe,boolean:()=>lre,coerce:()=>OVe,custom:()=>are,date:()=>zHe,datetimeRegex:()=>sre,defaultErrorMap:()=>Zi,discriminatedUnion:()=>aVe,effect:()=>TVe,enum:()=>hVe,function:()=>fVe,getErrorMap:()=>$d,getParsedType:()=>si,instanceof:()=>YHe,intersection:()=>cVe,isAborted:()=>WR,isAsync:()=>Fd,isDirty:()=>KR,isValid:()=>Ic,late:()=>qHe,lazy:()=>mVe,literal:()=>_Ve,makeIssue:()=>vh,map:()=>pVe,nan:()=>WHe,nativeEnum:()=>gVe,never:()=>tVe,null:()=>JHe,nullable:()=>AVe,number:()=>ure,object:()=>oVe,objectUtil:()=>XL,oboolean:()=>bVe,onumber:()=>NVe,optional:()=>SVe,ostring:()=>IVe,pipeline:()=>RVe,preprocess:()=>yVe,promise:()=>EVe,quotelessJson:()=>THe,record:()=>lVe,set:()=>dVe,setErrorMap:()=>AHe,strictObject:()=>sVe,string:()=>cre,symbol:()=>XHe,transformer:()=>TVe,tuple:()=>uVe,undefined:()=>QHe,union:()=>iVe,unknown:()=>eVe,util:()=>ve,void:()=>nVe});var tw=S(()=>{p();u();l();YR();JL();Zne();xh();pre();qR()});var Cc=S(()=>{p();u();l();tw();tw()});var dre,fre,JR,ZR=S(()=>{"use strict";p();u();l();Cc();dre=E.object({orgSlug:E.string(),orgName:E.string(),projectSlug:E.string(),projectName:E.string()}),fre=E.object({dsn:E.string(),projectId:E.string(),orgId:E.string().optional(),source:E.enum(["env","env_file","config","code","inferred"]),sourcePath:E.string().optional(),resolved:dre.optional(),allResolved:E.array(dre).optional(),cachedAt:E.number()}),JR=["packages","apps","libs","services","modules"]});var PVe,mre,_re,xVe,vVe,MVe,hre=S(()=>{"use strict";p();u();l();Cc();ZR();PVe=E.object({orgSlug:E.string(),orgName:E.string(),projectSlug:E.string(),projectName:E.string(),cachedAt:E.number()}),mre=E.object({orgSlug:E.string(),projectSlug:E.string()}),_re=E.object({aliases:E.record(mre),cachedAt:E.number(),dsnFingerprint:E.string().optional()}),xVe=E.object({token:E.string().optional(),refreshToken:E.string().optional(),expiresAt:E.number().optional(),issuedAt:E.number().optional()}),vVe=E.object({organization:E.string().optional(),project:E.string().optional()}),MVe=E.object({auth:xVe.optional(),defaults:vVe.optional(),projectCache:E.record(PVe).optional(),dsnCache:E.record(fre).optional(),projectAliases:_re.optional()})});var nw,eI,tI,gre=S(()=>{"use strict";p();u();l();Cc();nw=E.object({device_code:E.string(),user_code:E.string(),verification_uri:E.string(),verification_uri_complete:E.string().optional(),expires_in:E.number(),interval:E.number()}).passthrough(),eI=E.object({access_token:E.string(),token_type:E.string(),expires_in:E.number(),expires_at:E.string().optional(),refresh_token:E.string().optional(),scope:E.string().optional(),user:E.object({id:E.string(),name:E.string(),email:E.string()}).passthrough().optional()}).passthrough(),tI=E.object({error:E.string(),error_description:E.string().optional()}).passthrough()});function rw(t){return Tre.includes(t)}function wh(t){if(!t.steps)return[];for(let e of t.steps)if(e.key==="root_cause_analysis"&&e.causes)return e.causes;return[]}function VVe(t){for(let e of t)if(e.key==="solution"){let n=Sre.safeParse(e);if(n.success)return n.data}return null}function Ere(t){for(let e of t)if(e.artifacts){let n=VVe(e.artifacts);if(n)return n}return null}function nI(t){let e=t;if(e.blocks){let n=Ere(e.blocks);if(n)return n}if(e.steps){let n=Ere(e.steps);if(n)return n}return null}var Tre,LVe,wVe,DVe,UVe,kVe,jVe,GVe,BVe,P4t,$Ve,FVe,Sre,HVe,x4t,v4t,M4t,L4t,Dh=S(()=>{"use strict";p();u();l();Cc();Tre=["COMPLETED","ERROR","CANCELLED"],LVe=E.object({message:E.string(),timestamp:E.string(),type:E.string().optional()}),wVe=E.object({file_path:E.string(),repo_name:E.string()}),DVe=E.object({title:E.string(),code_snippet_and_analysis:E.string(),is_most_important_event:E.boolean().optional(),relevant_code_file:wVe.optional(),timeline_item_type:E.string().optional()}),UVe=E.object({id:E.number(),description:E.string(),relevant_repos:E.array(E.string()).optional(),reproduction_urls:E.array(E.string()).optional(),root_cause_reproduction:E.array(DVe).optional()}),kVe=E.object({cause_id:E.number(),instruction:E.string().nullable().optional()}),jVe=E.object({id:E.string(),key:E.string(),status:E.string(),title:E.string(),progress:E.array(LVe).optional(),causes:E.array(UVe).optional(),selection:kVe.optional()}).passthrough(),GVe=E.object({integration_id:E.number().optional(),url:E.string().optional(),external_id:E.string(),name:E.string(),provider:E.string().optional(),default_branch:E.string().optional(),is_readable:E.boolean().optional(),is_writeable:E.boolean().optional()}),BVe=E.object({repo_external_id:E.string(),file_changes:E.array(E.unknown()).optional(),is_readable:E.boolean().optional(),is_writeable:E.boolean().optional()}),P4t=E.object({pr_number:E.number().optional(),pr_url:E.string().optional(),repo_name:E.string().optional()}),$Ve=E.object({title:E.string(),description:E.string()}),FVe=E.object({one_line_summary:E.string(),steps:E.array($Ve)}),Sre=E.object({key:E.literal("solution"),data:FVe,reason:E.string().optional()}),HVe=E.object({run_id:E.number(),status:E.string(),updated_at:E.string().optional(),request:E.object({organization_id:E.number().optional(),project_id:E.number().optional(),repos:E.array(E.unknown()).optional()}).optional(),codebases:E.record(E.string(),BVe).optional(),steps:E.array(jVe).optional(),repositories:E.array(GVe).optional(),coding_agents:E.record(E.string(),E.unknown()).optional(),created_at:E.string().optional(),completed_at:E.string().optional()}).passthrough(),x4t=E.object({autofix:HVe.nullable()}),v4t=E.object({type:E.literal("select_root_cause"),cause_id:E.number(),stopping_point:E.enum(["solution","code_changes","open_pr"]).optional()}),M4t=E.object({type:E.literal("select_solution")}),L4t=E.object({type:E.literal("create_pr")})});var Pre={};Pn(Pre,{BreadcrumbSchema:()=>pw,BreadcrumbsEntrySchema:()=>Nre,BrowserContextSchema:()=>dw,DetailedLogsResponseSchema:()=>uI,DetailedSentryLogSchema:()=>gw,DeviceContextSchema:()=>mw,ExceptionEntrySchema:()=>Ire,ExceptionValueSchema:()=>lw,ISSUE_LEVELS:()=>Are,ISSUE_PRIORITIES:()=>yre,ISSUE_STATUSES:()=>iw,ISSUE_SUBSTATUSES:()=>qVe,LOG_SEVERITIES:()=>Cre,LogsResponseSchema:()=>cI,MechanismSchema:()=>uw,OrganizationLinksSchema:()=>sw,OsContextSchema:()=>fw,ProjectKeyDsnSchema:()=>Ore,ProjectKeySchema:()=>aI,RegionSchema:()=>ow,ReleaseSchema:()=>Uh,RepositoryProviderSchema:()=>Tw,RequestEntrySchema:()=>bre,SentryEventSchema:()=>iI,SentryIssueSchema:()=>fl,SentryLogSchema:()=>hw,SentryOrganizationSchema:()=>zd,SentryProjectSchema:()=>dl,SentryRepositorySchema:()=>pI,SentryUserSchema:()=>sI,SpanSchema:()=>Rre,StackFrameSchema:()=>cw,StacktraceSchema:()=>rI,TraceContextSchema:()=>aw,TransactionListItemSchema:()=>Ew,TransactionsResponseSchema:()=>lI,UserGeoSchema:()=>_w,UserRegionsResponseSchema:()=>oI});var ow,oI,sw,zd,sI,dl,iw,Are,yre,qVe,Uh,fl,aw,Rre,cw,rI,uw,lw,Ire,pw,Nre,bre,dw,fw,mw,_w,iI,Ore,aI,Cre,hw,cI,gw,uI,Ew,lI,Tw,pI,Sw=S(()=>{"use strict";p();u();l();Cc();ow=E.object({name:E.string(),url:E.string().url()}),oI=E.object({regions:E.array(ow)}),sw=E.object({organizationUrl:E.string(),regionUrl:E.string()}),zd=E.object({id:E.string(),slug:E.string(),name:E.string(),dateCreated:E.string().optional(),isEarlyAdopter:E.boolean().optional(),require2FA:E.boolean().optional(),avatar:E.object({avatarType:E.string(),avatarUuid:E.string().nullable()}).passthrough().optional(),features:E.array(E.string()).optional(),links:sw.optional()}).passthrough(),sI=E.object({id:E.string(),email:E.string().optional(),username:E.string().optional(),name:E.string().optional()}).passthrough(),dl=E.object({id:E.string(),slug:E.string(),name:E.string(),platform:E.string().nullable().optional(),dateCreated:E.string().optional(),isBookmarked:E.boolean().optional(),isMember:E.boolean().optional(),features:E.array(E.string()).optional(),firstEvent:E.string().nullable().optional(),firstTransactionEvent:E.boolean().optional(),access:E.array(E.string()).optional(),hasAccess:E.boolean().optional(),hasMinifiedStackTrace:E.boolean().optional(),hasMonitors:E.boolean().optional(),hasProfiles:E.boolean().optional(),hasReplays:E.boolean().optional(),hasSessions:E.boolean().optional(),isInternal:E.boolean().optional(),isPublic:E.boolean().optional(),avatar:E.object({avatarType:E.string(),avatarUuid:E.string().nullable()}).passthrough().optional(),color:E.string().optional(),status:E.string().optional(),organization:E.object({id:E.string(),slug:E.string(),name:E.string()}).passthrough().optional()}).passthrough(),iw=["resolved","unresolved","ignored"],Are=["fatal","error","warning","info","debug"],yre=["high","medium","low"],qVe=["ongoing","escalating","regressed","new","archived_until_escalating","archived_until_condition_met","archived_forever"],Uh=E.object({id:E.number().optional(),version:E.string(),shortVersion:E.string().optional(),status:E.string().optional(),dateCreated:E.string().optional(),dateReleased:E.string().nullable().optional(),ref:E.string().nullable().optional(),url:E.string().nullable().optional(),commitCount:E.number().optional(),deployCount:E.number().optional(),authors:E.array(E.unknown()).optional(),projects:E.array(E.object({id:E.union([E.string(),E.number()]),slug:E.string(),name:E.string()}).passthrough()).optional()}).passthrough(),fl=E.object({id:E.string(),shortId:E.string(),title:E.string(),culprit:E.string().optional(),permalink:E.string().optional(),logger:E.string().nullable().optional(),level:E.string().optional(),status:E.enum(iw).optional(),statusDetails:E.record(E.unknown()).optional(),substatus:E.string().optional().nullable(),priority:E.string().optional(),isPublic:E.boolean().optional(),platform:E.string().optional(),project:E.object({id:E.string(),name:E.string(),slug:E.string(),platform:E.string().nullable().optional()}).passthrough().optional(),type:E.string().optional(),metadata:E.object({value:E.string().optional(),type:E.string().optional(),filename:E.string().optional(),function:E.string().optional(),display_title_with_tree_label:E.boolean().optional()}).passthrough().optional(),numComments:E.number().optional(),assignedTo:E.object({id:E.string(),name:E.string(),type:E.string()}).passthrough().nullable().optional(),isBookmarked:E.boolean().optional(),isSubscribed:E.boolean().optional(),subscriptionDetails:E.object({reason:E.string().optional()}).passthrough().nullable().optional(),hasSeen:E.boolean().optional(),annotations:E.array(E.object({displayName:E.string(),url:E.string()}).passthrough()).optional(),isUnhandled:E.boolean().optional(),count:E.string().optional(),userCount:E.number().optional(),firstSeen:E.string().datetime({offset:!0}).optional(),lastSeen:E.string().datetime({offset:!0}).optional(),firstRelease:Uh.nullable().optional(),lastRelease:Uh.nullable().optional()}).passthrough(),aw=E.object({trace_id:E.string().optional(),span_id:E.string().optional(),parent_span_id:E.string().nullable().optional(),op:E.string().optional(),status:E.string().optional(),description:E.string().nullable().optional()}).passthrough(),Rre=E.object({span_id:E.string(),parent_span_id:E.string().nullable().optional(),trace_id:E.string().optional(),op:E.string().optional(),description:E.string().nullable().optional(),start_timestamp:E.number(),timestamp:E.number(),status:E.string().optional(),data:E.record(E.unknown()).optional(),tags:E.record(E.string()).optional()}).passthrough(),cw=E.object({filename:E.string().nullable().optional(),absPath:E.string().nullable().optional(),module:E.string().nullable().optional(),package:E.string().nullable().optional(),platform:E.string().nullable().optional(),function:E.string().nullable().optional(),rawFunction:E.string().nullable().optional(),symbol:E.string().nullable().optional(),lineNo:E.number().nullable().optional(),colNo:E.number().nullable().optional(),inApp:E.boolean().nullable().optional(),context:E.array(E.tuple([E.number(),E.string()])).nullable().optional(),vars:E.record(E.unknown()).nullable().optional(),instructionAddr:E.string().nullable().optional(),symbolAddr:E.string().nullable().optional(),trust:E.string().nullable().optional(),errors:E.array(E.unknown()).nullable().optional()}).passthrough(),rI=E.object({frames:E.array(cw).optional(),framesOmitted:E.array(E.number()).nullable().optional(),registers:E.record(E.string()).nullable().optional(),hasSystemFrames:E.boolean().optional()}).passthrough(),uw=E.object({type:E.string().optional(),handled:E.boolean().optional(),synthetic:E.boolean().optional(),description:E.string().nullable().optional(),data:E.record(E.unknown()).optional()}).passthrough(),lw=E.object({type:E.string().nullable().optional(),value:E.string().nullable().optional(),module:E.string().nullable().optional(),threadId:E.union([E.string(),E.number()]).nullable().optional(),mechanism:uw.nullable().optional(),stacktrace:rI.nullable().optional(),rawStacktrace:rI.nullable().optional()}).passthrough(),Ire=E.object({type:E.literal("exception"),data:E.object({values:E.array(lw).optional(),excOmitted:E.array(E.number()).nullable().optional(),hasSystemFrames:E.boolean().optional()}).passthrough()}),pw=E.object({type:E.string().optional(),category:E.string().nullable().optional(),level:E.string().optional(),message:E.string().nullable().optional(),timestamp:E.string().optional(),event_id:E.string().nullable().optional(),data:E.record(E.unknown()).nullable().optional()}).passthrough(),Nre=E.object({type:E.literal("breadcrumbs"),data:E.object({values:E.array(pw).optional()}).passthrough()}),bre=E.object({type:E.literal("request"),data:E.object({url:E.string().nullable().optional(),method:E.string().nullable().optional(),fragment:E.string().nullable().optional(),query:E.union([E.array(E.tuple([E.string(),E.string()])),E.string(),E.record(E.string())]).nullable().optional(),data:E.unknown().nullable().optional(),headers:E.array(E.tuple([E.string(),E.string()])).nullable().optional(),cookies:E.union([E.array(E.tuple([E.string(),E.string()])),E.record(E.string())]).nullable().optional(),env:E.record(E.string()).nullable().optional(),inferredContentType:E.string().nullable().optional(),apiTarget:E.string().nullable().optional()}).passthrough()}),dw=E.object({name:E.string().optional(),version:E.string().optional(),type:E.literal("browser").optional()}).passthrough(),fw=E.object({name:E.string().optional(),version:E.string().optional(),type:E.literal("os").optional()}).passthrough(),mw=E.object({family:E.string().optional(),model:E.string().optional(),brand:E.string().optional(),type:E.literal("device").optional()}).passthrough(),_w=E.object({country_code:E.string().optional(),city:E.string().optional(),region:E.string().optional()}).passthrough(),iI=E.object({eventID:E.string(),id:E.string().optional(),projectID:E.string().optional(),context:E.record(E.unknown()).optional(),contexts:E.object({trace:aw.optional(),browser:dw.optional(),os:fw.optional(),device:mw.optional()}).passthrough().optional(),dateCreated:E.string().optional(),dateReceived:E.string().optional(),entries:E.array(E.unknown()).optional(),errors:E.array(E.unknown()).optional(),fingerprints:E.array(E.string()).optional(),groupID:E.string().optional(),message:E.string().optional(),metadata:E.record(E.unknown()).optional(),platform:E.string().optional(),location:E.string().nullable().optional(),culprit:E.string().nullable().optional(),sdk:E.object({name:E.string().nullable().optional(),version:E.string().nullable().optional()}).passthrough().nullable().optional(),tags:E.array(E.object({key:E.string(),value:E.string()})).optional(),title:E.string().optional(),type:E.string().optional(),user:E.object({id:E.string().nullable().optional(),email:E.string().nullable().optional(),username:E.string().nullable().optional(),ip_address:E.string().nullable().optional(),name:E.string().nullable().optional(),geo:_w.nullable().optional(),data:E.record(E.unknown()).nullable().optional()}).passthrough().nullable().optional(),release:Uh.nullable().optional(),sdkUpdates:E.array(E.object({type:E.string().optional(),sdkName:E.string().optional(),newSdkVersion:E.string().optional(),sdkUrl:E.string().optional()}).passthrough()).optional()}).passthrough(),Ore=E.object({public:E.string(),secret:E.string().optional()}),aI=E.object({id:E.string(),name:E.string(),dsn:Ore,isActive:E.boolean(),dateCreated:E.string().optional()}).passthrough(),Cre=["fatal","error","warning","warn","info","debug","trace"],hw=E.object({"sentry.item_id":E.string(),timestamp:E.string(),timestamp_precise:E.number(),message:E.string().nullable().optional(),severity:E.string().nullable().optional(),trace:E.string().nullable().optional()}).passthrough(),cI=E.object({data:E.array(hw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),gw=E.object({"sentry.item_id":E.string(),timestamp:E.string(),timestamp_precise:E.number(),message:E.string().nullable().optional(),severity:E.string().nullable().optional(),trace:E.string().nullable().optional(),project:E.string().nullable().optional(),environment:E.string().nullable().optional(),release:E.string().nullable().optional(),"sdk.name":E.string().nullable().optional(),"sdk.version":E.string().nullable().optional(),span_id:E.string().nullable().optional(),"code.function":E.string().nullable().optional(),"code.file.path":E.string().nullable().optional(),"code.line.number":E.string().nullable().optional(),"sentry.otel.kind":E.string().nullable().optional(),"sentry.otel.status_code":E.string().nullable().optional(),"sentry.otel.instrumentation_scope.name":E.string().nullable().optional()}).passthrough(),uI=E.object({data:E.array(gw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),Ew=E.object({trace:E.string(),id:E.string(),transaction:E.string(),timestamp:E.string(),"transaction.duration":E.number(),project:E.string()}).passthrough(),lI=E.object({data:E.array(Ew),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),Tw=E.object({id:E.string(),name:E.string()}),pI=E.object({id:E.string(),name:E.string(),url:E.string().nullable(),provider:Tw,status:E.string(),dateCreated:E.string().optional(),integrationId:E.string().optional(),externalSlug:E.string().nullable().optional(),externalId:E.string().nullable().optional()}).passthrough()});var Aw=S(()=>{"use strict";p();u();l();hre();gre();Dh();Sw()});function ml(){let t=typeof process.versions.bun<"u"?`bun/${process.versions.bun}`:`node/${process.versions.node}`;return`sentry-cli/${hn} (${process.platform}-${process.arch}) ${t}`}var ra,kh,hn,xre,ao=S(()=>{"use strict";p();u();l();ra="sentry.io",kh=`https://${ra}`,hn="0.9.1";xre="https://1188a86f3f8168f089450587b00bca66@o1.ingest.us.sentry.io/4510776311808000"});var YVe,vre,Mre=S(()=>{p();u();l();YVe=globalThis.__bun_sqlite_polyfill,vre=YVe.Database});function WVe(t){return t.query("SELECT value FROM metadata WHERE key = ?").get(wre)?.value==="true"}function yw(t){t.query("INSERT OR REPLACE INTO metadata (key, value) VALUES (?, ?)").run(wre,"true")}function KVe(){let t=(0,dI.join)(oa(),Rw),{existsSync:e}=require("node:fs");return e(t)}function zVe(){let t=(0,dI.join)(oa(),Rw);try{let{readFileSync:e}=require("node:fs"),n=e(t,"utf-8");return JSON.parse(n)}catch{return null}}function XVe(){let t=(0,dI.join)(oa(),Rw);try{return(0,Lre.rmSync)(t),!0}catch(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"?!0:(console.error("Warning: Could not delete old config.json:",e),!1)}}function Dre(t){if(WVe(t))return;if(!KVe()){yw(t);return}let e=zVe();if(!e){yw(t);return}console.error("Migrating config to SQLite..."),t.exec("BEGIN TRANSACTION");try{if(e.auth?.token&&t.query(`
|
|
65
65
|
INSERT OR REPLACE INTO auth (id, token, refresh_token, expires_at, issued_at, updated_at)
|
|
66
66
|
VALUES (1, ?, ?, ?, ?, ?)
|
|
67
67
|
`).run(e.auth.token,e.auth.refreshToken??null,e.auth.expiresAt??null,e.auth.issuedAt??null,Date.now()),(e.defaults?.organization||e.defaults?.project)&&t.query(`
|
|
@@ -693,7 +693,7 @@ Make sure the trace ID is correct and the trace was sent recently.`);let m=iae(s
|
|
|
693
693
|
|
|
694
694
|
Commands:
|
|
695
695
|
list List recent traces in a project
|
|
696
|
-
view View details of a specific trace`,hideRoute:{}}})});var mce={};Pn(mce,{app:()=>I0,routes:()=>pf});var pf,hze,I0,ug=S(()=>{"use strict";p();u();l();Ji();an();Coe();Kse();Uie();ace();fce();wce();d0();zce();g0();Zce();E0();sue();T0();cue();S0();mue();R0();ao();Ge();En();pf=Gt({routes:{help:dce,auth:Wse,cli:Die,org:Jce,project:oue,repo:aue,issue:Lce,event:ice,log:Kce,trace:fue,api:Ooe,issues:fN,orgs:hN,projects:gN,repos:EN,logs:_N,traces:TN},defaultCommand:"help",docs:{brief:"A gh-like CLI for Sentry",fullDescription:"sentry is a command-line interface for interacting with Sentry. It provides commands for authentication, viewing issues, and making API calls."}}),hze={...lb,exceptionWhileRunningCommand:(t,e)=>{if(t instanceof Ie&&t.reason==="not_authenticated")throw t;return oe(t),t instanceof Ir?`${e?Mc("Error:"):"Error:"} ${t.format()}`:t instanceof Error?`Unexpected error: ${t.stack??t.message}`:`Unexpected error: ${String(t)}`}},I0=T1(pf,{name:"sentry",versionInfo:{currentVersion:hn},scanner:{caseStyle:"allow-kebab-for-camel"},determineExitCode:Gh,localization:{loadText:()=>hze}})});var Sze={};Pn(Sze,{default:()=>Tze});module.exports=D(Sze);p();u();l();p();u();l();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="
|
|
696
|
+
view View details of a specific trace`,hideRoute:{}}})});var mce={};Pn(mce,{app:()=>I0,routes:()=>pf});var pf,hze,I0,ug=S(()=>{"use strict";p();u();l();Ji();an();Coe();Kse();Uie();ace();fce();wce();d0();zce();g0();Zce();E0();sue();T0();cue();S0();mue();R0();ao();Ge();En();pf=Gt({routes:{help:dce,auth:Wse,cli:Die,org:Jce,project:oue,repo:aue,issue:Lce,event:ice,log:Kce,trace:fue,api:Ooe,issues:fN,orgs:hN,projects:gN,repos:EN,logs:_N,traces:TN},defaultCommand:"help",docs:{brief:"A gh-like CLI for Sentry",fullDescription:"sentry is a command-line interface for interacting with Sentry. It provides commands for authentication, viewing issues, and making API calls."}}),hze={...lb,exceptionWhileRunningCommand:(t,e)=>{if(t instanceof Ie&&t.reason==="not_authenticated")throw t;return oe(t),t instanceof Ir?`${e?Mc("Error:"):"Error:"} ${t.format()}`:t instanceof Error?`Unexpected error: ${t.stack??t.message}`:`Unexpected error: ${String(t)}`}},I0=T1(pf,{name:"sentry",versionInfo:{currentVersion:hn},scanner:{caseStyle:"allow-kebab-for-camel"},determineExitCode:Gh,localization:{loadText:()=>hze}})});var Sze={};Pn(Sze,{default:()=>Tze});module.exports=D(Sze);p();u();l();p();u();l();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="e1dbcbfd-a9d8-46d0-a27f-9d89154b2fa5",t._sentryDebugIdIdentifier="sentry-dbid-e1dbcbfd-a9d8-46d0-a27f-9d89154b2fa5")}catch{}})();p();u();l();var hue=require("node:tty");an();ug();s0();Ge();En();yD();Es();pg();m0();async function _ue(t){await toe(async e=>Kg(I0,t,o0(process,e)))}async function gze(t){try{await _ue(t)}catch(e){if(e instanceof Ie&&e.reason==="not_authenticated"&&!e.skipAutoAuth&&(0,hue.isatty)(0)){if(process.stderr.write(`Authentication required. Starting login flow...
|
|
697
697
|
|
|
698
698
|
`),await jI(process.stdout,process.stderr,process.stdin)){process.stderr.write(`
|
|
699
699
|
Retrying command...
|